/*! For license information please see dll.Revealer.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[97],{1118:function(e,t,n){"use strict";n.r(t);var o=n(13),a=n.n(o),r=n(12),s=n.n(r),l=n(6),i=n.n(l),c=n(14),h=n.n(c),u=n(15),d=n.n(u),p=n(8),f=n.n(p),C=n(5),m=n.n(C),v=n(0),w=n.n(v),E=n(25),g=n.n(E),y=n(1),T=n.n(y),N=n(24),R=n(87),b=n.n(R),_=n(105),O=n(141),S=n(27),k=n(20),x=n(18),D=n(73);function H(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,o=f()(e);if(t){var a=f()(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return d()(this,n)}}var P=g()("isle:revealer"),I=Object(S.default)("revealer"),A=function(e){h()(n,e);var t=H(n);function n(e){var o;return a()(this,n),o=t.call(this,e),m()(i()(o),"toggleContent",(function(){o.setState({showChildren:!o.state.showChildren},(function(){var e=o.context;o.state.showChildren?e.log({id:o.id,type:x.REVEAL_CONTENT,value:o.state.selectedCohort},"members"):e.log({id:o.id,type:x.HIDE_CONTENT,value:o.state.selectedCohort},"members")}))})),m()(i()(o),"handleCohortChange",(function(e){var t=e.target.value;(t!==o.state.selectedCohort||"all"===t&&b()(o.state.selectedCohort))&&(P("Handle cohort change: "+t),o.setState({selectedCohort:"all"===t?null:t}))})),m()(i()(o),"stopPropagation",(function(e){e.stopPropagation()})),o.id=e.id||I(e),o.state={showChildren:e.show,selectedCohort:null,showProp:e.show},o}return s()(n,[{key:"componentDidMount",value:function(){var e=this;P("Component did mount...");var t=this.context;t&&(this.unsubscribe=t.subscribe((function(n,o){if(n===D.RETRIEVED_COHORTS)e.forceUpdate();else if(n===D.MEMBER_ACTION){if(o.id===e.id){var a=o.value;P("Received action for cohort ".concat(a,": ")),(!a||t.cohort&&t.cohort===a)&&(o.type===x.REVEAL_CONTENT?(P("Reveal content..."),e.setState({showChildren:!0})):o.type===x.HIDE_CONTENT&&(P("Hide content..."),e.setState({showChildren:!1}))),e.state.selectedCohort===a&&(o.type===x.REVEAL_CONTENT?(P("Reveal content..."),e.setState({showChildren:!0})):o.type===x.HIDE_CONTENT&&(P("Hide content..."),e.setState({showChildren:!1})))}}else if(n===D.USER_JOINED&&t.user.email!==o.email&&(t.isOwner()||o.owner)){P("Update revealer state for ".concat(o.email));var r=e.context;e.state.showChildren?r.log({id:e.id,type:x.REVEAL_CONTENT,value:e.state.selectedCohort,noSave:!0},o.email):r.log({id:e.id,type:x.HIDE_CONTENT,value:e.state.selectedCohort,noSave:!0},o.email)}})))}},{key:"componentWillUnmount",value:function(){P("Component will unmount..."),this.unsubscribe&&this.unsubscribe()}},{key:"render",value:function(){var e=this.context.cohorts||[],t=w.a.createElement("h3",{className:"center"},this.props.message);return w.a.createElement(v.Fragment,null,w.a.createElement(O.default,{owner:!0},w.a.createElement(_.default,{className:"center",style:{marginBottom:"10px",width:"fit-content"}},w.a.createElement(N.default,{onClick:this.toggleContent,style:{marginRight:10}},this.state.showChildren?"Hide":"Reveal"),"contents of ",w.a.createElement("i",null,this.id)," ",this.state.showChildren?"from":"to",w.a.createElement("select",{style:{width:"150px",background:"#2e4468",marginLeft:"10px",padding:"2px",color:"white"},onChange:this.handleCohortChange,onBlur:this.handleCohortChange,onClick:this.stopPropagation,value:this.state.selectedCohort||"all"},w.a.createElement("option",{value:"all"},"All students"),e.map((function(e,t){return w.a.createElement("option",{key:t,value:e.title},e.title)}))))),this.state.showChildren?this.props.children:t)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.show!==t.showProp?{showChildren:e.show,showProp:e.show}:null}}]),n}(v.Component);A.defaultProps={message:"Content hidden by instructor",show:!1},A.propTypes={message:T.a.string,show:T.a.bool},A.contextType=k.default,t.default=A}}]);