-
Notifications
You must be signed in to change notification settings - Fork 3
/
5-fd5ef347026a0fd2f506.js
2 lines (2 loc) · 365 KB
/
5-fd5ef347026a0fd2f506.js
1
2
webpackJsonp([5,7],{3303:function(e,t,n){"use strict";function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=this.props.getModelDefinitionByName(this.props.params.modelType);return!!("edit"!==e&&"clone"!==e||this.props.getCurrentUser().canUpdate(t))}function l(e){var t=this.props.getModelDefinitionByName(this.props.params.modelType);return!("delete"===e&&!this.props.getCurrentUser().canDelete(t))}function u(e,t){var n=new Set(q.a.for(e)),a=["name","shortName"];return t?t.modelDefinition.getTranslatableProperties().filter(function(e){return n.has(e)}):a}function c(e,t,n){return re[e]&&re[e][t]?re[e][t][n]:n}Object.defineProperty(t,"__esModule",{value:!0}),t.getTranslatablePropertiesForModelType=u;var d=n(0),p=n.n(d),f=n(1),h=n.n(f),m=n(19),y=n.n(m),g=n(735),v=n.n(g),b=n(1311),T=n(1316),E=n(95),S=n.n(E),_=n(3395),C=n(3358),O=n(316),x=n(3496),w=n(446),k=n(734),P=n(322),A=n(728),D=n(3513),R=n(3515),I=n(3514),F=n(1323),N=n(1324),M=n(1322),j=n(1314),L=n(3518),B=n(84),q=n(1306),U=n(3490),H=n(3346),W=n(67),V=n(207),z=n(253),K=n(3356),G=n(3516),Y=(n(3517),n(203)),Q=(n.n(Y),n(723)),$=(n.n(Q),n(315)),X=n(447),Z=n(1319),J=n(3511),ee=n(445),te=n(733),ne=n(3495),ae=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),oe={dataTableWrap:{display:"flex",flexDirection:"column",flex:2},detailsBoxWrap:{flex:1,marginLeft:"1rem",marginRight:"1rem",opacity:1,flexGrow:0},listDetailsWrap:{flex:1,display:"flex",flexOrientation:"row"},filterWrap:{clear:"both",minHeight:80},box:{display:"inline-block",marginRight:16,width:256},topPagination:{float:"right"},bottomPagination:{marginTop:"-2rem",paddingBottom:"0.5rem"},filtersDropDownAsync:{display:"relative"}},re={program:{programType:{WITH_REGISTRATION:"TRACKER_PROGRAM",WITHOUT_REGISTRATION:"EVENT_PROGRAM"}}},ie=function(e){function t(){var e,a,i,s;o(this,t);for(var l=arguments.length,u=Array(l),d=0;d<l;d++)u[d]=arguments[d];return a=i=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),i.state={dataRows:[],pager:{total:0},isLoading:!0,detailsObject:null,sharing:{model:null,open:!1},translation:{model:null,open:!1},orgunitassignment:{model:null,open:!1},dataElementOperand:{model:null,open:!1},predictorDialog:{open:!1}},i.getTranslation=function(e){return i.context.d2.i18n.getTranslation(e)},i.translationSaved=function(){B.a.show({message:"translation_saved",translate:!0})},i.translationError=function(e){y.a.error(e),B.a.show({message:"translation_save_error",action:"ok",translate:!0})},i.isContextActionAllowed=function(e,t){if(!e||!e.access)return!1;if("categoryOptionCombo"===e.modelDefinition.name)return"edit"===t?e.access.write:"details"===t&&e.access.read;if(e.access.hasOwnProperty(t))return e.access[t];if("runNow"===t&&"predictor"===e.modelDefinition.name)return i.context.d2.currentUser.authorities.has("F_PREDICTOR_RUN");switch(t){case"edit":return"locale"!==e.modelDefinition.name&&e.access.write;case"clone":return!["dataSet","program","locale","sqlView","optionSet","icon"].includes(e.modelDefinition.name)&&e.access.write;case"translate":return e.access.read&&e.modelDefinition.identifiableObject&&"sqlView"!==e.modelDefinition.name;case"details":return e.access.read;case"share":return!0===e.modelDefinition.isShareable&&e.access.write;case"compulsoryDataElements":case"sectionForm":case"dataEntryForm":return"dataSet"===e.modelDefinition.name&&e.access.write;case"pdfDataSetForm":return"dataSet"===e.modelDefinition.name&&e.access.read;case"runNow":case"preview":return"pushAnalysis"===e.modelDefinition.name&&e.access.write;case"executeQuery":return"sqlView"===e.modelDefinition.name&&e.access.read&&["MATERIALIZED_VIEW","VIEW"].includes(e.type);case"refresh":return"sqlView"===e.modelDefinition.name&&e.access.read&&"MATERIALIZED_VIEW"===e.type;case"showSqlView":return"sqlView"===e.modelDefinition.name&&e.access.read;default:return!0}},i.searchListByName=function(e){var t=e.subscribe(function(e){i.setState({isLoading:!0}),A.a.searchByName({modelType:i.props.params.modelType,searchString:e}).subscribe(function(){},function(e){return y.a.error(e)})});i.registerDisposable(t)},i.closeTranslationDialog=function(){N.a.setState(Object.assign({},N.a.state,{open:!1}))},i.closeSharingDialog=function(e){var t=n.i(ne.b)(e),a=e?Object.assign(F.a.state.model,{sharing:t}):F.a.state.model;F.a.setState(Object.assign({},F.a.state,{model:a,open:!1}))},i.closeDataElementOperandDialog=function(){M.a.setState(Object.assign({},M.a.state,{open:!1}))},i.renderFilters=function(){var e=function(e){return function(t){i.setState({isLoading:!0}),A.a.setFilterValue({filterField:e,filterValue:t.target.value,modelType:i.props.params.modelType})}};return p.a.createElement("div",null,p.a.createElement(R.a,{initialValue:i.state.searchString,searchObserverHandler:i.searchListByName}),n.i(z.d)(i.props.params.modelType).map(function(t){var n=i.context.d2.models[i.props.params.modelType],a=n.modelProperties.hasOwnProperty(t)&&n.modelProperties[t].hasOwnProperty("constants"),o=a&&n.modelProperties[t].constants.map(function(e){return{text:c(i.props.params.modelType,t,e),value:e}}),r=i.context.d2.models.hasOwnProperty(t)?t:i.props.params.modelType+"."+t;return p.a.createElement("div",{key:t,style:oe.box},a?p.a.createElement(W.a,{labelText:i.getTranslation(t),options:o,onChange:e(t),value:i.state.filters?i.state.filters[t]:null,translateOptions:"periodType"!==t}):p.a.createElement(V.a,{labelText:i.getTranslation(t),referenceType:r,onChange:e(t),value:i.state.filters?i.state.filters[t]:null,quickAddLink:!1,preventAutoDefault:!0,style:oe.filterDrowDownAsync,limit:1,top:-15}))}))},s=a,r(i,s)}return i(t,e),ae(t,[{key:"componentWillMount",value:function(){var e=this;this.observerDisposables=[];var t=P.a.subscribe(function(t){if(!v()(t.list)||t.modelType!==e.props.params.modelType)return void e.setState({isLoading:!0});A.a.hideDetailsBox(),e.setState({dataRows:t.list,pager:t.pager,tableColumns:t.tableColumns,filters:t.filters,isLoading:!1,searchString:t.searchString,modelDefinition:t.modelDefinition})}),n=k.a.subscribe(function(t){e.setState({detailsObject:t})}),a=F.a.subscribe(function(t){e.setState(function(e){return{sharing:t,dataRows:e.dataRows.map(function(e){return e.id===t.model.id?Object.assign(e,{sharing:t.model.sharing}):e})}})}),o=N.a.subscribe(function(t){e.setState({translation:t})}),r=M.a.subscribe(function(t){e.setState({dataElementOperand:t})}),i=j.a.subscribe(function(t){e.setState({predictorDialog:t})});this.registerDisposable(t),this.registerDisposable(n),this.registerDisposable(a),this.registerDisposable(o),this.registerDisposable(r),this.registerDisposable(i)}},{key:"componentWillReceiveProps",value:function(e){this.props.params.modelType!==e.params.modelType&&this.setState({isLoading:!0,translation:Object.assign({},this.state.translation,{open:!1})})}},{key:"componentWillUnmount",value:function(){this.observerDisposables.forEach(function(e){return e.unsubscribe()})}},{key:"registerDisposable",value:function(e){this.observerDisposables.push(e)}},{key:"renderContextMenuHeader",value:function(){var e=this,t=this.state.modelDefinition,n=t.filters.getQueryFilterValues(),a={name:t.name,pluralName:t.plural,queryParamFilters:n,objectCount:this.state.pager.total},o=[{title:this.getTranslation("manage_columns"),icon:"view_column",action:this.props.openColumnsDialog},{title:this.getTranslation("download"),icon:"get_app",action:function(){return e.props.openDialog(te.a,a)}}];return p.a.createElement(J.a,{actions:o})}},{key:"render",value:function(){var e=this,t=n.i(U.a)(this.state.pager),o={hasNextPage:function(){return Boolean(e.state.pager.hasNextPage)&&e.state.pager.hasNextPage()},hasPreviousPage:function(){return Boolean(e.state.pager.hasPreviousPage)&&e.state.pager.hasPreviousPage()},onNextPageClick:function(){e.setState({isLoading:!0}),A.a.getNextPage()},onPreviousPageClick:function(){e.setState({isLoading:!0}),A.a.getPreviousPage()},total:this.state.pager.total,currentlyShown:t},r=Object.keys(w.a).filter(s,this).filter(l,this).filter(function(t){return"share"!==t||e.context.d2.models[e.props.params.modelType]&&e.context.d2.models[e.props.params.modelType].isShareable}).reduce(function(e,t){return e[t]=w.a[t],e},{}),i={clone:"content_copy",sharing:"share",sectionForm:"assignment_turned_in",dataEntryForm:"assignment",pdfDataSetForm:"picture_as_pdf",compulsoryDataElements:"border_color",runNow:"queue_play_next",preview:"dashboard",executeQuery:"playlist_play",refresh:"refresh",showSqlView:"view_module"},d=function(t){return e.state.tableColumns.reduce(function(e,n){if(n.includes("___")){var o=n.substr(0,n.indexOf("___")),r=n.substr(n.indexOf("___")+3);Object.assign(e,a({},n,t&&t[o]?t[o][r]:""))}return e},t),t},f=function(t){return t.categoryCombo&&t.categoryCombo.displayName&&"default"===t.categoryCombo.displayName&&t.categoryCombo___displayName===t.categoryCombo.displayName&&(t.categoryCombo___displayName=e.getTranslation("none"),t.categoryCombo.displayName=e.getTranslation("none")),t},h=function(t){var n={organisationUnit:["level"],dataSet:["formType"]},a=function(e,t){return!(n.hasOwnProperty(e)&&n[e].includes(t))};return t.noMoreGottaTranslateCauseIsDone?t:e.state.tableColumns.reduce(function(n,o){return a(t.modelDefinition.name,o)&&t&&t.modelDefinition&&t.modelDefinition.modelProperties[o]&&t.modelDefinition.modelProperties[o].constants&&(t.noMoreGottaTranslateCauseIsDone=!0,t[o]&&(n[o]=e.getTranslation(c(t.modelDefinition.name,o,t[o]).toLowerCase()))),n},t)},m=function(e){return e.sharing&&(e.publicAccess=e.sharing.public||"--------"),e},y=function(e){if(e.access.write&&"locale"!==e.modelDefinition.name)r.edit(e);else{var t="locale"===e.modelDefinition.name?"locales_can_only_be_created_and_deleted":"you_do_not_have_permissions_to_edit_this_object";B.a.show({message:t,translate:!0,action:"dismiss"})}};return p.a.createElement("div",null,p.a.createElement("div",null,p.a.createElement(O.a,null,this.getTranslation(S()(this.props.params.modelType)+"_management"),p.a.createElement(H.a,{schema:this.props.params.modelType})),p.a.createElement(D.a,{modelType:this.props.params.modelType,groupName:this.props.params.groupName})),p.a.createElement("div",{style:oe.filterWrap},p.a.createElement("div",{style:oe.topPagination},p.a.createElement(T.a,o)),this.renderFilters()),p.a.createElement(I.a,{loadingText:["Loading",this.props.params.modelType,"list..."].join(" "),isLoading:this.state.isLoading}),this.state.isLoading?p.a.createElement("div",null,"Loading..."):p.a.createElement("div",{style:oe.listDetailsWrap},p.a.createElement("div",{style:oe.dataTableWrap},this.state.dataRows&&this.state.dataRows.length?p.a.createElement(b.a,{rows:this.state.dataRows.map(d).map(f).map(h).map(m),columns:this.state.tableColumns,contextMenuActions:r,contextMenuIcons:i,primaryAction:y,isContextActionAllowed:this.isContextActionAllowed,contextMenuHeader:this.renderContextMenuHeader()}):p.a.createElement("div",null,this.getTranslation("no_results_found"))),!!this.state.detailsObject&&p.a.createElement(x.a,{style:oe.detailsBoxWrap,detailsObject:this.state.detailsObject,onClose:A.a.hideDetailsBox})),!!this.state.dataRows&&!!this.state.dataRows.length&&p.a.createElement("div",{style:oe.bottomPagination},p.a.createElement(T.a,o)),!!this.state.sharing.model&&p.a.createElement(_.a,{d2:this.context.d2,id:this.state.sharing.model.id,type:this.props.params.modelType,open:this.state.sharing.model&&this.state.sharing.open,onRequestClose:this.closeSharingDialog,bodyStyle:{minHeight:"400px"}}),!!this.state.translation.model&&p.a.createElement(C.a,{objectToTranslate:this.state.translation.model,objectTypeToTranslate:this.state.translation.model&&this.state.translation.model.modelDefinition,open:this.state.translation.open,onTranslationSaved:this.translationSaved,onTranslationError:this.translationError,onRequestClose:this.closeTranslationDialog,fieldsToTranslate:u(this.props.params.modelType,this.state.translation.model)}),p.a.createElement(G.a,{model:this.state.dataElementOperand.model,dataElementOperands:this.state.dataElementOperand.dataElementOperands,open:this.state.dataElementOperand.open,onRequestClose:this.closeDataElementOperandDialog}),this.state.predictorDialog&&p.a.createElement(L.a,null),p.a.createElement(Z.a,{groupName:this.props.params.groupName,modelType:this.props.params.modelType}))}}]),t}(d.Component);ie.propTypes={params:h.a.shape({modelType:h.a.string.isRequired,groupName:h.a.string.isRequired}).isRequired},ie.contextTypes={d2:h.a.object.isRequired};var se={openColumnsDialog:X.a,openDialog:ee.a};t.default=n.i($.a)(null,se)(n.i(K.a)(ie))},3308:function(e,t,n){"use strict";function a(e){return"WITH_REGISTRATION"===e.model.programType?i.a.createElement(p.a,e):i.a.createElement(d.a,e)}Object.defineProperty(t,"__esModule",{value:!0});var o=n(315),r=n(0),i=n.n(r),s=n(250),l=n(722),u=n.n(l),c=n(318),d=n(3869),p=n(3889),f=n(325),h=n(249),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},y=function(e){return{isLoading:e.eventProgram.step.isLoading,isProgramStageStepperActive:n.i(h.a)(e)}},g=n.i(s.b)(n.i(o.a)(y),u()(function(e){return e.combineLatest(c.a,function(e,t){return m({},e,{model:t.program})})}),function(e){return n.i(s.e)(e,n.i(s.f)(f.a))}(function(e){return e.isLoading}));t.default=g(a)},3318:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={easeOutFunction:"cubic-bezier(0.23, 1, 0.32, 1)",easeInOutFunction:"cubic-bezier(0.445, 0.05, 0.55, 0.95)",easeOut:function(e,t,n,a){if(a=a||this.easeOutFunction,t&&"[object Array]"===Object.prototype.toString.call(t)){for(var o="",r=0;r<t.length;r++)o&&(o+=","),o+=this.create(e,t[r],n,a);return o}return this.create(e,t,n,a)},create:function(e,t,n,a){return e=e||"450ms",t=t||"all",n=n||"0ms",a=a||"linear",t+" "+e+" "+a+" "+n}}},3319:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1),o=function(e){return e&&e.__esModule?e:{default:e}}(a),r=o.default.oneOf(["left","middle","right"]),i=o.default.oneOf(["top","center","bottom"]);t.default={corners:o.default.oneOf(["bottom-left","bottom-right","top-left","top-right"]),horizontal:r,vertical:i,origin:o.default.shape({horizontal:r,vertical:i}),cornersAndCenter:o.default.oneOf(["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"]),stringOrNumber:o.default.oneOfType([o.default.string,o.default.number]),zDepth:o.default.oneOf([0,1,2,3,4,5])}},3323:function(e,t,n){"use strict";t.__esModule=!0;var a=n(114),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3325:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3454),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3329:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(){if(!F){var e=document.createElement("style");e.innerHTML="\n button::-moz-focus-inner,\n input::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n ",document.body.appendChild(e),F=!0}}function r(){N||(w.default.on(window,"keydown",function(e){M="tab"===(0,P.default)(e)}),N=!0)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),s=a(i),l=n(8),u=a(l),c=n(6),d=a(c),p=n(2),f=a(p),h=n(3),m=a(h),y=n(5),g=a(y),v=n(4),b=a(v),T=n(9),E=a(T),S=n(0),_=a(S),C=n(1),O=a(C),x=n(3369),w=a(x),k=n(35),P=a(k),A=n(3473),D=a(A),R=n(3478),I=a(R),F=!1,N=!1,M=!1,j=function(e){function t(){var e,n,a,o;(0,f.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,g.default)(this,(e=t.__proto__||(0,d.default)(t)).call.apply(e,[this].concat(i))),a.state={isKeyboardFocused:!1},a.handleKeyDown=function(e){a.props.disabled||a.props.disableKeyboardFocus||("enter"===(0,P.default)(e)&&a.state.isKeyboardFocused&&a.handleTouchTap(e),"esc"===(0,P.default)(e)&&a.state.isKeyboardFocused&&a.removeKeyboardFocus(e)),a.props.onKeyDown(e)},a.handleKeyUp=function(e){a.props.disabled||a.props.disableKeyboardFocus||"space"===(0,P.default)(e)&&a.state.isKeyboardFocused&&a.handleTouchTap(e),a.props.onKeyUp(e)},a.handleBlur=function(e){a.cancelFocusTimeout(),a.removeKeyboardFocus(e),a.props.onBlur(e)},a.handleFocus=function(e){e&&e.persist(),a.props.disabled||a.props.disableKeyboardFocus||(a.focusTimeout=setTimeout(function(){M&&(a.setKeyboardFocus(e),M=!1)},150),a.props.onFocus(e))},a.handleTouchTap=function(e){a.cancelFocusTimeout(),a.props.disabled||(M=!1,a.removeKeyboardFocus(e),a.props.onClick(e))},o=n,(0,g.default)(a,o)}return(0,b.default)(t,e),(0,m.default)(t,[{key:"componentWillMount",value:function(){var e=this.props,t=e.disabled,n=e.disableKeyboardFocus,a=e.keyboardFocused;t||!a||n||this.setState({isKeyboardFocused:!0})}},{key:"componentDidMount",value:function(){o(),r(),this.state.isKeyboardFocused&&(this.button.focus(),this.props.onKeyboardFocus(null,!0))}},{key:"componentWillReceiveProps",value:function(e){(e.disabled||e.disableKeyboardFocus)&&this.state.isKeyboardFocused&&(this.setState({isKeyboardFocused:!1}),e.onKeyboardFocus&&e.onKeyboardFocus(null,!1))}},{key:"componentWillUnmount",value:function(){this.focusTimeout&&clearTimeout(this.focusTimeout)}},{key:"isKeyboardFocused",value:function(){return this.state.isKeyboardFocused}},{key:"removeKeyboardFocus",value:function(e){this.state.isKeyboardFocused&&(this.setState({isKeyboardFocused:!1}),this.props.onKeyboardFocus(e,!1))}},{key:"setKeyboardFocus",value:function(e){this.state.isKeyboardFocused||(this.setState({isKeyboardFocused:!0}),this.props.onKeyboardFocus(e,!0))}},{key:"cancelFocusTimeout",value:function(){this.focusTimeout&&(clearTimeout(this.focusTimeout),this.focusTimeout=null)}},{key:"createButtonChildren",value:function(){var e=this.props,t=e.centerRipple,n=e.children,a=e.disabled,o=e.disableFocusRipple,r=e.disableKeyboardFocus,i=e.disableTouchRipple,s=e.focusRippleColor,l=e.focusRippleOpacity,u=e.touchRippleColor,c=e.touchRippleOpacity,d=this.state.isKeyboardFocused,p=!d||a||o||r?void 0:_.default.createElement(D.default,{color:s,opacity:l,show:d,style:{overflow:"hidden"},key:"focusRipple"}),f=a||i?void 0:_.default.createElement(I.default,{centerRipple:t,color:u,opacity:c,key:"touchRipple"},n);return[p,f,f?void 0:n]}},{key:"render",value:function(){var e=this,t=this.props,n=(t.centerRipple,t.children),a=t.containerElement,o=t.disabled,r=(t.disableFocusRipple,t.disableKeyboardFocus),i=(t.disableTouchRipple,t.focusRippleColor,t.focusRippleOpacity,t.href),l=(t.keyboardFocused,t.touchRippleColor,t.touchRippleOpacity,t.onBlur,t.onClick,t.onFocus,t.onKeyUp,t.onKeyDown,t.onKeyboardFocus,t.style),c=t.tabIndex,d=t.type,p=(0,u.default)(t,["centerRipple","children","containerElement","disabled","disableFocusRipple","disableKeyboardFocus","disableTouchRipple","focusRippleColor","focusRippleOpacity","href","keyboardFocused","touchRippleColor","touchRippleOpacity","onBlur","onClick","onFocus","onKeyUp","onKeyDown","onKeyboardFocus","style","tabIndex","type"]),f=this.context.muiTheme,h=f.prepareStyles,m=f.enhancedButton,y=(0,E.default)({border:10,boxSizing:"border-box",display:"inline-block",fontFamily:this.context.muiTheme.baseTheme.fontFamily,WebkitTapHighlightColor:m.tapHighlightColor,cursor:o?"default":"pointer",textDecoration:"none",margin:0,padding:0,outline:"none",fontSize:"inherit",fontWeight:"inherit",position:"relative",verticalAlign:i?"middle":null},l);if(y.backgroundColor||y.background||(y.background="none"),o&&i)return _.default.createElement("span",(0,s.default)({},p,{style:y}),n);var g=(0,s.default)({},p,{style:h(y),ref:function(t){return e.button=t},disabled:o,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyUp:this.handleKeyUp,onKeyDown:this.handleKeyDown,onClick:this.handleTouchTap,tabIndex:o||r?-1:c});i&&(g.href=i);var v=this.createButtonChildren();return _.default.isValidElement(a)?_.default.cloneElement(a,g,v):(i||"button"!==a||(g.type=d),_.default.createElement(i?"a":a,g,v))}}]),t}(S.Component);j.defaultProps={containerElement:"button",onBlur:function(){},onClick:function(){},onFocus:function(){},onKeyDown:function(){},onKeyUp:function(){},onKeyboardFocus:function(){},tabIndex:0,type:"button"},j.contextTypes={muiTheme:O.default.object.isRequired},j.propTypes={},t.default=j},3335:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3444),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3336:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3449),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3337:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3453),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3338:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(14),O=a(C),x=n(721),w=a(x),k=n(3367),P=a(k),A=n(3319),D=(a(A),n(3325)),R=a(D),I=n(730),F=a(I),N=n(3455),M=a(N),j={root:{display:"none"}},L=function(e){function t(e,n){(0,d.default)(this,t);var a=(0,m.default)(this,(t.__proto__||(0,u.default)(t)).call(this,e,n));return a.timeout=null,a.renderLayer=function(){var e=a.props,t=e.animated,n=e.animation,o=(e.anchorEl,e.anchorOrigin,e.autoCloseWhenOffScreen,e.canAutoPosition,e.children),i=(e.onRequestClose,e.style),l=e.targetOrigin,u=(e.useLayerForClickAway,e.scrollableContainer,(0,s.default)(e,["animated","animation","anchorEl","anchorOrigin","autoCloseWhenOffScreen","canAutoPosition","children","onRequestClose","style","targetOrigin","useLayerForClickAway","scrollableContainer"])),c=i;if(!t)return c={position:"fixed",zIndex:a.context.muiTheme.zIndex.popover},a.state.open?E.default.createElement(R.default,(0,r.default)({style:(0,b.default)(c,i)},u),o):null;var d=n||M.default;return E.default.createElement(d,(0,r.default)({targetOrigin:l,style:c},u,{open:a.state.open&&!a.state.closing}),o)},a.componentClickAway=function(){a.requestClose("clickAway")},a.setPlacement=function(e){if(a.state.open&&a.popoverRefs.layer.getLayer()){var t=a.popoverRefs.layer.getLayer().children[0];if(t){var n=a.props,o=n.targetOrigin,r=n.anchorOrigin,i=a.props.anchorEl||a.anchorEl,s=a.getAnchorPosition(i),l=a.getTargetPosition(t),u={top:s[r.vertical]-l[o.vertical],left:s[r.horizontal]-l[o.horizontal]};e&&a.props.autoCloseWhenOffScreen&&a.autoCloseWhenOffScreen(s),a.props.canAutoPosition&&(l=a.getTargetPosition(t),u=a.applyAutoPositionIfNeeded(s,l,o,r,u)),t.style.top=u.top+"px",t.style.left=u.left+"px",t.style.maxHeight=window.innerHeight+"px"}}},a.handleResize=(0,F.default)(a.setPlacement,100),a.handleScroll=(0,F.default)(a.setPlacement.bind(a,!0),50),a.popoverRefs={},a.state={open:e.open,closing:!1},a}return(0,g.default)(t,e),(0,f.default)(t,[{key:"componentDidMount",value:function(){this.placementTimeout=setTimeout(this.setPlacement)}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(e.open!==this.props.open)if(e.open)clearTimeout(this.timeout),this.timeout=null,this.anchorEl=e.anchorEl||this.props.anchorEl,this.setState({open:!0,closing:!1});else if(e.animated){if(null!==this.timeout)return;this.setState({closing:!0}),this.timeout=setTimeout(function(){t.setState({open:!1},function(){t.timeout=null})},500)}else this.setState({open:!1})}},{key:"componentDidUpdate",value:function(){clearTimeout(this.placementTimeout),this.placementTimeout=setTimeout(this.setPlacement)}},{key:"componentWillUnmount",value:function(){this.handleResize.cancel(),this.handleScroll.cancel(),this.placementTimeout&&(clearTimeout(this.placementTimeout),this.placementTimeout=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}},{key:"requestClose",value:function(e){this.props.onRequestClose&&this.props.onRequestClose(e)}},{key:"getAnchorPosition",value:function(e){e||(e=O.default.findDOMNode(this));var t=e.getBoundingClientRect(),n={top:t.top,left:t.left,width:e.offsetWidth,height:e.offsetHeight};return n.right=t.right||n.left+n.width,n.bottom=t.bottom||n.top+n.height,n.middle=n.left+(n.right-n.left)/2,n.center=n.top+(n.bottom-n.top)/2,n}},{key:"getTargetPosition",value:function(e){return{top:0,center:e.offsetHeight/2,bottom:e.offsetHeight,left:0,middle:e.offsetWidth/2,right:e.offsetWidth}}},{key:"autoCloseWhenOffScreen",value:function(e){(e.top<0||e.top>window.innerHeight||e.left<0||e.left>window.innerWidth)&&this.requestClose("offScreen")}},{key:"getOverlapMode",value:function(e,t,n){return[e,t].indexOf(n)>=0?"auto":e===t?"inclusive":"exclusive"}},{key:"getPositions",value:function(e,t){var n=(0,r.default)({},e),a=(0,r.default)({},t),o={x:["left","right"].filter(function(e){return e!==a.horizontal}),y:["top","bottom"].filter(function(e){return e!==a.vertical})},i={x:this.getOverlapMode(n.horizontal,a.horizontal,"middle"),y:this.getOverlapMode(n.vertical,a.vertical,"center")};return o.x.splice("auto"===i.x?0:1,0,"middle"),o.y.splice("auto"===i.y?0:1,0,"center"),"auto"!==i.y&&(n.vertical="top"===n.vertical?"bottom":"top","inclusive"===i.y&&(a.vertical=a.vertical)),"auto"!==i.x&&(n.horizontal="left"===n.horizontal?"right":"left","inclusive"===i.y&&(a.horizontal=a.horizontal)),{positions:o,anchorPos:n}}},{key:"applyAutoPositionIfNeeded",value:function(e,t,n,a,o){var r=this.getPositions(a,n),i=r.positions,s=r.anchorPos;if(o.top<0||o.top+t.bottom>window.innerHeight){var l=e[s.vertical]-t[i.y[0]];l+t.bottom<=window.innerHeight?o.top=Math.max(0,l):(l=e[s.vertical]-t[i.y[1]])+t.bottom<=window.innerHeight&&(o.top=Math.max(0,l))}if(o.left<0||o.left+t.right>window.innerWidth){var u=e[s.horizontal]-t[i.x[0]];u+t.right<=window.innerWidth?o.left=Math.max(0,u):(u=e[s.horizontal]-t[i.x[1]])+t.right<=window.innerWidth&&(o.left=Math.max(0,u))}return o}},{key:"render",value:function(){var e=this;return E.default.createElement("div",{style:j.root},E.default.createElement(w.default,{target:this.props.scrollableContainer,onScroll:this.handleScroll,onResize:this.handleResize}),E.default.createElement(P.default,{ref:function(t){return e.popoverRefs.layer=t},open:this.state.open,componentClickAway:this.componentClickAway,useLayerForClickAway:this.props.useLayerForClickAway,render:this.renderLayer}))}}]),t}(T.Component);L.defaultProps={anchorOrigin:{vertical:"bottom",horizontal:"left"},animated:!0,autoCloseWhenOffScreen:!0,canAutoPosition:!0,onRequestClose:function(){},open:!1,scrollableContainer:"window",style:{overflowY:"auto"},targetOrigin:{vertical:"top",horizontal:"left"},useLayerForClickAway:!0,zDepth:1},L.contextTypes={muiTheme:_.default.object.isRequired},L.propTypes={},t.default=L},3339:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3464),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3340:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={set:function(e,t,n){e[t]=n}}},3341:function(e,t,n){"use strict";function a(e,t,n){return e<t?t:e>n?n:e}function o(e){var t=e.type,n=e.values;if(t.indexOf("rgb")>-1)for(var a=0;a<3;a++)n[a]=parseInt(n[a]);var o=void 0;return o=t.indexOf("hsl")>-1?e.type+"("+n[0]+", "+n[1]+"%, "+n[2]+"%":e.type+"("+n[0]+", "+n[1]+", "+n[2],4===n.length?o+=", "+e.values[3]+")":o+=")",o}function r(e){if(4===e.length){for(var t="#",n=1;n<e.length;n++)t+=e.charAt(n)+e.charAt(n);e=t}var a={r:parseInt(e.substr(1,2),16),g:parseInt(e.substr(3,2),16),b:parseInt(e.substr(5,2),16)};return"rgb("+a.r+", "+a.g+", "+a.b+")"}function i(e){if("#"===e.charAt(0))return i(r(e));var t=e.indexOf("("),n=e.substring(0,t),a=e.substring(t+1,e.length-1).split(",");return a=a.map(function(e){return parseFloat(e)}),{type:n,values:a}}function s(e,t){var n=l(e),a=l(t),o=(Math.max(n,a)+.05)/(Math.min(n,a)+.05);return Number(o.toFixed(2))}function l(e){if(e=i(e),e.type.indexOf("rgb")>-1){var t=e.values.map(function(e){return e/=255,e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)});return Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}if(e.type.indexOf("hsl")>-1)return e.values[2]/100}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(e)>.5?d(e,t):p(e,t)}function c(e,t){return e=i(e),t=a(t,0,1),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),e.values[3]=t,o(e)}function d(e,t){if(e=i(e),t=a(t,0,1),e.type.indexOf("hsl")>-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")>-1)for(var n=0;n<3;n++)e.values[n]*=1-t;return o(e)}function p(e,t){if(e=i(e),t=a(t,0,1),e.type.indexOf("hsl")>-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")>-1)for(var n=0;n<3;n++)e.values[n]+=(255-e.values[n])*t;return o(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.convertColorToString=o,t.convertHexToRGB=r,t.decomposeColor=i,t.getContrastRatio=s,t.getLuminance=l,t.emphasize=u,t.fade=c,t.darken=d,t.lighten=p;var f=n(12);!function(e){e&&e.__esModule}(f)},3342:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(3487),r=a(o),i=n(3323),s=a(i),l=n(3370),u=(a(l),n(3371)),c=(a(u),function(e){var t=(0,r.default)(function(e,t){return!(0,s.default)(e,t)});return t(e)});t.default=c},3346:function(e,t,n){"use strict";function a(e){return e&&v.a[e]}function o(e){var t=e.major,n=e.minor;return e.snapshot?"master":""+t+n}function r(e,t){var n=/\$\{(.+?)\}/g;return e.replace(n,function(e,n){return t.has(n)?t.get(n):".+?"})}function i(e,t){return Object.keys(v.a).find(function(n){var a=r(n,t);return new RegExp(a).test(e)})}function s(e,t){return a(e)?r(v.a[e],t):""}function l(e,t){var a=new Map([["objectType",t]]),o=new Map([["objectType",n.i(y.camelCaseToUnderscores)(t)]]);return s(i(e,a),o)}function u(e,t){var n=e.schema,a=t.d2,r=window.location.hash.replace(/^#/,"").replace(/\?.+?$/,""),i=o(a.system.version),s="https://docs.dhis2.org/en/use/user-guides/dhis-core-version-"+i+"/configuring-the-system",u=l(r,n);return u?d.a.createElement(m.a,{href:""+s+u,target:"_blank",rel:"noopener noreferrer",tooltip:a.i18n.getTranslation("open_user_guide"),tooltipPosition:"bottom-center",iconClassName:"material-icons",iconStyle:{top:-2}},"help_outline"):null}t.a=u;var c=n(0),d=n.n(c),p=n(1),f=n.n(p),h=n(133),m=n.n(h),y=n(724),g=(n.n(y),n(3357)),v=n.n(g);u.propTypes={schema:f.a.string.isRequired},u.contextTypes={d2:f.a.object}},3355:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function r(e,t,a){return n.i(k.isString)(e)?e===t.key:e===a}function i(e){var t=e.onBackClick;return c.a.createElement(T.a,{onClick:t},c.a.createElement(C.a,null))}function s(e){var t=e.onForwardClick;return c.a.createElement(T.a,{onClick:t},c.a.createElement(S.a,null))}function l(e,t){var n={buttons:{display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"4rem 1rem 1rem"}};return function(a){var o=a.children;return c.a.createElement("div",{style:n.buttons},c.a.createElement(e,null),o,c.a.createElement(t,null))}}n.d(t,"a",function(){return R}),n.d(t,"b",function(){return I}),n.d(t,"g",function(){return F}),n.d(t,"f",function(){return N}),t.e=l,n.d(t,"c",function(){return j}),n.d(t,"d",function(){return L});var u=n(0),c=n.n(u),d=n(1334),p=n.n(d),f=n(1332),h=n.n(f),m=n(1333),y=n.n(m),g=n(1331),v=n.n(g),b=n(203),T=n.n(b),E=n(3529),S=n.n(E),_=n(3528),C=n.n(_),O=n(170),x=n(19),w=n.n(x),k=n(15),P=(n.n(k),n(315)),A=n(201),D=n(3372),R=function(e,t,n){var a=D.a.groupsByField(n);return a&&t.map(function(t){return a[t.name]===e||t.isAttribute&&0===e?t.props.style={display:"block"}:t.props.style={display:"none"},t}),[].concat(o(t))},I=function(e){var t=e.steps,n=e.activeStep,a=e.stepperClicked,o=e.orientation,r=void 0===o?"horizontal":o;return c.a.createElement(p.a,{activeStep:n,linear:!1,orientation:r,style:{margin:"0 -16px"}},t.map(function(e,t){return c.a.createElement(v.a,{key:e.label},c.a.createElement(h.a,{onClick:function(){return a(t)}},c.a.createElement(O.a,null,e.label)))}))},F=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"horizontal";return function(o){var i=o.activeStep,s=o.stepperClicked,l=o.disabled,u=a(o,["activeStep","stepperClicked","disabled"]),d=function(e){var t=[];return t.push(c.a.createElement(h.a,{key:"button",onClick:function(){return s(e.key)}},c.a.createElement(O.a,null,e.name))),e.content&&t.push(c.a.createElement(y.a,{key:"content"},c.a.createElement(e.content,u))),t};return c.a.createElement(p.a,{linear:!1,orientation:t,activeStep:n.i(k.isNumber)(i)?i:void 0},e.map(function(e,t){return c.a.createElement(v.a,{key:e.key,active:r(i,e,t),disabled:!!l},d(e))}))}},N=function(e){return function(t){var n=t.activeStep,o=a(t,["activeStep"]),r=e.find(function(e){return e.key===n});return r&&r.component?c.a.createElement(r.component,o):(n?w.a.warn("Could not find a content component for a step with key ("+n+") in",e):w.a.warn("The `activeStep` prop is undefined, therefore the component created by `createStepperContentFromConfig` will render null"),null)}},M=function(e){return function(t){return n.i(A.a)(e,t)}},j=function(e){return n.i(P.a)(void 0,M({onForwardClick:e}))(s)},L=function(e){return n.i(P.a)(void 0,M({onBackClick:e}))(i)}},3356:function(e,t,n){"use strict";n.d(t,"a",function(){return c});var a=n(0),o=n.n(a),r=n(1),i=n.n(r),s=n(441),l=n.n(s),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},c=function(e){var t=function(t,n){var a=n.d2,r={getCurrentUser:function(){return a.currentUser},getModelDefinitionByName:function(e){return a.models[e]}};return o.a.createElement(e,u({},t,r))};return t.displayName="WithAuth("+l()(e)+")",t.contextTypes={d2:i.a.object},t};t.b=c},3357:function(e,t){e.exports={"/list/categorySection":"/metadata.html#manage_category","/list/dataElementSection":"/metadata.html#manage_data_element","/list/dataSetSection":"/metadata.html#manage_data_set","/edit/dataSetSection/dataSet/${objectId}/sections":"/metadata.html#manage_section_form","/edit/dataSetSection/dataSetNotificationTemplate":"/metadata.html#create_data_set_notification","/edit/dataSetSection/dataSet":"/metadata.html#create_data_set","/list/indicatorSection/programIndicatorGroup":"/programs.html#manage_${objectType}","/list/indicatorSection/programIndicator":"/programs.html#configure_program_indicator","/list/indicatorSection":"/metadata.html#manage_indicator","/edit/indicatorSection/programIndicator":"/programs.html#create_${objectType}","/edit/indicatorSection/programIndicatorGroup":"/programs.html#create_${objectType}","/list/organisationUnitSection/organisationUnitLevel":"/metadata.html#name_organisation_unit_level","/list/organisationUnitSection":"/metadata.html#manage_organisation_unit","organisationUnitSection/hierarchy":"/metadata.html#move_organisation_unit","/list/programSection/trackedEntity":"/programs.html#configure_tracked_entity","/list/programSection/programRuleVariable":"/programs.html#configure_program_rule","/list/programSection/program/":"/programs.html#configure_programs_in_maintenance_app","/list/programSection/${objectType}":"/programs.html#configure_${objectType}","/list/programSection":"/programs.html#configure_programs_in_maintenance_app","/edit/programSection/program/":"/programs.html#configure_programs_in_maintenance_app","/edit/programSection/trackedEntityType":"/programs.html#create_tracked_entity","/edit/programSection/${objectType}":"/programs.html#create_${objectType}","/list/validationSection":"/metadata.html#manage_validation_rule","/edit/validationSection/validationNotificationTemplate":"/metadata.html#create_validation_notification","/edit/otherSection/attribute":"/metadata.html#create-or-edit-an-attribute","/list/otherSection/optionGroup":"/metadata.html#create_option_group","/list/otherSection/optionGroupSet":"/metadata.html#create_option_group_set","/list/otherSection/legendSet":"/metadata.html#manage_legend","/edit/otherSection/legendSet":"/metadata.html#create_legend","/list/otherSection/predictorGroup":"/metadata.html#create_predictor_group","/list/otherSection/pushAnalysis":"/metadata.html#manage_push_report","/edit/otherSection/pushAnalysis":"/metadata.html#manage_push_report","/list/otherSection/externalMapLayer":"/metadata.html#manage_external_maplayer","/list/otherSection/locale":"/metadata.html#maintenance_locale_management","/edit/otherSection/locale":"/metadata.html#maintenance_locale_management","/list/otherSection/sqlView":"/metadata.html#maintenance_sql_view","/edit/otherSection/sqlView":"/metadata.html#maintenance_sql_view","/edit/":"/metadata.html#create_${objectType}","/list/":"/metadata.html#manage_${objectType}"}},3358:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(18),d=(n.n(c),n(437)),p=n.n(d),f=n(3374),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),y=function(e){function t(e,r){a(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return i.i18n=r.d2.i18n,i.state={TranslationForm:n.i(f.a)(i.props.objectToTranslate)},i.translationSaved=i.translationSaved.bind(i),i.translationError=i.translationError.bind(i),i.closeTranslationDialog=i.closeTranslationDialog.bind(i),i}return r(t,e),m(t,[{key:"render",value:function(){return s.a.createElement(p.a,h({title:this.i18n.getTranslation("translation_dialog_title"),autoDetectWindowHeight:!0,autoScrollBodyContent:!0},this.props),s.a.createElement(this.state.TranslationForm,{onTranslationSaved:this.translationSaved,onTranslationError:this.translationError,onCancel:this.closeTranslationDialog,fieldsToTranslate:this.props.fieldsToTranslate}))}},{key:"componentWillReceiveProps",value:function(e){e.objectToTranslate&&this.setState({TranslationForm:n.i(f.a)(e.objectToTranslate)})}},{key:"closeTranslationDialog",value:function(){this.props.onRequestClose()}},{key:"translationSaved",value:function(e){this.props.onTranslationSaved(e),this.closeTranslationDialog()}},{key:"translationError",value:function(e){this.props.onTranslationError(e)}}]),t}(i.Component);y.propTypes={objectToTranslate:u.a.shape({id:u.a.string.isRequired}).isRequired,onTranslationSaved:u.a.func.isRequired,onTranslationError:u.a.func.isRequired,open:u.a.bool,onRequestClose:u.a.func.isRequired,fieldsToTranslate:u.a.array},y.contextTypes={d2:u.a.object},t.a=y},3359:function(e,t,n){"use strict";var a=n(7),o=n.n(a),r=n(6),i=n.n(r),s=n(2),l=n.n(s),u=n(5),c=n.n(u),d=n(4),p=n.n(d),f=n(1),h=n.n(f),m=n(0),y=n.n(m),g=n(3336),v=n.n(g),b=n(3335),T=n.n(b),E=n(3457),S=n.n(E),_=n(3364),C=n.n(_),O=n(85),x=n(3437),w={optionHeader:{paddingLeft:16,paddingTop:16,fontWeight:"500",color:"gray"}},k=function(e){return e.canEdit?"Create":e.canView?"Visibility":"NotInterested"},P=function(e){function t(e,n){l()(this,t);var a=c()(this,(t.__proto__||i()(t)).call(this,e));return a.state={open:!1},a.onOptionClick=function(e,t){var n=o()({},a.props.access,t.props.value);a.props.onChange(n)},a.openMenu=function(e){e.preventDefault(),a.setState({open:!0,anchor:e.currentTarget})},a.closeMenu=function(){a.setState({open:!1})},a.translate=function(e){return a.context.d2.i18n.getTranslation(e)},a.render=function(){var e=a.props.access,t=e.data,n=e.meta,o=a.props.accessOptions,r=o.data,i=o.meta;return y.a.createElement("div",null,y.a.createElement(v.a,{onClick:a.openMenu,disabled:a.props.disabled},y.a.createElement(O.c,{icon:k(n)})),y.a.createElement(S.a,{open:a.state.open,anchorEl:a.state.anchor,onRequestClose:a.closeMenu},y.a.createElement(A,{text:a.translate("metadata")}),y.a.createElement(C.a,{onItemTouchTap:a.onOptionClick},y.a.createElement(x.a,{disabled:!i.canEdit,value:{meta:{canView:!0,canEdit:!0}},primaryText:a.translate("can_edit_and_view"),isSelected:n.canEdit}),y.a.createElement(x.a,{disabled:!i.canView,value:{meta:{canView:!0,canEdit:!1}},primaryText:a.translate("can_view_only"),isSelected:!n.canEdit&&n.canView}),y.a.createElement(x.a,{disabled:!i.noAccess,value:{meta:{canView:!1,canEdit:!1}},primaryText:a.translate("no_access"),isSelected:!n.canEdit&&!n.canView})),y.a.createElement(T.a,null),r&&y.a.createElement("div",null,y.a.createElement(A,{text:a.translate("data")}),y.a.createElement(C.a,{onItemTouchTap:a.onOptionClick},y.a.createElement(x.a,{disabled:!r.canEdit,value:{data:{canView:!0,canEdit:!0}},primaryText:a.translate("can_capture_and_view"),isSelected:t.canEdit}),y.a.createElement(x.a,{disabled:!r.canView,value:{data:{canView:!0,canEdit:!1}},primaryText:a.translate("can_view_only"),isSelected:!t.canEdit&&t.canView}),y.a.createElement(x.a,{disabled:!r.noAccess,value:{data:{canView:!1,canEdit:!1}},primaryText:a.translate("no_access"),isSelected:!t.canEdit&&!t.canView})))))},n.d2.i18n.addStrings(["can_edit_and_view","can_capture_and_view","can_view_only","no_access"]),a}return p()(t,e),t}(m.Component);P.propTypes={access:h.a.object.isRequired,accessOptions:h.a.object.isRequired,onChange:h.a.func.isRequired,disabled:h.a.bool},P.defaultProps={disabled:!1},P.contextTypes={d2:h.a.object.isRequired};var A=function(e){var t=e.text;return y.a.createElement("div",{style:w.optionHeader},t.toUpperCase())};A.propTypes={text:h.a.string.isRequired},t.a=P},3360:function(e,t,n){"use strict";n.d(t,"b",function(){return a}),n.d(t,"a",function(){return o});var a=function(e){if(!e)return{data:{canView:!1,canEdit:!1},meta:{canView:!1,canEdit:!1}};var t=e.substring(0,2),n=e.substring(2,4);return{meta:{canView:t.includes("r"),canEdit:t.includes("rw")},data:{canView:n.includes("r"),canEdit:n.includes("rw")}}},o=function(e){var t=function(e){var t=e.canEdit,n=e.canView;return t?"rw":n?"r-":"--"},n="";return n+=t(e.meta),n+=t(e.data),n+="----"}},3361:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(3318),O=a(C),x=n(3341),w=n(3329),k=a(w),P=n(3445),A=a(P),D=function(e){function t(){var e,n,a,o;(0,d.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,m.default)(this,(e=t.__proto__||(0,u.default)(t)).call.apply(e,[this].concat(i))),a.state={hovered:!1,isKeyboardFocused:!1,touch:!1},a.handleKeyboardFocus=function(e,t){a.setState({isKeyboardFocused:t}),a.props.onKeyboardFocus(e,t)},a.handleMouseEnter=function(e){a.state.touch||a.setState({hovered:!0}),a.props.onMouseEnter(e)},a.handleMouseLeave=function(e){a.setState({hovered:!1}),a.props.onMouseLeave(e)},a.handleTouchStart=function(e){a.setState({touch:!0}),a.props.onTouchStart(e)},o=n,(0,m.default)(a,o)}return(0,g.default)(t,e),(0,f.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.disabled&&this.setState({hovered:!1})}},{key:"render",value:function(){var e=this.props,t=e.backgroundColor,n=e.children,a=e.disabled,o=e.fullWidth,i=e.hoverColor,l=e.icon,u=e.label,c=e.labelStyle,d=e.labelPosition,p=e.primary,f=e.rippleColor,h=e.secondary,m=e.style,y=(0,s.default)(e,["backgroundColor","children","disabled","fullWidth","hoverColor","icon","label","labelStyle","labelPosition","primary","rippleColor","secondary","style"]),g=this.context.muiTheme,v=g.borderRadius,T=g.button,S=T.height,_=T.minWidth,C=T.textTransform,w=g.flatButton,P=w.buttonFilterColor,D=w.color,R=w.disabledTextColor,I=w.fontSize,F=w.fontWeight,N=w.primaryTextColor,M=w.secondaryTextColor,j=w.textColor,L=w.textTransform,B=void 0===L?C||"uppercase":L,q=a?R:p?N:h?M:j,U=(0,x.fade)(P,.2),H=P,W=i||U,V=f||H,z=t||D,K=(this.state.hovered||this.state.isKeyboardFocused)&&!a,G=(0,b.default)({},{height:S,lineHeight:S+"px",minWidth:o?"100%":_,color:q,transition:O.default.easeOut(),borderRadius:v,userSelect:"none",overflow:"hidden",backgroundColor:K?W:z,padding:0,margin:0,textAlign:"center"},m),Y=void 0,Q={};if(l){var $=(0,b.default)({verticalAlign:"middle",marginLeft:u&&"before"!==d?12:0,marginRight:u&&"before"===d?12:0},l.props.style);Y=E.default.cloneElement(l,{color:l.props.color||G.color,style:$,key:"iconCloned"}),"before"===d?Q.paddingRight=8:Q.paddingLeft=8}var X=(0,b.default)({letterSpacing:0,textTransform:B,fontWeight:F,fontSize:I},Q,c),Z=u?E.default.createElement(A.default,{key:"labelElement",label:u,style:X}):void 0,J="before"===d?[Z,Y,n]:[n,Y,Z];return E.default.createElement(k.default,(0,r.default)({},y,{disabled:a,focusRippleColor:V,focusRippleOpacity:.3,onKeyboardFocus:this.handleKeyboardFocus,onMouseLeave:this.handleMouseLeave,onMouseEnter:this.handleMouseEnter,onTouchStart:this.handleTouchStart,style:G,touchRippleColor:V,touchRippleOpacity:.3}),J)}}]),t}(T.Component);D.muiName="FlatButton",D.defaultProps={disabled:!1,fullWidth:!1,labelStyle:{},labelPosition:"after",onKeyboardFocus:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onTouchStart:function(){},primary:!1,secondary:!1},D.contextTypes={muiTheme:_.default.object.isRequired},D.propTypes={},t.default=D},3362:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(3365),O=a(C),x=function(e){function t(){return(0,d.default)(this,t),(0,m.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.style,a=(0,s.default)(e,["children","style"]),o=this.context.muiTheme.prepareStyles,i=!1,l=T.Children.toArray(t)[0];(0,T.isValidElement)(l)&&l.type===O.default&&(i=!0);var u={root:{padding:(i?0:8)+"px 0px 8px 0px"}};return E.default.createElement("div",(0,r.default)({},a,{style:o((0,b.default)(u.root,n))}),t)}}]),t}(T.Component);x.contextTypes={muiTheme:_.default.object.isRequired},x.propTypes={},t.default=x},3363:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e.desktop,a=e.maxHeight,o=e.width,r=t.muiTheme;return{root:{zIndex:r.zIndex.menu,maxHeight:a,overflowY:a?"auto":null},divider:{marginTop:7,marginBottom:8},list:{display:"table-cell",paddingBottom:n?16:8,paddingTop:n?16:8,userSelect:"none",width:o},selectedMenuItem:{color:r.menuItem.selectedTextColor}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(320),c=a(u),d=n(6),p=a(d),f=n(2),h=a(f),m=n(3),y=a(m),g=n(5),v=a(g),b=n(4),T=a(b),E=n(9),S=a(E),_=n(0),C=a(_),O=n(1),x=a(O),w=n(14),k=a(w),P=n(3323),A=a(P),D=n(3366),R=a(D),I=n(35),F=a(I),N=n(3319),M=(a(N),n(3362)),j=a(M),L=n(3452),B=function(e){function t(e,n){(0,h.default)(this,t);var a=(0,v.default)(this,(t.__proto__||(0,p.default)(t)).call(this,e,n));q.call(a);var o=a.getFilteredChildren(e.children),r=a.getLastSelectedIndex(e,o),i=e.disableAutoFocus?-1:r>=0?r:0;return-1!==i&&e.onMenuItemFocusChange&&e.onMenuItemFocusChange(null,i),a.state={focusIndex:i,isKeyboardFocused:e.initiallyKeyboardFocused,keyWidth:e.desktop?64:56},a.hotKeyHolder=new L.HotKeyHolder,a}return(0,T.default)(t,e),(0,y.default)(t,[{key:"componentDidMount",value:function(){this.props.autoWidth&&this.setWidth(),this.setScollPosition()}},{key:"componentWillReceiveProps",value:function(e){var t=void 0,n=this.getFilteredChildren(e.children);t=!0!==this.props.multiple?this.getLastSelectedIndex(e,n):this.state.focusIndex;var a=e.disableAutoFocus?-1:t>=0?t:0;a!==this.state.focusIndex&&this.props.onMenuItemFocusChange&&this.props.onMenuItemFocusChange(null,a),this.setState({focusIndex:a,keyWidth:e.desktop?64:56})}},{key:"shouldComponentUpdate",value:function(e,t,n){return!(0,A.default)(this.props,e)||!(0,A.default)(this.state,t)||!(0,A.default)(this.context,n)}},{key:"componentDidUpdate",value:function(){this.props.autoWidth&&this.setWidth()}},{key:"getValueLink",value:function(e){return e.valueLink||{value:e.value,requestChange:e.onChange}}},{key:"setKeyboardFocused",value:function(e){this.setState({isKeyboardFocused:e})}},{key:"getFilteredChildren",value:function(e){var t=[];return C.default.Children.forEach(e,function(e){e&&t.push(e)}),t}},{key:"cloneMenuItem",value:function(e,t,n,a){var o=this,r=e.props.disabled,i={};if(!r){this.isChildSelected(e,this.props)&&(0,S.default)(i,n.selectedMenuItem,this.props.selectedMenuItemStyle)}var s=(0,S.default)({},e.props.style,this.props.menuItemStyle,i),l={desktop:this.props.desktop,style:s};if(!r){var u=t===this.state.focusIndex,c="none";u&&(c=this.state.isKeyboardFocused?"keyboard-focused":"focused"),(0,S.default)(l,{focusState:c,onClick:function(t){o.handleMenuItemTouchTap(t,e,a),e.props.onClick&&e.props.onClick(t)},ref:u?"focusedMenuItem":null})}return C.default.cloneElement(e,l)}},{key:"decrementKeyboardFocusIndex",value:function(e){var t=this.state.focusIndex;t--,t<0&&(t=0),this.setFocusIndex(e,t,!0)}},{key:"getMenuItemCount",value:function(e){var t=0;return e.forEach(function(e){var n=e.type&&"Divider"===e.type.muiName,a=e.props.disabled;n||a||t++}),t}},{key:"getLastSelectedIndex",value:function(e,t){var n=this,a=-1,o=0;return t.forEach(function(t){var r=t.type&&"Divider"===t.type.muiName;n.isChildSelected(t,e)&&(a=o),r||o++}),a}},{key:"setFocusIndexStartsWith",value:function(e,t){var n=-1;return C.default.Children.forEach(this.props.children,function(e,a){if(!(n>=0)){var o=e.props.primaryText;"string"==typeof o&&o.substr(0,t.length).toLowerCase()===t.toLowerCase()&&(n=a)}}),n>=0&&(this.setFocusIndex(e,n,!0),!0)}},{key:"handleMenuItemTouchTap",value:function(e,t,n){var a=this.props.children,o=this.props.multiple,r=this.getValueLink(this.props),i=r.value,s=t.props.value,l=C.default.isValidElement(a)?0:a.indexOf(t);if(this.setFocusIndex(e,l,!1),o){i=i||[];var u=i.indexOf(s),d=i,p=(0,c.default)(d),f=p.slice(0);-1===u?f.push(s):f.splice(u,1),r.requestChange(e,f)}else o||s===i||r.requestChange(e,s);this.props.onItemTouchTap(e,t,n)}},{key:"incrementKeyboardFocusIndex",value:function(e,t){var n=this.state.focusIndex,a=this.getMenuItemCount(t)-1;n++,n>a&&(n=a),this.setFocusIndex(e,n,!0)}},{key:"isChildSelected",value:function(e,t){var n=this.getValueLink(t).value,a=e.props.value;return t.multiple?n&&n.length&&-1!==n.indexOf(a):e.props.hasOwnProperty("value")&&n===a}},{key:"setFocusIndex",value:function(e,t,n){this.props.onMenuItemFocusChange&&this.props.onMenuItemFocusChange(e,t),this.setState({focusIndex:t,isKeyboardFocused:n})}},{key:"setScollPosition",value:function(){var e=this.props.desktop,t=this.refs.focusedMenuItem,n=e?32:48;if(t){var a=k.default.findDOMNode(t).offsetTop,o=a-n;o<n&&(o=0),k.default.findDOMNode(this.refs.scrollContainer).scrollTop=o}}},{key:"cancelScrollEvent",value:function(e){return e.stopPropagation(),e.preventDefault(),!1}},{key:"setWidth",value:function(){var e=k.default.findDOMNode(this),t=k.default.findDOMNode(this.refs.list),n=e.offsetWidth,a=this.state.keyWidth,o=1.5*a,r=n/a,i=void 0;r=r<=1.5?1.5:Math.ceil(r),i=r*a,i<o&&(i=o),e.style.width=i+"px",t.style.width=i+"px"}},{key:"render",value:function(){var e=this,t=this.props,n=(t.autoWidth,t.children),a=(t.desktop,t.disableAutoFocus,t.initiallyKeyboardFocused,t.listStyle),r=(t.maxHeight,t.multiple,t.onItemTouchTap,t.onEscKeyDown,t.onMenuItemFocusChange,t.selectedMenuItemStyle,t.menuItemStyle,t.style),s=(t.value,t.valueLink,t.width,(0,l.default)(t,["autoWidth","children","desktop","disableAutoFocus","initiallyKeyboardFocused","listStyle","maxHeight","multiple","onItemTouchTap","onEscKeyDown","onMenuItemFocusChange","selectedMenuItemStyle","menuItemStyle","style","value","valueLink","width"])),u=this.context.muiTheme.prepareStyles,c=o(this.props,this.context),d=(0,S.default)(c.root,r),p=(0,S.default)(c.list,a),f=this.getFilteredChildren(n),h=0,m=C.default.Children.map(f,function(t,n){var a=t.props.disabled,o=t.type?t.type.muiName:"",r=t;switch(o){case"MenuItem":r=e.cloneMenuItem(t,h,c,n);break;case"Divider":r=C.default.cloneElement(t,{style:(0,S.default)({},c.divider,t.props.style)})}return"MenuItem"!==o||a||h++,r});return C.default.createElement(R.default,{onClickAway:this.handleClickAway},C.default.createElement("div",{onKeyDown:this.handleKeyDown,onWheel:this.handleOnWheel,style:u(d),ref:"scrollContainer",role:"presentation"},C.default.createElement(j.default,(0,i.default)({},s,{ref:"list",style:p,role:"menu"}),m)))}}]),t}(_.Component);B.defaultProps={autoWidth:!0,desktop:!1,disableAutoFocus:!1,initiallyKeyboardFocused:!1,maxHeight:null,multiple:!1,onChange:function(){},onEscKeyDown:function(){},onItemTouchTap:function(){},onKeyDown:function(){}},B.contextTypes={muiTheme:x.default.object.isRequired};var q=function(){var e=this;this.handleClickAway=function(t){if(!t.defaultPrevented){var n=e.state.focusIndex;if(!(n<0)){var a=e.getFilteredChildren(e.props.children),o=a[n];o.props.menuItems&&o.props.menuItems.length>0||e.setFocusIndex(t,-1,!1)}}},this.handleKeyDown=function(t){var n=e.getFilteredChildren(e.props.children),a=(0,F.default)(t);switch(a){case"down":t.preventDefault(),e.incrementKeyboardFocusIndex(t,n);break;case"esc":e.props.onEscKeyDown(t);break;case"tab":t.preventDefault(),t.shiftKey?e.decrementKeyboardFocusIndex(t):e.incrementKeyboardFocusIndex(t,n);break;case"up":t.preventDefault(),e.decrementKeyboardFocusIndex(t);break;default:if(a&&1===a.length){var o=e.hotKeyHolder.append(a);e.setFocusIndexStartsWith(t,o)&&t.preventDefault()}}e.props.onKeyDown(t)},this.handleOnWheel=function(t){var n=e.refs.scrollContainer;if(!(n.scrollHeight<=n.clientHeight)){var a=n.scrollTop,o=n.scrollHeight,r=n.clientHeight,i=t.deltaY,s=i>0;return s&&i>o-r-a?(n.scrollTop=o,e.cancelScrollEvent(t)):!s&&-i>a?(n.scrollTop=0,e.cancelScrollEvent(t)):void 0}}};B.propTypes={},t.default=B},3364:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.MenuItem=t.Menu=void 0;var o=n(3363),r=a(o),i=n(3337),s=a(i);t.Menu=r.default,t.MenuItem=s.default,t.default=r.default},3365:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3463),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3366:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=a(o),i=n(2),s=a(i),l=n(3),u=a(l),c=n(5),d=a(c),p=n(4),f=a(p),h=n(0),m=n(1),y=(a(m),n(14)),g=a(y),v=n(3369),b=a(v),T=function e(t,n){return null!==n&&(t===n||e(t,n.parentNode))},E=["mouseup","touchend"],S=function(e){return E.forEach(function(t){return b.default.on(document,t,e)})},_=function(e){return E.forEach(function(t){return b.default.off(document,t,e)})},C=function(e){function t(){var e,n,a,o;(0,s.default)(this,t);for(var i=arguments.length,l=Array(i),u=0;u<i;u++)l[u]=arguments[u];return n=a=(0,d.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),a.handleClickAway=function(e){if(!e.defaultPrevented&&a.isCurrentlyMounted){var t=g.default.findDOMNode(a);document.documentElement.contains(e.target)&&!T(t,e.target)&&a.props.onClickAway(e)}},o=n,(0,d.default)(a,o)}return(0,f.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){this.isCurrentlyMounted=!0,this.props.onClickAway&&S(this.handleClickAway)}},{key:"componentDidUpdate",value:function(e){e.onClickAway!==this.props.onClickAway&&(_(this.handleClickAway),this.props.onClickAway&&S(this.handleClickAway))}},{key:"componentWillUnmount",value:function(){this.isCurrentlyMounted=!1,_(this.handleClickAway)}},{key:"render",value:function(){return this.props.children}}]),t}(h.Component);C.propTypes={},t.default=C},3367:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=a(o),i=n(2),s=a(i),l=n(3),u=a(l),c=n(5),d=a(c),p=n(4),f=a(p),h=n(0),m=n(1),y=a(m),g=n(14),v=n(3368),b=a(v),T=function(e){function t(){var e,n,a,o;(0,s.default)(this,t);for(var i=arguments.length,l=Array(i),u=0;u<i;u++)l[u]=arguments[u];return n=a=(0,d.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),a.onClickAway=function(e){if(!e.defaultPrevented&&a.props.componentClickAway&&a.props.open){var t=a.layer;(e.target!==t&&e.target===window||document.documentElement.contains(e.target)&&!b.default.isDescendant(t,e.target))&&a.props.componentClickAway(e)}},o=n,(0,d.default)(a,o)}return(0,f.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){this.renderLayer()}},{key:"componentDidUpdate",value:function(){this.renderLayer()}},{key:"componentWillUnmount",value:function(){this.unrenderLayer()}},{key:"getLayer",value:function(){return this.layer}},{key:"unrenderLayer",value:function(){this.layer&&(this.props.useLayerForClickAway?(this.layer.style.position="relative",this.layer.removeEventListener("touchstart",this.onClickAway),this.layer.removeEventListener("click",this.onClickAway)):(window.removeEventListener("touchstart",this.onClickAway),window.removeEventListener("click",this.onClickAway)),(0,g.unmountComponentAtNode)(this.layer),document.body.removeChild(this.layer),this.layer=null)}},{key:"renderLayer",value:function(){var e=this,t=this.props,n=t.open,a=t.render;if(n){this.layer||(this.layer=document.createElement("div"),document.body.appendChild(this.layer),this.props.useLayerForClickAway?(this.layer.addEventListener("touchstart",this.onClickAway),this.layer.addEventListener("click",this.onClickAway),this.layer.style.position="fixed",this.layer.style.top=0,this.layer.style.bottom=0,this.layer.style.left=0,this.layer.style.right=0,this.layer.style.zIndex=this.context.muiTheme.zIndex.layer):setTimeout(function(){window.addEventListener("touchstart",e.onClickAway),window.addEventListener("click",e.onClickAway)},0));var o=a();this.layerElement=(0,g.unstable_renderSubtreeIntoContainer)(this,o,this.layer)}else this.unrenderLayer()}},{key:"render",value:function(){return null}}]),t}(h.Component);T.defaultProps={useLayerForClickAway:!0},T.contextTypes={muiTheme:y.default.object.isRequired},T.propTypes={},t.default=T},3368:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={isDescendant:function(e,t){for(var n=t.parentNode;null!==n;){if(n===e)return!0;n=n.parentNode}return!1},offset:function(e){var t=e.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}}}},3369:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={once:function(e,t,n){for(var a=t?t.split(" "):[],o=function e(t){return t.target.removeEventListener(t.type,e),n(t)},r=a.length-1;r>=0;r--)this.on(e,a[r],o)},on:function(e,t,n){e.addEventListener?e.addEventListener(t,n):e.attachEvent("on"+t,function(){n.call(e)})},off:function(e,t,n){e.removeEventListener?e.removeEventListener(t,n):e.detachEvent("on"+t,n)},isKeyboard:function(e){return-1!==["keydown","keypress","keyup"].indexOf(e.type)}}},3370:function(e,t,n){"use strict";t.__esModule=!0;var a=n(3486),o=function(e){return e&&e.__esModule?e:{default:e}}(a),r=function(e){return(0,o.default)("displayName",e)};t.default=r},3371:function(e,t,n){"use strict";t.__esModule=!0;var a=n(3485),o=function(e){return e&&e.__esModule?e:{default:e}}(a),r=function(e,t){return t+"("+(0,o.default)(e)+")"};t.default=r},3372:function(e,t,n){"use strict";var a=n(15),o=(n.n(a),n(1306)),r=new Map([["programRule",[{label:"enter_program_rule_details",fields:["program","programStage","name","description","priority"]},{label:"enter_program_rule_expression",fields:["condition"]},{label:"define_program_rule_actions",fields:["programRuleActions"]}]],["dataSetNotificationTemplate",[{label:"what_to_send",fields:["name","code","dataSets","messageTemplate"]},{label:"when_to_send_it",fields:["dataSetNotificationTrigger","relativeScheduledDays","sendStrategy"]},{label:"who_to_send_it_to",fields:["notificationRecipient","recipientUserGroup","deliveryChannels"]}]],["programNotificationTemplate",[{label:"what_to_send",fields:["name","messageTemplate"]},{label:"when_to_send_it",fields:["notificationTrigger","relativeScheduledDays"]},{label:"who_to_send_it_to",fields:["notificationRecipient","recipientUserGroup","deliveryChannels","recipientProgramAttribute","notifyUsersInHierarchyOnly","notifyParentOrganisationUnitOnly"]}]],["programStageNotificationTemplate",[{label:"what_to_send",fields:["name","messageTemplate"]},{label:"when_to_send_it",fields:["notificationTrigger","relativeScheduledDays","sendRepeatable"]},{label:"who_to_send_it_to",fields:["notificationRecipient","recipientUserGroup","deliveryChannels","recipientDataElement","recipientProgramAttribute","notifyUsersInHierarchyOnly","notifyParentOrganisationUnitOnly"]}]],["programIndicator",[{label:"program_indicator__details",fields:["program","name","shortName","code","style","description","decimals","aggregationType","analyticsType","orgUnitField","analyticsPeriodBoundaries","displayInForm","legendSets","aggregateExportCategoryOptionCombo","aggregateExportAttributeOptionCombo"]},{label:"program_indicator__edit_expression",fields:["expression"]},{label:"program_indicator__edit_filter",fields:["filter"]}]]]);t.a={for:function(e){return this.isGroupedFields(e)?r.get(e):[{label:"details",fields:o.a.for(e)}]},isGroupedFields:function(e){return e&&r.has(e)},getStepLength:function(e){if(this.isGroupedFields(e)){return r.get(e).length}return 0},groupNoByName:function(e,t){if(this.isGroupedFields(t)){var o=r.get(t);return n.i(a.findIndex)(function(t){return t.fields.includes(e)},o)}return 0},groupNameByStep:function(e,t){if(this.isGroupedFields(t)){return r.get(t)[e].label}return""},groupsByField:function(e){if(this.isGroupedFields(e))return r.get(e).map(function(e){return e.fields}).reduce(function(e,t,n){return t.map(function(t){return e[t]=n}),e},{})}}},3373:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(319),d=n.n(c),p=n(204),f=n.n(p),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},m=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),y=function(e){function t(e,n){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.onLocaleChange=function(e,t,n){r.setState({locale:n}),r.props.onChange(n,e)};var i=r.context.d2.i18n;return r.getTranslation=i.getTranslation.bind(i),r}return r(t,e),m(t,[{key:"render",value:function(){var e=[{payload:"",text:""}].concat(this.props.locales).map(function(e,t){return s.a.createElement(f.a,{key:t,primaryText:e.name,value:e.locale})});return s.a.createElement(d.a,h({fullWidth:!0},this.props,{value:this.state&&this.state.locale,hintText:this.getTranslation("select_locale"),onChange:this.onLocaleChange}),e)}}]),t}(i.Component);y.propTypes={value:u.a.string,locales:u.a.arrayOf(u.a.shape({name:u.a.string.isRequired,locale:u.a.string.isRequired})).isRequired,onChange:u.a.func.isRequired},y.contextTypes={d2:u.a.object},t.a=y},3374:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function i(e){var t=S.a.create();return n.i(T.a)(e).subscribe(function(e){t.setState(e)}),v.Observable.combineLatest(n.i(T.b)(),t,function(){for(var n=arguments.length,a=Array(n),o=0;o<n;o++)a[o]=arguments[o];return Object.assign.apply(Object,[{objectToTranslate:e,setTranslations:function(e){t.setState({translations:e})}}].concat(a))})}function s(e){return n.i(E.a)(i(e),O)}t.a=s;var l=n(0),u=n.n(l),c=n(1),d=n.n(c),p=n(58),f=n.n(p),h=n(95),m=n.n(h),y=n(200),g=n.n(y),v=n(25),b=(n.n(v),n(3373)),T=n(3375),E=n(1307),S=n(44),_=n(150),C=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),O=function(e){function t(e,r){a(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));i.state={loading:!0,translations:{},translationValues:{},currentSelectedLocale:""},i.setCurrentLocale=function(e){i.setState({currentSelectedLocale:e})},i.setValue=function(e,t){var n=[].concat(i.props.translations),a=n.find(function(t){return t.locale===i.state.currentSelectedLocale&&t.property.toLowerCase()===m()(e)});a?t.target.value?a.value=t.target.value:n=n.filter(function(e){return e!==a}):(a={property:m()(e).toUpperCase(),locale:i.state.currentSelectedLocale,value:t.target.value},n.push(a)),i.props.setTranslations(n)},i.saveTranslations=function(){n.i(T.c)(i.props.objectToTranslate,i.props.translations).subscribe(i.props.onTranslationSaved,i.props.onTranslationError)};var s=i.context.d2.i18n;return i.getTranslation=s.getTranslation.bind(s),i}return r(t,e),C(t,[{key:"getLoadingdataElement",value:function(){return u.a.createElement("div",{style:{textAlign:"center"}},u.a.createElement(_.a,{mode:"indeterminate"}))}},{key:"renderFieldsToTranslate",value:function(){var e=this;return this.props.fieldsToTranslate.filter(function(e){return e}).map(function(t){return u.a.createElement("div",{key:t},u.a.createElement(f.a,{floatingLabelText:e.getTranslation(m()(t)),value:e.getTranslationValueFor(t),fullWidth:!0,onChange:e.setValue.bind(e,t)}),u.a.createElement("div",null,e.props.objectToTranslate[t]))})}},{key:"renderForm",value:function(){return u.a.createElement("div",null,this.renderFieldsToTranslate(),u.a.createElement(g.a,{label:this.getTranslation("save"),primary:!0,onClick:this.saveTranslations}),u.a.createElement(g.a,{style:{marginLeft:"1rem"},label:this.getTranslation("cancel"),onClick:this.props.onCancel}))}},{key:"renderHelpText",value:function(){return u.a.createElement("div",null,u.a.createElement("p",null,this.getTranslation("select_a_locale_to_enter_translations_for_that_language")))}},{key:"render",value:function(){return this.props.locales||this.props.translations?u.a.createElement("div",{style:{minHeight:250}},u.a.createElement(b.a,{locales:this.props.locales,onChange:this.setCurrentLocale}),this.state.currentSelectedLocale?this.renderForm():this.renderHelpText()):this.getLoadingdataElement()}},{key:"getTranslationValueFor",value:function(e){var t=this,n=this.props.translations.find(function(n){return n.locale===t.state.currentSelectedLocale&&n.property.toLowerCase()===m()(e)});if(n)return n.value}}]),t}(l.Component);O.propTypes={onTranslationSaved:d.a.func.isRequired,onTranslationError:d.a.func.isRequired,objectToTranslate:d.a.shape({id:d.a.string.isRequired}),fieldsToTranslate:d.a.arrayOf(d.a.string)},O.defaultProps={fieldsToTranslate:["name","shortName","description"]},O.contextTypes={d2:d.a.object}},3375:function(e,t,n){"use strict";function a(){return a.localePromise||(a.localePromise=n.i(i.getInstance)().then(function(e){return e.Api.getApi().get("locales/db")}).then(function(e){return{locales:e}})),s.Observable.fromPromise(a.localePromise)}function o(e){return e.href?e.href:e.modelDefinition.apiEndpoint+"/"+e.id}function r(e){return s.Observable.of(e).flatMap(function(e){var t=e.modelDefinition;return t||t.name?n.i(i.getInstance)().then(function(t){return t.Api.getApi().get(o(e)+"/translations")}):Promise.reject(new Error("Can not find modelDefinition for "+e.id))})}t.b=a,t.a=r,n.d(t,"c",function(){return c});var i=n(18),s=(n.n(i),n(25)),l=(n.n(s),n(112)),u=function(){function e(e,t){var n=[],a=!0,o=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){o=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=l.a.create("saveTranslations");c.subscribe(function(e){var t=u(e.data,2),a=t[0],r=t[1],s=e.complete,l=e.error,c=o(a)+"/translations";n.i(i.getInstance)().then(function(e){e.Api.getApi().update(c,{translations:r},{dataType:"text"}).then(function(){return s(r)}).catch(l)})})},3392:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t){var o=e.level,r=e.schema,s=e.children,l=e.groupName,u=e.isDirtyHandler,m=e.skipTranslation,y=a(e,["level","schema","children","groupName","isDirtyHandler","skipTranslation"]);return i.a.createElement(c.a,h({},y,{level:o}),i.a.createElement(p.a,{onClick:function(){return n.i(f.b)("/list/"+l+"/"+r)},iconStyle:{top:3},isDirtyHandler:u}),m?s:t.d2.i18n.getTranslation(s),r&&i.a.createElement(d.a,{schema:r}))}var r=n(0),i=n.n(r),s=n(1),l=n.n(s),u=n(83),c=n(316),d=n(3346),p=n(3396),f=n(202),h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};o.propTypes={children:l.a.oneOfType([l.a.string,l.a.array]),level:l.a.number,isDirtyHandler:l.a.func,schema:l.a.string.isRequired,groupName:l.a.string.isRequired,skipTranslation:l.a.bool},o.defaultProps={isDirtyHandler:function(){},level:2,children:"",skipTranslation:!1},t.a=n.i(u.a)(o)},3393:function(e,t,n){"use strict";function a(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function a(o,r){try{var i=t[o](r),s=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(s).then(function(e){a("next",e)},function(e){a("throw",e)});e(s)}return a("next")})}}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.props&&t.props.isRequired?e+" (*)":e}function r(e,t){var a=e.models[t];return Object.keys(a.attributeProperties).map(function(t){var o=a.attributeProperties[t];return n.i(k.a)({name:o.name,valueType:o.valueType,type:k.b.get(o.optionSet?"CONSTANT":o.valueType),required:Boolean(o.mandatory),fieldOptions:{labelText:o.name,options:o.optionSet?o.optionSet.options.map(function(e){return{name:e.displayName||e.name,value:e.code}}):[]}},a,e.models)})}function i(e,t){e.validators&&(e.validators=e.validators.map(function(e){return D({},e,{message:t.i18n.getTranslation(e.message)})}))}function s(e,t){e.translatedName=t.i18n.getTranslation(e.props.labelText),e.props.labelText=o(e.translatedName,e)}function l(e,t,n){if(x.a.isGroupedFields(t)&&"programNotificationTemplate"!==t){var a=x.a.groupNoByName(e.name,t),o=x.a.groupNameByStep(a,t);e.step=a+1+": "+n.i18n.getTranslation(o)}}function u(e,t,a){return function(o){if(!o||!o.trim())return Promise.resolve(!0);var r=t.filter().on(e.fieldOptions.referenceProperty).equals(o);return a&&(r=r.filter().on("id").notEqual(a)),r.list().then(function(e){return 0!==e.size?n.i(v.getInstance)().then(function(e){return e.i18n.getTranslation("value_not_unique")}).then(function(e){return Promise.reject(e)}):Promise.resolve(!0)})}}function c(e,t){return e.unique&&(e.asyncValidators=[u(e,t.modelDefinition,t.id)]),e}function d(e,t){return e.attributes&&new Set(Object.keys(e.attributes)).has(t.name)}function p(e,t){return e.map(function(e){return d(t,e)?D({},e,{value:t.attributes[e.name]}):D({},e,{value:t[e.name]})}).map(I).map(F(t))}function f(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:E.identity,o=arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments[5];return a=a||E.identity,T()(function(s){return s.filter(function(e){return e.model}).combineLatest(g.Observable.fromPromise(R(e,t,o,i)),function(t,o){var s=p(o,t.model),l=r?n.i(P.a)(n.i(P.b)(i||e),a(s),t.model):s;return D({},t,{fieldConfigs:l})})})}function h(e,t,a,o,r){function i(e){var a=e.fieldConfigs,o=e.model,i=e.editFieldChanged,s=e.detailsFormStatusChange,l=void 0===s?E.noop:s,u=N(a,i),c=n.i(P.a)(n.i(P.b)(r||t),a,o);return y.a.createElement(S.a,{fields:c,onUpdateField:u,onUpdateFormStatus:l})}return n.i(E.compose)(T()(function(t){return t.combineLatest(e,function(e,t){return D({},e,{model:t})})}),f(t,a,void 0,o,!1,r))(i)}n.d(t,"a",function(){return R}),t.b=c,t.c=f,t.e=h,n.d(t,"d",function(){return M});var m=n(0),y=n.n(m),g=n(25),v=(n.n(g),n(18)),b=(n.n(v),n(722)),T=n.n(b),E=n(15),S=(n.n(E),n(1309)),_=n(1327),C=n(1328),O=n(1306),x=n(3372),w=n(1325),k=n(726),P=n(3489),A=function(){function e(e,t){var n=[],a=!0,o=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){o=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},R=function(){var e=a(regeneratorRuntime.mark(function e(t,a){var o,u,c,d,p,f,h,m,y,g,b,T=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],E=arguments[3];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.i(v.getInstance)();case 2:for(o=e.sent,u=new C.a(new _.a(o.models)),u.setFieldOrder(a||O.a.for(t)),c=!0,d=!1,p=void 0,e.prev=8,f=w.a.for(E||t)[Symbol.iterator]();!(c=(h=f.next()).done);c=!0)m=h.value,y=A(m,2),g=y[0],b=y[1],u.addFieldOverrideFor(g,b);e.next=16;break;case 12:e.prev=12,e.t0=e.catch(8),d=!0,p=e.t0;case 16:e.prev=16,e.prev=17,!c&&f.return&&f.return();case 19:if(e.prev=19,!d){e.next=22;break}throw p;case 22:return e.finish(19);case 23:return e.finish(16);case 24:return e.abrupt("return",u.getFormFieldsForModel({modelDefinition:o.models[t]},E).map(function(e){return i(e,o),l(e,t,o),s(e,o),e}).concat(T?r(o,t):[]));case 25:case"end":return e.stop()}},e,this,[[8,12,16,24],[17,,19,23]])}));return function(t,n){return e.apply(this,arguments)}}(),I=function(e){return e.beforePassToFieldConverter?D({},e,{value:e.beforePassToFieldConverter(e.value)}):e},F=function(e){return function(t){return D({},t,{props:D({},t.props,{model:e})})}},N=function(e,t){return function(n,a){var o=e.find(function(e){return e.name===n}),r=o.beforeUpdateConverter||E.identity;return t(n,r(a))}},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(n){return t.length<1||t.includes(n.name)?D({},n,{props:D({},n.props,e)}):n}}},3395:function(e,t,n){"use strict";var a=n(3439);t.a=a.a},3396:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t){var n=e.tooltip,o=e.onClick,r=e.isDirtyHandler,s=void 0===r?c.a.getState.bind(c.a):r,u=a(e,["tooltip","onClick","isDirtyHandler"]),p=function(){s&&s()&&s().dirty?confirm(t.d2.i18n.getTranslation("abandon_unsaved_changes"))&&o.apply(void 0,arguments):o.apply(void 0,arguments)};return i.a.createElement(l.a,d({tooltip:n||t.d2.i18n.getTranslation("back"),tooltipPosition:"bottom-right",onClick:p},u,{iconClassName:"material-icons"}),"")}var r=n(0),i=n.n(r),s=n(203),l=n.n(s),u=n(83),c=n(245),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};o.propTypes={tooltip:i.a.PropTypes.string},t.a=n.i(u.a)(o)},3397:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t){var n=t.d2,o=e.label,r=e.isSaving,s=(e.isValid,e.onClick),l=a(e,["label","isSaving","isValid","onClick"]),u=o||(r?n.i18n.getTranslation("saving"):n.i18n.getTranslation("save"));return i.a.createElement(c.a,p({},l,{primary:!0,onClick:s,label:u,disabled:r}))}var r=n(0),i=n.n(r),s=n(1),l=n.n(s),u=n(200),c=n.n(u),d=n(83),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};o.propTypes={label:l.a.string,isSaving:l.a.bool,isValid:l.a.bool,onClick:l.a.func.isRequired},o.defaultProps={label:"",isSaving:!1,isValid:!0},t.a=n.i(d.a)(o)},3403:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}))};c=(0,s.default)(c),c.displayName="ContentAdd",c.muiName="SvgIcon",t.default=c},3408:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=a(o),i=n(2),s=a(i),l=n(3),u=a(l),c=n(5),d=a(c),p=n(4),f=a(p),h=n(9),m=a(h),y=n(0),g=a(y),v=n(1),b=a(v),T=n(3569),E=(a(T),n(3568)),S=a(E),_=n(3570),C=a(_),O=function(e){function t(e,n){var a=n.muiTheme;(0,s.default)(this,t);var o=(0,d.default)(this,(t.__proto__||(0,r.default)(t)).call(this,e));return o.state={isKeyboardFocused:!1},o.styles=(0,C.default)(a),o.getStylesMain=o.getStylesMain.bind(o),o.getStylesText=o.getStylesText.bind(o),o.getStylesFocus=o.getStylesFocus.bind(o),o.setFocus=o.setFocus.bind(o),o.handleFocus=o.handleFocus.bind(o),o.handleKeyUp=o.handleKeyUp.bind(o),o.handleBlur=o.handleBlur.bind(o),o}return(0,f.default)(t,e),(0,u.default)(t,[{key:"handleBlur",value:function(){this.setState({isKeyboardFocused:!1}),this.props.onBlur()}},{key:"handleFocus",value:function(){this.setState({isKeyboardFocused:!0}),this.props.onFocus()}},{key:"handleKeyUp",value:function(e){this.state.isKeyboardFocused&&13===e.keyCode&&this.props.onClick(e)}},{key:"setFocus",value:function(){this.refs.link.focus()}},{key:"getStylesMain",value:function(){var e=this.props,t=e.isOpen,n=e.direction,a=e.alignment,o=e.style,r=this.styles,i=t?"visible":"invisible";return(0,m.default)({},r.root.main,r.root[i].main,r.root.direction[n],r.root[i].direction[n],r.root.alignment[a],o)}},{key:"getStylesFocus",value:function(e){return this.state.isKeyboardFocused?this.styles.focus[e]:{}}},{key:"getStylesText",value:function(){var e=this.props,t=e.alignment,n=e.styleText,a=this.styles;return(0,m.default)({},a.text.main,a.text.alignment[t],this.getStylesFocus("text"),n)}},{key:"renderAvatar",value:function(e){var t=this.styles,n=this.props[e];return n?g.default.cloneElement(n,{style:(0,m.default)({},n.props.style,t[e],this.getStylesFocus("avatar"))}):null}},{key:"renderContent",value:function(){var e=this.props.primaryText;return g.default.createElement("span",null,this.renderAvatar("leftAvatar"),g.default.createElement("span",{style:this.getStylesText()},e),this.renderAvatar("rightAvatar"))}},{key:"renderLink",value:function(){var e=this.props,t=e.href,n=e.onClick,a=e.tabIndex,o=e.isOpen,r=this.styles;return t?g.default.createElement("a",{href:t,ref:"link",style:r.wrap.main,tabIndex:o?a:-1,onBlur:this.handleBlur,onFocus:this.handleFocus},this.renderContent()):g.default.createElement("a",{ref:"link",style:r.wrap.main,tabIndex:o?a:-1,onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyUp:this.handleKeyUp,onClick:n},this.renderContent())}},{key:"render",value:function(){var e=this.props.className;return g.default.createElement("li",{className:e,ref:"item",style:this.getStylesMain()},this.renderLink())}}]),t}(g.default.Component);O.displayName="BubbleListItem",O.propTypes={},O.defaultProps=S.default,O.contextTypes={muiTheme:b.default.object.isRequired},t.default=O},3435:function(e,t,n){"use strict";n.d(t,"c",function(){return T}),n.d(t,"b",function(){return E}),n.d(t,"a",function(){return _});var a=n(7),o=n.n(a),r=n(1),i=n.n(r),s=n(0),l=n.n(s),u=n(3484),c=n(3336),d=n.n(c),p=n(85),f=n(3359),h=n(3360),m={accessView:{fontWeight:"400",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",padding:"4px 8px"},accessDescription:{display:"flex",flexDirection:"column",flex:1,paddingLeft:16}},y={d2:i.a.object.isRequired},g=function(e){switch(e){case"user":return"Person";case"userGroup":return"Group";case"external":return"Public";case"public":return"Business";default:return"Person"}},v=function(e){return o()({},e,{access:n.i(h.b)(e.access),onChange:function(t){e.onChange(n.i(h.a)(t))}})},b=function(e){var t=e.access,n=e.accessType,a=e.accessOptions,o=e.primaryText,r=e.secondaryText,i=e.onChange,s=e.onRemove,u=e.disabled;return l.a.createElement("div",{style:m.accessView},l.a.createElement(p.c,{icon:g(n)}),l.a.createElement("div",{style:m.accessDescription},l.a.createElement("div",null,o),l.a.createElement("div",{style:{color:"#818181",paddingTop:4}},r||" ")),l.a.createElement(f.a,{access:t,accessOptions:a,onChange:i,disabled:u}),l.a.createElement(d.a,{disabled:!s,iconStyle:{color:"#bbbbbb"},onClick:s||function(){}},l.a.createElement(p.c,{icon:"Clear"})))};b.contextTypes=y,b.propTypes={access:i.a.object.isRequired,accessType:i.a.string.isRequired,accessOptions:i.a.object.isRequired,primaryText:i.a.string.isRequired,onChange:i.a.func.isRequired,disabled:i.a.bool,secondaryText:i.a.string,onRemove:i.a.func},b.defaultProps={secondaryText:void 0,onRemove:void 0,disabled:!1};var T=n.i(u.a)(n.i(u.b)(v),n.i(u.c)(function(e){return{accessType:e.groupType,primaryText:e.groupName,accessOptions:{meta:{canView:!0,canEdit:!0,noAccess:!1},data:e.dataShareable&&{canView:!0,canEdit:!0,noAccess:!0}}}}))(b),E=n.i(u.a)(n.i(u.d)(y),n.i(u.c)(function(e){return e.d2.i18n.addStrings(["public_access","external_access","anyone_can_view_without_a_login","anyone_can_find_view_and_edit","anyone_can_find_and_view","no_access"]),{accessType:"external",primaryText:e.d2.i18n.getTranslation("external_access"),secondaryText:e.access?e.d2.i18n.getTranslation("anyone_can_view_without_a_login"):e.d2.i18n.getTranslation("no_access"),access:{meta:{canEdit:!1,canView:e.access},data:{canEdit:!1,canView:!1}},onChange:function(t){e.onChange(t.meta.canView)},accessOptions:{meta:{canView:!0,canEdit:!1,noAccess:!0}}}}))(b),S=function(e){var t=e.canView;return e.canEdit?"anyone_can_find_view_and_edit":t?"anyone_can_find_and_view":"no_access"},_=n.i(u.a)(n.i(u.b)(v),n.i(u.d)(y),n.i(u.c)(function(e){return e.d2.i18n.addStrings(["public_access","external_access","anyone_can_view_without_a_login","anyone_can_find_view_and_edit","anyone_can_find_and_view","no_access"]),{accessType:"public",primaryText:e.d2.i18n.getTranslation("public_access"),secondaryText:e.d2.i18n.getTranslation(S(e.access.meta)),accessOptions:{meta:{canView:!0,canEdit:!0,noAccess:!0},data:e.dataShareable&&{canView:!0,canEdit:!0,noAccess:!0}}}}))(b)},3436:function(e,t,n){"use strict";var a=n(1),o=n.n(a),r=n(0),i=n.n(r),s=function(e,t){var n=e.author;t.d2.i18n.addStrings(["created_by","no_author"]);var a=n?t.d2.i18n.getTranslation("created_by")+": "+n.name:t.d2.i18n.getTranslation("no_author");return i.a.createElement("div",null,a)};s.propTypes={author:o.a.object.isRequired},s.contextTypes={d2:o.a.object.isRequired},t.a=s},3437:function(e,t,n){"use strict";var a=n(6),o=n.n(a),r=n(2),i=n.n(r),s=n(5),l=n.n(s),u=n(4),c=n.n(u),d=n(1),p=n.n(d),f=n(0),h=n.n(f),m=n(85),y=n(3337),g=n.n(y),v=function(e){function t(){var e,n,a,r;i()(this,t);for(var s=arguments.length,u=Array(s),c=0;c<s;c++)u[c]=arguments[c];return n=a=l()(this,(e=t.__proto__||o()(t)).call.apply(e,[this].concat(u))),a.ref=null,a.render=function(){return a.props.disabled?null:h.a.createElement(g.a,{insetChildren:!0,leftIcon:a.props.isSelected?h.a.createElement(m.c,{icon:"Done"}):void 0,primaryText:a.props.primaryText,value:a.props.value,disabled:a.props.disabled,onClick:a.props.onClick,focusState:a.props.focusState})},r=n,l()(a,r)}return c()(t,e),t}(f.Component);v.propTypes={disabled:p.a.bool.isRequired,isSelected:p.a.bool,primaryText:p.a.string.isRequired,value:p.a.object.isRequired,onClick:p.a.func,focusState:p.a.string},v.defaultProps={onClick:void 0,focusState:"none",isSelected:!1},v.muiName="MenuItem",t.a=v},3438:function(e,t,n){"use strict";var a=n(68),o=n.n(a),r=n(7),i=n.n(r),s=n(6),l=n.n(s),u=n(2),c=n.n(u),d=n(3),p=n.n(d),f=n(5),h=n.n(f),m=n(4),y=n.n(m),g=n(1),v=n.n(g),b=n(0),T=n.n(b),E=n(3335),S=n.n(E),_=n(3365),C=n.n(_),O=n(85),x=n(3440),w=n(3436),k=n(3435),P={createdBy:{color:"#818181"},titleBodySpace:{paddingTop:30},rules:{height:"240px",overflowY:"scroll"}},A=function(e){function t(e,n){c()(this,t);var a=h()(this,(t.__proto__||l()(t)).call(this,e));return a.onAccessRuleChange=function(e){return function(t){var n=function(n){return n.id===e?i()({},n,{access:t}):n},o=(a.props.sharedObject.object.userAccesses||[]).map(n),r=(a.props.sharedObject.object.userGroupAccesses||[]).map(n);a.props.onChange({userAccesses:o,userGroupAccesses:r})}},a.onAccessRemove=function(e){return function(){var t=function(t){return t.id!==e},n=(a.props.sharedObject.object.userAccesses||[]).filter(t),o=(a.props.sharedObject.object.userGroupAccesses||[]).filter(t);a.props.onChange({userAccesses:n,userGroupAccesses:o})}},a.onPublicAccessChange=function(e){a.props.onChange({publicAccess:e})},a.onExternalAccessChange=function(e){a.props.onChange({externalAccess:e})},a.setAccessListRef=function(e){a.accessListRef=e},a.accessListRef=null,a.addUserAccess=function(e){var t=a.props.sharedObject.object.userAccesses||[];a.props.onChange({userAccesses:[].concat(o()(t),[e])},a.scrollAccessListToBottom())},a.addUserGroupAccess=function(e){var t=a.props.sharedObject.object.userGroupAccesses||[];a.props.onChange({userGroupAccesses:[].concat(o()(t),[e])},a.scrollAccessListToBottom())},a.scrollAccessListToBottom=function(){a.accessListRef.scrollTop=a.accessListRef.scrollHeight},n.d2.i18n.addStrings(["who_has_access"]),a}return y()(t,e),p()(t,[{key:"render",value:function(){var e=this,t=this.props.sharedObject.object,n=t.user,a=t.displayName,o=t.userAccesses,r=t.userGroupAccesses,i=t.publicAccess,s=t.externalAccess,l=this.props.sharedObject.meta,u=l.allowPublicAccess,c=l.allowExternalAccess,d=(o||[]).map(function(e){return e.id}).concat((r||[]).map(function(e){return e.id}));return T.a.createElement("div",null,T.a.createElement(O.b,{text:a,level:2}),T.a.createElement(w.a,{author:n}),T.a.createElement("div",{style:P.titleBodySpace}),T.a.createElement(C.a,null,this.context.d2.i18n.getTranslation("who_has_access")),T.a.createElement(S.a,null),T.a.createElement("div",{style:P.rules,ref:this.setAccessListRef},T.a.createElement(k.a,{access:i,disabled:!u,dataShareable:this.props.dataShareable,onChange:this.onPublicAccessChange}),T.a.createElement(S.a,null),T.a.createElement(k.b,{access:s,disabled:!c,onChange:this.onExternalAccessChange}),T.a.createElement(S.a,null),o&&o.map(function(t){return T.a.createElement("div",{key:t.id},T.a.createElement(k.c,{groupName:t.displayName,groupType:"user",access:t.access,dataShareable:e.props.dataShareable,onRemove:e.onAccessRemove(t.id),onChange:e.onAccessRuleChange(t.id)}),T.a.createElement(S.a,null))}),r&&r.map(function(t){return T.a.createElement("div",{key:t.id},T.a.createElement(k.c,{access:t.access,groupName:t.displayName,groupType:"userGroup",dataShareable:e.props.dataShareable,onRemove:e.onAccessRemove(t.id),onChange:e.onAccessRuleChange(t.id)}),T.a.createElement(S.a,null))})),T.a.createElement(x.a,{onSearch:this.props.onSearch,addUserAccess:this.addUserAccess,addUserGroupAccess:this.addUserGroupAccess,dataShareable:this.props.dataShareable,currentAccessIds:d}))}}]),t}(T.a.Component);A.propTypes={sharedObject:v.a.object.isRequired,dataShareable:v.a.bool.isRequired,onChange:v.a.func.isRequired,onSearch:v.a.func.isRequired},A.contextTypes={d2:v.a.object.isRequired},t.a=A},3439:function(e,t,n){"use strict";var a=n(7),o=n.n(a),r=n(6),i=n.n(r),s=n(2),l=n.n(s),u=n(3),c=n.n(u),d=n(5),p=n.n(d),f=n(4),h=n.n(f),m=n(3443),y=n.n(m),g=n(3361),v=n.n(g),b=n(3459),T=n.n(b),E=n(3462),S=n.n(E),_=n(1),C=n.n(_),O=n(0),x=n.n(O),w=n(3438),k=n(85),P={loadingMask:{position:"relative"}},A={sharedObject:null,errorMessage:""},D=function(e){function t(e){l()(this,t);var n=p()(this,(t.__proto__||i()(t)).call(this,e));return R.call(n),e.d2?e.d2.i18n.addStrings(["share","close","no_manage_access"]):console.error("no d2"),n}return h()(t,e),c()(t,[{key:"getChildContext",value:function(){return{d2:this.props.d2}}},{key:"componentDidMount",value:function(){this.loadDataSharingSettings(),this.props.open&&this.isReadyToLoadObject(this.props)&&this.loadObjectFromApi(this.props)}},{key:"componentWillReceiveProps",value:function(e){var t=this.createPropsChecker(e);(t("id")||t("type")||t("sharedObject"))&&this.isReadyToLoadObject(e)&&(this.resetState(),e.open&&this.loadObjectFromApi(e)),!this.props.open&&e.open&&this.isReadyToLoadObject(e)&&this.loadObjectFromApi(e)}},{key:"render",value:function(){var e=-1!==this.state.dataShareableTypes.indexOf(this.props.type),t=""!==this.state.errorMessage,n=!this.state.sharedObject&&this.props.open&&!t,a=[x.a.createElement(v.a,{label:this.translate("close"),onClick:this.closeDialog})];return this.props.doNotPost&&a.push(x.a.createElement(T.a,{primary:!0,style:{marginLeft:"8px"},label:this.translate("apply"),onClick:this.confirmAndCloseDialog})),x.a.createElement("div",null,x.a.createElement(S.a,{open:t,message:this.state.errorMessage,autoHideDuration:3e3}),x.a.createElement(y.a,o()({autoDetectWindowHeight:!0,autoScrollBodyContent:!0,open:this.props.open,title:this.props.d2.i18n.getTranslation("share"),actions:a,onRequestClose:this.closeDialog},this.props),n&&x.a.createElement(k.a,{style:P.loadingMask,size:1}),this.state.sharedObject&&x.a.createElement(w.a,{sharedObject:this.state.sharedObject,dataShareable:e,onChange:this.onSharingChanged,onSearch:this.onSearchRequest})))}}]),t}(x.a.Component),R=function(){var e=this;this.state=o()({},A,{dataShareableTypes:[]}),this.isReadyToLoadObject=function(e){return e.type&&(e.id||e.sharedObject)},this.onSearchRequest=function(t){return e.props.d2.Api.getApi().get("sharing/search",{key:t}).then(function(e){return e})},this.onSharingChanged=function(t,n){var a={meta:e.state.sharedObject.meta,object:o()({},e.state.sharedObject.object,t)};e.props.doNotPost?e.updateSharedObject(a,n):e.postChanges(a,n)},this.createPropsChecker=function(t){return function(n){return t[n]!==e.props[n]}},this.postChanges=function(t,n){var a="sharing?type="+e.props.type+"&id="+e.props.id;return e.props.d2.Api.getApi().post(a,t).then(function(a){var o=a.httpStatus,r=a.message;return"OK"===o&&e.updateSharedObject(t,n),r}).catch(function(t){var n=t.message;e.setState({errorMessage:n})})},this.updateSharedObject=function(t,n){e.setState({sharedObject:t},function(){n&&n()})},this.resetState=function(){e.setState(A)},this.loadDataSharingSettings=function(){e.props.d2.Api.getApi().get("schemas",{fields:["name","dataShareable"]}).then(function(t){var n=t.schemas.filter(function(e){return e.dataShareable}).map(function(e){return e.name});e.setState({dataShareableTypes:n})})},this.loadObjectFromApi=function(t){var n=function(t){e.setState({sharedObject:t})};t.sharedObject?n(t.sharedObject):e.props.d2.Api.getApi().get("sharing",{type:t.type,id:t.id}).then(function(e){return n(e)}).catch(function(t){e.setState({errorMessage:t.message})})},this.addId=function(t){return o()({},t,{id:e.props.id})},this.closeDialog=function(){e.props.onRequestClose(e.addId(e.state.sharedObject.object,e.props.id))},this.confirmAndCloseDialog=function(){e.props.onConfirm(e.addId(e.state.sharedObject.object,e.props.id))},this.translate=function(t){return e.props.d2.i18n.getTranslation(t)}};D.childContextTypes={d2:C.a.object},D.propTypes={open:C.a.bool.isRequired,type:C.a.string,id:C.a.string,doNotPost:C.a.bool,sharedObject:C.a.shape({object:C.a.shape({user:C.a.shape({name:C.a.string}).isRequired,displayName:C.a.string.isRequired,userAccesses:C.a.array.isRequired,userGroupAccesses:C.a.array.isRequired,publicAccess:C.a.string.isRequired,externalAccess:C.a.bool}),meta:C.a.shape({allowPublicAccess:C.a.bool.isRequired,allowExternalAccess:C.a.bool.isRequired})}),onRequestClose:C.a.func.isRequired,onConfirm:C.a.func,d2:C.a.object.isRequired},D.defaultProps={type:"",id:"",doNotPost:!1,sharedObject:null},t.a=D},3440:function(e,t,n){"use strict";var a=n(7),o=n.n(a),r=n(6),i=n.n(r),s=n(2),l=n.n(s),u=n(3),c=n.n(u),d=n(5),p=n.n(d),f=n(4),h=n.n(f),m=n(0),y=n.n(m),g=n(1),v=n.n(g),b=n(51),T=(n.n(b),n(732)),E=(n.n(T),n(1318)),S=(n.n(E),n(3442)),_=n.n(S),C=n(3360),O=n(3359),x={container:{fontWeight:"400",padding:16,backgroundColor:"#F5F5F5",display:"flex",flexDirection:"column",justifyContent:"center"},innerContainer:{display:"flex",flexDirection:"row",flex:1},title:{color:"#818181",paddingBottom:8},searchBox:{backgroundColor:"white",boxShadow:"2px 2px 2px #cccccc",padding:"0px 16px",marginRight:"16px"}},w=function(e){function t(e,a){l()(this,t);var r=p()(this,(t.__proto__||i()(t)).call(this,e));return r.state={defaultAccess:{meta:{canView:!0,canEdit:!0},data:{canView:!1,canEdit:!1}},searchResult:[],searchText:""},r.onResultClick=function(e,t){r.inputStream.next("");var a=r.state.searchResult[t],i=a.type;delete a.type,"userAccess"===i?r.props.addUserAccess(o()({},a,{access:n.i(C.a)(r.state.defaultAccess)})):r.props.addUserGroupAccess(o()({},a,{access:n.i(C.a)(r.state.defaultAccess)})),r.clearSearchText()},r.inputStream=new b.Subject,r.hasNoCurrentAccess=function(e){return-1===r.props.currentAccessIds.indexOf(e.id)},r.fetchSearchResult=function(e){""===e?r.handleSearchResult([]):r.props.onSearch(e).then(function(e){var t=e.users,n=e.userGroups,a=function(e){return function(t){return o()({},t,{type:e})}},i=t.map(a("userAccess")).filter(r.hasNoCurrentAccess).concat(n.map(a("userGroupAccess")).filter(r.hasNoCurrentAccess));r.handleSearchResult(i)})},r.handleSearchResult=function(e){r.setState({searchResult:e})},r.handleUpdateInput=function(e){r.inputStream.next(e),r.setState({searchText:e})},r.accessOptionsChanged=function(e){r.setState({defaultAccess:e})},r.clearSearchText=function(){r.setState({searchText:""})},r.noFilter=function(){return!0},a.d2.i18n.addStrings(["add_users_and_user_groups","enter_names"]),r}return h()(t,e),c()(t,[{key:"componentWillMount",value:function(){var e=this;this.inputStream.pipe(n.i(E.debounce)(function(){return n.i(T.timer)(300)})).subscribe(function(t){e.fetchSearchResult(t)})}},{key:"render",value:function(){return y.a.createElement("div",{style:x.container},y.a.createElement("div",{style:x.title},this.context.d2.i18n.getTranslation("add_users_and_user_groups")),y.a.createElement("div",{style:x.innerContainer},y.a.createElement(_.a,{fullWidth:!0,openOnFocus:!0,filter:this.noFilter,dataSource:this.state.searchResult,dataSourceConfig:{text:"displayName",value:"id"},hintText:this.context.d2.i18n.getTranslation("enter_names"),onNewRequest:this.onResultClick,onUpdateInput:this.handleUpdateInput,style:x.searchBox,searchText:this.state.searchText,underlineShow:!1}),y.a.createElement(O.a,{access:this.state.defaultAccess,accessOptions:{meta:{canView:!0,canEdit:!0,noAccess:!1},data:this.props.dataShareable&&{canView:!0,canEdit:!0,noAccess:!0}},onChange:this.accessOptionsChanged})))}}]),t}(m.Component);w.propTypes={onSearch:v.a.func.isRequired,addUserAccess:v.a.func.isRequired,dataShareable:v.a.bool.isRequired,addUserGroupAccess:v.a.func.isRequired,currentAccessIds:v.a.array.isRequired},w.contextTypes={d2:v.a.object.isRequired},t.a=w},3441:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=n.anchorEl,o=e.fullWidth,r={root:{display:"inline-block",position:"relative",width:o?"100%":256},menu:{width:"100%"},list:{display:"block",width:o?"100%":256},innerDiv:{overflow:"hidden"}};return a&&o&&(r.popover={width:a.clientWidth}),r}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(96),l=a(s),u=n(8),c=a(u),d=n(6),p=a(d),f=n(2),h=a(f),m=n(3),y=a(m),g=n(5),v=a(g),b=n(4),T=a(b),E=n(9),S=a(E),_=n(0),C=a(_),O=n(1),x=a(O),w=n(14),k=a(w),P=n(35),A=a(P),D=n(3470),R=a(D),I=n(3364),F=a(I),N=n(3337),M=a(N),j=n(3335),L=a(j),B=n(3338),q=a(B),U=n(3319),H=(a(U),function(e){function t(){var e,n,a,o;(0,h.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,v.default)(this,(e=t.__proto__||(0,p.default)(t)).call.apply(e,[this].concat(i))),a.state={anchorEl:null,focusTextField:!0,open:!1,searchText:void 0},a.handleRequestClose=function(){a.state.focusTextField||a.close()},a.handleMouseDown=function(e){e.preventDefault()},a.handleItemTouchTap=function(e,t){var n=a.props.dataSource,o=parseInt(t.key,10),r=n[o],i=a.chosenRequestText(r),s=function(){return a.props.onUpdateInput(i,a.props.dataSource,{source:"click"})};a.timerTouchTapCloseId=function(){return setTimeout(function(){a.timerTouchTapCloseId=null,a.close(),a.props.onNewRequest(r,o)},a.props.menuCloseDelay)},void 0!==a.props.searchText?(s(),a.timerTouchTapCloseId()):a.setState({searchText:i},function(){s(),a.timerTouchTapCloseId()})},a.chosenRequestText=function(e){return"string"==typeof e?e:e[a.props.dataSourceConfig.text]},a.handleEscKeyDown=function(){a.close()},a.handleKeyDown=function(e){switch(a.props.onKeyDown&&a.props.onKeyDown(e),(0,A.default)(e)){case"enter":a.close();var t=a.state.searchText;""!==t&&a.props.onNewRequest(t,-1);break;case"esc":a.close();break;case"down":e.preventDefault(),a.setState({open:!0,focusTextField:!1,anchorEl:k.default.findDOMNode(a.refs.searchTextField)})}},a.handleChange=function(e){var t=e.target.value;if(t!==a.state.searchText){var n={open:!0,anchorEl:k.default.findDOMNode(a.refs.searchTextField)};void 0===a.props.searchText&&(n.searchText=t),a.setState(n),a.props.onUpdateInput(t,a.props.dataSource,{source:"change"})}},a.handleBlur=function(e){a.state.focusTextField&&null===a.timerTouchTapCloseId&&(a.timerBlurClose=setTimeout(function(){a.close()},0)),a.props.onBlur&&a.props.onBlur(e)},a.handleFocus=function(e){!a.state.open&&a.props.openOnFocus&&a.setState({open:!0,anchorEl:k.default.findDOMNode(a.refs.searchTextField)}),a.setState({focusTextField:!0}),a.props.onFocus&&a.props.onFocus(e)},o=n,(0,v.default)(a,o)}return(0,T.default)(t,e),(0,y.default)(t,[{key:"componentWillMount",value:function(){this.requestsList=[],this.setState({open:this.props.open,searchText:this.props.searchText||""}),this.timerTouchTapCloseId=null}},{key:"componentWillReceiveProps",value:function(e){this.props.searchText!==e.searchText&&this.setState({searchText:e.searchText}),this.props.open!==e.open&&this.setState({open:e.open,anchorEl:k.default.findDOMNode(this.refs.searchTextField)})}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timerTouchTapCloseId),clearTimeout(this.timerBlurClose)}},{key:"close",value:function(){this.setState({open:!1,anchorEl:null}),this.props.onClose&&this.props.onClose()}},{key:"blur",value:function(){this.refs.searchTextField.blur()}},{key:"focus",value:function(){this.refs.searchTextField.focus()}},{key:"render",value:function(){var e=this,t=this.props,n=t.anchorOrigin,a=t.animated,r=t.animation,s=t.dataSource,u=(t.dataSourceConfig,t.disableFocusRipple),d=t.errorStyle,p=t.floatingLabelText,f=t.filter,h=t.fullWidth,m=t.style,y=t.hintText,g=t.maxSearchResults,v=(t.menuCloseDelay,t.textFieldStyle),b=t.menuStyle,T=t.menuProps,E=t.listStyle,_=t.targetOrigin,O=(t.onBlur,t.onClose,t.onFocus,t.onKeyDown,t.onNewRequest,t.onUpdateInput,t.openOnFocus,t.popoverProps),x=(t.searchText,(0,c.default)(t,["anchorOrigin","animated","animation","dataSource","dataSourceConfig","disableFocusRipple","errorStyle","floatingLabelText","filter","fullWidth","style","hintText","maxSearchResults","menuCloseDelay","textFieldStyle","menuStyle","menuProps","listStyle","targetOrigin","onBlur","onClose","onFocus","onKeyDown","onNewRequest","onUpdateInput","openOnFocus","popoverProps","searchText"])),w=O||{},k=w.style,P=(0,c.default)(w,["style"]),A=this.state,D=A.open,I=A.anchorEl,N=A.searchText,j=A.focusTextField,B=this.context.muiTheme.prepareStyles,U=o(this.props,this.context,this.state),H=[];s.every(function(t,n){switch(void 0===t?"undefined":(0,l.default)(t)){case"string":f(N,t,t)&&H.push({text:t,value:C.default.createElement(M.default,{innerDivStyle:U.innerDiv,value:t,primaryText:t,disableFocusRipple:u,key:n})});break;case"object":if(t&&"string"==typeof t[e.props.dataSourceConfig.text]){var a=t[e.props.dataSourceConfig.text];if(!e.props.filter(N,a,t))break;var o=t[e.props.dataSourceConfig.value];!o.type||o.type.muiName!==M.default.muiName&&o.type.muiName!==L.default.muiName?H.push({text:a,value:C.default.createElement(M.default,{innerDivStyle:U.innerDiv,primaryText:a,disableFocusRipple:u,key:n})}):H.push({text:a,value:C.default.cloneElement(o,{key:n,disableFocusRipple:u})})}}return!(g&&g>0&&H.length===g)}),this.requestsList=H;var W=D&&H.length>0&&C.default.createElement(F.default,(0,i.default)({ref:"menu",autoWidth:!1,disableAutoFocus:j,onEscKeyDown:this.handleEscKeyDown,initiallyKeyboardFocused:!0,onItemTouchTap:this.handleItemTouchTap,onMouseDown:this.handleMouseDown,style:(0,S.default)(U.menu,b),listStyle:(0,S.default)(U.list,E)},T),H.map(function(e){return e.value}));return C.default.createElement("div",{style:B((0,S.default)(U.root,m))},C.default.createElement(R.default,(0,i.default)({ref:"searchTextField",autoComplete:"off",onBlur:this.handleBlur,onFocus:this.handleFocus,onKeyDown:this.handleKeyDown,floatingLabelText:p,hintText:y,fullWidth:h,multiLine:!1,errorStyle:d,style:v},x,{value:N,onChange:this.handleChange})),C.default.createElement(q.default,(0,i.default)({style:(0,S.default)({},U.popover,k),canAutoPosition:!1,anchorOrigin:n,targetOrigin:_,open:D,anchorEl:I,useLayerForClickAway:!1,onRequestClose:this.handleRequestClose,animated:a,animation:r},P),W))}}]),t}(_.Component));H.defaultProps={anchorOrigin:{vertical:"bottom",horizontal:"left"},animated:!0,dataSourceConfig:{text:"text",value:"value"},disableFocusRipple:!0,filter:function(e,t){return""!==e&&-1!==t.indexOf(e)},fullWidth:!1,open:!1,openOnFocus:!1,onUpdateInput:function(){},onNewRequest:function(){},menuCloseDelay:300,targetOrigin:{vertical:"top",horizontal:"left"}},H.contextTypes={muiTheme:x.default.object.isRequired},H.propTypes={},H.levenshteinDistance=function(e,t){for(var n=[],a=void 0,o=void 0,r=0;r<=t.length;r++)for(var i=0;i<=e.length;i++)o=r&&i?e.charAt(i-1)===t.charAt(r-1)?a:Math.min(n[i],n[i-1],a)+1:r+i,a=n[i],n[i]=o;return n.pop()},H.noFilter=function(){return!0},H.defaultFilter=H.caseSensitiveFilter=function(e,t){return""!==e&&-1!==t.indexOf(e)},H.caseInsensitiveFilter=function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},H.levenshteinDistanceFilter=function(e){if(void 0===e)return H.levenshteinDistance;if("number"!=typeof e)throw"Error: AutoComplete.levenshteinDistanceFilter is a filter generator, not a filter!";return function(t,n){return H.levenshteinDistance(t,n)<e}},H.fuzzyFilter=function(e,t){var n=t.toLowerCase();e=e.toLowerCase();for(var a=0,o=0;o<t.length;o++)n[o]===e[a]&&(a+=1);return a===e.length},H.Item=M.default,H.Divider=L.default,t.default=H},3442:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3441),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3443:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e.autoScrollBodyContent,a=e.open,o=t.muiTheme,r=o.baseTheme,i=r.spacing,s=r.palette,l=o.dialog,u=o.zIndex,c=i.desktopGutter,d="1px solid "+s.borderColor;return{root:{position:"fixed",boxSizing:"border-box",WebkitTapHighlightColor:"rgba(0,0,0,0)",zIndex:u.dialog,top:0,left:a?0:-1e4,width:"100%",height:"100%",transition:a?R.default.easeOut("0ms","left","0ms"):R.default.easeOut("0ms","left","450ms")},content:{boxSizing:"border-box",WebkitTapHighlightColor:"rgba(0,0,0,0)",transition:R.default.easeOut(),position:"relative",width:"75%",maxWidth:12*i.desktopKeylineIncrement,margin:"0 auto",zIndex:u.dialog},actionsContainer:{boxSizing:"border-box",WebkitTapHighlightColor:"rgba(0,0,0,0)",padding:8,width:"100%",textAlign:"right",marginTop:n?-1:0},overlay:{zIndex:u.dialogOverlay},title:{margin:0,padding:c+"px "+c+"px 20px "+c+"px",color:s.textColor,fontSize:l.titleFontSize,lineHeight:"32px",fontWeight:400,marginBottom:n?-1:0},body:{fontSize:l.bodyFontSize,color:l.bodyColor,padding:(e.title?0:c)+"px "+c+"px "+c+"px",boxSizing:"border-box",overflowY:n?"auto":"hidden",borderTop:n?d:"none",borderBottom:n?d:"none"}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(14),x=a(O),w=n(721),k=a(w),P=n(35),A=a(P),D=n(3318),R=a(D),I=n(3474),F=a(I),N=n(3367),M=a(N),j=n(3325),L=a(j),B=n(205),q=a(B),U=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={style:{}},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillUnmount",value:function(){clearTimeout(this.enterTimeout),clearTimeout(this.leaveTimeout)}},{key:"componentWillEnter",value:function(e){this.componentWillAppear(e)}},{key:"componentWillAppear",value:function(e){var t=this.context.muiTheme.baseTheme.spacing;this.setState({style:{opacity:1,transform:"translate(0, "+t.desktopKeylineIncrement+"px)"}}),this.enterTimeout=setTimeout(e,450)}},{key:"componentWillLeave",value:function(e){this.setState({style:{opacity:0,transform:"translate(0, 0)"}}),this.leaveTimeout=setTimeout(e,450)}},{key:"render",value:function(){var e=this.props,t=e.style,n=e.children,a=(0,l.default)(e,["style","children"]),o=this.context.muiTheme.prepareStyles;return S.default.createElement("div",(0,i.default)({},a,{style:o((0,T.default)({},this.state.style,t))}),n)}}]),t}(E.Component);U.contextTypes={muiTheme:C.default.object.isRequired},U.propTypes={};var H=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.handleTouchTapOverlay=function(){a.requestClose(!1)},a.handleKeyUp=function(e){"esc"===(0,A.default)(e)&&a.requestClose(!1)},a.handleResize=function(){a.positionDialog()},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){this.positionDialog()}},{key:"componentDidUpdate",value:function(){this.positionDialog()}},{key:"positionDialog",value:function(){var e=this.props,t=e.actions,n=e.autoDetectWindowHeight,a=e.autoScrollBodyContent,r=e.bodyStyle,i=e.open,s=e.repositionOnUpdate,l=e.title;if(i){var u=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=x.default.findDOMNode(this),d=x.default.findDOMNode(this.refs.dialogWindow),p=x.default.findDOMNode(this.refs.dialogContent);d.style.height="",p.style.height="";var f=d.offsetHeight,h=(u-f)/2-64;if(h<16&&(h=16),!s&&c.style.paddingTop||(c.style.paddingTop=h+"px"),n||a){var m=o(this.props,this.context);m.body=(0,T.default)(m.body,r);var y=u-128;l&&(y-=p.previousSibling.offsetHeight),S.default.Children.count(t)&&(y-=p.nextSibling.offsetHeight),p.style.maxHeight=y+"px",y>f&&(p.style.borderBottom="none",p.style.borderTop="none")}}}},{key:"requestClose",value:function(e){!e&&this.props.modal||this.props.onRequestClose&&this.props.onRequestClose(!!e)}},{key:"render",value:function(){var e=this.props,t=e.actions,n=e.actionsContainerClassName,a=e.actionsContainerStyle,r=e.bodyClassName,s=e.bodyStyle,l=e.children,u=e.className,c=e.contentClassName,d=e.contentStyle,p=e.overlayClassName,f=e.overlayStyle,h=e.open,m=e.paperClassName,y=e.paperProps,g=e.style,v=e.titleClassName,b=e.titleStyle,E=e.title,_=this.context.muiTheme.prepareStyles,C=o(this.props,this.context);C.root=(0,T.default)(C.root,g),C.content=(0,T.default)(C.content,d),C.body=(0,T.default)(C.body,s),C.actionsContainer=(0,T.default)(C.actionsContainer,a),C.overlay=(0,T.default)(C.overlay,f),C.title=(0,T.default)(C.title,b);var O=S.default.Children.count(t)>0&&S.default.createElement("div",{className:n,style:_(C.actionsContainer)},S.default.Children.toArray(t)),x=E;return S.default.isValidElement(E)?x=S.default.cloneElement(E,{className:E.props.className||v,style:_((0,T.default)(C.title,E.props.style))}):"string"==typeof E&&(x=S.default.createElement("h3",{className:v,style:_(C.title)},E)),S.default.createElement("div",{className:u,style:_(C.root)},h&&S.default.createElement(k.default,{target:"window",onKeyUp:this.handleKeyUp,onResize:this.handleResize}),S.default.createElement(q.default,{component:"div",ref:"dialogWindow",transitionAppear:!0,transitionAppearTimeout:450,transitionEnter:!0,transitionEnterTimeout:450},h&&S.default.createElement(U,{className:c,style:C.content},S.default.createElement(L.default,(0,i.default)({className:m,zDepth:4},y),x,S.default.createElement("div",{ref:"dialogContent",className:r,style:_(C.body)},l),O))),S.default.createElement(F.default,{show:h,className:p,style:C.overlay,onClick:this.handleTouchTapOverlay}))}}]),t}(E.Component);H.contextTypes={muiTheme:C.default.object.isRequired},H.propTypes={};var W=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.renderLayer=function(){return S.default.createElement(H,a.props)},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){return S.default.createElement(M.default,{render:this.renderLayer,open:!0,useLayerForClickAway:!1})}}]),t}(E.Component);W.contextTypes={muiTheme:C.default.object.isRequired},W.defaultProps={autoDetectWindowHeight:!0,autoScrollBodyContent:!1,modal:!1,repositionOnUpdate:!0},W.propTypes={},t.default=W},3444:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(9),u=a(l),c=n(0),d=a(c),p=n(1),f=a(p),h=function(e,t){var n=e.inset,a=e.style,o=(0,s.default)(e,["inset","style"]),i=t.muiTheme,l=i.baseTheme,c=i.prepareStyles,p={root:{margin:0,marginTop:-1,marginLeft:n?72:0,height:1,border:"none",backgroundColor:l.palette.borderColor}};return d.default.createElement("hr",(0,r.default)({},o,{style:c((0,u.default)(p.root,a))}))};h.muiName="Divider",h.propTypes={},h.defaultProps={inset:!1},h.contextTypes={muiTheme:f.default.object.isRequired},t.default=h},3445:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=t.muiTheme.baseTheme;return{root:{position:"relative",paddingLeft:n.spacing.desktopGutterLess,paddingRight:n.spacing.desktopGutterLess,verticalAlign:"middle"}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=a(r),s=n(2),l=a(s),u=n(3),c=a(u),d=n(5),p=a(d),f=n(4),h=a(f),m=n(9),y=a(m),g=n(0),v=a(g),b=n(1),T=a(b),E=function(e){function t(){return(0,l.default)(this,t),(0,p.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,h.default)(t,e),(0,c.default)(t,[{key:"render",value:function(){var e=this.props,t=e.label,n=e.style,a=this.context.muiTheme.prepareStyles,r=o(this.props,this.context);return v.default.createElement("span",{style:a((0,y.default)(r.root,n))},t)}}]),t}(g.Component);E.contextTypes={muiTheme:T.default.object.isRequired},E.propTypes={},t.default=E},3446:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3361),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3447:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=e.color,o=e.hoverColor,r=t.muiTheme.baseTheme,i=a||r.palette.textColor,s=o||i;return{root:{color:n.hovered?s:i,position:"relative",fontSize:r.spacing.iconSize,display:"inline-block",userSelect:"none",transition:x.default.easeOut()}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3318),x=a(O),w=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={hovered:!1},a.handleMouseLeave=function(e){void 0!==a.props.hoverColor&&a.setState({hovered:!1}),a.props.onMouseLeave&&a.props.onMouseLeave(e)},a.handleMouseEnter=function(e){void 0!==a.props.hoverColor&&a.setState({hovered:!0}),a.props.onMouseEnter&&a.props.onMouseEnter(e)},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=(e.hoverColor,e.onMouseLeave,e.onMouseEnter,e.style),n=(0,l.default)(e,["hoverColor","onMouseLeave","onMouseEnter","style"]),a=this.context.muiTheme.prepareStyles,r=o(this.props,this.context,this.state);return S.default.createElement("span",(0,i.default)({},n,{onMouseLeave:this.handleMouseLeave,onMouseEnter:this.handleMouseEnter,style:a((0,T.default)(r.root,t))}))}}]),t}(E.Component);w.muiName="FontIcon",w.defaultProps={onMouseEnter:function(){},onMouseLeave:function(){}},w.contextTypes={muiTheme:C.default.object.isRequired},w.propTypes={},t.default=w},3448:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3447),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3449:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=t.muiTheme.baseTheme;return{root:{boxSizing:"border-box",overflow:"visible",transition:x.default.easeOut(),padding:n.spacing.iconSize/2,width:2*n.spacing.iconSize,height:2*n.spacing.iconSize,fontSize:0},tooltip:{boxSizing:"border-box"},disabled:{color:n.palette.disabledColor,fill:n.palette.disabledColor,cursor:"default"}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3318),x=a(O),w=n(3319),k=(a(w),n(3329)),P=a(k),A=n(3448),D=a(A),R=n(3477),I=a(R),F=n(3482),N=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={hovered:!1,isKeyboardFocused:!1,touch:!1,tooltipShown:!1},a.handleBlur=function(e){a.hideTooltip(),a.props.onBlur&&a.props.onBlur(e)},a.handleFocus=function(e){a.showTooltip(),a.props.onFocus&&a.props.onFocus(e)},a.handleMouseLeave=function(e){a.button.isKeyboardFocused()||a.hideTooltip(),a.setState({hovered:!1}),a.props.onMouseLeave&&a.props.onMouseLeave(e)},a.handleMouseOut=function(e){a.props.disabled&&a.hideTooltip(),a.props.onMouseOut&&a.props.onMouseOut(e)},a.handleMouseEnter=function(e){a.showTooltip(),a.state.touch||a.setState({hovered:!0}),a.props.onMouseEnter&&a.props.onMouseEnter(e)},a.handleTouchStart=function(e){a.setState({touch:!0}),a.props.onTouchStart&&a.props.onTouchStart(e)},a.handleKeyboardFocus=function(e,t){var n=a.props,o=n.disabled,r=n.onFocus,i=n.onBlur,s=n.onKeyboardFocus;t&&!o?(a.showTooltip(),r&&r(e)):(a.hideTooltip(),i&&i(e)),a.setState({isKeyboardFocused:t}),s&&s(e,t)},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillReceiveProps",value:function(e){e.disabled&&this.setState({hovered:!1})}},{key:"setKeyboardFocus",value:function(){this.button.setKeyboardFocus()}},{key:"showTooltip",value:function(){this.props.tooltip&&this.setState({tooltipShown:!0})}},{key:"hideTooltip",value:function(){this.props.tooltip&&this.setState({tooltipShown:!1})}},{key:"render",value:function(){var e=this,t=this.props,n=t.disabled,a=t.hoveredStyle,r=t.disableTouchRipple,s=t.children,u=t.iconClassName,c=t.style,d=t.tooltip,p=t.tooltipPosition,f=t.tooltipStyles,h=t.touch,m=t.iconStyle,y=(0,l.default)(t,["disabled","hoveredStyle","disableTouchRipple","children","iconClassName","style","tooltip","tooltipPosition","tooltipStyles","touch","iconStyle"]),g=void 0,v=o(this.props,this.context),b=p.split("-"),E=(this.state.hovered||this.state.isKeyboardFocused)&&!n,_=(0,T.default)(v.root,c,E?a:{}),C=d?S.default.createElement(I.default,{label:d,show:this.state.tooltipShown,touch:h,style:(0,T.default)(v.tooltip,f),verticalPosition:b[0],horizontalPosition:b[1]}):null;if(u){var O=m.iconHoverColor,x=(0,l.default)(m,["iconHoverColor"]);g=S.default.createElement(D.default,{className:u,hoverColor:n?null:O,style:(0,T.default)({},n&&v.disabled,x),color:this.context.muiTheme.baseTheme.palette.textColor},s)}var w=n?(0,T.default)({},m,v.disabled):m;return S.default.createElement(P.default,(0,i.default)({ref:function(t){return e.button=t}},y,{centerRipple:!0,disabled:n,onTouchStart:this.handleTouchStart,style:_,disableTouchRipple:r,onBlur:this.handleBlur,onFocus:this.handleFocus,onMouseLeave:this.handleMouseLeave,onMouseEnter:this.handleMouseEnter,onMouseOut:this.handleMouseOut,onKeyboardFocus:this.handleKeyboardFocus}),C,g,(0,F.extendChildren)(s,{style:w}))}}]),t}(E.Component);N.muiName="IconButton",N.defaultProps={disabled:!1,disableTouchRipple:!1,iconStyle:{},tooltipPosition:"bottom-center",touch:!1},N.contextTypes={muiTheme:C.default.object.isRequired},N.propTypes={},t.default=N},3450:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=e.autoGenerateNestedIndicator,o=e.insetChildren,r=e.leftAvatar,i=e.leftCheckbox,s=e.leftIcon,l=e.nestedItems,u=e.nestedLevel,c=e.rightAvatar,d=e.rightIcon,p=e.rightIconButton,f=e.rightToggle,h=e.secondaryText,m=e.secondaryTextLines,y=t.muiTheme,g=y.listItem,v=y.baseTheme.palette.textColor,b=e.hoverColor||(0,P.fade)(v,.1),T=!h&&(r||c),E=!h&&!(r||c),S=h&&1===m,_=h&&m>1;return{root:{backgroundColor:!(void 0!==e.isKeyboardFocused?e:n).isKeyboardFocused&&!n.hovered||n.rightIconButtonHovered||n.rightIconButtonKeyboardFocused?null:b,color:v,display:"block",fontSize:16,lineHeight:"16px",position:"relative",transition:D.default.easeOut()},innerDiv:{marginLeft:u*g.nestedLevelDepth,paddingLeft:s||r||i||o?72:16,paddingRight:d||c||p||l.length&&a?56:f?72:16,paddingBottom:T?20:16,paddingTop:E||_?16:20,position:"relative"},icons:{height:24,width:24,display:"block",position:"absolute",top:S?12:T?4:0,margin:12},leftIcon:{left:4},rightIcon:{right:4},avatars:{position:"absolute",top:T?8:16},label:{cursor:"pointer"},leftAvatar:{left:16},rightAvatar:{right:16},leftCheckbox:{position:"absolute",display:"block",width:24,top:S?24:T?16:12,left:16},primaryText:{},rightIconButton:{position:"absolute",display:"block",top:S?12:T?4:0,right:4},rightToggle:{position:"absolute",display:"block",width:54,top:S?25:T?17:13,right:8},secondaryText:{fontSize:14,lineHeight:_?"18px":"16px",height:_?36:16,margin:0,marginTop:4,color:g.secondaryTextColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:_?null:"nowrap",display:_?"-webkit-box":null,WebkitLineClamp:_?2:null,WebkitBoxOrient:_?"vertical":null}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),i=a(r),s=n(7),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(14),x=a(O),w=n(3323),k=a(w),P=n(3341),A=n(3318),D=a(A),R=n(3329),I=a(R),F=n(3336),N=a(F),M=n(3480),j=a(M),L=n(3481),B=a(L),q=n(3451),U=a(q),H=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={hovered:!1,isKeyboardFocused:!1,open:!1,rightIconButtonHovered:!1,rightIconButtonKeyboardFocused:!1,touch:!1},a.handleKeyboardFocus=function(e,t){a.setState({isKeyboardFocused:t}),a.props.onKeyboardFocus(e,t)},a.handleMouseEnter=function(e){a.state.touch||a.setState({hovered:!0}),a.props.onMouseEnter(e)},a.handleMouseLeave=function(e){a.setState({hovered:!1}),a.props.onMouseLeave(e)},a.handleTouchTap=function(e){a.props.onClick&&a.props.onClick(e),a.props.primaryTogglesNestedList&&a.handleNestedListToggle(e)},a.handleNestedListToggle=function(e){a.props.leftCheckbox&&e.preventDefault(),e.stopPropagation(),null===a.props.open?a.setState({open:!a.state.open},function(){a.props.onNestedListToggle(a)}):a.props.onNestedListToggle((0,l.default)({},a,{state:{open:!a.state.open}}))},a.handleRightIconButtonKeyboardFocus=function(e,t){t&&a.setState({isKeyboardFocused:!1,rightIconButtonKeyboardFocused:t});var n=a.props.rightIconButton;n&&n.props.onKeyboardFocus&&n.props.onKeyboardFocus(e,t)},a.handleRightIconButtonMouseLeave=function(e){var t=a.props.rightIconButton;a.setState({rightIconButtonHovered:!1}),t&&t.props.onMouseLeave&&t.props.onMouseLeave(e)},a.handleRightIconButtonMouseEnter=function(e){var t=a.props.rightIconButton;a.setState({rightIconButtonHovered:!0}),t&&t.props.onMouseEnter&&t.props.onMouseEnter(e)},a.handleRightIconButtonMouseUp=function(e){var t=a.props.rightIconButton;e.stopPropagation(),t&&t.props.onMouseUp&&t.props.onMouseUp(e)},a.handleRightIconButtonTouchTap=function(e){var t=a.props.rightIconButton;e.stopPropagation(),t&&t.props.onClick&&t.props.onClick(e)},a.handleTouchStart=function(e){a.setState({touch:!0}),a.props.onTouchStart(e)},a.handleTouchEnd=function(e){a.setState({touch:!0}),a.props.onTouchEnd(e)},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillMount",value:function(){this.setState({open:null===this.props.open?!0===this.props.initiallyOpen:this.props.open})}},{key:"componentWillReceiveProps",value:function(e){null!==e.open&&this.setState({open:e.open}),e.disabled&&this.state.hovered&&this.setState({hovered:!1})}},{key:"shouldComponentUpdate",value:function(e,t,n){return!(0,k.default)(this.props,e)||!(0,k.default)(this.state,t)||!(0,k.default)(this.context,n)}},{key:"applyFocusState",value:function(e){if(this.button){var t=x.default.findDOMNode(this.button);switch(e){case"none":t.blur();break;case"focused":t.focus();break;case"keyboard-focused":this.button.setKeyboardFocus(),t.focus()}}}},{key:"createDisabledElement",value:function(e,t,n){var a=this.props,o=a.innerDivStyle,r=a.style,i=(0,T.default)({},e.root,e.innerDiv,o,r);return S.default.createElement("div",(0,l.default)({},n,{style:this.context.muiTheme.prepareStyles(i)}),t)}},{key:"createLabelElement",value:function(e,t,n){var a=this.props,o=a.innerDivStyle,r=a.style,i=(0,T.default)({},e.root,e.innerDiv,o,e.label,r);return S.default.createElement("label",(0,l.default)({},n,{style:this.context.muiTheme.prepareStyles(i)}),t)}},{key:"createTextElement",value:function(e,t,n){var a=this.context.muiTheme.prepareStyles;if(S.default.isValidElement(t)){var o=(0,T.default)({},e,t.props.style);return"string"==typeof t.type&&(o=a(o)),S.default.cloneElement(t,{key:n,style:o})}return S.default.createElement("div",{key:n,style:a(e)},t)}},{key:"pushElement",value:function(e,t,n,a){if(t){var o=(0,T.default)({},n,t.props.style);e.push(S.default.cloneElement(t,(0,l.default)({key:e.length,style:o},a)))}}},{key:"render",value:function(){var e=this,t=this.props,n=t.autoGenerateNestedIndicator,a=t.children,r=t.containerElement,s=t.disabled,u=t.disableKeyboardFocus,c=(t.hoverColor,t.initiallyOpen,t.innerDivStyle),d=(t.insetChildren,t.leftAvatar),p=t.leftCheckbox,f=t.leftIcon,h=t.nestedItems,m=t.nestedLevel,y=t.nestedListStyle,g=(t.onKeyboardFocus,t.isKeyboardFocused,t.onMouseEnter,t.onMouseLeave,t.onNestedListToggle,t.onTouchStart,t.onClick,t.rightAvatar),v=t.rightIcon,b=t.rightIconButton,E=t.rightToggle,_=t.primaryText,C=t.primaryTogglesNestedList,O=t.secondaryText,x=(t.secondaryTextLines,t.style),w=(0,i.default)(t,["autoGenerateNestedIndicator","children","containerElement","disabled","disableKeyboardFocus","hoverColor","initiallyOpen","innerDivStyle","insetChildren","leftAvatar","leftCheckbox","leftIcon","nestedItems","nestedLevel","nestedListStyle","onKeyboardFocus","isKeyboardFocused","onMouseEnter","onMouseLeave","onNestedListToggle","onTouchStart","onClick","rightAvatar","rightIcon","rightIconButton","rightToggle","primaryText","primaryTogglesNestedList","secondaryText","secondaryTextLines","style"]),k=this.context.muiTheme.prepareStyles,P=o(this.props,this.context,this.state),A=[a];if(f){var D={color:f.props.color||this.context.muiTheme.listItem.leftIconColor};this.pushElement(A,f,(0,T.default)({},P.icons,P.leftIcon),D)}if(v){var R={color:v.props.color||this.context.muiTheme.listItem.rightIconColor};this.pushElement(A,v,(0,T.default)({},P.icons,P.rightIcon),R)}d&&this.pushElement(A,d,(0,T.default)({},P.avatars,P.leftAvatar)),g&&this.pushElement(A,g,(0,T.default)({},P.avatars,P.rightAvatar)),p&&this.pushElement(A,p,(0,T.default)({},P.leftCheckbox));var F=h.length,M=g||v||b||E,L=F&&n&&!M;if(b||L){var q=b,H={onKeyboardFocus:this.handleRightIconButtonKeyboardFocus,onMouseEnter:this.handleRightIconButtonMouseEnter,onMouseLeave:this.handleRightIconButtonMouseLeave,onClick:this.handleRightIconButtonTouchTap,onMouseDown:this.handleRightIconButtonMouseUp,onMouseUp:this.handleRightIconButtonMouseUp};L&&(q=this.state.open?S.default.createElement(N.default,null,S.default.createElement(j.default,null)):S.default.createElement(N.default,null,S.default.createElement(B.default,null)),H.onClick=this.handleNestedListToggle),this.pushElement(A,q,(0,T.default)({},P.rightIconButton),H)}if(E&&this.pushElement(A,E,(0,T.default)({},P.rightToggle)),_){var W=this.createTextElement(P.primaryText,_,"primaryText");A.push(W)}if(O){var V=this.createTextElement(P.secondaryText,O,"secondaryText");A.push(V)}var z=h.length?S.default.createElement(U.default,{nestedLevel:m,open:this.state.open,style:y},h):void 0,K=!C&&(p||E);return S.default.createElement("div",null,K?this.createLabelElement(P,A,w):s?this.createDisabledElement(P,A,w):S.default.createElement(I.default,(0,l.default)({containerElement:r},w,{disableKeyboardFocus:u||this.state.rightIconButtonKeyboardFocused,onKeyboardFocus:this.handleKeyboardFocus,onMouseLeave:this.handleMouseLeave,onMouseEnter:this.handleMouseEnter,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onClick:this.handleTouchTap,disabled:s,ref:function(t){return e.button=t},style:(0,T.default)({},P.root,x)}),S.default.createElement("div",{style:k((0,T.default)(P.innerDiv,c))},A)),z)}}]),t}(E.Component);H.muiName="ListItem",H.defaultProps={autoGenerateNestedIndicator:!0,containerElement:"span",disableKeyboardFocus:!1,disabled:!1,initiallyOpen:!1,insetChildren:!1,nestedItems:[],nestedLevel:0,onKeyboardFocus:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onNestedListToggle:function(){},onTouchEnd:function(){},onTouchStart:function(){},open:null,primaryTogglesNestedList:!1,secondaryTextLines:1},H.contextTypes={muiTheme:C.default.object.isRequired},H.propTypes={},t.default=H},3451:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(1),s=(a(i),n(3362)),l=a(s),u=function(e){var t=e.children,n=e.open,a=e.nestedLevel,i=e.style;return n?r.default.createElement(l.default,{style:i},o.Children.map(t,function(e){return(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{nestedLevel:a+1}):e})):null};u.propTypes={},t.default=u},3452:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.HotKeyHolder=void 0;var o=n(2),r=a(o),i=n(3),s=a(i);t.HotKeyHolder=function(){function e(){var t=this;(0,r.default)(this,e),this.clear=function(){t.timerId=null,t.lastKeys=null}}return(0,s.default)(e,[{key:"append",value:function(e){return clearTimeout(this.timerId),this.timerId=setTimeout(this.clear,500),this.lastKeys=(this.lastKeys||"")+e}}]),e}()},3453:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=t.muiTheme.baseTheme.palette.disabledColor,a=t.muiTheme.baseTheme.palette.textColor,o=e.desktop?64:72,r=e.desktop?24:16;return{root:{color:e.disabled?n:a,cursor:e.disabled?"default":"pointer",minHeight:e.desktop?"32px":"48px",lineHeight:e.desktop?"32px":"48px",fontSize:e.desktop?15:16,whiteSpace:"nowrap"},innerDivStyle:{paddingLeft:e.leftIcon||e.insetChildren||e.checked?o:r,paddingRight:e.rightIcon?o:r,paddingBottom:0,paddingTop:0},secondaryText:{float:"right"},leftIconDesktop:{margin:0,left:24,top:4},rightIconDesktop:{margin:0,right:24,top:4,fill:t.muiTheme.menuItem.rightIconDesktopFill}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(14),x=a(O),w=n(3323),k=a(w),P=n(3338),A=a(P),D=n(3479),R=a(D),I=n(3450),F=a(I),N=n(3363),M=a(N),j=n(3319),L=(a(j),{position:"relative"}),B=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={open:!1},a.cloneMenuItem=function(e){return S.default.cloneElement(e,{onClick:function(t){e.props.menuItems||a.handleRequestClose(),e.props.onClick&&e.props.onClick(t)}})},a.handleTouchTap=function(e){e.preventDefault(),a.setState({open:!0,anchorEl:x.default.findDOMNode(a)}),a.props.onClick&&a.props.onClick(e)},a.handleRequestClose=function(){a.setState({open:!1,anchorEl:null})},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){this.applyFocusState()}},{key:"componentWillReceiveProps",value:function(e){this.state.open&&"none"===e.focusState&&this.handleRequestClose()}},{key:"shouldComponentUpdate",value:function(e,t,n){return!(0,k.default)(this.props,e)||!(0,k.default)(this.state,t)||!(0,k.default)(this.context,n)}},{key:"componentDidUpdate",value:function(){this.applyFocusState()}},{key:"componentWillUnmount",value:function(){this.state.open&&this.setState({open:!1})}},{key:"applyFocusState",value:function(){this.refs.listItem.applyFocusState(this.props.focusState)}},{key:"render",value:function(){var e=this.props,t=e.checked,n=e.children,a=e.desktop,r=e.disabled,s=(e.focusState,e.innerDivStyle),u=e.insetChildren,c=e.leftIcon,d=e.menuItems,p=e.rightIcon,f=e.secondaryText,h=e.style,m=e.animation,y=e.anchorOrigin,g=e.targetOrigin,v=(e.value,(0,l.default)(e,["checked","children","desktop","disabled","focusState","innerDivStyle","insetChildren","leftIcon","menuItems","rightIcon","secondaryText","style","animation","anchorOrigin","targetOrigin","value"])),b=this.context.muiTheme.prepareStyles,E=o(this.props,this.context),_=(0,T.default)(E.root,h),C=(0,T.default)(E.innerDivStyle,s),O=c||(t?S.default.createElement(R.default,null):null);if(O){var x=a?(0,T.default)(E.leftIconDesktop,O.props.style):O.props.style;O=S.default.cloneElement(O,{style:x})}var w=void 0;if(p){var k=a?(0,T.default)(E.rightIconDesktop,p.props.style):p.props.style;w=S.default.cloneElement(p,{style:k})}var P=void 0;if(f){var D=S.default.isValidElement(f),I=D?(0,T.default)(E.secondaryText,f.props.style):null;P=D?S.default.cloneElement(f,{style:I}):S.default.createElement("div",{style:b(E.secondaryText)},f)}var N=void 0;return d&&(N=S.default.createElement(A.default,{animation:m,anchorOrigin:y,anchorEl:this.state.anchorEl,open:this.state.open,targetOrigin:g,useLayerForClickAway:!1,onRequestClose:this.handleRequestClose},S.default.createElement(M.default,{desktop:a,disabled:r,style:L},S.default.Children.map(d,this.cloneMenuItem))),v.onClick=this.handleTouchTap),S.default.createElement(F.default,(0,i.default)({},v,{disabled:r,hoverColor:this.context.muiTheme.menuItem.hoverColor,innerDivStyle:C,insetChildren:u,leftIcon:O,ref:"listItem",rightIcon:w,role:"menuitem",style:_}),n,P,N)}}]),t}(E.Component);B.muiName="MenuItem",B.defaultProps={anchorOrigin:{horizontal:"right",vertical:"top"},checked:!1,desktop:!1,disabled:!1,focusState:"none",insetChildren:!1,targetOrigin:{horizontal:"left",vertical:"top"}},B.contextTypes={muiTheme:C.default.object.isRequired},B.propTypes={},t.default=B},3454:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e.rounded,a=e.circle,o=e.transitionEnabled,r=e.zDepth,i=t.muiTheme,s=i.baseTheme,l=i.paper,u=i.borderRadius;return{root:{color:l.color,backgroundColor:l.backgroundColor,transition:o&&w.default.easeOut(),boxSizing:"border-box",fontFamily:s.fontFamily,WebkitTapHighlightColor:"rgba(0,0,0,0)",boxShadow:l.zDepthShadows[r-1],borderRadius:a?"50%":n?u:"0px"}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3319),x=(a(O),n(3318)),w=a(x),k=function(e){function t(){return(0,p.default)(this,t),(0,y.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,v.default)(t,e),(0,h.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=(e.circle,e.rounded,e.style),a=(e.transitionEnabled,e.zDepth,(0,l.default)(e,["children","circle","rounded","style","transitionEnabled","zDepth"])),r=this.context.muiTheme.prepareStyles,s=o(this.props,this.context);return S.default.createElement("div",(0,i.default)({},a,{style:r((0,T.default)(s.root,n))}),t)}}]),t}(E.Component);k.defaultProps={circle:!1,rounded:!0,transitionEnabled:!0,zDepth:1},k.contextTypes={muiTheme:C.default.object.isRequired},k.propTypes={},t.default=k},3455:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=e.targetOrigin,o=n.open,r=t.muiTheme,i=a.horizontal.replace("middle","vertical");return{root:{position:"fixed",zIndex:r.zIndex.popover,opacity:o?1:0,transform:o?"scale(1, 1)":"scale(0, 0)",transformOrigin:i+" "+a.vertical,transition:v.default.easeOut("250ms",["transform","opacity"]),maxHeight:"100%"},horizontal:{maxHeight:"100%",overflowY:"auto",transform:o?"scaleX(1)":"scaleX(0)",opacity:o?1:0,transformOrigin:i+" "+a.vertical,transition:v.default.easeOut("250ms",["transform","opacity"])},vertical:{opacity:o?1:0,transform:o?"scaleY(1)":"scaleY(0)",transformOrigin:i+" "+a.vertical,transition:v.default.easeOut("500ms",["transform","opacity"])}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=a(r),s=n(2),l=a(s),u=n(3),c=a(u),d=n(5),p=a(d),f=n(4),h=a(f),m=n(9),y=a(m),g=n(3318),v=a(g),b=n(0),T=a(b),E=n(1),S=a(E),_=n(3319),C=(a(_),n(3325)),O=a(C),x=function(e){function t(){var e,n,a,o;(0,l.default)(this,t);for(var r=arguments.length,s=Array(r),u=0;u<r;u++)s[u]=arguments[u];return n=a=(0,p.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(s))),a.state={open:!1},o=n,(0,p.default)(a,o)}return(0,h.default)(t,e),(0,c.default)(t,[{key:"componentDidMount",value:function(){this.setState({open:!0})}},{key:"componentWillReceiveProps",value:function(e){this.setState({open:e.open})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,a=e.zDepth,r=this.context.muiTheme.prepareStyles,i=o(this.props,this.context,this.state);return T.default.createElement(O.default,{style:(0,y.default)(i.root,n),zDepth:a,className:t},T.default.createElement("div",{style:r(i.horizontal)},T.default.createElement("div",{style:r(i.vertical)},this.props.children)))}}]),t}(b.Component);x.defaultProps={style:{},zDepth:1},x.contextTypes={muiTheme:S.default.object.isRequired},x.propTypes={},t.default=x},3456:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=e.targetOrigin,o=n.open,r=t.muiTheme,i=a.horizontal.replace("middle","center");return{root:{position:"fixed",zIndex:r.zIndex.popover,opacity:o?1:0,transform:o?"scaleY(1)":"scaleY(0)",transformOrigin:i+" "+a.vertical,transition:C.default.easeOut("450ms",["transform","opacity"]),maxHeight:"100%"}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=a(r),s=n(2),l=a(s),u=n(3),c=a(u),d=n(5),p=a(d),f=n(4),h=a(f),m=n(9),y=a(m),g=n(0),v=a(g),b=n(1),T=a(b),E=n(3325),S=a(E),_=n(3318),C=a(_),O=n(3319),x=(a(O),function(e){function t(){var e,n,a,o;(0,l.default)(this,t);for(var r=arguments.length,s=Array(r),u=0;u<r;u++)s[u]=arguments[u];return n=a=(0,p.default)(this,(e=t.__proto__||(0,i.default)(t)).call.apply(e,[this].concat(s))),a.state={open:!1},o=n,(0,p.default)(a,o)}return(0,h.default)(t,e),(0,c.default)(t,[{key:"componentDidMount",value:function(){this.setState({open:!0})}},{key:"componentWillReceiveProps",value:function(e){this.setState({open:e.open})}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.style,a=e.zDepth,r=o(this.props,this.context,this.state);return v.default.createElement(S.default,{style:(0,y.default)(r.root,n),zDepth:a,className:t},this.props.children)}}]),t}(g.Component));x.defaultProps={style:{},zDepth:1},x.contextTypes={muiTheme:T.default.object.isRequired},x.propTypes={},t.default=x},3457:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.PopoverAnimationVertical=t.Popover=void 0;var o=n(3338),r=a(o),i=n(3456),s=a(i);t.Popover=r.default,t.PopoverAnimationVertical=s.default,t.default=r.default},3458:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=t.muiTheme,o=a.baseTheme,r=a.button,i=a.raisedButton,s=a.borderRadius,l=e.disabled,u=e.disabledBackgroundColor,c=e.disabledLabelColor,d=e.fullWidth,p=e.icon,f=e.label,h=e.labelPosition,m=e.primary,y=e.secondary,g=e.style,v=m||y?.4:.08,b=i.color,T=i.textColor;l?(b=u||i.disabledColor,T=c||i.disabledTextColor):m?(b=i.primaryColor,T=i.primaryTextColor):y?(b=i.secondaryColor,T=i.secondaryTextColor):(e.backgroundColor&&(b=e.backgroundColor),e.labelColor&&(T=e.labelColor));var E=g&&g.height||r.height;return{root:{display:"inline-block",transition:x.default.easeOut(),minWidth:d?"100%":r.minWidth},button:{height:E,lineHeight:E+"px",width:"100%",padding:0,borderRadius:s,transition:x.default.easeOut(),backgroundColor:b,textAlign:"center"},label:{position:"relative",opacity:1,fontSize:i.fontSize,letterSpacing:0,textTransform:i.textTransform||r.textTransform||"uppercase",fontWeight:i.fontWeight,margin:0,userSelect:"none",paddingLeft:p&&"before"!==h?8:o.spacing.desktopGutterLess,paddingRight:p&&"before"===h?8:o.spacing.desktopGutterLess,color:T},icon:{verticalAlign:"middle",marginLeft:f&&"before"!==h?12:0,marginRight:f&&"before"===h?12:0},overlay:{height:E,borderRadius:s,backgroundColor:(n.keyboardFocused||n.hovered)&&!l&&(0,w.fade)(T,v),transition:x.default.easeOut(),top:0},ripple:{color:T,opacity:m||y?.16:.1}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3318),x=a(O),w=n(3341),k=n(3329),P=a(k),A=n(3325),D=a(A),R=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={hovered:!1,keyboardFocused:!1,touched:!1,initialZDepth:0,zDepth:0},a.handleMouseDown=function(e){0===e.button&&a.setState({zDepth:a.state.initialZDepth+1}),a.props.onMouseDown&&a.props.onMouseDown(e)},a.handleMouseUp=function(e){a.setState({zDepth:a.state.initialZDepth}),a.props.onMouseUp&&a.props.onMouseUp(e)},a.handleMouseLeave=function(e){a.state.keyboardFocused||a.setState({zDepth:a.state.initialZDepth,hovered:!1}),a.props.onMouseLeave&&a.props.onMouseLeave(e)},a.handleMouseEnter=function(e){a.state.keyboardFocused||a.state.touched||a.setState({hovered:!0}),a.props.onMouseEnter&&a.props.onMouseEnter(e)},a.handleTouchStart=function(e){a.setState({touched:!0,zDepth:a.state.initialZDepth+1}),a.props.onTouchStart&&a.props.onTouchStart(e)},a.handleTouchEnd=function(e){a.setState({touched:!0,zDepth:a.state.initialZDepth}),a.props.onTouchEnd&&a.props.onTouchEnd(e)},a.handleKeyboardFocus=function(e,t){var n=t&&!a.props.disabled?a.state.initialZDepth+1:a.state.initialZDepth;a.setState({zDepth:n,keyboardFocused:t})},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillMount",value:function(){var e=this.props.disabled?0:1;this.setState({zDepth:e,initialZDepth:e})}},{key:"componentWillReceiveProps",value:function(e){var t=e.disabled?0:1,n={zDepth:t,initialZDepth:t};e.disabled&&(n.hovered=!1),this.setState(n)}},{key:"render",value:function(){var e=this.props,t=(e.backgroundColor,e.buttonStyle),n=e.children,a=e.className,r=e.disabled,s=(e.disabledBackgroundColor,e.disabledLabelColor,e.fullWidth,e.icon),u=e.label,c=(e.labelColor,e.labelPosition),d=e.labelStyle,p=e.overlayStyle,f=(e.primary,e.rippleStyle),h=(e.secondary,e.style),m=(0,l.default)(e,["backgroundColor","buttonStyle","children","className","disabled","disabledBackgroundColor","disabledLabelColor","fullWidth","icon","label","labelColor","labelPosition","labelStyle","overlayStyle","primary","rippleStyle","secondary","style"]),y=this.context.muiTheme.prepareStyles,g=o(this.props,this.context,this.state),v=(0,T.default)({},g.ripple,f),b=r?{}:{onMouseDown:this.handleMouseDown,onMouseUp:this.handleMouseUp,onMouseLeave:this.handleMouseLeave,onMouseEnter:this.handleMouseEnter,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onKeyboardFocus:this.handleKeyboardFocus},_=u&&S.default.createElement("span",{style:y((0,T.default)(g.label,d)),key:"labelElement"},u),C=s&&(0,E.cloneElement)(s,{color:s.props.color||g.label.color,style:(0,T.default)(g.icon,s.props.style),key:"iconCloned"}),O="before"===c?[_,C,n]:[n,C,_];return S.default.createElement(D.default,{className:a,style:(0,T.default)(g.root,h),zDepth:this.state.zDepth},S.default.createElement(P.default,(0,i.default)({},m,b,{ref:"container",disabled:r,style:(0,T.default)(g.button,t),focusRippleColor:v.color,touchRippleColor:v.color,focusRippleOpacity:v.opacity,touchRippleOpacity:v.opacity}),S.default.createElement("div",{ref:"overlay",style:y((0,T.default)(g.overlay,p))},O)))}}]),t}(E.Component);R.muiName="RaisedButton",R.defaultProps={disabled:!1,labelPosition:"after",fullWidth:!1,primary:!1,secondary:!1},R.contextTypes={muiTheme:C.default.object.isRequired},R.propTypes={},t.default=R},3459:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3458),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3460:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=t.muiTheme,o=a.baseTheme.spacing.desktopSubheaderHeight,r=a.zIndex,i=n.open;return{root:{position:"fixed",left:"50%",display:"flex",bottom:0,zIndex:r.snackbar,visibility:i?"visible":"hidden",transform:i?"translate(-50%, 0)":"translate(-50%, "+o+"px)",transition:x.default.easeOut("400ms","transform")+", "+x.default.easeOut("400ms","visibility")}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3318),x=a(O),w=n(3366),k=a(w),P=n(3461),A=a(P),D=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.componentClickAway=function(){a.timerTransitionId||(null!==a.props.open&&a.props.onRequestClose?a.props.onRequestClose("clickaway"):a.setState({open:!1}))},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillMount",value:function(){this.setState({open:this.props.open,message:this.props.message,action:this.props.action})}},{key:"componentDidMount",value:function(){this.state.open&&(this.setAutoHideTimer(),this.setTransitionTimer())}},{key:"componentWillReceiveProps",value:function(e){var t=this;if(this.props.open&&e.open&&(e.message!==this.props.message||e.action!==this.props.action))this.setState({open:!1}),clearTimeout(this.timerOneAtTheTimeId),this.timerOneAtTheTimeId=setTimeout(function(){t.setState({message:e.message,action:e.action,open:!0})},400);else{var n=e.open;this.setState({open:null!==n?n:this.state.open,message:e.message,action:e.action})}}},{key:"componentDidUpdate",value:function(e,t){t.open!==this.state.open&&(this.state.open?(this.setAutoHideTimer(),this.setTransitionTimer()):clearTimeout(this.timerAutoHideId))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timerAutoHideId),clearTimeout(this.timerTransitionId),clearTimeout(this.timerOneAtTheTimeId)}},{key:"setAutoHideTimer",value:function(){var e=this,t=this.props.autoHideDuration;t>0&&(clearTimeout(this.timerAutoHideId),this.timerAutoHideId=setTimeout(function(){null!==e.props.open&&e.props.onRequestClose?e.props.onRequestClose("timeout"):e.setState({open:!1})},t))}},{key:"setTransitionTimer",value:function(){var e=this;this.timerTransitionId=setTimeout(function(){e.timerTransitionId=void 0},400)}},{key:"render",value:function(){var e=this.props,t=(e.autoHideDuration,e.contentStyle),n=e.bodyStyle,a=(e.message,e.onRequestClose,e.onActionTouchTap),r=e.style,s=(0,l.default)(e,["autoHideDuration","contentStyle","bodyStyle","message","onRequestClose","onActionTouchTap","style"]),u=this.state,c=u.action,d=u.message,p=u.open,f=this.context.muiTheme.prepareStyles,h=o(this.props,this.context,this.state);return S.default.createElement(k.default,{onClickAway:p?this.componentClickAway:null},S.default.createElement("div",(0,i.default)({},s,{style:f((0,T.default)(h.root,r))}),S.default.createElement(A.default,{action:c,contentStyle:t,message:d,open:p,onActionTouchTap:a,style:n})))}}]),t}(E.Component);D.contextTypes={muiTheme:C.default.object.isRequired},D.propTypes={},t.default=D},3461:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=e.open,a=e.width,o=t.muiTheme,r=o.baseTheme,i=r.spacing,s=i.desktopGutter,l=i.desktopSubheaderHeight,u=r.fontFamily,c=o.snackbar,d=c.backgroundColor,p=c.textColor,f=c.actionColor,h=o.borderRadius,m=a===g.SMALL;return{root:{fontFamily:u,backgroundColor:d,padding:"0 "+s+"px",height:l,lineHeight:l+"px",borderRadius:m?0:h,maxWidth:m?"inherit":568,minWidth:m?"inherit":288,width:m?"calc(100vw - "+2*s+"px)":"auto",flexGrow:m?1:0},content:{fontSize:14,color:p,opacity:n?1:0,transition:n?y.default.easeOut("500ms","opacity","100ms"):y.default.easeOut("400ms","opacity")},action:{color:f,float:"right",marginTop:6,marginRight:-16,marginLeft:s,backgroundColor:"transparent"}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarBody=void 0;var r=n(7),i=a(r),s=n(8),l=a(s),u=n(9),c=a(u),d=n(0),p=a(d),f=n(1),h=a(f),m=n(3318),y=a(m),g=n(3483),v=a(g),b=n(3446),T=a(b),E=function(e,t){var n=e.action,a=e.contentStyle,r=e.message,s=(e.open,e.onActionTouchTap),u=e.style,d=(0,l.default)(e,["action","contentStyle","message","open","onActionTouchTap","style"]),f=t.muiTheme.prepareStyles,h=o(e,t),m=n&&p.default.createElement(T.default,{style:h.action,label:n,onClick:s});return p.default.createElement("div",(0,i.default)({},d,{style:f((0,c.default)(h.root,u))}),p.default.createElement("div",{style:f((0,c.default)(h.content,a))},p.default.createElement("span",null,r),m))};t.SnackbarBody=E,E.propTypes={},E.contextTypes={muiTheme:h.default.object.isRequired},t.default=(0,v.default)()(E)},3462:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3460),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3463:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(9),u=a(l),c=n(0),d=a(c),p=n(1),f=a(p),h=function(e,t){var n=e.children,a=e.inset,o=e.style,i=(0,s.default)(e,["children","inset","style"]),l=t.muiTheme,c=l.prepareStyles,p=l.subheader,f={root:{boxSizing:"border-box",color:p.color,fontSize:14,fontWeight:p.fontWeight,lineHeight:"48px",paddingLeft:a?72:16,width:"100%"}};return d.default.createElement("div",(0,r.default)({},i,{style:c((0,u.default)(f.root,o))}),n)};h.muiName="Subheader",h.propTypes={},h.defaultProps={inset:!1},h.contextTypes={muiTheme:f.default.object.isRequired},t.default=h},3464:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(3318),O=a(C),x=function(e){function t(){var e,n,a,o;(0,d.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,m.default)(this,(e=t.__proto__||(0,u.default)(t)).call.apply(e,[this].concat(i))),a.state={hovered:!1},a.handleMouseLeave=function(e){a.setState({hovered:!1}),a.props.onMouseLeave(e)},a.handleMouseEnter=function(e){a.setState({hovered:!0}),a.props.onMouseEnter(e)},o=n,(0,m.default)(a,o)}return(0,g.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.color,a=e.hoverColor,o=(e.onMouseEnter,e.onMouseLeave,e.style),i=e.viewBox,l=(0,s.default)(e,["children","color","hoverColor","onMouseEnter","onMouseLeave","style","viewBox"]),u=this.context.muiTheme,c=u.svgIcon,d=u.prepareStyles,p=n||"currentColor",f=a||p,h=(0,b.default)({display:"inline-block",color:c.color,fill:this.state.hovered?f:p,height:24,width:24,userSelect:"none",transition:O.default.easeOut()},o);return E.default.createElement("svg",(0,r.default)({},l,{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,style:d(h),viewBox:i}),t)}}]),t}(T.Component);x.muiName="SvgIcon",x.defaultProps={onMouseEnter:function(){},onMouseLeave:function(){},viewBox:"0 0 24 24"},x.contextTypes={muiTheme:_.default.object.isRequired},x.propTypes={},t.default=x},3465:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){return{root:{position:"relative"},textarea:{height:n.height,width:"100%",resize:"none",font:"inherit",padding:0,cursor:"inherit"},shadow:{resize:"none",overflow:"hidden",visibility:"hidden",position:"absolute",height:"auto"}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(721),x=a(O),w=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={height:null},a.handleResize=function(e){a.syncHeightWithShadow(a.props.value,e)},a.handleChange=function(e){a.props.hasOwnProperty("value")||a.syncHeightWithShadow(e.target.value),a.props.hasOwnProperty("valueLink")&&a.props.valueLink.requestChange(e.target.value),a.props.onChange&&a.props.onChange(e)},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillMount",value:function(){this.setState({height:24*this.props.rows})}},{key:"componentDidMount",value:function(){this.syncHeightWithShadow(this.props.value)}},{key:"componentWillReceiveProps",value:function(e){e.value===this.props.value&&e.rowsMax===this.props.rowsMax||this.syncHeightWithShadow(e.value,null,e)}},{key:"getInputNode",value:function(){return this.refs.input}},{key:"setValue",value:function(e){this.getInputNode().value=e,this.syncHeightWithShadow(e)}},{key:"syncHeightWithShadow",value:function(e,t,n){var a=this.refs.shadow,o=!this.props.hintText||""!==e&&void 0!==e&&null!==e?e:this.props.hintText;void 0!==o&&(a.value=o);var r=a.scrollHeight;if(void 0!==r&&(n=n||this.props,n.rowsMax>=n.rows&&(r=Math.min(24*n.rowsMax,r)),r=Math.max(r,24),this.state.height!==r)){var i=this.refs.input,s=i.selectionStart;this.setState({height:r},function(){i.setSelectionRange(s,s)}),n.onHeightChange&&n.onHeightChange(t,r)}}},{key:"render",value:function(){var e=this.props,t=(e.onChange,e.onHeightChange,e.rows,e.rowsMax,e.shadowStyle),n=e.style,a=(e.hintText,e.textareaStyle),r=e.valueLink,s=(0,l.default)(e,["onChange","onHeightChange","rows","rowsMax","shadowStyle","style","hintText","textareaStyle","valueLink"]),u=this.context.muiTheme.prepareStyles,c=o(this.props,this.context,this.state),d=(0,T.default)(c.root,n),p=(0,T.default)(c.textarea,a),f=(0,T.default)({},p,c.shadow,t),h={};return this.props.hasOwnProperty("valueLink")&&(s.value=r.value,h.valueLink=r),S.default.createElement("div",{style:u(d)},S.default.createElement(x.default,{target:"window",onResize:this.handleResize}),S.default.createElement("textarea",(0,i.default)({ref:"shadow",style:u(f),tabIndex:"-1",rows:this.props.rows,defaultValue:this.props.defaultValue,readOnly:!0,value:this.props.value},h)),S.default.createElement("textarea",(0,i.default)({},s,{ref:"input",rows:this.props.rows,style:u(p),onChange:this.handleChange})))}}]),t}(E.Component);w.defaultProps={rows:1},w.contextTypes={muiTheme:C.default.object.isRequired},w.propTypes={},t.default=w},3466:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e){return""!==e&&void 0!==e&&null!==e&&!(Array.isArray(e)&&0===e.length)}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(14),x=a(O),w=n(3323),k=a(w),P=n(3318),A=a(P),D=n(3465),R=a(D),I=n(3467),F=a(I),N=n(3468),M=a(N),j=n(3469),L=a(j),B=n(12),q=(a(B),function(e,t,n){var a=t.muiTheme,o=a.baseTheme,r=a.textField,i=r.floatingLabelColor,s=r.focusColor,l=r.textColor,u=r.disabledTextColor,c=r.backgroundColor,d=r.errorColor,p={root:{fontSize:16,lineHeight:"24px",width:e.fullWidth?"100%":256,height:24*(e.rows-1)+(e.floatingLabelText?72:48),display:"inline-block",position:"relative",backgroundColor:c,fontFamily:o.fontFamily,transition:A.default.easeOut("200ms","height"),cursor:e.disabled?"not-allowed":"auto"},error:{position:"relative",bottom:2,fontSize:12,lineHeight:"12px",color:d,transition:A.default.easeOut()},floatingLabel:{color:e.disabled?u:i,pointerEvents:"none"},input:{padding:0,position:"relative",width:"100%",border:"none",outline:"none",backgroundColor:"rgba(0,0,0,0)",color:e.disabled?u:l,cursor:"inherit",font:"inherit",WebkitOpacity:1,WebkitTapHighlightColor:"rgba(0,0,0,0)"},inputNative:{appearance:"textfield"}};return p.textarea=(0,T.default)({},p.input,{marginTop:e.floatingLabelText?36:12,marginBottom:e.floatingLabelText?-36:-12,boxSizing:"border-box",font:"inherit"}),p.input.height="100%",n.isFocused&&(p.floatingLabel.color=s),e.floatingLabelText&&(p.input.boxSizing="border-box",e.multiLine||(p.input.marginTop=14),n.errorText&&(p.error.bottom=e.multiLine?3:p.error.fontSize+3)),n.errorText&&n.isFocused&&(p.floatingLabel.color=p.error.color),p}),U=function(e){function t(){var e,n,a,r;(0,p.default)(this,t);for(var i=arguments.length,s=Array(i),l=0;l<i;l++)s[l]=arguments[l];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(s))),a.state={isFocused:!1,errorText:void 0,hasValue:!1},a.handleInputBlur=function(e){a.setState({isFocused:!1}),a.props.onBlur&&a.props.onBlur(e)},a.handleInputChange=function(e){a.props.hasOwnProperty("value")||a.setState({hasValue:o(e.target.value)}),a.props.onChange&&a.props.onChange(e,e.target.value)},a.handleInputFocus=function(e){a.props.disabled||(a.setState({isFocused:!0}),a.props.onFocus&&a.props.onFocus(e))},a.handleHeightChange=function(e,t){var n=t+24;a.props.floatingLabelText&&(n+=24),x.default.findDOMNode(a).style.height=n+"px"},r=n,(0,y.default)(a,r)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentWillMount",value:function(){var e=this.props,t=e.children,n=e.name,a=e.hintText,r=e.floatingLabelText,i=(e.id,t?t.props:this.props);this.setState({errorText:this.props.errorText,hasValue:o(i.value)||o(i.defaultValue)});var s=n+"-"+a+"-"+r+"-"+Math.floor(65535*Math.random());this.uniqueId=s.replace(/[^A-Za-z0-9-]/gi,"")}},{key:"componentWillReceiveProps",value:function(e){if(e.disabled&&!this.props.disabled&&this.setState({isFocused:!1}),e.errorText!==this.props.errorText&&this.setState({errorText:e.errorText}),e.children&&e.children.props&&(e=e.children.props),e.hasOwnProperty("value")){var t=o(e.value);this.setState({hasValue:t})}}},{key:"shouldComponentUpdate",value:function(e,t,n){return!(0,k.default)(this.props,e)||!(0,k.default)(this.state,t)||!(0,k.default)(this.context,n)}},{key:"blur",value:function(){this.input&&this.getInputNode().blur()}},{key:"focus",value:function(){this.input&&this.getInputNode().focus()}},{key:"select",value:function(){this.input&&this.getInputNode().select()}},{key:"getValue",value:function(){return this.input?this.getInputNode().value:void 0}},{key:"getInputNode",value:function(){return this.props.children||this.props.multiLine?this.input.getInputNode():x.default.findDOMNode(this.input)}},{key:"_isControlled",value:function(){return this.props.hasOwnProperty("value")}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,a=t.className,o=t.disabled,r=t.errorStyle,s=(t.errorText,t.floatingLabelFixed),u=t.floatingLabelFocusStyle,c=t.floatingLabelShrinkStyle,d=t.floatingLabelStyle,p=t.floatingLabelText,f=(t.fullWidth,t.hintText),h=t.hintStyle,m=t.id,y=t.inputStyle,g=t.multiLine,v=(t.onBlur,t.onChange,t.onFocus,t.style),b=t.type,E=t.underlineDisabledStyle,_=t.underlineFocusStyle,C=t.underlineShow,O=t.underlineStyle,x=t.rows,w=t.rowsMax,k=t.textareaStyle,P=(0,l.default)(t,["children","className","disabled","errorStyle","errorText","floatingLabelFixed","floatingLabelFocusStyle","floatingLabelShrinkStyle","floatingLabelStyle","floatingLabelText","fullWidth","hintText","hintStyle","id","inputStyle","multiLine","onBlur","onChange","onFocus","style","type","underlineDisabledStyle","underlineFocusStyle","underlineShow","underlineStyle","rows","rowsMax","textareaStyle"]),A=this.context.muiTheme.prepareStyles,D=q(this.props,this.context,this.state),I=m||this.uniqueId,N=this.state.errorText&&S.default.createElement("div",{style:A((0,T.default)(D.error,r))},this.state.errorText),j=p&&S.default.createElement(M.default,{muiTheme:this.context.muiTheme,style:(0,T.default)(D.floatingLabel,d,this.state.isFocused?u:null),shrinkStyle:c,htmlFor:I,shrink:this.state.hasValue||this.state.isFocused||s,disabled:o},p),B={id:I,ref:function(t){return e.input=t},disabled:this.props.disabled,onBlur:this.handleInputBlur,onChange:this.handleInputChange,onFocus:this.handleInputFocus},U=(0,T.default)(D.input,y),H=void 0;H=n?S.default.cloneElement(n,(0,i.default)({},B,n.props,{style:(0,T.default)(U,n.props.style)})):g?S.default.createElement(R.default,(0,i.default)({style:U,textareaStyle:(0,T.default)(D.textarea,D.inputNative,k),rows:x,rowsMax:w,hintText:f},P,B,{onHeightChange:this.handleHeightChange})):S.default.createElement("input",(0,i.default)({type:b,style:A((0,T.default)(D.inputNative,U))},P,B));var W={};return n&&(W=P),S.default.createElement("div",(0,i.default)({},W,{className:a,style:A((0,T.default)(D.root,v))}),j,f?S.default.createElement(F.default,{muiTheme:this.context.muiTheme,show:!(this.state.hasValue||p&&!this.state.isFocused)||!this.state.hasValue&&p&&s&&!this.state.isFocused,style:h,text:f}):null,H,C?S.default.createElement(L.default,{disabled:o,disabledStyle:E,error:!!this.state.errorText,errorStyle:r,focus:this.state.isFocused,focusStyle:_,muiTheme:this.context.muiTheme,style:O}):null,N)}}]),t}(E.Component);U.defaultProps={disabled:!1,floatingLabelFixed:!1,multiLine:!1,fullWidth:!1,type:"text",underlineShow:!0,rows:1},U.contextTypes={muiTheme:C.default.object.isRequired},U.propTypes={},t.default=U},3467:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.muiTheme.textField.hintColor;return{root:{position:"absolute",opacity:e.show?1:0,color:t,transition:d.default.easeOut(),bottom:12}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=a(r),s=n(0),l=a(s),u=n(1),c=(a(u),n(3318)),d=a(c),p=function(e){var t=e.muiTheme.prepareStyles,n=e.style,a=e.text,r=o(e);return l.default.createElement("div",{style:t((0,i.default)(r.root,n))},a)};p.propTypes={},p.defaultProps={show:!0},t.default=p},3468:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e){var t={position:"absolute",lineHeight:"22px",top:38,transition:d.default.easeOut(),zIndex:1,transform:"scale(1) translate(0, 0)",transformOrigin:"left top",pointerEvents:"auto",userSelect:"none"},n=e.shrink?(0,i.default)({transform:"scale(0.75) translate(0, -28px)",pointerEvents:"none"},e.shrinkStyle):null;return{root:(0,i.default)(t,e.style,n)}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=a(r),s=n(0),l=a(s),u=n(1),c=(a(u),n(3318)),d=a(c),p=function(e){var t=e.muiTheme,n=e.className,a=e.children,r=e.htmlFor,i=e.onClick,s=t.prepareStyles,u=o(e);return l.default.createElement("label",{className:n,style:s(u.root),htmlFor:r,onClick:i},a)};p.propTypes={},p.defaultProps={disabled:!1,shrink:!1},t.default=p},3469:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(9),r=a(o),i=n(0),s=a(i),l=n(1),u=a(l),c=n(3318),d=a(c),p=(u.default.bool,u.default.object,u.default.bool,u.default.object,u.default.bool,u.default.object,u.default.object.isRequired,u.default.object,{disabled:!1,disabledStyle:{},error:!1,errorStyle:{},focus:!1,focusStyle:{},style:{}}),f=function(e){var t=e.disabled,n=e.disabledStyle,a=e.error,o=e.errorStyle,i=e.focus,l=e.focusStyle,u=e.muiTheme,c=e.style,p=o.color,f=u.prepareStyles,h=u.textField,m=h.borderColor,y=h.disabledTextColor,g=h.errorColor,v=h.focusColor,b={root:{borderTop:"none",borderLeft:"none",borderRight:"none",borderBottomStyle:"solid",borderBottomWidth:1,borderColor:m,bottom:8,boxSizing:"content-box",margin:0,position:"absolute",width:"100%"},disabled:{borderBottomStyle:"dotted",borderBottomWidth:2,borderColor:y},focus:{borderBottomStyle:"solid",borderBottomWidth:2,borderColor:v,transform:"scaleX(0)",transition:d.default.easeOut()},error:{borderColor:p||g,transform:"scaleX(1)"}},T=(0,r.default)({},b.root,c),E=(0,r.default)({},T,b.focus,l);return t&&(T=(0,r.default)({},T,b.disabled,n)),i&&(E=(0,r.default)({},E,{transform:"scaleX(1)"})),a&&(E=(0,r.default)({},E,b.error)),s.default.createElement("div",null,s.default.createElement("hr",{"aria-hidden":"true",style:f(T)}),s.default.createElement("hr",{"aria-hidden":"true",style:f(E)}))};f.propTypes={},f.defaultProps=p,t.default=f},3470:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=n(3466),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=o.default},3471:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=a(o),i=n(2),s=a(i),l=n(3),u=a(l),c=n(5),d=a(c),p=n(4),f=a(p),h=n(0),m=n(1),y=(a(m),null),g=0,v=function(e){function t(){var e,n,a,o;(0,s.default)(this,t);for(var i=arguments.length,l=Array(i),u=0;u<i;u++)l[u]=arguments[u];return n=a=(0,d.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),a.locked=!1,o=n,(0,d.default)(a,o)}return(0,f.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){!0===this.props.lock&&this.preventScrolling()}},{key:"componentWillReceiveProps",value:function(e){this.props.lock!==e.lock&&(e.lock?this.preventScrolling():this.allowScrolling())}},{key:"componentWillUnmount",value:function(){this.allowScrolling()}},{key:"preventScrolling",value:function(){if(!0!==this.locked&&(g+=1,this.locked=!0,1===g)){var e=document.getElementsByTagName("body")[0];y=e.style.overflow,e.style.overflow="hidden"}}},{key:"allowScrolling",value:function(){if(!0===this.locked&&(g-=1,this.locked=!1),0===g&&null!==y){document.getElementsByTagName("body")[0].style.overflow=y||"",y=null}}},{key:"render",value:function(){return null}}]),t}(h.Component);v.propTypes={},t.default=v},3472:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(14),O=a(C),x=n(3323),w=a(x),k=n(3340),P=a(k),A=n(3318),D=a(A),R=function(e){function t(){return(0,d.default)(this,t),(0,m.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,f.default)(t,[{key:"shouldComponentUpdate",value:function(e){return!(0,w.default)(this.props,e)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.enterTimer),clearTimeout(this.leaveTimer)}},{key:"componentWillAppear",value:function(e){this.initializeAnimation(e)}},{key:"componentWillEnter",value:function(e){this.initializeAnimation(e)}},{key:"componentDidAppear",value:function(){this.animate()}},{key:"componentDidEnter",value:function(){this.animate()}},{key:"componentWillLeave",value:function(e){O.default.findDOMNode(this).style.opacity=0;var t=this.props.aborted?0:2e3;this.enterTimer=setTimeout(e,t)}},{key:"animate",value:function(){var e=O.default.findDOMNode(this).style,t=D.default.easeOut("2s","opacity")+", "+D.default.easeOut("1s","transform");P.default.set(e,"transition",t),P.default.set(e,"transform","scale(1)")}},{key:"initializeAnimation",value:function(e){var t=O.default.findDOMNode(this).style;t.opacity=this.props.opacity,P.default.set(t,"transform","scale(0)"),this.leaveTimer=setTimeout(e,0)}},{key:"render",value:function(){var e=this.props,t=(e.aborted,e.color),n=(e.opacity,e.style),a=(e.touchGenerated,(0,s.default)(e,["aborted","color","opacity","style","touchGenerated"])),o=this.context.muiTheme.prepareStyles,i=(0,b.default)({position:"absolute",top:0,left:0,height:"100%",width:"100%",borderRadius:"50%",backgroundColor:t},n);return E.default.createElement("div",(0,r.default)({},a,{style:o(i)}))}}]),t}(T.Component);R.defaultProps={opacity:.1,aborted:!1},R.contextTypes={muiTheme:_.default.object.isRequired},R.propTypes={},t.default=R},3473:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),r=a(o),i=n(2),s=a(i),l=n(3),u=a(l),c=n(5),d=a(c),p=n(4),f=a(p),h=n(9),m=a(h),y=n(0),g=a(y),v=n(1),b=a(v),T=n(14),E=a(T),S=n(3323),_=a(S),C=n(3340),O=a(C),x=n(3318),w=a(x),k=n(3475),P=a(k),A=750,D=function(e){function t(){var e,n,a,o;(0,s.default)(this,t);for(var i=arguments.length,l=Array(i),u=0;u<i;u++)l[u]=arguments[u];return n=a=(0,d.default)(this,(e=t.__proto__||(0,r.default)(t)).call.apply(e,[this].concat(l))),a.pulsate=function(){var e=E.default.findDOMNode(a.refs.innerCircle);if(e){var t=e.style.transform||"scale(1)",n="scale(1)"===t?"scale(0.85)":"scale(1)";O.default.set(e.style,"transform",n),a.timeout=setTimeout(a.pulsate,A)}},o=n,(0,d.default)(a,o)}return(0,f.default)(t,e),(0,u.default)(t,[{key:"componentDidMount",value:function(){this.props.show&&(this.setRippleSize(),this.pulsate())}},{key:"shouldComponentUpdate",value:function(e,t){return!(0,_.default)(this.props,e)||!(0,_.default)(this.state,t)}},{key:"componentDidUpdate",value:function(){this.props.show?(this.setRippleSize(),this.pulsate()):this.timeout&&clearTimeout(this.timeout)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout)}},{key:"getRippleElement",value:function(e){var t=e.color,n=e.innerStyle,a=e.opacity,o=this.context.muiTheme,r=o.prepareStyles,i=o.ripple,s=(0,m.default)({position:"absolute",height:"100%",width:"100%",borderRadius:"50%",opacity:a||.16,backgroundColor:t||i.color,transition:w.default.easeOut(A+"ms","transform",null,w.default.easeInOutFunction)},n);return g.default.createElement("div",{ref:"innerCircle",style:r((0,m.default)({},s))})}},{key:"setRippleSize",value:function(){var e=E.default.findDOMNode(this.refs.innerCircle),t=e.offsetHeight,n=e.offsetWidth,a=Math.max(t,n),o=0;-1!==e.style.top.indexOf("px",e.style.top.length-2)&&(o=parseInt(e.style.top)),e.style.height=a+"px",e.style.top=t/2-a/2+o+"px"}},{key:"render",value:function(){var e=this.props,t=e.show,n=e.style,a=(0,m.default)({height:"100%",width:"100%",position:"absolute",top:0,left:0},n),o=t?this.getRippleElement(this.props):null;return g.default.createElement(P.default,{maxScale:.85,style:a},o)}}]),t}(y.Component);D.contextTypes={muiTheme:b.default.object.isRequired},D.propTypes={},t.default=D},3474:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=t.muiTheme.overlay,a={root:{position:"fixed",height:"100%",width:"100%",top:0,left:"-100%",opacity:0,backgroundColor:n.backgroundColor,WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",willChange:"opacity",transform:"translateZ(0)",transition:e.transitionEnabled&&x.default.easeOut("0ms","left","400ms")+", "+x.default.easeOut("400ms","opacity")}};return e.show&&(0,T.default)(a.root,{left:0,opacity:1,transition:x.default.easeOut("0ms","left")+", "+x.default.easeOut("400ms","opacity")}),a}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3318),x=a(O),w=n(3471),k=a(w),P=function(e){function t(){return(0,p.default)(this,t),(0,y.default)(this,(t.__proto__||(0,c.default)(t)).apply(this,arguments))}return(0,v.default)(t,e),(0,h.default)(t,[{key:"setOpacity",value:function(e){this.refs.overlay.style.opacity=e}},{key:"render",value:function(){var e=this.props,t=e.autoLockScrolling,n=e.show,a=e.style,r=(e.transitionEnabled,(0,l.default)(e,["autoLockScrolling","show","style","transitionEnabled"])),s=this.context.muiTheme.prepareStyles,u=o(this.props,this.context);return S.default.createElement("div",(0,i.default)({},r,{ref:"overlay",style:s((0,T.default)(u.root,a))}),t&&S.default.createElement(k.default,{lock:n}))}}]),t}(E.Component);P.defaultProps={autoLockScrolling:!0,style:{},transitionEnabled:!0},P.contextTypes={muiTheme:C.default.object.isRequired},P.propTypes={},t.default=P},3475:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(205),O=a(C),x=n(3476),w=a(x),k=function(e){function t(){return(0,d.default)(this,t),(0,m.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,f.default)(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=e.childStyle,a=e.enterDelay,o=e.maxScale,i=e.minScale,l=e.style,u=(0,s.default)(e,["children","childStyle","enterDelay","maxScale","minScale","style"]),c=this.context.muiTheme.prepareStyles,d=(0,b.default)({},{position:"relative",height:"100%"},l),p=E.default.Children.map(t,function(e){return E.default.createElement(w.default,{key:e.key,enterDelay:a,maxScale:o,minScale:i,style:n},e)});return E.default.createElement(O.default,(0,r.default)({},u,{style:c(d),component:"div"}),p)}}]),t}(T.Component);k.defaultProps={enterDelay:0},k.contextTypes={muiTheme:_.default.object.isRequired},k.propTypes={},t.default=k},3476:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),r=a(o),i=n(8),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(14),O=a(C),x=n(3340),w=a(x),k=n(3318),P=a(k),A=function(e){function t(){return(0,d.default)(this,t),(0,m.default)(this,(t.__proto__||(0,u.default)(t)).apply(this,arguments))}return(0,g.default)(t,e),(0,f.default)(t,[{key:"componentWillUnmount",value:function(){clearTimeout(this.enterTimer),clearTimeout(this.leaveTimer)}},{key:"componentWillAppear",value:function(e){this.initializeAnimation(e)}},{key:"componentWillEnter",value:function(e){this.initializeAnimation(e)}},{key:"componentDidAppear",value:function(){this.animate()}},{key:"componentDidEnter",value:function(){this.animate()}},{key:"componentWillLeave",value:function(e){var t=O.default.findDOMNode(this).style;t.opacity="0",w.default.set(t,"transform","scale("+this.props.minScale+")"),this.leaveTimer=setTimeout(e,450)}},{key:"animate",value:function(){var e=O.default.findDOMNode(this).style;e.opacity="1",w.default.set(e,"transform","scale("+this.props.maxScale+")")}},{key:"initializeAnimation",value:function(e){var t=O.default.findDOMNode(this).style;t.opacity="0",w.default.set(t,"transform","scale(0)"),this.enterTimer=setTimeout(e,this.props.enterDelay)}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.enterDelay,e.maxScale,e.minScale,e.style),a=(0,s.default)(e,["children","enterDelay","maxScale","minScale","style"]),o=this.context.muiTheme.prepareStyles,i=(0,b.default)({},{position:"absolute",height:"100%",width:"100%",top:0,left:0,transition:P.default.easeOut(null,["transform","opacity"])},n);return E.default.createElement("div",(0,r.default)({},a,{style:o(i)}),t)}}]),t}(T.Component);A.defaultProps={enterDelay:0,maxScale:1,minScale:0},A.contextTypes={muiTheme:_.default.object.isRequired},A.propTypes={},t.default=A},3477:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n){var a=e.verticalPosition,o=e.horizontalPosition,r=e.touch?10:0,i=e.touch?-20:-10,s="bottom"===a?14+r:-14-r,l=t.muiTheme,u=l.baseTheme,c=l.zIndex,d=l.tooltip,p=l.borderRadius;return{root:{position:"absolute",fontFamily:u.fontFamily,fontSize:"10px",lineHeight:"22px",padding:"0 8px",zIndex:c.tooltip,color:d.color,overflow:"hidden",top:-1e4,borderRadius:p,userSelect:"none",opacity:0,right:"left"===o?12:null,left:"center"===o?(n.offsetWidth-48)/2*-1:"right"===o?12:null,transition:x.default.easeOut("0ms","top","450ms")+", "+x.default.easeOut("450ms","transform","0ms")+", "+x.default.easeOut("450ms","opacity","0ms")},label:{position:"relative",whiteSpace:"nowrap"},ripple:{position:"absolute",left:"center"===o?"50%":"left"===o?"100%":"0%",top:"bottom"===a?0:"100%",transform:"translate(-50%, -50%)",borderRadius:"50%",backgroundColor:"transparent",transition:x.default.easeOut("0ms","width","450ms")+", "+x.default.easeOut("0ms","height","450ms")+", "+x.default.easeOut("450ms","backgroundColor","0ms")},rootWhenShown:{top:"top"===a?i:36,opacity:d.opacity,transform:"translate(0px, "+s+"px)",transition:x.default.easeOut("0ms","top","0ms")+", "+x.default.easeOut("450ms","transform","0ms")+", "+x.default.easeOut("450ms","opacity","0ms")},rootWhenTouched:{fontSize:"14px",lineHeight:"32px",padding:"0 16px"},rippleWhenShown:{backgroundColor:d.rippleBackgroundColor,transition:x.default.easeOut("450ms","width","0ms")+", "+x.default.easeOut("450ms","height","0ms")+", "+x.default.easeOut("450ms","backgroundColor","0ms")}}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),i=a(r),s=n(8),l=a(s),u=n(6),c=a(u),d=n(2),p=a(d),f=n(3),h=a(f),m=n(5),y=a(m),g=n(4),v=a(g),b=n(9),T=a(b),E=n(0),S=a(E),_=n(1),C=a(_),O=n(3318),x=a(O),w=function(e){function t(){var e,n,a,o;(0,p.default)(this,t);for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=a=(0,y.default)(this,(e=t.__proto__||(0,c.default)(t)).call.apply(e,[this].concat(i))),a.state={offsetWidth:null},o=n,(0,y.default)(a,o)}return(0,v.default)(t,e),(0,h.default)(t,[{key:"componentDidMount",value:function(){this.setRippleSize(),this.setTooltipPosition()}},{key:"componentWillReceiveProps",value:function(){this.setTooltipPosition()}},{key:"componentDidUpdate",value:function(){this.setRippleSize()}},{key:"setRippleSize",value:function(){var e=this.refs.ripple,t=this.refs.tooltip,n=parseInt(t.offsetWidth,10)/("center"===this.props.horizontalPosition?2:1),a=parseInt(t.offsetHeight,10),o=Math.ceil(2*Math.sqrt(Math.pow(a,2)+Math.pow(n,2)));this.props.show?(e.style.height=o+"px",e.style.width=o+"px"):(e.style.width="0px",e.style.height="0px")}},{key:"setTooltipPosition",value:function(){this.setState({offsetWidth:this.refs.tooltip.offsetWidth})}},{key:"render",value:function(){var e=this.props,t=(e.horizontalPosition,e.label),n=(e.show,e.touch,e.verticalPosition,(0,l.default)(e,["horizontalPosition","label","show","touch","verticalPosition"])),a=this.context.muiTheme.prepareStyles,r=o(this.props,this.context,this.state);return S.default.createElement("div",(0,i.default)({},n,{ref:"tooltip",style:a((0,T.default)(r.root,this.props.show&&r.rootWhenShown,this.props.touch&&r.rootWhenTouched,this.props.style))}),S.default.createElement("div",{ref:"ripple",style:a((0,T.default)(r.ripple,this.props.show&&r.rippleWhenShown))}),S.default.createElement("span",{style:a(r.label)},t))}}]),t}(E.Component);w.contextTypes={muiTheme:C.default.object.isRequired},w.propTypes={},t.default=w},3478:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(68),r=a(o),i=n(6),s=a(i),l=n(2),u=a(l),c=n(3),d=a(c),p=n(5),f=a(p),h=n(4),m=a(h),y=n(320),g=a(y),v=n(9),b=a(v),T=n(0),E=a(T),S=n(1),_=a(S),C=n(14),O=a(C),x=n(205),w=a(x),k=n(3368),P=a(k),A=n(3472),D=a(A),R=function(e){return(0,g.default)(e).slice(1)},I=function(e){function t(e,n){(0,u.default)(this,t);var a=(0,f.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e,n));return a.handleMouseDown=function(e){0===e.button&&a.start(e,!1)},a.handleMouseUp=function(){a.end()},a.handleMouseLeave=function(){a.end()},a.handleTouchStart=function(e){e.stopPropagation(),a.props.abortOnScroll&&e.touches&&(a.startListeningForScrollAbort(e),a.startTime=Date.now()),a.start(e,!0)},a.handleTouchEnd=function(){a.end()},a.handleTouchMove=function(e){if(Math.abs(Date.now()-a.startTime)>300)return void a.stopListeningForScrollAbort();var t=Math.abs(e.touches[0].clientY-a.firstTouchY),n=Math.abs(e.touches[0].clientX-a.firstTouchX);if(t>6||n>6){var o=a.state.ripples,i=o[0],s=E.default.cloneElement(i,{aborted:!0});o=R(o),o=[].concat((0,r.default)(o),[s]),a.setState({ripples:o},function(){a.end()})}},a.ignoreNextMouseDown=!1,a.state={hasRipples:!1,nextKey:0,ripples:[]},a}return(0,m.default)(t,e),(0,d.default)(t,[{key:"start",value:function(e,t){var n=this.context.muiTheme.ripple;if(this.ignoreNextMouseDown&&!t)return void(this.ignoreNextMouseDown=!1);var a=this.state.ripples;a=[].concat((0,r.default)(a),[E.default.createElement(D.default,{key:this.state.nextKey,style:this.props.centerRipple?{}:this.getRippleStyle(e),color:this.props.color||n.color,opacity:this.props.opacity,touchGenerated:t})]),this.ignoreNextMouseDown=t,this.setState({hasRipples:!0,nextKey:this.state.nextKey+1,ripples:a})}},{key:"end",value:function(){var e=this.state.ripples;this.setState({ripples:R(e)}),this.props.abortOnScroll&&this.stopListeningForScrollAbort()}},{key:"startListeningForScrollAbort",value:function(e){this.firstTouchY=e.touches[0].clientY,this.firstTouchX=e.touches[0].clientX,document.body.addEventListener("touchmove",this.handleTouchMove)}},{key:"stopListeningForScrollAbort",value:function(){document.body.removeEventListener("touchmove",this.handleTouchMove)}},{key:"getRippleStyle",value:function(e){var t=O.default.findDOMNode(this),n=t.offsetHeight,a=t.offsetWidth,o=P.default.offset(t),r=e.touches&&e.touches.length,i=r?e.touches[0].pageX:e.pageX,s=r?e.touches[0].pageY:e.pageY,l=i-o.left,u=s-o.top,c=this.calcDiag(l,u),d=this.calcDiag(a-l,u),p=this.calcDiag(a-l,n-u),f=this.calcDiag(l,n-u),h=Math.max(c,d,p,f),m=2*h;return{directionInvariant:!0,height:m,width:m,top:u-h,left:l-h}}},{key:"calcDiag",value:function(e,t){return Math.sqrt(e*e+t*t)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.style,a=this.state,o=a.hasRipples,r=a.ripples,i=this.context.muiTheme.prepareStyles,s=void 0;if(o){var l=(0,b.default)({height:"100%",width:"100%",position:"absolute",top:0,left:0,overflow:"hidden",pointerEvents:"none",zIndex:1},n);s=E.default.createElement(w.default,{style:i(l)},r)}return E.default.createElement("div",{onMouseUp:this.handleMouseUp,onMouseDown:this.handleMouseDown,onMouseLeave:this.handleMouseLeave,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},s,t)}}]),t}(T.Component);I.defaultProps={abortOnScroll:!0},I.contextTypes={muiTheme:_.default.object.isRequired},I.propTypes={},t.default=I},3479:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(3342),s=a(i),l=n(3339),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))};c=(0,s.default)(c),c.displayName="NavigationCheck",c.muiName="SvgIcon",t.default=c},3480:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(3342),s=a(i),l=n(3339),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}))};c=(0,s.default)(c),c.displayName="NavigationExpandLess",c.muiName="SvgIcon",t.default=c},3481:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(3342),s=a(i),l=n(3339),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"}))};c=(0,s.default)(c),c.displayName="NavigationExpandMore",c.muiName="SvgIcon",t.default=c},3482:function(e,t,n){"use strict";function a(e,t,n){return r.default.Children.map(e,function(e){if(!r.default.isValidElement(e))return e;var a="function"==typeof t?t(e):t,o="function"==typeof n?n(e):n||e.props.children;return r.default.cloneElement(e,a,o)})}Object.defineProperty(t,"__esModule",{value:!0}),t.extendChildren=a;var o=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(o)},3483:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.largeWidth,n=void 0===t?992:t,a=e.mediumWidth,o=void 0===a?768:a,r=e.resizeInterval,s=void 0===r?166:r;return function(e){return function(t){function a(){var e,t,n,o;(0,c.default)(this,a);for(var r=arguments.length,i=Array(r),u=0;u<r;u++)i[u]=arguments[u];return t=n=(0,h.default)(this,(e=a.__proto__||(0,l.default)(a)).call.apply(e,[this].concat(i))),n.state={width:null},n.handleResize=function(){clearTimeout(n.deferTimer),n.deferTimer=setTimeout(function(){n.updateWidth()},s)},o=t,(0,h.default)(n,o)}return(0,y.default)(a,t),(0,p.default)(a,[{key:"componentDidMount",value:function(){this.updateWidth()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.deferTimer)}},{key:"updateWidth",value:function(){var e=window.innerWidth,t=void 0;(t=e>=n?_:e>=o?S:E)!==this.state.width&&this.setState({width:t})}},{key:"render",value:function(){var t=this.state.width;return null===t?null:v.default.createElement(T.default,{target:"window",onResize:this.handleResize},v.default.createElement(e,(0,i.default)({width:t},this.props)))}}]),a}(g.Component)}}Object.defineProperty(t,"__esModule",{value:!0}),t.LARGE=t.MEDIUM=t.SMALL=void 0;var r=n(7),i=a(r),s=n(6),l=a(s),u=n(2),c=a(u),d=n(3),p=a(d),f=n(5),h=a(f),m=n(4),y=a(m);t.default=o;var g=n(0),v=a(g),b=n(721),T=a(b),E=t.SMALL=1,S=t.MEDIUM=2,_=t.LARGE=3},3484:function(e,t,n){"use strict";function a(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}n.d(t,"b",function(){return u}),n.d(t,"c",function(){return h}),n.d(t,"d",function(){return m}),n.d(t,"a",function(){return a});var o=n(0),r=(n.n(o),n(114)),i=(n.n(r),n(246)),s=(n.n(i),n(729)),l=(n.n(s),n(252)),u=function(e){return function(t){var a=n.i(o.createFactory)(t),r=function(t){return a(e(t))};return r}},c=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},f=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},h=function(e){var t=u(function(t){return d({},t,"function"==typeof e?e(t):e)});return t},m=(Object.keys,function(e){function t(){return c(this,t),f(this,e.apply(this,arguments))}p(t,e),t.prototype.render=function(){return null}}(o.Component),function(e){return function(t){var a=n.i(o.createFactory)(t),r=function(e,t){return a(d({},e,t))};return r.contextTypes=e,r}}),y={fromESObservable:null,toESObservable:null},g={fromESObservable:function(e){return"function"==typeof y.fromESObservable?y.fromESObservable(e):e},toESObservable:function(e){return"function"==typeof y.toESObservable?y.toESObservable(e):e}}},3485:function(e,t,n){"use strict";t.__esModule=!0;var a=function(e){if("string"==typeof e)return e;if(e)return e.displayName||e.name||"Component"};t.default=a},3486:function(e,t,n){"use strict";t.__esModule=!0;var a=function(e,t){return function(n){return n[e]=t,n}};t.default=a},3487:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}t.__esModule=!0;var s=n(0),l=n(3370),u=(a(l),n(3371)),c=(a(u),function(e){return function(t){var n=(0,s.createFactory)(t),a=function(t){function a(){return o(this,a),r(this,t.apply(this,arguments))}return i(a,t),a.prototype.shouldComponentUpdate=function(t){return e(this.props,t)},a.prototype.render=function(){return n(this.props)},a}(s.Component);return a}});t.default=c},3488:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t){var n=e.onClick,o=(e.isPristine,e.isDirtyHandler),r=void 0===o?c.a.getState.bind(c.a):o,s=a(e,["onClick","isPristine","isDirtyHandler"]),u=r&&r()&&r().dirty,p=function(){u?confirm(t.d2.i18n.getTranslation("abandon_unsaved_changes"))&&n.apply(void 0,arguments):n.apply(void 0,arguments)};return i.a.createElement(l.a,d({},s,{onClick:p,secondary:u,label:t.d2.i18n.getTranslation("cancel")}))}var r=n(0),i=n.n(r),s=n(74),l=n.n(s),u=n(83),c=n(245),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};o.propTypes={onClick:i.a.PropTypes.func.isRequired,isDirtyHandler:i.a.PropTypes.func},t.a=n.i(u.a)(o)},3489:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e){return A.a.has(e)?A.a.get(e):[]}function r(e,t,n,a){n&&t.setValue(a,e)}function i(e,t,n){if(e)return e.props[t.propName]=n?t.thenValue:t.elseValue}function s(e,t,n){n&&e?(e.hiddenComponent=e.hiddenComponent||e.component,e.component=function(){return null}):e&&e.hiddenComponent&&(e.component=e.hiddenComponent,delete e.hiddenComponent)}function l(e,t,n){n&&e.hiddenComponent?(e.component=e.hiddenComponent,delete e.hiddenComponent):(e.hiddenComponent=e.hiddenComponent||e.component,e.component=function(){return null})}function u(e){return I.has(e)?I.get(e):x.a}function c(e){return R.has(e)?R.get(e):x.a}function d(e){return void 0!==e&&null!==e}function p(e){return d(e)&&e.toString().trim().length>0}function f(e,t){return e===t}function h(e,t){return e!==t}function m(e,t){return t.indexOf(e)>=0}function y(e,t){return t.indexOf(e)<0}function g(e,t,n){return t(e,n)}function v(e){try{var t=JSON.parse(e);return Array.isArray(t)&&(0===t.length||2===t.length&&!isNaN(t[0])&&!isNaN(t[1]))}catch(e){return!1}}function b(e,t,n){return n.hasOwnProperty("hiddenComponent")}function T(e,t){return!0===(D.a.getState()?D.a.getState()[t]:void 0)}function E(e,t){return!1===(D.a.getState()?D.a.getState()[t]:void 0)}function S(e,t,n){var a=e.whenFieldName,o=e.operatorFn,r=e.whenValue;return o(n[a],r,t,n,a)}function _(e,t,n,a){return e.map(function(e,o){var r=a.find(function(n){return n.name===(e.field||t.field)});return S({whenFieldName:e.field?e.field:t.field,operatorFn:c(e.operator),whenValue:e.value},r,n)})}function C(e,t,n){return e.forEach(function(e){var o=P()(e.when)?e.when:[e.when],r=_(o,e,n,t).some(function(e){return!0===e});(e.operations||[e.operation]).forEach(function(o){var i=t.find(function(t){return t.name===(o.field||e.field)}),s=(o.field,o.type),l=a(o,["field","type"]);u(s)(i,l,r,n)})}),t}t.b=o,t.a=C;var O=n(448),x=n.n(O),w=n(15),k=(n.n(w),n(169)),P=n.n(k),A=n(3520),D=n(451),R=new Map([["EQUALS",f],["NOT_EQUALS",h],["HAS_VALUE",d],["HAS_NO_VALUE",n.i(w.negate)(d)],["HAS_STRING_VALUE",p],["ONEOF",m],["NONEOF",y],["SYSTEM_SETTING_IS_TRUE",T],["SYSTEM_SETTING_IS_FALSE",E],["IS_VALID_POINT",v],["IS_HIDDEN_FIELD",b],["PREDICATE",g]]),I=new Map([["SET_PROP",i],["CHANGE_VALUE",r],["HIDE_FIELD",s],["SHOW_FIELD",l]])},3490:function(e,t,n){"use strict";function a(e){var t=e.query&&e.query.pageSize||50,n=e.total,a=e.pageCount,o=e.page,r=n-(n-(a-(a-o))*t),i=1+r-t,s=r;return i+" - "+(s>n?n:s)}t.a=a},3495:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return o});var a=function(e){if(!e)return{publicAccess:"--------",externalAccess:!1,userGroupAccesses:[],userAccesses:[]};var t=e.public,n=e.users,a=e.userGroups,o=e.external;return{publicAccess:t||"--------",externalAccess:Boolean(o),userGroupAccesses:a?Object.values(a).map(function(e){return{id:e.id,access:e.access,displayName:e.displayName,userGroupUid:e.id}}):[],userAccesses:n?Object.values(n).map(function(e){return{id:e.id,access:e.access,displayName:e.displayName,userUid:e.id}}):[]}},o=function(e){if(!e)return{public:"--------",external:!1,userGroups:{},users:{}};var t=e.publicAccess,n=e.externalAccess,a=e.userGroupAccesses,o=e.userAccesses;return{public:t||"--------",external:Boolean(n),userGroups:r(a),users:r(o)}},r=function(e){return e.reduce(function(e,t){return e[t.id]={displayName:t.displayName,access:t.access,id:t.id},e},{})}},3496:function(e,t,n){"use strict";(function(e){function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(25),d=(n.n(c),n(317)),p=n.n(d),f=n(3512),h=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),m=function(t){function n(){return a(this,n),o(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return r(n,t),h(n,[{key:"componentDidMount",value:function(){var t=this;this.subscription=c.Observable.fromEvent(e,"scroll").debounceTime(200).map(function(){return document.querySelector("body").scrollTop}).subscribe(function(){return t.forceUpdate()})}},{key:"componentWillUnmount",value:function(){this.subscription&&this.subscription.unsubscribe()}},{key:"render",value:function(){var e={maxWidth:500,minWidth:300,marginTop:document.querySelector("body").scrollTop};return s.a.createElement("div",{style:this.props.style},s.a.createElement(p.a,{zDepth:1,rounded:!1,style:e},s.a.createElement(f.a,{source:this.props.detailsObject,showDetailBox:!!this.props.detailsObject,onClose:this.props.onClose})))}}]),n}(i.Component);m.propTypes={style:u.a.object,detailsObject:u.a.object.isRequired,onClose:u.a.func.isRequired},m.defaultProps={style:{}},t.a=m}).call(t,n(32))},3497:function(e,t,n){"use strict";function a(e){var t=e.style,n=void 0===t?{}:t,a=e.large,o=void 0!==a&&a,r=e.small,i=void 0!==r&&r;return s.a.createElement("div",{style:Object.assign({},u,n)},s.a.createElement(l.a,{large:o,small:i}))}t.a=a;var o=n(1),r=n.n(o),i=n(0),s=n.n(i),l=n(150),u={left:"45%",position:"fixed",top:"45%"};a.propTypes={style:r.a.object,large:r.a.bool,small:r.a.bool}},3509:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.BubbleListItem=t.BubbleList=t.SpeedDial=void 0;var o=n(3575),r=a(o),i=n(3571),s=a(i),l=n(3408),u=a(l);t.SpeedDial=r.default,t.BubbleList=s.default,t.BubbleListItem=u.default},3510:function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"c",function(){return r}),n.d(t,"a",function(){return i});var a=n(15),o=(n.n(a),n.i(a.get)("eventProgram.step.activeStep")),r=n.i(a.get)("eventProgram.step.disabled"),i=n.i(a.get)("eventProgram.step.isSaving")},3511:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(133),d=n.n(c),p=n(1317),f=n.n(p),h=n(443),m=n.n(h),y=n(115),g=n.n(y),v=n(98),b=n.n(v),T=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),E=function(e){function t(){var e,n,r,i;a(this,t);for(var s=arguments.length,l=Array(s),u=0;u<s;u++)l[u]=arguments[u];return n=r=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.state={open:!1},r.handleOpen=function(e){e.preventDefault(),r.setState({open:!0,anchorEl:e.currentTarget})},r.handleRequestClose=function(){r.setState({open:!1})},r.handleAction=function(e){r.handleRequestClose(),e()},i=n,o(r,i)}return r(t,e),T(t,[{key:"render",value:function(){var e=this,t=this.props.actions.map(function(t){return s.a.createElement(g.a,{primaryText:t.title,key:t.title,leftIcon:s.a.createElement(b.a,{className:"material-icons"},t.icon),onClick:function(){return e.handleAction(t.action)}})});return s.a.createElement("div",null,s.a.createElement(d.a,{onClick:this.handleOpen},s.a.createElement(b.a,{color:"gray",className:"material-icons"},"settings")),s.a.createElement(f.a,{open:this.state.open,anchorEl:this.state.anchorEl,anchorOrigin:{horizontal:"left",vertical:"bottom"},targetOrigin:{horizontal:"left",vertical:"top"},onRequestClose:this.handleRequestClose},s.a.createElement(m.a,null,t)))}}]),t}(i.Component);E.propTypes={actions:u.a.array},t.a=E},3512:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(21),d=n.n(c),p=n(723),f=n.n(p),h=n(95),m=n.n(h),y=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),g=function(e){function t(){var e,n,r,i;a(this,t);for(var l=arguments.length,u=Array(l),c=0;c<l;c++)u[c]=arguments[c];return n=r=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.getTranslation=function(e){return r.context.d2.i18n.getTranslation(e)},r.getDetailBoxContent=function(){return r.props.source?r.props.fields.filter(function(e){return r.props.source[e]}).map(function(e){var t=r.getValueToRender(e,r.props.source[e]);return s.a.createElement("div",{key:e,className:"detail-field"},s.a.createElement("div",{className:"detail-field__label detail-field__"+e+"-label"},r.getTranslation(m()(e))),s.a.createElement("div",{className:"detail-field__value detail-field__"+e},t))}):s.a.createElement("div",{className:"detail-box__status"},"Loading details...")},r.getDateString=function(e){var t=new Date(e).toString();return"Invalid Date"===t?e:t},r.getNamesToDisplay=function(e){var t=e.map(function(e){return e.displayName?e.displayName:e.name}).filter(function(e){return e});return s.a.createElement("ul",null,t.map(function(e){return s.a.createElement("li",{key:e},e)}))},r.getJsonApiResource=function(e){return s.a.createElement("a",{style:{wordBreak:"break-all"},href:e+".json",rel:"noopener noreferrer",target:"_blank"},e)},r.getValueToRender=function(e,t){return Array.isArray(t)&&t.length?r.getNamesToDisplay(t):"created"===e||"lastUpdated"===e?r.getDateString(t):"href"===e?r.getJsonApiResource(t):t},i=n,o(r,i)}return r(t,e),y(t,[{key:"render",value:function(){var e=d()("details-box"),t=s.a.createElement(f.a,{className:"details-box__close-button material-icons",onClick:this.props.onClose},"close");return!1===this.props.showDetailBox?null:s.a.createElement("div",{className:e},t,s.a.createElement("div",null,this.getDetailBoxContent()))}}]),t}(i.Component);g.propTypes={fields:u.a.array,showDetailBox:u.a.bool,source:u.a.object,onClose:u.a.func},g.defaultProps={source:u.a.object,fields:["name","locale","shortName","code","displayDescription","created","lastUpdated","id","href"],showDetailBox:!1,onClose:function(){}},g.contextTypes={d2:u.a.object.isRequired},t.a=g},3513:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1313),u=n.n(l),c=n(723),d=n.n(c),p=n(731),f=n.n(p),h=n(202),m=n(3356),y=n(3509),g=(n.n(y),n(83)),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),T=function(e){function t(e,n){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.state={items:[{id:"WITHOUT_REGISTRATION",primaryText:n.d2.i18n.getTranslation("event_program"),rightAvatar:s.a.createElement(f.a,{className:"material-icons",icon:s.a.createElement(d.a,null,"event")})},{id:"WITH_REGISTRATION",primaryText:n.d2.i18n.getTranslation("tracker_program"),rightAvatar:s.a.createElement(f.a,{className:"material-icons",icon:s.a.createElement(d.a,null,"assignment")})}]},r}return r(t,e),b(t,[{key:"handleClick",value:function(e){n.i(h.a)("/edit/"+this.props.groupName+"/"+this.props.modelType+"/add?type="+e.id)}},{key:"render",value:function(){var e=this;return s.a.createElement(y.SpeedDial,{hasBackdrop:!0},s.a.createElement(y.BubbleList,null,this.state.items.map(function(t,n){return s.a.createElement(y.BubbleListItem,v({key:t.id},t,{onClick:e.handleClick.bind(e,t)}))})))}}]),t}(s.a.Component);T=n.i(g.a)(T);var E=s.a.createClass({displayName:"ListActionBar",propTypes:{modelType:s.a.PropTypes.string.isRequired,groupName:s.a.PropTypes.string.isRequired},_addClick:function(){n.i(h.a)("/edit/"+this.props.groupName+"/"+this.props.modelType+"/add")},render:function(){var e={textAlign:"right",marginTop:"1rem",bottom:"1.5rem",right:"1.5rem",position:"fixed",zIndex:10},t=this.props.getModelDefinitionByName(this.props.modelType);return this.props.getCurrentUser().canCreate(t)&&("program"!==this.props.modelType||this.props.getCurrentUser().canCreate(this.props.getModelDefinitionByName("programStage")))?s.a.createElement("div",{style:e},"program"===this.props.modelType?s.a.createElement(T,this.props):s.a.createElement(u.a,{onClick:this._addClick},s.a.createElement(d.a,{className:"material-icons"},"add"))):null}});t.a=n.i(m.a)(E)},3514:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(248),i=n.n(r);t.a=o.a.createClass({displayName:"LoadingStatus.component",propTypes:{isLoading:o.a.PropTypes.bool.isRequired},getDefaultProps:function(){return{isLoading:!1}},render:function(){return this.props.isLoading?o.a.createElement(i.a,{mode:"indeterminate",style:{backgroundColor:"lightblue"}}):null}})},3515:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(3521),i=n(1308),s=n(58),l=n.n(s),u=n(134),c=n(323),d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},p=["organisationUnit"],f=o.a.createClass({displayName:"SearchBox",propTypes:{searchObserverHandler:o.a.PropTypes.func.isRequired,initialValue:o.a.PropTypes.string},mixins:[r.a,i.a],getInitialState:function(){return{showSearchField:!1,value:this.props.initialValue||""}},componentWillMount:function(){this.searchBoxCb=this.createEventObserver("searchBox")},componentWillReceiveProps:function(e){this.props.params.modelType!==e.params.modelType&&this.setState({value:""})},componentDidMount:function(){var e=this,t=this.events.searchBox.debounceTime(400).map(function(e){return e&&e.target&&e.target.value?e.target.value:""}).distinctUntilChanged();this.props.searchObserverHandler(t),this.subscription=u.d.subscribe(function(t){return e.setState(d({},e.state,{showSearchField:!p.includes(t)}))})},componentWillUnmount:function(){this.subscription&&this.subscription.unsubscribe&&this.subscription.unsubscribe()},render:function(){var e={display:"inline-block",marginRight:16,position:"relative",top:-15};return this.state.showSearchField?o.a.createElement("div",{className:"search-list-items",style:e},o.a.createElement(l.a,{className:"list-search-field",value:this.state.value,fullWidth:!1,type:"search",onChange:this._onKeyUp,floatingLabelText:""+this.getTranslation("search_by_name_code_id")})):null},_onKeyUp:function(e){this.setState({value:e.target.value}),this.searchBoxCb(e)}});t.a=n.i(c.g)(f)},3516:function(e,t,n){"use strict";function a(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function a(o,r){try{var i=t[o](r),s=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(s).then(function(e){a("next",e)},function(e){a("throw",e)});e(s)}return a("next")})}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),l=n.n(s),u=n(437),c=n.n(u),d=n(151),p=n.n(d),f=n(200),h=n.n(f),m=n(58),y=n.n(m),g=n(83),v=n(316),b=n(440),T=n(44),E=n(84),S=function(){function e(e,t){var n=[],a=!0,o=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(a=(i=s.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){o=!0,r=e}finally{try{!a&&s.return&&s.return()}finally{if(o)throw r}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),C=T.a.create(),O=T.a.create(),x=function(e){function t(e,n){var i=this;o(this,t);var s=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return s._changeFilter=function(e){s.setState({filterText:e.target.value})},s._assignItems=function(){var e=a(regeneratorRuntime.mark(function e(t){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=O.getState().concat(t),O.setState(n),e.abrupt("return",Promise.resolve(!0));case 3:case"end":return e.stop()}},e,i)}));return function(t){return e.apply(this,arguments)}}(),s._removeItems=function(e){var t=O.getState().filter(function(t){return-1===e.indexOf(t)});return O.setState(t),Promise.resolve(!0)},s._saveCollection=function(){var e=O.getState().map(function(e){return e.split(".")}).filter(function(e){return 2===e.length}).map(function(e){var t=S(e,2);return{dataElement:{id:t[0]},categoryOptionCombo:{id:t[1]}}});s.setState({isSaving:!0}),s.props.model.compulsoryDataElementOperands=e,s.props.model.save().then(function(){E.a.show({message:"saved_compulsory_data_elements",translate:!0})}).catch(function(){E.a.show({message:"failed_to_save_compulsory_data_elements",action:"ok",translate:!0})}).then(function(){s.setState({isSaving:!1}),s.props.onRequestClose()})},s.state={filterText:"",isSaving:!1},s.i18n=n.d2.i18n,e.dataElementOperands&&e.model&&(C.setState(e.dataElementOperands.map(function(e){return{text:e.displayName,value:e.dataElementId+"."+e.optionComboId}})),O.setState(e.model.compulsoryDataElementOperands.filter(function(e){return e.dataElement&&e.categoryOptionCombo}).map(function(e){return e.dataElement.id+"."+e.categoryOptionCombo.id}))),s}return i(t,e),_(t,[{key:"componentWillReceiveProps",value:function(e){e.open?e.dataElementOperands&&e.model&&(C.setState(e.dataElementOperands.map(function(e){return{text:e.displayName,value:[e.dataElementId,e.optionComboId].join(".")}})),O.setState(e.model.compulsoryDataElementOperands.filter(function(e){return e.dataElement&&e.categoryOptionCombo}).map(function(e){return[e.dataElement.id,e.categoryOptionCombo.id].join(".")}))):(C.setState(void 0),O.setState([]))}},{key:"render",value:function(){var e=this.state.isSaving?this.i18n.getTranslation("saving"):this.i18n.getTranslation("save"),t=[l.a.createElement(p.a,{disabled:this.state.isSaving,style:{marginRight:"1rem"},onClick:this.props.onRequestClose,label:this.i18n.getTranslation("close")}),l.a.createElement(h.a,{labelColor:"white",disabled:this.state.isSaving,primary:!0,onClick:this._saveCollection,label:e})];return l.a.createElement(c.a,{open:this.props.open,onRequestClose:this.props.onRequestClose,autoScrollBodyContent:!0,modal:!0,actions:t,contentStyle:{maxWidth:"none",width:"95%"}},l.a.createElement("div",{style:{marginBottom:"3.5rem"}},l.a.createElement(v.a,null,this.i18n.getTranslation("edit_compulsory_data_elements")," - ",this.props.model&&this.props.model.displayName),l.a.createElement(y.a,{floatingLabelText:this.i18n.getTranslation("filter"),style:{width:"100%"},onChange:this._changeFilter}),l.a.createElement(b.a,{itemStore:C,assignedItemStore:O,onAssignItems:this._assignItems,onRemoveItems:this._removeItems,height:350,filterText:this.state.filterText})))}}]),t}(s.Component);t.a=n.i(g.a)(x)},3517:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(1329),i=n(727),s=n.n(i),l=n(1336),u=n.n(l),c=n(3527),d=n.n(c),p=n(1337),f=n.n(p),h=n(1315),m=n.n(h),y=n(247),g=n.n(y),v=n(15),b=(n.n(v),n(170)),T=g()(function(){return{}}),E=s()(function(e){var t=e.value;return!n.i(v.isString)(t)},m.a),S=s()(function(e){return!0===e.value},f()(T(u.a)))(T(d.a));n.i(r.b)(function(e){return"BOOLEAN"===e.valueType},S),n.i(r.b)(function(e){var t=e.columnName,n=e.valueType;return"formType"===t&&"CONSTANT"===n},E(function(e){var t=e.value;return o.a.createElement(b.a,null,t.toLowerCase())})),n.i(r.b)(function(e){var t=e.columnName,n=e.valueType,a=e.value;return"icon"===t&&"URL"===n&&a.endsWith("/icon")},function(e){var t=e.value;return o.a.createElement("img",{width:36,src:t,alt:"icon"})})},3518:function(e,t,n){"use strict";function a(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function a(o,r){try{var i=t[o](r),s=i.value}catch(e){return void n(e)}if(!i.done)return Promise.resolve(s).then(function(e){a("next",e)},function(e){a("throw",e)});e(s)}return a("next")})}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),l=n.n(s),u=n(152),c=n.n(u),d=n(74),p=n.n(d),f=n(97),h=n.n(f),m=n(449),y=n.n(m),g=n(1330),v=n.n(g),b=n(18),T=(n.n(b),n(84)),E=n(1314),S=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),_=function(e){function t(){var e;o(this,t);for(var n=arguments.length,a=Array(n),i=0;i<n;i++)a[i]=arguments[i];var s=r(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(a)));return s.state={open:!1,running:!1},s.getTranslation=s.context.d2.i18n.getTranslation.bind(s.context.d2.i18n),s.setStartDate=s.setStartDate.bind(s),s.setEndDate=s.setEndDate.bind(s),s.executeAction=s.executeAction.bind(s),s}return i(t,e),S(t,[{key:"componentDidMount",value:function(){var e=this;this.subscriptions=[],this.subscriptions.push(E.a.subscribe(function(t){return e.setState(t)}))}},{key:"componentWillUnmount",value:function(){this.subscriptions.forEach(function(e){return e.unsubscribe&&e.unsubscribe()})}},{key:"requestClose",value:function(){E.a.setState(Object.assign({},E.a.state,{open:!1}))}},{key:"setStartDate",value:function(e,t){var n=new Date(t);this.setState({startDate:n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()})}},{key:"setEndDate",value:function(e,t){var n=new Date(t);this.setState({endDate:n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()})}},{key:"executeAction",value:function(){function e(){return t.apply(this,arguments)}var t=a(regeneratorRuntime.mark(function e(){var t,a,o,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.i(b.getInstance)();case 2:t=e.sent,a=[this.state.model.modelDefinition.plural,this.state.model.id,"run"].join("/"),o=a+"?startDate="+this.state.startDate+"&endDate="+this.state.endDate,this.setState({running:!0}),t.Api.getApi().post(o,{startDate:this.state.startDate,endDate:this.state.endDate}).then(function(e){T.a.show({message:e.message,action:"ok"}),r.setState({open:!1,running:!1})}).catch(function(e){T.a.show({message:r.getTranslation("failed_to_start_predictor")+": "+e.message,action:"ok"}),r.setState({open:!1,running:!1}),console.error(e)});case 7:case"end":return e.stop()}},e,this)}));return e}()},{key:"render",value:function(){var e=[l.a.createElement(p.a,{label:this.getTranslation("cancel"),onClick:this.requestClose,style:{marginRight:16},disabled:this.state.running}),l.a.createElement(c.a,{label:this.getTranslation("run_predictor"),primary:!0,onClick:this.executeAction,disabled:!this.state.startDate||!this.state.endDate||this.state.running})];return l.a.createElement(h.a,{open:this.state.open,actions:e,title:this.getTranslation("run_predictor"),contentStyle:{maxWidth:450},bodyStyle:{marginLeft:64},autoScrollBodyContent:!0},this.state.running?l.a.createElement("div",null,l.a.createElement("div",{style:{textAlign:"center",marginRight:64}},this.getTranslation("running_predictor")),l.a.createElement("div",{style:{marginTop:32,marginRight:64,textAlign:"center"}},l.a.createElement(v.a,null))):l.a.createElement("div",null,l.a.createElement(y.a,{autoOk:!0,floatingLabelText:this.getTranslation("start_date")+" (*)",onChange:this.setStartDate}),l.a.createElement(y.a,{autoOk:!0,floatingLabelText:this.getTranslation("end_date")+" (*)",onChange:this.setEndDate})),l.a.createElement("div",{style:{marginBottom:16}}))}}]),t}(l.a.Component);_.contextTypes={d2:l.a.PropTypes.any},t.a=_},3519:function(e,t,n){"use strict";function a(e){return{ENROLLMENT:[{analyticsPeriodBoundaryType:r.g,boundaryTarget:r.c},{analyticsPeriodBoundaryType:r.f,boundaryTarget:r.c}],EVENT:[{analyticsPeriodBoundaryType:r.g,boundaryTarget:r.b},{analyticsPeriodBoundaryType:r.f,boundaryTarget:r.b}]}[e]}function o(e,t){return{field:e,when:[{operator:"EQUALS",value:void 0}],operations:[{type:"CHANGE_VALUE",setValue:function(e,n){n&&(n.value=t,e[n.name]=t)}}]}}t.b=a,t.a=o;var r=n(1326)},3520:function(e,t,n){"use strict";function a(e,t){e.optionSet&&e.optionSet.valueType&&(t.value=e.optionSet.valueType,e[t.name]!==e.optionSet.valueType&&(e[t.name]=e.optionSet.valueType))}var o=n(3519);t.a=new Map([["dataElement",[{field:"domainType",when:{operator:"EQUALS",value:"TRACKER"},operations:[{field:"categoryCombo",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"optionSet",when:{operator:"PREDICATE",value:function(){return!0}},operations:[{type:"CHANGE_VALUE",field:"valueType",setValue:function(e,t){if(e&&("MULTI_TEXT"===e.valueType||e.optionSet&&"MULTI_TEXT"===e.optionSet.valueType))t.originalOptions&&(t.props.options=t.originalOptions);else{var n=t.props.options;t.originalOptions||(t.originalOptions=t.props.options),t.props.options=n.filter(function(e){return"MULTI_TEXT"!==e.value})}}}]},{field:"valueType",when:{field:"optionSet",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{type:"CHANGE_VALUE",setValue:a}]},{field:"aggregationType",when:{field:"valueType",operator:"ONEOF",value:["TEXT","LONG_TEXT","MULTI_TEXT","LETTER","PHONE_NUMBER","EMAIL","TRACKER_ASSOCIATE","USERNAME","FILE_RESOURCE","COORDINATE"]},operations:[{field:"aggregationType",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{field:"aggregationType",type:"CHANGE_VALUE",setValue:function(e,t){t.value="NONE",e[t.name]="NONE"}}]}]],["dataSetNotificationTemplate",[{when:[{field:"dataSetNotificationTrigger",operator:"NOT_EQUALS",value:"SCHEDULED_DAYS"}],operations:[{field:"relativeScheduledDays",type:"HIDE_FIELD"},{field:"sendStrategy",type:"HIDE_FIELD"}]},{field:"deliveryChannels",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"ORGANISATION_UNIT_CONTACT"}],operations:[{field:"deliveryChannels",type:"HIDE_FIELD"}]}]],["attribute",[{field:"valueType",when:{field:"optionSet",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{type:"CHANGE_VALUE",setValue:a}]}]],["trackedEntityAttribute",[{field:"unique",when:[{field:"valueType",operator:"ONEOF",value:["BOOLEAN","TRUE_ONLY","DATE","TRACKER_ASSOCIATE","USERNAME","OPTION_SET"]}],operations:[{field:"unique",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{field:"unique",type:"CHANGE_VALUE",setValue:function(e,t){t.value=!1,e.unique=!1}}]},{field:"valueType",when:{field:"optionSet",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1},{type:"CHANGE_VALUE",setValue:a}]},{field:"orgunitScope",when:[{field:"unique",operator:"NOT_EQUALS",value:!0},{field:"valueType",operator:"ONEOF",value:["BOOLEAN","TRUE_ONLY","DATE","TRACKER_ASSOCIATE","USERNAME","OPTION_SET"]}],operations:[{type:"HIDE_FIELD"}]},{field:"generated",when:[{field:"orgunitScope",operator:"IS_HIDDEN_FIELD"},{field:"orgunitScope",operator:"ONEOF",value:["organisation_unit"]},{field:"orgunitScope",operator:"EQUALS",value:!0}],operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=!1,e.generated=!1}}]},{field:"pattern",when:[{field:"generated",operator:"IS_HIDDEN_FIELD"},{field:"generated",operator:"NOT_EQUALS",value:!0}],operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=null,e.pattern=null}}]}]],["externalMapLayer",[{field:"legendSetUrl",when:[{field:"legendSet",operator:"HAS_VALUE"}],operations:[{field:"legendSetUrl",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"legendSet",when:[{field:"legendSetUrl",operator:"HAS_STRING_VALUE"}],operations:[{field:"legendSet",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"mapLayerPosition",when:[{field:"mapService",operator:"ONEOF",value:["GEOJSON_URL","ARCGIS_FEATURE"]}],operations:[{field:"mapLayerPosition",type:"CHANGE_VALUE",setValue:function(e,t){t.value="OVERLAY",e[t.name]="OVERLAY"}}]},{field:"mapLayerPosition",when:[{field:"mapService",operator:"EQUALS",value:"VECTOR_STYLE"}],operations:[{field:"mapLayerPosition",type:"CHANGE_VALUE",setValue:function(e,t){t.value="BASEMAP",e[t.name]="BASEMAP"}}]}]],["organisationUnit",[{field:"dataSets",when:[{operator:"SYSTEM_SETTING_IS_FALSE",value:"keyAllowObjectAssignment"}],operations:[{field:"dataSets",type:"HIDE_FIELD"}]},{field:"programs",when:[{operator:"SYSTEM_SETTING_IS_FALSE",value:"keyAllowObjectAssignment"}],operations:[{field:"programs",type:"HIDE_FIELD"}]}]],["programRule",[{field:"name",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"description",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"priority",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"condition",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]},{field:"programRuleActions",when:[{field:"program",operator:"HAS_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!1,elseValue:!0}]}]],["programRuleVariable",[{field:"program",when:[{field:"dataElement",operator:"HAS_STRING_VALUE"},{field:"trackedEntityAttribute",operator:"HAS_STRING_VALUE"},{field:"programStage",operator:"HAS_STRING_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"dataElement",when:[{field:"programRuleVariableSourceType",operator:"ONEOF",value:["CALCULATED_VALUE","TEI_ATTRIBUTE"]}],operations:[{field:"dataElement",type:"HIDE_FIELD"}]},{field:"trackedEntityAttribute",when:[{field:"programRuleVariableSourceType",operator:"NOT_EQUALS",value:"TEI_ATTRIBUTE"}],operations:[{field:"trackedEntityAttribute",type:"HIDE_FIELD"}]},{field:"programStage",when:[{field:"programRuleVariableSourceType",operator:"NOT_EQUALS",value:"DATAELEMENT_NEWEST_EVENT_PROGRAM_STAGE"}],operations:[{field:"programStage",type:"HIDE_FIELD"}]},{field:"programStage",when:[{field:"dataElement",operator:"HAS_STRING_VALUE"}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"valueType",when:[{field:"programRuleVariableSourceType",operator:"NOT_EQUALS",value:"CALCULATED_VALUE"}],operations:[{field:"valueType",type:"HIDE_FIELD"}]},n.i(o.a)("valueType","TEXT")]],["programStage",[{field:"autoGenerateEvent",when:[{field:"autoGenerateEvent",operator:"NOT_EQUALS",value:!0}],operations:[{field:"openAfterEnrollment",type:"HIDE_FIELD"},{field:"reportDateToUse",type:"HIDE_FIELD"}]},{field:"reportDateToUse",when:[{field:"openAfterEnrollment",operator:"NOT_EQUALS",value:!0}],operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]}]],["eventProgramStage",[n.i(o.a)("validationStrategy","ON_UPDATE_AND_INSERT")]],["programIndicator",[{field:"orgUnitField",when:[{field:"program",operator:"EQUALS",value:void 0}],operations:[{field:"orgUnitField",type:"HIDE_FIELD"}]},{field:"analyticsPeriodBoundaries",when:[{field:"analyticsType",operator:"HAS_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){if(t){var a=t.previousAnalyticsType,r=e.analyticsType,i=t.value,s=a&&a!==r;if(!i||s){var l=n.i(o.b)(r,t.value);t.value=l,e[t.name]=l}t.previousAnalyticsType=r}}}]}]],["programStageNotificationTemplate",[{field:"notificationTrigger",when:[{field:"notificationTrigger",operator:"NOT_EQUALS",value:"SCHEDULED_DAYS_DUE_DATE"}],operations:[{field:"relativeScheduledDays",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NONEOF",value:["TRACKED_ENTITY_INSTANCE","ORGANISATION_UNIT_CONTACT"]}],operations:[{field:"deliveryChannels",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"DATA_ELEMENT"}],operations:[{field:"recipientDataElement",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"PROGRAM_ATTRIBUTE"}],operations:[{field:"recipientProgramAttribute",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyUsersInHierarchyOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyParentOrganisationUnitOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"EQUALS",value:"WEB_HOOK"}],operations:[{field:"deliveryChannels",type:"CHANGE_VALUE",setValue:function(e,t){t&&(t.value=e[t.name]=["HTTP"])}}]},{field:"notifyUsersInHierarchyOnly",when:[{field:"notifyParentOrganisationUnitOnly",operator:"EQUALS",value:!0}],operations:[{field:"notifyUsersInHierarchyOnly",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"notifyParentOrganisationUnitOnly",when:[{field:"notifyUsersInHierarchyOnly",operator:"EQUALS",value:!0}],operations:[{field:"notifyParentOrganisationUnitOnly",type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]}]],["programNotificationTemplate",[{field:"notificationTrigger",when:[{field:"notificationTrigger",operator:"NONEOF",value:["SCHEDULED_DAYS_INCIDENT_DATE","SCHEDULED_DAYS_ENROLLMENT_DATE"]}],operations:[{field:"relativeScheduledDays",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NONEOF",value:["TRACKED_ENTITY_INSTANCE","ORGANISATION_UNIT_CONTACT"]}],operations:[{field:"deliveryChannels",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"PROGRAM_ATTRIBUTE"}],operations:[{field:"recipientProgramAttribute",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyUsersInHierarchyOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"NOT_EQUALS",value:"USER_GROUP"}],operations:[{field:"notifyParentOrganisationUnitOnly",type:"HIDE_FIELD"}]},{field:"notificationRecipient",when:[{field:"notificationRecipient",operator:"EQUALS",value:"WEB_HOOK"}],operations:[{field:"deliveryChannels",type:"CHANGE_VALUE",setValue:function(e,t){t&&(t.value=e[t.name]=["HTTP"])}}]}]],["categoryCombo",[{field:"dataDimensionType",when:[{field:"dataDimensionType",operator:"HAS_NO_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){t.value=e[t.name]="DISAGGREGATION"}}]}]],["sqlView",[{field:"name",when:{field:"id",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"type",when:{field:"id",operator:"HAS_VALUE"},operations:[{type:"SET_PROP",propName:"disabled",thenValue:!0,elseValue:!1}]},{field:"cacheStrategy",when:[{field:"sqlQuery",operator:"HAS_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){try{e.dataValues.sqlQuery.includes("${_current_user_id}")||e.dataValues.sqlQuery.includes("${_current_username}")?(t.value=e[t.name]="NO_CACHE",t.props.disabled=!0):t.props.disabled=!1}catch(e){return}}}]}]],["analyticsTableHook",[{field:"resourceTableType",when:{field:"phase",operator:"PREDICATE",value:function(e){return"RESOURCE_TABLE_POPULATED"!=e}},operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=e[t.name]=void 0}}]},{field:"analyticsTableType",when:{field:"phase",operator:"PREDICATE",value:function(e){return"ANALYTICS_TABLE_POPULATED"!=e}},operations:[{type:"HIDE_FIELD"},{type:"CHANGE_VALUE",setValue:function(e,t){t.value=e[t.name]=void 0}}]}]],["relationshipType",[{field:"toFromName",when:{field:"bidirectional",operator:"NOT_EQUALS",value:!0},operations:[{type:"HIDE_FIELD"}]}]],["dataSet",[{field:"openPeriodsAfterCoEndDate",when:{field:"categoryCombo",operator:"PREDICATE",value:function(e){return e&&"default"===e.name}},operations:[{type:"HIDE_FIELD"}]},{field:"workflow",when:[{field:"categoryCombo",operator:"HAS_VALUE"}],operations:[{type:"CHANGE_VALUE",setValue:function(e,t){try{var n=["categoryCombo.id:eq:"+e.dataValues.categoryCombo.id,"categoryCombo.id:null"];Array.isArray(t.props.queryParamFilter)?t.props.queryParamFilter.includes(n[0])||(t.props.queryParamFilter=n,t.value=e[t.name]=void 0):t.props.queryParamFilter=n}catch(e){return}}}]}]],["predictor",[n.i(o.a)("organisationUnitDescendants","SELECTED")]],["eventProgram",[{field:"openDaysAfterCoEndDate",when:{field:"categoryCombo",operator:"PREDICATE",value:function(e){return e&&"default"===e.name}},operations:[{type:"HIDE_FIELD"}]}]],["trackerProgram",[{field:"openDaysAfterCoEndDate",when:{field:"categoryCombo",operator:"PREDICATE",value:function(e){return e&&"default"===e.name}},operations:[{type:"HIDE_FIELD"}]}]]])},3521:function(e,t,n){"use strict";var a=n(25),o=(n.n(a),n(19)),r=n.n(o),i={getInitialState:function(){return this.events={},this.eventSubjects={},{}},createEventObserver:function(){var e=new Map;return function(t){var n=void 0;return e.has(t)?n=e.get(t):(n=new a.Subject,e.set(t,n)),this.events[t]||(this.events[t]=n.map(function(e){return Object.assign({},e)})),function(e){n.next(e)}}}(),componentWillUnmount:function(){var e=this;Object.keys(this.eventSubjects).forEach(function(t){r.a.debug("Completing: "+[e.constructor.name,t].join(".")),e.eventSubjects[t].completed()})}};t.a=i},3527:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M19 13H5v-2h14v2z"}))};c=(0,s.default)(c),c.displayName="ContentRemove",c.muiName="SvgIcon",t.default=c},3528:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}))};c=(0,s.default)(c),c.displayName="NavigationArrowBack",c.muiName="SvgIcon",t.default=c},3529:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}))};c=(0,s.default)(c),c.displayName="NavigationArrowForward",c.muiName="SvgIcon",t.default=c},3530:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))};c=(0,s.default)(c),c.displayName="NavigationClose",c.muiName="SvgIcon",t.default=c},3568:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={isOpen:!1,isInTransition:!1,positionV:"bottom",tabIndex:1,onBlur:function(){},onClick:function(){},onFocus:function(){},onKeyDown:function(){},onKeyUp:function(){},onMouseDown:function(){},onMouseEnter:function(){},onMouseLeave:function(){},onMouseUp:function(){},onTouchEnd:function(){},onTouchStart:function(){}}},3569:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1);t.default={alignment:a.PropTypes.string,className:a.PropTypes.string,direction:a.PropTypes.string,href:a.PropTypes.string,isInTransition:a.PropTypes.bool,isOpen:a.PropTypes.bool,leftAvatar:a.PropTypes.object,positionV:a.PropTypes.string,primaryText:a.PropTypes.string,rightAvatar:a.PropTypes.object,style:a.PropTypes.object,styleText:a.PropTypes.object,tabIndex:a.PropTypes.oneOfType([a.PropTypes.string,a.PropTypes.number]),onBlur:a.PropTypes.func,onClick:a.PropTypes.func,onFocus:a.PropTypes.func,onKeyboardFocus:a.PropTypes.func,onKeyDown:a.PropTypes.func,onKeyUp:a.PropTypes.func,onMouseDown:a.PropTypes.func,onMouseEnter:a.PropTypes.func,onMouseLeave:a.PropTypes.func,onMouseUp:a.PropTypes.func}},3570:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(23),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=function(e){var t=e.paper,n=e.baseTheme;return{root:{main:{backgroundColor:"transparent",listStyle:"none",cursor:"pointer",transition:o.default.easeOut()},direction:{down:{marginBottom:14},up:{marginTop:14},right:{textAlign:"left",float:"left",marginRight:14},left:{textAlign:"right",float:"right",marginLeft:14}},alignment:{right:{},left:{}},visible:{main:{opacity:1,visibility:"visible"},direction:{down:{},up:{},right:{},left:{}}},invisible:{main:{opacity:0,visibility:"hidden"},direction:{left:{marginRight:-20},right:{marginLeft:-20},up:{marginTop:-40},down:{marginBottom:-40}}}},wrap:{main:{position:"relative",display:"inline-block",lineHeight:"40px",outline:0,textDecoration:"none"}},text:{main:{borderRadius:"5px",padding:"6px 12px 5px",fontSize:14,color:n.palette.secondaryTextColor,backgroundColor:n.palette.canvasColor,boxShadow:t.zDepthShadows[1],whiteSpace:"nowrap"},alignment:{left:{marginLeft:24},right:{marginRight:24},up:{display:"none"},down:{display:"none"}}},rightAvatar:{float:"right",boxShadow:t.zDepthShadows[1]},leftAvatar:{float:"left",boxShadow:t.zDepthShadows[1]},focus:{avatar:{boxShadow:t.zDepthShadows[2]},text:{boxShadow:t.zDepthShadows[2]}}}}},3571:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){return null!==e&&"object"===(void 0===e?"undefined":(0,y.default)(e))&&!(e instanceof Array)&&e.type&&e.type.displayName===t}Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),i=a(r),s=n(2),l=a(s),u=n(3),c=a(u),d=n(5),p=a(d),f=n(4),h=a(f),m=n(96),y=a(m),g=n(9),v=a(g),b=n(0),T=a(b),E=n(1),S=a(E),_=n(3572),C=a(_),O=function(e){function t(e,n){var a=n.muiTheme;(0,l.default)(this,t);var o=(0,p.default)(this,(t.__proto__||(0,i.default)(t)).call(this,e));return o.styles=(0,C.default)(a),o.getStylesMain=o.getStylesMain.bind(o),o.renderChild=o.renderChild.bind(o),o}return(0,h.default)(t,e),(0,c.default)(t,[{key:"getStylesMain",value:function(){var e=this.props,t=e.isOpen,n=e.direction,a=void 0===n?"up":n,o=e.alignment,r=void 0===o?"right":o,i=e.positionV,s=void 0===i?"bottom":i,l=this.styles,u=t?"visible":"invisible";return(0,v.default)({},l.root.main,l.root[u].main,l.root.direction[a],l.root.direction[a+"_"+s],l.root.alignment[r])}},{key:"renderChild",value:function(e,t){var n=this.props,a=n.isOpen,r=n.isInTransition,i=n.direction,s=void 0===i?"up":i,l=n.alignment,u=void 0===l?"right":l;return o(e,"BubbleListItem")?T.default.cloneElement(e,{key:t,isOpen:a,isInTransition:r,alignment:u,direction:s,ref:"listItem"+t}):e}},{key:"renderChildren",value:function(){var e=this.props.children;return e?o(e,"BubbleListItem")?this.renderChild(e,0):e instanceof Array?e.map(this.renderChild):e:T.default.createElement("ul",{style:this.getStylesMain()})}},{key:"render",value:function(){var e=this.props.className;return T.default.createElement("ul",{className:e,style:this.getStylesMain()},this.renderChildren())}}]),t}(T.default.Component);O.displayName="BubbleList",O.propTypes={},O.defaultProps={isOpen:!1,isInTransition:!1},O.contextTypes={muiTheme:S.default.object.isRequired},t.default=O},3572:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(23),o=function(e){return e&&e.__esModule?e:{default:e}}(a);t.default=function(){return{root:{main:{position:"absolute",opacity:1,padding:0,margin:0,width:320,transition:o.default.easeOut()},direction:{down:{top:0},up:{bottom:0},right:{left:0},left:{right:0},down_inline:{paddingTop:40},up_inline:{paddingBottom:40}},alignment:{down:{top:0},up:{bottom:-7},right:{right:0,textAlign:"right"},left:{left:0,textAlign:"left"},middle:{top:-22}},visible:{main:{opacity:1}},invisible:{main:{opacity:0}}}}}},3573:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n=[],a=(0,l.default)({},u,e),o=a.className,r=a.name,s=a.type,c=a.duration,d=a.iterationCount,p=["animation:"+r+" "+s+" "+c+";","animation-iteration-count:"+d+";"];return n.push("."+o+"{"+p.join("")+"}"),n.push("@keyframes "+r+"{"),(0,i.default)(t).forEach(function(e){var a=[],o=t[e];(0,i.default)(o).forEach(function(e){a.push(e+"("+o[e]+")")}),n.push(e+"{transform:"+a.join(" ")+"}")}),n.push("}"),n.join("")}Object.defineProperty(t,"__esModule",{value:!0});var r=n(45),i=a(r),s=n(9),l=a(s),u={className:"animation",name:"animationFrame",type:"linear",duration:"0.45s",iterationCount:1};t.default=o},3574:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(3403),s=a(i),l=n(3530),u=a(l);t.default={closeOnSecondClick:!0,closeOnScrollDown:!1,closeOnScrollUp:!1,hasBackdrop:!0,icon:r.default.createElement(s.default,null),iconOpen:r.default.createElement(u.default,null),isInitiallyOpen:!1,positionH:"right",positionV:"bottom",style:{},styleBackdrop:{},styleButtonWrap:{},tabIndex:1,onClickPrimaryButton:function(){},onChangeState:function(){}}},3575:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function o(){return document.body.scrollTop||document.documentElement.scrollTop}function r(e,t){return null!==e&&"object"===(void 0===e?"undefined":(0,b.default)(e))&&!(e instanceof Array)&&e.type&&e.type.displayName===t}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),s=a(i),l=n(6),u=a(l),c=n(2),d=a(c),p=n(3),f=a(p),h=n(5),m=a(h),y=n(4),g=a(y),v=n(96),b=a(v),T=n(9),E=a(T),S=n(0),_=a(S),C=n(1),O=a(C),x=n(450),w=a(x),k=n(113),P=n(3408),A=a(P),D=n(3577),R=(a(D),n(3574)),I=a(R),F=n(3578),N=a(F),M=n(3576),j=function(e){function t(e,n){(0,d.default)(this,t);var a=(0,m.default)(this,(t.__proto__||(0,u.default)(t)).call(this,e,n));return a.state={isOpen:e.isOpen||e.isInitiallyOpen,isInTransition:!1,wasOpened:!e.isInitiallyOpen,isBackdropFocused:!1,openedScrollPos:0},a.instanceKey=String(1e4*Math.random()).substring(0,4),a.isControlled=Boolean("boolean"==typeof e.isOpen),a.getStylesBackdrop=a.getStylesBackdrop.bind(a),a.isChildrenBubbleList=a.isChildrenBubbleList.bind(a),a.isToolbox=a.isToolbox.bind(a),a.handleClickOpen=a.handleClickOpen.bind(a),a.handleClickClose=a.handleClickClose.bind(a),a.handleClickCloseToolbox=a.handleClickCloseToolbox.bind(a),a.handleClickBackdrop=a.handleClickBackdrop.bind(a),a.handleFocusFirstListItem=a.handleFocusFirstListItem.bind(a),a.handleFocusPrimaryText=a.handleFocusPrimaryText.bind(a),a.handleFocusBackdrop=a.handleFocusBackdrop.bind(a),a.handleBlurBackdrop=a.handleBlurBackdrop.bind(a),a.handleBackdropKeyUp=a.handleBackdropKeyUp.bind(a),a.handleScroll=a.handleScroll.bind(a),a.styles=(0,N.default)(n.muiTheme),a.isControlled&&"function"!=typeof e.onChange&&console.error("Warning: Failed speed-dial propType: You provided a `isOpen` prop to a speed-dial without an `onChange` handler"),a}return(0,g.default)(t,e),(0,f.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.closeOnScrollDown,n=e.closeOnScrollUp;!0!==t&&!0!==n||window.addEventListener("scroll",this.handleScroll)}},{key:"componentWillReceiveProps",value:function(e){this.isControlled&&this.setState({isOpen:e.isOpen})}},{key:"componentWillUnmount",value:function(){var e=this.props,t=e.closeOnScrollDown,n=e.closeOnScrollUp;!0!==t&&!0!==n||window.removeEventListener("scroll",this.handleScroll)}},{key:"handleScroll",value:function(){var e=this.props,t=e.closeOnScrollDown,n=e.closeOnScrollUp,a=this.state,r=a.isOpen,i=a.openedScrollPos;if(r){var s=Number(o()||0)-i;!0===t&&s>=30&&this.handleClickClose(),!0===n&&s<=-30&&this.handleClickClose()}}},{key:"handleFocusFirstListItem",value:function(){this.refs.list&&this.refs.list.refs&&this.refs.list.refs.listItem0&&this.refs.list.refs.listItem0.setFocus()}},{key:"handleClickOpen",value:function(){var e=this;this.updateState({wasOpened:!1,isOpen:!0,isInTransition:!0,openedScrollPos:o()}),setTimeout(function(){e.updateState({wasOpened:!1,isInTransition:!1}),e.handleFocusFirstListItem()},450)}},{key:"handleClickClose",value:function(){var e=this;this.props.onClickPrimaryButton(),this.props.closeOnSecondClick&&this.updateState({wasOpened:!0,isOpen:!1,isInTransition:!0}),setTimeout(function(){e.updateState({wasOpened:!1,isInTransition:!1})},450)}},{key:"handleClickCloseToolbox",value:function(){var e=this;this.updateState({wasOpened:!0,isOpen:!1,isInTransition:!0}),setTimeout(function(){e.updateState({wasOpened:!1,isInTransition:!1})},450)}},{key:"handleClickBackdrop",value:function(e){var t=this;e&&"function"==typeof e.stopPropagation&&e.stopPropagation(),this.updateState({isOpen:!1,isInTransition:!0}),setTimeout(function(){t.updateState({isInTransition:!1})},450)}},{key:"handleFocusPrimaryText",value:function(){this.refs.btn.refs.container.refs.enhancedButton.focus()}},{key:"handleFocusBackdrop",value:function(){this.updateState({isBackdropFocused:!0})}},{key:"handleBlurBackdrop",value:function(){this.updateState({isBackdropFocused:!1})}},{key:"handleBackdropKeyUp",value:function(e){13===e.keyCode&&this.handleClickBackdrop(e)}},{key:"getCurrentTransitionState",value:function(){var e=this.state,t=e.isOpen,n=e.isInTransition,a=e.wasOpened;return n?t&&!a?"opening":"closing":t?"open":"closed"}},{key:"getDirection",value:function(){var e=this.props,t=e.children,n=e.positionV;return t&&t.props&&t.props.direction?t.props.direction:"bottom"===n?"up":"down"}},{key:"getAlignment",value:function(){var e=this.props,t=e.children,n=e.positionH;return t&&t.props&&t.props.alignment?t.props.alignment:n}},{key:"getActionButton",value:function(){try{return this.refs.btn.refs.container}catch(e){return{}}}},{key:"getActionButtonStyles",value:function(){try{return(0,E.default)({},this.getActionButton().refs.enhancedButton.style)}catch(e){return{}}}},{key:"getStylesBtn",value:function(){var e=this.props,t=e.positionV,n=e.positionH,a=e.styleButtonWrap,o=this.getCurrentTransitionState(),r=this.styles;return this.isToolbox()?(0,E.default)({},r.btnWrap.main,r.btnWrap[t],r.btnWrap[n],a,r.btnWrap.toolbox[o]):(0,E.default)({},r.btnWrap.main,r.btnWrap[t],r.btnWrap[n],a)}},{key:"getStylesMain",value:function(){var e=this.props,t=e.positionV,n=e.style,a=this.styles;return(0,E.default)({},a.root.main,a.root[t],n)}},{key:"getStylesContentWrap",value:function(){var e=this.props,t=e.positionV,n=e.positionH,a=this.state.isOpen,o=this.styles,r={};return this.isChildrenBubbleList()||(r=(0,E.default)({},o.notBubbleList.main,o.notBubbleList[a?"visible":"invisible"])),(0,E.default)({},o.contentWrap.main,o.contentWrap[t],o.contentWrap[n],o.contentWrap.direction[this.getDirection()],o.contentWrap.alignment[this.getAlignment()],r)}},{key:"getStylesPrimaryText",value:function(){var e=this.props.positionH,t=this.state.isOpen,n=this.styles;return(0,E.default)({},n.primaryText.main,n.primaryText[String(t)],n.primaryText[e])}},{key:"getStylesBackdrop",value:function(){var e=this.state,t=e.isOpen,n=e.isBackdropFocused,a=this.styles,o=t?a.backdrop.main:a.backdrop.invisible,r=n?a.backdrop.focus:{};return(0,E.default)({},o,r)}},{key:"getStylesToolbox",value:function(){var e=this.state.isOpen,t=this.props.toolbox,n=this.styles;if(!e)return(0,E.default)({},n.toolbox.main);var a={height:t.height};return(0,E.default)({},n.toolbox.main,a)}},{key:"getStylesToolboxInner",value:function(){return(0,E.default)({},this.styles.toolboxInner.main,this.styles.toolboxInner[this.getCurrentTransitionState()])}},{key:"getStylesMorphActionButton",value:function(){var e=this.styles,t=this.getStylesBtn(),n=this.getActionButtonStyles(),a=(0,E.default)({},e.morphActionButton.main,{backgroundColor:n.backgroundColor||k.cyan500,width:n.width||56,height:n.height||56});return(0,E.default)({},t,a,e.morphActionButton[this.getCurrentTransitionState()])}},{key:"updateState",value:function(e){this.setState(e),this.props.onChangeState(e),this.isControlled&&"boolean"==typeof e.isOpen&&this.props.onChange({isOpen:e.isOpen})}},{key:"isChildrenBubbleList",value:function(){return r(this.props.children,"BubbleList")}},{key:"isToolbox",value:function(){var e=this.props.toolbox;return Boolean(e&&"number"==typeof e.height)}},{key:"renderIcon",value:function(){var e=this.props,t=e.icon,n=e.iconOpen,a=this.state.isOpen;return[_.default.cloneElement(t,{key:"0",style:a?this.styles.iconClosed.invisible:this.styles.iconClosed.main}),_.default.cloneElement(n,{key:"1",style:a?this.styles.iconOpen.main:this.styles.iconOpen.invisible})]}},{key:"renderToolbox",value:function(){var e=this.props,t=e.toolbox,n=e.children;return this.isToolbox()?_.default.createElement("div",{className:t.className,style:this.getStylesToolbox()},_.default.createElement("div",{style:this.styles.morphWrap},this.renderMorphActionButton()),_.default.createElement("div",{style:this.getStylesToolboxInner()},_.default.cloneElement(n,{onClickCloseToolbox:this.handleClickCloseToolbox}))):null}},{key:"renderChildren",value:function(){var e=this.props,t=e.children,n=e.positionV,a=this.state,o=a.isOpen,i=a.isInTransition;return this.isToolbox()?null:r(t,"BubbleList")?_.default.cloneElement(t,{isOpen:o,isInTransition:i,direction:this.getDirection(),alignment:this.getAlignment(),positionV:n,ref:"list"}):t}},{key:"renderBackdrop",value:function(){var e=this.props,t=e.hasBackdrop,n=e.classNameBackdrop,a=e.tabIndex,o=e.styleBackdrop,r=this.state.isOpen,i=this.styles,s=r?i.backdropWrap.main:i.backdropWrap.invisible;return!t||this.isToolbox()?null:_.default.createElement("span",{className:n,style:(0,E.default)({},s,o)},_.default.createElement("a",{style:this.getStylesBackdrop(),tabIndex:r?a+1:-1,onBlur:this.handleBlurBackdrop,onFocus:this.handleFocusBackdrop,onKeyUp:this.handleBackdropKeyUp,onClick:this.handleClickBackdrop}))}},{key:"renderPrimaryText",value:function(){var e=this.props,t=e.primaryText,n=e.onClickPrimaryButton,a=e.tabIndex,o=this.state.isOpen;return["left","right"].indexOf(this.getDirection())>=0?null:t&&""!==t?_.default.createElement("ul",{style:this.getStylesPrimaryText()},_.default.createElement(A.default,{isOpen:!0,primaryText:t,tabIndex:o?a:-1,onClick:n,onFocus:this.handleFocusPrimaryText})):null}},{key:"renderMorphActionButton",value:function(){var e=this.getCurrentTransitionState(),t=this.props.toolbox,n=[];return t.classNameMorphButton&&n.push(t.classNameMorphButton),"closing"===e&&n.push("anim-btn-morph-closing"+this.instanceKey),"opening"===e&&n.push("anim-btn-morph"+this.instanceKey),_.default.createElement("div",{className:n.join(" "),ref:"morphBtn",style:this.getStylesMorphActionButton()})}},{key:"renderCssKeyframes",value:function(){var e=this.props,t=e.toolbox,n=e.positionH;if(!this.isToolbox())return null;var a={height:t.height,btnHeight:56,positionH:n};return _.default.createElement("style",null,(0,M.getCssKeyFrames)("anim-btn-morph",this.instanceKey,a),(0,M.getCssKeyFramesClosing)("anim-btn-morph-closing",this.instanceKey,a))}},{key:"render",value:function(){var e=this.props,t=e.floatingActionButtonProps,n=e.className,a=e.classNameInTransition,o=e.classNameOpen,r=e.classNameButtonWrap,i=e.tabIndex,l=this.state,u=l.isOpen,c=l.isInTransition,d=u?this.handleClickClose:this.handleClickOpen,p=[n],f=(0,E.default)({},t,{onClick:d});return c&&a&&p.push(a),u&&o&&p.push(o),_.default.createElement("div",{className:p.join(" "),style:this.getStylesMain()},this.renderCssKeyframes(),this.renderToolbox(),this.renderBackdrop(),_.default.createElement("div",{style:this.getStylesContentWrap()},this.renderChildren()),_.default.createElement("div",{className:r,style:this.getStylesBtn()},this.renderPrimaryText(),_.default.createElement(w.default,(0,s.default)({ref:"btn",tabIndex:i},f),this.renderIcon())))}}]),t}(_.default.Component);j.displayName="SpeedDial",j.propTypes={},j.defaultProps=I.default,j.contextTypes={muiTheme:O.default.object.isRequired},t.default=j},3576:function(e,t,n){"use strict";function a(){return Number(window.innerWidth<=1024?window.innerWidth:1024)}Object.defineProperty(t,"__esModule",{value:!0}),t.getCssKeyFramesClosing=t.getCssKeyFrames=void 0;var o=n(3573),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.getCssKeyFrames=function(e,t,n){var o=n.height,i=n.btnHeight,s=n.positionH,l=a(),u=Number(o/2)+"px",c=l/2-i+"px",d="0px,"+u,p=l/40,f="0px,0px";return f="left"===s?c+","+u:"-"+c+","+u,(0,r.default)({className:e+t,name:e+t,iterationCount:1},{"0%":{translate:"0px,0px",scaleX:1,scaleY:1},"20%":{translate:d,scaleX:1,scaleY:1},"40%":{translate:f,scaleX:p/2,scaleY:p/2},"100%":{translate:f,scaleX:p,scaleY:p}})},t.getCssKeyFramesClosing=function(e,t,n){var o=n.height,i=n.btnHeight,s=n.positionH,l=a(),u=Number(o/2)+"px",c=l/2-i+"px",d="0px,"+u,p=l/40,f="0px,0px";return f="left"===s?c+","+u:"-"+c+","+u,(0,r.default)({className:e+t,name:e+t,iterationCount:1},{"0%":{translate:f,scaleX:p,scaleY:p},"20%":{translate:d,scaleX:p/2,scaleY:p/2},"40%":{translate:"0px,0px",scaleX:1,scaleY:1},"100%":{translate:"0px,0px",scaleX:1,scaleY:1}})}},3577:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(1);t.default={children:a.PropTypes.any,className:a.PropTypes.string,classNameBackdrop:a.PropTypes.string,classNameButtonWrap:a.PropTypes.string,classNameInTransition:a.PropTypes.string,classNameOpen:a.PropTypes.string,closeOnSecondClick:a.PropTypes.bool,closeOnScrollDown:a.PropTypes.bool,closeOnScrollUp:a.PropTypes.bool,floatingActionButtonProps:a.PropTypes.shape({backgroundColor:a.PropTypes.string,className:a.PropTypes.string,disabled:a.PropTypes.bool,iconClassName:a.PropTypes.string,iconStyle:a.PropTypes.object,mini:a.PropTypes.bool,secondary:a.PropTypes.bool,style:a.PropTypes.object,zDepth:a.PropTypes.number}),hasBackdrop:a.PropTypes.bool,icon:a.PropTypes.object,iconOpen:a.PropTypes.object,isInitiallyOpen:a.PropTypes.bool,isOpen:a.PropTypes.bool,positionH:a.PropTypes.string,positionV:a.PropTypes.string,primaryText:a.PropTypes.string,style:a.PropTypes.object,styleBackdrop:a.PropTypes.object,styleButtonWrap:a.PropTypes.object,tabIndex:a.PropTypes.oneOfType([a.PropTypes.string,a.PropTypes.number]),toolbox:a.PropTypes.shape({height:a.PropTypes.number.isRequired,className:a.PropTypes.string,classNameMorphButton:a.PropTypes.string}),onClickPrimaryButton:a.PropTypes.func,onChange:a.PropTypes.func,onChangeState:a.PropTypes.func}},3578:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=n(113),o=n(23),r=function(e){return e&&e.__esModule?e:{default:e}}(o);t.default=function(e){var t=e.baseTheme;return{root:{main:{position:"fixed",width:"100%",left:0,zIndex:9999},inline:{position:"relative"},top:{top:0},bottom:{bottom:0}},actionButton:{invisible:{opacity:0}},toolbox:{main:{position:"relative",transition:r.default.easeOut(),height:0,width:"100%"}},toolboxInner:{main:{transition:r.default.easeOut()},closed:{opacity:0},closing:{opacity:0},open:{opacity:1},opening:{opacity:0}},morphWrap:{position:"absolute",width:"100%",height:"100%",left:0,top:0,overflow:"hidden"},morphActionButton:{main:{display:"inline-block",transition:r.default.easeOut(),height:56,width:56,background:a.cyan500,zIndex:0,opacity:1,borderRadius:"50%"},closed:{transition:"none"},closing:{transition:"none"},opening:{},open:{transition:"none",position:"absolute",width:"auto",height:"auto",top:0,right:0,bottom:0,left:0,opacity:1,borderRadius:"0%"}},notBubbleList:{main:{transition:r.default.easeOut()},invisible:{opacity:0},visible:{opacity:1}},contentWrap:{main:{position:"absolute"},top:{top:88},bottom:{bottom:88},left:{left:23},right:{right:23},direction:{up:{},down:{},left:{right:88},right:{left:88}},alignment:{up:{bottom:23},down:{top:23},left:{},right:{}}},backdropWrap:{main:{position:"fixed",width:"100%",height:"100%",overflow:"hidden",top:0,opacity:1},invisible:{opacity:0}},backdrop:{main:{position:"absolute",backgroundColor:t.palette.borderColor,display:"block",transition:r.default.easeOut(),width:"100%",height:"100%",top:0,right:0,opacity:.8},invisible:{opacity:0},focus:{backgroundColor:t.palette.secondaryTextColor,opacity:.4}},btnWrap:{main:{transition:r.default.easeOut(),position:"absolute",opacity:1},inline:{top:-28},bottom:{bottom:16},top:{top:16},left:{left:16},right:{right:16},toolbox:{open:{opacity:0},closed:{opacity:1},opening:{opacity:0},closing:{opacity:0}}},iconClosed:{main:{position:"absolute",transform:"rotate(0deg)",opacity:1},invisible:{position:"absolute",transform:"rotate(90deg)",opacity:0}},iconOpen:{main:{transform:"rotate(0deg)",opacity:1},invisible:{transform:"rotate(-90deg)",opacity:0}},primaryText:{main:{position:"absolute",bottom:10,margin:0,transition:r.default.easeOut()},true:{opacity:1},false:{opacity:0},left:{left:33},right:{right:73}}}}},3686:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e){var t=e.level,n=e.children,o=a(e,["level","children"]),r=Object.assign({},u,o.style);return i.a.createElement(s.a,l({},o,{style:r,level:t||3}),n)}var r=n(0),i=n.n(r),s=n(316),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},u={fontSize:"1.25rem",paddingTop:".5rem",fontWeight:100};o.propTypes={children:i.a.PropTypes.string,level:i.a.PropTypes.number},t.a=o},3687:function(e,t,n){"use strict";n.d(t,"a",function(){return p}),n.d(t,"b",function(){return f}),n.d(t,"c",function(){return h});var a=n(0),o=n.n(a),r=n(15),i=(n.n(r),n(317)),s=n.n(i),l=n(247),u=n.n(l),c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},d=function(e){return function(t){var a=n.i(r.isNil)(e)?{padding:"3rem"}:e;return function(e){return o.a.createElement(s.a,{style:a},o.a.createElement(t,e))}}},p=d(),f=u()(function(e){return c({},e,{groupName:e.params.groupName,modelType:e.schema,modelId:e.params.modelId})}),h=function(e){return d({padding:"3rem",marginTop:"15px"})(e)}},3717:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),l=n.n(s),u=n(315),c=n(1335),d=(n.n(c),n(317)),p=n.n(d),f=n(201),h=n(439),m=(n.n(h),n(3875)),y=n(3773),g=n(3874),v=n(3879),b=n(722),T=n.n(b),E=n(247),S=n.n(E),_=n(15),C=(n.n(_),n(725)),O=n.n(C),x=n(318),w=n(3719),k=n(1346),P=n(249),A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},D=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),R={basic:0,section:1,custom:2},I={tabContent:{padding:"3rem"},helpText:{color:"gray",marginBottom:"2rem"}},F=function(e){function t(e){o(this,t);var a=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));a.onTabChange=function(e,t,n){var o=n.props.index;a.setState({curTab:o})},a.programDataElementOrderChanged=function(e){var t=e.oldIndex,o=e.newIndex;a.props.onChangeDefaultOrder(n.i(h.arrayMove)(a.props.availableDataElements.map(function(e){return e.id}),t,o))},a.renderTab=function(e,t){return l.a.createElement(c.Tab,{style:I.tab,label:e},l.a.createElement("div",{style:I.tabContent},l.a.createElement(N,null),t))},a.getTranslation=function(e){return a.context.d2.i18n.getTranslation(e)};var i=a.props.programStage&&a.props.programStage.dataEntryForm;return a.state={curTab:i?R.custom:R.section},a}return i(t,e),D(t,[{key:"render",value:function(){return l.a.createElement(p.a,null,l.a.createElement(c.Tabs,{initialSelectedIndex:this.state.curTab,onChange:this.onTabChange},this.renderTab(this.getTranslation("basic"),l.a.createElement(m.a,{availableDataElements:this.props.availableDataElements,onChange:this.programDataElementOrderChanged})),this.renderTab(this.getTranslation("section"),l.a.createElement(y.a,{availableElements:this.props.availableDataElements,sections:this.props.programStageSections,onSectionUpdated:this.props.onSectionUpdated,onSectionOrderChanged:this.props.onSectionOrderChanged,onSectionAdded:this.props.onSectionAdded,onSectionRemoved:this.props.onSectionRemoved,elementPath:"dataElements"})),this.renderTab(this.getTranslation("custom"),l.a.createElement(g.a,{isActive:this.state.curTab===R.custom,programStage:this.props.programStage}))))}}]),t}(s.Component);F.contextTypes={d2:s.PropTypes.object};var N=function(e,t){var n=t.d2;return l.a.createElement("div",{style:I.helpText},n.i18n.getTranslation("program_forms_help_text"))};N.contextTypes={d2:s.PropTypes.object},F.propTypes={onChangeDefaultOrder:s.PropTypes.func.isRequired,onSectionOrderChanged:s.PropTypes.func.isRequired,onSectionUpdated:s.PropTypes.func.isRequired,onSectionAdded:s.PropTypes.func.isRequired,onSectionRemoved:s.PropTypes.func.isRequired,programStageSections:s.PropTypes.arrayOf(s.PropTypes.shape({id:s.PropTypes.string.isRequired,sortOrder:s.PropTypes.number.isRequired,displayName:s.PropTypes.string.isRequired,dataElements:s.PropTypes.arrayOf(s.PropTypes.shape({id:s.PropTypes.string.isRequired,displayName:s.PropTypes.string.isRequired})).isRequired})).isRequired};var M=function(e){return{currentProgramStageId:n.i(v.a)(e)}},j=function(e){return n.i(f.a)({changeProgramStageDataElementOrder:k.a,changeProgramStageSectionOrder:k.b,addProgramStageSection:k.c,removeProgramStageSection:k.d,updateProgramStageSection:k.e},e)},L=x.a.map(n.i(_.getOr)([],"programStageSections")),B=x.a.map(n.i(_.getOr)([],"availableDataElements")),q=n.i(_.compose)(n.i(u.a)(M,j),T()(function(e){return e.combineLatest(n.i(w.a)(e),L,B,x.a,function(e,t,a,o,r){return A({},e,{programStage:t,programStageSections:n.i(P.c)(r,t.id)||[],trackerDataElements:o})})}),S()(function(e){var t=e.trackerDataElements,o=a(e,["trackerDataElements"]),r=function(e){return e.displayName||n.i(_.get)("displayName",n.i(_.find)(function(t){return e.id===t.id},t))},i=o.programStage.programStageDataElements;return A({},o,{programStageSections:n.i(_.sortBy)(["sortOrder"],o.programStageSections.map(function(e){return e.dataElements=Array.from(e.dataElements.values()).map(function(e){return{id:e.id,displayName:r(e)}}),e})),availableDataElements:n.i(_.sortBy)(["sortOrder"],i.map(function(e){return A({},e.dataElement,{displayName:r(e.dataElement),sortOrder:e.sortOrder})}))})}),O()({onChangeDefaultOrder:function(e){var t=e.programStage,n=e.changeProgramStageDataElementOrder;return function(e){n({programStage:t.id,newDataElementOrder:e})}},onSectionUpdated:function(e){var t=e.programStage,n=e.updateProgramStageSection;return function(e,a){n({programStage:t.id,programStageSectionId:e,newProgramStageSectionData:a})}},onSectionOrderChanged:function(e){var t=e.programStage,n=e.changeProgramStageSectionOrder;return function(e){n({programStage:t.id,programStageSections:e})}},onSectionAdded:function(e){var t=e.programStage,n=e.addProgramStageSection;return function(e){n({programStage:t.id,newSectionData:e})}},onSectionRemoved:function(e){var t=e.programStage,n=e.removeProgramStageSection;return function(e){n({programStage:t.id,programStageSection:e})}}}));t.a=q(F)},3718:function(e,t,n){"use strict";function a(e){var t=e.onAddClick,n={textAlign:"right",marginTop:"1rem",bottom:"1.5rem",right:"1.5rem",position:"fixed",zIndex:10};return i.a.createElement("div",{style:n},i.a.createElement(u.a,{onClick:t},i.a.createElement(d.a,null)))}function o(e){var t=e.notifications,n=e.onRemoveNotification,a=e.onEditNotification,o=e.onAddNotification,r=e.addButton,l=e.showProgramStage,u=e.showAddButton,c=l?["name","programStage","lastUpdated"]:["name","lastUpdated"],d=r||E;return i.a.createElement("div",null,u&&i.a.createElement(d,{modelType:"programNotificationTemplate",onAddClick:o}),i.a.createElement(s.a,{rows:t,columns:c,contextMenuActions:{edit:a,delete:n},primaryAction:a}))}n.d(t,"b",function(){return T}),t.a=o;var r=n(0),i=n.n(r),s=n(1311),l=n(1313),u=n.n(l),c=n(3403),d=n.n(c),p=n(208),f=n.n(p),h=n(206),m=n.n(h),y=n(727),g=n.n(y),v=n(1315),b=n.n(v),T=m()(f()({d2:r.PropTypes.object}),g()(function(e){var t=e.d2,n=e.modelType;return!t.currentUser.canCreate(t.models[n])},b.a)),E=T(a);o.propTypes={notifications:r.PropTypes.array,showAddButton:r.PropTypes.bool},o.defaultProps={showAddButton:!0}},3719:function(e,t,n){"use strict";n.d(t,"c",function(){return d}),n.d(t,"e",function(){return p}),n.d(t,"d",function(){return f}),n.d(t,"b",function(){return h}),n.d(t,"a",function(){return m});var a=n(722),o=n.n(a),r=n(318),i=n(15),s=(n.n(i),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}),l=r.a.map(n.i(i.get)("program")),u=r.a.map(n.i(i.get)("programStages")),c=n.i(i.compose)(i.first,n.i(i.get)("programStages")),d=r.a.map(c),p=o()(function(e){return e.combineLatest(e.flatMap(function(e){return e.programStage$}),function(e,t){return s({},e,{programStage:t})})}),f=n.i(i.compose)(o()(function(e){return e.combineLatest(l,u,function(e,t,n){return s({},e,{program:t,programStages:n})})})),h=function(e){return u.flatMap(function(e){return e}).filter(function(t){return t.id&&t.id===e})},m=function(e){return e.take(1).flatMap(function(e){return e.programStage$?e.programStage$:r.a.map(c)})}},3770:function(e,t,n){"use strict";var a=n(201),o=n(438),r=n(3866),i=n(3510),s=function(e){return n.i(a.a)({onSaveAction:o.d},e)},l=function(e){return{isSaving:n.i(i.a)(e)}},u=n.i(r.a)(s,l);t.a=u},3771:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){return function(o){var r=o.dataElement,i=a(o,["dataElement"]),s=e.find(function(e){return e.id===r.id}),l=n.i(q.f)(r,q.g,t);if(!s)return console.warn("Could not find tracker-element with id",r.id),U({},i,{dataElement:U({},r,{renderTypeOptions:l})});var u=s.displayName,c=s.valueType,d=s.optionSet;return U({},i,{dataElement:U({},r,{displayName:u,valueType:c,optionSet:d,renderTypeOptions:l})})}}function i(e,t){var a=t.d2,o=N.a.create(),i=N.a.create(),s=new Set,u=e.trackerDataElements.map(function(e){return s.add(e.id),{id:e.id,text:e.displayName,value:e.id}}),c=e.model.programStageDataElements.filter(function(e){var t=e.dataElement;return"TRACKER"!==t.domainType&&!s.has(t.id)}).map(function(e){var t=e.dataElement;return{id:t.id,text:t.displayName,value:t.id}});o.setState(u.concat(c)),i.setState(e.model.programStageDataElements.map(function(e){return e.dataElement.id}));var d=e.model.programStageDataElements.map(r(e.trackerDataElements,e.renderingOptions)).map(function(t,n){return l.a.createElement(Q,{key:t.id,programStageDataElement:t,onEditProgramStageDataElement:e.onEditProgramStageDataElement})});return l.a.createElement(m.a,null,l.a.createElement("div",{style:U({padding:"2rem 3rem 4rem"},e.outerDivStyle)},l.a.createElement(k.a,{hintText:a.i18n.getTranslation("search_available_selected_items"),onChange:p()(e.setDataElementFilter,n.i(v.getOr)("","target.value")),value:e.dataElementFilter,fullWidth:!0}),l.a.createElement(f.a,{itemStore:o,assignedItemStore:i,height:250,filterText:e.dataElementFilter,onAssignItems:e.onAssignItems,onRemoveItems:e.onRemoveItems})),l.a.createElement(j.a,{style:{borderSpacing:0}},l.a.createElement(j.a.Head,null,l.a.createElement(j.a.Row,null,l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("name")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("compulsory")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("allow_provided_elsewhere")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("display_in_reports")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("date_in_future")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("skip_synchronization")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("skip_in_analytics")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("render_type_mobile")),l.a.createElement(j.a.CellHead,null,a.i18n.getTranslation("render_type_desktop")))),l.a.createElement(j.a.Body,null,d)))}var s=n(0),l=n.n(s),u=n(247),c=n.n(u),d=n(206),p=n.n(d),f=n(440),h=n(317),m=n.n(h),y=n(722),g=n.n(y),v=n(15),b=(n.n(v),n(201)),T=n(315),E=n(725),S=n.n(E),_=n(4080),C=n.n(_),O=n(4079),x=n.n(O),w=n(58),k=n.n(w),P=n(41),A=n.n(P),D=n(251),R=n.n(D),I=n(736),F=n.n(I),N=n(44),M=n(743),j=n(3872),L=n(318),B=n(323),q=n(1321),U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},H=p()(v.first,n.i(v.get)("programStages")),W=function(e){return e.take(1).flatMap(function(e){return e.programStage$?e.programStage$:L.a.map(H)})},V=L.a.map(n.i(v.get)("availableDataElements")).take(1),z=L.a.map(n.i(v.get)("renderingOptions")).take(1),K=function(e){return n.i(b.a)({addDataElementsToStage:M.a,removeDataElementsFromStage:M.b,editProgramStageDataElement:M.c},e)},G=p()(B.g,c()(function(e){return U({},e,{groupName:e.params.groupName,modelType:e.schema,modelId:e.params.modelId})}),n.i(T.a)(null,K),g()(function(e){return e.combineLatest(W(e),V,z,function(e,t,n,a){return U({},e,{trackerDataElements:n,renderingOptions:a,model:t,items:t.programStageDataElements})})}),S()({onAssignItems:function(e){return function(t){var n=e.model;return(0,e.addDataElementsToStage)({programStage:n.id,dataElements:t}),Promise.resolve()}},onRemoveItems:function(e){var t=e.model,n=e.removeDataElementsFromStage;return function(e){return n({programStage:t.id,dataElements:e}),Promise.resolve()}},onEditProgramStageDataElement:function(e){var t=e.model,n=e.editProgramStageDataElement;return function(e){return n({programStage:t.id,programStageDataElement:e})}}}),R()("dataElementFilter","setDataElementFilter","")),Y=function(e,t){return U({},e,o({},t,!e[t]))},Q=A()(function(e){var t=e.programStageDataElement,a=e.onEditProgramStageDataElement,o="DATE"===t.dataElement.valueType,r=function(e){return function(){return a(Y(t,e))}},i=n.i(v.getOr)(!1,v.__,t);return l.a.createElement(j.a.Row,null,l.a.createElement(j.a.Cell,{title:t.dataElement.displayName,style:{maxWidth:250,paddingLeft:0}},t.dataElement.displayName),l.a.createElement(j.a.Cell,null,l.a.createElement(F.a,{checked:i("compulsory"),onClick:r("compulsory")})),l.a.createElement(j.a.Cell,null,l.a.createElement(F.a,{checked:i("allowProvidedElsewhere"),onClick:r("allowProvidedElsewhere")})),l.a.createElement(j.a.Cell,null,l.a.createElement(F.a,{checked:i("displayInReports"),checkedIcon:l.a.createElement(C.a,null),uncheckedIcon:l.a.createElement(x.a,null),onClick:r("displayInReports")})),l.a.createElement(j.a.Cell,null,o?l.a.createElement(F.a,{checked:i("allowFutureDate"),onClick:r("allowFutureDate")}):null),l.a.createElement(j.a.Cell,null,l.a.createElement(F.a,{checked:i("skipSynchronization"),onClick:r("skipSynchronization")})),l.a.createElement(j.a.Cell,null,l.a.createElement(F.a,{checked:i("skipAnalytics"),onClick:r("skipAnalytics")})),l.a.createElement(j.a.Cell,null,l.a.createElement(q.a,{device:q.b,target:t,options:t.dataElement.renderTypeOptions,changeHandler:a})),l.a.createElement(j.a.Cell,{style:{paddingRight:0}},l.a.createElement(q.a,{device:q.c,target:t,options:t.dataElement.renderTypeOptions,changeHandler:a})))});i.contextTypes={d2:s.PropTypes.object,outerDivStyle:s.PropTypes.object},t.a=G(i)},3772:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return x});var i=n(0),s=n.n(i),l=n(113),u=(n.n(l),n(439)),c=(n.n(u),n(316)),d=n(74),p=n.n(d),f=n(97),h=n.n(f),m=n(133),y=n.n(m),g=n(98),v=n.n(g),b=n(1320),T=n(3878),E=n(58),S=n.n(E),_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},C=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),O={sectionContainer:{width:"100%",borderRadius:"8px",borderStyle:"solid",borderColor:l.grey300,borderWidth:"3px",marginBottom:"1.2rem"},noDataElementsMessage:{height:"4rem",lineHeight:"4rem",borderRadius:"6px",backgroundColor:"white",paddingLeft:"1.5rem"},sectionContent:{backgroundColor:l.grey300},sectionHeader:{color:"black",backgroundColor:l.grey300,borderRadius:"4px 4px 0 0",paddingLeft:"1rem"},sectionTopBar:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},collapsibleArrow:{color:"black",cursor:"pointer",transition:"none",userSelect:"none"},row:{display:"flex",flexDirection:"row",alignItems:"center"},sectionName:{textAlign:"left",color:"black",fontSize:"1.7rem",fontWeight:"400",wordWrap:"break-word",minWidth:"180px"},filterField:{marginTop:"-12px",marginBottom:"6px"},hiddenByFilter:{margin:0,padding:"5px",textAlign:"center"}},x=function(e){var t=e.numberOfHiddenElements,n=e.getTranslation;return t<1?null:s.a.createElement("p",{style:{margin:0,padding:"5px",textAlign:"center"}},1===t?n("element_hidden_by_filter"):n("$$total$$_elements_hidden_by_filter",{total:t}))},w=function(e){var t=e.onClick,n=e.icon,a=function(e){e&&e.stopPropagation(),t()};return s.a.createElement(y.a,{style:{transition:"none"},iconStyle:{transition:"none"},onClick:a},s.a.createElement(v.a,{color:"gray",className:"material-icons"},n))},k=function(e){function t(e,n){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.onSortEnd=function(e,t){r.props.sortItems(e,t)},r.openRemovalDialog=function(){r.setState({showRemovalDialog:!0})},r.closeRemovalDialog=function(){r.setState({showRemovalDialog:!1})},r.confirmSectionRemoval=function(){r.closeRemovalDialog(),r.props.onSectionRemoved()},r.handleFilterElemenets=function(e){r.setState({filter:e.target.value})},r.state={showRemovalDialog:!1,filter:""},r.getTranslation=n.d2.i18n.getTranslation.bind(n.d2.i18n),r}return r(t,e),C(t,[{key:"getFilteredElements",value:function(){var e=this.state.filter;return this.props.elements.filter(function(t){return!e.length||t.displayName.toLowerCase().includes(e.toLowerCase())})}},{key:"render",value:function(){var e=this.props.elements,t=this.getFilteredElements(),n=e.length-t.length,a=[s.a.createElement(p.a,{primary:!0,label:this.getTranslation("cancel"),onTouchTap:this.closeRemovalDialog}),s.a.createElement(p.a,{primary:!0,label:this.getTranslation("delete"),onTouchTap:this.confirmSectionRemoval})],o=e&&e.length>0?s.a.createElement("div",{style:O.sectionContent},s.a.createElement(T.a,{distance:4,onSortEnd:this.onSortEnd,onDataElementRemoved:this.props.onDataElementRemoved,sectionDataElements:t}),s.a.createElement(x,{numberOfHiddenElements:n,getTranslation:this.getTranslation})):s.a.createElement("div",{style:O.noDataElementsMessage},"dataElements"===this.props.elementPath?this.getTranslation("no_data_elements"):this.getTranslation("no_attributes"));return s.a.createElement("div",{style:_({},O.sectionContainer,{borderColor:this.props.selected?l.grey800:l.grey300})},s.a.createElement("div",{onClick:this.props.onSelect,style:O.sectionHeader},s.a.createElement("div",{style:O.sectionTopBar},s.a.createElement("div",{style:O.row},s.a.createElement(b.a,null),s.a.createElement(w,{onClick:this.props.onToggleEdit,icon:"mode_edit"}),s.a.createElement("div",{style:O.sectionName},this.props.section.displayName)),s.a.createElement("div",{style:O.row},s.a.createElement(w,{onClick:this.props.onToggleOpen,icon:this.props.collapsed?"keyboard_arrow_down":"keyboard_arrow_up"}),s.a.createElement(w,{onClick:this.openRemovalDialog,icon:"clear"}))),!this.props.collapsed&&s.a.createElement(S.a,{style:O.filterField,hintText:this.getTranslation("filter_elements"),onChange:this.handleFilterElemenets})),!this.props.collapsed&&o,s.a.createElement(h.a,{title:this.getTranslation("delete_section_message"),actions:a,open:this.state.showRemovalDialog,onRequestClose:this.closeRemovalDialog,autoScrollBodyContent:!0},s.a.createElement(c.a,{level:2},this.props.section.displayName)))}}]),t}(i.Component);k.propTypes={section:i.PropTypes.object.isRequired,selected:i.PropTypes.bool.isRequired,collapsed:i.PropTypes.bool.isRequired,onSectionRemoved:i.PropTypes.func.isRequired,onDataElementRemoved:i.PropTypes.func.isRequired,onToggleEdit:i.PropTypes.func.isRequired,onToggleOpen:i.PropTypes.func.isRequired,onSelect:i.PropTypes.func.isRequired,sortItems:i.PropTypes.func.isRequired},k.contextTypes={d2:i.PropTypes.object},t.b=n.i(u.SortableElement)(k)},3773:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(439),u=(n.n(l),n(15)),c=(n.n(u),n(1355)),d=n.n(c),p=n(152),f=n.n(p),h=n(3876),m=n(3873),y=n(1345),g=n(3772),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),b={sectionForm:{display:"flex",flexDirection:"row",alignItems:"space-between"}},T=function(e,t){return n.i(u.flatten)(e.map(function(e){return e[t]}))},E=function(e){function t(e,r){a(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return i.getElementsForSection=function(e){return e[i.props.elementPath]},i.onToggleEditing=function(e){i.setState({editingSection:i.state.editingSection&&n.i(u.isEqual)(e.id,i.state.editingSection.id)?null:e,sectionEditOpen:!i.state.sectionEditOpen})},i.clearEditingSection=function(){i.setState({editingSection:null,sectionEditOpen:!1})},i.openSection=function(e){i.setState({collapsedSections:n.i(u.pull)(e,i.state.collapsedSections)})},i.closeSection=function(e){var t=i.state.collapsedSections;t.push(e),i.setState({collapsedSections:t})},i.selectSection=function(e){i.setState({selectedSectionId:e})},i.openNoSelectionSectionMessage=function(){i.setState({showNoSelectionSectionMessage:!0})},i.closeNoSelectionSectionMessage=function(){i.setState({showNoSelectionSectionMessage:!1})},i.isSectionCollapsed=function(e){return i.state.collapsedSections.includes(e)},i.onToggleSection=function(e){i.isSectionCollapsed(e)?i.openSection(e):i.closeSection(e)},i.openSectionIfClosed=function(e){i.isSectionCollapsed(e)&&i.openSection(e)},i.onSelectSection=function(e){i.openSectionIfClosed(e),i.selectSection(e)},i.onSectionUpdated=function(e,t){i.props.onSectionUpdated(e,t),i.clearEditingSection()},i.onSortEnd=function(e){var t=e.oldIndex,a=e.newIndex;i.props.onSectionOrderChanged(n.i(l.arrayMove)(i.props.sections,t,a))},i.onElementPicked=function(e){var t=n.i(u.find)(function(t){return n.i(u.isEqual)(t.id,e)},i.props.availableElements);if(t){var a=n.i(u.findIndex)(function(e){return n.i(u.isEqual)(i.state.selectedSectionId,e.id)},i.props.sections);if(-1===a)return void i.openNoSelectionSectionMessage();var o=i.props.sections[a],r=i.getElementsForSection(o).concat(t),s=i.props.sections;o[i.props.elementPath]=r,i.props.onSectionOrderChanged(s),i.openSectionIfClosed(o.id)}},i.removeElementFromSection=function(e,t){var a=n.i(u.findIndex)(function(e){return n.i(u.isEqual)(e.id,t)},i.props.sections),o=i.props.sections[a],r=i.getElementsForSection(o),s=n.i(u.filter)(n.i(u.negate)(function(t){return n.i(u.isEqual)(t.id,e)}),r),l=i.props.sections;i.props.sections[a][i.props.elementPath]=s,i.props.onSectionOrderChanged(l)},i.sortItems=function(e,t,a){var o=i.props.sections[e],r=i.getElementsForSection(o),s=n.i(l.arrayMove)(r,t,a),u=i.props.sections;u[e][i.props.elementPath]=s,i.props.onSectionOrderChanged(u)},i.handleFilterAvailableElements=function(e){i.setState({availableDataElementsFilter:e.target.value})},i.render=function(){var e=i.getFilteredAvailableElements(),t=i.props.availableElements.length-e.length;return s.a.createElement("div",{style:b.sectionForm},s.a.createElement("div",{style:{flex:2}},s.a.createElement(h.a,{useDragHandle:!0,distance:4,sections:i.props.sections,selectedSectionId:i.state.selectedSectionId,collapsedSections:i.state.collapsedSections,onToggleSection:i.onToggleSection,onToggleEditing:i.onToggleEditing,onSelectSection:i.onSelectSection,onSectionRemoved:i.props.onSectionRemoved,onDataElementRemoved:i.removeElementFromSection,onSortEnd:i.onSortEnd,sortItems:i.sortItems,elementPath:i.props.elementPath}),s.a.createElement(m.a,{onSectionAdded:i.props.onSectionAdded,onSectionUpdated:i.onSectionUpdated,editingSection:i.state.editingSection,clearEditingSection:i.clearEditingSection,open:i.state.sectionEditOpen})),s.a.createElement("div",{style:{flex:1}},s.a.createElement(f.a,{style:{marginBottom:15,marginLeft:"1.5rem"},label:i.getTranslation("add_section_to_form"),primary:!0,fullWidth:!1,onClick:function(){return i.setState({sectionEditOpen:!0})}}),s.a.createElement(y.a,{availableDataElements:n.i(u.sortBy)(["displayName"],e),activeDataElements:i.state.activeElements,onElementPicked:i.onElementPicked,onFilter:i.handleFilterAvailableElements,filterText:i.getTranslation("filter_elements"),heading:"dataElements"===i.props.elementPath?i.getTranslation("available_data_elements"):i.getTranslation("available_attributes")}),s.a.createElement(g.a,{numberOfHiddenElements:t,getTranslation:i.getTranslation})),s.a.createElement(d.a,{open:i.state.showNoSelectionSectionMessage,message:i.getTranslation("no_section_selected_error"),autoHideDuration:3e3,onRequestClose:i.closeNoSelectionSectionMessage}))},i.state={collapsedSections:[],activeElements:T(e.sections,e.elementPath),selectedSectionId:e.sections[0]&&e.sections[0].id||-1,editingSection:null,showNoSelectionSectionMessage:!1,availableDataElementsFilter:"",sectionEditOpen:!1},i.getTranslation=r.d2.i18n.getTranslation.bind(r.d2.i18n),i}return r(t,e),v(t,[{key:"componentWillReceiveProps",value:function(e){if(e.sections!==this.props.sections){this.setState({activeElements:T(e.sections,this.props.elementPath)});var t=n.i(u.difference)(e.sections,this.props.sections)[0];t&&this.selectSection(t.id)}}},{key:"getFilteredAvailableElements",value:function(){var e=this.state.availableDataElementsFilter;return this.props.availableElements.filter(function(t){return!e.length||t.displayName.toLowerCase().includes(e.toLowerCase())})}}]),t}(i.Component);E.PropTypes={onSectionUpdated:i.PropTypes.func.isRequired,onSectionOrderChanged:i.PropTypes.func.isRequired,onSectionAdded:i.PropTypes.func.isRequired,onSectionRemoved:i.PropTypes.func.isRequired,availableElements:i.PropTypes.array.isRequired,sections:i.PropTypes.arrayOf(i.PropTypes.shape({id:i.PropTypes.string.isRequired,sortOrder:i.PropTypes.number.isRequired,displayName:i.PropTypes.string.isRequired})).isRequired},E.contextTypes={d2:i.PropTypes.object},t.a=E},3774:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(15),u=(n.n(l),n(19)),c=n.n(u),d=n(25),p=(n.n(d),function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}()),f=function(e){function t(e,n){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.setContainerRef=function(e){r.editorContainer=e},r.subscriptions=new Set,r}return r(t,e),p(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,n=t.onEditorChange,a=void 0===n?l.noop:n,o=t.onEditorInitialized,r=void 0===o?l.noop:o;window.CKEDITOR||c.a.error("CKEDITOR namespace can not be found on the window. You probably forgot to load the CKEditor script"),this.editor=window.CKEDITOR.replace(this.editorContainer,{plugins:["a11yhelp","basicstyles","bidi","blockquote","clipboard","colorbutton","colordialog","contextmenu","dialogadvtab","div","elementspath","enterkey","entities","filebrowser","find","floatingspace","font","format","horizontalrule","htmlwriter","image","indentlist","indentblock","justify","link","list","liststyle","magicline","maximize","forms","pastefromword","pastetext","preview","removeformat","resize","selectall","showblocks","showborders","sourcearea","specialchar","stylescombo","tab","table","tabletools","toolbar","undo","wsc","wysiwygarea"].join(","),removePlugins:"scayt,wsc,about",allowedContent:!0,extraPlugins:"div",height:500}),this.editor.setData(this.props.initialContent);var i=d.Observable.fromEventPattern(function(t){return e.editor.on("mode",t)}).switchMap(function(e){if("source"===e.editor.mode){var t=e.editor.editable();return d.Observable.fromEventPattern(function(e){return t.attachListener(t,"input",e)})}return d.Observable.empty()}),s=d.Observable.fromEventPattern(function(t){e.editor.on("change",t)}).merge(i).debounceTime(250).subscribe(function(){a(e.editor.getData())});this.subscriptions.add(s),r(this.editor)}},{key:"componentWillUnmount",value:function(){this.editor&&this.editor.destroy(),this.subscriptions.forEach(function(e){return e.unsubscribe()})}},{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return s.a.createElement("textarea",{ref:this.setContainerRef})}}]),t}(i.Component);t.a=f,f.propTypes={onEditorChange:i.PropTypes.func,onEditorInitialized:i.PropTypes.func,initialContent:i.PropTypes.string}},3775:function(e,t,n){"use strict";function a(e,t){var n=e.keySet,a=e.label,o=e.filter,i=e.expand,s=e.expandClick,u=e.usedIds,c=e.insertFn,d=e.styles,p=t.d2,f=Object.keys(n).filter(function(e){return!o.length||o.every(function(t){return-1!==n[e].toLowerCase().indexOf(t.toLowerCase())})}),h=a===i?"cell expanded":"cell";return r.a.createElement("div",{className:h},r.a.createElement("div",{style:l({},d),className:"header",onClick:s},r.a.createElement("div",{className:"arrow"},"▸"),p.i18n.getTranslation(a),":",r.a.createElement("div",{className:"count"},f.length)),r.a.createElement("div",{className:"items"},f.sort(function(e,t){return n[e]?n[e].localeCompare(n[t]):e.localeCompare(t)}).map(function(e){var t=-1===u.indexOf(e),a=t?"item active":"item inactive",o=n[e].name||n[e];return r.a.createElement("div",{key:e,className:a,title:o},r.a.createElement("a",{onClick:c[e]},o))})))}var o=n(0),r=n.n(o),i=n(41),s=n.n(i),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};a.contextTypes={d2:r.a.PropTypes.object};var u=s()(a);t.a=u},3776:function(e,t,n){"use strict";function a(e,t,n,a){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"entryfield",r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"id",i=t?" style="+t:"",s=n?" disabled="+n:"";return"<input "+r+'="'+e+'" '+((o?'name="'+o+'"':"")+' title="'+a+'" value="[ '+a+' ]"'+i+s).trim()+"/>"}function o(e){if(!e)return null;for(var t in c){var n=c[t],a=e[n];if(a){var o=a;return{idString:e[0],id:o,fieldType:t}}}return null}function r(e,t){for(var n=e,r="",i=[],s=l.exec(n),c=0;null!==s;){r+=n.substr(c,s.index-c),c=l.lastIndex;var d=s[0],p=(/style="(.*?)"/.exec(d)||["",""])[1],f=null!==/disabled/.exec(d),h=u.exec(d),m=o(h);if(m&&m.idString&&m.id){var y=m.id,g=m.fieldType;i.push(y);r+=a(y,p,f,t&&t[y],"id"===g?"entryfield":null,g)}else r+=d;s=l.exec(n)}return r+=n.substr(c),{usedIds:i,outHtml:r}}function i(e,t,n,a){var o={};return Object.keys(e).forEach(function(e){o[e]=t.bind(n,e,a)}),o}function s(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"id",r="id"===o?"entryfield":null,i=a(e,null,null,t,r,o);n.insertHtml(i,"unfiltered_html");var s=n.getSelection().getRanges()[0];s&&s.moveToElementEditablePosition(s.endContainer,!0)}t.a=r,t.b=i,t.c=s;var l=/<input.*?\/>/gi,u=/attributeid="(\w*?)"|programid="(\w*?)"|id="((\w*?)-(\w*?)-val)"/,c={attributeid:1,programid:2,id:3}},3777:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}var o=n(0),r=n.n(o),i=n(1),s=n.n(i),l=n(206),u=n.n(l),c=n(208),d=n.n(c),p=n(247),f=n.n(p),h=n(74),m=n.n(h),y=n(97),g=n.n(y),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b=function(e){var t=e.onCancel,n=e.onConfirm,a=e.question,o=e.open,i=e.t,s=[r.a.createElement(m.a,{label:i("cancel"),primary:!0,onTouchTap:t}),r.a.createElement(m.a,{label:i("delete"),primary:!0,onTouchTap:n})];return r.a.createElement(g.a,{actions:s,modal:!1,open:o,onRequestClose:t,autoScrollBodyContent:!0},a)};b.propTypes={onCancel:s.a.func,onConfirm:s.a.func,question:s.a.string,t:s.a.func};var T=u()(d()({d2:s.a.object}),f()(function(e){var t=e.d2,n=e.name,o=a(e,["d2","name"]);return v({t:t.i18n.getTranslation.bind(t.i18n),question:t.i18n.getTranslation("delete")+" "+n+"?"},o)}));t.a=T(b)},3778:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}var o=n(0),r=n.n(o),i=n(201),s=n(315),l=n(727),u=n.n(l),c=n(1315),d=n.n(c),p=n(1312),f=n(3883),h=n(74),m=n.n(h),y=n(97),g=n.n(y),v=n(251),b=n.n(v),T=n(206),E=n.n(T),S=n(444),_=n.n(S),C=n(3355),O=n(442),x=n(746),w=n.n(x),k=n(3913),P=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},A=E()(b()("activeStep","setActiveStep",0),_()(function(e){var t=e.setActiveStep,n=e.dataElements;return{stepperClicked:function(e){t(f.a.findIndex(function(t){return t.key===e}))},dataElements:n}})),D=function(e){return A(n.i(C.g)(e,"vertical"))},R=D(f.a),I=D(f.b),F={content:{width:"60%",minWidth:700,maxWidth:"none"},titleStyle:{fontWeight:400,margin:0}},N=function(e){return r.a.createElement("div",{style:P({},e.style,{paddingBottom:10})},r.a.createElement("h3",{style:F.titleStyle},e.title),r.a.createElement(w.a,null,e.subtitle))},M=function(e,t){var n=t.d2,o=e.model,i=e.onCancel,s=e.onConfirm,l=e.dataElements,u=e.isTracker,c=e.isProgram,d=a(e,["model","onCancel","onConfirm","dataElements","isTracker","isProgram"]),p=n.i18n.getTranslation.bind(n.i18n),f={attributes:u?d.program.programTrackedEntityAttributes:[],programStages:d.programStages,dataElements:l,isTracker:u,isProgram:c},h=[r.a.createElement(m.a,{label:p("cancel"),primary:!0,onTouchTap:i}),r.a.createElement(m.a,{label:p("done"),primary:!0,onTouchTap:function(){return s(o)}})],y=""+p(!u||c?"program_notification":"program_stage_notification"),v=c?I:R;return r.a.createElement(g.a,{actions:h,open:!!o,onRequestClose:i,title:r.a.createElement(N,{title:y,subtitle:o.displayName}),autoDetectWindowHeight:!0,repositionOnUpdate:!1,autoScrollBodyContent:!0,contentStyle:F.content,style:{paddingTop:0}},r.a.createElement(v,f))};M.contextTypes={d2:o.PropTypes.object},M.propTypes={model:o.PropTypes.object.isRequired,onCancel:o.PropTypes.func.isRequired,onConfirm:o.PropTypes.func.isRequired,dataElements:o.PropTypes.array,isTracker:o.PropTypes.bool,isProgram:o.PropTypes.bool},M.defaultProps={isProgram:!1,isTracker:!1};var j=function(e,t){var a=t.model,o=t.availableDataElements,r=t.programStages,i=t.dataElements,s=a&&a.programStage&&a.programStage.id||r.length>0&&r[0].id||null;return{model:a,dataElements:i||n.i(p.d)({availableDataElements:o,programStages:r})(s)}},L=function(e){return n.i(i.a)({onCancel:O.c.bind(null,null),onConfirm:O.e},e)},B=E()(n.i(k.a)(function(e){var t=e.programStages;return t&&t.length<1},{message:"cannot_create_program_notification_without_program_stage",translate:!0}),n.i(s.a)(j,L))(M),q=n.i(s.a)(null,function(e){return n.i(i.a)({onCancel:O.c.bind(null,null),onConfirm:O.f},e)})(M),U=function(e){return e.isProgram?r.a.createElement(q,P({},e,{dialogStyle:F})):r.a.createElement(B,P({},e,{dialogStyle:F}))},H=E()(n.i(s.a)(function(e){return{notificationType:n.i(p.e)(e),isProgram:n.i(p.f)(e),model:n.i(p.g)(e)}}),u()(function(e){return!e.model},d.a))(U);t.a=H},3779:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(317),i=n.n(r),s=n(1),l=n.n(s),u=n(316),c=n(456),d=n(3886),p=n(250),f={paper:{padding:"3rem"},padding:{paddingTop:"3rem"}},h=function(e,t){var n=t.d2;return o.a.createElement("div",null,n.i18n.getTranslation("save_the_program_in_order_to_access_sharing_settings"))};h.contextTypes={d2:l.a.object};var m=n.i(p.e)(function(e){return!e.model.dataValues.sharing},n.i(p.f)(h))(d.a),y=function(e,t){var n=e.modelToEdit,a=t.d2;return n?o.a.createElement(i.a,{style:f.paper},o.a.createElement(u.a,null,a.i18n.getTranslation("organisation_units")),o.a.createElement(c.a,{value:n.organisationUnits,model:n,modelDefinition:n.modelDefinition}),o.a.createElement(u.a,{style:f.padding},a.i18n.getTranslation("roles_and_access")),o.a.createElement(m,{model:n})):null};y.contextTypes={d2:l.a.object},t.a=y},3780:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e){return e&&n.i(f.has)("trackedEntityType.trackedEntityTypeAttributes",e)?e.trackedEntityType.trackedEntityTypeAttributes.filter(function(t){return!e.programTrackedEntityAttributes.find(function(e){return e.trackedEntityAttribute.id===t.trackedEntityAttribute.id})}):[]}function r(e,t){return function(o){var r=o.trackedEntityAttribute,i=a(o,["trackedEntityAttribute"]),s=e.find(function(e){return e.id===r.id}),l=s.displayName,u=s.valueType,c=s.optionSet,d=s.unique,p=n.i(M.f)(r,M.h,t);return j({},i,{trackedEntityAttribute:j({},r,{displayName:l,valueType:u,optionSet:c,unique:d,renderTypeOptions:p})})}}function i(e,t){var n=t.d2,a=w.a.create(),o=w.a.create();a.setState(e.availableAttributes.map(function(e){return{id:e.id,text:e.displayName,value:e.id}})),o.setState(e.assignedAttributes.map(function(e){return e.trackedEntityAttribute.id}));var i=function(t){o.setState(t),e.setAttributesOrder(t)},s=e.assignedAttributes.map(r(e.availableAttributes,e.renderingOptions)).map(function(t){return l.a.createElement(I.a,{key:t.id,displayName:t.trackedEntityAttribute.displayName,attribute:t,onEditAttribute:e.onEditProgramAttribute,isDateValue:"DATE"===t.trackedEntityAttribute.valueType,isUnique:t.trackedEntityAttribute.unique,hasOptionSet:!!t.trackedEntityAttribute.optionSet,renderTypeOptions:t.trackedEntityAttribute.renderTypeOptions})});return l.a.createElement(P.a,null,l.a.createElement("div",{style:L.groupEditor},l.a.createElement("div",{style:L.fieldname},n.i18n.getTranslation("program_tracked_entity_attributes")),l.a.createElement(D.a,{hintText:n.i18n.getTranslation("search_available_program_tracked_entity_attributes"),onChange:e.onAttributeFilter,value:e.attributeFilter,fullWidth:!0}),l.a.createElement(x.a,{itemStore:a,assignedItemStore:o,height:250,filterText:e.attributeFilter,onAssignItems:e.onAssignItems,onRemoveItems:e.onRemoveItems,onOrderChanged:i})),l.a.createElement(R.Table,null,l.a.createElement(R.TableHeader,{displaySelectAll:!1,adjustForCheckbox:!1},l.a.createElement(R.TableRow,null,l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("name")),l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("display_in_list")),l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("mandatory")),l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("date_in_future")),l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("searchable")),l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("render_type_mobile")),l.a.createElement(R.TableHeaderColumn,null,n.i18n.getTranslation("render_type_desktop")))),l.a.createElement(R.TableBody,{displayRowCheckbox:!1},s)))}n.d(t,"b",function(){return W});var s=n(0),l=n.n(s),u=n(1),c=n.n(u),d=n(201),p=n(315),f=n(15),h=(n.n(f),n(444)),m=n.n(h),y=n(206),g=n.n(y),v=n(722),b=n.n(v),T=n(251),E=n.n(T),S=n(725),_=n.n(S),C=n(748),O=n.n(C),x=n(453),w=n(44),k=n(317),P=n.n(k),A=n(58),D=n.n(A),R=n(747),I=(n.n(R),n(1353)),F=n(318),N=n(1347),M=n(1321),j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},L={groupEditor:{padding:"2rem 3rem 4rem",marginTop:"15px"},fieldname:{fontSize:16,color:"#00000080"}},B=F.a.map(n.i(f.get)("program")),q=F.a.map(n.i(f.get)("availableAttributes")).take(1),U=F.a.map(n.i(f.get)("renderingOptions")).take(1),H=function(e){return n.i(d.a)({addAttributesToProgram:N.a,removeAttributesFromProgram:N.b,editProgramAttributes:N.c,setAttributesOrder:N.d},e)},W=b()(function(e){return e.combineLatest(B,q,U,function(e,t,n,a){return j({},e,{availableAttributes:n,renderingOptions:a,model:t,assignedAttributes:t.programTrackedEntityAttributes.map(r(n,a))})})}),V=g()(m()(function(e){return{groupName:e.params.groupName,modelType:e.schema,modelId:e.params.modelId}}),n.i(p.a)(null,H),O()({componentDidMount:function(){if("add"===this.props.modelId){var e=o(this.props.model).map(function(e){return e.trackedEntityAttribute.id});this.props.addAttributesToProgram({attributes:e})}}}),E()("attributeFilter","setAttributeFilter",""),_()({onAssignItems:function(e){var t=e.addAttributesToProgram;return function(e){return t({attributes:e}),Promise.resolve()}},onRemoveItems:function(e){var t=e.removeAttributesFromProgram;return function(e){return t({attributes:e}),Promise.resolve()}},onEditProgramAttribute:function(e){var t=e.editProgramAttributes;return function(e){return t({attribute:e})}},onAttributeFilter:function(e){var t=e.setAttributeFilter;return function(e){return t(e.target.value)}}}));i.propTypes={availableAttributes:c.a.array.isRequired,assignedAttributes:c.a.array.isRequired,onEditProgramAttribute:c.a.func.isRequired,attributeFilter:c.a.string.isRequired,onAttributeFilter:c.a.func.isRequired,onAssignItems:c.a.func.isRequired,onRemoveItems:c.a.func.isRequired},i.contextTypes={d2:c.a.object},t.a=V(i)},3860:function(e,t,n){var a=n(3916);"string"==typeof a&&(a=[[e.i,a,""]]);n(455)(a,{});a.locals&&(e.exports=a.locals)},3866:function(e,t,n){"use strict";function a(e){var t=e.onSaveAction,n=e.onCancelAction,a=e.isDirtyHandler,o=e.isSaving;return i.a.createElement("div",null,i.a.createElement(f.a,{onClick:t,isSaving:o}),i.a.createElement(h.a,{onClick:n,isDirtyHandler:a,style:y.cancelButton}))}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=function(e,t){return function(){return n.i(m.b)("/list/"+e+"/"+t)}};return n.i(p.compose)(d()(function(e){var t=e.groupName,n=e.schema;return{onCancelAction:o(t,n)}}),n.i(u.a)(t,e))(a)}t.a=o;var r=n(0),i=n.n(r),s=n(1),l=n.n(s),u=n(315),c=n(444),d=n.n(c),p=n(15),f=(n.n(p),n(3397)),h=n(3488),m=n(202),y={cancelButton:{marginLeft:"1rem"}};a.propTypes={onSaveAction:l.a.func.isRequired,onCancelAction:l.a.func.isRequired,isDirtyHandler:l.a.func,isSaving:l.a.bool},a.defaultProps={isDirtyHandler:function(){},isSaving:!1}},3869:function(e,t,n){"use strict";function a(e){var t=e.params.modelType||"program",a=e.params.groupName;return r.a.createElement("div",null,r.a.createElement("div",{style:E.heading},r.a.createElement(u.a,{schema:t,groupName:a,isDirtyHandler:S},"event_"+n.i(l.camelCaseToUnderscores)(t)),r.a.createElement(c.a,null,e.model.displayName)),r.a.createElement("div",null,r.a.createElement(d.a,null)),r.a.createElement(p.a,g({schema:t},e)),r.a.createElement(T,null,r.a.createElement(h.a,{groupName:a,schema:t,isDirtyHandler:S})))}var o=n(0),r=n.n(o),i=n(1),s=n.n(i),l=n(724),u=(n.n(l),n(3392)),c=n(3686),d=n(3870),p=n(3871),f=n(318),h=n(3770),m=n(3355),y=n(438),g=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},v=n.i(m.c)(y.b),b=n.i(m.d)(y.c),T=n.i(m.e)(b,v),E={heading:{display:"flex",flexDirection:"column",marginBottom:"1rem"}},S=function(){return{dirty:n.i(f.b)(f.a.getState())}};a.propTypes={params:s.a.object.isRequired,isProgramStageStepperActive:s.a.bool,model:s.a.object.isRequired},a.defaultProps={isProgramStageStepperActive:!1},t.a=a},3870:function(e,t,n){"use strict";var a=n(3355),o=n(3510),r=n(315),i=n(1340),s=n(438),l=n(201),u=function(e){return{activeStep:n.i(o.b)(e)}},c=function(e){return n.i(l.a)({stepperClicked:s.f},e)},d=n.i(r.a)(u,c)(n.i(a.g)(i.a));t.a=d},3871:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(315),i=n(201),s=n(722),l=n.n(s),u=n(15),c=(n.n(u),n(3355)),d=n(3510),p=n(318),f=n(1340),h=n(3771),m=n(3717),y=n(3779),g=n(3882),v=n(3393),b=n(438),T=n(3687),E=n(1306),S=n(1309),_=n(321),C=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},O=E.a.for("eventProgram"),x=E.a.for("eventProgramStage"),w=n.i(u.compose)(l()(function(e){return e.combineLatest(p.a.map(n.i(u.get)("program")),function(e,t){return C({},e,{model:t})})}),n.i(v.c)("program",O,void 0,!0,!0,"eventProgram")),k=function(e){return o.a.createElement(S.a,{fields:e.fieldConfigs,onUpdateField:e.editFieldChanged})};k=w(k);var P=function(e){return o.a.createElement(S.a,{fields:e.fieldConfigs,onUpdateField:e.editProgramStageFieldChange})};P=n.i(v.c)("programStage",x,void 0,null,!0,"eventProgramStage")(P);var A=function(e){return o.a.createElement("div",null,o.a.createElement(k,{model:e.model,editFieldChanged:e.editFieldChanged}),o.a.createElement(P,{model:e.programStage,editProgramStageFieldChange:e.editProgramStageFieldChange}))},D=function(e,t){return n.i(i.a)({editFieldChanged:b.e,editProgramStageFieldChange:function(e,a){return n.i(_.a)(t.programStage.id,e,a)}},e)};A=n.i(r.a)(null,D)(n.i(T.a)(A));var R=function(e){return{activeStep:n.i(d.b)(e)}},I=n.i(u.compose)(n.i(r.a)(R),l()(function(e){return e.combineLatest(p.a,function(e,t){var a=t.program,o=t.programStages;return C({},e,{modelToEdit:a,programStage:n.i(u.first)(o)})})}))(n.i(c.f)(function(){var e={EditProgramDetailsForm:A,AssignDataElements:h.a,EditDataEntryForm:m.a,ProgramAccess:y.a,EventProgramNotifications:g.a};return f.a.map(function(t){return t.component=e[t.componentName],t})}()));t.a=I},3872:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}n.d(t,"a",function(){return s});var o=n(0),r=n.n(o),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},s=function(e){var t=e.children,n=a(e,["children"]);return r.a.createElement("table",i({},n,{style:{padding:"0 3rem",borderSpacing:0,width:"100%"}}),t)};s.Head=function(e){var t=e.children,n=a(e,["children"]);return r.a.createElement("thead",i({},n,{style:{textAlign:"left",verticalAlign:"top"}}),t)},s.Body=function(e){var t=e.children,n=a(e,["children"]);return r.a.createElement("tbody",n,t)},s.Row=function(e){var t=e.children,n=a(e,["children"]);return r.a.createElement("tr",n,t)},s.CellHead=function(e){var t=e.children,n=(e.style,a(e,["children","style"]));return r.a.createElement("th",i({},n,{style:{height:"56px",padding:"0 5px 10px"}}),t)},s.Cell=function(e){var t=e.children,n=e.style,o=a(e,["children","style"]);return r.a.createElement("td",i({},o,{style:i({padding:"10px 5px",borderTop:"1px solid #bdbdbd"},n||{})}),t)}},3873:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(97),u=n.n(l),c=n(74),d=n.n(c),p=n(99),f=n.n(p),h=n(1321),m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},y=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),g={container:{textAlign:"right",width:"100%"}},v={section:{id:null,name:"",description:"",renderType:{MOBILE:{type:h.d},DESKTOP:{type:h.d}}}},b=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onNameChanged=function(e,t){n.setState({section:m({},n.state.section,{name:t})})},n.onDescriptionChanged=function(e,t){n.setState({section:m({},n.state.section,{description:t})})},n.onRenderTypeChanged=function(e){n.setState({section:e})},n.getTranslation=function(e){return n.context.d2.i18n.getTranslation(e)},n.closeDialog=function(){n.props.clearEditingSection(),n.setState(m({},v))},n.openDialog=function(){n.setState({dialogOpen:!0})},n.confirmAddNewSection=function(){n.closeDialog(),n.props.onSectionAdded(n.state.section)},n.confirmUpdateSection=function(){var e=n.state.section;n.closeDialog(),n.props.onSectionUpdated(e.id,e)},n.focusOnSectionName=function(e){e&&setTimeout(function(){e.focus()},20)},n.render=function(){var e=n.state.section,t=e.id,a=e.name,o=e.description,r=void 0,i=void 0,l=void 0;t?(r=n.getTranslation("update_section"),i=n.confirmUpdateSection,l=n.getTranslation("update")):(r=n.getTranslation("add_new_section"),i=n.confirmAddNewSection,l=n.getTranslation("add"));var c=[s.a.createElement(d.a,{primary:!0,label:n.getTranslation("cancel"),onTouchTap:n.closeDialog}),s.a.createElement(d.a,{primary:!0,label:l,disabled:!a,onTouchTap:i})];return s.a.createElement("div",{style:g.container},s.a.createElement(u.a,{title:r,actions:c,open:n.props.open,onRequestClose:n.closeDialog,autoScrollBodyContent:!0},s.a.createElement(f.a,{ref:n.focusOnSectionName,hintText:n.getTranslation("name"),onChange:n.onNameChanged,value:a,fullWidth:!0}),s.a.createElement(f.a,{hintText:n.getTranslation("description"),onChange:n.onDescriptionChanged,value:o,fullWidth:!0,multiLine:!0,rows:2,rowsMax:4}),s.a.createElement(h.a,{device:h.b,target:n.state.section,options:h.e,inDialog:!0,changeHandler:n.onRenderTypeChanged}),s.a.createElement(h.a,{device:h.c,target:n.state.section,options:h.e,inDialog:!0,changeHandler:n.onRenderTypeChanged})))},n.state=m({},v),n}return r(t,e),y(t,[{key:"componentDidUpdate",value:function(e){this.props.editingSection&&!e.editingSection&&this.showDialogForEditingModel(this.props.editingSection)}},{key:"getSaveData",value:function(){var e=this.state.section;return m({},e,{renderType:{MOBILE:{type:e.renderType},DESKTOP:{type:e.renderType}}})}},{key:"showDialogForEditingModel",value:function(e){var t=e.id,n=e.name,a=e.description,o=e.renderType;this.setState({section:{id:t,name:n,description:a,renderType:{MOBILE:{type:o?o.MOBILE.type:h.d},DESKTOP:{type:o?o.DESKTOP.type:h.d}}}})}}]),t}(i.Component);b.propTypes={onSectionAdded:i.PropTypes.func.isRequired,onSectionUpdated:i.PropTypes.func.isRequired,editingSection:i.PropTypes.object,clearEditingSection:i.PropTypes.func.isRequired},b.defaultProps={editingSection:null},b.contextTypes={d2:i.PropTypes.object},t.a=b},3874:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(3880),i=function(e){return o.a.createElement(r.a,e)};t.a=i},3875:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(3877),i=function(e){var t=e.availableDataElements,n=e.onChange;return o.a.createElement(r.a,{darkItems:!0,dataElements:t,onSortEnd:n})};i.propTypes={availableDataElements:a.PropTypes.array.isRequired,onChange:a.PropTypes.func.isRequired},t.a=i},3876:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(439),i=(n.n(r),n(15)),s=(n.n(i),n(3772)),l=function(e){var t=e.sections,a=e.selectedSectionId,r=e.onToggleEditing,l=e.collapsedSections,u=e.onToggleSection,c=e.onSelectSection,d=e.onSectionRemoved,p=e.onDataElementRemoved,f=e.sortItems,h=e.elementPath;return o.a.createElement("div",{style:{minHeight:410}},t.map(function(e,t){var m=e[h];return o.a.createElement(s.b,{key:"section-"+t,index:t,section:e,selected:n.i(i.isEqual)(e.id,a),collapsed:l.includes(e.id),onToggleEdit:function(){r(e)},onToggleOpen:function(){u(e.id)},onSelect:function(){c(e.id)},onSectionRemoved:function(){d(e)},onDataElementRemoved:function(t){p(t,e.id)},sortItems:function(e){var n=e.oldIndex,a=e.newIndex;f(t,n,a)},elements:m,elementPath:h})}))};t.a=n.i(r.SortableContainer)(l)},3877:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(439),i=(n.n(r),n(1320)),s=n(113),l=(n.n(s),{dataElement:{padding:"1rem 1rem",backgroundColor:s.grey200,marginBottom:"4px",borderRadius:"8px"},row:{userSelect:"none",display:"flex",flexDirection:"row",alignItems:"center"},horizontalSpace:{paddingLeft:"1rem"}}),u=function(e){var t=e.dataElement;return o.a.createElement("div",{style:l.dataElement},o.a.createElement("div",{style:l.row},o.a.createElement(i.a,null),o.a.createElement("div",{style:l.horizontalSpace}),t.displayName))};u.propTypes={dataElement:a.PropTypes.shape({id:a.PropTypes.string.isRequired,displayName:a.PropTypes.string.isRequired})};var c=n.i(r.SortableElement)(u),d=n.i(r.SortableContainer)(function(e){var t=e.dataElements,n=e.isSortingIndex;return o.a.createElement("div",null,t.map(function(e,t){return o.a.createElement(c,{dataElement:e,index:t,isSortingIndex:n,key:"item-"+t,sortIndex:t})}))});t.a=d},3878:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(439),i=(n.n(r),n(1320)),s=n(113),l=(n.n(s),n(1344)),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},c={dataElement:{height:"55px",display:"flex",paddingLeft:"1rem",backgroundColor:s.grey100,borderRadius:"6px",justifyContent:"space-between",alignItems:"center"},row:{userSelect:"none",MozUserSelect:"none",display:"flex",flexDirection:"row",alignItems:"center"},horizontalSpace:{paddingLeft:"1rem"}},d=function(e){var t=e.first,n=e.dataElement,a=e.onRemove,r=u({},c.dataElement,{marginTop:t?"0px":"4px"});return o.a.createElement("div",{style:r},o.a.createElement("div",{style:c.row},o.a.createElement(i.a,null),o.a.createElement("div",{style:c.horizontalSpace}),n.displayName),o.a.createElement(l.a,{onClick:a,icon:"clear"}))};d.propTypes={dataElement:a.PropTypes.shape({id:a.PropTypes.string.isRequired,displayName:a.PropTypes.string.isRequired})};var p=n.i(r.SortableElement)(d),f=n.i(r.SortableContainer)(function(e){var t=e.sectionDataElements,n=e.onDataElementRemoved;return o.a.createElement("div",null,t.map(function(e,t){return o.a.createElement(p,{first:0===t,dataElement:e,onRemove:function(){n(e.id)},index:t,key:"item-"+t})}))});t.a=f},3879:function(e,t,n){"use strict";n.d(t,"a",function(){return a});var a=function(e){return e.eventProgram.programStageStepper.stageId}},3880:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),l=n.n(s),u=n(25),c=(n.n(u),n(151)),d=n.n(c),p=n(319),f=n.n(p),h=n(204),m=n.n(h),y=n(317),g=n.n(y),v=n(58),b=n.n(v),T=n(3497),E=n(112),S=n(722),_=n.n(S),C=n(15),O=(n.n(C),n(201)),x=n(315),w=n(1339),k=n(318),P=n(3774),A=n(3860),D=(n.n(A),n(1312)),R=n(3775),I=n(3776),F=n(1),N=n.n(F),M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},j=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),L=function(e){return function(t){return{id:e+"."+t.id,displayName:t.displayName}}},B=R.a,q={heading:{paddingBottom:18},formContainer:{},formPaper:{display:"flex",flexDirection:"row",width:"100%",margin:"0 auto 2rem",padding:"4rem 4rem",alignItems:"center"},formSection:{display:"flex",flexWrap:"wrap"},cancelButton:{marginLeft:"2rem"},deleteButton:{marginLeft:"2rem"},paletteHeader:{},paletteFilter:{padding:"0 8px 8px"},paletteFilterField:{width:"100%"},greySwitch:{position:"absolute",bottom:8,left:8,right:8}},U=function(e){function t(e,a){o(this,t);var i=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a));i.handleEditorChanged=function(e){if(i.props.isActive&&(e||i.props.dataEntryForm)){var t=n.i(I.a)(e,i.operands),a=t.usedIds,o=t.outHtml;i.setState({usedIds:a},function(){i.props.dataEntryForm&&i.props.dataEntryForm.htmlCode===o||i.props.onFormChange(o)})}};var s=e.dataEntryForm;i.state={usedIds:[],filter:"",expand:"data_elements",insertFn:{}},i.disposables=new Set;var l=e.programStage,c=e.dataElements;return i.disposables.add(u.Observable.fromPromise(a.d2.Api.getApi().get("system/flags")).subscribe(function(e){i.operands=c.map(L(l.id)).filter(function(e){return-1!==e.id.indexOf(".")}).reduce(function(e,t){return e[t.id.split(".").join("-")+"-val"]=t.displayName,e},{}),i.flags=e.reduce(function(e,t){return e[t.path]=t.name,e},{});var t=n.i(I.b)(i.operands,i.insertElement,i),a=n.i(I.b)(i.flags,i.insertFlag,i),o=M({},t,a),r=n.i(I.a)(n.i(C.getOr)("","htmlCode",s),i.operands),u=r.usedIds,d=r.outHtml,p=s?d:"";i.setState({usedIds:u,insertFn:o,formHtml:p,dataEntryForm:s,formTitle:i.props.formTitle})})),i.filterAction=E.a.create("filter"),i.disposables.add(i.filterAction.map(function(e){var t=e.data,n=e.complete,a=e.error;return{data:t[1],complete:n,error:a}}).debounceTime(75).subscribe(function(e){var t=e.data.split(" ").filter(function(e){return e.length});i.setState({filter:t})})),i.getTranslation=i.context.d2.i18n.getTranslation.bind(i.context.d2.i18n),i.handleDeleteClick=i.handleDeleteClick.bind(i),i.handleStyleChange=i.handleStyleChange.bind(i),i.setEditorReference=i.setEditorReference.bind(i),i}return i(t,e),j(t,[{key:"componentWillUnmount",value:function(){this.disposables.forEach(function(e){return e.unsubscribe()})}},{key:"componentWillReceiveProps",value:function(e){var t=e.dataEntryForm;!this.props.dataEntryForm||t&&t.id||this._editor.setData("")}},{key:"handleDeleteClick",value:function(){this.props.onFormDelete()}},{key:"handleStyleChange",value:function(e,t,n){this.state.dataEntryForm.style!==n&&this.props.onStyleChange(n)}},{key:"insertElement",value:function(e){if(-1===this.state.usedIds.indexOf(e))return n.i(I.c)(e,this.operands[e],this._editor)}},{key:"insertFlag",value:function(e){this._editor.insertHtml('<img src="../dhis-web-commons/flags/'+e+'" />',"unfiltered_html");var t=this._editor.getSelection().getRanges()[0];t.moveToElementEditablePosition(t.endContainer,!0)}},{key:"setEditorReference",value:function(e){this._editor=e}},{key:"renderPalette",value:function(){var e=this;return l.a.createElement("div",{className:"paletteContainer",style:{}},l.a.createElement("div",{className:"palette"},l.a.createElement("div",{style:q.paletteFilter},l.a.createElement(b.a,{hintText:this.getTranslation("filter_elements"),style:q.paletteFilterField,onChange:this.filterAction,fullWidth:!0})),l.a.createElement("div",{className:"elements"},l.a.createElement(B,{keySet:this.operands,label:"data_elements",filter:this.state.filter,expand:this.state.expand,expandClick:function(){e.setState({expand:"data_elements"})},usedIds:this.state.usedIds,insertFn:this.state.insertFn}),l.a.createElement(B,{keySet:this.flags,label:"flags",filter:this.state.filter,expand:this.state.expand,expandClick:function(){e.setState({expand:"flags"})},usedIds:this.state.usedIds,insertFn:this.state.insertFn}))))}},{key:"render",value:function(){var e=this.props;return void 0===this.state.formHtml?l.a.createElement(T.a,null):l.a.createElement("div",{style:Object.assign({},q.formContainer,{})},l.a.createElement("div",{className:"programStageEditForm"},l.a.createElement("div",{className:"left"},l.a.createElement(P.a,{onEditorChange:this.handleEditorChanged,onEditorInitialized:this.setEditorReference,initialContent:this.state.formHtml}),l.a.createElement(g.a,{style:q.formPaper},l.a.createElement("div",{style:q.formSection},l.a.createElement(f.a,{value:n.i(C.getOr)("NORMAL","style",e.dataEntryForm),floatingLabelText:"Form display style",onChange:this.handleStyleChange},l.a.createElement(m.a,{value:"NORMAL",primaryText:this.getTranslation("normal")}),l.a.createElement(m.a,{value:"COMFORTABLE",primaryText:this.getTranslation("comfortable")}),l.a.createElement(m.a,{value:"COMPACT",primaryText:this.getTranslation("compact")}),l.a.createElement(m.a,{value:"NONE",primaryText:this.getTranslation("none")}))),l.a.createElement("div",{style:q.formSection},e.dataEntryForm&&e.dataEntryForm.id?l.a.createElement(d.a,{primary:!0,label:this.getTranslation("delete"),style:q.deleteButton,onClick:this.handleDeleteClick}):void 0))),l.a.createElement("div",{className:"right"},this.renderPalette())))}}]),t}(l.a.Component);U.propTypes={params:N.a.object,onFormChange:N.a.func,onStyleChange:N.a.func,onFormDelete:N.a.func,elements:N.a.array},U.defaultProps={onFormChange:C.noop,onStyleChange:C.noop,onFormDelete:C.noop},U.contextTypes={d2:N.a.any};var H=function(e,t){var a=t.programStage;return n.i(O.a)({onFormChange:n.i(C.curry)(w.a)(a.id)("htmlCode"),onStyleChange:n.i(C.curry)(w.a)(a.id)("style"),onFormDelete:w.b.bind(void 0,a.id)},e)},W=n.i(C.compose)(_()(function(e){return e.combineLatest(k.a,function(e,t){var o=e.programStage,r=a(e,["programStage"]);return M({},r,{programStage:o,dataEntryForm:t.dataEntryFormForProgramStage[o.id],dataElements:n.i(D.d)(t)(o.id),formTitle:o.displayName})})}),n.i(x.a)(void 0,H));t.a=W(U)},3881:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return H});var i=n(0),s=n.n(i),l=n(151),u=n.n(l),c=n(319),d=n.n(c),p=n(204),f=n.n(p),h=n(317),m=n.n(h),y=n(58),g=n.n(y),v=n(3497),b=n(112),T=n(722),E=n.n(T),S=n(15),_=(n.n(S),n(201)),C=n(315),O=n(1339),x=n(318),w=n(3774),k=n(3860),P=(n.n(k),n(3775)),A=n(3776),D=n(1),R=n.n(D),I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},F=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),N=function(e){var t=e.programTrackedEntityAttributes,n=e.availableAttributes,a={};return t.map(function(e){var t=n.find(function(t){return t.id===e.trackedEntityAttribute.id});a[t.id]=t.displayName}),a},M=P.a,j={heading:{paddingBottom:18},formContainer:{},formPaper:{display:"flex",flexDirection:"row",width:"100%",margin:"0 auto 2rem",padding:"4rem 4rem",alignItems:"center"},formSection:{display:"flex",flexWrap:"wrap"},cancelButton:{marginLeft:"2rem"},deleteButton:{marginLeft:"2rem"},paletteHeader:{},paletteFilter:{padding:"0 8px 8px"},paletteFilterField:{width:"100%"},greySwitch:{position:"absolute",bottom:8,left:8,right:8}},L=function(e){function t(e,r){a(this,t);var i=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));B.call(i),i.getTranslation=i.context.d2.i18n.getTranslation.bind(i.context.d2.i18n);var s=e.dataEntryForm,l={incidentDate:i.getTranslation("date_of_incident"),enrollmentDate:i.getTranslation("date_of_enrollment")},u=n.i(A.a)(n.i(S.getOr)("","htmlCode",s),I({},l,i.props.elements)),c=u.usedIds,d=u.outHtml,p=s?d:"";return i.state={usedIds:c||[],filter:"",expand:"attributes",insertFn:I({},n.i(A.b)(e.elements,i.insertElement,i),n.i(A.b)(l,i.insertProgramElement,i)),formTitle:i.props.formTitle,formHtml:p,programElements:l},i.filterAction=b.a.create("filter"),i.disposables=new Set,i.disposables.add(i.filterAction.map(function(e){var t=e.data,n=e.complete,a=e.error;return{data:t[1],complete:n,error:a}}).debounceTime(75).subscribe(function(e){var t=e.data.split(" ").filter(function(e){return e.length});i.setState({filter:t})})),i.handleDeleteClick=i.handleDeleteClick.bind(i),i.handleStyleChange=i.handleStyleChange.bind(i),i.setEditorReference=i.setEditorReference.bind(i),i}return r(t,e),F(t,[{key:"componentWillUnmount",value:function(){this.disposables.forEach(function(e){return e.unsubscribe()})}},{key:"componentWillReceiveProps",value:function(e){var t=e.dataEntryForm;this.props.dataEntryForm&&!t&&this._editor.setData("")}},{key:"handleDeleteClick",value:function(){this.props.onFormDelete()}},{key:"handleStyleChange",value:function(e,t,n){this.props.dataEntryForm.style!==n&&this.props.onStyleChange(n)}},{key:"insertElement",value:function(e){if(-1===this.state.usedIds.indexOf(e))return n.i(A.c)(e,this.props.elements[e],this._editor,"attributeid")}},{key:"insertProgramElement",value:function(e){if(-1===this.state.usedIds.indexOf(e))return n.i(A.c)(e,this.state.programElements[e],this._editor,"programid")}},{key:"setEditorReference",value:function(e){this._editor=e}},{key:"renderPalette",value:function(){var e=this;return s.a.createElement("div",{className:"paletteContainer",style:{}},s.a.createElement("div",{className:"palette"},s.a.createElement("div",{style:j.paletteFilter},s.a.createElement(g.a,{hintText:this.getTranslation("filter_elements"),style:j.paletteFilterField,onChange:this.filterAction,fullWidth:!0})),s.a.createElement("div",{className:"elements"},s.a.createElement(M,{keySet:this.props.elements,label:"attributes",filter:this.state.filter,expand:this.state.expand,expandClick:function(){e.setState({expand:"attributes"})},usedIds:this.state.usedIds,insertFn:this.state.insertFn})),s.a.createElement("div",{className:"elements"},s.a.createElement(M,{keySet:this.state.programElements,label:"program",filter:this.state.filter,expand:this.state.expand,expandClick:function(){e.setState({expand:"program"})},usedIds:this.state.usedIds,insertFn:this.state.insertFn}))))}},{key:"render",value:function(){var e=this.props;return void 0===this.state.formHtml?s.a.createElement(v.a,null):s.a.createElement("div",{style:Object.assign({},j.formContainer,{})},s.a.createElement("div",{className:"programStageEditForm"},s.a.createElement("div",{className:"left"},s.a.createElement(w.a,{onEditorChange:this.handleEditorChanged,onEditorInitialized:this.setEditorReference,initialContent:this.state.formHtml}),s.a.createElement(m.a,{style:j.formPaper},s.a.createElement("div",{style:j.formSection},s.a.createElement(g.a,{floatingLabelText:this.getTranslation("form_name"),defaultValue:this.props.program.displayName,onChange:this.props.onFormNameChange}),s.a.createElement(d.a,{value:n.i(S.getOr)("NORMAL","style",e.dataEntryForm),floatingLabelText:"Form display style",onChange:this.handleStyleChange},s.a.createElement(f.a,{value:"NORMAL",primaryText:this.getTranslation("normal")}),s.a.createElement(f.a,{value:"COMFORTABLE",primaryText:this.getTranslation("comfortable")}),s.a.createElement(f.a,{value:"COMPACT",primaryText:this.getTranslation("compact")}),s.a.createElement(f.a,{value:"NONE",primaryText:this.getTranslation("none")}))),s.a.createElement("div",{style:j.formSection},e.dataEntryForm&&e.dataEntryForm.id?s.a.createElement(u.a,{primary:!0,label:this.getTranslation("delete"),style:j.deleteButton,onClick:this.handleDeleteClick}):void 0))),s.a.createElement("div",{className:"right"},this.renderPalette())))}}]),t}(s.a.Component),B=function(){var e=this;this.handleEditorChanged=function(t){if(t||e.props.dataEntryForm){var a=n.i(A.a)(t,I({},e.state.programElements,e.props.elements)),o=a.usedIds,r=a.outHtml;e.setState({usedIds:o},function(){e.props.dataEntryForm&&e.props.dataEntryForm.htmlCode===r||e.props.onFormChange(r)})}}};L.propTypes={params:R.a.object,onFormChange:R.a.func,onStyleChange:R.a.func,onFormDelete:R.a.func},L.defaulRFFtProps={onFormChange:S.noop,onStyleChange:S.noop,onFormDelete:S.noop},L.contextTypes={d2:R.a.any};var q=function(e,t){var a=t.program;return n.i(_.a)({onFormChange:n.i(S.curry)(O.c)("htmlCode"),onFormNameChange:function(e){return n.i(O.c)("name",e.target.value)},onStyleChange:n.i(S.curry)(O.c)("style"),onFormDelete:O.d.bind(void 0,a.id)},e)},U=n.i(S.compose)(E()(function(e){return e.combineLatest(x.a,function(e,t){var n=t.program,a=t.availableAttributes;return I({},e,{program:n,dataEntryForm:n.dataEntryForm,elements:N({programTrackedEntityAttributes:n.programTrackedEntityAttributes,availableAttributes:a}),formTitle:n.displayName})})}),n.i(C.a)(void 0,q)),H=U(L)},3882:function(e,t,n){"use strict";function a(e){var t=e.notifications,n=e.askForConfirmation,a=e.onCancel,o=e.onDelete,i=e.open,s=e.setOpen,l=e.modelToDelete,u=e.setEditModel,c=e.setAddModel,d=e.dataElements,p=e.programStages;return r.a.createElement("div",null,r.a.createElement(y.a,{notifications:t,onRemoveNotification:n,onEditNotification:u,onAddNotification:c}),r.a.createElement(T.a,{dataElements:d,programStages:p}),r.a.createElement(v.a,{setOpen:s,open:i,onCancel:a,onConfirm:o,name:l&&l.name}))}var o=n(0),r=n.n(o),i=n(315),s=n(201),l=n(251),u=n.n(l),c=n(206),d=n.n(c),p=n(725),f=n.n(p),h=n(722),m=n.n(h),y=n(3718),g=n(1312),v=n(3777),b=n(442),T=n(3778),E=n(318),S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},_=E.a.map(g.a),C=E.a.map(g.b),O=E.a.map(g.c);a.propTypes={notifications:o.PropTypes.any.isRequired,askForConfirmation:o.PropTypes.any.isRequired,onCancel:o.PropTypes.any.isRequired,onDelete:o.PropTypes.any.isRequired,open:o.PropTypes.any.isRequired,setOpen:o.PropTypes.any.isRequired,modelToDelete:o.PropTypes.any,setEditModel:o.PropTypes.any.isRequired,setAddModel:o.PropTypes.any.isRequired,dataElements:o.PropTypes.any.isRequired};var x=function(e){return n.i(s.a)({removeStageNotification:b.b,setEditModel:function(e){return n.i(b.c)(e,"PROGRAM_STAGE_NOTIFICATION")},setAddModel:b.d},e)},w=d()(n.i(i.a)(void 0,x,void 0,{pure:!1}),u()("open","setOpen",!1),u()("modelToDelete","setModelToDelete",null),f()({onCancel:function(e){var t=e.setOpen;return function(){return t(!1)}},onDelete:function(e){var t=e.setOpen,n=e.removeStageNotification,a=e.modelToDelete;return function(){t(!1),n(a)}},askForConfirmation:function(e){var t=e.setOpen,n=e.setModelToDelete;return function(e){n(e),t(!0)}}}),m()(function(e){return e.combineLatest(O,_,C,function(e,t,n,a){return S({},e,{programStages:t,notifications:n,dataElements:a})})}));t.a=w(a)},3883:function(e,t,n){"use strict";function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}n.d(t,"a",function(){return x}),n.d(t,"b",function(){return w});var s=n(0),l=n.n(s),u=n(315),c=n(206),d=n.n(c),p=n(1309),f=n(1312),h=n(442),m=n(3393),y=n(67),g=n(3372),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},b=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),T=function(e){return{model:n.i(f.g)(e)}},E=function(e){return{onUpdateField:function(t,a){e(n.i(h.a)(t,a))},handleProgramStageSelect:function(t){e(n.i(h.g)(t))}}},S=function(e){return e.map(function(e,t){return{text:e.displayName,value:e.id}})},_=function(e){function t(e){o(this,t);var n=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleProgramStage=function(e){var t=e.target.value,a=n.props.programStages.find(function(e){return e.id===t});n.setState(v({},n.state,{programStageId:t})),n.props.handleProgramStageSelect(a)},n.createProgramStageDropdown=function(){return{name:"programStage",component:y.a,props:{options:S(n.props.programStages),labelText:"Program stage",fullWidth:!0,value:n.state.programStageId,onChange:n.handleProgramStage}}},n.state={programStageId:e.model.programStage?e.model.programStage.id:null},n}return i(t,e),b(t,[{key:"render",value:function(){var e=this.props,t=e.fieldConfigs,o=e.onUpdateField,r=e.isTracker,i=e.isProgram,s=e.dataElements,u=e.attributes,c=r&&!i?[this.createProgramStageDropdown()].concat(a(t)):t,d={dataElements:s,attributes:u,isProgram:i};return l.a.createElement(p.a,{fields:c.map(n.i(m.d)(d,["messageTemplate"])),onUpdateField:o})}}]),t}(s.Component);_=d()(n.i(u.a)(T,function(e){return{onUpdateField:function(t,a){e(n.i(h.a)(t,a))},handleProgramStageSelect:function(t){e(n.i(h.g)(t))}}},void 0,{pure:!1}),n.i(m.c)("programNotificationTemplate",g.a.for("programStageNotificationTemplate")[0].fields))(_);var C=function(e){var t=e.fieldConfigs,a=void 0===t?[]:t,o=e.onUpdateField,r=e.dataElements,i=e.isTracker,s=e.isProgram,u=e.attributes,c={dataElements:r,isTracker:i,isProgram:s,attributes:u},d=a;return i||(d=d.map(function(e){if("notificationRecipient"===e.name){var t=e.props.options.filter(function(e){return"PROGRAM_ATTRIBUTE"!==e.value}),n=v({},e.props,{options:t});return v({},e,{props:v({},n)})}return e})),l.a.createElement(p.a,{fields:d.map(n.i(m.d)(c,["recipientDataElement","recipientProgramAttribute"])),onUpdateField:o})},O=n.i(u.a)(T,E,void 0,{pure:!1}),x=[{key:"what",name:"what_to_send",content:_},{key:"when",name:"when_to_send_it",content:d()(O,n.i(m.c)("programNotificationTemplate",g.a.for("programStageNotificationTemplate")[1].fields,void 0,null,!0,"programStageNotificationTemplate"))(C)},{key:"who",name:"who_to_send_it_to",content:d()(O,n.i(m.c)("programNotificationTemplate",g.a.for("programStageNotificationTemplate")[2].fields,void 0,null,!0,"programStageNotificationTemplate"))(C)}],w=[{key:"what",name:"what_to_send",content:_},{key:"when",name:"when_to_send_it",content:d()(O,n.i(m.c)("programNotificationTemplate",g.a.for("programNotificationTemplate")[1].fields))(C)},{key:"who",name:"who_to_send_it_to",content:d()(O,n.i(m.c)("programNotificationTemplate",g.a.for("programNotificationTemplate")[2].fields))(C)}]},3884:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(3718),d=n(83),p=n(731),f=n.n(p),h=n(98),m=n.n(h),y=n(3509),g=(n.n(y),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}),v=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),b=function(e){function t(e,n){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.handleOpen=function(e){var t=e.isOpen;r.setState(g({},r.state,{open:t}))},r.handleItemClick=function(e,t){r.setState(g({},r.state,{open:!1})),r.props.onAddClick(e)},r.state={items:[{id:"PROGRAM_NOTIFICATION",primaryText:n.d2.i18n.getTranslation("program_notification"),rightAvatar:s.a.createElement(f.a,{className:"material-icons",icon:s.a.createElement(m.a,null,"event")})},{id:"PROGRAM_STAGE_NOTIFICATION",primaryText:n.d2.i18n.getTranslation("program_stage_notification"),rightAvatar:s.a.createElement(f.a,{className:"material-icons",icon:s.a.createElement(m.a,null,"event_note")})}],open:!1},r}return r(t,e),v(t,[{key:"render",value:function(){var e=this;return s.a.createElement(y.SpeedDial,{hasBackdrop:!0,isOpen:this.state.open,onChange:this.handleOpen},s.a.createElement(y.BubbleList,null,this.state.items.map(function(t,n){return s.a.createElement(y.BubbleListItem,g({key:t.id},t,{onClick:e.handleItemClick.bind(e,t.id)}))})))}}]),t}(s.a.Component);b.propTypes={onAddClick:u.a.func.isRequired};var T=n.i(c.b)(n.i(d.a)(b));t.a=T},3885:function(e,t,n){"use strict";function a(e,t){var n={};for(var a in e)t.indexOf(a)>=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}var o=n(0),r=n.n(o),i=n(1),s=n.n(i),l=n(1335),u=(n.n(l),n(315)),c=n(201),d=n(15),p=(n.n(d),n(251)),f=n.n(p),h=n(206),m=n.n(h),y=n(725),g=n.n(y),v=n(722),b=n.n(v),T=n(3718),E=n(1312),S=n(3777),_=n(442),C=n(3778),O=n(318),x=n(249),w=n(3884),k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},P=O.a.map(E.c),A=O.a.map(n.i(d.get)("programStageNotifications")),D=O.a.map(E.h).map(function(e){return e.toArray()}),R=O.a.map(n.i(d.get)("availableDataElements")),I=function(e,t){var o=t.d2,i=e.programStages,s=e.programStageNotifications,u=e.programNotifications,c=e.askForConfirmation,p=e.onCancel,f=e.onDelete,h=e.open,m=e.setOpen,y=e.modelToDelete,g=e.setEditProgramModel,v=e.setEditProgramStageModel,b=e.setAddModel,E=e.availableDataElements,_=e.model,O=a(e,["programStages","programStageNotifications","programNotifications","askForConfirmation","onCancel","onDelete","open","setOpen","modelToDelete","setEditProgramModel","setEditProgramStageModel","setAddModel","availableDataElements","model"]),x=[];for(var k in s)!function(e){var t=s[e],a=O.getProgramStageById(e),o=n.i(d.pick)(["displayName","id"],a);t.forEach(function(e){e.programStage=o,x.push(e)})}(k);return r.a.createElement("div",null,r.a.createElement(l.Tabs,{initialSelectedIndex:0},r.a.createElement(l.Tab,{label:o.i18n.getTranslation("program_stage_notifications")},r.a.createElement(T.a,{showProgramStage:!0,notifications:x,onRemoveNotification:c,onEditNotification:v,onAddNotification:b,showAddButton:!0,addButton:w.a})),r.a.createElement(l.Tab,{label:o.i18n.getTranslation("program_notifications")},r.a.createElement(T.a,{notifications:u,onRemoveNotification:c,onEditNotification:g,onAddNotification:b,showAddButton:!1}))),r.a.createElement(C.a,{availableDataElements:E,isTracker:!0,program:_,programStages:i}),r.a.createElement(S.a,{setOpen:m,open:h,onCancel:p,onConfirm:f,name:y&&y.name}))};I.propTypes={programStageNotifications:s.a.any.isRequired,programNotifications:s.a.any.isRequired,askForConfirmation:s.a.any.isRequired,onCancel:s.a.any.isRequired,onDelete:s.a.any.isRequired,open:s.a.any.isRequired,setOpen:s.a.any.isRequired,modelToDelete:s.a.any,setEditProgramStageModel:s.a.func.isRequired,setEditProgramModel:s.a.func.isRequired,setAddModel:s.a.any.isRequired},I.contextTypes={d2:s.a.object};var F=function(e){return n.i(c.a)({removeStageNotification:_.b,removeProgramNotification:_.h,setEditProgramStageModel:function(e){return n.i(_.c)(e,"PROGRAM_STAGE_NOTIFICATION")},setEditProgramModel:function(e){return n.i(_.c)(e,"PROGRAM_NOTIFICATION")},setAddModel:_.d},e)},N=m()(n.i(u.a)(function(e){return{}},F,void 0,{pure:!1}),f()("open","setOpen",!1),f()("modelToDelete","setModelToDelete",null),g()({onCancel:function(e){var t=e.setOpen;return function(){return t(!1)}},onDelete:function(e){var t=e.setOpen,n=e.removeStageNotification,a=e.removeProgramNotification,o=e.modelToDelete;return function(){t(!1),o.programStage?n(o):a(o)}},askForConfirmation:function(e){var t=e.setOpen,n=e.setModelToDelete;return function(e){n(e),t(!0)}}}),b()(function(e){return e.combineLatest(P,A,D,R,O.a,function(e,t,a,o,r,i){return k({},e,{programStages:t,programStageNotifications:a,programNotifications:o,availableDataElements:r,getProgramStageById:n.i(x.d)(i)})})}));t.a=N(I)},3886:function(e,t,n){"use strict";function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var s=n(0),l=n.n(s),u=n(1),c=n.n(u),d=n(327),p=n.n(d),f=n(117),h=n.n(f),m=n(4083),y=n.n(m),g=n(4081),v=n.n(g),b=n(293),T=n(74),E=n.n(T),S=n(133),_=n.n(S),C=n(3395),O=n(315),x=n(201),w=n(438),k=n(321),P=n(3887),A=n(3888),D=n(113),R=(n.n(D),n(3495)),I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},F={container:{paddingTop:32,display:"flex",flexDirection:"column"},vertical:{display:"flex",flexDirection:"column",justifyContent:"space-between"},horizontal:{display:"flex",flexDirection:"row",justifyContent:"space-between"},programHeading:{padding:"5px 0px"},accessDescription:{color:"#aaa",fontWeight:400,overflow:"hidden"},programStageList:{width:"100%",display:"flex",flexDirection:"row"},warningIcon:{top:"22px",height:"32px",width:"32px"},stageSharingItem:{height:"80px"}},N=function(e){function t(e){o(this,t);var a=r(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));M.call(a);var i=a.props.model.dataValues,s=Array.from(a.props.model.dataValues.programStages.valuesContainerMap).map(function(e){return e[1]}),l=[];return s.forEach(function(e){n.i(A.a)(i,e)&&l.push(e.id)}),a.state={sharingDialogOpen:!1,stagesSharing:s,programSharing:i,selectedStages:l},a}return i(t,e),t}(l.a.Component),M=function(){var e=this;this.translate=function(t){return e.context.d2.i18n.getTranslation(t)},this.toggleStageSelection=function(t){return function(n,o){e.setState({selectedStages:o?[].concat(a(e.state.selectedStages),[t]):e.state.selectedStages.filter(function(e){return e!==t})})}},this.selectSimilarStages=function(){var t=[];e.state.stagesSharing.forEach(function(a){n.i(A.a)(a,e.state.programSharing)&&t.push(a.id)}),e.setState({selectedStages:t})},this.selectAllStages=function(){e.setState({selectedStages:e.state.stagesSharing.map(function(e){return e.id})})},this.deselectAllStages=function(){e.setState({selectedStages:[]})},this.openSharingDialog=function(t,a){var o=n.i(R.a)(t.sharing),r={meta:{allowPublicAccess:!0,allowExternalAccess:!1},object:{user:t.user,displayName:t.displayName||t.name,userAccesses:o.userAccesses,userGroupAccesses:o.userGroupAccesses,publicAccess:o.publicAccess,externalAccess:o.externalAccess}};e.setState({sharingDialogOpen:!0,sharingType:a,sharingId:t.id,objectToShare:r})},this.closeSharingDialog=function(){e.setState({sharingDialogOpen:!1})},this.confirmAndCloseSharingDialog=function(t){var a=n.i(R.b)(t);t.id===e.state.programSharing.id?e.updateProgramAccess(t,a):e.updateStageAccess(t,a),e.closeSharingDialog()},this.updateProgramAccess=function(t,n){e.storeProgramChanges(n);var a={id:t.id,sharing:n};e.setState({programSharing:a})},this.updateStageAccess=function(t,n){e.storeStageChanges(t.id,n),e.setState({stagesSharing:e.state.stagesSharing.map(function(e){return t.id===e.id?I({},e,{sharing:n}):e})})},this.storeProgramChanges=function(t){e.props.editFieldChanged("sharing",t)},this.storeStageChanges=function(t,n){e.props.editProgramStageField(t,"sharing",n)},this.propagateAccess=function(t){t.stopPropagation();var n=function(t){var n=e.state.programSharing.sharing;return e.state.selectedStages.includes(t.id)?(e.storeStageChanges(t.id,n),{sharing:n,id:t.id,displayName:t.displayName||t.name}):t},a=e.state.stagesSharing.map(n);e.setState({stagesSharing:a})},this.render=function(){var t=e.state.stagesSharing.filter(function(t){return n.i(A.a)(e.state.programSharing,t)}).map(function(e){return e.id}),a=e.state.stagesSharing.map(function(a){var o=t.includes(a.id)?l.a.createElement("div",null):l.a.createElement(_.a,{style:{pointer:"default"},tooltip:e.translate("differs_from_program")},l.a.createElement(v.a,{style:F.warningIcon,color:D.yellow800}));return l.a.createElement(p.a,{style:F.stageSharingItem,onClick:function(){return e.openSharingDialog(a,"programStage")},leftAvatar:o,key:a.id,primaryText:a.displayName||a.name,secondaryText:n.i(A.b)(a)})}),o=e.state.stagesSharing.map(function(t){return l.a.createElement(b.Checkbox,{key:t.id,style:{height:"80px",paddingTop:"24px",paddingLeft:"32px"},onCheck:e.toggleStageSelection(t.id),checked:e.state.selectedStages.includes(t.id)})});return l.a.createElement("div",{style:F.container},l.a.createElement(p.a,{onClick:function(){return e.openSharingDialog(e.props.model,"program")},primaryText:e.props.model.displayName||e.props.model.name,secondaryText:n.i(A.b)(e.state.programSharing),rightIconButton:l.a.createElement(E.a,{primary:!0,disabled:0===e.state.selectedStages.length,style:{height:45},icon:l.a.createElement(y.a,null),label:e.translate("apply_to_selected_stages"),labelPosition:"before",onClick:e.propagateAccess})}),l.a.createElement(h.a,null),l.a.createElement(P.a,{selectAll:e.selectAllStages,deselectAll:e.deselectAllStages,selectSimilar:e.selectSimilarStages,areNoneSelected:0===e.state.selectedStages.length,areAllSelected:e.state.selectedStages.length===e.state.stagesSharing.length}),0!==e.state.stagesSharing.length&&l.a.createElement("div",{style:F.programStageList},l.a.createElement("div",{style:{flex:1}},a),l.a.createElement("div",null,o)),l.a.createElement(C.a,{doNotPost:!0,sharedObject:e.state.objectToShare,open:e.state.sharingDialogOpen,id:e.state.sharingId,type:e.state.sharingType,onRequestClose:e.closeSharingDialog,onConfirm:e.confirmAndCloseSharingDialog,d2:e.context.d2}))}};N.contextTypes={d2:c.a.object};var j=function(){return{}},L=function(e){return n.i(x.a)({editFieldChanged:w.e,editProgramStageField:k.a},e)};t.a=n.i(O.a)(j,L)(N)},3887:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(1),i=n.n(r),s=n(74),l=n.n(s),u=n(4077),c=n.n(u),d=n(4078),p=n.n(d),f=n(4082),h=n.n(f),m=function(e,t){var n=e.selectAll,a=e.selectSimilar,r=e.deselectAll,i=e.areAllSelected,s=e.areNoneSelected,u=t.d2,d=function(e){return u.i18n.getTranslation(e)};return o.a.createElement("div",{style:{alignSelf:"flex-end",height:60,display:"flex",flexDirection:"row",alignItems:"center"}},o.a.createElement(l.a,{primary:!0,labelPosition:"before",disabled:s,style:{height:45},icon:o.a.createElement(h.a,null),label:d("deselect_all"),onClick:r}),o.a.createElement(l.a,{primary:!0,labelPosition:"before",style:{height:45},icon:o.a.createElement(p.a,null),label:d("select_similar"),onClick:a}),o.a.createElement(l.a,{primary:!0,labelPosition:"before",disabled:i,style:{height:45},icon:o.a.createElement(c.a,null),label:d("select_all"),onClick:n}))};m.contextTypes={d2:i.a.object},t.a=m},3888:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return s});var a=n(15),o=(n.n(a),function(e){return e?Object.values(e).sort(function(e,t){return e.id<t.id}):e}),r=function(e,t){var r=e.sharing,i=t.sharing;return!(!r||!i||r.public!==i.public)&&(!!r.externalAccess==!!i.externalAccess&&(!!n.i(a.isEqual)(o(r.users),o(i.users))&&n.i(a.isEqual)(o(r.userGroups),o(i.userGroups))))},i=function(e){if(!e||"----"===e.substr(0,4))return"No public access";if("rwrw"===e.substr(0,4))return"Complete public access";var t="";switch(e.substr(0,2)){case"rw":t+="Public metadata read- and write access";break;case"r-":t+="Public metadata read access";break;default:t+="No public metadata access"}switch(t=t+=", ",e.substr(2,2)){case"rw":return t+"public data read- and write access";case"r-":return t+"public data read access";default:return t+"no public data access"}},s=function(e){var t=e.sharing,n=t||{},a=n.public,o=n.users,r=n.userGroups,s=i(a),l=r?Object.keys(r).length:0,u=o?Object.keys(o).length:0,c=s;if(u||l){if(c+=", accessible to ",u){c+=u+" user"+(u>1?"s":"")}if(l){u&&(c+=" and ");c+=l+" user group"+(l>1?"s":"")}}return c}},3889:function(e,t,n){"use strict";function a(e){var t=e.params.modelType||"program",a=e.params.groupName;return r.a.createElement("div",null,r.a.createElement("div",{style:T.heading},r.a.createElement(l.a,{schema:t,groupName:a,isDirtyHandler:E},"tracker_"+n.i(s.camelCaseToUnderscores)(t)),r.a.createElement(u.a,null,e.model.displayName)),r.a.createElement("div",null,r.a.createElement(c.a,null)),r.a.createElement(d.a,y({schema:t},e)),!e.isProgramStageStepperActive&&r.a.createElement(b,null,r.a.createElement(f.a,{groupName:a,schema:t,isDirtyHandler:E})))}var o=n(0),r=n.n(o),i=n(1),s=(n.n(i),n(724)),l=(n.n(s),n(3392)),u=n(3686),c=n(3891),d=n(3892),p=n(318),f=n(3770),h=n(438),m=n(3355),y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},g=n.i(m.c)(h.g),v=n.i(m.d)(h.h),b=n.i(m.e)(v,g),T={heading:{display:"flex",flexDirection:"column",marginBottom:"1rem"}},E=function(){return{dirty:n.i(p.b)(p.a.getState())}};a.propTypes={params:i.PropTypes.object.isRequired,isProgramStageStepperActive:i.PropTypes.bool,model:i.PropTypes.object.isRequired},a.defaultProps={isProgramStageStepperActive:!1},t.a=a},3890:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(315),i=n(201),s=n(15),l=(n.n(s),n(3393)),u=n(3687),c=n(318),d=n(1306),p=n(438),f=c.a.map(n.i(s.get)("program")),h=d.a.for("enrollment"),m=function(e){return n.i(i.a)({editFieldChanged:p.e},e)},y=n.i(s.compose)(u.b,n.i(r.a)(null,m)),g=y(n.i(l.e)(f,"program",h,!1,"enrollment")),v=function(e){return o.a.createElement("div",null,o.a.createElement(g,e))};t.a=n.i(u.a)(v)},3891:function(e,t,n){"use strict";var a=n(201),o=n(315),r=n(3355),i=n(3510),s=n(1341),l=n(438),u=function(e){return{activeStep:n.i(i.b)(e),disabled:n.i(i.c)(e)}},c=function(e){return n.i(a.a)({stepperClicked:l.f},e)},d=n.i(o.a)(u,c)(n.i(r.g)(s.a));t.a=d},3892:function(e,t,n){"use strict";var a=n(315),o=n(201),r=n(722),i=n.n(r),s=n(15),l=(n.n(s),n(3355)),u=n(3510),c=n(318),d=n(1341),p=n(3717),f=n(3779),h=n(3885),m=n(3393),y=n(438),g=n(3687),v=n(1306),b=n(3893),T=n(3898),E=n(3890),S=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},_=function(e){return{activeStep:n.i(u.b)(e)}},C=n.i(s.compose)(n.i(a.a)(_),i()(function(e){return e.combineLatest(c.a,function(e,t){var n=t.program;return S({},e,{modelToEdit:n})})}))(n.i(l.f)(function(){var e=c.a.map(n.i(s.get)("program")),t=function(e){return n.i(o.a)({editFieldChanged:y.e},e)},r=n.i(s.compose)(g.b,n.i(a.a)(null,t)),i=v.a.for("trackerProgram"),l={EditProgramDetailsForm:r(n.i(g.a)(n.i(m.e)(e,"program",i,!0,"trackerProgram"))),Enrollment:E.a,AttributesStepper:b.a,ProgramStage:T.a,EditDataEntryForm:p.a,ProgramAccess:f.a,TrackerProgramNotifications:h.a};return d.a.map(function(e){return e.component=l[e.componentName],e})}()));t.a=C},3893:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=(n.n(l),n(3355)),c=n(3780),d=n(3894),p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},f=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),h=[{key:"assign_attributes",name:"assign_attributes",componentName:"AssignAttributes"},{key:"create_registration_form",name:"create_registration_form",componentName:"CreateEnrollmentDataEntryForm"}],m=n.i(u.g)(function(){var e={AssignAttributes:c.a,CreateEnrollmentDataEntryForm:d.a};return h.map(function(t){return t.component=e[t.componentName],t.content=e[t.componentName],t})}(),"vertical"),y=n.i(c.b)(m),g=function(e){function t(e){a(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.changeStep=function(e){n.setState({activeStep:e})},n.state={activeStep:0},n}return r(t,e),f(t,[{key:"render",value:function(){return s.a.createElement(y,p({},this.props,{activeStep:this.state.activeStep,stepperClicked:this.changeStep}))}}]),t}(s.a.Component);t.a=g},3894:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(315),u=n(1335),c=(n.n(u),n(317)),d=n.n(c),p=n(201),f=n(439),h=(n.n(f),n(3773)),m=n(3881),y=n(722),g=n.n(y),v=n(444),b=n.n(v),T=n(15),E=(n.n(T),n(725)),S=n.n(E),_=n(318),C=n(1348),O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},x=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),w={section:0,custom:1},k={tabContent:{padding:"3rem"},helpText:{color:"gray",marginBottom:"2rem"}},P=function(e){function t(e){a(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));r.onTabChange=function(e,t,n){var a=n.props.index;r.setState({curTab:a})},r.programDataElementOrderChanged=function(e){var t=e.oldIndex,a=e.newIndex;r.props.onChangeDefaultOrder(n.i(f.arrayMove)(r.props.availableAttributes.map(function(e){return e.id}),t,a))},r.renderTab=function(e,t){return s.a.createElement(u.Tab,{style:k.tab,label:e},s.a.createElement("div",{style:k.tabContent},s.a.createElement(A,null),t))},r.getTranslation=function(e){return r.context.d2.i18n.getTranslation(e)};var i=e.model&&e.model.dataEntryForm;return r.state={curTab:i?w.custom:w.section},r}return r(t,e),x(t,[{key:"render",value:function(){return s.a.createElement(d.a,{style:{marginTop:"15px"}},s.a.createElement(u.Tabs,{initialSelectedIndex:this.state.curTab,onChange:this.onTabChange},this.renderTab(this.getTranslation("section"),s.a.createElement(h.a,{availableElements:this.props.assignedAttributes,sections:this.props.programSections,onSectionUpdated:this.props.onSectionUpdated,onSectionOrderChanged:this.props.onSectionOrderChanged,onSectionAdded:this.props.onSectionAdded,onSectionRemoved:this.props.onSectionRemoved,elementPath:"trackedEntityAttributes"})),this.renderTab(this.getTranslation("custom"),s.a.createElement(m.a,{isActive:this.state.curTab===w.custom,programStage:this.props.programStage}))))}}]),t}(i.Component);P.contextTypes={d2:i.PropTypes.object};var A=function(e,t){var n=t.d2;return s.a.createElement("div",{style:k.helpText},n.i18n.getTranslation("program_forms_help_text"))};A.contextTypes={d2:i.PropTypes.object},P.propTypes={onSectionOrderChanged:i.PropTypes.func.isRequired,onSectionUpdated:i.PropTypes.func.isRequired,onSectionAdded:i.PropTypes.func.isRequired,onSectionRemoved:i.PropTypes.func.isRequired,programSections:i.PropTypes.arrayOf(i.PropTypes.shape({id:i.PropTypes.string.isRequired,sortOrder:i.PropTypes.number.isRequired,displayName:i.PropTypes.string.isRequired,attributes:i.PropTypes.arrayOf(i.PropTypes.shape({id:i.PropTypes.string.isRequired,displayName:i.PropTypes.string.isRequired})).isRequired})).isRequired};var D=function(e){return n.i(p.a)({changeProgramSectionOrder:C.a,addProgramSection:C.b,removeProgramSection:C.c,updateProgramSection:C.d},e)},R=_.a.map(n.i(T.getOr)([],"programSections")),I=n.i(T.compose)(n.i(l.a)(null,D),g()(function(e){return e.combineLatest(R,function(e,t){return O({},e,{programSections:t})})}),b()(function(e){var t=e.assignedAttributes,n=e.programSections;return{assignedAttributes:t.map(function(e){return O({},e.trackedEntityAttribute,{sortOrder:e.sortOrder})}),programSections:n.map(function(e){return e.trackedEntityAttributes=Array.from(e.trackedEntityAttributes.values()),e})}}),S()({onSectionUpdated:function(e){var t=e.updateProgramSection;return function(e,n){t({programSectionId:e,newProgramSectionData:n})}},onSectionOrderChanged:function(e){var t=e.changeProgramSectionOrder;return function(e){t({programSections:e})}},onSectionAdded:function(e){var t=e.addProgramSection;return function(e){t({newSectionData:e})}},onSectionRemoved:function(e){var t=e.removeProgramSection;return function(e){t({programSection:e})}}}));t.a=I(P)},3895:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(3771),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e};t.a=function(e){return e.programStage$&&o.a.createElement(r.a,i({outerDivStyle:{marginTop:"15px"}},e,{programStage$:e.programStage$}))}},3896:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(1),i=n.n(r),s=n(315),l=n(201),u=n(250),c=n(18),d=(n.n(c),n(3719)),p=n(438),f=n(321),h=n(3900),m=n(3397),y=n(3488),g=function(e,t){var n={buttons:{padding:"2rem 1rem 1rem",marginLeft:"10px"}};return o.a.createElement("div",null,o.a.createElement(h.a,{programStage$:e.programStage$,programStage:e.programStage}),o.a.createElement("div",{style:n.buttons},e.isEditing&&o.a.createElement("div",{style:{padding:"10px 0",fontWeight:"bold"}},t.d2.i18n.getTranslation("stage_save_hint_text")),o.a.createElement("div",null,o.a.createElement(m.a,{onClick:e.saveProgramStageEdit,label:t.d2.i18n.getTranslation(e.isEditing?"stage_update":"stage_add")}),o.a.createElement(y.a,{onClick:e.cancelProgramStageEdit,style:{marginLeft:"1rem"}}))))};g.contextTypes={d2:i.a.object},t.a=n.i(u.b)(n.i(s.a)(null,function(e){return n.i(l.a)({changeStepperDisabledState:p.i,saveProgramStageEdit:f.f,cancelProgramStageEdit:f.g,editProgramStageReset:f.h},e)}),n.i(u.g)({componentWillMount:function(){this.props.changeStepperDisabledState(!0)},componentWillUnmount:function(){this.props.changeStepperDisabledState(!1),this.props.editProgramStageReset()},shouldComponentUpdate:function(e){return!(e.programStage!==this.props.programStage||!this.props.programStage&&!e.programStage)&&e!==this.props}}),d.e)(g)},3897:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(1),i=(n.n(r),n(201)),s=n(315),l=n(41),u=n.n(l),c=n(321),d=n(1306),p=n(3687),f=n(3393),h=d.a.for("programStage"),m=function(e){var t=n.i(s.a)(null,function(t){return n.i(i.a)({editFieldChanged:function(t,a){return n.i(c.a)(e.programStage.id,t,a)}},t)}),a=u()(t(n.i(p.c)(n.i(f.e)(e.programStage$,"programStage",h))));return o.a.createElement(a,e)};m.propTypes={programStage$:r.PropTypes.object.isRequired},t.a=m},3898:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=(n.n(l),n(315)),c=n(250),d=n(3899),p=n(3896),f=n(321),h=n(3719),m=n(249),y=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),g=function(e){function t(){return a(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return r(t,e),y(t,[{key:"shouldComponentUpdate",value:function(e){return e.programStage===this.props.programStage}},{key:"render",value:function(){var e=this.props,t="add"!==e.currentProgramStageId&&n.i(h.b)(e.currentProgramStageId).defaultIfEmpty(h.c);return s.a.createElement("div",null,this.props.currentProgramStageId?s.a.createElement(p.a,{programStage$:t,isEditing:e.isEditing}):s.a.createElement(d.a,{program:e.program,programStages:e.programStages}))}}]),t}(i.Component),v=function(e){return{currentProgramStageId:n.i(m.e)(e),isEditing:n.i(m.f)(e)}},b=function(e){return{editProgramStage:function(t){e(n.i(f.b)(t))}}};g.propTypes={programStage:l.PropTypes.object,currentProgramStageId:l.PropTypes.string},g.defaultProps={currentProgramStageId:"",programStage:{}},t.a=n.i(c.b)(n.i(u.a)(v,b),h.d)(g)},3899:function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var i=n(0),s=n.n(i),l=n(1),u=n.n(l),c=n(315),d=n(201),p=n(1311),f=n(3395),h=n(3358),m=n(1313),y=n.n(m),g=n(723),v=n.n(g),b=n(3496),T=n(253),E=n(3303),S=n(1349),_=n(321),C=n(3356),O=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},x=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),w={fab:{textAlign:"right",marginTop:"1rem",bottom:"1.5rem",right:"1.5rem",position:"fixed",zIndex:10},detailsBox:{flex:1,marginLeft:"1rem",marginRight:"1rem",opacity:1,flexGrow:0,paddingLeft:"1rem"},detailsBoxWrap:{paddingLeft:"1rem"},listWrap:{flex:1,display:"flex",flexOrientation:"row"},sharingDialogBody:{minHeight:"400px"}},k=function(e){function t(){var e,r,i,l;a(this,t);for(var u=arguments.length,c=Array(u),d=0;d<u;d++)c[d]=arguments[d];return r=i=o(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(c))),i.state={stages:i.props.programStages,modelType:"programStage",detailsObject:null,sharing:{id:null},translate:{model:null},tableColumns:n.i(T.c)("programStage")},i.openSharing=function(e){i.setState(O({},i.state,{sharing:O({},i.state.sharing,{id:e.id})}))},i.closeSharing=function(){i.setState(O({},i.state,{sharing:O({},i.state.sharing,{id:null})}))},i.openDetails=function(e){return i.setState({detailsObject:e})},i.closeDetails=function(){return i.setState({detailsObject:null})},i.openTranslate=function(e){i.setState(O({},i.state,{translate:O({},i.state.translate,{model:e})}))},i.handleOnRequestClose=function(){i.setState(O({},i.state,{translate:O({},i.state.translate,{model:null})}))},i.swapStages=function(e,t){i.setState(function(n){var a=e.sortOrder;return e.sortOrder=t.sortOrder,t.sortOrder=a,{sections:n.stages.sort(function(e,t){return e.sortOrder-t.sortOrder})}})},i.contextActionChecker=function(e,t){return"move_up"===t?i.state.stages.indexOf(e)>0:"move_down"!==t||i.state.stages.indexOf(e)<i.state.stages.length-1},i.moveStageUp=function(e){var t=i.state.stages.indexOf(e);if(t>0){var n=i.state.stages[t-1];i.swapStages(n,e)}},i.moveStageDown=function(e){var t=i.state.stages.indexOf(e);if(t<i.state.stages.length-1){var n=i.state.stages[t+1];i.swapStages(n,e)}},i.renderSharing=function(){return!!i.state.sharing.id&&s.a.createElement(f.a,{id:i.state.sharing.id,type:i.state.modelType,open:!!i.state.sharing.id,onRequestClose:i.closeSharing,bodyStyle:w.sharingDialogBody,d2:i.context.d2})},i.renderTranslate=function(){return!!i.state.translate.model&&s.a.createElement(h.a,{objectToTranslate:i.state.translate.model,objectTypeToTranslate:i.state.translate.model.modelDefinition,open:!!i.state.translate.model,onTranslationSaved:S.a,onTranslationError:S.b,onRequestClose:i.handleOnRequestClose,fieldsToTranslate:n.i(E.getTranslatablePropertiesForModelType)(i.state.modelType)})},i.renderDetails=function(){return!!i.state.detailsObject&&s.a.createElement("div",{style:w.detailsBoxWrap},s.a.createElement(b.a,{detailsObject:i.state.detailsObject,onClose:i.closeDetails,styles:w.detailsBox}))},i.renderFAB=function(){return i.props.getCurrentUser().canCreate(i.props.getModelDefinitionByName("programStage"))?s.a.createElement("div",{style:w.fab},s.a.createElement(y.a,{onClick:i.props.handleNewProgramStage},s.a.createElement(v.a,{className:"material-icons"},"add"))):null},l=r,o(i,l)}return r(t,e),x(t,[{key:"componentWillReceiveProps",value:function(e){this.state.stages!==e.programStages&&this.props.programStages!==e.programStages&&this.setState(O({},this.state,{stages:e.programStages}))}},{key:"render",value:function(){var e={edit:this.props.handleEditProgramStage,share:this.openSharing,delete:this.props.handleDeleteProgramStage,details:this.openDetails,translate:this.openTranslate,move_up:this.moveStageUp,move_down:this.moveStageDown},t={edit:"edit",share:"share",move_up:"arrow_upward",move_down:"arrow_downward"};return s.a.createElement("div",{style:w.listWrap},s.a.createElement(p.a,{rows:this.state.stages,columns:this.props.tableColumns,primaryAction:this.props.handleEditProgramStage,contextMenuActions:e,contextMenuIcons:t,isContextActionAllowed:this.contextActionChecker}),this.renderDetails(),this.renderSharing(),this.renderTranslate(),this.renderFAB())}}]),t}(i.Component);k.propTypes={programStages:u.a.array.isRequired,tableColumns:u.a.array,handleNewProgramStage:u.a.func.isRequired,handleEditProgramStage:u.a.func.isRequired,handleDeleteProgramStage:u.a.func.isRequired,getCurrentUser:u.a.func.isRequired,getModelDefinitionByName:u.a.func.isRequired},k.defaultProps={tableColumns:["name","lastUpdated"]},k.contextTypes={d2:u.a.object.isRequired},t.a=n.i(c.a)(null,function(e){return n.i(d.a)({handleEditProgramStage:function(e){return n.i(_.b)(e.id)},handleNewProgramStage:function(){return n.i(_.c)()},handleDeleteProgramStage:function(e){return n.i(_.d)(e.id)}},e)})(n.i(C.b)(k))},3900:function(e,t,n){"use strict";var a=n(0),o=n.n(a),r=n(1),i=n.n(r),s=n(315),l=n(41),u=n.n(l),c=n(201),d=n(1350),p=n(321),f=n(3355),h=n(3897),m=n(3895),y=n(3717),g=n(249),v=function(e){return o.a.createElement("div",{style:{marginTop:"15px"}},o.a.createElement(y.a,e))},b=n.i(s.a)(function(e){return{activeStep:n.i(g.g)(e)}},function(e){return n.i(c.a)({stepperClicked:p.i},e)})(n.i(f.g)(function(){var e={EditProgramStageDetails:h.a,AssignProgramStageDataElements:m.a,CreateDataEntryForm:v};return d.a.map(function(t){return t.component=e[t.componentName],t.content=e[t.componentName],t})}(),"vertical")),T=u()(function(e){return o.a.createElement("div",null,o.a.createElement(b,{programStage$:e.programStage$,programStage:e.programStage}))});T.propTypes={programStage$:i.a.object.isRequired,programStage:i.a.object},t.a=T},3913:function(e,t,n){"use strict";n.d(t,"a",function(){return u});var a=n(0),o=n.n(a),r=n(250),i=n(84),s=function(){return null},l=n.i(r.g)({componentDidMount:function(){i.a.show(this.props.snackAction)}})(s),u=function(e,t){return n.i(r.e)(e,function(e){return function(e){return o.a.createElement(l,{snackAction:t})}})}},3916:function(e,t,n){t=e.exports=n(452)(!1),t.push([e.i,'.programStageEditForm {\n display: flex;\n box-sizing: border-box;\n}\n.programStageEditForm .left {\n width: auto;\n}\n.programStageEditForm .right {\n width: 30%;\n min-width: 300px;\n}\n.programStageEditForm .paletteContainer:hover .resizeHandle:after {\n border-color: rgba(0, 0, 0, 0.12);\n}\n.programStageEditForm .paletteContainer .resizeHandle {\n position: absolute;\n top: -20px;\n right: 0;\n bottom: -16px;\n left: -8px;\n width: 12px;\n cursor: col-resize;\n}\n.programStageEditForm .paletteContainer .resizeHandle:after {\n content: "";\n display: block;\n position: absolute;\n bottom: 0;\n top: 0;\n border: 0 dashed rgba(0, 0, 0, 0);\n border-left-width: 1px;\n margin-left: 5px;\n transition: border 125ms linear;\n}\n.programStageEditForm .paletteContainer .resizeHandle:hover:after {\n border-color: rgba(0, 0, 0, 0.45);\n}\n.programStageEditForm .paletteContainer .palette {\n padding-left: 1rem;\n}\n.programStageEditForm .paletteContainer .palette .elements {\n padding: 0 8px 8px;\n font-size: 13px;\n font-weight: 300;\n display: flex;\n flex-direction: column;\n overflow-x: auto;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell {\n position: relative;\n flex: 1 1;\n transition: all 175ms ease-in-out;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell.expanded {\n flex: 1;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell.expanded .header .arrow {\n transform: rotate(90deg);\n}\n.programStageEditForm .paletteContainer .palette .elements .cell.expanded .items {\n height: 100%;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell .header {\n font-weight: 700;\n font-size: 16px;\n padding-top: 8px;\n cursor: pointer;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell .header .arrow {\n display: inline-block;\n margin: 0 2px;\n transition: transform 175ms ease-out;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell .header .count {\n display: inline-block;\n font-weight: 400;\n font-size: 14px;\n margin-left: 4px;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell .items {\n transition: height 175ms ease-in-out;\n height: 0;\n max-height: 500px;\n position: relative;\n padding-left: 16px;\n overflow: auto;\n}\n.programStageEditForm .paletteContainer .palette .elements .cell .items .item {\n padding-bottom: 1px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.programStageEditForm .item.active a,\n.programStageEditForm .expand a {\n cursor: pointer;\n}\n.programStageEditForm .item.active a:hover,\n.programStageEditForm .expand a:hover {\n text-decoration: underline;\n}\n.programStageEditForm .item.inactive a {\n color: inherit;\n opacity: 0.5;\n cursor: default;\n}',""])},4077:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M18 7l-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41L6 19l1.41-1.41L1.83 12 .41 13.41z"}))};c=(0,s.default)(c),c.displayName="ActionDoneAll",c.muiName="SvgIcon",t.default=c},4078:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}))};c=(0,s.default)(c),c.displayName="ActionDone",c.muiName="SvgIcon",t.default=c},4079:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"}))};c=(0,s.default)(c),c.displayName="ActionVisibilityOff",c.muiName="SvgIcon",t.default=c},4080:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"}))};c=(0,s.default)(c),c.displayName="ActionVisibility",c.muiName="SvgIcon",t.default=c},4081:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}))};c=(0,s.default)(c),c.displayName="AlertWarning",c.muiName="SvgIcon",t.default=c},4082:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))};c=(0,s.default)(c),c.displayName="ContentClear",c.muiName="SvgIcon",t.default=c},4083:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),r=a(o),i=n(41),s=a(i),l=n(42),u=a(l),c=function(e){return r.default.createElement(u.default,e,r.default.createElement("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}))};c=(0,s.default)(c),c.displayName="NavigationArrowDownward",c.muiName="SvgIcon",t.default=c}});
//# sourceMappingURL=5-fd5ef347026a0fd2f506.js.map