PageSourceSearch

https://solvably.com/static/js/983.98e8fe45.chunk.js

js solvably.com collected 2026-10-09 23:04:28 UTC 3,830,030 bytes, 2 lines download raw bytes

1/*! For license information please see 983.98e8fe45.chunk.js.LICENSE.txt */
2(self.webpackChunksolvably_client=self.webpackChunksolvably_client||[]).push([[983],{2371:function(e,s,a){"use strict";a.r(s),a.d(s,{ReactComponent:function(){return h}});var t,i,l,n,r=a(58878);const o=["title","titleId"];function d(){return d=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},d.apply(null,arguments)}function c(e,s){let{title:a,titleId:c}=e,h=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,o);return r.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:64,height:64,ref:s,"aria-labelledby":c},h),a?r.createElement("title",{id:c},a):null,t||(t=r.createElement("rect",{width:64,height:64,rx:10,ry:10,fill:"#d24726"})),i||(i=r.createElement("path",{d:"M19 17 L36 13 L46 17 L46 47 L36 51 L19 47 Z",fill:"#fff"})),l||(l=r.createElement("path",{d:"M36 13 L36 51 L46 47 L46 17 Z",fill:"#f8d8cc"})),n||(n=r.createElement("text",{x:27.5,y:38,fontFamily:"Segoe UI, Arial, sans-serif",fontSize:18,fontWeight:700,fill:"#d24726",textAnchor:"middle"},"O")))}const h=r.forwardRef(c);s.default=a.p+"static/media/office_online_icon.a01b7df1e8e661ab0c7908bfe77926eb.svg"},17508:function(s,a,t){"use strict";t.r(a),t.d(a,{default:function(){return IK}});var i={};t.r(i),t.d(i,{cartridge:function(){return Wx},challenge:function(){return $j},journey:function(){return l_}});
2var l=t(58878),n=t(60069),r=t(1406);const o=document.location.host,d="https:"===window.location.protocol;let c=null,h=null;"localhost:3000"===o&&d?(c="https://localhost:3000",h=["polling"]):"localhost:3000"!==o||d?(c=(d?"wss:":"ws:")+"//"+o,h=["websocket"]):(c="localhost:5001",h=["websocket"]);const u={};let m=null,g=null,p=!1;const x=new r.mS(c,{transports:h,upgrade:!1});x.on("reconnect",()=>{p=!1,"function"===typeof m&&m()}),x.on("reconnect_attempt",e=>{}),x.on("reconnect_error",e=>{}),x.on("reconnect_failed",()=>{});const v=e=>!!u.hasOwnProperty(e)&&u[e];var f=function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a="function"==typeof a?a:function(){},new Promise((t,i)=>{if(!e)return i("No namespace provided");if(!s)return i("No connection identifier provided");const l={active:!0,callback:a,connect_id:s,initialized:!1,namespace:e,socket:null},n=x.socket("/"+e);if(n.connected)return l.initialized=!0,a(n,!1),void t(n);u[s]=l,n.off("connect").on("connect",()=>{a(n,l.initialized),l.initialized=!0,t(n)}),n.off("connect_error").on("connect_error",e=>{console.error(e)}),n.off("connect_timeout").on("connect_timeout",e=>{console.error(e)}),n.off("disconnect").on("disconnect",function(){const e=v(s);!p&&e.active&&"function"===typeof g&&g(),p=!0})})},j=s=>{if(!s)throw new Error("No connection identifier provided");if(!u.hasOwnProperty(s))throw new Error("Invalid connection identifier provided");if(u[s].active=!1,u[s].socket)try{u[s].socket.off()}catch(e){console.error(e)}},_=e=>{g=e},b=e=>{m=e};const A=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"general";const s=!!window.MSInputMethodContext&&!!document.documentMode,a={debug:{color:"gray",method:"log",tag:"[ debug ]"},err:{color:"lightcoral",method:"error",tag:"[ error ]"},failure:{color:"orangered",method:"log",tag:"[ failure ]"},general:{color:"black",method:"log",tag:""},info:{color:"dodgerblue",method:"info",tag:"[ info ]"},success:{color:"green",method:"log",tag:"[ success ]"},warn:{color:"orange",method:"warn",tag:"[ warning ]"}}[e];for(var t=arguments.length,i=new Array(t>1?t-1:0),l=1;l<t;l++)i[l-1]=arguments[l];s?console[a.method](a.tag,...i):console[a.method](`%c${a.tag}`,`color: ${a.color}; font-weight: bold; padding: 5px;`,...i)},y=function(){for(var e=arguments.length,s=new Array(e),a=0;a<e;a++)s[a]=arguments[a];return A("info",...s)},w=function(){for(var e=arguments.length,s=new Array(e),a=0;a<e;a++)s[a]=arguments[a];return A("err",...s)};var N=t(90782);class S extends l.Component{constructor(s){var a;super(s),a=this,this.init=async()=>{const{app:s}=this.props,{isLoggedIn:t,userId:i}=s;try{await f("user","CurrentUser",function(e){var s,l;null!==(s=a.heartbeat)&&void 0!==s&&s.current&&clearInterval(null===(l=a.heartbeat)||void 0===l?void 0:l.current),t&&e.emit("user:online",i),a.heartbeat.current=setInterval(()=>{t&&e.emit("user:online",i)},1e4)})}catch(e){w(e)}},this.stop=async()=>{try{var s,a;null!==(s=this.heartbeat)&&void 0!==s&&s.current&&clearInterval(null===(a=this.heartbeat)||void 0===a?void 0:a.current),this.heartbeat.current=null,j("CurrentUser")}catch(e){w(e)}},this.heartbeat=(0,l.createRef)()}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}async componentWillUnmount(){try{await this.stop();const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}catch(e){w(e)}}render(){var e;const{children:s}=this.props;return(0,N.jsx)(k,{value:{heartbeat:null===(e=this.heartbeat)||void 0===e?void 0:e.current,init:this.init,stop:this.stop},children:s})}}var C=(0,n.G0)(S);const M=l.createContext({}),k=M.Provider;M.Consumer;M.displayName="UserStatusServiceContext";var z=t(23848),T=t(95989);class I extends l.Component{constructor(s){super(s),this.reset=()=>this.setState({organization:null,user_organization_id:null}),this.sync=async()=>{const{app:e}=this.props,{isLoggedIn:s,userHasSiteRole:a}=e;if(s){let e=this.getUserOrganizationCookie();if(!1!==e&&this.isValidOrganization(e))this.setUserOrganizationId(e,!1);else{let e=a()?null:this.getRandomUserOrganizationMembership();e?this.setUserOrganizationId(e.organization_id):await this.fetchURIOrganization()}const s=this.getUserOrganization();s&&this.setOrganization(s)}else await this.fetchURIOrganization()},this.getAllUserOrganizations=()=>{const{app:e}=this.props,{user:s}=e;return Array.isArray(null===s||void 0===s?void 0:s.organization_memberships)?s.organization_memberships:[]},this.isValidOrganization=e=>this.getAllUserOrganizations().map(e=>null===e||void 0===e?void 0:e.organization_id).includes(e),this.getUserOrganization=()=>{var e;const s=this.getUserOrganizationId(),{app:a}=this.props,{user:t}=a;if(!s)return null;return(null===(e=(Array.isArray(null===t||void 0===t?void 0:t.organization_memberships)?t.organization_memberships:[]).find(e=>{var a;return(null===e||void 0===e||null===(a=e.organization)||void 0===a?void 0:a.id)===s}))||void 0===e?void 0:e.organization)||null},this.setUserOrganizationId=(e,s)=>{this.setState({user_organization_id:e}),s&&this.setUserOrganizationCookie(e)},this.getUserOrganizationMembership=()=>{const e=this.getUserOrganizationId(),{app:s}=this.props,{user:a}=s;
2if(!e)return null;return(Array.isArray(null===a||void 0===a?void 0:a.organization_memberships)?a.organization_memberships:[]).find(s=>{var a;return(null===s||void 0===s||null===(a=s.organization)||void 0===a?void 0:a.id)===e})||null},this.getUserOrganizationId=()=>{var e;return null===this||void 0===this||null===(e=this.state)||void 0===e?void 0:e.user_organization_id},this.fetchURIOrganization=async()=>{try{var e;const{app:s}=this.props;let{api:a,siteUrl:t}=s,i=document.location.host;const l=document.location.pathname,n=(null===(e=l.split("/"))||void 0===e?void 0:e[2])||"",r=()=>{var e;return-1!==i.indexOf("localhost")&&"portal"===(null===(e=l.split("/"))||void 0===e?void 0:e[1])&&!!n};if(!r()&&(-1!==i.indexOf("localhost")||-1===i.indexOf(t)||i===t||!i))return;let o=i.split("."),d=r()?n:o.length?o[0]:"";if(!d)return;const{organization:c}=await a.get(`/api/organizations/get/basic/${d}`);this.setOrganization(c)}catch({err:err}){w(err)}},this.getUserOrganizationCookie=()=>{const{app:s}=this.props,{getCookie:a}=s;try{let e=a(`user_organization.${(0,z.A)()}.id`)||null;return e&&JSON.parse(e)||null}catch(e){console.error(e)}return null},this.setUserOrganizationCookie=e=>{const{app:s}=this.props,{setCookie:a}=s;a(`user_organization.${(0,z.A)()}.id`,JSON.stringify(e))},this.getRandomUserOrganizationMembership=()=>{const{app:e}=this.props,{user:s}=e,a=Array.isArray(null===s||void 0===s?void 0:s.organization_memberships)?s.organization_memberships:[];return(null===a||void 0===a?void 0:a[0])||null},this.setOrganization=e=>this.setState({organization:e}),this.getOrganization=()=>{var e;return(null===this||void 0===this||null===(e=this.state)||void 0===e?void 0:e.organization)||null},this.state={organization:null,user_organization_id:null}}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}componentWillUnmount(){const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}componentDidUpdate(e,s,a){const{app:t}=this.props,{forceRerender:i}=t,{organization:l,user_organization_id:n}=s,{organization:r,user_organization_id:o}=this.state;(0,T.isEqual)(l,r)&&(0,T.isEqual)(n,o)||i()}render(){const{organization:e,user_organization_id:s}=this.state,{children:a}=this.props;return(0,N.jsx)(D,{value:{fetchURIOrganization:this.fetchURIOrganization,getAllUserOrganizations:this.getAllUserOrganizations,getRandomUserOrganizationMembership:this.getRandomUserOrganizationMembership,getUserOrganization:this.getUserOrganization,getUserOrganizationCookie:this.getUserOrganizationCookie,getUserOrganizationId:this.getUserOrganizationId,getUserOrganizationMembership:this.getUserOrganizationMembership,isValidOrganization:this.isValidOrganization,organization:e,reset:this.reset,setOrganization:this.setOrganization,setUserOrganizationCookie:this.setUserOrganizationCookie,setUserOrganizationId:this.setUserOrganizationId,sync:this.sync,user_organization_id:s},children:a})}}var E=(0,n.G0)(I),F=t(27405);const R=l.createContext({}),D=R.Provider,B=R.Consumer;R.displayName="OrganizationsServiceContext";var P=t(9303);class L extends l.Component{constructor(s){var a;super(s),a=this,this.init=async()=>{try{await f("notifications","UserNotifications",function(e){a.socket=e,e.off("notification:new").on("notification:new",e=>{let{user_notification:s}=e;for(const t of a.subscribers){const{callback:e}=t||{};"function"===typeof e&&e(s)}})})}catch(e){w(e)}},this.listen=async e=>{const s=null===this||void 0===this?void 0:this.socket;s&&s.emit("notifications:subscribe",e)},this.subscribe=async e=>{const{id:s,callback:a}=e||{};return"function"===typeof a&&(this.subscribers.push(e),await this.listen(s),!0)},this.unsubscribe=async e=>{const s=null===this||void 0===this?void 0:this.socket;s&&(Array.isArray(null===this||void 0===this?void 0:this.subscribers)&&(this.subscribers=this.subscribers.filter(s=>s.id!==e)),await s.emit("notifications:unsubscribe"))},this.socket=null,this.subscribers=[]}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}async componentWillUnmount(){try{j("UserNotifications"),await this.unsubscribe();const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}catch(e){w(e)}}render(){const{children:e}=this.props;return(0,N.jsx)(U,{value:{init:this.init,listen:this.listen,socket:this.socket,subscribe:this.subscribe,subscribers:this.subscribers,unsubscribe:this.unsubscribe},children:e})}}var O=(0,P.G0)(L);const H=l.createContext({}),U=H.Provider;H.Consumer;H.displayName="NotificationsServiceContext";class Q extends l.Component{constructor(s){var a;super(s),a=this,this.init=async()=>{try{await f("user","UserOnlineService",function(e){a.socket=e;const s=a;e.off("status").on("status",e=>{var a;let{is_online:t,user_id:i}=e;if(s.users_online[i]=!!t,null===s||void 0===s||null===(a=s.subscribers)||void 0===a||!a.length)return;const l=s.subscribers.filter(e=>(null===e||void 0===e?void 0:e.user_id)===i);if(null!==l&&void 0!==l&&l.length)for(const s of l)"function"===typeof(null===s||void 0===s?void 0:s.callback)&&s.callback(t)})})}catch(e){w(e)}},this.subscribe=(e,s)=>{const a=this.socket;if(!a||!s||"function"!==typeof s)return!1;const t=this.subscribers.find(s=>
2(null===s||void 0===s?void 0:s.user_id)===e);if(this.subscribers.push({callback:s,user_id:e}),t){var i;s(!!!(null===this||void 0===this||null===(i=this.users_online)||void 0===i||!i[e]))}else a.emit("monitor",e);return!0},this.unsubscribe=()=>{},this.socket=null,this.subscribers=[],this.users_online={}}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}async componentWillUnmount(){try{j("UserOnlineService"),await this.unsubscribe();const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}catch(e){w(e)}}render(){const{children:e}=this.props;return(0,N.jsx)(W,{value:{init:this.init,socket:this.socket,subscribe:this.subscribe,subscribers:this.subscribers,unsubscribe:this.unsubscribe,users_online:this.users_online},children:e})}}var V=Q;const G=l.createContext({}),W=G.Provider;G.Consumer;G.displayName="AllUsersStatusServiceContext";class K extends l.Component{constructor(s){var a;super(s),a=this,this.init=async()=>{try{await f("assignments","AssignmentStatus",function(e){a.socket=e,e.off("assignment:updated").on("assignment:updated",e=>{let{status:s}=e;for(const t of a.subscribers){const{callback:e}=t||{};"function"===typeof e&&e(s)}})})}catch(e){w(e)}},this.listen=async e=>{const s=null===this||void 0===this?void 0:this.socket;s&&s.emit("assignments:subscribe",e)},this.subscribe=async e=>{const{callback:s,group_assignment_id:a}=e||{};return"function"===typeof s&&(this.subscribers.push(e),await this.listen(a),!0)},this.unsubscribe=async e=>{const s=null===this||void 0===this?void 0:this.socket;s&&(Array.isArray(null===this||void 0===this?void 0:this.subscribers)&&(this.subscribers=this.subscribers.filter(s=>s.id!==e)),await s.emit("assignments:unsubscribe"))},this.getAssignmentStatus=async e=>{try{const{app:s}=this.props,{api:a}=s,{gma:t}=await a.get(`/api/learners/assignment/${e}`);if(!t)return;return t}catch({err:err}){w(err)}},this.socket=null,this.subscribers=[]}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}async componentWillUnmount(){try{j("AssignmentStatus"),await this.unsubscribe();const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}catch(e){w(e)}}render(){const{children:e}=this.props;return(0,N.jsx)(J,{value:{getAssignmentStatus:this.getAssignmentStatus,init:this.init,listen:this.listen,socket:this.socket,subscribe:this.subscribe,subscribers:this.subscribers,unsubscribe:this.unsubscribe},children:e})}}var Y=(0,n.G0)(K);const q=l.createContext({}),J=q.Provider;q.Consumer;q.displayName="AssignmentsServiceContext";var X=t(88598),Z=t(80915);const $=t(17643),ee={ALL:["Directory.Read.All","Files.ReadWrite","OnlineMeetings.ReadWrite","User.Read"],AZURE:["Directory.Read.All"],FILES:["Files.ReadWrite"],TEAMS:["OnlineMeetings.ReadWrite"],USER:["User.Read"]},se={excel:{ext:"xlsx",label:"Excel workbook",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",template:"/microsoft_templates/empty.xlsx"},powerpoint:{ext:"pptx",label:"PowerPoint presentation",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation",template:"/microsoft_templates/empty.pptx"},word:{ext:"docx",label:"Word document",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",template:"/microsoft_templates/empty.docx"}};let ae=null;const te=async()=>{if(!ae)return!1;return!!(await ae.getAllAccounts()||[]).length},ie=async function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee.TEAMS;if(!ae)return!1;try{const e=await ae.loginPopup({scopes:s});return e.idToken}catch(e){return console.log("Login failed:",e),!1}},le=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ee.ALL;if(!ae)return!1;const s=await(async()=>!!ae&&((await ae.getAllAccounts()||[])[0]||null))();let a;try{a=await ae.acquireTokenSilent({account:s,scopes:e})}catch(t){console.error(t)}if(!a)try{a=await ae.acquireTokenPopup({account:s,scopes:e})}catch(t){console.error(t)}if(!a)throw new Error("Unable to retrieve access token for Microsoft Teams");return a};var ne=t(44628);const re=(0,l.forwardRef)((e,s)=>{const{children:a}=e,[t,i,n]=(0,ne.CQ)({modal_stack:[]}),r=e=>new Promise(s=>i({modal_stack:e},s)),o=()=>Array.isArray(t.modal_stack)?t.modal_stack:[],d=e=>o().includes(e);(0,l.useEffect)(()=>n,[]);const c={addToStack:async e=>{if(d(e))return;const s=[...o(),e];await r(s)},clearStack:()=>r([]),getHeightInStack:e=>o().indexOf(e),getStack:o,getStackSize:()=>o().length,isBottomOfStack:e=>{if(!e)return!1;const s=o();return(null===s||void 0===s?void 0:s[0])===e},isInStack:d,isTopOfStack:e=>{if(!e)return!1;const s=o();return s[(null===s||void 0===s?void 0:s.length)-1]===e},modal_stack:t.modal_stack,popStack:async()=>{const e=[...o()],s=e.pop();return await r(e),s},removeFromStack:async e=>{if(!d(e))return;const s=o().filter(s=>s!==e);await r(s)},shiftStack:async()=>{const e=[...o()],s=e.shift();return await r(e),s}};return(0,l.useImperativeHandle)(s,()=>(0,F.A)({},c)),(0,N.jsx)(ce,{value:(0,F.A)({},c),children:a})});re.displayName="ModalManager";var oe=re;const de=l.createContext({}),ce=de.Provider;de.Consumer;de.displayName="ModalManagerContext";
2var he=t(81515),ue=t(20331),me=t(85472);const ge=["divider"],pe=e=>{let{divider:s=!0}=e,a=(0,he.A)(e,ge);const{addToStack:t,getHeightInStack:i,isInStack:n,removeFromStack:r}=(0,l.useContext)(de),o=(0,l.useRef)((0,me.A)());(0,l.useLayoutEffect)(()=>async()=>{n(null===o||void 0===o?void 0:o.current)&&await r(null===o||void 0===o?void 0:o.current)},[]);const d=i(null===o||void 0===o?void 0:o.current),c=`stackable-modal-backdrop stack-height-${d} ${a.backdropClassName||""}`,h=`stackable-modal stack-height-${d} ${s?"":"remove-title-divider"} ${a.className||""}`;return(0,N.jsx)(ue.A,(0,F.A)((0,F.A)({},a),{},{backdropClassName:c,className:h,onEntered:async()=>{const{onEnter:e}=a;await t(null===o||void 0===o?void 0:o.current),"function"===typeof e&&e()},onExit:async()=>{const{onExit:e}=a;await r(null===o||void 0===o?void 0:o.current),"function"===typeof e&&e()}}))};pe.Body=ue.A.Body,pe.Dialog=ue.A.Dialog,pe.Footer=ue.A.Footer,pe.Header=ue.A.Header,pe.Title=ue.A.Title,pe.displayName="ManagedModal";var xe=pe,ve=t(69841);const fe=(0,l.forwardRef)((e,s)=>{const{defaultOverrides:a}=e,[t,i,n]=(0,ne.CQ)({actions:[],body:null,centered:!1,onHide:null,prompt:null,reject:Function(),resolve:Function(),show:!1,size:null===e||void 0===e?void 0:e.size,title:null}),r=(0,l.useRef)(),o=(0,l.useRef)(),d=(0,l.useRef)(),c={defaultButtonVariant:"primary",defaultCancelButtonVariant:"secondary",defaultCancelLabel:"Cancel",defaultOkLabel:"OK"},h=e=>new Promise((s,a)=>{clearTimeout(d.current),r.current=e,i((0,F.A)((0,F.A)({},e),{},{reject:a,resolve:s,show:!0}))}),u=()=>{const{onHide:e,resolve:s,show:a}=t;a&&("function"===typeof e&&e(),s(null),i({show:!1},()=>{d.current=setTimeout(n,500)}))},m=e=>({className:(null===e||void 0===e?void 0:e.className)||"",func(){"function"===typeof(null===e||void 0===e?void 0:e.onClick)&&e.onClick(),u()},key:(null===e||void 0===e?void 0:e.key)||"",label:(null===e||void 0===e?void 0:e.label)||"",onClick:null===e||void 0===e?void 0:e.onClick,variant:(null===e||void 0===e?void 0:e.variant)||(null===c||void 0===c?void 0:c.defaultButtonVariant)||""}),g=()=>{var e,s;return(null===o||void 0===o||null===(e=o.current)||void 0===e||null===(s=e.getValue)||void 0===s?void 0:s.call(e))||null},p=e=>"undefined"===typeof(null===t||void 0===t?void 0:t.size)?e:"medium"===(null===t||void 0===t?void 0:t.size)?null:null===t||void 0===t?void 0:t.size,x=(e,s)=>{const a={actions:[_()],body:e,size:s};h(a)},v=e=>m(e),f=e=>{const s=(null===e||void 0===e?void 0:e.label)||(null===a||void 0===a?void 0:a.defaultOkLabel)||c.defaultOkLabel||"";return m((0,F.A)((0,F.A)({},e),{},{label:s}))},j=e=>{const s=(null===e||void 0===e?void 0:e.label)||(null===a||void 0===a?void 0:a.defaultCancelLabel)||c.defaultCancelLabel||"",t=(null===e||void 0===e?void 0:e.variant)||(null===a||void 0===a?void 0:a.defaultCancelButtonVariant)||c.defaultCancelButtonVariant||"";return m((0,F.A)((0,F.A)({},e),{},{label:s,variant:t}))},_=e=>{const s=(null===e||void 0===e?void 0:e.label)||(null===a||void 0===a?void 0:a.defaultOkLabel)||c.defaultOkLabel||"";return m((0,F.A)((0,F.A)({},e),{},{key:"enter,esc",label:s}))},b=e=>new ye(e),A=e=>new we(e),y=e=>new Ne(e);(0,l.useEffect)(()=>n,[]),(0,l.useImperativeHandle)(s,()=>({Action:v,CancelAction:j,getInputValue:g,getSize:p,hide:u,NumberPrompt:y,OKAction:f,PasswordPrompt:A,show:h,showAlert:x,SingleOKAction:_,TextPrompt:b}));const{actions:w,body:S,centered:C,prompt:M,show:k,size:z,title:T}=t;return(0,N.jsxs)(xe,(0,F.A)((0,F.A)({centered:!!C,onHide:u,show:k,size:z},e),{},{children:[T&&(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:T})}),(0,N.jsxs)(xe.Body,{children:["string"===typeof S?(0,N.jsx)("p",{children:S}):(0,N.jsx)(N.Fragment,{children:S}),M&&(0,N.jsx)(Se,{onSubmit:()=>{var e,s;const a=null===(e=r.current)||void 0===e||null===(s=e.keyBinds)||void 0===s?void 0:s.enter;a&&a()},prompt:M,ref:o})]}),!(null===w||void 0===w||!w.length)&&(0,N.jsx)(xe.Footer,{children:w&&w.map((e,s)=>(0,N.jsx)(ve.A,{className:`${null===e||void 0===e?void 0:e.className}`,onClick:()=>e.func(),size:"sm",style:{minWidth:82},variant:null===e||void 0===e?void 0:e.variant,children:null===e||void 0===e?void 0:e.label},s))})]}))});fe.displayName="Dialog",fe.defaultProps={size:"normal"};var je=fe,_e=t(53383),be=t(88694);class Ae{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{initialValue:s,placeholder:a,required:t}=e;this.initialValue=s,this.placeholder=a,this.required=t}}class ye extends Ae{}class we extends Ae{}class Ne extends Ae{}class Se extends l.Component{constructor(e,s){super(e,s),this.getValue=()=>this.state.value,this.checkValidity=()=>{const{formElement:e}=this;return!(e&&!e.checkValidity())||(e.reportValidity(),!1)},this.onSubmit=e=>{if(e.preventDefault(),!this.checkValidity())return;const{onSubmit:s}=this.props;"function"===typeof s&&s()};const{initialValue:a,placeholder:t}=e.prompt;this.state={initialValue:a,placeholder:t,value:a||""},this.onSubmit=this.onSubmit.bind(this)}componentDidMount(){this.setState(e=>({value:e.initialValue||""}),()=>{this.inputElement&&this.inputElement.select()})}render(){const{prompt:e}=this.props,{placeholder:s,value:a}=this.state;let t;switch(e.constructor.name){case"PasswordPrompt":t="password";break;case"TextPrompt":t="text";break;case"NumberPrompt":t="number"}return(0,N.jsx)(_e.A,{onSubmit:this.onSubmit,ref:e=>this.formElement=e,children:(0,N.jsx)(be.A,{autoFocus:!0,onChange:e=>this.setState({value:e.target.value}),placeholder:s,ref:e=>this.inputElement=e,required:null===e||void 0===e?void 0:e.required,type:t,value:a})})}}var Ce=t(98055),Me=t(5236),ke=t(99059),ze=t(6795);const Te=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{reloadWindow:t}=(0,n.nm)(),[i,r,o]=(0,ne.CQ)({show:!1}),d=e=>r({show:!0}),c=()=>{o(),"function"===typeof a&&a()};return(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>o,[]),(0,N.jsx)(xe,{backdrop:"static",backdropClassName:"reconnect-modal-backdrop",className:"reconnect-modal",id:"reconnectMod
2al",keyboard:!1,onHide:c,show:i.show,children:(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(Ce.S,{className:"mb-4 mt-2",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)("h5",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Reconnecting...",id:"label.reconnecting.66bce4bd"})}),(0,N.jsx)("p",{className:"text-muted text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Please wait while we do our magic",id:"label.please_wait_while_we_do_our_magic.fb25f319"})}),(0,N.jsx)(Ce.S,{className:"mt-3 d-flex justify-content-center",children:(0,N.jsxs)(ve.A,{className:"b-700 d-flex align-items-center",onClick:t,variant:"secondary",children:[(0,N.jsx)(ze.EEI,{className:"me-1",size:14})," ",(0,N.jsx)(ke.A,{defaultMessage:"Refresh page",id:"label.refresh_page.b873c33c"})]})})]})})});Te.displayName="ReconnectModal";var Ie=Te,Ee=t(25619),Fe=t(52381),Re=t(4909),De=t(93417),Be=t(94844),Pe=t(2465),Le=t(43863);var Oe=()=>{const{pathname:e}=(0,Pe.zy)();return(0,l.useEffect)(()=>{window.scrollTo(0,0)},[e]),null};const He=()=>{const{api:s,isImpersonating:a,user:t}=(0,P.nm)(),[i,n]=(0,l.useState)(!1),r=a();if((0,l.useEffect)(()=>(document.body.classList.toggle("impersonating",r),()=>document.body.classList.remove("impersonating")),[r]),!r)return null;const o=e=>{const s=new URL(e,window.location.origin);s.pathname===window.location.pathname&&s.search===window.location.search?(window.history.replaceState(null,"",s.href),window.location.reload()):window.location.href=s.href};return(0,N.jsxs)("div",{className:"impersonation-banner",children:[(0,N.jsxs)("span",{className:"impersonation-banner-text d-inline-flex align-items-center",children:[(0,N.jsx)(ze.XiY,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"You're viewing the app as {name}",id:"label.youre_viewing_the_app_as_name.c0b6ba35",values:{name:null===t||void 0===t?void 0:t.fullname}})]}),(0,N.jsxs)(ve.A,{className:"impersonation-banner-exit d-inline-flex align-items-center ms-3",disabled:i,onClick:async()=>{try{n(!0);const{redirect_url:e}=await s.post("/api/auth/impersonate/stop");o(e||"/")}catch(e){o("/")}},size:"sm",variant:"light",children:[(0,N.jsx)(ze.axc,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Exit impersonation",id:"label.exit_impersonation.357bef8f"})]})]})};var Ue=t(91470),Qe=t(91261),Ve=t(83403),Ge=t(31488),We=t(59040),Ke=t(57288);var Ye=t.p+"static/media/logo_solvably.d45036cd1e0c1ebeb5eb39b53d68134c.svg";class qe extends l.Component{constructor(e){super(e),this.state={can_request:!1,loading:!0,request_failed:!1,request_failure_message:""}}async componentDidMount(){const e="function"==typeof document.requestStorageAccess;this.setState({can_request:e,loading:!1})}render(){const{can_request:e,loading:s,request_failed:a}=this.state,{app:t}=this.props;return(0,N.jsxs)(Ue.A,{children:[s&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!s&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"text-center pt-5 pb-3",children:(0,N.jsx)("img",{alt:"Solvably Logo",src:Ye,style:{width:300}})}),(0,N.jsx)(Qe.A,{className:"my-3 my-lg-5 justify-content-center",children:(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)(Ge.A,{className:"registration-form-container",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Uh oh!",id:"label.uh_oh.c3bef8b1"})}),!!e&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Your browser currently does not support cookies or other storage. Please request access to enable storage below:",id:"label.your_browser_currently_does_not_su.bffe242e"})}),a&&(0,N.jsxs)(We.A,{className:"mt-3",variant:"danger",children:["It appears that didn't work. Your browser may have a security setting in place preventing cross-site cookies from being created. Please try ",(0,N.jsx)("b",{children:(0,N.jsx)("a",{href:"/",target:"_blank",children:"opening the application"})})," in a new tab, clicking anywhere on the page, then closing the tab and return here and try again."]}),(0,N.jsx)(Qe.A,{className:"justify-content-center",children:(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)(ve.A,{block:!0,size:"lg",variant:"primary",onClick:e=>{document.requestStorageAccess().then(()=>{t.forceRerender()}).catch(e=>{this.setState({request_failed:!0,request_failure_message:e||""})})},children:(0,N.jsx)(ke.A,{defaultMessage:"Enable storage",id:"label.enable_storage.757d49ae"})})})})]}),!e&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Your browser currently does not support storage. Please enable them within your browser or contact an administrator.",id:"label.your_browser_currently_does_not_su.8fea201a"})})})]})})})})]})]})}}var Je=(0,Ke.Ay)((0,Pe.y)((0,n.G0)(qe)));const Xe=e=>{const{component:s}=e,{cookiesEnabled:a,storageEnabled:t}=(0,P.nm)();return(0,N.jsx)(Pe.qh,(0,F.A)((0,F.A)({},e),{},{component:a()&&t()?s:Je}))};Xe.displayName="CookieEnforcedRoute";var Ze=Xe,$e=t.p+"static/media/Solvably - Privacy Policy - 05-10-2024.120c17018ae49e5582cf.md",es=t(85698),ss=t(10001);var as=e=>{const{hideHeading:s}=e,[a,t]=(0,ne.CQ)({policy:""}),{policy:i}=a;return(0,l.useEffect)(()=>{fetch($e).then(e=>e.text()).then(e=>t({policy:e}))},[]),(0,N.jsxs)(N.Fragment,{children:[!s&&(0,N.jsx)("h1",{className:"mb-3 text-center",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably privacy policy",id:"label.solvably_privacy_policy.af49c8f6"})})}),(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"p-5",loading:!i,children:(0,N.jsx)(es.oz,{rehypePlugins:[ss.A],children:i})})]})};const ts=(0,l.forwardRef)((e,s)=>{const{size:a}=e,[t,i]=(0,l.useState)(!1),n=()=>i(!0),r=()=>i(!1);return(0,l.useImperativeHandle)(s,()=>({hide:r,show:n})),(0,N.jsxs)(xe,{backdrop:"static",onHide:r,show:t,size:a,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(as,{hideHeading:!0})})]})});ts.displayName="PrivacyPolicyModal",ts.defaultProps={size:"lg"};var is=ts,ls=t.p+"static/media/Solvably - Terms of Service - 05-10-2024.2c309acee410b057b67f.md";var ns=e=>{const{hideHeading:s}=e,[a,t]=(0,ne.CQ)({policy:""}),{policy:i}=a;return(0,l.useEffect)(()=>{fetch(ls).then(e=>e.text()).then(e=>t({policy:e}))},[]),(0,N.jsxs)(Ce.S,{className:"terms-of-service",children:[!s&&(0,N.jsx)("h1",{className:"mb-3 text-center",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably Terms of Service",id:"label.solvably_terms_of_service.8beebecc"})})}),(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"p-5",loading:!i,children:(0,N.jsx)(es.oz,{rehypePlugins:[ss.A],children:i})})]})};const rs=["children","className"];var os=e=>{const{children:s,className:a}=e,t=(0,he.A)(e,rs);return(0,N.jsx)("div",(0,F.A)((0,F.A)({className:`form-group ${e.className||""}`},t),{},{children:s}))},ds=t(93731);var cs=(0,Ke.Ay)(e=>{const{buttonStretch:s,defaultValues:a,enableBusinessField:t}=e,{locale:i,tryRegister:r}=(0,n.nm)(),[o,d,c]=(0,ne.CQ)({error:null,loading:!1}),h=(0,l.useRef)(),{business:u,email_address:m,fullname:g,password:p,password_confirm:x}=a||{},v={business:u||"",email_address:m||"",fullname:g||"",password:p||"",password_confirm:x||""},{error:f,loading:j}=o;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ds.l1,{initialValues:v,onSubmit:s=>{const{business:a,email_address:t,fullname:l,password:n}=s||{},{onFinish:o}=e;d({error:null,loading:!0}),r({business:a,email_address:t,fullname:l,locale:i,password:n}).then(()=>{d({loading:!1}),"function"===typeof o&&o()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:s,loading:!1})})},validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:i,scope:"user.register"}),children:e=>{let{errors:a,handleChange:i,handleSubmit:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:l,children:[j&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!j&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:f,variant:"danger",children:f}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"email",isInvalid:n.email_address&&a.email_address,isValid:n.email_address&&!a.email_address,name:"email_address",onChange:i,placeholder:"[email protected]",type:"text",value:r.email_address}),(0,N.jsx)(ds.Kw,{name:"email_address",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),t&&(0,N.jsxs)(os,{className:"me-2",style:{flex:1},children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Business",id:"label.business.76f68a75"}),(0,N.jsx)("small",{className:"text-muted ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.o
2ptional.0059798b"})})]}),(0,N.jsx)(_e.A.Control,{"aria-label":"business",isInvalid:n.business&&a.business,isValid:n.business&&!a.business,name:"business",onChange:i,placeholder:"Example Inc.",type:"text",value:r.business}),(0,N.jsx)(ds.Kw,{name:"business",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(Ce.S,{className:"d-flex",children:(0,N.jsxs)(os,{className:"me-2",style:{flex:1},children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"name",isInvalid:n.fullname&&a.fullname,isValid:n.fullname&&!a.fullname,name:"fullname",onChange:i,placeholder:"John Doe",type:"text",value:r.fullname}),(0,N.jsx)(ds.Kw,{name:"fullname",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(os,{className:"me-2",style:{flex:1},children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"password",isInvalid:n.password&&a.password,isValid:n.password&&!a.password,name:"password",onChange:i,placeholder:"Example123!",type:"password",value:r.password}),(0,N.jsx)(ds.Kw,{name:"password",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{style:{flex:1},children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Confirm",id:"label.confirm.eebdd24a"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"confirm password",isInvalid:n.password_confirm&&a.password_confirm,isValid:n.password_confirm&&!a.password_confirm,name:"password_confirm",onCh
2ange:i,placeholder:"Example123!",type:"password",value:r.password_confirm}),(0,N.jsx)(ds.Kw,{name:"password_confirm",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]}),(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsxs)("small",{className:"text-muted",children:['By pressing "Register", I agree to the Solvably'," ",(0,N.jsx)("a",{href:"#",rel:"noreferrer noopener",onClick:e=>{e.preventDefault(),h.current.show()},children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})})})]})}),(0,N.jsx)(os,{className:"d-flex justify-content-end mb-0",children:(0,N.jsx)(ve.A,{className:"btn-main "+(s?"w-100":""),size:"lg",type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Register",id:"label.register.bb7234ec"})})})]})]})}}),(0,N.jsx)(is,{ref:h})]})});const hs=(0,l.forwardRef)((e,s)=>{const{api:a,locale:t}=(0,n.nm)(),[i,r,o]=(0,ne.CQ)({error:null,loading:!1,success:!1});(0,l.useEffect)(()=>o,[]);const{error:d,loading:c,success:h}=i;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:d,variant:"danger",children:d}),(0,N.jsx)("p",{style:{marginBottom:25},children:(0,N.jsx)(ke.A,{defaultMessage:"Recover your account password by filling out the form below.",id:"label.recover_your_account_password_by_f.71218c65"})}),h?(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({success:!1}),variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"If an account exists with that email, you will receive a reset password link. If after 5 minutes you do not, try again with a different possible email.",id:"label.if_an_account_exists_with_that_ema.f227f7f0"})}):(0,N.jsx)(ds.l1,{onSubmit:async e=>await(async e=>{try{r({loading:!0}),await a.post("/api/users/forgot","",{email_address:e}),r({loading:!1,success:!0})}catch({err:err}){w(err),r({error:err,loading:!1,success:!1})}})(null===e||void 0===e?void 0:e.email_address),validationSchema:(0,Re.by)({locale:t,scope:"authentication.forgot_password"}),initialValues:{email_address:(null===e||void 0===e?void 0:e.email_address)||""},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,resetForm:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{className:"form-purple",onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Email address",id:"label.email_address.f2488fd4"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"email",disabled:c,isInvalid:l.email_address&&s.email_address,isValid:l.email_address&&!s.email_address,name:"email_address",onChange:a,placeholder:"[email protected]",type:"text",value:n.email_address}),(0,N.jsx)(ds.Kw,{name:"email_address",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(Me.p0,{className:"btn-main float-end",loading:c,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Reset password",id:"label.reset_password.e0edfeb3"})})})]})}})]})});hs.defaultProps={email_address:""};var us=hs;const ms=(0,l.forwardRef)((e,s)=>{const[a,t]=(0,l.useState)(!1),{email_address:i}=e;return(0,l.useImperativeHandle)(s,()=>({hide:()=>{t(!1)},show:()=>{t(!0)}})),(0,N.jsxs)(xe,{backdrop:"static",onHide:()=>t(!1),show:a,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Forgot something?",id:"label.forgot_something.51e32294"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(us,{email_address:i})})]})});ms.defaultProps={email_address:""};var gs=ms;const ps=e=>{const{integration_type_token:s}=e;switch(s){case"microsoft":return(0,N.jsx)("img",(0,F.A)({src:t(95326)},e));case"scorm":return(0,N.jsx)(ze.lHQ,(0,F.A)({},e))}return s};var xs=t(18745);const vs=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({error:!1,item:{},loading:!1,message:"",show:!1,success:!1,type:""}),{api:n}=(0,P.nm)(),r=(e,s)=>{t({item:s||{},show:!0,success:!1,type:e||""})},o=(e,s,a,i,l)=>{t({loading:!0}),n.post("/api/site/demo",{description:l,email:s,name:e,organization:a,phone:i}).then(()=>{t({loading:!1,message:"A demo request has been submitted. We will respond to you as soon as possible.",success:!0})}).catch(e=>{let{err:s}=e;t({error:s,loading:!1,success:!1})})},d=()=>{"function"==typeof e.onHide&&e.onHide(),t({error:null,message:"",show:!1,success:!1})};(0,l.useImperativeHandle)(s,()=>({handleHide:d,show:r,submitRequest:o}));const{locale:c}=(0,P.nm)(),{error:h,item:u,loading:m,saving:g,show:p,success:x,type:v}=a,{generic:f}=e,j=u&&v?`I'd like more information about the ${v} "${(()=>{switch(v){case"challenge":case"cartridge":case"journey":return null===u||void 0===u?void 0:u.title}}
2)()}".`:"";return(0,N.jsxs)(xe,{centered:!0,className:"fancy-modal",id:"requestDemoModal",onHide:()=>{d()},show:p,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h3",{children:"Help Us, Help You!"}),(0,N.jsx)("p",{className:"lead",children:`Submit your info and a Solvably ${f?"":"TALENT "}problem solver will get right back to you!`})]})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{t({error:null})},show:h,variant:"danger",children:h}),x&&(0,N.jsx)(We.A,{variant:"success",children:"A demo request has been submitted. A Solvably team member will respond to you as soon as possible."}),m&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!h&&!m&&!x&&(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ds.l1,{validationSchema:(0,Re.by)({locale:c,scope:"misc.request_demo"}),initialValues:{description:j,email:"",name:"",organization:"",phone:""},onSubmit:(e,s)=>{o(e.name,e.email,e.organization,e.phone,e.description)},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,isValid:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(_e.A,{onSubmit:t,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:"Name *"}),(0,N.jsx)(_e.A.Control,{isInvalid:n.name&&s.name,isValid:n.name&&!s.name,name:"name",onChange:a,placeholder:"John Doe",type:"text",value:r.name}),s.name&&n.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:"Email *"}),(0,N.jsx)(_e.A.Control,{isInvalid:n.email&&s.email,isValid:n.email&&!s.email,name:"email",onChange:a,placeholder:"[email protected]",type:"text",value:r.email}),s.email&&n.email&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.email})]})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:"Organization *"}),(0,N.jsx)(_e.A.Control,{isInvalid:n.organization&&s.organization,isValid:n.organization&&!s.organization,name:"organization",onChange:a,placeholder:"Example, Inc.",type:"text",value:r.organization}),s.organization&&n.organization&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.organization})]})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:"Phone *"}),(0,N.jsx)(_e.A.Control,{isInvalid:n.phone&&s.phone,isValid:n.phone&&!s.phone,name:"phone",onChange:a,placeholder:"123-456-7890",type:"tel",value:r.phone}),s.phone&&n.phone&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.phone})]})}),(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:"How may we serve you? *"}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:n.description&&s.description,isValid:n.description&&!s.description,name:"description",onChange:a,placeholder:"Anything you'd like us to know?",rows:4,value:r.description}),s.description&&n.description&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.description})]})}),(0,N.jsxs)(Ve.A,{className:"d-flex justify-content-between mt-2",xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("small",{children:"Required *"}),(0,N.jsx)("a",{href:"https://app.solvably.com/privacy",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)("small",{style:{fontWeight:500},children:"Privacy Policy"})})]}),(0,N.jsx)(_e.A.Group,{className:"mb-0",children:(0,N.jsxs)(ve.A,{className:"pull-right d-flex",disabled:!i||g,onClick:t,size:"lg",variant:"primary",children:[(0,N.jsx)(ze.uCC,{"aria-hidden":!0,className:"me-1",size:14,style:{alignSelf:"center"}}),(0,N.jsx)(ke.A,{defaultMessage:"Send request",id:"label.send_request.3a69f897"})]})})]})]})})})}})})]})]})});vs.displayName="RequestDemo";var fs=vs,js=t(34395);const _s=e=>{const{heading:s,onFinish:a}=e,{location:t}=(0,Pe.W6)(),{logoutMessage:i,resetLogoutMessage:n}=(0,P.nm)(),[r,o,d]=(0,ne.CQ)({alert:null,alert_variant:null,email_address:"",error:!1,loading:!1,step:1});(0,l.useEffect)(()=>
2{if(t){const e=js.A.parse(t.search);e.message&&o({alert:e.message,alert_variant:"success"}),e.error&&o({alert:e.error,alert_variant:"danger"}),i&&(o({alert:i,alert_variant:"warning"}),n())}},[i,t]);const{alert:c,alert_variant:h,email_address:u,step:m}=r;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"login-form",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({alert:null,alert_variant:null}),show:!!c,variant:h,children:c}),1==m&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bs,{heading:s,onSubmit:e=>{o({alert:null,email_address:e,error:null,step:2})}})}),2==m&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(As,{email_address:u,onAltSelection:()=>{o({step:4})},onBack:()=>{o({step:1})},onMagicLinkSent:()=>{o({step:3})}})}),3==m&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ys,{email_address:u,onAltSelection:()=>{o({step:4})},onBack:()=>{o({step:2})}})}),4==m&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ws,{email_address:u,onBack:()=>{o({step:1})},onFinish:a})})]})})};_s.defaultProps={heading:"",onFinish:()=>{}};const bs=(0,l.forwardRef)((e,s)=>{var a;const{heading:t,onSubmit:i}=e,{authProviders:n,locale:r,tryMSLogin:o}=(0,P.nm)(),d=(0,l.useRef)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ds.l1,{onSubmit:e=>i(e.email_address),validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:r,scope:"authentication.login_email"}),initialValues:{email_address:""},children:e=>{const{errors:s,handleChange:a,handleSubmit:i,isValid:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,style:{minWidth:"100%"},children:[(0,N.jsxs)(Ce.S,{children:[t?(0,N.jsx)("h4",{className:"mb-3",children:t}):"",(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,"aria-label":"email",className:"form-control",isInvalid:(null===n||void 0===n?void 0:n.email_address)&&(null===s||void 0===s?void 0:s.email_address),isValid:(null===n||void 0===n?void 0:n.email_address)&&!(null!==s&&void 0!==s&&s.email_address),name:"email_address",onChange:a,placeholder:"[email protected]",type:"text",value:r.email_address}),(null===s||void 0===s?void 0:s.email_address)&&(null===n||void 0===n?void 0:n.email_address)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.email_address})]})]}),(0,N.jsx)(Ce.S,{className:"mt-3 pt-2",children:(0,N.jsx)(os,{children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column justify-content-center",children:(0,N.jsx)(Me.p0,{block:!0,disabled:!l,size:"lg",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Continue with email",id:"label.continue_with_email.8c99a086"})})})})})]})}}),(null===n||void 0===n||null===(a=n.microsoft)||void 0===a?void 0:a.sso)&&(0,N.jsx)(Ce.S,{className:"mt-3 pt-2",children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-center or-divider small font-weight-bold text-secondary mb-3",children:[(0,N.jsx)("hr",{}),(0,N.jsx)(ke.A,{defaultMessage:"or",id:"label.or.7175517a"}),(0,N.jsx)("hr",{})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center justify-content-center w-100",onClick:async()=>{o()},variant:"secondary",children:[(0,N.jsx)(ps,{className:"me-2",integration_type_token:"microsoft"}),(0,N.jsx)(ke.A,{defaultMessage:"Sign in with Microsoft",id:"label.sign_in_with_microsoft.92fa49e9"})]})]})}),(0,N.jsx)(Ce.S,{className:"mb-3 mt-4",children:(0,N.jsxs)("p",{className:"d-flex flex-column flex-sm-row gap-1 gap-sm-2 justify-content-baseline justify-content-sm-start align-items-start align-items-sm-baseline",children:[(0,N.jsx)(ke.A,{defaultMessage:"Don't have an account?",id:"label.dont_have_an_account.1b545b23"}),(0,N.jsx)(ve.A,{className:"p-0 fw-normal",onClick:()=>{const e=null===d||void 0===d?void 0:d.current;e&&e.show()},style:{textTransform:"initial"},variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Talk to a Problem Solver.",id:"label.talk_to_a_problem_solver.a4b5dc0c"})})]})}),(0,N.jsx)(fs,{generic:!0,ref:d})]})}),As=(0,l.forwardRef)((e,s)=>{const{email_address:a,onAltSelection:t,onBack:i,onMagicLinkSent:l}=e,{api:n}=(0,P.nm)(),[r,o,d]=(0,ne.CQ)({error:!1,loading:!1,sending:!1}),{error:c,loading:h}=r;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:c,variant:"warning",children:c}),(0,N.jsx)(Ce.S,{children:"function"===typeof i&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center text-secondary",onClick:i,variant:"link",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})]})}),(0,N.jsx)(Ce.S,{className:"text-primary mt-4 mb-3",children:(0,N.jsx)(ze.Wjb,{size:60})}),(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"One more step",id:"label.one_more_step.7d9346b6"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Get a magic code sent to your email to sign in password-free",id:"label.get_a_magic_code_sent_to_your_emai.0fc3254f"})}),(0,N.jsx)(Ce.S,{className:"d-grid",children:(0,N.jsx)(Me.p0,{loading:h,onClick:()=>{o({loading:!0}),n.post("/api/auth/new/code",{email_address:a}).then(()=>{o({loading:!1}),"function"==typeof l&&l()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:s,loading:!1})})},children:(0,N.jsx)(ke.A,{defaultMessage:"Send magic code",id:"label.send_magic_code.a76e3ce4"})})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-center or-divider small font-weight-bold text-secondary mt-3 mb-3",children:[(0,N.jsx)("hr",{}),(0,N.jsx)(ke.A,{defaultMessage:"or",id:"label.or.7175517a"}),(0,N.jsx)("hr",{})]}),(0,N.jsx)(Ce.S,{className:"d-grid",children:(0,N.jsx)(ve.A,{block:!0,onClick:()=>{"function"==typeof t&&t()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Type password instead",id:"label.type_password_instead.6a190c93"})})})]})}),ys=(0,l.forwardRef)((e,s)=>{const{email_address:a,onAltSelection:t,onBack:i}=e,{api:l,locale:n}=(0,P.nm)(),[r,o,d]=((0,Pe.W6)(),(0,ne.CQ)({error:!1,loading:!1,open:!1,sending:!1,sent:!1})),{error:c,loading:h,open:u,sending:m,sent:g}=r;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:c,variant:"warning",children:c}),h&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!h&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{children:"function"===typeof i&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center text-secondary",onClick:i,variant:"link",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})]})}),(0,N.jsx)(Ce.S,{className:"text-primary mt-4 mb-3",children:(0,N.jsx)(ze.Cer,{size:60})}),(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Check your email",id:"label.check_your_email.77322879"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:`We sent a magic code to ${a}. Paste it here to log in!`,id:"client.src.common.components.LoginForm.4804820382"})}),(0,N.jsx)(ds.l1,{onSubmit:e=>{const{code:s}=e;o({error:null,sending:!0,sent:!1}),l.get("/api/auth/new/code",{code:s,email_address:a}).then(e=>{let{redirect_url:s}=e;window.location=s}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:s,sending:!1})})},validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:n,scope:"authentication.magic_code"}),initialValues:{code:"",email_address:a},children:e=>{const{errors:s,handleChange:a,handleSubmit:t,isValid:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Magic code",id:"label.magic_code.d379fbd7"})}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,"aria-label":"code",className:"form-control",isInvalid:(null===l||void 0===l?void 0:l.code)&&(null===s||void 0===s?void 0:s.code),isValid:(null===l||void 0===l?void 0:l.code)&&!(null!==s&&void 0!==s&&s.code),name:"code",onChange:a,placeholder:"ABC123",type:"text",value:n.code}),(null===s||void 0===s?void 0:s.code)&&(null===l||void 0===l?void 0:l.code)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.code})]})}),(0,N.jsx)(Ce.S,{className:"mt-3 pt-2",children:(0,N.jsx)(os,{children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column justify-content-center",children:(0,N.jsx)(Me.p0,{block:!0,disabled:!i,size:"lg",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Log in",id:"label.log_in.c189840c"})})})})})]})}}),(0,N.jsxs)(Ce.S,{className:"mt-4",children:[(0,N.jsxs)("a",{className:"d-flex",href:"#",onClick:()=>{o({open:!u})},style:{color:"#000"},children:[(0,N.jsx)("u",{children:(0,N.jsx)(ke.A,{defaultMessage:"Didn't get an email?",id:"label.didnt_get_an_email.14065200"})}),(0,N.jsxs)(Ce.S,{className:"ms-2",children:[!u&&(0,N.jsx)(ze.z44,{}),u&&(0,N.jsx)(ze.UCm,{})]})]}),(0,N.jsx)(xs.A,{in:u,children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"text-muted text-small mt-2 mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Check your spam or junk folder just in case. You can also try the following:",id:"label.check_your_spam_or_junk_folder_jus.53124f08"})}),(0,N.jsx)(Ce.S,{className:"d-grid",children:(0,N.jsxs)(Me.p0,{className:"mb-3",disabled:g,loading:m,onClick:()=>{o({error:null,sending:!0,sent:!1}),l.post("/api/auth/new/code",{email_address:a}).then(()=>{o({sending:!1,sent:!0})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:s,sending:!1})})},children:[!g&&(0,N.jsx)(ke.A,{defaultMessage:"Try sending again",id:"label.try_sending_again.850ed62f"}),g&&(0,N.jsx)(ke.A,{defaultMessage:"Email sent again",id:"label.email_sent_again.415926cb"})]})}),(0,N.jsx)(Ce.S,{className:"d-grid",children:(0,N.jsx)(ve.A,{block:!0,onClick:()=>{"function"==typeof t&&t()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Type password instead",id:"label.type_password_instead.6a190c93"})})})]})})]})]})]})}),ws=(0,l.forwardRef)((s,a)=>{const{email_address:t,onBack:i,onFinish:n}=s,{locale:r,tryLogin:o}=(0,P.nm)(),[d,c,h]=(0,ne.CQ)({error:!1,loading:!1,show:!1}),u=(0,l.useRef)(),m=e=>{e.preventDefault();const s=null===u||void 0===u?void 0:u.current;s&&s.show()},{error:g,loading:p}=d;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:g,variant:"warning",children:g}),p&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!p&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{children:"function"===typeof i&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center text-secondary",onClick:i,variant:"link",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})]})}),(0,N.jsx)(Ce.S,{className:"text-primary mt-4 mb-3",children:(0,N.jsx)(ze.e7y,{size:60})}),(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Enter your password",id:"label.enter_your_password.c06bf967"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:`Log in to your account at ${t}.`,id:"client.src.common.components.LoginForm.4804320382"})}),(0,N.jsx)(ds.l1,{onSubmit:async s=>{const{email_address:a,password:t}=s;try{c({loading:!0}),await o(a,t),"function"==typeof n&&n(),c({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:r,scope:"authentication.login"}),initialValues:{email_address:t,password:""},children:e=>{const{errors:s,handleChange:a,handleSubmit:t,isValid:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})}),(0,N.jsx)("a",{"aria-disabled":p,className:"m-0 text-primary "+(p?"disabled":""),onClick:m,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||m(e)},children:(0,N.jsx)(ke.A,{defaultMessage:"Forgot password?",id:"label.forgot_password.30c1d8d3"})})]}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,"aria-label":"password",className:"form-control",isInvalid:(null===l||void 0===l?void 0:l.password)&&(null===s||void 0===s?void 0:s.password),isValid:(null===l||void 0===l?void 0:l.password)&&!(null!==s&&void 0!==s&&s.password),name:"password",onChange:a,placeholder:"Please enter your password",type:"password",value:n.password}),(null===s||void 0===s?void 0:s.password)&&(null===l||void 0===l?void 0:l.password)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.password})]})}),(0,N.jsx)(Ce.S,{className:"mt-3 pt-2",children:(0,N.jsx)(os,{children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column justify-content-center",children:(0,N.jsx)(Me.p0,{block:!0,disabled:!i,size:"lg",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Log in",id:"label.log_in.c189840c"})})})})})]})}})]}),(0,N.jsx)(gs,{email_address:t,ref:u})]})});var Ns=_s;
2var Ss=(0,Ke.Ay)((0,Pe.y)(e=>{const[s,a]=(0,l.useState)("welcome"),{history:t}=e,{getCookie:i}=(0,n.nm)(),r=(0,l.useRef)();(0,l.useEffect)(()=>{},[]);const o=i(`integration_configuration.${(0,z.A)()}`)||{},{email:d,fullname:c}=o;return(0,N.jsxs)(Ce.S,{style:{background:"rgb(236, 239, 238)",minHeight:"100vh"},children:[(0,N.jsxs)(Ue.A,{className:"py-5",children:[(0,N.jsx)(Ce.S,{className:"text-center mb-5",children:(0,N.jsx)("img",{alt:"Solvably Logo",src:Ye,style:{width:300}})}),(0,N.jsxs)(Qe.A,{className:"mt-5 my-lg-5 justify-content-center",children:["welcome"==s&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(Ce.S,{className:"registration-form-container text-center",children:[(0,N.jsx)("h3",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably",id:"label.welcome_to_solvably.9fa6b41f"})}),(0,N.jsxs)("p",{className:"mb-5",children:[(0,N.jsx)(ke.A,{defaultMessage:"We notice that you're using a third-party identity provider.",id:"label.we_notice_that_youre_using_a_third.c6f37159"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Please create an account or log in to continue.",id:"label.please_create_an_account_or_log_in.83d6836d"})]}),(0,N.jsx)(Ce.S,{className:"justify-content-center",children:(0,N.jsx)(ve.A,{onClick:()=>a("register"),size:"lg",style:{maxWidth:"100%",width:250},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create account",id:"label.create_account.798ca2ce"})})}),(0,N.jsx)(Ce.S,{className:"justify-content-center",children:(0,N.jsx)(ve.A,{className:"mt-2",onClick:()=>a("login"),size:"lg",style:{maxWidth:"100%",width:250},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Log in",id:"label.log_in.c189840c"})})})]})})}),"register"==s&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ve.A,{lg:6,children:[(0,N.jsx)(Ge.A,{className:"registration-form-container",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create an account",id:"label.create_an_account.86033f75"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Fill out the form below to create your account",id:"label.fill_out_the_form_below_to_create.bcbbeb47"})}),(0,N.jsx)(cs,{buttonRight:!0,compact:!0,enableBusinessField:!0,buttonSize:"lg",defaultValues:{email_address:d,fullname:c},onFinish:()=>{t.push("/authenticate/redirect")}})]})}),(0,N.jsx)(ve.A,{className:"mt-2",onClick:()=>a("welcome"),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})})]})}),"login"==s&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ve.A,{lg:4,children:[(0,N.jsx)(Ge.A,{className:"registration-form-container",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(Ns,{heading:(0,N.jsx)(ke.A,{defaultMessage:"Log in to Solvably",id:"label.log_in_to_solvably.69b261d0"}),onFinish:()=>{t.push("/authenticate/redirect")}}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)("a",{href:"#",rel:"noreferrer noopener",onClick:e=>{e.preventDefault(),r.current.show()},children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})})})]})}),(0,N.jsx)(ve.A,{className:"mt-2",onClick:()=>a("welcome"),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})})]})})]})]}),(0,N.jsx)(is,{ref:r})]})})),Cs=(0,l.forwardRef)((e,s)=>{let[a,t]=(0,ne.CQ)({error:null,loading:!0});const i=(0,n.nm)(),r=(0,Pe.W6)();(0,l.useEffect)(()=>{const{api:e,setUserOrganizationId:s,tryCookieLogin:a}=i;e.get("/api/auth/redirect").then(async e=>{let{organization_id:t,redirect_url:l}=e;l&&(await a()&&t&&s(t,!0),i.deleteCookie(`integration_configuration.${(0,z.A)()}`),i.deleteCookie(`redirect_configuration.${(0,z.A)()}`),r.push(l))}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;t({error:s})})},[]);const{error:o,loading:d}=a;return(0,N.jsxs)(Ce.S,{className:"pt-5",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{t({error:null})},show:o,variant:"danger",children:o}),d&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})})]})}),Ms=(0,l.forwardRef)((e,s)=>((0,l.useEffect)(()=>{localStorage.setItem("msAuth",Number.parseInt(1e4*Math.random())),window.close()},[]),(0,N.jsx)(N.Fragment,{}
2)));const{Debug:ks,Err:zs,Info:Ts,Success:Is}=(null===Re._$||void 0===Re._$?void 0:Re._$.log)||{},{parseScormManifest:Es}=(null===Re._$||void 0===Re._$?void 0:Re._$.scorm)||{};class Fs extends l.Component{constructor(s){super(s),this.fetchCartridge=async()=>{try{const{cartridge_id:e}=this.state,{app:s}=this.props,{api:a}=s,{cartridge:t}=await a.get(`/api/cartridges/get/${e}`);this.setState({cartridge:t,completion_status:null!==t&&void 0!==t&&t.completed?"completed":"incomplete",suspend_data:null===t||void 0===t?void 0:t.data})}catch(e){zs(e)}},this.getAPIName=()=>{const{version:e}=this.state;switch(e){case"scorm2004":return"API_1484_11";case"scorm12":return"API";default:return null}},this.getRuntime=()=>{const{version:e}=this.state;switch(e){case"scorm2004":return Scorm2004API;case"scorm12":return Scorm12API;default:return null}},this.parseManifest=async()=>{try{const{intl:e}=this.props,{formatMessage:t}=e,{cartridge_id:i}=this.state,l=`/content/cartridges/package/${i}`;let n=await fetch(`${l}/imsmanifest.xml`,{headers:{Accept:"text/xml","Content-Type":"text/xml; charset=UTF-8"},method:"GET"});if("application/xml"!==n.headers.get("Content-Type")){var s,a;const{message:e}=await(null===(s=n)||void 0===s||null===(a=s.json)||void 0===a?void 0:a.call(s))||{},i=t({id:"label.an_unknown_error_occurred.0f56130f",defaultMessage:"An unknown error occurred"});throw e||i}n=await n.text();const{launcher:r,version:o}=await Es(n,l);this.setState({launcher:r,loading:!1,version:o})}catch(e){const{onError:a}=this.props,t=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({loading:!1}),a(t)}},this.handleInitialize=()=>{Is("SCORM initialized successfully."),this.setState({initialized:!0})},this.handleSetExit=async(e,s)=>Ts("exit status:",s),this.handleDataChange=(e,s)=>ks(`\n---- VALUE UPDATED ----\nfield: ${e}\nvalue: ${s}`),this.getHandlers=()=>{const{version:e}=this.state;switch(e){case"scorm2004":return{Initialize:this.handleInitialize,"SetValue.cmi.exit":this.handleSetExit};case"scorm12":return{LMSInitialize:this.handleInitialize,"LMSSetValue.cmi.exit":this.handleSetExit}}},this.formatInitData=e=>((null===e||void 0===e?void 0:e.session_time)&&delete e.session_time,e),this.shouldPersistChanges=()=>{var e;return"readonly"!==(null===this||void 0===this||null===(e=this.state)||void 0===e?void 0:e.mode)},this.init=()=>{const{intl:s,onError:a}=this.props,{formatMessage:t}=s;try{Ts("Initializing SCORM runtime...");const{cartridge:e,cartridge_id:s}=this.state,{data:a}=e||{},i=this.formatInitData(a),l=this.getRuntime(),n=this.getAPIName();if(!n)throw t({id:"label.invalid_or_unsupported_scorm_versi.16b957b0",defaultMessage:"Invalid or unsupported SCORM version detected."});const r={alwaysSendTotalTime:!0,autocommit:!0,lmsCommitUrl:this.shouldPersistChanges()&&`/api/cartridges/commit/${s}`,selfReportSessionTime:!0};window[n]=new l(r),window[n].loadFromJSON(i),this.attachListeners()}catch(e){throw a((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e),t({id:"label.an_error_occurred_during_initializ.91b02528",defaultMessage:"An error occurred during initialization: {e}"},{e:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e})}},this.attachListeners=()=>{const{intl:s}=this.props,{formatMessage:a}=s,t=this.getAPIName(),i=this.getHandlers();ks(`Attempting to attach listeners to window.${t}...`);for(const[l,n]of Object.entries(i||[]))try{window[t].on(l,n),Is(`"${l}" attached.`)}catch(e){throw a({id:"label.failed_to_attach_listener_key_api.fb73811d",defaultMessage:'Failed to attach listener "{key}" (api: {api_name}'},{api_name:t,key:l})}},this.cleanupRuntime=()=>{var s;const{intl:a}=this.props,{formatMessage:t}=a,i=this.getAPIName();if(null===(s=window)||void 0===s||!s[i])return;const l=this.getHandlers();ks(`Attempting to detach listeners from window.${i}...`);for(const[o]of Object.entries(l))try{var n,r;if(null!==(n=window)&&void 0!==n&&n[i])(null===(r=window)||void 0===r?void 0:r[i])&&window[i].clear(o),Is(`"${o}" detached.`)}catch(e){zs(t({id:"label.failed_to_detach_listener_key_api.2b6f38e7",defaultMessage:'Failed to detach listener "{key}" (api: {api_name})'},{api_name:i,key:o}))}ks("Destroying SCORM runtime..."),delete window[i],Is("Runtime destroyed.")};const{cartridge:a,cartridge_id:t}=s;this.state={cartridge:a||{},cartridge_id:(null===a||void 0===a?void 0:a.id)||t||"",completion_status:null,initialized:!1,launcher:null,loading:!0,mode:(null===s||void 0===s?void 0:s.mode)||"active",prev_completion_status:null,prev_suspend_data:null,saving:!1,session_time:"",suspend_data:null,version:null}}async componentDidMount(){const{cartridge:e}=this.state;
2(0,T.isEmpty)(e)&&await this.fetchCartridge(),await this.parseManifest()}componentWillUnmount(){this.cleanupRuntime()}componentDidUpdate(e,s,a){const{initialized:t,version:i}=this.state;i&&!t&&this.init()}render(){const{initialized:e,launcher:s,loading:a}=this.state;return(0,N.jsx)(Ce.S,{className:"scorm-player "+(e?"":"initializing"),children:(0,N.jsx)(Ls,{value:{initialized:e,launcher:s,loading:a},children:(0,N.jsxs)(Me.x_,{defaultSpinnerClassName:"h-100",loading:a||!s,children:[(0,N.jsx)(Bs,{}),!e&&(0,N.jsxs)(Ce.S,{className:"spinner-container d-flex flex-column align-items-center justify-content-center",children:[(0,N.jsx)(Me.y$,{}),(0,N.jsx)("h5",{className:"mt-5 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Initializing...",id:"label.initializing.6f191ff7"})})]})]})})})}}Fs.defaultProps={onError:Function()};var Rs=(0,Ke.Ay)((0,P.G0)(Fs));const Ds=(0,l.forwardRef)((e,s)=>{const{launcher:a}=Os();return(0,N.jsx)("iframe",{className:"scorm-player-frame",ref:s,src:a})});Ds.displayName="SCORMPlayerFrame";var Bs=Ds;const Ps=l.createContext({}),Ls=Ps.Provider,Os=(Ps.Consumer,()=>(0,l.useContext)(Ps));class Hs extends l.Component{constructor(e){super(e),this.state={error:null,loading:!0}}async syncStatus(e){const{app:s}=this.props,{assignment_status:a,scorm:t}=s;let{completion_status:i}=await t.getStatus();if("completed"!=i&&"passed"!=i){a&&a.listen(e);let i=await s.getAssignmentStatus(e);return i&&t.setStatus(i),void await s.subscribeAssignmentStatus({assignment_id:e,callback:e=>{t.setStatus(e)}})}}async componentDidMount(){const{app:e,history:s,intl:a}=this.props,{api:t,scorm:i}=e;e.deleteCookie(`user_organization.${(0,z.A)()}.id`),e.setIsolatedMode(!0);let{learner_id:l,learner_name:n}=await i.getLearner(),{hostname:r,pathname:o}=await i.getUrl(),{group_assignment_id:d,group_id:c,organization_id:h,organization_integration_id:u}=await i.getBasics();if(!l){const{formatMessage:e}=a;return void this.setState({error:e({id:"label.this_scorm_launch_has_invalid_laun.b5150864",defaultMessage:"This SCORM launch has invalid launch data. This may have happened due to a refresh of the page. Please try closing the SCORM window and relaunching."}),loading:!1})}let m="",g="";if(-1!==(null===n||void 0===n?void 0:n.indexOf(","))){let e=null===n||void 0===n?void 0:n.split(",");m=null===e||void 0===e?void 0:e[0],g=null===e||void 0===e?void 0:e[1]}else{let e=null===n||void 0===n?void 0:n.split(" ");m=null===e||void 0===e?void 0:e[0],g=null===e||void 0===e?void 0:e[1]}let p=m+" "+g;t.post("/api/scorm/launch",{group_assignment_id:d,group_id:c,hostname:r,learner_fullname:p,learner_id:l,organization_id:h,organization_integration_id:u,pathname:o}).then(async e=>{let{redirect_url:a}=e;s.push(a)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{error:e,loading:s}=this.state;return(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Ce.S,{className:"pt-5",children:[s&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!s&&e&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"text-center pt-5 pb-3",children:(0,N.jsx)("img",{alt:"Solvably Logo",src:Ye,style:{width:300}})}),(0,N.jsx)(Qe.A,{className:"my-3 my-lg-5 justify-content-center",children:(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)(Ge.A,{className:"registration-form-container",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"There was an error launching content",id:"label.there_was_an_error_launching_conte.de0a9a5b"})}),(0,N.jsx)("p",{children:e})]})})})})]})]})})}}var Us=(0,Ke.Ay)((0,Pe.y)((0,n.G0)(Hs)));class Qs extends l.Component{constructor(e){super(e),this.state={error:null,loading:!0}}async componentDidMount(){const{app:e,history:s}=this.props,{token:a}=this.props.match.params,{api:t}=e;e.deleteCookie(`user_organization.${(0,z.A)()}.id`),t.post("/lti/launch",{token:a}).then(async a=>{let{access_token:t,integration_config:i,redirect_config:l,redirect_url:n}=a,{organization_id:r}=i;if(e.setCookie(`redirect_configuration.${(0,z.A)()}`,l||""),e.setUserOrganizationId(r,!0),t){let a=await e.getUserBasics();a?(await e.doLogin(a,r),s.push(n)):this.setState({error:"Unable to complete log in process due to an unknown error",loading:!1})}else e.setCookie(`integration_configuration.${(0,z.A)()}`,i||""),s.push(n)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,saving:!1})})}render(){const{error:e,loading:s}=this.state;return(0,N.jsxs)(Ce.S,{className:"pt-5",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:e,variant:"danger",children:e}),s&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})})]})}}var Vs=(0,Pe.y)((0,n.G0)(Qs));var Gs=s=>{const a=(0,Pe.W6)(),{doLocalLogout:t,isLoggedIn:i,tryServerLogout:r,verifyLogin:o}=(0,n.nm)(),[d,c,h]=(0,ne.CQ)({isLoggedOut:!i});return(0,l.useEffect)(()=>{(async()=>{try{await o()&&await r(),await t(),c(()=>({isLoggedOut:!0}))}catch(e){w(e)}})()},[]),(0,l.useEffect)(()=>{d.isLoggedOut&&a.push("/")},[d.isLoggedOut]),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center vh-100",children:(0,N.jsx)(Me.y$,{})})};var Ws=t.p+"static/media/ie11-astro.107dcdb42a2df7083b3ca07b6103939b.svg";var Ks=t.p+"static/media/ie11-dino.c2e4d546eb8bed7af88319d422bed8df.svg",Ys=t(24009),qs=t(67232),Js=t(43483);var Xs={asteroid:Ws,chrome:qs,dino:Ks,edge:Js,firefox:Ys},Zs=t(40472);const $s=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({visible:!1}),{visible:n}=a,r=()=>t({visible:!0}),o=()=>i();return(0,l.useImperativeHandle)(s,()=>
2({hide:o,show:r,visible:n})),(0,N.jsxs)(xe,{backdrop:"static",centered:!0,className:"extinction-modal",enforceFocus:!0,id:"ie11ExtinctionModal",onHide:()=>{const e=(new Date).getTime()+864e5,s=JSON.stringify({expiry:e,value:!0});localStorage.setItem("has_seen_extinction_notice",s),o()},show:n,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0}),(0,N.jsxs)(xe.Body,{className:"d-flex flex-column align-items-center",children:[(0,N.jsxs)(Ce.S,{className:"extinction-modal-graphic",children:[(0,N.jsx)(Zs.A,{alt:"ie11 extinction dino",className:"ie11-dino",src:null===Xs||void 0===Xs?void 0:Xs.dino}),(0,N.jsx)(Zs.A,{alt:"ie11 extinction asteroid",className:"ie11-asteroid",src:null===Xs||void 0===Xs?void 0:Xs.asteroid})]}),(0,N.jsxs)(Ce.S,{className:"extinction-modal-text d-flex flex-column align-items-center",children:[(0,N.jsx)("span",{className:"h3",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Internet explorer nearing extinction",id:"label.internet_explorer_nearing_extincti.5997c216"})})}),(0,N.jsx)("p",{children:"Solvably does not support this browser. For a better experience, try using a different browser, such as one of the following:"})]}),(0,N.jsxs)(Qe.A,{className:"extinction-modal-links m-0",children:[(0,N.jsx)(Ve.A,{as:ve.A,className:"browser-link",href:"https://www.mozilla.org/en-US/firefox/new/?redirect_source=firefox-com",lg:3,rel:"noopener noreferrer",target:"_blank",variant:"link",xs:12,children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center px-5 pt-2",children:[(0,N.jsx)(Zs.A,{alt:"firefox logo",className:"firefox",src:null===Xs||void 0===Xs?void 0:Xs.firefox}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Firefox",id:"label.firefox.2f262335"})})]})}),(0,N.jsx)(Ve.A,{as:ve.A,className:"browser-link",href:"https://www.microsoft.com/en-us/edge",lg:3,rel:"noopener noreferrer",target:"_blank",variant:"link",xs:12,children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center px-5 pt-2",children:[(0,N.jsx)(Zs.A,{alt:"edge logo",className:"edge",src:null===Xs||void 0===Xs?void 0:Xs.edge}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Edge",id:"label.edge.0f82fe72"})})]})}),(0,N.jsx)(Ve.A,{as:ve.A,className:"browser-link",href:"https://www.google.com/chrome/",lg:3,rel:"noopener noreferrer",target:"_blank",variant:"link",xs:12,children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center px-5 pt-2",children:[(0,N.jsx)(Zs.A,{alt:"chrome logo",className:"chrome",src:null===Xs||void 0===Xs?void 0:Xs.chrome}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Chrome",id:"label.chrome.c4ef2ec2"})})]})})]})]})]})});$s.displayName="IE11ExtinctionModal";var ea=$s,sa=t(25966),aa=t(81124),ta=t(86913);var ia=e=>{const{subscribeNotifications:s,unsubscribeNotifications:a,userId:t}=(0,P.nm)(),[i,n]=(0,ne.CQ)({user_notifications:[]}),{user_notifications:r}=i,o=e=>n({user_notifications:[...i.user_notifications,e]});return(0,l.useEffect)(()=>(s({id:t,callback:o}),()=>a(t)),[]),(0,N.jsx)(Ce.S,{className:"notification-alerts",children:r.map((e,s)=>e?(0,N.jsx)(ca,{user_notification:e},s):(0,N.jsx)(N.Fragment,{}))})},la=t(50885),na=t(29775),ra=t(3018),oa=t.n(ra);var da=t.p+"static/media/achievement.b69a724fcb525dae4f5cf7d86d2a82c0.svg";var ca=e=>{var s;const[a,i]=(0,ne.CQ)({visible:!0}),{visible:l}=a,{user_notification:n}=e,{data:r,event_token:o}=n,d=uy(o,r);if(!d)return;const c=!(null===r||void 0===r||null===(s=r.achievement)||void 0===s||!s.icon_token)||!(null===r||void 0===r||!r.user_achievement_id),h=oa()("toast-notification",{"has-icon":c});return(0,N.jsxs)(la.A,{autohide:!0,className:h,delay:12500,onClose:()=>i({visible:!1}),show:l,transition:na.A,children:[c&&(0,N.jsx)(Ce.S,{className:"toast-icon",children:(()=>{var e;switch(!0){case!(null===r||void 0===r||null===(e=r.achievement)||void 0===e||!e.icon_token):return(0,N.jsx)(Zs.A,{src:t(42806)(`./${r.achievement.icon_token}.png`)});case!(null===r||void 0===r||!r.user_achievement_id):return(0,N.jsx)(Zs.A,{src:da})}})()}),(0,N.jsx)(la.A.Header,{closeButton:!0,children:(0,N.jsx)("h6",{className:"me-auto",children:null===d||void 0===d?void 0:d.content})})]})},ha=t(29830),ua=t.n(ha);const ma=e=>{const{user:s}=e;return(0,N.jsx)(N.Fragment,{children:(null===s||void 0===s?void 0:s.fullname)||""})};ma.defaultProps={user:{}},ma.propTypes={user:ua().object};var ga=ma,pa=t(45291),xa=t(21052),va=t(55293);var fa=e=>{const{disabled:s,is_custom:a,onClose:t,onSubmit:i,submitting:n}=e,r=(0,l.useRef)((0,me.A)()),[o,d,c]=(0,ne.CQ)({file:null,submitting:!1});return(0,l.useEffect)(()=>c,[]),(0,N.jsxs)(Ce.S,{children:[n?(0,N.jsx)(Ma,{job_id:r.current,submitting:n}):(0,N.jsx)(Na,{disabled:s,is_custom:a,onChange:e=>d(s=>(0,F.A)((0,F.A)({},s),{},{file:e})),submitting:n}),(0,N.jsxs)("div",{className:"clearfix",style:{marginTop:15},children:[o.file&&(0,N.jsx)(ve.A,{className:"float-end",disabled:n||s,onClick:()=>"function"==typeof i&&i(o.file,r.current),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload",id:"label.upload.865e89de"})}),t&&!a&&(0,N.jsx)(ve.A,{disabled:n||s,onClick:t,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})]})]})},ja=t(5480),_a=t(77388);const ba={jpeg:"image/jpeg",png:"image/png"},Aa=(0,l.forwardRef)((s,a)=>{const{allowed_types:t,aspectRatio:i,croppable:n,is_custom:r,maxHeight:o,maxWidth:d,onClose:c,onFinish:h,submitting:u,transparency:m,type:g}=s,p=ba[g]||"image/jpeg",x=(0,l.useRef)(),{formatMessage:v}=(0,ja.A)(),[f,j,_]=(0,ne.CQ)({error:null,file:(null===s||void 0===s?void 0:s.file)||null,
2job_id:null,step:0}),b=async e=>{const s=await(e=>new Promise(s=>{const a=document.createElement("img");a.src=URL.createObjectURL(e),a.onload=()=>{s({height:a.height,ratio:a.width/a.height,width:a.width}),URL.revokeObjectURL(a.src)}}))(e);return i&&i!==s.ratio?{error:`Incorrect aspect ratio. Please select an image with an aspect ratio of ${i}.`,valid:!1}:d&&o&&(s.width>d||s.height>o)?{error:`Maximum dimensions exceeded. Please select an image with dimensions not exceeding ${d} x ${o}`,valid:!1}:d&&s.width>d?{error:`Image must not be larger than ${d}px wide`,valid:!1}:o&&s.height>o?{error:`Image must not be larger than ${d}px tall`,valid:!1}:{valid:!0}},A=async e=>{if(!t.includes(null===e||void 0===e?void 0:e.type))return j({error:v({id:"label.invalid_file_type_please_select_an.35370a93",defaultMessage:"Invalid file type. Please select an image with one of the following types: jpg, jpeg, png"}),file:null});if(n)return j({file:e,step:1});const{error:s,valid:a}=await b(e);if(!a)return j({error:s,file:null});(e=>{var s;j({file:e,step:2});const a=new Blob([e],{type:e.type});a.file_name=null===f||void 0===f||null===(s=f.file)||void 0===s?void 0:s.name,"function"==typeof h&&h(a,f.job_id)})(e)},y=async()=>{const s=null===x||void 0===x?void 0:x.current,a=null===s||void 0===s?void 0:s.cropper;if(!a)return j({error:v({id:"label.image_cropper_is_not_ready_please.724aeb9b",defaultMessage:"Image cropper is not ready. Please try again."})});try{const e=a.getCroppedCanvas({fillColor:m?"transparent":"#FFFFFF"}),s=await new Promise((s,a)=>{e.toBlob(e=>e?s(e):a(new Error("Failed to create cropped image")),p,1)}),t=await((e,s)=>{let{maxHeight:a,maxWidth:t,mimeType:i,quality:l=1}=s;return new Promise((s,n)=>{const r=new Image;r.onload=()=>{let{height:e,width:o}=r;t&&o>t?(e*=t/o,o=t):a&&e>a&&(o*=a/e,e=a);const d=document.createElement("canvas");d.width=Math.round(o),d.height=Math.round(e),d.getContext("2d").drawImage(r,0,0,d.width,d.height),d.toBlob(e=>{if(URL.revokeObjectURL(r.src),!e)return n(new Error("Failed to create image blob"));s(e)},i,l)},r.onerror=()=>{URL.revokeObjectURL(r.src),n(new Error("Failed to load image for resizing"))},r.src=URL.createObjectURL(e)})})(s,{maxHeight:o,maxWidth:d,mimeType:p});j({step:2}),t.file_name=f.file.name,"function"==typeof h&&h(t,f.job_id)}catch(e){w(e),j({error:v({id:"label.there_was_an_error_processing_the.9ce0d82d",defaultMessage:"There was an error processing the image. Please try again with a different image."})})}},S=()=>j({step:0});(0,l.useImperativeHandle)(a,()=>({resetCropper:S})),(0,l.useEffect)(()=>(j({job_id:(0,me.A)()}),_),[]);const{error:C}=f;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>j({error:null}),show:C,variant:"danger",children:C}),(()=>{const{step:e}=f;switch(e){case 0:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Na,{file:f.file,is_custom:r,onChange:A}),c&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("br",{}),(0,N.jsx)(ve.A,{disabled:u,onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})]})]});case 1:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_a.A,{aspectRatio:i,guides:!0,ref:x,src:URL.createObjectURL(null===f||void 0===f?void 0:f.file),style:{height:400,width:"100%"}}),(0,N.jsx)("br",{}),c&&(0,N.jsx)(ve.A,{disabled:u,onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{className:c&&"float-end",onClick:y,children:(0,N.jsx)(ke.A,{defaultMessage:"Upload",id:"label.upload.865e89de"})})]});case 2:return(0,N.jsx)(Ma,{job_id:f.job_id,submitting:u})}})()]})});Aa.displayName="ImageCropUpload",Aa.defaultProps={allowed_types:["image/png","image/jpeg","image/jpg"],aspectRatio:1,croppable:!0,file:null,is_custom:!1,maxHeight:500,maxWidth:500,type:"jpeg"};var ya=Aa;const wa=["disabled","is_custom","onChange","style"];var Na=(0,l.forwardRef)((e,s)=>{const{disabled:a,is_custom:t,onChange:i,style:n}=e,r=(0,he.A)(e,wa),[o,d]=(0,l.useState)(e.file||null),c=e=>{e&&(d(e),"function"==typeof i&&i(e))};return(0,l.useEffect)(()=>{e.file&&c(o)},[e.file]),(0,N.jsx)(N.Fragment,{children:t?(0,N.jsx)(Ce.S,{className:"custom-file",children:(0,N.jsx)("input",{className:"custom-file-input",disabled:a,id:"customFile",onChange:e=>{var s,a;return c(null===e||void 0===e||null===(s=e.target)||void 0===s||null===(a=s.files)||void 0===a?void 0:a[0])},type:"file"})}):(0,N.jsx)(Ce.S,{style:n,children:(0,N.jsx)("input",(0,F.A)({className:"form-control",disabled:a,onChange:e=>{var s,a;return c(null===e||void 0===e||null===(s=e.target)||void 0===s||null===(a=s.files)||void 0===a?void 0:a[0])},ref:s,style:{height:"fit-content"},type:"file"},r))})})}),Sa=t(19497);const Ca=(0,l.forwardRef)((e,s)=>
2{const{job_id:a,striped:t}=e,i=(0,l.useRef)(),[n,r,o]=(0,ne.CQ)({comp_pct:0,message:"Uploading"});return(0,l.useEffect)(()=>((async()=>{i.current=await f("files","FileUploadStatus"),i.current.emit("listen",a),i.current.on("job-status-"+a+":comp_pct",e=>{let{comp_pct:s}=e;y("comp_pct",s),r(e=>(0,F.A)((0,F.A)({},e),{},{comp_pct:s}))}),i.current.on("job-status-"+a+":message",e=>{let{message:s}=e;y("message",s),r(e=>(0,F.A)((0,F.A)({},e),{},{message:s}))})})(),o),[a]),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("span",{children:[n.message,"..."]}),(0,N.jsx)(Sa.A,{animated:!0,now:n.comp_pct>=0?n.comp_pct:100,striped:t})]})});Ca.defaultProps={striped:!0};var Ma=Ca;const ka=(0,l.forwardRef)(function(s,a){const{aspectRatio:t,maxHeight:i,maxWidth:n,onClose:r,onFinish:o}=s,d=(0,l.useRef)(),[c,h,u]=(0,ne.CQ)({file:null,reject:Function(),resolve:Function(),show:null}),m=e=>new Promise((s,a)=>{h(t=>(0,F.A)((0,F.A)({},t),{},{file:e,reject:a,resolve:s,show:!0}))});(0,l.useImperativeHandle)(a,()=>({show:m}));return(0,N.jsxs)(xe,{backdrop:"static",backdropClassName:"image-upload-backdrop",className:"image-upload-modal",show:null===c||void 0===c?void 0:c.show,onHide:()=>{"function"===typeof c.resolve&&c.resolve(null),u()},children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})})}),(0,N.jsx)(xe.Body,{children:(null===c||void 0===c?void 0:c.file)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_a.A,{aspectRatio:t,guides:!0,onInitialized:e=>d.current=e,src:URL.createObjectURL(null===c||void 0===c?void 0:c.file),style:{height:400,width:"100%"}}),(0,N.jsx)("br",{}),(0,N.jsx)(ve.A,{className:r&&"float-end",onClick:async()=>{var s;if(d.current)try{const e=d.current.getCroppedCanvas({fillColor:"#FFFFFF"}),a=await new Promise((s,a)=>{e.toBlob(e=>e?s(e):a(new Error("Failed to create cropped image")),"image/jpeg",1)}),t=await new Promise((e,s)=>{const t=new Image;t.onload=()=>{let{height:a,width:l}=t;const r=Math.max(l,a);l=Math.min(n*(l/r),l),a=Math.min(i*(a/r),a);const o=document.createElement("canvas");o.width=Math.round(l),o.height=Math.round(a);o.getContext("2d").drawImage(t,0,0,o.width,o.height),o.toBlob(a=>{if(URL.revokeObjectURL(t.src),!a)return s(new Error("Failed to resize image"));e(a)},"image/jpeg",1)},t.onerror=()=>{URL.revokeObjectURL(t.src),s(new Error("Failed to load image for resizing"))},t.src=URL.createObjectURL(a)});s=t,"function"===typeof c.resolve&&(c.resolve(s),"function"===typeof o&&o(s),u())}catch(e){w(e)}},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload",id:"label.upload.865e89de"})})]})})]})});ka.defaultProps={aspectRatio:1,maxHeight:500,maxWidth:500,onClose:Function(),onFinish:Function()};var za=ka;const Ta=l.createContext({}),Ia=Ta.Provider,Ea=Ta.Consumer,Fa=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(Ea,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{challenge:s,ref:e=>{this.comp=e}}))})}}return s},Ra=()=>(0,l.useContext)(Ta);var Da=t(7494),Ba=t(33641);const Pa=["value"];var La=e=>{let{value:s}=e,a=(0,he.A)(e,Pa);const t=(0,Ba.x)(new Date(s||Date.now()));let i=["second","hour","minute"].includes(t.unit);return(0,N.jsx)(Da.A,(0,F.A)((0,F.A)({},a),{},{numeric:"auto",unit:t.unit,updateIntervalInSeconds:i?10:void 0,value:t.value}))};const Oa=e=>{let{children:s,condition:a,wrapper:t}=e;return a?t(s):s};var Ha=Oa,Ua=t(30793),Qa=t(20134),Va=t(52171),Ga=t(15715),Wa=t(25558);const Ka=e=>{var s,a,t,i,r,o;const{className:d,customIcon:c,innerStyle:h,isSpeaking:u,redirToProfile:m,role:g,showOnline:p,showTooltip:x,speakingIndicator:v,style:f,theme:j,user:_,withBorder:b}=e,{portfolio_token:A}=_||{},y=(0,Pe.W6)(),{styles:w,subscribeAllUsersStatus:S,systemUser:C,unsubscribeAllUsersStatus:M}=(0,n.nm)(),k=(null===_||void 0===_?void 0:_.id)===(null===C||void 0===C?void 0:C.id),[z,T]=(0,l.useState)(!1),I=()=>{m&&A&&y.push(`/portfolio/${A}`)};(0,l.useEffect)(()=>(!_||null!==_&&void 0!==_&&_.is_agent||S(null===_||void 0===_?void 0:_.id,e=>T(e)),M),[_]);let E={};if(f&&(E=(0,F.A)({},f)),!_)return(0,N.jsx)(N.Fragment,{});const R=(null===(s=E)||void 0===s?void 0:s.height)||(null===(a=E)||void 0===a?void 0:a.width),D=(null===e||void 0===e?void 0:e.size)||R;
2E.width=(null===(t=E)||void 0===t?void 0:t.width)||D,E.height=(null===(i=E)||void 0===i?void 0:i.height)||D;const B=k?Ga:null!==(r=null===_||void 0===_||null===(o=_.avatar)||void 0===o?void 0:o.location)&&void 0!==r&&r,P=!B,L=null===_||void 0===_?void 0:_.fullname,O=B||Wa,H=p&&z?"online":"offline",U=(null===_||void 0===_?void 0:_.fullname)||"",Q=["dark","light"].includes(j)?j:"",V=w&&w["gray-300"],G=null===_||void 0===_?void 0:_.is_agent;return(0,N.jsx)(Oa,{condition:x,wrapper:e=>(0,N.jsx)(Ua.A,{overlay:(0,N.jsx)(Qa.A,{children:(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)(Ce.S,{style:{fontWeight:700},children:U}),(0,N.jsx)(Ce.S,{children:g})]})}),children:(0,N.jsx)("div",{style:{width:"max-content"},children:e})}),children:(0,N.jsx)(N.Fragment,{children:P?(0,N.jsxs)(Ce.S,{className:`user-icon-container ${b?"with-border":""} ${Q} ${G?"is-agent":""} ${d}`,style:E,children:[(0,N.jsxs)(Ce.S,{className:`user-icon rounded-circle ${m&&A?"clickable":""} ${p?H:""} ${v&&u?"speaking":""}`,onClick:I,style:(0,F.A)({maxHeight:D,maxWidth:D},h),children:[(0,N.jsxs)("span",{className:"visually-hidden",children:[U,",",g,",",H]}),(0,N.jsx)(Ce.S,{"aria-hidden":!0,className:"user-icon-inner",children:(0,N.jsx)(Va.Ay,{color:V,fgColor:"black",name:L,onClick:I,round:!0,size:D,style:{verticalAlign:"initial"},title:U})}),!k&&!p&&c]}),G&&(0,N.jsx)(Ce.S,{className:"user-icon-agent-badge",children:"AI"})]}):(0,N.jsxs)(Ce.S,{className:`user-icon-container ${b?"with-border":""} ${Q} ${G?"is-agent":""} ${d}`,style:E,children:[(0,N.jsxs)(Ce.S,{className:`user-icon ${m&&A?"clickable":""} ${!k&&p?H:""} ${v&&u?"speaking":""}`,onClick:I,style:(0,F.A)({backgroundColor:k&&"white",maxHeight:D,maxWidth:D},h),children:[(0,N.jsx)(Ce.S,{className:"user-icon-inner",children:(0,N.jsx)(Zs.A,{alt:`${U} avatar - ${g} ${H}`,className:"icon-img",fluid:!0,src:O})}),!k&&!p&&c]}),G&&(0,N.jsx)(Ce.S,{className:"user-icon-agent-badge",children:"AI"})]})})})};Ka.defaultProps={className:"",customIcon:null,redirToProfile:!1,role:"",showOnline:!0,size:45,speakingIndicator:!1,theme:"light",user:null,withBorder:!1};var Ya=Ka,qa=t(23525);var Ja=e=>{const s=(0,n.nm)(),{userId:a}=s,{challengeComplete:t,contributors:i,submission:l}=e;if(!l)return(0,N.jsx)(N.Fragment,{});const{user:r}=l;return(0,N.jsxs)(Qe.A,{noGutters:!0,className:"phase-recap"+(t?" challenge-recap":""),children:[(0,N.jsxs)(Ve.A,{className:"mb-4",sm:6,children:[(0,N.jsx)("p",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Submitted by",id:"label.submitted_by.1c84cbb4"})}),r&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"mt-3",children:[(0,N.jsx)(Ce.S,{className:"d-inline-block align-middle",children:(0,N.jsx)(Ya,{className:"mt-1",size:40,user:r})}),(0,N.jsxs)(Ce.S,{className:"d-inline-block align-middle ms-3",children:[(0,N.jsx)("h6",{className:"mb-1",children:null===r||void 0===r?void 0:r.fullname}),(0,N.jsx)("p",{className:"mb-0",children:(0,N.jsx)(La,{value:l.created_at})})]})]})}),!r&&(0,N.jsx)("h6",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"N/A",id:"label.na.e2f79e5b"})})]}),(0,N.jsxs)(Ve.A,{sm:6,children:[t?(0,N.jsx)("p",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Total contributions",id:"label.total_contributions.faa40ee9"})}):(0,N.jsx)("p",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Contributions",id:"label.contributions.7219a025"})}),(0,N.jsx)(qa.A,{borderless:!0,size:"sm",children:i.map((e,s)=>{let t=e&&e.user,i=e&&e.contributions?e.contributions:0;if(!t)return"";let l=a===t.id;return(0,N.jsxs)("tr",{className:l?"table-primary":"",style:{borderRadius:5},children:[(0,N.jsx)("td",{children:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center bg-transparent",children:(0,N.jsx)(Ya,{className:"d-flex align-items-center",showOnline:!1,size:20,user:t})})}),(0,N.jsx)("td",{children:(0,N.jsx)("strong",{className:"bg-transparent shadow-none",children:t.fullname})}),(0,N.jsx)("td",{className:"text-end text-primary",children:(0,N.jsx)("strong",{className:"bg-transparent shadow-none",children:i})})]},s)})})]})]})};var Xa=e=>{const{contributors:s,onNext:a,phase:t,submission:i}=e,{getRandomIntRange:l}=(0,P.hc)(),{getPhaseTitle:n,team:r}=Ra(),o=new Array(50).fill(1);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{"aria-hidden":"true",className:"confetti",role:"presentation",children:[o.map((e,s)=>{const a={animationDelay:`${l(0,500)}ms`,animationDuration:`${l(700,1200)}ms`,transform:`rotate(${l(-80,80)}deg)`};return(0,N.jsx)(Ce.S,{className:"confetto",style:a},s)}),(0,N.jsx)("div",{className:"medal-container",children:(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Ru,{phase:t,size:32})})})]}),(0,N.jsx)(Ce.S,{className:"p-lg-4 clearfix",id:"phase-celebration-content",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)("h3",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Way to go, <span>{teamName}</span>!",id:"label.way_to_go_teamname.33b7820c",values:{span:e=>(0,N.jsx)("span",{children:e}),teamName:r&&r.name}})}),(0,N.jsx)("p",{className:"text-center mt-2 mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your team has completed the <b>{phaseTitle}</b> phase. Good job!",id:"label.your_team_has_completed_the_phaset.262c2e8b",values:{b:e=>(0,N.jsx)("b",{children:e}),phaseTitle:n(t)}})}),(0,N.jsx)(Ja,{contributors:s,submission:i}),(0,N.jsx)(Qe.A,{className:"mt-3 justify-content-md-center",children:(0,N.jsx)(Ve.A,{className:"p-0",md:"auto",children:(0,N.jsx)(ve.A,{onClick:()=>a(t),size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Continue",id:"label.continue.31fbef16"})})})})]})})]})},Za=t(42472);var $a=e=>{const{animatablePhases:s,challengeComplete:a,currentPhase:t,phase:i,size:n,unlockCurrentPhase:r}=e,{challenge_type:o,getPhaseTitle:d}=Ra(),{num_phases:c}=Za.Ay[o]||Za.Ay.classic,h=(e,t)=>a?`phase phase-${e} ${e!==c?"no-anim complete":"active no-anim"}`:`phase phase-${e} ${t>e?"complete":""} ${t===e&&r?"active":""} ${-1===s.indexOf(e)?"no-anim":""}`,[u,m]=(0,l.useState)(h(i,t));(0,l.useEffect)(()=>{a&&i===c&&setTimeout(()=>{m(`${u.replace("active no-anim","complete")}`)},1500)},[]),(0,l.useEffect)(()=>{m(h(i,t))},[t,r]);const[g,p]=(0,l.useState)(u.includes("active"));return(0,l.useEffect)(()=>{p(u.includes("active"))},[u]),(0,N.jsx)(Ve.A,{className:u,lg:n,children:(0,N.jsxs)(Ce.S,{className:"contents",children:[(0,N.jsx)(Ce.S,{className:"icon-container",children:(0,N.jsx)(Ce.S,{className:"icon",children:g?(0,N.jsx)(Ru,{phase:i,size:40}):""})}),(0,N.jsx)(Ce.S,{className:"text",children:d(i)}),(0,N.jsx)("h2",{className:"number",children:i})]})})};var et=e=>{const{animatablePhases:s,challengeComplete:a,currentPhase:t,unlockCurrentPhase:i}=e;return(0,N.jsxs)(Qe.A,{className:"next-phase-animation-blocks",children:[(0,N.jsx)($a,{animatablePhases:s,challengeComplete:a,currentPhase:t,phase:1,size:7,unlockCurrentPhase:i}),(0,N.jsx)($a,{animatablePhases:s,challengeComplete:a,currentPhase:t,phase:2,size:5,unlockCurrentPhase:i}),(0,N.jsx)($a,{animatablePhases:s,challengeComplete:a,currentPhase:t,phase:3,size:4,unlockCurrentPhase:i}),(0,N.jsx)($a,{animatablePhases:s,challengeComplete:a,currentPhase:t,phase:4,size:4,unlockCurrentPhase:i}),(0,N.jsx)($a,{animatablePhases:s,challengeComplete:a,currentPhase:t,phase:5,size:4,unlockCurrentPhase:i})]})};var st=e=>{const{animatable_phases:s,next_phase:a,onContinue:t,onPrev:i,phase:l,unlock_current_phase:n}=e,{getPhaseDescription:r,getPhaseTitle:o}=Ra();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsx)(ve.A,{className:"float-start",onClick:()=>i(a),size:"sm",variant:"quaternary",children:(0,N.jsx)(ze.QVr,{})}),(0,N.jsx)(ve.A,{className:"float-end",onClick:t,size:"sm",variant:"quaternary",children:(0,N.jsx)(ze.QCr,{})})]}),(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Ru,{phase:l,size:50})}),(0,N.jsxs)(Ce.S,{className:"content clearfix",children:[(0,N.jsxs)("h4",{className:"text-center",children:["Next Up: ",o(a)]}),(0,N.jsx)("p",{className:"text-center mt-3",children:r(a)}),(0,N.jsx)(et,{animatablePhases:s,challengeComplete:!1,currentPhase:l,unlockCurrentPhase:n}),(0,N.jsx)(Qe.A,{className:"mt-4 justify-content-md-center",children:(0,N.jsx)(Ve.A,{className:"p-0",md:"auto",children:(0,N.jsx)(ve.A,{block:!0,onClick:t,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Continue to {phaseTitle}",id:"label.continue_to_phasetitle.0e14201c",values:{phaseTitle:o(a)}})})})})]})]})};class at extends l.Component{constructor(e){super(e),this.showCelebration=e=>{const{app:s,challenge:a}=this.props,{api:t}=s;e<1||e>4||(this.setState({animatable_phases:[],loading:!0,page:1,phase:e,show:!0,unlock_current_phase:!0}),t.get("/api/challenges/phase/recap/"+e,{challenge_id:a.project.id}).then(s=>{let{contributors:a,submission:t}=s;this.setState({contributors:a,loading:!1,next_phase:e+1,submission:t})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),console.error(s)}))},this.handleNext=e=>{this.setState({page:2}),setTimeout(()=>{this.setState({animatable_phases:[e,e+1],phase:e+1,unlock_current_phase:!1}),setTimeout(()=>{this.setState({unlock_current_phase:!0})},1500)},250)},this.handlePrev=e=>{this.showCelebration(e-1)},this.handleContinue=()=>{this.setState({show:!1})},this.state={animatable_phases:[],contributors:[],error:null,loading:!1,next_phase:1,page:1,phase:1,show:!1,submission:null,unlock_current_phase:!0},this.dialog=null}render(){const{handleHide:e}=this.props,{animatable_phases:s,contributors:a,error:t,loading:i,next_phase:l,page:n,phase:r,show:o,submission:d,unlock_current_phase:c}=this.state;return(0,N.jsxs)(xe,{"aria-labelledby":"phase-celebration-content","aria-live":"assertive",backdrop:"static",className:"phase-celebration-container",onHide:()=>{"function"==typeof e&&e()},show:o,size:"lg",children:[i&&(0,N.jsx)(Ce.S,{className:"mt-5 mb-5",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:e=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),!i&&!t&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"page-"+n,children:[1===n&&(0,N.jsx)(Xa,{contributors:a,onNext:this.handleNext,phase:r,submission:d}),2===n&&(0,N.jsx)(st,{animatable_phases:s,next_phase:l,onContinue:this.handleContinue,onPrev:this.handlePrev,phase:r,unlock_current_phase:c})]})})]})}}var tt=(0,n.G0)(Fa(at));var it=e=>{const{agent_name:s,is_agent:a,user_id:t}=e,{api:i}=(0,n.nm)(),[r,o]=(0,l.useState)(null),[d,c]=(0,l.useState)(null),[h,u]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{a?c({id:"agent",fullname:s||"AI",is_agent:!0}):(u(!0),i.get("/api/users/profile/basics/get-by-id",{user_id:t}).then(e=>{let{user:s}=e;c(s),u(!1)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o(s),u(!1)}))},[]),(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"challenge-user-is-typing",children:[(0,N.jsx)("div",{className:"typing-loader"}),!h&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{children:(0,N.jsx)(Ya,{className:"me-1",style:{height:20,width:20},user:d})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"{user} is typing...",description:"",id:"label.user_is_typing.985f566a",values:{user:null===d||void 0===d?void 0:d.fullname}})})]})]})})};const lt=l.createContext({}),nt=lt.Provider,rt=lt.Consumer,ot=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(rt,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{assignment_wrapper:s,ref:e=>this.comp=e}))})}}return s};lt.displayName="AssignmentWrapperContext";const dt=()=>(0,l.useContext)(lt),ct=t(98223);class ht extends l.Component{constructor(s){var a;super(s),a=this,this.clearError=()=>this.setState({error:null}),this.loadChallengeInfo=()=>{const{app:e,group_member_assignment_component_id:s}=this.props,a=e.api;return new Promise((e,t)=>
2{a.get(`/api/challenges/get/${s}`).then(s=>{let{challenge:a,facilitators:t,group:i,group_assignment:l,team:n}=s;this.setState({challenge_id:null===a||void 0===a?void 0:a.id,error:null,facilitators:t,group:i,group_assignment:l,group_id:l&&l.group_id,project:a,team:n},()=>{this.setState({is_facilitator:this.isUserFacilitator()},()=>{e({group:i,group_assignment:l,project:a,team:n})})})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,a=null===e||void 0===e?void 0:e.data;a&&"noexist"===a.reason?this.setState({project:!1,team:!1}):this.setState({error:s}),t(s)})})},this.reloadProjectInfo=()=>{const{app:e,group_member_assignment_component_id:s}=this.props,a=e.api;return new Promise((e,t)=>{a.get(`/api/challenges/get/${s}`).then(s=>{let{challenge:a,team:t}=s;this.setState({loading:!1,project:a,team:t},()=>{e({project:a,team:t})})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,a=null===e||void 0===e?void 0:e.data;a&&"noexist"===a.reason?this.setState({loading:!1,project:!1,team:!1}):this.setState({error:s}),t(s)})})},this.reloadTeam=()=>{const{app:e,group_member_assignment_component_id:s}=this.props;e.api.get(`/api/challenges/get/${s}`).then(e=>{let{team:s}=e;this.setState({loading:!1,team:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.setLearnerStarted=()=>{var e,s;const a=this.getChallengeMember();if(null!==a&&void 0!==a&&a.start)return;const{app:t}=this.props,i=t.api,l=null===(e=this.state)||void 0===e||null===(s=e.project)||void 0===s?void 0:s.id;l&&i.post("/api/challenges/start/",{challenge_id:l}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.isPhaseComplete=e=>{const s=this.getAllSubphaseData(e);for(const a of s)if(null===a||void 0===a||!a.is_complete)return!1;return!0},this.isPhaseStarted=e=>{const s=this.getAllSubphaseData(e);for(const a of s)if(!(0,T.isEmpty)(null===a||void 0===a?void 0:a.data))return!0;return!1},this.isUserFacilitator=()=>{const{app:e}=this.props,{team:s}=this.state;if(e.userIsLearner())return!1;const a=Array.isArray(null===s||void 0===s?void 0:s.facilitators)?s.facilitators:[];for(let t=0;t<a.length;t++){const s=a[t];if(s&&s.user_id===e.user.id)return!0}return!1},this.loadGroupMemberAssignment=async()=>{const{app:e}=this.props,s=e.api,{project:a}=this.state,t=null===a||void 0===a?void 0:a.id;try{const{group_member_assignment_id:e,group_member_id:a,organization_member_id:i}=await s.get("/api/challenges/group-member-org-member/",{challenge_id:t}),{assignment:l}=await s.get(`/api/learners/gma/${e}`);this.setState({assignment:l,group_member_assignment_id:e,group_member_id:a,organization_member_id:i,team_member:null===l||void 0===l?void 0:l.team_member})}catch({err:err}){throw this.setState({error:err,group_member_assignment_id:null,group_member_id:null,organization_member_id:null}),err}},this.canStartPhase=e=>{const{project:s}=this.state;return(null===s||void 0===s?void 0:s.num_phases_complete)===e-1},this.getPhaseLink=(e,s)=>{const{group_member_assignment_component_id:a,group_member_assignment_id:t}=this.props;return"number"!==typeof e&&(e=1),"number"!==typeof s&&(s=1),`/assignment/${t}/${a}/content/${e=e.toString()}/${s=s.toString()}`},this.getSyllabusLink=()=>{const{group_member_assignment_component_id:e,group_member_assignment_id:s}=this.props;return`/assignment/${s}/${e}/overview`},this.getHubLink=()=>{const{group_member_assignment_component_id:e,group_member_assignment_id:s}=this.props;return`/assignment/${s}/${e}/content`},this.getPhaseData=(e,s)=>{const{data:a}=this.getSubphaseData(e,s);return JSON.parse(JSON.stringify(a))},this.applyPhaseDataPatch=(e,s,a)=>new Promise((t,i)=>{const{project:l}=this.state,n=(null===l||void 0===l?void 0:l.challenge_data)||[];if(!l)return t(!1);const r=(0,T.clone)(n),o=this.getSubphaseDataKey(e,s),d=(0,T.clone)(this.getPhaseData(e,s))||{};ct.applyPatch(d,a),r[o].data=d,this.setState({challenge_data:r},()=>t(!0))}),this.changePhaseData=async(e,s,a)=>{const{app:t}=this.props,{project:i,team_member:l}=this.state;if(!i||!this.canChangePhaseData(!0))return!1;this.addTMAP(e,s);const n=Array.isArray(null===i||void 0===i?void 0:i.challenge_data)?i.challenge_data:[];for(let r=0;r<n.length;r++){const o=n[r];if(!o)continue;const{data:d,phase:c,subphase:h}=o;if(c!=e||h!=s)continue;const u=ct.createPatch(d,a);await this.applyPhaseDataPatch(e,s,u),this.io.emit("update",{challenge_id:null===i||void 0===i?void 0:i.id,patch:u,phase:e,subphase:s,team_member_id:(null===l||void 0===l?void 0:l.id)||null,timestamp:(new Date).getTime(),user_id:t.user.id})}},this.canChangePhaseData=e=>{const{intl:{formatMessage:s},preview:a}=this.props,{project:t}=this.state,{is_submitted:i}=t||{},{completed:l,expired:n}=this.getStatus();if(e){let e="";switch(!0){case a:e=s({id:"label.cannot_make_changes_in_preview_mod.935e2535",defaultMessage:"Cannot make changes in preview mode"});break;case l:e=s({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});break;case n:e=s({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});break;case i:e=s({id:"label.cannot_make_changes_to_a_challenge.f62f4c91",defaultMessage:"Cannot make changes to a challenge once submitted"})}e&&this.launchErrorModal(e)}return!i&&!n&&!a},this.getTeamMemberWithUserId=e=>{const{team:s}=this.state;if(!s||!s.members||!Array.isArray(s.members))return!1;for(let a=0;a<s.members.length;a++){const t=s.members[a];if(t&&t.user&&t.user.id===e)return t.user}if(!s||!s.facilitators||!Array.isArray(s.facilitators))return!1;for(let a=0;a<s.facilitators.length;a++){const t=s.facilitators[a];if(t&&t.user&&t.user.id===e)return t.user}return!1},this.getUserChallengeMember=()=>{const{project:e,team_member:s}
2=this.state;return((null===e||void 0===e?void 0:e.members)||[]).find(e=>(null===e||void 0===e?void 0:e.team_member_id)===(null===s||void 0===s?void 0:s.id))},this.canSubmitPhase=e=>{const s=this.getAllSubphaseData(e);if(!this.canChangePhaseData())return!1;if(!s.length)return!1;for(const a of s)if(null===a||void 0===a||!a.is_complete)return!1;return!0},this.buildPhaseSubphaseMap=e=>{const s={};let a=0;return Object.keys(e.phases).sort((e,s)=>e.localeCompare(s)).forEach(t=>{s[t]={},Object.keys(e.phases[t].subphases).sort((e,s)=>e.localeCompare(s)).forEach(e=>{s[t][e]=String(a++)})}),s},this.getTypeConfig=()=>{var e,s;const a=(null===(e=this.state.project)||void 0===e||null===(s=e.challenge_template)||void 0===s?void 0:s.challenge_type)||"classic";return Za.Ay[a]||Za.Ay.classic},this.getPhaseTitle=e=>{var s;return e&&(null===(s=this.getTypeConfig().phases[e])||void 0===s?void 0:s.title)||""},this.getPhaseDescription=e=>{var s;return(null===(s=this.getTypeConfig().phases[e])||void 0===s?void 0:s.description)||""},this.getSubphaseTitle=(e,s)=>{var a;const t=null===(a=this.getTypeConfig().phases[e])||void 0===a?void 0:a.subphases[s];return("object"===typeof t?null===t||void 0===t?void 0:t.title:t)||""},this.getAllPhaseTitles=()=>Object.values(this.getTypeConfig().phases).map(e=>e.title),this.getSubphasesTitlesForPhase=e=>{var s;return Object.values((null===(s=this.getTypeConfig().phases[e])||void 0===s?void 0:s.subphases)||{}).map(e=>"object"===typeof e?null===e||void 0===e?void 0:e.title:e)},this.getSubphases=e=>{const s=this.getHubLink(),a=this.getTypeConfig().phases[e];return a?Object.entries(a.subphases).map(a=>{let[t,i]=a;return{route:`${s}/${e}/${t}`,title:"object"===typeof i?null===i||void 0===i?void 0:i.title:i}}):[]},this.submitPhase=async e=>{const{assignment_wrapper:s}=this.props,{fetchAssignmentData:a}=s||{};if(!this.state.project||!this.state.project.id)return;e=Number(e);const{group_member_assignment_component_id:t,group_member_assignment_id:i,history:l}=this.props,{num_phases:n}=this.getTypeConfig();e<n?l.push(this.getPhaseLink(e+1,1)):(l.push(`/assignment/${i}/${t}/content`),await a(),this.reloadProjectInfo()),this.hidePhaseSubmissionModal(),this.triggerPhaseCelebration(e),this.setState({count:10,submission_user:null,try_submit:!1})},this.triggerPhaseCelebration=e=>{this.celebration_modal.showCelebration(e)},this.hidePhaseCelebration=()=>{},this.handleSubmitPhase=e=>{this.launchPhaseSubmissionModal()},this.cancelSubmitPhase=async s=>{try{const{app:e,intl:a}=this.props,{formatMessage:t}=a,i=e.api,{project:l,team:n,team_member:r}=this.state,o=null===l||void 0===l?void 0:l.id,d=null===n||void 0===n?void 0:n.id,c=null===r||void 0===r?void 0:r.id,h=t({id:"label.i_am_cancelling_the_phase_submissi.df4efd46",defaultMessage:"I am cancelling the Phase Submission"});await i.post("/api/teams/chat/add",{body:h,source:"system_post",team_id:d,team_member_id:c,text:h}),this.setState({count:10,submission_user:null,try_submit:!1},()=>clearInterval(this.timer)),await i.post(`/api/challenges/phase/cancel-submit/${s}`,{challenge_id:o,team_id:d,user_id:e.user.id})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;"muted"!==a&&this.setState({error:a})}},this.trySubmitPhase=async s=>{try{const{app:e}=this.props,a=e.api,{project:t,team:i}=this.state,l=t&&t.id,n=i&&i.id,r=e.user.id;await a.post(`/api/challenges/phase/try-submit/${s}`,{challenge_id:l,team_id:n,user_id:r})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a})}},this.trySkipCountdown=async s=>{try{const{app:e}=this.props,a=e.api,{project:t,team:i}=this.state,l=t&&t.id,n=i&&i.id,r=e.user.id;await a.post(`/api/challenges/phase/try-submit/skip/${s}`,{challenge_id:l,team_id:n,user_id:r})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a})}},this.addTMAP=(e,s)=>{this.tmap_timer&&clearTimeout(this.tmap_timer);const{app:a}=this.props,t=a.api,{group_member_assignment_id:i,is_facilitator:l,project:n,team:r,team_member:o}=this.state;if(l||!e||!s)return!1;this.tmap_timer=setTimeout(()=>{const a=null===n||void 0===n?void 0:n.id,l=null===r||void 0===r?void 0:r.id,d=null===o||void 0===o?void 0:o.id;return new Promise((n,r)=>{t.post("/api/tmap/add/",{challenge_id:a,group_member_assignment_id:i,phase:e,subphase:s,team_id:l,team_member_id:d}).then(()=>{n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),r(s)})})},3500)}
2,this.expireTMAP=(e,s)=>{const{app:a}=this.props,{group_member_assignment_id:t,is_facilitator:i,project:l,team:n,team_member:r}=this.state,o=a.api;if(i||!e||!s)return!1;const d=null===l||void 0===l?void 0:l.id,c=null===n||void 0===n?void 0:n.id,h=null===r||void 0===r?void 0:r.id;return new Promise((a,i)=>{o.post("/api/tmap/expire/",{challenge_id:d,group_member_assignment_id:t,phase:e,subphase:s,team_id:c,team_member_id:h}).then(()=>{a()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),i(s)})})},this.setFourCSubPhaseComplete=e=>{const{app:s}=this.props,a=s.api,{group_member_assignment_id:t}=this.state;return t?new Promise((s,i)=>{a.post(`/api/learners/group-member-assignment/${t}/mark-four-c-complete/`,{subphase:e}).then(()=>{this.reloadProjectInfo(),s()}).catch(e=>{this.setState({error:e}),i(e)})}):""},this.setHasSeenFinalCompulsion=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];a.setState(s=>s.team_member?(s.team_member.has_seen_final_compulsion=e,s):s)},this.calculatePhaseProgress=e=>{const{project:s}=this.state,a=Number(e),t=null===s||void 0===s?void 0:s.challenge_data,i=[];let l=0;return t?(t&&t.map((e,s)=>{const{phase:t}=e;return a!==t?"":i.push({data:e})}),i&&i.length&&i.map(e=>{const s=100/i.length,{isComplete:a}=e&&e.data;return a?l+=s:""}),!!i.length&&{progress_arr:i,progress_score:l}):i},this.getSubphaseDataKey=(e,s)=>{var a,t;return(null===(a=this.phase_subphase_map)||void 0===a||null===(t=a[e])||void 0===t?void 0:t[s])||null},this.isSubphaseComplete=(e,s)=>{const{is_complete:a}=this.getSubphaseData(e,s)||{};return!!a},this.updateSubphaseCompletionStatus=(e,s,a)=>{this.setState(t=>{const i=(0,T.clone)(t.project),{challenge_data:l}=i||{};if(!l)return t;const n=this.getSubphaseDataKey(e,s);return i.challenge_data[n].is_complete=a,{project:i}})},this.getSubphaseData=(e,s)=>{const{project:a}=this.state;if(!a)return{};const{challenge_data:t}=a||{};if(!t)return{};const i=this.getSubphaseDataKey(e,s);if(!i)return{};const l=t[i];return l||{}},this.getAllSubphaseData=e=>{var s;const a=null===(s=this.phase_subphase_map)||void 0===s?void 0:s[e];if(!a)return[];return Object.keys(a).map(s=>this.getSubphaseData(e,s))},this.getSubphaseCompletionCount=()=>{var e,s,a;const t=null===(e=this.state)||void 0===e||null===(s=e.project)||void 0===s?void 0:s.challenge_data;if(t)return null===(a=Object.values(t).filter(e=>null===e||void 0===e?void 0:e.is_complete))||void 0===a?void 0:a.length},this.openChallengeTemplateSyllabusModal=async()=>{var e;return await(null===(e=this.challenge_template_syllabus_modal)||void 0===e?void 0:e.current.show())},this.openSidebarSyllabus=()=>{var e,s,a;if(null!==(e=this.challenge_layout_ref)&&void 0!==e&&e.current&&null!==(s=this.challenge_layout_ref.current)&&void 0!==s&&null!==(a=s.sidebar_ref)&&void 0!==a&&a.current){const{sidebar_ref:e}=this.challenge_layout_ref.current,{collapsed:s,setTabKey:a,showSidebar:t}=e.current;s&&t(),a("syllabus")}},this.fetchInitialCompetencyScores=async()=>{var s;const{challenge_id:a,is_facilitator:t,project:i}=this.state;if(!a||t)return;if(null===i||void 0===i||null===(s=i.group_assignment_component)||void 0===s?void 0:s.certification_template_id){this.setState({competency_scores_loading:!0,has_certification:!0});try{const{app:e}=this.props,s=await e.api.get(`/api/certifications/live-competency-scores/${a}`);null!==s&&void 0!==s&&s.competency_scores?this.setState({competency_scores:s.competency_scores,competency_scores_loading:!1,competency_scores_updated_at:s.updated_at}):this.setState({competency_scores_loading:!1})}catch(e){this.setState({competency_scores_loading:!1})}}},this.initSocket=()=>{const{team:e}=this.state,{app:s}=this.props,t=this;f("teams","ProjectComponent",function(i){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.io=i,i.emit("listen",e.id),i.emit("arrive",e.id,s.user,"",""),i.off("user-is-typing").on("user-is-typing",e=>{let{agent_name:s,agent_persona_id:t,field_id:i,is_agent:l,phase:n,sub_field_id:r,subph
2ase:o,user_id:d}=e;a.field_status.upsertFieldTimer(n,o,i,r,d,l,s,t)}),i.off("update").on("update",async e=>{let{patch:s,phase:t,subphase:i}=e;1==t&&4==i&&console.log("socket.off ",t,i,s),await a.applyPhaseDataPatch(t,i,s)}),i.off("update-failure").on("update-failure",async e=>{let{err:s}=e;a.launchErrorModal(s)}),i.off("subphase-completion-update").on("subphase-completion-update",e=>{let{is_complete:s,phase:t,subphase:i}=e;a.updateSubphaseCompletionStatus(t,i,s)}),i.off("competency-scores-update").on("competency-scores-update",e=>{var s,i;let{competency_scores:l,updated_at:n,user_id:r}=e;r===(null===(s=t.props.app)||void 0===s||null===(i=s.user)||void 0===i?void 0:i.id)&&a.setState({competency_scores:l,competency_scores_loading:!1,competency_scores_updated_at:n})}),i.off("start-phase-countdown").on("start-phase-countdown",e=>{let{can_skip:s,phase:i,user_id:l}=e;const{phase:n}=t.state;n===i&&(clearInterval(a.timer),a.setState({can_skip_submit_delay:s,count:10,submission_user:l,try_submit:!0},()=>{a.handleStartCountdown(),a.launchPhaseSubmissionModal({phase:i})}))}),i.off("phase-completed").on("phase-completed",e=>{let{phase:s}=e;a.state.phase===s&&a.submitPhase(s)}),i.off("cancel-phase-submit").on("cancel-submit-phase",e=>{let{phase:s}=e;const{phase:i}=t.state;i===s&&(a.hidePhaseSubmissionModal(),a.setState({count:10,submission_user:null,try_submit:!1}),clearInterval(a.timer))}),i.off("arrival").on("arrival",i=>{let{phase:l,subphase:n,user:r}=i,o=0;setTimeout(function(){t.io.emit("arrive-response",e.id,s.user,t.state.phase,t.state.subphase)},500);const d={phase:l,subphase:n,user:r};let c=a.state.team_locations;c?c.push(d):c=[d];let h=c.filter((e,s,a)=>a.map(e=>e.user.id).indexOf(e.user.id)===s);h=h.filter((e,a)=>(!s.user||e.user.id!==s.user.id)&&e);const u=h.map(e=>r&&e.user.id===r.id&&0===o?(o++,d):!(r&&e.user.id===r.id&&o>0)&&e);u&&a.setState({team_locations:u})}),i.off("arrival-response").on("arrival-response",e=>{let{phase:t,subphase:i,user:l}=e,n=0;const r={phase:t,subphase:i,user:l};let o=a.state.team_locations;o?o.push(r):o=[r];let d=o.filter((e,s,a)=>a.map(e=>e.user.id).indexOf(e.user.id)===s);d=d.filter((e,a)=>(!s.user||e.user.id!==s.user.id)&&e);const c=d.map(e=>l&&e.user.id===l.id&&0===n?(n++,r):!(l&&e.user.id===l.id&&n>0)&&e);c&&a.setState({team_locations:c})}),i.off("departure").on("departure",e=>{let{user:s}=e;const t=s,i=a.state.team_locations;if(!i)return;const l=i.filter(e=>(!t||e.user.id!==t.id)&&e);l&&a.setState({team_locations:l})}),i.off("team-members-updated").on("team-members-updated",()=>{a.reloadTeam()}),l&&a.loadChallengeInfo().catch(e=>{a.setState({error:e,loading:!1})}),a.setState({loading:!1})})},this.getChallengeMember=()=>{const{project:e,team_member:s}=this.state;return((null===e||void 0===e?void 0:e.members)||[]).find(e=>(null===e||void 0===e?void 0:e.team_member_id)===(null===s||void 0===s?void 0:s.id))||null},this.isLastSubphase=()=>{const{phase:e,subphase:s}=this.state,a=this.getSubphases(e);return(null===a||void 0===a?void 0:a.length)===s},this.getStatus=()=>{const{assignment_wrapper:{component:e}}=this.props,{completed:s,group_assignment_component:a,start:t}=e||{},{is_expired:i,is_overdue:l}=a||{},{project:n}=this.state,{is_submitted:r}=n||{};return{completed:!!s&&!!r,expired:i,overdue:l,started:!!t}},this.launchErrorModal=e=>{var s;const a=null===this||void 0===this||null===(s=this.error_modal)||void 0===s?void 0:s.current;a&&a.show({error:e})},this.launchPhaseSubmissionModal=e=>{var s;const a=null===this||void 0===this||null===(s=this.phase_submission_modal)||void 0===s?void 0:s.current;a&&a.show(e)},this.hidePhaseSubmissionModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.phase_submission_modal)||void 0===e?void 0:e.current;s&&s.hide()},this.state={can_skip_submit_delay:!1,challenge_field_status:{},challenge_id:null,challenge_template_id:null,competency_scores:null,competency_scores_loading:!1,competency_scores_updated_at:null,error:null,facilitators:[],group:null,group_assignment:null,group_id:null,has_certification:!1,is_facilitator:!1,loading:!0,phase:s.phase||"",project:null,subphase:s.subphase||"",team:{members:[]},team_member:null,try_submit:!1},this.phase_subphase_map=this.buildPhaseSubphaseMap(Za.Ay.classic),this.celebration_modal=null,this.io=null,this.challenge_template_syllabus_modal=(0,l.createRef)(),this.challenge_layout_ref=(0,l.createRef)(),this.error_modal=(0,l.createRef)(),this.phase_submission_modal=(0,l.createRef)(),this.field_status={fieldStatusIndicator:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const t=a.field_status.getFieldStatus(e,s);return t?(0,N.jsx)(it,{agent_name:t.agent_name,is_agent:t.is_agent,user_id:t.user_id}):(0,N.jsx)(N.Fragment,{})},getFieldStatus:(e,s)=>
2{const{challenge_field_status:a,phase:t,subphase:i}=this.state;if(!t||!i)return!1;return a[this.field_status.getFieldToken(t,i,e,s)]},getFieldToken:function(e,s,a){let t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return e+"."+s+"."+a+(t?"."+t:"")},isFieldDisabled:(e,s)=>{const{challenge_field_status:a,phase:t,subphase:i}=this.state,{app:l}=this.props;if(!t||!i)return!1;const n=a[this.field_status.getFieldToken(t,i,e,s)];return!(!n||n.user_id==l.user.id)},setFieldStatus:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{phase:t,project:i,subphase:l,team:n}=a.state,{app:r}=a.props;if(!t||!l||!n||!i)return!1;a.field_status.isFieldDisabled(e,s)||a.field_status.upsertFieldTimer(t,l,e,s,r.user.id),a.io.emit("user-is-typing",{field_id:e,phase:t,sub_field_id:s,subphase:l,team_id:n.id,user_id:r.user.id})},upsertFieldTimer:function(e,s,t){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=arguments.length>4?arguments[4]:void 0,n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;const{challenge_field_status:d}=a.state,c=a.field_status.getFieldToken(e,s,t,i);let h=d[c];if(h){const{timer:e}=h;clearTimeout(e)}h={agent_name:r,agent_persona_id:o,field_id:t,is_agent:n,phase:e,sub_field_id:i,subphase:s,timer:setTimeout(()=>{a.setState(e=>(delete e.challenge_field_status[c],e))},5e3),user_id:l},a.setState(e=>(e.challenge_field_status[c]=h,e))}}}handleStartCountdown(){this.timer=setInterval(()=>{const e=this.state.count-1;this.setState({count:e>=0?e:0},()=>{e<0&&clearInterval(this.timer)})},1e3)}async componentDidMount(){const{app:s,onRef:a}=this.props,t=s.userIsSiteArbitrator();"function"===typeof a&&a(this),this.setState({loading:!0});try{await this.loadChallengeInfo();const{is_facilitator:e}=this.state;e||t||await this.loadGroupMemberAssignment(),this.initSocket(),this.fetchInitialCompetencyScores()}catch(e){this.setState({error:e,loading:!1})}}async componentDidUpdate(e,s){!s.project&&this.state.project&&(this.phase_subphase_map=this.buildPhaseSubphaseMap(this.getTypeConfig()));const{phase:a,subphase:t}=e,{phase:i,subphase:l}=this.props;(!(0,T.isEqual)(a,i)||!(0,T.isEqual)(t,l))&&(this.setState({phase:i,subphase:l}),a&&this.expireTMAP(a,t),i&&l&&this.addTMAP(i,l))}componentWillUnmount(){const{onRef:s}=this.props;"function"===typeof s&&s(void 0);try{j("ProjectComponent")}catch(e){console.error(e)}}render(){var e,s;const{assignment:a,can_skip_submit_delay:t,challenge_id:i,challenge_template_id:n,count:r,error:o,facilitators:d,group:c,group_assignment:h,group_id:u,group_member_assignment_id:m,group_member_id:g,is_facilitator:p,loading:x,organization_member_id:v,phase:f,project:j,submission_user:_,subphase:b,team:A,team_locations:y,team_member:w,try_submit:S}=this.state,{chat_service:C,children:M,preview:k}=this.props,z=this.getPhaseTitle(f);let T=null;return f&&(T=this.canSubmitPhase(f)),this.isSubphaseComplete(1,1),(0,N.jsx)(l.Fragment,{children:(0,N.jsxs)(Ia,{value:{assignment:a,calculatePhaseProgress:this.calculatePhaseProgress,can_skip_submit_delay:t,can_submit_phase:T,cancelSubmitPhase:this.cancelSubmitPhase,canChangePhaseData:this.canChangePhaseData,canStartPhase:this.canStartPhase,canSubmitPhase:this.canSubmitPhase,challenge_id:i,challenge_member:this.getChallengeMember(),challenge_members:(null===j||void 0===j?void 0:j.members)||[],challenge_template:null===j||void 0===j?void 0:j.challenge_template,challenge_template_id:n,challenge_type:(null===j||void 0===j||null===(s=j.challenge_template)||void 0===s?void 0:s.challenge_type)||"classic",changePhaseData:this.changePhaseData,chat_service:C,competency_scores:this.state.competency_scores,competency_scores_loading:this.state.competency_scores_loading,competency_scores_updated_at:this.state.competency_scores_updated_at,count:r,facilitators:d,fieldStatusIndicator:this.field_status.fieldStatusIndicator,getAllPhaseTitles:this.getAllPhaseTitles,getAllSubphaseData:this.getAllSubphaseData,getChallengeMember:this.getChallengeMember,getHubLink:this.getHubLink,getPhaseData:this.getPhaseData,getPhaseDescription:this.getPhaseDescription,getPhaseLink:this.getPhaseLink,getPhaseTitle:this.getPhaseTitle,getSubphaseCompletionCount:this.getSubphaseCompletionCount,getSubphases:this.getSubphases,getSubphasesTitlesForPhase:this.getSubphasesTitlesForPhase,getSubphaseTitle:this.getSubphaseTitle,getSyllabusLink:this.getSyllabusLink,getTeamMemberWithUserId:this.getTeamMemberWithUserId,getUserChallengeMember:this.getUserChallengeMember,group:c,group_assignment:h,group_id:u,group_member_assignment_id:m,group_member_id:g,handleSubmitPhase:this.handleSubmitPhase,has_certification:this.state.has_certification,io:this.io,is_facilitator:p,isFieldDisabled:this.field_status.isFieldDisabled,isLastSubphase:this.isLastSubphase,isPhaseComplete:this.isPhaseComplete,isPhaseStarted:this.isPhaseStarted,isSubphaseComplete:this.isSubphaseComplete,launchPhaseSubmissionModal:this.lau
2nchPhaseSubmissionModal,loadGMA:this.loadGroupMemberAssignment,openChallengeTemplateSyllabusModal:this.openChallengeTemplateSyllabusModal,openSidebarSyllabus:this.openSidebarSyllabus,organization_member_id:v,phase:f,phase_title:z,preview:k,project:j,reloadProjectInfo:this.reloadProjectInfo,setFieldStatus:this.field_status.setFieldStatus,setFourCSubPhaseComplete:this.setFourCSubPhaseComplete,setHasSeenFinalCompulsion:this.setHasSeenFinalCompulsion,setLearnerStarted:this.setLearnerStarted,status:this.getStatus(),submission_user:_,subphase:b,team:A,team_locations:y,team_member:w,team_members:(null===A||void 0===A?void 0:A.members)||[],try_submit:S,trySkipCountdown:this.trySkipCountdown,trySubmitPhase:this.trySubmitPhase},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:o,variant:"danger",children:o}),(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"flex-fill",loading:x,children:M}),(0,N.jsx)(tt,{handleHide:this.hidePhaseCelebration,onRef:e=>this.celebration_modal=e}),(0,N.jsx)(Om,{ref:this.challenge_template_syllabus_modal}),(0,N.jsx)(vA,{ref:this.error_modal}),(0,N.jsx)(_A,{ref:this.phase_submission_modal})]})},null===(e=this.module_wrapper_component)||void 0===e?void 0:e.current)}}var ut=(0,Pe.y)((0,Ke.Ay)((0,P.G0)(ot(ht)))),mt=t(23e3);const gt=e=>{const{details:s,style:a}=e,{icon:t,label:i,value:l}=s||{};return(0,N.jsxs)(Ce.S,{className:"challenge-hub-activity-card-section",style:a||{},children:[(0,N.jsx)("span",{className:"visually-hidden",id:"challengeActivityLabel",children:`${l} ${i}`}),(0,N.jsxs)(mt.A,{"aria-labelledby":"challengeActivityLabel",className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:`d-flex justify-content-center mt-3 activity-icon ${i}-icon`,children:(0,N.jsx)(Zs.A,{alt:"",height:40,src:t,width:40})}),(0,N.jsxs)(mt.A.Caption,{"aria-hidden":!0,className:"d-flex flex-column mt-2 ms-3",children:[(0,N.jsx)(Ce.S,{className:"d-flex",children:(0,N.jsx)(Ce.S,{className:`h3 activity-value ${i}-value`,style:{lineHeight:"32px"},children:l})}),(0,N.jsx)(Ce.S,{className:"card-data-label",children:i})]})]})]})};var pt=t.p+"static/media/icon-file-folder.db046222e4f81d23f4e2bc82e257cf2a.svg";var xt=t.p+"static/media/icon-chat.7898e4dd77b0168755cc9329688f9934.svg";var vt={chat:xt,clock:t.p+"static/media/icon-clock.efb5d60301cb8e046b68bd350b9d80c0.svg",file:pt};const ft=e=>{const{api:s,userIsLearner:a}=(0,n.nm)(),t=!a(),{chat_service:i,getUserChallengeMember:r,preview:o,project:d,reloadProjectInfo:c,team_member:h}=Ra(),u=r&&r(),m=u?Math.round(u.total_time_seconds/60):null,[g,p,x]=(0,ne.CQ)({error:null,files_count:0,loading:!1,messages_count:0}),v=async()=>{if(!o&&!t)try{const{count:e}=await s.get(`/api/challenges/count/files/${h.id}`,{challenge_id:null===d||void 0===d?void 0:d.id,team_member_id:h.id});p({files_count:e})}catch({err:err}){p({error:err})}},f=async()=>{if(!o&&!t)try{const{count:e}=await s.get(`/api/challenges/count/messages/${h.id}`,{challenge_id:null===d||void 0===d?void 0:d.id,team_member_id:h.id});p({messages_count:e})}catch({err:err}){p({error:err})}},j=e=>{(null===e||void 0===e?void 0:e.team_member_id)===(null===h||void 0===h?void 0:h.id)&&p({messages_count:g.messages_count+1})};(0,l.useEffect)(()=>{t||o||(p({loading:!0}),Promise.all([v(),f()]).finally(()=>p({loading:!1})),i&&i.subscribe(j),c())},[]);const{error:_,files_count:b,loading:A,messages_count:y}=g,w=[{icon:vt.clock,label:"minutes",value:t?"-":m},{icon:vt.chat,label:"messages",value:t?"-":y},{icon:vt.file,label:"files",value:t?"-":b}];return(0,N.jsx)(Ge.A,{className:"challenge-hub-card challenge-hub-activity-card",id:"challengeHubMyActivityCard",children:(0,N.jsxs)(Ge.A.Body,{className:"p-0",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)("span",{className:"card-heading",children:(0,N.jsx)(ke.A,{defaultMessage:"My activity",description:"",id:"label.my_activity.6376be73"})})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>p({error:null}),show:_,variant:"danger",children:_}),(0,N.jsx)(Me.x_,{loading:A,children:(0,N.jsx)(Qe.A,{noGutters:!0,className:"pt-2",children:w.map((e,s)=>{let a=(null===w||void 0===w?void 0:w.length)===s+1;return(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(gt,{details:e,style:a?{}:{marginRight:20}})},s)})})})]})})};var jt=t(89159),_t=t(78918),bt=t(45341),At=t(57086),yt=t(77997),wt=t(60015),Nt=t(75758),St=t(8586),Ct=t(14732);const Mt=[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}],kt=e=>{const{bars:s,data:a,isPlaceholder:t,legend:i,responsive_height:l,responsive_width:r,showLabels:o,tickCounts:d,tickLines:c,tooltip:h,y_axis_domain:u,yAxisLine:m}=e;
2t&&s.forEach(e=>e.fill="#808080");const g=e=>{switch(e){case"1C":return"Critical Thinking";case"2C":return"Communication";case"3C":return"Collaboration";case"4C":return"Creativity";default:return""}},p=e=>{var s;let{active:a,label:t,payload:i}=e;const l=(null===i||void 0===i||null===(s=i[0])||void 0===s?void 0:s.value)||"";return a&&i?(0,N.jsx)(Ce.S,{className:"challenge-hub-bar-chart-tooltip",children:(0,N.jsxs)(Ce.S,{className:"label m-0 d-flex flex-column",children:[(0,N.jsx)("span",{className:"label-name",children:g(t)}),(0,N.jsx)("span",{className:"label-value",children:l})]})}):(0,N.jsx)(N.Fragment,{})},{styles:x}=(0,n.nm)(),v=x&&x.primary,f=x&&x["gray-200"];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{className:"visually-hidden",children:!t&&a&&a.map(e=>`${g(null===e||void 0===e?void 0:e.name)} = ${null===e||void 0===e?void 0:e.score}, `)}),(0,N.jsx)(jt.u,{className:"bar-chart-has-bg",height:l,width:r,children:t?(0,N.jsxs)(_t.E,{data:Mt,children:[(0,N.jsx)(bt.d,{vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name",tickCount:d.x,tickLine:c}),(0,N.jsx)(yt.h,{allowDecimals:!0,axisLine:m,domain:u,tickCount:d.y,tickLine:c,width:10}),i&&(0,N.jsx)(Nt.s,{}),s&&s.map(e=>{const{background:s,barSize:a,dataKey:t,fill:i}=e;return(0,N.jsx)(St.y,{background:s,barSize:a,dataKey:t,fill:i,radius:[0,0,0,0],width:50},t)})]}):(0,N.jsxs)(_t.E,{data:a,children:[(0,N.jsx)(bt.d,{vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name",tickCount:d.x,tickLine:c}),(0,N.jsx)(yt.h,{allowDecimals:!0,axisLine:m,domain:u,tickCount:d.y,tickLine:c,width:10}),h&&(0,N.jsx)(wt.m,{content:(0,N.jsx)(p,{})}),i&&(0,N.jsx)(Nt.s,{}),s&&s.map(e=>{let{background:s,barSize:a,dataKey:t,fill:i}=e;return i=i||v,s=s||{fill:f},(0,N.jsx)(St.y,{background:s,barSize:a,dataKey:t,fill:i,radius:[0,0,0,0],width:50,children:o&&(0,N.jsx)(Ct.Z,{dataKey:"score",fill:"#FFFFFF",position:"insideTop"})},t)})]})})]})};kt.defaultProps={bars:[{barSize:10,dataKey:"score"}],chart_height:300,chart_width:500,data:Mt,isPlaceholder:!1,legend:!1,responsive_height:"100%",responsive_width:"100%",showLabels:!0,tickCounts:{x:5,y:5},tickLines:!0,tooltip:!0,y_axis_domain:[0,4],yAxisLine:!0};var zt=kt;var Tt=e=>{var s,a,t;const{feedback:i,loading:l}=e,{facilitators:n}=dt(),{challenge_member:r,group_assignment:o,project:d={}}=Ra(),{is_graded:c}=d,h=!(null===o||void 0===o||!o.enable_grading),u=(e=>{const s=[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}];return e?(e.hasOwnProperty("critical")&&(s[0].score=e.critical),e.hasOwnProperty("communication")&&(s[1].score=e.communication),e.hasOwnProperty("collaboration")&&(s[2].score=e.collaboration),e.hasOwnProperty("creativity")&&(s[3].score=e.creativity),s):s})(null===r||void 0===r?void 0:r.four_c_score),m=(e=>{let s=0;return e.forEach(e=>s+=e.score),s/4})(u).toFixed(1);return(0,N.jsx)(Ge.A,{className:"challenge-hub-card challenge-hub-activity-card",children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsxs)(Me.x_,{loading:l,children:[(0,N.jsxs)(Ce.S,{className:"pb-1 flex-column",children:[(0,N.jsx)("span",{className:"card-heading",children:(0,N.jsx)(ke.A,{defaultMessage:"Evaluation",id:"label.evaluation.163e44b1"})}),(0,N.jsx)("p",{className:"m-0",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Average of self, peer, and facilitator evaluations",id:"label.average_of_self_peer_and_facilitat.8a8c2460"}):(0,N.jsx)(ke.A,{defaultMessage:"Average of self and peer evaluations",id:"label.average_of_self_and_peer_evaluatio.445e31e8"})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center flex-row my-2",children:[(0,N.jsx)(Ce.S,{className:"d-inline-flex me-4",style:{height:100,width:150},children:(0,N.jsx)(zt,{data:u,showLabels:!1,yAxisLine:!1})}),(0,N.jsxs)(Ce.S,{className:"d-inline-flex",children:[(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"average score",id:"label.average_score.a1235992"})}),(0,N.jsx)("span",{className:"numerical-score four-c",children:`${m}`})]})]}),(0,N.jsx)(Ce.S,{className:"flex-column",children:!(null===n||void 0===n||!n.length)&&h&&(0,N.jsx)(N.Fragment,{children:c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{className:"card-subheading",children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitator feedback",i
2d:"label.facilitator_feedback.d5db463d"})}),null!==i&&void 0!==i&&null!==(s=i.notes)&&void 0!==s&&null!==(a=s.trim)&&void 0!==a&&null!==(t=a.call(s))&&void 0!==t&&t.length?(0,N.jsx)("span",{children:i.notes}):(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No feedback provided",id:"label.no_feedback_provided.d3edd858"})})]}):(0,N.jsx)("p",{className:"lead text-muted text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Awaiting facilitator evaluation",id:"label.awaiting_facilitator_evaluation.710eb22b"})})})})]})})})},It=t(89599),Et=t(82267),Ft=t(77040);function Rt(e){let{app:s,barSize:a,className:t,color:i,customDisabledLabel:l,customScoreLabel:n,disabled:r,fontSize:o,height:d,labelClassName:c,maxValue:h,showLabel:u,value:m,width:g}=e;const{styles:p}=s,x=p&&p.primary;m=Number.parseInt(m)||0;const v=[{fill:i||x,name:"",value:m},{fill:"#ccc",name:"",value:100-m}];return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("div",{className:"donut "+(t||""),style:{height:d,width:g},children:[u&&(0,N.jsx)("div",{className:`donut-label ${r?c:""}`,style:{fontSize:o},children:r?l||"- -":n||(0,N.jsxs)(N.Fragment,{children:[m,(0,N.jsx)("sup",{children:"%"})]})}),(0,N.jsx)(It.r,{height:d,margin:{bottom:0,left:0,right:0,top:0},width:g,children:(0,N.jsx)(Et.F,{cx:g/2,cy:d/2,data:v,endAngle:-270,fill:i||x,innerRadius:d/2-a,outerRadius:d/2,paddingAngle:0,startAngle:90,children:(0,N.jsx)(Ft.f,{fill:i||x})})})]})})}Rt.defaultProps={barSize:10,customScoreLabel:null,disabled:!1,fontSize:16,height:80,maxValue:100,showLabel:!0,value:50,width:80};var Dt=(0,n.G0)(Rt);var Bt=e=>{var s,a,t;const{feedback:i,loading:l}=e,{facilitators:n}=dt(),{group_assignment:r,project:o={}}=Ra(),{is_graded:d,score:c}=o,h=!(null===r||void 0===r||!r.enable_grading),u=!(null===n||void 0===n||!n.length)&&h,m=oa()("challenge-hub-card challenge-hub-activity-card h-100",{"locked h-100":!d&&(u||!(null!==n&&void 0!==n&&n.length))});return(0,N.jsx)(Ge.A,{className:m,children:(0,N.jsx)(Ge.A.Body,{className:"d-flex flex-column",children:(0,N.jsxs)(Me.x_,{loading:l,children:[(0,N.jsxs)(Ce.S,{className:"pb-1 flex-column",children:[(0,N.jsx)("span",{className:"card-heading",children:(0,N.jsx)(ke.A,{defaultMessage:"Final score",id:"label.final_score.11c34366"})}),u&&(0,N.jsx)("p",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"From your facilitator",id:"label.from_your_facilitator.beda2432"})})]}),u?(0,N.jsx)(N.Fragment,{children:d?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-4 py-4",children:[(0,N.jsx)(Ce.S,{"aria-hidden":!0,className:"d-inline-flex",children:(0,N.jsx)(Dt,{height:50,showLabel:!1,value:c,width:50})}),(0,N.jsx)(Ce.S,{className:"d-inline-flex",children:(0,N.jsx)("span",{className:"numerical-score final-grade",children:`${c}%`})})]}),(0,N.jsxs)(Ce.S,{className:"flex-column",children:[(0,N.jsx)("span",{className:"card-subheading",children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitator feedback",id:"label.facilitator_feedback.d5db463d"})}),null!==i&&void 0!==i&&null!==(s=i.notes)&&void 0!==s&&null!==(a=s.trim)&&void 0!==a&&null!==(t=a.call(s))&&void 0!==t&&t.length?(0,N.jsx)("span",{children:(null===i||void 0===i?void 0:i.notes)||""}):(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No feedback provided",id:"label.no_feedback_provided.d3edd858"})})]})]}):(0,N.jsx)(Ce.S,{className:"d-flex flex-fill align-items-center justify-content-center p-5",children:(0,N.jsx)("p",{className:"lead",children:(0,N.jsx)(ke.A,{defaultMessage:"Not yet graded",id:"label.not_yet_graded.2a7d593b"})})})}):(0,N.jsx)(Ce.S,{className:"d-flex flex-fill align-items-center justify-content-center",children:(0,N.jsx)("p",{className:"lead",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge is not facilitator graded",id:"label.challenge_is_not_facilitator_grade.162c5f2a"})})})]})})})};var Pt=s=>{const{api:a,userIsLearner:t}=(0,P.nm)(),{assignment:i,challenge_member:n,project:r}=Ra(),o=!t(),[d,c]=(0,ne.CQ)({error:null,feedback:null,loading:!0}),{error:h,feedback:u,loading:m}=d;return(0,l.useEffect)(()=>
2{if(o||!r.is_graded)return c({loading:!1});(async()=>{try{if(o||!r.is_graded)return c({loading:!1});c({loading:!0});const e=await a.get(`/api/teams/get_facilitator_notes/${n.id}`);c({feedback:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}})()},[]),o||!i?(0,N.jsx)(N.Fragment,{}):(0,N.jsxs)(Ve.A,{className:"mt-5 py-2 challenge-hub-scores",xs:12,children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Scores",id:"label.scores.c5f09715"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:h,variant:"danger",children:h}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"pt-3",lg:6,children:(0,N.jsx)(Bt,{feedback:null===u||void 0===u?void 0:u.team_notes,loading:m})}),(0,N.jsx)(Ve.A,{className:"pt-3",lg:6,children:(0,N.jsx)(Tt,{feedback:null===u||void 0===u?void 0:u.team_member_notes,loading:m})})]})]})};const Lt=l.createContext({}),Ot=(Lt.Provider,Lt.Consumer,l.createContext({})),Ht=Ot.Provider,Ut=Ot.Consumer,Qt=()=>(0,l.useContext)(Ot);const Vt=l.createContext({}),Gt=Vt.Provider;Vt.Consumer;const Wt=l.createContext({}),Kt=Wt.Provider,Yt=(Wt.Consumer,()=>(0,l.useContext)(Wt));var qt=t(58036);var Jt=t.p+"static/media/animated-phone-light.9d6501f62463f04cd22f4835f44f4480.svg";var Xt=t.p+"static/media/animated-phone-dark.34f1bef83bd48632de87b03e09feab51.svg";var Zt=e=>{const s=(0,l.useRef)(),{joined:a,loading_state:t,meeting:i}=Yt(),[n,r]=(0,l.useState)(!1);(0,l.useEffect)(()=>{r(!1)},[i]);const o=["connecting","joining","leaving"].includes(t);return(0,N.jsxs)(Ce.S,{className:"active-meeting-indicator "+(a?"joined":""),disabled:o,children:[(0,N.jsx)(ve.A,{disabled:o,onClick:()=>r(!n),ref:s,variant:"link",children:o?(0,N.jsx)(qt.A,{animation:"border",size:"sm",style:{flexShrink:0},variant:"secondary"}):(0,N.jsx)(Zs.A,{className:"animated-phone-icon",height:20,src:a?Jt:Xt,width:20})}),(0,N.jsx)(Si,{onHide:()=>r(!1),placement:"bottom-end",show:n,target:s})]})},$t=t(40761);var ei=e=>{const s=(0,$t.GYC)();return(0,N.jsx)(Ht,{value:{meeting_manager:s},children:e.children})};var si=e=>{const{disabled:s,tooltipPosition:a}=e,{isAudioOn:t,toggleAudio:i}=(0,$t.eDo)();return(0,N.jsx)(Ai,{disabled:s,icon:(0,N.jsx)(ii,{deafened:t,size:20}),onClick:i,tooltipLabel:t?"deafen":"undeafen",tooltipPosition:a})};var ai=t.p+"static/media/headphones-slash.f7a37fe0e930c9b06e750d0f0f9c7e1e.svg";var ti=t.p+"static/media/headphones.2f0faa5df0bd6f4085b9782bccd8e467.svg";var ii=e=>(0,N.jsx)(Zs.A,{alt:(e.muted?"unmute":"mute")+" icon",height:e.size||e.height,src:e.deafened?ti:ai,width:e.size||e.width}),li=t(39859);var ni=e=>{const{disabled:s}=e,[a,t]=(0,l.useState)(!1),{joined:i,loading:n,user_device:r,voice_focus_supported:o}=Yt();return(0,N.jsxs)(li.A,{className:"io-settings-dropdown",onToggle:e=>t(e),children:[(0,N.jsxs)(Ai,{asToggle:!0,disabled:s||!i||n,iconWidth:14,id:"ioSettingsDropdownTrigger",children:[(0,N.jsx)(ze.Pcn,{color:i?"var(--white)":"var(--gray-700)",size:14}),(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"})})]}),(0,N.jsx)(Oa,{condition:!r.compatible,wrapper:e=>(0,N.jsx)(Ua.A,{placement:"top",trigger:["hover","focus"],overlay:(0,N.jsx)(Qa.A,{id:"incompatibleBrowserTooltip",children:(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"The current browser does not support these features",id:"label.the_current_browser_does_not_suppo.366428aa"})})}),children:e}),children:(0,N.jsxs)(li.A.Menu,{className:r.compatible?"":"disabled",show:a,children:[(0,N.jsx)(Kl,{type:"input"}),(0,N.jsx)(Kl,{type:"output"}),o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(Vl,{})]})]})})]})};var ri=e=>{const{existing_meeting:s,loading_state:a,meeting:t}=Yt();return(0,N.jsx)("div",{className:"meeting-chat-widget px-2",children:(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between",children:t||s||"connecting"===a?(0,N.jsx)(Zt,{}):(0,N.jsx)(kl,{})})})};var oi=e=>{const{compact:s,disabled:a,tooltipPosition:t}=e,{joined:i}=Yt();
2return(0,N.jsxs)(Ce.S,{className:"solvably-meeting-controls d-flex justify-content-between align-items-center",children:[i?(0,N.jsxs)(Ce.S,{className:"io-controls d-flex align-items-center",children:[(0,N.jsx)("span",{className:"me-2",children:(0,N.jsx)(Ci,{disabled:a,tooltipPosition:t})}),(0,N.jsx)("span",{className:"me-2",children:(0,N.jsx)(si,{disabled:a,tooltipPosition:t})})]}):(0,N.jsx)(N.Fragment,{}),(0,N.jsx)(zl,{compact:s,disabled:a})]})},di=t(17643),ci=t.n(di);var hi=e=>{const{meeting:s}=Yt(),a=ci()(null===s||void 0===s?void 0:s.start_date),[t,i]=(0,l.useState)(null),[n,r]=(0,l.useState)(null),[o,d]=(0,l.useState)(null),[c,h]=(0,l.useState)(null),u=(e,s)=>{var t;const i=ci()(),l=ci()(a);if(!i||!l)return null;let n=i.diff(l,e);if(s&&(n%=s),isNaN(n))return null;let r=n.toString();return["seconds","minutes"].includes(e)&&(null===(t=r)||void 0===t?void 0:t.length)<=1&&(r=`0${r}`),r},m=()=>{i(u("hours",24)),r(u("minutes",60)),d(u("seconds",60))},g=()=>clearInterval(c);return(0,l.useEffect)(()=>{if(c)return g;(()=>{if(!a)return;m();const e=setInterval(m,1e3);h(e)})()},[c]),(0,N.jsx)(Ce.S,{className:"meeting-duration",children:(0,N.jsxs)("p",{className:"small text-muted mb-0",children:[Number.parseInt(t)?`${t}:`:"",n,":",o]})})},ui=t(11702);var mi=t.p+"static/media/grip-handle.c6768b3dc4d56e88059cbc6c75483ea9.svg";var gi=t.p+"static/media/divider.e80d98e217dd4704ad9b0db28284f0b6.svg";const pi=(0,l.forwardRef)((e,s)=>{const{attributes:a,isDragging:t,listeners:i,setNodeRef:n}=(0,ui.PM)({id:"floating-meeting-widget"}),r=(0,l.useRef)(),{userId:o}=(0,P.nm)(),{meeting:d,roster_preview:c}=Yt(),{show_widget:h,widget_location:u}=(0,l.useContext)(Vt),{roster:m}=(0,$t.Abl)(),g=["top-left","top-right"].includes(u)?"bottom":"top",[p,x]=(0,l.useState)(!1);(0,l.useEffect)(()=>{x(!1)},[d]),(0,l.useEffect)(()=>{t&&x(!1)},[t]);const[v,f]=(0,l.useState)(!0);(0,l.useEffect)(()=>{f((()=>{const e=Object.values(m),s=(null!==e&&void 0!==e&&e.length?e:null!==c&&void 0!==c&&c.length?c:[]).filter(e=>{let{id:s,externalUserId:a}=e;return!(s&&!Number(s)||a&&!Number(a))&&(s?Number(s)!==o:a?Number(a)!==o:void 0)});return!(null!==s&&void 0!==s&&s.length)})())},[m,c]);const j={"bottom-left":"top-end","bottom-right":"top-start","top-left":"bottom-end","top-right":"bottom-start"};return(0,N.jsxs)(l.Fragment,{ref:s,children:[(0,N.jsx)("div",{className:`meeting-floating-widget p-3 ${u} ${h?"show":""} ${t?"dragging":""}`,ref:n,children:(0,N.jsxs)("div",{className:"meeting-floating-widget-inner position-relative",ref:r,children:[(0,N.jsxs)(Ce.S,{className:"floating-widget-left d-flex",children:[(0,N.jsx)(Ce.S,(0,F.A)((0,F.A)((0,F.A)({},i),a),{},{className:"grab-point d-flex justify-content-center align-items-center me-3",children:(0,N.jsx)(Zs.A,{alt:"grip handle icon",height:12,src:mi,width:12})})),(0,N.jsxs)(ve.A,{className:"meeting-widget-trigger d-flex justify-content-center align-items-center",onClick:()=>x(!p),variant:"link",children:[(0,N.jsx)(yi,{compact:!0}),(0,N.jsx)("div",{className:"d-inline ms-1",children:(0,N.jsxs)("span",{className:"d-flex justify-content-center align-items-center",children:[v?(0,N.jsx)(ke.A,{defaultMessage:"Just you",id:"label.just_you.aeed20a9"}):"",p?(0,N.jsx)(ze.UCm,{className:"ms-1"}):(0,N.jsx)(ze.z44,{className:"ms-1"})]})})]}),(0,N.jsx)(Ce.S,(0,F.A)((0,F.A)((0,F.A)({},i),a),{},{className:"grab-point center",children:(0,N.jsx)(Zs.A,{alt:"center divider grip icon",height:40,src:gi,width:1})}))]}),(0,N.jsx)(Ce.S,{className:"floating-widget-right",children:(0,N.jsx)(oi,{compact:!0,tooltipPosition:g})})]})}),(0,N.jsx)(Si,{floating:!0,onHide:()=>x(!1),placement:(null===j||void 0===j?void 0:j[u])||"top-end",show:p,target:r})]})});pi.displayName="MeetingFloatingWidget";var xi=pi;const vi=(0,l.forwardRef)((e,s)=>{const{userId:a}=(0,P.nm)(),{roster_preview:t}=Yt(),{roster:i}=(0,$t.Abl)(),[n,r]=(0,l.useState)(!0);return(0,l.useEffect)(()=>{r((()=>{const e=Object.values(i),s=(null!==e&&void 0!==e&&e.length?e:null!==t&&void 0!==t&&t.length?t:[]).filter(e=>{let{id:s,externalUserId:t}=e;return!(s&&!Number(s)||t&&!Number(t))&&(s?Number(s)!==a:t?Number(t)!==a:void 0)});return!(null!==s&&void 0!==s&&s.length)})())},[i,t]),(0,N.jsx)(l.Fragment,{ref:s,children:(0,N.jsx)("div",{className:"meeting-floating-widget p-3 draggable-overlay",children:(0,N.jsxs)("div",{className:"meeting-floating-widget-inner position-relative",children:[(0,N.jsxs)(Ce.S,{className:"floating-widget-left d-flex",children:[(0,N.jsx)(Ce.S,{className:"grab-point d-flex justify-content-center align-items-center me-3",children:(0,N.jsx)(Zs.A,{alt:"grip handle icon",height:12,src:mi,width:12})}),(0,N.jsxs)(ve.A,{className:"meeting-widget-trigger d-flex justify-content-center align-items-center",disabled:!0,variant:"link",children:[(0,N.jsx)(yi,{compact:!0}),(0,N.jsx)("div",{className:"d-inline ms-1",children:(0,N.jsxs)("span",{className:"d-flex justify-content-center align-items-center",children:[n?(0,N.jsx)(ke.A,{defaultMessage:"Just you",id:"label.just_you.aeed20a9"}):"",(0,N.jsx)(ze.z44,{className:"ms-1"})]})})]}),(0,N.jsx)(Ce.S,{className:"grab-point center",children:(0,N.jsx)(Zs.A,{alt:"center divider grip icon",height:40,src:gi,width:1})})]}),(0,N.jsx)(Ce.S,{className:"floating-widget-right",children:(0,N.jsx)(oi,{compact:!0,disabled:!0})})]})})})});vi.displayName="MeetingFloatingWidgetDraggableOverlay";var fi=vi;var ji=e=>{const{isDraggingOver:s,position:a}=e,{setNodeRef:t}=(0,ui.zM)({id:a});return(0,N.jsx)("div",{className:`meeting-floating-widget-dropzone ${a} ${s?"dragging-over":""}`,ref:t,children:(0,N.jsx)(Ce.S,{className:"snap-area"})})};var _i=e=>{const{children:s,sidebarOpen:a}=e,{getCookie:t,setCookie:i}=(0,P.nm)(),{joined:n}=Yt(),[r,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(t("preferredMeetingWidgetLocation")||"bottom-right"),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null);(0,l.useEffect)(()=>{o(n)},[n]);
2return(0,N.jsxs)(ui.Mp,{onDragEnd:e=>{const{over:s}=e,a=(null===s||void 0===s?void 0:s.id)||d;d!==a&&(c(a),i("preferredMeetingWidgetLocation",a)),u(!1),g(null)},onDragOver:e=>{const{over:s}=e;g(null===s||void 0===s?void 0:s.id)},onDragStart:()=>u(!0),children:[(0,N.jsx)(Gt,{value:{setShowWidget:o,setWidgetLocation:c,show_widget:r,widget_location:d},children:(0,N.jsxs)(Ce.S,{className:`meeting-floating-widget-wrapper ${r?"widget-visible":""} ${a?"sidebar-open":""} ${h?"dragging":""}`,children:[["top-left","top-right","bottom-left","bottom-right"].map((e,s)=>(0,N.jsx)(ji,{isDraggingOver:e===m,position:e},s)),s,(0,N.jsx)(xi,{})]})}),(0,N.jsx)(ui.Hd,{className:"meeting-floating-widget-drag-overlay",dropAnimation:{duration:300,easing:"cubic-bezier(0, 0.7, 0.5, 1)"},children:h?(0,N.jsx)(fi,{}):null})]})},bi=t(32795);var Ai=e=>{const{asToggle:s,children:a,className:t,disabled:i,icon:n,onClick:r,tooltipLabel:o,tooltipPosition:d}=e,c=(0,l.useRef)(null),[h,u]=(0,l.useState)(!1),m=()=>o&&u(!0),g=()=>o&&u(!1);return(0,N.jsxs)(N.Fragment,{children:[s?(0,N.jsx)(li.A.Toggle,{className:`meeting-icon-button ${t||""}`,disabled:i,onMouseEnter:m,onMouseLeave:g,ref:c,variant:"link",children:n||a}):(0,N.jsx)(ve.A,{className:`meeting-icon-button ${t||""}`,disabled:i,onClick:r,onMouseEnter:m,onMouseLeave:g,ref:c,variant:"link",children:n||a}),(0,N.jsx)(bi.A,{placement:d,show:h,target:null===c||void 0===c?void 0:c.current,children:(0,N.jsx)(Qa.A,{id:`${o}-tooltip`,style:{zIndex:1e4},children:(0,N.jsx)("span",{className:"text-capitalize",children:(0,N.jsx)(ke.A,{defaultMessage:o,id:`label.${o}`})})})})]})};var yi=e=>{const{compact:s}=e,{joined:a,roster_preview:t}=Yt(),{roster:i}=(0,$t.Abl)(),[n,r]=(0,l.useState)(t);return(0,l.useEffect)(()=>{if(a){const e=Object.values(i);r(null!==e&&void 0!==e&&e.length?e.map(e=>(e=>{const{chimeAttendeeId:s,externalUserId:a}=e,i=t.find(e=>(null===e||void 0===e?void 0:e.id)===Number.parseInt(a));return i?{attendee_id:s,user:i}:null})(e)||null):[])}else r(t)},[i,t]),(0,N.jsx)(Ce.S,{className:"solvably-meeting-roster-preview d-flex flex-column",children:n?(0,N.jsx)(Ce.S,{className:"meeting-roster d-flex",children:s?(0,N.jsx)(tn,{maxIcons:3,offset:-12,showOnline:!1,size:36,speakingIndicators:!0,theme:"dark",users:n.filter(e=>e),withBorder:!0}):(0,N.jsx)(N.Fragment,{children:n.map(e=>(0,N.jsx)(wi,{size:36,theme:"dark",user:e,withBorder:!0},null===e||void 0===e?void 0:e.id))})}):(0,N.jsx)(N.Fragment,{})})};var wi=e=>{const{showOnline:s,size:a,style:t,theme:i,user:n,withBorder:r}=e,{speaking_volume_threshold:o}=Yt(),{meeting_manager:d}=Qt(),{audioVideo:c}=d;(0,l.useEffect)(()=>{if(!c||null===n||void 0===n||!n.attendee_id)return;const e=(e,s)=>u(s>=o);return c.realtimeSubscribeToVolumeIndicator(null===n||void 0===n?void 0:n.attendee_id,e),()=>c.realtimeUnsubscribeFromVolumeIndicator(null===n||void 0===n?void 0:n.attendee_id,e)},[n]);const[h,u]=(0,l.useState)(!1);return(0,N.jsx)(Ya,{isSpeaking:h,showOnline:s,size:a,speakingIndicator:!0,style:(0,F.A)({},t),theme:i,user:null===n||void 0===n?void 0:n.user,withBorder:r})};const Ni=["arrowProps","placement","popper","show"];var Si=e=>{const{floating:s,onHide:a,placement:t,show:i,target:l}=e,{chime_attendee:n,chime_meeting:r,joined:o,loading:d,loading_state:c,meeting:h}=Yt(),u=r&&n?{Attendee:n,Meeting:r}:null;return(0,N.jsx)(bi.A,{rootClose:!0,onHide:()=>a(),placement:t,show:i,target:l.current,children:e=>{let{arrowProps:a,placement:t,popper:i,show:l}=e,n=(0,he.A)(e,Ni);return(0,N.jsxs)("div",(0,F.A)((0,F.A)({className:`meeting-widget ${o?"joined":""} ${s?"my-3":"my-2"} p-3`},n),{},{children:[(0,N.jsxs)(Ce.S,{className:"meeting-widget-header d-flex flex-column",children:[(0,N.jsxs)(Ce.S,{className:"meeting-widget-header-upper d-flex align-items-center justify-content-between",children:[(0,N.jsx)("p",{className:"h5 m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Active voice call",id:"label.active_voice_call.fbaef141"})}),o&&(0,N.jsx)(ni,{createMeetinResponse:u})]}),(0,N.jsx)(Ce.S,{className:"meeting-widget-header-lower",children:o&&h?(0,N.jsx)(hi,{}):(0,N.jsx)(N.Fragment,{})})]}),(0,N.jsx)(Ce.S,{className:"meeting-widget-body p-3",children:d&&"polling"!==c?(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center justify-content-center",children:[(0,N.jsx)(qt.A,{animation:"border",variant:"secondary"}),(0,N.jsx)("span",{className:"loading-status text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:`${c}`,id:`label.${c}`})})]}):(0,N.jsx)(Bl,{})}),(0,N.jsx)(Ce.S,{className:"meeting-widget-footer d-flex",children:(0,N.jsx)(oi,{tooltipPosition:"bottom"})})]}))}})};
2var Ci=e=>{const{disabled:s,tooltipPosition:a}=e,{muted:t,toggleMute:i}=(0,$t.abu)();return(0,N.jsx)(Ai,{disabled:s,icon:(0,N.jsx)(zi,{muted:t,size:20}),onClick:i,tooltipLabel:t?"unmute":"mute",tooltipPosition:a})};var Mi=t.p+"static/media/microphone-slash.27f0ee4209beeca08e2c1d1095bcddee.svg";var ki=t.p+"static/media/microphone.8851998868531d63d37bc8b25c23c326.svg";var zi=e=>(0,N.jsx)(Zs.A,{alt:(e.muted?"unmute":"mute")+" icon",height:e.size||e.height,src:e.muted?Mi:ki,width:e.size||e.width});class Ti extends l.Component{constructor(e){super(e),this.state={error:null,loading:!1}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this);const e=js.A.parse(window.location.search),s=e&&e.code?e.code:null,a=e&&e.scope?e.scope:null;s?this.getGoogleAccessToken(s):this.redirectToGoogleAuth(a)}getGoogleAccessToken(e){return new Promise((s,a)=>{const{app:t}=this.props,{api:i}=t;i.get("/oauth/google/tokens/get",{auth_code:e}).then(e=>{let s=e&&e.hasOwnProperty("expiry_date")?e.expiry_date:0;t.setCookie("googleAccessToken",JSON.stringify(e),{expires:new Date(s)}),window.close()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),a(s)})})}redirectToGoogleAuth(e){const{app:s}=this.props,a=s.api;return new Promise((s,t)=>{this.setState({loading:!0}),a.get("/oauth/google/auth",{scope:e}).then(e=>{let{url:s}=e;window.location=s}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),t(s)})})}render(){return(0,N.jsxs)(Ce.S,{style:{paddingTop:35},children:[this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error})]})}}var Ii=(0,n.G0)(Ti),Ei=t(35335),Fi=t(8767);const Ri=new De.A,Di=e=>("undefined"!=typeof e&&null!=e||(e=""),new Promise((s,a)=>{const t=window.open(`/auth/google?scope=${e}`,"googleOAuth","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=150,top=150,width=475,height=650"),i=setInterval(function(){t.closed&&(clearInterval(i),Bi()?s(!0):a("Log in failed"))},500)})),Bi=()=>!!Pi(),Pi=()=>{const e=Ri.get("googleAccessToken");return e||null};var Li=t(70364),Oi=t.n(Li);const Hi=l.createContext({}),Ui=Hi.Provider,Qi=(Hi.Consumer,()=>l.useContext(Hi));var Vi=t.p+"static/media/google_meets_text.6c6531e10e7b9c601cd22b41e36d6f07.svg";class Gi extends l.Component{constructor(s){super(s),this.show=async()=>{let e=0;await Bi()&&(e=1),this.setState({error:null,join_url:"",phase:e,show:!0})},this.handleHide=()=>{const{onHide:e}=this.props;"function"==typeof e&&e(),this.setState({show:!1})},this.handleSubmit=async s=>{let{attendees:a,color:t,description:i,end_date:l,start_date:n,title:r}=s;this.setState({loading:!0});try{const e=await(async e=>{let{attendees:s,color:a,description:t,end_date:i,start_date:l,title:n}=e;const r=new Ee.Ay;if(Bi()||await Di(),!Bi())return!1;const o=Pi(),d=new Date(l).toISOString(),c=new Date(i).toISOString();return new Promise((e,i)=>{r.post("/oauth/google/meet/create",{attendees:s,color:a,description:t,end_date:c,start_date:d,title:n,tokens:JSON.stringify(o)}).then(s=>{let{event:a}=s;e(a)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i(s)})})})({attendees:a,color:t,description:i,end_date:l,start_date:n,title:r}),s=e&&e.data&&e.data.hangoutLink?e.data.hangoutLink:"";this.setState({join_url:s,loading:!1,phase:2})}catch(e){console.log(e),this.setState({loading:!1,phase:3})}},this.handleSignIn=async()=>{Di().then(e=>{if(!e)return!1;this.setState({phase:1})}).catch(e=>{this.setState({error:e})})},this.handleGetColors=async()=>{const e=await(async()=>{const e=new Ee.Ay;if(Bi()||await Di(),!Bi())return!1;const s=Pi();return new Promise((a,t)=>{e.get("/oauth/google/calendar/colors",{},{tokens:JSON.stringify(s)}).then(e=>{let{colors:s}=e;a(s)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;t(s)})})})();
2if(e&&e.data&&e.data.event){const s=this.parseEventColors(e.data.event);this.setState({colors:e.data.event,event_colors:s})}},this.parseEventColors=e=>{const s=[];for(const a in e)e.hasOwnProperty(a)&&s.push({color:e[a].background,key:a});return s},this.getColorName=e=>{let s="";switch(e){case"#a4bdfc":s="Lavender";break;case"#7ae7bf":s="Sage";break;case"#dbadff":s="Flamingo";break;case"#ff887c":s="Tangerine";break;case"#fbd75b":s="Banana";break;case"#ffb878":s="Mac & Cheese";break;case"#46d6db":s="Peacock";break;case"#e1e1e1":s="Mercury";break;case"#5484ed":s="Blueberry";break;case"#51b749":s="Basil";break;case"#dc2127":s="Tomato"}return s},this.toggleShowDateOptions=()=>{this.setState(e=>({display_date_calendar_options:!e.display_date_calendar_options}))},this.handleSendChatLink=async()=>{const{join_url:e}=this.state,{app:s,assignment_wrapper:a}=this.props,{api:t}=s,{team:i}=a||{},l=null===i||void 0===i?void 0:i.id,n="I'm hosting a Google Meets meeting",r=`<p>${n}</p><p></br>${`<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`}</p>`,o=`${n} \n${e}`;return await t.post("/api/teams/chat/add",{body:r,file_id:null,source:"system_post",team_id:l,text:o}).then(()=>!0).catch(e=>{let s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;return"muted"===s&&(s="You no longer have access to this feature. If you feel this is an error, please contact your administrator or Solvably support."),this.setState({error:s}),!1})},this.state={attendees:[""],colors:null,display_date_calendar_options:!1,error:null,event_colors:null,join_url:"",loading:!1,phase:0,show:!1}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}render(){const{phase:e}=this.state;return(0,N.jsx)(Ui,{value:(0,F.A)((0,F.A)({},this.state),{},{getColorName:this.getColorName,goToPhase2:()=>this.setState({phase:2}),handleHide:this.handleHide,handleSendChatLink:this.handleSendChatLink,handleSignIn:this.handleSignIn,handleSubmit:this.handleSubmit,toggleShowDateOptions:this.toggleShowDateOptions}),children:(0,N.jsxs)(xe,{dismissable:!0,className:"modal-google-meet",onHide:()=>{this.handleHide()},show:this.state.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!this.state.loading&&(0,N.jsxs)(N.Fragment,{children:[0===e&&(0,N.jsx)(Ki,{}),1===e&&(0,N.jsx)(Yi,{}),2===e&&(0,N.jsx)(qi,{}),3===e&&(0,N.jsx)(Ji,{})]})]})]})})}}var Wi=(0,n.G0)(ot(Gi));const Ki=e=>{const{handleSignIn:s}=Qi();return(0,N.jsxs)(Ce.S,{className:"text-center mt-5 mb-5",children:[(0,N.jsxs)("div",{className:"google-logo-container",children:[(0,N.jsx)(Zs.A,{roundedCircle:!0,className:"google-meet-logo",src:t(15911)}),(0,N.jsx)(Zs.A,{className:"google-meet-text-logo mt-2",src:Vi})]}),(0,N.jsx)("h5",{className:"mt-5",children:"Welcome to Google Meet"}),(0,N.jsx)(ve.A,{className:"btn-google-meet mt-3",onClick:e=>{s()},size:"lg",children:"Sign in"})]})},Yi=e=>{const{locale:s}=(0,P.nm)(),{attendees:a,colors:i,display_date_calendar_options:l,event_colors:n,getColorName:r,handleHide:o,handleSubmit:d,saving:c,toggleShowDateOptions:h}=Qi(),u=ci()(),m=ci()(u).add(1,"hour");return(0,N.jsxs)(Ce.S,{className:"phase-1",children:[(0,N.jsxs)("div",{className:"mb-5 google-logo-container",children:[(0,N.jsx)(Zs.A,{alt:"Google Meet Logo",className:"google-meet-logo",fluid:!0,roundedCircle:!0,src:t(15911)}),(0,N.jsx)("h5",{className:"text-center mt-3 mb-3",children:"Create a Google Meet meeting for your Solvably team."})]}),(0,N.jsx)(ds.l1,{validationSchema:(0,Re.by)({locale:s,scope:"meetings.google_meet_meeting"}),initialValues:{attendees:a,color:"default",description:"",end_date:m.toDate().getTime(),start_date:u.toDate().getTime(),title:""},onSubmit:(e,s)=>{d(e)},children:e=>{let{dirty:s,errors:a,handleChange:t,handleSubmit:d,isSubmitting:u,setFieldTouched:m,setFieldValue:g,touched:p,values:x}=e;return(0,N.jsxs)(_e.A,{onSubmit:d,children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"meeting-title",children:(0,N.jsxs)(os,{controlId:"createMeetingForm.Title",children:[(0,N.jsx)(_e.A.Label,{children:"Title"}),(0,N.jsx)(_e.A.Control,{"aria-label":"Title",disabled:c,isInvalid:p.title&&a.title,isValid:p.title&&!a.title,name:"title",onCh
2ange:t,placeholder:"Add title",value:x.title}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger my-1",children:e})})]})}),(0,N.jsx)(Ce.S,{className:"mt-4",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"When?"}),(0,N.jsxs)("div",{className:"d-flex",children:[(0,N.jsx)(_e.A.Check,{checked:!l,className:"me-2",id:"form_start_meeting_now_radio",label:"Now",name:"start_meeting_now",type:"radio",onChange:()=>{h();const e=new Date;g("start_date",e.getTime()),m("start_date"),g("end_date",ci()(e).add(1,"hour").toDate().getTime())}}),(0,N.jsx)(_e.A.Check,{checked:l,id:"form_start_meeting_now_radio",label:"Later",name:"start_meeting_now",type:"radio",onChange:()=>{const e=new Date;g("start_date",e.getTime()),m("start_date"),g("end_date",ci()(e).add(1,"hour").toDate().getTime()),h()}})]})]}),l&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"Start date"}),(0,N.jsx)("div",{children:(0,N.jsx)(Oi(),{dateFormat:"MMM d, yyyy",selected:x.start_date,showPopperArrow:!1,onChange:e=>{g("start_date",e.getTime()),m("start_date"),g("end_date",ci()(e).add(1,"hour").toDate().getTime())}})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"Start Time"}),(0,N.jsx)("div",{children:(0,N.jsx)(Oi(),{showTimeSelect:!0,showTimeSelectOnly:!0,dateFormat:"h:mm aa",selected:x.start_date,timeCaption:"Time",timeIntervals:30,onChange:e=>{g("start_date",e.getTime()),m("start_date"),g("end_date",ci()(e).add(1,"hour").toDate().getTime())}})})]})})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"End Date"}),(0,N.jsx)("div",{className:"d-flex flex-nowrap",children:(0,N.jsx)(Oi(),{dateFormat:"MMM d, yyyy",maxDate:ci()(x.start_date).add(4,"hours").toDate(),minDate:ci()(x.start_date).add(5,"minutes").toDate(),selected:x.end_date,showPopperArrow:!1,onChange:e=>{g("end_date",e.getTime()),m("end_date")}})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"End Time"}),(0,N.jsx)(Oi(),{showTimeSelect:!0,showTimeSelectOnly:!0,dateFormat:"h:mm aa",maxTime:ci()(x.start_date).add(4,"hours").toDate(),minTime:ci()(x.start_date).add(5,"minutes").toDate(),selected:x.end_date,timeCaption:"Time",timeIntervals:30,onChange:e=>{g("end_date",e.getTime()),m("end_date")}})]})})]})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)(ds.Kw,{name:"start_date",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(ds.Kw,{name:"end_date",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:["Attendees ",(0,N.jsx)("small",{children:"(optional)"})]}),(0,N.jsx)(ds.ED,{name:"attendees",render:e=>(0,N.jsxs)("div",{className:"position-relative",children:[x.attendees&&x.attendees.length>0?x.attendees.map((s,t)=>(0,N.jsxs)("div",{className:"mb-3",children:[(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(ds.D0,{className:"google-meet-attendee-input",name:`attendees.${t}`,placeholder:"Email"}),x.attendees.length>1&&(0,N.jsx)(ve.A,{className:"btn-google-meet-remove-attendee",onClick:()=>e.remove(t),variant:"secondary",children:(0,N.jsx)(ze.QCr,{})})]}),a.attendees&&p.attendees&&a.attendees[t]&&p.attendees[t]&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:a.attendees[t]})]},t)):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"No attendees added",id:"label.no_attendees_added.3dca33d8"})}),(0,N.jsx)(Ce.S,{style:{position:"absolute",right:0,top:0},children:(0,N.jsx)(ve.A,{onClick:s=>{s.preventDefault(),e.push("")},type:"link",variant:"link",children:"+ Add Attendee"})})]})})]})})})})}),n&&(0,N.jsxs)(Ce.S,{className:"mt-4",children:[(0,N.jsx)(ze.lV_,{className:"float-start mt-2",height:20,width:20}),(0,N.jsxs)(Ce.S,{className:"google-meet-modal-line",children:[(0,N.jsxs)(os,{controlId:"createMeetingForm.EventColor",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Event color",id:"label.event_c
2olor.e71b089e"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Event color (optional)",disabled:c,hidden:!0,isInvalid:p.color&&a.color,isValid:p.color&&!a.color,name:"color",onChange:t,value:x.color}),i.hasOwnProperty(x.color)?(0,N.jsxs)(Ce.S,{style:{display:"inline-block",verticalAlign:"middle"},children:[(0,N.jsx)("span",{className:"google-meet-color-circle",style:{backgroundColor:i[x.color].background}}),(0,N.jsx)("span",{className:"my-auto ms-2",style:{verticalAlign:"top"},children:r(i[x.color].background)})]}):(0,N.jsx)(Ce.S,{style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Default",id:"label.default.21b111cb"})})]}),(0,N.jsxs)(Fi.A,{className:"ms-4",id:"google-meet-color-dropdown",style:{display:"inline-block"},title:"Choose color",children:[(0,N.jsx)(li.A.Item,{onClick:()=>{g("color","default")},style:{verticalAlign:"center"},children:"Default (calendar color)"}),n.map(e=>{const{color:s,key:a}=e,t=r(s);return(0,N.jsxs)(li.A.Item,{onClick:()=>{g("color",a)},style:{verticalAlign:"center"},children:[(0,N.jsx)("span",{className:"google-meet-color-circle",style:{backgroundColor:s}}),(0,N.jsx)("span",{className:"my-auto ms-2",style:{verticalAlign:"top"},children:t})]},a)})]})]}),(0,N.jsx)(ds.Kw,{name:"color",children:e=>(0,N.jsx)("small",{className:"text-danger my-1",children:e})})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{children:[(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:["Event Description ",(0,N.jsx)("small",{children:"(optional)"})]}),(0,N.jsx)(_e.A.Control,{"aria-label":"Description (optional)",as:"textarea",disabled:c,isInvalid:p.description&&a.description,isValid:p.description&&!a.description,name:"description",onChange:t,value:x.description})]}),(0,N.jsx)(ds.Kw,{name:"description",children:e=>(0,N.jsx)("small",{className:"text-danger my-1",children:e})})]})})})})]}),(0,N.jsxs)(Ce.S,{className:"mt-4 d-flex justify-content-center",children:[(0,N.jsx)(ve.A,{className:"me-2",onClick:e=>{d()},variant:"google-meet",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})}),(0,N.jsx)(ve.A,{onClick:e=>{o()},variant:"google-meet-inverted",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})})]})]})}})]})},qi=e=>{const{handleSendChatLink:s,join_url:a}=Qi(),[i,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(!1),h=(0,l.useRef)();return(0,N.jsxs)(Ce.S,{className:"text-center phase-2",children:[(0,N.jsx)("div",{className:"mb-5 google-logo-container",children:(0,N.jsx)(Zs.A,{alt:"Google Meet Logo",className:"google-meet-logo",fluid:!0,roundedCircle:!0,src:t(15911)})}),(0,N.jsxs)(Ce.S,{className:"text-start mb-5",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"meetingUrl",children:(0,N.jsx)("strong",{children:"Your Shareable Meeting URL"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{readonly:!0,"aria-label":"Your shareable meeting URL",id:"meetingUrl",ref:h,value:a}),(0,N.jsx)(ve.A,{"aria-label":"Copy meeting URL",className:"copy-url-btn btn-google-meet",id:"copyMeetingUrlBtn",onClick:()=>{!!document.documentMode?window.clipboardData.setData("Text",a):navigator.clipboard.writeText(a),n(!0),h.current.select()},size:"sm",children:(0,N.jsx)(ze.paH,{})})]}),(0,N.jsx)(_e.A.Text,{className:"text-success "+(i?"d-block":"d-none"),children:"Copied to clipboard!"})]}),(0,N.jsxs)(Ce.S,{className:"mt-2 mb-5",children:[(0,N.jsx)(ve.A,{className:"btn-google-meet",href:a,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start meeting",id:"label.start_meeting.781731fd"})})}),(0,N.jsx)(ve.A,{className:"btn-google-meet inverted ms-2",disabled:r,onClick:()=>{"function"===typeof s&&(c(!0),s().then(e=>{o(e),c(!1)}))},children:d?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(qt.A,{animation:"border",size:"sm"}),(0,N.jsx)("span",{className:"ms-1",children:"Sending..."})]}):(0,N.jsx)(N.Fragment,{children:r?"Invite Sent":"Send to Team"})})]})]})},Ji=e=>{const{goToPhase2:s}=Qi();return(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)(ze._Hm,{className:"text-danger mt-3",size:60}),(0,N.jsx)("h3",{className:"mt-4",children:"Unable to create meeting."}),(0,N.jsx)(Ce.S,{className:"mt-3",children:"We were unable to create your meeting. Please ensure that your Google or G Suite account has access to Google Hangouts/Meet by logging in."}),(0,N.jsx)(Ce.S,{className:"mt-2 mb-5",children:(0,N.jsx)(ve.A,{className:"btn-google-meet mt-3",onClick:e=>{s()},children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})})]})};const Xi=l.createContext({}),Zi=Xi.Provider,$i=(Xi.Consumer,()=>l.useContext(Xi));class el extends l.Component{constructor(s){super(s),this.show=async()=>{let e=0;await te()&&(e=1),this.setState({error:null,join_url:"",phase:e,show:!0})},this.handleHide=()=>{const{onHide:e}=this.props;"function"==typeof e&&e(),this.setState({show:!1})},this.handleSubmit=async s=>{let{end_date:a,start_date:t,title:i}=s;this.setState({loading:!0});try{const e=await(async e=>{let s,a,t,{end_date:i,start_date:l,title:n}=e;if(!ae)return!1;let r=null;try{r=await le()}catch(o){throw o}try{const e={endDateTime:new Date(i).toISOString(),startDateTime:new Date(l).toISOString(),subject:n},o=await Z.A.post("https://graph.microsoft.com/beta/me/onlineMeetings",e,{headers:{Authorization:`Bearer ${r.accessToken}`,"Content-type":"application/json"}}),d=decodeURIComponent((null!==(t=null===(a=null===(s=o.data.joinInformation.content)||void 0===s?void 0:s.split(","))||void 0===a?void 0:a[1])&&void 0!==t?t:"").replace(/\+/g,"%20"));return{id:o.data.id,conferenceId:o.data.audioConferencing?o.data.audioConferencing.conferenceId:"",creationDateTime:$(o.data.creationDateTime),dialinUrl:o.data.audioConferencing?o.data.audioConferencing.dialinUrl:"",endDateTime:$(o.data.endDateTime),joinUrl:o.data.joinUrl,joinWebUrl:o.data.joinWebUrl,preview:d,startDateTime:$(o.data.startDateTime),subject:o.data.subject,tollFreeNumber:o.data.audioConferencing?o.data.audioConferencing.tollFreeNumber:"",tollNumber:o.data.audioConferencing?o.data.audioConferencing.tollNumber:"",videoTeleconferenceId:o.data.videoTeleconferenceId}}catch(o){throw new Error("Unable to create meeting due to an error: "+o)}})({end_date:a,start_date:t,title:i});this.setState({join_url:null===e||void 0===e?void 0:e.joinUrl,loading:!1,phase:2})}catch(e){this.setState({loading:!1,phase:3})}},this.handleSignIn=async()=>
2{if(!await ie())return!1;this.setState({phase:1})},this.toggleShowDateOptions=()=>{this.setState(e=>({display_date_calendar_options:!e.display_date_calendar_options}))},this.handleSendChatLink=async()=>{const{join_url:e}=this.state,{app:s,assignment_wrapper:a}=this.props,{api:t}=s,{team:i}=a||{},l=null===i||void 0===i?void 0:i.id,n="I'm hosting a Microsoft Teams meeting",r=`<p>${n}</p><p></br>${`<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`}</p>`,o=`${n} \n${e}`;return await t.post("/api/teams/chat/add",{body:r,file_id:null,source:"system_post",team_id:l,text:o}).then(()=>!0).catch(e=>{let s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;return"muted"===s&&(s="You no longer have access to this feature. If you feel this is an error, please contact your administrator or Solvably support."),this.setState({error:s}),!1})},this.state={display_date_calendar_options:!1,error:null,join_url:"",loading:!1,phase:0,show:!1}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}render(){const{phase:e}=this.state;return(0,N.jsx)(Zi,{value:(0,F.A)((0,F.A)({},this.state),{},{goToPhase1:()=>this.setState({phase:1}),handleHide:this.handleHide,handleSendChatLink:this.handleSendChatLink,handleSignIn:this.handleSignIn,handleSubmit:this.handleSubmit,toggleShowDateOptions:this.toggleShowDateOptions}),children:(0,N.jsx)(xe,{dismissable:!0,className:"modal-ms-teams",onHide:()=>{this.handleHide()},show:this.state.show,children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!this.state.loading&&(0,N.jsxs)(N.Fragment,{children:[0===e&&(0,N.jsx)(sl,{}),1===e&&(0,N.jsx)(al,{}),2===e&&(0,N.jsx)(tl,{}),3===e&&(0,N.jsx)(il,{})]})]})]})})})}}const sl=()=>{const{handleSignIn:e}=$i();return(0,N.jsxs)(Ce.S,{className:"phase-zero text-center mt-5 mb-5 ",children:[(0,N.jsxs)("div",{className:"ms-teams-logo-container",children:[(0,N.jsx)(Zs.A,{fluid:!0,alt:"Microsoft Teams Logo",className:"ms-teams-logo",roundedCircle:!0,src:t(24589)}),(0,N.jsx)("div",{className:"ms-text-logo",children:(0,N.jsx)(ke.A,{defaultMessage:"Microsoft teams",id:"label.microsoft_teams.02fd2276"})})]}),(0,N.jsx)("h5",{className:"mt-5",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Microsoft Teams",id:"label.welcome_to_microsoft_teams.28bdcb1f"})}),(0,N.jsx)(ve.A,{className:"btn-ms-teams mt-3",onClick:s=>{e()},size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Sign in",id:"label.sign_in.bfd402b2"})})]})},al=()=>{const{locale:e}=(0,P.nm)(),{display_date_calendar_options:s,handleHide:a,handleSubmit:i,saving:l,toggleShowDateOptions:n}=$i(),r=ci()(),o=ci()(r).add(1,"hour");return(0,N.jsxs)(Ce.S,{className:"phase-1",children:[(0,N.jsxs)("div",{className:"mb-5 ms-teams-logo-container",children:[(0,N.jsx)(Zs.A,{alt:"Microsoft Teams Logo",className:"ms-teams-logo",roundedCircle:!0,src:t(24589)}),(0,N.jsx)("div",{className:"ms-text-logo",children:(0,N.jsx)(ke.A,{defaultMessage:"Microsoft teams",id:"label.microsoft_teams.02fd2276"})}),(0,N.jsx)("h5",{className:"text-center mg-3 mb-3 mt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a Microsoft Teams meeting for your Solvably team.",id:"label.create_a_microsoft_teams_meeting_f.8024fcdc"})})]}),(0,N.jsx)(ds.l1,{validateOnChange:!0,validationSchema:(0,Re.by)({locale:e,scope:"meetings.ms_teams_meeting"}),initialValues:{end_date:o.toDate().getTime(),start_date:r.toDate().getTime(),title:""},onSubmit:(e,s)=>{i(e)},children:e=>{let{errors:t,handleChange:i,handleSubmit:r,isValid:o,setFieldTouched:d,setFieldValue:c,touched:h,values:u}=e;return(0,N.jsxs)(_e.A,{onSubmit:r,children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"meeting-title",children:(0,N.jsxs)(os,{controlId:"createMeetingForm.Title",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Title",disabled:l,isInvalid:h.title&&t.title,isValid:h.title&&!t.title,name:"title",onCh
2ange:i,placeholder:"Add title",value:u.title}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)(Ce.S,{className:"mt-4",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"When?",id:"label.when.e5d25249"})}),(0,N.jsxs)("div",{className:"d-flex",children:[(0,N.jsx)(_e.A.Check,{checked:!s,className:"me-2",id:"form_start_meeting_now_radio",label:"Now",name:"start_meeting_now",type:"radio",onChange:async()=>{n();const e=new Date;await c("start_date",e.getTime()),await d("start_date"),await c("end_date",ci()(e).add(1,"hour").toDate().getTime())}}),(0,N.jsx)(_e.A.Check,{checked:s,id:"form_start_meeting_now_radio",label:"Later",name:"start_meeting_now",type:"radio",onChange:async()=>{const e=new Date;await c("start_date",e.getTime()),await d("start_date"),await c("end_date",ci()(e).add(1,"hour").toDate().getTime()),n()}})]})]}),s&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)("div",{children:(0,N.jsx)(Oi(),{className:"ms-datepicker",dateFormat:"MMM d, yyyy",selected:u.start_date,showPopperArrow:!1,onChange:async e=>{await c("start_date",e.getTime()),await d("start_date"),await c("end_date",ci()(e).add(1,"hour").toDate().getTime())}})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start time",id:"label.start_time.babe9dda"})}),(0,N.jsx)("div",{children:(0,N.jsx)(Oi(),{showTimeSelect:!0,showTimeSelectOnly:!0,dateFormat:"h:mm aa",selected:u.start_date,timeCaption:"Time",timeIntervals:30,onChange:async e=>{await c("start_date",e.getTime()),await d("start_date"),await c("end_date",ci()(e).add(1,"hour").toDate().getTime())}})})]})})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",id:"label.end_date.14303aa0"})}),(0,N.jsx)("div",{children:(0,N.jsx)(Oi(),{dateFormat:"MMM d, yyyy",maxDate:ci()(u.start_date).add(4,"hours").toDate(),minDate:ci()(u.start_date).add(5,"minutes").toDate(),selected:u.end_date,showPopperArrow:!1,onChange:e=>{c("end_date",e.getTime()),d("end_date")}})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"End time",id:"label.end_time.2e46006a"})}),(0,N.jsx)("div",{children:(0,N.jsx)(Oi(),{showTimeSelect:!0,showTimeSelectOnly:!0,dateFormat:"h:mm aa",maxTime:ci()(u.start_date).add(4,"hours").toDate(),minTime:ci()(u.start_date).add(5,"minutes").toDate(),selected:u.end_date,timeCaption:"Time",timeIntervals:30,onChange:e=>{c("end_date",e.getTime()),d("end_date")}})})]})})]})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(ds.Kw,{name:"start_date",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(ds.Kw,{name:"end_date",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]})})]}),(0,N.jsxs)(Ce.S,{className:"mt-4 d-flex justify-content-center",children:[(0,N.jsx)(ve.A,{className:"me-2",disabled:!o,type:"submit",variant:"ms-teams",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})}),(0,N.jsx)(ve.A,{onClick:a,variant:"ms-teams-inverted",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})})]})]})}})]})},tl=()=>{const{handleSendChatLink:e,join_url:s}=$i(),[a,i]=(0,l.useState)(!1),[n,r]=(0,l.useState)(!1),[o,d]=(0,l.useState)(!1),c=(0,l.useRef)();return(0,N.jsxs)(Ce.S,{className:"text-center phase-2",children:[(0,N.jsxs)("div",{className:"mb-5 ms-teams-logo-container",children:[(0,N.jsx)(Zs.A,{alt:"Microsoft Teams Logo",className:"ms-teams-logo",fluid:!0,roundedCircle:!0,src:t(24589)}),(0,N.jsx)("div",{className:"ms-text-logo mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Microsoft teams",id:"label.microsoft_teams.02fd2276"})})]}),(0,N.jsxs)(Ce.S,{className:"text-start mb-5",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"meetingUrl",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Meeting URL",id:"label.meeting_url.a64aea16"})})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{readonly:!0,"aria-label":"Your shareable meeting URL",id:"meetingUrl",ref:c,value:s}),(0,N.jsxs)(ve.A,{"aria-label":"Copy meeting URL",className:"copy-url-btn btn-ms-teams",id:"copyMeetingUrlBtn",onClick:()=>{!!document.documentMode?window.clipboardData.setData("Text",s):navigator.clipboard.writeText(s),i(!0),c.current.select()},size:"sm",children:["   ",(0,N.jsx)(ze.paH,{})]})]}),(0,N.jsx)(_e.A.Text,{className:"text-success "+(a?"d-block":"d-none"),children:(0,N.jsx)(ke.A,{defaultMessage:"Copied to clipboard!",id:"label.copied_to_clipboard.916fa4a5"})})]}),(0,N.jsxs)(Ce.S,{className:"mt-2 mb-5",children:[(0,N.jsx)(ve.A,{className:"btn-ms-teams",href:s,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start meeting",id:"label.start_meeting.781731fd"})})}),(0,N.jsx)(ve.A,{className:"btn-ms-teams inverted ms-2",disabled:n,onClick:()=>{"function"===typeof e&&(d(!0),e().then(e=>{r(e),d(!1)}))},children:o?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(qt.A,{animation:"border",size:"sm"}),(0,N.jsx)("span",{className:"ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Sending...",id:"label.sending.286a3af7"})})]}):(0,N.jsx)(N.Fragment,{children:n?"Invite Sent":"Send to Team"})})]})]})},il=()=>{const{goToPhase1:e}=$i();return(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)(ze._Hm,{className:"text-danger mt-3",size:60}),(0,N.jsx)("h3",{className:"mt-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Unable to create meeting.",id:"label.unable_to_create_meeting.f2085c8b"})}),(0,N.jsxs)(Ce.S,{className:"mt-3",children:[(0,N.jsx)(ke.A,{defaultMessage:"We were unable to create your meeting. Please ensure that your Microsoft Account has access to Microsoft Teams by logging into your native",id:"label.we_were_unable_to_create_your_meet.2576df83"})," ",(0,N.jsx)("a",{href:"MSTeams:/l/",children:(0,N.jsx)(ke.A,{defaultMessage:"Microsoft Teams application",id:"label.microsoft_teams_application.75520124"})}),"."]}),(0,N.jsx)(Ce.S,{className:"mt-2 mb-5",children:(0,N.jsx)(ve.A,{className:"btn-ms-teams mt-3",onClick:s=>{e()},children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})})]})};var ll=(0,P.G0)(ot(el));
2class nl extends l.Component{constructor(e){super(e),this.state={error:null,loading:!1}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this);const e=js.A.parse(window.location.search),s=(null===e||void 0===e?void 0:e.code)||null,a=(null===e||void 0===e?void 0:e.scope)||null;s?this.getZoomAccessToken(s):this.redirectToZoomAuth(a)}async getZoomAccessToken(e){const{app:s}=this.props,{api:a}=s;await a.get("/oauth/zoom/tokens/get",{auth_code:e}).then(e=>{const a=JSON.parse(e),t=(null===a||void 0===a?void 0:a.expires_in)||0,i=Date.now()+1e3*t;s.setCookie("zoomAccessToken",JSON.stringify(a),{expires:new Date(i)}),window.close()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}async redirectToZoomAuth(e){const{app:s}=this.props,a=s.api;this.setState({loading:!0}),await a.get("/oauth/zoom/auth",{scope:e}).then(e=>{let{url:s}=e;window.location=s}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{error:e,loading:s}=this.state;return(0,N.jsxs)(Ce.S,{style:{paddingTop:35},children:[s&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e})]})}}var rl=(0,n.G0)(nl);const ol=new De.A,dl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return new Promise((s,a)=>{const t=window.open(`/auth/zoom?scope=${e}`,"zoomOAuth","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=150,top=150,width=475,height=650"),i=setInterval(()=>{t.closed&&(clearInterval(i),cl()?s(!0):a("Log in failed"))},500)})},cl=()=>!!hl(),hl=()=>ol.get("zoomAccessToken")||null;var ul=t(85900),ml=t(50829),gl=t(99133);const pl=l.createContext({}),xl=pl.Provider;pl.Consumer;class vl extends l.Component{constructor(e){super(e),this.state={error:null,join_url:"",loading:!1,password:"",phase:0,show:!1,start_url:""},this.handleGetPersonalMeeting=this.handleGetPersonalMeeting.bind(this),this.handleSendChatLink=this.handleSendChatLink.bind(this),this.handleCreateMeeting=this.handleCreateMeeting.bind(this),this.handleSignIn=this.handleSignIn.bind(this),this.handleRetry=this.handleRetry.bind(this),this.show=this.show.bind(this),this.hide=this.hide.bind(this)}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}async show(){const e=await cl()?1:0;this.setState({error:null,phase:e,show:!0})}hide(){const{onHide:e}=this.props;"function"===typeof e&&e(),this.setState({show:!1})}async handleSignIn(){const{app:e}=this.props,{authProviders:s}=e;s.zoom&&(this.setState({loading:!0}),await dl().then(async e=>{if(!e)return!1;this.setState({join_url:"",loading:!1,password:"",phase:1,start_url:""})}).catch(e=>this.setState({error:e,loading:!1})))}async handleCreateMeeting(e){this.setState({loading:!0}),await(async(e,s)=>{const a=new Ee.Ay;if(cl()||await dl(),!cl())return!1;const t=hl();return await a.post("/oauth/zoom/meeting/create",{options:JSON.stringify(s),tokens:JSON.stringify(t)})})().then(e=>{let{meeting:s}=e;const{join_url:a,password:t,start_url:i}=s;this.setState({join_url:a,loading:!1,password:t,phase:2,start_url:i})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1,phase:3})})}async handleGetPersonalMeeting(){return this.setState({loading:!0}),await(async()=>{const e=new Ee.Ay;if(cl()||await dl(),!cl())return!1;const s=hl();return await e.post("/oauth/zoom/user/get",{tokens:JSON.stringify(s)})})().then(()=>(this.setState({join_url:"",loading:!1,password:"",phase:2,start_url:""}),!0)).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;return this.setState({error:s,loading:!1,phase:3}),null})}async handleSendChatLink(){const{join_url:e,password:s}=this.state,{app:a,assignment_wrapper:t}=this.props,{api:i}=a,{team:l}=t||{},n=null===l||void 0===l?void 0:l.id,r="I'm hosting a Zoom meeting.",o=`<p>${r}</p>${s?`<p>Password: <strong>${s}</strong></p>`:""}<p></br>${`<a href="${e}" target="_blank" rel="noopener noreferrer">${e}</a>`}</p>`,d=`${r} \n ${s} \n${e}`;
2return await i.post("/api/teams/chat/add",{body:o,file_id:null,source:"system_post",team_id:n,text:d}).then(()=>!0).catch(e=>{let s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;return"muted"===s&&(s="You no longer have access to this feature. If you feel this is an error, please contact your administrator or Solvably support."),this.setState({error:s}),!1})}handleRetry(){this.setState({error:null,phase:1})}render(){const{app:e}=this.props,{authProviders:s}=e||{},a=Boolean(null===s||void 0===s?void 0:s.zoom),{error:t,join_url:i,loading:l,password:n,phase:r,show:o,start_url:d}=this.state;return(0,N.jsx)(xl,{value:{handleCreateMeeting:this.handleCreateMeeting,handleGetPersonalMeeting:this.handleGetPersonalMeeting,handleRetry:this.handleRetry,handleSendChatLink:this.handleSendChatLink,handleSignIn:this.handleSignIn,hide:this.hide,join_url:i,password:n,start_url:d,zoom_auth_enabled:a},children:(0,N.jsx)(xe,{dismissable:!0,className:"modal-zoom",onHide:this.hide,show:o,children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:t,variant:"danger",children:t}),l?(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{height:300},children:(0,N.jsx)(Me.y$,{})}):(0,N.jsx)(N.Fragment,{children:(e=>{switch(e){case 0:return(0,N.jsx)(fl,{});case 1:return(0,N.jsx)(jl,{});case 2:return(0,N.jsx)(_l,{});case 3:return(0,N.jsx)(bl,{});default:return(0,N.jsx)(N.Fragment,{})}})(r)})]})]})})})}}const fl=e=>{const s=(0,l.useContext)(pl),{handleSignIn:a,hide:t,zoom_auth_enabled:i}=s;return(0,N.jsxs)(Ce.S,{className:"text-center mb-2 phase-0",children:[(0,N.jsxs)(Ce.S,{className:"zoom-logo-container",children:[(0,N.jsx)(Zs.A,{alt:"zoom camera logo",className:"zoom-camera-logo mb-2",fluid:!0,src:ml}),(0,N.jsx)(Zs.A,{alt:"zoom text logo",className:"zoom-text-logo",fluid:!0,src:gl})]}),(0,N.jsx)("h5",{className:"mt-5",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Zoom",id:"label.welcome_to_zoom.0150479f"})}),i?(0,N.jsx)(ve.A,{className:"btn-zoom mt-3",onClick:a,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Sign in",id:"label.sign_in.bfd402b2"})}):(0,N.jsx)(ve.A,{className:"btn-zoom mt-3",href:"https://www.zoom.us/start",onClick:t,rel:"noopener noreferrer",size:"lg",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Sign in",id:"label.sign_in.bfd402b2"})})]})},jl=e=>{const s=(0,l.useContext)(pl),{handleCreateMeeting:a}=s,t=ul.Ik().shape({password:ul.Yj().max(10,"Password does not meet length requirements (max 10 characters)").matches(/^[a-zA-Z0-9@\-_*]{0,10}$/,"Password format invalid - Password must be no more than 10 characters, and may only include alphanumeric characters and the following symbols (@, -, _, *).")});return(0,N.jsxs)(Ce.S,{className:"phase-1",children:[(0,N.jsxs)(Ce.S,{className:"mb-5 zoom-logo-container",children:[(0,N.jsx)(Zs.A,{alt:"zoom camera logo",className:"zoom-camera-logo mb-2",fluid:!0,roundedCircle:!0,src:ml}),(0,N.jsx)(Zs.A,{alt:"zoom text logo",className:"zoom-text-logo",fluid:!0,src:gl})]}),(0,N.jsx)("h5",{className:"text-center mt-5 mb-3",children:"Create a Zoom meeting for your Solvably team."}),(0,N.jsx)(ds.l1,{initialValues:{password:"",topic:"",use_pmi:!0},onSubmit:async(e,s)=>{const{password:t,topic:i,use_pmi:l}=e,n={password:l?void 0:t,topic:i,use_pmi:l};await a(n)},validationSchema:t,render:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{className:"mb-3",controlId:"createMeetingForm.Title",children:[(0,N.jsxs)(_e.A.Label,{children:["Title ",(0,N.jsx)("small",{children:"(optional)"})]}),(0,N.jsx)(_e.A.Control,{isInvalid:i.topic&&s.topic,isValid:i.topic&&!s.topic,name:"topic",onChange:a,placeholder:"Solvably Team Meeting",value:l.topic}),s.topic&&i.topic&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.topic})]}),(0,N.jsxs)(os,{className:"mb-3",controlId:"createMeetingForm.Password",children:[(0,N.jsxs)(_e.A.Label,{children:["Password ",(0,N.jsx)("small",{children:"(optional)"})]}),(0,N.jsx)(_e.A.Control,{disabled:l.use_pmi,isInvalid:i.password&&s.password,isValid:i.password&&!s.password,name:"password",onChange:a,placeholder:"******",type:"password",value:l.password}),s.password&&i.password&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.password})]}),(0,N.jsx)(os,{className:"mb-3",controlId:"formBasicCheckbox",children:(0,N.jsx)(_e.A.Check,{checked:l.use_pmi,className:"ps-0",label:"Use your Zoom Personal Meeting Room",name:"use_pmi",onChange:a,type:"checkbox"})}),(0,N.jsx)(os,{className:"mt-4",children:(0,N.jsx)(ve.A,{className:"btn-zoom",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Create meeting",id:"label.create_meeting.68e8ab71"})})})]})})}})]})},_l=e=>{const s=(0,l.useContext)(pl),{handleSendChatLink:a,join_url:t,password:i,start_url:n}=s,[r,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)(!1),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),p=(0,l.useRef)(),x=(0,l.useRef)();return(0,N.jsxs)(Ce.S,{className:"text-center phase-2",children:[(0,N.jsxs)(Ce.S,{className:"mb-5 zoom-logo-container",children:[(0,N.jsx)(Zs.A,{alt:"zoom camera logo",className:"zoom-camera-logo mb-2",fluid:!0,roundedCircle:!0,src:ml}),(0,N.jsx)(Zs.A,{alt:"zoom text logo",className:"zoom-text-logo",fluid:!0,src:gl})]}),(0,N.jsxs)(Ce.S,{className:"mb-5 text-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"meetingUrl",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Your Sharable Meeting URL",id:"label.your_sharable_meeting_url.016ad395"})})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{readonly:!0,"aria-label":"Your sharable meeting URL",id:"meetingUrl",ref:p,value:t}),(0,N.jsx)(ve.A,{"aria-label":"Copy meeting URL",className:"copy-url-btn btn-zoom",id:"c
2opyMeetingUrlBtn",onClick:()=>{!!document.documentMode?window.clipboardData.setData("Text",t):navigator.clipboard.writeText(t),c(!1),o(!0),p.current.select()},size:"sm",children:(0,N.jsx)(ze.paH,{})})]}),(0,N.jsx)(_e.A.Text,{className:"text-success "+(r?"d-block":"d-none"),children:"Copied to clipboard!"}),i&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_e.A.Label,{className:"mt-2",htmlFor:"meetingPassword",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{readonly:!0,"aria-label":"Your meeting password",id:"meetingPassword",ref:x,value:i}),(0,N.jsx)(ve.A,{"aria-label":"Copy meeting password",className:"copy-url-btn btn-zoom",id:"copyMeetingPasswordBtn",onClick:()=>{if(!i)return;!!document.documentMode?window.clipboardData.setData("Text",i):navigator.clipboard.writeText(i),o(!1),c(!0),x.current.select()},size:"sm",children:(0,N.jsx)(ze.paH,{})})]}),(0,N.jsx)(_e.A.Text,{className:"text-success "+(d?"d-block":"d-none"),children:"Copied to clipboard!"})]})]}),(0,N.jsxs)(Ce.S,{className:"mb-3",children:[(0,N.jsx)(ve.A,{className:"btn-zoom",href:n,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start meeting",id:"label.start_meeting.781731fd"})})}),(0,N.jsx)(ve.A,{className:"btn-zoom inverted ms-2",disabled:h,onClick:()=>{"function"===typeof a&&(g(!0),a().then(e=>{u(e),g(!1)}))},children:m?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(qt.A,{animation:"border",size:"sm"}),(0,N.jsx)("span",{className:"ms-1",children:"Sending..."})]}):(0,N.jsx)(N.Fragment,{children:h?"Invite Sent":"Send to Team"})})]})]})},bl=e=>{const s=(0,l.useContext)(pl),{handleRetry:a}=s;return(0,N.jsxs)(Ce.S,{className:"phase-3",children:[(0,N.jsx)(ze._Hm,{className:"text-danger mt-3",size:60}),(0,N.jsx)("span",{className:"h3 mt-4",children:"Unable to create meeting."}),(0,N.jsx)("span",{className:"mt-3",children:"There was a problem creating your meeting."}),(0,N.jsx)(Ce.S,{className:"mt-2 mb-5",children:(0,N.jsx)(ve.A,{className:"btn-zoom mt-3",onClick:a,children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})})]})};var Al=(0,n.G0)(ot(vl)),yl=t(62030),wl=t(71435),Nl=t(47759),Sl=t(29912),Cl=t(31275);const Ml=["arrowProps","placement","popper","show"];var kl=e=>{var s,a,t,i;const{videoMeetingProviders:n}=(0,P.nm)(),{attemptMeetingJoin:r,loading:o,loading_state:d}=Yt(),[c,h]=(0,l.useState)(!1),u=(0,l.useRef)(),m=(0,l.useRef)(),g=(0,l.useRef)(),p=(0,l.useRef)(),x=(0,l.useRef)(),v=null!==(s=null===n||void 0===n?void 0:n.microsoft)&&void 0!==s&&s,f=null!==(a=null===n||void 0===n?void 0:n.google)&&void 0!==a&&a,j=null!==(t=null===n||void 0===n?void 0:n.slack)&&void 0!==t&&t,_=null!==(i=null===n||void 0===n?void 0:n.zoom)&&void 0!==i&&i,b=o&&["connecting","joining","leaving"].includes(d),A=async e=>{switch(e){case"voice":await r();break;case"zoom":(null===p||void 0===p?void 0:p.current)&&p.current.show();break;case"meet":(null===g||void 0===g?void 0:g.current)&&g.current.show();break;case"teams":(null===m||void 0===m?void 0:m.current)&&m.current.show();break;case"slack":window.open("https://slack.com/","_blank","noopener")}h(!1)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"new-meeting-dropdown "+(c?"show":""),ref:u,children:[(0,N.jsx)(ve.A,{"aria-label":"start new meeting",className:"d-flex justify-content-center align-items-center align-self-center toggle",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),h(!c)},ref:x,size:"lg",variant:"tertiary",children:(0,N.jsx)(ze.Cab,{})}),(0,N.jsx)(bi.A,{id:"newMeetingDropdownPopover",onHide:()=>h(!1),placement:"bottom-start",rootClose:!0,rootCloseEvent:"click",
2show:c,target:x.current,children:e=>{let{arrowProps:s,placement:a,popper:t,show:i}=e,l=(0,he.A)(e,Ml);return(0,N.jsx)(Ce.S,{className:"new-meeting-dropdown",children:(0,N.jsxs)(yl.A,(0,F.A)((0,F.A)({},l),{},{className:"p-2 bg-white border",onSelect:A,children:[(0,N.jsx)(ve.A,{as:yl.A.Item,className:"d-flex w-100 justify-content-center align-items-center voice-chat",disabled:b,eventKey:"voice",size:"lg",variant:b?"secondary":"primary",children:b?(0,N.jsxs)("span",{className:"loading-state",children:[(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}),(0,N.jsx)(ke.A,{defaultMessage:`${d}...`,id:`label.${d}`})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.i0t,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Start voice call",id:"label.start_voice_call.f47ea0ec"})]})}),(0,N.jsx)(Ce.S,{className:"or-divider"}),_&&(0,N.jsxs)(ve.A,{as:yl.A.Item,className:"text-start py-2 text-body text-decoration-none zoom",eventKey:"zoom",variant:"link",children:[(0,N.jsx)(Zs.A,{alt:"Start a Zoom meeting",className:"me-2",height:20,src:Cl,width:20}),(0,N.jsx)(ke.A,{defaultMessage:"Zoom",id:"label.zoom.509c517e"})]}),f&&(0,N.jsxs)(ve.A,{as:yl.A.Item,className:"text-start py-2 text-body text-decoration-none google",eventKey:"meet",variant:"link",children:[(0,N.jsx)(Zs.A,{alt:"Start a Google Meet meeting",className:"me-2",height:20,src:wl,width:20}),(0,N.jsx)(ke.A,{defaultMessage:"Google meet",id:"label.google_meet.94adb63a"})]}),v&&(0,N.jsxs)(ve.A,{as:yl.A.Item,className:"text-start py-2 text-body text-decoration-none teams",eventKey:"teams",variant:"link",children:[(0,N.jsx)(Zs.A,{alt:"Start a Microsoft Teams meeting",className:"me-2",height:20,src:Nl,width:20}),(0,N.jsx)(ke.A,{defaultMessage:"Teams",id:"label.teams.1e1a1c07"})]}),j&&(0,N.jsxs)(ve.A,{as:yl.A.Item,className:"text-start py-2 text-body text-decoration-none slack",eventKey:"slack",variant:"link",children:[(0,N.jsx)(Zs.A,{alt:"Start a Slack meeting (opens new window)",className:"me-2",height:20,src:Sl,width:20}),(0,N.jsx)(ke.A,{defaultMessage:"Slack",id:"label.slack.b27fb38b"})]})]}))})}})]}),(0,N.jsx)(ll,{onRef:e=>m.current=e}),(0,N.jsx)(Wi,{onRef:e=>g.current=e}),(0,N.jsx)(Al,{onRef:e=>p.current=e})]})};var zl=e=>{const{compact:s,disabled:a}=e,{userId:t}=(0,P.nm)(),{attemptMeetingJoin:i,attemptMeetingLeave:l,existing_meeting:n,joined:r,loading:o,loading_state:d,roster_preview:c}=Yt(),h=()=>{var e;return null===c||void 0===c||null===(e=c.find)||void 0===e?void 0:e.call(c,e=>(null===e||void 0===e?void 0:e.id)===t)},u=o&&["connecting","joining","leaving"].includes(d)||!r&&!n;return(0,N.jsx)(ve.A,{className:"meeting-widget-join-leave-button d-flex justify-content-center align-items-center ms-2 "+(s?"compact":""),disabled:u||a,onClick:async()=>r?await l():await i(),size:"xl",variant:r?"danger":h()?"warning":"primary",children:d?(0,N.jsx)("span",{className:"text-capitalize",children:(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"})}):(0,N.jsx)(N.Fragment,{children:r?(0,N.jsx)("span",{className:"b-600 d-flex justify-content-center align-items-center gap-1",children:s?(0,N.jsx)(ke.A,{defaultMessage:"Leave",id:"label.leave.fc6e4a40"}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.QCr,{}),(0,N.jsx)(ke.A,{defaultMessage:"Leave call",id:"label.leave_call.06eb7d6c"})]})}):(0,N.jsx)(N.Fragment,{children:h()?(0,N.jsx)("span",{className:"d-flex justify-content-center align-items-center gap-1",children:s?(0,N.jsx)(ke.A,{defaultMessage:"Rejoin",id:"label.rejoin.fb5cdea2"}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.i0t,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rejoin call",id:"label.rejoin_call.fb96dba6"})]})}):(0,N.jsx)("span",{className:"d-flex justify-content-center align-items-center gap-1",children:s?(0,N.jsx)(ke.A,{defaultMessage:"Join",id:"label.join.fd30fe68"}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.i0t,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Join call",id:"label.join_call.f0675c04"})]})})})})})};const Tl=["children","ellipsis","lines"];class Il extends l.Component{constructor(){super(...arguments),this.state={},this.styles={ellipsis:{left:0,position:"fixed",top:0,visibility:"hidden"}},this.elements={},this.state={overview_expanded:!1},this.onResize=this.onResize.bind(this),this.onTruncate=this.onTruncate.bind(this),this.calcTargetWidth=this.calcTargetWidth.bind(this),this.measureWidth=this.measureWidth.bind(this),this.getLines=this.getLines.bind(this),this.renderLine=this.renderLine.bind(this),this.toggleLinesDefault=this.toggleLinesDefault.bind(this),this.onTruncateDefault=this.onTruncateDefault.bind(this)}componentDidMount(){const{calcTargetWidth:e,elements:{text:s},onResize:a}=this,t=document.createElement("canvas");this.canvasContext=t.getContext("2d"),e(()=>{s&&s.parentNode.removeChild(s)}),window.addEventListener("resize",a)}componentDidUpdate(e){this.props.children!==e.children&&this.forceUpdate(),this.props.width!==e.width&&this.calcTargetWidth()}componentWillUnmount(){const{elements:{ellipsis:e},onResize:s,timeout:a}=this,t=(0,N.jsxs)("span",{children:["... ",(0,N.jsx)(ve.A,{onClick:this.toggleLinesDefault,variant:"link",children:"read more"})]});e?e.parentNode.removeChild(e):t.parentNode.removeChild(t),window.removeEventListener("resize",s),window.cancelAnimationFrame(a)}innerText(e){const s=document.createElement("div"),a="innerText"in window.HTMLElement.prototype?"innerText":"textContent";s.innerHTML=e.innerHTML.replace(/\r\n|\r|\n/g," ");let t=s[a];const i=document.createElement("div");return i.innerHTML="foo<br/>bar","foo\nbar"!==i[a].replace(/\r\n|\r/g,"\n")&&(s.innerHTML=s.innerHTML.replace(/<br.*?[/]?>/gi,"\n"),t=s[a]),t}onResize(){this.calcTargetWidth()}onTruncate(e){const{onTruncate:s}=this.props;this.timeout="function"===typeof s?window.requestAnimationFrame(()=>{s(e)}):window.requestAnimationFrame(()=>{this.onTruncateDefault(e)})}calcTargetWidth(e){const{calcTargetWidth:s,canvasContext:a,elements:{target:t},props:{width:i}}=this;if(!t)return;const l=i||Math.floor(t.parentNode.getBoundingClientRect().width);if(!l)return window.requestAnimationFrame(()=>s(e));const n=window.getComputedStyle(t),r=[n["font-weight"],n["font-style"],n["font-size"],n["font-family"]].join(" ");a.font=r,this.setState({targetWidth:l},e)}measureWidth(e){return this.canvasContext.measureText(e).width}ellipsisWidth(e){return e.offsetWidth}trimRight(e){return e.replace(/\s+$/,"")}getLines(){const{elements:e,innerText:s,measureWidth:a,onTruncate:t,props:{ellipsis:i,lines:l,trimWhitespace:n},state:{targetWidth:r},trimRight:o}=this,d=(0,N.jsxs)("span",{children:["... ",(0,N.jsx)(ve.A,{"aria-label":"read more",onClick:this.toggleLinesDefault,variant:"link",children:this.props.ellipsisText})]}),c=[],h=s(e.text).split("\n").map(e=>e.split(" "));let u=!0;const m=this.ellipsisWidth(this.elements.ellipsis);for(let g=1;g<=l;g++){const e=h[0];if(0===e.length){c.push(),h.shift(),g--;continue}let s=e.join(" ");if(a(s)<=r&&1===h.length){u=!1,c.push(s);break}if(g===l){const t=e.join(" ");let l=0,h=t.length-1;for(;l<=h;){const e=Math.floor((l+h)/2);a(t.slice(0,e+1))+m<=r?l=e+1:h=e-1}let u=t.slice(0,l);if(n)for(u=o(u);!u.length&&c.length;){u=o(c.pop())}s=(0,N.jsxs)("span",{children:[u,i||d]})}else{let t=0,i=e.length-1;for(;t<=i;){const s=Math.floor((t+i)/2);a(e.slice(0,s+1).join(" "))<=r?t=s+1:i=s-1}if(0===t){g=l-1;continue}s=e.slice(0,t).join(" "),h[0].splice(0,t)}c.push(s)}return this.timeout="function"===typeof t?window.requestAnimationFrame(()=>{t(u)}):window.requestAnimationFrame(()=>{this.onTruncateDefault(u)}),c}renderLine(e,s,a){if(s===a.length-1)return(0,N.jsx)("span",{children:e},s);{const a=(0,N.jsx)("br",{},s+"br");return e?[(0,N.jsx)("span",{children:e},s),a]:a}}onTruncateDefault(e){this.state.overview_truncated===e&&this.setState({overview_truncated:e})}toggleLinesDefault(e){e.preventDefault(),this.setState(e=>({overview_expanded:!e.overview_expanded}))}render(){const{elements:{target:e},getLines:s,onTruncate:a,props:{children:t,ellipsis:i,lines:l},renderLine:n,state:{targetWidth:r}}=this,o=(0,he.A)(this.props,Tl);let d;"undefined"!==typeof window&&!(!e||!r)&&(l>0&&!this.state.overview_expanded?d=s().map((e,s,a)=>n(e,s,a)):(d=t,a(!1)));const c=(0,N.jsxs)("span",{children:["...",(0,N.jsx)(ve.A,{onClick:this.toggleLinesDefault,variant:"link",children:"read more"})]});return delete o.onTruncate,delete o.trimWhitespace,(0,N.jsxs)("span",(0,F.A)((0,F.A)({},o),{},{ref:e=>{this.elements.target=e},children:[(0,N.jsx)("span",{children:d}),(0,N.jsx)("span",{ref:e=>{this.elements.text=e},children:t}),(0,N.jsx)("span",{ref:e=>{this.elements.ellipsis=e},style:this.styles.ellipsis,children:i||c}),!this.state.overview_truncated&&this.state.overview_expanded&&(0,N.jsx)("span",{children:(0,N.jsx)(ve.A,{onClick:this.toggleLinesDefault,variant:"link",children:"read less"})})]}))}}Il.defaultProps={children:"",ellipsis:"",ellipsisText:"read more",lines:1,trimWhitespace:!1,width:0};var El=Il;const Fl=e=>{const s=(0,l.useRef)(),[a,t]=(0,ne.CQ)(!1),{as:i,children:n,className:r,inline:o,maxWidth:d,placement:c,tooltipId:h,trigger:u}=e;(0,l.useLayoutEffect)(()=>{(e=>e.offsetWidth<e.scrollWidth)(null===s||void 0===s?void 0:s.current)&&t(!0)},[]);
2const m=(0,F.A)({display:o?"inline-block":"block",maxWidth:d,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"noWrap"},e.styles);return(0,N.jsx)(Ua.A,{delay:{hide:100,show:100},overlay:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({id:h},e),{},{children:n})),placement:c,show:!!a&&void 0,trigger:u,children:(0,N.jsx)(i,{className:r,ref:s,style:m,children:n})})};Fl.defaultProps={as:"span",inline:!1,maxWidth:80,placement:"right",tooltipId:"truncateTextTooltip",trigger:["hover","focus"]};const Rl=e=>{const{lg:s=0,maxWidth:a="none",md:t=0,sm:i=0,style:n={},tabIndex:r=0,triggerPosition:o="left",xl:d=0,xs:c=0,xxl:h=0}=e,u=(0,l.useRef)(null),[m,g]=(0,l.useState)(!1),[p,x]=(0,l.useState)(!0),{width:v}=(0,ne.vh)(),f=(0,l.useMemo)(()=>{const s=[];return["xs","sm","md","lg","xl","xxl"].forEach(a=>{var t;const i=null!==(t=null===e||void 0===e?void 0:e.lines)&&void 0!==t&&t;!i&&e[a]?s.push(`clamp-${a}-${e[a]?e[a]:0}`):i&&s.push(`clamp-${a}-${i}`)}),s},[p,c,i,t,s,d,h]),j=(0,l.useMemo)(()=>{const e=["d-flex"];return["left","center","right"].includes(o)&&("left"==o?e.push("justify-content-left"):"center"==o?e.push("justify-content-center"):e.push("justify-content-end")),e},[o]);(0,l.useEffect)(()=>{if(u.current){const e=(e=>e.scrollHeight>e.clientHeight)(u.current);e!==m&&g(e)}},[v]);return(0,N.jsxs)("div",{children:[(0,N.jsx)("div",{className:oa()(f,e.className,"truncate-container",!p&&"disable-clamp"),ref:u,style:(0,F.A)((0,F.A)({},n),{},{maxWidth:a}),children:(0,N.jsx)("div",{className:"truncate-text",style:{maxWidth:a},children:e.children})}),(0,N.jsx)("div",{className:oa()(j,"truncate-trigger-wrapper"),children:(0,N.jsx)(ve.A,{className:oa()("truncate-trigger","px-0",!m&&"d-none"),onClick:()=>{x(!p)},style:{textAlign:o},tabIndex:r,variant:"link",children:p?"More":"Less"})})]})};var Dl=e=>{const{attendee_id:s,user:a}=e,{userId:t}=(0,P.nm)(),{id:i,fullname:l}=a||{},{muted:n}=(0,$t.Y$K)(s),{joined:r}=Yt();return(0,N.jsx)(N.Fragment,{children:a?(0,N.jsxs)(Ce.S,{className:"popover-roster-list-item d-flex align-items-center py-2 "+(r||i!==t?"":"inactive"),children:[(0,N.jsx)(wi,{showOnline:!1,size:24,theme:"dark",user:{attendee_id:s,user:a}}),(0,N.jsx)(Ce.S,{className:"user-details align-items-baseline ms-2",children:(0,N.jsx)(Fl,{className:"first-last h6 mb-0 me-1",maxWidth:"60%",placement:"bottom",tooltipId:"meetingFirstLastTooltip",children:`${l}`})}),s&&n&&(0,N.jsx)(Ce.S,{className:"muted-icon d-flex justify-content-end",children:(0,N.jsx)(Zs.A,{height:24,src:Mi,width:24})})]}):(0,N.jsx)(N.Fragment,{})})};var Bl=e=>{const{joined:s,roster_preview:a}=Yt(),{roster:t}=(0,$t.Abl)(),[i,n]=(0,l.useState)(a);return(0,l.useEffect)(()=>{if(s){const e=Object.values(t);n(null!==e&&void 0!==e&&e.length?e.map(e=>(e=>{const{chimeAttendeeId:s,externalUserId:t}=e;return{attendee_id:s,user:a.find(e=>(null===e||void 0===e?void 0:e.id)===Number.parseInt(t))}})(e)||null):[])}else n(a)},[t,a]),(0,N.jsx)(Ce.S,{className:"popover-roster-list d-flex flex-column",children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:s?(0,N.jsx)(N.Fragment,{children:i.map((e,s)=>{let{attendee_id:a,user:t}=e;return(0,N.jsx)(Dl,{attendee_id:a,user:t},s)})}):(0,N.jsx)(N.Fragment,{children:i.map((e,s)=>(0,N.jsx)(Dl,{user:e},s))})}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",children:(0,N.jsx)("p",{className:"small text-muted text-center m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No attendees found",id:"label.no_attendees_found.0e091481"})})})})},Pl=t(80270);class Ll extends l.Component{constructor(s){var a;super(s),a=this,this.getContextState=()=>{const{parent_context_name:e}=this.props;return"assignment"===e?{team_meeting_member:null}:{}},this.setLoading=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;a.setState({loading:e,loading_state:s})},this.setPollingRoster=e=>this.setState({polling_roster:e}),this.setError=e=>this.setState({error:e}),this.setJoined=e=>this.setState({joined:e}),this.setMeeting=e=>this.setState({meeting:e}),this.setRosterPreview=e=>this.setState({roster_preview:e}),this.setExistingMeeting=e=>this.setState({existing_meeting:e}),this.setVoiceFocusSupported=e=>this.setState({voice_focus_supported:e}),this.setVoiceFocusEnabled=e=>this.setState({voice_focus_enabled:e}),this.toggleVoiceFocusEnabled=()=>{const{user_device:e}=this.state;e.compatible&&this.setState(e=>({voice_focus_enabled:!e.voice_focus_enabled}))},this.resetMeetingState=()=>this.setState((0,F.A)({chime_attendee:null,chime_meeting:null,connected:!1,existing_meeting:!1,joined:!1,loading:!1,loading_state:null,meeting:null,roster_preview:[]},this.getContextState())),this.attemptMeetingJoin=async()=>{var s,a;const{app:t,parent_context:i,parent_context_name:l,setCreateMeetingResponse:n}=this.props;if(!i||!l)return;let r=null;const o={};if("assignment"===l)r="/api/meetings/team/join",o.team_id=null===i||void 0===i||null===(s=i.team)||void 0===s?void 0:s.id,o.team_member_id=null===i||void 0===i||null===(a=i.team_member)||void 0===a?void 0:a.id,o.is_facilitator=null!==i&&void 0!==i&&i.is_facilitator?1:0;const{joined:d,loading:c,user_device:h}=this.state;if(c||d)return;this.setLoading(!0,"connecting");const u=!!Number.parseInt(t.getCookie("disableBrowserIncompatibilityWarning"));if(!h.compatible&&!u){if(!await this.showIncompatibilityModal())return this.setLoading(!1)}try{var m,g;const e=await t.api.post(r,o).catch(e=>{throw(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e});if(!this.mounted||!e)return;const s=(null===e||void 0===e||null===(m=e.meeting)||void 0===m?void 0:m.Meeting)||(null===e||void 0===e?void 0:e.meeting),a=(null===e||void 0===e||null===(g=e.attendee)||void 0===g?void 0:g.Attendee)||(null===e||void 0===e?void 0:e.attendee),i={chime_attendee:a,chime_meeting:s,
2connected:!0,meeting:null===e||void 0===e?void 0:e.solvably_meeting};if("challenge"===l)i.team_meeting_member=null===e||void 0===e?void 0:e.team_meeting_member;const d={Attendee:a,Meeting:s};this.setState(i,()=>n(d)),this.stopPollingRoster(),this.beginAttendeeHeartbeat()}catch(e){return this.setError(e),this.setLoading(!1,null),(0,xa.Err)(e)}},this.attemptMeetingLeave=async s=>{var a;const{app:t,parent_context:i,parent_context_name:l}=this.props,{chime_attendee:n,joined:r,loading:o,meeting:d}=this.state;if(!i||!l||o||!r)return;let c=null;const h={attendee_id:null===n||void 0===n?void 0:n.AttendeeId,meeting:null===d||void 0===d?void 0:d.id};if("assignment"===l)c="/api/meetings/team/leave",h.team_id=null===i||void 0===i||null===(a=i.team)||void 0===a?void 0:a.id,h.is_facilitator=null!==i&&void 0!==i&&i.is_facilitator?1:0;this.setLoading(!0,"leaving");try{const e=await t.api.post(c,h).catch(e=>{throw(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e});if(!this.mounted||!e)return;const{meeting:a,roster:i}=e,{existing_meeting:l,roster_preview:n}=this.state;this.stopAttendeeHeartbeat(),this.resetMeetingState(),i!==n&&this.setRosterPreview(i),a!==l&&this.setExistingMeeting(!!a),"function"===typeof s&&s(),this.beginPollingRoster()}catch(e){if((0,xa.Err)(e),!this.mounted)return;this.setError(e),this.setLoading(!1,null)}},this.sendAttendeeHeartbeat=async()=>{var s,a;const{app:t,parent_context:i,parent_context_name:l}=this.props;if(!i||!l)return;let n=null;const r={};if("assignment"===l)n="/api/meetings/team/attendee-heartbeat",r.team_id=null===i||void 0===i||null===(s=i.team)||void 0===s?void 0:s.id,r.team_member_id=null===i||void 0===i||null===(a=i.team_member)||void 0===a?void 0:a.id,r.is_facilitator=null!==i&&void 0!==i&&i.is_facilitator?1:0;try{await t.api.post(n,r).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;throw{data:null===e||void 0===e?void 0:e.data,err:s}})}catch(e){var o;if((0,xa.Err)(null===e||void 0===e?void 0:e.err),!this.mounted)return;["NO_MEETING","NO_TEAM_MEETING","NO_TEAM_MEETING_MEMBER"].includes(null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.code)&&(this.stopAttendeeHeartbeat(),this.resetMeetingState(),this.beginPollingRoster())}},this.beginAttendeeHeartbeat=()=>{const e=setInterval(async()=>await this.sendAttendeeHeartbeat(),this.HEARTBEAT_INTERVAL);this.setState({attendee_heartbeat_timer:e})},this.stopAttendeeHeartbeat=()=>{const{attendee_heartbeat_timer:e}=this.state;clearInterval(e),this.setState({attendee_heartbeat_timer:null})},this.attemptLoadRosterPreview=async()=>{var s,a;if(!this.mounted)return;const{app:t,parent_context:i,parent_context_name:l}=this.props;if(!i||!l)return;let n=null;const r={};if("assignment"===l){n="/api/meetings/team/roster",r.team_id=null===i||void 0===i||null===(s=i.team)||void 0===s?void 0:s.id,r.team_member_id=null===i||void 0===i||null===(a=i.team_member)||void 0===a?void 0:a.id,r.is_facilitator=null!==i&&void 0!==i&&i.is_facilitator?1:0,r.skip_auth_refresh=1;try{this.setPollingRoster(!0);const e=await t.api.get(n,r).then(e=>(this.setPollingRoster(!1),e)).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;throw this.setPollingRoster(!1),s});if(!this.mounted||!e)return;const{meeting:s,roster:a}=e,{existing_meeting:i,roster_preview:l}=this.state;a!==l&&this.setRosterPreview(a),s!==i&&this.setExistingMeeting(!!s)}catch(e){if((0,xa.Err)(e),!this.mounted)return;this.setError(e)}}},this.beginPollingRoster=()=>{this.roster_poll_timer=setInterval(this.attemptLoadRosterPreview,this.ROSTER_POLL_INTERVAL)},this.stopPollingRoster=()=>{clearInterval(this.roster_poll_timer),this.roster_poll_timer=null},this.detectBrowserCompatibility=()=>{var e,s;const a=navigator.userAgent.toLowerCase(),t=navigator.platform.toLowerCase(),i={android:["android"],ios:["iphone","ipad","ipod"],linux:["linux"],mac:["mac"],windows:["win"]};let l={browser:"other",compatible:!1,os:"other"};switch(!0){case a.indexOf("edge")>-1:l.browser="edge (non-chromium";break;case a.indexOf("edg/")>-1:l.browser="edge (chromium)";break;case a.indexOf("opr")>-1&&!(null===(e=window)||void 0===e||!e.opr):l.browser="opera";break;case a.indexOf("chrome")>-1&&!(null===(s=window)||void 0===s||!s.chrome):l.browser="chrome";break;case a.indexOf("trident")>-1:l.browser="ie";break;case a.indexOf("firefox")>-1:l.browser="firefox";break;case a.indexOf("safari")>-1:l.browser="safari"}for(const[r,o]of Object.entries(i))for(const e of o)-1!==t.indexOf(e)&&(l.os=r);const{browser:n}=l;return l.compatible=(()=>!this.INCOMPATIBLE_BROWSERS.includes(n))(),l},this.showIncompatibilityModal=async()=>{var e;const s=null===this||void 0===this||null===(e=this.incompatibility_modal)||void 0===e?void 0:e.current;if(s)return await s.showModal()},this.mounted=!1,this.INCOMPATIBLE_BROWSERS=["firefox","safari"];const t=this.detectBrowserCompatibility();this.state=(0,F.A)({attendee_heartbeat_timer:null,chime_attendee:null,chime_meeting:null,connected:!1,error:null,existing_meeting:!1,initial_roster_poll:!1,joined:!1,loading:!1,loading_state:null,meeting:null,parent_context_name:s.parent_context_name||null,polling_roster:!1,roster_preview:[],user_device:t,voice_focus_enabled:!1,voice_focus_supported:null},this.getContextState()),this.roster_poll_timer=null,this.ROSTER_POLL_INTERVAL=5e3,this.HEARTBEAT_INTERVAL=5e3,this.SPEAKING_VOLUME_THRESHOLD=.1,this.incompatibility_modal=(0,l.createRef)()}componentDidMount(){this.mounted=!0,this.detectBrowserCompatibility(),this.attemptLoadRosterPreview(),this.beginPollingRoster()}componentWillUnmount(){this.mounted=!1,this.stopPollingRoster(),this.stopAttendeeHeartbeat(),this.attemptMeetingLeave()}render(){const{children:e,parent_context:s,parent_context_name:a}=this.props,{active_speakers:t,chime_attendee:i,chime_meeting:l,connected:n,error:r,existing_meeting:o,joined:d,loading:c,loading_state:h,meeting:u,roster_preview:m,team_meeting_member:g,user_device:p,voice_focus_enabled:x,voice_focus_supported:v}=this.state;let f="";if("assignment"===a)f="/assignment";return(0,N.jsx)(Pl.NP,{theme:$t.a5x,children:(0,N.jsxs)(Kt,{value:{active_speakers:t,attemptLoadRosterPreview:this.attemptLoadRosterPreview,attemptMeetingJoin:this.attemptMeetingJoin,attemptMeetingLeave:this.attemptMeetingLeave,beginRosterPolling:this.beginPollingRoster,chime_attendee:i,chime_meeting:l,connected:n,error:r,existing_meeting:o,joined:d,loading:c,loading_state:h,meeting:u,parent_context:s,parent_context_name:a,resetMeetingState:this.resetMeetingState,roster_preview:m,setError:this.setError,setJoined:this.setJoined,setLoading:this.setLoading,setMeeting:this.setMeeting,setVoiceFocusEnabled:this.setVoiceFocusEnabled,setVoiceFocusSupported:this.setVoiceFocusSupported,speaking_volume_threshold:this.SPEAKING_VOLUME_THRESHOLD,stopAttendeeHeartbeat:this.stopAttendeeHeartbeat,team_meeting_member:g,toggleVoiceFocusEnabled:this.toggleVoiceFocusEnabled,user_device:p,voice_focus_enabled:x,voice_focus_supported:v}
2,children:[e,(0,N.jsx)(Wl,{}),f&&(0,N.jsx)(Pe.XG,{when:d,message:(e,s)=>!!e.pathname.startsWith(f)||"You are currently in an active voice call. If you proceed, you will be removed from the call.\n\nAre you sure you want to leave?"}),(0,N.jsx)(sn,{ref:this.incompatibility_modal})]})})}}var Ol=(0,P.G0)((e=>class extends e{constructor(e){super(e),this.componentDidMount=()=>{const{onRef:e}=this.props;"function"==typeof e&&e(this.getChildComponent())},this.getChildComponent=()=>this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp,this.comp=null}componentWillUnmount(){const{onRef:e}=this.props;"function"==typeof e&&e(void 0)}render(){return(0,N.jsx)(Ut,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{chime_meeting:s,ref:e=>this.comp=e}))})}})(Ll));var Hl=e=>{const{children:s,context:a,context_type:t}=e,[i,n]=(0,l.useState)(null);return(0,N.jsx)(Ce.S,{className:"solvably-meeting-wrapper",children:(0,N.jsx)($t.Fjh,{children:(0,N.jsx)(ei,{children:(0,N.jsx)(Jl,{createMeetingResponse:i,children:(0,N.jsx)(Ol,{parent_context:a,parent_context_name:t,setCreateMeetingResponse:n,children:s})})})})})};const Ul=(0,l.forwardRef)((e,s)=>{const{attemptMeetingLeave:a,resetMeetingState:t}=Yt(),[i,n]=(0,l.useState)(!1),r=()=>n(!0),o=()=>n(!1),d=async()=>{const{onHide:s}=e;"function"===typeof s&&s(),await a(),t(),o()};(0,l.useImperativeHandle)(s,()=>({hideModal:o,showModal:r}));return(0,N.jsxs)(xe,{backdrop:"static",onHide:d,show:i,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Allow microphone",id:"label.allow_microphone.2f6aca9a"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"To speak in a Solvably Voice call, go to your browser settings and allow access to the microphone",id:"label.to_speak_in_a_solvably_voice_call.abb2315e"})})}),(0,N.jsx)(xe.Footer,{className:"justify-content-start",children:(0,N.jsxs)(ve.A,{onClick:()=>{d(),setTimeout(()=>window.location.reload(),500)},variant:"secondary",children:[(0,N.jsx)(ze.OKX,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Refresh page",id:"label.refresh_page.b873c33c"})]})})]})});Ul.displayName="DevicePermissionModal";var Ql=Ul;var Vl=e=>{const{toggleVoiceFocusEnabled:s,voice_focus_enabled:a}=Yt(),t=e=>{const s=(0,l.useRef)(),[a,t]=(0,l.useState)(!1);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"reduce-noise-info-button p-0",onBlur:()=>t(!1),onFocus:()=>t(!0),onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1),ref:e=>s.current=e,variant:"link",children:(0,N.jsx)(ze.gZZ,{color:"var(--gray-500)"})}),(0,N.jsx)(bi.A,{placement:"right",show:a,target:s.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({className:"reduce-noise-tooltip",id:"reduceNoiseTooltip"},e),{},{children:(0,N.jsx)(ke.A,{defaultMessage:"Reduces background noise to make your voice clearer",id:"label.reduces_background_noise_to_make_y.011b7cc3"})}))})]})};return(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(_e.A.Label,{className:"mb-0 me-1",htmlFor:"voiceFocusEnableToggle",children:(0,N.jsx)(ke.A,{defaultMessage:"Reduce noise",id:"label.reduce_noise.47200f53"})}),(0,N.jsx)(t,{})]}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",children:(0,N.jsx)(_e.A.Switch,{checked:a,className:"d-flex",id:"voiceFocusEnabledToggle",onChange:s})})]})},Gl=t(27490);var Wl=s=>{const a=(0,l.useRef)(),t=(0,l.useRef)([]),{api:i,getCookie:n}=(0,P.nm)(),r=(0,$t.GTR)(),o=(0,$t.VjK)(),{addVoiceFocus:d,isVoiceFocusSupported:c}=(0,$t.IMw)(),{roster:h}=(0,$t.Abl)(),{meeting_manager:u}=Qt(),{audioInputDevices:m,audioOutputDevices:g,audioVideo:p,selectedAudioInputDevice:x,startAudioInputDevice:v,startAudioOutputDevice:f,subscribeToSelectedAudioInputDevice:j,unsubscribeFromSelectedAudioInputDevice:_}=u||{},{attemptLoadRosterPreview:b,beginRosterPolling:A,chime_attendee:y,chime_meeting:w,connected:S,joined:C,resetMeetingState:M,roster_preview:k,setJoined:z,setLoading:I,setMeeting:E,setVoiceFocusEnabled:F,setVoiceFocusSupported:R,stopAttendeeHeartbeat:D,user_device:B,voice_focus_enabled:L,voice_focus_supported:O}=Yt(),[H,U]=(0,l.useState)(x);return(0,l.useEffect)(()=>
2{if(!S)return;j(U);return(async()=>{try{const e=new Gl.MeetingSessionConfiguration(w,y),s={deviceLabels:$t.iin.Audio,enableWebAudio:!0};I(!0,"joining"),await u.join(e,s),await u.start(),z(!0),I(!1,null)}catch(e){(0,xa.Err)(e),I(!1,null),E(null),z(!1)}})(),()=>{_(U),u.leave()}},[S]),(0,l.useEffect)(()=>{p&&(p.realtimeMuteLocalAudio(),p.deviceController.useWebAudio=!0)},[p]),(0,l.useEffect)(()=>{"DENIED"===r&&(null===a||void 0===a?void 0:a.current)&&a.current.showModal()},[r]),(0,l.useEffect)(()=>{switch(o){case $t.e0s.JoinedFromAnotherDevice:(0,xa.Info)("resetting instance because attendee joined from another device..."),M(),D(),b(),A();break;case $t.e0s.Succeeded:(async()=>{var s,a;if(!B.compatible)return;const t=n("preferredInputDevice")||"default",i=n("preferredOutputDevice")||"default",l=null===m||void 0===m||null===(s=m.find)||void 0===s?void 0:s.call(m,e=>e.deviceId===t),r=null===g||void 0===g||null===(a=g.find)||void 0===a?void 0:a.call(g,e=>e.deviceId===i);try{let e=l?t:"default",s=r?i:"default";(0,xa.Info)("input_exists",l),(0,xa.Info)("using IO defaults..."),console.log("input:",e),console.log("output:",s),e instanceof Gl.VoiceFocusTransformDevice||!O||(e=await d(t)),await v(e),await f(s)}catch(e){(0,xa.Err)(e)}})()}},[o]),(0,l.useEffect)(()=>{H instanceof Gl.VoiceFocusTransformDevice?F(!0):F(!1)},[H]),(0,l.useEffect)(()=>{c&&B.compatible&&async function(){let e=H;L?"string"===typeof H&&(await p.realtimeMuteLocalAudio(),e=await d(H),await p.realtimeUnmuteLocalAudio()):H instanceof Gl.VoiceFocusTransformDevice&&(e=H.getInnerDevice()),await v(e)}()},[L,c,p]),(0,l.useEffect)(()=>{void 0!==c&&R(c)},[c]),(0,l.useEffect)(()=>{if(!C)return;let e=Object.values(h).map(e=>Number.parseInt(null===e||void 0===e?void 0:e.externalUserId)).sort((e,s)=>e-s);if(e=e.filter(e=>!isNaN(e)).sort((e,s)=>e-s),(0,T.isEmpty)(e))return;const s=k.map(e=>e.id).sort();(0,T.isEqual)(s,e)||b()},[h,k,C]),(0,l.useEffect)(()=>{const s=null===p||void 0===p?void 0:p.transcriptionController,a=null===y||void 0===y?void 0:y.AttendeeId,l=null===w||void 0===w?void 0:w.MeetingId;if(!s||!C||!a||!l)return;const n=async()=>{if(!t.current.length)return;const s=t.current;t.current=[];try{await i.post("/api/meetings/transcripts/create",{chime_meeting_id:l,segments:s})}catch(e){t.current=[...s,...t.current],(0,xa.Err)(e)}},r=e=>{if(e instanceof Gl.Transcript)for(const o of e.results||[]){var s,i,l,n,r;if(o.isPartial)continue;const e=null===(s=o.alternatives)||void 0===s?void 0:s[0],d=null===e||void 0===e||null===(i=e.transcript)||void 0===i?void 0:i.trim();if(!d)continue;const c=null===(l=e.items)||void 0===l?void 0:l.find(e=>{var s;return null===e||void 0===e||null===(s=e.attendee)||void 0===s?void 0:s.attendeeId});(null===c||void 0===c||null===(n=c.attendee)||void 0===n?void 0:n.attendeeId)===a&&t.current.push({end_time:new Date(null!==(r=o.endTimeMs)&&void 0!==r?r:o.startTimeMs).toISOString(),start_time:new Date(o.startTimeMs).toISOString(),transcript:d})}};s.subscribeToTranscriptEvent(r);const o=setInterval(n,4e3);return()=>{s.unsubscribeFromTranscriptEvent(r),clearInterval(o),n()}},[p,C,y,w]),(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ql,{ref:a})})};var Kl=(0,Ke.Ay)(e=>{const s=(0,ja.A)(),{type:a}=e,{setCookie:t}=(0,P.nm)(),{user_device:i,voice_focus_enabled:l,voice_focus_supported:n}=Yt(),{addVoiceFocus:r}=(0,$t.IMw)(),o=(0,$t.n3W)(),{muted:d}=(0,$t.abu)(),{meeting_manager:c}=Qt(),{audioInputDevices:h,audioOutputDevices:u,selectedAudioInputDevice:m,selectedAudioOutputDevice:g,startAudioInputDevice:p,startAudioOutputDevice:x}=c||{};let v=[],f=null;switch(a){case"input":v=h,f=(null===m||void 0===m?void 0:m.device)||(null===m||void 0===m?void 0:m.deviceId)||m;break;case"output":v=u,f=(null===g||void 0===g?void 0:g.device)||(null===g||void 0===g?void 0:g.deviceId)||g}const j=!(null!==u&&void 0!==u&&u.length)||!(null!==h&&void 0!==h&&h.length)||!i.compatible,_=async e=>{var s;try{var c;if(!i.compatible)return;const h=(null===e||void 0===e||null===(c=e.target)||void 0===c?void 0:c.value)||"default";switch(a){case"input":const a=(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)||"default",i=!d;if(n&&l){const e=await r(a);i&&await o.realtimeMuteLocalAudio(),await p(e),i&&o.realtimeUnmuteLocalAudio()}else await p(a);(0,xa.Info)("setting input device preference:",a),t("preferredInputDevice",a);break;case"output":(0,xa.Info)("setting output device preference:",h),t("preferredOutputDevice",h),await x(h)}}catch(e){(0,xa.Err)(e)}};return(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"outputDeviceSelector",children:(()=>{switch(a){case"input":return(0,N.jsx)(ke.A,{defaultMessage:"Select microphone",id:"label.select_microphone.bf4edf25"});case"output":return(0,N.jsx)(ke.A,{defaultMessage:"Select speaker",id:"label.select_speaker.57481b9e"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(()=>{var e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(_e.A.Select,{defaultValue:f,disabled:j,id:"outputDeviceSelector",onChange:_,children:null!==(e=v)&&void 0!==e&&e.length?(0,N.jsx)(N.Fragment,{children:v.map((e,s)=>(0,N.jsx)("option",{value:null===e||void 0===e?void 0:e.deviceId,children:null===e||void 0===e?void 0:e.label},s))}):(0,N.jsx)("option",{children:s.formatMessage({id:"label.no_devices_detected.0c8cb2ee",defaultMessage:"no devices detected"})})})})})()]})});const Yl=e=>{const{children:s,createMeetingResponse:a}=e;
2return(0,N.jsx)($t.GZo,{createMeetingResponse:a,spec:{name:"ns_es"},children:s})},ql=(e,s)=>(0,T.isEqual)(e.createMeetingResponse,s.createMeetingResponse)&&(0,T.isEqual)(e.children,s.children);var Jl=(0,l.memo)(Yl,ql),Xl=t(40552),Zl=t(54579);var $l={0:(0,Ke.Ay)(e=>{const{getCookie:s,setCookie:a}=(0,P.nm)(),t=(0,ja.A)(),{setCurrentStep:i}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Incompatible browser",id:"label.incompatible_browser.21c517a6"})})}),(0,N.jsxs)(xe.Body,{className:"step-0",children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"The current browser may not be fully compatible with all Solvably Voice features.",id:"label.the_current_browser_may_not_be_ful.4f9fc9e9"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"We recommend using one of the following browsers to access all available features:",id:"label.we_recommend_using_one_of_the_foll.3f422888"})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column pb-3",children:[(0,N.jsxs)(ve.A,{className:"w-100 browser-choice",href:"https://www.google.com/chrome/",rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(Zs.A,{alt:"Google Chrome logo",className:"me-3",height:32,src:qs,width:32}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Google chrome",id:"label.google_chrome.3ced0ad6"})})]}),(0,N.jsxs)(ve.A,{className:"w-100  browser-choice",href:"https://www.microsoft.com/en-us/edge",rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(Zs.A,{alt:"Microsoft Edge logo",className:"me-3",height:32,src:Js,width:32}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Microsoft edge",id:"label.microsoft_edge.f1a5921e"})})]})]}),(0,N.jsx)("hr",{className:"m-0"})]}),(0,N.jsxs)(xe.Footer,{className:"d-flex flex-column justify-content-start",children:[(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center",children:(0,N.jsx)(ve.A,{className:"align-self-center mb-3",onClick:()=>i(1),size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Continue in current browser",id:"label.continue_in_current_browser.30353434"})})}),(0,N.jsx)(Xl.A,{className:"w-100",children:(0,N.jsx)(Zl.A,{defaultChecked:!!Number.parseInt(s("disableBrowserIncompatibilityWarning")),onChange:()=>{const e=!!Number.parseInt(s("disableBrowserIncompatibilityWarning"));a("disableBrowserIncompatibilityWarning",e?0:1)},label:t.formatMessage({id:"label.do_not_show_this_again.d7c2e397",defaultMessage:"Do not show this again"})})})]})]})}),1:(0,Ke.Ay)(e=>{const{onConfirmJoin:s,setCurrentStep:a}=e,{user_device:t}=Yt(),i={mac:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Open the <strong>System Preferences</strong> app",id:"label.open_the_system_preferences_app.07e2d7ea",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click on the <strong>Sound</strong> icon",id:"label.click_on_the_sound_icon.3a3101c7",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"From the <strong>Input</strong> tab, select your desired input device",id:"label.from_the_input_tab_select_your_des.ef1e2ec0",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"From the <strong>Output</strong> tab, select your desired output device",id:"label.from_the_output_tab_select_your_de.3c36f6bc",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})],windows:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Open the <strong>Control Panel</strong> app",id:"label.open_the_control_panel_app.c32f38cb",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click on the <strong>Hardware</strong> option",id:"label.click_on_the_hardware_option.76d63611",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click on the <strong>Sound</strong> option",id:"label.click_on_the_sound_option.2cced8f6",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"From the <strong>Recording</strong> tab, select your desired input device and click <strong>Set Default</strong>",id:"label.from_the_recording_tab_select_your.154286ab",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"From the <strong>Playback</strong> tab, select your desired output device and click <strong>Set Default</strong>",id:"label.from_the_playback_tab_select_your.a7e35f50",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]},l=(null===i||void 0===i?void 0:i[null===t||void 0===t?void 0:t.os])||[];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select audio devices",id:"label.select_audio_devices.b71cdc79"})})}),(0,N.jsxs)(xe.Body,{className:"step-1",children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Follow the instructions below to select the desired audio devices in your operating system.",id:"label.follow_the_instructions_below_to_s.2ecb262b"})}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column bg-light instructions rounded p-3",children:l.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"d-flex instruction align-items-baseline mb-3",children:[(0,N.jsx)(Ce.S,{className:"number p-2 me-2 d-flex b-700 justify-content-center align-items-center rounded-circle",children:s+1}),(0,N.jsx)(Ce.S,{className:"description",children:(0,N.jsx)(ke.A,{defaultMessage:"{instruction}",id:`message.io_selection_instruction_${s+1}`,values:{instruction:e}})})]},s))}),(0,N.jsx)("p",{className:"text-muted mb-0 mt-2 disclaimer",children:(0,N.jsx)(ke.A,{defaultMessage:"You will not be able to change your audio devices during the call. Please use Chrome or Edge to use this feature.",id:"label.you_will_not_be_able_to_change_you.d5be33fd"})})]}),(0,N.jsxs)(xe.Footer,{className:"justify-content-between",children:[(0,N.jsx)(ve.A,{onClick:()=>a(0),size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})}),(0,N.jsxs)(ve.A,{className:"d-flex justify-content-center align-items-center",onClick:s,size:"lg",children:[(0,N.jsx)(ze.i0t,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Join call",id:"label.join_call.f0675c04"})]})]})]})})};const en=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({currentStep:0,reject:Function(),resolve:Function(),show:!1}),n=()=>new Promise((e,s)=>{t(a=>(0,F.A)((0,F.A)({},a),{},{reject:s,resolve:e,show:!0}))}),r=e=>{a.resolve(!!e),i()},o=()=>r(!1),d=()=>r(!0),c=e=>t(s=>(0,F.A)((0,F.A)({},s),{},{currentStep:e}));(0,l.useImperativeHandle)(s,()=>
2({hideModal:r,showModal:n}));return(0,N.jsx)(xe,{backdrop:"static",className:"remove-title-divider remove-footer-divider",id:"incompatibleBrowserModal",onHide:r,show:a.show,children:(()=>{const e=$l[a.currentStep]||l.Fragment;return(0,N.jsx)(e,{onCancelJoin:o,onConfirmJoin:d,setCurrentStep:c})})()})});en.displayName="MeetingBrowserIncompatibilityModal";var sn=en;const an=e=>{const{className:s,maxIcons:a,offset:t,showOnline:i,showTooltip:l,size:n,speakingIndicators:r,style:o,theme:d,withBorder:c}=e,h=Array.isArray(null===e||void 0===e?void 0:e.users)?null===e||void 0===e?void 0:e.users:[],u=`stacked-user-icons d-inline-flex ${s||""}`,m=r?wi:Ya,g=a&&(null===h||void 0===h?void 0:h.length)>a?h.filter((e,s)=>s<a-1):h,p=h.filter(e=>!g.includes(e)),x=e=>({marginLeft:e?`${t}px`:"",zIndex:(null===h||void 0===h?void 0:h.length)-e});return(0,N.jsxs)(Ce.S,{className:u,style:(0,F.A)({height:n,position:"relative"},o),children:[g.map((e,s)=>(0,N.jsx)(m,{innerStyle:{border:"2px solid white"},showOnline:i,showTooltip:l,size:n,style:x(s),theme:d,user:e,withBorder:c},`${s}-${null===e||void 0===e?void 0:e.id}`)),a&&(null===h||void 0===h?void 0:h.length)>a&&(0,N.jsx)(XA,{overflow:p,overflowAmount:(null===h||void 0===h?void 0:h.length)-(a-1),showTooltip:l,size:n,style:(0,F.A)((0,F.A)({},x(g.length)),{},{top:2})})]})};an.defaultProps={leftFirst:!0,offset:-8,showTooltip:!1,size:22.5,spread:!1,style:{},theme:"light"};var tn=(0,P.G0)(an);const ln=e=>{const{facilitators:s,team:a}=Ra(),{members:t}=a;return(0,N.jsx)(Ge.A,{className:"challenge-hub-card challenge-hub-team-card",id:"challengeHubTeamCard",children:(0,N.jsxs)(Ge.A.Body,{className:"p-0",children:[(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between",children:(0,N.jsx)("span",{className:"card-heading",children:"My team"})}),(0,N.jsxs)(Qe.A,{className:"pt-2",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",md:7,xs:6,children:[(0,N.jsx)(Ce.S,{className:"py-2 d-xl-none",children:(0,N.jsx)(tn,{showTooltip:!0,offset:-6,users:t.map(e=>e.user)})}),(0,N.jsxs)(Ce.S,{className:"py-2 d-none d-xl-flex",children:[t.map((e,s)=>s>=5?null:(0,N.jsx)(Ce.S,{className:"d-inline",style:{marginRight:8},children:(0,N.jsx)(Ya,{redirToProfile:!0,showOnline:!0,showTooltip:!0,role:"Learner",size:32,user:e.user})},s)),t&&t.length>5&&(0,N.jsx)("div",{className:"d-flex justify-content-center bg-primary align-items-center text-white rounded-circle",style:{height:30,width:30},children:(0,N.jsxs)("p",{className:"text-white small",style:{fontWeight:700,left:-1,marginBottom:0,position:"relative"},children:["+",t.length-5,(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"additional learners",description:"",id:"label.additional_learners.4bee9e59"})})]})})]}),(0,N.jsx)(Ce.S,{className:"mt-1 card-data-label",children:(0,N.jsx)(ke.A,{defaultMessage:"learners",description:"",id:"label.learners.dc2ae857"})})]}),(0,N.jsx)(Ve.A,{md:5,xs:6,children:(null===s||void 0===s?void 0:s.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"py-2",children:[(0,N.jsx)(Ce.S,{className:"d-xl-none",children:(0,N.jsx)(tn,{showTooltip:!0,offset:-6,users:s})}),(0,N.jsxs)(Ce.S,{className:"d-none d-xl-flex",children:[s.map((e,s)=>s>=3?null:(0,N.jsx)(Ce.S,{className:"d-inline",style:{marginRight:8},children:(0,N.jsx)(Ya,{showOnline:!0,showTooltip:!0,role:"Facilitator",size:30,user:e})},s)),s&&s.length>3&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)("div",{className:"d-flex justify-content-center bg-primary align-items-center text-white rounded-circle",style:{height:30,width:30},children:(0,N.jsxs)("p",{className:"text-white small",style:{fontWeight:700,left:-1,marginBottom:0,position:"relative"},children:["+",s.length-3,(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"additional facilitators",description:"",id:"label.additional_facilitators.06dfc91d"})})]})})})})]})]}),(0,N.jsx)(Ce.S,{className:"mt-1 card-data-label",children:(0,N.jsx)(ke.A,{defaultMessage:"facilitators",description:"",id:"label.facilitators.0dfb6008"})})]})})]})]})})};var nn=t(85273);var rn=e=>(0,N.jsx)(Ve.A,{className:"challenge-hub-stats-overview",xs:12,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"mb-2 mb-lg-0",lg:6,children:(0,N.jsx)(nn.z,{displayMessage:!0,enableDetails:!1,fallbackClassName:"challenge-hub-card",showIcon:!1,size:"sm",children:(0,N.jsx)(ln,{})})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)(ft,{})})]})});var on=e=>{const{default_banner:s}=(0,P.hc)(),{challenge_template:a}=Ra()||{};return(0,N.jsx)(Ce.S,{className:"challenge-hub-banner",children:(0,N.jsx)(Zs.A,{alt:"",fluid:!0,src:(null===a||void 0===a?void 0:a.banner_path)||s})})};var dn=e=>{const{dummy:s,phases:a}=e,{formatMessage:t}=(0,ja.A)(),i={create:t({id:"label.make_your_idea_come_to_life.141dfca2",defaultMessage:"Make your idea come to life"}),discover:t({id:"label.identify_and_understand_the_proble.8f9d39b1",defaultMessage:"Identify and understand the problem"}),explore:t({id:"label.learn_what_you_need_to_know.aeeae8fc",defaultMessage:"Learn what you need to know"}),imagine:t({id:"label.brainstorm_and_generate_ideas.b71bfd80",defaultMessage:"Brainstorm and generate ideas"}
2),reflect:t({id:"label.debrief_and_evaluate_your_teammate.9d0cea63",defaultMessage:"Debrief and evaluate your teammates"})};return(0,N.jsx)(Ce.S,{className:"challenge-progress-container "+(s?"dummy":""),children:(0,N.jsxs)(Qe.A,{className:"mx-0",children:[(0,N.jsx)(Ve.A,{className:"p-2",lg:7,children:(0,N.jsx)(Pn,{data:a[1],description:i.discover,dummy:s,icon:"discover",phase:1})}),(0,N.jsx)(Ve.A,{className:"p-2",lg:5,children:(0,N.jsx)(Pn,{data:a[2],description:i.explore,dummy:s,icon:"explore",phase:2})}),(0,N.jsx)(Ve.A,{className:"p-2",lg:4,children:(0,N.jsx)(Pn,{data:a[3],description:i.imagine,dummy:s,icon:"imagine",phase:3})}),(0,N.jsx)(Ve.A,{className:"p-2",lg:4,children:(0,N.jsx)(Pn,{data:a[4],description:i.create,dummy:s,icon:"create",phase:4})}),(0,N.jsx)(Ve.A,{className:"p-2",lg:4,children:(0,N.jsx)(Pn,{data:a[5],description:i.reflect,dummy:s,icon:"reflect",phase:5})})]})})};const cn=e=>(0,N.jsxs)("svg",(0,F.A)((0,F.A)({fill:"none",height:"1em",viewBox:"0 0 64 64",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,N.jsx)("path",{d:"M34.9 17.5h-5.7v3.9h5.7v-3.9z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M34.8 17.5h-5.6v3.8h5.6v-3.8z",fill:e.strokeColor}),(0,N.jsx)("path",{d:"M62.9 43.7v-.2c0-.4-.1-.8-.2-1.2-.2-.8-.4-1.6-.8-2.4L48.8 10.6c-1.7-3.9-6.2-5.8-10.1-4.2-2.9 1.2-4.8 4-4.8 7.2v.8l2 21.5H28l2-21.5v-.8c0-4.3-3.5-7.8-7.7-7.8-3.1 0-6 1.9-7.2 4.8L2 39.9c-.3.8-.6 1.6-.8 2.4-.1.4-.1.8-.2 1.2V45.1c0 .9.1 1.8.3 2.6 1 5.1 5 9.1 10.2 10.2.9.2 1.8.3 2.6.3.4 0 .9 0 1.3-.1l.4-.1c.3 0 .6-.1.8-.1.2 0 .3-.1.5-.1s.5-.1.7-.2l.5-.2c.2-.1.4-.2.7-.2l.5-.2.6-.3.5-.3.6-.3.5-.3c.2-.1.4-.2.5-.4.1-.2.3-.2.5-.4s.3-.3.5-.4l.4-.4.4-.5.4-.5.4-.5c.1-.2.2-.3.4-.5s.2-.3.3-.5l.3-.5.3-.5.3-.6c.1-.2.1-.4.2-.5.1-.2.2-.4.2-.6 0-.2.1-.4.1-.6 0-.2.1-.4.2-.7v-.1h10.2v.1c0 .2.1.4.2.7.1.3.1.4.1.6.1.2.1.4.2.6.1.2.1.4.2.5l.3.6.3.5.3.5c.1.2.2.3.3.5.1.2.2.3.3.5l.4.5.4.5.4.5.4.4c.2.2.3.3.5.4.2.1.3.3.5.4.2.1.3.3.5.4l.5.3.6.3.5.3.6.3.5.2c.2.1.4.2.7.2l.5.2c.2.1.5.1.7.2.2.1.3.1.5.1s.6.1.8.1l.4.1c.4 0 .9.1 1.3.1 6.2 0 11.6-4.3 12.8-10.4.2-.9.3-1.7.3-2.6-.3-.6-.3-1-.4-1.5zm-21.2-34c1.6 0 3 .9 3.6 2.4l9.2 20.7c-5.2-2-11.1-.5-14.6 3.8l-2-22.5V14v-.4c0-2.1 1.7-3.9 3.8-3.9zm-5.4 30l.4 3.9h-9.3l.4-3.9h8.5zM18.7 12.2c.8-2 3.1-2.9 5.1-2.1 1.4.6 2.3 2 2.4 3.5v.5l-2.1 22.5c-3.6-4.3-9.4-5.8-14.6-3.8l9.2-20.6zM4.9 45.1v-.9L5 44c0-.3.1-.5.1-.8v-.1C6.2 38.1 11 35 16 36c4.3.9 7.3 4.7 7.3 9v.9c0 .2 0 .3-.1.4-.1.1 0 .3-.1.5v.2c-.1.2-.1.5-.2.7-.9 2.9-3.1 5.1-6 6-.3.1-.5.1-.8.2H16c-.2 0-.5.1-.7.1h-1.1c-5.1.3-9.2-3.8-9.3-8.9zm45 9.2h-1.1c-.2 0-.5-.1-.8-.1-.3-.1-.5-.1-.8-.2-3.4-1.1-5.9-4-6.4-7.6v-.3-.9c0-5.1 4.1-9.2 9.2-9.2 4.4 0 8.1 3 9 7.3v.1c0 .2.1.5.1.8v1.1c-.1 4.9-4.1 9-9.2 9z",fill:"currentColor"})]}));cn.defaultProps={color:"#008087"};var hn=cn;const un=e=>(0,N.jsxs)("svg",(0,F.A)((0,F.A)({fill:"none",height:"1em",viewBox:"0 0 64 64",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,N.jsx)("path",{d:"M47 60.1999C47 60.5999 46.7 60.9999 46.3 60.9999C31 60.6999 27 51.7999 27 46.9999C27 36.4999 14.9 35.1999 11.7 34.9999C11.3 34.9999 11 34.5999 11 34.1999V31.6999C11 31.2999 11.3 30.9999 11.7 30.8999C18.8 31.1999 31 34.7999 31 46.9999C31 47.3999 31.3 56.6999 46.3 56.9999C46.7 56.9999 47 57.2999 47 57.7999V60.1999Z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M47 14C53.9 14 59.5 19.6 59.5 26.5C59.5 32.3 54.6 38.8 49 46.4L46.9 49.3C40.2 40.6 34.5 33.1 34.5 26.5C34.5 19.6 40.1 14 47 14ZM47 10C37.9 10 30.5 17.4 30.5 26.5C30.5 35.4 37.9 44.3 46.4 55.2C46.6 55.5 47.1 55.6 47.4 55.4C47.5 55.4 47.5 55.3 47.6 55.2C55.3 44.3 63.5 35.4 63.5 26.5C63.5 17.4 56.1 10 47 10Z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M46.9999 25.2998C47.6999 25.2998 48.1999 25.7998 48.1999 26.4998C48.1999 27.1998 47.6999 27.6998 46.9999 27.6998C46.2999 27.6998 45.7999 27.1998 45.7999 26.4998C45.7999 25.7998 46.2999 25.2998 46.9999 25.2998ZM46.9999 21.2998C44.0999 21.2998 41.7999 23.5998 41.7999 26.4998C41.7999 29.3998 44.0999 31.6998 46.9999 31.6998C49.8999 31.6998 52.1999 29.3998 52.1999 26.4998C52.1999 23.5998 49.8999 21.2998 46.9999 21.2998Z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M11 5.5C14.5 5.5 17.4 8.4 17.4 11.9C17.4 15 14.5 19 11.1 23.6L10.9 23.8C7.39997 19.2 4.59998 15.2 4.59998 11.9C4.59998 8.4 7.49998 5.5 11 5.5ZM11 1.5C5.29998 1.5 0.599976 6.2 0.599976 11.9C0.599976 17.4 5.19998 22.9 10.4 29.7C10.6 30 11.1 30.1 11.4 29.9C11.5 29.9 11.5 29.8 11.6 29.7C16.4 23 21.4 17.4 21.4 11.9C21.4 6.2 16.8 1.5 11 1.5Z",fill:e.strokeColor}),(0,N.jsx)("path",{d:"M11 8.6001C9.19995 8.6001 7.69995 10.1001 7.69995 11.9001C7.69995 13.7001 9.19995 15.2001 11 15.2001C12.8 15.2001 14.3 13.7001 14.3 11.9001C14.3 10.1001 12.8 8.6001 11 8.6001Z",fill:e.strokeColor})]}));un.defaultProps={color:"#008087",strokeColor:"#D5D9DC"};var mn=un;const gn=e=>(0,N.jsxs)("svg",(0,F.A)((0,F.A)({fill:"none",height:"1em",viewBox:"0 0 64 64",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,N.jsx)("path",{d:"M61.4 51.7001H62.9C63.3 51.7001 63.7 51.4001 63.7 50.9001V49.1C63.7 48.7 63.4 48.3 62.9 48.3H61.4C61.2 47.1 60.7 46 60.1 45L61.2 43.9001C61.5 43.6001 61.5 43.1 61.2 42.8L59.9 41.5C59.6 41.2 59.1 41.2 58.8 41.5L57.7 42.5C56.7 41.8 55.6 41.3 54.4 41.1V39.6C54.4 39.2 54.1 38.8 53.6 38.8H51.8C51.4 38.8 51 39.1 51 39.6V41.1C49.8 41.3 48.7 41.8001 47.7 42.4001L46.6 41.3C46.3 41 45.8 41 45.5 41.3L44.2 42.6C43.9 42.9 43.9 43.4001 44.2 43.7001L45.3 44.8C44.6 45.8 44.1 46.9 43.8 48.1H42.3C41.9 48.1 41.5 48.4001 41.5 48.9001V50.7001C41.5 51.1 41.8 51.5 42.3 51.5H43.8C44 52.7 44.4 53.8 45.1 54.8L44 55.8C43.7 56.1 43.7 56.6001 44 56.9001L45.3 58.2001C45.6 58.5 46.1 58.5 46.4 58.2001L47.5 57.2001C48.5 57.9001 49.6 58.4 50.8 58.6V60.1C50.8 60.5 51.1 60.9
2001 51.6 60.9001H53.4C53.8 60.9001 54.2 60.6 54.2 60.1V58.6C54.5 58.6 54.7 58.5001 55 58.4001C55.9 58.1001 56.8 57.8001 57.5 57.2001L58.6 58.3C58.9 58.6 59.4 58.6 59.7 58.3L61 57.1C61.3 56.8 61.3 56.3 61 56L59.9 55C60.6 54 61.1 52.9001 61.4 51.7001ZM52.5 54.5C49.9 54.4 47.8 52.3001 47.9 49.7001C47.9 47.6 49.3 45.8 51.3 45.3C51.7 45.2 52.2 45.1 52.6 45.1C55.2 45 57.4 47.1 57.5 49.7001C57.6 52.3001 55.5 54.5 52.9 54.6C52.8 54.6 52.6 54.6 52.5 54.5Z",fill:e.strokeColor}),(0,N.jsx)("path",{d:"M54.7 24.2L57.6 23.1C58 23 58.2 22.5 58.1 22.1L57.1 19.2C56.9 18.8 56.5 18.6 56.1 18.7L53.2 19.8C52.5 18.6 51.5 17.5 50.4 16.7L51.7 13.9C51.9 13.5 51.7 13.1 51.3 12.9L48.6 11.6C48.2 11.4 47.8 11.6 47.6 12L46.3 14.8C44.9 14.5 43.5 14.4 42.1 14.6L41.1 11.7C40.9 11.3 40.5 11.1 40.1 11.2L37.3 12.2C36.9 12.3 36.7 12.8 36.8 13.2L37.8 16.1C36.6 16.8 35.5 17.8 34.7 18.9L31.9 17.6C31.5 17.5 31.1 17.6 30.9 18L29.6 20.7C29.4 21.1 29.6 21.5 30 21.7L32.8 23C32.5 24.4 32.4 25.8 32.6 27.2L29.7 28.3C29.3 28.4 29.1 28.9 29.2 29.3L30.2 32.1C30.4 32.5 30.8 32.7 31.2 32.6L34.1 31.6C34.8 32.8 35.8 33.9 36.9 34.7L35.6 37.5C35.4 37.9 35.6 38.3 36 38.5L38.7 39.8C39.1 40 39.5 39.8 39.7 39.4L41.1 36.6C42.5 36.9 43.9 37 45.3 36.8L46.3 39.7C46.5 40.1 46.9 40.3 47.3 40.2L50.1 39.2C50.5 39.1 50.7 38.6 50.6 38.2L49.6 35.3C50.8 34.6 51.8 33.6 52.7 32.5L55.5 33.8C55.9 34 56.4 33.8 56.5 33.4L57.7 30.6C57.9 30.2 57.7 29.8 57.3 29.6L54.5 28.3C54.8 27.1 54.9 25.7 54.7 24.2ZM40.5 32.2C37 30.5 35.4 26.3 37.1 22.8C37.9 21.1 39.3 19.8 41.1 19.2C41.4 19.1 41.6 19 41.9 19C45.7 18.1 49.5 20.5 50.4 24.3C51.3 28.1 48.9 31.9 45.1 32.8C43.6 33.1 42 32.9 40.5 32.2Z",fill:e.strokeColor}),(0,N.jsx)("path",{d:"M9.8 49H24.3C24.7 49 25.1 49.3 25.1 49.8V52.3C25.1 52.7 24.8 53.1 24.3 53.1H9.8C9.3 53 9 52.7 9 52.2V49.7C9 49.3 9.3 49 9.8 49Z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M12.8 55H21.3C21.7 55 22.1 55.3 22.1 55.8V58.3C22.1 58.7 21.8 59.1 21.3 59.1H12.8C12.4 59.1 12 58.8 12 58.3V55.8C12 55.3 12.3 55 12.8 55Z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M26.3 33.7L25.5 31.6C23 34.9 21.5 38.9 21.1 43H12.9C12.5 38.4 10.6 34.1 7.70004 30.6C3.50004 25.5 4.30004 17.9 9.40004 13.7C11.5 12 14.2 11 16.9 11H17C21.1 11 24.8 13.1 27 16.5C27.6 15.3 28.7 14.3 30 13.9C27.1 9.6 22.2 7 17 7H16.9C8.40004 7.1 1.40004 13.8 1.00004 22.2C0.80004 26.2 2.10004 30.1 4.70004 33.2C7.40004 36.5 9.00004 40.5 9.00004 44.8V46.3C9.00004 46.7 9.30004 47 9.80004 47H24.3C24.7 47 25 46.7 25.1 46.2V45C25.1 41.7 26 38.4 27.7 35.6C27 35.1 26.5 34.4 26.3 33.7Z",fill:"currentColor"})]}));gn.defaultProps={color:"#008087",strokeColor:"#D5D9DC"};var pn=gn;const xn=e=>(0,N.jsxs)("svg",(0,F.A)((0,F.A)({fill:"none",height:"1em",viewBox:"0 0 64 64",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,N.jsx)("path",{d:"M20.2 41h-2.5c-.4 0-.8-.4-.8-.8V25.8c0-.4.3-.8.8-.8h2.5c.4 0 .8.4.8.8v14.4c0 .4-.3.8-.8.8zM27 16c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm0-4c-3.3 0-6 2.7-6 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zM36.2 41h-2.5c-.4 0-.8-.4-.8-.8V25.8c0-.4.3-.8.8-.8h2.5c.4 0 .8.4.8.8v14.4c0 .4-.3.8-.8.8z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M46.3 48.1l1.8-1.8c.3-.3.8-.3 1.1 0L62.7 60c.3.3.3.8 0 1.1L61 62.8c-.3.3-.8.3-1.1 0L46.3 49.1c-.3-.3-.3-.7 0-1zM27 6.1c11.5 0 20.9 9.3 20.9 20.9 0 11.6-9.4 20.9-20.9 20.9-11.5 0-20.9-9.4-20.9-20.9C6.1 15.5 15.5 6.1 27 6.1zM27 2C13.2 2 2 13.2 2 27s11.2 25 25 25 25-11.2 25-25S40.8 2 27 2z",fill:e.strokeColor})]}));xn.defaultProps={color:"#008087"};var vn=xn;const fn=e=>(0,N.jsxs)("svg",(0,F.A)((0,F.A)({fill:"none",height:"1em",viewBox:"0 0 64 64",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,N.jsx)("path",{d:"M39.4 13.9l-.6.6.6-.6z",fill:"currentColor"}),(0,N.jsx)("path",{d:"M38.8 14.5l-2.2 2.2 10.8 10.9 2.8-2.8h.1L39.4 13.9l-.6.6z",fill:e.strokeColor}),(0,N.jsx)("path",{d:"M36.6 16.7l2.2-2.2-2.2 2.2zM43.8 3.9l-32.2 32c-.1.1-.1.2-.2.3L4.3 58.6c-.2.4 0 .8.4 1 .2.1.3.1.5 0l22.5-6.9c.1 0 .2-.1.3-.2l32.2-32c.3-.3.3-.8 0-1.1L44.9 3.9c-.3-.3-.8-.3-1.1 0zm-18 45.2L10 53.9l5-15.8 21.6-21.4 2.2-2.2.6-.6L44.3 9l10.8 11-4.9 4.9-2.8 2.8-21.6 21.4z",fill:"currentColor"})]}));fn.defaultProps={color:"#008087"};var jn=fn;var _n=t.p+"static/media/icon-discover-white.1cd96dbc9989ce4efe5a2c6e4b8c2dd5.svg";var bn=t.p+"static/media/icon-discover-gray.f9b330fef915f6b64a293876f3d27aac.svg";var An={gray:bn,normal:t.p+"static/media/icon-discover.1cd96dbc9989ce4efe5a2c6e4b8c2dd5.svg",white:_n};var yn=t.p+"static/media/icon-explore-white.d1c5496097989363f3232ba1482b74b1.svg";var wn=t.p+"static/media/icon-explore-gray.0f8881f67c10eeda7040e9c2960f879b.svg";var Nn={gray:wn,normal:t.p+"static/media/icon-explore.676834c90617757d6f01cf15c1d94095.svg",white:yn};var Sn=t.p+"static/media/icon-imagine-white.3098f6856e720938fd0b9bcdc67c4d48.svg";var Cn=t.p+"static/media/icon-imagine-gray.7d0107b5d040827af118ea08cbfd2a16.svg";var Mn={gray:Cn,normal:t.p+"static/media/icon-imagine.15e5cffa17ebee208fbd0d3ca774c0
270.svg",white:Sn};var kn=t.p+"static/media/icon-reflect-white.79fedb41d5e686d3939950d51e04cebf.svg";var zn=t.p+"static/media/icon-reflect-gray.6e8dd48e5aa9b3c5edb76583f8f25676.svg";var Tn={gray:zn,normal:t.p+"static/media/icon-reflect.50e9a59ba4dbfbaff47b4dba5b6f6d99.svg",white:kn};var In=t.p+"static/media/icon-complete.797e776f44d63b046101024b0f11cfef.svg";var En=t.p+"static/media/icon-create-white.719a0b05d7d2cf582e01ce3a15588ab4.svg";var Fn=t.p+"static/media/icon-create-gray.7785b0df64d57f329cd6bdd8164ec27b.svg";var Rn=t.p+"static/media/icon-create.719a0b05d7d2cf582e01ce3a15588ab4.svg";var Dn={complete:In,create:{gray:Fn,normal:Rn,white:En},discover:An,explore:Nn,imagine:Mn,lock:t.p+"static/media/icon-lock.b72b371c31d52c5e85928fd952189ac1.svg",reflect:Tn};const Bn=e=>{const{color:s,size:a,stroke:t}=e;switch(e.icon){case"discover":return(0,N.jsx)(hn,{color:s,fontSize:a,strokeColor:t});case"explore":return(0,N.jsx)(mn,{color:s,fontSize:a,strokeColor:t});case"imagine":return(0,N.jsx)(pn,{color:s,fontSize:a,strokeColor:t});case"create":return(0,N.jsx)(jn,{color:s,fontSize:a,strokeColor:t});case"reflect":return(0,N.jsx)(vn,{color:s,fontSize:a,strokeColor:t});default:return(0,N.jsx)(N.Fragment,{})}};var Pn=e=>{const{data:s,description:a,dummy:t,icon:i,phase:l}=e,{complete:n,expired:r,link:o,locked:d,started:c,title:h,users:u}=s||{},m=(0,Pe.W6)(),{styles:g,utils:p}=(0,P.nm)(),{preventBubbling:x}=p,v=(null===g||void 0===g?void 0:g.primary)||"",f=(null===g||void 0===g?void 0:g["gray-300"])||"",j=d&&!n?"locked":n?"complete":"incomplete",_=d?f:v;return(0,N.jsx)(Ge.A,{"aria-disabled":d,className:`challenge-progress-card ${j}`,onClick:()=>{d&&!n||o&&m.push(o)},children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex p-0 gap-3",children:[(0,N.jsx)(Ce.S,{className:`d-flex challenge-hub-card-icon ${j}`,children:n?(0,N.jsx)(Zs.A,{alt:"",height:24,src:Dn.complete,width:24}):(0,N.jsx)(Bn,{color:_,icon:i,size:40,stroke:f})}),(0,N.jsx)(Qe.A,{className:"flex-1 mx-0 d",children:(0,N.jsxs)(Ve.A,{className:"p-0",children:[(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between gap-1",children:(0,N.jsxs)(Ce.S,{className:"flex-column card-heading-container px-0 flex-1",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-1",children:[(0,N.jsx)("h4",{className:"mb-0",children:h}),(0,N.jsx)("h1",{className:"phase-number mb-0",children:l})]}),(0,N.jsx)("p",{className:"card-description",children:a})]})}),(0,N.jsx)(Ln,{phase:s}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between pt-3",children:[n?(0,N.jsx)("strong",{style:{color:v},children:(0,N.jsx)(ke.A,{defaultMessage:"Complete",id:"label.complete.143b270a"})}):d?(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.JhU,{className:"text-secondary",fontSize:14}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column justify-content-end",children:(0,N.jsx)("strong",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Locked",id:"label.locked.a424e33d"})})})]}):t?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("strong",{className:"text-black-50",children:(0,N.jsx)(ke.A,{defaultMessage:"Incomplete",id:"label.incomplete.75f33cdf"})})}):(0,N.jsx)(N.Fragment,{children:r?(0,N.jsx)("strong",{style:{color:"#DC3545"},children:(0,N.jsx)(ke.A,{defaultMessage:"Expired",id:"label.expired.424a2551"})}):(0,N.jsxs)(Le.Link,{className:"p-0",onClick:x,to:o,children:[(0,N.jsx)("strong",{className:"me-1 phase-progress-text",children:!n&&c?(0,N.jsx)(ke.A,{defaultMessage:"Resume",id:"label.resume.d640c742"}):(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})}),(0,N.jsx)(ze.Z0P,{})]})}),(0,N.jsxs)(Ce.S,{className:"d-inline-flex",children:[!(null===u||void 0===u||!u.length)&&u.map((e,s)=>(0,N.jsx)(Ce.S,{className:"me-1",children:(0,N.jsx)(Ya,{showOnline:!1,size:18,user:e.user})},s)),(null===u||void 0===u?void 0:u.length)>4&&(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center bg-primary align-items-center text-white rounded-circle",style:{height:18,marginTop:4,width:18},children:(0,N.jsxs)("p",{className:"text-white small",style:{fontWeight:400,left:-1,marginBottom:0,position:"relative"},children:["+",u.length-4]})})]})]})]})})]})})};var Ln=e=>{const{phase:s}=e,{subphases:a}=s,t=(0,Pe.W6)(),{preventBubbling:i}=(0,P.hc)();return(0,N.jsx)(Ce.S,{className:"progress challenge-progress-bar",children:!(null===a||void 0===a||!a.length)&&a.map((e,s)=>{let{icon:a,link:l,status:n,title:r}=e;return(0,N.jsx)(Ce.S,{className:`progress-bar challenge-progress-segment ${n}`,children:(0,N.jsxs)(Ce.S,{className:"challenge-progress-segment-content",onClick:e=>((e,s)=>{i(e),s&&t.push(s)})(e,l),children:[(0,N.jsx)(Ce.S,{children:"incomplete"===n?a:"complete"===n?(0,N.jsx)(ze.CMH,{fill:"#FFFFFF",size:20}):(0,N.jsx)(N.Fragment,{})}),(0,N.jsx)("p",{className:"subphase-title small",children:r})]})},s)})})},On=t(5989),Hn=t(92460),Un=t(44103),Qn=t(44393),Vn=t(741),Gn=t(30147),Wn=t(91294),Kn=t(29448),Yn=t(57628),qn=t(90926),Jn=t(50260),Xn=t(85746);const Zn=e=>{const{color:s,size:a,subject:t}=e,i={CTE:qn.default,"Data Literacy":Un.default,"Diversity & Inclusion":On.default,ELA:Jn.default,Innovation:Vn.default,Leadership:Qn.default,Math:Yn.default,"Professional Development":Xn.default,Scie
2nce:Wn.default,"Social Studies":Hn.default,STEAM:Kn.default,"Well-being":Gn.default},n=(null===i||void 0===i?void 0:i[t])||l.Fragment;return(0,N.jsx)(n,{color:s,fontSize:a})};Zn.defaultProps={color:"var(--primary)",size:20};var $n=Zn,er=t(30148),sr=t(13836),ar=t(72512),tr=t(98117),ir=t(71338),lr=t(69748),nr=t(48268),rr=t(80610),or=t(77217),dr=t(56071),cr=t(19894),hr=t(85591),ur=t(51578),mr=t(18620);const gr={beaker:er.default,brain:ar.default,checklist:nr.default,cursor_select:sr.default,flag:mr.default,flash:ur.default,grid:va.default,list_ol:ze.lfF,magnifier:lr.default,puzzle:cr.default,question:ze.qQC,share:hr.default,symbols:or.default,target:dr.default,three_crayons:tr.default,three_users:ir.default,user_alt:rr.default},pr=e=>{var s,a,t;const{challenge_type:i,color:n,phase:r,size:o,subphase:d}=e,c=Za.Ay[i]||Za.Ay.classic,h=null===c||void 0===c||null===(s=c.phases)||void 0===s||null===(a=s[r])||void 0===a||null===(t=a.subphases)||void 0===t?void 0:t[d],u="object"===typeof h?null===h||void 0===h?void 0:h.icon:null,m=u&&gr[u]||l.Fragment;return(0,N.jsx)(m,{color:n,fontSize:o},`${r}-${d}`)};pr.defaultProps={challenge_type:"classic",color:"var(--black)",size:24};var xr=pr;const vr=["className","height","path","size","width"],fr=e=>{const{className:s,height:a,path:i,size:l,width:n}=e,r=(0,he.A)(e,vr),o=t(44054)(`./${i}`);return(0,N.jsx)(Zs.A,(0,F.A)({className:`common-icon ${s||""}`,src:o,style:{height:a||l,width:n||l}},r))};var jr=fr,_r=t(62192),br=t.n(_r);class Ar{constructor(){this.colors=["#684bb4","#007DB8","#008087","#9E6C00"],this.shuffledColors=this.colors.slice().sort(()=>Math.random()-.5),this.index=0,this.getNextColor=()=>(this.index>=this.shuffledColors.length&&(this.index=0,this.shuffledColors.sort(()=>Math.random()-.5)),this.shuffledColors[this.index++])}}const yr=e=>{var s,a;const{aspectRatio:t}=e,{isBelowBreakpoint:i}=(0,ne.vh)({breakpoint:993}),{project:n}=Ra(),{challenge_data:r}=n||{},o=(null===e||void 0===e?void 0:e.list)||(null===r||void 0===r||null===(s=r[0])||void 0===s||null===(a=s.data)||void 0===a?void 0:a.wordCloudList)||[],d=(0,l.useMemo)(()=>o.map(e=>[e.value,Math.floor(3*Math.random())+1]),[o]),[c,h]=(0,l.useState)(null),u=new Ar;return(0,l.useEffect)(()=>{(async()=>{const e=await(e=>new Promise(s=>{const a=document.createElement("canvas");a.width=i?700:1400,a.height=i?350:700;const t=()=>{a.removeEventListener("wordcloudstop",t),s(a.toDataURL("image/png",1))};a.addEventListener("wordcloudstop",t),br()(a,{backgroundColor:"#fff",color:u.getNextColor,drawOutOfBound:!1,fontFamily:"proxima-nova, sans-serif",gridSize:20,list:e,rotateRatio:.3,rotationSteps:4,shrinkToFit:!0,weightFactor:35})}))(d);h(e)})()},[d]),(0,N.jsx)(Ce.S,{className:"word-cloud-renderer d-flex flex-fill",style:{aspectRatio:t},children:null!==d&&void 0!==d&&d.length?(0,N.jsx)(Ge.A,{className:"flex-fill",children:(0,N.jsx)(Me.R_,{fluid:!0,rounded:!0,alt:`A word cloud containing the words: ${d.map(e=>e[0]).join(", ")}`,imageClassname:"h-100 p-2",objectFit:"contain",placeholderClassname:"h-100",src:c})}):(0,N.jsxs)(Ce.S,{className:"wordcloud-placeholder rounded d-flex flex-column align-items-center justify-content-center gap-2 flex-fill",children:[(0,N.jsx)(fr,{height:100,path:"subphases/1-1/wordcloud_placeholder.png",width:200}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add a word to generate your word cloud",id:"label.add_a_word_to_generate_your_word_c.b47a90d4"})})]})})};yr.defaultProps={aspectRatio:16/9};var wr=yr;var Nr=e=>{const{challenge_type:s,getPhaseLink:a,getPhaseTitle:t,getSubphaseTitle:i,group_assignment:n,isPhaseStarted:r,project:o,team_locations:d}=Ra(),{challenge_data:c}=o||{},{is_expired:h}=n||{},u=Za.Ay[s]||Za.Ay.classic,m=Object.keys(u.phases).map(Number),g=m.reduce((e,s)=>(e[s]=[],e),{}),[p,x]=(0,l.useState)(g);(0,l.useEffect)(()=>{if(d){const e=m.reduce((e,s)=>(e[s]=d.filter(e=>e.phase===s),e),{});x(e)}},[d]);const v=e=>null===c||void 0===c?void 0:c.filter(s=>s.phase===e),f=()=>{var e;let s=null;return null===c||void 0===c||null===(e=c.every)||void 0===e||e.call(c,e=>
2{let{is_complete:a,phase:t,subphase:i}=e;return!!a||(s={phase:t,subphase:i},!1)}),s};return(0,N.jsx)(dn,{phases:(()=>{let e=m.reduce((e,s)=>(e[s]={},e),{});for(const l of m){const n=v(l),o=f(),d=l>(null===o||void 0===o?void 0:o.phase),c=!n.find(e=>!e.is_complete),u=n.map((e,t)=>({icon:(0,N.jsx)(xr,{challenge_type:s,phase:l,size:20,subphase:t+1}),link:a(l,t+1),status:d?"locked":null!==e&&void 0!==e&&e.is_complete?"complete":"incomplete",title:i(l,t+1)}));e[l]={complete:c,expired:h,link:a(l),locked:d,next_subphase:o,started:r(l),subphases:u,title:t(l),users:p[l]}}return e})()})};const Sr=l.createContext({}),Cr=Sr.Provider,Mr=(Sr.Consumer,()=>(0,l.useContext)(Sr)),kr=(0,l.forwardRef)(function(e,s){const{onHide:a}=e,{api:t}=(0,n.nm)(),i=(0,Pe.W6)(),[r,o,d]=(0,ne.CQ)({can_learners_create_teams:!0,error:null,existing_teams:[],group_member_assignment_id:null,loading:!1,show:!1,step:0}),c=e=>{var s;const{can_learners_create_teams:a}=(null===e||void 0===e?void 0:e.assignment)||{},{group_member_assignment_id:t}=(null===e||void 0===e||null===(s=e.group_member_assignment_components)||void 0===s?void 0:s[0])||{};d(),o(e=>(0,F.A)((0,F.A)({},e),{},{can_learners_create_teams:a,group_member_assignment_id:t,show:!0}))},h=()=>{o({show:!1}),"function"===typeof a&&a()},u=e=>o(s=>(0,F.A)((0,F.A)({},s),{},{error:e})),m=e=>{let{group_member_assignment:s}=e;const{group_member_assignment_components:a}=s;return(null===a||void 0===a?void 0:a.length)>1?`/assignment/${null===s||void 0===s?void 0:s.id}`:`/assignment/${null===s||void 0===s?void 0:s.id}/${s.group_member_assignment_components[0].id}/overview`};return(0,l.useImperativeHandle)(s,()=>({hideModal:h,showModal:c})),(0,l.useEffect)(()=>d,[]),(0,N.jsx)(Cr,{value:{createTeam:async(e,s,a)=>{const{group_member_assignment_id:l}=r;o(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0}));try{const{group_member_assignment:n}=await t.post("/api/teams/add",{group_member_assignment_id:l,name:e,password:a,slug:s});i.push(m({group_member_assignment:n}))}catch({err:err}){o(s=>(0,F.A)((0,F.A)({},s),{},{error:err,loading:!1}))}},existing_teams:r.existing_teams,fetchTeams:async()=>{try{const{group_member_assignment_id:e}=r;o(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0}));const{teams:s}=await t.get(`/api/teams/existing/${e}`);o(e=>(0,F.A)((0,F.A)({},e),{},{existing_teams:s,loading:!1}))}catch({err:err}){o(s=>(0,F.A)((0,F.A)({},s),{},{error:err,loading:!1}))}},joinTeam:async(e,s)=>{try{const{group_member_assignment_id:a}=r,{group_member_assignment:l}=await t.post("/api/teams/members/add",{group_member_assignment_id:a,password:s,team_id:e});i.push(m({group_member_assignment:l}))}catch({err:err}){u(err)}},loading:r.loading,resetTeams:()=>o(e=>(0,F.A)((0,F.A)({},e),{},{existing_teams:[]})),setError:u,setStep:e=>o(s=>(0,F.A)((0,F.A)({},s),{},{step:e}))},children:(0,N.jsxs)(xe,{onHide:h,show:r.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start your assignment",id:"label.start_your_assignment.51f2a11e"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),show:r.error,variant:"danger",children:r.error}),r.can_learners_create_teams?(()=>{const e=(null===Dr||void 0===Dr?void 0:Dr[r.step])||l.Fragment;return(0,N.jsx)(e,{})})():(0,N.jsx)(Ce.S,{children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Your facilitator is still setting up your team, you can't start your assignment until this process is complete. Please check back later!",id:"label.your_facilitator_is_still_setting.6a6c6619"})})})]})]})})});var zr=kr;var Tr=e=>{const{setStep:s}=Mr();return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h2",{className:"text-center text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Let's Get Started",id:"label.lets_get_started.7a9267ac"})}),(0,N.jsx)("h6",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Before getting started, you'll need to either create a new team, or join an existing one. Which would you like to do?",id:"label.before_getting_started_youll_need.240f9721"})}),(0,N.jsxs)(Ce.S,{className:"text-center mt-4",children:[(0,N.jsx)(ve.A,{className:"me-3",onClick:()=>s(2),size:"lg",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a New Team",description:"",id:"label.create_a_new_team.e1a9a52e"})}),(0,N.jsx)(ve.A,{className:"mt-3 mt-sm-0",onClick:()=>s(1),size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Join a Team",description:"",id:"label.join_a_team.0f6e42f2"})})]})]})};var Ir=s=>{const{team:a}=s,t=(0,l.useRef)(),[i,n]=(0,l.useState)(!1),{joinTeam:r}=Mr(),{formatMessage:o}=(0,ja.A)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"d-flex justify-content-center align-items-center",disabled:i,onClick:async()=>{n(!0);try{if(null!==t&&void 0!==t&&t.current){const e=()=>new Promise(e=>{const s=t.current;s.show({actions:[s.CancelAction({onClick:()=>n(!1)}),s.Action({label:o({id:"label.submit.155f816c",defaultMessage:"Submit"}),onClick:()=>e(s.getInputValue())})],onHide:()=>n(!1),prompt:s.PasswordPrompt({initialValue:""}),size:"sm",title:o({id:"label.team_password.2e1065b4",defaultMessage:"Team password"})})}),s=await e();await r(null===a||void 0===a?void 0:a.id,s),n(!1)}}catch(e){n(!1)}},size:"lg",style:{minHeight:40,minWidth:70},type:"submit",children:i?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsx)(ke.A,{defaultMessage:"Join",id:"label.join.fd30fe68"})}),(0,N.jsx)(je,{ref:t})]})};var Er=e=>{const{existing_teams:s,fetchTeams:a,loading:t,resetTeams:i,setStep:n}=Mr();return(0,l.useEffect)(()=>((async()=>{await a()})(),()=>i),[]),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(qa.A,{responsive:!0,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})}),(0,N.jsx)("th",{}),(0,N.jsx)("th",{className:"text-end"})]})}),(0,N.jsx)("tbody",{children:t?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center align-middle",colSpan:3,children:(0,N.jsx)(Me.y$,{})})})}):(0,N.jsx)(N.Fragment,{children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>{let{name:a,password:t}=e;return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:a}),(0,N.jsx)("td",{children:t?(0,N.jsx)(ze.JhU,{}):(0,N.jsx)(N.Fragment,{})}),(0,N.jsx)("td",{className:"d-flex justify-content-end",children:(0,N.jsx)(Ir,{team:e})})]},s)})}):(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:"3",children:(0,N.jsx)("p",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"No teams created yet.",id:"label.no_teams_created_yet.3ef8438d"})})})})})})]}),(0,N.jsx)(ve.A,{onClick:()=>n(0),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",description:"",id:"label.back.76900f1b"})})]})},Fr=t(26405),Rr=t.n(Fr);var Dr=[Tr,Er,e=>{const{locale:s}=(0,n.nm)(),{createTeam:a,setStep:t}=Mr();return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ds.l1,{onSubmit:(e,s)=>a(e.name,e.slug,e.password),validateOnChange:!0,validationSchema:(0,Re.by)({locale:s,scope:"team.add_team"}),initialValues:{name:"",password:"",slug:""},children:e=>{let{errors:s,handleChange:a,handleSubmit:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Your team name",id:"label.your_team_name.ee128394"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"New Team",autoFocus:!0,isInvalid:(null===n||void 0===n?void 0:n.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===n||void 0===n?void 0:n.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",placeholder:"The Environmentalists",type:"text",value:r.name,onChange:(e,s)=>{const{target:t}=e;a(e,s),l("slug",Rr()(null===t||void 0===t?void 0:t.value,{lower:!0,replacement:"-",strict:!0}))}}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(ds.Kw,{name:"slug",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Your Team Password (optional)",id:"label.your_team_password_optional.bc009a41"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"New Team Password",isInvalid:(null===n||void 0===n?void 0:n.password)&&(null===s||void 0===s?void 0:s.password),isValid:(null===n||void 0===n?void 0:n.password)&&!(null!==s&&void 0!==s&&s.password),name:"password",onChange:a,placeholder:"*******",type:"text",value:r.password}),(0,N.jsx)(ds.Kw,{name:"password",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(ve.A,{onClick:()=>t(0),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsx)(ve.A,{className:"float-end",onClick:i,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create team",id:"label.create_team.284ff194"})})]})}})})}],Br=t(16758);const Pr=e=>{const{className:s,count:a,disabled:t,onChange:i,page:l,page_size:n}=e,r=e=>"function"===typeof i&&!t&&i(e),o=a>0?Math.ceil(a/n):0,d=l>1,c=l<o,h=l>1,u=l<o,m=Math.max(1,l-2),g=Math.min(o,m+5),p=[];for(let x=m;x<=g;x++){let e=x;p.push((0,N.jsx)(Br.A.Item,{active:l===e,onClick:()=>r(e),children:e},e))}return(0,N.jsx)(N.Fragment,{children:!!a&&(0,N.jsxs)(Br.A,{className:s,style:{justifyContent:"center"},children:[(0,N.jsx)(Br.A.First,{disabled:!d,onClick:()=>r(1),children:(0,N.jsx)(ze.X8f,{})}),(0,N.jsx)(Br.A.Prev,{disabled:!h,onClick:()=>r(l-1),children:(0,N.jsx)(ze.ed2,{})}),p,(0,N.jsx)(Br.A.Next,{disabled:!u,onClick:()=>r(l+1),children:(0,N.jsx)(ze.FDZ,{})}),(0,N.jsx)(Br.A.Last,{disabled:!c,onClick:()=>r(o),children:(0,N.jsx)(ze.eaw,{})})]})})};Pr.defaultProps={className:"",count:0,disabled:!1,page:1,page_size:20};var Lr=Pr;const Or=(0,l.forwardRef)((s,a)=>{const t=(0,l.useRef)(),{api:i,getUserOrganizationId:n}=(0,P.nm)(),[r,o]=(0,ne.CQ)({active_tab:"active",assignments:[],count:0,counts:{active:0,completed:0,expired:0},error:null,loading:!0,page:1,page_size:4,sort_direction:"ASC",sort_token:"due_date"}),{active_tab:d,assignments:c,count:h,counts:u,error:m,loading:g,page:p,page_size:x,sort_direction:v,sort_token:f}=r,j=async()=>{const{active_tab:e,page:s,page_size:a,sort_direction:t,sort_token:l}=r,{assignments:d,count:c}=await i.post(`/api/learners/assignments/list/${s}/${a}`,{organization_id:n(),sort_direction:t,sort_token:l,status:e});o({assignments:d,count:c}
2)},_=async()=>{try{if(!n())return;o({error:null,loading:!0}),await j(),o({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}},b=async()=>{try{o({error:null,loading:!0});const{active:e,completed:s}=await(async()=>{const e=n(),s=await i.get("/api/learners/assignments/counts",{organization_id:e});return o({counts:s}),s})();!e&&s&&o({active_tab:"completed"}),await j(),o({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}};(0,l.useImperativeHandle)(a,()=>({active_tab:d,assignments:c,count:h})),(0,l.useEffect)(()=>{b()},[]);const A={active_tab:d,assignments:c,count:h,counts:u,error:m,handleShowTeamSelector:e=>{const s=null===t||void 0===t?void 0:t.current;s&&s.showModal(e)},handleSort:(e,s)=>o({sort_direction:s,sort_token:e},_),isOnTeam:e=>(null===e||void 0===e?void 0:e.team_id)&&(null===e||void 0===e?void 0:e.team_member_id),loading:g,page:p,page_size:x,refreshAssignments:_,sort_direction:v,sort_token:f};return(0,N.jsxs)(Qr,{value:(0,F.A)({},A),children:[(0,N.jsxs)("section",{className:"assignments-widget d-flex flex-column mt-5 "+(g?"loading":""),id:"assignments",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center gap-1",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"})}),(0,N.jsx)(Me.p0,{"aria-label":"refresh assignments",className:"align-self-center",loading:g,onClick:_,size:"sm",title:"Refresh assignments",variant:"link",children:(0,N.jsx)(ze.KP4,{})})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:m,variant:"danger",children:m}),(0,N.jsxs)(aa.A,{activeKey:d,className:"flex-row tabs-primary flex-fill",onSelect:e=>o({active_tab:e,page:1},_),variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{disabled:g,eventKey:"active",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",id:"label.active.92340695"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{disabled:g,eventKey:"completed",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{disabled:g,eventKey:"expired",children:(0,N.jsx)(ke.A,{defaultMessage:"Expired",id:"label.expired.424a2551"})})})]}),(0,N.jsx)(po,{}),(0,N.jsx)(Pr,{className:"m-0",count:h,disabled:g,onChange:e=>o({page:e},_),page:p,page_size:x})]}),(0,N.jsx)(zr,{ref:t})]})});Or.displayName="AssignmentsWidget";var Hr=Or;const Ur=l.createContext({}),Qr=Ur.Provider;Ur.Consumer;Ur.displayName="AssignmentsWidgetContext";const Vr=()=>(0,l.useContext)(Ur),Gr=["children"],Wr=e=>{let{children:s}=e,a=(0,he.A)(e,Gr);return(0,N.jsx)("thead",(0,F.A)((0,F.A)({},a),{},{children:s}))};var Kr=Wr;const Yr=["children","cols","loading"],qr=e=>{const{children:s,cols:a,loading:t}=e,i=(0,he.A)(e,Yr);return(0,N.jsx)("tbody",(0,F.A)((0,F.A)({},i),{},{children:(0,N.jsx)(Ha,{condition:!!a,wrapper:e=>(0,N.jsx)(Me.x_,{loading:t,spinner:(0,N.jsx)(io,{children:(0,N.jsx)(ro,{colSpan:a,children:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center p-3",children:(0,N.jsx)(Me.y$,{})})})}),children:e}),children:s})}))};qr.defaultProps={loading:!1};var Jr=qr;const Xr=["children"],Zr=e=>{let{children:s}=e,a=(0,he.A)(e,Xr);return(0,N.jsx)("tfoot",(0,F.A)((0,F.A)({},a),{},{children:s}))};const $r=["children","className","hiddenBelow","name","sortable"],eo=e=>{const{children:s,className:a,hiddenBelow:t,name:i,sortable:n}=e,r=(0,he.A)(e,$r),{handleSort:o,sort_direction:d,sort_token:c}=go(),h=n?c!==i?ze.MjW:"ASC"===d?ze.XhJ:ze.GOR:l.Fragment,u=oa()(a||void 0,{"d-lg-table-cell":"lg"===t,"d-md-table-cell":"md"===t,"d-none":!!t,"d-sm-table-cell":"sm"===t,"d-xl-table-cell":"xl"===t,"d-xxl-table-cell":"xxl"===t,sortable:n,"text-black":c===i});return(0,N.jsx)("th",(0,F.A)((0,F.A)({className:u,onClick:()=>n&&o(i)},r),{},{children:(0,N.jsxs)(Ce.S,{className:"d-inline-flex align-items-center",children:[(0,N.jsx)("span",{className:n?"me-1":"",children:s}),(0,N.jsx)(h,{})]})}))};eo.defaultProps={sortable:!1};var so=eo;const ao=["children"],to=e=>{let{children:s}=e,a=(0,he.A)(e,ao);return(0,N.jsx)("tr",(0,F.A)((0,F.A)({},a),{},{children:s}))};var io=to;const lo=["children","className","hiddenBelow"],no=e=>{const{children:s,className:a,hiddenBelow:t}=e,i=(0,he.A)(e,lo),l=oa()(a||void 0,{"d-lg-table-cell":"lg"===t,"d-md-table-cell":"md"===t,"d-none":!!t,"d-sm-table-cell":"sm"===t,"d-xl-table-cell":"xl"===t,"d-xxl-table-cell":"xxl"===t});return(0,N.jsx)("td",(0,F.A)((0,F.A)({className:l},i),{},{children:s}))};var ro=no;const oo=["children","className","defaultSortDirection","defaultSortToken","floating","onSort","rounded","textResize"],co=(0,l.forwardRef)((e,s)=>{const{children:a,className:t,defaultSortDirection:i,defaultSortToken:n,floating:r,onSort:o,rounded:d,textResize:c}=e,h=(0,he.A)(e,oo),[u,m,g]=(0,ne.CQ)({sort_direction:i||null,sort_token:n||null}),{sort_direction:p,sort_token:x}=u,v={handleSort:e=>{if(!e||"function"!==typeof o)return;let s="ASC";e===u.sort_token&&"ASC"===u.sort_direction&&(s="DESC"),m({sort_direction:s,sort_token:e},()=>o(e,s))},sort_direction:p,sort_token:x};(0,l.useImperativeHandle)(s,()=>(0,F.A)({},v));const f=oa()({floating:r,"table-rounded":d,"text-resize":c});return(0,N.jsx)(mo,{value:(0,F.A)({},v),children:(0,N.jsx)(qa.A,(0,F.A)((0,F.A)({className:`${f} ${t||""}`},h),{},{children:a}))})});co.Tbody=qr,co.Thead=Wr,co.Tfoot=Zr,co.Th=eo,co.Tr=to,co.Td=no,co.displayName="Table",co.defaultProps={bordered:!1,defaultSortDirection:null,defaultSortToken:null,floating:!1,hover:!0,onSort:Function(),responsive:!1,rounded:!0,striped:!0};var ho=co;const uo=l.createContext({}),mo=uo.Provider;
2uo.Consumer;uo.displayName="TableContext";const go=()=>(0,l.useContext)(uo);var po=e=>{const{active_tab:s,assignments:a,handleSort:t,loading:i,sort_direction:l,sort_token:n}=Vr(),{isBelowBreakpoint:r}=(0,ne.vh)({breakpoint:992});return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ho,{defaultSortDirection:l,defaultSortToken:n,floating:!i,onSort:t,children:[(0,N.jsx)("caption",{children:(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"My assignments, column headers with buttons are sortable.",id:"label.my_assignments_column_headers_with.144904ac"})})}),(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"assignment",style:{width:r?200:350},children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment",id:"label.assignment.153cdaae"})}),"active"===s&&(0,N.jsx)(ho.Th,{hiddenBelow:"lg",name:"progress",children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),"completed"===s&&(0,N.jsx)(ho.Th,{hiddenBelow:"lg",name:"results",children:(0,N.jsx)(ke.A,{defaultMessage:"Results",id:"label.results.219c4a6c"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"group",children:(0,N.jsx)(ke.A,{defaultMessage:"Group",id:"label.group.34ca0e76"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",name:"team",children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})}),"completed"===s?(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"completion_date",children:(0,N.jsx)(ke.A,{defaultMessage:"Completion date",id:"label.completion_date.ea621af1"})}):(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"due_date",children:(0,N.jsx)(ke.A,{defaultMessage:"Due date",id:"label.due_date.e1cb6d30"})}),"active"===s&&(0,N.jsxs)(ho.Th,{hiddenBelow:"lg",children:[(0,N.jsx)("span",{"aria-hidden":"true",children:(0,N.jsx)(ke.A,{defaultMessage:"Est. Duration",id:"label.est_duration.df55da53"})}),(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated duration",id:"label.estimated_duration.f682564b"})})]}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})})]})}),(0,N.jsx)(ho.Tbody,{cols:"active"===s?7:"completed"===s?6:5,loading:i,children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>(0,N.jsx)(qh,{assignment:e,ind:s},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:"active"===s?7:"completed"===s?6:5,children:(0,N.jsx)("span",{className:"d-flex justify-content-center align-items-center text-secondary p-4",children:(0,N.jsx)(ke.A,{defaultMessage:"No {status} assignments found",id:"label.no_status_assignments_found.3693ab9b",values:{status:s}})})})})})]})})},xo=t(59013);const vo=["","Basic","Emerging","Strong","Exemplary"],fo=["","danger","warning","info","success"],jo=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),[i,n,r]=(0,ne.CQ)({certification_template:null,error:null,loading:!1,visible:!1}),{certification_template:o,error:d,loading:c,visible:h}=i,u=async s=>{n({loading:!0,visible:!0});try{const{certification_template:e}=await t.get(`/api/certification-templates/get/${s}`);n({certification_template:e,loading:!1})}catch(e){n({error:(null===e||void 0===e?void 0:e.message)||e,loading:!1})}},m=()=>r();(0,l.useImperativeHandle)(a,()=>({hide:m,show:u}));const g=(null===o||void 0===o?void 0:o.Competencies)||[],p=null===o||void 0===o?void 0:o.CertificationAccreditor;return(0,N.jsxs)(xe,{className:"fancy-modal",onHide:m,show:h,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.Z0L,{size:20}),(0,N.jsx)(ke.A,{defaultMessage:"Certification details",id:"label.certification_details.7f7b9a0d"})]})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(Me.x_,{loading:c,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:!!d,variant:"danger",children:d}),o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3 mb-3",children:[(0,N.jsx)(Me.R_,{roun
2ded:!0,height:60,imageHeight:60,imageWidth:60,src:o.icon_path||xo,width:60}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{className:"mb-1",children:o.title}),p&&(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Issued by {accreditor}",id:"label.issued_by_accreditor.ce573a63",values:{accreditor:p.name}})})]})]}),o.description&&(0,N.jsx)(Ce.S,{className:"mb-4",children:(0,N.jsx)(Rl,{lines:4,children:(0,N.jsx)("p",{className:"text-muted mb-0",children:o.description})})}),g.length>0&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies ({count})",id:"label.competencies_count.0de18e8a",values:{count:g.length}})}),(0,N.jsx)("p",{className:"text-muted small mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"You will be evaluated on the following competencies upon completion:",id:"label.you_will_be_evaluated_on_the_follo.17de705b"})}),(0,N.jsx)(yl.A,{variant:"flush",children:g.map(e=>(0,N.jsxs)(yl.A.Item,{className:"px-0",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center mb-1",children:[(0,N.jsx)("span",{className:"fw-semibold",style:{fontSize:"0.85rem"},children:e.name}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Scored 1-4",id:"label.scored_1_4.be6b8ea0"})})]}),(0,N.jsx)(Sa.A,{style:{height:4},children:vo.slice(1).map((e,s)=>(0,N.jsx)(Sa.A,{now:25,style:{opacity:.3+.23*s},variant:fo[s+1]},e))}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between mt-1",children:vo.slice(1).map(e=>(0,N.jsx)("small",{className:"text-muted",style:{fontSize:"0.65rem"},children:e},e))})]},e.id))})]}),(0,N.jsx)("small",{className:"text-muted d-block mt-3",style:{fontStyle:"italic"},children:(0,N.jsx)(ke.A,{defaultMessage:"Complete the challenge and request certification to be evaluated. Submission does not guarantee certification.",id:"label.complete_the_challenge_and_request.d4963e2e"})})]})]})})]})});jo.displayName="CertificationInfoModal";var _o=jo,bo=t(59190);var Ao=e=>{let{certification_template_id:s}=e;const a=(0,l.useRef)();if(!s)return null;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(bo.A,{pill:!0,bg:"info",className:"d-inline-flex align-items-center gap-1 ms-2",onClick:e=>{var t;e.preventDefault(),e.stopPropagation(),null===(t=a.current)||void 0===t||t.show(s)},role:"button",style:{cursor:"pointer",fontSize:"0.7rem",fontWeight:600},children:[(0,N.jsx)(ze.Z0L,{size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})]}),(0,N.jsx)(_o,{ref:a})]})};var yo=e=>{const{audiences:s,useContextHook:a}=e,{formatMessage:t}=(0,ja.A)(),{hasSelections:i,isFilterSelected:l,toggleFilterSelection:n}=a(),{isBelowBreakpoint:r}=(0,ne.vh)({breakpoint:576}),o=r?(0,N.jsx)(ze.YXz,{className:"mx-auto",size:24}):(0,N.jsx)("span",{className:"mx-auto",children:t({id:"label.audience.545c0235",defaultMessage:"Audience"})});return(0,N.jsx)(td,{has_selections:i("audience"),label:o,children:(()=>{let e=null;return(0,N.jsx)(N.Fragment,{children:s&&s.sort((e,s)=>(e=e.category)<(s=s.category)?-1:e>s?1:0).map(s=>{const a=l("audience",s.id),t=null===s||void 0===s?void 0:s.audience_category,i=e!=s.category;return e=s.category,(0,N.jsxs)(N.Fragment,{children:[i&&(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)("b",{style:{whiteSpace:"nowrap"},children:null===t||void 0===t?void 0:t.name})}),(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center text-primary",onClick:()=>{return e=s.id,n("audience",e);var e},children:[(0,N.jsx)(_e.A.Check,{checked:a,className:"ps-0 pe-2",id:"ownerFilter",type:"checkbox"}),a?(0,N.jsx)("b",{children:null===s||void 0===s?void 0:s.name}):null===s||void 0===s?void 0:s.name]})]})})})})()})};var wo=e=>{const{useContextHook:s}=e,{formatMessage:a}=(0,ja.A)(),{duration_options:t,est_time_max:i,est_time_min:l,hasSelections:n,selectDuration:r}=s(),{isBelowBreakpoint:o}=(0,ne.vh)({breakpoint:576}),d=(e,s)=>r(e,s),c=o?(0,N.jsx)(ze.w_X,{className:"mx-auto",size:24}):(0,N.jsx)("span",{className:"mx-auto",children:((e,s)=>{let a=t.find(a=>(null===a||void 0===a?void 0:a.min)==e&&(null===a||void 0===a?void 0:a.max)==s);return null===a||void 0===a?void 0:a.name})(l,i)||a({id:"label.duration.4fc52a3c",defaultMessage:"Duration"})});return(0,N.jsxs)(td,{class_name:"component-duration-filter",has_selections:n("duration"),label:c,children:[(0,N.jsx)(yl.A.Item,{className:"d-flex",onClick:()=>d(null),children:(0,N.jsx)(ke.A,{defaultMessage:"Any duration",id:"label.any_duration.d991235a"})}),(0,N.jsx)("hr",{className:"mx-auto"}),!(null===t||void 0===t||!t.length)&&t.map((e,s)=>(0,N.jsx)(yl.A.Item,{className:"d-flex",onClick:()=>d(null===e||void 0===e?void 0:e.min,null===e||void 0===e?void 0:e.max),children:null===e||void 0===e?void 0:e.name},s))]})};var No=e=>{const{subjects:s,useContextHook:a}=e,{formatMessage:t}=(0,ja.A)(),{hasSelections:i,isFilterSelected:l,toggleFilterSelection:n}=a(),{isBelowBreakpoint:r}=(0,ne.vh)({breakpoint:576}),o=r?(0,N.jsx)(ze.vd0,{className:"mx-auto",size:24}):(0,N.jsx)("span",{className:"mx-auto",children:t({id:"label.subject.68971283",defaultMessage:"Subject"})});return(0,N.jsx)(td,{has_selections:i("subject"),label:o,children:(0,N.jsx)(N.Fragment,{children:s.map(e=>{const s=l("subject",e.id);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center text-primary",onClick:()=>{return s=e.id,n("subject",s);var s},children:[(0,N.jsx)(_e.A.Check,{checked:s,className:"ps-0 pe-2",id:"subjectFilter",type:"checkbox"}),s?(0,N.jsx)("b",{children:null===e||void 0===e?void 0:e.name}):null===e||void 0===e?void 0:e.name]})})})})})};var So=e=>{const{global_count:s,type:a,useContextHook:t}=e,[i,l]=(0,ne.CQ)({selected_organization:null}),{formatMessage:n}=(0,ja.A)(),{hasSelections:r,organizations:o,selected_organization_id:d,toggleFilterSelection:c}=t(),{isBelowBreakpoint:h}=(0,ne.vh)({breakpoint:576}),u=e=>{c("owner",null===e||void 0===e?void 0:e.id),l({selected_organization:e})},{selected_organization:m}=i,g=e=>{switch(a){case"cartridge":return(null===e||void 0===e?void 0:e.cartridge_count)||0;case"challenge":return(null===e||void 0===e?void 0:e.challenge_count)||0;case"journey":return(null===e||void 0===e?void 0:e.journey_count)||0}},p=m&&!h?(0,N.jsx)(Fl,{className:"mx-auto",maxWidth:120,children:null===m||void 0===m?void 0:m.name}):h?(0,N.jsx)(ze.VkW,{className:"mx-auto",size:24}):(0,N.jsx)("span",{className:"mx-auto",children:n({id:"label.owner.4b1b8aa3",defaultMessage:"Owner"})});return(0,N.jsxs)(td,{class_name:"component-owner-filter",has_selections:r("owner"),label:p,children:[(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center justify-content-between",onClick:()=>u(null),children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Any owner",id:"label.any_owner.e121484a"})}),(0,N.jsxs)("span",{children:["(",s,")"]})]}),(0,N.jsx)("hr",{className:"mx-auto"}),!(null===o||void 0===o||!o.length)&&o.map((e,s)=>(0,N.jsxs)(yl.A.Item,{active:d===(null===e||void 0===e?void 0:e.id),className:"d-flex align-items-center mw-100 justify-content-between",onClick:()=>u(e),children:[(0,N.jsx)(Fl,{as:"span",inline:!0,maxWidth:`calc(100% - ${`${g(e)}`.length}em`,placement:"bottom",children:null===e||void 0===e?void 0:e.name}),(0,N.jsxs)("span",{children:["(",g(e),")"]})]},s))]})};
2var Co=(0,l.forwardRef)((e,s)=>{const{onRemove:a,size:t,tag:i}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ua.A,{delay:{hide:400,show:250},overlay:e=>((e,s)=>{var a;return(0,N.jsxs)(Qa.A,(0,F.A)((0,F.A)({},e),{},{children:[(0,N.jsx)(Ce.S,{className:"font-weight-bold",children:null===s||void 0===s?void 0:s.name}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)("small",{children:null===s||void 0===s||null===(a=s.tag_set)||void 0===a?void 0:a.name})})]}))})(e,i),placement:"right",children:(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:`me-2 ${(null===e||void 0===e?void 0:e.className)||""}`,size:t,text:"dark",children:[null===i||void 0===i?void 0:i.name,a&&(0,N.jsx)(ve.A,{className:"ms-2 p-0 text-dark",onClick:()=>{"function"==typeof a&&a()},variant:"link",children:(0,N.jsx)(ze.QCr,{size:10})})]})})})});const Mo=(0,l.forwardRef)((e,s)=>{const{hideApplied:a,multi:t,onBulkSelect:i,onSelect:r,organization_id:o,placement:d,target:c,zIndex:h}=e,{api:u}=(0,n.nm)(),[m,g,p]=(0,ne.CQ)({error:null,loading:!1,selected_tag_set:null,show:!1,tag_sets:null,user_selections:[]}),{error:x,loading:v,selected_tag_set:f,show:j,tag_sets:_,user_selections:b}=m,A=()=>{t&&"function"==typeof i&&i(b||[]),p()},y=e=>{if(t){b.find(s=>s.id==e.id)?w(e):g(s=>(s.user_selections.push(e),s))}else"function"==typeof r&&r(e),A()},w=e=>{let s=b.findIndex(s=>s.id==e.id);s>-1&&g(e=>(e.user_selections.splice(s,1),e))},S=async()=>{try{g(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0}));const{tag_sets:e}=await u.get("/api/organizations/tags/"+(a?"eligible":"all"),{organization_id:o});g({loading:!1,tag_sets:e})}catch({err:err}){g(s=>(0,F.A)((0,F.A)({},s),{},{error:err,loading:!1}))}},C=e=>g({selected_tag_set:e});(0,l.useImperativeHandle)(s,()=>({hide:()=>A(),show:s=>(g({show:!0,user_selections:(null===e||void 0===e?void 0:e.selectedTags)||[]}),void S())}));const M={marginTop:7.5,maxWidth:"100vw",width:350};return h&&(M.zIndex=h),(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bi.A,{containerPadding:20,onHide:A,placement:d,rootClose:!0,show:j,target:c,children:(0,N.jsx)(Ge.A,{style:M,children:(0,N.jsxs)(Me.x_,{loading:v,spinner:(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{size:10})}),children:[(0,N.jsx)(We.A,{dismissible:!0,onHide:()=>g({error:null}),show:x,variant:"danger",children:x}),f?(0,N.jsx)(Ce.S,{children:(0,N.jsx)(zo,{isTagSelected:e=>!!b.find(s=>s.id==e.id),onBack:()=>C(null),onSelectTag:y,tag_set:f})}):(0,N.jsx)(ko,{onSelectTag:y,onSelectTagSet:C,tag_sets:_,children:(0,N.jsx)(N.Fragment,{children:t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("hr",{className:"m-0"}),(0,N.jsx)(Ce.S,{className:"p-2",children:null!==b&&void 0!==b&&b.length?(0,N.jsx)(Ce.S,{children:b.map(e=>(0,N.jsx)(Co,{onRemove:()=>w(e),tag:e}))}):(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"No selections",id:"label.no_selections.7b94464d"})})})}),(0,N.jsx)("hr",{className:"m-0"})]})})})]})})})})}),ko=(0,l.forwardRef)((e,s)=>{const{onSelectTag:a,onSelectTagSet:t,tag_sets:i}=e,[l,n,r]=(0,ne.CQ)({search:""}),{search:o}=l;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"p-2",children:(0,N.jsxs)(Ei.A,{className:"search-field",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search tags",value:o,onChange:e=>{var s;n({search:null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value})}})]})}),e.children,(0,N.jsxs)(Ce.S,{style:{maxHeight:400,overflowY:"scroll"},children:[!o&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(yl.A,{className:"list-group-borderless",style:{border:0},children:!(null===i||void 0===i||!i.length)&&i.map(e=>{const{name:s,tag_count:a}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(yl.A.Item,{action:!0,onClick:()=>{"function"==typeof t&&t(e)},children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsxs)(Ce.S,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[(0,N.jsx)("b",{children:s}),(0,N.jsx)("br",{}),(0,N.jsxs)("small",{className:"text-secondary",children:[a," ",(0,N.jsx)(ke.A,{defaultMessage:"tags",id:"label.tags.978c2f89"})]})]}),(0,N.jsx)(Ce.S,{className:"ps-3",children:(0,N.jsx)(ze.ZPM,{})})]})})})})})}),o&&(0,N.jsx)(N.Fragment,{children:(()=>{let e=(e=>{let s=[];for(let a of i){let{tags:t}=a;for(let i of t){let{name:t}=i,l=t.toUpperCase(),n=e.toUpperCase();-1!==l.indexOf(n)&&s.push({tag:i,tag_set:a,title:(0,N.jsx)("span",{dangerouslySetInnerHTML:{__html:t.replace(new RegExp(e,"ig"),"<b>$&</b>")}})})}}return s})(o);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(yl.A,{className:"list-group-borderless",style:{border:0},children:[e.map(e=>{let{tag:s,tag_set:t,title:i}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(yl.A.Item,{action:!0,onClick:()=>{"function"==typeof a&&a(s)},children:(0,N.jsxs)(Ce.S,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[i,(0,N.jsx)("br",{}),(0,N.jsx)("small",{className:"text-secondary",children:null===t||void 0===t?void 0:t.name})]})})})}),(!e||!(null!==e&&void 0!==e&&e.length))&&(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})})]})})})()})]})]})}),zo=(0,l.forwardRef)((e,s)=>{const{isTagSelected:a,onBack:t,onSelectTag:i,tag_set:l}=e,{tags:n}=l;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"p-2",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ve.A,{style:{borderRadius:"50%",height:35,position:"relative",width:35},variant:"secondary",onClick:()=>{"function"==typeof t&&t()},children:(0,N.jsx)(ze.QVr,{className:"absolute-transform-middle",size:15})})}),(0,N.jsx)("h5",{className:"mt-2",children:null===l||void 0===l?void 0:l.name})]}),(0,N.jsx)("hr",{className:"m-1"}),(0,N.jsx)(Ce.S,{style:{maxHeight:400,overflowY:"scroll"},children:(0,N.jsxs)(yl.A,{className:"list-group-borderless",children:[n&&n.map((e,s)=>(0,N.jsx)(yl.A.Item,{action:!0,active:a(e),onClick:()=>{"function"==typeof i&&i(e)},children:null===e||void 0===e?void 0:e.name},s)),(!n||!(null!==n&&void 0!==n&&n.length))&&(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})})]})})]})});Mo.displayName="TagPickerPopover",Mo.defaultProps={hideApplied:!1,multi:!1,organization_id:null,placement:"bottom-end",selectedTags:[]};var To=Mo;var Io={Audience:yo,Duration:wo,Owner:So,Subject:No,Tag:e=>{var s;const{useContextHook:a}=e,{hasSelections:t,setSelectedOptions:i}=a(),{getUserOrganizationId:r}=(0,n.nm)(),[o,d]=(0,ne.CQ)({selected_tags:[]}),{selected_tags:c}=o,h=(0,l.createRef)(),u=(0,l.createRef)(),m=t("tag");let g=c.length;return(0,N.jsxs)("div",{children:[(0,N.jsxs)(ve.A,{className:"component-search-filter",has_selections:m,ref:h,variant:m?"primary":"secondary",onClick:()=>{u.current.show()},children:[(0==g||g>1)&&(0,N.jsx)(ke.A,{defaultMessage:"Tagged with",id:"label.tagged_with.2be0d00d"}),g>1&&` (${g})`,1==g&&` ${null===c||void 0===c||null===(s=c[0])||void 0===s?void 0:s.name}`," \xa0",(0,N.jsx)(ze.z44,{})]}),(0,N.jsx)(To,{multi:!0,organization_id:r(),ref:u,selectedTags:c,target:h,zIndex:1100,onBulkSelect:e=>{d({selected_tags:e}),i("tag",e.map(e=>null===e||void 0===e?void 0:e.id))}})]})}};const Eo=e=>{const{default_audience_slugs:s=[],include_unpublished:a=0,selected_organization_id:t}=e,{api:i,getUserOrganization:n,getUserOrganizationId:r}=(0,P.nm)(),{attemptSearch:o,changeSearchFilters:d,changeSearchTerm:c,context_org_id:h,getFilterDisplay:u,search_term:m}=Qo(),[g,p,x]=(0,ne.CQ)({audiences:[],error:null,est_time_max:"",est_time_min:"",global_cartridges_count:0,organizations:[],selected_audience_ids:[],selected_organization_id:null,
2selected_subject_ids:[],selected_tag_ids:[],sort_token:"title",subjects:[]}),v=()=>p(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),f=async()=>{try{let e=n(),a=[];const{audiences:t}=await i.get("/api/marketplace/list/audiences/",{organization_id:null===e||void 0===e?void 0:e.id});s&&s.length?(a=s.reduce((e,s)=>{let a=t.find(e=>(null===e||void 0===e?void 0:e.slug)==s);return a&&e.push(null===a||void 0===a?void 0:a.id),e},[]),p({audiences:t,selected_audience_ids:a})):p({audiences:t})}catch({err:err}){p({error:err})}},j=async()=>{try{const{subjects:e}=await i.get("/api/subjects/list");p({subjects:e})}catch({err:err}){p({error:err})}},_=async()=>{try{const e=r()||h,{count:s}=await i.get("/api/cartridge-templates/count/global-stubs",{organization_id:e});p({global_cartridges_count:s})}catch({err:err}){p(s=>(0,F.A)((0,F.A)({},s),{},{error:err}))}},b=async()=>{try{const e=r()||h,{organizations:s}=await i.get("/api/organizations/ids-name",{include_unpublished:a,organization_id:e});p({organizations:s})}catch({err:err}){p({error:err})}},A=e=>{p(s=>(0,F.A)((0,F.A)({},s),{},{sort_token:e}),e=>{d(y(e)),o(1)})},y=e=>({est_time_max:null===e||void 0===e?void 0:e.est_time_max,est_time_min:null===e||void 0===e?void 0:e.est_time_min,selected_audience_ids:null===e||void 0===e?void 0:e.selected_audience_ids,selected_organization_id:null===e||void 0===e?void 0:e.selected_organization_id,selected_subject_ids:null===e||void 0===e?void 0:e.selected_subject_ids,selected_tag_ids:null===e||void 0===e?void 0:e.selected_tag_ids,sort_token:null===e||void 0===e?void 0:e.sort_token}),w=async e=>{c((null===e||void 0===e?void 0:e.search_term)||""),await o(1)};(0,l.useEffect)(()=>((async()=>{await(async()=>{p(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0})),await Promise.all([b(),_(),j(),f()]),p(e=>(0,F.A)((0,F.A)({},e),{},{loading:!1}))})(),await(async()=>{const e=y(g);d(e),await o()})()})(),x),[]);const{audiences:S,est_time_max:C,est_time_min:M,global_cartridges_count:k,loading:z,organizations:I,solvably_cartridge_count:E,sort_token:R,subjects:D}=g,B={search_term:m};return(0,N.jsx)(Go,{value:{clearError:v,duration_options:[{max:59,min:0,name:"< 1 hour"},{max:120,min:60,name:"1-2 hours"},{max:180,min:120,name:"2-3 hours"},{max:null,min:180,name:"3+ hours"}],est_time_max:C,est_time_min:M,getSelectedOptions:e=>(null===g||void 0===g?void 0:g[`selected_${e}_ids`])||[],global_cartridges_count:k,handleSubmit:w,hasSelections:e=>{var s;switch(e){case"owner":return null===g||void 0===g?void 0:g.selected_organization_id;case"duration":return(null===g||void 0===g?void 0:g.est_time_min)||(null===g||void 0===g?void 0:g.est_time_max);case"tag":case"subject":case"audience":return!(null===g||void 0===g||null===(s=g[`selected_${e}_ids`])||void 0===s||!s.length)}},isFilterSelected:(e,s)=>{var a,t;switch(e){case"owner":return(null===g||void 0===g?void 0:g.selected_organization_id)===s;case"tag":case"subject":case"audience":return!(null===g||void 0===g||null===(a=g[`selected_${e}_ids`])||void 0===a||null===(t=a.includes)||void 0===t||!t.call(a,s))}},loading:z,organizations:I,selectDuration:(e,s)=>{p(a=>(0,F.A)((0,F.A)({},a),{},{est_time_max:s,est_time_min:e}),e=>{d(y(e)),o(1)})},selected_organization_id:t,setSelectedOptions:(e,s)=>p(a=>(a[`selected_${e}_ids`]=s,a),e=>{d(y(e)),o(1)}),solvably_cartridge_count:E,toggleFilterSelection:(e,s)=>{if("owner"===e)p(e=>(0,F.A)((0,F.A)({},e),{},{selected_organization_id:s}),e=>{d(y(e)),o(1)});else{const a=`selected_${e}_ids`;let t=(0,T.clone)(null===g||void 0===g?void 0:g[a]);t=t.includes(s)?t.filter(e=>e!==s):[...t,s],p(e=>(0,F.A)((0,F.A)({},e),{},{[a]:t}),e=>{d(y(e)),o(1)})}}},children:(0,N.jsxs)(Ce.S,{className:"component-search-bar cartridge-template-search "+(null!==e&&void 0!==e&&e.hidden?"d-none":"d-block"),id:"cartridgeTemplateSearch",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:v,show:g.error,variant:"danger",children:g.error}),(0,N.jsx)(ds.l1,{initialValues:B,onSubmit:w,role:"search",children:e=>{let{handleChange:s,handleSubmit:a,values:t}=e;return(0,N.jsxs)(_e.A,{className:"row d-flex align-items-center flex-column flex-lg-row gap-2 gap-lg-0",onSubmit:a,children:[(0,N.jsx)(Ve.A,{className:"search-input-col",lg:4,xs:12,children:(0,N.jsx)(ed,{disabled:z,handleChange:s,loading:z,type:"cartridge",value:t.search_term})}),(0,N.jsxs)(Ve.A,{className:"ps-0 d-flex gap-2 filters-wrapper",lg:8,xs:12,children:[(0,N.jsx)(Io.Duration,{type:"cartridge",useContextHook:Wo}),(0,N.jsx)(Io.Owner,{global_count:k,type:"cartridge",useContextHook:Wo}),(0,N.jsx)(Io.Audience,{audiences:S,useContextHook:Wo}),(0,N.jsx)(Io.Subject,{subjects:D,useContextHook:Wo})]})]})}}),"function"===typeof u&&(0,N.jsxs)(li.A,{className:"mt-2 sort-filter-dropdown",children:[(0,N.jsxs)(li.A.Toggle,{variant:"quaternary",children:[(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Sort by",id:"label.sort_by.c9129025"})})," ",u(R)]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:()=>A("updated_at"),children:(0,N.jsx)(ke.A,{defaultMessage:"Last updated",id:"label.last_updated.382ac5f3"})}),(0,N.jsx)(li.A.Item,{onClick:()=>A("title"),children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})})]})]})]})})};Eo.defaultProps={noPadding:!1,size:"lg"};var Fo=Eo;const Ro=s=>{const{default_audience_slugs:a=[],include_unpublished:t=0,selected_organization_id:i}=s,{api:n,getUserOrganization:r,getUserOrganizationId:o}=(0,P.nm)(),{attemptSearch:d,changeSearchFilters:c,changeSearchTerm:h,context_org_id:u,getFilterDisplay:m,search_term:g}=Qo(),[p,x,v]=(0,ne.CQ)({audiences:[],error:null,est_time_max:"",est_time_min:"",global_challenges_count:0,organizations:[],selected_audience_ids:[],selected_organization_id:null,
2selected_subject_ids:[],selected_tag_ids:[],sort_token:"title",subjects:[]}),f=()=>x({error:null}),j=async()=>{try{let e=r(),s=[];const{audiences:t}=await n.get("/api/marketplace/list/audiences/",{organization_id:null===e||void 0===e?void 0:e.id});a&&a.length?(s=a.reduce((e,s)=>{let a=t.find(e=>(null===e||void 0===e?void 0:e.slug)==s);return a&&e.push(null===a||void 0===a?void 0:a.id),e},[]),x({audiences:t,selected_audience_ids:s})):x({audiences:t})}catch({err:err}){x({error:err})}},_=async()=>{try{const{subjects:e}=await n.get("/api/subjects/list");x({subjects:e})}catch({err:err}){x({error:err})}},b=async()=>{try{const e=o()||u,{count:s}=await n.get("/api/challenge-templates/count/global-stubs",{organization_id:e});x({global_challenges_count:s})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;x({error:a})}},A=async()=>{try{const e=o()||u,{organizations:s}=await n.get("/api/organizations/ids-name",{include_unpublished:t,organization_id:e});x({organizations:s})}catch({err:err}){x({error:err})}},y=e=>{x({sort_token:e},e=>{c(w(e)),d(1)})},w=e=>({est_time_max:null===e||void 0===e?void 0:e.est_time_max,est_time_min:null===e||void 0===e?void 0:e.est_time_min,selected_audience_ids:null===e||void 0===e?void 0:e.selected_audience_ids,selected_organization_id:null===e||void 0===e?void 0:e.selected_organization_id,selected_subject_ids:null===e||void 0===e?void 0:e.selected_subject_ids,selected_tag_ids:null===e||void 0===e?void 0:e.selected_tag_ids,sort_token:null===e||void 0===e?void 0:e.sort_token}),S=async e=>{console.log(e),h((null===e||void 0===e?void 0:e.search_term)||""),await d(1)};(0,l.useEffect)(()=>((async()=>{await(async()=>{x({loading:!0}),await Promise.all([A(),_(),j(),b()]),x({loading:!1})})(),await(async()=>{const e=w(p);c(e),await d(1)})()})(),v),[]);const{audiences:C,est_time_max:M,est_time_min:k,global_challenges_count:z,loading:I,organizations:E,selected_audience_ids:R,selected_subject_ids:D,solvably_challenge_count:B,sort_token:L,subjects:O}=p,H={search_term:g};return(0,N.jsx)(Yo,{value:{clearError:f,duration_options:[{max:59,min:0,name:"< 1 hour"},{max:120,min:60,name:"1-2 hours"},{max:180,min:120,name:"2-3 hours"},{min:180,name:"3+ hours"}],est_time_max:M,est_time_min:k,getSelectedOptions:e=>(null===p||void 0===p?void 0:p[`selected_${e}_ids`])||[],global_challenges_count:z,handleSubmit:S,hasSelections:e=>{var s;switch(e){case"owner":return null===p||void 0===p?void 0:p.selected_organization_id;case"duration":return(null===p||void 0===p?void 0:p.est_time_min)||(null===p||void 0===p?void 0:p.est_time_max);case"audience":case"subject":case"tag":return!(null===p||void 0===p||null===(s=p[`selected_${e}_ids`])||void 0===s||!s.length)}},isFilterSelected:(e,s)=>{var a,t;switch(e){case"owner":return(null===p||void 0===p?void 0:p.selected_organization_id)===s;
2case"audience":case"subject":case"tag":return!(null===p||void 0===p||null===(a=p[`selected_${e}_ids`])||void 0===a||null===(t=a.includes)||void 0===t||!t.call(a,s))}},loading:I,organizations:E,selectDuration:(e,s)=>{x({est_time_max:s,est_time_min:e},e=>{c(w(e)),d(1)})},selected_audience_ids:R,selected_organization_id:i,selected_subject_ids:D,setSelectedOptions:(e,s)=>x(a=>(a[`selected_${e}_ids`]=s,a),e=>{c(w(e)),d(1)}),solvably_challenge_count:B,toggleFilterSelection:(e,s)=>{if("owner"===e)x({selected_organization_id:s},e=>{c(w(e)),d(1)});else{const a=`selected_${e}_ids`;let t=(0,T.clone)(null===p||void 0===p?void 0:p[a]);t=t.includes(s)?t.filter(e=>e!==s):[...t,s],x(e=>(0,F.A)((0,F.A)({},e),{},{[a]:t}),e=>{c(w(e)),d(1)})}}},children:(0,N.jsxs)(Ce.S,{className:"component-search-bar challenge-template-search "+(null!==s&&void 0!==s&&s.hidden?"d-none":"d-block"),id:"challengeTemplateSearch",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:f,show:p.error,variant:"danger",children:p.error}),(0,N.jsx)(ds.l1,{initialValues:H,onSubmit:S,role:"search",children:e=>{let{handleChange:s,handleSubmit:a,values:t}=e;return(0,N.jsxs)(_e.A,{className:"row d-flex align-items-center flex-column flex-lg-row gap-2 gap-lg-0",onSubmit:a,children:[(0,N.jsx)(Ve.A,{className:"search-input-col",lg:4,xs:12,children:(0,N.jsx)(ed,{disabled:I,handleChange:s,loading:I,type:"challenge",value:t.search_term})}),(0,N.jsxs)(Ve.A,{className:"ps-0 d-flex gap-2 filters-wrapper",lg:8,xs:12,children:[(0,N.jsx)(Io.Duration,{type:"challenge",useContextHook:qo}),(0,N.jsx)(Io.Owner,{global_count:z,type:"challenge",useContextHook:qo}),(0,N.jsx)(Io.Audience,{audiences:C,useContextHook:qo}),(0,N.jsx)(Io.Subject,{subjects:O,useContextHook:qo})]})]})}}),"function"===typeof m&&(0,N.jsxs)(li.A,{className:"mt-2 sort-filter-dropdown",children:[(0,N.jsxs)(li.A.Toggle,{className:"d-flex align-items-center gap-1",variant:"quaternary",children:[(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Sort by",id:"label.sort_by.c9129025"})}),m(L)]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:()=>y("updated_at"),children:(0,N.jsx)(ke.A,{defaultMessage:"Last updated",id:"label.last_updated.382ac5f3"})}),(0,N.jsx)(li.A.Item,{onClick:()=>y("title"),children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})})]})]})]})})};Ro.defaultProps={noPadding:!1,size:"lg"};var Do=Ro;const Bo=s=>{const{api:a,getUserOrganization:t,getUserOrganizationId:i}=(0,P.nm)(),{attemptSearch:n,changeSearchFilters:r,changeSearchTerm:o,context_org_id:d,getFilterDisplay:c,search_term:h}=Qo(),{default_audience_slugs:u=[],include_unpublished:m=0}=s,[g,p,x]=(0,ne.CQ)({audiences:[],error:null,est_time_max:"",est_time_min:"",global_journeys_count:0,organizations:[],selected_audience_ids:[],selected_organization_id:null,selected_subject_ids:[],selected_tag_ids:[],sort_direction:"ASC",sort_token:"title",subjects:[]}),v=()=>p(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),f=async()=>{try{let e=t(),s=[];const{audiences:i}
2=await a.get("/api/marketplace/list/audiences/",{organization_id:null===e||void 0===e?void 0:e.id});u&&u.length?(s=u.reduce((e,s)=>{let a=i.find(e=>(null===e||void 0===e?void 0:e.slug)==s);return a&&e.push(null===a||void 0===a?void 0:a.id),e},[]),p({audiences:i,selected_audience_ids:s})):p({audiences:i})}catch({err:err}){p({error:err})}},j=async()=>{try{const{subjects:e}=await a.get("/api/subjects/list");p({subjects:e})}catch({err:err}){p({error:err})}},_=e=>{p(s=>(0,F.A)((0,F.A)({},s),{},{sort_token:e}),e=>{r(b(e)),n(1)})},b=e=>({est_time_max:null===e||void 0===e?void 0:e.est_time_max,est_time_min:null===e||void 0===e?void 0:e.est_time_min,selected_audience_ids:null===e||void 0===e?void 0:e.selected_audience_ids,selected_organization_id:null===e||void 0===e?void 0:e.selected_organization_id,selected_subject_ids:null===e||void 0===e?void 0:e.selected_subject_ids,selected_tag_ids:null===e||void 0===e?void 0:e.selected_tag_ids,sort_token:null===e||void 0===e?void 0:e.sort_token}),A=async()=>{try{const{count:e}=await a.get("/api/group-assignment-templates/count/global-stubs",{organization_id:i()||d||g.selected_organization_id||null});p({global_journeys_count:e})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;p({error:a})}},y=async()=>{try{const e=i()||d,{organizations:s}=await a.get("/api/organizations/ids-name",{include_unpublished:m,organization_id:e});p({organizations:s})}catch({err:err}){p({error:err})}};(0,l.useEffect)(()=>((async()=>{await(async()=>{p(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0})),await Promise.all([A(),j(),f(),y()]),p(e=>(0,F.A)((0,F.A)({},e),{},{loading:!1}))})(),await(async()=>{const{selected_organization_id:e,sort_direction:s,sort_token:a}=g;r({selected_organization_id:e,sort_direction:s,sort_token:a}),await n()})()})(),x),[]);const{audiences:w,est_time_max:S,est_time_min:C,global_journeys_count:M,loading:k,organizations:z,sort_token:I,subjects:E}=g,R={search_term:h};return(0,N.jsx)(Xo,{value:{clearError:v,duration_options:[{max:59,min:0,name:"< 1 hours"},{max:120,min:60,name:"1-2 hours"},{max:180,min:120,name:"2-3 hours"},{max:300,min:180,name:"3-5 hours"},{max:420,min:300,name:"5-7 hours"},{max:600,min:420,name:"7-10 hours"},{max:600,min:600,name:"10 hours"}],est_time_max:S,est_time_min:C,getSelectedOptions:e=>(null===g||void 0===g?void 0:g[`selected_${e}_ids`])||[],global_journeys_count:M,handleSubmit:async e=>{o((null===e||void 0===e?void 0:e.search_term)||""),r(b()),await n(1)},hasSelections:e=>{var s;switch(e){case"owner":return(null===g||void 0===g?void 0:g.selected_organization_id)||null===g.selected_organization_id;case"duration":return(null===g||void 0===g?void 0:g.est_time_min)||null===g.est_time_min;
2case"audience":case"subject":case"tag":return!(null===g||void 0===g||null===(s=g[`selected_${e}_ids`])||void 0===s||!s.length)}},isFilterSelected:(e,s)=>{var a,t;return"owner"===e?(null===g||void 0===g?void 0:g.selected_organization_id)===s:!(null===g||void 0===g||null===(a=g[`selected_${e}_ids`])||void 0===a||null===(t=a.includes)||void 0===t||!t.call(a,s))},loading:k,organizations:z,selectDuration:(e,s)=>{p(a=>(0,F.A)((0,F.A)({},a),{},{est_time_max:s,est_time_min:e}),e=>{r(b(e)),n(1)})},setSelectedOptions:(e,s)=>p(a=>(a[`selected_${e}_ids`]=s,a),e=>{r(b(e)),n(1)}),sort_token:I,toggleFilterSelection:(e,s)=>{if("owner"===e)p(e=>(0,F.A)((0,F.A)({},e),{},{selected_organization_id:s}),e=>{r(b(e)),n(1)});else{const a=`selected_${e}_ids`;let t=(0,T.clone)(null===g||void 0===g?void 0:g[a]);t=t.includes(s)?t.filter(e=>e!==s):[...t,s],p(e=>(0,F.A)((0,F.A)({},e),{},{[a]:t}),e=>{r(b(e)),n(1)})}}},children:(0,N.jsxs)(Ce.S,{className:"component-search-bar journey-template-search "+(null!==s&&void 0!==s&&s.hidden?"d-none":"d-block"),id:"journeyTemplateSearch",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:v,show:g.error,variant:"danger",children:g.error}),(0,N.jsx)(ds.l1,{initialValues:R,onSubmit:async(e,s)=>{p(s=>(0,F.A)((0,F.A)({},s),e),()=>{r(e),n(1)})},role:"search",children:e=>{let{handleChange:s,handleSubmit:a,values:t}=e;return(0,N.jsxs)(_e.A,{className:"row d-flex align-items-center flex-column flex-lg-row gap-2 gap-lg-0",onSubmit:a,children:[(0,N.jsx)(Ve.A,{className:"search-input-col",lg:4,xs:12,children:(0,N.jsx)(ed,{disabled:k,handleChange:s,loading:k,type:"journey",value:t.search_term})}),(0,N.jsxs)(Ve.A,{className:"ps-0 d-flex gap-2 filters-wrapper",lg:8,xs:12,children:[(0,N.jsx)(Io.Duration,{type:"journey",useContextHook:Zo}),(0,N.jsx)(Io.Owner,{global_count:M,type:"journey",useContextHook:Zo}),(0,N.jsx)(Io.Audience,{audiences:w,useContextHook:Zo}),(0,N.jsx)(Io.Subject,{subjects:E,useContextHook:Zo})]})]})}}),"function"==typeof c&&(0,N.jsxs)(li.A,{className:"mt-2 sort-filter-dropdown",children:[(0,N.jsxs)(li.A.Toggle,{variant:"quaternary",children:[(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Sort by",description:"",id:"label.sort_by.c9129025"})})," ",c(I)]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:()=>{_("updated_at")},children:(0,N.jsx)(ke.A,{defaultMessage:"Last updated",description:"",id:"label.last_updated.382ac5f3"})}),(0,N.jsx)(li.A.Item,{onClick:()=>{_("title")},children:(0,N.jsx)(ke.A,{defaultMessage:"Title",description:"",id:"label.title.7e8cd205"})})]})]})]})})};Bo.defaultProps={noPadding:!1};var Po=Bo;const Lo=(0,l.forwardRef)((s,a)=>{const{components:t,count:i,disabled_ids:n,include_unpublished:r=0,isSelected:o,onAdd:d,onErr:c,onPageChange:h,onResults:u,onSelect:m,organization_id:g,page:p,page_size:x,type:v}=s,{api:f,getUserOrganizationId:j}=(0,P.nm)(),[_,b,A]=(0,ne.CQ)({components:[],count:0,error:null,has_searched:!1,searching:!1}),y=(0,l.useRef)(""),S=(0,l.useRef)({}),C=e=>y.current=e,M=e=>S.current=e,k=S.current,z=async function(){var s,a,t,i;let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{b({searching:!0});let e={};l?h(l,{silent:!0}):l=p,e.search_term=y.current,S.current&&(e=(0,F.A)((0,F.A)({},e),S.current));let n,r=g||j();switch(e.organization_id=r,v){case"cartridge":n=await f.post(`/api/marketplace/cartridges/search/${l}/${x}`,e),u({components:null===(s=n)||void 0===s?void 0:s.cartridge_templates,count:n.count,prev_search:e});break;case"challenge":n=await f.post(`/api/marketplace/challenges/search/${l}/${x}`,e),u({components:null===(a=n)||void 0===a?void 0:a.challenge_templates,count:n.count,prev_search:e});break;case"journey":n=await f.post(`/api/marketplace/journeys/search/${l}/${x}`,e),u({components:null===(t=n)||void 0===t?void 0:t.group_assignment_templates,count:null===(i=n)||void 0===i?void 0:i.count,prev_search:e})}let o=y.current.length>0||k!=S.current;b(e=>(0,F.A)((0,F.A)({},e),{},{has_searched:o,searching:!1}))}catch(e){w(e),"function"===typeof c&&c((null===e||void 0===e?void 0:e.err)||e)}};(0,l.useImperativeHandle)(a,()=>({attemptSearch:z,changeSearchTerm:C})),(0,l.useEffect)(()=>A,[]);const T=(null===id||void 0===id?void 0:id[v])||l.Fragment;return(0,N.jsx)(Uo,{value:{attemptSearch:z,changePage:h,changeSearchFilters:M,changeSearchTerm:C,components:_.components,context_org_id:g,count:_.count,disabled_ids:n,getFilterDisplay:e=>{let s="";switch(e){case"updated_at":s="Last updated";break;case"title":s="Title"}return s},has_searched:_.has_searched,isSelected:o,onAdd:d,onSelect:m,search_term:_.search_term,searching:_.searching},children:(0,N.jsxs)(Ce.S,{className:`component-search d-flex flex-column gap-3 ${null===s||void 0===s?void 0:s.className}`,children:[(0,N.jsx)(T,{hidden:!_.has_searched&&0==t.length,include_unpublished:r}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(sd,{components:t,count:i,onSelect:m,page:p,page_size:x,resetSearch:async()=>{A(),M({}),C(""),await z(1)},type:v}),(0,N.jsx)(Ce.S,{className:"pb-2",children:(0,N.jsx)(Lr,{count:i,onChange:h,page:p,page_size:x})})]})]})})});Lo.displayName="ComponentSearch";var Oo=Lo;const Ho=l.createContext({}),Uo=Ho.Provider,Qo=(Ho.Consumer,()=>(0,l.useContext)(Ho));const Vo=l.createContext({}),Go=Vo.Provider,Wo=(Vo.Consumer,()=>(0,l.useContext)(Vo));const Ko=l.createContext({}),Yo=Ko.Provider,qo=(Ko.Consumer,()=>(0,l.useContext)(Ko));const Jo=l.createContext({}),Xo=Jo.Provider,Zo=(Jo.Consumer,()=>(0,l.useContext)(Jo)),$o=e=>{const{disabled:s,handleChange:a,loading:t,name:i,type:l,value:n}=e,{formatMessage:r}=(0,ja.A)(),{changeSearchTerm:o,searching:d}=Qo(),c=t||d,h=s||c;return(0,N.jsxs)(Ei.A,{className:"component-search-input-container search-input-container",children:[(0,N.jsx)(ve.A,{"aria-label":`Search ${l}s`,className:"d-flex justify-content-center align-items-center",disabled:h,type:"submit",variant:"secondary",children:c?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(_e.A.Control,{className:`component-search-input ${l}-search-input`,id:`${l}SearchInput`,name:i,onChange:e=>{var s;a(e),o((null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)||"")},readOnly:h,type:"search",value:n,"aria-label":r({id:"label.type_title.819d84db",defaultMessage:"{type} title"},{type:l||"component"}),placeholder:r({id:"label.search_by_title.019ae09d",defaultMessage:"Search by title..."})})]})};$o.defaultProps={disabled:!1,loading:!1,name:"search_term",value:""};var ed=$o;var sd=e=>{const{components:s,count:a,page:t,page_size:i,resetSearch:l,type:n}=e,{disabled_ids:r,has_searched:o,isSelected:d,onSelect:c,searching:h}=Qo(),u=(t-1)*i+i<=a?(t-1)*i+i:a;return(0,N.jsx)(Ce.S,{className:"component-search-results p-0 d-flex flex-column justify-content-center",children:(0,N.jsx)(Me.x_,{loading:h,children:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Qe.A,{className:"search-results-counter "+(a?"mb-4":""),children:(0,N.jsx)(Ve.A,{xs:12,children:!!u&&(0,N.jsx)(Ce.S,{className:"float-end pe-2 text-muted",children:a>0?(0,N.jsx)(ke.A,{defaultMessage:"Showing {pageNumber}-{pageCount} of {count} results",id:"label.showing_pagenumber_pagecount_of_co.bb92f67a",values:{count:a,pageCount:u,pageNumber:(t-1)*i+1}}):(0,N.jsx)(ke.A,{defaultMessage:"0 results",id:"label.0_results.ff7009f4"})})})}),null!==s&&void 0!==s&&s.length?(0,N.jsx)(Ce.S,{className:"component-search-results-row mb-4",children:s.map((e,s)=>{return(0,N.jsx)(Kh,{component:e,disabled:(a=null===e||void 0===e?void 0:e.id,r.includes(a)),onSelect:c,selected:d(n,null===e||void 0===e?void 0:e.id),type:n},s);var a})}):o?(0,N.jsx)(Ge.A,{style:{backgroundColor:"rgba(213, 217, 220, 0.32)",border:"0px"},children:(0,N.jsx)(Ge.A.Body,{className:"d-flex justify-content-center",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column justify-content-center align-items-center text-center",style:{maxWidth:"240px"},children:[(0,N.jsx)("h5",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"No results",id:"label.no_results.a43619f3"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"There are no results for this search",id:"label.there_are_no_results_for_this_sear.c0b81978"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:l,variant:"tertiary",children:[(0,N.jsx)(ze.tMu,{}),(0,N.jsx)(ke.A,{defaultMessage:"Reset filters",id:"label.reset_filters.10afa984"})]})]})})}):(0,N.jsx)(Me.x_,{loading:!0})]})})})},ad=t(63900);var td=e=>{const{children:s,class_name:a,has_selections:t,label:i}=e,l=t?"primary":"secondary";return(0,N.jsxs)(li.A,{className:`component-search-filter ${a}`,children:[(0,N.jsx)(li.A.Toggle,{className:"d-flex align-items-center ",variant:l,children:i}),(0,N.jsx)(li.A.Menu,{children:(0,N.jsx)(yl.A,{children:s})})]})};const id={cartridge:Fo,challenge:Do,journey:Po};var ld=t(38510);const nd=(0,l.forwardRef)((e,s)=>{const a=(0,l.useRef)(),t=(0,l.useRef)(),[i,n,r]=(0,ne.CQ)({active_tab:"",components:[],count:0,disabled_ids:[],error:null,last_search:{},loading:!1,multi_select:!1,organization_id:null,page:1,page_size:8,reject:Function(),resolve:Function(),scope:["challenge","journey","cartridge"],selections:[],show:!1,title:""}),o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((s,a)=>{const t=Array.isArray(null===e||void 0===e?void 0:e.scope)&&null!==e&&void 0!==e&&e.scope.length?null===e||void 0===e?void 0:e.scope:["challenge","journey","cartridge"];n({active_tab:t[0],disabled_ids:(null===e||void 0===e?void 0:e.disabled_ids)||[],multi_select:!(null===e||void 0===e||!e.multi_select)||!1,onHide:null===e||void 0===e?void 0:e.onHide,organization_id:null===e||void 0===e?void 0:e.organization_id,reject:a,resolve:s,scope:t,show:!0,title:null===e||void 0===e?void 0:e.title})})},d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.resolve(),"function"===typeof i.onHide&&i.onHide(e),r()},c=e=>{i.resolve(e),d((null===e||void 0===e?void 0:e.type)&&(null===e||void 0===e?void 0:e.component))},h=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=null;"function"==typeof s&&(a=s,s={}),n({page:e},()=>{var e,i,l;if("function"===typeof a&&a(),null===(e=s)||void 0===e||!e.silent)return null===t||void 0===t||null===(i=t.current)||void 0===i||null===(l=i.attemptSearch)||void 0===l?void 0:l.call(i)})},u=async e=>{let{components:s,count:a,prev_search:t}=e;
2try{n(e=>(0,F.A)((0,F.A)({},e),{},{components:s,count:a,loading:!1,prev_search:t}))}catch({err:err}){n(s=>(0,F.A)((0,F.A)({},s),{},{error:err,loading:!1}))}},m=e=>n(s=>(0,F.A)((0,F.A)({},s),{},{error:e})),g=(e,s)=>{const{selections:a}=i;return!!a.find(a=>(null===a||void 0===a?void 0:a.type)==e&&(null===a||void 0===a?void 0:a.component_id)==s)},p=e=>i.scope.includes(e);(0,l.useImperativeHandle)(s,()=>({hide:d,show:o})),(0,l.useEffect)(()=>{r(),null!==e&&void 0!==e&&e.is_modal||o({organization_id:e.organization_id})},[]);const{active_tab:x,components:v,count:f,disabled_ids:j,error:_,last_search:b,loading:A,multi_select:y,organization_id:w,page:S,page_size:C,selections:M,show:k}=i;return(0,N.jsxs)(dd,{value:{active_tab:x,components:v,count:f,error:_,handleSearchError:m,handleSearchResults:u,last_search:b,loading:A,page:S,page_size:C},children:[(0,N.jsx)(Oa,{condition:null===e||void 0===e?void 0:e.is_modal,wrapper:e=>(0,N.jsxs)(xe,{backdrop:"static",className:"assignment-component-picker",id:"assignmentComponentPicker",keyboard:!1,onHide:d,show:k,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:i.title||(0,N.jsx)(ke.A,{defaultMessage:"Marketplace",id:"label.marketplace.c608981d"})})}),(0,N.jsx)(xe.Body,{className:"p-0",children:e}),y&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:d,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!(null!==M&&void 0!==M&&M.length),variant:"primary",onClick:()=>{c({selections:M})},children:(0,N.jsx)(ke.A,{defaultMessage:`Select ${M.length} items`,id:"label.select_items"})})]})})]}),children:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),show:_,variant:"danger",children:_}),(0,N.jsxs)(ld.A.Container,{activeKey:i.active_tab,id:"learnerAssignmentTabs",mountOnEnter:!1,onSelect:e=>n(s=>(0,F.A)((0,F.A)({},s),{},{active_tab:e,components:[],count:0,page:1,page_size:8})),role:"navigation",children:[(0,N.jsx)(Qe.A,{className:"m-0 "+(i.scope.length<=1?"d-none":""),children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[p("challenge")&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"challenge",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})})}),p("journey")&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"journey",children:(0,N.jsx)(ke.A,{defaultMessage:"Journeys",id:"label.journeys.8a953125"})})}),p("cartridge")&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"cartridge",children:(0,N.jsx)(ke.A,{defaultMessage:"Third party",id:"label.third_party.f3c6dbcc"})})})]})})}),(0,N.jsx)(Qe.A,{className:"m-0",children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsx)(ld.A.Content,{children:["challenge","journey","cartridge"].map((s,i)=>(0,N.jsx)(ld.A.Pane,{eventKey:s,children:x===s&&(0,N.jsx)(Oo,{className:null!==e&&void 0!==e&&e.is_modal?"":"component-search-full-page",components:v,count:f,disabled_ids:j,isSelected:g,onErr:m,onPageChange:h,onResults:u,organization_id:w,page:S,page_size:C,ref:t,type:s,onSelect:t=>{y?((e,s)=>{n(a=>{if(g(e,s)){let t=a.selections.findIndex(a=>(null===a||void 0===a?void 0:a.type)==e&&(null===a||void 0===a?void 0:a.component_id)==s);a.selections.splice(t,1)}else a.selections.push({component_id:s,type:e});return a})})(s,null===t||void 0===t?void 0:t.id):(async(s,t)=>{if("function"===typeof e.onSelect)return void e.onSelect({component:t,type:s});if(!a.current)return;const i=await a.current.show({assignable:null===e||void 0===e?void 0:e.show_assignment_wizard,component_id:null===t||void 0===t?void 0:t.id,selectable:!0,type:s});i&&c((0,F.A)({type:s},i))})(s,t)}})},i))})})})]})]})}),(0,N.jsx)(Uh,{ref:a})]})});nd.displayName="AssignmentComponentPicker",nd.defaultProps={is_modal:!0,show_assignment_wizard:!1};var rd=nd;const od=l.createContext({}),dd=od.Provider;od.Consumer;var cd=rd,hd=t(93298);const ud=e=>{const{className:s,name:a,onClick:t,showTooltip:i,size:l,src:n,style:r,suspenseful:o,tooltipContent:d,tooltipPlacement:c}=e,h="function"===typeof t,{styles:u}=(0,P.nm)(),{secondary:m,white:g}=u;return(0,N.jsx)(Oa,{condition:i,wrapper:e=>(0,N.jsx)(Ua.A,{placement:c,trigger:["hover","focus"],overlay:(0,N.jsx)(Qa.A,{id:"avatarTooltip",children:(0,N.jsx)(Ce.S,{className:"text-center",children:d})}),children:e}),children:(0,N.jsx)(Ce.S,{className:`avatar rounded-circle ${s||""}`,onClick:t,role:h?"button":"presentation",style:(0,F.A)({height:l,width:l},r),children:n?(0,N.jsx)(hd.R,{alt:`${a||""} avatar`,className:"avatar-image",fluid:!0,height:"100%",imageStyle:{height:l,width:l},spinner:o,src:n,width:"100%"}):(0,N.jsx)(Va.Ay,{className:"d-flex align-items-center justify-content-center",color:m,fgColor:g,name:a,roun
2d:!1,size:"100%",style:{fontWeight:600,verticalAlign:"initial"},title:a})})})};ud.displayName="CustomAvatar",ud.defaultProps={showTooltip:!1,size:24,suspenseful:!1,tooltipPlacement:"top"};var md=ud;const gd=e=>{const{className:s,maxIcons:a,offset:t,showTooltip:i,size:l,style:n,type:r,withBorder:o}=e,d=Array.isArray(null===e||void 0===e?void 0:e.list)?null===e||void 0===e?void 0:e.list:[],c=`stacked-avatars ${s||""}`,h=a&&(null===d||void 0===d?void 0:d.length)>a?d.filter((e,s)=>s<a-1):d,u=e=>({marginLeft:e?`${t}px`:"",zIndex:(null===d||void 0===d?void 0:d.length)-e});return(0,N.jsxs)(Ce.S,{className:c,style:(0,F.A)({height:l},n),children:[h.map((e,s)=>{const a={key:`${s}-${null===e||void 0===e?void 0:e.id}`,showTooltip:i,size:l,style:u(s),withBorder:o};return"group"===r?(0,N.jsx)(_d,(0,F.A)((0,F.A)({},a),{},{group:e})):(0,N.jsx)(md,(0,F.A)((0,F.A)({},a),{},{item:e}))}),a&&(null===d||void 0===d?void 0:d.length)>a&&(0,N.jsx)(vd,{overflowAmount:(null===d||void 0===d?void 0:d.length)-(a-1),size:l,style:(0,F.A)({},u(h.length))})]})};gd.defaultProps={offset:-8,size:22.5,style:{}};var pd=gd;const xd=e=>{const{overflowAmount:s}=e,a=(0,F.A)({},e.style),t=(null===a||void 0===a?void 0:a.height)||(null===a||void 0===a?void 0:a.width),i=(null===e||void 0===e?void 0:e.size)||t;return a.width=(null===a||void 0===a?void 0:a.width)||i,a.height=(null===a||void 0===a?void 0:a.height)||i,isNaN(Number(s))?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(Ce.S,{className:"stacked-avatars-overflow avatar",style:a,children:(0,N.jsxs)("span",{className:"overflow-amount",children:["+",s]})})};xd.defaultProps={style:{}};var vd=xd,fd=t(60300);const jd=e=>{const{clickable:s,group:a,showTooltip:t,size:i,style:l,tooltipPlacement:n}=e,{avatar:r,name:o}=a||{},d=(0,Pe.W6)();return(0,N.jsx)(md,{className:"group-avatar",clickable:s,name:o,onClick:()=>s&&d.push(`/admin/group/${null===a||void 0===a?void 0:a.id}`),showTooltip:t,size:i,src:(null===r||void 0===r?void 0:r.location)||fd,style:l,tooltipContent:o,tooltipPlacement:n})};jd.defaultProps={clickable:!1,group:{},showTooltip:!1,size:24,tooltipPlacement:"top"};var _d=jd;const bd=e=>{const{className:s,component:a,showTooltip:t,size:i,style:l,suspenseful:n,tooltipPlacement:r,type:o}=e,{title:d}=a||{},c=(null===a||void 0===a?void 0:a.icon_path)||xo;return(0,N.jsx)(md,{className:`assignment-component-avatar ${o||""} ${s||""}`,name:d,showTooltip:t,size:i,src:c,style:l,suspenseful:n,tooltipContent:d,tooltipPlacement:r})};bd.defaultProps={size:40};var Ad=bd;const yd=l.createContext({}),wd=yd.Provider,Nd=(yd.Consumer,()=>(0,l.useContext)(yd)),Sd=[{index:0,label:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})},{index:1,label:(0,N.jsx)(ke.A,{defaultMessage:"Group",id:"label.group.34ca0e76"})},{index:2,label:(0,N.jsx)(ke.A,{defaultMessage:"Assignment",id:"label.assignment.153cdaae"})},{index:3,label:(0,N.jsx)(ke.A,{defaultMessage:"Schedule",id:"label.schedule.f4830a1d"})},{index:4,label:(0,N.jsx)(ke.A,{defaultMessage:"Assignees",id:"label.assignees.9bbf8c4b"})},{index:5,label:(0,N.jsx)(ke.A,{defaultMessage:"Options",id:"label.options.d0db8b5e"})}],Cd=()=>{const{design_lab_template:e,handleClose:s,initial_step:a,navigateToStep:t,step:i}=Nd(),l=Sd.filter(s=>!(s.index<a)&&(2!==s.index||!e));return(0,N.jsxs)(Ce.S,{className:"acw-sidebar",children:[(0,N.jsxs)(Ce.S,{className:"acw-sidebar-header",children:[(0,N.jsx)("span",{className:"acw-sidebar-title",children:(0,N.jsx)(ke.A,{defaultMessage:"New assignment",id:"label.new_assignment.1ee23709"})}),(0,N.jsx)("button",{"aria-label":"Close",className:"btn-close",onClick:s,type:"button"})]}),(0,N.jsx)(Ce.S,{className:"acw-steps-list",children:l.map((e,s)=>{let{index:a,label:l}=e;const n=i===a,r=i>a,o=r,d=["acw-step",n?"acw-step--active":"",r?"acw-step--completed":"",!n&&!r?"acw-step--upcoming":"",o?"acw-step--clickable":""].filter(Boolean).join(" ");return(0,N.jsxs)(Ce.S,{className:d,onClick:o?()=>t(a):void 0,children:[(0,N.jsx)(Ce.S,{className:"acw-step-dot",children:r?(0,N.jsx)(ze.CMH,{size:10}):(0,N.jsx)("span",{children:s+1})}),(0,N.jsxs)(Ce.S,{className:"acw-step-text",children:[(0,N.jsxs)("span",{className:"acw-step-number",children:["Step ",s+1]}),(0,N.jsx)("span",{className:"acw-step-label",children:l})]})]},a)})})]})};const Md=l.createContext({}),kd=Md.Provider,zd=(Md.Consumer,()=>(0,l.useContext)(Md));const Td=(0,l.forwardRef)((e,s)=>{const{autoAssignTeams:a}=zd(),[t,i,n]=(0,ne.CQ)({prefix:"Team",team_size:1,visible:!1}),{prefix:r,team_size:o,visible:d}=t,c=()=>i({visible:!0}),h=()=>n();return(0,l.useImperativeHandle)(s,()=>({hide:h,show:c,visible:d})),(0,N.jsxs)(xe,{contentClassName:"team-generation-modal",onHide:h,show:d,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Generate teams",id:"label.generate_teams.940d50fd"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(os,{controlId:"teamSize",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Team size",id:"label.team_size.62bc7da1"})}
2),(0,N.jsx)(_e.A.Select,{name:"team_size",onChange:e=>{var s;return i({team_size:Number.parseInt(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)||1})},children:new Array(7).fill(null,0,7).map((e,s)=>(0,N.jsx)("option",{value:s+1,children:s+1},s))})]}),(0,N.jsxs)(os,{controlId:"teamPrefix",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Team prefix",id:"label.team_prefix.94e5490b"})}),(0,N.jsx)(_e.A.Control,{name:"prefix",onChange:e=>{var s;return i({prefix:(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)||""})},type:"text",value:r})]}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end w-100",children:(0,N.jsx)(ve.A,{onClick:()=>{a(o,r),h()},style:{padding:"11px 24px"},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add teams",id:"label.add_teams.adb978fb"})})})]})]})});Td.displayName="TeamGenerationModal";var Id=Td;const Ed=(0,l.forwardRef)((e,s)=>{const{formatMessage:a}=(0,ja.A)(),{addTeamToList:t,createTeam:i}=zd(),{locale:n}=(0,P.nm)(),[r,o,d]=(0,ne.CQ)({visible:!1}),{visible:c}=r,{errors:h,handleChange:u,handleSubmit:m,resetForm:g,setFieldValue:p,touched:x,values:v}=(0,ds.Wx)({initialValues:{name:"",password:"",slug:""},onSubmit:(e,s)=>{const a=i(e.name,e.password);t(a),j()},validateOnChange:!0,validationSchema:(0,Re.by)({locale:n,scope:"team.add_team"})}),f=()=>o({visible:!0}),j=()=>{g(),d()};return(0,l.useImperativeHandle)(s,()=>({hide:j,show:f,visible:c})),(0,N.jsxs)(xe,{contentClassName:"add-team-content-modal",onHide:j,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add team",id:"label.add_team.8101addc"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(_e.A,{onSubmit:m,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Team name",id:"label.team_name.0952fcc6"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===x||void 0===x?void 0:x.name)&&(null===h||void 0===h?void 0:h.name),isValid:(null===x||void 0===x?void 0:x.name)&&!(null!==h&&void 0!==h&&h.name),name:"name",onChange:async(e,s)=>{var a;await u(e,s);const t=null===e||void 0===e||null===(a=e.target)||void 0===a?void 0:a.value;await p("slug",Rr()(t,{lower:!0,replacement:"-",strict:!0}))},type:"text",value:v.name,"aria-label":a({id:"label.new_team.1b9ed8ea",defaultMessage:"New team"}),placeholder:a({id:"label.my_team.6899e997",defaultMessage:"My team"})}),(null===h||void 0===h?void 0:h.name)&&(null===x||void 0===x?void 0:x.name)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:h.name})]}),(0,N.jsx)(ve.A,{className:"float-end",onClick:m,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add team",id:"label.add_team.8101addc"})})]})})]})});Ed.displayName="AddTeamModal";var Fd=Ed,Rd=t(60103),Dd=t(29029);const Bd=(0,Dd.A)(e=>e.reduce((e,s)=>(e[s]=!0,e),{}));var Pd=e=>{const{dragging_member_id:s,loading:a,multiSelectTo:t,selected_member_ids:i,toggleSelection:l,toggleSelectionInGroup:n,unassigned_members:r}=zd();return(0,N.jsxs)(Ce.S,{className:"unassigned d-flex flex-column gap-2",children:[(0,N.jsx)("h6",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Unassigned learners",id:"label.unassigned_learners.8e5be81f"})}),(0,N.jsx)(Ge.A,{id:"unassigned-learners",children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Me.x_,{loading:a,children:(0,N.jsx)(Rd.gL,{droppableId:"unassigned",children:(e,a)=>{return(0,N.jsxs)("div",(0,F.A)((0,F.A)({ref:e.innerRef},e.droppableProps),{},{style:(o=a.isDraggingOver,d=e.droppableProps.style,(0,F.A)({background:o?"rgb(157 144 222)":"#fff",minHeight:"inherit",transition:"background-color 0.2s ease"},d)),children:[r.length>0?r.map((e,a)=>{if(e){let r=!1;i&&(r=Boolean(Bd(i)[e.id]));const o=r&&Boolean(s)&&s!==e.id;return(0,N.jsx)(sc,{index:a,isGhosting:o,isSelected:r,member:e,multiSelectTo:t,selectionCount:i.length,toggleSelection:e=>l(e),toggleSelectionInGroup:e=>n(e)},e.id)}return null}):(0,N.jsx)("div",{className:"no-users-found d-flex align-items-center justify-content-center",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"All learners are assigned",id:"label.all_learners_are_assigned.7003b239"})})}),e.placeholder]}));var o,d}})})})})]})};const Ld=e=>
2{const{children:s,className:a,custom_target_child:t,style:i,tooltipRender:l,trigger_variant:n}=e;return(0,N.jsx)(Ce.S,{className:a,style:i,children:(()=>{switch(n){case"mouse":return(0,N.jsx)(Ud,{rendering:l});case"focus":return t?(0,N.jsx)(Vd,{custom_target_child:t,rendering:l,children:s}):(0,N.jsx)(Vd,{custom_target_child:t,rendering:l});default:return(0,N.jsx)(N.Fragment,{})}})()})};Ld.defaultProps={className:"expanded-information help-cursor",custom_target_child:!1,fontSize:"1rem",height:"200px",label:"Image not supplied...",placement:"top",size:40,style:{display:"inline"},textDisplay:"block",tooltipRender:"",trigger_variant:"mouse",variant:"default",width:"100%"};var Od=Ld;const Hd=e=>{const{placement:s,rendering:a}=e,[t,i]=(0,l.useState)(!1),n=(0,l.useRef)(null);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),ref:n,children:(0,N.jsx)(ze.__w,{})}),(0,N.jsx)(bi.A,{placement:s,show:t,target:n.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({id:"overlay-example"},e),{},{children:(0,N.jsx)(Ce.S,{children:a})}))})]})};Hd.defaultProps={placement:"top"};var Ud=Hd;const Qd=e=>{const{custom_target_child:s,placement:a,rendering:t}=e,[i,n]=(0,l.useState)(!1),r=(0,l.useRef)(null);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onBlur:()=>n(!1),onClick:e=>e.preventDefault(),onFocus:()=>n(!0),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),ref:r,style:{cursor:"help"},variant:"link",children:s?null===e||void 0===e?void 0:e.children:(0,N.jsx)(ze.__w,{})}),(0,N.jsx)(bi.A,{placement:a,show:i,target:null===r||void 0===r?void 0:r.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({id:"overlay-example"},e),{},{children:(0,N.jsx)(Ce.S,{children:t})}))})]})};Qd.defaultProps={placement:"top"};var Vd=Qd,Gd=t(53627);var Wd=e=>{const{deleteTeam:s,dialog:a,getTeamCount:t,launchAddTeamModal:i,launchTeamGenerationModal:l,members:n,team_order:r,teams:o,toggleLockTeam:d,updateTeamName:c}=zd(),h=t(),u=(0,N.jsx)("span",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"Randomly assign the unassigned learners to new teams of a specified team size",id:"label.randomly_assign_the_unassigned_lea.7c0ab1a2"})});return(0,N.jsxs)(Ce.S,{className:"assigned d-flex flex-column flex-fill gap-2",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h6",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Teams",id:"label.teams.1e1a1c07"})}),!!h&&(0,N.jsxs)(ve.A,{className:"p-0 d-flex align-items-center gap-1",onClick:i,variant:"link",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add team",id:"label.add_team.8101addc"})]})]}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column flex-fill align-items-center "+(h?"":"justify-content-center"),id:"assigned-learners",children:(0,N.jsxs)(Ce.S,{className:"teams-list w-100",children:[!!o&&!!n&&(0,N.jsx)(Gd.A,{alwaysOpen:!0,defaultActiveKey:"0",children:o&&n&&r.map((e,t)=>{const i=o[e];if(i)return"unassigned"===e?null:(0,N.jsx)(Xd,{deleteTeam:()=>s(null===i||void 0===i?void 0:i.id),dialog:a,index:t,members:n,team:i,toggleLockTeam:()=>d(null===i||void 0===i?void 0:i.id),updateTeamName:e=>c(null===i||void 0===i?void 0:i.id,e)},i.id)})}),!h&&(0,N.jsxs)(Ce.S,{className:"mx-3 d-flex flex-column flex-lg-row justify-content-center align-items-center gap-lg-3",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:l,size:"xl",children:[(0,N.jsx)(ke.A,{defaultMessage:"Generate teams",id:"label.generate_teams.940d50fd"}),(0,N.jsx)(Od,{tooltipRender:u})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:i,size:"xl",variant:"outline-primary",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add team",id:"label.add_team.8101addc"})]})]})]})})]})};const Kd=e=>{return(null===e||void 0===e?void 0:e.user)||((s=null===e||void 0===e?void 0:e.agent_persona)?{id:`agent-${s.id}`,avatar:s.avatar_path?{location:s.avatar_path}:null,fullname:s.name,is_agent:!0}:null);var s};var Yd=t(47815);const qd=(e,s)=>(0,F.A)({background:e?"rgb(157 144 222)":"#fff",transition:"background-color 0.2s ease"},s),Jd=(0,Dd.A)(e=>e.reduce((e,s)=>(e[s]=!0,e),{}));var Xd=e=>{var s;const{team:a}=e,t=(0,l.useRef)(),i=(0,l.useRef)(),{formatMessage:n}=(0,ja.A)(),{preventBubbling:r}=(0,P.hc)(),{styles:o}=(0,P.nm)(),d=null!==(s=null===o||void 0===o?void 0:o.primary)&&void 0!==s?s:"#575757",{deleteTeam:c,draggingMemberId:h,members:u,selected_member_ids:m,updateTeamName:g}=zd();let p=a.member_ids?a.member_ids.map(e=>u[e]):[];p=p.filter(e=>Boolean(e));const x=p.map(e=>Kd(e)),[v,f]=(0,ne.CQ)({editing:!1,error:null}),{editing:j,error:_}=v;return(0,N.jsxs)(Gd.A.Item,{className:a.locked?"team-locked":"",eventKe
2y:a.id,children:[(0,N.jsxs)(Gd.A.Button,{className:"d-flex justify-content-between p-2",children:[_?(0,N.jsx)("small",{className:"text-danger d-block",style:{marginBottom:10},children:(0,N.jsx)(ke.A,{defaultMessage:"Team name is required",id:"label.team_name_is_required.4e4ff466"})}):"",(0,N.jsx)(Ce.S,{className:"flex-1 mx-4",children:j?(0,N.jsx)("input",{className:"form-control",onBlur:e=>{var s;const a=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value;f({editing:!1,error:0===(null===a||void 0===a?void 0:a.length)})},onChange:e=>{var s;return g(null===a||void 0===a?void 0:a.id,null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},onClick:r,ref:i,value:(null===a||void 0===a?void 0:a.name)||""}):(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.name})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(tn,{borderSize:2,className:"me-2",showOnline:!1,size:24,users:x}),(0,N.jsx)(ve.A,{className:"btn-edit-team",disabled:!(null===a||void 0===a||!a.locked),onClick:e=>{if(r(e),v.editing)return;const s=null===i||void 0===i?void 0:i.current;f({editing:!0},null===s||void 0===s?void 0:s.focus)},variant:"link",children:(0,N.jsx)(Yd.fd4,{style:{color:d}})}),(0,N.jsx)(ve.A,{className:"btn-delete-team",disabled:!(null===a||void 0===a||!a.locked),onClick:e=>{r(e);const s=null===t||void 0===t?void 0:t.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:n({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:()=>c(null===a||void 0===a?void 0:a.id),size:"sm",variant:"danger"})],body:n({id:"label.are_you_sure_you_want_to_delete_na.c95fd592",defaultMessage:"Are you sure you want to delete {name}?"},{name:(0,N.jsx)("strong",{children:(null===a||void 0===a?void 0:a.name)||"this team"})}),title:n({id:"label.delete_team.9ff59cd4",defaultMessage:"Delete team"})})},variant:"link",children:(0,N.jsx)(ze.H8h,{style:{color:d}})})]})]}),(0,N.jsx)(Gd.A.Body,{className:"p-0",children:(0,N.jsx)(Rd.gL,{droppableId:null===a||void 0===a?void 0:a.id,isDropDisabled:(null===a||void 0===a?void 0:a.locked)||7===(null===u||void 0===u?void 0:u.length),children:(e,s)=>{var t;return(0,N.jsxs)("div",(0,F.A)((0,F.A)({ref:e.innerRef},e.droppableProps),{},{style:qd(s.isDraggingOver,e.droppableProps.style),children:[(null===(t=p)||void 0===t?void 0:t.length)>0?p.map((e,s)=>{if(null===e||void 0===e||!e.id)return(0,N.jsx)(N.Fragment,{});const t=Boolean(m&&Jd(m)[e.id]),i=t&&Boolean(h)&&h!==e.id;return(0,N.jsx)(sc,{index:s,isDragDisabled:!(null===a||void 0===a||!a.locked),isGhosting:i,isSelected:t,member:e},null===e||void 0===e?void 0:e.id)}):(0,N.jsx)(Ce.S,{className:"no-users-found text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No members added",id:"label.no_members_added.3fd713f6"})}),e.placeholder]}))}})}),(0,N.jsx)(je,{ref:t})]})},Zd=t(75872);const $d=(e,s,a,t)=>(0,F.A)({background:ec(e,a,t),boxShadow:e?" 2px 2px 1px #8993a4":"",opacity:t?" 0.8":""},s),ec=(e,s,a)=>e?"#D5D9DC":s?"#deebff":"#fff";var sc=e=>{const{index:s,isDragDisabled:a,isGhosting:t,isSelected:i,member:l}=e,n=Kd(l),{fullname:r}=n||{},{multiSelectTo:o,toggleSelection:d,toggleSelectionInGroup:c}=zd(),h=e=>{const{button:s,defaultPrevented:a}=e;a||0!==s||(e.preventDefault(),u(e))},u=e=>(e=>navigator.platform.indexOf("Win")>=0?e.ctrlKey:e.metaKey)(e)?c(l.id):(e=>!!e.shiftKey)(e)?o(l.id):void d(l.id);return(0,N.jsx)(Rd.sx,{draggableId:null===l||void 0===l?void 0:l.id,index:s,isDragDisabled:a,children:(e,s)=>(0,N.jsxs)("div",(0,F.A)((0,F.A)((0,F.A)({},e.draggableProps),e.dragHandleProps),{},{className:"team-member noselect py-2",onClick:h,onKeyDown:e=>((e,s,a)=>{const{defaultPrevented:t,keyCode:i}=e;t||a.isDragging||13!==i||(e.preventDefault(),u(e))})(e,0,s),ref:e.innerRef,style:$d(s.isDragging,e.draggableProps.style,i,t),children:[(0,N.jsx)(Ce.S,{className:"align-self-center",children:(0,N.jsx)(Ce.S,{className:"avatar ms-3 me-2",children:(0,N.jsx)(Ya,{showOnline:!1,size:32,user:n})})}),(0,N.jsx)(Ce.S,{className:"details",children:(0,N.jsx)("p",{className:"mb-0",children:(0,N.jsx)("div",{className:"bolder",children:r})})}),(0,N.jsx)(Ce.S,{className:"dragger",children:(0,N.jsx)(Zd.DragIndicator,{})})]}))},null===l||void 0===l?void 0:l.id)};const ac=(e,s)=>({id:null===e||void 0===e?void 0:e.id,action:null===e||void 0===e?void 0:e.action,challenge_name:null===e||void 0===e?void 0:e.challenge_name,group_assignment_id:null===e||void 0===e?void 0:e.group_assignment_id,locked:null===e||void 0===e?void 0:e.locked,member_ids:s,name:null===e||void 0===e?void 0:e.name,team_id:null===e||void 0===e?void 0:e.team_id}),tc=e=>{let{destination:s,selected_member_ids:a,source:t,teams:i}=e;if(t.droppableId===s.droppableId){const e=i[t.droppableId],l=((e,s,a)=>{const t=Array.from(e),[i]=t.splice(s,1);return t.splice(a,0,i),t})(e.member_ids,t.index,s.index);return{selected_member_ids:a,teams:(0,F.A)((0,F.A)({},i),{},{[e.id]:ac(e,l)})}}const l=i[t.droppableId],n=i[s.droppableId],r=l.member_ids[t.index],o=[...l.member_ids];o.splice(t.index,1);const d=[...n.member_ids];d.splice(s.index,0,r);return{selected_member_ids:a,teams:(0,F.A)((0,F.A)({},i),{},{[n.id]:ac(n,d),[l.id]:ac(l,o)})}},ic=(e,s,a)=>{const t=a.find(a=>e[a].member_ids.includes(s));if(null!=t)return e[t];console.log(t,"Could not find team for member")},lc=e=>e.selected_member_ids.length>1?(e=>{let{destination:s,selected_member_ids:a,source:t,team_order:i,teams:l}=e;const n=l[t.droppableId].member_ids[t.index],r=(()=>{const e=a.reduce((e,a)=>{if(a===n)return e;const t=l[s.droppableId],r=ic(l,a,i);return r!==t||r.member_ids.indexOf(a)>=s.index?e:e+1},0);return s.index-e})(),o=[...a];o.sort((e,s)=>{if(e===n)return-1;if(s===n)return 1;const a=ic(l,e,i).member_ids.indexOf(e),t=ic(l,s,i).member_ids.indexOf(s);return a!==t?a-t:-1});const d=i.reduce((e,s)=>{var t,i;const n=null===l||void 0===l?void 0:l[s],r=(null===n||void 0===n||null===(t=n.member_ids)||void 0===t||null===(i=t.filter)||void 0===i?void 0:i.call(t,e=>!a.includes(e)))||[];return null!==e&&void 0!==e&&e[null===n||void 0===n?void 0:n.id]&&(e[n.id]=ac(n,r)),e},l),c=d[s.droppableId],h=(()=>{const e=[...c.member_ids];return e.splice(r,0,...o),e})(),u=(0,F.A)((0,F.A)({},d),{},{[c.id]:ac(c,h)});return{selected_member_ids:o,teams:u}})(e):tc(e),nc=(0,l.forwardRef)((s,a)=>{const{onSuccess:t}=s,{api:i,styles:n}=(0,P.nm)(),r=(null===n||void 0===n?void 0:n.primary)||"",{formatMessage:o}=(0,ja.A)(),d=(0,l.useRef)(),c=(0,l.useRef)(),[h,u,m]=(0,ne.CQ)({dragging_member_id:null,error:null,group_assignment:null,loading:!1,members:null,page:1,page_size:1e4,reject:Function(),resolve:Function(),selected_member_ids:[],show:!1,team_order:[],teams:null,unassigned_members:[]}),{dragging_member_id:g,error:p,loading:x,members:v,selected_member_ids:f,team_order:j,teams:_,visible:b}
2=h;let A=[];if(null!==_&&null!==v){const e=null===_||void 0===_?void 0:_.unassigned;e&&(A=e.member_ids.map(e=>v[e]))}const y=e=>h.resolve(e),w=()=>{y(null),m()},S=async()=>{try{const{group_assignment:e={},page:s,page_size:a}=h,{id:t,group_id:l}=e;u({loading:!0});const{members:n,team_order:r,teams:o}=await i.get(`/api/assignments/members-teams/list/${s}/${a}`,{group_assignment_id:t,group_id:l});u({loading:!1,members:n,team_order:r,teams:o})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}},C=(e,s,a)=>({id:(0,me.A)(),member_ids:a||[],name:e,password:s,team_id:null}),M=()=>u({selected_member_ids:[]}),k=e=>!(null!==e&&void 0!==e&&e.defaultPrevented)&&M();(0,l.useEffect)(()=>(window.addEventListener("click",k),()=>window.removeEventListener("click",k)),[]);const z={addTeamToList:e=>u({team_order:[...h.team_order,null===e||void 0===e?void 0:e.id],teams:(0,F.A)((0,F.A)({},h.teams),{},{[null===e||void 0===e?void 0:e.id]:e})}),autoAssignTeams:(s,a)=>{try{if(s<1||s>7)throw new Error("Team size must be between 1 and 7.");u({loading:!0});const e=h.teams.unassigned,t=(null===e||void 0===e?void 0:e.member_ids).length;if(0===t)throw new Error(o({id:"label.there_are_no_learners_available.a1933c1e",defaultMessage:"There are no learners available."}));if(t>1e3)throw new Error(o({id:"label.the_maximum_amount_of_learners_is.7e5b3a83",defaultMessage:"The maximum amount of learners is 1000."}));let{new_teams:i,teams_order:l}=((e,s)=>{var a;const{teams:t}=h,i=(null===t||void 0===t||null===(a=t.unassigned)||void 0===a?void 0:a.member_ids)||[];let l={};const n=[],r=(0,T.chunk)(i,e);for(const[o,d]of r.entries()){const e=C(`${s} ${o+1}`,"",d);l=(0,F.A)((0,F.A)({},l),{},{[null===e||void 0===e?void 0:e.id]:e}),n.push(null===e||void 0===e?void 0:e.id)}return{new_teams:l,teams_order:n}})(s,a);const n=(0,F.A)((0,F.A)({},e),{},{member_ids:[]});u({loading:!1,team_order:[...h.team_order,...l],teams:(0,F.A)((0,F.A)((0,F.A)({},h.teams),i),{},{unassigned:n})})}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}},createTeam:C,deleteTeam:e=>{var s;const a=(0,T.clone)(null===h||void 0===h?void 0:h.teams),t=(0,T.clone)(null===a||void 0===a?void 0:a[e]);if(t){if(null!==t&&void 0!==t&&null!==(s=t.member_ids)&&void 0!==s&&s.length){var i;const e=(null===a||void 0===a||null===(i=a.unassigned)||void 0===i?void 0:i.member_ids)||[];a.unassigned.member_ids=[...t.member_ids,...e]}delete a[e],u({teams:a})}},dragging_member_id:g,getTeamCount:()=>{var e;const{teams:s}=h;return s?null===(e=Object.keys(s).filter(e=>"unassigned"!=e))||void 0===e?void 0:e.length:0},hide:w,launchAddTeamModal:()=>{const e=null===c||void 0===c?void 0:c.current;e&&e.show()},launchTeamGenerationModal:()=>{const e=null===d||void 0===d?void 0:d.current;e&&e.show()},loading:x,members:v,multiSelectTo:e=>{const{selected_member_ids:s,team_order:a,teams:t}=h,i=((e,s,a,t)=>{if(!s.length)return[a];const i=ic(e,a,t),l=i.member_ids.indexOf(a),n=s[s.length-1],r=ic(e,n,t),o=r.member_ids.indexOf(n);if(i!==r)return i.member_ids.slice(0,l+1);if(l===o)return null;const d=l>o,c=d?o:l,h=d?l:o,u=i.member_ids.slice(c,h+1).filter(e=>!s.includes(e)),m=d?u:[...u].reverse();return[...s,...m]}
2)(t,s,e,a);null!==i&&u({selected_member_ids:i})},selected_member_ids:f,show:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((s,a)=>{const{group_assignment:t}=e;u({error:null,group_assignment:t&&(0,T.clone)(t),reject:a,resolve:s,visible:!0},S)})},team_order:j,teams:_,toggleLockTeam:e=>{const s=null===h||void 0===h?void 0:h.teams,a=null===s||void 0===s?void 0:s[e];a&&(a.locked=!a.locked,u({teams:s}))},toggleSelection:e=>{var s;const{selected_member_ids:a}=h,t=!!(null===a||void 0===a||null===(s=a.includes)||void 0===s||!s.call(a,e))||(null===a||void 0===a?void 0:a.length)>1?[e]:[];u({selected_member_ids:t})},toggleSelectionInGroup:e=>{const{selected_member_ids:s}=h;if(!s.includes(e))return u({selected_member_ids:[...s,e]});const a=s.filter(s=>s!==e);u({selected_member_ids:a})},unassigned_members:A,updateTeamName:(e,s)=>{const a=(0,T.clone)(null===h||void 0===h?void 0:h.teams);null!==a&&void 0!==a&&a[e]&&(a[e].name=s,u({teams:a}))}};return(0,l.useImperativeHandle)(a,()=>(0,F.A)({},z)),(0,N.jsxs)(kd,{value:(0,F.A)({},z),children:[(0,N.jsxs)(xe,{backdrop:"static",className:"team-manager",contentClassName:"content-overrides",dialogClassName:"root-modal-dimensions",onHide:w,show:b,size:"xl",children:[(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex align-items-start flex-column gap-1",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create teams",id:"label.create_teams.0ff8ad9b"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Place your learners in teams by dragging and dropping them",id:"label.place_your_learners_in_teams_by_dr.cd24f35e"})})]}),(0,N.jsxs)(xe.Body,{className:"d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>u({error:null}),show:p,variant:"danger",children:p}),(0,N.jsxs)(Ce.S,{className:"team-manager-instructions d-flex flex-column gap-2",children:[(0,N.jsxs)("p",{children:[(0,N.jsx)(ze.__w,{className:"me-2",color:r}),(0,N.jsx)(ke.A,{defaultMessage:"Click while holding the <strong>Ctrl</strong> or <strong>Command \u2318</strong> key to select learners individually.",id:"label.click_while_holding_the_ctrl_or_co.8feff5bd",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})]}),(0,N.jsxs)("p",{children:[(0,N.jsx)(ze.__w,{className:"me-2",color:r}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click while holding the <strong>Shift</strong> key to select multiple learners.",id:"label.click_while_holding_the_shift_key.eade1528",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]})]}),(0,N.jsx)(Rd.JY,{onDragEnd:function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{selected_member_ids:a,team_order:t,teams:i}=h,{destination:l,reason:n,source:r}=s;if(!l||"CANCEL"===n)return u({dragging_member_id:null});try{var d;const e=null===i||void 0===i?void 0:i[null===l||void 0===l?void 0:l.droppableId],s=(null===e||void 0===e||null===(d=e.member_ids)||void 0===d?void 0:d.length)||0,t=(null===a||void 0===a?void 0:a.length)||0;if(s+t>7&&"unassigned"!==(null===e||void 0===e?void 0:e.id))throw o({id:"label.team_size_must_be_between_1_and_7.cb174aba",defaultMessage:"Team size must be between 1 and 7."})}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;return M(),u({error:a})}const c=lc({destination:l,selected_member_ids:a,source:r,team_order:t,teams:i});u((0,F.A)((0,F.A)({},c),{},{dragging_member_id:null}))},onDragStart:e=>{u({error:null});const s=e.draggableId;h.selected_member_ids.find(e=>e===s)||M(),u({dragging_member_id:e.draggableId})},children:(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"flex-fill",loading:x,children:(0,N.jsxs)(Ce.S,{className:"list-wrapper d-flex flex-column-reverse flex-lg-row gap-3",children:[(0,N.jsx)(Pd,{}),(0,N.jsx)(Wd,{})]})})})]}),(0,N.jsx)(xe.Footer,{className:"border-0",children:(0,N.jsx)(Me.p0,{disabled:!!x,loading:x,onClick:async()=>{try{const{group_assignment:e,members:s,teams:a}=h,{id:l}=e||{};u({loading:!0}),await i.post("/api/teams/members/update/",{group_assignment_id:l,members:s,teams:a}),"function"===typeof t&&t(),y(a),w()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:null})}},style:{padding:"11px 24px"},type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})})})]}),(0,N.jsx)(Id,{ref:d}),(0,N.jsx)(Fd,{ref:c})]})});nc.displayName="TeamManager",nc.defaultProps={onSuccess:Function()};var rc=nc,oc=t(38815);const dc=(0,l.forwardRef)((s,a)=>{const t={agent_persona_stub_ids:[],allow_late_completion:1,allow_teams:0,assign_all:1,assign_to_new:1,can_learners_create_teams:0,component:null,create_lti_assignment:1,due:null,enable_agent_c
2ontributions:1,enable_agent_personas:0,enable_due_date:!1,enable_grading:0,enable_start_date:!1,enable_voice_chat:1,group_member_ids:[],lock_end_date:1,lock_start_date:1,notify_learners:0,schedule:null,start:null,title:""},[i,n,r]=(0,ne.CQ)({assignment:t,component:null,component_type:null,design_lab_template:!1,error:null,global:!0,group:null,group_id:null,initial_step:0,is_lti_user:!1,learners:[],loading:!1,onResolve:null,organization_id:null,reject:Function(),resolve:Function(),scheduled:!1,selected_learners:[],show:!1,show_notification_option:!1,step:-1,user_groups:[],validation_errors:[]}),{api:o,getUserOrganizationId:d,isLTIUser:c,locale:h,orgHasNotification:u,userIsEcommerce:m}=(0,P.nm)(),{formatMessage:g}=(0,ja.A)(),p=(0,l.useRef)(),x=(0,l.useRef)(),v=(0,l.useRef)(),f=(0,l.useRef)(),j=e=>new Promise((s,a)=>{const l=(null===e||void 0===e?void 0:e.organization_id)||d(),r=null!==e&&void 0!==e&&e.component_type?S(null===e||void 0===e?void 0:e.component,null===e||void 0===e?void 0:e.component_type):0,o=l?null!==e&&void 0!==e&&e.group_id?2:1:0;n({assignment:(0,F.A)((0,F.A)({},t),{},{allow_teams:r}),component:null===e||void 0===e?void 0:e.component,component_type:null===e||void 0===e?void 0:e.component_type,design_lab_template:!(null===e||void 0===e||!e.component),enable_voice_chat:r,global:!l&&!(null!==e&&void 0!==e&&e.group_id),group:null,group_id:(null===e||void 0===e?void 0:e.group_id)||null,initial_step:o,organization_id:l,reject:a,resolve:s,show:!0,step:o},async()=>{i.group_id&&(await k(),await M())})}),_=()=>{i.resolve(null),r()},b=()=>n({error:null}),A=e=>n({step:e}),y=()=>!!i.scheduled,w=()=>{const{assignment:e,selected_learners:s}=i,{assign_all:a}=e||{};return!a||!(null===s||void 0===s||!s.length)},S=(e,s)=>{if("journey"===s){const s=(null===e||void 0===e?void 0:e.group_assignment_components)||[];for(const a of s)if(a.type===e)return 1;return 0}return 0},C=e=>n({assignment:(0,F.A)((0,F.A)({},i.assignment),e)}),M=async()=>{try{var e;n({loading:!0});const{members:s}=await o.get("/api/groups/members/list/1/1000",{filter_learner:1,group_id:null===i||void 0===i||null===(e=i.group)||void 0===e?void 0:e.id}),a=s.filter(e=>!e.role_id);n({learners:a,loading:!1})}catch({err:err}){n({error:err,loading:!1})}},k=async()=>{try{n({loading:!0});const{group_id:e}=i,{group:s}=await o.get("/api/groups/get",{group_id:e});n({group:s,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},z=async()=>{try{const e=(()=>{const{assignment:e,component:s,component_type:a,group:t,is_lti_user:l,selected_learners:n}=i,{agent_persona_stub_ids:r,allow_teams:o,assign_all:d,assign_to_new:c,can_learners_create_teams:h,certification_template_id:u,create_lti_assignment:m,due:g,enable_agent_contributions:p,enable_agent_personas:x,enable_grading:v,enable_voice_chat:f,notify_learners:j,schedule:_,start:b}=e||{};return{agent_persona_stub_ids:r,allow_teams:o,assign_all:d,assign_to_new:c,can_learners_create_teams:h,certification_template_id:u||null,component:s,component_type:a,create_lti_assignment:l?m:0,due:g?ci().isMoment(g)?g.toDate():g:null,enable_agent_contributions:p,enable_agent_personas:x,enable_grading:v,enable_voice_chat:f,group_id:(null===t||void 0===t?void 0:t.id)||null,group_member_ids:n,notify_learners:j,schedule:_,start:b?ci().isMoment(b)?b.toDate():b:null}})(),{allow_teams:s}=e;(0,Re.by)({locale:h,scope:"assignment.add_assignment"}).validateSync(e),n({error:null,loading:!0});const{assignment:a}=await o.post("/api/assignments/add",e);s&&await I(a),(e=>{X(e),"function"===typeof i.onResolve&&i.onResolve(e)})({assignment:a,component:B}),_()}catch(e){var s,a;const i=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.errors)||(null===e||void 0===e?void 0:e.message),l=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.errors;n({error:i,loading:!1,validation_errors:l})}},I=async e=>{const s=f.current;s&&await s.show({group_assignment:e})},E=async()=>{const e=null===x||void 0===x?void 0:x.current;if(!e)return;let s=!1;return await e.show({actions:[e.CancelAction(),e.Action({label:"Confirm",onClick:()=>s=!0,variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Returning to the previous step will undo your current changes.",id:"label.returning_to_the_previous_step_wil.59823ca0"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to continue?",id:"label.are_you_sure_you_want_to_continue.e58e4c81"})})]}),title:g({id:"label.confirm_step_back.9a5c0445",defaultMessage:"Confirm step back"})}),s},R=()=>{const e=(0,F.A)((0,F.A)({},i.assignment),{},{allow_late_completion:!0,due:null,schedule:null,start:null});n({assignment:e,scheduled:!1})};(0,l.useEffect)(()=>{var e;c(null===i||void 0===i||null===(e=i.group)||void 0===e?void 0:e.id)&&(0,oc.flushSync)(()=>n({is_lti_user:!0})),(async()=>{const{organization_id:e}=i,s=await u(e,"assignment_new");n({show_notification_option:s})})()},[i.group]),(0,l.useImperativeHandle)(a,()=>({hide:_,show:j}));const{assignment:D,component:B,component_type:L,design_lab_template:O,error:H,global:U,group:Q,group_id:V,initial_step:G,is_lti_user:W,learners:K,loading:Y,organization_id:q,reject:J,resolve:X,selected_learners:Z,show:$,show_advanced_options:ee,show_notification_option:se,step:ae,user_groups:te,validation_errors:ie}=i,le=1e3*Number.parseInt(Math.floor((new Date).getTime()/1e3)),re=Number.parseInt((new Date).getTime())+12096e5,oe=(null===hh||void 0===hh?void 0:hh[ae])||l.Fragment;return(0,N.jsxs)(wd,{value:{assignment:D,clearError:b,component:B,component_type:L,createAssignment:z,default_due:re,default_start:le,design_lab_template:O,error:H,fetchGroup:k,fetchLearners:M,global:U,group:Q,group_id:V,handleClose:()=>{const e=null===v||void 0===v?void 0:v.current;
2if(!e||(0,T.isEmpty)(i.journey))return _();e.show({actions:[e.CancelAction({label:g({id:"label.keep_editing.e76fd2ad",defaultMessage:"Keep editing"})}),e.Action({label:g({id:"label.delete_journey.ee1407b7",defaultMessage:"Delete journey"}),onClick:_,variant:"danger"})],body:g({id:"label.all_progress_made_on_title_will_be.6b90fe94",defaultMessage:"All progress made on {title} will be lost if you continue."},{title:(0,N.jsx)("strong",{children:i.journey.title})}),title:g({id:"label.delete_journey.ee1407b7",defaultMessage:"Delete journey"})})},handleComponentSelected:async s=>{var a;if(!s)return void n({component:null,component_type:null});let{component:t,type:i}=s;if("challenge"===i&&null!==(a=t)&&void 0!==a&&a.id)try{const{challenge_template:e}=await o.get(`/api/marketplace/challenge-template-details/${t.id}`);e&&(t=e)}catch(e){}const l=S(t,i);C({allow_teams:l,enable_voice_chat:l}),n({component:t,component_type:i,step:3})},handleFormSubmit:async e=>{await z()},handleNext:async()=>{const{component:e,group_id:s,organization_id:a,step:t}=i;switch(t){case 0:return!!a&&A(1);case 1:s&&(A(O?3:2),await k(),await M());break;case 2:return!!e&&A(3);case 3:{const e=null===p||void 0===p?void 0:p.current;if(!e)return;if(!e.isValid())return void n({error:g({id:"label.please_fix_the_schedule_errors_bef.39743dd2",defaultMessage:"Please fix the schedule errors before continuing."})});const s=e.getAssignment();return n({error:null,scheduled:!0}),C(s),A(4)}case 4:return A(5)}},handlePrevious:async()=>{const{component:e,step:s}=i;switch(s){case 1:if(!i.group_id)return A(0);if(await E())return n({group:null,group_id:null}),A(0);break;case 2:if(!e)return A(1);if(await E())return A(1);break;case 3:if(!y())return A(2);if(await E())return R(),A(2);break;case 4:if(!w())return A(3);if(await E())return n({selected_learners:[]}),C({assign_all:1,assign_to_new:1}),A(3);break;case 5:return A(4)}},handleSelectGroup:async e=>{e&&n({group_id:e})},handleSelectOrg:e=>!!e&&n({organization_id:e}),hasScheduled:y,initial_step:G,inline_scheduler:p,is_ecommerce:m(),is_lti_user:W,learners:K,loading:Y,navigateToStep:async e=>{const{step:s}=i;if(e>=s)return;const a=e<1&&!!i.group_id,t=e<2&&!!i.component,l=e<3&&y(),r=e<4&&w();if(a||t||l||r){if(!await E())return}const o={step:e},d=(0,F.A)({},i.assignment);r&&(o.selected_learners=[],d.assign_all=1,d.assign_to_new=1),l&&(d.allow_late_completion=!0,d.due=null,d.schedule=null,d.start=null,o.scheduled=!1),t&&(o.component=null,o.component_type=null),a&&(o.group=null,o.group_id=null),n((0,F.A)((0,F.A)({},o),{},{assignment:d}))},organization_id:q,reject:J,resolve:X,selected_learners:Z,setStep:A,show:$,show_advanced_options:ee,show_notification_option:se,step:ae,toggleLearnerSelection:e=>{const{learners:s,selected_learners:a}=i;let t=a.includes(e)?a.filter(s=>s!==e):[...a,e];n({selected_learners:t}),C({assign_all:t.length===s.length?1:0})},toggleSelectAllLearners:()=>{const{learners:e,selected_learners:s}=i;if((null===s||void 0===s?void 0:s.length)!==(null===e||void 0===e?void 0:e.length)){const s=e.map(e=>null===e||void 0===e?void 0:e.id);n({selected_learners:s}),C({assign_all:1})}else n({selected_learners:[]})},updateAssignmentValues:C,user_groups:te},children:[(0,N.jsx)(xe,{fullscreen:!0,backdrop:"static",className:"assignment-creation-wizard",id:"assignmentCreationWizard",keyboard:!1,show:i.show,children:(0,N.jsxs)("div",{className:"acw-layout",children:[(0,N.jsx)(Cd,{}),(0,N.jsxs)("div",{className:"acw-main",children:[(0,N.jsx)(mh,{}),(0,N.jsxs)(Me.x_,{flexFill:!0,loading:Y,children:[(0,N.jsxs)("div",{className:"acw-main-body",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:b,show:H,variant:"danger",children:null!==ie&&void 0!==ie&&ie.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("strong",{children:[H,":"]}),(0,N.jsx)("ul",{children:ie.map((e,s)=>(0,N.jsx)("li",{style:{color:"#711624"},children:e},s))})]}):(0,N.jsx)(N.Fragment,{children:H})}),(0,N.jsx)(oe,{})]}),(0,N.jsx)(_h,{})]})]})]})}),(0,N.jsx)(je,{ref:v}),(0,N.jsx)(je,{ref:x}),(0,N.jsx)(rc,{ref:f})]})});dc.displayName="AssignmentCreationWizard";var cc=dc,hc=t(19860);const uc=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{formatMessage:t}=(0,ja.A)(),{component:i,component_type:n}=Nd(),[r,o,d]=(0,ne.CQ)({error:null,learners:[],loading:!1,reject:Function(),resolve:Function(),select_all:!1,selected_learners:[],show:!1}),c=e=>{let{journey:s={},learners:a=[],selected_learners:t=[]}=e;return new Promise((e,i)=>{const l=[...t],n=(null===t||void 0===t?void 0:t.length)===(null===a||void 0===a?void 0:a.length);o({journey:s,learners:a,prev_selected:l,reject:i,resolve:e,select_all:n,selected_learners:t,show:!0})})},h=()=>{const{prev_selected:e,reject:s}=r;o({show:!1},()=>"function"===typeof a&&a());s({err:"Modal closed without assigning users",ids:null!==e&&void 0!==e&&e.length?e:[]}
2)},u=e=>r.selected_learners.includes(e);(0,l.useImperativeHandle)(s,()=>({hide:h,show:c})),(0,l.useEffect)(()=>{d()},[]);const{learners:m,select_all:g,selected_learners:p,show:x}=r,v=null===i||void 0===i?void 0:i.title;return(0,N.jsxs)(xe,{className:"learner-selector-modal",id:"learnerSelectorModal",onHide:h,show:x,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select learners",id:"label.select_learners.561601eb"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(Ge.A,{className:"challenge-template-selection",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex align-items-center p-3 gap-2",children:[(0,N.jsx)(Ad,{component:i,type:n}),(0,N.jsxs)(Ce.S,{className:"challenge-template-name text-truncate d-flex flex-column mw-100",children:[(0,N.jsx)("small",{className:"text-muted text-uppercase font-weight-bold",children:n}),(0,N.jsx)("strong",{children:v})]})]})}),(0,N.jsxs)(yl.A,{className:"mt-3",variant:"flush",children:[(0,N.jsxs)(yl.A.Item,{className:"user-row px-0 d-flex align-items-center",children:[(0,N.jsx)(_e.A.Check,{checked:g,className:"me-3",onChange:()=>{const{learners:e,selected_learners:s}=r;if((null===s||void 0===s?void 0:s.length)!==(null===e||void 0===e?void 0:e.length)){const s=e.map(e=>null===e||void 0===e?void 0:e.id);o({select_all:!0,selected_learners:s})}else o({select_all:!1,selected_learners:[]})}}),(0,N.jsx)("span",{className:"h6 m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"All learners",id:"label.all_learners.df997d3d"})})]}),!(null===m||void 0===m||!m.length)&&m.map((e,s)=>{var a;const{id:t}=e||{},i=null===e||void 0===e||null===(a=e.organization_member)||void 0===a?void 0:a.user,{fullname:l}=i||{};return(0,N.jsxs)(yl.A.Item,{action:!0,className:"user-row px-0 d-flex align-items-center",onClick:()=>(e=>{var s;const{learners:a,selected_learners:t}=r;let i=[...t];u(e)?i=i.filter(s=>s!==e):i.push(e);const l=(null===(s=i)||void 0===s?void 0:s.length)===(null===a||void 0===a?void 0:a.length);o({select_all:l,selected_learners:i})})(t),children:[(0,N.jsx)(_e.A.Check,{checked:u(t),className:"me-3",readOnly:!0}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ya,{className:"me-2",showOnline:!1,size:24,user:i}),(0,N.jsx)("strong",{className:"me-2 mb-0 d-inline",children:l})]})]},s)}),!(null!==m&&void 0!==m&&m.length)&&(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"There are no learners in this group",id:"label.there_are_no_learners_in_this_grou.c2a7481c"})})]})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{disabled:!(null!==p&&void 0!==p&&p.length),onClick:()=>{const{resolve:e,selected_learners:s}=r;e(s||[]),h()},size:"lg",children:(()=>{var e;const s=(null===r||void 0===r||null===(e=r.selected_learners)||void 0===e?void 0:e.length)||0;return g?(0,N.jsx)(ke.A,{defaultMessage:"Assign to all learners",id:"label.assign_to_all_learners.92a4c9e5"}):(0,N.jsx)(hc.A,{value:s,one:t({id:"label.assign_to_num_selected_learner.347e75f0",defaultMessage:"Assign to {num_selected} learner"},{num_selected:s}),other:t({id:"label.assign_to_num_selected_learners.ca3f8cbd",defaultMessage:"Assign to {num_selected} learners"},{num_selected:s})})})()})})]})});uc.displayName="LearnerSelectorModal";const mc=(0,l.forwardRef)((s,a)=>{const{assignment:t,template:i,type:n}=s,r=(null===i||void 0===i?void 0:i.group_assignment_template_components)||[],o=(0,T.isEmpty)(null===t||void 0===t?void 0:t.schedule)?r.map(e=>({id:null===e||void 0===e?void 0:e.id,allow_late_completion:(null===t||void 0===t?void 0:t.allow_late_completion)||!0,due:(null===t||void 0===t?void 0:t.due)||null,start:(null===t||void 0===t?void 0:t.start)||null})):null===t||void 0===t?void 0:t.schedule,{locale:d}=(0,P.nm)(),{formatMessage:c}=(0,ja.A)(),[h,u,m]=(0,ne.CQ)({assignment:t,assignment_error:null,component_errors:[],schedule:o}),g=e=>{var s,a;return(null===h||void 0===h||null===(s=h.schedule)||void 0===s||null===(a=s.find)||void 0===a?void 0:a.call(s,s=>(null===s||void 0===s?void 0:s.id)===e))||{}},p=e=>h.schedule.slice(0,(e=>h.schedule.indexOf(g(e)))(e)),x=ci()().subtract(1,"day"),v=e=>{const{force_order:s}=i,{assignment:a}=h,t=null!==a&&void 0!==a&&a.due?ci()(null===a||void 0===a?void 0:a.due):null,l=g(e),n=p(e),r=null!==l&&void 0!==l&&l.start?ci()(null===l||void 0===l?void 0:l.start):null;if(!r)return null;if(r.isSameOrAfter(t))return c({id:"label.start_date_must_be_before_journey.faec3a47",defaultMessage:"Start date must be before journey due date"});if(s)for(const i of n){const e=null!==i&&void 0!==i&&i.due?ci()(null===i||void 0===i?void 0:i.due):null;if(e&&!r.isSameOrAfter(e))return!1}return null},f=()=>{const{assignment:s,schedule:a}=h,{due:t,start:i}=s;if(null===a||void 0===a||!a.length)return!0;const l=(0,Re.by)({locale:d,scope:"assignment.component_schedule"}),n=[];for(const o of a){const s=a.indexOf(o),d=v(null===o||void 0===o?void 0:o.id);if(!d)try{l.validateSync({assignment_due:t,assignment_start:i,due:o.due,start:o.start})}catch(e){var r;const t=(null===e||void 0===e||null===(r=e.errors)||void 0===r?void 0:r[0])||(null===e||void 0===e?void 0:e.message)||e;t&&n.push({error:t,ind:s}
2)}else n.push({error:d,ind:s})}return u({component_errors:n}),!(null!==n&&void 0!==n&&n.length)},{assignment_error:j,component_errors:_}=h,b={assignment:t,assignment_error:j,component_errors:_,components:r,getAssignment:()=>(0,F.A)((0,F.A)({},h.assignment),{},{schedule:h.schedule}),getComponentError:e=>{var s,a;return(null===h||void 0===h||null===(s=h.component_errors)||void 0===s||null===(a=s.find)||void 0===a?void 0:a.call(s,s=>s.ind===e))||null},getComponentSchedule:g,getTemplate:e=>{const{cartridge_template:s,challenge_template:a,group_assignment_template:t}=e;return a||s||t||null},isValid:()=>{var e;return!h.assignment_error&&!(null!==(e=h.component_errors)&&void 0!==e&&e.length)||!1},isValidAssignmentDue:e=>{const{assignment:s}=h;return null!==s&&void 0!==s&&s.start?e.isAfter(ci()(s.start)):e.isAfter(ci().now())},isValidAssignmentStart:e=>{const{assignment:s}=h;return null!==s&&void 0!==s&&s.due?e.isAfter(x)&&e.isBefore(ci()(s.due)):e.isAfter(x)},isValidComponentDue:(e,s)=>{const{assignment:a}=h,{due:t,start:i}=a||{},l=g(e),{start:n}=l||{},r=n?s.isAfter(ci()(n)):s.isAfter(ci()()),o=i?s.isAfter(ci()(i)):s.isAfter(ci()(x)),d=t?s.isSameOrBefore(ci()(t)):s.isAfter(ci()());return r&&o&&d},isValidComponentStart:(e,s)=>{if(null===s)return!0;s=ci().isMoment(s)?s:ci()(s);ci()();const{force_order:a}=i||{},{assignment:t}=h,l=null!==t&&void 0!==t&&t.start?ci()(t.start):null,n=null!==t&&void 0!==t&&t.due?ci()(t.due):null,r=g(e),o=null!==r&&void 0!==r&&r.due?ci()(r.due):null,d=o?s.isBefore(o):s.isSameOrAfter(x),c=l?s.isSameOrAfter(l):s.isAfter(x),u=n?s.isBefore(n):s.isAfter(x);if(!a)return d&&c&&u;const m=p(e);let v=(null===m||void 0===m||!m.length)&&c;for(const i of m){const e=null!==i&&void 0!==i&&i.start?ci()(i.start):null;v=e?s.isSameOrAfter(e):c}return d&&c&&v&&u},template:i,type:n,updateAssignmentSchedule:e=>{const s=(0,F.A)((0,F.A)({},h.assignment),e);u({assignment:s},f)},updateComponentSchedule:e=>{const s=(0,T.clone)(h.schedule),a=s.indexOf(g(null===e||void 0===e?void 0:e.id));-1!==a&&(s[a]=e,u({schedule:s},f))},validateComponentSchedules:f};return(0,l.useImperativeHandle)(a,()=>(0,F.A)({},b)),(0,l.useEffect)(()=>m,[]),(0,N.jsx)(yc,{value:(0,F.A)({},b),children:(0,N.jsxs)(Ce.S,{className:"assignment-scheduler d-flex flex-column gap-3 py-3",children:[(0,N.jsx)(xc,{}),"journey"===n&&(0,N.jsx)(vc,{})]})})});mc.displayName="AssignmentScheduler",mc.defaultProps={template:{}};var gc=mc,pc=t(29455);var xc=e=>{var s;const a=null===Re._$||void 0===Re._$||null===(s=Re._$.binary)||void 0===s?void 0:s.parseBinary,{assignment:t,assignment_error:i,isValidAssignmentDue:n,isValidAssignmentStart:r,template:o,type:d,updateAssignmentSchedule:c}=wc(),{cover_path:h,group_assignment_template_components:u,title:m,total_est_completion_time:g}=o||{},[p,x,v]=(0,ne.CQ)({allow_late_completion:!!a(null===t||void 0===t?void 0:t.allow_late_completion),due:(null===t||void 0===t?void 0:t.due)||null,error:i,start:(null===t||void 0===t?void 0:t.start)||null}),{allow_late_completion:f,due:j,error:_,start:b}=p,A=async(e,s)=>{const a={[`${s}`]:e.toDate()};x(a,()=>c(a))};(0,l.useEffect)(()=>{x({error:i||null})},[i]);const y=(0,N.jsx)(ke.A,{defaultMessage:"Right away",id:"label.right_away.846f9d48"}),w=(0,N.jsx)(ke.A,{defaultMessage:"Never",id:"label.never.6300ef80"});return(0,N.jsx)(Ge.A,{className:"assignment-schedule-card "+(_?"invalid":""),children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsxs)(Qe.A,{className:"m-0 flex-column flex-lg-row",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column justify-content-between",lg:5,children:[(0,N.jsxs)(Ce.S,{className:"component-metadata d-flex flex-column gap-2",children:[(0,N.jsx)(Me.R_,{alt:`"${m}" ${d} cover image`,height:56,imageClassname:`cover-image ${d}`,imageHeight:56,imageWidth:84,src:h||pc,width:84}),(0,N.jsxs)("small",{className:"d-flex gap-2 align-items-center duration",children:["journey"===d&&(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1 font-weight-bold",children:[(0,N.jsx)(ze.aQJ,{}),(0,N.jsx)(hc.A,{value:(null===u||void 0===u?void 0:u.length)||0,one:(0,N.jsx)(ke.A,{defaultMessage:"1 module",id:"label.1_module.f5f57032"}),other:(0,N.jsx)(ke.A,{defaultMessage:"{count} modules",id:"label.count_modules.bba1cca4",values:{count:(null===u||void 0===u?void 0:u.length)||0}})})]}),(0,N.jsxs)("span",{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)(ze.w_X,{}),(0,N.jsx)(Vh,{duration:g,label_type:"long",unit:"minutes"})]})]}),(0,N.jsx)("h5",{className:"m-0",children:m})]}),!!_&&(0,N.jsx)("small",{className:"text-danger",children:_})]}),(0,N.jsx)(Ve.A,{className:"schedule-inputs d-flex flex-column",lg:7,children:(0,N.jsx)(bc,{allow_late_completion:f,due:j,due_label:w,onChangeDue:e=>A(e,"due"),onChangeLateCompletion:e=>{var s;const a=!(null===e||void 0===e||null===(s=e.target)||void 0===s||!s.checked);x({allow_late_completion:a},c({allow_late_completion:a}))},onChangeStart:e=>A(e,"start"),setDue:e=>x({due:e},()=>c({due:e})),setStart:e=>x({start:e},()=>c({start:e})),start:b,start_label:y,validDue:n,validStart:r})})]})})})};var vc=e=>{const{components:s,getComponentSchedule:a,template:t}=wc(),{force_order:i}=t||{};return(0,N.jsxs)(Ce.S,{className:"component-scheduler-card-list d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",id:"label.modules.76c86c4c"})}),(0,N.jsx)("small",{className:"d-flex align-items-center gap-1 font-weight-bold text-black-50",children:i?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.JhU,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learners must complete modules in order",id:"label.learners_must_c
2omplete_modules_in.810c0386"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.nQ7,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learners can complete modules in any order",id:"label.learners_can_complete_modules_in_a.82862049"})})]})})]}),null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(fc,{component:e,component_schedule:a(null===e||void 0===e?void 0:e.id),ind:s},s))}):(0,N.jsx)(Ge.A,{children:(0,N.jsx)(Ge.A.Body,{className:"d-flex justify-content-center align-items-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No components found",id:"label.no_components_found.cfc11e03"})})})]})};var fc=e=>{var s;const{component:a,component_schedule:t,ind:i}=e,{id:n,total_est_completion_time:r,type:o}=a,d=null===Re._$||void 0===Re._$||null===(s=Re._$.binary)||void 0===s?void 0:s.parseBinary,{component_errors:c,getComponentError:h,getTemplate:u,isValidComponentDue:m,isValidComponentStart:g,updateComponentSchedule:p}=wc(),{cover_path:x,title:v}=u(a)||{},[f,j,_]=(0,ne.CQ)({allow_late_completion:!!d(null===t||void 0===t?void 0:t.allow_late_completion),due:(null===t||void 0===t?void 0:t.due)||null,error:null,start:(null===t||void 0===t?void 0:t.start)||null}),{allow_late_completion:b,due:A,error:y,start:w}=f,S=()=>({id:n,allow_late_completion:d(f.allow_late_completion),due:(null===f||void 0===f?void 0:f.due)||null,start:(null===f||void 0===f?void 0:f.start)||null}),C=async(e,s)=>{const a={[`${s}`]:e.toDate()};j(a,()=>p(S()))};(0,l.useEffect)(()=>{const{error:e}=h(i)||{};j({error:e||null})},[c]);const M=(0,N.jsx)(ke.A,{defaultMessage:"Same as journey",id:"label.same_as_journey.20cf791b"});return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ge.A,{className:"component-schedule-card "+(y?"invalid":""),children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsxs)(Qe.A,{className:"m-0",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column justify-content-between",xs:5,children:[(0,N.jsxs)(Ce.S,{className:"component-metadata d-flex flex-column gap-2",children:[(0,N.jsx)(Me.R_,{alt:`"${v}" ${o} cover image`,height:56,imageClassname:`cover-image ${o}`,imageHeight:56,imageWidth:84,src:x||pc,width:84}),(0,N.jsxs)("small",{className:"d-flex gap-2 align-items-center duration",children:[(0,N.jsx)("span",{className:"text-uppercase",children:o}),(0,N.jsxs)("span",{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)(ze.w_X,{}),(0,N.jsx)(Vh,{duration:r,label_type:"long",unit:"minutes"})]})]}),(0,N.jsx)("h5",{className:"m-0",children:v})]}),!!y&&(0,N.jsx)("small",{className:"text-danger",children:y})]}),(0,N.jsx)(Ve.A,{className:"schedule-inputs d-flex flex-column",xs:7,children:(0,N.jsx)(bc,{allow_late_completion:b,due:A,due_label:M,onChangeDue:e=>C(e,"due"),onChangeLateCompletion:e=>{var s;const a=!(null===e||void 0===e||null===(s=e.target)||void 0===s||!s.checked);j({allow_late_completion:a},()=>p(S()))},onChangeStart:e=>C(e,"start"),setDue:e=>j({due:e},()=>p(S())),setStart:e=>j({start:e},()=>p(S())),start:w,start_label:M,validDue:e=>m(n,e),validStart:e=>g(n,e)})})]})})})})},jc=t(32566),_c=t.n(jc);var bc=e=>{var s;const{allow_late_completion:a,due:t,due_label:i,onChangeDue:l,onChangeLateCompletion:n,onChangeStart:r,setDue:o,setStart:d,start:c,start_label:h,validDue:u,validStart:m}=e,{formatMessage:g}=(0,ja.A)(),{parseBinary:p}=null!==(s=null===Re._$||void 0===Re._$?void 0:Re._$.binary)&&void 0!==s?s:{},{assignment:x}=wc(),[v,f,j]=(0,ne.CQ)({custom_due:!(null===x||void 0===x||!x.due),custom_start:!(null===x||void 0===x||!x.start)}),{custom_due:_,custom_start:b}=v,A=e=>{const s=!!p(e.target.value);f({custom_start:s},()=>!s&&d(null))},y=e=>{const s=!!p(e.target.value);f({custom_due:s},()=>!s&&o(null))},w=(0,N.jsx)(ke.A,{defaultMessage:"Custom",id:"label.custom.494ca78f"}),S=g({id:"label.no_date_selected.a775f9f6",defaultMessage:"No date selected"}),C=(0,N.jsx)(ke.A,{defaultMessage:"Allow access after due date",id:"label.allow_access_after_due_date.f0853020"});return(0,N.jsx)(_e.A,{className:"d-flex flex-column",children:(0,N.jsxs)(Ce.S,{className:"d-flex gap-5",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsxs)(os,{className:"d-flex flex-column mb-0",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)(_e.A.Check,{checked:!b,defaultChecked:!b,label:h,name:"custom_start",onChange:A,type:"radio",value:0}),(0,N.jsx)(_e.A.Check,{checked:!!b,defaultChecked:!!b,label:w,name:"custom_start",onChange:A,type:"radio",value:1}),!!b&&(0,N.jsx)(os,{children:(0,N.jsx)(_c(),{closeOnSelect:!0,isValidDate:m,name:"start",onChange:r,value:c,inputProps:{placeholder:S,value:c&&ci()(c).format("M/D/YYYY, h:mm a")}})})]}),(0,N.jsx)(os,{className:"d-flex flex-column mt-4 mb-0",children:(0,N.jsx)(_e.A.Check,{checked:!!a,className:"mb-0 font-weight-bold",defaultChecked:!!a,label:C,name:"allow_late_completion",onChange:n,value:p(!a)})})]}),(0,N.jsxs)(os,{className:"d-flex flex-column mb-0",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",id:"label.end_date.14303aa0"})}),(0,N.jsx)(_e.A.Check,{checked:!_,defaultChecked:!_,label:i,name:"custom_due",onChange:y,type:"radio",value:0}),(0,N.jsx)(_e.A.Check,{checked:!!_,defaultChecked:!!_,label:w,name:"custom_due",onChange:y,type:"radio",value:1}),!!_&&(0,N.jsx)(os,{children:(0,N.jsx)(_c(),{closeOnSelect:!0,isValidDate:u,name:"due",onChange:l,value:t,inputProps:{placeholder:S,value:t&&ci()(t).format("M/D/YYYY, h:mm a")}})})]})]})})};const Ac=l.createContext({}),yc=Ac.Provider,wc=(Ac.Consumer,()=>(0,l.useContext)(Ac)),Nc=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,[t,i,n]=(0,ne.CQ)({assignment:null,error:null,loading:!1,reject:Function(),resolve:Function(),show:!1,template:null,type:null}),r=(0,l.useRef)(),o=(0,l.useRef)(),{assignment:d,template:c,type:h}=t,u=e=>new Promise((s,a)=>{i({assignment:e.assignment,reject:a,resolve:s,show:!0,template:e.template,type:e.type})}),m=()=>{t.resolve(null),n(),"function"===typeof a&&a()},g=()=>{const e=null===r||void 0===r?void 0:r.current;e&&e.show({actions:[e.SingleOKAction()],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"There are one or more issues with your current schedule.",id:"label.there_are_one_or_more_issues_with.0ca61bd7"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Please correct these errors and try again.",id:"label.please_correct_these_errors_and_tr.c442f8d4"})})]}),title:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 text-danger",children:[(0,N.jsx)(ze.TNq,{}),(0,N.jsx)(ke.A,{defaultMessage:"Schedule errors",id:"label.schedule_errors.44782340"})]})})};return(0,l.useImperativeHandle)(s,()=>({hide:m,show:u})),(0,N.jsxs)(xe,{backdrop:"static",className:"assignment-scheduler-modal",id:"assignmentSchedulerModal",onHide:m,show:t.show,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,className:"border-bottom",children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Schedule {type}",id:"label.schedule_type.21ddaa06",values:{type:h}})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(gc,{assignment:d,ref:o,template:c,type:h})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:()=>{var e;const s=null===o||void 0===o?void 0:o.current;if(!s)return;const a=(null===s||void 0===s||null===(e=s.getAssignment)||void 0===e?void 0:e.call(s))||[];if(!s.isValid())return g();t.resolve(a),m()},children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})}),(0,N.jsx)(je,{ref:r})]})});Nc.displayName="AssignmentSchedulerModal";var Sc,Cc;const Mc=["title","titleId"];function kc(){return kc=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},kc.apply(null,arguments)}function zc(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,Mc);return l.createElement("svg",kc({width:64,height:64,viewBox:"0 0 64 64",f
2ill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,Sc||(Sc=l.createElement("path",{d:"M37.0002 19V25.2L38.5002 23.6C38.8002 23.3 39.2002 23.3 39.5002 23.5C39.5002 23.5 39.5002 23.5 39.6002 23.6L41.0002 25.2V5.8C41.0002 5.3 40.7002 5 40.2002 5H25.5002C25.3002 5 25.1002 5.1 25.0002 5.2L18.8002 11.5C18.5002 11.8 18.5002 12.3 18.8002 12.6L25.1002 18.8C25.2002 18.9 25.4002 19 25.6002 19H37.0002ZM26.8002 9H37.0002V15H26.8002L23.8002 12L26.8002 9Z",fill:"#D5D9DC"})),Cc||(Cc=l.createElement("path",{d:"M63.2 55H0.8C0.3 55 0 54.7 0 54.2V50.4C0 50.2 0.1 50 0.2 49.9L16.4 33.6C16.7 33.3 17.2 33.3 17.5 33.6L24 40L38.5 24.5C38.8 24.2 39.2 24.2 39.5 24.4C39.5 24.4 39.5 24.4 39.6 24.5L63.8 51C63.9 51.1 64 51.3 64 51.5V54.2C64 54.7 63.7 55 63.2 55ZM4.8 51H58.3L39 29.9L24.6 45.3C24.3 45.6 23.8 45.6 23.5 45.3L17 38.8L4.8 51Z",fill:"#008087"})))}const Tc=l.forwardRef(zc);var Ic=t.p+"static/media/challenge.d5fb4c9b9a5a5ea07da27b9c39df7688.svg";var Ec=t.p+"static/media/cartridge.804b114459d2dc3388017feb2fdf2324.svg";var Fc=t.p+"static/media/journey.132a14d77cd2f7bdd378f88d269b6a2f.svg";const Rc=(0,l.forwardRef)((e,s)=>{const{allowGlobal:a,allowMultiSelect:t,disableAll:i,disableTopParent:n,excludedIds:r,exploded:o,maxHeight:d,onSelectionChange:c,onSubmit:h,organization_id:u,organization_ids:m,preselectedOrganizationId:g,returnType:p,searchable:x,selectorLabel:v,selectorType:f,showRole:j,submitOnSelect:_,user_id:b}=e,{api:A,getUserOrganization:y}=(0,P.nm)(),w=(0,l.useRef)(),[S,C,M]=(0,ne.CQ)({count:0,error:null,loading:!1,organization_memberships:[],organizations:[],page:1,page_size:1e3,preselected_organization_id:void 0,search_term:"",selected_organization_ids:void 0!==g?[g]:[]}),k=async()=>{try{const{page:e,page_size:s,search_term:a}=S,t=y(),i=(null===t||void 0===t?void 0:t.id)||null,{count:l,organizations:n}=await A.post(`/api/organizations/list/all-with-parent/${e}/${s}`,{organization_id:i,organization_ids:m,search_term:a,sort_direction:"ASC",sort_token:"name"});C({count:l,organizations:n})}catch({err:err}){C({error:err})}},z=async()=>{try{if(!j)return;const{organization_memberships:e}=await A.get("/api/organizations/memberships/list/1/1000",{user_id:b});C({organization_memberships:e})}catch({err:err}){C({error:err})}},T=e=>S.selected_organization_ids.includes(e),I=()=>{const e=(null===S||void 0===S?void 0:S.selected_organization_ids)||[];return"object"===p?t?B.filter(s=>{var a;return(null===e||void 0===e||null===(a=e.includes)||void 0===a?void 0:a.call(e,s.id))||[]}):B.find(s=>s.id===(null===e||void 0===e?void 0:e[0])):t?e:null===e||void 0===e?void 0:e[0]},E=e=>{var s;return!(null===r||void 0===r||null===(s=r.includes)||void 0===s||!s.call(r,e))},{error:F,loading:R,organization_memberships:D,organizations:B,search_term:L}=S;return(0,l.useImperativeHandle)(s,()=>({getSelection:I})),(0,l.useEffect)(()=>(C({loading:!0}),Promise.all([k(),z()]).finally(()=>C({loading:!1})),M),[]),(0,l.useEffect)(()=>{"function"===typeof c&&c(I())},[S.selected_organization_ids]),(0,N.jsxs)(Wc,{value:{allowGlobal:a,clearSelections:()=>C({selected_organization_ids:[]}),disableAll:i,disableTopParent:n,excludedIds:r,exploded:o,getOrgRole:e=>{var s,a,t,i;return(null===S||void 0===S||null===(s=S.organization_memberships)||void 0===s||null===(a=s.find)||void 0===a||null===(t=a.call(s,s=>(null===s||void 0===s?void 0:s.organization_id)===e))||void 0===t||null===(i=t.role)||void 0===i?void 0:i.name)||"Learner"},handleSelectOrganization:async e=>{if(E(null===e||void 0===e?void 0:e.id))return;const s=t?(e=>{const{selected_organization_ids:s}=S;return T(e)?null===s||void 0===s?void 0:s.filter(s=>s===e):[...s,e]})(null===e||void 0===e?void 0:e.id):T(null===e||void 0===e?void 0:e.id)?[]:[null===e||void 0===e?void 0:e.id];C({selected_organization_ids:s}),_&&"function"===typeof h&&await h(I())},isDisabled:E,isSelected:T,isTopParent:e=>e===u,loading:R,maxHeight:d,organization_id:u,organization_memberships:D,organizations:B,refresh:k,selectorLabel:v,selectorType:f,showRole:j},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>C({error:null}),show:F,variant:"danger",children:F}),!!x&&(0,N.jsxs)(Ei.A,{className:"p-2",children:[(0,N.jsx)(Ei.A.Text,{className:"border bg-white",children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{className:"border-start-0",onChange:e=>{var s;C({search_term:null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value}),(()=>{const{search_term:e}=S;w.current&&clearTimeout(w.current),w.current=setTimeout(()=>C({page:1,search_term:e},k),1e3)})()},placeholder:"Search",readOnly:R,value:L})]}),(0,N.jsx)(Uc,{})]})});Rc.displayName="OrganizationsPicker",Rc.defaultProps={allowGlobal:!0,disableAll:!1,disableTopParent:!1,excludedIds:[],organization_ids:[],returnType:"id",searchable:!0,selectorType:"radio",showRole:!1,submitOnSelect:!1};var Dc=Rc;const Bc=["children","className","loading","maxHeight","style"],Pc=e=>{const{children:s,className:a,loading:t,maxHeight:i,style:l}=e,n=(0,he.A)(e,Bc);return(0,N.jsx)(_e.A,(0,F.A)((0,F.A)({className:`'accordion-list d-flex flex-column p-1 ${i?"overflow-auto":""} ${a||""}`,style:(0,F.A)({maxHeight:i},l)},n),{},{children:(0,N.jsx)(Me.x_,{loading:t,children:s})}))};Pc.defaultProps={loading:!1,maxHeight:400,style:{}};var Lc=Pc;const Oc=["active","children","childSelected","className","depth","disabled","style"];var Hc=e=>{const{active:s,children:a,childSelected:t,className:i,depth:l,disabled:n,style:r}=e,o=(0,he.A)(e,Oc),d=oa()("accordion-list-item d-flex align-items-center mb-1 rounded",{active:s,"child-selected":t,disabled:n},i);return(0,N.jsx)(Ce.S,(0,F.A)((0,F.A)({className:d,style:(0,F.A)({marginLeft:16*l},r)},o),{},{children:a}))};var Uc=e=>{var s;const{allowGlobal:a,exploded:t,loading:i,maxHeight:l,organizations:n}=Kc(),r=(null===n||void 0===n||null===(s=n.filter)||void 0===s?void 0:s.call(n,e=>!e.parent_id))||[];let o=!t&&null!==r&&void 0!==r&&r.length?r:n||[];return(0,N.jsxs)(Lc,{className:"organization-picker-list",loading:i,maxHeight:l,children:[a&&(0,N.jsx)(Vc,{organization:{id:null}}),o.map((e,s)=>(0,N.jsx)(Vc,{organization:e},s))]})};const Qc=e=>{const{depth:s,organization:a}=e,{clearSelections:t,disableAll:i,disableTopParent:l,exploded:n,getOrgRole:r,handleSelectOrganization:o,isDisabled:d,isSelected:c,isTopParent:h,organizations:u,selectorLabel:m,selectorType:g,showRole:p}=Kc(),x=(null===a||void 0===a?void 0:a.id)||null,v=(null===a||void 0===a?void 0:a.organization_count)||0,f=l&&h(x),j=e=>{var s;return!(null===(s=u.filter(s=>s.parent_id===e))||void 0===s||!s.length)},_=e=>{if(j(e)){const s=u.filter(s=>s.parent_id===e).map(e=>null===e||void 0===e?void 0:e.id);for(const e of s){if(c(e))return!0;
2if(j(e))return _(e)}return!1}return!1},[b,A,y]=(0,ne.CQ)({collapsed:!h(x)}),w=u.filter(e=>(null===e||void 0===e?void 0:e.parent_id)===x),{collapsed:S}=b,C=S&&_(x);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Hc,{active:c(x),childSelected:C,depth:s,disabled:i||d(null===a||void 0===a?void 0:a.id),children:[!n&&(0,N.jsx)(Ce.S,{style:{width:36},children:!!v&&j(x)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ve.A,{className:"collapse-toggle text-decoration-none "+(c(x)||C?"":"text-dark"),disabled:f,onClick:()=>{f||(_(null===a||void 0===a?void 0:a.id)&&t(),A({collapsed:!b.collapsed}))},size:"sm",variant:c(x)||C?"outline-primary":"outline-light",children:S?(0,N.jsx)(ze.ZPM,{size:12}):(0,N.jsx)(ze.z44,{size:12})})})}),(0,N.jsx)(Ce.S,{className:"flex-1",children:(0,N.jsx)(Fl,{as:"h6",className:"mb-0 d-flex align-items-center",maxWidth:260-16*s,placement:"bottom",children:null===a.id?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Eh_,{className:"text-primary me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Global",id:"label.global.a258b30f"})]}):(0,N.jsx)(N.Fragment,{children:null===a||void 0===a?void 0:a.name})})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:[p&&(0,N.jsx)("span",{className:"text-muted me-2",children:r(null===a||void 0===a?void 0:a.id)}),i||!d(null===a||void 0===a?void 0:a.id)&&(()=>{switch(g){case"radio":return(0,N.jsx)(Zl.A,{checked:c(null===a||void 0===a?void 0:a.id),onChange:()=>o(a),type:"radio"});case"checkbox":return(0,N.jsx)(Zl.A,{checked:c(null===a||void 0===a?void 0:a.id),onChange:()=>o(a),type:"checkbox"});case"button":return(0,N.jsx)(ve.A,{className:"text-decoration-none",disabled:i,onClick:()=>o(a),size:"sm",variant:"outline-primary",children:m})}})()]})]}),!n&&!S&&(0,N.jsx)(N.Fragment,{children:w.map((e,a)=>(0,N.jsx)(Qc,{depth:s+1,organization:e},a))})]})};Qc.defaultProps={depth:0};var Vc=Qc;const Gc=l.createContext({}),Wc=Gc.Provider,Kc=(Gc.Consumer,()=>(0,l.useContext)(Gc));var Yc=e=>{const{handleSelectOrg:s,organization_id:a}=Nd(),t=(0,l.useRef)();return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Dc,{allowGlobal:!1,allowMultiSelect:!1,exploded:!1,onSelectionChange:s,preselectedOrganizationId:a,ref:t,searchable:!0,selectorType:"radio",submitOnSelect:!1})})};const qc=l.createContext({}),Jc=qc.Provider,Xc=(qc.Consumer,()=>(0,l.useContext)(qc)),Zc=(0,l.forwardRef)((s,a)=>{const{allowMultiSelect:t,excludedIds:i,onSelectionChange:n,onSubmit:r,organization_id:o,organization_memberships:d,scopeToUser:c,searchable:h,selectorType:u,submitOnSelect:m}=s,g=(0,l.useRef)(),{api:p}=(0,P.nm)(),[x,v,f]=(0,ne.CQ)({error:null,groups:[],loading:!1,organizations:[],search_term:"",selected_group_ids:[],show:!1,submitting:!1}),j=async()=>{try{const{loading:e,search_term:s}=x;if(e)return;v({groups:[],loading:!0});const{count:a,groups:t}=await p.get("/api/organizations/groups/list/1/1000",{organization_id:o,search_term:s,sort_direction:"ASC",sort_token:"name",user_id:c});v({count:a,groups:t,loading:!1})}catch(e){v({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message),loading:null})}},_=e=>{var s;return!(null===i||void 0===i||null===(s=i.includes)||void 0===s||!s.call(i,e))},b=e=>x.selected_group_ids.includes(e),A=e=>{const{selected_group_ids:s}=x;return b(e)?s.filter(s=>s!==e):[...s,e]},y=()=>{var e;return t?null===x||void 0===x?void 0:x.selected_group_ids:null===x||void 0===x||null===(e=x.selected_group_ids)||void 0===e?void 0:e[0]},w=()=>{var e;const{groups:s}=x,a=y();return t?s.filter(e=>{var s;return null===a||void 0===a||null===(s=a.includes)||void 0===s?void 0:s.call(a,null===e||void 0===e?void 0:e.id)}):null===s||void 0===s||null===(e=s.find)||void 0===e?void 0:e.call(s,e=>(null===e||void 0===e?void 0:e.id)===a)};(0,l.useImperativeHandle)(a,()=>({getFullSelection:w,getSelection:y,refresh:j})),(0,l.useEffect)(()=>(j(),f),[]),(0,l.useEffect)(()=>{"function"===typeof n&&n(y())},[x.selected_group_ids]);const{error:S,groups:C,loading:M,organizations:k,search_term:z,selected_group_ids:T,submitting:I}=x,E={clearSelections:()=>v({selected_group_ids:[]}),excludedIds:i,fetchGroups:j,getSelectedGroups:A,groups:C,handleSelectGroup:async e=>{if(_(null===e||void 0===e?void 0:e.id))return;const s=t?A(null===e||void 0===e?void 0:e.id):b(null===e||void 0===e?void 0:e.id)?[]:[null===e||void 0===e?void 0:e.id];v({selected_group_ids:s}),m&&"function"===typeof r&&await r(y())},isDisabled:_,isOrgAdmin:e=>{var s,a;return 2===(null===d||void 0===d||null===(s=d.find)||void 0===s||null===(a=s.call(d,s=>(null===s||void 0===s?void 0:s.organization_id)===e))||void 0===a?void 0:a.role_id)},isSelected:b,loading:M,organization_memberships:d,organizations:k,selected_group_ids:T,selectorType:u,submitting:I};return(0,N.jsxs)(Jc,{value:(0,F.A)({},E),children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>v({error:null}),show:S,variant:"danger",children:S}),!!h&&(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{className:"border bg-white",children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{className:"border-start-0",onChange:e=>{var s;v({search_term:null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value}),(()=>{const{search_term:e}=x;g.current&&clearTimeout(g.current),g.current=setTimeout(()=>v({page:1,search_term:e},j),1e3)})()},placeholder:"Search",value:z})]}),(0,N.jsx)(eh,{})]})});Zc.displayName="GroupPicker",Zc.defaultProps={allowMultiSelect:!0,body:"",excludedIds:[],hideOnSubmit:!1,searchable:!1,submitOnSelect:!1};var $c=Zc;var eh=e=>{const{excludedIds:s,groups:a,loading:t}=Xc(),i=(e=>e.filter(e=>!s.includes(null===e||void 0===e?void 0:e.id)))(a);return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(_e.A,{className:"group-picker-list d-flex pt-2 flex-column",children:(0,N.jsx)(Me.x_,{loading:t,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map((e,s)=>(0,N.jsx)(sh,{group:e},s))}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center p-5 border rounded",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No groups foun
2d",id:"label.no_groups_found.463d5fb4"})})})})})})};var sh=e=>{var s,a;const{group:t}=e,i=(null===t||void 0===t||null===(s=t.members)||void 0===s?void 0:s.length)||0,{handleSelectGroup:l,isDisabled:n,isSelected:r,selectorType:o}=Xc();return(0,N.jsxs)(Ce.S,{className:`group-picker-list-item d-flex align-items-center p-2 mb-1 rounded ${r(null===t||void 0===t?void 0:t.id)?"selected":""} ${n(null===t||void 0===t?void 0:t.id)?"disabled":""}`,children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-1 align-items-center",children:[(0,N.jsx)(_d,{group:t,size:32}),(0,N.jsx)(Fl,{as:"strong",className:"ms-2",maxWidth:250,placement:"bottom",children:null!==(a=null===t||void 0===t?void 0:t.name)&&void 0!==a?a:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Eh_,{className:"text-primary"})," Global"]})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)("span",{className:"small text-muted me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"{count} member{plural}",id:"label.count_memberplural.c0168180",values:{count:i,plural:0===i||i>1?"s":""}})}),!n(null===t||void 0===t?void 0:t.id)&&(0,N.jsx)(Ce.S,{children:(()=>{switch(o){case"radio":return(0,N.jsx)(Zl.A,{checked:r(null===t||void 0===t?void 0:t.id),onChange:()=>l(t),type:"radio"});case"checkbox":return(0,N.jsx)(Zl.A,{checked:r(null===t||void 0===t?void 0:t.id),onChange:()=>l(t),type:"checkbox"});case"button":return(0,N.jsx)(ve.A,{className:"text-decoration-none",onClick:()=>l(t),size:"sm",variant:"link",children:(0,N.jsx)(ze.Z0P,{})})}})()})]})]})};var ah=e=>{const{getUserOrganizationMembership:s,userId:a,userIsOrgAdmin:t,userIsSiteAdmin:i}=(0,P.nm)(),{handleSelectGroup:n,organization_id:r}=Nd(),o=(0,l.useRef)();return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)($c,{allowMultiSelect:!1,exploded:!0,include_sub_orgs:i()||t(),onSelectionChange:n,organization_id:r,organization_memberships:s(),ref:o,scopeToUser:i()||t()?null:a,searchable:!1,selectorType:"radio",submitOnSelect:!1})})};var th=()=>{const{component:e,component_type:s,design_lab_template:a,handleComponentSelected:t,organization_id:i}=Nd(),l=()=>{switch(s){case"challenge":return(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"});case"journey":return(0,N.jsx)(ke.A,{defaultMessage:"Journey",id:"label.journey.fe50ed10"});case"cartridge":return(0,N.jsx)(ke.A,{defaultMessage:"Third party",id:"label.third_party.f3c6dbcc"});default:return(0,N.jsx)(N.Fragment,{})}};return e?(0,N.jsx)(Ce.S,{className:"step-2",children:(0,N.jsx)(Ge.A,{className:"acw-selected-component",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(Ad,{component:e,size:44,type:s}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("small",{className:"text-uppercase fw-semibold text-muted",style:{fontSize:"0.7rem",letterSpacing:"0.04em"},children:l()}),(0,N.jsx)(Fl,{as:"strong",maxWidth:300,placement:"bottom",children:(null===e||void 0===e?void 0:e.title)||""})]})]}),!a&&(0,N.jsx)(ve.A,{onClick:()=>t(null),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]})})}):(0,N.jsx)(Ce.S,{className:"step-2 acw-step-2-picker",children:(0,N.jsx)(cd,{is_modal:!1,onSelect:t,organization_id:i})})};var ih=()=>{const{assignment:e,component:s,component_type:a,inline_scheduler:t}=Nd(),{cover_path:i,title:l,total_est_completion_time:n}=s||{};return(0,N.jsxs)(Ce.S,{className:"step-3",children:[(0,N.jsxs)(Ce.S,{className:"acw-schedule-meta d-flex align-items-center gap-3 pb-3 mb-3",children:[(0,N.jsx)(Me.R_,{alt:`"${l}" cover image`,height:56,imageClassname:`cover-image ${a}`,imageHeight:56,imageWidth:84,src:i||pc,width:84}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{className:"m-0",children:l}),(0,N.jsxs)("small",{className:"d-flex gap-1 align-items-center text-muted mt-1",children:[(0,N.jsx)(ze.w_X,{}),(0,N.jsx)(Vh,{duration:n,label_type:"long",unit:"minutes"})]})]})]}),(0,N.jsx)(gc,{assignment:e,ref:t,template:s,type:a})]})};var lh=()=>{const{formatMessage:e}=(0,ja.A)(),{parseBinary:s}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},{assignment:a,group:t,learners:i,loading:l,selected_learners:n,toggleLearnerSelection:r,toggleSelectAllLearners:o,updateAssignmentValues:d}=Nd(),c=e=>{d({assign_all:s(e.target.value)})},h=e=>n.includes(e),u=!s(null===a||void 0===a?void 0:a.assign_all);return(0,N.jsx)(Ce.S,{className:"step-4",children:(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Check,{checked:!!s(null===a||void 0===a?void 0:a.assign_all),defaultChecked:!!s(null===a||void 0===a?void 0:a.assign_all),disabled:l,name:"assign_all",onChange:c,type:"radio",value:1,label:e({id:"label.all_learners_in_group.f88e9a2f",defaultMessage:"All learners in {group}"},{group:null===t||void 0===t?void 0:t.name})}),(0,N.jsx)(_e.A.Check,{checked:!s(null===a||void 0===a?void 0:a.assign_all),defaultChecked:!s(null===a||void 0===a?void 0:a.assign_all),disabled:l,name:"assign_all",onChange:c,type:"radio",value:0,label:e({id:"label.select_specific_learners.4155817d",defaultMessage:"Select specific learners"})})]}),u&&(0,N.jsx)(Ce.S,{className:"acw-learner-list mt-2",children:(0,N.jsxs)(yl.A,{variant:"flush",children:[(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center",children:[(0,N.jsx)(_e.A.Check,{checked:(null===n||void 0===n?void 0:n.length)===(null===i||void 0===i?void 0:i.length)&&!(null===i||void 0===i||!i.length),className:"me-3",onChange:o}),(0,N.jsx)("span",{className:"fw-semibold",children:(0,N.jsx)(ke.A,{defaultMessage:"All learners",id:"label.all_learners.df997d3d"})})]}),!(null===i||void 0===i||!i.length)&&i.map((e,s)=>{var a;const{id:t}=e||{},i=null===e||void 0===e||null===(a=e.organization_member)||void 0===a?void 0:a.user,{fullname:l}=i||{};return(0,N.jsxs)(yl.A.Item,{action:!0,className:"d-flex align-items-center",onClick:()=>r(t),children:[(0,N.jsx)(_e.A.Check,{readOnly:!0,checked:h(t),className:"me-3"}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:24,user:i}),(0,N.jsx)("strong",{className:"mb-0",children:l})]})]},s)}),!(null!==i&&void 0!==i&&i.length)&&(0,N.jsx)(yl.A.Item,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"There are no learners in this group",id:"label.there_are_no_learners_in_this_grou.c2a7481c"})})]})}),(0,N.jsx)(os,{className:"mt-3",children:(0,N.jsx)(_e.A.Check,{checked:!!s(null===a||void 0===a?void 0:a.assign_to_new),defaultChecked:!!s(null===a||void 0===a?void 0:a.assign_to_new),disabled:l,name:"assign_to_new",onChange:e=>d({assign_to_new:s(e.target.checked)}),label:e({id:"label.auto_assign_to_new_learners.32c03a7f",defaultMessage:"Auto-assign to new learners"})})})]})})},nh=t(13527);var rh=t.p+"static/media/default_competency_icon.e35342d5503152ea0229f52806c3e013.svg";const oh=e=>{const{competency:s,size:a}=e,t={collaboration:nh.collaborator_white,communication:nh.communicator_white,creativity:nh.creativity_white,"critical-thinking":nh.critical_white,default:rh};
2return(0,N.jsx)(Zs.A,{"aria-hidden":!0,className:"competency-icon",height:a,src:(null===t||void 0===t?void 0:t[s])||t.default,width:a})};var dh=oh;var ch=()=>{var s,a,t;const{assignment:i,component:l,component_type:n,loading:r,organization_id:o,show_notification_option:d,updateAssignmentValues:c}=Nd(),{formatMessage:h}=(0,ja.A)(),{parseBinary:u}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},{api:m}=(0,P.nm)(),[g,p]=(0,ne.CQ)({expanded_cert_id:null,picker_count:0,picker_loading:!1,picker_open:!1,picker_page:1,picker_page_size:8,picker_results:[],picker_search:"",selected_certification:null}),x=e=>{const s=u(e.target.value);c({allow_teams:s,enable_voice_chat:s?1:0})},v=async s=>{const a=s||g.picker_page;try{p({picker_loading:!0});const{certification_templates:e,count:s}=await m.post(`/api/certification-templates/search/${a}/${g.picker_page_size}`,{challenge_template_id:(null===l||void 0===l?void 0:l.id)||void 0,organization_id:o||void 0,search_term:g.picker_search});p({picker_count:s,picker_loading:!1,picker_page:a,picker_results:e||[]})}catch(e){p({picker_loading:!1})}},f="challenge"===n&&(null===l||void 0===l||null===(s=l.agent_personas)||void 0===s?void 0:s.length)>0,j="challenge"===n;return(0,N.jsxs)(Ce.S,{className:"step-5",children:[(0,N.jsx)(_e.A,{onSubmit:e=>e.preventDefault(),children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Check,{checked:!!u(null===i||void 0===i?void 0:i.allow_teams),defaultChecked:!!u(null===i||void 0===i?void 0:i.allow_teams),disabled:r,name:"allow_teams",onChange:x,type:"radio",value:1,label:h({id:"label.learners_will_work_in_teams.cbc9ecbe",defaultMessage:"Learners will work in teams"})}),(0,N.jsx)(_e.A.Check,{checked:!u(null===i||void 0===i?void 0:i.allow_teams),defaultChecked:!u(null===i||void 0===i?void 0:i.allow_teams),disabled:r,name:"allow_teams",onChange:x,type:"radio",value:0,label:h({id:"label.learners_will_work_individually.129bdf1c",defaultMessage:"Learners will work individually"})}),(!!u(null===i||void 0===i?void 0:i.allow_teams)||!!d||f)&&(0,N.jsx)("hr",{}),!!u(null===i||void 0===i?void 0:i.allow_teams)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(_e.A.Check,{checked:!!u(null===i||void 0===i?void 0:i.enable_voice_chat),defaultChecked:!!u(null===i||void 0===i?void 0:i.enable_voice_chat),disabled:r,name:"enable_voice_chat",onChange:e=>c({enable_voice_chat:u(e.target.checked)}),label:h({id:"label.enable_voice_chat.69f224b5",defaultMessage:"Enable voice chat"})})}),f&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(os,{className:"d-flex",children:(0,N.jsx)(_e.A.Check,{checked:!!u(null===i||void 0===i?void 0:i.enable_agent_personas),className:"align-items-start",disabled:r,id:"enableAgentPersonas",name:"enable_agent_personas",onChange:e=>{if(u(e.target.checked)){const e=((null===l||void 0===l?void 0:l.agent_personas)||[]).map(e=>e.agent_persona_stub_id);c({agent_persona_stub_ids:e,enable_agent_personas:1})}else c({agent_persona_stub_ids:[],enable_agent_contributions:1,enable_agent_personas:0})},label:(0,N.jsxs)("p",{className:"mb-0",children:[(0,N.jsx)("span",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Include AI agent teammates",id:"label.include_ai_agent_teammates.4ead89bc"})}),(0,N.jsx)("span",{className:"d-block text-secondary small",children:(0,N.jsx)(ke.A,{defaultMessage:"AI agents will be available to assist learners as they work through this challenge.",id:"label.ai_agents_will_be_available_to_ass.b7f1e625"})})]})})}),!!u(null===i||void 0===i?void 0:i.enable_agent_personas)&&(0,N.jsxs)(Ce.S,{className:"ms-4 mt-2 mb-2",children:[(0,N.jsx)("small",{className:"text-muted d-block mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Select which agents to include:",id:"label.select_which_agents_to_include.4e503300"})}),l.agent_personas.map(e=>{var s;const a=null===e||void 0===e||null===(s=e.agent_persona_stub)||void 0===s?void 0:s.current;if(!a)return null;const t=null===a||void 0===a?void 0:a.category,l=e.agent_persona_stub_id,n=((null===i||void 0===i?void 0:i.agent_persona_stub_ids)||[]).includes(l);return(0,N.jsx)(_e.A.Check,{checked:n,className:"mb-2",disabled:r,id:`agent-persona-${l}`,onChange:e=>((e,s)=>{const a=(null===i||void 0===i?void 0:i.agent_persona_stub_ids)||[],t=s?[...a,e]:a.filter(s=>s!==e);c({agent_persona_stub_ids:t})})(l,e.target.checked),label:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[a.avatar_path?(0,N.jsx)(md,{name:a.name,size:24,src:a.avatar_path}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{background:(null===t||void 0===t?void 0:t.color)||"#6c757d",borderRadius:"50%",color:"#fff",flexShrink:0,fontSize:11,height:24,width:24},children:(a.name||"?").charAt(0).toUpperCase()}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("span",{className:"d-block",children:a.name}),(null===t||void 0===t?void 0:t.name)&&(0,N.jsx)("small",{className:"d-block text-muted",children:t.name})]})]})},l)}),(0,N.jsx)(_e.A.Check,{checked:!!u(null===i||void 0===i?void 0:i.enable_agent_c
2ontributions),className:"align-items-start mt-3",disabled:r,id:"enableAgentContributions",name:"enable_agent_contributions",onChange:e=>c({enable_agent_contributions:u(e.target.checked)}),label:(0,N.jsxs)("p",{className:"mb-0",children:[(0,N.jsx)("span",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Allow AI teammates to edit the challenge",id:"label.allow_ai_teammates_to_edit_the_cha.67d3969f"})}),(0,N.jsx)("span",{className:"d-block text-secondary small",children:(0,N.jsx)(ke.A,{defaultMessage:"When off, AI teammates can chat and offer suggestions, but cannot make changes to the challenge themselves.",id:"label.when_off_ai_teammates_can_chat_and.6e991af1"})})]})})]})]}),j&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("hr",{}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{className:"fw-semibold",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})}),(0,N.jsx)("p",{className:"text-muted small mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Optionally associate a certification that learners can earn upon completing this challenge.",id:"label.optionally_associate_a_certificati.ef2a2197"})}),g.selected_certification?(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3 p-3 border rounded",children:[g.selected_certification.icon_path?(0,N.jsx)("img",{alt:"",src:g.selected_certification.icon_path,style:{flexShrink:0,height:36,objectFit:"contain",width:36}}):(0,N.jsx)(ze.veT,{className:"text-muted",size:22,style:{flexShrink:0}}),(0,N.jsxs)(Ce.S,{className:"flex-grow-1",children:[(0,N.jsx)("strong",{className:"d-block",children:g.selected_certification.title}),g.selected_certification.description&&(0,N.jsx)("small",{className:"d-block text-muted",children:g.selected_certification.description})]}),(0,N.jsx)(ve.A,{onClick:()=>{p({selected_certification:null}),c({certification_template_id:null})},size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})]}):(0,N.jsxs)(Ce.S,{className:"text-center p-4 rounded",style:{backgroundColor:"rgba(213, 217, 220, 0.32)"},children:[(0,N.jsx)("p",{className:"text-muted mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"No certification selected",id:"label.no_certification_selected.3756f165"})}),(0,N.jsxs)(ve.A,{onClick:()=>p({picker_open:!0,picker_page:1,picker_search:""},()=>v(1)),variant:"primary",children:[(0,N.jsx)(ze.veT,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Select certification",id:"label.select_certification.fca43c30"})]})]})]})]}),d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("hr",{}),(0,N.jsx)(os,{className:"d-flex",children:(0,N.jsx)(_e.A.Check,{checked:u(null===i||void 0===i?void 0:i.notify_learners),className:"align-items-start",id:"notifyLearners",name:"notify_learners",onChange:e=>c({notify_learners:u(e.target.checked)}),label:(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners of assignment",id:"label.notify_learners_of_assignment.43ea6722"})}),(0,N.jsx)("span",{className:"d-block text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Send an email to learners when this assignment is available. We will consolidate emails for multiple assignments available together.",id:"label.send_an_email_to_learners_when_thi.02c6069d"})})]})})})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(os,{className:"d-flex",children:(0,N.jsx)(_e.A.Check,{checked:u(null===i||void 0===i?void 0:i.enable_grading),className:"align-items-start",id:"enableGrading",name:"enable_grading",onChange:e=>c({enable_grading:u(e.target.checked)}),label:(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Enable grading",id:"label.enable_grading.599a8e50"})}),(0,N.jsx)("span",{className:"d-block text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Allow facilitators to grade completed challenges. When off, the 'Awaiting Grading' step is hidden for this assignment.",id:"label.allow_facilitators_to_grade_comple.c7b58169"})})]})})})]})}),(0,N.jsxs)(xe,{onHide:()=>p({picker_open:!1,picker_results:[],picker_search:""}),show:g.picker_open,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select certification",id:"label.select_certification.fca43c30"})})}),(0,N.jsxs)(xe.Body,{className:"p-0",children:[(0,N.jsx)(Ce.S,{className:"p-3 border-bottom",children:(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(_e.A.Control,{className:"flex-grow-1",onChange:e=>p({picker_search:e.target.value}),onKeyDown:e=>"Enter"===e.key&&(e.preventDefault(),v(1)),placeholder:h({id:"label.search_certifications.a4ce710c",defaultMessage:"Search certifications..."}),value:g.picker_search}),(0,N.jsx)(ve.A,{onClick:()=>v(1),children:(0,N.jsx)(ze.KSO,{})})]})}),(0,N.jsxs)(Me.x_,{loading:g.picker_loading,children:[(0,N.jsxs)(yl.A,{variant:"flush",children:[null===(a=g.picker_results)||void 0===a?void 0:a.map((e,s)=>{var a;const t=g.expanded_cert_id===e.id;return(0,N.jsxs)(yl.A.Item,{className:"p-0",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3 py-3 px-3",children:[e.icon_path?(0,N.jsx)("img",{alt:"",src:e.icon_path,style:{flexShrink:0,height:32,objectFit:"contain",width:32}}):(0,N.jsx)(ze.veT,{className:"text-muted",size:22,style:{flexShrink:0}}),(0,N.jsxs)(Ce.S,{className:"flex-grow-1",style:{minWidth:0},children:[(0,N.jsx)("strong",{className:"d-block",children:e.title}),e.description&&!t&&(0,N.jsx)("small",{className:"d-block text-muted text-truncate",children:e.description})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",style:{flexShrink:0},children:[(0,N.jsx)(ve.A,{className:"text-muted p-0",onClick:()=>p({expanded_cert_id:t?null:e.id}),size:"sm",variant:"link",children:t?(0,N.jsx)(ze.Ucs,{size:12}):(0,N.jsx)(ze.Vr3,{size:12})}),(0,N.jsx)(ve.A,{onClick:()=>(e=>{p({picker_open:!1,selected_certification:e}),c({certification_template_id:e.id})})(e),size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Select",id:"label.select.2a78025d"})})]})]}),t&&(0,N.jsxs)(Ce.S,{className:"px-3 pb-3 pt-1 d-flex flex-column gap-3",style:{backgroundColor:"var(--gray-50, #f8f9fa)",borderTop:"1px solid var(--gray-200, #e9ecef)"},children:[e.description&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("small",{className:"fw-semibold text-muted d-block mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)("p",{className:"mb-0 small",children:e.description})]}),e.certification_accreditor&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("small",{className:"fw-semibold text-muted d-block mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Certifying body",id:"label.certifying_body.c7dccd78"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[e.certification_accreditor.logo_path?(0,N.jsx)("img",{alt:"",src:e.certification_accreditor.logo_path,style:{borderRadius:4,flexShrink:0,height:28,objectFit:"contain",width:28}}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center",style:{backgroundColor:"var(--gray-300, #dee2e6)",borderRadius:4,flexShrink:0,height:28,width:28},children:(0,N.jsx)(ze.veT,{className:"text-muted",size:14})}),(0,N.jsx)("span",{className:"small fw-semibold",children:e.certification_accreditor.name})]})]}),(null===(a=e.competencies)||void 0===a?void 0:a.length)>0&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("small",{className:"fw-semibold text-muted d-block mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies",id:"label.competencies.ec64b47c"})}),(0,N.jsx)(Ce.S,{className:"d-flex flex-wrap gap-2",children:e.competencies.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1 px-2 py-1 rounded",style:{backgroundColor:"var(--gray-200, #e9ecef)"},children:[(0,N.jsx)(oh,{competency:e.slug,size:16}),(0,N.jsx)("small",{className:"fw-semibold",children:e.name})]},s))})]})]})]},s)}),!(null!==(t=g.picker_results)&&void 0!==t&&t.length)&&!g.picker_loading&&(0,N.jsx)(yl.A.Item,{className:"text-center text-muted py-4",children:(0,N.jsx)(ke.A,{defaultMessage:"No certifications foun
2d",id:"label.no_certifications_found.5c62e166"})})]}),(0,N.jsx)(Ce.S,{className:"p-2",children:(0,N.jsx)(Lr,{count:g.picker_count,onChange:e=>p({picker_page:e},()=>v(e)),page:g.picker_page,page_size:g.picker_page_size})})]})]})]})]})},hh=[Yc,ah,th,ih,lh,ch];const uh=[0,1,2,3,4,5];var mh=()=>{const{design_lab_template:e,group:s,handleClose:a,initial_step:t,step:i}=Nd(),l=(null===s||void 0===s?void 0:s.name)||"",n=uh.filter(s=>!(s<t)&&(2!==s||!e)).indexOf(i)+1,r={0:{subtitle:(0,N.jsx)(ke.A,{defaultMessage:"Choose which organization this assignment belongs to.",id:"label.choose_which_organization_this_ass.121ed65e"}),title:(0,N.jsx)(ke.A,{defaultMessage:"Select organization",id:"label.select_organization.99e5009d"})},1:{subtitle:(0,N.jsx)(ke.A,{defaultMessage:"Which group should be assigned?",id:"label.which_group_should_be_assigned.01a455a5"}),title:(0,N.jsx)(ke.A,{defaultMessage:"Select group",id:"label.select_group.720c488f"})},2:{subtitle:s?(0,N.jsx)(ke.A,{defaultMessage:"Assign to learners in {group_name}",id:"label.assign_to_learners_in_group_name.e388ee67",values:{group_name:(0,N.jsx)("strong",{children:l})}}):(0,N.jsx)(ke.A,{defaultMessage:"Choose a challenge, journey, or course to assign.",id:"label.choose_a_challenge_journey_or_cour.d2527766"}),title:(0,N.jsx)(ke.A,{defaultMessage:"Select assignment",id:"label.select_assignment.be168ddb"})},3:{subtitle:(0,N.jsx)(ke.A,{defaultMessage:"Set when learners can access and submit this assignment.",id:"label.set_when_learners_can_access_and_s.3f74479c"}),title:(0,N.jsx)(ke.A,{defaultMessage:"Schedule assignment",id:"label.schedule_assignment.22e45ec8"})},4:{subtitle:s?(0,N.jsx)(ke.A,{defaultMessage:"Choose which learners in {group_name} to assign.",id:"label.choose_which_learners_in_group_nam.fff6f1ee",values:{group_name:(0,N.jsx)("strong",{children:l})}}):(0,N.jsx)(ke.A,{defaultMessage:"Choose which learners to include in this assignment.",id:"label.choose_which_learners_to_include_i.1bde7e10"}),title:(0,N.jsx)(ke.A,{defaultMessage:"Select assignees",id:"label.select_assignees.a382f019"})},5:{subtitle:(0,N.jsx)(ke.A,{defaultMessage:"Configure team settings and learner notifications.",id:"label.configure_team_settings_and_learne.f74aa2e6"}),title:(0,N.jsx)(ke.A,{defaultMessage:"Additional options",id:"label.additional_options.092170b2"})}}[i];return r?(0,N.jsxs)(Ce.S,{className:"acw-main-header",children:[(0,N.jsx)("button",{"aria-label":"Close",className:"btn-close acw-main-close",onClick:a,type:"button"}),n>0&&(0,N.jsxs)("p",{className:"acw-main-step-label",children:["Step ",n]}),(0,N.jsx)("h4",{className:"acw-main-title",children:r.title}),r.subtitle&&(0,N.jsx)("p",{className:"acw-main-subtitle",children:r.subtitle})]}):null};const gh=e=>{const{children:s,className:a,condition:t,disabled:i,href:l,onClick:n,size:r,style:o,to:d,tooltipClassname:c,tooltipContent:h,tooltipPlacement:u,tooltipTrigger:m,variant:g}=e;return(0,N.jsx)(Oa,{condition:t,wrapper:e=>(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ua.A,{placement:u,trigger:m,overlay:(0,N.jsx)(Qa.A,{className:c||"",children:h}),children:s=>(0,N.jsx)("div",(0,F.A)((0,F.A)({},s),{},{className:"tooltip-button-wrapper d-flex align-items-center",children:e}))})}),children:d?(0,N.jsx)(N.Fragment,{children:i?(0,N.jsxs)("span",{className:`tooltip-button text-muted ${a||""}`,children:[!!t&&(0,N.jsx)("div",{className:"trigger-target position-absolute",role:"none"}),s]}):(0,N.jsxs)(Le.Link,{className:`tooltip-button ${a||""}`,style:o,to:d,children:[!!t&&(0,N.jsx)("div",{className:"trigger-target position-absolute",role:"none"}),s]})}):(0,N.jsxs)(ve.A,{className:`tooltip-button ${a||""}`,disabled:i,href:l,onClick:n,size:r,style:o,variant:g,children:[!!t&&(0,N.jsx)("div",{className:"trigger-target position-absolute",role:"none"}),s]})})};gh.defaultProps={className:"",disabled:!1,onClick:Function(),style:{},tooltipClassname:"",tooltipPlacement:"right",tooltipTrigger:["hover","focus"],variant:"primary"};var ph=gh;const xh=["children","className","tooltipClassname","tooltipContent","tooltipPlacement","tooltipTrigger"],vh=e=>{const{children:s,className:a,tooltipClassname:t,tooltipContent:i,tooltipPlacement:n,tooltipTrigger:r}=e,o=(0,he.A)(e,xh),d=(0,l.useRef)(null),c=()=>{switch(n){case"top":case"bottom":case"left":case"right":return[0,8];default:return[0,0]}};return(0,N.jsx)(Ua.A,{offset:c(),overlay:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({className:`tooltip-content ${t}`,ref:d},e),{},{children:i})),placement:n,trigger:r,popperConfig:{modifiers:[{name:"preventOverflow",options:{padding:8}},{name:"offset",options:{offset:c()}}]},children:(0,N.jsx)("div",(0,F.A)((0,F.A)({className:`tooltip-wrapper ${a}`,style:{display:"inline-flex",position:"relative"}}
2,o),{},{children:s}))})};vh.defaultProps={className:"",tooltipClassname:"",tooltipPlacement:"right",tooltipTrigger:["hover","focus"]};var fh=vh;const jh=e=>{const{children:s,className:a,condition:t,disabled:i,onClick:l,tooltipClassname:n,tooltipContent:r,tooltipPlacement:o,tooltipTrigger:d}=e;return(0,N.jsx)(Oa,{condition:t,wrapper:e=>(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ua.A,{placement:o,trigger:d,overlay:(0,N.jsx)(Qa.A,{className:n||"",children:r}),children:s=>(0,N.jsx)("div",(0,F.A)((0,F.A)({},s),{},{className:"tooltip-button-wrapper",children:e}))})}),children:(0,N.jsxs)(li.A.Item,{className:`${a||""}`,disabled:i,onClick:l,children:[!!t&&(0,N.jsx)("div",{className:"trigger-target position-absolute",role:"none"}),s]})})};jh.defaultProps={className:"",disabled:!1,onClick:Function(),style:{},tooltipClassname:"",tooltipPlacement:"right",tooltipTrigger:["hover","focus"]};var _h=()=>{const{component:e,createAssignment:s,group_id:a,handleNext:t,handlePrevious:i,initial_step:l,organization_id:n,step:r}=Nd(),o=()=>{switch(r){case 0:return!n;case 1:return!a;case 2:return(0,T.isEmpty)(e);default:return!1}};return(0,N.jsxs)(Ce.S,{className:"acw-main-footer",children:[r>l?(0,N.jsx)(ve.A,{onClick:i,size:"lg",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})}):(0,N.jsx)("div",{}),5===r?(0,N.jsx)(ve.A,{onClick:s,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Assign",id:"label.assign.8ece895c"})}):(0,N.jsx)(ph,{condition:o(),disabled:o(),onClick:t,size:"lg",tooltipContent:(()=>{switch(r){case 0:return(0,N.jsx)(ke.A,{defaultMessage:"You must select an organization before continuing",id:"label.you_must_select_an_organization_be.4e31639e"});case 1:return(0,N.jsx)(ke.A,{defaultMessage:"You must select a group before continuing",id:"label.you_must_select_a_group_before_con.81d756d5"});case 2:return(0,N.jsx)(ke.A,{defaultMessage:"You must select an assignment before continuing",id:"label.you_must_select_an_assignment_befo.f3135314"});default:return(0,N.jsx)(ke.A,{defaultMessage:"One or more steps are incomplete",id:"label.one_or_more_steps_are_incomplete.7c47aa76"})}})(),children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})]})},bh=t(64381);const Ah=(0,l.forwardRef)((e,s)=>{const a=(0,l.useRef)(),{api:t}=(0,P.nm)(),[i,n,r]=(0,ne.CQ)({assignable:!1,component:{},component_id:null,error:null,loading:!1,onHide:null,resolve:Function(),selectable:!1,show:!1,type:null}),{assignable:o,component:d,error:c,loading:h,resolve:u,selectable:m,show:g,type:p}=i,x=e=>new Promise(async s=>{n({assignable:!(null===e||void 0===e||!e.assignable),component_id:null===e||void 0===e?void 0:e.component_id,onHide:null===e||void 0===e?void 0:e.onHide,resolve:s,selectable:!(null===e||void 0===e||!e.selectable),show:!0,type:null===e||void 0===e?void 0:e.type}),await j(e.type,e.component_id)}),v=()=>{"function"===typeof i.onHide&&i.onHide(),r(()=>u(!1))},f=()=>{u({component:i.component}),v()},j=async(e,s)=>{try{n({loading:!0});const a=await t.get(`/api/marketplace/${e}-template-details/${s}`);n({component:null===a||void 0===a?void 0:a[`${e}_template`],loading:!1})}catch({err:err}){n({error:err,loading:!1})}};(0,l.useImperativeHandle)(s,()=>({hide:v,show:x})),(0,l.useEffect)(()=>r,[]);const _=(null===Fh||void 0===Fh?void 0:Fh[p])||l.Fragment,b=p?{onSelect:f,template:d}:{};return(0,N.jsx)(Lh,{value:{assignable:o,clearError:()=>n({error:null}),component:d,error:c,handleClickCTA:async()=>o?await(async()=>{const e=null===a||void 0===a?void 0:a.current;if(!e||!d)return;const{assignment:s}=await e.show({component:d,component_type:p,template:d})||{};return s?history.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`):void 0})():m?f():void 0,handleHide:v,selectable:m,type:p},children:(0,N.jsxs)(xe,{className:`assignment-component-details-modal ${p}`,id:"assignmentComponentDetailsModal",onHide:v,show:g,size:"xl",children:[(0,N.jsxs)(xe.Header,{children:[(0,N.jsx)(bh.A,{className:"custom-close-btn",onClick:v}),(0,N.jsx)(Dh,{})]}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"flex-1",loading:h,children:(0,N.jsx)(_,(0,F.A)({},b))})}),(0,N.jsx)(cc,{ref:a})]})})});
2Ah.displayName="AssignmentComponentDetailsModal";var yh,wh,Nh=Ah;const Sh=["title","titleId"];function Ch(){return Ch=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},Ch.apply(null,arguments)}function Mh(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,Sh);return l.createElement("svg",Ch({width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,yh||(yh=l.createElement("path",{d:"M14.1501 22.0998L7.90014 14.6998C7.75014 14.5498 7.80014 14.2998 7.95014 14.1498L8.90014 13.3498C9.05014 13.1998 9.30014 13.2498 9.45014 13.3997L14.4501 19.2498L28.1501 2.04975C28.3001 1.89975 28.5001 1.84975 28.7001 1.99975L29.7001 2.79975C29.8501 2.94975 29.9001 3.14975 29.7501 3.34975L14.7501 22.1497C14.6001 22.2997 14.4001 22.3498 14.2001 22.1998C14.2001 22.1498 14.2001 22.0998 14.1501 22.0998Z",fill:"#008087"})),wh||(wh=l.createElement("path",{d:"M24.7999 12.7004C27.2999 17.9504 25.0499 24.2504 19.7999 26.7504C14.5499 29.2504 8.24988 27.0004 5.74988 21.7504C3.24988 16.5004 5.49988 10.2004 10.7499 7.70041C13.9499 6.20041 17.6999 6.40041 20.6999 8.20041L21.9499 6.60041C16.1999 2.90041 8.44988 4.60041 4.79988 10.4504C1.14988 16.3004 2.84988 24.0004 8.64988 27.6504C14.4499 31.3004 22.1999 29.6004 25.8499 23.8004C28.2999 19.9004 28.4499 15.0004 26.1499 10.9504L24.7999 12.7004Z",fill:"#D5D9DC"})))}const kh=l.forwardRef(Mh);t.p;var zh=e=>{var s,a;const{clearError:t,component:i,error:l}=Oh(),{author_avatar_image_path:n,author_name:r,learning_objectives:o,stub:d}=i||{},c=(null===d||void 0===d||null===(s=d.tags)||void 0===s||null===(a=s.map)||void 0===a?void 0:a.call(s,e=>null===e||void 0===e?void 0:e.tag))||[];return(0,N.jsxs)(Ue.A,{fluid:!0,className:"widget-container d-flex flex-column gap-lg-5",children:[(0,N.jsx)(Bh,{}),(0,N.jsx)(We.A,{dismissible:!0,onClose:t,show:l,variant:"danger",children:l}),(0,N.jsxs)(Ce.S,{className:"widget-row d-flex flex-column flex-lg-row gap-lg-5 flex-1 mb-5",children:[(0,N.jsx)(Ge.A,{className:"d-flex flex-shrink-0",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objectives",id:"label.learning_objectives.d38eb0fc"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Identify strategies that can help you:",id:"label.identify_strategies_that_can_help.68116b74"})}),!(null===o||void 0===o||!o.length)&&(0,N.jsx)("ul",{className:"list-style-none d-flex flex-column gap-2",children:o.map((e,s)=>(0,N.jsxs)("li",{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(kh,{}),e]},s))})]})}),(0,N.jsx)(Ge.A,{className:"flex-fill",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),null!==c&&void 0!==c&&c.length?(0,N.jsx)(Ce.S,{className:"d-flex flex-wrap gap-1",children:c.map((e,s)=>(0,N.jsx)(Co,{tag:e},s))}):(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(md,{size:48,src:n}),(0,N.jsx)("h6",{className:"m-0",children:r})]})]})]})})]})]})};var Th=t.p+"static/media/grade_icon.d5b02dfca8a887fb6597a57e2c65dfa8.svg";var Ih=e=>{var s;const{onSelect:a,template:t}=e,{agent_personas:i,audiences:n,author_avatar_image_path:r,author_name:o,cover_path:d,learning_goals:c,overview:h,stub:u,title:m,total_est_completion_time:g}=t,{utils:p}=(0,P.nm)(),x=(0,Pe.W6)(),{assignable:v,clearError:f,error:j,selectable:_}=Oh(),b=(0,l.useRef)();return(0,N.jsxs)(Ue.A,{fluid:!0,className:"challenge-template-details",children:[(0,N.jsx)("h3",{className:"mb-3",children:m}),(0,N.jsx)(We.A,{dismissible:!0,onClose:f,show:j,variant:"danger",children:j}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"challenge-details",lg:8,children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:6,xl:7,children:!!o&&(0,N.jsxs)(Ce.S,{className:"author-details",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(Me.R_,{roun
2dedCircle:!0,alt:`An image of author ${o||""}`,height:32,src:r,width:32}),(0,N.jsx)("span",{className:"lead",children:o})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{className:"m-0",children:[(0,N.jsxs)(Ve.A,{xs:3,children:[(0,N.jsx)("small",{className:"fw-semibold d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience",id:"label.audience.545c0235"})}),(0,N.jsxs)("small",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(Zs.A,{alt:"school house",height:18,src:Th,width:18}),p.parseAudienceRange(n)]})]}),(0,N.jsxs)(Ve.A,{xs:4,children:[(0,N.jsx)("small",{className:"fw-semibold d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Time",id:"label.time.33b93476"})}),(0,N.jsxs)("small",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.obD,{color:"var(--primary)"}),(0,N.jsx)(Vh,{duration:g,unit:"minutes"})]})]})]}),(0,N.jsx)("hr",{})]})}),(0,N.jsx)(Ve.A,{className:"d-none d-lg-flex",lg:6,xl:5,children:t&&d&&(0,N.jsx)(Zs.A,{fluid:!0,rounded:!0,src:d})})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})}),(0,N.jsx)(Ce.S,{dangerouslySetInnerHTML:{__html:h}})]})]}),(0,N.jsxs)(Ve.A,{lg:4,children:[(!!v||!!_)&&(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsx)(ve.A,{block:!0,onClick:v?async()=>{const e=null===b||void 0===b?void 0:b.current;if(!e||!t)return;const{assignment:s}=await e.show({component:t,component_type:"challenge",template:t})||{};s&&x.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`)}:a,size:"lg",variant:"primary",children:v?(0,N.jsx)(ke.A,{defaultMessage:"Assign challenge",id:"label.assign_challenge.808f7730"}):(0,N.jsx)(ke.A,{defaultMessage:"Select challenge",id:"label.select_challenge.9733e05c"})})}),(0,N.jsx)("hr",{className:"d-block d-md-none"}),(0,N.jsxs)(Ce.S,{className:"challenge-metadata",children:[!(null===u||void 0===u||null===(s=u.tags)||void 0===s||!s.length)&&(0,N.jsxs)("section",{className:"mb-2",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),null===u||void 0===u?void 0:u.tags.map((e,s)=>{let{tag:a}=e;return(0,N.jsx)(Co,{className:"mt-2",tag:a},s)})]}),!(null===i||void 0===i||!i.length)&&(0,N.jsxs)("section",{className:"mb-3",children:[(0,N.jsxs)("h6",{className:"mb-2 d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.y8Q,{className:"text-primary"}),(0,N.jsx)(ke.A,{defaultMessage:"AI Agents",id:"label.ai_agents.d591a7cb"})]}),i.map((e,s)=>{var a;const t=null===e||void 0===e||null===(a=e.agent_persona_stub)||void 0===a?void 0:a.current;if(!t)return null;const i=null===t||void 0===t?void 0:t.category;return(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 mb-2",children:[t.avatar_path?(0,N.jsx)(md,{name:t.name,size:28,src:t.avatar_path}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{background:(null===i||void 0===i?void 0:i.color)||"#6c757d",borderRadius:"50%",color:"#fff",flexShrink:0,fontSize:12,height:28,width:28},children:(t.name||"?").charAt(0).toUpperCase()}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("small",{className:"fw-semibold",children:t.name}),(null===i||void 0===i?void 0:i.name)&&(0,N.jsx)("small",{className:"text-muted d-block",style:{fontSize:11},children:i.name})]})]},s)})]}),!(null===c||void 0===c||!c.length)&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objectives",id:"label.learning_objectives.d38eb0fc"})}),c.map((e,s)=>{let{value:a}=e;return(0,N.jsxs)(Ce.S,{className:"text-primary",style:{alignItems:"center",marginBottom:10,position:"relative"},children:[(0,N.jsx)(ze.CMH,{size:12,style:{left:0,marginBottom:3,marginTop:2.5,position:"absolute",top:5}}),(0,N.jsx)("p",{style:{fontSize:16,marginLeft:25},children:a})]},s)})]})]})]})]}),(0,N.jsx)(cc,{ref:b})]})};const Eh=e=>{const{onSelect:s,template:a}=e,{author_avatar_path:t,author_biography:i,author_name:n,description:r,group_assignment_template_components:o,learning_objective:d,title:c,total_est_completion_time:h}=a,u=(0,Pe.W6)(),{assignable:m,clearError:g,error:p,selectable:x}=Oh(),v=(0,l.useRef)(),f=(0,l.useRef)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Qe.A,{className:"journey-template-details d-flex justify-content-center mb-3",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:g,show:p,variant:"danger",children:p}),(0,N.jsx)(Ve.A,{className:"card d-flex",lg:11,xs:12,children:(0,N.jsxs)(Ce.S,{className:"text-center p-5",children:[(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"align-self-start mb-2",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey",id:"label.journey.fe50ed10"})}),(0,N.jsx)("h1",{children:c||""}),(0,N.jsx)(Ce.S,{className:"mt-4",children:r?(0,N.jsx)(Rl,{lg:2,maxWidth:"100%",triggerPosition:"right",xs:3,children:r}):(0,N.jsx)(ke.A,{defaultMessage:"No description available",id:"label.no_description_available.aab5e3e7"})}),(0,N.jsx)(Ce.S,{className:"mt-4",children:(!!m||!!x)&&(0,N.jsx)(ve.A,{block:!0,onClick:m?async()=>{const e=null===f||void 0===f?void 0:f.current;if(!e||!a)return;const{assignment:s}=await e.show({component:a,component_type:"journey",template:a})||{};s&&u.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`)}:s,size:"lg",variant:"primary",children:m?(0,N.jsx)(ke.A,{defaultMessage:"Assign journey",id:"label.assign_journey.61ea3e58"}):(0,N.jsx)(ke.A,{defaultMessage:"Select journey",id:"label.select_journey.faf37108"})})}),(0,N.jsx)(Ce.S,{className:"mt-3",children:(0,N.jsxs)("small",{children:[(0,N.jsx)(ze.w_X,{className:"me-2"}),(0,N.jsx)(Vh,{duration:h,unit:"minutes"})]})})]})})]}),(0,N.jsxs)(Qe.A,{className:"d-flex justify-content-center",children:[(0,N.jsx)(Ve.A,{as:Ge.A,className:"p-0 me-0 me-lg-2 order-1 order-lg-0 d-flex flex-column",lg:7,xs:12,children:(0,N.jsxs)(Ce.S,{className:"p-3 ",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",id:"label.learning_modules.6e1d2fad"})}),(0,N.jsx)(Ce.S,{children:o.map((e,s)=>(0,N.jsx)(Ce.S,{className:"mt-3",children:(0,N.jsx)(Hh,{group_assignment_template_component:e,onSelect:()=>(e=>{const s=null===v||void 0===v?void 0:v.current;if(!s)return;const a="journey"===(null===e||void 0===e?void 0:e.type)?"group_assignment":null===e||void 0===e?void 0:e.type;s.show({component_id:null===e||void 0===e?void 0:e[`${a}_template_id`],selectable:!1,type:a})})(e)})}
2,s))})]})}),(0,N.jsxs)(Ve.A,{as:Ge.A,className:"ms-0 ms-lg-2 mb-3 mb-lg-0 p-3 d-flex flex-column ",lg:4,xs:12,children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objective",id:"label.learning_objective.bc5b0195"})}),(null===d||void 0===d?void 0:d.length)<=0?(0,N.jsx)("div",{className:"mb-3",style:{fontSize:16,lineHeight:"24px"},children:"No learning objectives available"}):(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:d}})]}),n&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"About the author",id:"label.about_the_author.708041b4"})}),(0,N.jsxs)(Ce.S,{children:[t&&(0,N.jsx)(Ce.S,{style:{display:"inline-block",verticalAlign:"middle"},children:(0,N.jsx)("img",{alt:"",className:"img-circle",src:t,style:{height:25,width:25}})}),(0,N.jsx)(Ce.S,{style:{display:"inline-block",marginLeft:7.5,verticalAlign:"middle"},children:(0,N.jsx)(Ce.S,{className:"heading",style:{color:"black",fontSize:12,fontWeight:600,lineHeight:"14px",textTransform:"uppercase"},children:n})})]}),!!i&&(0,N.jsx)("p",{className:"mt-3",children:i})]})]})]}),(0,N.jsx)(Uh,{ref:v}),(0,N.jsx)(cc,{ref:f})]})};Eh.defaultProps={onSelect:Function(),template:{}};var Fh={cartridge:zh,challenge:Ih,journey:Eh},Rh=t(58621);var Dh=e=>{const{default_banner:s}=(0,P.hc)(),{component:a}=Oh(),{banner_path:t}=a;return(0,N.jsx)(Ce.S,{className:"banner-container",children:(0,N.jsx)(Ce.S,{className:"banner-image-container",children:(0,T.isEmpty)(a)?(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder h-100",xs:12}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Zs.A,{alt:"",className:"banner-image",src:t||s}),(0,N.jsx)(Ce.S,{className:"banner-image-overlay"})]})})})};var Bh=e=>{const{assignable:s,component:a,handleClickCTA:t,selectable:i,type:l}=Oh(),{description:n,title:r,total_est_completion_time:o}=a;return(0,N.jsx)(Ge.A,{className:"hero-widget",children:(0,N.jsx)(Ge.A.Body,{as:Qe.A,className:"m-0",children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:8,xs:12,children:[(0,N.jsx)("strong",{className:"text-uppercase text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge",id:"label.cartridge.af853653"})}),(0,N.jsx)("h1",{children:r}),(0,N.jsx)(Rl,{lg:2,maxWidth:"100%",triggerPosition:"right",xs:3,children:(0,ad.G9)(n,{preserveNewlines:!0})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-lg-row align-items-center gap-3 mt-3",children:[(!!s||!!i)&&(0,N.jsx)(ve.A,{block:!0,onClick:t,size:"lg",variant:"primary",children:s?(0,N.jsx)(ke.A,{defaultMessage:"Assign {type}",id:"label.assign_type.a72fa93b",values:{type:l}}):(0,N.jsx)(ke.A,{defaultMessage:"Select {type}",id:"label.select_type.7ea998a6",values:{type:l}})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1 text-secondary",children:[(0,N.jsx)(ze.w_X,{}),(0,N.jsx)(Vh,{duration:o,label_type:"long",unit:"minutes"})]})]})]})})})};const Ph=l.createContext({}),Lh=Ph.Provider,Oh=(Ph.Consumer,()=>(0,l.useContext)(Ph));var Hh=e=>{const{group_assignment_template_component:s={},onSelect:a}=e,{type:t}=s,i=(()=>{switch(t){case"journey":return null===s||void 0===s?void 0:s.group_assignment_template;case"challenge":case"cartridge":return null===s||void 0===s?void 0:s[`${t}_template`];default:return{}}})(),{description:l=null,overview:n=null,title:r="",total_est_completion_time:o=null}=i;return(0,N.jsx)(Ge.A,{tabIndex:0,children:(0,N.jsxs)(Ce.S,{className:"p-3 d-flex flex-row",children:[(0,N.jsx)(Ad,{component:i,size:75,type:t}),(0,N.jsxs)(Ce.S,{className:"ms-2 w-100",children:[(0,N.jsx)(Ce.S,{className:"float-end",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-row align-items-center",children:[(0,N.jsx)(ze.w_X,{className:"me-1"}),(0,N.jsx)(Vh,{duration:o,unit:"minutes"}),(0,N.jsx)(bo.A,{pill:!0,bg:"gray-no-border",className:"ms-1",style:{textTransform:"capitalize"},children:t})]})}),(0,N.jsx)("h5",{className:`title ${"challenge"===t&&"challenge"}`,children:r}),(0,N.jsx)("div",{className:"description-container",children:n||l?(0,N.jsx)("div",{className:"description",children:(0,N.jsx)(El,{ellipsisText:"",lines:2,children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:n||l}})})}):""}),(0,N.jsx)(ve.A,{className:"w-100 mt-xl-3",onClick:()=>"function"===typeof a&&a(),variant:"secondary",children:"View"})]})]})})},Uh=Nh;const Qh=e=>{const{className:s,duration:a,label_type:t,unit:i}=e,{minutesToHoursAndMinutes:l}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},n=Math.round(Number.parseInt(a));if(isNaN(n))return(0,N.jsx)(N.Fragment,{});const{hours:r,minutes:o}=l(n),d={long:{hour:{plural:" hours",singular:" hour"},minute:{plural:" mins",singular:" min"}},short:{hour:{plural:"h",singular:"h"},minute:{plural:"m",singular:"m"}}},c=e=>0===e||e>1,h=(e,s)=>{var a,i;return(null===d||void 0===d||null===(a=d[r&&o?t||"short":t||"long"])||void 0===a||null===(i=a[e])||void 0===i?void 0:i[s?"plural"
2:"singular"])||""};return(0,N.jsx)("span",{className:`formatted-duration ${s||""}`,children:(()=>{let e="";return"minutes"!==i?"":(r&&(e+=`${r}${h("hour",c(r))} `),o&&(e+=`${o}${h("minute",c(o))}`),r||o||(e+=`${o}${h("minute",c(o))}`),e)})()})};Qh.defaultProps={unit:"minutes"};var Vh=Qh,Gh=t(33388),Wh=t(83245);var Kh=e=>{var s,a;let{className:t,component:i,disabled:l,modules:n,onClick:r,onSelect:o,selected:d,timestamp:c,timestamp_label:h,type:u}=e,{group_assignment_template_components:m}=i||{};const g="function"===typeof o||"function"===typeof r,{styles:p}=(0,P.nm)(),{secondary:x}=p,{author_avatar_image_path:v,author_avatar_path:f,author_name:j,certification_template_id:_,challenge_statement:b,cover_path:A,description:y,subjects:w,title:S,total_est_completion_time:C,total_est_time_mins:M}=i||{},k=C||M,z=null===w||void 0===w||null===(s=w[0])||void 0===s||null===(a=s.subjects)||void 0===a?void 0:a.name,I={avatar:v||f||Ga,name:j||"Solvably"},E=(null===i||void 0===i||i.stub,oa()("assignment-component-card px-0 d-flex flex-column",{clickable:g,disabled:l,selected:d},t,u));return(0,N.jsx)(Ce.S,{className:E,onClick:!l&&(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),"function"===typeof o?o(i):"function"===typeof r&&r()}),role:g?"button":"presentation",tabIndex:g?0:void 0,children:(0,N.jsxs)(Ge.A,{className:"assignment-component-card-inner flex-1",children:[(0,N.jsx)(Ce.S,{className:"cover-image-container",children:(0,T.isEmpty)(i)?(0,N.jsx)(Ce.S,{className:"cover-image-placeholder",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm",variant:"secondary"})}):(0,N.jsx)(hd.R,{alt:`${S} cover image`,fluid:!0,height:160,imageHeight:160,imageWidth:278,objectFit:"cover",src:A||pc,width:278})}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column details ",children:[(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(bo.A,{pill:!0,bg:"primary",className:"mt-2",text:"light",children:z})})}),(0,N.jsxs)(Ce.S,{className:"type d-flex align-items-center justify-content-between text-black-50 text-uppercase small",children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("span",{children:u}),"journey"===u&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Qp1,{className:"mx-2",size:4}),(0,N.jsx)(hc.A,{value:(null===n||void 0===n?void 0:n.length)||(null===m||void 0===m?void 0:m.length)||0,one:(0,N.jsx)(ke.A,{defaultMessage:"1 module",id:"label.1_module.f5f57032"}),other:(0,N.jsx)(ke.A,{defaultMessage:"{count} modules",id:"label.count_modules.bba1cca4",values:{count:(null===n||void 0===n?void 0:n.length)||(null===m||void 0===m?void 0:m.length)||0}})})]})]}),!!_&&(0,N.jsx)(Wh.QbB,{size:24})]}),(0,N.jsx)(Fl,{as:"h5",className:"title",maxWidth:250,placement:"bottom",children:S}),(0,N.jsx)("p",{className:"description",children:y||b?(0,N.jsx)(N.Fragment,{children:(0,ad.G9)(y||b,{preserveNewlines:!0})}):(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No description provided",id:"label.no_description_provided.41183d01"})})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center small pb-2",children:[(0,N.jsx)(Ce.S,{className:"author d-flex align-items-center",children:!(null===I||void 0===I||!I.name)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(md,{className:"me-2",size:24,src:null===I||void 0===I?void 0:I.avatar}),(0,N.jsx)(Fl,{maxWidth:120,placement:"bottom",children:(0,N.jsx)(ke.A,{defaultMessage:"By: {author}",id:"label.by_author.ccc3870f",values:{author:null===I||void 0===I?void 0:I.name}})})]})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(ze.w_X,{className:"me-1",color:x,size:16}),(0,N.jsx)(Vh,{duration:k,unit:"minutes"})]})]})]}),!!c&&(0,N.jsxs)(Ge.A.Footer,{className:"timestamp text-black-50 d-flex align-items-center px-0 pb-0",children:[h," ",(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:c,year:"numeric"})]})]})]})})};var Yh=t(79522);var qh=e=>{var s,a,t,i,l,n,r,o,d,c,h,u,m;const{assignment:g}=e,{isBelowBreakpoint:p}=(0,ne.vh)({breakpoint:992}),{active_tab:x,handleShowTeamSelector:v,isOnTeam:f}=Vr(),j=null===g||void 0===g||null===(s=g.assignment)||void 0===s?void 0:s.type,_=(null===g||void 0===g||null===(a=g.assignment)||void 0===a||null===(t=a.group_assignment_components)||void 0===t?void 0:t[0])||{},b=(null===g||void 0===g?void 0:g.group_member_assignment_components.find(e=>e.group_assignment_component_id==_.id))||{},A=(null===g||void 0===g||null===(i=g.group_member)||void 0===i?void 0:i.group)||{},y=null===b||void 0===b?void 0:b.member_evaluation,w=null===b||void 0===b||null===(l=b.challenge_member)||void 0===l?void 0:l.certification_request,S=(null===_||void 0===_?void 0:_[`${j}_template`])||(null===g||void 0===g?void 0:g.assignment),C=e=>{switch(e){case"start":switch(j){case"cartridge":case"challenge":return`/assignment/${null===g||void 0===g?void 0:g.id}/${null===b||void 0===b?void 0:b.id}/overview`;
2case"journey":return`/assignment/${null===g||void 0===g?void 0:g.id}/overview`;default:return"/"}case"review":case"resume":switch(j){case"cartridge":case"challenge":return`/assignment/${null===g||void 0===g?void 0:g.id}/${null===b||void 0===b?void 0:b.id}/content`;case"journey":return`/assignment/${null===g||void 0===g?void 0:g.id}/overview`;default:return"/"}default:return"/"}},M=()=>{var e,s;const a=e=>(0,N.jsx)(Le.Link,{className:`btn btn-${e}`,to:C("review"),children:(0,N.jsx)(ke.A,{defaultMessage:"Review",id:"label.review.aff0766a"})});switch(x){case"completed":return null!==_&&void 0!==_&&_.certification_template_id?(0,N.jsxs)(Yh.A,{children:[(0,N.jsx)(Cu,{certification_request:w,challenge:null===g||void 0===g||null===(e=g.group_member_assignment_components)||void 0===e||null===(s=e[0])||void 0===s?void 0:s.challenge,group_assignment:null===g||void 0===g?void 0:g.assignment,member_evaluation:y,team:null===g||void 0===g?void 0:g.team}),(0,N.jsx)(a,{variant:"secondary"})]}):(0,N.jsx)(a,{variant:"primary"});case"expired":return(0,N.jsx)(a,{});default:return(0,N.jsx)(N.Fragment,{children:f(g)?(0,N.jsx)(N.Fragment,{children:null!==g&&void 0!==g&&g.start?(0,N.jsx)(Le.Link,{className:"btn btn-primary",to:C("resume"),children:(0,N.jsx)(ke.A,{defaultMessage:"Resume",id:"label.resume.d640c742"})}):(0,N.jsx)(Le.Link,{className:"btn btn-primary",to:C("start"),children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ve.A,{onClick:()=>v(g),children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})})})})}},k=(null===g||void 0===g||null===(n=g.team)||void 0===n||null===(r=n.members)||void 0===r||null===(o=r.map)||void 0===o?void 0:o.call(r,e=>null!==e&&void 0!==e&&e.user?e.user:null!==e&&void 0!==e&&e.is_agent&&null!==e&&void 0!==e&&e.agent_persona?{id:`agent-${e.agent_persona.id}`,avatar:e.agent_persona.avatar_path?{location:e.agent_persona.avatar_path}:null,fullname:e.agent_persona.name,is_agent:!0}:null).filter(Boolean))||[],z=(null===g||void 0===g||null===(d=g.group_member_assignment_components)||void 0===d||null===(c=d[0])||void 0===c?void 0:c.challenge)||{},T=(null===Fu||void 0===Fu?void 0:Fu[j])||(()=>(0,N.jsx)("strong",{className:"text-success",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete",id:"label.complete.143b270a"})})),I=(null===Ou||void 0===Ou?void 0:Ou[j])||(()=>(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Incomplete",id:"label.incomplete.75f33cdf"})}));return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ad,{component:S,size:40,type:j}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-2",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)("span",{style:{fontWeight:500},children:(0,N.jsx)(Fl,{maxWidth:p?150:350,placement:"right",children:null===g||void 0===g||null===(h=g.assignment)||void 0===h?void 0:h.title})}),(0,N.jsx)(Ao,{certification_template_id:null===_||void 0===_?void 0:_.certification_template_id})]}),(0,N.jsx)("span",{className:"text-capitalize text-muted",children:j})]})]})}),"expired"!==x&&(0,N.jsx)(ro,{hiddenBelow:"lg",children:"completed"===x?(0,N.jsx)(T,{assignment:g}):(0,N.jsx)(I,{challenge:z})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:null===A||void 0===A?void 0:A.name}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:null!==g&&void 0!==g&&g.team?(0,N.jsx)(tn,{maxIcons:5,offset:-4,showOnline:!1,showTooltip:!0,users:k}):(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Not assigned",id:"label.not_assigned.13075c23"})})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:"completed"===x?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Gh.XU,{value:null===g||void 0===g?void 0:g.completed})}):(0,N.jsx)(N.Fragment,{children:null!==g&&void 0!==g&&null!==(u=g.assignment)&&void 0!==u&&u.due?(0,N.jsx)(Gh.XU,{value:null===g||void 0===g||null===(m=g.assignment)||void 0===m?void 0:m.due}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No due date",id:"label.no_due_date.6139ed04"})})})})}),"active"===x&&(0,N.jsx)(ro,{hiddenBelow:"lg",children:null!==g&&void 0!==g&&g.total_est_time_mins?(0,N.jsx)(Vh,{className:"me-1",duration:null===g||void 0===g?void 0:g.total_est_time_mins,unit:"minutes"}):(0,N.jsxs)(N.Fragment,{children:["-",(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"None",id:"label.none.dc937b59"})})]})}),(0,N.jsx)(ro,{className:"text-end",children:(0,N.jsx)(M,{})})]})};const Jh=(0,l.forwardRef)((s,a)=>{const{challenge_member_id:t}=s,{api:i}=(0,P.nm)(),[n,r]=(0,ne.CQ)({error:null,loading:!0,member_evaluation:null,supporting_data:null,team_evaluation:null}),{error:o,loading:d,member_evaluation:c,supporting_data:h,team_evaluation:u}=n;return(0,l.useEffect)(()=>{(async()=>{try{r({loading:!0});const{data:e,member_evaluation:s,team_evaluation:a}=await i.get("/api/certifications/get/report-data",{challenge_member_id:t});r({loading:!1,member_evaluation:s,supporting_data:e,team_evaluation:a})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;r({error:a,loading:!1})}})()},[]),(0,l.useImperativeHandle)(a,()=>({error:o,loading:d,member_evaluation:c,supporting_data:h,team_evaluation:u})),(0,N.jsx)(nu,{value:{member_evaluation:c,supporting_data:h,team_evaluation:u},children:(0,N.jsx)(Ce.S,{className:"report-renderer",children:(0,N.jsxs)(Me.x_,{loading:d,spinner:(0,N.jsx)(Zh,{}),children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:o,variant:"danger",children:o}),o?(0,N.jsxs)(Ce.S,{className:"bg-light d-flex flex-column align-items-center justify-content-center p-5 text-danger rounded",children:[(0,N.jsx)(ze.BS8,{className:"m-0",size:24}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Error",id:"label.error.54a0e8c1"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(eu,{}),(0,N.jsx)("hr",{}),(0,N.jsxs)("section",{children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Supporting data",id:"label.supporting_data.239e5e82"})}),(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"The above report was generated based in part on the following engagement data:",id:"label.the_above_report_was_generated_bas.f3
2cce9af"})}),(0,N.jsx)(tu,{})]})]})]})})})}),Xh=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({challenge_member_id:null,visible:!1}),{challenge_member_id:n,visible:r}=a,o=e=>{t({challenge_member_id:e.challenge_member_id||null,visible:!0})},d=()=>i();return(0,l.useEffect)(()=>{const e=()=>document.body.classList.remove("report-printing");return window.addEventListener("afterprint",e),()=>{window.removeEventListener("afterprint",e),document.body.classList.remove("report-printing")}},[]),(0,l.useImperativeHandle)(s,()=>({hide:d,show:o,visible:r})),(0,N.jsxs)(xe,{className:"report-renderer-modal",onHide:d,show:r,size:"lg",children:[(0,N.jsxs)(xe.Header,{closeButton:!0,children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"AI Assessment",id:"label.ai_assessment.2955a028"})}),(0,N.jsxs)(ve.A,{className:"d-print-none ms-auto me-2 d-flex align-items-center gap-1",onClick:()=>{document.body.classList.add("report-printing"),window.print()},size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.n4o,{}),(0,N.jsx)(ke.A,{defaultMessage:"Print / Save PDF",id:"label.print_save_pdf.bf785022"})]})]}),(0,N.jsx)(xe.Body,{children:n&&(0,N.jsx)(Jh,{challenge_member_id:n})})]})}),Zh=e=>(0,N.jsxs)(Ce.S,{className:"report-renderer-placeholder d-flex flex-column gap-4 ",children:[(0,N.jsxs)(Rh.A,{animation:"wave",children:[(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:11}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:9}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:10}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:11}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:4})]}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",className:"p-5",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",className:"p-5",size:"lg",xs:9})]}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",className:"p-5",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",className:"p-5",size:"lg",xs:9})]}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",className:"p-5",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",className:"p-5",size:"lg",xs:9})]}),(0,N.jsx)(Rh.A,{animation:"wave",className:"text-center",children:(0,N.jsx)(Rh.A,{bg:"light",className:"p-3",size:"lg",xs:6})}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:7})]}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:6})]}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:10})]}),(0,N.jsx)(Rh.A,{animation:"wave",className:"text-center",children:(0,N.jsx)(Rh.A,{bg:"light",className:"p-3",size:"lg",xs:6})}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:7})]}),(0,N.jsxs)(Rh.A,{animation:"wave",className:"text-center d-flex gap-3",children:[(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{bg:"light",size:"lg",xs:6})]})]});var $h=t(21357);const eu=e=>{var s;const a=ru(),t=(null===e||void 0===e?void 0:e.member_evaluation)||(null===a||void 0===a?void 0:a.member_evaluation)||{},i=(null===e||void 0===e?void 0:e.team_evaluation)||(null===a||void 0===a?void 0:a.team_evaluation)||{},{challenge_member:l={},data:n={}}=t,{areas_for_growth:r,competencies:o={},overall_assessment:d,strengths:c}=n,h=(null===l||void 0===l?void 0:l.certification_request)||(null===e||void 0===e?void 0:e.certification_request),{data:u={}}=i,{competencies:m={},decision_evaluation:g="",implementation_plan:p={}}=u,{team_performance:x={}}=m,{other:v=[],profit_and_loss:f=[],required_skills:j=[],timeframe:_=[]}=p,b=Array.isArray(g),A="string"===typeof g,y=b?g.filter(e=>{var s;return null===e||void 0===e||null===(s=e.bullets)||void 0===s?void 0:s.length}):[],w=b||A?[]:Object.values(g||{}),S=b?!!y.length:A?!!g:!!w.length;return(0,N.jsxs)(Ce.S,{className:"report d-flex flex-column gap-3",children:[(0,N.jsxs)("section",{className:"overview p-3 rounded",style:{backgroundColor:"var(--brand-primary-100)"},children:[(0,N.jsx)("h4",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})}),(0,N.jsx)("p",{children:d})]}),(0,N.jsxs)("section",{className:"team-performance bg-light p-3 rounded d-flex flex-column gap-3",children:[(0,N.jsx)("h4",{className:"text-center m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Team assessment",id:"label.team_assessment.1bf72bbc"})}),(0,N.jsx)(iu,{competency:x}),(0,N.jsx)("hr",{className:"m-0"}),(0,N.jsx)("h4",{className:"text-center m-0",children:S?(0,N.jsx)(ke.A,{defaultMessage:"Decision evaluation",id:"label.decision_evaluation.84612025"}):(0,N.jsx)(ke.A,{defaultMessage:"Solution evaluation",id:"label.solution_evaluation.c467e33d"})}),S&&(0,N.jsx)("section",{className:"decision-evaluation d-flex flex-column gap-3",children:b?y.map(e=>{let{bullets:s,key:a,title:t}=e;return(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:t}),(0,N.jsx)("ul",{children:s.map((e,s)=>(0,N.jsx)("li",{children:e},s))})]},a)}):A?(0,N.jsx)("p",{className:"m-0",children:g}):w.map((e,s)=>(0,N.jsx)(iu,{competency:e},s))}),!S&&!(null===f||void 0===f||!f.length)&&(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Profit & loss",id:"label.profit_and_loss.0a16934b"})}),(0,N.jsx)("ul",{children:f.map((e,s)=>{let{content:a,title:t}=e;return(0,N.jsxs)("li",{children:[(0,N.jsxs)("strong",{className:"me-1",children:[t,":"]}),(0,N.jsx)("span",{children:a})]},s)})})]}),!S&&!(null===_||void 0===_||!_.length)&&(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Timeframe",id:"label.timeframe.f580cb76"})}),(0,N.jsx)("ul",{children:_.map((e,s)=>{let{content:a,title:t}=e;return(0,N.jsxs)("li",{children:[(0,N.jsxs)("strong",{className:"me-1",children:[t,":"]}),(0,N.jsx)("span",{children:a})]},s)})})]}),!S&&!(null===j||void 0===j||!j.length)&&(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Required skills",id:"label.required_skills.dc7f3b37"})}),(0,N.jsx)("ul",{children:j.map((e,s)=>(0,N.jsx)("li",{children:(0,N.jsx)("span",{children:e})},s))})]}),!S&&!(null===v||void 0===v||!v.length)&&(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Other requirements & considerations",id:"label.other_requirements_and_considerati.8d5c15d2"})}),(0,N.jsx)("ul",{children:v.map((e,s)=>(0,N.jsx)("li",{children:(0,N.jsx)("span",{children:e})},s))})]})]}),(0,N.jsxs)("div",{className:"border p-3 rounded d-flex flex-column gap-3",children:[(0,N.jsx)("h4",{className:"text-center m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Member assessment",id:"label.member_assessment.d163741f"})}),!(null===(s=Object.entries(o))||void 0===s||!s.length)&&(0,N.jsx)("section",{className:"scores d-flex flex-column gap-3",children:Object.values(o).map((e,s)=>(0,N.jsx)(iu,{competency:e},s))}),(0,N.jsx)("hr",{className:"m-0"}),(0,N.jsxs)("section",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Strengths",id:"label.strengths.b11d27f8"})}),null!==c&&void 0!==c&&c.length?(0,N.jsx)("ul",{className:"d-flex flex-column gap-2",children:c.map((e,s)=>(0,N.jsx)("li",{children:(0,N.jsx)("span",{children:(null===e||void 0===e?void 0:e.content)||e})},s))}):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"No notable strengths",id:"label.no_notable_strengths.5dcb6f74"})})]}),(0,N.jsxs)("section",{className:"areas-for-improvement",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Areas for Growth",id:"label.areas_for_growth.76319abf"})}),null!==r&&void 0!==r&&r.length?(0,N.jsx)("ul",{className:"d-flex flex-column gap-2",children:r.map((e,s)=>(0,N.jsxs)("li",{children:[(0,N.jsxs)("strong",{className:"me-1",children:[null===e||void 0===e?void 0:e.title,":"]}
2),(0,N.jsx)("span",{children:null===e||void 0===e?void 0:e.content})]},s))}):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"No recommendations",id:"label.no_recommendations.c9d9a09b"})})]}),(0,N.jsxs)("section",{className:"recommendation d-flex gap-1 align-items-center",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Recommendation:",id:"label.recommendation.898ede61"})}),(0,$h.parseBinary)(null===h||void 0===h?void 0:h.recommendation)?(0,N.jsx)(bo.A,{bg:"success",className:"fw-bold text-uppercase",color:"white",children:(0,N.jsx)(ke.A,{defaultMessage:"Approve",id:"label.approve.6007acbe"})}):(0,N.jsx)(bo.A,{bg:"danger",className:"fw-bold text-uppercase",color:"white",children:(0,N.jsx)(ke.A,{defaultMessage:"Deny",id:"label.deny.05a2d733"})})]}),!(null===h||void 0===h||!h.notes)&&(0,N.jsxs)("section",{className:"arbitrator-notes p-2 bg-light rounded",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Arbitrator notes:",id:"label.arbitrator_notes.411935a7"})}),(0,N.jsx)("em",{children:(null===h||void 0===h?void 0:h.notes)||""})]})]})]})};t(20641);const su=e=>{const{label_type:s,precise:a,round:t,round_to:i,unit:l,value:n}=e;let r=((e,s)=>{if(["months","years"].includes(s)){const a=ci()(),t=ci()().add(e,s);return ci().duration(t.diff(a))}return ci().duration(e,s)})(n,l);a||(r=ci().duration(Math.round(r.asSeconds()),"seconds"));const o=(e,a)=>{const t={days:{long:"day",medium:"day",short:"d"},hours:{long:"hour",medium:"hr",short:"h"},milliseconds:{long:"millisecond",medium:"ms",short:"ms"},minutes:{long:"minute",medium:"min",short:"m"},months:{long:"month",medium:"mo",short:"mo"},seconds:{long:"second",medium:"sec",short:"s"},weeks:{long:"week",medium:"wk",short:"w"},years:{long:"year",medium:"yr",short:"y"}}[e][s];return(0,N.jsx)(hc.A,{one:t,other:"short"===s?t:`${t}s`,value:a})};return(0,N.jsx)("span",{children:(()=>{const e=[],s=["years","months","weeks","days","hours","minutes","seconds"];let l=ci().duration(r);if(t&&i&&s.includes(i)){s.indexOf(i);const a="up"===t?Math.ceil(l.as(i)):Math.floor(l.as(i));l=ci().duration(a,i);const n=i;return e.push((0,N.jsxs)("span",{children:[a," ",o(n,a)," "]},n)),e}if(s.forEach((s,a)=>{const t=Math.floor(l.as(s));(t>0||"seconds"===s&&0===e.length)&&(e.push((0,N.jsxs)("span",{children:[t," ",o(s,t)," "]},s)),l=ci().duration(l.asMilliseconds()-ci().duration(t,s).asMilliseconds()))}),a&&(!t||!i)){const s=l.milliseconds();(s>0||0===e.length)&&e.push((0,N.jsxs)("span",{children:[s," ",o("milliseconds",s)]},"milliseconds"))}return e})()})};su.defaultProps={label_type:"long",precise:!1,round:null,round_to:null,unit:"seconds"};var au=su;const tu=e=>{const s=ru(),a=(null===e||void 0===e?void 0:e.supporting_data)||(null===s||void 0===s?void 0:s.supporting_data),{assets:t,assets_uploaded:i,chat_messages:l,chat_messages_sent:n,meetings_attended:r,phase_contributions:o,total_meeting_attendance:d,total_meetings:c,total_phase_contributions:h,voice_transcripts:u}=a||{},m=e=>{var s,a;switch(typeof e){case"string":return e;case"object":return null!==e&&void 0!==e&&e.additions||null!==e&&void 0!==e&&e.deletions?(0,N.jsxs)("div",{children:[(0,N.jsx)("span",{className:"d-flex gap-1",children:!(null===(s=e.additions)||void 0===s||!s.length)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Additons:",id:"label.additons.41cc7f7f"}),(0,N.jsx)("strong",{children:e.additions.length})]})}),(0,N.jsx)("span",{className:"d-flex gap-1",children:!(null===(a=e.deletions)||void 0===a||!a.length)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Deletions:",id:"label.deletions.702fdee7"}),(0,N.jsx)("strong",{children:e.deletions.length})]})})]}):null!==e&&void 0!==e&&e.new_category||null!==e&&void 0!==e&&e.previous_category?(0,N.jsxs)("div",{children:[(0,N.jsx)("span",{className:"d-flex gap-1",children:!!e.previous_category&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Previous category:",id:"label.previous_category.c5034362"}),(0,N.jsx)("strong",{children:e.previous_category})]})}),(0,N.jsx)("span",{className:"d-flex gap-1",children:!!e.new_category&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"New category:",id:"label.new_category.93d80f98"})}),(0,N.jsx)("strong",{children:e.new_category})]})})]}):"";default:return""}};return(0,N.jsx)(Ce.S,{className:"supporting-data",children:(0,N.jsxs)(yl.A,{className:"bg-white",children:[(0,N.jsxs)(yl.A.Item,{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Time spent on challenge:",id:"label.time_spent_on_challenge.93bbfbc7"})}),(0,N.jsx)("strong",{children:(0,N.jsx)(au,{label_type:"short",round:"up",round_to:"minutes",unit:"seconds",value:3060})})]}),(0,N.jsxs)(yl.A.Item,{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Voice meetings attended:",id:"label.voice_meetings_attended.c9062b44"})}),(0,N.jsxs)("span",{className:"d-flex gap-1",children:[(0,N.jsx)("strong",{children:c}),(0,N.jsxs)("span",{children:["/ ",r]})]})]}),(0,N.jsxs)(yl.A.Item,{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Time spent in voice meetings:",id:"label.time_spent_in_voice_meetings.7d93b9c2"})}),(0,N.jsx)("strong",{children:(0,N.jsx)(au,{label_type:"short",unit:"seconds",value:d})})]}),(0,N.jsxs)(yl.A.Item,{as:"details",className:"d-flex flex-column",disabled:!h,children:[(0,N.jsx)("summary",{children:(0,N.jsxs)("span",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Total phase contributions:",id:"label.total_phase_contributions.59886342"})}),(0,N.jsx)("strong",{children:h})]})}),(0,N.jsx)(Ce.S,{className:"ms-3 mt-2",children:!!o&&Object.entries(o).map(e=>{let[s,a]=e;return(0,N.jsxs)("details",{disabled:!(null!==a&&void 0!==a&&a.length),children:[(0,N.jsx)("summary",{children:(0,N.jsxs)("span",{className:"d-inline-flex gap-1",children:[(0,N.jsxs)("em",{children:[s,":"]}),(0,N.jsx)("strong",{children:(null===a||void 0===a?void 0:a.length)||0})]})}),(0,N.jsx)("ul",{className:"list-unstyled d-flex flex-column gap-1",children:(null===a||void 0===a?void 0:a.length)&&a.map((e,s)=>{let{action:a,changes:t,date:i}=e;return(0,N.jsxs)("li",{className:"d-flex flex-column bg-light px-2 py-1 rounded",children:[(0,N.jsxs)("small",{className:"text-muted d-inline-flex justify-content-between align-items-center",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(Gh.XU,{value:i})," | ",(0,N.jsx)(Gh.ib,{value:i})]}),(0,N.jsx)(Fl,{as:"em",maxWidth:150,children:a})]}),(0,N.jsx)("span",{children:m(t)})]},s)})})]},s)})})]}),(0,N.jsxs)(yl.A.Item,{as:"details",className:"d-flex flex-column",disabled:!(null!==l&&void 0!==l&&l.length),children:[(0,N.jsx)("summary",{children:(0,N.jsxs)("span",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Messages sent:",id:"label.messages_sent.abb76afa"})}),(0,N.jsx)("strong",{children:n||0})]})}),(0,N.jsx)("ul",{className:"list-unstyled d-flex flex-column gap-1 mt-2",children:(null===l||void 0===l?void 0:l.length)&&l.map((e,s)=>{let{content:a,date:t}=e;return(0,N.jsxs)("li",{className:"d-flex flex-column bg-light px-2 py-1 rounded",children:[(0,N.jsxs)("small",{className:"text-muted",children:[(0,N.jsx)(Gh.XU,{value:t})," | ",(0,N.jsx)(Gh.ib,{value:t})]}),(0,N.jsx)("span",{children:a})]},s)})})]}),(0,N.jsxs)(yl.A.Item,{as:"details",className:"d-flex flex-column",disabled:!(null!==t&&void 0!==t&&t.length),children:[(0,N.jsx)("summary",{children:(0,N.jsxs)("span",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assets uploaded:",id:"label.assets_uploaded.f5762bdd"})}),(0,N.jsx)("strong",{className:"text-black",children:i})]})}),(0,N.jsx)("ul",{className:"list-unstyled d-flex flex-column gap-1 mt-2",children:(null===t||void 0===t?void 0:t.length)&&t.map((e,s)=>{let{context:a,date:t,file_extension:i}=e;return(0,N.jsxs)("li",{className:"d-flex flex-column bg-light px-2 py-1 rounded",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsxs)("small",{className:"text-muted",children:[(0,N.jsx)(Gh.XU,{value:t})," | ",(0,N.jsx)(Gh.ib,{value:t})]}),(0,N.jsx)("small",{className:"text-muted fw-semibold",children:"chat"===a?(0,N.jsx)(ke.A,{defaultMessage:"Chat",id:"label.chat.460b3a7d"}):(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})})]}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"{file_extension} file uploaded",id:"label.file_extension_file_uploaded.70ebb1b9",values:{file_extension:(0,N.jsx)("strong",{className:"text-uppercase",children:i})}})})]},s)})})]}),(0,N.jsxs)(yl.A.Item,{as:"details",className:"d-flex flex-column",disabled:!(null!==u&&void 0!==u&&u.length),children:[(0,N.jsx)("summary",{children:(0,N.jsxs)("span",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Voice transcript lines:",id:"label.voice_transcript_lines.ab18c228"})}),(0,N.jsx)("strong",{children:(null===u||void 0===u?void 0:u.length)||0})]})}),(0,N.jsx)("ul",{className:"list-unstyled d-flex flex-column gap-1 mt-2",children:!(null===u||void 0===u||!u.length)&&u.map((e,s)=>{let{content:a,is_evaluated_member:t,is_team_member:i,speaker_name:l,start_time:n}=e;return(0,N.jsxs)("li",{className:"d-flex flex-column bg-light px-2 py-1 rounded "+(t?"border-start border-primary border-3":""),children:[(0,N.jsxs)("small",{className:"text-muted d-inline-flex justify-content-between align-items-center",children:[(0,N.jsxs)("span",{className:t?"fw-bold":"fw-semibold",children:[l||(0,N.jsx)(ke.A,{defaultMessage:"Unknown speaker",id:"label.unknown_speaker.8cd85329"}),t&&(0,N.jsx)("span",{className:"text-primary fw-normal ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(member under review)",id:"label.member_under_review.ecd5ecd4"})}),!i&&l&&(0,N.jsx)("span",{className:"fw-normal ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(facilitator)",id:"label.facilitator.591ed353"})})]}),n&&(0,N.jsxs)("span",{children:[(0,N.jsx)(Gh.XU,{value:n})," | ",(0,N.jsx)(Gh.ib,{value:n})]})]}),(0,N.jsx)("span",{children:a})]},s)})})]})]})})},iu=e=>{const{competency:s}=e,{rationale:a,score:t,sub_categories:i,title:l}=s,{isBelowBreakpoint:n}=(0,ne.vh)({breakpoint:992}),r=n?80:60,o=n?8:6;return(0,N.jsxs)(Qe.A,{className:"d-flex flex-column flex-lg-row gx-2",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column align-items-center",children:[(0,N.jsx)(Dt,{barSize:o,customScoreLabel:Number.parseInt(t)||"-",fontSize:24,height:r,value:Number.parseInt(t)?25*Number.parseInt(t):0,width:r}),(0,N.jsx)("small",{className:"fw-semibold text-center",children:l})]}),(0,N.jsx)(Ve.A,{lg:10,xs:12,children:(0,N.jsx)("span",{children:a})})]})};iu.defaultProps={competency:{}};const lu=l.createContext({}),nu=lu.Provider;lu.Consumer;lu.displayName="ReportRendererContext";const ru=()=>(0,l.useContext)(lu);var ou;const du=["title","titleId"];function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},cu.apply(null,arguments)}function hu(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,du);return l.createElement("svg",cu({xmlns:"http://www.w3.org/2000/svg",className:"uncertified",width:18,height:28,viewBox:"0 0 18 28",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,ou||(ou=l.createElement("path",{d:"M15.926 2.722c-.482 1.41-.484 1.139 0 2.555.05.147.074.297.074.445 0 .449-.222.883-.615 1.156-1.256.87-1.09.651-1.562 2.067-.198.591-.77.99-1.415.99h-.003c-1.549-.005-1.28-.088-2.528.789-.262.184-.569.276-.877.276s-.615-.092-.876-.275c-1.249-.878-.98-.794-2.528-.789h-.004c-.645 0-1.216-.399-1.413-.99-.473-1.417-.311-1.198-1.562-2.067-.395-.274-.617-.708-.617-1.157 0-.148.024-.298.074-.444.483-1.411.484-1.139 0-2.5
255-.05-.147-.074-.297-.074-.445 0-.45.222-.883.616-1.157 1.251-.868 1.089-.648 1.562-2.067.197-.591.769-.99 1.413-.99h.004c1.545.005 1.271.095 2.528-.79.262-.183.569-.274.877-.274s.615.091.876.274c1.248.878.98.795 2.528.79h.003c.646 0 1.217.399 1.415.99.473 1.416.307 1.197 1.562 2.067.394.273.616.707.616 1.156 0 .148-.024.299-.074.445zm-2.176 1.278c0-2.623-2.127-4.75-4.75-4.75s-4.75 2.127-4.75 4.75 2.127 4.75 4.75 4.75 4.75-2.128 4.75-4.75zm-2.5 8v4.974l-1.945-1.474-2.055 1.525v-5.025h-2v9l4.042-3 3.958 3v-9h-2z",transform:"translate(-1.5, 4)"})))}const uu=l.forwardRef(hu);var mu,gu;t.p;const pu=["title","titleId"];function xu(){return xu=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},xu.apply(null,arguments)}function vu(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,pu);return l.createElement("svg",xu({xmlns:"http://www.w3.org/2000/svg",className:"certified",viewBox:"0 0 18 26",width:18,height:26,ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,mu||(mu=l.createElement("defs",null,l.createElement("linearGradient",{id:"shimmering-gradient",x1:"-100%",y1:"-100%",x2:"100%",y2:"100%"},l.createElement("stop",{offset:"0%",stopColor:"#ebcb8b"}),l.createElement("stop",{offset:"12.5%",stopColor:"#c0b283"}),l.createElement("stop",{offset:"25%",stopColor:"#dcd0c0"}),l.createElement("stop",{offset:"37.5%",stopColor:"#c0b283"}),l.createElement("stop",{offset:"50%",stopColor:"#ebcb8b"}),l.createElement("stop",{offset:"62.5%",stopColor:"#c0b283"}),l.createElement("stop",{offset:"75%",stopColor:"#dcd0c0"}),l.createElement("stop",{offset:"87.5%",stopColor:"#c0b283"}),l.createElement("stop",{offset:"100%",stopColor:"#ebcb8b"}),l.createElement("animateTransform",{attributeName:"gradientTransform",type:"translate",from:"0 0",to:"1 1",dur:"3s",repeatCount:"indefinite",calcMode:"spline",keyTimes:"0;1",keySplines:"0.42 0 0.58 1"})),l.createElement("mask",{id:"icon-mask"},l.createElement("path",{fill:"white",d:"M14.5 15h1.5v9l-3.958-3-4.042 3v-9h1.463c.83.582 1.381 1 2.537 1 .975 0 1.88-.415 2.5-1zm4.426-6.723c.051.147.074.297.074.445 0 .449-.222.883-.615 1.156-1.256.87-1.09.651-1.562 2.067-.198.591-.77.99-1.414.99h-.004c-1.549-.005-1.279-.088-2.528.789-.262.184-.569.276-.877.276s-.615-.092-.876-.275c-1.249-.878-.98-.794-2.528-.789h-.004c-.645 0-1.216-.399-1.413-.99-.473-1.417-.311-1.198-1.562-2.067-.395-.274-.617-.708-.617-1.157 0-.148.024-.298.074-.444.483-1.411.484-1.139 0-2.555-.05-.147-.074-.297-.074-.445 0-.45.222-.883.616-1.157 1.251-.868 1.089-.648 1.562-2.067.197-.591.769-.99 1.413-.99h.004c1.545.005 1.271.095 2.528-.79.262-.183.569-.274.877-.274s.615.091.876.274c1.249.878.98.795 2.528.79h.004c.645 0 1.216.399 1.414.99.473 1.416.307 1.197 1.562 2.067.394.273.616.707.616 1.156 0 .148-.023.299-.074.445-.483 1.41-.485 1.139 0 2.555zm-3.426-2.798l-1.084-1.083-3.291 3.374-1.542-1.462-1.083 1.084 2.625 2.545 4.375-4.458z",transform:"translate(-3, 0.5)"})))),gu||(gu=l.createElement("rect",{width:"100%",height:"100%",fill:"url(#shimmering-gradient)",mask:"url(#icon-mask)"})))}const fu=l.forwardRef(vu);t.p;const ju=e=>{const{certification_request:s}=e,{certificate:a,status:t}=s||{},i="approved"===t&&!!a,{formatMessage:l}=(0,ja.A)(),n=l(i?{id:"label.certified.c9996efd",defaultMessage:"Certified"}:{id:"label.not_certified.8544534e",defaultMessage:"Not certified"});return(0,N.jsx)(Ce.S,{className:"certification-badge d-flex align-items-center justify-content-center",title:n,children:i?(0,N.jsx)(fu,{}):(0,N.jsx)(uu,{style:{opacity:.7}})})};ju.defaultProps={certified:!1};var _u=ju;const bu=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({certificate:null,visible:!1}),{certificate:n,visible:r}=a,{certification_template:o,user:d}=n||{},c=e=>{const{certificate:s}=e;t({certificate:s,visible:!0})},h=()=>i();return(0,l.useImperativeHandle)(s,()=>({hide:h,show:c,visible:r})),(0,N.jsxs)(xe,{className:"fancy-modal certificate-viewer-modal",onHide:h,show:r,size:"xl",children:[(0,N.jsxs)(xe.Header,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h3",{className:"m-0",children:null===o||void 0===o?void 0:o.title}),(0,N.jsx)("span",{className:"lead",children:(null===d||void 0===d?void 0:d.fullname)||"Unknown User"})]}),(0,N.jsx)(bh.A,{onClick:h,variant:"white"})]}),(0,N.jsx)(xe.Body,{className:"p-0",children:(0,N.jsx)(Su,{downloadable:!0,ownerOnly:!0,certificate_id:null===n||void 0===n?void 0:n.id})})]})});bu.displayName="CertificateViewerModal";var Au=bu;const yu=e=>{const{preview:s,variant:a}=e,t=oa()("certificate-renderer-placeholder placeholder d-flex flex-fill h-100 align-items-center justify-content-center",{roun
2ded:s});return(0,N.jsx)(Rh.A,{animation:"wave",bg:a,className:t,xs:12,children:(0,N.jsx)("h4",{className:"loading-message",children:s?(0,N.jsx)(ke.A,{defaultMessage:"Rendering preview...",id:"label.rendering_preview.dfe992db"}):(0,N.jsx)(ke.A,{defaultMessage:"Fetching certificate...",id:"label.fetching_certificate.7005c01b"})})})};yu.defaultProps={preview:!1,variant:"dark"};const wu=1056,Nu=816,Su=s=>{const{certificate_id:a,downloadable:t,ownerOnly:i,thumbnail:n}=s,{api:r,userId:o,userIsSiteAdmin:d}=(0,P.nm)(),[c,h]=(0,ne.CQ)({certificate:null,error:null,html:"",loading:!0}),{certificate:u,error:m,html:g,loading:p}=c,x=(0,l.useRef)(),v=(0,l.useRef)(),f=async()=>{try{h({error:null,loading:!0});const{certificate:e,html:s}=await r.get("/api/certifications/certificate/html",{certificate_id:a});h({certificate:e,html:s,loading:!1})}catch(e){h({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,loading:!1})}};(0,l.useEffect)(()=>{a&&f()},[a]),(0,l.useEffect)(()=>{const e=x.current,s=v.current;if(!e||!s||!g)return;const a=()=>{const a=e.clientWidth/wu;s.style.transform=`scale(${a})`,e.style.height=Nu*a+"px"};a();const t=new ResizeObserver(a);return t.observe(e),()=>t.disconnect()},[g]);return m?n?(0,N.jsx)("div",{className:"certificate-frame-container bg-light rounded",style:{aspectRatio:"1056 / 816",width:"100%"}}):(0,N.jsxs)(Ce.S,{className:"certificate-renderer d-flex flex-column justify-content-center align-items-center bg-secondary position-relative gap-3 p-5 text-center",children:[(0,N.jsx)("span",{className:"lead",children:(0,N.jsx)(ke.A,{defaultMessage:"Unable to load certificate.",id:"label.unable_to_load_certificate.5c7d9cfa"})}),(0,N.jsx)("span",{className:"text-danger",children:m}),(0,N.jsx)(ve.A,{onClick:f,size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Retry",id:"label.retry.942087cc"})})]}):p?(0,N.jsx)(yu,{preview:n}):(0,N.jsxs)(Ce.S,{className:n?"certificate-renderer-thumbnail":"certificate-renderer d-flex flex-column justify-content-center bg-secondary position-relative",children:[(0,N.jsx)("div",{className:"certificate-frame-container",ref:x,style:{aspectRatio:"1056 / 816",overflow:"hidden",position:"relative",width:"100%"},children:(0,N.jsx)("iframe",{className:"rounded",ref:v,scrolling:"no",srcDoc:g,style:{border:0,height:"816px",pointerEvents:n?"none":"auto",transformOrigin:"top left",width:"1056px"},title:"Certificate"})}),!n&&(()=>{const e=o===(null===u||void 0===u?void 0:u.user_id);return!(!t||i&&!e&&!d())})()&&(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center p-3",children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:()=>{var e;const s=null===(e=v.current)||void 0===e?void 0:e.contentWindow;s&&(s.focus(),s.print())},variant:"secondary",children:[(0,N.jsx)(ze.kl1,{}),(0,N.jsx)(ke.A,{defaultMessage:"Save as PDF",id:"label.save_as_pdf.4cab70e9"})]})})]})};Su.defaultProps={downloadable:!1,ownerOnly:!0,thumbnail:!1};var Cu=e=>{const{certification_request:s,challenge:a,group_assignment:t,member_evaluation:i,team:n}=e,{certificate:r,created_at:o,status:d}=s||{},{refreshAssignments:c}=Vr(),h=(0,l.useRef)(),u=(0,l.useRef)(),m=(0,l.useRef)(),g=async()=>{var e;const s=null===h||void 0===h?void 0:h.current;if(!s)return;await s.show({assignment_component:null===t||void 0===t||null===(e=t.group_assignment_components)||void 0===e?void 0:e[0],challenge:a,team:n})&&c()},p=async()=>{const e=null===u||void 0===u?void 0:u.current;if(!e)return;const{challenge_member_id:s}=i;e.show({challenge_member_id:s})},x=async()=>{const e=null===m||void 0===m?void 0:m.current;e&&r&&e.show({certificate:r})},v=()=>(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certification request submitted on {date}",id:"label.certification_request_submitted_on.b196bbbf",values:{date:ci()(o).format("M/D/YYYY")}})}),f=()=>{switch(d){case"awaiting_evaluation":case"processing":case"pending":return(0,N.jsx)(ph,{condition:!0,disabled:!0,onClick:e=>e.preventDefault(),tooltipContent:(0,N.jsx)(v,{}),tooltipPlacement:"bottom",tooltipTrigger:"hover",style:{borderBottomRightRadius:0,borderTopRightRadius:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Submitted",id:"label.submitted.64900440"})});case"approved":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{disabled:!r,onClick:x,style:{whiteSpace:"nowrap"},children:(0,N.jsx)(ke.A,{defaultMessage:"View certificate",id:"label.view_certificate.316744d9"})}),(0,N.jsx)(ve.A,{onClick:p,style:{whiteSpace:"nowrap"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"View report",id:"label.view_report.45e1eb06"})})]});case"denied":return(0,N.jsx)(ve.A,{onClick:p,style:{whiteSpace:"nowrap"},children:(0,N.jsx)(ke.A,{defaultMessage:"View report",id:"label.view_report.45e1eb06"})});default:return(0,N.jsx)(ve.A,{onClick:g,style:{borderBottomRightRadius:0,borderTopRightRadius:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Certify",id:"label.certify.c1567c29"})})}};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(f,{}),(0,N.jsx)(zu,{ref:h}),(0,N.jsx)(Xh,{ref:u}),(0,N.jsx)(Au,{ref:m})]})},Mu=t(4925);const ku=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),[i,n,r]=(0,ne.CQ)({assignment_component:{},certification_template:null,error:null,loading:!1,reject:Function(),resolve:Function(),submitted:!1,team:{},visible:!1}),{assignment_component:o,certification_template:d,challenge:c,error:h,loading:u,resolve:m,submitted:g,team:p,visible:x}=i,v=async()=>{try{var s;n({loading:!0});const e=null===i||void 0===i||null===(s=i.assignment_component)||void 0===s?void 0:s.certification_template_id,{certification_template:a}=await t.get(`/api/certification-templates/get/${e}`);n({certification_template:a,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},f=e=>new Promise(s=>{const{assignment_component:a={},challenge:t={},team:i={}}=e||{};n({assignment_component:a,challenge:t,resolve:s,team:i,visible:!0},v)}),j=()=>{m(g),r()},_=(0,ds.Wx)({enableReinitialize:!0,initialValues:{accrediting_body:1,terms_agreement:0},onSubmit:async(s,a)=>{let{resetForm:i}=a;await(async()=>{try{n({loading:!0}),await t.post("/api/certifications/request/create",{challenge_id:null===c||void 0===c?void 0:c.id}),n({loading:!1,submitted:!0})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1,submitted:!1})}})(),i()}}),{handleSubmit:b,setFieldValue:A,values:y}=_;return(0,l.useImperativeHandle)(a,()=>({hide:j,show:f,visible:x})),(0,N.jsxs)(xe,{backdrop:"static",className:"remove-footer-divider fancy-modal",onHide:j,show:x,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Request certification",id:"label.request_certification.88085505"})})}),g?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe.Body,{className:"pb-0 d-flex flex-column align-items-center gap-5 text-center",children:[(0,N.jsx)(Mu.cxC,{color:"var(--success)",size:48}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h5",{className:"text-primary text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"We've received your request.",id:"label.weve_received_your_request.e8c96a66"})}),(0,N.jsx)("p",{calssName:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Please allow up to 48 hours for your request to be processed.",id:"label.please_allow_up_to_48_hours_for_yo.be149c3f"})}),(0,N.jsxs)("small",{className:"mt-3 text-muted d-inline-flex flex-column align-items-start gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"* Submission does not guarantee certification.",id:"label.submission_does_not_guarantee_cert.2b3487dd"}),(0,N.jsx)("a",{href:"/support#certifications",rel:"noopener noreferrer",style:{width:"fit-content"},target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Learn how certifications work.",id:"label.learn_how_certifications_work.a61dc486"})})]})]})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:j,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]}):(0,N.jsx)(Me.x_,{loading:u,children:(0,N.jsx)(ds.QI,{value:_,children:(0,N.jsxs)(_e.A,{onSubmit:b,children:[(0,N.jsxs)(xe.Body,{className:"pb-0",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:h,variant:"danger",children:h}),(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations!",i
2d:"label.congratulations.6a9fac33"})}),(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"By completing this challenge, you are now eligible to submit your participation data for expert review, potentially earning the following certification:",id:"label.by_completing_this_challenge_you_a.2ca0ba9b"})}),(0,N.jsxs)(Ge.A,{className:"mb-3",children:[(0,N.jsx)(Ge.A.Header,{className:"d-flex align-items-center",children:(0,N.jsxs)(Ge.A.Title,{className:"d-flex gap-3 align-items-center m-0",children:[(0,N.jsx)(Me.R_,{rounded:!0,height:50,imageHeight:50,imageWidth:50,src:(null===d||void 0===d?void 0:d.icon_path)||xo,width:50}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column flex-fill",children:(0,N.jsx)("h5",{className:"m-0",children:null===d||void 0===d?void 0:d.title})})]})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Rl,{lines:2,children:(0,N.jsx)("small",{children:null===d||void 0===d?void 0:d.description})})})]}),(0,N.jsx)(_e.A.Group,{className:"d-flex flex-column gap-3",children:(0,N.jsx)(_e.A.Check,{checked:!!y.terms_agreement,name:"terms_agreement",onChange:e=>{let{target:{checked:s}}=e;return A("terms_agreement",(0,$h.parseBinary)(s))},label:(0,N.jsx)(ke.A,{defaultMessage:"I have read and understand the {privacy} and {terms}.",id:"label.i_have_read_and_understand_the_pri.315bd6b9",values:{privacy:(0,N.jsx)("a",{href:"/privacy",rel:"noopener noreferrer",target:"_blank",children:"Privacy Policy"}),terms:(0,N.jsx)("a",{href:"/terms",rel:"noopener noreferrer",target:"_blank",children:"Terms of Service"})}})})}),(0,N.jsxs)("small",{className:"mt-3 text-muted d-flex flex-column gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"* Submission does not guarantee certification.",id:"label.submission_does_not_guarantee_cert.2b3487dd"}),(0,N.jsx)("a",{href:"/support#certifications",rel:"noopener noreferrer",style:{width:"fit-content"},target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Learn how certifications work.",id:"label.learn_how_certifications_work.a61dc486"})})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:j,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{assignment_component:o,disabled:!y.terms_agreement,team:p,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit request",id:"label.submit_request.917e144e"})})]})]})})})]})});ku.displayName="CertificationRequestModal";var zu=ku;const Tu=e=>{let{bars:s,c1:a,c2:t,c3:i,c4:l,className:n,disabled:r,fourCs:o,height:d,legend:c,tooltip:h,width:u,y_axis_domain:m}=e;const{styles:g}=(0,P.nm)(),p=g&&g.primary,x=g&&g["gray-200"];
2o&&(a=o.hasOwnProperty("critical")?o.critical:o.hasOwnProperty("critical_score")?o.critical_score:a,t=o.hasOwnProperty("communication")?o.communication:o.hasOwnProperty("communication_score")?o.communication_score:t,i=o.hasOwnProperty("collaboration")?o.collaboration:o.hasOwnProperty("collaboration_score")?o.collaboration_score:i,l=o.hasOwnProperty("creativity")?o.creativity:o.hasOwnProperty("creativity_score")?o.creativity_score:l);const v=e=>{var s,a;const{active:t,label:i,payload:l}=e,n=null!==(s=null===l||void 0===l||null===(a=l[0])||void 0===a?void 0:a.value)&&void 0!==s?s:"";return t?(0,N.jsx)("div",{className:"four-c-tooltip",children:(0,N.jsx)("p",{className:"four-c-label m-0",children:`${(e=>{switch(e){case"1C":return"Critical Thinking";case"2C":return"Communication";case"3C":return"Collaboration";case"4C":return"Creativity"}})(i)} : ${n}`})}):(0,N.jsx)(N.Fragment,{})},f=((e,s,a,t)=>[{amt:4,name:"1C",score:e},{amt:4,name:"2C",score:s},{amt:4,name:"3C",score:a},{amt:4,name:"4C",score:t}])(a,t,i,l);return(0,N.jsx)(Ce.S,{className:`four-c-bar-chart ${n} ${r?"empty":""}`,style:{minHeight:d,minWidth:u},children:(0,N.jsxs)(_t.E,{className:"text-center",data:f,height:d,width:u,children:[(0,N.jsx)(At.W,{dataKey:"name",interval:0}),(0,N.jsx)(yt.h,{domain:m,interval:1,width:10}),h&&(0,N.jsx)(wt.m,{allowEscapeViewBox:{x:!0,y:!0},content:(0,N.jsx)(v,{})}),c&&(0,N.jsx)(Nt.s,{}),!(null===s||void 0===s||!s.length)&&s.map((e,s)=>{let{background:a,dataKey:t,fill:i}=e;return(0,N.jsx)(St.y,{background:a||{fill:x},barSize:8,dataKey:t,fill:i||p},s)})]})})};Tu.defaultProps={bars:[{dataKey:"score"}],c1:1,c2:2,c3:4,c4:3.5,className:"",height:90,legend:!1,responsive_height:"100%",responsive_width:"100%",tooltip:!0,width:80,y_axis_domain:[0,4]};var Iu=Tu;var Eu=e=>{var s,a,t,i,l,n,r,o,d;const{assignment:c}=e,h=!(null===c||void 0===c||null===(s=c.group_member)||void 0===s||null===(a=s.group)||void 0===a||null===(t=a.members)||void 0===t||!t.length),u=!(null===c||void 0===c||null===(i=c.assignment)||void 0===i||!i.enable_grading),m=h&&u,g=(null===c||void 0===c||null===(l=c.group_member_assignment_components)||void 0===l||null===(n=l[0])||void 0===n?void 0:n.challenge)||{},{is_graded:p,score:x}=g,v=(null===c||void 0===c||null===(r=c.group_member_assignment_components)||void 0===r||null===(o=r[0])||void 0===o||null===(d=o.challenge_member)||void 0===d?void 0:d.four_c_score)||{};return(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(Ce.S,{className:"d-flex flex-column align-items-center",children:(0,N.jsx)(Iu,{disabled:m&&!p,fourCs:v,tooltip:!0})}),u&&(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center justify-content-center",children:[(0,N.jsx)(Dt,{barSize:8,customDisabledLabel:!m&&"N/A",disabled:!m||!p,fontSize:14,height:50,labelClassName:!m&&"text-secondary",showLabel:!0,value:!!m&&x,width:50}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Score",id:"label.score.38e5a46c"})})]})]})},Fu={challenge:Eu};const Ru=e=>{const{color:s,phase:a,size:t,stroke:i}=e,n=[hn,mn,pn,jn,vn],r=(null===n||void 0===n?void 0:n[a-1])||l.Fragment;return(0,N.jsx)(r,{color:s,fontSize:t,strokeColor:i})};Ru.defaultProps={size:24};var Du=Ru;const Bu=e=>{const{filled:s,segments:a}=e,t=new Array(a).fill(null),i=e=>e<=s,l=e=>i(e)&&!i(e+1);return(0,N.jsx)(Ce.S,{className:"segmented-progress-bar d-flex",children:!(null===t||void 0===t||!t.length)&&t.map((e,s)=>(0,N.jsx)(Sa.A,{className:`d-inline-flex ${i(s+1)?"filled":""} ${l(s+1)?"active":""}`,max:100,now:i(s+1)?100:0,style:{width:`calc(100% / ${a})`}},s))})};Bu.defaultProps={segments:1};var Pu=Bu;const Lu=e=>{const{challenge:s}=e,{challenge_data:a,challenge_template:t}=s,i=(null===t||void 0===t?void 0:t.challenge_type)||"classic",l=Za.Ay[i]||Za.Ay.classic,n=e=>{var s,t,i,l;return null!==(s=null===a||void 0===a||null===(t=a.filter)||void 0===t||null===(i=t.call(a,s=>Number.parseInt(e)===s.phase))||void 0===i||null===(l=i.map)||void 0===l?void 0:l.call(i,e=>{let{is_complete:s,phase:a,subphase:t}=e;return{is_complete:s,phase:a,subphase:t}}))&&void 0!==s?s:[]},r=(()=>{for(let e=1;e<=5;e++)if(!n(e).every(e=>{let{is_complete:s}=e;return!!s}))return e;return 5})(),o=(e=>{var s;return(null===(s=l.phases[e])||void 0===s?void 0:s.title)||""})(r);return(0,N.jsxs)(Ce.S,{className:"challenge-progress-indicator d-flex flex-column gap-2",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)("span",{className:"phase-icon d-flex align-items-center justify-content-center rounded-circle p-2",children:(0,N.jsx)(Du,{phase:r})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsxs)("small",{className:"text-uppercase fw-semibold text-muted",children:["Phase ",r," / 5"]}),(0,N.jsx)("h5",{className:"m-0",children:o})]})]}),(0,N.jsx)(Pu,{filled:r,segments:5})]})};Lu.defaultProps={challenge:{}};var Ou={challenge:Lu},Hu=t(86694);var Uu=e=>{const{children:s,embed:a,style:i}=e,{type:l}=a||{},n=(()=>{let e={account_needed:!1,description:"",icon_path:"",link:"",link_label:"",title:""};switch(l){case"bandcamp":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"First upload your song to Bandcamp and then <strong>click</strong> the Share/Embed button below the album art",description:"",id:"label.first_upload_your_song_to_bandcamp.e2b0078f",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsxs)("li",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> this track, choose your embed style, and copy and paste your embed code (it should start with  <em>iframe</em>)",description:"",id:"label.click_embed_this_track_choose_your.34b742bc",values:{em:e=>(0,N.jsx)("em",{children:e}),strong:e=>(0,N.jsx)("strong",{children:e})}})," "]}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> below, and paste your Embed link in its entirety",description:"",id:"label.click_embed_below_and_paste_your_e.e770e776",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://bandcamp.com/login",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open bandcamp",description:"",id:"label.o
2pen_bandcamp.ce591792"}),e.title=(0,N.jsx)(ke.A,{defaultMessage:"Bandcamp",description:"",id:"label.bandcamp.088f5f25"}),e.icon_path=t(35855);break;case"soundcloud":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"First upload your song to Soundcloud and then <strong>click</strong> the Share Button below the track",description:"",id:"label.first_upload_your_song_to_soundclo.9c606703",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsxs)("li",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Navigate to the <strong>Embed</strong> tab, copy the link under Code to your clipboard (it should start with <em>iframe</em>)",description:"",id:"label.navigate_to_the_embed_tab_copy_the.895bb8fd",values:{em:e=>(0,N.jsx)("em",{children:e}),strong:e=>(0,N.jsx)("strong",{children:e})}})," "]}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> below, and paste your Embed link in its entirety",description:"",id:"label.click_embed_below_and_paste_your_e.e770e776",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.soundcloud.com",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open soundcloud",description:"",id:"label.open_soundcloud.1f169902"}),e.title=(0,N.jsx)(ke.A,{defaultMessage:"Soundcloud",description:"",id:"label.soundcloud.edb0232d"}),e.icon_path=t(43326);break;case"powtoon":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"First upload your project to Powtoon and then <strong>click</strong> the Share/Embed button below the album art",description:"",id:"label.first_upload_your_project_to_powto.4815fe55",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> this track, choose your embed style, and copy and paste your embed code (it should start with  <em>iframe</em>)",description:"",id:"label.click_embed_this_track_choose_your.34b742bc",values:{em:e=>(0,N.jsx)("em",{children:e}),strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> below, and paste your Embed link in its entirety",description:"",id:"label.click_embed_below_and_paste_your_e.e770e776",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://powtoon.com",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open powtoon",description:"",id:"label.open_powtoon.e9458746"}),e.title=(0,N.jsx)(ke.A,{defaultMessage:"Powtoon",description:"",id:"label.powtoon.3aa71e60"}),e.icon_path=t(19608);break;case"creative_cloud_express":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Within Adobe Creative Cloud Express, click the <strong>Share</strong> button, and then <strong>Publish</strong>",description:"",id:"label.within_adobe_creative_cloud_expres.fb03dd27",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"From the <strong>Share</strong> menu, select <strong>Link</strong>",description:"",id:"label.from_the_share_menu_select_link.78297171",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Finally, copy and paste the link.",description:"",id:"label.finally_copy_and_paste_the_link.8c1d33cb"})})]}),e.link="https://www.adobe.com/express/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open adobe creative cloud express",description:"",id:"label.open_adobe_creative_cloud_express.7cf26e3c"}),e.title=(0,N.jsx)(ke.A,{defaultMessage:"Adobe creative cloud express",description:"",id:"label.adobe_creative_cloud_express.f359b692"}),e.icon_path=t(70200);break;case"youtube":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"After uploading your video to YouTube, copy the video url from your browser",description:"",id:"label.after_uploading_your_video_to_yout.7d8d4844"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Alternatively, when viewing the video scroll down to the share button, click it and copy the share link",description:"",id:"label.alternatively_when_viewing_the_vid.adca55d0"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> below, and paste your link",description:"",id:"label.click_embed_below_and_paste_your_l.8829383a",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.youtube.com/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open YouTube",description:"",id:"label.o
2pen_youtube.f0a69d5a"}),e.title="YouTube",e.icon_path=t(2078);break;case"vimeo":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"After uploading your video to Vimeo, copy the video url from your browser",description:"",id:"label.after_uploading_your_video_to_vime.857daee6"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Alternatively, hover over your video and click the paper airplane Share icon and copy the Link",description:"",id:"label.alternatively_hover_over_your_vide.eab465f5"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed</strong> below, and paste your link",description:"",id:"label.click_embed_below_and_paste_your_l.8829383a",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.vimeo.com/signin",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open vimeo",description:"",id:"label.open_vimeo.86c92ce2"}),e.title="Vimeo",e.icon_path=t(42976);break;case"prezi":e.account_needed=!1,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"After creating your presentation with Prezi, select the <b>Share</b> button",description:"",id:"label.after_creating_your_presentation_w.c5144f04",values:{b:e=>(0,N.jsx)("b",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <b>Copy</b> to copy the link, and paste your link when creating your deliverable",description:"",id:"label.click_copy_to_copy_the_link_and_pa.b2dedc90",values:{b:e=>(0,N.jsx)("b",{children:e})}})})]}),e.link="https://www.prezi.com/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open prezi",description:"",id:"label.open_prezi.2187030e"}),e.title="Prezi",e.icon_path=t(8096);break;case"canva":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Within Canva, select <b>Share link to watch</b>",description:"",id:"label.within_canva_select_share_link_to.e6b055d7",values:{b:e=>(0,N.jsx)("b",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Copy the <strong>Link</strong> to your clipboard",description:"",id:"label.copy_the_link_to_your_clipboard.f0d5e18e",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Paste the link when creating your deliverable",description:"",id:"label.paste_the_link_when_creating_your.7e2a8b9f"})})]}),e.link="https://www.canva.com/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open canva",description:"",id:"label.open_canva.cf3074b2"}),e.title="Canva",e.icon_path=t(83698);break;case"google_slides":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Within Google Slides, first <strong>publish</strong> your presentation",description:"",id:"label.within_google_slides_first_publish.14a5daea",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Once published, under the <strong>Link</strong> tab, copy the link to your project",description:"",id:"label.once_published_under_the_link_tab.f13f6e91",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed Slides</strong> below, and paste your link",description:"",id:"label.click_embed_slides_below_and_paste.82f44a68",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.google.com/slides/about/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open slides",description:"",id:"label.open_slides.5413b504"}),e.title="Google Slides",e.icon_path=t(44838);break;case"google_sheets":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Within Google Sheets, first <strong>publish</strong> your spreadsheet",description:"",id:"label.within_google_sheets_first_publish.c21a9a51",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Once published, under the <strong>Link</strong> tab, copy the link to your project",description:"",id:"label.once_published_under_the_link_tab.f13f6e91",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed Sheets</strong> below, and paste your link",description:"",id:"label.click_embed_sheets_below_and_paste.bd99248f",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.google.com/sheets/about/",e.link_label="Open Sheets",e.title="Google Sheets",e.icon_path=t(67070);break;case"google_docs":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Within Google Docs, first <strong>publish</strong> your document",description:"",id:"label.within_google_docs_first_publish_y.164297d3",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Once published, under the <strong>Link</strong> tab, copy the link to your project",description:"",id:"label.once_published_under_the_link_tab.f13f6e91",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed Sheets</strong> below, and paste your link",description:"",id:"label.click_embed_sheets_below_and_paste.bd99248f",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.google.com/docs/about/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open docs",description:"",id:"label.o
2pen_docs.76deaf7d"}),e.title="Google Docs",e.icon_path=t(44838);break;case"office_online":e.account_needed=!0,e.description=(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"In Word, Excel, or PowerPoint Online, open <strong>File \u2192 Share \u2192 Embed</strong>",description:"",id:"label.in_word_excel_or_powerpoint_online.7a91c70f",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Copy the <strong>src URL</strong> from the generated embed code",description:"",id:"label.copy_the_src_url_from_the_generate.1930885b",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click <strong>Embed Office Online</strong> below, and paste your link",description:"",id:"label.click_embed_office_online_below_an.ddf8c798",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]}),e.link="https://www.office.com/",e.link_label=(0,N.jsx)(ke.A,{defaultMessage:"Open office online",description:"",id:"label.open_office_online.a771d2f3"}),e.title="Microsoft Office Online",e.icon_path=t(2371)}return e})(),r=(0,N.jsx)(Hu.A,{classname:"deliverable-popover",children:(0,N.jsxs)(Hu.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"mb-2",style:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-start"},children:[(0,N.jsx)("img",{alt:"",height:25,src:n.icon_path,style:{objectFit:"contain"},width:25}),(0,N.jsxs)(Ce.S,{className:"ms-2",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)("strong",{style:{fontSize:14},children:n.title})}),(0,N.jsx)(Ce.S,{className:"text-muted",style:{color:"rgba(55,55,55,.50)",fontSize:12,fontWeight:500},children:n.account_needed?(0,N.jsx)(ke.A,{defaultMessage:"*Account Required",id:"label.account_required.b9736a80"}):(0,N.jsx)(ke.A,{defaultMessage:"*No Account Required",id:"label.no_account_required.b97bd895"})})]})]}),(0,N.jsx)(Ce.S,{className:"embed-instructions",style:{color:"rgba(55,55,55,.75)",fontSize:14},children:n.description})]})});return(0,N.jsx)(Ce.S,{style:i,children:(0,N.jsx)(Ua.A,{overlay:r,placement:"top",trigger:"hover",children:(0,N.jsx)(ve.A,{className:"p-0",onClick:e=>e.preventDefault(),tabIndex:"0",variant:"link",children:s})})})};var Qu=e=>{const{ext:s,filename:a,location:t}=e,{styles:i}=(0,P.nm)(),l=i&&i.primary;let n;const r=()=>{switch(s){case"ppt":case"pptx":return n="Powerpoint Presentation",(0,N.jsx)(ze.rgF,{color:l,size:64});case"doc":case"docx":return n="Word Document",(0,N.jsx)(ze.WLb,{color:l,size:64});case"pdf":return n="PDF Document",(0,N.jsx)(ze.kl1,{color:l,size:64});case"rtf":return n="RTF Document",(0,N.jsx)(ze.t69,{color:l,size:64});case"xlsx":return n="Excel Spreadsheet",(0,N.jsx)(ze.Ru,{color:l,size:64});case"csv":return n="CSV Document",(0,N.jsx)(ze.QaY,{color:l,size:64});case"tsv":return n="TSV Document",(0,N.jsx)(ze.Gp9,{color:l,size:64});default:return n="Uploaded Resource",(0,N.jsx)(ze.Gp9,{color:l,size:64})}};return(0,N.jsxs)(Ce.S,{className:"solvably-document-deliverable",children:[(0,N.jsx)(r,{}),(0,N.jsx)("strong",{className:"pt-1",children:a||n}
2),(0,N.jsx)(Ce.S,{className:"download-link",children:(0,N.jsxs)(Me.NX,{"aria-label":"Download this deliverable document",className:"text-decoration-none d-flex align-items-center gap-1",filename:a,show_loading_label:!0,type:s,url:t,variant:"link",children:[(0,N.jsx)(ze.WCW,{"aria-hidden":!0}),(0,N.jsx)(ke.A,{defaultMessage:"Download",id:"label.download.d6eafe82"})]})})]})},Vu=t(4613);var Gu=e=>{const s=(0,l.useContext)(n.BR),{downloadable:a,setCycleDelay:t,src:i,title:r}=e,o=`video/${s.utils.parseExt(i)}`,[d,c]=(0,l.useState)(!0);let h;const u=()=>{h.ended?(c(!0),g(5)):g(5)},m=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},g=e=>{t&&t(e)};return(0,l.useEffect)(()=>{let e=h;e.onvolumechange=function(e){localStorage.setItem("aim_video_volume",e.target.muted?0:e.target.volume)};const s=localStorage.getItem("aim_video_volume");null!=s&&(e.volume=s)},[]),(0,N.jsxs)(Ce.S,{className:"solvably-video-wrapper w-100",children:[(0,N.jsx)(Ce.S,{className:"solvably-video",children:(0,N.jsx)("video",{autoPlay:!1,className:"video-fluid",controls:!d,crossOrigin:"anonymous",onClick:e=>m(e),onEnded:u,onPause:u,onPlay:()=>g(Math.floor(h.duration-h.currentTime)+5),ref:e=>h=e,title:r||"project solution video",children:(0,N.jsx)("source",{src:i,type:o})})}),(0,N.jsx)(ve.A,{className:"video-play-button "+(d?"":"hidden"),onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),c(!1),h.play()},variant:"link",children:(0,N.jsx)(Zs.A,{alt:"video play button icon","aria-hidden":!0,height:48,src:null===Vu.default||void 0===Vu.default?void 0:Vu.default.play,width:48})}),a&&(0,N.jsx)("a",{"aria-label":"download video",className:"video-download-button icon-button "+(d?"":"hidden"),href:i,onClick:e=>m(e),rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(Zs.A,{alt:"video download button","aria-hidden":!0,height:24,src:null===Vu.default||void 0===Vu.default?void 0:Vu.default.download,width:24})})]})};const Wu=e=>{const{src:s}=e;return(0,N.jsx)(Ce.S,{className:"audio-player-wrapper w-100",children:(0,N.jsx)(Ce.S,{className:"audio-player",children:(0,N.jsxs)("audio",{controls:!0,autoPlay:!1,children:[(0,N.jsx)("source",{src:s,type:"audio/mpeg"}),(0,N.jsxs)("p",{children:["Your browser doesn't support HTML5 audio. Here is a ",(0,N.jsx)("a",{href:s,children:"link to the audio"})," instead."]})]})})})};var Ku=e=>{var s,a;const{styles:t}=(0,n.nm)(),{black:i}=t,l=e.deliverable,r=e.deliverable_choice,o=e.width||"100%",d=e.height||650,c=e.download_only||!1,h=(e,s,a,t)=>{var i,l,n,r,o,d,c;if(!e)return"";let{file:h,link:u}=e;h||(h={}),!u&&h.location&&(u=h.location);let m=u?u.split(".").pop():"";var g;if(m="string"==typeof m?m:"",null!==(i=h)&&void 0!==i&&i.type)switch(null===(g=h)||void 0===g?void 0:g.type){case"image":return(0,N.jsx)(Ce.S,{className:"deliverable-rendering deliverable-rendering-image",children:(0,N.jsx)(Zs.A,{alt:"final deliverable",fluid:!0,height:a,rounded:!0,src:null===(l=h)||void 0===l?void 0:l.location,width:s})});case"video":return(0,N.jsx)(Ce.S,{className:"deliverable-rendering deliverable-rendering-video position-relative",children:(0,N.jsx)(Gu,{downloadable:!0,src:null===(n=h)||void 0===n?void 0:n.location,title:"final deliverable"})});case"audio":return(0,N.jsx)(Ce.S,{className:"deliverable-rendering deliverable-rendering-audio position-relative",children:t?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Gp9,{size:25})," ",(0,N.jsx)("b",{children:(0,N.jsxs)("a",{href:u,children:["Download File (",m.toUpperCase(),")"]})})]}):(0,N.jsx)(Wu,{src:null===(r=h)||void 0===r?void 0:r.location,title:"final deliverable"})});case"file":return(0,N.jsx)(Ce.S,{className:"deliverable-rendering deliverable-rendering-file",children:t?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Gp9,{size:25})," ",(0,N.jsx)("b",{children:(0,N.jsxs)("a",{href:u,children:["Download File (",m.toUpperCase(),")"]})})]}):(0,N.jsx)(Qu,{ext:null===(o=h)||void 0===o?void 0:o.ext,filename:null===(d=h)||void 0===d?void 0:d.filename,location:null===(c=h)||void 0===c?void 0:c.location})});default:return(0,N.jsx)(N.Fragment,{})}else if(u)return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("a",{className:"float-end mb-2 d-flex align-items-center",href:u,rel:"noreferrer noopener",target:"_blank",children:[(0,N.jsx)(ke.A,{defaultMessage:"Open in New Window",id:"label.o
2pen_in_new_window.e8e0ccba"}),(0,N.jsx)(ze.EQc,{className:"ms-1"})]}),(0,N.jsx)(Ce.S,{className:"deliverable-rendering deliverable-rendering-file embedded-deliverable",children:(0,N.jsx)("iframe",{allowFullScreen:"true",frameBorder:"0",height:a,mozallowfullscreen:"true",src:u,style:{borderRadius:4},title:"Preview of the uploaded deliverable",webkitallowfullscreen:"true",width:s})})]})};return e.show_details||!1?(0,N.jsxs)(Ce.S,{className:"deliverable",children:[(0,N.jsx)(bo.A,{bg:"gray-alt",pill:!0,children:(0,N.jsxs)("span",{className:"d-flex gap-1 text-black",children:[(0,N.jsx)(zm,{ext:null===l||void 0===l||null===(s=l.file)||void 0===s?void 0:s.ext,fill:i,size:16,type:null===l||void 0===l||null===(a=l.file)||void 0===a?void 0:a.type}),null===r||void 0===r?void 0:r.title]})}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:(null===r||void 0===r?void 0:r.specifics)||""}}),(0,N.jsx)(Ce.S,{className:"deliverable-item",children:h(l,o,d,c)})]}):(0,N.jsx)(N.Fragment,{children:h(l,o,d,c)})};const Yu=async e=>{let s=null;return((e=e.replace("//www.","//")).includes("express.adobe.com/post")||e.includes("express.adobe.com/page"))&&(s=qu(e)),e.includes("powtoon.com")&&(s=Ju(e)),e.includes("prezi.com")&&(s=Xu(e)),e.includes("bandcamp.com")&&(s=Zu(e)),e.includes("soundcloud.com")&&(s=$u(e)),e.includes("docs.google.com/document")&&(s=sm(e)),e.includes("docs.google.com/presentation")&&(s=am(e)),e.includes("docs.google.com/spreadsheets")&&(s=tm(e)),e.includes("vimeo")&&(s=im(e)),(e.startsWith("https://youtu.be")||e.startsWith("https://youtube.com"))&&(s=lm(e)),e.includes("canva.com")&&(s=nm(e)),om(e)&&(s=dm(e)),s},qu=e=>({link:e,subtype:"creative_cloud_express"}),Ju=e=>({link:"https://powtoon.com/embed/"+e.split("/").filter(e=>e.match(/[A-Za-z0-9]{11,11}/g)).find(e=>11==e.length),subtype:"powtoon"}),Xu=e=>({link:e,subtype:"prezi"}),Zu=e=>{let s=null;return s={link:e.slice(e.indexOf("src=")+5,e.lastIndexOf("seamless>")+9),subtype:"bandcamp"},s},$u=e=>{let s=null;return s={link:e.slice(e.indexOf("src=")+5,e.lastIndexOf("><")-1),subtype:"soundcloud"},s},em=e=>{const s='There was an error loading your document. Please make sure you have the privacy mode set to "Anyone with the link" and try again.';return fetch(e).then(e=>200===e.status?{error:null,valid:!0}:{error:s,valid:!1}).catch(e=>({error:s,valid:!1}))},sm=async e=>{let s=null;const a=await em(e);return null!==a&&void 0!==a&&a.valid?(s={link:e,subtype:"google_docs"},s):Error(a.error)},am=async e=>{let s=null;const a=await em(e);return null!==a&&void 0!==a&&a.valid?(s={link:e,subtype:"google_slides"},s):Error(a.error)},tm=async e=>{let s=null;const a=await em(e);return null!==a&&void 0!==a&&a.valid?(s={link:e,subtype:"google_sheets"},s):Error(a.error)},im=async s=>{let a=null;try{const e=await(t=s,new Promise((e,s)=>{fetch("https://vimeo.com/api/oembed.json?url="+t).then(e=>e.json()).then(s=>{if(s&&null!==s&&void 0!==s&&s.thumbnail_url_with_play_button){const a="https://player.vimeo.com/video/"+s.video_id;e(a)}}).catch(e=>{s(e)})}));e&&(a={link:e,subtype:"vimeo"})}catch(e){return Error(e)}var t;return a},lm=e=>{let s=null;const a=(e=>{const s=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return!(!s||11!==s[7].length)&&s[7]})(e);if(a){s={link:"https://youtube.com/embed/"+a,subtype:"youtube"}}return s},nm=e=>(-1!==e.indexOf("/view")||-1!==e.indexOf("/watch"))&&(-1!==e.indexOf("?")&&(e=e.substr(0,e.indexOf("?"))),-1===e.indexOf("?embed")&&(e+="?embed"),{link:e,subtype:"canva"}),rm=["onedrive.live.com","1drv.ms","sharepoint.com","officeapps.live.com","office.com","office365.com","live.com"],om=e=>rm.some(s=>e.includes(s)),dm=e=>{let s=e;return s.includes("sharepoint.com")&&!/action=embedview/i.test(s)&&(s+=s.includes("?")?"&action=embedview":"?action=embedview"),{link:s,subtype:"office_online"}},cm="creating",hm="error",um="form",mm="login",gm="success",pm=[{ext:"docx",label:"Word document",value:"word"},{ext:"pptx",label:"PowerPoint presentation",value:"powerpoint"},{ext:"xlsx",label:"Excel workbook",value:"excel"}],xm=(0,l.forwardRef)((s,a)=>{var t;const{allowed_kinds:i=["word","powerpoint","excel"],default_filename:n="Team Deliverable",onConfirmed:r,onCreated:o}=s,d=(0,P.nm)(),{api:c}=d,h=dt(),u=(null===h||void 0===h?void 0:h.team)||null,{formatMessage:m}=(0,ja.A)(),[g,p]=(0,l.useState)(!1),[x,v]=(0,l.useState)(mm),[f,j]=(0,l.useState)(null),[_,b]=(0,l.useState)(n),[A,y]=(0,l.useState)(i[0]||"word"),[w,S]=(0,l.useState)(""),[C,M]=(0,l.useState)(null),[k,z]=(0,l.useState)("idle");(0,l.useImperativeHandle)(a,()=>({show:async()=>{j(null),b(n),y(i[0]||"word"),S(""),M(null),z("idle");const e=await te();v(e?um:mm),p(!0)}}));const T=()=>{p(!1)},I=pm.filter(e=>i.includes(e.value)),E=I.length>1;return(0,N.jsxs)(xe,{dismissable:!0,backdrop:"static",onHide:T,show:g,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.cpg,{className:"text-primary"}),(0,N.jsx)(ke.A,{defaultMessage:"Create document in OneDrive",id:"label.create_document_in_onedrive.a9c92bc7"})]})}),(0,N.jsxs)(xe.Body,{children:[f&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>j(null),variant:"danger",children:f}),x===mm&&(0,N.jsxs)(Ce.S,{className:"text-center py-3",children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Sign in with your Microsoft account to create a new document in your OneDrive.",id:"label.sign_in_with_your_microsoft_accoun.d2c8cf8c"})}),(0,N.jsxs)(ve.A,{onClick:async()=>
2{if(!await ie(ee.FILES))return v(hm),void j(m({id:"label.microsoft_sign_in_failed_please_tr.05247d46",defaultMessage:"Microsoft sign-in failed. Please try again."}));v(um)},size:"lg",children:[(0,N.jsx)(ze.cpg,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Sign in with Microsoft",id:"label.sign_in_with_microsoft.92fa49e9"})]})]}),x===um&&(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-3",children:[E&&(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Document type",id:"label.document_type.5b81f70d"})}),(0,N.jsx)(_e.A.Select,{onChange:e=>y(e.target.value),value:A,children:I.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"File name",id:"label.file_name.3efed3de"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{autoFocus:!0,maxLength:120,onChange:e=>b(e.target.value),value:_,placeholder:m({id:"label.team_deliverable.df9644d2",defaultMessage:"Team deliverable"})}),(0,N.jsxs)(Ei.A.Text,{children:[".",(null===(t=I.find(e=>e.value===A))||void 0===t?void 0:t.ext)||"docx"]})]}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Saved to your OneDrive under /Solvably/. The link will be posted to your team chat.",id:"label.saved_to_your_onedrive_under_solva.fa649bdb"})})]})]}),x===cm&&(0,N.jsxs)(Ce.S,{className:"text-center py-4",children:[(0,N.jsx)(qt.A,{animation:"border",variant:"primary"}),(0,N.jsx)("p",{className:"mt-3 mb-0 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Creating your document in OneDrive\u2026",id:"label.creating_your_document_in_onedrive.f5aa831d"})})]}),x===gm&&(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-3 py-2",children:[(0,N.jsx)("p",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Document created. The link has been saved as your team's deliverable.",id:"label.document_created_the_link_has_been.4406977e"})}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{className:"small text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Document URL",id:"label.document_url.736b5b1e"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{readOnly:!0,value:w}),(0,N.jsx)(ve.A,{"aria-label":"Copy",onClick:()=>{var e,s;null!==(e=navigator)&&void 0!==e&&null!==(s=e.clipboard)&&void 0!==s&&s.writeText&&navigator.clipboard.writeText(w)},variant:"outline-secondary",children:(0,N.jsx)(ze.paH,{})})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 small",children:["sending"===k&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(qt.A,{animation:"border",size:"sm"}),(0,N.jsx)(ke.A,{defaultMessage:"Posting link to team chat\u2026",id:"label.posting_link_to_team_chat.46505535"})]}),"sent"===k&&(0,N.jsx)("span",{className:"text-success",children:(0,N.jsx)(ke.A,{defaultMessage:"Link posted to team chat.",id:"label.link_posted_to_team_chat.37ecaae5"})}),"failed"===k&&(0,N.jsx)("span",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Document was created, but the chat message could not be posted.",id:"label.document_was_created_but_the_chat.0818f2b0"})})]})]}),x===hm&&(0,N.jsx)(Ce.S,{className:"text-center py-3",children:(0,N.jsx)("p",{className:"text-muted m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Something went wrong. You can retry, or close this and add your link manually.",id:"label.something_went_wrong_you_can_retry.91d7341f"})})})]}),(0,N.jsxs)(xe.Footer,{children:[x===um&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onClick:T,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!_.trim(),onClick:async()=>{var s,a;const t=(_||"").trim();if(t.length<2)return void j(m({id:"label.please_enter_a_name_for_your_docum.9d67487d",defaultMessage:"Please enter a name for your document."}));let i;v(cm),j(null);try{i=await(async e=>{let{filename:s,kind:a}=e;if(!ae)throw new Error("Microsoft sign-in is not initialized");const t=se[a];if(!t)throw new Error(`Unsupported Office document kind: ${a}`);let i,l=null;try{l=await le(ee.FILES)}catch(m){throw m}try{const e=await fetch(t.template);
2if(!e.ok)throw new Error(`Failed to load template (${e.status})`);i=await e.arrayBuffer()}catch(m){throw new Error("Unable to load Office template: "+((null===m||void 0===m?void 0:m.message)||m))}const n=`https://graph.microsoft.com/v1.0/me/drive/root:/${["Solvably",`${(s||"Untitled").replace(/[<>:"/\\|?*\x00-\x1f]/g,"_").trim().slice(0,120)||"Untitled"}.${t.ext}`].map(encodeURIComponent).join("/")}:/content`;try{var r,o,d;const e=await Z.A.put(n,i,{headers:{Authorization:`Bearer ${l.accessToken}`,"Content-Type":t.mime}});return{id:null===(r=e.data)||void 0===r?void 0:r.id,name:null===(o=e.data)||void 0===o?void 0:o.name,webUrl:null===(d=e.data)||void 0===d?void 0:d.webUrl}}catch(m){var c,h,u;const e=(null===m||void 0===m||null===(c=m.response)||void 0===c||null===(h=c.data)||void 0===h||null===(u=h.error)||void 0===u?void 0:u.message)||(null===m||void 0===m?void 0:m.message)||m;throw new Error("Unable to create OneDrive document: "+e)}})({filename:t,kind:A})}catch(e){return v(hm),void j((null===e||void 0===e?void 0:e.message)||String(e))}const l=null===(s=i)||void 0===s?void 0:s.webUrl;if(!l)return v(hm),void j(m({id:"label.the_document_was_created_but_no_li.dfc82fc1",defaultMessage:"The document was created but no link was returned. Please try again."}));S(l),z("sending");const n=(null===(a=se[A])||void 0===a?void 0:a.label)||"document",r=await(async(s,a)=>{const t=null===u||void 0===u?void 0:u.id;if(!t)return!1;const i=`I created a Microsoft ${a} for our team to work on`,l=`<p>${i}</p><p><a href="${s}" target="_blank" rel="noopener noreferrer">${s}</a></p>`,n=`${i}\n${s}`;try{return await c.post("/api/teams/chat/add",{body:l,file_id:null,source:"system_post",team_id:t,text:n}),!0}catch(e){return!1}})(l,n);z(r?"sent":"failed");const d=Yu(l)||{link:l,subtype:"office_online"};M(d),"function"===typeof o&&o(d,l),v(gm)},children:(0,N.jsx)(ke.A,{defaultMessage:"Create document",id:"label.create_document.ac6e9784"})})]}),x===gm&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{as:"a",href:w,rel:"noopener noreferrer",target:"_blank",variant:"outline-primary",children:[(0,N.jsx)(ze.EQc,{className:"me-1",size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Open document",id:"label.open_document.07e93c9e"})]}),(0,N.jsx)(ve.A,{onClick:()=>{"function"===typeof r&&C&&r(C,w),p(!1)},children:(0,N.jsx)(ke.A,{defaultMessage:"Done",id:"label.done.11a6767d"})})]}),x===hm&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onClick:T,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{onClick:()=>v(um),children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})]}),x===mm&&(0,N.jsx)(ve.A,{onClick:T,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),x===cm&&(0,N.jsx)(ve.A,{disabled:!0,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})})]})]})});xm.displayName="OfficeDocumentCreatorModal";var vm=xm;var fm=t.p+"static/media/drag_drop_image_placeholder_icon.843aaaf925ba7c33e9ebe5a3892697a9.svg";var jm=t.p+"static/media/upload_cloud.35a21819cbc0363338d6301bd0f3551e.svg";var _m=t.p+"static/media/drag_drop_square.d3324fafc3c370c4f4ba424fd84a275e.svg";const bm=e=>{const{background:s,className:a,fontSize:t,height:i,label:l,size:r,supported_types:o,textDisplay:d,variant:c,width:h}=e,{styles:u}=(0,n.nm)(),m=null===u||void 0===u?void 0:u.primary,g=()=>{const e=null===o||void 0===o?void 0:o.length;let s="";return o.forEach((a,t)=>{0!==t&&(s+=" "),s+=a.toUpperCase(),2===e&&t!==e-1||e>2&&t===e-2?s+=" and":t!==e-1&&(s+=",")}),s};return(0,N.jsx)(Ce.S,{className:a,style:{background:s},children:(()=>{switch(c){case"default":return(0,N.jsx)(Ce.S,{className:"whitespace-wrap container-default",style:{height:i,width:h},children:(0,N.jsxs)(Ce.S,{className:"absolute-transform-middle icon",children:[(0,N.jsx)(ze.dkL,{size:r}),(0,N.jsx)("small",{className:"label-text",style:{display:d,fontSize:t},children:l})]})});case"drag-drop":return(0,N.jsxs)(Ce.S,{className:"whitespace-wrap container-drag-drop",style:{height:i,width:h},tabIndex:"0",children:[(0,N.jsx)(Ce.S,{className:"mx-auto dashed-bg"}),(0,N.jsx)("img",{alt:"",className:"absolute-transform-middle",src:fm}),(0,N.jsx)(Ce.S,{className:"mx-auto",style:{height:40,width:"100%"}}),(0,N.jsxs)("small",{style:{display:d,fontSize:t},children:[l,(0,N.jsx)(Ce.S,{style:{color:m},children:(0,N.jsx)(ke.A,{defaultMessage:"Select your file",description:"",id:"label.select_your_file.8fd6bba1"})})]})]});case"drag-drop-cloud":return(0,N.jsxs)(Ce.S,{className:"whitespace-wrap container-drag-drop",style:{height:i,width:h},children:[(0,N.jsx)("img",{alt:"",className:"absolute-transform-middle",src:jm,style:{to
2p:"30%"}}),(0,N.jsx)(Ce.S,{className:"mx-auto",style:{height:100,width:"100%"}}),(0,N.jsxs)("small",{style:{display:d,fontSize:t},children:[l,(0,N.jsx)(Ce.S,{style:{color:m},children:(0,N.jsx)(ke.A,{defaultMessage:"Select your file",description:"",id:"label.select_your_file.8fd6bba1"})})]})]});case"drag-drop-square":return(0,N.jsxs)(Ce.S,{className:"whitespace-wrap container-drag-drop",style:{height:i,width:h},children:[(0,N.jsx)("img",{alt:"",className:"absolute-transform-middle",src:_m,style:{top:"30%"}}),(0,N.jsx)(Ce.S,{className:"mx-auto",style:{height:100,width:"100%"}}),(0,N.jsxs)("p",{style:{display:d,fontSize:t},children:[l,(0,N.jsx)("span",{className:"ms-1",style:{color:m},children:(0,N.jsx)(ke.A,{defaultMessage:"select file...",id:"label.select_file.2d06d5e5"})})]}),o?(0,N.jsx)("p",{className:"small text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Supports {types}",id:"label.supports_types.1273a8b1",values:{types:g()}})}):(0,N.jsx)(N.Fragment,{})]});case"embed-only":return(0,N.jsxs)(Ce.S,{className:"whitespace-wrap container-drag-drop",style:{height:i,width:h},children:[(0,N.jsx)("img",{alt:"",className:"absolute-transform-middle",src:fm,style:{to
2p:"30%"}}),(0,N.jsx)(Ce.S,{className:"mx-auto",style:{height:100,width:"100%"}}),(0,N.jsx)("small",{style:{display:d,fontSize:t},children:l})]});case"circle":return(0,N.jsx)(Ce.S,{className:"whitespace-wrap container-default",style:{borderRadius:"50%",height:i,width:h},children:(0,N.jsx)(ze.dkL,{className:"absolute-transform-middle icon",size:r})});default:return(0,N.jsx)(N.Fragment,{})}})()})};bm.defaultProps={background:"",className:"image-placeholder",fontSize:"1rem",height:"200px",label:"Image not supplied...",size:40,supported_types:[],textDisplay:"block",variant:"default",width:"100%"};var Am=bm,ym=t(65694);const wm={4:"powerpoint",5:"word",7:"excel"},Nm=(0,l.forwardRef)((s,a)=>{let{deliverable_challenge:t,deliverable_choice:i,onSubmit:r}=s;const o=(0,n.nm)(),d=(0,P.hc)(),c=Ra(),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null),[p,x]=(0,l.useState)(!1),[v,f]=(0,l.useState)(!1),[j,_]=(0,l.useState)(null),[b,A]=(0,l.useState)(null),y=(0,l.useRef)();(0,l.useImperativeHandle)(a,()=>({show:()=>{x(!1),u(!0),g(null),f(!1),_(null),A(null)}}));const w=e=>{const s=null===c||void 0===c?void 0:c.project,a=null===s||void 0===s?void 0:s.id,{type:t}=e,l=o.utils.getFileType(t),n=(()=>{const{configurations:e}=i,s=[];return e&&e.forEach(e=>{const{params:a,type:t}=e&&e.configurations;"file_upload"===t&&a&&a.acceptable_types&&a.acceptable_types.forEach(e=>{s.push(e)})}),s})(),r=o.utils.arrayRemoveDuplicates(n),h=r&&Array.isArray(r)&&r.join(", ");if(!l)return f(!1),void g(`Invalid file type detected, acceptable Types are: ${h}`);if(!d.isValidDeliverableType(t,n))return f(!1),void g(`Invalid file type detected, acceptable Types are: ${h}`);const u=(0,me.A)();let m=null;switch(l){case"file":m=o.api.file("/api/challenges/upload/file",{challenge_id:a,job_id:u},e,e.name);break;case"image":m=o.api.file("/api/challenges/upload/image",{challenge_id:a,job_id:u},e,"image.jpg");break;case"video":m=o.api.file("/api/challenges/upload/video",{challenge_id:a,job_id:u},e,e.name);break;case"audio":m=o.api.file("/api/challenges/upload/audio",{challenge_id:a,job_id:u},e,e.name);break;default:return!1}f(!0),g(null),_(u),m.then(e=>{let{file:s}=e;g(null),f(!1),_(null),A({file:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;f(!1),_(null),g(s)})},{styles:S}=o,C=S&&S.primary;if(!i||!i.configurations)return(0,N.jsx)(N.Fragment,{});const M=Boolean(i.configurations.find(e=>{var s;return"file_upload"!==(null===e||void 0===e||null===(s=e.configurations)||void 0===s?void 0:s.type)})),k=Boolean(i.configurations.find(e=>{var s;return"file_upload"===(null===e||void 0===e||null===(s=e.configurations)||void 0===s?void 0:s.type)}));if(!M&&!k)return(0,N.jsx)(N.Fragment,{});const z=(i.configurations||[]).filter(e=>{var s;return"office_online"===(null===e||void 0===e||null===(s=e.configurations)||void 0===s?void 0:s.type)}),T=Array.from(new Set(z.map(e=>{var s;return wm[null===e||void 0===e||null===(s=e.configurations)||void 0===s?void 0:s.deliverable_category_id]}).filter(Boolean))),I=T.length>0;return(0,N.jsxs)(xe,{dismissable:!0,backdrop:"static",dialogClassName:"deliv-modal",show:h,onHide:()=>{u(!1)},children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:"Upload your Deliverable"})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(Ge.A.Body,{children:[p&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{g(null)},show:m,variant:"danger",children:m}),!p&&(0,N.jsxs)(N.Fragment,{children:[!v&&(0,N.jsxs)(N.Fragment,{children:[b&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ku,{deliverable:b,show_details:!1}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(ve.A,{variant:"link",onClick:()=>{window.confirm("Are you sure you want to do this? This will clear your deliverable")&&A(null)},children:[(0,N.jsx)(ze.qbC,{})," Remove"]})})]}),!b&&(0,N.jsxs)(N.Fragment,{children:[I&&(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-2 mb-3 p-3",style:{background:"rgba(13,110,253,0.05)",border:"1px solid rgba(13,110,253,0.2)",borderRadius:8},children:[(0,N.jsxs)("strong",{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.cpg,{className:"text-primary"}),(0,N.jsx)(ke.A,{defaultMessage:"Create a new document in OneDrive",id:"label.create_a_new_document_in_onedrive.480955c7"})]}),(0,N.jsx)("p",{className:"text-muted small m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"We'll create a new {kinds} in your OneDrive, post the link to your team chat, and save it as your deliverable.",id:"label.well_create_a_new_kinds_in_your_on.f00d3f06",values:{kinds:1===T.length?{excel:"Excel workbook",powerpoint:"PowerPoint presentation",word:"Word document"}[T[0]]:"document"}})}),(0,N.jsxs)(ve.A,{className:"align-self-start",onClick:()=>{var e,s;return null===(e=y.current)||void 0===e||null===(s=e.show)||void 0===s?void 0:s.call(e)},size:"sm",variant:"primary",children:[(0,N.jsx)(ze.cpg,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Create in OneDrive",id:"label.create_in_onedrive.2cf81a38"})]})]}
2),k&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ym.Ay,{multiple:!1,onDrop:e=>{e&&e.length&&w(e[0])},children:e=>{let{getInputProps:s,getRootProps:a}=e;return(0,N.jsx)(Ce.S,{children:(0,N.jsx)("div",(0,F.A)((0,F.A)({},a()),{},{children:(0,N.jsxs)(Ce.S,{className:"text-center",style:{cursor:"pointer",paddingTop:30},children:[(0,N.jsx)(Am,{label:"Drag and drop here or",variant:"drag-drop-cloud"}),(0,N.jsx)("div",{className:"text-center",children:(0,N.jsx)("input",(0,F.A)({},s()))})]})}))})}})}),M&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ds.l1,{initialValues:{link:""},onSubmit:async s=>{let a,{link:t}=s;x(!0),g(!1);try{a=await Yu(t)}catch(e){return x(!1),void g("Unable to detect deliverable due to an error: "+e)}if(!a)return x(!1),void g("Invalid link supplied. Check to make sure this link is a valid deliverable type.");const l=await((e,s)=>{if(!e)return!1;if(!s||!s.configurations)return!1;const{subtype:a}=e,t=s.configurations.find(e=>e.configurations.type==a);return Boolean(t)})(a,i);if(!l)return x(!1),void g("Invalid link supplied. Check to make sure this link is a valid deliverable type.");x(!1),A(a)},render:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsx)(_e.A,{onSubmit:t,children:(0,N.jsx)(os,{children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"Paste a deliverable embed link",isInvalid:i.link&&s.link,isValid:i.link&&!s.link,name:"link",onChange:a,placeholder:"Paste a link",type:"text",value:l.link}),s.link&&i.link&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.link}),(0,N.jsxs)(ve.A,{type:"submit",variant:"type",children:[(0,N.jsx)("span",{className:"visually-hidden",children:"Upload Link"}),(0,N.jsx)(ze.HVe,{style:{color:C}})]})]})})})}})})]})]}),v&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ge.A,{className:"card-bordered",style:{backgroundColor:"white",margin:"35px auto",padding:35,width:"75%"},children:(0,N.jsx)(Ma,{job_id:j,submitting:!0})})})]})]})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{disabled:!b,id:"submit-btn",variant:"primary",onClick:()=>{"function"===typeof r&&r(b,i),u(!1)},children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})}),I&&(0,N.jsx)(vm,{allowed_kinds:T,onConfirmed:e=>{"function"===typeof r&&r(e,i),u(!1)},onCreated:e=>{A(e),g(null)},ref:y})]})});Nm.displayName="DeliverableUploadModal";var Sm=Nm,Cm=t(6707);const Mm=e=>{const{category:s,color:a,size:t}=e,i=(()=>{switch(s){case"Image":case"Visual":return ze.R1W;case"Document":default:return ze.t69;case"Slideshow":return ze.rgF;case"Storyboard":return ze.kQE;case"Video":return ze.Zgf;case"Audio":return ze.EVA;case"Multiple":return Cm.default}})();return(0,N.jsx)(i,{color:a,fontSize:t,size:t})};Mm.defaultProps={color:"var(--primary",size:25};var km=Mm;var zm=e=>{const{ext:s,filename:a,fill:t,size:i,type:l="other",withLabel:n}=e,r={component:ze.t69,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Uploaded File",id:"label.uploaded-file"})},o={file:{component:Tm,iconProps:{ext:s,filename:a,fill:t,size:i,withLabel:n}},image:{component:ze.R1W,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Uploaded Image",id:"label.uploaded_image"})},multimedia:{component:ze.T0M,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Uploaded Multimedia Research",id:"label.uploaded_media_research"})},print:{component:ze.Nhm,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Uploaded Print Research",id:"label.uploaded_print_research"})},video:{component:ze.Zgf,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Uploaded Video",id:"label.uploaded_video"})}},{component:d,iconProps:c={},label:h}=(null===o||void 0===o?void 0:o[l])||r;return(0,N.jsxs)(Ce.S,{className:"deliverable-icon-container d-flex align-items-center gap-1",children:[(0,N.jsx)(d,(0,F.A)((0,F.A)({ext:s,fill:t,size:i},c),{},{className:"deliverable-icon"})),!!n&&!!h&&(0,N.jsx)("strong",{children:h})]})};var Tm=e=>{const{ext:s,filename:a,fill:t,size:i,withLabel:l}=e,{component:n,label:r}=(()=>{switch(s){case"ppt":case"pptx":return{component:ze.rgF,label:(0,N.jsx)(ke.A,{defaultMessage:a||"PowerPoint Presentation",id:"label.ppt_presentation"})};case"doc":case"docx":return{component:ze.WLb,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Word Document",id:"label.word_document"})};case"pdf":return{component:ze.kl1,label:(0,N.jsx)(ke.A,{defaultMessage:a||"PDF Document",id:"label.pdf_document"})};case"rtf":return{component:ze.t69,label:(0,N.jsx)(ke.A,{defaultMessage:a||"RTF Document",id:"label.rtf_document"})};case"xlsx":return{component:ze.Ru,label:(0,N.jsx)(ke.A,{defaultMessage:a||"XLSX Document",id:"lavel.xlsx_document"})};case"csv":return{component:ze.QaY,label:(0,N.jsx)(ke.A,{defaultMessage:a||"CSV Document",id:"lavel.csv_document"})};default:return{component:ze.Gp9,label:(0,N.jsx)(ke.A,{defaultMessage:a||"Uploaded Resource",id:"label.uploaded_resource"})}}})();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(n,{fill:t,size:i}),l&&(0,N.jsx)("strong",{children:r})]})};const Im=e=>{const{deliverable_challenge:s,handleSubmit:a,is_first:t,selected:i}=e,{formatMessage:l}=(0,ja.A)(),{canChangePhaseData:n}=Ra(),r=!(null!==n&&void 0!==n&&n()),{styles:o,utils:d}=(0,P.nm)(),c=null===o||void 0===o?void 0:o.black,{embed_type_links:h}=d,{id:u,configurations:m,requirements:g,specifics:p,title:x}=s||{},v=`deliverableChallenge${u}-${(0,me.A)()}`,f=d.arrayRemoveDuplicates((e=>{let s=[];
2return e&&e.forEach(e=>{const{params:a,type:t}=e&&e.configurations;"file_upload"===t&&a&&a.acceptable_types&&a.acceptable_types.forEach(e=>{s.push(e)})}),s})(m)),j=d.arrayAttrRemoveDuplicates((e=>{let s=[];return e&&e.forEach(e=>{const{params:a,title:t,type:i}=(null===e||void 0===e?void 0:e.configurations)||{};if("file_upload"!==i){const e=h.find(e=>(null===e||void 0===e?void 0:e.type)===i);let l={link:null===e||void 0===e?void 0:e.link,params:a,title:t,type:i};s.push(l)}}),s})(m),"type"),_=(e=>{if(!e||!e.length)return 0;let s=[];for(const i of e){var a,t;if(!i)continue;let e=null===i||void 0===i||null===(a=i.configurations)||void 0===a||null===(t=a.deliverable_categories)||void 0===t?void 0:t.title;e&&(-1===s.indexOf(e)&&s.push(e))}return null===s||void 0===s?void 0:s.length})(m),b=_<=1?(e=>{var s,a,t;return null===e||void 0===e||null===(s=e[0])||void 0===s||null===(a=s.configurations)||void 0===a||null===(t=a.deliverable_categories)||void 0===t?void 0:t.title})(m):l({id:"label.multiple.14070fdb",defaultMessage:"Multiple"});return(0,N.jsx)(Ce.S,{className:"deliverable-challenge-list-item-container "+(i?"selected":""),children:(0,N.jsxs)(Ge.A,{children:[(0,N.jsxs)(Ce.S,{style:{padding:"10px 10px 10px 15px",whiteSpace:"nowrap"},children:[(0,N.jsx)(ve.A,{"aria-controls":v,"aria-expanded":"false",className:"btn chevron float-end "+(t?"":"collapsed"),"data-target":`#${v}`,"data-toggle":"collapse",type:"button",variant:"link","aria-label":l({id:"label.view_deliverable_details.2613419a",defaultMessage:"View deliverable details"}),children:(0,N.jsx)(ze.Ucs,{})}),(0,N.jsxs)(Ce.S,{style:{verticalAlign:"middle"},children:[b&&(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"d-inline-flex align-items-center align-self-start gap-1",text:"dark",children:[(0,N.jsx)(km,{category:b,color:c,size:14}),b]}),(0,N.jsx)("h4",{className:"mb-0",style:{whiteSpace:"break-spaces"},children:x})]})]}),(0,N.jsx)("div",{className:"collapse "+(t?"show":""),id:v,children:(0,N.jsx)(Ce.S,{className:"expanded-details-container",children:(0,N.jsx)(Ce.S,{style:{display:"flex",flexDirection:"row"},children:(0,N.jsxs)(Ce.S,{style:{width:"100%"},children:[(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:p}}),g&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("strong",{style:{color:"#373737",fontSize:14},children:(0,N.jsx)(ke.A,{defaultMessage:"Requirements",id:"label.requirements.e0cdd07f"})}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:g}})]}),(0,N.jsx)("strong",{style:{color:"#373737",fontSize:14},children:(0,N.jsx)(ke.A,{defaultMessage:"Acceptable file types",id:"label.acceptable_file_types.cd68f88c"})}),(0,N.jsxs)(Ce.S,{className:"acceptable-file-types",children:[!(null===f||void 0===f||!f.length)&&f.map((e,s)=>(0,N.jsxs)("span",{children:[e,s===f.length-1&&j&&!j.length?"":(0,N.jsx)("span",{children:",\xa0"})]},s)),!(null===j||void 0===j||!j.length)&&j.map((e,s)=>{const{link:a,type:t}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Uu,{embed:e,children:(0,N.jsx)("span",{className:"embed",style:{cursor:"help"},children:t})},s),(0,N.jsx)("a",{"aria-label":`Open ${t} in new window`,className:"p-0",href:a,rel:"noopener noreferrer",style:{cursor:"pointer",fontSize:"12px"},target:"_blank",children:(0,N.jsx)(ze.EQc,{className:"ms-1"})}),s===j.length-1?"":(0,N.jsx)("span",{children:",\xa0"})]})})]}),(0,N.jsx)(Ce.S,{className:"mt-3",children:"function"===typeof a&&(0,N.jsx)(ve.A,{disabled:r,onClick:()=>a(s),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create this Deliverable",id:"label.create_this_deliverable.8029fddc"})})})]})})})})]})})};Im.defaultProps={is_first:!1};var Em=Im,Fm=t(61275),Rm=t.n(Fm);const Dm=e=>{const{alt:s,type:a,url:t}=e;return(0,N.jsx)(N.Fragment,{children:(()=>{switch(a){case"YouTube":case"Vimeo":case"Video":return(0,N.jsx)(Rm(),{controls:!0,height:"100%",style:{borderRadius:4,overflow:"clip"},url:t,width:"100%"});case"Image":return(0,N.jsx)(Zs.A,{alt:s,src:t,style:{margin:"auto",width:"100%"}});case"Other":return(0,N.jsx)("a",{href:t,rel:"noopener noreferrer",target:"_blank",children:t});default:return(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"No trigger content found...",id:"label.no_trigger_content_found.52a6ffe3"})})}})()})};
2Dm.defaultProps={alt:"Challenge Template Trigger Content",type:"",url:""};var Bm=Dm,Pm=t(62147);const Lm=(0,l.forwardRef)((e,s)=>{var a,t,i;const[n,r,o]=(0,ne.CQ)({error:null,gmac_id:null,link:null,loading:!0,project:null,reject:Function(),resolve:Function(),show:!1,showPreview:!1,trigger_video:null}),{api:d}=(0,P.nm)(),{default_banner:c}=(0,P.hc)(),{openSidebarTab:h}=dt(),{isBelowBreakpoint:u}=(0,ne.vh)({breakpoint:991}),m=e=>new Promise((s,a)=>{r(t=>(0,F.A)((0,F.A)({},t),{},{gmac_id:null===e||void 0===e?void 0:e.gmac_id,reject:a,resolve:s,show:!0}))}),g=()=>{n.resolve(null),o()};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m}));const p=()=>r(e=>(0,F.A)((0,F.A)({},e),{},{showPreview:!1}));(0,l.useEffect)(()=>{n.show&&(async()=>{try{await(async()=>{try{r(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0}));const{challenge:e,team:s}=await d.get(`/api/challenges/get/${null===n||void 0===n?void 0:n.gmac_id}`);r(a=>(0,F.A)((0,F.A)({},a),{},{loading:!1,project:e,team:s}))}catch({data:OT,err:err}){"noexist"===(null===OT||void 0===OT?void 0:OT.reason)?r(e=>(0,F.A)((0,F.A)({},e),{},{loading:!1,project:null,team:null})):r(e=>(0,F.A)((0,F.A)({},e),{},{error:err}))}})(),await(async()=>{try{if(null===n||void 0===n||!n.project)return;const{project:e}=(null===n||void 0===n?void 0:n.project)||{},{challenge_template:s}=e;if(!s)return;const{challenge_template:a}=await d.get(`/api/marketplace/challenge-template-details/${s.id}`);r(e=>(0,F.A)((0,F.A)({},e),{},{challenge_template:a,loading:!1}))}catch({err:err}){r(s=>(0,F.A)((0,F.A)({},s),{},{error:err,loading:!1}))}})()}catch({err:err}){w(err)}})()},[n.show]),(0,l.useEffect)(()=>o,[]);const{challenge_statement:x=null,challenge_type:v=null,deliverable_challenges:f=null,overview:j=null,title:_="Title Missing",trigger_content_type:b=null,trigger_content_url:A=null}=(null===n||void 0===n||null===(a=n.project)||void 0===a?void 0:a.challenge_template)||{},y="decision_making"===v,S=u?"100%":300;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{dialogClassName:"challenge-template-syllabus-modal",divider:!1,onHide:g,show:n.show,size:"lg",children:[(0,N.jsxs)(xe.Header,{closeButton:!0,children:[(0,N.jsxs)("div",{className:"flex flex-column",children:[(0,N.jsx)(xe.Title,{children:_}),!n.loading&&(0,N.jsx)(ve.A,{className:"d-flex align-items-center mt-3",disabled:null==A||""==A,onClick:()=>{return e=A,"Other"===b&&window.open(e,"_blank").focus(),void r(e=>(0,F.A)((0,F.A)({},e),{},{showPreview:!0}));var e},style:{border:"1px solid #e0e0e0",fontWeight:"20px",padding:"9px 33px"},variant:"outline-primary",children:(C=b,["YouTube","Vimeo","Video"].includes(C)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Watch video",description:"",id:"label.watch_video.dbae3e9b"}),(0,N.jsx)(Pm.blI,{className:"ms-2"})]}):["Image"].includes(C)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"View image",description:"",id:"label.view_image.5bb55a4b"}),(0,N.jsx)(ze.dkL,{className:"ms-2"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"View resource",description:"",id:"label.view_resource.9eff7736"}),(0,N.jsx)(ze.f35,{className:"ms-2"})]}))})]}),(0,N.jsx)(Ua.A,{overlay:(0,N.jsx)(Qa.A,{id:"syllabus-modal-open-sidebar",children:(0,N.jsx)(ke.A,{defaultMessage:"Open in Sidebar",description:"",id:"label.open_in_sidebar.ee39dc29"})}),children:(0,N.jsx)(ve.A,{className:"position-absolute d-flex justify-content-center align-items-center",onClick:()=>{h("syllabus"),g()},variant:"light",style:{height:40,right:44,top:2,transform:"rotate(90deg)",width:40},children:(0,N.jsx)(ze.kxO,{})})})]}),(0,N.jsx)(xe.Body,{children:n.loading?(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{minHeight:400},children:(0,N.jsx)(Me.y$,{})}):(0,N.jsxs)(N.Fragment,{children:[j&&(0,N.jsxs)("div",{className:"overview",children:[(0,N.jsx)("h5",{children:"Overview"}),(0,N.jsx)(hd.R,{rounded:!0,height:200,imageClassname:"float-end ms-3",imageHeight:200,imageStyle:{objectFit:"cover"},imageWidth:S,placeholderClassname:"float-end ms-3",src:(null===n||void 0===n||null===(t=n.project)||void 0===t||null===(i=t.challenge_template)||void 0===i?void 0:i.cover_path)||c,width:S,style:{aspectRatio:"3/2",borderRadius:8}}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:j}})]}),x&&(0,N.jsxs)("div",{className:"challenge",children:[(0,N.jsx)("h5",{className:"mb-2",children:y?(0,N.jsx)(ke.A,{defaultMessage:"Decision question",id:"label.decision_question.8ac79b2c"}):"Challenge"}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:x}})]}),f&&(0,N.jsxs)("div",{className:"deliverables",children:[(0,N.jsx)("h5",{className:"mb-2",children:"Deliverable Formats"}),(0,N.jsx)("div",{className:"deliverable-challenge-list-container",style:{width:"100%"},children:f.map((e,s)=>(0,N.jsx)(Em,{deliverable_challenge:e},s))})]})]})})]}),(0,N.jsxs)(xe,{onHide:p,show:n.showPreview,size:"lg",children:[(0,N.jsx)(xe.Body,{children:null!=b&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Bm,{alt:`${b} ${_}
2 Trigger Content`,type:b,url:A})})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:p,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",description:"",id:"label.close.7d9eb7ac"})})})]})]});var C});Lm.displayName="ChallengeOverviewModal";var Om=Lm;class Hm extends l.Component{constructor(s){var a;super(s),this.setError=e=>this.setState({error:e}),this.clearError=()=>this.setError(null),this.fetchCartridge=async()=>{try{const{cartridge_history_id:e}=this.state,{app:s,group_member_assignment_component_id:a}=this.props,{api:t}=s,{cartridge:i}=await t.get(`/api/cartridges/get-by-gmac/${a}`,{cartridge_history_id:e});this.setState({cartridge:i||{},cartridge_template:(null===i||void 0===i?void 0:i.cartridge_template)||{},is_snapshot:!(null===i||void 0===i||!i.history)})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setError(a)}},this.reloadCartridge=async()=>{this.setState({loading:!0}),await this.fetchCartridge(),this.setState({loading:!1})},this.fetchInitialData=()=>{this.setState({loading:!0}),Promise.all([this.fetchCartridge()]).then(()=>{this.setState({loading:!1})})},this.restoreResponse=async()=>{try{const{cartridge:e,cartridge_history_id:s}=this.state,{app:a}=this.props,{api:t}=a;this.setState({loading:!0}),await t.post("/api/cartridges/history/restore",{cartridge_history_id:s,cartridge_id:null===e||void 0===e?void 0:e.id}),this.setState({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,loading:!1})}},this.confirmRestoreResponse=()=>{var e;const s=null===(e=this.restore_response_modal)||void 0===e?void 0:e.current;if(!s)return;const{intl:a}=this.props,{formatMessage:t}=a;s.show({actions:[s.CancelAction(),s.Action({label:t({id:"label.restore.a76e13b9",defaultMessage:"Restore"}),onClick:this.restoreResponse,variant:"primary"})],body:t({id:"label.make_this_the_most_recent_response.fb4e3a6c",defaultMessage:"Make this the most recent response?"}),size:"sm",title:t({id:"label.restore_response.465c7715",defaultMessage:"Restore response"})})};const{cartridge_history_id:t}=js.A.parse(null===(a=window.location)||void 0===a?void 0:a.search);this.state={cartridge:{},cartridge_history_id:Number.parseInt(t)||null,cartridge_template:{},error:null,is_snapshot:!1,loading:!0},this.restore_response_modal=(0,l.createRef)()}componentDidMount(){try{const{onRef:e}=this.props;"function"===typeof e&&e(this),this.fetchInitialData()}catch(e){this.setState({error:(null===e||void 0===e?void 0:e.message)||e,loading:!1})}}render(){var e;const{children:s,mode:a}=this.props,{cartridge:t,cartridge_history_id:i,cartridge_template:n,completion_status:r,error:o,loading:d,location:c,session_time:h,success_status:u,suspend_data:m}=this.state;return(0,N.jsx)(l.Fragment,{children:(0,N.jsxs)(Vm,{value:{cartridge:t,cartridge_history_id:i,cartridge_template:n,clearError:this.clearError,completion_status:r,confirmRestoreResponse:this.confirmRestoreResponse,fetchCartridge:this.fetchCartridge,location:c,mode:a,reloadCartridge:this.reloadCartridge,session_time:h,setError:this.setError,success_status:u,suspend_data:m},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:o,variant:"danger",children:o}),(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"flex-1",loading:d||!t,children:s}),(0,N.jsx)(je,{ref:this.restore_response_modal})]})},null===(e=this.module_wrapper_component)||void 0===e?void 0:e.current)}}var Um=(0,Ke.Ay)((0,P.G0)(Hm));const Qm=l.createContext({}),Vm=Qm.Provider,Gm=(Qm.Consumer,()=>(0,l.useContext)(Qm));var Wm=e=>{var s,a,t;const{component:i,template:l}=dt();let n=(null===i||void 0===i||null===(s=i.group_assignment_component)||void 0===s?void 0:s.cartridge_template)||l;const{author_avatar_image_path:r,author_name:o,learning_objectives:d,stub:c,subtopics:h,topics:u}=n||{},m=(null===c||void 0===c||null===(a=c.tags)||void 0===a||null===(t=a.map)||void 0===t?void 0:t.call(a,e=>e.tag))||[];return(0,N.jsxs)(Ce.S,{className:"overview cartridge flex-fill mb-3",children:[(0,N.jsx)(Km,{}),(0,N.jsxs)(Ue.A,{className:"widget-container d-flex flex-column gap-lg-5",children:[(0,N.jsx)(Ym,{}),(0,N.jsxs)(Ce.S,{className:"widget-row d-flex flex-column flex-lg-row gap-lg-5 flex-1",children:[(0,N.jsx)(Ge.A,{className:"d-flex flex-shrink-0",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objectives",id:"label.learning_objectives.d38eb0fc"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Identify strategies that can help you:",id:"label.identify_strategies_that_can_help.68116b74"})}),!(null===d||void 0===d||!d.length)&&(0,N.jsx)("ul",{className:"list-style-none",children:d.map((e,s)=>(0,N.jsxs)("li",{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(kh,{}),e]},s))})]})}),(0,N.jsx)(Ge.A,{className:"flex-fill",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{children:[!(null===m||void 0===m||!m.length)>0&&(0,N.jsxs)(Ce.S,{className:"d-flex flex-wrap gap-1",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),m.map((e,s)=>{let{name:a}=e;return(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:a},s)})]}),(null===u||void 0===u?void 0:u.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{className:"mb-3",children:"Topic"}),(0,N.jsx)(Ce.S,{children:u.map(e=>{var s;return(0,N.jsx)(bo.A,{pill:!0,style:{fontSize:14,marginBottom:6,marginRight:11},variant:"blue",children:(null===e||void 0===e?void 0:e.topics)&&(null===e||void 0===e||null===(s=e.topics)||void 0===s?void 0:s.name)},e.id)})})]}),(null===h||void 0===h?void 0:h.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{className:"mb-3",children:"Subto
2pic"}),(0,N.jsx)(Ce.S,{children:h.map(e=>(0,N.jsx)(bo.A,{pill:!0,style:{fontSize:14,marginBottom:6,marginRight:11},variant:"purple",children:e.subtopics&&e.subtopics.name},e.id))})]})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(md,{size:48,src:r}),(0,N.jsx)("h6",{className:"m-0",children:o})]})]})]})})]})]})]})};var Km=e=>{var s;const a=(0,Pe.W6)(),{assignment_type:t,component:i,group_member_assignment_id:l,template:n}=dt();let r=(null===i||void 0===i||null===(s=i.group_assignment_component)||void 0===s?void 0:s.cartridge_template)||n;const{banner_path:o}=r||{},{isolatedMode:d}=(0,P.nm)(),{default_banner:c}=(0,P.hc)();return(0,N.jsxs)(Ce.S,{className:"banner-container w-100",children:[!(d&&"cartridge"===t)&&(0,N.jsx)(ve.A,{className:"back-btn d-flex align-items-center",onClick:()=>{const e="journey"===t?`/assignment/${l}`:"/home";a.push(e)},variant:"secondary",children:(0,N.jsx)(ze.QVr,{})}),(0,N.jsx)(Ce.S,{className:"banner-image-container",children:(0,T.isEmpty)(n)?(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder h-100",xs:12}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Zs.A,{alt:"",className:"banner-image",src:o||c}),(0,N.jsx)(Ce.S,{className:"banner-image-overlay"})]})})]})};var Ym=e=>{var s;const a=(0,Pe.W6)(),{assignment:t,component:i,group_member_assignment_component_id:l,group_member_assignment_id:n,template:r}=dt();let o=(null===i||void 0===i||null===(s=i.group_assignment_component)||void 0===s?void 0:s.cartridge_template)||r;const{description:d,title:c,total_est_completion_time:h}=o,{completed:u,start:m}=i||t||{},g=()=>a.push(`/assignment/${n}/${l}/content`);return(0,N.jsx)(Ge.A,{className:"overview-hero-card",children:(0,N.jsx)(Ge.A.Body,{as:Qe.A,className:"m-0",children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:8,xs:12,children:[(0,N.jsx)("strong",{className:"text-uppercase text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge",id:"label.cartridge.af853653"})}),(0,N.jsx)("h1",{children:c}),(0,N.jsx)(Rl,{lg:2,maxWidth:"100%",triggerPosition:"right",xs:3,children:(0,ad.G9)(d,{preserveNewlines:!0})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-lg-row align-items-center gap-3 mt-3",children:[u?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"overview-CTA",onClick:g,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Review",id:"label.review.aff0766a"})}),(0,N.jsx)("strong",{className:"text-success",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed {date}",id:"label.completed_date.c4cc1456",values:{date:(0,N.jsx)(Gh.XU,{value:u})}})})]}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ve.A,{className:"overview-CTA",onClick:g,size:"lg",children:m?(0,N.jsx)(ke.A,{defaultMessage:"Resume cartridge",id:"label.resume_cartridge.39996774"}):(0,N.jsx)(ke.A,{defaultMessage:"Start cartridge",id:"label.start_cartridge.96207e8f"})})}),!u&&(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1 text-secondary",children:[(0,N.jsx)(ze.w_X,{}),(0,N.jsx)(Vh,{duration:h,label_type:"long",unit:"minutes"})]})]})]})})})};t(302);var qm,Jm,Xm=e=>{const{children:s,group_member_assignment_component_id:a,group_member_assignment_id:t}=e,i=(0,Pe.W6)(),{formatMessage:l}=(0,ja.A)(),{cartridge:n,clearError:r,mode:o,setError:d}=Gm(),[c,h,u]=(0,ne.CQ)({forced_close:!1,launched:!1,launching:!1,scrubbed:!1}),m=o?"readonly":"active",g=o?"mode-banner":"",{launched:p,launching:x,scrubbed:v}=c;return(0,N.jsxs)(Ce.S,{className:`cartridge-content d-flex flex-column w-100 ${g}`,children:[s,(0,N.jsx)(Me.x_,{loading:x,children:n&&!v?(0,N.jsx)(Rs,{cartridge:n,mode:m,onError:e=>{d(e),h({launched:!1,launching:!1,scrubbed:!0})}}):(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center justify-content-center flex-1",children:[(0,N.jsx)(ze.BS8,{color:"var(--danger)",size:36}),(0,N.jsx)("p",{className:"text-danger fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"Failed to initialize SCORM package.",id:"label.failed_to_initialize_scorm_package.188e017d"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:()=>{r(),i.push(`/assignment/${t}/${a}/overview`)},variant:"link",children:[(0,N.jsx)(ze.QVr,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Go back",id:"label.go_back.6aadac2f"})]})]})}),(0,N.jsx)(Pe.XG,{when:p,message:e=>!!e.pathname.startsWith(`/assignment/${t}/${a}/content`)||l({id:"label.you_currently_have_content_open_in.15d3dcbc",defaultMessage:"You currently have content open in another window, any unsaved changes may be lost if you proceed."})})]})};const Zm=["title","titleId"];function $m(){return $m=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},$m.apply(null,arguments)}function eg(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,Zm);return l.createElement("svg",$m({width:24,height:20,viewBox:"0 0 24 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,qm||(qm=l.createElement("path",{d:"M15.2498 0.666992H2.74984C1.60075 0.666992 0.666504 1.60118 0.666504 2.7502V12.1247C0.666504 13.2737 1.60075 14.2079 2.74984 14.2079H5.87484V16.9421C5.87484 17.2611 6.23942 17.4466 6.49658 17.2578L9.86808 14.7287C9.84499 14.489 9.83317 14.246 9.83317 14.0003C9.83317 9.85819 13.191 6.50033 17.3332 6.50033V2.7502C17.3332 1.60118 16.3989 0.666992 15.2498 0.666992Z",fill:"#050505"})),Jm||(Jm=l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.1665 14.0003C23.1665 17.222 20.5548 19.8337 17.3332 19.8337C14.1115 19.8337 11.4998 17.222 11.4998 14.0003C11.4998 10.7787 14.1115 8.16699 17.3332 8.16699C20.5548 8.16699 23.1665 10.7787 23.1665 14.0003ZM19.9526 15.1483L18.7373 14.6275C18.6854 14.6053 18.6277 14.6007 18.5729 14.6142C18.5181 14.6277 18.4691 14.6586 18.4335 14.7023L17.8953 15.3599C17.0506 14.9616 16.3708 14.28
219 15.9726 13.4372L16.6301 12.899C16.674 12.8634 16.705 12.8145 16.7185 12.7596C16.732 12.7048 16.7273 12.6471 16.705 12.5952L16.1842 11.3799C16.1598 11.3239 16.1166 11.2783 16.0621 11.2507C16.0077 11.2232 15.9453 11.2155 15.8858 11.2291L14.7573 11.4895C14.6999 11.5027 14.6487 11.535 14.6121 11.5811C14.5754 11.6272 14.5554 11.6844 14.5555 11.7433C14.5555 14.5265 16.8114 16.7781 19.5903 16.7781C19.6492 16.7781 19.7064 16.7582 19.7525 16.7215C19.7986 16.6849 19.8309 16.6337 19.8442 16.5763L20.1046 15.4478C20.118 15.388 20.1102 15.3254 20.0825 15.2707C20.0547 15.216 20.0088 15.1728 19.9526 15.1483Z",fill:"#050505"})))}const sg=l.forwardRef(eg);t.p;var ag=e=>{const s=(0,Pe.W6)(),{assignment:a,group:t,group_member_assignment_component_id:i,group_member_assignment_id:l,mode:n,openSidebarTab:r,preview:o,sidebar_open:d,template:c,toggleAssignmentSidebar:h}=dt(),{cartridge_history_id:u,confirmRestoreResponse:m}=Gm(),{isBelowBreakpoint:g}=(0,ne.vh)({breakpoint:922}),p=(null===a||void 0===a?void 0:a.assignment)||{};return(0,N.jsxs)(sa.A,{className:"cartridge-content-topnav p-2",children:[(0,N.jsxs)(sa.A.Collapse,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"navbar-left d-flex align-items-center",children:[(0,N.jsx)(ve.A,{"aria-label":"back to cartridge overview",className:"content-close-btn btn-icon me-3 text-decoration-none text-muted",disabled:o,onClick:()=>{var e,a,t,n;if(o)return s.push(`/admin/cartridge-template/preview/${null===s||void 0===s||null===(e=s.location)||void 0===e||null===(a=(t=e.pathname).split)||void 0===a||null===(n=a.call(t,"/"))||void 0===n?void 0:n[2]}`);const r=`/assignment/${l}/${i}/overview`;s.push(r)},variant:"quaternary",children:(0,N.jsx)(ze.QVr,{size:16})}),(0,N.jsxs)(Ce.S,{className:"cartridge-metadata d-flex flex-column",children:[(0,N.jsx)("p",{className:"subtitle text-muted mb-0",children:"journey"===(null===p||void 0===p?void 0:p.type)?null===p||void 0===p?void 0:p.title:null===t||void 0===t?void 0:t.name}),(0,N.jsx)(Fl,{as:g?"h6":"h4",className:"title mb-0",maxWidth:300,placement:"bottom",children:null===c||void 0===c?void 0:c.title})]})]}),(0,N.jsxs)(Ce.S,{className:"navbar-right d-flex align-items-center gap-3",children:["facilitation"===n&&u&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:m,variant:"secondary",children:[(0,N.jsx)(ze.OKX,{}),(0,N.jsx)(ke.A,{defaultMessage:"Restore response",id:"label.restore_response.465c7715"})]}),(0,N.jsx)(ve.A,{onClick:()=>{d?h(!d):r("chat")},variant:d?"primary":"secondary",children:(0,N.jsx)(sg,{className:"chat-call-icon "+(d?"active":"inactive")})})]})]}),(0,N.jsx)(ia,{})]})};const tg=l.createContext({}),ig=tg.Provider,lg=(tg.Consumer,()=>(0,l.useContext)(tg));class ng extends l.Component{constructor(e){super(e),this.getJourney=()=>{const{app:e,group_member_assignment_id:s}=this.props;e.api.get(`/api/journeys/get/${s}`).then(e=>{var s;let{group_assignment:a,group_assignment_components:t,group_member_assignment:i,group_member_assignment_components:l}=e;this.setState({group_assignment:a,group_assignment_components:t,group_assignment_template:null===a||void 0===a?void 0:a.group_assignment_template,group_assignment_template_stub:null===a||void 0===a||null===(s=a.group_assignment_template)||void 0===s?void 0:s.stub,group_member_assignment:i,group_member_assignment_components:l,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.goToGroupAssignmentComponent=e=>{const{history:s}=this.props;s.push(this.getComponentLink(e))},this.getComponentLink=e=>{const{group_member_assignment_components:s}=this.state,a=null===s||void 0===s?void 0:s.find(s=>(null===s||void 0===s?void 0:s.group_assignment_component_id)==e);return`/assignment/${null===a||void 0===a?void 0:a.group_member_assignment_id}/${null===a||void 0===a?void 0:a.id}/${null!==a&&void 0!==a&&a.start?"content":"overview"}`},this.state={error:null,group_assignment:null,group_assignment_components:null,group_assignment_template:null,group_assignment_template_stub:null,group_member_assignment:null,group_member_assignment_components:null,loading:!0}}componentDidMount(){this.getJourney()}render(){const{error:e,group_assignment:s,group_assignment_components:a,group_assignment_template:t,group_assignment_template_stub:i,group_member_assignment:l,group_member_assignment_components:n,loading:r}=this.state;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(nn.z,{enableDetails:!0,size:"lg",children:(0,N.jsxs)(ig,{value:{getComponentLink:this.getComponentLink,goToGroupAssignmentC
2omponent:this.goToGroupAssignmentComponent,group_assignment:s,group_assignment_components:a,group_assignment_template:t,group_assignment_template_stub:i,group_member_assignment:l,group_member_assignment_components:n},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e}),r?(0,N.jsx)(Ce.S,{className:"text-center d-flex justify-content-center align-items-center h-100",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsx)(N.Fragment,{children:this.props.children})]})})})}}var rg=(0,n.G0)((0,Pe.y)((0,Ke.Ay)(ng))),og=t(14690);var dg=e=>{var s,a,t,i;const[l,r]=(0,ne.CQ)({error:null}),{isolatedMode:o}=(0,n.nm)(),{goToGroupAssignmentComponent:d,group_assignment:c,group_assignment_components:h,group_assignment_template:u,group_assignment_template_stub:m,group_member_assignment:g,group_member_assignment_components:p}=lg(),{completion_pct:x=0}=g||{},{team:v}=g||{},{subtopics:f,topics:j}=u||{};let{members:_=[]}=v||{},b=(null===c||void 0===c||null===(s=c.group)||void 0===s?void 0:s.members)||[];b=b.map(e=>{var s;return null===e||void 0===e||null===(s=e.organization_member)||void 0===s?void 0:s.user});const A=(0,Pe.W6)(),y=null!==c&&void 0!==c&&c.start?ci()(null===c||void 0===c?void 0:c.start):null,w=null!==c&&void 0!==c&&c.due?ci()(null===c||void 0===c?void 0:c.due):null,S=(!y||ci()()>y)&&(!w||ci()()<w);return(0,N.jsxs)(Ce.S,{className:"learner-journey-overview",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),show:l.error,variant:"danger",children:l.error}),(0,N.jsx)("div",{className:"banner-image",style:{backgroundImage:`url(${(null===u||void 0===u?void 0:u.banner_path)||og})`},children:!o&&(0,N.jsxs)(ve.A,{className:"back-btn hide-ultrawide",onClick:()=>A.push("/home"),variant:"secondary",children:[(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"back to home",description:"",id:"label.back_to_home.7d0de940"})}),(0,N.jsx)(ze.QVr,{})]})}),(0,N.jsxs)("div",{className:"journey-container",children:[(0,N.jsxs)(Ge.A,{className:"d-flex align-items-center justify-content-center banner-container",children:[(0,N.jsx)("div",{className:"banner-top-badge text-capitalize",children:(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:null===g||void 0===g||null===(a=g.assignment)||void 0===a?void 0:a.type})}),(0,N.jsx)("h1",{children:null===c||void 0===c?void 0:c.title}),(0,N.jsx)("div",{className:"d-flex flex-column",children:(0,N.jsx)(Rl,{lg:2,maxWidth:680,triggerPosition:"right",xs:3,children:null===u||void 0===u?void 0:u.description})}),(0,N.jsx)("div",{className:"journey-call-to-action",children:S&&x<100&&(0,N.jsx)(ve.A,{onClick:()=>{let e=null;for(const s of h){const a=p.find(e=>e.group_assignment_component_id===s.id);if(100!==Number.parseInt(a.completion_pct)){e=s.id;break}}null!==e&&d(e)},children:(0,N.jsx)(ug,{completion_pct:x})})}),(0,N.jsx)("div",{className:"journey-duration small d-flex align-items-center",children:x<100?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.w_X,{className:"me-1"}),(0,N.jsx)(Vh,{duration:null===g||void 0===g?void 0:g.total_est_time_remaining_mins,unit:"minutes"}),"\xa0",(0,N.jsx)(ke.A,{defaultMessage:"left",id:"label.left.360f8403"})]}):(0,N.jsxs)("div",{style:{color:"#00AD00"},children:[(0,N.jsx)(ze.A7C,{})," ",(0,N.jsx)("span",{className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey complete",description:"",id:"label.journey_complete.66210754"})})]})})]}),!o&&(0,N.jsx)(ve.A,{className:"back-btn d-none display-ultrawide",onClick:()=>A.push("/home"),variant:"secondary",children:(0,N.jsx)(ze.QVr,{})})]}),(0,N.jsx)("div",{className:"d-xl-none",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"module",id:"journey-overview-tabs",mountOnEnter:!0,role:"navigation",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary overview-tabs-wrapper",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"module",href:"#module",children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",description:"",id:"label.modules.76c86c4c"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"about",href:"#about",children:(0,N.jsx)(ke.A,{defaultMessage:"About",description:"",id:"label.about.4efca0d1"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"module",title:"Modules",children:(0,N.jsx)(Ge.A,{className:"learning-module-container gray-bg border-start-0 border-end-0",children:(0,N.jsxs)("section",{children:[(0,N.jsx)("h5",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",description:"",id:"label.learning_modules.6e1d2fad"})}),(0,N.jsx)("div",{className:"module-list",children:h.map(e=>{let s=p.find(s=>s.group_assignment_component_id==e.id);return(0,N.jsx)(cg,{group_assignment:c,group_assignment_component:e,group_member_assignment_component:s},e.id)})})]})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"about",title:"About",children:(0,N.jsx)(Ge.A,{className:"about-container border-start-0 border-end-0",children:(0,N.jsxs)("section",{children:[!(null===(t=b)||void 0===t||!t.length)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"user-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitator",description:"",id:"label.facilitator.49c5d7ad"})}),(0,N.jsx)("div",{className:"user-list",children:b.map((e,s)=>(0,N.jsx)(rx,{role:"Facilitator",user:e},s))})]}),(0,N.jsx)("div",{className:"user-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Your team",description:"",id:"label.your_team.245c1087"})}),(0,N.jsx)("div",{className:"user-list",children:_.map((e,s)=>(0,N.jsx)(rx,{user:null===e||void 0===e?void 0:e.user},s))})]})})})]})]})}),(0,N.jsx)("div",{className:"left-content-container d-none d-xl-block",children:(0,N.jsx)(Ge.A,{className:"learning-module-container",children:(0,N.jsxs)("section",{children:[(0,N.jsx)("h5",{className:"ms-3 mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",description:"",id:"label.learning_modules.6e1d2fad"})}),(0,N.jsx)("div",{className:"module-list",children:h.map((e,s,a)=>{let t=a[s-1],i=p.find(e=>e.group_assignment_component_id==(null===t||void 0===t?void 0:t.id)),l=p.find(s=>s.group_assignment_component_id==e.id);return(0,N.jsx)(cg,{group_assignment:c,group_assignment_component:e,group_member_assignment_component:l,onStartModule:()=>d(e.id),previous_gma:i},e.id)})})]})})}),(0,N.jsx)("div",{className:"right-content-container d-none d-xl-block",children:(0,N.jsxs)(Ge.A,{className:"about-container pb-0",children:[(null===m||void 0===m||null===(i=m.tags)||void 0===i?void 0:i.length)>0&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("section",{className:"mb-2",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),m.tags.map(e=>{let{tag:s}=e;return(0,N.jsx)(Co,{className:"mt-2",tag:s},null===s||void 0===s?void 0:s.id)})]})}),(null===j||void 0===j?void 0:j.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{className:"mb-3",children:"Topic"}),(0,N.jsx)(Ce.S,{children:j.map(e=>{var s;return(0,N.jsx)(bo.A,{pill:!0,style:{fontSize:14,marginBottom:6,marginRight:11},variant:"blue",children:(null===e||void 0===e?void 0:e.topics)&&(null===e||void 0===e||null===(s=e.topics)||void 0===s?void 0:s.name)},e.id)})})]}),(null===f||void 0===f?void 0:f.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{className:"mb-3",children:"Subto
2pic"}),(0,N.jsx)(Ce.S,{children:f.map(e=>(0,N.jsx)(bo.A,{pill:!0,style:{fontSize:14,marginBottom:6,marginRight:11},variant:"purple",children:e.subtopics&&e.subtopics.name},e.id))})]}),(0,N.jsxs)("section",{children:[b.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"user-label",children:"Facilitator"}),(0,N.jsx)("div",{className:"user-list",children:b.map((e,s)=>(0,N.jsx)(rx,{className:"mb-2",role:"Facilitator",user:e},s))})]}),(0,N.jsx)("div",{className:"user-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Your team",description:"",id:"label.your_team.245c1087"})}),(0,N.jsx)("div",{className:"user-list",children:_.map((e,s)=>(0,N.jsx)(rx,{className:"mt-3",user:null===e||void 0===e?void 0:e.user},s))})]})]})})]})};var cg=e=>{const{group_assignment:s={},group_assignment_component:a={},group_member_assignment_component:t={},previous_gma:i=null}=e,{cartridge_template:n=null,challenge_template:r=null,type:o}=a,d=r||n||{},{cover_path:c=null,description:h=null,icon_path:u=null,overview:m=null,title:g="",total_est_completion_time:p=null}=d,{completed:x}=t,[v,f]=(0,ne.CQ)({text_toggled:!1}),{goToGroupAssignmentComponent:j,group_assignment_template:_}=lg(),b=ci()(),A=null!==a&&void 0!==a&&a.start?ci()(null===a||void 0===a?void 0:a.start):null,y=null!==a&&void 0!==a&&a.due?ci()(null===a||void 0===a?void 0:a.due):null,w=(null===s||void 0===s?void 0:s.is_expired)||!1,S=(0,l.useMemo)(()=>{let e=!i,s=null===i||void 0===i?void 0:i.completed,a=t.start;return!(!_||!(null===_||void 0===_?void 0:_.force_order)||e||s||a)},[t]),C=(0,l.useMemo)(()=>{let e=null===a||void 0===a?void 0:a.start,s=null===a||void 0===a?void 0:a.due;return!(e&&!b.isSameOrAfter(e))&&((!s||!b.isSameOrAfter(s))&&!S)},[a]),M=(0,l.useMemo)(()=>{const e=t.start,{completion_pct:s=0}=t;return w?(0,N.jsx)(ke.A,{defaultMessage:"Expired",id:"label.expired.424a2551"}):"challenge"===(null===o||void 0===o?void 0:o.toLowerCase())?100===s?"Review Challenge":e?"Resume Challenge":"Start Challenge":"cartridge"===(null===o||void 0===o?void 0:o.toLowerCase())?100===s?"Review Module":e?"Resume Module":"Start Module":void 0}),k=(0,l.useMemo)(()=>"challenge"===(null===o||void 0===o?void 0:o.toLowerCase())?"Challenge":"Module");return null==o?null:(0,N.jsxs)(Ge.A,{className:"lm-card",onClick:()=>f(e=>({text_toggled:!e.text_toggled})),tabIndex:0,children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)("img",{className:"rounded-circle",src:c||u||xo})}),(0,N.jsxs)("div",{className:"about w-100",children:[(0,N.jsx)("div",{className:"duration-and-type d-none d-xl-block",children:(0,N.jsxs)("div",{className:"d-flex flex-np-wrap justify-content-end align-items-center",children:[(0,N.jsx)("div",{className:"badge-wrapper",children:(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:o})}),(0,N.jsxs)("div",{className:"d-flex align-items-center time me-3 text-muted",children:[(0,N.jsx)(ze.w_X,{className:"me-1"}),(0,N.jsx)(Vh,{duration:p,unit:"minutes"})]})]})}),(0,N.jsx)("h5",{className:`title ${"challenge"===o&&"challenge"}`,children:g}),(0,N.jsx)("div",{className:"description-container",children:m||h?(0,N.jsx)("div",{className:"description",children:(0,N.jsx)(El,{ellipsisText:"",lines:2,children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:m||h}})})}):""}),(0,N.jsxs)("div",{className:"d-flex start-end",children:[(0,N.jsx)("div",{className:"break d-xl-none"}),(0,N.jsxs)("div",{className:"d-flex w-100",children:[A&&(0,N.jsxs)("div",{className:"start",children:[(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Starts",description:"",id:"label.starts.96dbedec"})}),(0,N.jsx)("div",{className:"time",children:ci()(A).format("MMM Do, h:mm a")})]}),y&&(0,N.jsxs)("div",{className:"end ms-2",children:[(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Due",description:"",id:"label.due.9071738f"})}),(0,N.jsx)("div",{className:"time",children:ci()(y).format("MMM Do, h:mm a")})]})]})]}),C&&(0,N.jsx)(ve.A,{className:"mt-xl-3",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),j(null===a||void 0===a?void 0:a.id)},variant:"secondary",children:M}),x&&(0,N.jsx)("div",{className:"completed-indicator mt-xl-3 ms-4 align-self-center",children:(0,N.jsxs)("span",{className:"text-success",children:[(0,N.jsx)(ze.A7C,{})," ",k," completed"]})})]})]})};const hg=e=>{const{group_assignment_component:s=null,type:a=null}=e,{cartridge_template:t=null,challenge_template:i=null}=s,l=i||t||{},{cover_path:n=null,description:r=null,icon_path:o=null,overview:d=null,title:c="",total_est_completion_time:h=null}=l,[u,m]=(0,ne.CQ)({text_toggled:!1}),g=ci()(),p=g,x=g.add(5,"days");return(0,N.jsxs)(Ge.A,{className:"lm-card",onClick:()=>m(e=>({text_toggled:!e.text_toggled})),tabIndex:0,children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)("img",{alt:"",className:"rounded-circle",src:n||o||xo})}),(0,N.jsxs)("div",{className:"about w-100",children:[(0,N.jsx)("div",{className:"duration-and-type d-none d-xl-block",children:(0,N.jsxs)("div",{className:"d-flex flex-np-wrap justify-content-end align-items-center",children:[(0,N.jsx)("div",{className:"badge-wrapper",children:(0,N.jsx)(bo.A,{pill:!0,bg:"gray-no-border",children:a})}),(0,N.jsxs)("div",{className:"d-flex align-items-center time me-3 text-muted",children:[(0,N.jsx)(ze.w_X,{className:"me-1"}),(0,N.jsx)(Vh,{duration:h,unit:"minutes"})]})]})}),(0,N.jsx)("h5",{className:`title ${"challenge"===a&&"challenge"}`,children:c}),(0,N.jsx)("div",{className:"description-container",children:d||r?(0,N.jsx)("div",{className:"description",children:(0,N.jsx)(El,{ellipsisText:"",lines:2,children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:d||r}})})}):""}),(0,N.jsxs)("div",{className:"d-flex start-end",children:[(0,N.jsx)("div",{className:"break d-xl-none"}),(0,N.jsxs)("div",{className:"d-flex w-100",children:[p&&(0,N.jsxs)("div",{className:"start",children:[(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",description:"",id:"label.start_date.81696931"})}),(0,N.jsx)("div",{className:"time",children:"N/A"})]}),x&&(0,N.jsxs)("div",{className:"end ms-2",children:[(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Due date",description:"",id:"label.due_date.e1cb6d30"})}),(0,N.jsx)("div",{className:"time",children:"N/A"})]})]})]}),(0,N.jsx)(ve.A,{disabled:!0,className:"w-100 mt-xl-3",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},variant:"secondary",children:"challenge"===(null===a||void 0===a?void 0:a.toLowerCase())?"Start Challenge":"Start Module"})]})]})};var ug=e=>{const{completion_pct:s=0}=e;return 100===s?(0,N.jsx)(ke.A,{defaultMessage:"Review journey",description:"",id:"label.review_journey.0300e557"}):0===s?(0,N.jsx)(ke.A,{defaultMessage:"Start journey",description:"",id:"label.start_journey.0819a761"}):(0,N.jsx)(ke.A,{defaultMessage:"Resume journey",description:"",id:"label.resume_journey.c466931c"})},mg=t(22706),gg=t(3626);const pg=e=>{const{className:s}=e,{shopping:a}=(0,P.nm)(),t=ci()().format("YYYY");return(0,N.jsx)(Ce.S,{className:`app-footer-container ${s||""}`,children:(0,N.jsx)(Ce.S,{className:"footer h-100",children:(0,N.jsx)(Ue.A,{className:"h-100",children:(0,N.jsxs)(Qe.A,{className:"h-100 m-0",children:[(0,N.jsx)(Ve.A,{className:"text-center d-flex align-items-center justify-content-center justify-content-lg-start order-2 order-lg-0",lg:4,children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"\xa9 {year} Smart Marketing Solutions, LLC. All Rights Reserved.",id:"label.c_year_smart_marketing_solutions_l.0a935efc",values:{year:t}})})}),(0,N.jsx)(Ve.A,{className:"text-center company-icon-container d-flex align-items-center justify-content-center",lg:4,children:(0,N.jsx)(jr,{height:34,path:"logo_solvably.svg",width:100})}),(0,N.jsx)(Ve.A,{className:"text-center d-flex align-items-center justify-content-center justify-content-lg-end",lg:4,children:(0,N.jsxs)(Ce.S,{className:"links-container",children:[(0,N.jsx)(Le.Link,{target:"_blank",to:"/privacy",children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})}),(0,N.jsx)(Le.Link,{target:"_blank",to:"/terms",children:(0,N.jsx)(ke.A,{defaultMessage:"Terms of Service",id:"label.terms_of_service.4afa55bf"})}),(0,N.jsx)(Le.Link,{to:"/support",children:(0,N.jsx)(ke.A,{defaultMessage:"Support",id:"label.support.be91940b"})})]})})]})})})})};class xg extends l.Component{constructor(e){super(e),this.setLoading=(e,s)=>this.setState({loading:e},s),this.clearError=()=>this.setState({error:null}
2),this.getRouteParams=()=>{var e,s;return(null===this||void 0===this||null===(e=this.props)||void 0===e||null===(s=e.match)||void 0===s?void 0:s.params)||{}},this.updateRouteParams=e=>{const{preview:s}=this.props,a=this.getRouteParams(),t=Number.parseInt(null===a||void 0===a?void 0:a.group_member_assignment_id)||null,i=Number.parseInt(null===a||void 0===a?void 0:a.group_member_assignment_component_id)||null,l=!isNaN(i)&&null!==a&&void 0!==a&&a.view?null===a||void 0===a?void 0:a.view:i||"overview",n=isNaN(Number.parseInt(l))?Number.parseInt(null===a||void 0===a?void 0:a.section)||null:l,r=isNaN(Number.parseInt(l))?Number.parseInt(null===a||void 0===a?void 0:a.subsection)||null:n;this.setState({group_member_assignment_component_id:i,group_member_assignment_id:t,section:n,subsection:r,view:l},async()=>e&&!s&&await this.fetchAssignmentData())},this.synchronizeMode=()=>{var e;const{assignment:s,component:a,mode:t}=this.state;let i=!(null===a||void 0===a||!a.completed)||!(null===s||void 0===s||!s.completed);var l;"challenge"===(null===a||void 0===a||null===(e=a.group_assignment_component)||void 0===e?void 0:e.type)&&(i=null===a||void 0===a||null===(l=a.challenge)||void 0===l?void 0:l.is_submitted);i&&!["preview","facilitation","arbitration"].includes(t)&&this.setState({mode:"review"})},this.handleSidebarToggle=e=>this.setState({sidebar_open:e}),this.toggleAssignmentSidebar=e=>{var s;const a=null===this||void 0===this||null===(s=this.assignment_sidebar)||void 0===s?void 0:s.current;a&&a.toggleSidebar(e)},this.getAssignmentType=()=>{var e,s,a;return(null===this||void 0===this||null===(e=this.state)||void 0===e||null===(s=e.assignment)||void 0===s||null===(a=s.assignment)||void 0===a?void 0:a.type)||null},this.getComponentType=()=>{const{component:e}=this.state,{cartridge_id:s,challenge_id:a}=e||{};return a?"challenge":s?"cartridge":null},this.launchChallengeOverviewModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.challenge_overview_modal)||void 0===e?void 0:e.current;if(!s)return;const{group_member_assignment_component_id:a}=this.state;s.show({gmac_id:a})},this.openSidebarTab=e=>{var s;const a=null===this||void 0===this||null===(s=this.assignment_sidebar)||void 0===s?void 0:s.current;a&&a.openSidebarTab(e)},this.getJourneyOverviewLink=()=>`/assignment/${this.state.group_member_assignment_id}/overview`,this.setChatService=e=>this.chat_service.current=e,this.isTeamBased=()=>{var e,s,a,t;return(null===(e=this.state)||void 0===e||null===(s=e.assignment)||void 0===s||null===(a=s.team)||void 0===a||null===(t=a.members)||void 0===t?void 0:t.length)>1},this.fetchGMA=async()=>{try{var e,s,a,t,i;const{app:l,preview:n}=this.props,{api:r}=l;if(n)return;const{group_member_assignment_id:o}=this.state;if(!o)return;const d=this.isUserFacilitator()||l.userIsSiteArbitrator()?"facilitators":"learners",{assignment:c}=await r.get(`/api/${d}/gma/${o}`);this.setState({assignment:c,assignment_type:(null===c||void 0===c||null===(e=c.assignment)||void 0===e?void 0:e.type)||null,facilitators:(null===c||void 0===c||null===(s=c.assignment)||void 0===s||null===(a=s.group)||void 0===a||null===(t=a.members)||void 0===t||null===(i=t.map)||void 0===i?void 0:i.call(t,e=>null===e||void 0===e?void 0:e.organization_member))||[]},()=>{let e=this.isUserFacilitator()?"facilitation":l.userIsSiteArbitrator()?"arbitration":"";this.setState({mode:e})})}catch({err:err}){w(err),this.setState({error:err})}},this.fetchGMAC=async()=>{try{var e;const{app:s}=this.props,{api:a}=s,{group_member_assignment_component_id:t,group_member_assignment_id:i}=this.state;if(!i||!t)return;const{component:l}=await a.get(`/api/learners/gmac/${t}`);this.setState({component:l,component_type:(null===l||void 0===l||null===(e=l.group_assignment_component)||void 0===e?void 0:e.type)||null})}catch({err:err}){w(err),this.setState({error:err})}},this.fetchAssignmentData=async()=>{this.setState({loading:!0}),await this.fetchGMA(),await this.fetchGMAC(),await(0,gg.sleep)(100),this.synchronizeMode(),this.setState({loading:!1})},this.isUserFacilitator=()=>{const{app:e}=this.props,{userIsLearner:s,userIsSiteArbitrator:a}=e;return!s()&&!a()},this.getTemplate=()=>{var e;const{assignment:s,assignment_type:a,component:t,component_type:i}=this.state;var l;return"journey"!==a?(null===t||void 0===t||null===(l=t.group_assignment_component)||void 0===l?void 0:l[`${i}_template`])||{}:null===s||void 0===s||null===(e=s.assignment)||void 0===e?void 0:e.group_assignment_template},this.getModuleWrapper=()=>{const{assignment:e,component:s}=this.state;if(e&&!s)return rg;var a;switch(null===s||void 0===s||null===(a=s.group_assignment_component)||void 0===a?void 0:a.type){case"cartridge":return Um;case"challenge":return ut;default:return l.Fragment}},this.getModule=()=>{const{assignment:e,component:s,view:a}=this.state;if(e){var t;if(s)switch(null===s||void 0===s||null===(t=s.group_assignment_component)||void 0===t?void 0:t.type){case"cartridge":return"overview"===a?Wm:Xm;case"challenge":return"overview"===a?Vf:pA;default:return l.Fragment}return"journey"===this.getAssignmentType()?dg:l.Fragment}return l.Fragment},this.getModuleProps=()=>{var e;const{component:s,group_member_assignment_component_id:a,group_member_assignment_id:t,mode:i,section:l,sidebar_open:n,subsection:r}=this.state,o={chat_service:null===this||void 0===this||null===(e=this.chat_service)||void 0===e?void 0:e.current,group_member_assignment_component_id:a,group_member_assignment_id:t,mode:i,onLoading:this.setLoading,preview:!1,sidebar_open:n,toggleAssignmentSidebar:this.toggleAssignmentSidebar};var d;if(s&&"challenge"===(null===s||void 0===s||null===(d=s.group_assignment_component)||void 0===d?void 0:d.type))o.p
2hase=l,o.subphase=r;return o},this.shouldUseAssignmentLayout=()=>{const{view:e}=this.state,s=this.getComponentType(),a=this.getAssignmentType();switch(s||a||null){case"cartridge":case"challenge":return"content"===e;default:return!1}},this.getCustomTopnav=()=>{const{view:e}=this.state,s=this.getComponentType(),a=this.getAssignmentType(),t=s||a||"";if(this.getModuleWrapper()===l.Fragment)return l.Fragment;switch(t){case"challenge":return"content"===e?p_:l.Fragment;case"cartridge":return"content"===e?ag:l.Fragment;default:return l.Fragment}};const{app:s}=e,a=e.preview?"preview":s.userIsSiteArbitrator()?"arbitration":"";this.state={assignment:null,assignment_type:null,component:null,component_type:null,error:null,facilitators:[],group_member_assignment_component_id:null,group_member_assignment_id:null,loading:!0,mode:a,section:null,sidebar_open:!0,subsection:null,view:null},this.chat_service=(0,l.createRef)(),this.assignment_sidebar=(0,l.createRef)(),this.module_wrapper_component=(0,l.createRef)(),this.challenge_overview_modal=(0,l.createRef)()}componentDidUpdate(e,s,a){const{assignment_type:t,component_type:i}=this.state,l=i||t||null,n=e.match.params,r=this.getRouteParams(),o=!(0,T.isEqual)(null===n||void 0===n?void 0:n.group_member_assignment_id,null===r||void 0===r?void 0:r.group_member_assignment_id),d=!(0,T.isEqual)(null===n||void 0===n?void 0:n.group_member_assignment_component_id,null===r||void 0===r?void 0:r.group_member_assignment_component_id),c=!(0,T.isEqual)(null===n||void 0===n?void 0:n.view,null===r||void 0===r?void 0:r.view);(0,T.isEqual)(n,r)||(d&&this.setState({component:null}),this.updateRouteParams(o||d||c&&"cartridge"===l))}componentDidMount(){this.updateRouteParams(!0)}render(){var e,s,a,t;const{assignment:i,assignment_type:l,component:n,component_type:r,facilitators:o,group_member_assignment_component_id:d,group_member_assignment_id:c,loading:h,mode:u,section:m,sidebar_open:g,subsection:p,view:x}=this.state,v=this.getModuleWrapper(),f=this.getModule(),j=this.getModuleProps(),_=this.getCustomTopnav(),b=this.shouldUseAssignmentLayout(),A="cartridge"!==r||"content"!==x,y=()=>(0,N.jsx)(Ce.S,{className:"assignment-wrapper "+(u?`${u}-mode`:""),children:(0,N.jsx)(fg,{children:(0,N.jsxs)(mg.z,{enableDetails:!0,size:"lg",children:[(0,N.jsx)(Ce.S,{className:"module-container d-flex flex-column justify-content-between mw-100",children:(0,N.jsxs)(v,(0,F.A)((0,F.A)({},j),{},{children:[(0,N.jsxs)(Ce.S,{className:"module-contents position-relative d-flex flex-column",children:[(0,N.jsx)(ux,{}),(0,N.jsx)(f,(0,F.A)((0,F.A)({},j),{},{children:(0,N.jsx)(_,{})}))]}),(0,N.jsx)(pg,{})]}))}),(0,N.jsx)(Ce.S,{className:"sidebar-placeholder "+(g?"open":"closed"),children:(0,N.jsx)(Bg,{ref:this.assignment_sidebar,showNavButtons:A})})]})})});return(0,N.jsx)(nt,{value:{assignment:i,assignment_sidebar:this.assignment_sidebar.current,assignment_type:l,chat_service:null===this||void 0===this||null===(e=this.chat_service)||void 0===e?void 0:e.current,component:n,component_type:r,facilitators:o,fetchAssignmentData:this.fetchAssignmentData,getJourneyOverviewLink:this.getJourneyOverviewLink,group:null===i||void 0===i||null===(s=i.assignment)||void 0===s?void 0:s.group,group_assignment:null===i||void 0===i?void 0:i.assignment,group_member:null===i||void 0===i?void 0:i.group_member,group_member_assignment_component_id:d,group_member_assignment_id:c,handleSidebarToggle:this.handleSidebarToggle,is_facilitator:this.isUserFacilitator(),is_muted:null===i||void 0===i||null===(a=i.team_member)||void 0===a?void 0:a.is_muted,is_team_based:this.isTeamBased(),launchChallengeOverviewModal:this.launchChallengeOverviewModal,mode:u,openSidebarTab:this.openSidebarTab,section:m,setChatService:this.setChatService,setWrapperLoading:this.setLoading,sidebar_open:g,subsection:p,team:(0,F.A)((0,F.A)({},null===i||void 0===i?void 0:i.team),{},{facilitators:o}),team_member:null===i||void 0===i?void 0:i.team_member,team_members:null===i||void 0===i||null===(t=i.team)||void 0===t?void 0:t.members,template:this.getTemplate(),toggleAssignmentSidebar:this.toggleAssignmentSidebar,view:x,wrapper_loading:h},children:(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"vh-100",loading:h||!c,children:(0,N.jsxs)(hx,{children:[b?(0,N.jsx)(mx,{children:y()}):(0,N.jsx)(py,{className:"flex-fill",hideFooter:!0,children:y()}),(0,N.jsx)(Om,{ref:this.challenge_overview_modal})]})})})}}var vg=(0,Ke.Ay)((0,Pe.y)((0,n.G0)(xg)));var fg=e=>{const{children:s}=e,{sidebar_open:a}=dt(),{isBelowBreakpoint:t}=(0,ne.vh)({breakpoint:922}),[i,n]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{const e=new MutationObserver((e,s)=>
2{e.forEach(e=>{"class"===e.attributeName&&("modal-open"===e.target.className||e.target.className.split(" ").includes("modal-open")?n(!0):n(!1))})});return e.observe(document.body,{attributes:!0}),()=>e.disconnect()},[]),(0,N.jsx)(Ce.S,{className:`assignment-wrapper-inner ${i?"modal-open":""} ${a?"sidebar-open":""} ${t?"mobile":""}`,children:s})};var jg=t.p+"static/media/icon-chat-inactive.6aa0eb82a401c345e81896f53506b3b1.svg";var _g=t.p+"static/media/icon-chat-active.894732621714022f6f58d2dcbbeb036c.svg";var bg=t.p+"static/media/icon-chat-gray.4435d4d5e82566a1cec76ee8af44483b.svg";var Ag={gray:bg,normal:t.p+"static/media/icon-chat.ddf6bdf6cb37815c3e84c4239f2ff0f7.svg"};const yg={black:jg,white:_g};var wg=t.p+"static/media/icon-syllabus-white.a56a7548a008ef47a8ba065e3e14333a.svg";var Ng={normal:t.p+"static/media/icon-syllabus.fbdd3b955ebafb77e027a6ebf1bf5980.svg",white:wg};var Sg=t.p+"static/media/icon-file-white.85cf8263c13ad6cefc1a6990b9ebc151.svg";var Cg={chat:Ag,chat2:yg,file:{normal:t.p+"static/media/icon-file.da6acf76ae817e63917512314ae215f4.svg",white:Sg},syllabus:Ng};const Mg=(0,l.forwardRef)((e,s)=>{const{children:a,className:t,defaultActiveKey:i,defaultOpen:n,hideButtonsWhenOpen:r,onHide:o,onNavSelect:d,onToggle:c}=e,{isBelowBreakpoint:h}=(0,ne.vh)({breakpoint:922}),u=!(!(0,T.isBoolean)(n)||h)&&n,[m,g,p]=(0,ne.CQ)({activeKey:i,error:null,loading:!1,show:u}),x=(0,l.useRef)(),v=e=>g({activeKey:(null===e||void 0===e?void 0:e.activeKey)||i,show:!0}),f=()=>{g({activeKey:"",show:!1}),"function"===typeof o&&o()},j=()=>g(e=>(0,F.A)((0,F.A)({},e),{},{show:!m.show})),_=e=>g(s=>(0,F.A)((0,F.A)({},s),{},{activeKey:e}));(0,l.useImperativeHandle)(s,()=>({activeKey:m.activeKey,element:x.current,hide:f,show:v,toggle:j})),(0,l.useEffect)(()=>p,[]),(0,l.useEffect)(()=>{"function"===typeof c&&c(m.show,m.activeKey)},[m.show,m.activeKey]),(0,l.useEffect)(()=>{"function"===typeof d&&d(m.activeKey)},[m.activeKey]);const{activeKey:b,show:A}=m,y=oa()(`sidebar ${t||""}`,{closed:!A,mobile:!!h,open:!!A});return(0,N.jsx)(Tg,{value:{activeKey:b,defaultActiveKey:i,handleHide:f,handleNavSelect:e=>{m.show?e===m.activeKey?(f(),_("")):_(e):v({activeKey:e})},handleShow:v,hideButtonsWhenOpen:r,show:A},children:(0,N.jsx)("aside",{className:y,ref:x,children:a})})});Mg.displayName="Sidebar",Mg.defaultProps={defaultActiveKey:"",defaultOpen:!1};var kg=Mg;const zg=l.createContext({}),Tg=zg.Provider,Ig=(zg.Consumer,()=>(0,l.useContext)(zg));var Eg=e=>{const{buttons:s}=e,{activeKey:a,defaultActiveKey:t,handleNavSelect:i,hideButtonsWhenOpen:l,show:n}=Ig();return(0,N.jsx)(aa.A,{activeKey:a,className:"sidebar-nav "+(n&&l?"d-none":""),defaultActiveKey:t,onSelect:i,children:!(null===s||void 0===s||!s.length)&&s.map((e,s)=>(0,N.jsx)(Rg,{activeKey:a,ariaLabel:null===e||void 0===e?void 0:e.ariaLabel,eventKey:null===e||void 0===e?void 0:e.eventKey,icon:null===e||void 0===e?void 0:e.icon,label:null===e||void 0===e?void 0:e.label},s))})},Fg=t(72368);var Rg=e=>{const{activeKey:s,ariaLabel:a,eventKey:t,icon:i,label:l=""}=e,n=s===t;return(0,N.jsx)(Fg.A,{"aria-label":a,as:ve.A,className:"sidebar-nav-button "+(n?"selected":""),eventKey:t,id:`${t}Button`,children:(0,N.jsxs)(Ce.S,{className:"contents "+(n?"selected":""),children:[i,(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:l,id:`label.${l}-tab`})})]})})};const Dg=(0,l.forwardRef)((e,s)=>{const{showNavButtons:a}=e,t=(0,l.useRef)(),i=(0,l.useRef)(),{styles:r}=(0,n.nm)(),{formatMessage:o}=(0,ja.A)(),{isBelowBreakpoint:d}=(0,ne.vh)({breakpoint:922}),{component:c,component_type:h,handleSidebarToggle:u}=dt(),m=d?"":"chat",[g,p]=(0,l.useState)(m),x=()=>{var e;const s=(null===r||void 0===r?void 0:r.white)||"",t=(null===r||void 0===r?void 0:r.black)||"",i={chat:{ariaLabel:o({id:"label.chat_messages.4165e297",defaultMessage:"Chat messages"}),eventKey:"chat",icon:(0,N.jsx)(Zs.A,{alt:"",height:40,src:null===Cg||void 0===Cg||null===(e=Cg.chat2)||void 0===e?void 0:e["chat"===g?"white":"black"],width:40}),label:o({id:"label.chat.460b3a7d",defaultMessage:"Chat"})},files:{ariaLabel:o({id:"label.chat_files.c826719c",defaultMessage:"Chat files"}),eventKey:"files",icon:(0,N.jsx)(ze.M1W,{color:"files"===g?s:t,size:24}),label:o({id:"label.files.abc7e989",defaultMessage:"Files"})},syllabus:{ariaLabel:o({id:"label.overview.d4b1ea57",defaultMessage:"Overview"}),eventKey:"syllabus",icon:(0,N.jsx)(ze.kkc,{color:"syllabus"===g?s:t,size:24}),label:o({id:"label.overview.d4b1ea57",defaultMessage:"Overview"})}};switch(h){case"cartridge":return a?[i.chat]:[];case"challenge":return d?[i.files,i.chat]:[i.chat,i.syllabus,i.files];default:return[i.chat,i.files]}},v=e=>{const s=null===t||void 0===t?void 0:t.current;s&&(e?s.show():s.hide())},f=e=>{const s=null===t||void 0===t?void 0:t.current;s&&s.show({activeKey:e})};(0,l.useImperativeHandle)(s,()=>({getNavButtons:x,is_mobile:d,openSidebarTab:f,setActiveKey:p,sidebar_ref:t,toggleSidebar:v}));const j=x();return(0,N.jsx)(Lg,{value:{launchOverviewModal:()=>{const e=null===i||void 0===i?void 0:i.current;e&&e.show({gmac_id:null===c||void 0===c?void 0:c.id})},openSidebarTab:f,setOverviewModal:e=>i.current=e},children:(0,N.jsxs)(kg,{className:"assignment-sidebar d-flex flex-column",defaultActiveKey:m,defaultOpen:!0,onNavSelect:p,onToggle:(e,s)=>{p(e?s:""),"function"===typeof u&&u(e)},ref:t,children:[(0,N.jsx)(Qg,{}),(0,N.jsx)(Vg,{}),(0,N.jsx)(Eg,{buttons:j})]})})});Dg.displayName="AssignmentSidebar";var Bg=Dg;const Pg=l.createContext({}),Lg=Pg.Provider;Pg.Consumer;Pg.displayName="AssignmentSidebarContext";const Og=()=>(0,l.useContext)(Pg);var Hg=t.p+"static/media/icon-close.1216393623999df968940188a5917d88.svg";const Ug=e=>{var s,a,t;const{launchOverviewModal:i}=Og(),{assignment:l,component:n,component_type:r}=dt(),{activeKey:o,handleHide:d,handleNavSelect:c}=Ig(),{enable_voice_chat:h}=(null===l||void 0===l?void 0:l.assignment)||{},u=((null===l||void 0===l||null===(s=l.team)||void 0===s?void 0:s.members)||[]).map(e=>{if(null!==e&&void 0!==e&&e.user)return e.user;const s=null===e||void 0===e?void 0:e.agent_persona;return s?{id:`agent-${s.id}`,avatar:s.avatar_path?{location:s.avatar_path}:null,fullname:s.name,is_agent:!0}:null}
2).filter(Boolean),m=(null===l||void 0===l||null===(a=l.team)||void 0===a?void 0:a.name)||"";return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"sidebar-panel top-panel p-2",children:(0,N.jsxs)(Ce.S,{className:"sidebar-header",children:["chat"===o&&(0,N.jsxs)(Ce.S,{className:"d-flex w-100 justify-content-between align-items-center",children:[(0,N.jsx)(Ce.S,{children:h&&(0,N.jsx)(ri,{})}),(0,N.jsxs)(Ce.S,{className:"team-user-icons text-center",onClick:()=>c("team"),role:"button",children:[(0,N.jsx)(tn,{maxIcons:5,size:24,users:u}),(0,N.jsxs)(Ce.S,{className:"team-name",children:[(0,N.jsx)("span",{className:"visually-hidden",children:"team name: "})," ",m," ",(0,N.jsx)(ze.X6T,{className:"ms-1",size:"8"})]})]}),(0,N.jsx)(ve.A,{"aria-label":"close side panel",className:"close-button d-flex justify-content-center align-items-center text-dark",onClick:d,variant:"link",children:(0,N.jsx)(Zs.A,{alt:"",height:24,src:Hg,width:24})})]}),"team"===o&&(0,N.jsxs)(Ce.S,{className:"d-flex w-100 justify-content-between align-items-center",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ve.A,{className:"close-button d-flex justify-content-center align-items-center text-dark",onClick:()=>c("chat"),variant:"link",children:(0,N.jsx)(ze.QVr,{})})}),(0,N.jsx)(Ce.S,{style:{fontSize:20,fontWeight:500,lineHeight:"24px"},children:m}),(0,N.jsx)(ve.A,{"aria-label":"close side panel",className:"close-button d-flex justify-content-center align-items-center text-dark",onClick:d,variant:"link",children:(0,N.jsx)(Zs.A,{alt:"",height:24,src:Hg,width:24})})]}),"syllabus"===o&&(0,N.jsxs)(Ce.S,{className:"d-flex w-100 justify-content-between align-items-center project-syllabus",children:[(0,N.jsx)("div",{children:(0,N.jsx)(Ad,{component:null===(t=n.group_assignment_component)||void 0===t?void 0:t.challenge_template,size:40,type:r})}),(0,N.jsx)(ve.A,{"aria-label":"open syllabus content in modal",className:"close-button d-flex justify-content-center align-items-center text-dark ms-auto",onClick:i,variant:"link",children:(0,N.jsx)(ze.z0S,{})}),(0,N.jsx)(ve.A,{"aria-label":"close side panel",className:"close-button d-flex justify-content-center align-items-center text-dark",onClick:d,variant:"link",children:(0,N.jsx)(Zs.A,{alt:"",height:24,src:Hg,width:24})})]}),"files"===o&&(0,N.jsxs)(Ce.S,{className:"d-flex w-100 justify-content-between align-items-center project-syllabus",children:[(0,N.jsx)("div",{children:(0,N.jsx)("h5",{className:"p-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Files",description:"",id:"label.files.abc7e989"})})}),(0,N.jsx)(ve.A,{"aria-label":"close side panel",className:"close-button d-flex justify-content-center align-items-center text-dark",onClick:d,variant:"link",children:(0,N.jsx)(Zs.A,{alt:"",height:24,src:Hg,width:24})})]})]})})})};Ug.defaultProps={onOpenSyllabusModal:Function()};var Qg=Ug;var Vg=e=>{const{challenge_id:s}=e,{team:a}=dt(),{facilitators:t,members:i}=a||{},{activeKey:n}=Ig(),r=(null===cx||void 0===cx?void 0:cx[n])||l.Fragment,o="team"===n?{challenge_id:s,facilitators:t,members:i,withoutFiles:!0}:{};return(0,N.jsx)(Ce.S,{className:"sidebar-panel bottom-panel",children:(0,N.jsx)(r,(0,F.A)({},o))})},Gg=t(25740),Wg=t.n(Gg);var Kg=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,[t,i,n]=(0,ne.CQ)({challenge_template:null,error:null,image:null,link:null,loading:!1,show:!1,trigger_video:null}),r=e=>{i(s=>(0,F.A)((0,F.A)({},s),{},{challenge_template:e.challenge_template,image:e.image,link:e.link,show:!0,trigger_video:e.trigger_video}))},o=()=>{i(e=>(0,F.A)((0,F.A)({},e),{},{show:!1})),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:o,show:r})),(0,l.useEffect)(()=>n,[]);const{challenge_template:d,image:c,link:h,show:u,trigger_video:m}=t;return(0,N.jsxs)(xe,{backdrop:"static",onHide:o,show:u,size:"xl",children:[(0,N.jsxs)(xe.Body,{children:[m&&(0,N.jsx)(Ce.S,{style:{aspectRatio:"16/9",width:"100%"},children:(0,N.jsx)(Wg(),{playing:!0,controls:!0,height:"100%",url:m,width:"100%"})}),h&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("h3",{children:[null===d||void 0===d?void 0:d.title,(0,N.jsx)(ke.A,{defaultMessage:": Trigger C
2ontent",id:"label.trigger_content.9d551544"})]}),(0,N.jsx)("a",{href:h,rel:"noopener noreferrer",target:"_blank",children:h})]}),c&&(0,N.jsx)("img",{alt:`${null===d||void 0===d?void 0:d.title} Trigger Content`,src:c,style:{margin:"auto",width:"100%"}})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:o,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})});var Yg=e=>{var s;const a=(0,l.useRef)(),t=(0,l.useRef)(),{formatMessage:i}=(0,ja.A)(),{setOverviewModal:n}=Og(),{component:r}=dt(),o=null===r||void 0===r||null===(s=r.group_assignment_component)||void 0===s?void 0:s.challenge_template,{challenge_statement:d,overview:c,title:h,total_est_completion_time:u,trigger_content_type:m,trigger_content_url:g}=o||{},p="decision_making"===(null===o||void 0===o?void 0:o.challenge_type),x=m&&g,v=(null===o||void 0===o?void 0:o.deliverable_challenges)||[];(0,l.useEffect)(()=>{(null===t||void 0===t?void 0:t.current)&&n(t.current)},[t.current]);const f=(()=>{if(!o)return"";let{trigger_content_type:e}=o;switch(e){case"YouTube":return i({id:"label.watch_youtube_video.a9439f04",defaultMessage:"Watch YouTube Video"});case"Vimeo":return i({id:"label.watch_vimeo_video.cb7b3faf",defaultMessage:"Watch vimeo video"});case"Video":return i({id:"label.watch_video.dbae3e9b",defaultMessage:"Watch video"});case"Image":return i({id:"label.view_full_sized_image.e0fb5b2b",defaultMessage:"View Full-Sized Image"});case"Other":return i({id:"label.view_link.2d559279",defaultMessage:"View link"});default:return i({id:"label.variable_trigger_content.59a4a44f",defaultMessage:"Variable trigger content"})}})();return(0,N.jsxs)(Ce.S,{className:"sidebar-syllabus",children:[(0,N.jsxs)(Ce.S,{className:"syllabus-container",children:[(0,N.jsx)("h4",{children:h}),(0,N.jsx)(Ce.S,{className:"challenge-time-data",children:(0,N.jsxs)(Ce.S,{className:"duration",children:[(0,N.jsx)("span",{className:"icon",children:(0,N.jsx)(ze.w_X,{height:14,width:14})}),(0,N.jsx)(ke.A,{defaultMessage:"{time} minutes",id:"label.time_minutes.c9c512f6",values:{time:u}})]})}),x&&(0,N.jsxs)(ve.A,{className:"play-trigger",onClick:e=>{e.preventDefault(),((e,s)=>{const t=null===a||void 0===a?void 0:a.current;t&&("YouTube"===e||"Vimeo"===e||"Video"==e?t.show({challenge_template:o,trigger_video:s}):"Image"===e?t.show({challenge_template:o,image:s}):"Other"===e&&(s.startsWith("http://")||s.startsWith("https://")||(s=`http://${s}`),t.show({challenge_template:o,link:s})))})(m,g)},variant:"secondary",children:[(0,N.jsx)(ze.GH9,{className:"me-2",size:16})," ",f]}),(0,N.jsxs)(Ce.S,{className:"syllabus-entry",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})}),(0,N.jsx)(Ce.S,{className:"body-text trunacte-override-container",children:(0,N.jsx)(Rl,{ellipsisText:"More",lines:3,children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:c}})})})]}),(0,N.jsxs)(Ce.S,{className:"syllabus-entry",children:[(0,N.jsx)("h6",{children:p?(0,N.jsx)(ke.A,{defaultMessage:"Decision question",id:"label.decision_question.8ac79b2c"}):(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})}),(0,N.jsx)(Ce.S,{className:"body-text trunacte-override-container",children:(0,N.jsx)(Rl,{ellipsisText:"More",lines:3,children:(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:d}})})})]}),(null===v||void 0===v?void 0:v.length)&&(0,N.jsxs)(Ce.S,{className:"syllabus-entry",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deliverable formats",id:"label.deliverable_formats.3b66a39f"})}),(0,N.jsx)(Ce.S,{className:"deliverable-challenge-list-container",style:{width:"100%"},children:v.map((e,s)=>(0,N.jsx)(Em,{deliverable_challenge:e},s))})]})]}),(0,N.jsx)(Kg,{ref:a}),(0,N.jsx)(Om,{ref:t})]})};const qg=e=>{let{file_name:s,file_type:a,handleRemove:t=null,handleReplace:i=null,link:l}=e;const{formatMessage:n}=(0,ja.A)(),{parseExt:r}=(0,P.hc)(),o=r(l);return l?(0,N.jsxs)(Ce.S,{className:"meta-preview p-2 d-flex ",children:[(0,N.jsx)(Ce.S,{className:"meta-left ps-2 flex-fill",children:(0,N.jsx)(zm,{ext:o,filename:s,fill:"#008087",size:16,type:a,withLabel:!0})}),(0,N.jsxs)(Ce.S,{className:"meta-right d-flex",children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",children:(0,N.jsx)(Me.NX,{className:"image-download-button text-decoration-none",filename:s,title:"Download attachment",type:o,url:l,variant:"quaternary"})}),"function"===typeof t&&(0,N.jsx)(ve.A,{className:"meta-trash d-flex align-items-center align-self-center",onClick:t,style:{color:"#141414"},variant:"light","aria-label":n({id:"label.remove_attachment.595b066a",defaultMessage:"Remove attachment"}),children:(0,N.jsx)("div",{className:"remove-icon",children:(0,N.jsx)(ze.RCe,{})})}),"function"===typeof i&&(0,N.jsx)(ve.A,{className:"meta-trash d-flex align-items-center align-self-center",onClick:i,variant:"light","aria-label":n({id:"label.replace_attachment.daf2ad44",defaultMessage:"Replace attachment"}),children:(0,N.jsx)("div",{className:"remove-icon",children:(0,N.jsx)(ze.Mbp,{})})})]})]}):null};qg.displayName="MetaPreview";
2const Jg=(0,l.forwardRef)((e,s)=>{let{file_name:a="Uploaded File",file_type:t,link:i=null}=e;const[n,r,o]=(0,ne.CQ)({reject:Function(),resolve:Function(),show:!1}),d=()=>{n.resolve(null),o()};return(0,l.useImperativeHandle)(s,()=>({hide:()=>d(),show:()=>new Promise((e,s)=>{r(a=>(0,F.A)((0,F.A)({},a),{},{reject:s,resolve:e,show:!0}))})})),i?(0,N.jsxs)(xe,{dialogClassName:"share-preview-attachment-modal",onHide:d,show:n.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{className:"text-capitalize d-flex align-items-cente gap-1",children:[(0,N.jsx)("span",{children:t}),(0,N.jsx)(ke.A,{defaultMessage:"attachment",id:"label.attachment.602a5e69"})]})}),(0,N.jsxs)(xe.Body,{children:["image"===t&&(0,N.jsx)(Zs.A,{alt:"Image attachment preview",className:"image-preview",src:i}),"video"===t&&(0,N.jsx)(Ce.S,{className:"prev-att-video-container",children:(0,N.jsx)(Zg,{expandable:!1,overlay_enabled:!1,src:i,title:"Video attachment preview"})}),(0,N.jsx)(Ce.S,{className:"mt-3",children:(0,N.jsx)(qg,{file_name:a,link:i})})]})]}):null});var Xg=Jg;Jg.displayName="PreviewAttachmentModal";const Zg=e=>{var s,a;const{classWrapper:t="",data:i,downloadable:r,expandable:o,onLoad:d,overlay_enabled:c,setCycleDelay:h,src:u,style:m,title:g}=e,p=`video/${(0,n.nm)().utils.parseExt(u)}`,[x,v]=(0,l.useState)(!0),[f,j]=(0,l.useState)(!0);let _=(0,l.useRef)(null);const b=(0,l.useRef)(null),A=()=>{_.current.ended?(v(!0),w(5)):(w(5),v(!0)),j(!0)},y=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},w=e=>{h&&h(e)};return(0,l.useEffect)(()=>{let e=_.current;e.onvolumechange=function(e){localStorage.setItem("aim_video_volume",e.target.muted?0:e.target.volume)};const s=localStorage.getItem("aim_video_volume");null!=s&&(e.volume=s)},[]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:`solvably-video-wrapper w-100 solvably--video-player-2 ${t}`,style:m,children:(0,N.jsxs)(Ce.S,{className:"solvably-video "+(c&&f?"overlay":""),children:[(0,N.jsx)("video",{autoPlay:!1,className:"video-fluid",controls:!x,crossOrigin:"anonymous",onClick:e=>y(e),onEnded:A,onLoadedData:d,onPause:A,onPlay:()=>w(Math.floor(_.duration-_.currentTime)+5),ref:_,title:g||"project solution video",children:(0,N.jsx)("source",{src:u,type:p})}),(0,N.jsx)(ve.A,{className:"video-play-button "+(x?"":"hidden"),onClick:e=>{e.preventDefault(),y(e),v(!1),j(!1),_.current.play()},variant:"link",children:(0,N.jsx)(Zs.A,{alt:"video play button icon","aria-hidden":!0,height:48,src:null===Vu.default||void 0===Vu.default?void 0:Vu.default.play2,width:48})}),f&&r&&(0,N.jsx)(Me.NX,{className:"video-download-button text-decoration-none",icon_size:12,title:"Download attachment",url:u,variant:"link"}),f&&o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"video-expand-button d-flex align-items-center justify-content-center",onClick:async()=>await b.current.show(),children:(0,N.jsx)(ze.z0S,{color:"var(--white)",size:14})}),(0,N.jsx)("h6",{className:"meta-title",children:"video.mp4"})]})]})}),(0,N.jsx)(Xg,{file_name:null===i||void 0===i||null===(s=i.data)||void 0===s?void 0:s.file_name,file_type:null===i||void 0===i?void 0:i.file_type,link:null===i||void 0===i||null===(a=i.data)||void 0===a?void 0:a.link,ref:b})]})};Zg.defaultProps={downloadable:!1,expandable:!0,overlay_enabled:!0};var $g=Zg;const ep=e=>{const{file_name:s,file_type:a,link:t,onRemove:i,onReplace:l}=e,{parseExt:n}=(0,P.hc)(),r=n(t);return t?(0,N.jsxs)(Ce.S,{className:"file-metadata-preview d-flex justify-content-between align-items-center",children:[(0,N.jsx)(Ce.S,{className:"meta-left d-flex align-items-center",children:(0,N.jsx)(zm,{ext:r,filename:s,size:16,type:a,withLabel:!0})}),(0,N.jsxs)(Ce.S,{className:"meta-right",children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",children:(0,N.jsxs)(Me.NX,{className:"text-decoration-none",filename:s,show_loading_label:!0,type:a,url:t,variant:"link",children:[(0,N.jsx)(ze.WCW,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Download",id:"label.download.d6eafe82"})]})}),"function"===typeof i&&(0,N.jsx)(ve.A,{className:"meta-trash",onClick:i,style:{color:"#141414"},variant:"light",children:(0,N.jsx)(Ce.S,{className:"remove-icon",children:(0,N.jsx)(ze.RCe,{})})}),"function"===typeof l&&(0,N.jsx)(ve.A,{className:"meta-trash",onClick:l,variant:"light",children:(0,N.jsx)(Ce.S,{className:"remove-icon",children:(0,N.jsx)(ze.Mbp,{})})})]})]}):(0,N.jsx)(N.Fragment,{})};ep.displayName="FileMetadataPreview";var sp=ep;const ap=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({file_type:"",filename:"",link:"",loaded:!1,onHide:null,reject:Function(),resolve:Function(),show:!1}),n=e=>new Promise((s,a)=>{t(t=>(0,F.A)((0,F.A)({},t),{},{file_type:(null===e||void 0===e?void 0:e.file_type)||"",filename:(null===e||void 0===e?void 0:e.filename)||"",link:(null===e||void 0===e?void 0:e.link)||"",onHide:(null===e||void 0===e?void 0:e.onHide)||null,reject:a,resolve:s,show:!0}))});(0,l.useImperativeHandle)(s,()=>({hide:n,show:n})),(0,l.useEffect)(()=>i,[]);const{file_type:r,filename:o,link:d,show:c}=a;return(0,N.jsxs)(xe,{dialogClassName:"media-preview-modal",onHide:()=>{const{onHide:e,resolve:s}=a;"function"===typeof s&&s(null),i(),"function"===typeof e&&e()},show:c,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{style:{textTransform:"capitalize"},children:[r," ",(0,N.jsx)(ke.A,{defaultMessage:"Attachment",id:"label.attachment.040d2b36"})]})}),(0,N.jsxs)(xe.Body,{className:"p-2",children:["image"===r&&(0,N.jsx)(Ce.S,{className:"image-preview-container mb-3 d-flex justify-content-center",children:(0,N.jsx)(hd.R,{height:400,src:d})}),"video"===r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"video-placeholder "+(null!==a&&void 0!==a&&a.loaded?"d-none":"d-flex"),children:(0,N.jsx)(qt.A,{animation:"border",size:"sm",variant:"secondary"})}),(0,N.jsx)("div",{className:"prev-att-video-container mb-3 "+(null!==a&&void 0!==a&&a.loaded?"d-block":"d-none"),children:(0,N.jsx)(Zg,{expandable:!1,onLoad:()=>t(e=>(0,F.A)((0,F.A)({},e),{},{loaded:!0})),overlay_enabled:!1,src:d,title:"video preview"})})]}),(0,N.jsx)(sp,{file_name:o,file_type:r,link:d})]})]})});ap.displayName="MediaPreviewModal";var tp=e=>{const s=(0,l.useRef)(),{api:a}=(0,n.nm)(),{component:t,component_type:i,preview:r,team:o}=dt(),{challenge_id:d}=t||{},[c,h,u]=(0,ne.CQ)({challenge_files:[],error:null,loading:!0,messages:[],show_challenge_files:!0,show_team_files:!0,team_files:[]}),m=async()=>
2{if(!r)try{const{files:e}=await a.get("/api/teams/files",{team_id:null===o||void 0===o?void 0:o.id});h({team_files:e})}catch({err:err}){throw h({error:err}),err}},g=async e=>{const a=null===s||void 0===s?void 0:s.current;a&&await a.show(e)},p=async()=>{const e=[m()];"challenge"===i&&e.push((async()=>{if(!r)try{const{files:e}=await a.get("/api/challenges/files",{challenge_id:d});h({challenge_files:e})}catch({err:err}){throw h({error:err}),err}})()),h({loading:!0}),await Promise.all(e).catch(e=>h({error:e,loading:!1})),h({loading:!1})},x=e=>h({[`show_${e}_files`]:!(null!==c&&void 0!==c&&c[`show_${e}_files`])});(0,l.useEffect)(()=>(p(),u),[]);const{challenge_files:v,error:f,loading:j,show_challenge_files:_,show_team_files:b,team_files:A}=c;return(0,N.jsxs)(Ce.S,{className:"files-tab d-flex h-100",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({error:null}),show:f,variant:"danger",children:f}),j?(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center flex-1",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm",variant:"primary"})}):(0,N.jsx)(Ce.S,{className:"files-container d-flex flex-column flex-1 py-3",children:null!==v&&void 0!==v&&v.length||null!==A&&void 0!==A&&A.length?(0,N.jsxs)(N.Fragment,{children:[!(null===v||void 0===v||!v.length)&&(0,N.jsxs)(Ce.S,{className:"challenge-files mb-3",children:[(0,N.jsxs)("h6",{className:"m-0 px-3",onClick:()=>x("challenge"),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&x("challenge"),role:"button",tabIndex:0,children:[(0,N.jsx)(ke.A,{defaultMessage:"Challenge files",id:"label.challenge_files.3ed8c67c"}),_?(0,N.jsx)(ze.Vr3,{className:"ms-2"}):(0,N.jsx)(ze.Ucs,{className:"ms-2"})]}),(0,N.jsx)(yl.A,{className:"collapse "+(_?"show":""),children:v.map((e,s)=>(0,N.jsx)(dx,{onPreview:g,team_file:e},s))}),!(null===A||void 0===A||!A.length)&&(0,N.jsx)("div",{className:"files-divider"})]}),!(null===A||void 0===A||!A.length)&&(0,N.jsxs)(Ce.S,{className:"team-files",children:[(0,N.jsxs)("h6",{className:"m-0 px-3",onClick:()=>x("team"),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&x("team"),role:"button",tabIndex:0,children:[(0,N.jsx)(ke.A,{defaultMessage:"Team files",id:"label.team_files.6a967c16"}),b?(0,N.jsx)(ze.Vr3,{className:"ms-2"}):(0,N.jsx)(ze.Ucs,{className:"ms-2"})]}),(0,N.jsx)(Ce.S,{className:"collapse "+(b?"show":""),children:A.map((e,s)=>(0,N.jsx)(dx,{onPreview:g,team_file:e},s))})]})]}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center flex-1 justify-content-center",children:(0,N.jsx)("p",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"No files uploaded yet",id:"label.no_files_uploaded_yet.14f53b40"})})})}),(0,N.jsx)(ap,{ref:s})]})};class ip{constructor(){this.registerCallback=e=>this.callback=e,this.start=e=>this.timerId=setTimeout(this.callback,e),this.cancel=()=>{clearTimeout(this.timerId),this.timerId=null,this.callback=null},this.forceTrigger=async()=>{"function"===typeof this.callback&&this.callback(),this.cancel()},this.timerId=null,this.callback=null}}const lp=(e,s)=>null!=s&&(e||[]).some(e=>(null===e||void 0===e?void 0:e.id)===s);class np extends l.Component{constructor(s){var a;super(s),a=this,this.setMessagesTop=e=>this.messages_top.current=e,this.setMessagesBottom=e=>this.messages_bottom.current=e,this.setMessagesContainer=e=>this.messages_container.current=e,this.setShiftPressed=e=>this.setState({shift_pressed:e}),this.setCoolDown=(e,s)=>this.setState({cooling_down:e},s),this.triggerCoolDown=e=>this.setCoolDown(!0,()=>setTimeout(()=>this.setCoolDown(!1),e)),this.syncPinToBottom=()=>{const{pin_to_bottom:e}=this.state,s=this.isViewerAtBottom();s!==e&&this.setState(e=>{let{has_unseen_messages:a}=e;return{has_unseen_messages:!s&&a,pin_to_bottom:s}})},this.showLatestMessages=()=>this.setState({has_unseen_messages:!1,pin_to_bottom:!0},this.scrollToBottom),this.setFeedbackToast=e=>this.feedback_toast.current=e,this.clearError=()=>this.setState({error:null}),this.isRefreshThrottling=()=>{var e;return null===this||void 0===this||null===(e=this.state)||void 0===e?void 0:e.throttle_refresh},this.beginRefreshThrottle=()=>{this.REFRESH_THROTTLE.cancel();this.REFRESH_THROTTLE.registerCallback(()=>this.setState({throttle_refresh:!1})),this.setState({throttle_refresh:!0},()=>this.REFRESH_THROTTLE.start(this.REFRESH_THROTTLE_DURATION))},this.getChatMembers=()=>{const{chat_audience:e,type:s}=this.props;if("team"===s){return[...Array.isArray(null===e||void 0===e?void 0:e.members)?e.members:[],...Array.isArray(null===e||void 0===e?void 0:e.facilitators)?e.facilitators:[]]}return[]},this.setActiveMention=(e,s)=>this.setState({active_mention:s,is_mentioning:e}),this._typingTimers={},this.handleTypingEvent=e=>{let{agent_name:s,agent_persona_id:a,is_agent:t,team_id:i,user_id:l}=e;if(!this.isOfThisChat(i))return;const n=t?`agent-${a}`:`user-${l}`,{app:r}=this.props;
2if(!t&&l===(null===r||void 0===r?void 0:r.userId))return;const o=t?s||"AI":null;this._typingTimers[n]&&clearTimeout(this._typingTimers[n]),this.setState(e=>e.typing_users.some(e=>e.key===n)?null:{typing_users:[...e.typing_users,{is_agent:t,key:n,name:o}]}),this._typingTimers[n]=setTimeout(()=>{this.removeTypingUser(n)},this.TYPING_EXPIRY_DURATION)},this.removeTypingUser=e=>{this._typingTimers[e]&&(clearTimeout(this._typingTimers[e]),delete this._typingTimers[e]),this.setState(s=>({typing_users:s.typing_users.filter(s=>s.key!==e)}))},this.clearTypingForMessage=e=>{var s,a;const t=(null===e||void 0===e||null===(s=e.message)||void 0===s?void 0:s.agent_persona_id)||(null===e||void 0===e?void 0:e.agent_persona_id),i=(null===e||void 0===e||null===(a=e.message)||void 0===a?void 0:a.user_id)||(null===e||void 0===e?void 0:e.user_id);t?this.removeTypingUser(`agent-${t}`):i&&this.removeTypingUser(`user-${i}`)},this.isOfThisChat=e=>{var s;return null==e||Number(e)===Number(null===(s=this.props.chat_audience)||void 0===s?void 0:s.id)},this.isActivityNote=e=>{var s,a;const t=null!==(s=null===e||void 0===e?void 0:e.body)&&void 0!==s?s:null===e||void 0===e||null===(a=e.message)||void 0===a?void 0:a.body;return"string"===typeof t&&t.includes("data-activity")},this.isOwnMessage=e=>{var s,a,t,i;const{app:l}=this.props;if(this.isActivityNote(e))return!1;const n=null!==(s=null===e||void 0===e?void 0:e.agent_persona_id)&&void 0!==s?s:null===e||void 0===e||null===(a=e.message)||void 0===a?void 0:a.agent_persona_id,r=null!==(t=null===e||void 0===e?void 0:e.user_id)&&void 0!==t?t:null===e||void 0===e||null===(i=e.message)||void 0===i?void 0:i.user_id;return!n&&null!=r&&r===(null===l||void 0===l?void 0:l.userId)},this.addMessage=e=>{if(!this.isOfThisChat(null===e||void 0===e?void 0:e.team_id))return;this.clearTypingForMessage(e);const s=this.isOwnMessage(e);this.setState(a=>{var t,i;if(lp(a.messages,null===e||void 0===e?void 0:e.id))return null;const l=s||a.pin_to_bottom;return{agent_replies_exhausted:!!!(null!==(t=null===e||void 0===e?void 0:e.agent_persona_id)&&void 0!==t?t:null===e||void 0===e||null===(i=e.message)||void 0===i?void 0:i.agent_persona_id)&&a.agent_replies_exhausted,has_unseen_messages:!l,messages:[e,...a.messages||[]],pin_to_bottom:l}},()=>{const{pin_to_bottom:e}=this.state;e&&this.scrollToBottom()})},this.scrollToTop=()=>{const e=this.messages_top.current;e&&e.scrollIntoView()},this.scrollToBottom=()=>{const e=this.messages_bottom.current;e&&e.scrollIntoView()},this.scrollToMessage=e=>{const s=document.querySelector(`chat-message-${e}`);s&&s.scrollIntoView()}
2,this.getScroller=()=>{const e=this.messages_container.current;return[e,null===e||void 0===e?void 0:e.parentElement].find(e=>(null===e||void 0===e?void 0:e.scrollHeight)>(null===e||void 0===e?void 0:e.clientHeight))||null},this.isViewerAtBottom=()=>{const e=this.getScroller();return!e||e.scrollHeight-e.scrollTop-e.clientHeight<this.AT_BOTTOM_DISTANCE},this.getScrollPosition=()=>{const e=this.getScroller();return e?{scroll_height:e.scrollHeight,scroll_top:e.scrollTop,scroller:e}:null},this.restoreScrollPosition=e=>{let{scroll_height:s,scroll_top:a,scroller:t}=e;t.scrollTop=a+t.scrollHeight-s},this.getUsersMentioned=e=>{const{app:s}=this.props,{user:a}=s;if(!new RegExp(`data-denotation-char="${this.MENTION_DENOTATION}"`,"g").test(e))return[];const t=[...e.matchAll(/data-id=\"([^"]*)\"/g)].map(e=>Number.parseInt(null===e||void 0===e?void 0:e[1])).filter(e=>e!==(null===a||void 0===a?void 0:a.id)&&!isNaN(e));return[...new Set(t)]},this.isChatBotMentioned=e=>{var s;const{app:a}=this.props,{chatbot:t}=a,i=`<span class="ql-mention-denotation-char">${this.MENTION_DENOTATION}</span>`;return null===e||void 0===e||null===(s=e.includes)||void 0===s?void 0:s.call(e,`${i}${null===t||void 0===t?void 0:t.username}`)},this.isMessageFlagged=e=>{const{app:s}=this.props,{userId:a}=s,{flags:t}=e||{};return!(null===t||void 0===t||!t.length)&&!!t.find(e=>e.creator_user_id===a)},this.getStepParams=()=>{const{step:e}=this.props,s={};for(const a of["challenge_id","phase","subphase"])null!=(null===e||void 0===e?void 0:e[a])&&(s[a]=e[a]);return s},this.isAgentRepliesExhausted=function(){arguments.length>0&&void 0!==arguments[0]||a.props;return!0===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.state).agent_replies_exhausted},this.sendMessage=async e=>{var s;let{body:a,file_id:t,text:i}=e;try{const{app:e,author:l,chat_audience:n,disabled:r,type:o}=this.props;if(r)return;if(this.setState({sending:!0}),"team"!==o)return;{const{group_member_assignment_id:r,team_member:o}=l,{api:d,getUserOrganization:c}=e;if((null===(s=c())||void 0===s?void 0:s.enable_chat_bot)&&this.isChatBotMentioned(a)){if(!await this.sendChatBotRequest(r,a))return this.setState({sending:!1})}const h=this.getStepParams(),{agent_replies_exhausted:u,team_message_id:m}=await d.post("/api/teams/chat/add",(0,F.A)({body:a,file_id:t,team_id:null===n||void 0===n?void 0:n.id,team_member_id:null===o||void 0===o?void 0:o.id,text:i},h));await this.sendMentionNotifications(m,a),u&&this.setAgentRepliesExhausted()}this.setState({sending:!1})}catch(l){const{err:e,message:s}=l;this.setState({sending:!1}),"muted"===e?this.showChatFeedback({reason:"muted"}):this.showChatFeedback({body:s||e||"Unknown error",reason:"error"})}},this.loadMessages=async s=>{try{var a;s&&this.REFRESH_THROTTLE.forceTrigger();const{latest_message_date:e}=this.state;if(this.isRefreshThrottling())return;this.beginRefreshThrottle();const{app:n,chat_audience:r,type:o}=this.props,{api:d}=n,c=(new Date).toISOString();let h=[];if(this.setState({loading:!0}),"team"===o){const{messages:s}=await d.get(`/api/teams/chat/get/${e||c}`,{team_id:null===r||void 0===r?void 0:r.id});h=s.filter(e=>!e.is_hidden)}if(null!==(a=h)&&void 0!==a&&a.length){var t,i,l;const e=null===(t=h)||void 0===t||null===(i=t[(null===(l=h)||void 0===l?void 0:l.length)-1])||void 0===i?void 0:i.created_at,a=s=>({latest_message_date:e,loading:!1,messages:[...s.messages||[],...h.filter(e=>!lp(s.messages,null===e||void 0===e?void 0:e.id))]});s?this.setState(e=>(0,F.A)((0,F.A)({},a(e)),{},{has_unseen_messages:!1,pin_to_bottom:!0}),this.scrollToBottom):this.setState(e=>(0,F.A)((0,F.A)({},a(e)),{},{older_pages_loaded:e.older_pages_loaded+1}))}else this.setState({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;w(a),this.setState({error:a,loading:!1})}},this.setAgentRepliesExhausted=()=>this.setState({agent_replies_exhausted:!0}),this.sendMentionNotifications=async(e,s)=>{try{const{app:a,author:t,chat_audience:i}=this.props,{group_member_assignment_id:l}=t||{},{api:n}=a;let r=this.getUsersMentioned(s);for(let s of r)s&&n.post("/api/teams/chat/mention/add",{group_member_assignment_id:l,team_id:null===i||void 0===i?void 0:i.id,team_message_id:e,user_mentioned:s})}catch(err){this.showChatFeedback({body:(null===err||void 0===err?void 0:err.message)||(null===err||void 0===err?void 0:err.err)||"Unknown error",reason:"error"})}},this.reportMessage=async e=>{let{comments:s,message_id:a,type:t}=e;try{const{app:e}=this.props,{api:i,userId:l}=e;await i.post("/api/teams/messages/flag",{comments:s,message_id:a,type:t});const n=[...this.state.messages],r=n.indexOf(n.find(e=>e.id===a));n[r].flags.push({creator_user_id:l,type:t}),this.showChatFeedback({reason:"report_success"})}catch(i){this.setState({error:(null===i||void 0===i?void 0:i.err)||i}),this.showChatFeedback({body:(null===i||void 0===i?void 0:i.err)||(null===i||void 0===i?void 0:i.message),reason:"error"})}},this.sendChatBotRequest=async(e,s)=>{try{const{app:a}=this.props,t=a.api;return s=s.replace(/<[^>]*>?/gm,""),await t.post("/api/site/chat-bot",{chat_message:s,group_member_assignment_id:e}),this.showChatFeedback({reason:"lara_success"}),a.userPerformedAchievementEvent(a.events.EVENT_USE_CHAT_BOT),!0}catch({data:OT,err:err}){const{reason:a}=OT||{};return a?this.showChatFeedback({reason:a}):this.showChatFeedback({body:err,reason:"error"}),!1}},this.launchMediaPreview=async e=>{var s;const a=null===this||void 0===this||null===(s=this.media_preview_modal)||void 0===s?void 0:s.current;a&&await a.show(e)},this.generateFeedbackOptions=e=>{const{app:s}=this.props,{chatbot:a}
2=s,{autohide:t,body:i,delay:l,reason:n,title:r,variant:o}=e||{};switch(n){case"lara_banned":return{autohide:!1,body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"You no longer have access to the <strong><em>@lara</em></strong> feature.",description:"",id:"label.you_no_longer_have_access_to_the_l.58530b25",values:{em:e=>(0,N.jsx)("em",{children:e}),strong:e=>(0,N.jsx)("strong",{children:e})}}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"If you feel this is an error, please contact your administrator or Solvably support.",description:"",id:"label.if_you_feel_this_is_an_error_pleas.0dff9fd3"})]}),delay:"",title:"Banned",variant:"danger"};case"lara_success":return{autohide:!0,body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Your message to {chat_bot_name} was successfully submitted.",description:"",id:"label.your_message_to_chat_bot_name_was.1947f539",values:{chat_bot_name:(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.username})}}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Please expect a response in the chat shortly.",description:"",id:"label.please_expect_a_response_in_the_ch.5a7cd534"})]}),delay:5e3,title:"Request Sent",variant:"primary"};case"error":return this.setState({error:i}),{autohide:!1,body:(0,N.jsx)("p",{className:"text-danger",children:i}),delay:"",title:"Error",variant:"danger"};case"muted":return{autohide:!1,body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"You no longer have access to this feature.",description:"",id:"label.you_no_longer_have_access_to_this.91caac5d"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"If you feel this is an error, please contact your administrator or Solvably support.",description:"",id:"label.if_you_feel_this_is_an_error_pleas.0dff9fd3"})]}),delay:"",title:"Muted",variant:"danger"};case"report_success":return{autohide:!0,body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Message was successfully reported.",id:"label.message_was_successfully_reported.4c1a20d8"})}),delay:5e3,title:"Success",variant:"primary"};default:return{autohide:t||!0,body:i||"",delay:l||5e3,title:r||"",variant:o||""}}},this.showChatFeedback=e=>{const s=this.feedback_toast.current;if(!s)return;const a=this.generateFeedbackOptions(e);s.show(a)},this.launchReportModal=e=>{var s;const a=null===this||void 0===this||null===(s=this.report_message_modal)||void 0===s?void 0:s.current;a&&a.show({message_id:e})},this.initSocket=()=>{const{chat_audience:e,type:s}=this.props,a=this;f("chat","ChatService",function(t){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.io=t,t.emit("listen",{context_id:null===e||void 0===e?void 0:e.id,context_type:s}),t.off("listen response").on("listen response",()=>a.loadMessages(!0)),t.off("message").on("message",e=>{let{message:s}=e;a.messages.new_message(s)}),t.off("user-is-typing").on("user-is-typing",e=>{a.handleTypingEvent(e)}),i&&a.loadMessages(!0).catch(e=>{w(e),a.setState({error:e,loading:!1})}),a.setState({loading:!1})})},this.state={active_mention:"",agent_replies_exhausted:!1,cooling_down:!1,error:null,has_unseen_messages:!1,is_mentioning:!1,latest_message_date:null,loading:!1,messages:[],older_pages_loaded:0,page_size:20,pin_to_bottom:!0,sending:!1,shift_pressed:!1,throttle_refresh:!1,typing_users:[]},this.io=null,this.media_preview_modal=(0,l.createRef)(),this.feedback_toast=(0,l.createRef)(),this.messages_top=(0,l.createRef)(),this.messages_bottom=(0,l.createRef)(),this.report_message_modal=(0,l.createRef)(),this.messages_container=(0,l.createRef)(),this.REFRESH_THROTTLE_DURATION=500,this.COOL_DOWN_DURATION=3e3,this.MENTION_DENOTATION="@",this.TYPING_EXPIRY_DURATION=12e3,this.AT_BOTTOM_DISTANCE=80,this.REFRESH_THROTTLE=new ip({repeat:!1}),this.messages={new_message:e=>{for(const s of this.messages.subscribers)s(e)},subscribe:e=>"function"===typeof e&&(this.messages.subscribers.push(e),!0),subscribers:[],unsubscribe:()=>(this.messages.subscribers=[],!0)}}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this),this.messages.subscribe(this.addMessage),this.initSocket()}getSnapshotBeforeUpdate(e,s){const{older_pages_loaded:a,typing_users:t}=this.state,i=t!==s.typing_users&&t.some(e=>{let{key:a}=e;
2return!s.typing_users.some(e=>e.key===a)}),l=a!==s.older_pages_loaded,n=this.isAgentRepliesExhausted()&&!this.isAgentRepliesExhausted(e,s);return i||l||n?{at_bottom:(i||n)&&this.isViewerAtBottom(),position:l?this.getScrollPosition():null}:null}componentDidUpdate(e,s,a){if(!a)return;const{pin_to_bottom:t}=this.state;a.position&&this.restoreScrollPosition(a.position),a.at_bottom&&t&&this.scrollToBottom()}componentWillUnmount(){try{Object.values(this._typingTimers).forEach(clearTimeout),this._typingTimers={},j("ChatService"),this.messages.unsubscribe();const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}catch(e){w(e)}}render(){var e;const{acceptable_file_types:s,author:a,chat_audience:t,children:i,component:l,disableAttachments:n,disableChat:r,disableEmoji:o,disableMentions:d,step:c,type:h}=this.props,u=(null===a||void 0===a||null===(e=a.team_member)||void 0===e?void 0:e.is_muted)||!1,{active_mention:m,cooling_down:g,has_unseen_messages:p,is_mentioning:x,latest_message_date:v,loading:f,messages:j,sending:_,shift_pressed:b,typing_users:A}=this.state;return(0,N.jsxs)(dp,{value:{acceptable_file_types:s,active_mention:m,agent_replies_exhausted:this.isAgentRepliesExhausted(),author:a,chat_audience:t,chat_members:this.getChatMembers(),chat_type:h,clearError:this.clearError,component:l,cool_down_duration:this.COOL_DOWN_DURATION,cooling_down:g,disable_attachments:n,disable_chat:r,disable_emoji:o,disable_mentions:d,generateFeedbackOptions:this.generateFeedbackOptions,has_unseen_messages:p,is_mentioning:x,is_muted:u,isMessageFlagged:this.isMessageFlagged,latest_message_date:v,launchMediaPreview:this.launchMediaPreview,launchReportModal:this.launchReportModal,loading:f,loadMessages:this.loadMessages,mention_denotation:this.MENTION_DENOTATION,messages:j,reportMessage:this.reportMessage,scrollToBottom:this.scrollToBottom,scrollToMessage:this.scrollToMessage,scrollToTop:this.scrollToTop,sending:_,sendMessage:this.sendMessage,setActiveMention:this.setActiveMention,setFeedbackToast:this.setFeedbackToast,setMessagesBottom:this.setMessagesBottom,setMessagesContainer:this.setMessagesContainer,setMessagesTop:this.setMessagesTop,setShiftPressed:this.setShiftPressed,shift_pressed:b,showChatFeedback:this.showChatFeedback,showLatestMessages:this.showLatestMessages,step:c||null,subscribeMessages:this.messages.subscribe,syncPinToBottom:this.syncPinToBottom,triggerCoolDown:this.triggerCoolDown,typing_users:A,unsubscribeMessages:this.messages.unsubscribe},children:[(0,N.jsx)(Ce.S,{className:"chat",children:i}),(0,N.jsx)(ap,{ref:this.media_preview_modal}),(0,N.jsx)(Zp,{ref:this.report_message_modal})]})}}np.defaultProps={acceptable_file_types:["pptx","ppt","docx","doc","pdf","rtf"],load_on_mount:!0};var rp=(0,n.G0)(np);const op=l.createContext({}),dp=op.Provider,cp=op.Consumer,hp=()=>(0,l.useContext)(op),up=e=>{const s=Number.parseInt(null===e||void 0===e?void 0:e.remaining);return Number.isInteger(s)&&s>=0?s:null},mp=e=>{let{agent_name:s,usage:a}=e;const{formatMessage:t}=(0,ja.A)(),i=up(a);if(null===i)return null;const l=(e=>{const s=Number.parseInt(null===e||void 0===e?void 0:e.limit);return Number.isInteger(s)&&s>0?s:null})(a),n=s||t({id:"label.this_ai_teammate.f3405074",defaultMessage:"This AI teammate"}),r=(0,N.jsx)(Qa.A,{id:`agent-replies-${(null===a||void 0===a?void 0:a.team_member_id)||(null===a||void 0===a?void 0:a.agent_persona_id)||"note"}`,children:l?(0,N.jsx)(ke.A,{defaultMessage:"{name} can respond {limit} times in this challenge \u2014 chatting and changes to the challenge both count. Each AI teammate has their own, and it does not reset between steps.",id:"label.name_can_respond_limit_times_in_th.dc2b85e9",values:{limit:l,name:n}}):(0,N.jsx)(ke.A,{defaultMessage:"{name} has a set number of responses for this challenge \u2014 chatting and changes to the challenge both count. Each AI teammate has their own, and it does not reset between steps.",id:"label.name_has_a_set_number_of_responses.8fb612e1",values:{name:n}})});return(0,N.jsx)(Ua.A,{overlay:r,placement:"top",children:(0,N.jsx)("div",{className:"chat-message-agent-note",role:"note",tabIndex:0,children:0===i?(0,N.jsx)(ke.A,{defaultMessage:"No responses left for this challenge",id:"label.no_responses_left_for_this_challen.4a9ba7d6"}):(0,N.jsx)(hc.A,{value:i,one:t({id:"label.1_response_left.a6c0c9c0",defaultMessage:"1 response left"}),other:t({id:"label.count_responses_left.26182508",defaultMessage:"{count} responses left"},{count:i})})})})};var gp=e=>{var s,a,t,i,n,r,o,d,c,h,u,m,g,p;const{message:x,previousMessage:v}=e,{systemUser:f,userId:j}=(0,P.nm)(),_=(0,Pe.W6)(),b=(0,Pe.zy)(),[A,y]=(0,l.useState)(!1),w=(null===x||void 0===x?void 0:x.body)||(null===x||void 0===x||null===(s=x.message)||void 0===s?void 0:s.body)||"",S=(null===x||void 0===x?void 0:x.file)||(null===x||void 0===x||null===(a=x.message)||void 0===a?void 0:a.file)||null,C=ci()(null===x||void 0===x?void 0:x.created_at)||"",M=null!==(t=null===x||void 0===x?void 0:x.user_id
2)&&void 0!==t?t:null===x||void 0===x||null===(i=x.message)||void 0===i?void 0:i.user_id,k=f&&null!=M&&M===f.id,z=w.includes("data-activity"),T=(null===x||void 0===x?void 0:x.agent_persona)||(null===x||void 0===x||null===(n=x.message)||void 0===n?void 0:n.agent_persona);if(z){const e=w.replace(/<[^>]*>/g,"").trim(),s=w.match(/data-phase="(\d+)"/),a=w.match(/data-subphase="(\d+)"/),t=s?s[1]:null,i=a?a[1]:null,l=()=>{if(!t||!i)return;const e=b.pathname.split("/"),s=e.indexOf("assignment");if(-1===s||e.length<s+3)return;const a=e[s+1],l=e[s+2];_.push(`/assignment/${a}/${l}/content/${t}/${i}`)},n=!(!t||!i);let r;if(T&&T.name&&e.startsWith(T.name)){const s=e.substring(T.name.length);r=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("strong",{children:T.name}),(0,N.jsx)("span",{className:"chat-activity-ai-badge",children:"AI"}),s]})}else{var I;const s=(null===x||void 0===x?void 0:x.user)||(null===x||void 0===x||null===(I=x.message)||void 0===I?void 0:I.user),a=null===s||void 0===s?void 0:s.fullname;if(a&&e.startsWith(a)){const s=e.substring(a.length);r=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("strong",{children:a}),s]})}else r=e}return(0,N.jsx)(Ce.S,{className:oa()("chat-message chat-message-activity",{"chat-activity-clickable":n}),onClick:n?l:void 0,children:(0,N.jsx)("span",{className:"chat-activity-text",children:r})})}const E=T?{id:`agent-${T.id}`,avatar:T.avatar_path?{location:T.avatar_path}:null,fullname:T.name,is_agent:!0}:null,F=k?f:E||(null===x||void 0===x?void 0:x.user)||(null===x||void 0===x||null===(r=x.message)||void 0===r?void 0:r.user)||null,R=!!E&&!k,D=!k&&!R&&null!=M&&M===j,B=(null===x||void 0===x?void 0:x.agent_usage)||(null===x||void 0===x||null===(o=x.message)||void 0===o?void 0:o.agent_usage)||null,L=R&&null!==up(B);const O=(null!==(d=null!==(c=null===v||void 0===v?void 0:v.body)&&void 0!==c?c:null===v||void 0===v||null===(h=v.message)||void 0===h?void 0:h.body)&&void 0!==d?d:"").includes("data-activity"),H=null!==(u=null===v||void 0===v?void 0:v.user_id)&&void 0!==u?u:null===v||void 0===v||null===(m=v.message)||void 0===m?void 0:m.user_id,U=(null===v||void 0===v?void 0:v.agent_persona)||(null===v||void 0===v||null===(g=v.message)||void 0===g?void 0:g.agent_persona),Q=!!v&&!z&&!O&&(T&&U?T.id===U.id:null!=M&&null!=H&&!T&&!U&&M===H),V=oa()("chat-message",{"chat-message-activity":z,"chat-message-agent":R,"chat-message-grouped":Q,"chat-message-other":!D,"chat-message-own":D,"chat-message-with-note":L,"system-message":k}),G=!Q;return(0,N.jsxs)(Ce.S,{className:V,id:`chat-message-${null===x||void 0===x?void 0:x.id}`,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[!D&&(0,N.jsx)(Ce.S,{className:"chat-message-avatar",children:G&&F?(0,N.jsx)(Ya,{showOnline:!R&&!k,size:28,user:F}):(0,N.jsx)(Ce.S,{style:{width:28}})}),(0,N.jsxs)(Ce.S,{className:"chat-message-bubble-wrapper",children:[G&&(0,N.jsxs)(Ce.S,{className:"chat-message-metadata",children:[(0,N.jsx)("span",{className:"chat-message-author",children:(null===F||void 0===F?void 0:F.fullname)||""}),R&&(0,N.jsx)(bo.A,{bg:"",style:{backgroundColor:(null===T||void 0===T||null===(p=T.category)||void 0===p?void 0:p.color)||"#6c757d",fontSize:"0.55rem",fontWeight:600,lineHeight:1.2,padding:"1px 4px",verticalAlign:"middle"},children:"AI"}),(0,N.jsx)("span",{className:"chat-message-timestamp",children:(()=>{const e=ci()().diff(C,"hours")>24,s=C.day()===ci()().day();return!e&&s?(0,N.jsx)(Gh.ib,{value:C}):(0,N.jsx)(Gh.XU,{day:"numeric",month:"numeric",value:C})})()}),!k&&A&&(0,N.jsx)(Kp,{message:x})]}),(0,N.jsxs)(Ce.S,{className:"chat-message-bubble",children:[(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:w}}),S&&(0,N.jsx)(Gp,{file:S})]}),L&&(0,N.jsx)(mp,{agent_name:null===T||void 0===T?void 0:T.name,usage:B})]})]})};const pp=l.createContext({}),xp=pp.Provider,vp=pp.Consumer,fp=()=>(0,l.useContext)(pp);var jp=t(76918),_p=t.n(jp),bp=t(44392),Ap=t(42475),yp=t.n(Ap);jp.Quill.register("modules/mentions",bp.A),jp.Quill.register("modules/magicUrl",yp());const wp=jp.Quill.import("formats/link");jp.Quill.register(class extends wp{static create(e){const s=super.create(e);return(e=this.sanitize(e)).startsWith("https")||e.startsWith("http")||(e=`https://${e}`),s.setAttribute("href",e),s}});class Np extends l.Component{constructor(s){var a;super(s),a=this,this.getFilteredMentions=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{app:t,chat:i}=a.props,{userId:l}=t,{chat_members:n}=i,{active_mention:r}=a.state;let o=(0,T.clone)(n);o=o.filter(e=>{var s;return(null===e||void 0===e||null===(s=e.user)||void 0===s?void 0:s.id)!==l});let d=o.filter(s=>{var a;let{user:t}=s;if(!t||null===t||void 0===t||!t.fullname)return!1;if(!e&&(null===r||void 0===r||!r.length))return!0;const i=t.fullname.toLowerCase(),l=e.toLowerCase(),n=(null===r||void 0===r||null===(a=r.toLowerCase)||void 0===a?void 0:a.call(r))||"";return!!i.includes(l||n.substring(1,null===n||void 0===n?void 0:n.length))});var c;(d=d.map(e=>{var s,a;return{id:null===e||void 0===e||null===(s=e.user)||void 0===s?void 0:s.id,value:null===e||void 0===e||null===(a=e.user)||void 0===a?void 0:a.fullname}}),s)&&(null!==(c=d)&&void 0!==c&&c.length?a.setActiveMention(!0,e):a.setActiveMention(!1,""));return d},this.handleSource=(e,s)=>{s(this.getFilteredMentions(e,!0),e)},this.handleMentionSelect=async(e,s)=>{const a=this.quill_ref.current.getEditor();a&&(await s(e,!0),await this.formik_options.current.setFieldValue("text_body",a.getText()),this.setState({active_mention:"",is_mentioning:!1,was_mentioning:!0}))},this.handleEnter=()=>{},this.handleSubmit=async()=>{const s=this.formik_options.current;if(!s)return;const{app:a,chat:t}=this.props,{locale:i}=a,{cool_down_duration:l,cooling_down:n,disable_chat:r,sendMessage:o,triggerCoolDown:d}=t,{setFieldError:c,setFieldTouched:h,setFieldValue:u,values:m}=s,g=(0,Re.by)({locale:i,scope:"message.add_message"});try{const{body:e,text_body:s}=m;if(n||r||null===s||void 0===s||!s.length)return;await g.validate({body:e,text_body:s}),d(l),o({body:e,text:s}),u("body",""),h("body",!1),u("text_body",""),h("text_body",!1),c("body",null)}catch(e){c("body",null===e||void 0===e?void 0:e.message)}},this.handleKeyDown=async e=>{var s,a,t,i;let{key:l}=e;const{chat:n}=this.props,{setShiftPressed:r}=n,o=null===(s=this.quill_ref)||void 0===s||null===(a=s.current)||void 0===a||null===(t=a.getEditor)||void 0===t?void 0:t.call(a);(null===(i=this.formik_options)||void 0===i?void 0:i.current)&&o&&"Shift"===l&&r(!0)},this.handleKeyUp=async e=>{var s,a,t,i;let{key:l}=e;const{is_mentioning:n,was_mentioning:r}=this.state,{chat:o}=this.props,{setShiftPressed:d,shift_pressed:c}=o,h=null===(s=this.quill_ref)||void 0===s||null===(a=s.current)||void 0===a||null===(t=a.getEditor)||void 0===t?void 0:t.call(a),u=null===(i=this.formik_options)||void 0===i?void 0:i.current;u&&h&&("Shift"===l&&d(!1),"Enter"!==l||c||(n||r||this.handleSubmit(),r&&this.setState({was_mentioning:!1})),["Enter","Shift"].includes(l)||await u.setFieldValue("text_body",h.getText()||""))},this.setActiveMention=(e,s)=>this.setState({active_mention:s,is_mentioning:e}),this.insertMention=()=>{var e,s,a;const t=null===this||void 0===this||null===(e=this.quill_ref)||void 0===e?void 0:e.current,i=null===t||void 0===t||null===(s=t.getEditor)||void 0===s?void 0:s.call(t),l=null===i||void 0===i||null===(a=i.getModule)||void 0===a?void 0:a.call(i,"mentions");
2if(!t||!i||!l)return;const{chat:n}=this.props,{mention_denotation:r}=n;l.openMenu(r)},this.insertEmoji=e=>{var s,a,t,i,l;const n=null===(s=this.quill_ref)||void 0===s||null===(a=s.current)||void 0===a||null===(t=a.getEditor)||void 0===t?void 0:t.call(a);if(!n||!e)return;const r=n.getSelection(!0)||{index:Math.max(0,n.getLength()-1)};n.insertText(r.index,e,"user"),n.setSelection(r.index+e.length,0),null===(i=this.formik_options)||void 0===i||null===(l=i.current)||void 0===l||l.setFieldValue("text_body",n.getText()||"")},this.state={active_mention:"",is_mentioning:!1,was_mentioning:!1},this.formik_options=(0,l.createRef)(),this.quill_ref=(0,l.createRef)();const{chat:t}=s,{mention_denotation:i}=t;this.FORMATS=["link","mention"],this.MODULES={keyboard:{bindings:{enter:{handler:this.handleEnter,key:13},tab:!1}},magicUrl:{defaultProtocol:"https:",globalRegularExpression:/((https?):\/\/)?(www.)?[-a-zA-Z0-9@:%_\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g,normalizeUrlOptions:{normalizeProtocol:!0},urlRegularExpression:/((https?):\/\/)?(www.)?[-a-zA-Z0-9@:%_\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g},mentions:{allowedChars:/^[A-Za-z0-9_\s\xc5\xc4\xd6\xe5\xe4\xf6]*$/,mentionContainerClass:"ql-mention-list-container chat-mention-container",mentionDenotationChars:[i],onClose:()=>this.setState(e=>({active_mention:"",is_mentioning:!1,was_mentioning:e.is_mentioning})),onSelect:this.handleMentionSelect,positioningStrategy:"fixed",source:this.handleSource}}}componentWillUnmount(){const e=document.querySelector(".chat-mention-container");e&&e.remove()}render(){const{app:e,chat:s,intl:a}=this.props,{formatMessage:t}=a,{locale:i}=e,{disable_attachments:l,disable_emoji:n,disable_mentions:r}=s;return(0,N.jsx)(Mp,{value:{handleSubmit:this.handleSubmit,insertEmoji:this.insertEmoji,insertMention:this.insertMention},children:(0,N.jsx)(Ce.S,{className:"chat-input",children:(0,N.jsx)(ds.l1,{onSubmit:this.handleSubmit,validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:i,scope:"message.add_message"}),initialValues:{body:"",text_body:""},children:e=>{var s;this.formik_options.current=e;const{errors:a,handleChange:i,handleSubmit:o,isValid:d,touched:c,values:h}=e;return(0,N.jsxs)(_e.A,{className:"d-flex flex-column flex-fill",onSubmit:o,style:{wordBreak:"break-word"},children:[(0,N.jsxs)(os,{className:"mb-0",children:[(0,N.jsx)(ds.D0,{autocomplete:"off",className:"quill-parent",isInvalid:c.body&&a.body,isValid:c.body&&!a.body,name:"body",onChange:i,placeholder:"Send a message...",value:h.body,children:e=>{let{field:s}=e;return(0,N.jsx)(_p(),{formats:this.FORMATS,id:"chat-quill",modules:this.MODULES,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,ref:this.quill_ref,style:{flex:1},theme:null,value:s.value,"aria-label":t({id:"label.send_a_message.56e541ad",defaultMessage:"Send a message"}),onChange:(e,a,t,i)=>{var l,n,r;s.onChange(s.name)(e),null===(l=this.formik_options)||void 0===l||null===(n=l.current)||void 0===n||n.setFieldValue("text_body",(null===i||void 0===i||null===(r=i.getText)||void 0===r?void 0:r.call(i))||"")},placeholder:t({id:"label.write_a_message.c851cf13",defaultMessage:"Write a message..."})})}}),(0,N.jsx)(ds.D0,{name:"text_body",onChange:i,type:"hidden",value:h.text_body}),a.body&&c.body&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",style:{bottom:0,display:"block",float:"left",left:5,position:"absolute"},children:a.body})]}),(0,N.jsxs)(os,{className:"d-flex justify-content-between mb-0 flex-1 p-3",id:"team-chat-toolbar",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[!r&&(0,N.jsx)(zp,{}),!n&&(0,N.jsx)(Ip,{}),!l&&(0,N.jsx)(Op,{})]}),(0,N.jsx)(Hp,{canSend:d&&!(null===h||void 0===h||null===(s=h.text_body)||void 0===s||!s.length)})]})]})}})})})}}var Sp=(0,n.G0)((0,Ke.Ay)((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}
2render(){return(0,N.jsx)(cp,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{chat:s,ref:e=>this.comp=e}))})}}return s})((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(vp,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{chat_dropzone:s,ref:e=>this.comp=e}))})}}return s})(Np))));const Cp=l.createContext({}),Mp=Cp.Provider,kp=(Cp.Consumer,()=>(0,l.useContext)(Cp));var zp=e=>{const{styles:s}=(0,n.nm)(),{formatMessage:a}=(0,ja.A)(),{insertMention:t}=kp();return(0,N.jsx)(Wp,{className:"ql-insertMention",onClick:t,tooltip_placement:"left",variant:"link","aria-label":a({id:"label.insert_a_mention.64ff2498",defaultMessage:"Insert a mention"}),children:(0,N.jsx)(ze.T35,{fill:null===s||void 0===s?void 0:s["gray-500"],size:20})})};const Tp=(0,l.lazy)(()=>t.e(766).then(t.bind(t,69766)));var Ip=()=>{const{styles:e}=(0,n.nm)(),{formatMessage:s}=(0,ja.A)(),{insertEmoji:a}=kp(),[t,i]=(0,l.useState)(!1),r=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!t)return;const e=e=>{r.current&&!r.current.contains(e.target)&&i(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[t]);return(0,N.jsxs)("div",{className:"position-relative",ref:r,children:[t&&(0,N.jsx)("div",{className:"chat-emoji-picker",style:{bottom:"100%",left:0,position:"absolute",zIndex:1050},children:(0,N.jsx)(l.Suspense,{fallback:null,children:(0,N.jsx)(Tp,{emojiStyle:"native",lazyLoadEmojis:!0,onEmojiClick:e=>{null!==e&&void 0!==e&&e.emoji&&a(e.emoji),i(!1)},previewConfig:{showPreview:!1}})})}),(0,N.jsx)(Wp,{className:"ql-insertEmoji",onClick:()=>i(e=>!e),tooltip_placement:"left",variant:"link","aria-label":s({id:"label.insert_an_emoji.e6c15996",defaultMessage:"Insert an emoji"}),children:(0,N.jsx)(ze.kqk,{fill:null===e||void 0===e?void 0:e["gray-500"],size:20})})]})};const Ep=["image/gif","image/jpeg","image/png"],Fp=["video/mp4","video/ogg","video/webm","video/mpeg"],Rp=["image/gif","image/jpeg","image/png","video/mp4","video/ogg","video/mpeg","application/pdf","application/msword","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/vnd.adobe.photoshop","application/x-photoshop","application/photoshop","application/psd","image/psd"];var Dp=s=>{let{children:a,loading:t}=s;const i=(0,n.nm)(),r=(0,ja.A)(),{challenge:o}=Ra(),{chat:d}=hp(),{formatMessage:c}=r,h=c({id:"label.posted_a_file.379e4ecb",defaultMessage:"Posted a file."}),[u,m]=(0,l.useState)(null),[g,p]=(0,l.useState)(!1),[x,v]=(0,l.useState)(null),[f,j]=(0,l.useState)(null),[_,b]=(0,l.useState)(""),[A,y]=(0,l.useState)(""),[S,C]=(0,l.useState)(""),[M,k]=(0,l.useState)(""),[z,T]=(0,l.useState)(""),[I,E]=(0,l.useState)(null),[R,D]=(0,l.useState)(!1),B=(0,l.useRef)(),P=(0,l.useRef)(),L=()=>{j(null),y(""),C(""),k(""),b(null),m(null)},O=e=>("string"!==typeof e&&(e=""),e=e.toLowerCase(),-1!==Ep.indexOf(e)?"image":-1!==Fp.indexOf(e)?"video":-1!==Rp.indexOf(e)&&"file"),H=async s=>{try{const e=null===B||void 0===B?void 0:B.current;if(!e)return;await e.show({step:s})}catch(e){const{showChatFeedback:a}=d;w(e),a({body:(null===e||void 0===e?void 0:e.message)||e,reason:"error"})}};return(0,N.jsxs)(xp,{value:{file_ext:M,file_message:S,file_name:A,file_pending:f,getFileType:O,handleChangeFileMetadata:e=>{void 0!==e.file_name&&y(e.file_name),void 0!==e.file_message&&C(e.file_message),void 0!==e.file_ext&&k(e.file_ext),void 0!==e.file_type&&b(e.file_type),void 0!==e.file_pending&&j(e.file_pending),void 0!==e.job_id&&m(e.job_id),void 0!==e.uploading&&p(e.uploading),void 0!==e.error&&E(e.error),void 0!==e.external_link&&T(e.external_link),void 0!==e.shift_pressed&&D(e.shift_pressed)},handleFileUpload:async()=>{const{showChatFeedback:e}=d;try{const{api:e}=i,{chat_audience:s,chat_type:a}=d,t=(0,me.A)(),l=A.length?`${A}.${M}`:null===f||void 0===f?void 0:f.name,n=null===f||void 0===f?void 0:f.type;p(!0),m(t);let r=new Promise(e=>e({file:null}));if("team"===a)r=e.file("/api/teams/upload",{job_id:t,mime_type:n,team_id:null===s||void 0===s?void 0:s.id},f,l);const{file:o}=await r;
2p(!1),v(o),((e,s)=>{const{sendMessage:a}=d,t=null!==s&&void 0!==s&&s.length?s:h;a({body:`<p>${t}</p>`,file_id:e,text:t})})(null===o||void 0===o?void 0:o.id,S),L()}catch({err:err}){w(err),p(!1),L(),e({body:err,reason:"error"})}},launchFileUploadModal:H,setFileData:e=>{let{file_ext:s,file_pending:a,file_type:t}=e;b(t),k(s),j(a)}},children:[(0,N.jsx)(ym.Ay,{multiple:!1,onDrop:e=>{let[s]=e;const{showChatFeedback:a}=d||{},{name:t,type:i}=s||{};if(!s)return p(!1),void a({body:r.formatMessage({id:"label.no_file_provided.78015634",defaultMessage:"No file provided."}),reason:"error"});const l=t.split(".").pop(),n=O(i);if(!n)return p(!1),void a({body:(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Invalid file type detected.",description:"",id:"label.invalid_file_type_detected.0b5c2cd2"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Acceptable file types are: DOC, DOCX, JFIF, JPE, JPEG, JPG, M4V, MP4, MPEG, MPG, PDF, PNG, PPT, PPTX, and WEBM.",description:"",id:"label.acceptable_file_types_are_doc_docx.6bd873c1"})]}),reason:"error"});b(n),k(l),j(s),H(1)},children:e=>{let{getInputProps:s,getRootProps:i,isDragActive:l}=e;return(0,N.jsxs)("div",(0,F.A)((0,F.A)({},i({onClick:e=>e.stopPropagation()})),{},{className:`chat-dropzone position-relative d-flex flex-column ${t?"loading":""} ${l?"drag-active":""}`,children:[a,!g&&(0,N.jsx)("input",(0,F.A)((0,F.A)({},s()),{},{hidden:!0})),(0,N.jsx)(Ce.S,{className:"dropzone-overlay "+(g||l?"d-flex flex-column justify-content-center align-items-center":"d-none"),children:g?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("div",{className:"chat-dropzone-progress",children:(0,N.jsx)(Ma,{job_id:u,message:!0,striped:!0,submitting:!0})})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.HVe,{className:"icon mb-2",size:50}),(0,N.jsx)("span",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Drop File Here to Share",id:"label.drop_file_here_to_share.b13834e6"})})]})})]}))}}),(0,N.jsx)(Pp,{ref:B}),(0,N.jsx)(je,{ref:P})]})};const Bp=(0,l.forwardRef)((s,a)=>{const{onHide:t}=s,{formatMessage:i}=(0,ja.A)(),{getFileType:n,handleChangeFileMetadata:r,handleFileUpload:o,setFileData:d}=fp(),[c,h,u]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1,step:0}),m=e=>new Promise((s,a)=>{h(t=>(0,F.A)((0,F.A)({},t),{},{reject:a,resolve:s,show:!0,step:(null===e||void 0===e?void 0:e.step)||0}))}),g=()=>{c.resolve(null),u(),"function"===typeof t&&t()},p=e=>{c.reject(e),g()};(0,l.useImperativeHandle)(a,()=>({hide:g,show:m})),(0,l.useEffect)(()=>u,[]);const{error:x,show:v,step:f}=c;return(0,N.jsxs)(xe,{backdrop:"static",onHide:g,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{children:[0===f&&(0,N.jsx)(ke.A,{defaultMessage:"Upload file",id:"label.upload_file.d99bcd78"}),1===f&&(0,N.jsx)(ke.A,{defaultMessage:"Message details",id:"label.message_details.1c831310"})]})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),show:x,variant:"danger",children:x}),0===f&&(0,N.jsx)(fa,{onSubmit:e=>{const{name:s,type:a}=e||{};if(!e)return p(i({id:"label.no_file_provided.78015634",defaultMessage:"No file provided."}));const t=s.split(".").pop(),l=n(a);if(!l)return p((0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Invalid file type detected.",id:"label.invalid_file_type_detected.0b5c2cd2"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Acceptable file types are: DOC, DOCX, JFIF, JPE, JPEG, JPG, M4V, MP4, MPEG, MPG, PDF, PNG, PPT, PPTX, and WEBM.",id:"label.acceptable_file_types_are_doc_docx.6bd873c1"})]}));d({file_ext:t,file_pending:e,file_type:l}),(e=>{h(s=>(0,F.A)((0,F.A)({},s),{},{step:e}))})(1)}}),1===f&&(0,N.jsx)(Lp,{onSubmit:async s=>{try{const{file_message:e,file_name:a}=s;r({file_message:e,file_name:a}),o(),(e=>{c.resolve(e),g()})(null)}catch(e){p(e)}}})]})]})});Bp.displayName="FileUploadModal";var Pp=Bp;var Lp=e=>{const{onSubmit:s}=e,a=(0,l.useRef)(),{file_ext:t}=fp(),{formatMessage:i}=(0,ja.A)();return(0,N.jsx)(ds.l1,{onSubmit:s,initialValues:{file_message:"",file_name:""},children:e=>{a.current=e;const{handleChange:s,handleSubmit:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:l,children:[(0,N.jsx)(os,{children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{name:"file_name",onChange:s,placeholder:"File Name (optional)",type:"text",value:n.file_name}),(0,N.jsx)(Ei.A.Text,{id:"inputGroupPrepend",children:`.${t}`})]})}
2),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Control,{as:"textarea",name:"file_message",onChange:s,rows:"3",value:n.file_message,placeholder:i({id:"label.message_optional.0a411b50",defaultMessage:"Message (optional)"})})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})}})};var Op=e=>{const{styles:s}=(0,n.nm)(),{launchFileUploadModal:a}=fp(),{formatMessage:t}=(0,ja.A)();return(0,N.jsx)(Wp,{className:"ql-attachMedia",onClick:()=>a(0),tooltip_placement:"left",variant:"link","aria-label":t({id:"label.attach_a_file.21298c62",defaultMessage:"Attach a file"}),children:(0,N.jsx)(ze.EHs,{fill:null===s||void 0===s?void 0:s["gray-500"],size:20})})};var Hp=e=>{const{canSend:s}=e,{cooling_down:a,disable_chat:t,sending:i}=hp(),{handleSubmit:l}=kp(),{formatMessage:n}=(0,ja.A)();return(0,N.jsxs)(Wp,{className:"ql-sendMessage",disabled:!s||a||t,loadable:!0,loading:i,onClick:l,tooltip_placement:"left",type:"submit","aria-label":n({id:"label.send_message.93a26b1e",defaultMessage:"Send message"}),children:[(0,N.jsx)(ke.A,{defaultMessage:"Send",id:"label.send.f6f4688f"}),(0,N.jsx)(ze.uCC,{className:"ms-1"})]})},Up=Sp;const Qp=()=>{const{has_unseen_messages:e,showLatestMessages:s}=hp();return e?(0,N.jsxs)(ve.A,{className:"chat-new-messages-button d-inline-flex align-items-center rounded-pill shadow-sm text-nowrap",onClick:s,size:"sm",variant:"primary",children:[(0,N.jsx)(ze.$TP,{"aria-hidden":"true",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"New messages",id:"label.new_messages.ef5df7e6"})]}):null};var Vp=e=>{const s=(0,l.useRef)(),a=(0,l.useRef)(),{loading:t,messages:i,setMessagesContainer:n,syncPinToBottom:r}=hp();return(0,l.useEffect)(()=>{(null===s||void 0===s?void 0:s.current)&&n(s.current)},[]),(0,N.jsxs)(Ce.S,{className:"chat-messages-container-outer position-relative",onScroll:r,children:[(0,N.jsx)("div",{className:"chat-messages-container position-relative d-flex flex-column "+(null!==i&&void 0!==i&&i.length?"":"h-100"),id:"chatMessagesContainer",onScroll:r,ref:s,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(Jp,{}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center h-100",style:{flex:1},children:t?(0,N.jsx)(qt.A,{animation:"border",size:"sm",variant:"primary"}):(0,N.jsx)("span",{className:"small text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No messages yet",id:"label.no_messages_yet.f42e0f66"})})})}),(0,N.jsx)(Qp,{}),(0,N.jsx)(ex,{ref:a})]})};var Gp=e=>{const{styles:s}=(0,P.nm)(),{launchMediaPreview:a}=hp(),{file:t,onImageLoaded:i}=e,{ext:l,filename:n,location:r,type:o}=t||{},d=e=>{(e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()})(e),a({file_type:o,filename:n,link:r})};return(0,N.jsx)(N.Fragment,{children:!(null===r||void 0===r||!r.length)&&(0,N.jsxs)("div",{className:"chat-message-file-preview",style:{marginTop:"10px"},children:["image"===o&&(0,N.jsxs)(Ce.S,{className:"image-preview",onClick:d,role:"button",children:[(0,N.jsx)(hd.R,{height:200,onImageLoaded:i,rounded:!0,src:r}),(0,N.jsx)(Me.NX,{className:"image-download-button text-decoration-none",filename:n,icon_color:null===s||void 0===s?void 0:s.white,type:o,url:r,variant:"link"})]}),"file"===o&&(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex justify-content-between p-3",children:[(0,N.jsx)(Ce.S,{className:"preview-left d-flex align-items-center",children:(0,N.jsx)(zm,{ext:l,filename:n,fill:s.secondary,size:32,type:o,withLabel:!0})}),(0,N.jsx)(Ce.S,{className:"preview-right d-flex align-items-center",children:(0,N.jsx)(Me.NX,{className:"image-download-button text-decoration-none",filename:n,icon_color:null===s||void 0===s?void 0:s.secondary,type:o,url:r,variant:"link"})})]})}),"video"===o&&(0,N.jsx)(Ge.A,{className:"video-preview",onClick:d,role:"button",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex justify-content-between p-3",children:[(0,N.jsxs)(Ce.S,{className:"preview-left d-flex align-items-center",children:[(0,N.jsx)(ze.HiP,{className:"me-2",color:null===s||void 0===s?void 0:s.primary,size:32}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Video file",id:"label.video_file.74d5e1a5"})})]}),(0,N.jsx)(Ce.S,{className:"preview-right d-flex align-items-center",children:(0,N.jsx)(Me.NX,{className:"image-download-button text-decoration-none",filename:n,icon_color:null===s||void 0===s?void 0:s.secondary,type:o,url:r,variant:"link"})})]})})]})})};var Wp=e=>{const{is_muted:s}=dt(),{children:a,loadable:t,tooltip_placement:i,trigger:l}=e,n=t?Me.p0:ve.A;return(0,N.jsx)(N.Fragment,{children:s?(0,N.jsx)(Ua.A,{placement:i,trigger:l||["hover","click","focus"],overlay:(0,N.jsxs)(Qa.A,{id:"tooltip-ch
2at-muted",children:[(0,N.jsx)("p",{className:"text-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"You no longer have access to this feature.",id:"label.you_no_longer_have_access_to_this.91caac5d"})}),(0,N.jsx)("p",{className:"small text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"If you feel this is an error, please contact your administrator or Solvably support.",id:"label.if_you_feel_this_is_an_error_pleas.0dff9fd3"})})]}),children:(0,N.jsxs)(n,(0,F.A)((0,F.A)({},e),{},{className:`${e.className||""} chat-mutable-button`,onClick:Function(),style:{cursor:"not-allowed"},children:[(0,N.jsx)("div",{className:"chat-mutable-button-overlay",role:"button",tabIndex:0,onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation())}}),a]}))}):(0,N.jsx)(n,(0,F.A)((0,F.A)({},e),{},{className:`${e.className||""} chat-mutable-button`,children:a}))})};var Kp=e=>{var s;const{message:a}=e,{isMessageFlagged:t,launchReportModal:i}=hp(),{styles:l,userId:r}=(0,n.nm)(),o=t(a),d=(null===a||void 0===a||null===(s=a.message)||void 0===s?void 0:s.user_id)===r||o;return(0,N.jsx)(ve.A,{className:"chat-report-button p-0 d-flex align-items-center",disabled:d,onClick:()=>i(null===a||void 0===a?void 0:a.id),variant:"link",children:o?(0,N.jsx)(ze.O5k,{color:null===l||void 0===l?void 0:l.primary,size:14,style:{lineHeight:1}}):(0,N.jsx)(ze.eGi,{size:14,style:{lineHeight:1}})})};const Yp=()=>{const{typing_users:e}=hp();return null!==e&&void 0!==e&&e.length?(0,N.jsxs)(Ce.S,{className:"chat-typing-indicator",children:[(0,N.jsx)(Ce.S,{className:"chat-typing-bubble",children:(0,N.jsxs)(Ce.S,{className:"chat-typing-dots",children:[(0,N.jsx)("span",{}),(0,N.jsx)("span",{}),(0,N.jsx)("span",{})]})}),(0,N.jsxs)("span",{className:"chat-typing-label",children:[e.map(e=>e.name||"Someone").join(", "),1===e.length?" is typing...":" are typing..."]})]}):null};var qp=t(48242);var Jp=e=>{const{loading:s,loadMessages:a,messages:t,scrollToBottom:i,setMessagesBottom:n,setMessagesTop:r}=hp(),o=(0,l.useRef)(),d=(0,l.useRef)(),c=(0,qp.KP)(o,{once:!1}),h=(0,qp.KP)(d,{once:!1});(0,l.useEffect)(()=>{!c||h||s||a()},[c]),(0,l.useEffect)(()=>{o.current&&r(o.current),d.current&&(n(d.current),i())},[o,d]);const u=[...t].reverse();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{id:"messagesTop",ref:o,style:{minHeight:1}}),s&&(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center p-3",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm",variant:"secondary"})}),u.map((e,s)=>(0,N.jsx)(gp,{message:e,previousMessage:u[s-1]},s)),(0,N.jsx)(Yp,{}),(0,N.jsx)("div",{id:"messagesBottom",ref:d,style:{minHeight:1}})]})};const Xp=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{locale:t}=(0,P.nm)(),{reportMessage:i}=hp(),{formatMessage:n}=(0,ja.A)(),[r,o,d]=(0,ne.CQ)({error:null,loading:!1,message_id:null,show:!1}),c=e=>{o(s=>(0,F.A)((0,F.A)({},s),{},{message_id:null===e||void 0===e?void 0:e.message_id,show:!0}))},h=()=>{d(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:h,show:c})),(0,l.useEffect)(()=>d,[]);const{error:u,loading:m,show:g}=r;return(0,N.jsxs)(xe,{onHide:h,show:g,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Report message",id:"label.report_message.0a1e3c52"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o(e=>(0,F.A)((0,F.A)({},e),{},{error:null})),show:u,variant:"danger",children:u}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{try{o(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0}));const{message_id:s}=r,{comments:a,type:t}=e;await i({comments:a,message_id:s,type:t}),h()}catch({err:err}){o(s=>(0,F.A)((0,F.A)({},s),{},{error:err,loading:!1}))}},validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:t,scope:"message.flag_message"}),initialValues:{comments:"",status:0,type:null},children:e=>{let{handleChange:s,handleSubmit:a,isValid:t,values:i}=e;return(0,N.jsxs)(_e.A,{onSubmit:a,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"type",children:(0,N.jsx)(ke.A,{defaultMessage:"Reason",id:"label.reason.f81ab834"})}),(0,N.jsxs)(_e.A.Select,{id:"type",name:"type",onChange:s,value:i.type,children:[(0,N.jsx)("option",{disabled:!0,selected:!i.type,value:null,children:n({id:"label.select_reason.e062b972",defaultMessage:"Select reason"})}),(0,N.jsx)("option",{selected:0==i.type,value:0,children:n({id:"label.inappropriate_content.940bd85c",defaultMessage:"Inappropriate content"})}),(0,N.jsx)("option",{selected:1==i.type,value:1,children:n({id:"label.spam_or_duplicate_comments.31442e34",defaultMessage:"Spam or duplicate comments"})}),(0,N.jsx)("option",{selected:2==i.type,value:2,children:n({id:"label.other.f97e9da0",defaultMessage:"Other"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"comments",children:(0,N.jsx)(ke.A,{defaultMessage:"Comments",id:"label.comments.355f79f2"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",id:"comments",name:"comments",onChange:s,rows:3,value:i.comments})]}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(Me.p0,{disabled:!t,loading:m,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})}})]})]})});Xp.displayName="ChatReportMessageModal";var Zp=Xp;const $p=(0,l.forwardRef)((e,s)=>{const{clearError:a,setFeedbackToast:t}=hp(),[i,n,r]=(0,ne.CQ)({autohide:!0,body:"",delay:"",show:!1,title:"",variant:""}),o=e=>{let{autohide:s,body:a,delay:t,title:i,variant:l}=e;n({autohide:s,body:a,delay:t,show:!0,title:i,variant:l})},d=()=>{a(),r()};(0,l.useEffect)(()=>(t(null===s||void 0===s?void 0:s.current),r),[]),(0,l.useImperativeHandle)(s,()=>({hide:d,show:o}));const{autohide:c,body:h,delay:u,show:m,title:g,variant:p}=i;return(0,N.jsxs)(la.A,{autohide:c,className:`chat-toast ${p||""}`,delay:u,onClose:d,show:m,children:[(0,N.jsx)(la.A.Header,{className:"d-flex justify-content-between",children:(0,N.jsx)("span",{className:"font-weight-bold",children:g})}),(0,N.jsx)(la.A.Body,{children:h})]})});$p.displayName="ChatFeedback";var ex=$p;const sx=()=>{const{agent_replies_exhausted:e}=hp();return(0,N.jsx)(Ce.S,{className:"chat-agent-replies-status",role:"status",children:!!e&&(0,N.jsxs)(Ce.S,{className:"chat-agent-replies-notice",children:[(0,N.jsx)(ze.__w,{"aria-hidden":"true",className:"chat-agent-replies-notice-icon",size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Your AI teammates have used all of their responses for this challenge. Check the team panel to see what each of them has left.",id:"label.your_ai_teammates_have_used_all_of.85feb1af"})})]})})};const ax=e=>{if("number"!==typeof e&&"string"!==typeof e)return null;const s=Number(e);return Number.isInteger(s)&&s>0?s:null};var tx=e=>{const{assignment:s,component:a,component_type:t,group_member_assignment_id:i,section:n,setChatService:r,subsection:o,team:d,team_member:c,view:h}=dt(),u={group_member_assignment_id:i,team_member:c},m=!(null===c||void 0===c||!c.is_muted),g="challenge"===t?ax(null===a||void 0===a?void 0:a.challenge_id):null,p=!!g&&"content"===h,x=p?ax(n):null,v=p?ax(o):null,f=(0,l.useMemo)(()=>g?x&&v?{challenge_id:g,phase:x,subphase:v}:{challenge_id:g}:null,[g,x,v]);return(0,N.jsx)(N.Fragment,{children:s?(0,N.jsx)(rp,{author:u,chat_audience:d,component:a,disableChat:m,disableMentions:!1,onRef:e=>r(null===e||void 0===e?void 0:e.messages),step:f,type:"team",children:(0,N.jsxs)(Dp,{children:[(0,N.jsx)(Vp,{}),(0,N.jsx)(sx,{}),(0,N.jsx)(Up,{})]})}):(0,N.jsx)(N.Fragment,{})})};const ix=e=>{const s=Number.parseInt(e);return Number.isInteger(s)&&s>=0?s:null},lx=e=>{let{agent_name:s,allowance:a}=e;const{formatMessage:t}=(0,ja.A)();if(!(e=>ix(null===e||void 0===e?void 0:e.limit)>0&&null!==ix(null===e||void 0===e?void 0:e.remaining))(a))return null;const i=ix(a.limit),l=Math.min(ix(a.remaining),i),n=Math.round(l/i*100),r=n<=10?"danger":n<=33?"warning":"success",o=s||t({id:"label.this_ai_teammate.f3405074",defaultMessage:"This AI teammate"}),d=(0,N.jsx)(Qa.A,{id:`agent-allowance-${a.team_member_id}`,children:(0,N.jsx)(ke.A,{defaultMessage:"{name} can respond {limit} times in this challenge, and has {remaining} left. Chatting and changes they make to the challenge both count. Eac
2h AI teammate has their own, and it does not reset between steps.",id:"label.name_can_respond_limit_times_in_th.b7b32591",values:{limit:i,name:o,remaining:l}})});return(0,N.jsx)(Ua.A,{overlay:d,placement:"left",children:(0,N.jsxs)("div",{className:"agent-allowance mt-1",role:"note",tabIndex:0,children:[(0,N.jsx)(Sa.A,{className:"agent-allowance-bar",label:null,max:i,now:l,style:{height:4},variant:r}),(0,N.jsx)("small",{className:"text-muted agent-allowance-text",children:0===l?(0,N.jsx)(ke.A,{defaultMessage:"No responses left",id:"label.no_responses_left.0a344d90"}):(0,N.jsx)(hc.A,{value:l,one:t({id:"label.1_response_left.a6c0c9c0",defaultMessage:"1 response left"}),other:t({id:"label.count_responses_left.26182508",defaultMessage:"{count} responses left"},{count:l})})})]})})};var nx=s=>{const{formatMessage:a}=(0,ja.A)(),{api:t}=(0,P.nm)(),{component:i,facilitators:n,team:r,team_members:o}=dt(),d=(o||[]).filter(e=>!e.is_agent),c=(o||[]).filter(e=>e.is_agent),[h,u]=(0,l.useState)({}),m=null===r||void 0===r?void 0:r.id,g=null===i||void 0===i?void 0:i.challenge_id,p=c.length>0;return(0,l.useEffect)(()=>{if(!p||!m||!g)return;let s=!0;return(async()=>{try{const e=await t.get("/api/teams/agents/allowance",{challenge_id:g,team_id:m});if(!s)return;const a={};for(const s of(null===e||void 0===e?void 0:e.agents)||[])a[s.team_member_id]=(0,F.A)((0,F.A)({},s),{},{limit:null===e||void 0===e?void 0:e.limit});u(a)}catch(e){w((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e)}})(),()=>{s=!1}},[t,g,p,m]),(0,N.jsx)(Ce.S,{className:"team-tab",children:(0,N.jsxs)(Ce.S,{className:"team-roster-container p-3",children:[!(null===n||void 0===n||!n.length)&&(0,N.jsxs)(Ce.S,{className:"roster mb-4",children:[(0,N.jsx)(Ce.S,{className:"h6",children:(0,N.jsx)(hc.A,{value:n.length,one:a({id:"label.facilitator.49c5d7ad",defaultMessage:"Facilitator"}),other:a({id:"label.facilitators.1cdd53ff",defaultMessage:"Facilitators"})})}),(0,N.jsx)(Ce.S,{className:"list",children:!(null===n||void 0===n||!n.length)&&n.map((e,s)=>{let{user:a}=e;return(0,N.jsx)(rx,{className:"py-1",role:"Facilitator",user:a},s)})})]}),(0,N.jsxs)(Ce.S,{className:"roster",children:[(0,N.jsx)(Ce.S,{className:"h6",children:(0,N.jsx)(hc.A,{value:d.length,one:a({id:"label.learner.0815286c",defaultMessage:"Learner"}),other:a({id:"label.learners.b8b5ae57",defaultMessage:"Learners"})})}),(0,N.jsx)(Ce.S,{className:"list",children:!(null===d||void 0===d||!d.length)&&d.map((e,s)=>{let{user:a}=e;return(0,N.jsx)(rx,{className:"py-1",user:a},s)})})]}),!(null===c||void 0===c||!c.length)&&(0,N.jsxs)(Ce.S,{className:"roster mt-4",children:[(0,N.jsx)(Ce.S,{className:"h6",children:(0,N.jsx)(hc.A,{value:c.length,one:a({id:"label.ai_team_member.b02e6253",defaultMessage:"AI Team Member"}),other:a({id:"label.ai_team_members.2ded0459",defaultMessage:"AI Team Members"})})}),(0,N.jsx)(Ce.S,{className:"list",children:c.map((e,s)=>{var a,t;return(0,N.jsxs)(Ce.S,{className:"agent-roster-member py-1",children:[(0,N.jsx)(rx,{role:"AI",user:(t=e.agent_persona,t?{id:`agent-${t.id}`,avatar:t.avatar_path?{location:t.avatar_path}:null,fullname:t.name,is_agent:!0}:null)}),(0,N.jsx)(lx,{agent_name:null===(a=e.agent_persona)||void 0===a?void 0:a.name,allowance:h[e.id]})]},s)})})]})]})})};var rx=e=>{const{className:s,role:a,user:t}=e,{utils:i}=(0,n.nm)();return(0,N.jsxs)(Ce.S,{className:`d-flex ${s||""}`,children:[(0,N.jsx)(Ya,{showOnline:!0,showTooltip:!0,role:a,size:32,user:t}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center ps-2",children:(0,N.jsx)("h6",{className:"m-0",style:{placeSelf:"center"},children:(null===t||void 0===t?void 0:t.fullname)||""})})]})},ox=t(47665);var dx=e=>{var s;const{demo:a,onPreview:i,team_file:r}=e,[o,d]=(0,l.useState)(!1),{team:c}=dt(),{styles:h}=(0,n.nm)(),{parseExt:u}=(0,Be.hc)(),{createdAt:m,file:g,file_name:p,team_member_id:x}=r||{},{location:v,type:f}=g||{},j=a?t(52919)(`./${v}`):v,{members:_}=c||{},b=null===(s=_.find(e=>e.id===x))||void 0===s?void 0:s.user,A=()=>["image","video"].includes(f),y=A()?"button":"presentation";return(0,N.jsx)(ox.A,{className:"team-file text-decoration-none border-0 px-3 py-2",onClick:()=>{A()&&"function"===typeof i&&i({file_type:f,filename:p,link:v})},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),role:y,children:(0,N.jsxs)(Ce.S,{className:"media-body d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"media-body-left d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{className:"thumbnail me-2",children:"image"===f?(0,N.jsx)(Zs.A,{alt:"",fluid:!0,rounded:!0,src:v}):(0,N.jsx)(zm,{ext:u(p),fill:h.secondary,size:32,type:f})}),(0,N.jsxs)(Ce.S,{className:"metadata d-flex flex-column",children:[(0,N.jsx)(Fl,{as:"p",className:"filename font-weight-bold mb-0",maxWidth:200,placement:"bottom",children:p}),(0,N.jsx)("p",{className:"uploader small text-muted mb-0",children:(null===b||void 0===b?void 0:b.fullname)||""})]})]}),(0,N.jsx)(Ce.S,{className:"media-body-right d-flex",children:o?(0,N.jsx)(Me.NX,{className:"text-decoration-none",filename:p,show_loading_label:!1,type:f,url:j,variant:"link",children:(0,N.jsx)(ze.WCW,{color:null===h||void 0===h?void 0:h.secondary,size:20})}):(0,N.jsx)("p",{className:"small text-muted mb-0 align-self-end",children:(()=>{const e=ci()(m).day()===ci()().day(),s=ci()().diff(m,"hours")<24&&!e,a=ci()().diff(m,"hours")>24;return s?(0,N.jsx)(ke.A,{defaultMessage:"Yesterday",id:"label.yesterday.56618125"}):!a&&e?(0,N.jsx)(Gh.ib,{value:m}):(0,N.jsx)(Gh.XU,{day:"numeric",month:"numeric",value:m})})()})})]})})},cx={chat:tx,files:tp,syllabus:Yg,team:nx};var hx=e=>{const{children:s}=e,a=dt(),{component:t,sidebar_open:i}=a||{},{preview:l}=t||{};
2return(0,N.jsxs)(Hl,{context:a,context_type:"assignment",children:[s,!l&&(0,N.jsx)(_i,{sidebarOpen:i})]})};var ux=e=>{const{component_type:s,mode:a}=dt();return(0,N.jsx)(Ce.S,{className:"module-mode-banner "+(a?`${a} d-flex justify-content-center p-2`:"d-none"),children:(0,N.jsx)("strong",{children:(()=>{switch(a){case"facilitation":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Facilitation mode",id:"label.facilitation_mode.51adeb2c"}),"cartridge"===s&&(0,N.jsx)(ke.A,{defaultMessage:"(changes won't be saved)",id:"label.changes_wont_be_saved.0659ee32"})]});case"preview":return(0,N.jsx)(ke.A,{defaultMessage:"Preview mode",id:"label.preview_mode.481bc90f"});case"arbitration":return(0,N.jsx)(ke.A,{defaultMessage:"Review mode",id:"label.review_mode.4c78e3be"});case"review":return(0,N.jsx)(ke.A,{defaultMessage:"Review mode (changes won't be saved)",id:"label.review_mode_changes_wont_be_saved.b6ee8776"});default:return(0,N.jsx)(N.Fragment,{})}})()})})};var mx=e=>{const{children:s}=e;return(0,N.jsx)(Ce.S,{className:"assignment-wrapper-layout d-flex flex-column",children:s})},gx=vg;const px=(0,l.forwardRef)((s,a)=>{var t;const{api:i}=(0,P.nm)(),{default_banner:n}=(0,Be.hc)(),{project:r,setHasSeenFinalCompulsion:o,team:d}=Ra(),{challenge_template:c}=r||{},{component:h,fetchAssignmentData:u}=dt(),m=(0,l.useRef)(),[g,p,x]=(0,ne.CQ)({animatable_phases:[],continuing:!1,contributors:[],error:null,fireworks:!1,loading:!1,request_submitted:!1,submission:null,unlock_current_phase:!0,visible:!0}),{animatable_phases:v,contributors:f,error:j,fireworks:_,loading:b,request_submitted:A,submission:y,unlock_current_phase:w,visible:S}=g,C=async()=>{p({continuing:!0}),await M(),await u(),p({continuing:!1,visible:!1})},M=async()=>{try{await i.post("/api/teams/members/update_has_seen_final_compulsion",{challenge_id:r.id,team_id:d.id}),o()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(a),p({error:a})}};(0,l.useEffect)(()=>{(async()=>{try{const{contributors:e,submission:s}=await i.get("/api/challenges/recap",{challenge_id:null===r||void 0===r?void 0:r.id});p({contributors:e,loading:!1,submission:s})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;p({error:a,loading:!1}),(0,xa.Err)(a)}})(),setTimeout(()=>p({fireworks:!0}),500)},[]),(0,l.useImperativeHandle)(a,()=>({hide:C,visible:S}));const k=(null===c||void 0===c?void 0:c.banner_path)||n;return(0,N.jsxs)(xe,{"aria-labelledby":"phase-celebration-content","aria-live":"assertive",backdrop:"static",className:"challenge-completion-modal bg-white",onHide:C,show:S,children:[(0,N.jsx)(xe.Dialog,{children:(0,N.jsxs)(Me.x_,{loading:b,children:[(0,N.jsxs)(xe.Header,{style:{backgroundImage:`url("${k}")`},children:[(0,N.jsx)(Zs.A,{roundedCircle:!0,className:"challenge-template-image",height:128,src:c.cover_path,width:128}),(0,N.jsx)(ve.A,{className:"close-button",onClick:C,variant:"link",children:(0,N.jsx)(ze.QCr,{fill:"#FFFFFF",size:20})})]}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(Qe.A,{className:"d-flex justify-content-center modal-body-contents",children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:8,md:10,xl:6,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:e=>p({error:null}),show:j,variant:"danger",children:j}),(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"You've Completed {challengeTemplateTitle}!",id:"label.youve_completed_challengetemplatet.ecf69354",values:{challengeTemplateTitle:c.title}})}),(0,N.jsx)("p",{className:"lead",children:(0,N.jsx)(ke.A,{defaultMessage:"Congrats, {teamName}! Your team has completed the <strong>Reflect</strong> phase, and the entire challenge. Good job!",id:"label.congrats_teamname_your_team_has_co.eee79b04",values:{strong:e=>(0,N.jsx)("strong",{children:e}),teamName:d.name}})}),null!==c&&void 0!==c&&c.completion_message?(0,N.jsx)("p",{className:"lead",children:(0,N.jsx)("strong",{children:c.completion_message})}):(0,N.jsx)(N.Fragment,{}),c.survey_path&&(0,N.jsx)(Ce.S,{className:"d-inline-flex flex-column justify-content-center",children:(0,N.jsx)(ve.A,{className:"mb-2 mt-3 btn btn-primary",href:c.survey_path,size:"lg",style:{fontWeight:800},target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Take 5-minute Survey",id:"label.take_5_minute_survey.caa3a5e2"})})})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(et,{animatablePhases:v,challengeComplete:!0,currentPhase:5,unlockCurrentPhase:w})}),(0,N.jsx)(Ja,{challengeComplete:!0,contributors:f,submission:y}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-center align-items-center gap-2 mt-3",children:[!(null===h||void 0===h||null===(t=h.group_assignment_component)||void 0===t||!t.certification_template_id)&&(0,N.jsx)(ve.A,{disabled:!!A,onClick:async()=>{const e=null===m||void 0===m?void 0:m.current;if(!e)return;const s=await e.show({assignment_component:null===h||void 0===h?void 0:h.group_assignment_component,challenge:r,team:d});p({request_submitted:s})},size:"xl",children:(0,N.jsx)(ke.A,{defaultMessage:"Request certification",id:"label.request_certification.88085505"})}),(0,N.jsx)(Me.p0,{onClick:C,size:"xl",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Continue",id:"label.continue.31fbef16"})})]})]})}
2),(0,N.jsx)("div",{"aria-hidden":!0,className:"pyro-container",role:"presentation",children:_&&(0,N.jsxs)("div",{className:"pyro",children:[(0,N.jsx)("div",{className:"before"}),(0,N.jsx)("div",{className:"after"})]})})]})]})}),(0,N.jsx)(zu,{ref:m})]})});px.displayName="ChallengeCompletionModal";var xx=px;const vx=()=>{const{competency_scores:e,competency_scores_loading:s,getPhaseTitle:a,has_certification:t,phase:i}=Ra(),[n,r]=(0,l.useState)(!1);(0,l.useCallback)(()=>r(e=>!e),[]);return null};vx.displayName="CompetencyProgressAccordion";var fx=vx;var jx=t.p+"static/media/icon-chat-gray.4435d4d5e82566a1cec76ee8af44483b.svg";var _x={gray:jx,normal:t.p+"static/media/icon-chat.57198978e754ebc63357d226697c1ad2.svg"};const bx={black:jg,white:_g};var Ax=t.p+"static/media/icon-syllabus-white.a56a7548a008ef47a8ba065e3e14333a.svg";var yx={normal:t.p+"static/media/icon-syllabus.fbdd3b955ebafb77e027a6ebf1bf5980.svg",white:Ax};var wx=t.p+"static/media/icon-file-white.85cf8263c13ad6cefc1a6990b9ebc151.svg";var Nx={chat:_x,chat2:bx,file:{normal:t.p+"static/media/icon-file.da6acf76ae817e63917512314ae215f4.svg",white:wx},syllabus:yx},Sx=t(40121);var Cx=t.p+"static/media/puzzle.107105d8e9fb6fe1c29905eac8ff7c00.svg";var Mx=e=>{let{description:s="NoDescriptionProvided",icon:a=null,name:t="NoNameProvided",phase:i=0}=e;return(0,N.jsx)(Ge.A,{className:"challenge-onboard-card",children:(0,N.jsxs)(Ge.A.Body,{className:"p-0",children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsx)("div",{className:"phase-icon",children:a}),(0,N.jsx)("div",{className:"phase",children:i})]}),(0,N.jsxs)("div",{className:"content",children:[(0,N.jsx)("h6",{children:t}),(0,N.jsx)("p",{className:"small my-0",children:s})]})]})})};var kx=()=>{const{styles:e}=(0,n.nm)(),s=(0,ja.A)(),{challenge_type:a}=Ra()||{},t=null===e||void 0===e?void 0:e.primary,i={create:{description:s.formatMessage({id:"label.create_a_solution.762ed1e1",defaultMessage:"Create a solution"}),icon:(0,N.jsx)(Zd.Pencil,{color:t,height:20,width:20}),name:s.formatMessage({id:"label.create.4759498a",defaultMessage:"Create"}),phase:4},discover:{description:s.formatMessage({id:"label.identify_and_understand_the_proble.8f9d39b1",defaultMessage:"Identify and understand the problem"}),icon:(0,N.jsx)(Zd.Binocular,{color:t,height:20,width:20}),name:s.formatMessage({id:"label.discover.d4a33d5b",defaultMessage:"Discover"}),phase:1},explore:{description:s.formatMessage({id:"label.learn_what_you_need_to_know.aeeae8fc",defaultMessage:"Learn what you need to know"}),icon:(0,N.jsx)(Zd.Compass,{color:t,height:22,width:22}),name:s.formatMessage({id:"label.explore.3b73900b",defaultMessage:"Explore"}),phase:2},imagine:{description:s.formatMessage({id:"label.brainstorm_solutions.b2f92799",defaultMessage:"Brainstorm solutions"}),icon:(0,N.jsx)(Zd.Bulb,{color:t,height:20,width:20}),name:s.formatMessage({id:"label.imagine.7108efed",defaultMessage:"Imagine"}),phase:3},reflect:{description:s.formatMessage({id:"label.evaluate_the_process.dc5e0426",defaultMessage:"Evaluate the process"}),icon:(0,N.jsx)(Zd.Magnifier,{height:20,stroke:t,width:20}),name:s.formatMessage({id:"label.reflect.9bd75a3f",defaultMessage:"Reflect"}),phase:5}};if(a&&"classic"!==a){var l;const e=(null===(l=Za.Ay[a])||void 0===l?void 0:l.phases)||{};Object.values(i).forEach(s=>{const a=e[s.phase];a&&(s.name=a.title||s.name,s.description=a.tagline||a.description||s.description)})}return(0,N.jsxs)(Ce.S,{className:"framework-feature",children:[(0,N.jsx)("h3",{className:"ms-3 pt-3 d-md-none",children:(0,N.jsx)(ke.A,{defaultMessage:"Problem-Solving Framework",description:"",id:"label.problem_solving_framework.dcde11ce"})}),(0,N.jsxs)(Ce.S,{className:"hub grid",children:[(0,N.jsx)("h5",{className:"pt-3 d-none d-md-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Problem-Solving Framework",description:"",id:"label.problem_solving_framework.dcde11ce"})}),(0,N.jsxs)("div",{className:"grid-container d-none d-md-block",children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsx)("div",{className:"discover py-2 me-md-3",children:(0,N.jsx)(Mx,(0,F.A)({},i.discover))}),(0,N.jsx)("div",{className:"explore py-2",children:(0,N.jsx)(Mx,(0,F.A)({},i.explore))})]}),(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsx)("div",{className:"third pt-2 mb-4 me-md-3",children:(0,N.jsx)(Mx,(0,F.A)({},i.imagine))}),(0,N.jsx)("div",{className:"third pt-2 mb-4 me-md-3",children:(0,N.jsx)(Mx,(0,F.A)({},i.create))}),(0,N.jsx)("div",{className:"third pt-2 mb-4",children:(0,N.jsx)(Mx,(0,F.A)({},i.reflect))})]})]})]})]})};class zx extends l.Component{constructor(e){super(e),this.state={show:!1}}render(){return(0,N.jsx)("div",{className:"completion-eg-container framework-feature d-none d-md-block",children:(0,N.jsxs)("div",{className:"hub steps",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge navigation",description:"",id:"label.challenge_navigation.6eb663f9"})}),(0,N.jsxs)("div",{className:"progress-path mb-3",children:[(0,N.jsx)("div",{className:"circle-check me-1",children:(0,N.jsx)(ze.CMH,{color:"white",size:20})}),(0,N.jsx)("div",{className:"between"}),(0,N.jsx)("div",{className:"circle-check incomplete ms-1",children:(0,N.jsx)(Zs.A,{src:Cx,style:{height:20,width:20}})})]}),(0,N.jsx)("h6",{className:"step-t",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed step",description:"",id:"label.completed_step.ef61a6c3"})}),(0,N.jsx)("p",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete all activities to prepare you to move to the next step",description:"",id:"label.complete_all_activities_to_prepare.b18d0f06"})}),(0,N.jsxs)("div",{className:"progress-path mb-3",children:[(0,N.jsx)("div",{className:"circle-check me-1",children:(0,N.jsx)(ze.CMH,{color:"white",size:20})}),(0,N.jsx)("div",{className:"between complete"}),(0,N.jsx)("div",{className:"circle-check ms-1",children:(0,N.jsx)(ze.CMH,{color:"white",size:20})})]}),(0,N.jsx)("h6",{className:"phase-t",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed phase",description:"",id:"label.completed_phase.7be2667e"})}),(0,N.jsx)("p",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete all steps to advance to the next challenge phase",description:"",id:"label.complete_all_steps_to_advance_to_t.acfc1349"})})]})})}}var Tx=(0,n.G0)(zx);var Ix=t.p+"static/media/img-stack.192429ba59c7eec42d6280ce6ef805b7.svg";function Ex(){return(0,N.jsxs)(aa.A,{className:"flex-column",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"pe-2",eventKe
2y:"first",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Zs.A,{height:24,src:Nx.chat.normal,width:24}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Communicate",description:"",id:"label.communicate.4375bc41"})})]}),(0,N.jsx)(Ce.S,{className:"text",children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Communicate with your team of problem solvers to develop a meaningful solution.",description:"",id:"label.communicate_with_your_team_of_prob.ec4a9584"})})})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"pe-2",eventKey:"second",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Zs.A,{height:24,src:Nx.file.normal,width:24}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Files",description:"",id:"label.files.abc7e989"})})]}),(0,N.jsx)(Ce.S,{className:"text",children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Artifacts such as video, audio, documents, and pictures are stored for easy access.",description:"",id:"label.artifacts_such_as_video_audio_docu.1959e4c9"})})})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"pe-2",eventKey:"third",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Zs.A,{height:24,src:Nx.syllabus.normal,width:24}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Syllabus",description:"",id:"label.syllabus.1a0cf891"})})]}),(0,N.jsx)(Ce.S,{className:"text",children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Quickly access the syllabus to review challenge details and expectations.",description:"",id:"label.quickly_access_the_syllabus_to_rev.51d4cd6b"})})})]})})]})}function Fx(){return(0,N.jsxs)(Ce.S,{className:"sidebar-skeleton-outer",children:[(0,N.jsx)("div",{className:"sidebar-nav-button chat sidebar-nav-button-blue selected",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.chat2.white,width:24})})}),(0,N.jsx)("div",{className:"sidebar-nav-button syllabus sidebar-nav-button-green",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.syllabus.normal,width:24})})}),(0,N.jsx)("div",{className:"sidebar-nav-button sidebar-nav-button-purple file",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.file.normal,width:24})})}),(0,N.jsx)(Ce.S,{className:"sidebar-activity",children:(0,N.jsxs)(Ce.S,{className:"messages-container",children:[(0,N.jsxs)(Ce.S,{className:"message",children:[(0,N.jsx)(Ce.S,{className:"user-icon"}),(0,N.jsxs)(Ce.S,{className:"content",children:[(0,N.jsx)(Ce.S,{className:"first"}),(0,N.jsx)(Ce.S,{className:"second"}),(0,N.jsx)(Ce.S,{className:"image",children:(0,N.jsx)("img",{alt:"",src:Ix,style:{height:25,width:29}})})]})]}),(0,N.jsxs)(Ce.S,{className:"message",children:[(0,N.jsx)(Ce.S,{className:"user-icon"}),(0,N.jsxs)(Ce.S,{className:"content",children:[(0,N.jsx)(Ce.S,{className:"first"}),(0,N.jsx)(Ce.S,{className:"second"})]})]})]})})]})}function Rx(){return(0,N.jsxs)(Ce.S,{className:"sidebar-skeleton-outer",children:[(0,N.jsx)("div",{className:"sidebar-nav-button chat sidebar-nav-button-blue",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.chat.normal,width:24})})}),(0,N.jsx)("div",{className:"sidebar-nav-button syllabus sidebar-nav-button-green selected",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.syllabus.white,width:24})})}),(0,N.jsx)("div",{className:"sidebar-nav-button sidebar-nav-button-purple file",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.file.normal,width:24})})}),(0,N.jsx)(Ce.S,{className:"sidebar-activity",children:(0,N.jsxs)(Ce.S,{className:"files",children:[(0,N.jsxs)(Ce.S,{className:"file-skeleton-container",children:[(0,N.jsx)(Ce.S,{className:"image",children:(0,N.jsx)("img",{alt:"",src:Ix,style:{height:25,width:29}})}),(0,N.jsxs)(Ce.S,{className:"text",children:[(0,N.jsx)(Ce.S,{className:"first mb-1"}),(0,N.jsx)(Ce.S,{className:"second"})]})]}),(0,N.jsxs)(Ce.S,{className:"file-skeleton-container",children:[(0,N.jsx)(Ce.S,{className:"image",children:(0,N.jsx)("img",{alt:"",src:Ix,style:{height:25,width:29}})}),(0,N.jsxs)(Ce.S,{className:"text",children:[(0,N.jsx)(Ce.S,{className:"first mb-1"}),(0,N.jsx)(Ce.S,{className:"second"})]})]}),(0,N.jsxs)(Ce.S,{className:"file-skeleton-container",children:[(0,N.jsx)(Ce.S,{className:"image",children:(0,N.jsx)("img",{alt:"",src:Ix,style:{height:25,width:29}})}),(0,N.jsxs)(Ce.S,{className:"text",children:[(0,N.jsx)(Ce.S,{className:"first mb-1"}),(0,N.jsx)(Ce.S,{className:"second"})]})]})]})})]})}function Dx(){return(0,N.jsxs)(Ce.S,{className:"sidebar-skeleton-outer",children:[(0,N.jsx)("div",{className:"sidebar-nav-button chat sidebar-nav-button-blue",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{src:Nx.chat.normal})})}),(0,N.jsx)("div",{className:"sidebar-nav-button syllabus sidebar-nav-button-green",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{src:Nx.syllabus.normal})})}),(0,N.jsx)("div",{className:"sidebar-nav-button sidebar-nav-button-purple file selected",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{src:Nx.file.white})})}),(0,N.jsx)(Ce.S,{className:"sidebar-activity",children:(0,N.jsxs)(Ce.S,{className:"syllabus-contents",children:[(0,N.jsx)(Ce.S,{className:"content",children:(0,N.jsx)(Ce.S,{className:"long"})}),(0,N.jsx)(Ce.S,{className:"content",children:(0,N.jsxs)(Ce.S,{className:"trigger-content",children:[(0,N.jsx)("i",{}),(0,N.jsx)(Ce.S,{className:"short"})]})}),(0,N.jsxs)(Ce.S,{className:"content",children:[(0,N.jsx)(Ce.S,{className:"md-long mb-1"}),(0,N.jsx)(Ce.S,{className:"short mb-1"}),(0,N.jsx)(Ce.S,{className:"short"})]}),(0,N.jsxs)(Ce.S,{className:"content",children:[(0,N.jsx)(Ce.S,{className:"md-long mb-1"}),(0,N.jsx)(Ce.S,{className:"short mb-1"}),(0,N.jsx)(Ce.S,{className:"short"})]})]})})]})}var Bx=Fa(function(){return(0,N.jsx)(Ce.S,{className:"team-collaboration-container framework-feature",children:(0,N.jsxs)("div",{className:"hub collaboration",children:[(0,N.jsx)("h3",{className:"d-md-none",children:"Team Collaboration"}),(0,N.jsx)("h5",{className:"d-none d-md-block pt-3",children:"Team Collaboration"}),(0,N.jsx)(ld.A.Container,{defaultActiveKey:"first",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{xs:5,children:(0,N.jsx)(Ex,{})}),(0,N.jsx)(Ve.A,{style:{paddingRight:2},xs:7,children:(0,N.jsxs)(ld.A.Content,{style:{paddingBottom:"unset",paddingRight:"unset"}
2,children:[(0,N.jsx)(ld.A.Pane,{eventKey:"first",children:(0,N.jsx)(Fx,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"second",children:(0,N.jsx)(Rx,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"third",children:(0,N.jsx)(Dx,{})})]})})]})})]})})});var Px=e=>{let{className:s,onOptionClick:a=()=>null,step:t=-1,style:i}=e;return(0,N.jsxs)("div",{className:s,style:i,children:[(0,N.jsxs)("div",{className:`d-md-flex flex-nowrap dialog-menu-option ${0==t&&"selected"} mb-3`,onClick:()=>a(0),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&a(0),role:"button",tabIndex:0,children:[(0,N.jsx)("div",{className:"d-none d-md-block",children:(0,N.jsx)("div",{className:"icon-circle-bg green-200",children:(0,N.jsx)(Sx.SvgrBricks,{color:"var(--primary)"})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Problem-Solving Framework",description:"",id:"label.problem_solving_framework.dcde11ce"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Address a real-world problem by moving through a problem-solving process.",description:"",id:"label.address_a_real_world_problem_by_mo.f26072de"})})]})]}),(0,N.jsxs)("div",{className:`d-none d-md-flex flex-nowrap dialog-menu-option mb-3 ${1==t&&"selected"}`,onClick:()=>a(1),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&a(1),role:"button",tabIndex:0,children:[(0,N.jsx)("div",{className:"d-none d-md-block",children:(0,N.jsx)("div",{className:"icon-circle-bg green-200",children:(0,N.jsx)(Pm.A3x,{className:"primary-stroke",color:"var(--primary)"})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge navigation",description:"",id:"label.challenge_navigation.6eb663f9"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Track your progress as you complete each of the challenge phases and steps.",description:"",id:"label.track_your_progress_as_you_complet.ee66728d"})})]})]}),(0,N.jsxs)("div",{className:`d-none d-md-flex flex-nowrap dialog-menu-option mb-3 ${2==t&&"selected"}`,onClick:()=>a(2),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&a(2),role:"button",tabIndex:0,children:[(0,N.jsx)("div",{className:"d-none d-md-block",children:(0,N.jsx)("div",{className:"icon-circle-bg green-200",children:(0,N.jsx)(Sx.SvgrGroupTwoUsers,{className:"primary-stroke",fill:"var(--primary)"})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team collaboration",description:"",id:"label.team_collaboration.28b4d621"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Share, reflect, and document your learning process and products.",description:"",id:"label.share_reflect_and_document_your_le.03141edd"})})]})]})]})};var Lx=e=>{const[s,a]=(0,l.useState)(0),{styles:t}=(0,n.nm)(),i=(null===t||void 0===t?void 0:t.primary)||"",r=(0,ja.A)(),o={create:{description:r.formatMessage({id:"label.create_a_solution.762ed1e1",defaultMessage:"Create a solution"}),icon:(0,N.jsx)(Zd.Pencil,{color:i,height:20,width:20}),name:r.formatMessage({id:"label.create.4759498a",defaultMessage:"Create"}),phase:4},discover:{description:r.formatMessage({id:"label.identify_and_understand_the_proble.8f9d39b1",defaultMessage:"Identify and understand the problem"}),icon:(0,N.jsx)(Zd.Binocular,{color:i,height:20,width:20}),name:r.formatMessage({id:"label.discover.d4a33d5b",defaultMessage:"Discover"}),phase:1},explore:{description:r.formatMessage({id:"label.learn_what_you_need_to_know.aeeae8fc",defaultMessage:"Learn what you need to know"}),icon:(0,N.jsx)(Zd.Compass,{color:i,height:22,width:22}),name:r.formatMessage({id:"label.explore.3b73900b",defaultMessage:"Explore"}),phase:2},imagine:{description:r.formatMessage({id:"label.brainstorm_solutions.b2f92799",defaultMessage:"Brainstorm solutions"}),icon:(0,N.jsx)(Zd.Bulb,{color:i,height:20,width:20}),name:r.formatMessage({id:"label.imagine.7108efed",defaultMessage:"Imagine"}),phase:3},reflect:{description:r.formatMessage({id:"label.evaluate_the_process.dc5e0426",defaultMessage:"Evaluate the process"}),icon:(0,N.jsx)(Zd.Magnifier,{height:20,stroke:i,width:20}),name:r.formatMessage({id:"label.reflect.9bd75a3f",defaultMessage:"Reflect"}),phase:5}};return(0,N.jsxs)(ld.A.Container,{activeKey:s,classNameN:e.className,defaultActiveKey:0,children:[(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsxs)(ld.A.Pane,{className:"d-md-none",eventKe
2y:0,children:[(0,N.jsxs)("div",{className:"d-md-flex flex-nowrap dialog-menu-option",children:[(0,N.jsx)("div",{className:"d-none d-md-block",children:(0,N.jsx)("div",{className:"icon-circle-bg green-200",children:(0,N.jsx)(Sx.SvgrBricks,{})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Problem-Solving Framework",description:"",id:"label.problem_solving_framework.dcde11ce"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Address a real-world problem by moving through a problem-solving process.",description:"",id:"label.address_a_real_world_problem_by_mo.f26072de"})})]})]}),(0,N.jsxs)("div",{className:"grid-container d-md-none",children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between w-100",children:[(0,N.jsx)("div",{className:"discover py-2",children:(0,N.jsx)(Mx,(0,F.A)({},o.discover))}),(0,N.jsx)("div",{className:"explore py-2",children:(0,N.jsx)(Mx,(0,F.A)({},o.explore))})]}),(0,N.jsxs)("div",{className:"d-flex justify-content-between w-100",children:[(0,N.jsx)("div",{className:"third pt-2 mb-4 mr",children:(0,N.jsx)(Mx,(0,F.A)({},o.imagine))}),(0,N.jsx)("div",{className:"third pt-2 mb-4 mr",children:(0,N.jsx)(Mx,(0,F.A)({},o.create))}),(0,N.jsx)("div",{className:"third pt-2 mb-4",children:(0,N.jsx)(Mx,(0,F.A)({},o.reflect))})]})]})]}),(0,N.jsx)(ld.A.Pane,{className:"completion-eg-container d-md-none",eventKey:1,children:(0,N.jsxs)("div",{className:"dialog-menu-option",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge navigation",description:"",id:"label.challenge_navigation.6eb663f9"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Track your progress as you complete each of the challenge phases and steps.",description:"",id:"label.track_your_progress_as_you_complet.ee66728d"})}),(0,N.jsxs)("div",{className:"progress-path mb-3",children:[(0,N.jsx)("div",{className:"circle-check me-1",children:(0,N.jsx)(ze.CMH,{color:"white",size:20})}),(0,N.jsx)("div",{className:"between"}),(0,N.jsx)("div",{className:"circle-check incomplete ms-1",children:(0,N.jsx)(Zs.A,{src:Cx,style:{height:20,width:20}})})]}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Completed step",description:"",id:"label.completed_step.ef61a6c3"})}),(0,N.jsx)("p",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete all activities to prepare you to move to the next step",description:"",id:"label.complete_all_activities_to_prepare.b18d0f06"})}),(0,N.jsxs)("div",{className:"progress-path mb-4",children:[(0,N.jsx)("div",{className:"circle-check me-1",children:(0,N.jsx)(ze.CMH,{color:"white",size:20})}),(0,N.jsx)("div",{className:"between complete"}),(0,N.jsx)("div",{className:"circle-check ms-1",children:(0,N.jsx)(ze.CMH,{color:"white",size:20})})]}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Completed phase",description:"",id:"label.completed_phase.7be2667e"})}),(0,N.jsx)("p",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete all steps to advance to the next challenge phase",description:"",id:"label.complete_all_steps_to_advance_to_t.acfc1349"})})]})}),(0,N.jsx)(ld.A.Pane,{className:"team-collaboration-container d-md-none",eventKey:2,children:(0,N.jsxs)("div",{className:"dialog-menu-option",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team collaboration",description:"",id:"label.team_collaboration.28b4d621"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Share, reflect, and document your learning process and products.",description:"",id:"label.share_reflect_and_document_your_le.03141edd"})}),(0,N.jsxs)("div",{className:"d-flex flex-nowrap mb-4",children:[(0,N.jsx)("div",{className:"sidebar-nav-button chat",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.chat.normal,width:24})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Chat",description:"",id:"label.chat.460b3a7d"})}),(0,N.jsx)("p",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Communicate with your team of problem solvers to develop a meaninful solution",description:"",id:"label.communicate_with_your_team_of_prob.634ff5be"})})]})]}),(0,N.jsxs)("div",{className:"d-flex flex-nowrap mb-4",children:[(0,N.jsx)("div",{className:"sidebar-nav-button file",children:(0,N.jsx)("div",{className:"sidebar-nav-button-container",children:(0,N.jsx)(Zs.A,{height:24,src:Nx.file.normal,width:24})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Files",description:"",id:"label.files.abc7e989"})}),(0,N.jsx)("p",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Artifacts such as video, audio, documents, and pictures are stored for easy access",description:"",id:"label.artifacts_such_as_video_audio_docu.3b28e1eb"})})]})]})]})})]}),(0,N.jsx)("hr",{className:"d-md-none",style:{border:"1px solid rgba(0, 0, 0, 0.12)",margin:"0px 16px"}}),(0,N.jsxs)("div",{className:(s>0?"justify-content-between":"justify-content-end")+" footer d-md-none",children:[(0,N.jsx)(ve.A,{className:""+(s>0?"d-block":"d-none"),onClick:()=>a(s>0?s-1:s),style:{padding:"11px 24px"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",description:"",id:"label.previous.a57b08a4"})}),(0,N.jsx)(ve.A,{onClick:()=>{2===s?e.handleClose():a(s<3?s+1:s)},style:{padding:"11px 24px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Next",description:"",id:"label.next.1ff57a29"})})]})]})};class Ox extends l.PureComponent{constructor(){var e;super(...arguments),e=this,this.state={rightPaneStep:0},this.goToStep=function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;null!=s&&s>=0&&s<3&&e.setState({rightPaneStep:s})},this.handleNext=function(){2===e.state.rightPaneStep?e.props.handleClose():e.setState(e=>({rightPaneStep:e.rightPaneStep<3?e.rightPaneStep+1:e.rightPaneStep}))}}render(){const{handleClose:e,show:s}=this.props;return(0,N.jsxs)(xe,{dialog:!0,className:"onboard-modal",onHide:e,show:s,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Getting Started with Solvably",id:"label.getting_started_with_
2solvably.e6d734fb"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(ld.A.Container,{activeKey:this.state.rightPaneStep,defaultActiveKey:this.state.rightPaneStep,children:[(0,N.jsxs)(Qe.A,{noGutters:!0,children:[(0,N.jsx)(Ve.A,{className:"left",md:6,children:(0,N.jsxs)(Ce.S,{className:"lhs-outer-container",children:[(0,N.jsx)(Px,{className:"d-none d-md-block",onOptionClick:this.goToStep,step:this.state.rightPaneStep}),(0,N.jsx)(Lx,{classNames:"d-md-none",handleClose:e})]})}),(0,N.jsx)(Ve.A,{className:"right ps-sm-0 d-none d-md-block h-100",md:6,children:(0,N.jsx)(Ce.S,{className:"rhs-outer-container",children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:0,children:(0,N.jsx)(kx,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:1,children:(0,N.jsx)(Tx,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:2,children:(0,N.jsx)(Bx,{})})]})})})]}),(0,N.jsx)("hr",{className:"d-none d-md-block",style:{border:"1px solid rgba(0, 0, 0, 0.12)",margin:"0px 24px"}}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Ce.S,{className:"footer d-none d-md-flex",children:(0,N.jsx)(ve.A,{onClick:this.handleNext,children:(0,N.jsx)(ke.A,{defaultMessage:"Next",description:"",id:"label.next.1ff57a29"})})})})})]})})]})}}var Hx=Ox;Ox.defaultProps={handleClose:()=>null};var Ux=e=>{const{has_privilege:s}=Qj();return(0,N.jsx)(Vx,{value:{},children:(0,N.jsxs)(Ce.S,{className:"assignment-snapshot-details cartridge",children:[(0,N.jsx)(d_,{}),(0,N.jsx)(c_,{}),s?(0,N.jsx)(Gx,{}):(0,N.jsx)(N.Fragment,{})]})})};const Qx=l.createContext({}),Vx=Qx.Provider;Qx.Consumer;var Gx=e=>{const{component:s,setError:a}=Qj();return(0,N.jsx)(Ce.S,{className:"cartridge-details-privileged mt-5 d-flex align-items-center justify-content-center",children:s?(0,N.jsx)(N.Fragment,{children:!!s&&(0,N.jsx)(Rs,{cartridge_id:null===s||void 0===s?void 0:s.cartridge_id,mode:"readonly",onError:a})}):(0,N.jsx)("p",{className:"p-5",children:(0,N.jsx)(ke.A,{defaultMessage:"Invalid SCORM package",id:"label.invalid_scorm_package.acddb64b"})})})},Wx=Ux;const Kx={actionStatement:"Action statement",brainstorm:"Brainstorm",chooseAnIdea:"Choose an idea",defineChallenge:"Define challenge",deliverable:"Deliverable",establishConstraints:"Establish constraints",finalDeliverable:"Final deliverable",identifyAudience:"Identify audience",needToKnow:"Need to know",ourAudience:"Our audience",ourSolution:"Our solution",research:"Research",sectionCreate:"Create",sectionDiscover:"Discover",sectionExplore:"Explore",sectionImagine:"Imagine",shareWhatYouKnow:"Share what you know",theChallenge:"The challenge"},Yx=[{hash:"theChallenge"},{hash:"ourAudience"},{hash:"ourSolution"},{hash:"finalDeliverable"}],qx=[{hash:"sectionDiscover",phase:1,sub_locations:[{hash:"defineChallenge",phase:1,subphase:1},{hash:"identifyAudience",phase:1,subphase:2},{hash:"establishConstraints",phase:1,subphase:3},{hash:"shareWhatYouKnow",phase:1,subphase:4}]},{hash:"sectionExplore",phase:2,sub_locations:[{hash:"needToKnow",phase:2,subphase:1},{hash:"research",phase:2,subphase:2}]},{hash:"sectionImagine",phase:3,sub_locations:[{hash:"brainstorm",phase:3,subphase:1},{hash:"chooseAnIdea",phase:3,subphase:2}]},{hash:"sectionCreate",phase:4,sub_locations:[{hash:"actionStatement",phase:4,subphase:1},{hash:"deliverable",phase:4,subphase:2}]}],Jx=e=>Za.Ay[e]||Za.Ay.classic,Xx=(e,s,a)=>{var t,i,l;return"classic"===e?Kx[s]:(null===(t=Jx(e))||void 0===t||null===(i=t.phases)||void 0===i||null===(l=i[a])||void 0===l?void 0:l.title)||Kx[s]},Zx=(e,s,a,t)=>{var i,l,n,r;if("classic"===e)return Kx[s];const o=null===(i=Jx(e))||void 0===i||null===(l=i.phases)||void 0===l||null===(n=l[a])||void 0===n||null===(r=n.subphases)||void 0===r?void 0:r[t];return("object"===typeof o?null===o||void 0===o?void 0:o.title:o)||Kx[s]},$x=e=>({overview:Yx.map(e=>({hash:e.hash,name:Kx[e.hash]})),process:qx.map(s=>({hash:s.hash,name:Xx(e,s.hash,s.phase),sub_locations:s.sub_locations.map(s=>({hash:s.hash,name:Zx(e,s.hash,s.phase,s.subphase)}))}))});var ev=e=>{var s;const{component:a,getTemplate:t,has_privilege:i}=Qj(),{challenge:l}=a||{},{challenge_data:n}=l||{},r=(null===t||void 0===t||null===(s=t())||void 0===s?void 0:s.challenge_type)||"classic",o=Za.Ay[r]||Za.Ay.classic,[d,c,h]=(0,ne.CQ)({active_tab:"overview",scrollspy_stickied:!1,scrollspy_visible:!0}),{active_tab:u,scrollspy_stickied:m,scrollspy_visible:g}=d,p=$x(r);return(0,N.jsx)(tv,{value:{active_tab:u,challenge:l,challenge_type:r,hideScrollspy:()=>{c({scrollspy_visible:!1})},isPhaseComplete:e=>!!l&&(null===l||void 0===l?void 0:l.num_phases_complete)>=e,isPhaseStarted:e=>{const s=(Array.isArray(null===l||void 0===l?void 0:l.challenge_data)?l.challenge_data:[]).filter(s=>s.phase===e);let a=!1;return s.every((e,s)=>{let{data:t}=e;return!!(0,T.isEmpty)(t)||(a=!0,!1)}),a},isPhaseUnlocked:e=>((null===l||void 0===l?void 0:l.num_phases_complete)||0)>=e-1,isSubphaseComplete:(e,s)=>{var a;const t=null===n||void 0===n||null===(a=n.find)||void 0===a?void 0:a.call(n,a=>(null===a||void 0===a?void 0:a.phase)===e&&(null===a||void 0===a?void 0:a.subphase)===s);return!(null===t||void 0===t||!t.is_complete)},scrollspy_locations:p,scrollspy_stickied:m,scrollspy_visible:g,setActiveTab:e=>c({active_tab:e}),setScrollspySticky:e=>c({scrollspy_stickied:e}),showScrollspy:()=>c({scrollspy_visible:!0}),typeConfig:o}
2,children:(0,N.jsxs)(Ce.S,{className:"assignment-snapshot-details challenge",children:[(0,N.jsx)(d_,{}),(0,N.jsx)(c_,{}),i?(0,N.jsx)(sv,{}):(0,N.jsx)(Oj,{})]})})};var sv=()=>{const{active_tab:e,setActiveTab:s}=iv(),{component:a}=Qj();return(0,N.jsxs)(Ce.S,{className:"challenge-details-tabs",children:[(0,N.jsxs)(aa.A,{activeKey:e,className:"flex-row tabs-primary mt-4 mb-3",onSelect:s,children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"overview",children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"process",children:(0,N.jsx)(ke.A,{defaultMessage:"Process",id:"label.process.e083bd83"})})})]}),(0,N.jsx)(ld.A.Container,{activeKey:e,defaultActiveKey:"overview",mountOnEnter:!0,onSelect:s,unmountOnExit:!1,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"overview",children:"overview"===e&&!(0,T.isEmpty)(a)&&(0,N.jsx)(rv,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"process",children:"process"===e&&!(0,T.isEmpty)(a)&&(0,N.jsx)(Pj,{})})]})})]})};const av=l.createContext({}),tv=av.Provider,iv=(av.Consumer,()=>(0,l.useContext)(av));var lv=t(64048),nv=t.n(lv);var rv=e=>{const{modal_guid:s}=Qj(),{setActiveTab:a,setScrollspySticky:t}=iv();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"challenge-details-overview my-5",children:(0,N.jsxs)(Qe.A,{className:"m-0",children:[(0,N.jsxs)(Ve.A,{lg:9,xs:12,children:[(0,N.jsx)(cv,{}),(0,N.jsx)(yv,{}),(0,N.jsx)(zv,{}),(0,N.jsx)(Rv,{})]}),(0,N.jsx)(Ve.A,{children:(0,N.jsx)(nv(),{className:"scrollspy-sticky-holder",onFixedToggle:t,positionRecheckInterval:100,stickyClassName:"scrollspy-sticky",topOffset:-150,children:(0,N.jsx)(Zj,{scope:"overview"})})})]})}),(0,N.jsx)(Ce.S,{className:"d-flex overview-footer mt-3 py-3",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column justify-content-evenly",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Want to learn more?",id:"label.want_to_learn_more.4a6ffc46"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:()=>{a("process"),setTimeout(()=>{document.querySelector(`.modal-${s}`).scrollTop=0},100)},children:[(0,N.jsx)(ke.A,{defaultMessage:"See our process",id:"label.see_our_process.263709d2"}),(0,N.jsx)(ze.Z0P,{})]})]})})]})};var ov,dv,cv=e=>{const{getTemplate:s}=Qj(),a=s(),{challenge_statement:t}=a||{};return(0,N.jsxs)("section",{className:"overview-section the-challenge d-flex gap-4 mb-5",id:"theChallenge",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Tc,{height:64,width:64})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"The challenge",id:"label.the_challenge.a99d3c07"})}),(0,N.jsx)(Ce.S,{dangerouslySetInnerHTML:{__html:t},style:{lineBreak:"anywhere"}})]})]})};const hv=["title","titleId"];function uv(){return uv=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},uv.apply(null,arguments)}function mv(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,hv);return l.createElement("svg",uv({width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,ov||(ov=l.createElement("g",{clipPath:"url(#clip0_968_51033)"},l.createElement("path",{d:"M32 64C14.3 64 0 49.7 0 32C0 14.3 14.3 0 32 0C49.7 0 64 14.3 64 32C64 49.7 49.7 64 32 64ZM32 4C16.5 4 4 16.5 4 32C4 47.5 16.5 60 32 60C47.5 60 60 47.5 60 32C60 16.5 47.5 4 32 4Z",fill:"#D5D9DC"}),l.createElement("path",{d:"M32 17.2C34.6 17.2 36.8 19.3 36.8 22C36.8 24.7 34.7 26.8 32 26.8C29.3 26.8 27.2 24.7 27.2 22C27.2 19.4 29.4 17.2 32 17.2ZM32 13C27 13 23 17 23 22C23 27 27 31 32 31C37 31 41 27 41 22C41 17 37 13 32 13Z",fill:"#008087"}),l.createElement("path",{d:"M19.8 32H22.3C22.7 32 23.1 32.3 23.1 32.8V49.3C23.1 49.7 22.8 50.1 22.3 50.1H19.8C19.4 50.1 19 49.8 19 49.3V32.8C19 32.3 19.3 32 19.8 32Z",fill:"#008087"}),l.createElement("path",{d:"M41.8 32H44.3C44.7 32 45.1 32.3 45.1 32.8V49.3C45.1 49.7 44.8 50.1 44.3 50.1H41.8C41.4 50.1 41 49.8 41 49.3V32.8C41 32.3 41.3 32 41.8 32Z",fill:"#008087"}))),dv||(dv=l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_968_51033"},l.createElement("rect",{width:64,height:64,fill:"white"})))))}const gv=l.forwardRef(mv);t.p;var pv,xv,vv,fv,jv,_v,bv,Av,yv=e=>{var s,a;const{challenge:t,isPhaseComplete:i}=iv(),{challenge_data:l=[]}=t||{},n=l.find(e=>1===e.phase&&2===e.subphase)||{},r=(null===n||void 0===n||null===(s=n.data)||void 0===s?void 0:s.identifyAudience)||{},o=(null===r||void 0===r||null===(a=r.item)||void 0===a?void 0:a.value)||"",d=(null===r||void 0===r?void 0:r.text)||"No Audience Text Found";return(0,N.jsxs)("section",{className:"overview-section our-audience d-flex gap-4 mb-5",id:"ourAudience",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(gv,{height:64,width:64})}),(0,N.jsxs)(Qe.A,{className:"d-flex m-0 flex-1",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Our audience",id:"label.our_audience.269e1b45"})}),i(1)?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ve.A,{className:"d-flex flex-column",lg:8,xs:12,children:(0,ad.G9)(d,{preserveNewlines:!0})}),(0,N.jsx)(Ve.A,{children:(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Zs.A,{alt:"identified audie
2nce",fluid:!0,rounded:!0,src:o})})})]}):(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Vj,{phase:1,subphase:2})})]})]})};const wv=["title","titleId"];function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},Nv.apply(null,arguments)}function Sv(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,wv);return l.createElement("svg",Nv({width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,pv||(pv=l.createElement("path",{d:"M24.8 52H39.3C39.7 52 40.1 52.3 40.1 52.8V55.3C40.1 55.7 39.8 56.1 39.3 56.1H24.8C24.4 56.1 24 55.8 24 55.3V52.8C24 52.3 24.3 52 24.8 52Z",fill:"#008087"})),xv||(xv=l.createElement("path",{d:"M27.8 58H36.3C36.7 58 37.1 58.3 37.1 58.8V61.3C37.1 61.7 36.8 62.1 36.3 62.1H27.8C27.4 62.1 27 61.8 27 61.3V58.8C27 58.3 27.3 58 27.8 58Z",fill:"#008087"})),vv||(vv=l.createElement("path",{d:"M31.9999 14C38.5999 14 43.9999 19.4 43.9999 26C43.9999 28.8 42.9999 31.5 41.1999 33.7C38.2999 37.2 36.4999 41.5 36.0999 46H27.8999C27.4999 41.4 25.5999 37.1 22.6999 33.6C20.7999 31.3 19.7999 28.3 19.9999 25.4C20.3999 19.3 25.2999 14.4 31.3999 14.1H31.9999V14ZM31.9999 10C31.3999 10 30.7999 10 30.0999 10.1C21.2999 11.1 15.0999 19.1 16.0999 27.9C16.4999 30.9 17.6999 33.8 19.5999 36.1C22.3999 39.4 23.8999 43.5 23.9999 47.8V49.3C23.9999 49.7 24.2999 50 24.7999 50.1H39.2999C39.6999 50.1 39.9999 49.8 40.0999 49.3V48C40.0999 43.7 41.5999 39.6 44.2999 36.3C49.9999 29.5 49.0999 19.4 42.2999 13.8C39.3999 11.3 35.7999 10 31.9999 10Z",fill:"#008087"})),fv||(fv=l.createElement("path",{d:"M30.8 1H33.3C33.7 1 34 1.3 34 1.8V8.3C34 8.7 33.7 9 33.2 9H30.7C30.3 9 30 8.7 30 8.2V1.8C30 1.3 30.3 1 30.8 1Z",fill:"#D5D9DC"})),jv||(jv=l.createElement("path",{d:"M7 27.2V24.7C7 24.3 7.3 24 7.8 24H14.3C14.7 24 15.1 24.3 15.1 24.8V27.3C15.1 27.7 14.8 28.1 14.3 28.1H7.8C7.3 28 7 27.7 7 27.2Z",fill:"#D5D9DC"})),_v||(_v=l.createElement("path",{d:"M49 27.1999V24.6999C49 24.2999 49.3 23.8999 49.8 23.8999H56.3C56.7 23.8999 57.1 24.1999 57.1 24.6999V27.1999C57.1 27.5999 56.8 27.9999 56.3 27.9999H49.8C49.3 27.9999 49 27.6999 49 27.1999Z",fill:"#D5D9DC"})),bv||(bv=l.createElement("path",{d:"M45.1 14.7001L43.3 12.9001C43 12.6001 43 12.1001 43.3 11.8001L47.9 7.2001C48.2 6.9001 48.7 6.9001 49 7.2001L50.8 9.0001C51.1 9.3001 51.1 9.8001 50.8 10.1001L46.2 14.7001C45.8 15.0001 45.4 15.0001 45.1 14.7001Z",fill:"#D5D9DC"})),Av||(Av=l.createElement("path",{d:"M13.3 9.1002L15.1 7.3002C15.4 7.0002 15.9 7.0002 16.2 7.3002L20.8 11.9002C21.1 12.2002 21.1 12.7002 20.8 13.0002L19 14.8002C18.7 15.1002 18.2 15.1002 17.9 14.8002L13.3 10.2002C13 9.8002 13 9.3002 13.3 9.1002Z",fill:"#D5D9DC"})))}const Cv=l.forwardRef(Sv);t.p;var Mv,kv,zv=e=>{var s,a,t,i,l;const{challenge:n,isPhaseComplete:r}=iv(),{challenge_data:o=[]}=n||{},d=(null===(s=(o.filter(e=>4===e.phase)||[])[0])||void 0===s||null===(a=s.data)||void 0===a?void 0:a.action_statement)||{};return(0,N.jsxs)("section",{className:"overview-section our-solution d-flex gap-4 mb-5",id:"ourSolution",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Cv,{height:64,width:64})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-1",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Our solution",id:"label.our_solution.c129a84d"})}),r(4)?(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"solution",children:[(0,N.jsxs)("p",{children:[(0,N.jsx)("strong",{className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"We will",id:"label.we_will.5daab980"})}),(null===d||void 0===d||null===(t=d.we_will)||void 0===t?void 0:t.value)||"..."]}),(0,N.jsxs)("p",{children:[(0,N.jsx)("strong",{className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"So that",id:"label.so_that.7fc46a9c"})}),(null===d||void 0===d||null===(i=d.so_that)||void 0===i?void 0:i.value)||"..."]}),(0,N.jsxs)("p",{children:[(0,N.jsx)("strong",{className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Ending in",id:"label.ending_in.d7de3f00"})}),(null===d||void 0===d||null===(l=d.ending_in)||void 0===l?void 0:l.value)||"..."]})]})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:4,subphase:1})})]})]})};const Tv=["title","titleId"];
2function Iv(){return Iv=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},Iv.apply(null,arguments)}function Ev(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,Tv);return l.createElement("svg",Iv({width:64,height:64,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,Mv||(Mv=l.createElement("g",{clipPath:"url(#clip0_968_51044)"},l.createElement("path",{d:"M51.6999 0.499902L29.9999 22.0999C29.8999 22.1999 29.7999 22.2999 29.7999 22.3999L24.7999 38.0999C24.5999 38.4999 24.7999 38.8999 25.1999 39.0999C25.3999 39.1999 25.4999 39.1999 25.6999 39.0999L41.4999 34.2999C41.5999 34.2999 41.6999 34.1999 41.7999 34.0999L63.4999 12.5999C63.7999 12.2999 63.7999 11.7999 63.4999 11.4999L52.6999 0.499902C52.3999 0.199902 51.8999 0.199902 51.6999 0.499902ZM58.3999 11.8999L56.0999 14.1999L49.8999 7.8999L52.1999 5.5999L58.3999 11.8999ZM39.4999 30.5999L30.3999 33.3999L33.2999 24.3999L46.9999 10.7999L53.1999 16.9999L39.4999 30.5999Z",fill:"#008087"}),l.createElement("path",{d:"M8.5 42H43.5C43.8 42 44 42.2 44 42.5V45.5C44 45.8 43.8 46 43.5 46H8.5C8.2 46 8 45.8 8 45.5V42.5C8 42.2 8.2 42 8.5 42Z",fill:"#008087"}),l.createElement("path",{d:"M8.5 50H55.5C55.8 50 56 50.2 56 50.5V53.5C56 53.8 55.8 54 55.5 54H8.5C8.2 54 8 53.8 8 53.5V50.5C8 50.2 8.2 50 8.5 50Z",fill:"#008087"}),l.createElement("path",{d:"M60 21.6V60H4V4H42.5L46.5 0H0.8C0.3 0 0 0.3 0 0.8V63.3C0 63.7 0.3 64 0.8 64H63.3C63.7 64 64 63.7 64.1 63.2V17.6L60 21.6Z",fill:"#D5D9DC"}))),kv||(kv=l.createElement("defs",null,l.createElement("clipPath",{id:"clip0_968_51044"},l.createElement("rect",{width:64,height:64,fill:"white"})))))}const Fv=l.forwardRef(Ev);t.p;var Rv=e=>{var s;const{challenge:a,isPhaseComplete:t}=iv(),{challenge_data:i=[]}=a||{},l=i.filter(e=>4===e.phase)||[],{deliverable:n,deliverable_choice:r}=(null===(s=l[1])||void 0===s?void 0:s.data)||{};return(0,N.jsxs)("section",{className:"overview-section final-deliverable d-flex gap-4 mt-2",id:"finalDeliverable",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Fv,{height:64,width:64})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-1",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Final deliverable",id:"label.final_deliverable.ac8cbb05"})}),t(4)?(0,N.jsx)(Ku,{deliverable:n,deliverable_choice:r,show_details:!0}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:4,subphase:2})})]})]})};const Dv=e=>Za.Ay[e]||Za.Ay.classic,Bv=(e,s)=>{var a,t,i;return null===(a=Dv(e))||void 0===a||null===(t=a.phases)||void 0===t||null===(i=t[s])||void 0===i?void 0:i.title},Pv=(e,s)=>{var a,t,i;return null===(a=Dv(e))||void 0===a||null===(t=a.phases)||void 0===t||null===(i=t[s])||void 0===i?void 0:i.tagline},Lv=(e,s,a)=>{var t,i,l,n;const r=null===(t=Dv(e))||void 0===t||null===(i=t.phases)||void 0===i||null===(l=i[s])||void 0===l||null===(n=l.subphases)||void 0===n?void 0:n[a];return"object"===typeof r?null===r||void 0===r?void 0:r.title:r};var Ov=t(56558);class Hv extends l.Component{constructor(s){var a;super(s),a=this,this.confirmHistoryReversion=function(){for(var e,s=arguments.length,t=new Array(s),i=0;i<s;i++)t[i]=arguments[i];const{challenge:{canChangePhaseData:l},intl:{formatMessage:n},onHistoryRevert:r}=a.props,o=null===a||void 0===a||null===(e=a.confirmation_dialog)||void 0===e?void 0:e.current;if(!o||!l())return;const{action:d}=(null===t||void 0===t?void 0:t[2])||{};let c,h,u;if("remove"===d)u=n({id:"label.restore.a76e13b9",defaultMessage:"Restore"}),h=n({id:"label.confirm_restoration.18736f66",defaultMessage:"Confirm restoration"}),c=(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to restore this item?",id:"label.are_you_sure_you_want_to_restore_t.64676f03"})});else u=n({id:"label.revert.0026c505",defaultMessage:"Revert"}),h=n({id:"label.confirm_reversion.0b5c8d3c",defaultMessage:"Confirm reversion"}),c=(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to revert to this version?",id:"label.are_you_sure_you_want_to_revert_to.73965c6b"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Any progress made to the current step after this revision will be reset.",id:"label.any_progress_made_to_the_current_s.8d7625ac"})]});o.show({actions:[o.CancelAction(),o.Action({label:u,onClick:()=>r(...t),variant:"danger"})],body:c,size:"normal",title:h})},this.state={challenge_data_history:[],error:null,loading:!0},this.el=null,this.phase=null,this.subphase=null,this.field_edit_timers=[],this.history_dialog=null,this.confirmation_dialog=(0,l.createRef)(),this.revisions={addChallengeDataHistory:e=>{let{action:a,action_data:t=null,data:i,field_id:l,sub_field_id:n=null}=e;const{app:r,challenge:o,phase:d,subphase:c}=s,{canChangePhaseData:h}=o;if(o.preview||!h())return;r.api.post(`/api/challenges/phase/history/add/${d}/${c}`,{action:a,action_data:t,challenge_id:o.project.id,data:i,field_id:l,sub_field_id:n}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},cancelFieldTimer:function(e,s){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{field_edit_timers:i}=a;for(let a=0;a<i.length;a++){const l=i[a];if(!l)continue;const n=null===l||void 0===l?void 0:l.field_id,r=null===l||void 0===l?void 0:l.sub_field_id,o=null===l||void 0===l?void 0:l.callback,d=null===l||void 0===l?void 0:l.timer;if(n==e&&r==s)return d&&clearTimeout(d),i.splice(a,1),!t&&o&&o(),!0}return!1},generateTextDiff:function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{type:"chars"};const{type:t}=a,i="words"===t?(0,Ov.b2)(e,s):(0,Ov.JJ)(e,s),l=i.filter(e=>!0===e.added),n=i.filter(e=>!0===e.removed),r=l.length>0?`${l.length} addition${l.length>
21?"s":""} `:"",o=n.length>0?`${l.length?"and ":" "}${n.length} deletion${n.length>1?"s":""}`:"",d=(0,N.jsx)("span",{className:"text-diff",children:i.map((e,s)=>(0,N.jsx)("span",{className:""+(e.added?"added":e.removed?"removed":"neutral"),children:e.value},s))});return{additions:{count:l.length,text:r},component:d,deletions:{count:n.length,text:o}}},getChallengeDataHistory:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{challenge_data_history:i}=a.state;let l=i.filter(a=>a.field_id===e&&a.sub_field_id===s);return null!==t&&void 0!==t&&t.length&&(l=l.filter(e=>t.includes(e.action))),l},getChallengeDataHistoryById:e=>{const{challenge_data_history:s}=this.state;return s.filter(s=>s.id==e)},getChallengeDataRemovedFields:e=>{const{challenge_data_history:s}=this.state;return s.filter(s=>s.field_id===e&&"remove"===(null===s||void 0===s?void 0:s.action))},getContributingUserIcons:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const t=a.revisions.getContributingUsers(e,s);return(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>(0,N.jsx)(Ya,{size:25,user:e},s))})},getContributingUsers:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const t=a.revisions.getChallengeDataHistory(e,s),i=[];return t.forEach(e=>{let s=null===e||void 0===e?void 0:e.user;if(!s&&null!==e&&void 0!==e&&e.agent_persona){const a=e.agent_persona;s={id:`agent-${a.id}`,avatar:a.avatar_path?{location:a.avatar_path}:null,fullname:a.name,is_agent:!0}}if(!s)return;i.find(e=>e.id===s.id)||i.push(s)}),i},getFieldTimer:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{field_edit_timers:t}=a,i=t.find(a=>{const t=null===a||void 0===a?void 0:a.field_id,i=null===a||void 0===a?void 0:a.sub_field_id;return t==e&&i==s});return i||!1},hideChallengeDataHistory:()=>{this.history_dialog.hide()},init:async()=>{const{challenge:s}=this.props;if(!s.preview){try{await this.revisions.loadChallengeDataHistory()}catch(e){}s.io&&(s.io.on("challenge-data-history-add",e=>{let{challenge_data_history:s}=e;s&&this.setState(e=>(Array.isArray(e.challenge_data_history)||(e.challenge_data_history=[]),e.challenge_data_history.unshift(s),e))}),s.io.on("challenge-data-history-remove",e=>{let{challenge_data_history_id:s}=e;s&&this.setState(e=>(Array.isArray(e.challenge_data_history)||(e.challenge_data_history=[]),e.challenge_data_history=e.challenge_data_history.filter(e=>e.id!==s),e))}))}},loadChallengeDataHistory:()=>{const{app:e,challenge:s}=this.props,{phase:a,subphase:t}=this.props;return new Promise((i,l)=>{if(s.preview)return i();e.api.get(`/api/challenges/phase/history/${a}/${t}`,{challenge_id:null===s||void 0===s?void 0:s.challenge_id}).then(e=>{let{history:s}=e;this.setState({challenge_data_history:s}),i()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),l(s)})})},setFieldTimer:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;t="function"===typeof t?t:function(){};const l=a.revisions.getFieldTimer(e,s);l&&(a.revisions.cancelFieldTimer(e,s,!0),t=l.callback),a.field_edit_timers.push({callback:t,field_id:e,sub_field_id:s,timer:setTimeout(()=>{a.revisions.cancelFieldTimer(e,s)},i)})},showChallengeDataHistory:function(e,s){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0;a.history_dialog.show(e,s,t,i)}}}async componentDidMount(){const{app:e,challenge:s,el:a,onRef:t,phase:i,subphase:l}=this.props,{user:n}=e;"function"==typeof t&&t(this),this.setState({loading:!0}),this.el=a,this.phase=i,this.subphase=l,await this.revisions.init(),s.io&&s.io.emit("arrive",s.team.id,n,i,l),this.setState({loading:!1})}render(){const{error:e,loading:s}=this.state,{challenge:a,children:t}=this.props;if(a)return(0,N.jsxs)(Ue.A,{className:"project-internal",id:"project-internal-container",tabIndex:"-1",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e}),s&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsxs)(Vv,{value:{addChallengeDataHistory:this.revisions.addChallengeDataHistory,challenge_data_history:this.state.challenge_data_history,generateTextDiff:this.revisions.generateTextDiff,getChallengeDataHistory:this.revisions.getChallengeDataHistory,getChallengeDataHistoryById:this.revisions.getChallengeDataHistoryById,getChallengeDataRemovedFields:this.revisions.getChallengeDataRemovedFields,getContributingUsers:this.revisions.getContributingUsers,phase:this.phase,showChallengeDataHistory:this.revisions.showChallengeDataHistory,subphase:this.subphase},children:[!s&&(0,N.jsx)(N.Fragment,{children:t}),(0,N.jsx)(lj,{onHistoryRevert:this.confirmHistoryReversion,onRef:e=>this.history_dialog=e})]}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}Hv.defaultProps={onHistoryRevert:Function()};var Uv=(0,Ke.Ay)((0,P.G0)(Fa(Hv)));const Qv=l.createContext({}),Vv=Qv.Provider,Gv=Qv.Consumer,Wv=()=>(0,l.useContext)(Qv);const Kv=e=>{const{allowedActions:s,field_id:a,full_descriptor:t,style:i,sub_field_id:l,title:n}=e,{getChallengeDataHistory:r,showChallengeDataHistory:o}=Wv(),d=r(a,l,s);return(0,N.jsxs)(ve.A,{className:"project-field-history-link",disabled:0===(null===d||void 0===d?void 0:d.length),onClick:()=>o(n,a,l,d),style:i,variant:"link",children:[(0,N.jsx)(ze.OKX,{className:"me-1"}),(0,N.jsx)("b",{children:`${(null===d||void 0===d?void 0:d.length)||0} ${t&&(null===d||void 0===d?void 0:d.length)>0?(null===d||void 0===d?void 0:d.length)>1?"revisions":"revision":""}`})]})};Kv.defaultProps={full_descriptor:!1,style:{}};var Yv=Kv;const qv=e=>{const{field_id:s,size:a,sub_field_id:t}=e,{getContributingUsers:i}=Wv();let l=i(s,t);return(0,N.jsx)(Ce.S,{className:"project-field-contributor-user-icons",children:l.map((e,s)=>(0,N.jsx)(Ya,{size:a,style:{lineHeight:a+"px"},user:e},s))})};qv.defaultProps={size:20};var Jv=qv;
2const Xv=e=>{const{challenge_data_history:s,onHistoryRevert:a}=e,{status:t}=Ra(),{formatMessage:i}=(0,ja.A)();return(0,N.jsxs)(ho,{children:[(0,N.jsx)(Kr,{children:(0,N.jsxs)(io,{children:[(0,N.jsx)(so,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(so,{children:(0,N.jsx)(ke.A,{defaultMessage:"Revision",id:"label.revision.2e516d68"})}),(0,N.jsx)(so,{children:(0,N.jsx)(ke.A,{defaultMessage:"Revised at",id:"label.revised_at.42244b52"})}),(0,N.jsx)(so,{})]})}),(0,N.jsx)(Jr,{children:s.map((e,s)=>{const{action:l,action_data:n,agent_persona:r,created_at:o,field_id:d,sub_field_id:c,user:h}=e,u=h||(r?{id:`agent-${r.id}`,avatar:r.avatar_path?{location:r.avatar_path}:null,fullname:r.name,is_agent:!0}:null),m=null===n||void 0===n?void 0:n.value,g=((e,s)=>{switch(!0){case t.completed:return i({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case t.expired:return i({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case 0===e:return i({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,l);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:u}),(0,N.jsx)("strong",{children:u.fullname||""})]})}),(0,N.jsxs)(ro,{children:["add"===l&&(0,N.jsxs)("span",{className:"text-primary d-inline-flex align-items-center gap-1",children:[(0,N.jsx)(ze.E5P,{}),(0,N.jsx)(ke.A,{defaultMessage:"Added",id:"label.added.6b02e0d3"}),(0,N.jsx)("b",{children:m})]}),"remove"===l&&(0,N.jsxs)("span",{className:"text-danger d-inline-flex align-items-center gap-1",children:[(0,N.jsx)(ze.UnJ,{}),(0,N.jsx)(ke.A,{defaultMessage:"Removed",id:"label.removed.4118fb4f"}),(0,N.jsx)("b",{children:m})]}),"revert"===l&&(0,N.jsxs)("span",{className:"text-secondary d-inline-flex align-items-center gap-1",children:[(0,N.jsx)(ze.OKX,{}),(0,N.jsx)(ke.A,{defaultMessage:"Reverted to earlier version",id:"label.reverted_to_earlier_version.caf33a4e"})]})]}),(0,N.jsxs)(ro,{children:[(0,N.jsx)(Gh.XU,{value:o})," ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(ro,{children:(0,N.jsx)(nj,{action:l,disabled:g,onHistoryRevert:()=>a(d,c,e),tooltip:g})})]})})})})]})};const Zv=e=>{const{challenge_data_history:s,onHistoryRevert:a}=e,{formatMessage:t}=(0,ja.A)(),{generateTextDiff:i}=Wv(),{status:l}=Ra(),n=(e,s)=>{const{action:n,action_data:r,agent_persona:o,created_at:d,data:c,field_id:h,sub_field_id:u,user:m}=e,g=m||(o?{id:`agent-${o.id}`,avatar:o.avatar_path?{location:o.avatar_path}:null,fullname:o.name,is_agent:!0}:null),p=((e,s)=>{switch(!0){case l.completed:return t({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case l.expired:return t({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case 0===e:return t({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,n);if("modify_field_text"===n){var x,v;let s=(null===r||void 0===r||null===(x=r.before)||void 0===x?void 0:x.text)||"",t=(null===r||void 0===r||null===(v=r.after)||void 0===v?void 0:v.text)||"";const l=i((0,ad.G9)(s),(0,ad.G9)(t),{type:"words"}),{additions:o,deletions:c}=l;return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:n,disabled:p,onHistoryRevert:()=>a(h,u,e),tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Changed text with {additions}
2 {deletions}",id:"label.changed_text_with_additions_deleti.f187e114",values:{additions:o.text,deletions:c.text}})}),(0,N.jsx)("p",{children:null===l||void 0===l?void 0:l.component})]})})})}if("revert"===n){const e=null===c||void 0===c?void 0:c.identifyAudience,{restored_from:s}=r;let a=s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:s}),", ",(0,N.jsx)(Gh.ib,{value:s})]}):t({id:"label.an_earlier_version.98a84893",defaultMessage:"an earlier version"});return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:n,disabled:!0,tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:a}})}),(0,N.jsx)("p",{children:(0,ad.G9)(null===e||void 0===e?void 0:e.text)||""})]})})})}};return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[(!s||0==s.length)&&(0,N.jsx)(Ce.S,{children:(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No revision history found",id:"label.no_revision_history_found.c4486636"})})}),s.map((e,s)=>(0,N.jsx)(Ce.S,{children:n(e,s)},s))]})})})})};const $v=e=>{const{field_id:s,onHistoryRevert:a,sub_field_id:t}=e,{formatMessage:i}=(0,ja.A)(),{generateTextDiff:l,getChallengeDataRemovedFields:n}=Wv(),{status:r}=Ra(),o=t?e.challenge_data_history:n(s),d=(e,s)=>{const{action:t,action_data:n,agent_persona:o,created_at:d,data:c,field_id:h,sub_field_id:u,user:m}=e,g=m||(o?{id:`agent-${o.id}`,avatar:o.avatar_path?{location:o.avatar_path}:null,fullname:o.name,is_agent:!0}:null),p=((e,s)=>{switch(!0){case r.completed:return i({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case r.expired:return i({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case"remove"!==s&&0===e:return i({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,t);if("modify_field_text"===t){var x,v;let s=(null===n||void 0===n||null===(x=n.before)||void 0===x?void 0:x.text)||"",i=(null===n||void 0===n||null===(v=n.after)||void 0===v?void 0:v.text)||"";const r=l(s,i,{type:"words"}),{additions:o,deletions:c}=r;return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:t,disabled:p,onHistoryRevert:()=>a(h,u,e),tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Changed text with {additions} {deletions}",id:"label.changed_text_with_additions_deleti.f187e114",values:{additions:o.text,deletions:c.text}})}),(0,N.jsx)("p",{children:null===r||void 0===r?void 0:r.component})]})})})}if("modify_field_category"===t){var f,j;let s=(null===n||void 0===n||null===(f=n.before)||void 0===f?void 0:f.category)||"",i=(null===n||void 0===n||null===(j=n.after)||void 0===j?void 0:j.category)||"";const r=l(s,i,{type:"words"});return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:t,disabled:p,onHistoryRevert:()=>a(h,u,e),tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Changed constraint type",id:"label.changed_constraint_type.1ef914f7"})}),(0,N.jsx)("p",{children:null===r||void 0===r?void 0:r.component})]})})})}if("add_field"===t)return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:t,disabled:!0})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Added new constraint",id:"label.added_new_constraint.5041b7d2"})})]})})});if("remove"===t){var _,b;let s=(null===c||void 0===c||null===(_=c.constraint)||void 0===_?void 0:_.category)||"",i=(null===c||void 0===c||null===(b=c.constraint)||void 0===b?void 0:b.text)||"";return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:t,disabled:p,onHistoryRevert:()=>a(h,u,e),tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Removed constraint",id:"label.removed_constraint.f3f92623"})}),(0,N.jsx)(Ce.S,{className:"mt-2",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{xs:3,children:(0,N.jsx)(ve.A,{className:"d-flex align-items-center justify-content-center w-100 ",variant:"primary",style:{height:75,pointerEvents:"none"},children:s||"-"})}),(0,N.jsx)(Ve.A,{xs:9,children:(0,N.jsx)(Ge.A,{body:!0,style:{minHeight:75},children:i||"-"})})]})})]})})})}if("revert"===t){const e=null===c||void 0===c?void 0:c.constraint,{restored_action:s,restored_from:a}=n;let l=a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:a}),", ",(0,N.jsx)(Gh.ib,{value:a})]}):i({id:"label.an_earlier_version.98a84893",defaultMessage:"an earlier version"});const r=()=>"remove"===s?(0,N.jsxs)(Ce.S,{className:"dummy-constraint",children:[(0,N.jsx)(Ce.S,{className:"dummy-constraint-dropdown-btn "+(null!==e&&void 0!==e&&e.category?"active":"inactive"),children:null!==e&&void 0!==e&&e.category?null===e||void 0===e?void 0:e.category:"-"}),(0,N.jsx)(Ce.S,{className:"dummy-constraint-text-field",children:null!==e&&void 0!==e&&e.text?null===e||void 0===e?void 0:e.text:"-"})]}):(0,N.jsx)("p",{children:(null===e||void 0===e?void 0:e.text)||(null===e||void 0===e?void 0:e.category)});return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(Ya,{className:"me-2",size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:t,disabled:!0,tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}
2",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:l}})}),r()]})})})}};return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[(!o||0===o.length)&&(0,N.jsx)(Ce.S,{children:(0,N.jsx)(We.A,{variant:"warning",children:"No revision history found"})}),o.map((e,s)=>(0,N.jsx)(Ce.S,{children:d(e,s)},s))]})})})})};var ef=e=>{const{challenge_data_history:s,getRevisionHistoryRecord:a}=e;return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[(!s||0===s.length)&&(0,N.jsx)(Ce.S,{children:(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:">No revision history found",description:"",id:"label.greaterno_revision_history_found.9ad10322"})})}),(0,N.jsx)(Qe.A,{children:s.map((e,s)=>["modify_share_card","add_share_card","revert"].includes(null===e||void 0===e?void 0:e.action)?(0,N.jsx)(Ue.A,{className:"mb-1",children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{lg:{offset:2,span:8},children:a(e,s)})})},s):(0,N.jsx)(Ve.A,{className:"d-flex",lg:4,md:5,children:a(e,s)}))})]})})})};var sf=e=>{const{utils:s}=(0,n.nm)(),{getColorName:a}=s||{},{action:t,classic:i=!1,field_id:l,onHistoryRevert:r,share:o,tooltip:d}=e,c=(null===o||void 0===o?void 0:o.color)||"white";return(0,N.jsxs)(Ge.A,{className:`share-lane-dummy-card ${i?"classic":""} w-100 ${a(c)}`,children:[(0,N.jsx)(Ce.S,{className:"share-lane-dummy-card-media-content",children:(e=>{if(!e)return(0,N.jsx)(N.Fragment,{});const{data:s,file_type:a}=e;switch(a){case"image":return(0,N.jsx)(Ge.A.Img,{src:`${null===s||void 0===s?void 0:s.link}`});case"video":return(0,N.jsx)("video",{controls:!0,autoPlay:!1,crossOrigin:"anonymous",preload:"auto",style:{maxHeight:"100%",maxWidth:"100%"},children:(0,N.jsx)("source",{src:null===s||void 0===s?void 0:s.link})});case"file":return(0,N.jsx)(uf,{color:c,data:s});case"link":return(0,N.jsx)(af,{data:s,link_bg_color:"white",link_color:"black",text_color:"black"});default:return(0,N.jsx)(N.Fragment,{})}})(o)}),(0,N.jsx)(Ce.S,{className:"share-lane-dummy-card-text-content",children:null===o||void 0===o?void 0:o.text}),(0,N.jsxs)(Ce.S,{className:"share-lane-dummy-card-revision-history",children:[(0,N.jsx)(Jv,{field_id:l,sub_field_id:null===o||void 0===o?void 0:o.id}),"remove"===t?(0,N.jsx)(nj,{action:t,disabled:d,onHistoryRevert:r,tooltip:d}):(0,N.jsx)(Ce.S,{className:"p-2",children:(0,N.jsx)(ze.H_v,{className:"ellipsis-icon",size:18})})]})]})};var af=s=>{const{data:a,link_color:t}=s,{link:i}=a,{image:l,title:n}=i;let r=i;try{r=new URL(i).hostname}catch(e){}const o=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()};return(0,N.jsxs)(N.Fragment,{children:[l&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"link-img",children:[(0,N.jsx)(Ge.A.Img,{src:l,style:{maxHeight:135}}
2),(0,N.jsx)(Qe.A,{className:"link-content",noGutters:!0,children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:i,onClick:e=>o(e),rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)("strong",{className:"link-title",style:{color:"white !important"},children:n}),(0,N.jsxs)("span",{className:"link-url d-flex small",style:{color:"white !important"},children:[r,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:t,size:12,style:{alignSelf:"center"}})]})]})})})})})]})}),!l&&(0,N.jsx)(Ce.S,{className:"link-plain",children:(0,N.jsx)(Qe.A,{className:"link-content",noGutters:!0,children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:i,onClick:e=>o(e),rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)("strong",{className:"link-title",style:{color:"#141414"},children:n}),(0,N.jsxs)("span",{className:"link-url d-flex small",style:{color:t},children:[r,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:t,size:12,style:{alignSelf:"center"}})]})]})})})})})})]})};var tf=t.p+"static/media/icon-download-purple.bf22d7ea12d13522fce825d761fea1cf.svg";var lf=t.p+"static/media/icon-download-orange.682a6d2eee342027bbe84fc570e0a094.svg";var nf=t.p+"static/media/icon-download-black.455cdc37b146ce4311d8913735e29ed4.svg";var rf=t.p+"static/media/icon-download-white.18ee32b51151dc9ef1c652f39ac040dc.svg";var of=t.p+"static/media/icon-download-green.bf22d7ea12d13522fce825d761fea1cf.svg";var df=t.p+"static/media/icon-download-blue.b15e79485e7c41b365c4ad4008265b8c.svg";var cf=t.p+"static/media/icon-download-gray.a04f4d0f10f47eaa540a61d58524a6dd.svg";var hf={black:nf,blue:df,gray:cf,green:of,orange:lf,purple:tf,red:t.p+"static/media/icon-download-red.b9aa76d9131f2068d7ccf31cf82eea7d.svg",white:rf,yellow:lf};var uf=e=>{var s;const{color:a,data:t}=e,{file_name:i,link:l}=t||{},r=(0,n.nm)(),o=r.utils.parseExt(l),{getColorName:d}=(null===r||void 0===r?void 0:r.utils)||{},c="white"===d(a)?"green":d(a),h=null!==(s=null===hf||void 0===hf?void 0:hf[c])&&void 0!==s?s:hf.green;return(0,N.jsx)(Qe.A,{className:"document-content",noGutters:!0,children:(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(Ce.S,{className:"document-container",children:[(0,N.jsx)(Ce.S,{className:"filename-container",children:(()=>{switch(o){case"ppt":case"pptx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.rgF,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:i||"PowerPoint Presentation",id:"label.ppt_presentation"})]});case"doc":case"docx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.WLb,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:i||"Word Document",id:"label.word_document"})]});case"pdf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.kl1,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:i||"PDF Document",id:"label.pdf_document"})]});case"rtf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.t69,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:i||"RTF Document",id:"label.rtf_document"})]});default:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Gp9,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:i||"Uploaded Resource",id:"label.uploaded_resource"})]})}})()}),(0,N.jsx)(ve.A,{href:l,rel:"noopener noreferrer",target:"_blank",variant:"link",children:(0,N.jsx)(Zs.A,{"aria-hidden":!0,height:18,src:`${h}`,width:18})})]})})})};const mf=e=>{const{field_id:s,onHistoryRevert:a,sub_field_id:t}=e,{formatMessage:i}=(0,ja.A)(),{userId:n}=(0,P.nm)(),{generateTextDiff:r,getChallengeDataRemovedFields:o}=Wv(),{status:d}=Ra(),c=t?e.challenge_data_history:o(s),h=(e,s)=>{const{action:t,action_data:l,agent_persona:n,created_at:o,data:c,field_id:h,sub_field_id:u,user:m}=e,g=m||(n?{id:`agent-${n.id}`,avatar:n.avatar_path?{location:n.avatar_path}:null,fullname:n.name,is_agent:!0}:null);if("share_lanes"===h){const n=((e,s)=>{switch(!0){case d.completed:return i({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case d.expired:return i({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case"remove"!==s&&0===e:return i({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,t);if("modify_share_card"===t){const s=null===l||void 0===l?void 0:l.changes;let r=(null===l||void 0===l?void 0:l.before)||{},d=(null===l||void 0===l?void 0:l.after)||{};const c=()=>{let e="";
2return s&&s.forEach((a,t)=>{e+=`${a}`,t<s.length-1&&(t===s.length-2?e+=i({id:"label.and.6201111b",defaultMessage:"and"}):s.length>2&&(e+=", "))}),e};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:n,onHistoryRevert:()=>a(h,u,e),tooltip:n})]})]}),(0,N.jsxs)("small",{className:"mb-1 d-inline-flex gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Edited",id:"label.edited.7117f080"}),(0,N.jsx)("span",{children:c()})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column w-50 share-grid-outer-container",style:{marginRight:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"Before",id:"label.before.9bb72500"})}),(0,N.jsx)(vj,{dummy:!0,field_id:h,share:r})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column w-50 share-grid-outer-container",style:{marginLeft:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"After",id:"label.after.7b68fe55"})}),(0,N.jsx)(vj,{dummy:!0,field_id:h,share:d})]})]})]})}if("add_share_card"===t){const s=null===c||void 0===c?void 0:c.share;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:n,onHistoryRevert:()=>a(h,u,e),tooltip:n})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Added a new card",id:"label.added_a_new_card.3fc61052"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-50 share-grid-outer-container",style:{marginRight:6},children:(0,N.jsx)(vj,{dummy:!0,field_id:h,share:s})})})]})}if("revert"===t){const e=null===c||void 0===c?void 0:c.share,{restored_from:s}=l;let a=s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:s}),", ",(0,N.jsx)(Gh.ib,{value:s})]}):i({id:"label.an_earlier_version.98a84893",defaultMessage:"an earlier version"});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:!0,tooltip:n})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:a}})}),(0,N.jsx)(Ce.S,{noGutters:!0,className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-50 share-grid-outer-container",style:{marginRight:6},children:(0,N.jsx)(vj,{dummy:!0,field_id:h,share:e})})})]})}if("remove"===t){const s=null===c||void 0===c?void 0:c.share;return(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-100",children:(0,N.jsx)(sf,{action:t,field_id:h,onHistoryRevert:()=>a(h,u,e),share:s,tooltip:n})})}}if("need_to_knows"===h){const i=0===s?"Current Version":"";if("modify_field_text"===t){var p,x;let s=(null===l||void 0===l||null===(p=l.before)||void 0===p?void 0:p.value)||"",n=(null===l||void 0===l||null===(x=l.after)||void 0===x?void 0:x.value)||"";const d=r(s,n,{type:"words"}),{additions:c,deletions:m}=d;return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:i,onHistoryRevert:()=>a(h,u,e),tooltip:i})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Changed text with {additions}
2 {deletions}",id:"label.changed_text_with_additions_deleti.f187e114",values:{additions:c.text,deletions:m.text}})}),(0,N.jsx)("p",{children:null===d||void 0===d?void 0:d.component})]})})})}if("add_field"===t)return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:!0})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Added new Need to Know question",id:"label.added_new_need_to_know_question.b8602da6"})})]})})});if("remove"===t){var v;let s=(null===c||void 0===c||null===(v=c.need_to_know)||void 0===v?void 0:v.value)||"";return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,onHistoryRevert:()=>a(h,u,e)})]})]}),(0,N.jsx)("small",{className:"mb-1",children:"Removed Need to Know question"}),(0,N.jsx)(Ce.S,{className:"mt-2",children:(0,N.jsx)(Ge.A,{body:!0,style:{minHeight:75},children:s||"-"})})]})})})}if("revert"===t){const e=null===c||void 0===c?void 0:c.need_to_know,{restored_action:s,restored_from:a}=l;let i=a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:a}),", ",(0,N.jsx)(Gh.ib,{value:a})]}):"an earlier version";const n=()=>"remove"===s?(0,N.jsx)(Ce.S,{className:"mt-2",children:(0,N.jsx)(Ge.A,{body:!0,style:{minHeight:75},children:(null===e||void 0===e?void 0:e.value)||"-"})}):(0,N.jsx)("p",{children:null===e||void 0===e?void 0:e.value});return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:!0})]})]}),(0,N.jsxs)("small",{className:"mb-1",children:["Restored from ",i]}),n()]})})})}}};return(0,N.jsxs)(N.Fragment,{children:["share_lanes"===s&&(0,N.jsx)(ef,{challenge_data_history:c,getRevisionHistoryRecord:h}),"need_to_knows"===s&&(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:null!==c&&void 0!==c&&c.length?(0,N.jsx)(N.Fragment,{children:c.map((e,s)=>(0,N.jsx)(l.Fragment,{children:h(e,s)},s))}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No revision history found",id:"label.no_revision_history_found.c4486636"})})})})})})]})};const gf=e=>{const{canSubmitPhase:s,challenge_type:a,getSubphaseCompletionCount:t,launchPhaseSubmissionModal:i,phase:l,phase_title:n,status:r}=Ra(),{formatMessage:o}=(0,ja.A)(),d=Za.Ay[a]||Za.Ay.classic,{num_phases:c}=d,h=Object.values(d.phases).reduce((e,s)=>e+Object.keys(s.subphases).length,0),u=t(),m=l<c?s(l):s(l)&&u===h,g=o({id:"label.submit_phasetitle.3f39124e",defaultMessage:"Submit {phaseTitle}"},{phaseTitle:n}),p="challenge-phase-submit-button btn-submit "+(m?"pulse":""),x=(()=>{switch(!0){case r.completed:return o({id:"label.this_challenge_has_already_been_co.a11345ac",defaultMessage:"This challenge has already been completed"});case r.expired:return o({id:"label.this_challenge_has_expired.61d87f05",defaultMessage:"This challenge has expired"});case l===c:return o({id:"label.once_all_your_teammates_have_compl.397f3f8c",defaultMessage:"Once all your teammates have completed their feedback you will be able to submit the Reflect Phase"});default:return null}})();return(0,N.jsx)(N.Fragment,{children:x&&!m?(0,N.jsx)(ph,{"aria-label":g,className:p,condition:!0,disabled:x,size:"xl",style:e.style,tooltipContent:x,tooltipPlacement:"top",children:g}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ve.A,{"aria-label":g,className:p,disabled:!m,onClick:()=>{i({phase:l})},size:"xl",style:e.style,children:g})})})};const pf=e=>(0,N.jsx)(Ua.A,{delay:{hide:400,show:250},placement:"right-start",overlay:(0,N.jsx)("div",{style:{backgroundColor:"white",border:"solid 1px #d1d1d6",borderRadius:3,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.16)",color:"black",minWidth:90,padding:"2px 10px",zIndex:1026},children:e&&e.filter_users&&e.filter_users.length>=1&&e.filter_users.map((e,s)=>{var a;return s<=2?null:(0,N.jsxs)(Ce.S,{style:{display:"inline"},children:[(0,N.jsx)(Ya,{style:{height:30,marginRight:5,width:30},user:e&&e.user},`${s}-${e.user.id}`),null===e||void 0===e||null===(a=e.user)||void 0===a?void 0:a.fullname]},s)})}),children:(0,N.jsxs)(Ce.S,{className:"absolute-transform-middle",style:{color:"white"},children:["+",e&&e.filter_users.length-3]})});class xf extends l.Component{constructor(e){super(e),this.state={}}handleRoute(e,s,a){const{history:t}=this.props;t.push(e)}render(){const{app:e,challenge:s,current_subphase:a,data:t,phase:i,subphases:l}=this.props,{challenge_type:n,isSubphaseComplete:r,team_locations:o}=s;let d=0;i&&(2===i&&(d=4),3===i&&(d=5),4===i&&(d=7),5===i&&(d=9));const c=(null===l||void 0===l?void 0:l.length)||1,h=100/(2*c)+"%",u=c>1?100*(c-1)/c+"%":"0%",m=[{phase:i,subphase:a,user:e.user}];if(o)for(const p in o)m.push(o[p]);const g=e.user.id;return(0,N.jsx)(sa.A,{className:"challenge-nav project-container-inner",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(aa.A,{style:{height:"100%",width:"100%"},children:[(0,N.jsx)(Ve.A,{className:"px-0",xs:10,children:(0,N.jsxs)(Ce.S,{className:"phases",style:{position:"relative"},children:[(0,N.jsx)(Ce.S,{className:"bg-line",style:{left:h,width:u}}),l&&l.map((e,s)=>{let a=!1;const o=r(i,s+1),{route:c,title:h}=e;if(m)var u=m.filter((e,t)=>
2!(!e||e.phase!==i||e.subphase!==s+1)&&(e.user.id==g&&(a=!0),e));if(!t||!t[i-1]||!t[d+s])return null;const p=o?"complete":"incomplete";return(0,N.jsx)(Ve.A,{className:"px-0 subphase-segment",xs:12/(l&&l.length),children:(0,N.jsxs)(aa.A.Link,{className:`absolute-transform-middle challenge-nav-link ${p} ${a?"active":""}`,onClick:()=>{this.handleRoute(c,i,s+1)},children:[(0,N.jsx)(Ce.S,{className:"icon-circle absolute-transform-middle subphase",children:o?(0,N.jsx)(ze.CMH,{size:25}):(0,N.jsx)(xr,{challenge_type:n,phase:i,size:5===i&&s+1===3?36:18,subphase:s+1})}),(0,N.jsx)(Ce.S,{className:"user-list",children:u&&u.length>=1&&u.map((e,s)=>s>2?(0,N.jsx)(Ce.S,{className:"more",style:{marginLeft:25},children:(0,N.jsx)(pf,{filter_users:u})}):s>=3?null:(0,N.jsx)(Ce.S,{className:"entry",style:{marginLeft:-5},children:(0,N.jsx)(Ya,{style:{height:30,width:30},user:e&&e.user},`${s}-${e.user.id}`)},`${s}-${e.user.id}`))}),(0,N.jsx)(Ce.S,{"aria-hidden":!0,className:"challenge-nav-title",children:h}),(0,N.jsxs)("span",{className:"visually-hidden",children:["Subphase ",s+1," out of ",l.length,", ",h,", ",o?"Complete":"Incomplete"," ",a&&" Active"]})]},s)},h)})]})}),(0,N.jsx)(Ve.A,{className:"d-flex align-items-center",xs:2,children:(0,N.jsx)(gf,{inChallengeNav:!0})})]})})})}}var vf=(0,n.G0)(Fa((0,Pe.y)(xf)));var ff=e=>{const{challenge_template:s,getPhaseTitle:a,getSubphases:t,is_facilitator:i,phase:l,preview:n,project:r,subphase:o,team:d}=Ra(),c=n||i?106:66,h=t(l),u=a(l);return(0,N.jsx)(nv(),{positionRecheckInterval:100,stickyClassName:"stickied",stickyStyle:{marginTop:c,zIndex:1},topOffset:-1*c,children:(0,N.jsxs)(Ce.S,{className:"challenge-nav-container",children:[(0,N.jsx)(Ce.S,{className:"d-none d-lg-block challenge-banner",style:{backgroundImage:`url(${null===s||void 0===s?void 0:s.banner_path})`}}),(0,N.jsx)(vf,{current_subphase:o,data:r.challenge_data,phase:l,phase_title:u,subphases:h,team:d})]})})};var jf=e=>{const s=(0,Pe.W6)(),{getPhaseLink:a,isLastSubphase:t,isSubphaseComplete:i,phase:l,subphase:n}=Ra();if(!l||!n)return"";const r=1===n;return(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between py-3",children:[(0,N.jsx)(Ce.S,{children:1!==n&&(0,N.jsx)(ve.A,{"aria-label":"Previous activity",className:"btn-prev",disabled:r,onClick:()=>s.push(a(l,n-1)),size:"xl",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})})}),(0,N.jsx)(Ce.S,{children:t()?(0,N.jsx)(gf,{}):(0,N.jsx)(ve.A,{"aria-label":"Next activity",className:"btn-next",onClick:()=>s.push(a(l,n+1)),size:"xl",variant:i(l,n)?"primary":"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})})]})})};const _f=e=>{const{phase:s}=Ra();return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"challenge-hub flex-1",children:[!s&&(0,N.jsx)(on,{}),s&&(0,N.jsx)(ff,{}),(0,N.jsxs)(Ce.S,{className:"project-hub container project-container-inner project-container-footer-offset",children:[e.children,(0,N.jsx)(jf,{})]})]})})};_f.displayName="ChallengeLayout";var bf=_f;const Af=e=>{const{title:s,type:a,value:t}=e,{styles:i}=(0,P.nm)(),l=i.primary,n=i.secondary,r={video:ze.UUG,website:ze.W_G},o=(null===r||void 0===r?void 0:r[a.toLowerCase()])||ze.Gp9;return(0,N.jsx)("a",{className:"guiding-resource-container d-flex p-3 rounded box-shadow-hover-200",href:t,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsxs)(Ce.S,{className:"resource-inner d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{className:"type",children:(0,N.jsx)(Ce.S,{className:"bg-circle d-flex justify-content-center align-items-center",children:(0,N.jsx)(o,{color:l,size:14})})}),(0,N.jsxs)(Ce.S,{className:"descriptors",children:[(0,N.jsx)("strong",{children:s}),(0,N.jsxs)("small",{className:"d-flex align-items-center gap-2 text-secondary",children:[(0,N.jsx)("span",{children:(e=>{const[s,,a]=e.split("/");return`${s}//${a}`})(t)}),(0,N.jsx)(ze.EQc,{color:n,size:12})]})]})]})})};Af.defaultProps={domain:"",title:"",type:"",value:""};var yf=Af;const wf=(0,l.forwardRef)((e,s)=>{const{guiding_resources:a=[]}=e,[t,i,n]=(0,ne.CQ)({error:null,reject:Function(),resolve:Function(),show:!1}),r=()=>{t.resolve(null),n()};return(0,l.useImperativeHandle)(s,()=>({hide:()=>r(),show:()=>new Promise((e,s)=>{i(a=>(0,F.A)((0,F.A)({},a),{},{reject:s,resolve:e,show:!0}))})})),(0,N.jsxs)(xe,{dialogClassName:"guiding-resources-modal",onHide:r,show:t.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Guiding resources",id:"label.guiding_resources.27a607fa"})}),(0,N.jsx)(ke.A,{defaultMessage:"Review the resources below.",id:"label.review_the_resources_below.5c80be88"})]})}),(0,N.jsx)(xe.Body,{className:"p-0",children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(Ce.S,{className:"d-flex flex-column",children:a.map((e,s)=>(0,l.createElement)(yf,(0,F.A)((0,F.A)({},e),{},{key:s})))}):(0,N.jsx)("p",{className:"text-center text-muted p-5",children:(0,N.jsx)(ke.A,{defaultMessage:"No resources are available for this phase.",id:"label.no_resources_are_available_for_thi.9decc382"})})})]})});wf.displayName="GuidingResourcesModal";var Nf=wf;const Sf=(0,l.forwardRef)((e,s)=>{const{questions:a=[]}=e,[t,i,n]=(0,ne.CQ)({questions:a,reject:Function(),resolve:Function(),show:!1});return(0,l.useImperativeHandle)(s,()=>({open:()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((s,a)=>{i({questions:null!=e&&e.length>0?e:t.questions,reject:a,resolve:s,show:!0})})}()})),(0,N.jsxs)(xe,{dialogClassName:"questions-to-consider-modal",divider:!1,onHide:()=>{t.resolve(null),n()},show:t.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Questions to Consider",description:"",id:"label.questions_to_consider.b828f13e"})})})}),(0,N.jsx)(xe.Body,{children:a.map((e,s)=>(0,N.jsxs)("div",{className:"q-container",children:[(0,N.jsx)("div",{className:"q-index",children:s+1}),(0,N.jsx)("div",{className:"q-text",children:e})]},s))})]})});var Cf=Sf;Sf.displayName="QuestionsToConsiderModal";const Mf=(0,l.forwardRef)((e,s)=>{const{dialogClassName:a,label:t,onHide:i,src:n,title:r}=e,[o,d]=(0,ne.CQ)({visible:!1}),{visible:c}=o,h=()=>d({visible:!0}),u=()=>{"function"===typeof i&&i(),d({visible:!1})};return(0,l.useImperativeHandle)(s,()=>({hide:u,show:h})),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-2 align-self-center",onClick:h,variant:"link",children:[(0,N.jsx)(ze.Qro,{}),t]}),(0,N.jsxs)(xe,{backdrop:"static",dialogClassName:a,dismissable:!0,onHide:u,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:r})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Zs.A,{fluid:!0,rounded:!0,alt:"An example of the completed activity",src:n})})]})]})});Mf.displayName="ExampleModal",Mf.defaultProps={dialogClassname:"",example:(0,N.jsx)(ke.A,{defaultMessage:"No example media to show",id:"label.no_example_media_to_show.a55c91c2"}),label:(0,N.jsx)(ke.A,{defaultMessage:"See example",id:"label.see_example.7e6a7f35"}),onHide:Function(),title:(0,N.jsx)(ke.A,{defaultMessage:"Example",id:"label.example.d029f87e"})};var kf=t(52781);const zf=e=>{var s,a,t,i;const{styles:n}=(0,P.nm)(),r=(null===n||void 0===n?void 0:n.primary)||"",{challenge_type:o,getSubphaseTitle:d,phase:c,subphase:h}
2=Ra(),{getSubphaseMetadata:u}=(0,P.hc)(),{launchChallengeOverviewModal:m}=dt(),g=(0,l.useRef)(),p=(0,l.useRef)(),x=null===Za.Ay||void 0===Za.Ay||null===(s=Za.Ay[o])||void 0===s||null===(a=s.phases)||void 0===a||null===(t=a[c])||void 0===t||null===(i=t.subphases)||void 0===i?void 0:i[h],v="classic"!==o&&o?null!==x&&void 0!==x&&x.description?{activity:x.activity,description:x.description,reminder:x.reminder,title:x.title}:null:u(c,h),{activity:f,description:j,duration:_,example:b,reminder:A,title:y}=v||{},{activity_button:w,activity_button_handler:S,card_body_class:C,card_class:M,disable_activity_button:k,guiding_resources:z,questions_to_consider:T,review_challenge:I,revision_history_button:E,show_example:F,show_guiding_resources:R,show_questions_to_consider:D}=e;if(!v){const s=d(c,h);return(0,N.jsxs)(Ce.S,{className:"activity-card-container d-flex flex-column gap-3",children:[s&&(0,N.jsx)("h3",{className:"mb-0",children:s}),e.children]})}return(0,N.jsxs)(Ce.S,{className:"activity-card-container d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-3 align-items-baseline",children:[(0,N.jsx)("h3",{className:"mb-0",style:{flexShrink:0},children:y}),null!=_&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{"aria-hidden":"true",className:"activity-icon icon-time d-flex align-items-center gap-1 justify-content-end justify-content-lg-start",children:[(0,N.jsx)(ze.obD,{size:16}),(0,N.jsx)("strong",{children:`${_}m`})]}),(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated {time} minutes to complete",id:"label.estimated_time_minutes_to_complete.e509310a",values:{time:_}})})]})]}),(0,N.jsx)(Ge.A,{className:`${M} top-card`,children:(0,N.jsx)(Ge.A.Body,{as:Qe.A,className:C,children:(0,N.jsxs)(Ve.A,{className:"activity-meta",xl:9,xs:12,children:[(0,N.jsxs)(Ce.S,{className:"activity-details",children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:j}),A&&(0,N.jsx)("p",{className:"mb-0 mt-2 activity-body-text",children:(0,N.jsx)("em",{children:A})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-2 py-3",children:[I&&(0,N.jsxs)(ve.A,{className:"d-flex gap-2 p-0 align-items-center align-self-start",onClick:async()=>await m(),variant:"link",children:[(0,N.jsx)(Zd.ChallengeFlag,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Review the Challenge",id:"label.review_the_challenge.83ea3777"})})]}),R&&(0,N.jsxs)(ve.A,{className:"d-flex p-0 gap-2 align-items-center align-self-start",onClick:async()=>await g.current.show(),variant:"link",children:[(0,N.jsx)(ze.iq2,{color:{color:r}}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Review guiding resources",id:"label.review_guiding_resources.6b3cd4e8"})})]}),D&&(0,N.jsxs)(ve.A,{className:"d-flex p-0 gap-2 align-items-center align-self-start",onClick:async()=>await p.current.open(),variant:"link",children:[(0,N.jsx)(kf.Blb,{color:{color:r}}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Questions to consider",id:"label.questions_to_consider.28b250ee"})})]})]})]})})}),(0,N.jsx)(Ge.A,{className:`${M}`,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Activity",id:"label.activity.38da1505"})}),F&&b&&(0,N.jsx)(Mf,{dialogClassName:"modal-50vw example-modal",src:b})]}),f&&(0,N.jsx)("p",{className:"instructions",children:f}),(0,N.jsxs)(Ce.S,{className:"activity-actions d-flex flex-column flex-md-row gap-2",children:[(null===w||void 0===w?void 0:w.length)&&(0,N.jsxs)(ve.A,{className:"activity-button d-flex align-items-center gap-1 align-self-start",disabled:k,onClick:S,variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:18}),(0,N.jsx)("span",{children:w})]}),!!E&&E]})]})})}),(0,N.jsx)("hr",{className:"my-4"}),e.children]})}),(0,N.jsx)(Nf,{guiding_resources:z,ref:g}),(0,N.jsx)(Cf,{questions:T,ref:p})]})};zf.defaultProps={activity_button:null,activity_button_handler:Function(),card_body_class:"card-body",card_class:"activity-card",disable_activity_button:!1,guiding_resources:[],questions_to_consider:[],review_challenge:!1,revision_history_button:null,show_example:!1,show_guiding_resources:!1,show_questions_to_consider:!1};var Tf=zf;var If=(0,Ke.Ay)(function(e){let{entry:s,intl:a}=e,t=s&&s.entries&&s.entries.full_token,i=s&&s.entries&&s.entries.description?s.entr
2ies.description:a.formatMessage({id:"label.no_description_available_for_this.d333a534",defaultMessage:"No description available for this standard"});return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("li",{style:{fontSize:".90em"},children:(0,N.jsx)(Ua.A,{newProp:"test",placement:"bottom",trigger:["hover","focus"],overlay:(0,N.jsxs)(Hu.A,{className:"standard-desc-popover",children:[(0,N.jsx)(Ce.S,{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Standard description",description:"",id:"label.standard_description.a8abe1b8"})}),(0,N.jsx)(Ce.S,{className:"description",children:(0,N.jsx)("p",{children:i})})]}),children:(0,N.jsx)(ve.A,{className:"p-0",onClick:e=>{e.preventDefault()},variant:"link",children:t})})})})});var Ef=e=>(0,N.jsx)("tr",{children:(0,N.jsx)("td",{style:{padding:5},children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"No Standards have been added to this challenge...",id:"label.no_standards_have_been_added_to_th.7d20ddf4"})})})});var Ff=e=>{const s=e.data;let a,t,i,l;return s.length?(t=s[0]&&s[0].entries&&s[0].entries.structure&&s[0].entries.structure.name,i=s[0]&&s[0].entries&&s[0].entries.structure&&s[0].entries.structure.token,l=s[0]&&s[0].entries&&s[0].entries.structure&&s[0].entries.structure.id,a=s.map(s=>(0,N.jsx)(If,{entry:s,structure:e.structure},s.id))):a=(0,N.jsx)(Ef,{}),(0,N.jsxs)(Ge.A,{className:"standard-structure-list",children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsxs)("span",{children:[t,"   ","(",i,")"]}),(0,N.jsx)("a",{"aria-controls":"collapse"+l,"aria-expanded":"false","aria-label":"View standards",className:"float-right collapsed chevron","data-target":"#collapse"+l,"data-toggle":"collapse",href:"#collapse"+l,children:(0,N.jsx)(ze.Ucs,{})})]}),(0,N.jsxs)("div",{className:"collapse",id:"collapse"+l,children:[(0,N.jsx)("hr",{"aria-hidden":"true"}),!s&&(0,N.jsx)(Me.y$,{}),s&&(0,N.jsx)("ul",{children:a})]})]})},Rf=t(16065),Df=t(57247),Bf=t(47245),Pf=t(64221);const Lf=e=>{const{color:s,size:a,type:t}=e,i={Image:Rf.default,Link:Bf.default,Other:Pf.default,YouTube:Df.default}[t]||l.Fragment;return(0,N.jsx)(i,{color:s,fontSize:a})};Lf.defaultProps={color:"var(--primary)",size:16};var Of=Lf,Hf=t(46038),Uf=t(40045);class Qf extends l.Component{constructor(e){super(e),this.loadProjectInfo=async()=>{const{app:e,group_member_assignment_component_id:s}=this.props,a=e.api;this.setState({loading:!0});try{const{challenge:e,group_member_assignment_component:t,team:i}=await a.get(`/api/challenges/get/${s}`);this.setState({challenge:e,challenge_template:null===e||void 0===e?void 0:e.challenge_template,group_member_assignment_component:t,loading:!1,team:i})}catch({data:OT,err:err}){OT&&"noexist"===OT.reason?this.setState({challenge:!1,loading:!1,team:!1}):this.setState({error:err})}},this.showMediaViewer=(e,s)=>{const{app:a}=this.props;"YouTube"===e||"Vimeo"===e||"Video"===e?this.setState({show:!0,trigger_video:s},()=>{a.userPerformedAchievementEvent(a.events.EVENT_WATCH_SYLLABUS_VIDEO)}):"Image"===e?this.setState({image:s,show:!0}):"Other"===e&&this.setState({link:s,show:!0})},this.startChallenge=async()=>{const{challenge:e,group_member_assignment_component_id:s,group_member_assignment_id:a,history:t}=this.props,{setLearnerStarted:i}=e,l=`/assignment/${a}/${s}/content`;t.push(l),await i()},this.goBack=()=>{var e,s;const{challenge:a,history:t}=this.props,i=null===a||void 0===a||null===(e=a.assignment)||void 0===e||null===(s=e.assignment)||void 0===s?void 0:s.type,l=null===a||void 0===a?void 0:a.group_member_assignment_id,n="challenge"===i?"/home":`/assignment/${l}/overview`;t.push(n)},this.parseTriggerContentType=e=>{switch(e){case"YouTube":case"Vimeo":return"Video";default:return"Link"}},this.filterEntryStructure=e=>{const s=(0,T.groupBy)(e,function(e){if(e.entries)return e.entries.structure_id});return!(!s||0===Object.entries(s).length&&s.constructor===Object)&&s},this.state={challenge:null,challenge_id:e.match.params.hasOwnProperty("challenge_id")&&e.match.params.challenge_id?e.match.params.challenge_id:"",challenge_template:null,error:null,group_member_assignment_component:null,loading:!1,show:!1,team:null,trigger_video:null}}async componentDidMount(){const{challenge:e}=this.props,{challenge_member:s,challenge_template:a}=e||{};try{await this.loadProjectInfo(),null!==s&&void 0!==s&&s.start||this.showMediaViewer(null===a||void 0===a?void 0:a.trigger_content_type,null===a||void 0===a?void 0:a.trigger_content_url)}catch(t){this.setState({error:t,loading:!1})}}render(){var e,s,a,t,i,l,n,r,o,d,c,h;const{app:u,intl:m,mode:g}=this.props,{formatMessage:p}=m,{isolatedMode:x,userIsLearner:v,utils:f}=u,{challenge:j,challenge_template:_,loading:b}=this.state,{author_avatar_image_path:A,author_bio:y,author_name:w,entries:S,stub:C,subtopics:M,topics:k}=_||{},{styles:z}=u,T=null===C||void 0===C?void 0:C.tags,I="decision_making"===(null===_||void 0===_?void 0:_.challenge_type),E=(null===_||void 0===_?void 0:_.banner_path)||f.default_banner,F=u.utils.parseAudienceRange(null===_||void 0===_?void 0:_.audiences),R=null===j||void 0===j||null===(e=j.assignment)||void 0===e||null===(s=e.assignment)||void 0===s?void 0:s.type;let D={};null!==S&&void 0!==S&&S.length&&(D=this.filterEntryStructure(S));const B=z&&z.black;return(0,N.jsxs)(Ce.S,{className:"challenge-overview d-flex flex-column flex-fill",children:[(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"flex-fill",loading:b,children:(0,N.jsxs)(Ce.S,{className:"challenge-template-syllabus-container",children:[(0,N.jsx)(Ce.S,{className:"banner-black-bg"}),(0,N.jsxs)(Ce.S,{className:"banner-container",children:[v()&&(0,N.jsx)(Ce.S,{className:"back-btn-container",children:!(x&&"challenge"==R)&&(0,N.jsx)(ve.A,{className:"back-btn d-flex align-items-center",onClick:this.goBack,variant:"secondary",children:(0,N.jsx)(ze.QVr,{})})}),(0,N.jsx)(Zs.A,{alt:"",className:"banner-img",src:E}),(0,N.jsx)(Ce.S,{className:"banner-bottom-bar"})]}),(0,N.jsxs)(Ue.A,{style:{position:"relative"},children:[(0,N.jsx)(Zs.A,{alt:"",className:"challenge-template-icon",src:(null===_||void 0===_?void 0:_.cover_path)||xo}),(0,N.jsxs)(Qe.A,{className:"details-with-offset",children:[(0,N.jsxs)(Ve.A,{lg:8,children:[(0,N.jsxs)(Ce.S,{className:"banner-bar-info-container",children:[(0,N.jsxs)(Ce.S,{className:"tpt-container",children:[(0,N.jsx)("h3",{className:"course-title",children:null===_||void 0===_?void 0:_.title}),(0,N.jsxs)(Ce.S,{"aria-hidden":"true",style:{color:"white"},children:[(0,N.jsx)(ze.obD,{className:"me-2"}),(0,N.jsx)("span",{className:"me-3",style:{verticalAlign:"bottom"},children:(0,N.jsx)(ke.A,{defaultMessage:"{total_est_completion_time} mins",id:"label.total_est_completion_time_mins.b204b843",values:{total_est_completion_time:null===_||void 0===_?void 0:_.total_est_completion_time}})})]}),(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated {total_est_completion_time} minutes to complete",id:"label.estimated_total_est_completion_tim.4296c4aa",values:{total_est_completion_time:null===_||void 0===_?void 0:_.total_est_completion_time}})})]}),(0,N.jsxs)(Ce.S,{className:"audience-details-container",children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Grade",id:"label.grade.839e20fb"})}),(0,N.jsx)(Hf.default,{className:"me-2",color:B,fontSize:16}),(0,N.jsx)("span",{children:F})]}),(null===_||void 0===_||null===(a=_.subjects)||void 0===a||null===(t=a[0])||void 0===t||null===(i=t.subjects)||void 0===i?void 0:i.name)&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{className:"body-small",children:"Subject"}),(0,N.jsx)("i",{"aria-hidden":"true",className:"text-primary me-2",style:{display:"inline-block"},children:(0,N.jsx)($n,{color:B,size:16,subject:null===_||void 0===_||null===(l=_.subjects)||void 0===l||null===(n=l[0])||void 0===n||null===(r=n.subjects)||void 0===r?void 0:r.name})}),(0,N.jsx)("span",{children:null!==_&&void 0!==_&&_.subjects&&null!==_&&void 0!==_&&_.subjects[0]&&null!==_&&void 0!==_&&_.subjects[0].subjects&&null!==_&&void 0!==_&&_.subjects[0].subjects.name?null===_||void 0===_?void 0:_.subjects[0].subjects.name:"-"})]}),(null===_||void 0===_?void 0:_.trigger_content_url)&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Watch",id:"label.watch.a71e7573"})}),(0,N.jsxs)(ve.A,{"aria-label":"View media",className:"p-0",style:{color:"initial"},variant:"link",onClick:e=>{e.preventDefault(),this.showMediaViewer(null===_||void 0===_?void 0:_.trigger_content_type,null===_||void 0===_?void 0:_.trigger_content_url)},children:[(0,N.jsx)("i",{"aria-hidden":"true",className:"text-primary me-2 mb-1",style:{display:"inline-block"},children:(0,N.jsx)(Of,{type:null===_||void 0===_?void 0:_.trigger_content_type})}),(0,N.jsx)("span",{className:"m-0 text-primary",children:this.parseTriggerContentType(null===_||void 0===_?void 0:_.trigger_content_type)})]})]})]})]}),(0,N.jsxs)(Ce.S,{className:"challenge-template-details",style:{marginTop:35},children:[(null===_||void 0===_?void 0:_.overview)&&(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:25},children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:null===_||void 0===_?void 0:_.overview}})]}),(null===_||void 0===_?void 0:_.challenge_statement)&&(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:25},children:[(0,N.jsx)("h3",{children:I?(0,N.jsx)(ke.A,{defaultMessage:"Decision question",id:"label.decision_question.8ac79b2c"}):(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:null===_||void 0===_?void 0:_.challenge_statement}})]}),(null===_||void 0===_?void 0:_.challenge_requirements)&&(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:25},children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Requirements",id:"label.requirements.e0cdd07f"})}),(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:null===_||void 0===_?void 0:_.challenge_requirements}})]}),(null===_||void 0===_||null===(o=_.learning_goals)||void 0===o?void 0:o.length)>0&&(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:25},children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objectives",id:"label.learning_objectives.d38eb0fc"})}),null===_||void 0===_?void 0:_.learning_goals.map((e,s)=>{const{value:a}=e;return(0,N.jsxs)(Ce.S,{style:{alignItems:"center",position:"relative"},children:[(0,N.jsx)(ze.CMH,{className:"float-start",size:12,style:{color:"rgb(142,142,142)",left:0,marginBottom:3,marginTop:2.5,position:"absolute",top:2.5}}),(0,N.jsx)("p",{style:{marginLeft:20},children:a})]},s)})]}),(null===_||void 0===_?void 0:_.deliverable_challenges)&&(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:25},children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deliverable formats",id:"label.deliverable_formats.3b66a39f"})}),(0,N.jsx)(Ce.S,{className:"deliverable-challenge-list-container w-100",children:(null===_||void 0===_?void 0:_.deliverable_challenges)&&(null===_||void 0===_?void 0:_.deliverable_challenges.map((e,s)=>(0,N.jsx)(Em,{deliverable_challenge:e},s)))})]})]})]}),(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:15},children:[(0,N.jsx)(ve.A,{block:!0,onClick:this.startChallenge,size:"lg",style:{color:"white",height:60,width:"100%"},children:(0,N.jsx)("h5",{className:"m-0",children:"review"!==g?I?(0,N.jsx)(ke.A,{defaultMessage:"Decide now",id:"label.decide_now.8b60cfd1"}):(0,N.jsx)(ke.A,{defaultMessage:"Solve now",id:"label.solve_now.87f4855e"}):(0,N.jsx)(ke.A,{defaultMessage:"Review",id:"label.review.aff0766a"})})}),!(null===T||void 0===T||!T.length)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{className:"mt-3 mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),T.map((e,s)=>{let{tag:a}=e;return(0,N.jsx)(Co,{tag:a},s)})]}),!!k&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{className:"mt-3 mb-3",children:(0,N.jsx)(hc.A,{value:null===k||void 0===k?void 0:k.length,one:p({id:"label.topic.7e61847d",defaultMessage:"Topic"}),other:p({id:"label.topics.e22820fc",defaultMessage:"Topics"})})}),k.map(e=>{var s;return(0,N.jsx)(bo.A,{pill:!0,style:{fontSize:14,marginBottom:6,marginRight:11},variant:"blue",children:(null===e||void 0===e?void 0:e.topics)&&(null===e||void 0===e||null===(s=e.topics)||void 0===s?void 0:s.name)},e.id)})]}),!!M&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{className:"mt-3 mb-3",children:(0,N.jsx)(hc.A,{value:null===M||void 0===M?void 0:M.length,one:p({id:"label.subtopic.79a01754",defaultMessage:"Subtopic"}),other:p({id:"label.subtopics.fad32c49",defaultMessage:"Subtopics"})})}),M.map(e=>(0,N.jsx)(bo.A,{pill:!0,style:{fontSize:14,marginBottom:6,marginRight:11},variant:"purple",children:e.subtopics&&e.subtopics.name},e.id))]}),!!D&&Object.entries(D).length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{className:"mt-3 mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Standards",id:"label.standards.b9a13629"})}),Object.entries(D).map(e=>{let[s,a]=e;return(0,N.jsx)(Ve.A,{className:"p-0 mb-3",children:(0,N.jsx)(Ff,{data:a})},s)})]}),(0,N.jsx)("h5",{className:"my-3",style:{margin:0},children:(0,N.jsx)(ke.A,{defaultMessage:"About the author",id:"label.about_the_author.708041b4"})}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Zs.A,{alt:"",className:"float-start",src:A||Uf,style:{borderRadius:"50%",height:50,marginRight:15,width:50}}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{style:{marginTop:2.5},children:w||(0,N.jsx)(ke.A,{defaultMessage:"Solvably",id:"label.solvably.c7989556"})}),(0,N.jsx)("p",{children:y||(0,N.jsx)(ke.A,{defaultMessage:"No biography available",id:"label.no_biography_available.191d7e2b"})})]})]})]})})]})]})]})}),(0,N.jsxs)(xe,{onHide:()=>this.setState({show:!1}),show:this.state.show,size:"xl",children:[(0,N.jsxs)(xe.Body,{className:"p-0",style:{aspectRatio:16/9},children:[!(null===this||void 0===this||null===(d=this.state)||void 0===d||!d.trigger_video)&&(0,N.jsx)(Bm,{type:"Video",url:this.state.trigger_video}),!(null===this||void 0===this||null===(c=this.state)||void 0===c||!c.link)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"{title}
2: Trigger Content",id:"label.title_trigger_content.da4d7845",values:{title:null===_||void 0===_?void 0:_.title}})}),(0,N.jsx)(Bm,{type:"Other",url:this.state.link})]}),!(null===this||void 0===this||null===(h=this.state)||void 0===h||!h.image)&&(0,N.jsx)(Bm,{alt:`${null===_||void 0===_?void 0:_.title} Trigger Content`,type:"Image",url:this.state.image})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:()=>{this.setState({show:null})},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})]})}}var Vf=(0,P.G0)(Fa((0,Pe.y)((0,Ke.Ay)(Qf))));var Gf=e=>{let{length:s,max:a=3e3,min:t=0}=e;const{styles:i}=(0,n.nm)(),l=i&&i.primary;return(0,N.jsxs)("div",{className:"word-count-component-container",children:[(0,N.jsxs)("span",{className:"words",children:[s||0," words"]}),(0,N.jsx)("span",{className:"icon",children:t<=s&&a>=s?(0,N.jsx)(ze.CMH,{style:{color:l}}):(0,N.jsx)(ze.QCr,{style:{color:"red"}})})]})};const Wf=(0,l.forwardRef)((e,s)=>{const{btnLabel:a="Button Label",placeholder:t="Write at least 5 words...",title:i="Modal Title"}=e,{utils:r}=(0,n.nm)(),{countWords:o}=r,[d,c,h]=(0,ne.CQ)({reject:Function,resolve:Function()}),[u,m,g]=(0,ne.CQ)({error:null,show:!1,text:""}),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((s,a)=>{c({reject:a,resolve:s}),m((0,F.A)((0,F.A)({},u),{},{show:!0,text:null!=e?e:""}))})},x=()=>{h(),g()};return(0,l.useImperativeHandle)(s,()=>({edit:e=>p(e),hide:()=>x(),show:()=>p()})),(0,N.jsxs)(xe,{dialogClassName:"textarea-input-modal",onHide:x,show:u.show,size:"md",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("h3",{children:i})})}),(0,N.jsxs)(xe.Body,{className:"textarea-input-modal-body",children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("textarea",{className:"form-control mb-2 card-text-area",defaultValue:u.text,onChange:e=>m((0,F.A)((0,F.A)({},u),{},{text:e.currentTarget.value})),placeholder:t,rows:4}),(0,N.jsx)(Gf,{length:o(u.text),max:25,min:5})]}),(0,N.jsx)("div",{children:(0,N.jsx)(ve.A,{className:"w-100 mt-3",disabled:o(u.text)<5||o(u.text)>25,onClick:()=>{d.resolve(u.text),x()},style:{padding:"13px 24px"},variant:"primary",children:a})})]})]})});var Kf=Wf;Wf.displayName="TextAreaModal";class Yf extends l.Component{constructor(s){var a;super(s),a=this,this.clearError=()=>this.setState({error:null}),this.handleAdd=async()=>{try{const e=await this.text_area_modal.current.show(),{challenge:s}=this.props,{changePhaseData:a,getPhaseData:t}=s,i=t(this.phase,this.subphase)||{},{need_to_knows:l={}}=i||{},n=Object.keys(l||{}).length||0;if(n>=8)return;const r=(0,me.A)(),o={research_lane:n,value:e};l[r]=o,i.need_to_knows=l,await a(this.phase,this.subphase,i),this.handler.revisions.addChallengeDataHistory({action:"add_field",action_data:{},data:{need_to_know:o},field_id:"need_to_knows",sub_field_id:r});const d=t(2,2)||{},{share_lanes:c=[]}=d;d.share_lanes=[...c,[]],await a(2,2,d)}catch(e){(0,xa.Err)(e)}},this.handleEdit=async function(s){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{a.setState({txt_btn_lbl:"Edit Question"});const e=await a.text_area_modal.current.edit(t);a.setState({txt_btn_lbl:"Add Question"});const{challenge:i}=a.props,{changePhaseData:l,getPhaseData:n}=i,r=n(a.phase,a.subphase)||{};let{need_to_knows:o}=r;o[s].value=e,r.need_to_knows=o,await l(a.phase,a.subphase,r),a.handler.revisions.addChallengeDataHistory({action:"edit_field",action_data:{},data:{need_to_know:o[s]},field_id:"need_to_knows",sub_field_id:s})}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(a)}},this.handleRemove=async s=>{try{const{challenge:e}=this.props,{changePhaseData:a,getPhaseData:t}=e,i=t(this.phase,this.subphase)||{},{need_to_knows:l}=i,n=null===l||void 0===l?void 0:l[s],r=Object.keys(l).indexOf(s);for(const[s,h]of Object.entries(l))(null===h||void 0===h?void 0:h.research_lane)>(null===n||void 0===n?void 0:n.research_lane)&&(l[s].research_lane-=1);delete l[s],i.need_to_knows=l,await a(this.phase,this.subphase,i),this.handler.revisions.addChallengeDataHistory({action:"remove",action_data:{},data:{need_to_know:n},field_id:"need_to_knows",sub_field_id:s});const o=t(2,2)||{},{share_lanes:d}=o,c=null===d||void 0===d?void 0:d[n.research_lane];if(!c||null!==c&&void 0!==c&&c.length)return c?console.log(`Research lane ${r} is not empty, aborting...`):console.log(`Research lane ${r} doesn't exist, aborting...`);console.log(`Lane ${r} is empty, deleting...`),o.share_lanes=o.share_lanes.filter((e,s)=>s!==r),await a(2,2,o)}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(a)}},this.handleConfirmRemoval=e=>{var s;const a=null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:{formatMessage:t}}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:t({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:()=>this.handleRemove(e),size:"sm",variant:"danger"})],body:t({id:"label.are_you_sure_you_want_to_remove_th.a2218826",defaultMessage:"Are you sure you want to remove this question?"}),title:t({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},this.handleHistoryRevert=async(s,a,t)=>{try{const{id:e,action:l,action_data:n,created_at:r,data:o}=t,{challenge:d}=this.props,{canChangePhaseData:c,changePhaseData:h,getPhaseData:u,project:m}=d;if(!c())return;const g=u(this.phase,this.subphase),p=Object.keys(g.need_to_knows||{}).length||0;if(!l)return;if("need_to_knows"===s){var i;if("modify_field_text"===l)g.need_to_knows[a].value=(null===o||void 0===o||null===(i=o.need_to_know)||void 0===i?void 0:i.value)||"",h(this.phase,this.subphase,g);if("remove"===l){const{app:t}=this.props,i=t.api;o.need_to_know&&(o.need_to_know.research_lane=p,g.need_to_knows[a]=o.need_to_know),h(this.phase,this.subphase,g),await i.post(`/api/challenges/phase/history/delete/${e}`,{action:l,action_data:n,challenge_id:m.id,data:o,field_id:s,sub_field_id:a}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})});const r=u(2,2)||{},{share_lanes:d=[]}=r;r.share_lanes=[...d,[]],await h(2,2,r)}this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:e,restored_action:l,restored_from:r},data:o,field_id:"need_to_knows",sub_field_id:a})}this.handler.revisions.hideChallengeDataHistory()}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(a)}},this.phase=2,this.subphase=1,this.handler=null,this.state={error:null,txt_btn_lbl:"Add Question"},this.text_area_modal=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)()}render(){var e,s,a;const{challenge:t}=this.props,{canChangePhaseData:i,getPhaseData:l}=t,n=!i(),r=l(this.phase,this.subphase),o=Object.entries(null!==(e=null===r||void 0===r?void 0:r.need_to_knows)&&void 0!==e?e:[]).map(e=>{let[s,{research_lane:a,value:t=""}]=e;return{id:s,question:t,research_lane:a}}).sort((e,s)=>e.research_lane-s.research_lane);return(0,N.jsxs)(Ce.S,{className:"subphase-content challenge-2-1",children:[(0,N.jsxs)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:[(0,N.jsxs)(Tf,{activity_button:"Add Question",activity_button_handler:this.handleAdd,disable_activity_button:n||Object.keys(o).length>=8,revision_history_button:(0,N.jsx)(rj,{field_id:"need_to_knows"}
2),show_example:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsxs)(Ce.S,{className:`need-to-know-grid ${null!==(s=Object.keys(o))&&void 0!==s&&s.length?"justify-content-center":"justify-content-start"} justify-content-md-start`,children:[!(null===o||void 0===o||!o.length)&&(0,N.jsx)(N.Fragment,{children:o.map((e,s)=>{let{id:a,question:t}=e;return(0,N.jsx)(Xf,{idx:s,onEdit:e=>this.handleEdit(a,e),onRemoveNeedToKnow:this.handleConfirmRemoval,subFieldId:a,value:t},s)})}),!(null!==(a=Object.keys(o))&&void 0!==a&&a.length)&&(0,N.jsx)(ve.A,{className:"need-to-know-placeholder rounded text-decoration-none",disabled:n,onClick:this.handleAdd,variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center gap-1 text-primary",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add a question",id:"label.add_a_question.8d62c67a"})]})})]})]}),(0,N.jsx)(Kf,{btnLabel:this.state.txt_btn_lbl,ref:this.text_area_modal,title:"Edit Question"===this.state.txt_btn_lbl?(0,N.jsx)(ke.A,{defaultMessage:"Edit a question",id:"label.edit_a_question.c42b1e0c"}):(0,N.jsx)(ke.A,{defaultMessage:"Add a question",id:"label.add_a_question.8d62c67a"})})]}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}var qf=(0,P.G0)((0,Ke.Ay)(Fa(Yf)));const Jf=e=>{var s;const{action:a,dummy:t,idx:i,onEdit:l,onHistoryRevert:n,onRemoveNeedToKnow:r,subFieldId:o,tooltip:d,value:c}=e,{formatMessage:h}=(0,ja.A)(),{canChangePhaseData:u,getPhaseData:m}=Ra(),{need_to_knows:g={}}=m(2,1),p=null===(s=Object.entries(g))||void 0===s?void 0:s.length,x=!u(),{share_lanes:v=[]}=m(2,2),f=(e,s)=>{var a;return!(null!==v&&void 0!==v&&null!==(a=v[s])&&void 0!==a&&a.length)},j=p<8?d:h({id:"label.a_maximum_of_8_questions_are_allow.e94ba3c4",defaultMessage:"A maximum of 8 questions are allowed. Please remove one if you'd like to restore this card."});return(0,N.jsx)(Ge.A,{className:"need-to-know-card",children:(0,N.jsxs)(Ce.S,{className:"need-to-know-inner",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-nowrap",children:[(0,N.jsx)(Ce.S,{className:"index",children:isNaN(Number.parseInt(i))?"\u2014":i+1}),(0,N.jsx)(Ce.S,{className:"description",children:c})]}),(0,N.jsxs)(Ce.S,{className:"bottom",children:[(0,N.jsxs)(Ce.S,{className:"history position-relative",style:{right:""+(null==a?"8px":"")},children:[(0,N.jsx)(Jv,{field_id:"need_to_knows",sub_field_id:o}),"remove"===a&&(0,N.jsx)(nj,{action:a,disabled:!!j,onHistoryRevert:n,style:{bottom:""+(null!=a?16:22)},tooltip:j})]}),!t&&(0,N.jsx)("div",{className:"options",children:(0,N.jsxs)(li.A,{children:[(0,N.jsx)(Oa,{condition:!x&&!f(0,i),wrapper:e=>(0,N.jsx)(Ua.A,{placement:"bottom",trigger:["hover","focus"],overlay:(0,N.jsx)(Qa.A,{id:"need-to-know-edit-disabled",children:(0,N.jsx)(ke.A,{defaultMessage:"You cannot modify a question which contains research cards in the next phase.",id:"label.you_cannot_modify_a_question_which.0d460692"})}),children:(0,N.jsx)("div",{children:e})}),children:(0,N.jsx)(li.A.Toggle,{className:"text-secondary",disabled:!f(0,i),title:"Actions",variant:"link",children:(0,N.jsx)(Pm.ZZB,{size:16})})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Item,{className:"d-flex align-items-center gap-2",onClick:()=>l(c),children:[(0,N.jsx)(jr,{path:"pen_2/pen-2.svg",size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(li.A.Item,{className:"d-flex align-items-center gap-2",disabled:!f(0,i),onClick:()=>r(o),children:[(0,N.jsx)(jr,{path:"bin/bin.svg",size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})]})})]})]})})};Jf.defaultProps={action:null,dummy:!1,idx:null,onEdit:Function(),onHistoryRevert:Function(),onRemoveNeedToKnow:Function(),tooltip:null,value:""};var Xf=Jf;const Zf=e=>{const{challenge_data_history:s,onHistoryRevert:a}=e,{formatMessage:t}=(0,ja.A)(),{status:i}=Ra();return(0,N.jsx)(ef,{challenge_data_history:s,getRevisionHistoryRecord:(e,s)=>{const{action:l,action_data:n,agent_persona:r,created_at:o,data:d,field_id:c,sub_field_id:h,user:u}=e,m=u||(r?{id:`agent-${r.id}`,avatar:r.avatar_path?{location:r.avatar_path}:null,fullname:r.name,is_agent:!0}:null),g=((e,s)=>{switch(!0){case i.completed:return t({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case i.expired:return t({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case"remove"!==s&&0===e:return t({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,l);if("modify_share_card"===l){const s=null===n||void 0===n?void 0:n.changes;let i=(null===n||void 0===n?void 0:n.before)||{},r=(null===n||void 0===n?void 0:n.after)||{};const d=()=>{let e="";return s&&s.map((a,i)=>{e+=`${a}`,i<s.length-1&&(i===s.length-2?e+=t({id:"label.and.6201111b",defaultMessage:"and"}):s.length>2&&(e+=", "))}),e};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:l,disabled:g,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsxs)("small",{className:"mb-1 d-inline-flex gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Edited",id:"label.edited.7117f080"}),(0,N.jsx)("span",{children:d()})]}),(0,N.jsxs)(Ce.S,{noGutters:!0,className:"d-flex justify-content-between",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column w-50",style:{marginRight:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"Before",id:"label.before.9bb72500"})}),(0,N.jsx)(sf,{classic:!0,field_id:c,share:i})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column w-50",style:{marginLeft:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"After",id:"label.after.7b68fe55"})}),(0,N.jsx)(sf,{classic:!0,field_id:c,share:r})]})]})]})}if("add_share_card"===l){const s=null===d||void 0===d?void 0:d.share;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:l,disabled:g,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Added a new card",i
2d:"label.added_a_new_card.3fc61052"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-50",style:{marginRight:6},children:(0,N.jsx)(sf,{classic:!0,field_id:c,share:s})})})]})}if("revert"===l){const e=null===d||void 0===d?void 0:d.share,{restored_from:s}=n;let a=s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:s}),", ",(0,N.jsx)(Gh.ib,{value:s})]}):t({id:"label.an_earlier_version.98a84893",defaultMessage:"an earlier version"});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:l,disabled:!0,tooltip:g})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:a}})}),(0,N.jsx)(Ce.S,{noGutters:!0,className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-50",style:{marginRight:6},children:(0,N.jsx)(sf,{classic:!0,field_id:c,share:e})})})]})}if("remove"===l){const{need_to_know:s}=d;return(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-100",style:{marginBottom:12},children:(0,N.jsx)(Xf,{action:l,dummy:!0,onHistoryRevert:()=>a(c,h,e),subFieldId:c,tooltip:g,value:s.value})})}}})};const $f=e=>{const{challenge_data_history:s,onHistoryRevert:a}=e,{userId:t}=(0,P.nm)(),{formatMessage:i}=(0,ja.A)(),{status:l}=Ra();return(0,N.jsx)(ef,{challenge_data_history:s,getRevisionHistoryRecord:(e,s)=>{const{action:t,action_data:n,agent_persona:r,created_at:o,data:d,field_id:c,sub_field_id:h,user:u}=e,m=u||(r?{id:`agent-${r.id}`,avatar:r.avatar_path?{location:r.avatar_path}:null,fullname:r.name,is_agent:!0}:null),g=((e,s)=>{switch(!0){case l.completed:return i({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case l.expired:return i({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case"remove"!==s&&0===e:return i({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,t);if("modify_share_card"===t){const s=null===n||void 0===n?void 0:n.changes;let l=(null===n||void 0===n?void 0:n.before)||{},r=(null===n||void 0===n?void 0:n.after)||{};const d=()=>{let e="";return s&&s.map((a,t)=>{e+=`${a}`,t<s.length-1&&(t===s.length-2?e+=i({id:"label.and.6201111b",defaultMessage:"and"}):s.length>2&&(e+=", "))}),e};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)("div",{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:g,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsxs)("small",{className:"mb-1 d-inline-flex gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Edited",id:"label.edited.7117f080"}),(0,N.jsx)("span",{children:d()})]}),(0,N.jsxs)("div",{noGutters:!0,className:"d-flex justify-content-between",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:[(0,N.jsxs)("div",{className:"d-flex flex-column w-50",style:{marginRight:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"Before",id:"label.before.9bb72500"})}),(0,N.jsx)(sf,{classic:!0,field_id:c,share:l})]}),(0,N.jsxs)("div",{className:"d-flex flex-column w-50",style:{marginLeft:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"After",id:"label.after.7b68fe55"})}),(0,N.jsx)(sf,{classic:!0,field_id:c,share:r})]})]})]})}if("add_share_card"===t){const s=null===d||void 0===d?void 0:d.share;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)("div",{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:g,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Added a new card",i
2d:"label.added_a_new_card.3fc61052"})}),(0,N.jsx)("div",{className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)("div",{className:"d-flex flex-column w-50 share-grid-outer-container",style:{marginRight:6},children:(0,N.jsx)(sf,{classic:!0,field_id:c,share:s})})})]})}if("revert"===t){const e=null===d||void 0===d?void 0:d.share,{restored_from:s}=n;let a=s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:s}),", ",(0,N.jsx)(Gh.ib,{value:s})]}):(0,N.jsx)(ke.A,{defaultMessage:"an earlier version",id:"label.an_earlier_version.98a84893"});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)("div",{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:!0,tooltip:g})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:a}})}),(0,N.jsx)("div",{className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)("div",{className:"d-flex flex-column w-50",style:{marginRight:6},children:(0,N.jsx)(sf,{classic:!0,field_id:c,share:e})})})]})}if("remove"===t){const s=null===d||void 0===d?void 0:d.share;return(0,N.jsx)("div",{className:"d-flex flex-column w-100 share-lane-outer-container",children:(0,N.jsx)(sf,{classic:!0,action:t,field_id:c,onHistoryRevert:()=>a(c,h,e),share:s,tooltip:g})})}}})};const ej=e=>{const{challenge_data_history:s,onHistoryRevert:a}=e,{userId:t}=(0,P.nm)(),{formatMessage:i}=(0,ja.A)(),{status:l}=Ra();return(0,N.jsx)(ef,{challenge_data_history:s,getRevisionHistoryRecord:(e,s)=>{const{action:t,action_data:n,agent_persona:r,created_at:o,data:d,field_id:c,sub_field_id:h,user:u}=e,m=u||(r?{id:`agent-${r.id}`,avatar:r.avatar_path?{location:r.avatar_path}:null,fullname:r.name,is_agent:!0}:null),g=((e,s)=>{switch(!0){case l.completed:return i({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case l.expired:return i({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case"remove"!==s&&0===e:return i({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,t);if("modify_share_card"===t){const s=null===n||void 0===n?void 0:n.changes;let l=(null===n||void 0===n?void 0:n.before)||{},r=(null===n||void 0===n?void 0:n.after)||{};const d=()=>{let e="";return s&&s.map((a,t)=>{e+=`${a}`,t<s.length-1&&(t===s.length-2?e+=i({id:"label.and.6201111b",defaultMessage:"and"}):s.length>2&&(e+=", "))}),e};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:g,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsxs)("p",{className:"small mb-1 d-inline-flex gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Edited",id:"label.edited.7117f080"}),(0,N.jsx)("span",{children:d()})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column w-50",style:{marginRight:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"Before",id:"label.before.9bb72500"})}),(0,N.jsx)(sf,{classic:!0,field_id:c,share:l})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column w-50",style:{marginLeft:6},children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"After",id:"label.after.7b68fe55"})}),(0,N.jsx)(sf,{classic:!0,field_id:c,share:r})]})]})]})}if("add_share_card"===t){const s=null===d||void 0===d?void 0:d.share;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:g,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Added a new card",description:"",id:"label.added_a_new_card.3fc61052"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-50",style:{marginRight:6},children:(0,N.jsx)(sf,{classic:!0,field_id:c,share:s})})})]})}if("revert"===t){const s=null===d||void 0===d?void 0:d.share,{restored_from:i}=n;let l=i?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:i}),", ",(0,N.jsx)(Gh.ib,{value:i})]}
2):(0,N.jsx)(ke.A,{defaultMessage:"an earlier version",id:"label.an_earlier_version.98a84893"});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:m}),(0,N.jsx)("strong",{children:m.fullname})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:o}),", ",(0,N.jsx)(Gh.ib,{value:o})]}),(0,N.jsx)(nj,{action:t,disabled:!0,onHistoryRevert:()=>a(c,h,e),tooltip:g})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:l}})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center",style:{borderBottom:"1px solid #AEB0B2",padding:"24px 0"},children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-50",style:{marginRight:6},children:(0,N.jsx)(sf,{classic:!0,field_id:c,share:s})})})]})}if("remove"===t){const s=null===d||void 0===d?void 0:d.share;return(0,N.jsx)(Ce.S,{className:"d-flex flex-column w-100",children:(0,N.jsx)(sf,{classic:!0,action:t,field_id:c,onHistoryRevert:()=>a(c,h,e),share:s,tooltip:g})})}}})};const sj=e=>{const{challenge_data_history:s,onHistoryRevert:a}=e,{formatMessage:t}=(0,ja.A)(),{generateTextDiff:i}=Wv(),{status:l}=Ra(),n=(e,s)=>{const{action:n,action_data:r,agent_persona:o,created_at:d,data:c,field_id:h,sub_field_id:u,user:m}=e,g=m||(o?{id:`agent-${o.id}`,avatar:o.avatar_path?{location:o.avatar_path}:null,fullname:o.name,is_agent:!0}:null),p=((e,s)=>{switch(!0){case l.completed:return t({id:"label.cannot_make_changes_to_a_completed.f2ded8a6",defaultMessage:"Cannot make changes to a completed challenge"});case l.expired:return t({id:"label.cannot_make_changes_to_an_expired.af7972be",defaultMessage:"Cannot make changes to an expired challenge"});case 0===e:return t({id:"label.current_version.a74487de",defaultMessage:"Current version"});case"revert"===s:return!0;default:return!1}})(s,n);if("modify_field_text"===n){var x,v;let s=(null===r||void 0===r||null===(x=r.before)||void 0===x?void 0:x.value)||"",t=(null===r||void 0===r||null===(v=r.after)||void 0===v?void 0:v.value)||"";const l=i((0,ad.G9)(s),(0,ad.G9)(t),{type:"words"}),{additions:o,deletions:c}=l;return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1",children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:n,disabled:p,onHistoryRevert:()=>a(h,u,e),tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Changed text with {additions} {deletions}",id:"label.changed_text_with_additions_deleti.f187e114",values:{additions:o.text,deletions:c.text}})}),(0,N.jsx)("p",{children:null===l||void 0===l?void 0:l.component})]})})})}if("revert"===n){const e=null===c||void 0===c?void 0:c.statement,{restored_from:s}=r;let a=s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:s}),", ",(0,N.jsx)(Gh.ib,{value:s})]}):t({id:"label.an_earlier_version.98a84893",defaultMessage:"an earlier version"});return(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:{offset:2,span:8},style:{borderBottom:"1px solid #AEB0B2",padding:"24px"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:20,user:g}),(0,N.jsx)("strong",{children:g.fullname})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1",children:[(0,N.jsxs)("small",{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:d}),", ",(0,N.jsx)(Gh.ib,{value:d})]}),(0,N.jsx)(nj,{action:n,disabled:!0,tooltip:p})]})]}),(0,N.jsx)("small",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Restored from {restoredFrom}
2",id:"label.restored_from_restoredfrom.280775a3",values:{restoredFrom:a}})}),(0,N.jsx)("p",{children:(null===e||void 0===e?void 0:e.value)||""})]})})})}};return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(Ce.S,{children:n(e,s)},s))}):(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No revision history found",id:"label.no_revision_history_found.c4486636"})})})})})})};var aj={"1-1":Xv,"1-2":Zv,"1-3":$v,"1-4":mf,"2-1":Zf,"2-2":$f,"3-1":ej,"4-1":sj};var tj=e=>{const{challenge_data_history:s,field_id:a,onHistoryRevert:t,sub_field_id:i}=e,{phase:l,subphase:n}=Ra(),r=null===aj||void 0===aj?void 0:aj[`${l}-${n}`];return(0,N.jsx)(Qe.A,{className:"history-list-formatter",id:"historyListFormatter",children:!!r&&(0,N.jsx)(r,{challenge_data_history:s,field_id:a,onHistoryRevert:t,sub_field_id:i})})};class ij extends l.Component{constructor(e){var s;super(e),s=this,this.state={body:null,error:null,loading:!1,show:!1,title:e.intl.formatMessage({id:"label.revision_history.5ae0d3d1",defaultMessage:"Revision history"})},this.hide=()=>this.setState({show:!1}),this.show=function(e,a){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3?arguments[3]:void 0,{onHistoryRevert:l}=s.props;"function"!==typeof l&&(l=()=>{});const n=(0,N.jsx)(tj,{challenge_data_history:i,field_id:a,onHistoryRevert:l,sub_field_id:t});s.setState({body:n,show:!0,title:e})}}componentWillUnmount(){"function"===typeof this.props.onRef&&this.props.onRef(void 0)}componentDidMount(){const{onRef:e}=this.props;"function"==typeof e&&e(this)}render(){const{body:e,error:s,show:a,title:t}=this.state;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(xe,{onHide:this.hide,show:a,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:t})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:s,variant:"danger",children:s}),e]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:()=>{this.setState({show:!1})},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})})}}var lj=(0,Ke.Ay)((0,n.G0)(Fa((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(Gv,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{challenge_content_wrapper:s,ref:e=>{this.comp=e}}))})}}return s})(ij))));var nj=e=>{const{className:s,disabled:a,onHistoryRevert:t,tooltip:i}=e,{userPerformedAchievementEvent:r}=(0,n.nm)(),{formatMessage:o}=(0,ja.A)(),[d,c]=(0,l.useState)(!1),h=(0,l.useRef)(),u=null!==i&&void 0!==i&&i.length?i:o({id:"label.cannot_restore_this_point.6ec248d5",defaultMessage:"Cannot restore this point"}),m=o({id:"label.revert.0026c505",defaultMessage:"Revert"});return(0,N.jsx)(N.Fragment,{children:a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"d-inline",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:(0,N.jsx)(ve.A,{disabled:!0,ref:h,variant:"link",children:(0,N.jsx)(ze.OKX,{})})}),(0,N.jsx)(bi.A,{placement:"bottom",show:d,target:h.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({id:"overlay-example"},e),{},{children:u}))})]}):(0,N.jsx)(ve.A,{"aria-label":m,className:s,onClick:e=>{e.preventDefault(),"function"===typeof t&&t(),r("use_revision_history")},variant:"link",children:(0,N.jsx)(ze.OKX,{})})})};var rj=e=>{const{field_id:s}=e,{formatMessage:a}=(0,ja.A)(),{getChallengeDataRemovedFields:t,showChallengeDataHistory:i}=Wv(),l=t(s,"removed")||[];return(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-2 align-self-center",disabled:l.length<=0,onClick:()=>{const{field_id:s}=e,l=t(s,"removed");i(a({id:"label.removed_items.0eed6666",defaultMessage:"Removed items"}),s,null,l)},variant:"secondary",children:[(0,N.jsx)(ze.qbC,{}),(0,N.jsx)(ke.A,{defaultMessage:"See removed items",id:"label.see_removed_items.a8627c2c"})]})})};const oj=l.createContext({}),dj=oj.Provider,cj=(oj.Consumer,()=>(0,l.useContext)(oj)),hj=["children","downloadable","share","src"],uj=e=>{var s,a;const{disabled:t,dummy:i,field_id:n,itemIndex:r,question:o,share:d,showContributions:c}=e||{},{color:h="#ffffff",text:u}=d||{},m=cj(),{onEdit:g,onRemove:p,revision_modal_title:x}=m||{},v=(0,P.nm)(),{getColorName:f}=(null===v||void 0===v?void 0:v.utils)||{},j=(0,l.useRef)(),[_,b]=(0,l.useState)(!1);if(!d)return null;
2return(0,N.jsxs)("div",{tabIndex:-1,children:[(0,N.jsx)(Ge.A,{className:`share-grid-card ${i&&"dummy"} ${f(h)}`,id:d.id,children:(0,N.jsxs)(Ge.A.Body,{id:d.id,children:[(0,N.jsx)(Ce.S,{className:"share-grid-card-text-content",children:u}),(0,N.jsxs)(Ce.S,{className:"share-grid-card-revision-history",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[c&&(0,N.jsx)(Jv,{field_id:n,sub_field_id:null===d||void 0===d?void 0:d.id}),!i&&(0,N.jsx)(Yv,{full_descriptor:!0,field_id:n,size:"large",sub_field_id:null===d||void 0===d?void 0:d.id,title:x,allowedActions:["add_share_card","modify_share_card","revert"],style:{left:10,paddingLeft:8,paddingRight:8,position:"relative"}}),(0,N.jsx)("div",{className:`${!(null!==d&&void 0!==d&&d.data)&&"d-none"} ms-3`,children:(0,N.jsxs)(li.A,{bsPrefix:"sgc-attachment",children:[(0,N.jsx)(li.A.Toggle,{title:"Attachments",variant:"link",children:(0,N.jsx)(ze.EHs,{className:"paperclip-icon"})}),(0,N.jsx)(li.A.Menu,{children:(0,N.jsx)(li.A.Item,{children:(0,N.jsx)("div",{className:"sharegrid-card-media-content",children:(0,N.jsx)(xj,{share:d})})})})]})})]}),!i&&v.user.id===(null===d||void 0===d?void 0:d.user)&&(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{bsPrefix:"solvably",disabled:t,id:`share-card-${r}`,title:"Actions",variant:"link",children:(0,N.jsx)(ze.H_v,{className:"ellipsis-icon"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Item,{as:"button",className:"d-flex align-items-center gap-1",onClick:()=>{(0,T.isFunction)(g)&&g(d,o)},children:[(0,N.jsx)(jr,{path:"pen_2/pen-2.svg",size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsxs)(li.A.Item,{as:"button",className:"d-flex align-items-center gap-1",onClick:()=>{(0,T.isFunction)(p)&&p(d)},children:[(0,N.jsx)(jr,{path:"bin/bin.svg",size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})]})]})]})}),(0,N.jsx)(Xg,{file_name:null===d||void 0===d||null===(s=d.data)||void 0===s?void 0:s.file_name,file_type:null===d||void 0===d?void 0:d.file_type,link:null===d||void 0===d||null===(a=d.data)||void 0===a?void 0:a.link,ref:j})]},e.share.id)};uj.defaultProps={disabled:!1,dummy:!1,share:null,showContributions:!0};const mj=e=>{var s;let{children:a,downloadable:t=!0,share:i={},src:n=null}=e;(0,he.A)(e,hj);const[r,o]=(0,l.useState)(!0),d=(0,l.useRef)(null),c=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()};return(0,N.jsxs)("div",{className:"share-preview-overlay",children:[(0,N.jsxs)("div",{className:""+(r?"overlay":""),onMouseEnter:e=>{e.preventDefault(),c(e),o(!0)},onMouseLeave:e=>{e.preventDefault(),c(e),o(!1)},children:[a,r&&t&&(0,N.jsx)("a",{download:!0,"aria-label":"download asset",className:"download-button",href:n,onClick:e=>c(e),rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ze.i3g,{className:"meta-icon"})}),r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"expand-button",onClick:async()=>{await d.current.show()},variant:"light",children:(0,N.jsx)(ze.z0S,{className:"meta-icon absolute-transform-middle"})}),(0,N.jsx)("h6",{className:"meta-title",children:null===i||void 0===i||null===(s=i.data)||void 0===s?void 0:s.file_name})]})]}),(0,N.jsx)(Xg,{file_name:i.data.file_name,file_type:i.file_type,link:i.data.link,ref:d})]})},gj=e=>{let{link_color:s,share:a}=e;const{data:t}=a||{},{link:i,meta:l}=t,{image:n,title:r}=l||{};let o=null;try{o=new URL(i).hostname}catch(c){(0,xa.Err)(c)}const d=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()};return(0,N.jsxs)(N.Fragment,{children:[n&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"link-img",children:[(0,N.jsx)(Ge.A.Img,{src:n}),(0,N.jsx)(Ce.S,{className:"link-content",children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:i,onClick:e=>d(e),rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(Fl,{as:"strong",className:"text-white",maxWidth:360,placement:"bottom",children:r}),(0,N.jsxs)("span",{className:"link-url d-flex small",style:{color:"white !important"}
2,children:[o,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:s,size:12,style:{alignSelf:"center"}})]})]})})})})]})}),!n&&(0,N.jsx)(Ce.S,{className:"link-preview",children:(0,N.jsx)("div",{className:"link-content",children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:i,onClick:e=>d(e),rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(Fl,{as:"h6",className:"link-title mb-0 text-extra-dark",maxWidth:360,placement:"bottom",children:r}),(0,N.jsxs)("span",{className:"link-url d-flex",style:{color:s},children:[o,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:s,size:12,style:{alignSelf:"center"}})]})]})})})})]})},pj=e=>{var s,a;let{color:t="",share:i}=e;const{parseExt:l}=(0,Be.hc)(),{styles:n}=(0,P.nm)(),{primary:r}=n,o=null!==(s=null===i||void 0===i||null===(a=i.data)||void 0===a?void 0:a.link)&&void 0!==s?s:null;if(!o)return null;const d=l(o);return(0,N.jsx)(Ce.S,{className:"document-content",children:(0,N.jsxs)(Ce.S,{className:"document-container p-3",children:[(0,N.jsx)(Ce.S,{className:"filename-container",children:(0,N.jsx)(zm,{ext:d,fill:r,size:16,type:"file",withLabel:!0})}),(0,N.jsx)(Me.NX,{className:"text-decoration-none",icon_size:14,title:"Download attachment",url:o,variant:"link"})]})})},xj=e=>{const{share:s}=e,{color:a="#ffffff",data:t=null,file_type:i=""}=s,{link:l=""}=t||{};switch(i){case"image":return(0,N.jsx)(mj,{share:s,src:l,children:(0,N.jsx)("div",{className:"media-content-image",style:{backgroundImage:`url(${l})`}})});case"video":return(0,N.jsx)(Zg,{downloadable:!0,data:s,src:l,title:"Video attachment preview"});case"link":return(0,N.jsx)("div",{children:(0,N.jsx)(gj,{color:a,share:s})});case"file":return(0,N.jsx)(pj,{share:s});default:return(0,N.jsx)(N.Fragment,{})}};var vj=uj;var fj=t.p+"static/media/icon-discover.1cd96dbc9989ce4efe5a2c6e4b8c2dd5.svg";var jj=e=>{var s,a,t,i,l;const{getTemplate:n}=Qj(),r=n(),{guiding_questions:o=[]}=r,{challenge:d,challenge_type:c,isSubphaseComplete:h}=iv(),{challenge_data:u=[]}=d||{},m="classic"===c,[g,p,x,v]=u.filter(e=>1===e.phase)||[],f=(null===g||void 0===g||null===(s=g.data)||void 0===s?void 0:s.wordCloudList)||[],j=(null===p||void 0===p||null===(a=p.data)||void 0===a?void 0:a.identifyAudience)||{},_=(null===j||void 0===j||null===(t=j.item)||void 0===t?void 0:t.value)||"",b=(0,ad.G9)(null===j||void 0===j?void 0:j.text,{preserveNewlines:!0}),A=Object.entries((null===x||void 0===x||null===(i=x.data)||void 0===i?void 0:i.constraints)||{}).map(e=>null===e||void 0===e?void 0:e[1])||[],y=null===v||void 0===v||null===(l=v.data)||void 0===l?void 0:l.share_lanes;return(0,N.jsxs)("section",{className:"process-section section-discover d-flex flex-column gap-5",id:"sectionDiscover",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-3",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:32,src:fj,width:32})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("span",{className:"h2 heading",children:m?(0,N.jsx)(ke.A,{defaultMessage:"Discover",id:"label.discover.d4a33d5b"}):Bv(c,1)}),(0,N.jsx)("span",{className:"subheading",children:m?(0,N.jsx)(ke.A,{defaultMessage:"Identify and understand the problem",id:"label.identify_and_understand_the_proble.8f9d39b1"}):Pv(c,1)||(0,N.jsx)(ke.A,{defaultMessage:"Identify and understand the problem",id:"label.identify_and_understand_the_proble.8f9d39b1"})})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column define-challenge",id:"defineChallenge",children:[(0,N.jsxs)("p",{className:"subsection-heading h4 d-flex align-items-center justify-content-between",children:[m?(0,N.jsx)(ke.A,{defaultMessage:"Define challenge",id:"label.define_challenge.d70fcbc4"}):(0,N.jsx)("span",{children:Lv(c,1,1)}),(0,N.jsx)(Wj,{phase:1,subphase:1})]}),h(1,1)?(0,N.jsx)(Ce.S,{className:"word-cloud-container",children:(0,N.jsx)(wr,{list:f})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:1,subphase:1})})]}),(0,N.jsxs)(Ce.S,{className:"subsection identify-audience d-flex flex-column",id:"identifyAudience",children:[(0,N.jsxs)("h4",{className:"d-flex align-items-center justify-content-between",children:[m?(0,N.jsx)(ke.A,{defaultMessage:"Identify audience",id:"label.identify_audience.be621a4b"}):(0,N.jsx)("span",{children:Lv(c,1,2)}),(0,N.jsx)(Wj,{phase:1,subphase:2})]}),h(1,2)?(0,N.jsxs)(Qe.A,{className:"d-flex",children:[(0,N.jsx)(Ve.A,{className:"d-flex flex-column",lg:8,xs:12,children:(0,N.jsx)("p",{children:b})}),(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Me.R_,{alt:"The audience this challenge aims to help",className:"audience-image",fluid:!0,rounded:!0,src:_})})]}):(0,N.jsx)(Vj,{phase:1,subphase:2})]}),(0,N.jsxs)(Ce.S,{className:"subsection establish-constraints d-flex flex-column",id:"establishConstraints",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:m?(0,N.jsx)(ke.A,{defaultMessage:"Establish constraints",id:"label.establish_constraints.14d6acce"}):Lv(c,1,3)}),(0,N.jsx)(Wj,{phase:1,subphase:3})]}),h(1,3)?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"constraints-container d-flex flex-column",children:null===A||void 0===A?void 0:A.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"constraint",children:[(0,N.jsx)(Ce.S,{className:"category",children:null===e||void 0===e?void 0:e.category}),(0,N.jsx)(Ce.S,{className:"text",children:null===e||void 0===e?void 0:e.text})]},s))})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:1,subphase:3})})]}),(0,N.jsxs)(Ce.S,{className:"subsection share-what-you-know share-grid-outer-container d-flex flex-column",id:"shareWhatYouKnow",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header d-flex flex-row justify-content-between",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:m?(0,N.jsx)(ke.A,{defaultMessage:"Share what you know",id:"label.share_what_you_know.7250b581"}):Lv(c,1,4)}),(0,N.jsx)(Wj,{phase:1,subphase:4})]}),(0,N.jsx)(Ce.S,{className:"mt-3",children:h(1,4)?!(null===o||void 0===o||!o.length)&&(null===o||void 0===o?void 0:o.map((e,s)=>{var a;return(0,N.jsxs)(Ce.S,{className:"d-flex flex-column mb-3 share-what-you-know-container",children:[(0,N.jsxs)(Ce.S,{className:"question-container",children:[(0,N.jsx)(Ce.S,{className:"q-wrapper",children:s+1}),(0,N.jsx)("span",{className:"m-0",children:e})]}),(0,N.jsx)(Ce.S,{className:"share-grid mt-3",children:null===y||void 0===y||null===(a=y[s])||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)(vj,{dummy:!0,share:e,showContributions:!1},s))})]},s)})):(0,N.jsx)(Vj,{phase:1,subphase:4})})]})]})};const _j=e=>{const{canChangePhaseData:s,changePhaseData:a,getPhaseData:t,phase:i,subphase:n}=Ra(),{add_btn_label:r,choose_color:o,data:d,hasAdditional:c=!1,onAdd:h,onEdit:u,onRemove:m,revision_modal_title:g}=e,p=(0,l.useMemo)(()=>Array.isArray(null===e||void 0===e?void 0:e.lanes)?e.lanes:Object.entries((null===e||void 0===e?void 0:e.lanes)||{}),[e.lanes]),x=!s(),v=(e,s,a)=>{const t=[...e],[i]=t.splice(s,1);return t.splice(a,0,i),t},f=(e,s,a,t)=>{var i;const l=[...e],n=[...s],r=l.splice(a.index,1)[0],{id:o}=null!==(i=null===p||void 0===p?void 0:p[null===t||void 0===t?void 0:t.droppableId])&&void 0!==i?i:{};return r.need_to_know_id=o,n.splice(t.index,0,r),{[t.droppableId]:n,[a.droppableId]:l}};return(0,N.jsx)(yj,{value:{add_btn_label:r,choose_color:o,disabled:x,onAdd:h,onEdit:u,onRemove:m,revision_modal_title:g},children:(0,N.jsx)(Rd.JY,{onDragEnd:e=>{const{destination:l,source:r}=e||{};if(!l||!s(!0))return;const{droppableId:o,index:d}=r||{},{droppableId:c,index:h}=l||{}
2,u=t(i,n),m=(null===u||void 0===u?void 0:u.share_lanes)||[];if(o===c)u.share_lanes[o]=v(m[o],d,h);else{!Array.isArray(m[c])&&(m[c]=[]);const e=f(m[o],m[c],r,l);u.share_lanes=u.share_lanes.map((s,a)=>e.hasOwnProperty(a)?e[a]:s)}a(i,n,u)},children:(0,N.jsx)("div",{className:"share-lanes-outer-container-classic "+(c?"has-additional":""),children:p.map((e,s)=>{let{id:a,question:t}=e;return(0,N.jsx)(Nj,{index:s,need_to_know_id:a,question:t,shares:d[s]},s)})})})})};_j.defaultProps={onAdd:Function(),onEdit:Function(),onMove:Function(),onRemove:Function()};var bj=_j;const Aj=l.createContext({}),yj=Aj.Provider,wj=(Aj.Consumer,()=>(0,l.useContext)(Aj));var Nj=e=>{const{disabled:s,onAdd:a}=wj(),{index:t,need_to_know_id:i,question:l,shares:n}=e;return(0,N.jsxs)("div",{className:"share-lane-outer-container",id:`shareLane-${t}`,children:[(0,N.jsxs)("div",{className:"card-numbered",children:[(0,N.jsx)("div",{className:"card-number",children:t+1}),(0,N.jsx)("div",{children:(0,N.jsx)("h6",{className:"m-0 d-inline-block",children:l})})]}),(0,N.jsxs)(ve.A,{className:"mt-3 mb-3 ms-2 me-2",disabled:s,onClick:()=>!s&&a(t,i,l),style:{color:"white",padding:"8px 24px"},children:[(0,N.jsx)(ze.OiG,{className:"me-1",color:"#FFFFFF",size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add research",id:"label.add_research.82a82943"})})]}),(0,N.jsx)(Rd.gL,{droppableId:`${t}`,children:(e,s)=>(0,N.jsxs)("div",{className:"share-dropzone-row",ref:e.innerRef,style:(s.isDraggingOver,{height:700,overflow:"auto",padding:8,width:"100%"}),children:[!(null===n||void 0===n||!n.length)&&n.map((e,s)=>(0,N.jsx)(kj,{marginBottom:!0,field_id:"share_lanes",itemIndex:s,laneIndex:t,question:l,share:e},s)),e.placeholder]})})]})};const Sj=s=>{const{data:a,link_color:t,share:i}=s,{link:l,meta:n}=a||{},{image:r,title:o}=n||{};let d=l;try{d=new URL(l).hostname}catch(e){}const c=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()},h=e=>["white","#ffffff","#fff","rgb(255,255,255)","rgba(255,255,255,1)"].includes(e.toLowerCase());return(0,N.jsx)(N.Fragment,{children:r?(0,N.jsxs)(Ce.S,{className:"link-img",children:[(0,N.jsx)(Ge.A.Img,{src:r,style:{borderRadius:4,maxHeight:135}}),(0,N.jsx)(Qe.A,{className:"link-content g-0",style:{borderRadius:4},children:(0,N.jsx)(Ve.A,{className:"d-flex flex-column justify-content-end",children:(0,N.jsx)(Ce.S,{className:"link-container with-image",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:l,onClick:c,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(Fl,{as:"strong",className:"text-white",maxWidth:"100%",placement:"bottom",children:o}),(0,N.jsxs)("span",{className:"link-url d-flex small text-white ",children:[d,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:"var(--white)",size:12,style:{alignSelf:"center"}})]})]})})})})})]}):(0,N.jsx)(Ce.S,{className:"link-plain-classic",children:(0,N.jsx)(Qe.A,{className:"link-content",n
2oGutters:!0,children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:l,onClick:c,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(Fl,{as:"strong",className:"text-extra-dark",maxWidth:"100%",placement:"bottom",children:o}),(0,N.jsxs)("span",{className:"link-url d-flex small",style:{color:h(null===i||void 0===i?void 0:i.color)?t:""},children:[d,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:h(null===i||void 0===i?void 0:i.color)?t:i.color,size:12,style:{alignSelf:"center"}})]})]})})})})})})})},Cj=e=>{const{color:s,data:a,filename:t}=e,{link:i}=a,{utils:l}=(0,P.nm)(),n=l.parseExt(i),{getColorName:r}=l||{},o="white"===r(s)?"green":r(s,e.bold),d=hf[o];return(0,N.jsx)(Qe.A,{className:"document-content",noGutters:!0,children:(0,N.jsx)(Ve.A,{className:"p-0",children:(0,N.jsxs)(Ce.S,{className:"document-container",children:[(0,N.jsx)(Ce.S,{className:"filename-container",children:(()=>{switch(n){case"ppt":case"pptx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.rgF,{className:"document-icon",size:24}),t||(0,N.jsx)(ke.A,{defaultMessage:"PowerPoint Presentation",id:"label.powerpoint_presentation.935176c7"})]});case"doc":case"docx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.WLb,{className:"document-icon",size:24}),t||(0,N.jsx)(ke.A,{defaultMessage:"Word document",id:"label.word_document.10eea543"})]});case"pdf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.kl1,{className:"document-icon",size:24}),t||(0,N.jsx)(ke.A,{defaultMessage:"PDF Document",id:"label.pdf_document.0cbeb39b"})]});case"rtf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.t69,{className:"document-icon",size:24}),t||(0,N.jsx)(ke.A,{defaultMessage:"RTF Document",id:"label.rtf_document.d61aacad"})]});default:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Gp9,{className:"document-icon",size:24}),t||(0,N.jsx)(ke.A,{defaultMessage:"Uploaded resource",id:"label.uploaded_resource.80706545"})]})}})()}),(0,N.jsx)(ve.A,{href:i,rel:"noopener noreferrer",target:"_blank",variant:"link",children:(0,N.jsx)(Zs.A,{"aria-hidden":!0,height:18,src:`${d}`,width:18})})]})})})};var Mj=e=>{const{className:s="",dummy:a=!1,field_id:t,itemIndex:i,marginBottom:l=!1,onEdit:n,onRemove:r,question:o=null,readonly:d=!1,revision_modal_title:c,share:h={},showContributions:u=!0}=e,m=(0,ja.A)(),{data:g,file_type:p,text:x}=h,v=(null===h||void 0===h?void 0:h.color)||"white",{is_facilitator:f}=Ra(),{user:j}=(0,P.nm)(),{getColorName:_}=(0,Be.hc)();return(0,N.jsxs)(Ge.A,{className:`share-lane-card ${l?"mb-2":""} ${_(v)} bold ${s}`,children:[(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"idea",id:"label.idea.ae0a9ad3"})}),(0,N.jsxs)(Ge.A.Body,{children:[null!==p&&(0,N.jsx)(Ce.S,{className:"share-lane-card-media-content pt-3 px-3 pb-0",children:(()=>{switch(p){case"image":return(0,N.jsx)(Ge.A.Img,{src:`${null===g||void 0===g?void 0:g.link}`});case"video":return(0,N.jsx)("video",{controls:!0,autoPlay:!1,crossOrigin:"anonymous",preload:"auto",style:{maxHeight:"100%",maxWidth:"100%"},children:(0,N.jsx)("source",{src:null===g||void 0===g?void 0:g.link})});case"file":return(0,N.jsx)(Cj,{bold:!0,color:v,data:g});case"link":return(0,N.jsx)(Sj,{data:g,link_bg_color:"white",link_color:"black",share:h,text_color:"black"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(0,N.jsx)(Ce.S,{className:"share-lane-card-text-content",children:x}),(0,N.jsxs)(Ce.S,{className:"share-lane-card-revision-history",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[u&&(0,N.jsx)(Jv,{field_id:t,sub_field_id:null===h||void 0===h?void 0:h.id}),!a&&(0,N.jsx)(Yv,{full_descriptor:!0,allowedActions:["add_share_card","modify_share_card","revert"],field_id:t,size:"large",sub_field_id:null===h||void 0===h?void 0:h.id,title:m.formatMessage({id:"label.title_history.06de0ec6",defaultMessage:"{title} History"},{title:c}),style:{left:10,paddingLeft:8,paddingRight:8,position:"relative"}})]}),!a&&(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{bsPrefix:"solvably",disabled:d,id:`share-card-${i}`,title:"Actions",variant:"link",children:(0,N.jsx)(ze.H_v,{className:"ellipsis-icon"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Item,{as:"button",className:"d-flex align-items-center gap-1",onClick:()=>(0,T.isFunction)(n)&&n(h,o),children:[(0,N.jsx)(jr,{path:"pen_2/pen-2.svg",size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsxs)(li.A.Item,{as:"button",className:"d-flex align-items-center gap-1",onClick:()=>(0,T.isFunction)(r)&&r(h),children:[(0,N.jsx)(jr,{path:"bin/bin.svg",size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})]})]})]})]})};var kj=e=>{const{field_id:s,itemIndex:a,laneIndex:t,marginBottom:i,question:l,share:n={}}=e,{onEdit:r,onRemove:o,revision_modal_title:d}=wj();return(0,N.jsx)(Rd.sx,{draggableId:`${n.text}${n.user}${n.updated_at}`,index:a,children:(e,c)=>{return(0,N.jsx)("div",(0,F.A)((0,F.A)((0,F.A)({id:`shareLaneCard-${t}-${a}`,ref:e.innerRef},e.draggableProps),e.dragHandleProps),{},{style:(c.isDragging,h=e.draggableProps.style,(0,F.A)({},h)),children:(0,N.jsx)(Mj,{field_id:s,itemIndex:a,laneIndex:t,marginBottom:i,onEdit:r,onRemove:o,question:l,revision_modal_title:d,share:n})}
2));var h}},`${n.text}${n.user}${n.updated_at}`)};var zj=t.p+"static/media/icon-explore.4dedfbe4a1cfafca4c1e1e4814cdda73.svg";var Tj=e=>{var s,a,t,i;const{challenge:l,challenge_type:n,isPhaseComplete:r}=iv(),{challenge_data:o=[]}=l||{},d="classic"===n,c=o.find(e=>2===e.phase&&1===e.subphase)||{},h=Object.values(null!==(s=null===c||void 0===c||null===(a=c.data)||void 0===a?void 0:a.need_to_knows)&&void 0!==s?s:{}),u=o.find(e=>2===e.phase&&2===e.subphase)||{},m=null!==(t=null===u||void 0===u||null===(i=u.data)||void 0===i?void 0:i.share_lanes)&&void 0!==t?t:[];return(0,N.jsxs)("section",{className:"process-section section-explore d-flex flex-column gap-5",id:"sectionExplore",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-3",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:32,src:zj,width:32})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h2",{children:d?(0,N.jsx)(ke.A,{defaultMessage:"Explore",id:"label.explore.3b73900b"}):Bv(n,2)}),(0,N.jsx)("span",{className:"subheading",children:d?(0,N.jsx)(ke.A,{defaultMessage:"Learn what you need to know",id:"label.learn_what_you_need_to_know.aeeae8fc"}):Pv(n,2)||(0,N.jsx)(ke.A,{defaultMessage:"Learn what you need to know",id:"label.learn_what_you_need_to_know.aeeae8fc"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection research mt-5",id:"needToKnow",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:d?(0,N.jsx)(ke.A,{defaultMessage:"Need to know",id:"label.need_to_know.df7dc667"}):Lv(n,2,1)}),(0,N.jsx)(Wj,{phase:2,subphase:1})]}),(0,N.jsx)(Ce.S,{children:r(2)?(0,N.jsx)(Ce.S,{className:"need-to-know-grid gallery",children:!(null===h||void 0===h||!h.length)&&(null===h||void 0===h?void 0:h.map((e,s)=>(0,N.jsx)(Ge.A,{className:"need-to-know-card gallery-card",style:{maxWidth:216},children:(0,N.jsx)(Ce.S,{className:"need-to-know-inner",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-nowrap",children:[(0,N.jsx)(Ce.S,{className:"index",children:s+1}),(0,N.jsx)(Ce.S,{className:"description",children:null===e||void 0===e?void 0:e.value})]})})},s)))}):(0,N.jsx)(Vj,{phase:2,subphase:1})})]}),(0,N.jsxs)(Ce.S,{className:"subsection research",id:"research",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:d?(0,N.jsx)(ke.A,{defaultMessage:"Research",id:"label.research.979d6300"}):Lv(n,2,2)}),(0,N.jsx)(Wj,{phase:2,subphase:1})]}),(0,N.jsx)(Ce.S,{className:"mt-3",children:r(2)?!(null===h||void 0===h||!h.length)&&(null===h||void 0===h?void 0:h.map((e,s)=>{var a;return(0,N.jsxs)(Ce.S,{className:"d-flex flex-column mb-3",children:[(0,N.jsxs)(Ce.S,{className:"question-container",children:[(0,N.jsx)(Ce.S,{className:"q-wrapper",children:s+1}),(0,N.jsx)("span",{className:"m-0",children:null===e||void 0===e?void 0:e.value})]}),(0,N.jsx)(Ce.S,{className:"share-grid mt-3",children:!(null===m||void 0===m||!m.length)&&(null===m||void 0===m||null===(a=m[s])||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)(Mj,{dummy:!0,share:e,showContributions:!1},s)))})]},s)})):(0,N.jsx)(Vj,{phase:2,subphase:2})})]})]})},Ij=t(56848);var Ej=t.p+"static/media/icon-imagine.7c84c7bc4e60afdb473dddf70b8f9f80.svg";const Fj=e=>{const{lane:s}=e,a=Array.isArray(s)?s:[];return(0,N.jsx)(Ce.S,{className:"decision-board-preview d-flex flex-column gap-3",children:Za.tM.map(e=>{const s=(e=>a.find(s=>(null===s||void 0===s?void 0:s.decision_type)===e)||null)(e);return(0,N.jsxs)(Ce.S,{className:"decision-slot border rounded bg-white shadow-sm overflow-hidden",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center flex-wrap gap-2 px-3 py-2 border-bottom",children:[(0,N.jsx)(bo.A,{bg:"primary",children:e}),Za.bT[e]&&(0,N.jsx)("span",{className:"text-muted small",children:Za.bT[e]})]}),(0,N.jsx)(Ce.S,{className:"px-3 py-3",children:(null===s||void 0===s?void 0:s.text)||"..."})]},e)})})};var Rj=e=>{var s,a,t;const{challenge:i,challenge_type:l,isPhaseComplete:n}=iv(),{challenge_data:r=[]}=i||{},o="classic"===l,d="decision_making"===l,c=r.find(e=>3===e.phase&&1===e.subphase)||{},h=r.find(e=>3===e.phase&&2===e.subphase)||{},{share_lanes:u}=(null===c||void 0===c?void 0:c.data)||{},m=(null===h||void 0===h||null===(s=h.data)||void 0===s||null===(a=s.selected_idea)||void 0===a?void 0:a.item)||{};return(0,N.jsxs)("section",{className:"process-section section-imagine d-flex flex-column gap-5",id:"sectionImagine",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-3",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:32,src:Ej,width:32})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h2",{children:o?(0,N.jsx)(ke.A,{defaultMessage:"Imagine",id:"label.imagine.7108efed"}):Bv(l,3)}),(0,N.jsx)("span",{className:"subheading",children:o?(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm and generate ideas",id:"label.brainstorm_and_generate_ideas.b71bfd80"}):Pv(l,3)||(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm and generate ideas",id:"label.brainstorm_and_generate_ideas.b71bfd80"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection brainstorm ",id:"brainstorm",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:o?(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm",id:"label.brainstorm.914af5cb"}):Lv(l,3,1)}),(0,N.jsx)(Wj,{phase:3,subphase:1})]}),(0,N.jsx)(Ce.S,{className:"mt-3",children:n(3)?d?(0,N.jsx)(Fj,{lane:null===u||void 0===u?void 0:u[0]}):(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2},children:(0,N.jsx)(Ij.A,{className:"share-grid masonry",gutter:8,children:(null===u||void 0===u?void 0:u.length)>0&&(null===u||void 0===u||null===(t=u[0])||void 0===t?void 0:t.map((e,s)=>(0,N.jsx)(Mj,{dummy:!0,share:e,showContributions:!1},s)))})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:3,subphase:1})})})]}),(0,N.jsxs)(Ce.S,{className:"subsection choose-an-idea",id:"chooseAnIdea",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:o?(0,N.jsx)(ke.A,{defaultMessage:"Choose an Idea",id:"label.choose_an_idea.19b2cf12"}):Lv(l,3,2)}),(0,N.jsx)(Wj,{phase:3,subphase:2})]}),(0,N.jsx)(Ce.S,{className:"mt-3",children:n(3)?(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"chosen-idea",children:[d&&(null===m||void 0===m?void 0:m.decision_type)&&(0,N.jsx)(Ce.S,{className:"mb-1",children:(0,N.jsx)(bo.A,{bg:"primary",children:m.decision_type})}),(0,N.jsx)(Mj,{dummy:!0,share:m,showContributions:!1})]})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:3,subphase:2})})})]})]})};var Dj=t.p+"static/media/icon-create.feceacfba6c60e6beca9daedb6c9a597.svg";var Bj=e=>{var s,a;const{challenge:t,challenge_type:i,isPhaseComplete:l}=iv(),{challenge_data:n=[]}=t||{},r="classic"===i,o=n.find(e=>4===e.phase&&1===e.subphase)||{},d=n.find(e=>4===e.phase&&2===e.subphase)||{},{ending_in:c,so_that:h,we_will:u}=(null===o||void 0===o||null===(s=o.data)||void 0===s?void 0:s.action_statement)||{},{deliverable:m,deliverable_choice:g}=(null===d||void 0===d?void 0:d.data)||{};return(0,N.jsxs)("section",{className:"process-section section-create d-flex flex-column gap-5",id:"sectionCreate",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-3",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:32,src:Dj,width:32})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h2",{children:r?(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"}):Bv(i,4)}),(0,N.jsx)("span",{className:"subheading",children:r?(0,N.jsx)(ke.A,{defaultMessage:"Make your ideas come to life",id:"label.make_your_ideas_come_to_life.8cc80824"}):Pv(i,4)||(0,N.jsx)(ke.A,{defaultMessage:"Make your ideas come to life",id:"label.make_your_ideas_come_to_life.8cc80824"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection action-statement d-flex flex-column",id:"actionStatement",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:r?(0,N.jsx)(ke.A,{defaultMessage:"Action statement",id:"label.action_statement.22fcbfc8"}):Lv(i,4,1)}),(0,N.jsx)(Wj,{phase:4,subphase:1})]}),l(4)?(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"statements d-flex flex-column",children:[(0,N.jsxs)("p",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"We will",id:"label.we_will.5daab980"})}),(null===u||void 0===u?void 0:u.value)||"..."]}),(0,N.jsxs)("p",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"So that",id:"label.so_that.7fc46a9c"})}),(null===h||void 0===h?void 0:h.value)||"..."]}),(0,N.jsxs)("p",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Ending in",id:"label.ending_in.d7de3f00"})}),(null===c||void 0===c?void 0:c.value)||"..."]})]})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:4,subphase:1})})]}),(0,N.jsxs)(Ce.S,{className:"subsection deliverable",id:"deliverable",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{children:r?(0,N.jsx)(ke.A,{defaultMessage:"Deliverable",id:"label.deliverable.b8b36626"}):Lv(i,4,2)}),(0,N.jsx)(Wj,{phase:4,subphase:2})]}),(0,N.jsx)("div",{className:"remove-nested-padding mb-2",dangerouslySetInnerHTML:{__html:null!==(a=null===g||void 0===g?void 0:g.specifics)&&void 0!==a?a:""}}),l(4)?(0,N.jsx)(Ku,{deliverable:m,deliverable_choice:g}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Vj,{phase:4,subphase:2})})]})]})};var Pj=e=>{const{setScrollspySticky:s}=iv();return(0,N.jsx)(Ce.S,{className:"challenge-details-process my-5",children:(0,N.jsxs)(Qe.A,{className:"m-0",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",lg:9,xs:12,children:[(0,N.jsx)(Lj.Discover,{}),(0,N.jsx)("hr",{}),(0,N.jsx)(Lj.Explore,{}),(0,N.jsx)("hr",{}),(0,N.jsx)(Lj.Imagine,{}),(0,N.jsx)("hr",{}),(0,N.jsx)(Lj.Create,{})]}),(0,N.jsx)(Ve.A,{children:(0,N.jsx)(nv(),{className:"scrollspy-sticky-holder",onFixedToggle:s,positionRecheckInterval:100,stickyClassName:"scrollspy-sticky",topOffset:-150,children:(0,N.jsx)(Zj,{scope:"process"})})})]})})};const Lj={Create:Bj,Discover:jj,Explore:Tj,Imagine:Rj};var Oj=e=>{const{challenge:s,challenge_type:a,typeConfig:t}=iv(),{challenge_data:i}=s||{}
2,l=Object.keys(t.phases).map(Number),n=e=>null===i||void 0===i?void 0:i.filter(s=>s.phase===e),r=()=>{let e=null;return i.every(s=>{let{is_complete:a,phase:t,subphase:i}=s;return!!a||(e={phase:t,subphase:i},!1)}),e};return(0,N.jsxs)(Ce.S,{className:"challenge-details-unprivileged py-5",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge phases",id:"label.challenge_phases.9886e3e5"})}),(0,N.jsx)(dn,{dummy:!0,phases:(()=>{let e=l.reduce((e,s)=>(e[s]={},e),{});for(const i of l){var s;const l=n(i),o=r(),d=i>(null===o||void 0===o?void 0:o.phase),c=!l.find(e=>!e.is_complete),h=l.map((e,s)=>{var l,n,r,o;return{icon:(0,N.jsx)(xr,{challenge_type:a,phase:i,size:20,subphase:s+1}),status:d?"locked":null!==e&&void 0!==e&&e.is_complete?"complete":"incomplete",title:("object"===typeof(null===(l=t.phases[i])||void 0===l?void 0:l.subphases[s+1])?null===(n=t.phases[i])||void 0===n||null===(r=n.subphases[s+1])||void 0===r?void 0:r.title:null===(o=t.phases[i])||void 0===o?void 0:o.subphases[s+1])||""}});e[i]={complete:c,locked:d,next_subphase:o,subphases:h,title:(null===(s=t.phases[i])||void 0===s?void 0:s.title)||""}}return e})()})]})};const Hj=l.createContext({}),Uj=Hj.Provider,Qj=(Hj.Consumer,()=>(0,l.useContext)(Hj));var Vj=e=>{const{phase:s,subphase:a}=e,{group_member_assignment_component_id:t,group_member_assignment_id:i,view:l}=(0,Pe.g)(),n=`/assignment/${i}/${t}/${l}/${s}/${a}`,{is_team_member:r}=Qj(),{isPhaseStarted:o,isPhaseUnlocked:d}=iv(),c=o(s,a),h=d(s);return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"subphase-placeholder p-5 text-center",children:r?(0,N.jsxs)(N.Fragment,{children:[h&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Le.Link,{className:"d-inline-flex align-items-center justify-content-center gap-1",to:n,children:[c?(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Resume",id:"label.resume.d640c742"})}):(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})}),(0,N.jsx)(ze.Z0P,{})]})}),!h&&(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-center gap-1 text-black-50",children:[(0,N.jsx)(ze.JhU,{}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Locked",id:"label.locked.a424e33d"})})]})]}):(0,N.jsx)("strong",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Incomplete",id:"label.incomplete.75f33cdf"})})})})};var Gj=t.p+"static/media/icon-info.f185dc3d76e40c078f6e69d51858aee9.svg";var Wj=e=>{const{phase:s,subphase:a}=e,{utils:t}=(0,n.nm)(),{formatMessage:i}=(0,ja.A)(),{challenge_type:r}=iv(),[o,d]=(0,l.useState)(!1),c=(0,l.useRef)(null),h=((e,s,a)=>{var t,i,l,n,r;return null===(t=Dv(e))||void 0===t||null===(i=t.phases)||void 0===i||null===(l=i[s])||void 0===l||null===(n=l.subphases)||void 0===n||null===(r=n[a])||void 0===r?void 0:r.description})(r,s,a),u=h||t.getSubphaseDescription(s,a);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"subphase-info-button",onBlur:()=>d(!1),onFocus:()=>d(!0),onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),ref:c,variant:"link","aria-label":i({id:"label.more_information.a1260fe9",defaultMessage:"more information"}),children:(0,N.jsx)(Zs.A,{"aria-hidden":!0,height:18,src:Gj,width:18})}),(0,N.jsx)(bi.A,{placement:"left",show:o,target:c.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({className:"subphase-popover",id:"overlay-example"},e),{},{children:u}))})]})};const Kj=(e,s)=>{switch(s){case"ppt":case"pptx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.rgF,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:e||"PowerPoint Presentation",id:"label.ppt_presentation"})]});case"doc":case"docx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.WLb,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:e||"Word Document",id:"label.word_document"})]});case"pdf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.kl1,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:e||"PDF Document",id:"label.pdf_document"})]});case"rtf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.t69,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:e||"RTF Document",id:"label.rtf_document"})]});default:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Gp9,{className:"document-icon",size:24}),(0,N.jsx)(ke.A,{defaultMessage:e||"Uploaded Resource",id:"label.uploaded_resource"})]})}};var Yj=e=>{var s,a;const{card:t,color:i,filename:r}=e,o=(null===t||void 0===t||null===(s=t.data)||void 0===s?void 0:s.link)||(null===t||void 0===t||null===(a=t.data)||void 0===a?void 0:a.doc),d=(0,l.useContext)(n.BR),c=null===d||void 0===d?void 0:d.utils.parseExt(o),{getColorName:h}=(null===d||void 0===d?void 0:d.utils)||{},u="white"===h(i)?"green":h(i),m=hf[u];
2return(0,N.jsx)(Qe.A,{className:"document-content",noGutters:!0,children:(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(Ce.S,{className:"document-container",children:[(0,N.jsx)(Ce.S,{className:"filename-container",children:Kj(r,c)}),(0,N.jsx)(ve.A,{href:o,rel:"noopener noreferrer",variant:"link",children:(0,N.jsx)(Zs.A,{"aria-hidden":!0,className:"doc-icon",height:18,src:`${m}`,width:18})})]})})})};var qj=e=>{const{card:{data:s={}},link_color:a}=e,{link:t,meta:i}=s,{image:l,title:n}=t||i||{},r=new URL(t).hostname,o=e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()};return(0,N.jsx)(N.Fragment,{children:l?(0,N.jsxs)(Ce.S,{className:"link-img",children:[(0,N.jsx)(Ge.A.Img,{src:l,style:{maxHeight:135}}),(0,N.jsx)(Qe.A,{className:"link-content",children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:t,onClick:o,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)("strong",{className:"link-title",style:{color:"white !important"},children:n}),(0,N.jsxs)("small",{className:"link-url d-flex justify-content-between",style:{color:"white !important"},children:[r,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:a,size:12,style:{alignSelf:"center"}})]})]})})})})})]}):(0,N.jsx)(Ce.S,{className:"link-plain",children:(0,N.jsx)(Qe.A,{className:"link-content",children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(Ce.S,{className:"link-container",children:(0,N.jsx)(Ce.S,{className:"link-title-container",children:(0,N.jsxs)("a",{className:"d-flex flex-column",href:t,onClick:o,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)("strong",{className:"link-title",style:{color:"#141414"},children:n}),(0,N.jsxs)("small",{className:"link-url d-flex justify-content-between",style:{color:a,lineBreak:"anywhere"},children:[r,(0,N.jsx)(ze.EQc,{"aria-hidden":!0,className:"ms-1",fill:a,size:12,style:{alignSelf:"center"}})]})]})})})})})})})};var Jj=e=>{const{card:s={},style:a}=e,{data:t,file_type:i}=s||{},l=(null===t||void 0===t?void 0:t.color)||(null===s||void 0===s?void 0:s.color)||"white",n=(null===t||void 0===t?void 0:t.link)||(null===t||void 0===t?void 0:t.image)||(null===s||void 0===s?void 0:s.image),r=(null===t||void 0===t?void 0:t.link)||(null===t||void 0===t?void 0:t.video)||(null===s||void 0===s?void 0:s.video),{getColorName:o}=(0,P.hc)();return(0,N.jsxs)(Ge.A,{className:`share-card ${o(l)}`,style:a,children:[(0,N.jsx)("div",{className:"share-card-upper",children:(()=>{switch(i){case"image":return(0,N.jsx)(Zs.A,{fluid:!0,className:"media-img",src:n});case"video":return(0,N.jsx)("div",{className:"position-relative",children:(0,N.jsx)(Gu,{downloadable:!0,downloadSize:"sm",src:r})});case"doc":return(0,N.jsx)(Yj,{card:s,color:l});case"link":return(0,N.jsx)(qj,{card:s,link_bg_color:"white",link_color:"black",text_color:"black"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(0,N.jsx)("div",{className:"share-card-lower",children:(null===t||void 0===t?void 0:t.text)||(null===s||void 0===s?void 0:s.text)||"No Text Found"})]})};var Xj=t(22631);var Zj=e=>{var s;const{modal_guid:a}=Qj(),{active_tab:t,hideScrollspy:i,scrollspy_locations:l,scrollspy_stickied:n,scrollspy_visible:r}=iv(),o=null===l||void 0===l?void 0:l[t],d=(null===o||void 0===o||null===(s=o.map)||void 0===s?void 0:s.call(o,e=>null===e||void 0===e?void 0:e.hash))||[],c=`.modal-${a}`,h=e=>null===e||void 0===e?void 0:e.sub_locations.map(e=>null===e||void 0===e?void 0:e.hash),u=e=>{e.preventDefault(),i();(e=>{var s,a;const t=document.querySelector(c),i=(null===e||void 0===e||null===(s=e.getBoundingClientRect)||void 0===s||null===(a=s.call(e))||void 0===a?void 0:a.top)+(null===t||void 0===t?void 0:t.scrollTop);t&&t.scrollTo({behavior:"smooth",top:i+-150})})(document.querySelector(c).querySelector(e.target.dataset.target))},m=e=>{"Enter"!==e.key&&" "!==e.key||u(e)};return(0,N.jsx)("aside",{className:`challenge-details-scroll-nav ${r?"show":"hide"} ${n?"is-stickied":""}`,children:(0,N.jsxs)(Ce.S,{className:"scroll-nav-content",children:[(0,N.jsxs)("div",{className:"scroll-nav-header",children:[(0,N.jsx)("span",{className:"h5",children:(0,N.jsx)(ke.A,{defaultMessage:"Contents",id:"label.contents.437aea62"})}),(0,N.jsx)(ve.A,{className:"close-btn",id:"scrollNavCloseButton",onClick:i,variant:"link",children:(0,N.jsx)(ze.QCr,{fill:"#575757"})})]}),(0,N.jsx)(Xj.A,{className:"nav nav-pills flex-column scrollspy",componentTag:"nav",currentClassName:"parent-active",items:d,offset:-250,rootEl:c,scrolledPastClassName:"passed",children:!!o&&o.map((e,s)=>{var a,t;return(0,N.jsxs)("div",{className:"nav-item nest-parent "+(null!==e&&void 0!==e&&e.sub_locations?""
2:"no-children"),children:[(0,N.jsx)("a",{className:"nav-link parent-link","data-target":`#${null===e||void 0===e?void 0:e.hash}`,onClick:u,onKeyDown:m,role:"button",tabIndex:0,children:null===e||void 0===e?void 0:e.name}),!(null===e||void 0===e||null===(a=e.sub_locations)||void 0===a||!a.length)&&(0,N.jsx)(Xj.A,{className:"nav nav-pills flex-column nested-scrollspy m-0",componentTag:"nav",currentClassName:"child-active",items:h(e),offset:-250,rootEl:c,children:null===e||void 0===e||null===(t=e.sub_locations)||void 0===t?void 0:t.map((e,s)=>(0,N.jsx)("div",{className:"nav-item nest-child",children:(0,N.jsx)("a",{className:"nav-link child-link","data-target":`#${null===e||void 0===e?void 0:e.hash}`,onClick:u,onKeyDown:m,role:"button",tabIndex:0,children:null===e||void 0===e?void 0:e.name})},s))})]},s)})})]})})},$j=ev;var e_=e=>(Qj(),(0,N.jsx)(a_,{value:{},children:(0,N.jsxs)(Ce.S,{className:"assignment-snapshot-details journey",children:[(0,N.jsx)(d_,{}),(0,N.jsx)(c_,{}),(0,N.jsx)(t_,{})]})}));const s_=l.createContext({}),a_=s_.Provider;s_.Consumer;var t_=e=>{const{assignment:s}=Qj(),{group_member_assignment_components:a=[]}=s||{};return(0,N.jsxs)(Ce.S,{className:"journey-component-list d-flex flex-column gap-3 my-5",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",id:"label.learning_modules.6e1d2fad"})}),!(null===a||void 0===a||!a.length)&&a.map((e,s)=>(0,N.jsx)(i_,{component:e},s))]})};var i_=e=>{const{component:s}=e,{id:a,cartridge:t,challenge:i,group_assignment_component:n,group_member_assignment_id:r,journey:o}=s||{},{type:d}=n||{},c=i||t||o||{},h=(null===c||void 0===c?void 0:c.total_time_seconds)/60,{has_privilege:u}=Qj(),{styles:m}=(0,P.nm)(),g=m["gray-500"],p=(0,l.useRef)(),x=(null===n||void 0===n?void 0:n[`${d}_template`])||{};return(0,N.jsxs)(Ge.A,{className:"journey-component-list-card",children:[(0,N.jsxs)(Ge.A.Body,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"component-icon me-3",children:(0,N.jsx)(Ad,{component:x,size:64,type:d})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-1",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("small",{className:"text-uppercase text-secondary font-weight-bold",children:d}),(0,N.jsxs)("span",{className:"d-flex align-items-center text-muted gap-1",children:[(0,N.jsx)(ze.w_X,{color:g}),(0,N.jsx)(Vh,{duration:null===x||void 0===x?void 0:x.total_est_completion_time,label_type:h>60?"short":"long",unit:"minutes"})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h5",{children:null===x||void 0===x?void 0:x.title}),(0,N.jsx)("small",{className:"text-secondary",style:{maxWidth:680},children:(0,ad.G9)((null===x||void 0===x?void 0:x.description)||(null===x||void 0===x?void 0:x.challenge_statement),{preserveNewlines:!0})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-5 mt-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Started",id:"label.started.ecbc89cd"})}),(0,N.jsx)("small",{className:"font-weight-bold",children:null!==s&&void 0!==s&&s.start?(0,N.jsx)(Gh.XU,{value:null===s||void 0===s?void 0:s.start}):(0,N.jsx)(ke.A,{defaultMessage:"Not started",id:"label.not_started.ba35f0c4"})})]}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column justify-content-between",children:null!==s&&void 0!==s&&s.completed?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})}),(0,N.jsx)("small",{className:"font-weight-bold",children:(0,N.jsx)(Gh.XU,{value:null===s||void 0===s?void 0:s.completed})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(Sa.A,{label:`${(null===s||void 0===s?void 0:s.completion_pct)||0}%`,max:100,min:0,now:null===s||void 0===s?void 0:s.completion_pct,style:{height:16,width:200}})]})})]}),!!u&&(0,N.jsx)(ve.A,{className:"align-self-end",onClick:()=>{const e=null===p||void 0===p?void 0:p.current;e&&u&&e.show({group_member_assignment_component_id:a,group_member_assignment_id:r})},size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Open preview",id:"label.o
2pen_preview.f7afe3dd"})})]})]})]}),(0,N.jsx)(r_,{is_admin:!0,ref:p})]})},l_=e_;const n_=(0,l.forwardRef)((s,a)=>{var t,n,r,o;const{onHide:d}=s,c=(0,l.useRef)((0,me.A)()),h=(0,l.useRef)(),u=(0,l.useRef)(),{api:m,getAllUserOrganizations:g,userId:p,userIsFullSiteAdmin:x}=(0,P.nm)(),v=(0,Pe.W6)(),[f,j,_]=(0,ne.CQ)({assignment:null,assignment_type:null,component:null,error:null,group_member_assignment_component_id:null,group_member_assignment_id:null,loading:!1,show:!1}),{assignment:b,assignment_type:A,component:y,error:w,group_member_assignment_component_id:S,group_member_assignment_id:C,loading:M}=f,k=null===b||void 0===b||null===(t=b.group_member_assignment_components)||void 0===t||null===(n=t[0])||void 0===n?void 0:n.certificate,z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{group_member_assignment_component_id:s,group_member_assignment_id:a}=e;j({group_member_assignment_component_id:s,group_member_assignment_id:a,show:!0})},T=()=>_(),I=()=>{T(),"function"===typeof d&&d()},E=()=>{var e,s;switch(A){case"journey":return(null===b||void 0===b||null===(e=b.assignment)||void 0===e?void 0:e.group_assignment_template)||{};case"challenge":case"cartridge":return(null===y||void 0===y||null===(s=y.group_assignment_component)||void 0===s?void 0:s[`${A}_template`])||{};default:return{}}};(0,l.useImperativeHandle)(a,()=>({hide:T,show:z})),(0,l.useEffect)(()=>_,[]),(0,l.useEffect)(()=>{f.group_member_assignment_id&&(async()=>{try{var s,a;const{group_member_assignment_component_id:e,group_member_assignment_id:t}=f;j({loading:!0});const{assignment:i,component:l}=await m.get("/api/assignments/snapshot",{group_member_assignment_component_id:e,group_member_assignment_id:t});j({assignment:i,assignment_type:(null===l||void 0===l||null===(s=l.group_assignment_component)||void 0===s?void 0:s.type)||(null===i||void 0===i||null===(a=i.assignment)||void 0===a?void 0:a.type)||null,component:l,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;j({error:a,loading:!1})}})()},[f.group_member_assignment_id]);const F=(null===i||void 0===i?void 0:i[A])||l.Fragment,R=!(null===b||void 0===b||null===(r=b.team)||void 0===r||null===(o=r.members)||void 0===o||!o.find(e=>{var s;return(null===e||void 0===e||null===(s=e.user)||void 0===s?void 0:s.id)===p}));return(0,N.jsxs)(Uj,{value:{assignment:b,assignment_type:A,clearError:()=>j({error:null}),component:y,error:w,getTemplate:E,group_member_assignment_component_id:S,group_member_assignment_id:C,handleCascadeHide:I,handleHide:T,has_privilege:(()=>{var e,s,a,t,i,l,n,r,o;const d=(null===(e=g())||void 0===e||null===(s=e.map)||void 0===s?void 0:s.call(e,e=>e.organization_id))||[],c=x(),{assignment:h,team:u}=b||{},m=(null===h||void 0===h||null===(a=h.group)||void 0===a||null===(t=a.members)||void 0===t||null===(i=t.map)||void 0===i?void 0:i.call(t,e=>{var s;return null===e||void 0===e||null===(s=e.organization_member)||void 0===s?void 0:s.user}))||[],v=d.includes(null===h||void 0===h||null===(l=h.group)||void 0===l?void 0:l.organization_id),f=!(null===m||void 0===m||null===(n=m.find)||void 0===n||!n.call(m,e=>e.id===p)),j=!(null===u||void 0===u||null===(r=u.members)||void 0===r||null===(o=r.find)||void 0===o||!o.call(r,e=>{var s,a;return(null===e||void 0===e||null===(s=e.group_member)||void 0===s||null===(a=s.organization_member)||void 0===a?void 0:a.user_id)===p}));return c||v||f||j})(),is_team_member:R,launchCertificateViewer:()=>{const e=null===u||void 0===u?void 0:u.current;e&&k&&e.show({certificate:k})},launchComponentDetailsModal:()=>{const e=null===h||void 0===h?void 0:h.current;if(!e)return;const s=E();e.show({component_id:null===s||void 0===s?void 0:s.id,type:A})},launchFacilitation:async()=>{var e;if(!b&&!y)return;const{cartridge:s,challenge:a}=y||{},t=(null===a||void 0===a?void 0:a.team_id)||(null===s||void 0===s?void 0:s.team_id)||(null===b||void 0===b||null===(e=b.team)||void 0===e?void 0:e.id);let i=`/assignment/${C}${y?`/${null===y||void 0===y?void 0:y.id}`:""}/content`;try{await m.post("/api/teams/members/facilitator/add",{team_id:t}),await window.open(i)}catch({err:err}){j({error:err})}},modal_guid:c.current,navigateToDashboard:()=>{const e=null===b||void 0===b?void 0:b.assignment,{id:s,group_id:a}=e||{},{group_assignment_component_id:t}=y||{};let i=`/admin/group/${a}/assignment/${s}`;t&&(i+=`/${t}`),I(),v.push(i)},setError:e=>j({error:e})}
2,children:[(0,N.jsx)(xe,{className:`assignment-snapshot-modal modal-${c.current}`,id:"assignmentSnapshotModal",onHide:T,show:f.show,size:"xl",children:(0,N.jsx)(Me.x_,{loading:M,spinner:(0,N.jsx)(u_,{}),children:b||y?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(o_,{}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(F,{})})]}):(0,N.jsx)(u_,{})})}),(0,N.jsx)(Uh,{ref:h}),(0,N.jsx)(Au,{ref:u})]})});n_.displayName="AssignmentSnapshotModal";var r_=n_;var o_=e=>{const{userIsAdmin:s}=(0,P.nm)(),{default_banner:a}=(0,P.hc)(),{getTemplate:t,handleHide:i,has_privilege:l}=Qj(),n=t(),{banner_path:r,title:o}=n;return(0,N.jsxs)(Ce.S,{className:"assignment-snapshot-modal-header",children:[(0,N.jsxs)(Ce.S,{className:"button-container d-flex",children:[s()&&l&&(0,N.jsx)(h_,{}),(0,N.jsx)(ve.A,{className:"close-btn",onClick:i,size:"sm",variant:"secondary",children:(0,N.jsx)(ze.QCr,{})})]}),n?(0,N.jsx)(Me.R_,{alt:`${o} banner image`,fluid:!0,src:r||a}):(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",xs:12})]})};var d_=e=>{var s,a,t,i,l,n;const{formatMessage:r}=(0,ja.A)(),{assignment:o,assignment_type:d,getTemplate:c,launchCertificateViewer:h,launchComponentDetailsModal:u}=Qj(),{title:m,total_est_completion_time:g}=c(),p=null===o||void 0===o||null===(s=o.group_member_assignment_components)||void 0===s||null===(a=s[0])||void 0===a?void 0:a.certificate,x=(null===o||void 0===o||null===(t=o.group_member_assignment_components)||void 0===t?void 0:t.length)||0,v=(null===o||void 0===o||null===(i=o.team)||void 0===i||null===(l=i.members)||void 0===l||null===(n=l.map)||void 0===n?void 0:n.call(l,e=>null===e||void 0===e?void 0:e.user))||[];return(0,N.jsx)(Ge.A,{className:"assignment-snapshot-metadata-container",children:(0,N.jsxs)(Ge.A.Body,{className:"p-5 position-relative",children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-5",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-1",children:[(0,N.jsx)("strong",{className:"text-secondary text-uppercase",children:d}),(0,N.jsx)("h1",{children:m}),(0,N.jsx)(tn,{className:"mt-3 d-flex",maxIcons:3,showOnline:!1,showTooltip:!0,size:32,users:v}),(0,N.jsxs)(Ce.S,{className:"d-flex mt-5 gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column milestone-date",children:[(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)("span",{className:"font-weight-bold",children:null!==o&&void 0!==o&&o.created_at?(0,N.jsx)(Gh.XU,{value:null===o||void 0===o?void 0:o.created_at}):"-"})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column milestone-date",children:[(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Started",id:"label.started.ecbc89cd"})}),(0,N.jsx)("span",{className:"font-weight-bold",children:null!==o&&void 0!==o&&o.start?(0,N.jsx)(Gh.XU,{value:null===o||void 0===o?void 0:o.start}):"-"})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column milestone-date",children:[(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})}),(0,N.jsx)("span",{className:"font-weight-bold",children:null!==o&&void 0!==o&&o.completed?(0,N.jsx)(Gh.XU,{value:null===o||void 0===o?void 0:o.completed}):"-"})]})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-end",xs:3,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1 text-secondary font-weight-bold mb-3",children:[(0,N.jsx)(Vh,{duration:g,label_type:"short",unit:"minutes"}),(0,N.jsx)(ze.w_X,{})]}),"journey"===d&&(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1 text-secondary font-weight-bold mb-3",children:[(0,N.jsxs)("span",{className:"d-inline-flex gap-1",children:[(0,N.jsx)("span",{children:x}),(0,N.jsx)(hc.A,{value:x,one:r({id:"label.module.120970d8",defaultMessage:"module"}),other:r({id:"label.modules.fbc6c1d4",defaultMessage:"modules"})})]}),(0,N.jsx)(ze.aQJ,{})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 p-0",onClick:u,variant:"link",children:[(0,N.jsx)(ke.A,{defaultMessage:"More details",id:"label.more_details.b5eff1db"}),(0,N.jsx)(ze.__w,{})]})]})]}),!!p&&(0,N.jsxs)(Ce.S,{className:"certificate-container d-flex flex-column align-items-end",children:[(0,N.jsx)("h6",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})}),(0,N.jsx)(Ce.S,{className:"box-shadow-100 box-shadow-hover-200 rounded",onClick:h,role:"button",style:{overflow:"hidden",
2width:140},children:(0,N.jsx)(Su,{thumbnail:!0,certificate_id:null===p||void 0===p?void 0:p.id})})]})]})})};var c_=e=>{const{clearError:s,error:a}=Qj();return(0,N.jsx)(We.A,{className:"mt-2",dismissible:!0,onClose:s,show:a,variant:"danger",children:a})};var h_=e=>{const{launchFacilitation:s,navigateToDashboard:a}=Qj();return(0,N.jsxs)(li.A,{className:"admin-actions-dropdown",onSelect:e=>{switch(e){case"facilitation":return s();case"dashboard":return a()}},children:[(0,N.jsx)(li.A.Toggle,{variant:"secondary",children:(0,N.jsx)(ze.H_v,{})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Item,{className:"d-flex align-items-center gap-2",eventKey:"facilitation",children:[(0,N.jsx)(ze.x$1,{}),(0,N.jsx)(ke.A,{defaultMessage:"Launch facilitation mode",id:"label.launch_facilitation_mode.e4a9ec72"})]}),(0,N.jsxs)(li.A.Item,{className:"d-flex align-items-center gap-2",eventKey:"dashboard",children:[(0,N.jsx)(ze.$BV,{}),(0,N.jsx)(ke.A,{defaultMessage:"See assignment dashboard",id:"label.see_assignment_dashboard.0820946c"})]})]})]})};var u_=e=>{const{handleHide:s,is_admin:a}=Qj();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"assignment-snapshot-modal-header",children:[(0,N.jsxs)(Ce.S,{className:"button-container d-flex",children:[a&&(0,N.jsx)(Ce.S,{className:"admin-actions-dropdown",children:(0,N.jsx)(ve.A,{className:"dropdown-toggle",disabled:!0,size:"sm",variant:"secondary",children:(0,N.jsx)(ze.H_v,{})})}),(0,N.jsx)(ve.A,{className:"close-btn",onClick:s,size:"sm",variant:"secondary",children:(0,N.jsx)(ze.QCr,{})})]}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",xs:12})]}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(Ce.S,{className:"assignment-snapshot-details",children:(0,N.jsx)(Ge.A,{className:"assignment-snapshot-metadata-container",children:(0,N.jsxs)(Ge.A.Body,{as:Qe.A,className:"p-5 d-flex justify-content-between",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column flex-1 gap-3",children:[(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",xs:2}),(0,N.jsx)(Rh.A,{animation:"wave",as:"h1",bg:"secondary",className:"placeholder",xs:6}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",size:"lg",xs:3}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-5 mt-5 mb-3",children:[(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",size:"lg",xs:2}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",size:"lg",xs:2})]})]}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3 align-items-end",xs:3,children:[(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",xs:5}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder",xs:4})]})]})})}),(0,N.jsx)(c_,{}),(0,N.jsx)(Ce.S,{className:"d-flex flex-1 p-5 align-items-center justify-content-center",children:(0,N.jsx)(Me.y$,{})})]})]})};const m_="has_seen_solvably_welcome";var g_=e=>{var s;const{group_member_assignment_component_id:a,group_member_assignment_id:t}=e,{events:i,userIsLearner:r,userPerformedAchievementEvent:o}=(0,n.nm)(),{getUserChallengeMember:d,preview:c,project:h}=Ra(),{is_complete:u,is_submitted:m}=h||{},g=(0,l.useRef)(),[p,x]=(0,ne.CQ)({show_onboard:!1}),{show_onboard:v}=p;(0,l.useEffect)(()=>{let e=JSON.parse(localStorage.getItem(m_));x({show_onboard:!e}),u&&m&&o(i.EVENT_VIEW_COMPLETED_CHALLENGE)},[]);const f=d&&(null===(s=d())||void 0===s?void 0:s.has_seen_final_compulsion),j=!r(),_=u&&m&&!f&&!j;return(0,N.jsxs)(Ce.S,{className:"challenge-hub d-flex flex-column align-items-center flex-1",children:[!c&&(0,N.jsx)(on,{}),(0,N.jsxs)(Ue.A,{as:Qe.A,className:"challenge-hub-contents",children:[(0,N.jsx)(rn,{}),(0,N.jsx)(Ve.A,{className:"mt-3",xs:12,children:(0,N.jsx)(fx,{})}),u&&m&&(0,N.jsx)(Pt,{}),(0,N.jsxs)(Ve.A,{className:"challenge-cards-container mt-4",xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Next steps",id:"label.next_steps.dd00d3d3"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 p-0",disabled:c,onClick:e=>{const s=null===g||void 0===g?void 0:g.current;s&&s.show({group_member_assignment_component_id:a,group_member_assignment_id:t})},variant:"link",children:[(0,N.jsx)(ze.Ny1,{}),(0,N.jsx)(ke.A,{defaultMessage:"Preview solution",id:"label.preview_solution.0dee4d50"})]})]}),(0,N.jsx)(Nr,{})]}),(0,N.jsx)(r_,{ref:g}),(0,N.jsx)(Hx,{handleClose:()=>{localStorage.setItem(m_,JSON.stringify("true")),x({show_onboard:!1})},show:v}),_&&(0,N.jsx)(xx,{})]})]})};var p_=e=>{var s;const a=(0,Pe.W6)(),{assignment:t,component:i,group:l,group_member_assignment_component_id:n,group_member_assignment_id:r}=dt(),{isBelowBreakpoint:o,width:d}=(0,ne.vh)({breakpoint:993}),c=o?d-250:d-680,{getPhaseLink:h,getSubphaseCompletionCount:u,phase:m,preview:g,project:p,set
2LearnerStarted:x,status:v,subphase:f}=Ra()||{},{completed:j,group_assignment_component:_,num_phases_complete:b}=p||{},{due:A}=_||{},y=(null===u||void 0===u?void 0:u())>0,w=Math.min(b+1,5),S=A?new Date(A):null,C=new Date(j),M=(null===t||void 0===t?void 0:t.assignment)||{},k=(null===i||void 0===i||null===(s=i.group_assignment_component)||void 0===s?void 0:s.challenge_template)||{},z=()=>{switch(!0){case!!g:return(0,N.jsx)(N.Fragment,{});case!!j:return(0,N.jsx)(ve.A,{className:"btn-xl",disabled:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge complete",id:"label.challenge_complete.c8478dee"})});case!(null===v||void 0===v||!v.expired):return(0,N.jsx)(ve.A,{className:"btn-xl",disabled:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge expired",id:"label.challenge_expired.8582f5fa"})});case!!y:return(0,N.jsx)(Le.Link,{className:"btn btn-primary btn-xl",to:h(w),children:(0,N.jsx)(ke.A,{defaultMessage:"Resume challenge",id:"label.resume_challenge.135f51f0"})});default:return(0,N.jsx)(Le.Link,{className:"btn btn-primary btn-xl",onClick:x,to:h(1),children:(0,N.jsx)(ke.A,{defaultMessage:"Start challenge",id:"label.start_challenge.e719fc07"})})}},T=e=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:e.date})," ","at"," ",(0,N.jsx)(Gh.ib,{dayPeriod:"short",hours:"numeric",minutes:"numeric",value:e.date})]}),I=()=>{switch(!0){case!!j:return(0,N.jsxs)("span",{className:"text-muted",children:[(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})," ",(0,N.jsx)(T,{date:C})]});case!(null===v||void 0===v||!v.expired):return(0,N.jsxs)("span",{className:"text-danger ",children:[(0,N.jsx)(ke.A,{defaultMessage:"Expired",id:"label.expired.424a2551"})," ",(0,N.jsx)(T,{date:S})]});case!(null===v||void 0===v||!v.overdue):return(0,N.jsxs)("span",{className:"d-flex flex-column",children:[(0,N.jsx)("strong",{className:"text-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge overdue",id:"label.challenge_overdue.689ee901"})}),(0,N.jsxs)("small",{className:"text-muted",children:[(0,N.jsx)(ke.A,{defaultMessage:"Due:",id:"label.due.df5b4777"})," ",(0,N.jsx)(T,{date:S})]})]});case!!A:return(0,N.jsxs)("span",{className:"text-muted",children:[(0,N.jsx)(ke.A,{defaultMessage:"Due",id:"label.due.9071738f"})," ",(0,N.jsx)(T,{date:S})]});default:return(0,N.jsx)(N.Fragment,{})}};return(0,N.jsxs)(sa.A,{className:"challenge-content-topnav p-3",children:[(0,N.jsx)(sa.A.Brand,{children:(0,N.jsx)(Le.Link,{"aria-label":"Go to Solvably Home",to:"/home",children:(0,N.jsx)(Zs.A,{alt:"Solvably logo",src:Ye})})}),(0,N.jsxs)(sa.A.Collapse,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"navbar-left d-flex align-items-center",children:[(()=>{if(g&&!m)return(0,N.jsx)(N.Fragment,{});const e="Back to challenge "+(m&&f?"hub":"syllabus");return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ve.A,{"aria-label":e,className:"content-close-btn btn-icon me-3 text-decoration-none text-muted",disabled:g&&!m,onClick:()=>{var e,s,t,i;if(g)return a.push(`/admin/challenge-template/preview/${null===a||void 0===a||null===(e=a.location)||void 0===e||null===(s=(t=e.pathname).split)||void 0===s||null===(i=s.call(t,"/"))||void 0===i?void 0:i[2]}`);const l=`/assignment/${r}/${n}/${m&&f?"content":"overview"}`;a.push(l)},title:e,variant:"quaternary",children:(0,N.jsx)(ze.QVr,{size:16})})})})(),(0,N.jsxs)(Ce.S,{className:"challenge-metadata d-flex flex-column",children:[(0,N.jsx)(Fl,{as:"p",className:"subtitle text-muted mb-0",maxWidth:c,placement:"bottom",children:"journey"===(null===M||void 0===M?void 0:M.type)?null===M||void 0===M?void 0:M.title:null===l||void 0===l?void 0:l.name}),(0,N.jsx)(Fl,{as:o?"h6":"h4",className:"title mb-0",maxWidth:c,placement:"bottom",children:null===k||void 0===k?void 0:k.title})]})]}),(0,N.jsxs)(Ce.S,{className:"navbar-right d-flex align-items-center",children:[!o&&(0,N.jsx)(Ce.S,{className:"challenge-hub-due-date me-3",children:(0,N.jsx)(I,{})}),!m&&!f&&!o&&(0,N.jsx)(z,{})]})]}),(0,N.jsx)(ia,{})]})};class x_ extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.handleTextChange=e=>{var s;return this.setState({word:(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)||""})},this.handleSubmit=e=>{e.preventDefault();const{word:s}=this.state,{app:a,challenge:t,intl:i}=this.props,{user:l}=a,{changePhaseData:n,getPhaseData:r}=t,o=r(this.phase,this.subphase),d=(null===o||void 0===o?void 0:o[this.field_id])||[];s&&(d.length>=25?this.setState({error:i.formatMessage({id:"label.too_many_words_only_25_words_can_b.53949621",defaultMessage:"Too many words! Only 25 words can be added to the Wordcloud, try removing an old word before adding a new one"})}):d.some(e=>e&&e.value.toLowerCase()===s.toLowerCase())?this.setState({error:i.formatMessage({id:"label.bummer_word_has_been_used_already.205f14e0",defaultMessage:"Bummer, {word} has been used already."},{word:(0,N.jsx)("strong",{children:s})})}):(d.push({user_id:l.id,value:s}),o[this.field_id]=d,this.setState({word:""}),n(this.phase,this.subphase,o),this.handler.revisions.addChallengeDataHistory({action:"add",action_data:{value:s},data:o,field_id:this.field_id})))},this.handleRemove=(e,s)=>{var a;const{challenge:t}=this.props,{changePhaseData:i,getPhaseData:l}=t,n=l(this.phase,this.subphase),r=(null===n||void 0===n?void 0:n[this.field_id])||[];(null===r||void 0===r||null===(a=r[e])||void 0===a?void 0:a.value)===s&&(r.splice(e,1),n[this.field_id]=r,i(this.phase,this.subphase,n),this.handler.revisions.addChallengeDataHistory({action:"remove",action_data:{value:s},data:n,field_id:this.field_id}))},this.launchRemovalConfirmationDialog=(e,s)=>{var a;const{intl:t}=this.props,{formatMessage:i}=t,l=null===(a=this.dialog)||void 0===a?void 0:a.current;l&&l.show({actions:[l.CancelAction(),l.Action({label:i({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:()=>this.handleRemove(e,s),variant:"danger"})],body:i({id:"label.are_you_sure_you_want_to_remove_wo.a2b7df3d",defaultMessage:'Are you sure you want to remove "{word}"?'},{word:(0,N.jsx)("strong",{children:s})}),size:"sm",title:"Remove word"})},this.handleHistoryRevert=(e,s,a)=>{const{id:t,data:i}=a,{challenge:l}=this.props,{canChangePhaseData:n,changePhaseData:r}=l;n()&&(r(this.phase,this.subphase,i),this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:t},data:i,field_id:this.field_id}),this.handler.revisions.hideChallengeDataHistory())},this.phase=1,this.subphase=1,this.handler=null,this.redirect=!1,this.field_id="wordCloudList",this.state={error:null,word:""},this.dialog=(0,l.createRef)()}render(){var e,s;const{challenge:a,intl:t}=this.props,{canChangePhaseData:i,getPhaseData:l}=a,{formatMessage:n}=t,r=!i(),o=l(this.phase,this.subphase),d=(null===o||void 0===o?void 0:o[this.field_id])||[],c=(null===d||void 0===d?void 0:d.length)||0;return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-1-1",children:(0,N.jsxs)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:[(0,N.jsx)(Tf,{show_example:!0,
2children:(0,N.jsxs)(Qe.A,{className:"gy-4 gx-0 gx-lg-3",children:[(0,N.jsxs)(Ve.A,{className:"left d-flex flex-column",children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:this.state.error,variant:"warning",children:(0,N.jsxs)("span",{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:this.state.error})]})}),(0,N.jsx)(_e.A,{onSubmit:this.handleSubmit,children:(0,N.jsx)(os,{children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(be.A,{"aria-label":"text input for word cloud",className:"form-control",disabled:r,id:"wordCloudList",onChange:this.handleTextChange,readOnly:r,style:{height:45},value:this.state.word,placeholder:n({id:"label.enter_a_word.4e2a9ff5",defaultMessage:"Enter a word..."})}),(0,N.jsx)(ve.A,{disabled:r||!(null!==this&&void 0!==this&&null!==(e=this.state)&&void 0!==e&&null!==(s=e.word)&&void 0!==s&&s.length),type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Add word",id:"label.add_word.c4d12e0a"})})]})})})]}),(0,N.jsx)(wr,{})]}),(0,N.jsxs)(Ve.A,{className:"right d-flex flex-column",lg:4,xs:12,children:[(0,N.jsx)(f_,{onWordClick:this.launchRemovalConfirmationDialog}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"field-revision-history-container",children:[(0,N.jsx)(Jv,{field_id:this.field_id}),(0,N.jsx)(Yv,{full_descriptor:!0,field_id:this.field_id,title:"Word Cloud History"})]}),(0,N.jsx)(Gf,{length:c,max:25,min:10})]})]})]})}),(0,N.jsx)(je,{ref:this.dialog})]})})}}var v_=(0,Ke.Ay)((0,P.G0)(Fa(x_)));var f_=e=>{var s,a;const{onWordClick:t}=e,{project:i}=Ra(),{challenge_data:l}=i,n=(null===l||void 0===l||null===(s=l[0])||void 0===s||null===(a=s.data)||void 0===a?void 0:a.wordCloudList)||[];return(0,N.jsxs)(Ce.S,{className:"used-words-list flex-fill d-flex flex-column",children:[(0,N.jsx)(Ce.S,{className:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Words used",id:"label.words_used.7245a9e5"})}),(0,N.jsx)(Ge.A,{className:"contents flex-fill",children:(0,N.jsx)(Ge.A.Body,{className:"p-2",children:null!==n&&void 0!==n&&n.length?(0,N.jsx)(N.Fragment,{children:n.map((e,s)=>{let{value:a}=e;return(0,N.jsx)(j_,{onClick:()=>t(s,a),word:a},s)})}):(0,N.jsx)(Ce.S,{className:"d-flex flex-column h-100 text-muted align-items-center justify-content-center",children:(0,N.jsx)(ke.A,{defaultMessage:"No words added yet.",id:"label.no_words_added_yet.11d72d49"})})})})]})};var j_=e=>{const{onClick:s,word:a}=e,{canChangePhaseData:t}=Ra(),i=!t();return(0,N.jsx)(Ce.S,{className:"used-word p-1 d-inline-block "+(i?"disabled":""),children:(0,N.jsxs)(bo.A,{"aria-label":`Remove word "${a}"`,bg:"light",className:"d-flex align-items-center gap-1",onClick:i?Function():s,role:i?"presentation":"button",tabIndex:"0",text:"dark",children:[a,!i&&(0,N.jsx)(ze.QCr,{className:"trash",size:14})]})})};const __=l.createContext({}),b_=__.Provider,A_=(__.Consumer,e=>{const{idx:s,item:a}=e,{type:t,user:i,value:n}=a||{},{userId:r}=(0,P.nm)(),{formatMessage:o}=(0,ja.A)(),{canChangePhaseData:d,getTeamMemberWithUserId:c}=Ra(),{handleChangePrimary:h,handleDelete:u}=(0,l.useContext)(__),m=(0,l.useRef)(),g=!d();return(0,N.jsxs)(Ge.A,{className:"gallery-card",style:{backgroundColor:"white",color:"black",marginBottom:10},children:[(0,N.jsx)(Ge.A.Img,{fluid:!0,className:"impacted-img",src:`${n}`}),(0,N.jsxs)(Ge.A.Footer,{className:"d-flex align-items-center justify-content-between bg-white",children:[i&&(0,N.jsx)(Ya,{showOnline:!1,size:32,user:c(i)}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{bsPrefix:"solvably",disabled:g,variant:"link",children:(0,N.jsx)(ze.H_v,{color:"var(--gray-500)"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Item,{className:"d-flex align-items-center gap-2",disabled:g,onClick:()=>((e,s,a)=>{const t=null===m||void 0===m?void 0:m.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:o({id:"label.confirm.eebdd24a",defaultMessage:"Confirm"}),onClick:()=>h(e,s,a),size:"sm",variant:"primary"})],body:o({id:"label.are_you_sure_you_want_to_set_this.5cf9e2dd",defaultMessage:"Are you sure you want to set this as the primary image?"}),title:o({id:"label.confirm_primary_change.698cbd03",defaultMessage:"Confirm primary change"})})})(a,t,s),children:[(0,N.jsx)(ze.pXu,{}),(0,N.jsx)(ke.A,{defaultMessage:"Make primary image",id:"label.make_primary_image.960f04b1"})]}),(0,N.jsx)(li.A.Divider,{}),i===r&&(0,N.jsxs)(li.A.Item,{className:"d-flex align-items-center gap-2 text-danger",disabled:g,onClick:()=>((e,s,a)=>{const t=null===m||void 0===m?void 0:m.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:o({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:()=>u(e,s,a),size:"sm",variant:"danger"})],body:o({id:"label.are_you_sure_you_want_to_delete_th.ed7fbe01",defaultMessage:"Are you sure you want to delete this image?"}
2),title:o({id:"label.confirm_deletion.fa57243d",defaultMessage:"Confirm deletion"})})})(a,t,s),children:[(0,N.jsx)(ze.qbC,{}),(0,N.jsx)(ke.A,{defaultMessage:"Delete item",id:"label.delete_item.a12c3854"})]})]})]})]}),(0,N.jsx)(je,{ref:m})]})});var y_=(0,l.forwardRef)((e,s)=>{const{galleryId:a,onDelete:t,onPrimaryChange:i,onUploadClick:n,primary:r}=e,o=Array.isArray(null===e||void 0===e?void 0:e.gallery)?e.gallery:[],{canChangePhaseData:d}=Ra(),c=(0,ja.A)(),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null),[p,x]=(0,l.useState)(null);(0,l.useEffect)(()=>{h||(g(null),x(null))},[h]);const v=()=>u(!0),f=()=>u(!1),j=!d();return(0,l.useImperativeHandle)(s,()=>({hideModal:f,showModal:v})),(0,N.jsx)(b_,{value:{handleChangePrimary:(e,s,t)=>{f(),"function"===typeof i&&i(e,s,a)},handleClick:(e,s)=>{e.gallery_id=s+1,x(e)},handleDelete:(e,s,a)=>{if(r&&(0,T.isEqual)(e,r))return g(c.formatMessage({id:"label.you_may_not_delete_this_image_as_i.62737cdb",defaultMessage:"You may not delete this image as it is currently set as primary"}));"function"===typeof t&&t(e,s,a)}},children:(0,N.jsxs)(xe,{backdrop:"static",dialogClassName:"photo-gallery-modal",onHide:()=>{const{onHide:s}=e;"function"===typeof s&&s(),f()},show:h,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Photo gallery",id:"label.photo_gallery.83185eb0"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g(null),show:m,variant:"danger",children:m}),(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2,992:3},children:(0,N.jsx)(Ij.A,{gutter:16,children:o.map((e,s)=>(0,N.jsx)(A_,{idx:s,item:e,stlye:{marginBottom:"10px"}},s))})}),(0,N.jsx)("hr",{}),n&&(0,N.jsx)(ve.A,{className:"gal-upload-button",disabled:j,onClick:n,children:(0,N.jsx)(ke.A,{defaultMessage:"Upload Image to Gallery",id:"label.upload_image_to_gallery.5f10b768"})})]})]})})});class w_ extends l.Component{constructor(e){super(e),this.clearSuccess=()=>this.setState({gallery_alert:null}),this.handleChangeText=e=>{const{challenge:s}=this.props,{changePhaseData:a,getPhaseData:t,isFieldDisabled:i}=s;if(i("identifyAudience")||!document.hasFocus())return;const l=this.field_id,n=t(this.phase,this.subphase),r=(null===n||void 0===n?void 0:n[l])||{};let o=(0,T.clone)(r);r.text=e,n.identifyAudience=r,a(this.phase,this.subphase,n),this.handler.revisions.setFieldTimer("constraints",null,()=>{const e=t(this.phase,this.subphase),s=(null===e||void 0===e?void 0:e.identifyAudience)||{text:""};(0,T.isEqual)((0,ad.G9)(o.text).trim(),(0,ad.G9)(s.text).trim())||this.handler.revisions.addChallengeDataHistory({action:"modify_field_text",action_data:{after:s,before:o},data:{identifyAudience:s},field_id:l})},5e3)},this.openGallery=()=>{this.photo_gallery&&this.photo_gallery.showModal()},this.closeGallery=()=>{this.photo_gallery&&this.photo_gallery.hideModal()},this.handleImageUpload=(e,s)=>{const{app:a,challenge:t}=this.props,{preview:i,project:l}=t;if(!i)return a.api.file("/api/challenges/upload/image",{challenge_id:null===l||void 0===l?void 0:l.id,job_id:s},e,"image.jpg")},this.handleImageUploadClick=()=>{const e=this.field_id,{app:s,challenge:a}=this.props,{canChangePhaseData:t,changePhaseData:i,getPhaseData:l}=a;t()&&this.uploader.promptImageUpload().then(a=>{if(!a)return;let t=(new Date).getTime()/1e3;const n=l(this.phase,this.subphase),r=(null===n||void 0===n?void 0:n[e])||{},o=!(null===r||void 0===r||!r.item);r.gallery=r.gallery?null===r||void 0===r?void 0:r.gallery:[],r.gallery.push({timestamp:t,type:"image",user:s.userId,value:a.location}),o?this.setState({gallery_alert:!0}):r.item={timestamp:t,type:"image",user:s.userId,value:a.location},n[e]=r,i(this.phase,this.subphase,n)})},this.handlePrimaryChange=e=>{const s=this.field_id,{challenge:a}=this.props,{changePhaseData:t,getPhaseData:i}=a,l=i(this.phase,this.subphase),n=(null===l||void 0===l?void 0:l[s])||{};null!==n&&void 0!==n&&n.item&&(n.item=e),t(this.phase,this.subphase,l)},this.handleGalleryDelete=(e,s,a)=>{var t;const i=this.field_id,{challenge:l}=this.props,{changePhaseData:n,getPhaseData:r}=l,o=r(this.phase,this.subphase),d=(null===o||void 0===o?void 0:o[i])||{};null!==d&&void 0!==d&&null!==(t=d.gallery)&&void 0!==t&&t[a]&&(d.gallery.splice(a,1),o.field=d,n(this.phase,this.subphase,o))},this.handleHistoryRevert=(e,s,a)=>{const{id:t,action:i,created_at:l,data:n}=a,{challenge:r}=this.props,{canChangePhaseData:o,changePhaseData:d,getPhaseData:c}=r;if(!o())return;const h=c(this.phase,this.subphase);i&&("modify_field_text"===i&&(h.identifyAudience.text=(null===n||void 0===n?void 0:n.identifyAudience.text)||"",d(this.phase,this.subphase,h)),this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:t,restored_from:l},data:n,field_id:"identifyAudience"}),this.handler.revisions.hideChallengeDataHistory())},this.state={gallery_alert:null,show_gallery:null},this.quillRef=(0,l.createRef)(),this.uploader=null,this.phase=1,this.subphase=2,this.field_id="identifyAudience",this.handler=null,this.photo_gallery=null}componentDidMount(){const{challenge:e}=this.props,{team:s}=e;if(s&&!this.state.quill_init&&this.quillRef){const e=this.quillRef&&this.quillRef.current&&"function"==typeof this.quillRef.current.getEditor&&this.quillRef.current.getEditor();this.setState({editor:e,modules:{},quill_init:!0})}}render(){var e;const{app:s,challenge:a,intl:t}=this.props,{canChangePhaseData:i,fieldStatusIndicator:l,getPhaseData:n,getTeamMemberWithUserId:r,isFieldDisabled:o,setFieldStatus:d}=a||{},{formatMessage:c}=t,h=n(this.phase,this.subphase),u=(null===h||void 0===h?void 0:h[null===this||void 0===this?void 0:this.field_id])||{},m=(null===h||void 0===h||null===(e=h.identifyAudience)||void 0===e?void 0:e.text)||"",g=(null===u||void 0===u?void 0:u.gallery)||[],p=!i();return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-1-2",children:(0,N.jsxs)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:[(0,N.jsx)(Tf,{show_example:!0,
2children:(0,N.jsxs)(Qe.A,{className:"gap-3 gap-lg-0",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column flex-fill",lg:5,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:this.state.gallery_alert,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Image successfully uploaded.",id:"label.image_successfully_uploaded.146be6e0"})}),(0,N.jsx)("h6",{className:"d-inline",children:(0,N.jsx)(ke.A,{defaultMessage:"1. Upload an image of who is impacted by the specific problem you are addressing.",id:"label.1_upload_an_image_of_who_is_impact.e7005ba5"})}),(0,N.jsxs)(Ce.S,{style:{marginTop:20},children:[(0,N.jsx)(Ge.A,{className:"gallery-card",children:null!==u&&void 0!==u&&u.item?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ge.A.Img,{fluid:!0,className:"impacted-img",src:`${u.item.value}`}),(0,N.jsx)(Ge.A.Footer,{className:"d-flex align-items-center justify-content-between bg-white",children:u.item.user&&(0,N.jsx)(Ya,{showOnline:!1,size:32,user:r(u.item.user)})})]}):(0,N.jsx)(Ge.A.Body,{className:"d-flex align-items-center justify-content-center",onClick:this.handleImageUploadClick,role:p?"presentation":"button",children:(0,N.jsx)(Am,{className:"image-placeholder",height:225,label:"",variant:"drag-drop"})})}),(0,N.jsx)(S_,{field_id:this.field_id,onAdd:this.handleImageUploadClick,onOpen:this.openGallery,thumbnails:g})]})]}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column flex-fill gap-3",lg:7,children:[(0,N.jsx)("h6",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"2. Describe their needs and motivations. (15-75 words)",id:"label.2_describe_their_needs_and_motivat.d14dca64"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ge.A,{className:"flex-fill quill-container "+(p?"bg-light":""),children:(0,N.jsx)(_p(),{formats:[],id:"id-audience-collaboration-area",modules:{keyboard:{bindings:{tab:!1}}},onChange:e=>this.handleChangeText(e),onFocus:Function(),onKeyDown:()=>d("identifyAudience"),readOnly:p||o("identifyAudience"),ref:this.quillRef,theme:null,value:m,placeholder:c({id:"label.describe_how_they_are_affected_usi.1e35fe3f",defaultMessage:"Describe how they are affected using text..."})})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)(Ce.S,{className:"me-auto",children:l("identifyAudience")}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Jv,{field_id:"identifyAudience"}),(0,N.jsx)(Yv,{full_descriptor:!0,field_id:"identifyAudience",size:"large",title:t.formatMessage({id:"label.identify_audience_history.87de21a8",defaultMessage:"Identify audience history"})}),(0,N.jsx)(Gf,{length:s.utils.countWords((0,ad.G9)(m)),max:75,min:15})]})]})]})]})]})}),(0,N.jsx)(y_,{closeGallery:this.closeGallery,gallery:g,onDelete:this.handleGalleryDelete,onPrimaryChange:this.handlePrimaryChange,onUploadClick:this.handleImageUploadClick,primary:null===u||void 0===u?void 0:u.item,ref:e=>this.photo_gallery=e}),(0,N.jsx)(TA,{aspectRatio:1.5,ref:e=>this.uploader=e,uploadHandler:this.handleImageUpload})]})})}}var N_=(0,Ke.Ay)((0,P.G0)(Fa(w_)));var S_=e=>{var s,a,t;const{field_id:i,onAdd:l,onOpen:n,thumbnails:r}=e,{canChangePhaseData:o,getPhaseData:d,phase:c,preview:h,subphase:u}=Ra(),m=d(c,u),g=(null===r||void 0===r||null===(s=r.filter)||void 0===s||null===(a=s.call(r,e=>{var s,a;let{value:t}=e;return t!==(null===m||void 0===m||null===(s=m[i])||void 0===s||null===(a=s.item)||void 0===a?void 0:a.value)}))||void 0===a||null===(t=a.slice)||void 0===t?void 0:t.call(a,0,2))||[],p=!o();return(0,N.jsxs)(Ce.S,{className:"thumbnail-gallery d-flex gap-1 align-items-center py-2",children:[(0,N.jsx)(ve.A,{className:"add-image-btn p-1",disabled:p,onClick:p?Function():l,variant:"secondary",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add image",id:"label.add_image.04136060"})})}),!(null===g||void 0===g||!g.length)&&g.map((e,s)=>{let{value:a}=e;return(0,N.jsx)(Zs.A,{thumbnail:!0,alt:"",className:"gallery-thumbnail p-0",src:a},s)}),(0,N.jsx)(ve.A,{className:"align-self-center",disabled:!!h,onClick:n,variant:"link",children:(0,N.jsxs)("strong",{children:[(0,N.jsx)(ke.A,{defaultMessage:"View all",id:"label.view_all.30a64216"}),(0,N.jsxs)("span",{className:"visually-hidden",children:["\xa0",(0,N.jsx)(ke.A,{defaultMessage:"images",id:"label.images.21b2eed1"})]})]})})]})};class C_ extends l.Component{constructor(e){super(e),this.handleChangeText=(e,s)=>{const{challenge:a}=this.props,{changePhaseData:t,getPhaseData:i}=a,l=e.currentTarget.value||"",n=i(this.phase,this.subphase),r=((null===n||void 0===n?void 0:n.constraints)||{})[s]||{category:"",text:""},o=(0,T.clone)(r);r.text=l,n.constraints[s]=r,t(this.phase,this.subphase,n),this.handler.revisions.setFieldTimer("constraints",s,()=>{const e=i(this.phase,this.subphase),a=((null===e||void 0===e?void 0:e.constraints)||{category:"",text:""})[s];(0,T.isEqual)((0,ad.G9)(o.text).trim(),(0,ad.G9)(a.text).trim())||this.handler.revisions.addChallengeDataHistory({action:"modify_field_text",action_data:{after:a,before:o},data:{constraint:a},field_id:"constraints",sub_field_id:s})},5e3)},this.handleChangeCategory=(e,s)=>{const{challenge:a}=this.props,{changePhaseData:t,getPhaseData:i}=a,l=i(this.phase,this.subphase),n=(null===l||void 0===l?void 0:l.constraints)||{},r=null===n||void 0===n?void 0:n[s],o=(0,T.clone)(r);if(e&&"delete"==e.toLowerCase())delete n[s],l.constraints=n,t(this.phase,this.subphase,l),this.handler.revisions.addChallengeDataHistory({action:"remove",action_data:{},data:{constraint:r},field_id:"constraints",sub_field_id:s});else{if((0,T.isEqual)(n[s].category,e))return;n[s].category=e,l.constraints=n,t(this.phase,this.subphase,l),this.handler.revisions.addChallengeDataHistory({action:"modify_field_category",action_data:{after:n[s],before:o},data:{constraint:o},field_id:"constraints",sub_field_id:s})}},this.handleAddConstraint=()=>{const{challenge:e}=this.props,{changePhaseData:s,getPhaseData:a}=e,t=a(this.phase,this.subphase),i=(null===t||void 0===t?void 0:t.constraints)||{};if(Object.keys(i).length>=6)return this.setState({error:!0}),!1;const l=(0,me.A)();i[l]={category:"",text:""},t.constraints=i,s(this.phase,this.subphase,t),this.handler.revisions.addChallengeDataHistory({action:"add_field",action_data:{},data:{constraint:i[l]},field_id:"constraints",sub_field_id:l})},this.handleHistoryRevert=(e,s,a)=>{const{id:t,action:i,action_data:l,created_at:n,data:r}=a,{challenge:o}=this.props,{canChangePhaseData:d,changePhaseData:c,getPhaseData:h,project:u}=o;if(!d())return;const m=h(this.phase,this.subphase);if(i){var g,p;if("modify_field_text"===i)m.constraints[s].text=(null===r||void 0===r||null===(g=r.constraint)||void 0===g?void 0:g.text)||"",c(this.phase,this.subphase,m);if("modify_field_category"===i)m.constraints[s].category=(null===r||void 0===r||null===(p=r.constraint)||void 0===p?void 0:p.category)||"",c(this.phase,this.subphase,m);if("remove"===i){const{app:a}=this.props,n=a.api;if(Object.keys(m.constraints).length>=6)return this.setState({error:!0},()=>{this.handler.revisions.hideChallengeDataHistory()}),!1;null!==r&&void 0!==r&&r.constraint&&(m.constraints[s]=r.constraint),c(this.phase,this.subphase,m),n.post(`/api/challenges/phase/history/delete/${t}`,{action:i,action_data:l,challenge_id:u.id,data:r,field_id:e,sub_field_id:s}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:t,restored_action:i,restored_from:n},data:r,field_id:"constraints",sub_field_id:s}),this.handler.revisions.hideChallengeDataHistory()}},this.getDefaultConstraints=()=>({[(0,me.A)()]:{category:"",text:""},[(0,me.A)()]:{category:"",text:""},[(0,me.A)()]:{category:"",text:""}}
2),this.phase=1,this.subphase=3,this.handler=null,this.redirect=!1,this.state={constraints:{},error:!1}}componentDidMount(){const{challenge:e}=this.props,{changePhaseData:s,getPhaseData:a}=e,t=a(this.phase,this.subphase);(null===t||void 0===t?void 0:t.constraints)||null||s(this.phase,this.subphase,{constraints:this.getDefaultConstraints()})}render(){const{app:e,challenge:s,intl:a}=this.props,{canChangePhaseData:t,fieldStatusIndicator:i,getPhaseData:l,isFieldDisabled:n,setFieldStatus:r}=s,{formatMessage:o}=a,{error:d}=this.state,c=l(this.phase,this.subphase),h=(null===c||void 0===c?void 0:c.constraints)||this.getDefaultConstraints(),u=!t();return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-1-3",children:(0,N.jsx)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:(0,N.jsxs)(Tf,{revision_history_button:(0,N.jsx)(rj,{field_id:"constraints"}),show_example:!0,children:[(0,N.jsx)(Ce.S,{style:{height:30,position:"relative"},children:(0,N.jsxs)(ve.A,{className:"add-constraint",disabled:u,onClick:this.handleAddConstraint,style:{position:"absolute",right:0,top:-10},variant:"link",children:[(0,N.jsx)("span",{"aria-hidden":"true",children:"+"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Add new constraint",description:"",id:"label.add_new_constraint.1122c87a"})]})}),(0,N.jsxs)(We.A,{show:d,variant:"danger",children:[(0,N.jsx)(We.A.Heading,{children:(0,N.jsx)(ke.A,{defaultMessage:"Oops, you've already added 6 Constraints!",description:"",id:"label.oops_youve_already_added_6_constra.758a17ed"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Great work, but you already reached the maximum number of Constraints possible for a single challenge. Review the six you have and move forward!",description:"",id:"label.great_work_but_you_already_reached.e11933ee"})}),(0,N.jsx)("hr",{}),(0,N.jsx)("div",{className:"d-flex justify-content-end",children:(0,N.jsx)(ve.A,{onClick:()=>this.setState({error:!1}),variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Close me!",description:"",id:"label.close_me.8b97cfbd"})})})]}),(0,N.jsx)(Ue.A,{fluid:!0,className:"mt-3",style:{padding:0},children:(0,N.jsx)("ul",{style:{paddingLeft:"0px"},children:Object.keys(h).map((s,a)=>{const t=h[s],l=t.category?t.category:"";return(0,N.jsxs)("li",{className:"constraint-item "+(l?"has-constraint":""),children:[(0,N.jsxs)(Ei.A,{className:"d-flex flex-column flex-lg-row gap-2",children:[(0,N.jsxs)(Fi.A,{disabled:u,onSelect:e=>this.handleChangeCategory(e,s),style:{overflow:"unset"},title:l.length?l:"Pick constraint category",variant:l?"primary":"secondary",children:[(0,N.jsx)(li.A.Item,{eventKey:"Time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time",id:"label.time.33b93476"})}),(0,N.jsx)(li.A.Item,{eventKey:"Cost",children:(0,N.jsx)(ke.A,{defaultMessage:"Cost",id:"label.cost.204a5eb2"})}),(0,N.jsx)(li.A.Item,{eventKey:"Resources",children:(0,N.jsx)(ke.A,{defaultMessage:"Resources",id:"label.resources.e89b30aa"})}),(0,N.jsx)(li.A.Item,{eventKey:"Materials",children:(0,N.jsx)(ke.A,{defaultMessage:"Materials",id:"label.materials.fd10a146"})}),(0,N.jsx)(li.A.Item,{eventKey:"Equipment",children:(0,N.jsx)(ke.A,{defaultMessage:"Equipment",id:"label.equipment.7f2465ac"})}),(0,N.jsx)(li.A.Item,{eventKey:"Safety",children:(0,N.jsx)(ke.A,{defaultMessage:"Safety",id:"label.safety.726d11bd"})}),(0,N.jsx)(li.A.Item,{eventKey:"Reliability",children:(0,N.jsx)(ke.A,{defaultMessage:"Reliability",id:"label.reliability.71d0acd4"})}),(0,N.jsx)(li.A.Item,{eventKey:"Aesthetics",children:(0,N.jsx)(ke.A,{defaultMessage:"Aesthetics",id:"label.aesthetics.11296d9d"})}),(0,N.jsx)(li.A.Item,{eventKey:"Social Impact",children:(0,N.jsx)(ke.A,{defaultMessage:"Social impact",id:"label.social_impact.6dc26756"})}),(0,N.jsx)(li.A.Item,{eventKey:"Cultural Impact",children:(0,N.jsx)(ke.A,{defaultMessage:"Cultural impact",id:"label.cultural_impact.1c849974"})}),(0,N.jsx)(li.A.Item,{eventKey:"Environmental Impact",children:(0,N.jsx)(ke.A,{defaultMessage:"Environmental impact",id:"label.environmental_impact.59165c18"})}),Object.keys(h).length>3&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(li.A.Divider,{}),(0,N.jsxs)(li.A.Item,{eventKey:"Delete",children:[(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})," ",(0,N.jsx)(ze.qbC,{})]})]})]}),(0,N.jsx)(_e.A.Control,{"aria-label":`text input for ${l} constraint`,as:"textarea",className:"flex-fill",disabled:u||n("constraints",s),onChange:e=>this.handleChangeText(e,s),onKeyDown:()=>r("constraints",s),readonly:u,rows:2,value:t.text,placeholder:0===a?o({id:"label.time_ex_we_want_to_produce_the_sol.4b8297e3",defaultMessage:"Time EX: We want to produce the solution by end of Q4 next year"}):""})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-md-row align-items-center justify-content-between",children:[(0,N.jsx)(Ce.S,{className:"me-auto",children:i("constraints",s)}),(0,N.jsxs)(Ce.S,{className:"d-flex",style:{alignItems:"center"},children:[(0,N.jsx)(Jv,{field_id:"constraints",sub_field_id:s}),(0,N.jsx)(Yv,{full_descriptor:!0,allowedActions:["add","modify_field_text","modify_field_category","add_field","revert"],field_id:"constraints",size:"large",sub_field_id:s,title:(0,N.jsx)(ke.A,{defaultMessage:"{category} Constraint History",description:"",id:"label.category_constraint_history.76c29ccf",values:{category:l}})}),(0,N.jsx)(Gf,{length:e.utils.countWords(t&&t.text),max:25,min:5})]})]})]},a)})})})]})})})}}var M_=(0,Ke.Ay)((0,P.G0)(Fa(C_)));let k_=ul.Ik().shape({link:ul.Yj().matches(/((https?):\/\/)?(www.)?[-a-zA-Z0-9@:%_\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/,{excludeEmptyString:!0,message:"Invalid URL"}).required("URL Required")});const z_=e=>{const[s,a]=(0,ne.CQ)({domain:null,error:!1,link:"",link_error:null,pasted:!1,show_modal:!0,uploading:!1}),t=(0,ne.ZC)(s.link),{api:i}=(0,P.nm)();(0,l.useEffect)(()=>{0===s.link.length&&a({link_error:null,pasted:!1}),s.link!==t&&null!==s.link_error&&a({link_error:null,pasted:!1})},[s.link]);const n=t=>{var l;null===t||void 0===t||null===(l=t.preventDefault)||void 0===l||l.call(t),k_.validate(s).then(()=>{let{link:t}=s;a({uploading:!0}),-1==t.indexOf("http://")&&-1==t.indexOf("https://")&&(t="https://"+t),i.post("/api/site/metadata",{url:t}).then(i=>{const l=s.link.match(/^https?:\/\/([^?#]+)(?:[?#]|$)/i),n=l&&l[1],{image:r,title:o}=i;a({show_modal:!1,uploading:!1});const d=t.substring(t.lastIndexOf(".")+1);"function"==typeof e.handleLinkChange&&e.handleLinkChange({domain:n,extension:d,image:r,link:t,title:o})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;a({error:s,uploading:!1})})}).catch(e=>{a({link_error:e.errors[0]})})};(0,l.useEffect)(()=>{s.pasted&&n()},[s.pasted]);const{error:r,link:o,link_error:d,uploading:c}=s;return(0,N.jsx)("div",{children:c?(0,N.jsx)("div",{className:"text-center",children:(0,N.jsx)(Me.y$,{animation:"border"})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,show:r,variant:"danger",onClose:()=>{a(e=>(0,F.A)((0,F.A)({},e),{},{error:null}))},children:r}),(0,N.jsx)(_e.A,{className:"sharebox-research-link",onSubmit:n,children:(0,N.jsxs)(os,{className:"d-flex m-0 gap-2 flex-fill",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-fill",children:[(0,N.jsx)(_e.A.Control,{onChange:e=>a({link:e.currentTarget.value}),onPaste:e=>{e.preventDefault();const s=e.clipboardData.getData("text");a({link:s,pasted:!0})},placeholder:o.length?"":"Example: https://www.nationalgeographic.com/article/pollution/reducing-pollution-2019",value:o||e.link}),!!d&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:`Validation Error: ${d}`})]}),(0,N.jsx)(ve.A,{className:"align-self-start",disabled:!(null!==o&&void 0!==o&&o.length),type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})]})})]})})},T_=(0,l.forwardRef)((e,s)=>{const{onLinkChange:a=null}=e,[t,i,n]=(0,ne.CQ)({show:!1}),{label:r,show:o}=t,[d,c,h]=(0,ne.CQ)({reject:Function(),resolve:Function()}),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;d.resolve(e),h()},m=()=>{n()};return(0,l.useImperativeHandle)(s,()=>({hide:()=>m(),show:e=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Add Link";return new Promise((s,a)=>{c({reject:a,resolve:s}),i(s=>(0,F.A)((0,F.A)({},s),{},{label:e,show:!0}))})}(e)})),(0,N.jsxs)(xe,{onHide:m,show:o,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:r})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)("div",{children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Paste a link",description:"",id:"label.paste_a_link.8275f7c2"})}),(0,N.jsx)(z_,{handleLinkChange:e=>{return s=e,"function"===typeof a?(a(s),u(null)):u(s),void m();var s}})]})})]})});t(76417);const I_={file:null,job_id:null,reject:Function(),resolve:Function(),show:!1,show_cropper:!1,step:0,supportedFiles:"",title:"Add Attachment",uploading:!1,wide:!0},E_=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)((0,F.A)({},I_)),n=(0,l.useRef)(null),r=(0,l.useRef)(null),o=()=>new Promise((e,s)=>{t(a=>(0,F.A)((0,F.A)({},a),{},{reject:s,resolve:e,show:!0}))}),d=()=>{a.resolve(null),i()},c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s="";3===e?(s="image",t({step:3})):4===e?(s="file",t({step:4})):2===e&&(s="video",t({step:2})),1!==e&&h(s)},h=async e=>{const s=null===n||void 0===n?void 0:n.current;if(!s)return;const t=await s.show(e);t&&(e=>{a.resolve(e),i()})(t)};return(0,l.useImperativeHandle)(s,()=>({hide:i,show:o})),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{backdrop:"static",dialogClassName:"share-attachment-wizard-modal expanded",onEnter:()=>t({error:null,step:0,supportedFiles:"",title:"Add Attachment",uploading:!1,wide:!1}),onHide:d,show:a.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add attachment",id:"label.add_attachment.ebda695e"})})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)("div",{className:"attachment-options",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsxs)("button",{className:"option",onClick:async()=>{const e=null===r||void 0===r?void 0:r.current;if(!e)return;const s=await e.show();null!==s&&(e=>{if(!e)return d();e.type="link",e.location=e.link,a.resolve({file:(0,F.A)({},e)}),i()})(s)},children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.f35,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:"Website"}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Enter a link to the web",id:"label.enter_a_link_to_the_web.541
2d1ef0"})})]})]})}),(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsxs)("button",{className:"option",onClick:()=>c(2),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.HiP,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:"Video"}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to a video",id:"label.upload_or_link_to_a_video.aafbe8e9"})})]})]})}),(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsxs)("button",{className:"option bottom-col",onClick:()=>c(3),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.dkL,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Image",id:"label.image.1aa4cb0b"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to an image",id:"label.upload_or_link_to_an_image.870776be"})})]})]})}),(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsxs)("button",{className:"option bottom-col",onClick:()=>c(4),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.t69,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Document",id:"label.document.d6bd8c0a"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to any file",id:"label.upload_or_link_to_any_file.d0a67f96"})})]})]})})]})})})]}),(0,N.jsx)(kA,{aspectRatio:328/170,has_finished:!1,ref:n}),(0,N.jsx)(T_,{ref:r})]})}),F_=(0,l.forwardRef)((e,s)=>{const{onHide:a=Function(),type:t="default"}=e,[i,n,r]=(0,ne.CQ)((0,F.A)({},I_)),o=(0,l.useRef)(null),d=(0,l.useRef)(null);(0,l.useImperativeHandle)(s,()=>({hide:()=>h(),show:()=>c()}));const c=()=>new Promise((e,s)=>{n(a=>(0,F.A)((0,F.A)({},a),{},{reject:s,resolve:e,show:!0}))}),h=()=>n(e=>(0,F.A)((0,F.A)({},e),{},{show:!1})),u=()=>{h(),a()},m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,s="";3===e?(s="image",n({step:3})):4===e?(s="file",n({step:4})):2===e?(s="video",n({step:2})):5===e?(s="link",n({step:5})):6===e&&(s="image",n({step:6})),1!==e&&g(s)},g=e=>{o.current.show(e).then(e=>{(e=>{i.resolve(e),u()})(e)})},p=e=>{d.current.show(e).then(e=>{null!==e&&(e=>{if(!e)return i.resolve(null),void r();e.type="link",e.location=e.link,i.resolve(e),r()})(e)})};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{backdrop:"static",dialogClassName:"share-attachment-wizard-modal expanded",onEnter:()=>{n({error:null,step:0,supportedFiles:"",title:"Add Attachment",uploading:!1,wide:!1})},onHide:u,show:i.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add attachment",id:"label.add_attachment.ebda695e"})})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)("div",{className:"attachment-options",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:4,md:6,children:(0,N.jsxs)("button",{className:"option",onClick:()=>m(6),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.Myc,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Sketch",description:"",id:"label.sketch.0f9b002d"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to a drawing of your idea",description:"",id:"label.upload_or_link_to_a_drawing_of_you.c333ea57"})})]})]})}),(0,N.jsx)(Ve.A,{lg:4,md:6,children:(0,N.jsxs)("button",{className:"option",onClick:()=>p("Link to your Google Docs, Prezi, etc."),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.t69,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Online document",description:"",id:"label.online_document.b597438c"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Link to your idea in Google Docs, Prezi, etc.",description:"",id:"label.link_to_your_idea_in_google_docs_p.62f2933b"})})]})]})}),(0,N.jsx)(Ve.A,{lg:4,md:6,children:(0,N.jsxs)("button",{className:"option",onClick:()=>p("Add Website"),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.f35,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Website",description:"",id:"label.website.b5a229ac"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Link to an idea foun
2d on the web",description:"",id:"label.link_to_an_idea_found_on_the_web.c8e48222"})})]})]})}),(0,N.jsx)(Ve.A,{lg:4,md:6,children:(0,N.jsxs)("button",{className:"option bottom-col",onClick:()=>m(2),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.HiP,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Video",description:"",id:"label.video.d534be82"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to a video of your idea",description:"",id:"label.upload_or_link_to_a_video_of_your.5460d025"})})]})]})}),(0,N.jsx)(Ve.A,{lg:4,md:6,children:(0,N.jsxs)("button",{className:"option bottom-col",onClick:()=>m(3),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.dkL,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Image",description:"",id:"label.image.1aa4cb0b"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to an image of your idea",description:"",id:"label.upload_or_link_to_an_image_of_your.7dcbd828"})})]})]})}),(0,N.jsx)(Ve.A,{lg:4,md:6,children:(0,N.jsxs)("button",{className:"option bottom-col",onClick:()=>m(4),children:[(0,N.jsx)("div",{className:"attach-icon",children:(0,N.jsx)(ze.t69,{})}),(0,N.jsxs)("div",{className:"d-flex flex-column text-start position-relative option-text",style:{left:52},children:[(0,N.jsx)("h6",{style:{marginBottom:4},children:(0,N.jsx)(ke.A,{defaultMessage:"Document",description:"",id:"label.document.d6bd8c0a"})}),(0,N.jsx)("p",{className:"small mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or link to any file",description:"",id:"label.upload_or_link_to_any_file.d0a67f96"})})]})]})})]})})})]}),(0,N.jsx)(kA,{aspectRatio:328/170,has_finished:!1,ref:o}),(0,N.jsx)(T_,{ref:d})]})});E_.displayName="ShareCardAttachmentModal",F_.displayName="IdeaCardAttachmentModal";const R_=["activeColor","bold","onChange","onFocus"],D_="#fff9e5",B_="#fce8f1",P_="#f2f0fc",L_="#e9f4fb",O_="#e8fcf8",H_="#ffffff",U_=e=>{let{activeColor:s,bold:a=!1,onChange:t,onFocus:i}=e;(0,he.A)(e,R_);return(0,N.jsx)("div",{className:"shares-color-picker-radio",children:(0,N.jsxs)("fieldset",{children:[(0,N.jsx)("legend",{children:(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Color",id:"label.color.6b73191a"})})}),(0,N.jsxs)(Ce.S,{className:"inputs d-flex flex-nowrap  justify-content-between",children:[(0,N.jsx)("input",{checked:s===H_,className:"white-r",id:"r4",name:"color",onChange:t,type:"radio",value:H_}),(0,N.jsxs)("label",{htmlFor:"r4",children:[(0,N.jsx)("span",{className:"white-r "+(a?"bold":"")}),(0,N.jsx)("p",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"white",id:"label.white.018fa96a"})})]}),(0,N.jsx)("input",{checked:s===D_,className:"yellow-r",id:"r3",name:"color",onChange:t,type:"radio",value:D_}),(0,N.jsxs)("label",{htmlFor:"r3",children:[(0,N.jsx)("span",{className:"yellow-r "+(a?"bold":"")}),(0,N.jsx)("p",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"yellow",id:"label.yellow.c685a2c9"})})]}),(0,N.jsx)("input",{checked:s===B_,className:"pink-r",id:"r2",name:"color",onChange:t,tabIndex:0,type:"radio",value:B_}),(0,N.jsxs)("label",{htmlFor:"r2",children:[(0,N.jsx)("span",{className:"pink-r "+(a?"bold":"")}),(0,N.jsx)("p",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"pink",id:"label.pink.a67a41c8"})})]}),(0,N.jsx)("input",{checked:s===P_,className:"magenta-r",id:"r1",name:"color",onChange:t,type:"radio",value:P_}),(0,N.jsxs)("label",{htmlFor:"r1",children:[(0,N.jsx)("span",{className:"magenta-r "+(a?"bold":"")}),(0,N.jsx)("p",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"magenta",id:"label.magenta.c7941b69"})})]}),(0,N.jsx)("input",{checked:s===L_,className:"blue-r",id:"r0",name:"color",onChange:t,type:"radio",value:L_}),(0,N.jsxs)("label",{htmlFor:"r0",children:[(0,N.jsx)("span",{className:"blue-r "+(a?"bold":"")}),(0,N.jsx)("p",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"blue",id:"label.blue.16477688"})})]}),(0,N.jsx)("input",{checked:s===O_,className:"green-r",id:"r5",name:"color",onChange:t,type:"radio",value:O_}),(0,N.jsxs)("label",{htmlFor:"r5",children:[(0,N.jsx)("span",{className:"green-r "+(a?"bold":"")}),(0,N.jsx)("p",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"green",id:"label.green.ba4788b2"})})]})]})]})})};const Q_=(0,l.forwardRef)((e,s)=>{var a;const{bold:t=!1,modal_title:i="Modal Title Missing",q_index:r,question_title:o="",type:d="default"}=e,c=(0,ja.A)(),{user:h,utils:u}=(0,n.nm)(),{countWords:m,file_types:g,image_types:p,video_types:x}=u,[v,f]=(0,l.useState)({reject:Function(),resolve:Function()}),[j,_,b]=(0,ne.CQ)(null),[A,y]=(0,l.useState)(!1),[w,S,C]=(0,ne.CQ)({is_edit:!1,show_preview:!1}),{show_preview:M}=w,[k,z,T]=(0,ne.CQ)({color:"#ffffff",data:null,file_type:null,text:"",user:h.id}),{file_type:I}=k,E=(0,l.useRef)(null),R=(0,l.useRef)(null),D=e=>z(s=>(0,F.A)((0,F.A)({},s),e)),B=e=>S(s=>null!=s.data?(0,F.A)((0,F.A)({},s),{},{data:(0,F.A)({},s.data)},e):(0,F.A)((0,F.A)({},s),e));(0,l.useImperativeHandle)(s,()=>({edit:P,hide:H,show:L}));const P=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((s,a)=>
2{if(null==e)return a(c.formatMessage({id:"label.share_card_data_not_supplied.6f422215",defaultMessage:"Share Card data not supplied"}));f({reject:a,resolve:s}),z(e,()=>{y(!0)})})},L=()=>new Promise((e,s)=>{f({reject:s,resolve:e}),y(!0)}),O=()=>{B({show_preview:!1}),D({color:"#ffffff",file_type:"text",location:null})},H=()=>{O(),T(),y(!1),v.resolve(null),f({reject:Function(),resolve:Function()})},U=()=>{switch(I){case"video":case"file":case"image":case"link":return!0;default:return!1}};(0,l.useEffect)(()=>{B({show_preview:U()})},[I]);const[Q,V]=(0,ne.CQ)(()=>"idea"==d?{textArea:"Description"}:{textArea:"Response"});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{backdrop:"static",dialogClassName:"sharecard-creator-modal",onHide:H,show:A,size:"md",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{as:"h3",children:i})}),(0,N.jsxs)(xe.Body,{className:"share-modal-body "+("idea"===d?"neg-m":""),children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:b,show:j,variant:"danger",children:j}),(null===o||void 0===o?void 0:o.length)>0&&(0,N.jsxs)("div",{className:"guiding-question",children:[(0,N.jsx)("div",{className:"q-number",children:r+1}),(0,N.jsx)("p",{className:"title mb-0",children:o})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h6",{className:"mb-1 mt-4",children:Q.textArea}),(0,N.jsx)("textarea",{className:"form-control mb-2 card-text-area",defaultValue:null===k||void 0===k?void 0:k.text,onChange:e=>D({text:e.currentTarget.value}),placeholder:"Write at least 5 words...",rows:4}),(0,N.jsx)(Gf,{length:m(null!==(a=null===k||void 0===k?void 0:k.text)&&void 0!==a?a:""),max:25,min:5})]}),(0,N.jsx)(U_,{activeColor:k.color,bold:t,onChange:e=>D({color:e.currentTarget.value})}),M?(0,N.jsxs)("div",{className:"mt-4",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Attachment:",id:"label.attachment.c570d892"})}),(()=>{if(U){var e;if("image"==I)return(0,N.jsxs)("div",{className:"image-preview p-3",children:[(0,N.jsx)("div",{className:"img-container",children:(0,N.jsx)("div",{className:"preview",style:{background:`url(${null===k||void 0===k||null===(e=k.data)||void 0===e?void 0:e.link})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}})}),(0,N.jsx)(qg,{file_name:k.data.file_name,file_type:k.file_type,handleRemove:O,link:k.data.link})]});if("link"==I)return(0,N.jsx)(V_,{handleRemoveAttachment:O,shareCard:k});if("file"==I)return(0,N.jsx)(qg,{file_name:k.data.file_name,file_type:k.file_type,handleRemove:O,link:k.data.link});if("video"==I)return(0,N.jsxs)("div",{className:"video-preview p-3",children:[(0,N.jsx)($g,{classWrapper:"video-container",data:k,src:k.data.link,style:{height:"100%"}}),(0,N.jsx)(qg,{data:k,file_name:k.data.file_name,file_type:k.file_type,handleRemove:O,link:k.data.link})]})}})()]}):(0,N.jsx)("div",{className:"mt-5 d-flex",children:(0,N.jsxs)(ve.A,{block:!0,className:"d-flex align-items-center justify-content-center w-100",onClick:async()=>{var e;let s="idea"===d?R:E;const a=null===s||void 0===s?void 0:s.current;if(!a)return;const t=await a.show();if(!t)return;let i=t.type,l={meta:{}};var n,r,o,c,h,u,m,v;if("link"===(null===t||void 0===t||null===(e=t.file)||void 0===e?void 0:e.type)||"link"===(null===t||void 0===t?void 0:t.type)){if(i="link",l.link=(null===t||void 0===t||null===(n=t.file)||void 0===n?void 0:n.link)||(null===t||void 0===t?void 0:t.link),l.file_name=(null===t||void 0===t||null===(r=t.file)||void 0===r?void 0:r.file_name)||(null===t||void 0===t||null===(o=t.file)||void 0===o?void 0:o.title)||(null===t||void 0===t?void 0:t.file_name)||(null===t||void 0===t?void 0:t.title),l.meta={domain:(null===t||void 0===t||null===(c=t.file)||void 0===c?void 0:c.domain)||(null===t||void 0===t?void 0:t.domain),image:(null===t||void 0===t||null===(h=t.file)||void 0===h?void 0:h.image)||(null===t||void 0===t?void 0:t.image),title:(null===t||void 0===t||null===(u=t.file)||void 0===u?void 0:u.title)||(null===t||void 0===t?void 0:t.title)},""!=(null!==(m=null===t||void 0===t||null===(v=t.file)||void 0===v?void 0:v.extension)&&void 0!==m?m:"")){const e=p.map(e=>e.substring(e.lastIndexOf("/")+1)),s=x.map(e=>e.substring(e.lastIndexOf("/")+1)),a=g.map(e=>e.substring(e.lastIndexOf("/")+1));e.includes(t.file.extension)?l.meta.resource_type="image":s.includes(t.file.extension)?l.meta.resource_type="video":a.includes(t.file.extension)?l.meta.resource_type="file":l.meta.resource_type=null}}else l.link=t.file.link,l.file_name=t.file.file_name||t.file.title;D({data:l,file_type:i})},style:{height:44,padding:"8px 12px"},variant:"secondary",children:[(0,N.jsx)(ze.EHs,{}),(0,N.jsx)("span",{className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Add an attachment",id:"label.add_an_attachment.0dd7c19d"})})]})}),(0,N.jsx)("div",{className:"mt-3 d-flex",children:(0,N.jsx)(ve.A,{block:!0,className:"w-100",disabled:!(()=>{var e,s;const{file_type:a,text:t=""}=k,i=(l=m(t))>=5&&l<=25;var l;switch(a){case"image":case"video":case"file":case"link":return i&&null!==(e=null===k||void 0===k||null===(s=k.data)||void 0===s?void 0:s.link)&&void 0!==e&&e;default:return i}})(),onClick:()=>{y(!1),v.resolve(k),C(),T()},style:{height:44,padding:"12px 24px"},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})]}),(0,N.jsx)(E_,{ref:E}),(0,N.jsx)(F_,{ref:R})]})});Q_.displayName="ShareCardCreatorModal";const V_=e=>{let{handleRemoveAttachment:s=null,handleReplaceAttachment:a=null,
2shareCard:t}=e;const{data:i}=t,{link:l,meta:r}=i,{styles:o}=(0,n.nm)(),d=o.white,c=o["gray-700"],h=o["gray-900"],u=o.primary,{image:m,resource_type:g,title:p}=r||{};return"image"==g||m?(0,N.jsxs)("div",{className:"link-preview has-image d-flex flex-column",style:{backgroundImage:`linear-gradient(180deg, rgba(0, 0, 0, .16) 0%, rgba(0, 0, 0, 0.5) 100%), url(${m})`,backgroundSize:"cover"},children:[(0,N.jsx)("div",{className:"flex-fill",children:(0,N.jsxs)("a",{className:"meta-content",href:i.link,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)("h6",{className:"mb-0 title",children:p}),(0,N.jsx)("div",{className:"badge",children:l})]})}),s&&(0,N.jsx)("div",{className:"remove-preview d-flex justify-content-end",children:(0,N.jsx)(ve.A,{onClick:s,variant:"light",children:(0,N.jsx)(ze.RCe,{color:d})})}),a&&(0,N.jsx)("div",{className:"remove-preview d-flex justify-content-end",children:(0,N.jsx)(ve.A,{onClick:a,variant:"light",children:(0,N.jsx)("div",{className:"remove-icon",children:(0,N.jsx)(ze.Mbp,{color:d})})})})]}):"video"==g?(0,N.jsxs)("div",{className:"video-preview p-3",children:[(0,N.jsx)($g,{classWrapper:"video-container",data:t,src:l,style:{height:"100%"}}),(0,N.jsx)(qg,{data:t,file_name:t.data.file_name,file_type:t.file_type,handleRemove:s,link:l})]}):(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)("div",{className:"link-preview d-flex flex-column",children:[(0,N.jsx)("div",{className:"link-prev-left flex-fill",children:(0,N.jsxs)("a",{className:"meta-content",href:i.link,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)("h6",{className:"mb-0 title",style:{color:h},children:p||""}),(0,N.jsx)("div",{className:"badge mt-1",style:{color:u},children:l})]})}),(0,N.jsxs)("div",{className:"link-prev-btns",children:[s&&(0,N.jsx)("div",{className:"remove-preview d-flex justify-content-end",children:(0,N.jsx)(ve.A,{className:"meta-trash",onClick:s,variant:"light",children:(0,N.jsx)("div",{className:"remove-icon",children:(0,N.jsx)(ze.RCe,{color:c})})})}),a&&(0,N.jsx)("div",{className:"remove-preview d-flex justify-content-end",children:(0,N.jsx)(ve.A,{className:"meta-trash",onClick:a,variant:"light",children:(0,N.jsx)("div",{className:"remove-icon",children:(0,N.jsx)(ze.Mbp,{color:c})})})})]})]})})};var G_=t(520),W_=t(42661);const K_=e=>{let{classWrapper:s="",laneIndex:a=null,question:t=null,shareCards:i=[]}=e;const{add_btn_label:n,creator_modal_title:r,onAdd:o}=cj(),d=(0,l.useRef)(null),c=()=>d.current.show().then(e=>{e&&o(a,e)});return null==a||null==t?null:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:`${s} sharecard-carousel`,children:(0,N.jsxs)(W_.A,{interval:15e3,children:[null===i||void 0===i?void 0:i.map((e,s)=>(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)("div",{className:"d-flex flex-nowrap justify-content-center",children:(0,N.jsx)(vj,{color:null===e||void 0===e?void 0:e.color,field_id:"share_lanes",itemIndex:s,question:t,share:e},s)})},s)),(0,N.jsx)(W_.A.Item,{children:(0,N.jsxs)("div",{className:"add-wyk-card",onClick:c,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||c()},role:"button",tabIndex:0,children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add what you know",description:"",id:"label.add_what_you_know.dcd7e21a"})})]})})]})}),(0,N.jsx)(Q_,{label:n,modal_title:r,q_index:a,question_title:t,ref:d})]})},Y_=e=>{const s=(0,ja.A)(),{bold:a=!1,cards:t=[],classWrapper:i,field_id:l=null,laneIndex:n=null,onEdit:r=Function(),onRemove:o=Function(),readonly:d=!1,revision_modal_title:c=s.formatMessage({id:"label.revision_modal_title_missing.901f179d",defaultMessage:"Revision modal title missing."})}=e;return(0,N.jsx)("div",{className:`${i} sharecard-carousel`,children:(0,N.jsx)(W_.A,{interval:15e3,children:t.map((e,s)=>(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)("div",{className:"d-flex flex-nowrap justify-content-center",children:(0,N.jsx)(Mj,{bold:a,color:null===e||void 0===e?void 0:e.color,field_id:l,itemIndex:s,laneIndex:n,onEdit:r,onRemove:o,readonly:d,revision_modal_title:c,share:e},s)})},s))})})},q_=e=>{var s,a;const t=(0,ja.A)(),i=cj(),n=(0,l.useRef)(null),{add_btn_label:r,creator_modal_title:o,items:d,onAdd:c}=i||{},{containerId:h,disabled:u,index:m,question:g}=e||{},p=(null===d||void 0===d||null===(s=d[h])||void 0===s?void 0:s.length)||0,x=p>=1,v=()=>null===n||void 0===n?void 0:n.current.show().then(e=>{e&&c(m,e)});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"share-grid-outer-container d-flex align-items-start",tabIndex:-1,
2children:[m>0&&(0,N.jsx)("hr",{style:{marginBottom:36}}),(0,N.jsx)("div",{className:"question-container",children:(0,N.jsx)("div",{className:"q-wrapper",children:m+1})}),(0,N.jsxs)("div",{className:"mt-2",style:{flex:1},children:[(0,N.jsx)("h6",{className:"m-0",children:g}),(0,N.jsxs)(We.A,{className:"share-grid-requirement d-flex align-items-center gap-2 mt-2 mb-0 py-2",variant:x?"success":"warning",children:[x?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:x?t.formatMessage({id:"label.count_cards_added_requirement_met.8027e7a9",defaultMessage:"{count} card(s) added \u2014 requirement met."},{count:p}):t.formatMessage({id:"label.add_at_least_min_card_to_this_ques.fe07d9e9",defaultMessage:"Add at least {min} card to this question ({count} of {min} added)."},{count:p,min:1})})]}),(0,N.jsx)(ve.A,{className:"sharebox-button mt-3",disabled:u,onClick:v,variant:"primary",children:(0,N.jsxs)(G_.Vx.Provider,{value:{className:"icon"},children:[(0,N.jsx)(ze.OiG,{}),r]})}),(0,N.jsxs)("div",{className:"grid-overflow mt-4",children:[(0,N.jsx)(K_,{laneIndex:m,question:g,shareCards:null===d||void 0===d?void 0:d[h]}),(0,N.jsxs)("div",{className:"share-grid-layout",children:[null===d||void 0===d||null===(a=d[h])||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)("div",{tabIndex:-1,children:(0,N.jsx)(vj,{color:null===e||void 0===e?void 0:e.color,disabled:u,field_id:"share_lanes",itemIndex:s,question:g,share:e},s)},s)),(0,N.jsx)(ve.A,{className:"add-wyk-card rounded text-decoration-none",disabled:u,onClick:!u&&v,style:{pointerEvents:u&&"none"},variant:"link",children:(0,N.jsxs)("strong",{children:[(0,N.jsx)(ze.OiG,{className:"me-1"})," ",r]})})]})]})]})]}),(0,N.jsx)(Q_,{label:r,modal_title:o,q_index:m,question_title:g,ref:n})]})};var J_=e=>{const s=(0,ja.A)(),{add_btn_label:a=null,creator_modal_title:t=s.formatMessage({id:"label.creator_modal_title_missing.74fce9fd",defaultMessage:"Creator modal title missing"}),data:i,disabled:n=!1,onAdd:r=null,onEdit:o=null,onRemove:d=null,revision_modal_title:c}=e,[h,u]=(0,l.useState)(()=>{if(null!==e&&void 0!==e&&e.data&&Array.isArray(e.data)){let s={};for(let a=0;a<e.data.length;a++)s[`container${a}`]=e.data[a];return s}return{}}),[m,g]=(0,l.useState)(Object.keys(h));(0,l.useEffect)(()=>{if(null!==e&&void 0!==e&&e.data&&Array.isArray(e.data)){let s=(null===e||void 0===e?void 0:e.lanes)||[],a=s.length>0?s.length:3,t=[...i];for(;t.length<a;)t.push([]);let l={};for(let e=0;e<t.length;e++)l[`container${e}`]=t[e];u(l),g(Object.keys(l))}},[e.data]);let p=(null===e||void 0===e?void 0:e.lanes)||[];return Array.isArray(p)||(p=Object.entries(p)),(0,N.jsx)(dj,{value:{add_btn_label:a,creator_modal_title:t,items:h,onAdd:r,onEdit:o,onRemove:d,revision_modal_title:c},children:(0,N.jsx)("div",{className:"share-gridmap-container",children:m.map((e,s)=>(0,N.jsx)(q_,{containerId:e,disabled:n,index:s,question:[p[s]],shares:i[s]},s))})})};class X_ extends l.Component{constructor(s){super(s),this.handleAddShare=(e,s)=>{if(!s)return;const{challenge:a}=this.props,{changePhaseData:t,getPhaseData:i}=a;s.updated_at=(new Date).getTime();const l=i(this.phase,this.subphase);l.share_lanes=Array.isArray(l.share_lanes)?l.share_lanes:[],l.share_lanes[e]=Array.isArray(l.share_lanes[e])?l.share_lanes[e]:[],null!==s&&void 0!==s&&s.id||(s.id=(0,me.A)()),l.share_lanes[e].push(s),t(this.phase,this.subphase,l),this.handler.revisions.addChallengeDataHistory({action:"add_share_card",action_data:{},data:{share:s},field_id:"share_lanes",sub_field_id:null===s||void 0===s?void 0:s.id})},this.getShareCardIndexes=e=>{const{challenge:s}=this.props,{getPhaseData:a}=s,t=a(this.phase,this.subphase),i=(null===t||void 0===t?void 0:t.share_lanes)||[];for(let l=0;l<i.length;l++){const s=i[l]||[];for(let a=0;a<s.length;a++){const t=s[a];if(t&&(null===t||void 0===t?void 0:t.id)==e)return[a,l]}}return[]},this.getQuestion=e=>{var s;const{challenge:a}=this.props,{project:t}=a;return((null===t||void 0===t||null===(s=t.challenge_template)||void 0===s?void 0:s.guiding_questions)||[])[e]},this.handleEditShare=async s=>{const{challenge:a}=this.props,{changePhaseData:t,getPhaseData:i}=a,l=null===s||void 0===s?void 0:s.id;try{var n;const[e,a]=this.getShareCardIndexes(l),r=this.getQuestion(a);this.setState({edit_question:r,edit_question_idx:a,edit_share:s});const o=await(null===(n=this.sharecard_creator)||void 0===n?void 0:n.current.edit(s));if(!o)return;const[d,c]=this.getShareCardIndexes(l),h=i(this.phase,this.subphase),u=(null===h||void 0===h?void 0:h.share_lanes)||{},m=(0,T.clone)(u[c][d]);h.share_lanes&&h.share_lanes[c]&&(h.share_lanes[c][d]=o),t(this.phase,this.subphase,h);const g=this.getChanges(o,m);if(!g)return;const p=u[c][d];this.handler.revisions.addChallengeDataHistory({action:"modify_share_card",action_data:{after:p,before:m,changes:g,lane:c},data:{share:p},field_id:"share_lanes",sub_field_id:null===p||void 0===p?void 0:p.id})}catch(e){}},this.getChanges=(e,s)=>{const a={document:!1,"file type":!1,image:!1,link:!1,text:!1,video:!1};var t,i,l,n,r,o,d,c;(a["file type"]=!(0,T.isEqual)(null===s||void 0===s?void 0:s.file_type,null===e||void 0===e?void 0:e.file_type),a.text=!(0,T.isEqual)(null===s||void 0===s?void 0:s.text.trim(),null===e||void 0===e?void 0:e.text.trim()),a.file_type)||(a.image=!(0,T.isEqual)(null===s||void 0===s||null===(t=s.data)||void 0===t?void 0:t.link,null===e||void 0===e||null===(i=e.data)||void 0===i?void 0:i.link),a.video=!(0,T.isEqual)(null===s||void 0===s||null===(l=s.data)||void 0===l?void 0:l.link,null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.link),a.document=!(0,T.isEqual)(null===s||void 0===s||null===(r=s.data)||void 0===r?void 0:r.link,null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.link),a.link=!(0,T.isEqual)(null===s||void 0===s||null===(d=s.data)||void 0===d?void 0:d.link,null===e||void 0===e||null===(c=e.data)||void 0===c?void 0:c.link));let h=!1;if(Object.values(a).every(e=>(h=e,!e)),!h)return;let u=[];
2return Object.keys(a).forEach(e=>{a[e]&&(u=[...u,e])}),u},this.confirmRemoval=e=>{var s;const a=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:{formatMessage:t}}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:"Remove",onClick:()=>this.handleRemoveShare(e),variant:"danger"})],body:t({id:"label.are_you_sure_you_want_to_remove_th.c8af760d",defaultMessage:"Are you sure you want to remove this card?"}),size:"sm",title:t({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},this.handleRemoveShare=async e=>{const{challenge:s}=this.props,{changePhaseData:a,getPhaseData:t}=s,i=t(this.phase,this.subphase),[l,n]=this.getShareCardIndexes(null===e||void 0===e?void 0:e.id),r=(null===i||void 0===i?void 0:i.share_lanes)&&(null===i||void 0===i?void 0:i.share_lanes[n])&&(null===i||void 0===i?void 0:i.share_lanes[n][l]);r&&(null!==i&&void 0!==i&&i.share_lanes&&i.share_lanes[n]&&i.share_lanes[n].splice(l,1),a(this.phase,this.subphase,i),this.handler.revisions.addChallengeDataHistory({action:"remove",action_data:{lane:n},data:{share:r},field_id:"share_lanes",sub_field_id:null===r||void 0===r?void 0:r.id}))},this.handleHistoryRevert=(e,s,a)=>{const{app:t,challenge:i}=this.props,{canChangePhaseData:l,changePhaseData:n,getPhaseData:r,project:o}=i;if(!l())return;const{id:d,action:c,action_data:h,created_at:u,data:m}=a,g=r(this.phase,this.subphase);if(c){if("share_lanes"===e){if(["add_share_card","modify_share_card"].includes(c)&&((null===g||void 0===g?void 0:g.share_lanes)&&g.share_lanes.forEach((e,a)=>{const t=e.find(e=>(null===e||void 0===e?void 0:e.id)===s);t&&(g.share_lanes[a][e.indexOf(t)]=null===m||void 0===m?void 0:m.share)}),n(this.phase,this.subphase,g)),"remove"===c){const{api:a}=t,{lane:i}=h||{},{share:l}=m||{};g.share_lanes[i].push(l),n(this.phase,this.subphase,g),a.post(`/api/challenges/phase/history/delete/${d}`,{action:c,action_data:h,challenge_id:o.id,data:m,field_id:e,sub_field_id:s}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:d,restored_from:u},data:m,field_id:e,sub_field_id:s}),this.handler.revisions.hideChallengeDataHistory()}if("need_to_knows"===e){var p;if("modify_field_text"===c)g.need_to_knows[s].value=(null===m||void 0===m||null===(p=m.need_to_know)||void 0===p?void 0:p.value)||"",n(this.phase,this.subphase,g);if("remove"===c){const{app:a}=this.props,t=a.api;m.need_to_know&&(g.need_to_knows[s]=m.need_to_know),n(this.phase,this.subphase,g),t.post(`/api/challenges/phase/history/delete/${d}`,{action:c,action_data:h,challenge_id:o.id,data:m,field_id:e,sub_field_id:s}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:d,restored_action:c,restored_from:u},data:m,field_id:"need_to_knows",sub_field_id:s})}this.handler.revisions.hideChallengeDataHistory()}},this.phase=1,this.subphase=4,this.handler=null,this.state={edit_question:null,edit_question_idx:null,edit_share:null,error:null},this.sharecard_creator=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)()}render(){var e;const{challenge:s}=this.props,{canChangePhaseData:a,getPhaseData:t,project:i}=s,l=null===i||void 0===i||null===(e=i.challenge_template)||void 0===e?void 0:e.guiding_questions,n=!a(),r=t(this.phase,this.subphase),o=r&&r.share_lanes||new Array(null!==l&&void 0!==l&&l.length?l.length:3).fill([]);return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-1-4",children:(0,N.jsxs)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:[(0,N.jsxs)(Tf,{card_body_class:"pb-0",revision_history_button:(0,N.jsx)(rj,{field_id:"share_lanes"}),show_example:!0,children:[(0,N.jsx)("h6",{className:"qc-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Guiding questions",id:"label.guiding_questions.53a932b3"})}),(0,N.jsx)(J_,{data:o,disabled:n,lanes:l,onAdd:this.handleAddShare,onEdit:this.handleEditShare,onRemove:this.confirmRemoval,add_btn_label:(0,N.jsx)(ke.A,{defaultMessage:"Add what you know",id:"label.add_what_you_know.dcd7e21a"}),creator_modal_title:(0,N.jsx)(ke.A,{defaultMessage:"Add what you know",id:"label.add_what_you_know.dcd7e21a"}),revision_modal_title:(0,N.jsx)(ke.A,{defaultMessage:"Research card history",id:"label.research_card_history.9b4c376a"})})]}),(0,N.jsx)(je,{ref:this.confirmation_dialog}),(0,N.jsx)(Q_,{q_index:this.state.edit_question_idx,question_title:this.state.edit_question,ref:this.sharecard_creator,label:(0,N.jsx)(ke.A,{defaultMessage:"Edit what you know",id:"label.edit_what_you_know.71b54dff"}),modal_title:(0,N.jsx)(ke.A,{defaultMessage:"Edit what you know",id:"label.edit_what_you_know.71b54dff"})})]})})}}var Z_=(0,Ke.Ay)((0,P.G0)(Fa(X_)));var $_=(0,l.forwardRef)((e,s)=>{const{question:a="Research question missing.",questionNumber:t=0}=e,[i,n,r]=(0,ne.CQ)({reject:Function(),resolve:Function(),show:!1}),o=()=>{i.resolve(null),r()},d=e=>{null!=e&&(i.resolve(e),r())};return(0,l.useImperativeHandle)(s,()=>({hide:()=>o(),open:()=>new Promise((e,s)=>{n(a=>(0,F.A)((0,F.A)({},a),{},{reject:s,resolve:e,show:!0}))})})),(0,N.jsxs)(xe,{dialogClassName:"add-research-selection-modal",divider:!1,onHide:o,show:i.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("h3",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Add research",id:"label.add_research.82a82943"})})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)("div",{className:"question-container",children:[(0,N.jsx)("div",{className:"q-number",children:t}),(0,N.jsx)("div",{className:"m-0",children:a})]}),(0,N.jsxs)("div",{className:"option-container",children:[(0,N.jsx)("div",{className:"third",children:(0,N.jsxs)(ve.A,{onClick:()=>d("print"),variant:"light",children:[(0,N.jsx)("div",{className:"icon-option",children:(0,N.jsx)(ze.Nhm,{size:24})}),(0,N.jsx)("div",{children:(0,N.jsx)("h5",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Print",description:"",id:"label.print.df0fe798"})})}),(0,N.jsx)("div",{className:"description",children:(0,N.jsx)(ke.A,{defaultMessage:"Books, journal articles, magazine articles, papers, traditional encyclopedias, and reports",description:"",id:"label.books_journal_articles_magazine_ar.80f4aedd"})})]})}),(0,N.jsx)("div",{className:"third",children:(0,N.jsxs)(ve.A,{onClick:()=>d("online"),variant:"light",children:[(0,N.jsx)("div",{className:"icon-option",children:(0,N.jsx)(ze.f35,{size:24})}),(0,N.jsx)("div",{children:(0,N.jsx)("h5",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Online",description:"",id:"label.online.0d21bd52"})})}),(0,N.jsx)("div",{className:"description",children:(0,N.jsx)(ke.A,{defaultMessage:"Statistics/data, blogs, websites, online magazines or newspapers, forums, wikis, and online journals or books",description:"",id:"label.statisticsdata_blogs_websites_onli.e560e166"})})]})}),(0,N.jsx)("div",{className:"third",children:(0,N.jsxs)(ve.A,{onClick:()=>d("multimedia"),variant:"light",children:[(0,N.jsx)("div",{className:"icon-option",children:(0,N.jsx)(ze.T
20M,{size:24})}),(0,N.jsx)("div",{children:(0,N.jsx)("h5",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Multimedia",description:"",id:"label.multimedia.33f67dcf"})})}),(0,N.jsx)("div",{className:"description",children:(0,N.jsx)(ke.A,{defaultMessage:"Documentaries, interviews, presentations, podcasts, photo essays, video of live events, and other media",description:"",id:"label.documentaries_interviews_presentat.f464b4e7"})})]})})]})]})]})});const eb=(0,l.forwardRef)((e,s)=>{var a;const{formatMessage:t}=(0,ja.A)(),{user:i}=(0,P.nm)(),{countWords:n,file_types:r,image_types:o,video_types:d}=(0,P.hc)(),c=(0,l.useRef)(null),h=(0,l.useRef)(null),u=(0,l.useRef)(null),[m,g,p]=(0,ne.CQ)({editing:!1,error:null,item_idx:null,question:null,question_idx:null,reject:Function(),research_type:null,resolve:Function(),show_preview:!1,visible:!1}),{editing:x,question:v,question_idx:f,resolve:j,visible:_}=m,[b,A,y]=(0,ne.CQ)({color:"#ffffff",data:null,file_type:null,text:"",user:i.id}),w=e=>{let{data:s,question:a,question_idx:t,research_type:i}=e;return new Promise((e,l)=>{A({data:s}),g({question:a,question_idx:t,reject:l,research_type:i,resolve:e,visible:!0})})},S=()=>{y(),p()},C=()=>{j(),S()},M=e=>{let{data:s,question:a,question_idx:t}=e;return new Promise((e,i)=>{A(s),g({editing:!0,question:a,question_idx:t,reject:i,resolve:e,visible:!0})})},k=async()=>{try{const e=null===c||void 0===c?void 0:c.current;if(!e)return;const s=await e.open(),a=e=>{if(null!=e){var s;let m={meta:{}};var a,t,i,l,n;if("link"===(null===e||void 0===e||null===(s=e.file)||void 0===s?void 0:s.type)){if(m.link=null===e||void 0===e||null===(a=e.file)||void 0===a?void 0:a.link,m.file_name=null,m.file_type="link",""!=(null===e||void 0===e||null===(t=e.file)||void 0===t?void 0:t.extension)){var c,h,u;const s=o.map(e=>e.substring(e.lastIndexOf("/")+1)),a=d.map(e=>e.substring(e.lastIndexOf("/")+1)),t=r.map(e=>e.substring(e.lastIndexOf("/")+1));s.includes(null===e||void 0===e||null===(c=e.file)||void 0===c?void 0:c.extension)?m.meta.resource_type="image":a.includes(null===e||void 0===e||null===(h=e.file)||void 0===h?void 0:h.extension)?m.meta.resource_type="video":t.includes(null===e||void 0===e||null===(u=e.file)||void 0===u?void 0:u.extension)?m.meta.resource_type="file":m.meta.resource_type=null}}else m={file_name:null===e||void 0===e||null===(i=e.file)||void 0===i?void 0:i.file_name,file_type:null===e||void 0===e||null===(l=e.file)||void 0===l?void 0:l.type,link:null===e||void 0===e||null===(n=e.file)||void 0===n?void 0:n.link};A({data:m})}};if("online"!==s){a(await h.current.show(s))}else{const e=await u.current.show();if(null!=e){const s={file_name:(null===e||void 0===e?void 0:e.file_name)||(null===e||void 0===e?void 0:e.title),file_type:"link",link:e.link,meta:{domain:(null===e||void 0===e?void 0:e.domain)||null,image:(null===e||void 0===e?void 0:e.image)||null,title:(null===e||void 0===e?void 0:e.title)||null}};A({data:s})}}}catch(e){(0,xa.Err)(e)}};return(0,l.useImperativeHandle)(s,()=>({edit:M,hide:S,show:w,visible:_})),(0,N.jsxs)(xe,{dialogClassName:"add-research-modal",onHide:C,show:_,Viewider:!1,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:x?(0,N.jsx)(ke.A,{defaultMessage:"Edit research",id:"label.edit_research.28b51bea"}):(0,N.jsx)(ke.A,{defaultMessage:"Add research",id:"label.add_research.82a82943"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(Ce.S,{className:"question-container",children:[(0,N.jsx)(Ce.S,{className:"q-number d-flex align-items-center justify-content-center",children:f+1}),(0,N.jsx)(Ce.S,{className:"m-0",children:v})]}),(0,N.jsxs)(Ce.S,{className:"research-container",children:[(0,N.jsxs)(Ce.S,{className:"research-preview",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Online research",id:"label.online_research.7432e9cb"})}),null!=(null===b||void 0===b?void 0:b.data)&&(()=>{var e,s,a,t,i,l,n,r;if(!(["print","online","multimedia"].includes(m.research_type)||m.editing))return null;var o;switch(null===b||void 0===b||null===(o=b.data)||void 0===o?void 0:o.file_type){case"link":return(0,N.jsx)(V_,{handleReplaceAttachment:k,shareCard:b});case"file":return(0,N.jsx)(qg,{file_name:null===b||void 0===b||null===(e=b.data)||void 0===e?void 0:e.file_name,file_type:null===b||void 0===b?void 0:b.file_type,handleReplace:k,link:null===b||void 0===b||null===(s=b.data)||void 0===s?void 0:s.link});case"image":return(0,N.jsx)(Ce.S,{className:"image-preview",children:(0,N.jsxs)(Ce.S,{className:"img-container",children:[(0,N.jsx)(Ce.S,{className:"preview",style:{background:`url(${null===b||void 0===b||null===(a=b.data)||void 0===a?void 0:a.link})`,backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}),(0,N.jsx)(qg,{file_name:null===b||void 0===b||null===(t=b.data)||void 0===t?void 0:t.file_name,file_type:null===b||void 0===b||null===(i=b.data)||void 0===i?void 0:i.file_type,handleReplace:k,link:null===b||void 0===b||null===(l=b.data)||void 0===l?void 0:l.link})]})});case"video":return(0,N.jsxs)(Ce.S,{className:"video-preview",children:[(0,N.jsx)($g,{classWrapper:"video-container",data:b,src:null===b||void 0===b?void 0:b.data.link,style:{height:"100%"}}),(0,N.jsx)(qg,{data:b,file_name:null===b||void 0===b||null===(n=b.data)||void 0===n?void 0:n.file_name,file_type:null===b||void 0===b?void 0:b.file_type,handleReplace:k,link:null===b||void 0===b||null===(r=b.data)||void 0===r?void 0:r.link})]});default:return null}})()]}),(0,N.jsxs)(Ce.S,{className:"research-response",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Response",id:"label.response.9061383b"})}),(0,N.jsx)("textarea",{className:"form-control mb-2 card-text-area",defaultValue:null===b||void 0===b?void 0:b.text,onChange:e=>{var s;const a=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value;A({text:a})},rows:4,placeholder:t({id:"label.write_at_least_5_words.86cbe260",defaultMessage:"Write at least 5 words..."})}),(0,N.jsx)(Gf,{length:n(null!==(a=null===b||void 0===b?void 0:b.text)&&void 0!==a?a:""),max:25,min:5})]}),(0,N.jsx)(Ce.S,{className:"research-colors",children:(0,N.jsx)(U_,{bold:!0,activeColor:b.color,onChange:e=>{var s;const a=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value;A({color:a})}})}),(0,N.jsx)(Ce.S,{className:"submit-option",children:(0,N.jsx)(ve.A,{disabled:!(()=>{var e;return n(null===b||void 0===b?void 0:b.text)>=5&&n(null===b||void 0===b?void 0:b.text)<=25&&!(null===b||void 0===b||null===(e=b.data)||void 0===e||!e.link)})(),onClick:()=>{var e;j((0,F.A)((0,F.A)({},b),{},{file_type:null===b||void 0===b||null===(e=b.data)||void 0===e?void 0:e.file_type})),C()},children:x?(0,N.jsx)(ke.A,{defaultMessage:"Update",id:"label.update.c1c1009d"}):(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})]}),(0,N.jsx)($_,{question:v,questionNumber:f,ref:c}),(0,N.jsx)(kA,{aspectRatio:328/170,ref:h}),(0,N.jsx)(T_,{ref:u})]})});
2eb.displayName="AddResearchModal";class sb extends l.Component{constructor(s){super(s),this.handleAddShare=(e,s,a)=>{if(!a)return;const{challenge:t}=this.props,{changePhaseData:i,getPhaseData:l}=t;a.updated_at=Date.now();const n=l(this.phase,this.subphase);n.share_lanes=n.share_lanes||[],n.share_lanes[e]=n.share_lanes[e]||[],a.id=a.id||(0,me.A)(),n.share_lanes[e].push(a),i(this.phase,this.subphase,n),this.handler.revisions.addChallengeDataHistory({action:"add_share_card",action_data:{},data:{share:a},field_id:"share_lanes",sub_field_id:a.id})},this.getShareCardIndexes=e=>{const{challenge:s}=this.props,{getPhaseData:a}=s,t=a(this.phase,this.subphase),i=(null===t||void 0===t?void 0:t.share_lanes)||[];for(let l=0;l<i.length;l++){const s=i[l]||[];for(let a=0;a<s.length;a++){const t=s[a];if((null===t||void 0===t?void 0:t.id)===e)return[a,l]}}return[]},this.getQuestion=e=>{var s,a,t,i;const{challenge:l}=this.props,{getPhaseData:n}=l||{},{need_to_knows:r}=n(2,1),o=(null===(s=Object.entries(r))||void 0===s||null===(a=s.sort)||void 0===a?void 0:a.call(s,(e,s)=>(null===e||void 0===e?void 0:e[1].research_lane)-(null===s||void 0===s?void 0:s[1].research_lane)))||[];return(null===o||void 0===o||null===(t=o[e])||void 0===t||null===(i=t[1])||void 0===i?void 0:i.value)||"Unknown question"},this.handleEditShare=async s=>{try{var a;const{challenge:e}=this.props,{changePhaseData:t,getPhaseData:i}=e||{},l=null===s||void 0===s?void 0:s.id,[n,r]=this.getShareCardIndexes(l),o=this.getQuestion(r);this.setState({edit_question:o,edit_question_idx:r,edit_share:s});const d=null===this||void 0===this||null===(a=this.add_research_modal)||void 0===a?void 0:a.current;if(!d)return;let c=await d.edit({data:s,question:o,question_idx:r});if(!c)return;const[h,u]=this.getShareCardIndexes(l),m=i(this.phase,this.subphase),g=(null===m||void 0===m?void 0:m.share_lanes)||{};let p=(0,T.clone)(g[u][h]);m.share_lanes&&m.share_lanes[u]&&(m.share_lanes[u][h]=c),t(this.phase,this.subphase,m);const x=this.getChanges(c,p);if(!x)return;const v=g[u][h];this.handler.revisions.addChallengeDataHistory({action:"modify_share_card",action_data:{after:v,before:p,changes:x,lane:u},data:{share:v},field_id:"share_lanes",sub_field_id:null===v||void 0===v?void 0:v.id})}catch(e){}},this.getChanges=(e,s)=>{var a,t;const i={document:!1,fileType:!1,image:!1,link:!1,text:!1,video:!1};var l,n,r,o,d,c,h,u;(i.fileType=!(0,T.isEqual)(null===s||void 0===s?void 0:s.file_type,null===e||void 0===e?void 0:e.file_type),i.text=!(0,T.isEqual)(null===s||void 0===s||null===(a=s.text)||void 0===a?void 0:a.trim(),null===e||void 0===e||null===(t=e.text)||void 0===t?void 0:t.trim()),i.fileType)||(i.image=!(0,T.isEqual)(null===s||void 0===s||null===(l=s.data)||void 0===l?void 0:l.link,null===e||void 0===e||null===(n=e.data)||void 0===n?void 0:n.link),i.video=!(0,T.isEqual)(null===s||void 0===s||null===(r=s.data)||void 0===r?void 0:r.link,null===e||void 0===e||null===(o=e.data)||void 0===o?void 0:o.link),i.document=!(0,T.isEqual)(null===s||void 0===s||null===(d=s.data)||void 0===d?void 0:d.link,null===e||void 0===e||null===(c=e.data)||void 0===c?void 0:c.link),i.link=!(0,T.isEqual)(null===s||void 0===s||null===(h=s.data)||void 0===h?void 0:h.link,null===e||void 0===e||null===(u=e.data)||void 0===u?void 0:u.link));if(Object.values(i).some(e=>e))return Object.keys(i).filter(e=>i[e])},this.confirmRemoval=e=>{var s;const a=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:{formatMessage:t}}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:"Remove",onClick:()=>this.handleRemoveShare(e),variant:"danger"})],body:t({id:"label.are_you_sure_you_want_to_remove_th.c8af760d",defaultMessage:"Are you sure you want to remove this card?"}),size:"sm",title:t({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},this.handleRemoveShare=async e=>{var s,a,t;const{challenge:i}=this.props,{changePhaseData:l,getPhaseData:n}=i,{need_to_knows:r}=n(this.phase,this.subphase-1)||{},o=Object.entries(r),d=n(this.phase,this.subphase),[c,h]=this.getShareCardIndexes(null===e||void 0===e?void 0:e.id),[u]=(null===o||void 0===o?void 0:o[h])||[],m=null===d||void 0===d||null===(s=d.share_lanes)||void 0===s||null===(a=s[h])||void 0===a?void 0:a[c];m&&(null!==d&&void 0!==d&&null!==(t=d.share_lanes)&&void 0!==t&&t[h]&&d.share_lanes[h].splice(c,1),l(this.phase,this.subphase,d),this.handler.revisions.addChallengeDataHistory({action:"remove",action_data:{lane:h,need_to_know_id:u},data:{share:m},field_id:"share_lanes",sub_field_id:null===m||void 0===m?void 0:m.id}))},this.handleHistoryRevert=(e,s,a)=>{const{app:t,challenge:i}=this.props,{canChangePhaseData:l,changePhaseData:n,getPhaseData:r,project:o}=i,{id:d,action:c,action_data:h,created_at:u,data:m}=a;if(!l())return;const g=r(this.phase,this.subphase);if(c&&["add_share_card","modify_share_card","remove"].includes(c)){if(["add_share_card","modify_share_card"].includes(c)&&((null===g||void 0===g?void 0:g.share_lanes)&&g.share_lanes.forEac
2h((e,a)=>{const t=e.find(e=>(null===e||void 0===e?void 0:e.id)===s);t&&(g.share_lanes[a][e.indexOf(t)]=null===m||void 0===m?void 0:m.share)}),n(this.phase,this.subphase,g)),"remove"===c){const{api:a}=t,{need_to_knows:i}=r(this.phase,this.subphase-1)||{},{lane:l,need_to_know_id:u}=h||{},{share:p}=m||{},x=null===i||void 0===i?void 0:i[u];if((0,T.isEmpty)(x))g.share_lanes[0].push(p);else{const e=null===x||void 0===x?void 0:x.research_lane;(0,T.isEqual)(e,l)?g.share_lanes[l].push(p):g.share_lanes[e].push(p)}n(this.phase,this.subphase,g),a.post(`/api/challenges/phase/history/delete/${d}`,{action:c,action_data:h,challenge_id:o.id,data:m,field_id:e,sub_field_id:s}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:d,restored_from:u},data:m,field_id:e,sub_field_id:s}),this.handler.revisions.hideChallengeDataHistory()}},this.handleAddResearch=async(e,s,a)=>{var t,i;const{app:l}=this.props,{utils:n}=l,{file_types:r,image_types:o,video_types:d}=n;this.setState({edit_question:a,edit_question_index:e+1});const c=null===this||void 0===this||null===(t=this.research_selection_modal)||void 0===t?void 0:t.current;if(!c)return;let h=await c.open();if(!h)return;let u=null,m={};if("online"!==h){var g;const e=null===this||void 0===this||null===(g=this.dropzone_file_upload_modal)||void 0===g?void 0:g.current;if(!e)return;if(u=await e.show(h),!u)return;if(m.meta={domain:u.file.domain,image:u.file.image,title:u.file.title},"link"===u.file.type){m.link=u.file.link,m.file_name=null,m.file_type="link";const e=e=>e.map(e=>e.split("/").pop()),s=e(o),a=e(d),t=e(r);switch(!0){case s.includes(u.file.extension):m.meta.resource_type="image";break;case a.includes(u.file.extension):m.meta.resource_type="video";break;case t.includes(u.file.extension):m.meta.resource_type="file";break;default:m.meta.resource_type=null}}else m.link=u.file.link,m.file_name=u.file.file_name,m.file_type=u.file.type}else{var p;const e=null===this||void 0===this||null===(p=this.research_link_modal)||void 0===p?void 0:p.current;if(!e)return;u=await e.show(),null!==u&&(m.link=u.link,m.file_name=null,m.file_type="link",m.meta={domain:u.domain,image:u.image,title:u.title})}const x=null===this||void 0===this||null===(i=this.add_research_modal)||void 0===i?void 0:i.current;if(!x)return;let v=await x.show({data:m,question:a,question_idx:e,research_type:h});v&&this.handleAddShare(e,s,v)},this.navigateToPhase2_1=()=>{const{history:e,location:s}=this.props,a=s.pathname.slice(0,-1)+"1";e.push(a)},this.state={data:{},edit_question:"",edit_question_index:0,error:null},this.phase=2,this.subphase=2,this.handler=null,this.add_research_modal=(0,l.createRef)(),this.research_selection_modal=(0,l.createRef)(),this.dropzone_file_upload_modal=(0,l.createRef)(),this.research_link_modal=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)()}render(){const{challenge:e,intl:s}=this.props,{canChangePhaseData:a,getPhaseData:t,project:i}=e||{},{challenge_template:l}=i||{},n=!a(),r=(null===l||void 0===l?void 0:l.guiding_resources)||{},o=t(this.phase,this.subphase)||{},d=t(2,1)||{},c=(null===d||void 0===d?void 0:d.need_to_knows)||{},h=(null===o||void 0===o?void 0:o.share_lanes)||new Array(Object.keys(c).length>3?Object.keys(c).length:3).fill([]),u=Object.entries(c).map(e=>{let[s,{research_lane:a=0,value:t=""}]=e;return{id:s,question:t,research_lane:a}}).sort((e,s)=>e.research_lane-s.research_lane);return(0,N.jsxs)(Ce.S,{clasName:"subphase-content challenge-2-2",children:[(0,N.jsx)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:(0,N.jsx)(Tf,{guiding_resources:r,revision_history_button:(0,N.jsx)(rj,{field_id:"share_lanes"}),show_example:!0,show_guiding_resources:!0,children:null!==u&&void 0!==u&&u.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Need to Know",id:"label.need_to_know.b6e05602"})}),(0,N.jsx)(bj,{data:h,disabled:n,hasAdditional:u.length>1,lanes:u,onAdd:this.handleAddResearch,onEdit:this.handleEditShare,onRemove:this.confirmRemoval,add_btn_label:s.formatMessage({id:"label.add_research.82a82943",defaultMessage:"Add research"}),revision_modal_title:s.formatMessage({id:"label.need_to_know_card.7dbe4e57",defaultMessage:"Need to Know Card"})})]}):(0,N.jsx)(Ce.S,{className:"empty-lane-container",children:[1,2,3].map(e=>(0,N.jsxs)(Ce.S,{className:"empty-lane",children:[(0,N.jsxs)(Ce.S,{className:"lane-header",children:[(0,N.jsx)(Ce.S,{className:"index",children:e}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"No questions added",id:"label.no_questions_added.ea675350"})}),(0,N.jsxs)(Ce.S,{className:"instruction d-flex align-items-baseline gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Add a question in the",id:"label.add_a_question_in_the.37966762"}),(0,N.jsx)(ve.A,{onClick:this.navigateToPhase2_1,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"previous step.",id:"label.previous_step.dd3ee776"})})]})]}),(0,N.jsx)(Ce.S,{className:"stub gray-300"}),(0,N.jsx)(Ce.S,{className:"stub gray-200"}),(0,N.jsx)(Ce.S,{className:"stub"})]},e))})})}),(0,N.jsx)($_,{question:this.state.edit_question,questionNumber:this.state.edit_question_index,ref:this.research_selection_modal}),(0,N.jsx)(eb,{question:this.state.edit_question,questionNumber:this.state.edit_question_index,ref:this.add_research_modal,title:(0,N.jsx)(ke.A,{defaultMessage:"Add research",id:"label.add_research.82a82943"})}),(0,N.jsx)(kA,{aspectRatio:328/170,ref:this.dropzone_file_upload_modal}),(0,N.jsx)(T_,{ref:this.research_link_modal}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}var ab=(0,P.G0)(Fa((0,Ke.Ay)((0,Pe.y)(sb))));class tb extends l.Component{constructor(s){super(s),this.handleAddShare=async()=>{const{challenge:e}=this.props,{changePhaseData:s,getPhaseData:a}=e,t=await this.sharecard_creator.current.show();if(!t)return;const i=a(this.phase,this.subphase);i.share_lanes=Array.isArray(i.share_lanes)?i.share_lanes:[],i.share_lanes[0]=Array.isArray(i.share_lanes[0])?i.share_lanes[0]:[],t.updated_at=(new Date).getTime(),null!==t&&void 0!==t&&t.id||(t.id=(0,me.A)()),i.share_lanes[0].push(t),s(this.phase,this.subphase,i),this.handler.revisions.addChallengeDataHistory({action:"add_share_card",action_data:{},data:{share:t},field_id:"share_lanes",sub_field_id:null===t||void 0===t?void 0:t.id})},this.getChanges=(e,s,a,t,i)=>{var l,n;const r=null===s||void 0===s||null===(l=s[i])||void 0===l||null===(n=l[a])||void 0===n?void 0:n[t],o={color:!1,document:!1,"file type":!1,image:!1,link:!1,text:!1,video:!1};var d,c,h,u,m,g,p,x;(o["file type"]=!(0,T.isEqual)(null===e||void 0===e?void 0:e.file_type,null===r||void 0===r?void 0:r.file_type),o.text=!(0,T.isEqual)(null===e||void 0===e?void 0:e.text.trim(),null===r||void 0===r?void 0:r.text.trim()),o.color=!(0,T.isEqual)(null===e||void 0===e?void 0:e.color,null===r||void 0===r?void 0:r.color),o.file_type)||(o.image=!(0,T.isEqual)(null===e||void 0===e||null===(d=e.data)||void 0===d?void 0:d.link,null===r||void 0===r||null===(c=r.data)||void 0===c?void 0:c.link),o.video=!(0,T.isEqual)(null===e||void 0===e||null===(h=e.data)||void 0===h?void 0:h.link,null===r||void 0===r||null===(u=r.data)||void 0===u?void 0:u.link),o.document=!(0,T.isEqual)(null===e||void 0===e||null===(m=e.data)||void 0===m?void 0:m.link,null===r||void 0===r||null===(g=r.data)||void 0===g?void 0:g.link),o.link=!(0,T.isEqual)(null===e||void 0===e||null===(p=e.data)||void 0===p?void 0:p.link,null===r||void 0===r||null===(x=r.data)||void 0===x?void 0:x.link));let v=!1;if(Object.values(o).every(e=>(v=e,!e)),!v)return;let f=[];
2return Object.keys(o).forEach(e=>{o[e]&&(f=[...f,e])}),f},this.getShareCardIndexes=e=>{const{challenge:s}=this.props,{getPhaseData:a}=s,t=a(this.phase,this.subphase),i=(null===t||void 0===t?void 0:t.share_lanes)||[];for(let l=0;l<i.length;l++){const s=i[l]||[];for(let a=0;a<s.length;a++){const t=s[a];if(t&&(null===t||void 0===t?void 0:t.id)==e)return[a,l]}}return[]},this.handleEditShare=async s=>{const{challenge:a}=this.props,{changePhaseData:t,getPhaseData:i}=a,l=null===s||void 0===s?void 0:s.id;try{var n;const e=await(null===(n=this.sharecard_creator)||void 0===n?void 0:n.current.edit(s));if(!e)return;const[a,r]=this.getShareCardIndexes(l),o=i(this.phase,this.subphase),d=(null===o||void 0===o?void 0:o.share_lanes)||{},c=(0,T.clone)(d[r][a]);o.share_lanes&&o.share_lanes[r]&&(o.share_lanes[r][a]=e),t(this.phase,this.subphase,o);const h=this.getChanges(c,o,r,a,"share_lanes");if(!h)return;const u=d[r][a];this.handler.revisions.addChallengeDataHistory({action:"modify_share_card",action_data:{after:u,before:c,changes:h,lane:r},data:{share:u},field_id:"share_lanes",sub_field_id:null===u||void 0===u?void 0:u.id})}catch(e){}},this.confirmRemoval=e=>{var s;const a=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:{formatMessage:t}}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:"Remove",onClick:()=>this.handleRemoveShare(e),variant:"danger"})],body:t({id:"label.are_you_sure_you_want_to_remove_th.d34b97f4",defaultMessage:"Are you sure you want to remove this idea?"}),size:"sm",title:t({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},this.handleRemoveShare=async e=>{const{challenge:s}=this.props,{changePhaseData:a,getPhaseData:t}=s,i=t(this.phase,this.subphase),[l,n]=this.getShareCardIndexes(null===e||void 0===e?void 0:e.id),r=(null===i||void 0===i?void 0:i.share_lanes)&&(null===i||void 0===i?void 0:i.share_lanes[n])&&(null===i||void 0===i?void 0:i.share_lanes[n][l]);r&&(null!==i&&void 0!==i&&i.share_lanes&&i.share_lanes[n]&&i.share_lanes[n].splice(l,1),a(this.phase,this.subphase,i),this.handler.revisions.addChallengeDataHistory({action:"remove",action_data:{lane:n},data:{share:r},field_id:"share_lanes",sub_field_id:null===r||void 0===r?void 0:r.id}))},this.handleHistoryRevert=(e,s,a)=>{const{id:t,action:i,action_data:l,created_at:n,data:r}=a,{app:o,challenge:d}=this.props,{canChangePhaseData:c,changePhaseData:h,getPhaseData:u,project:m}=d;if(!c())return;const g=u(this.phase,this.subphase);if(i){if("share_lanes"===e&&(["add_share_card","modify_share_card"].includes(i)&&((null===g||void 0===g?void 0:g.share_lanes)&&g.share_lanes.forEach((e,a)=>{const t=e.find(e=>(null===e||void 0===e?void 0:e.id)===s);t&&(g.share_lanes[a][e.indexOf(t)]=null===r||void 0===r?void 0:r.share)}),h(this.phase,this.subphase,g)),"remove"===i)){const{api:a}=o,{lane:n}=l||{},{share:d}=r||{};g.share_lanes[n].push(d),h(this.phase,this.subphase,g),a.post(`/api/challenges/phase/history/delete/${t}`,{action:i,action_data:l,challenge_id:m.id,data:r,field_id:e,sub_field_id:s}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}if("add_share_lanes"===e&&(["add_share_card","modify_share_card"].includes(i)&&((null===g||void 0===g?void 0:g.add_share_lanes)&&g.add_share_lanes.forEach((e,a)=>{const t=e.find(e=>(null===e||void 0===e?void 0:e.id)===s);t&&(g.add_share_lanes[a][e.indexOf(t)]=null===r||void 0===r?void 0:r.share)}),h(this.phase,this.subphase,g)),"remove"===i)){const{api:a}=o,{lane:n}=l||{},{share:d}=r||{};g.add_share_lanes[n].push(d),h(this.phase,this.subphase,g),a.post(`/api/challenges/phase/history/delete/${t}`,{action:i,action_data:l,challenge_id:m.id,data:r,field_id:e,sub_field_id:s}).then(()=>{}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:t,restored_from:n},data:r,field_id:e,sub_field_id:s}),this.handler.revisions.hideChallengeDataHistory()}},this.uploader=null,this.phase=3,this.subphase=1,this.handler=null,this.redirect=!1,this.state={error:null},this.sharecard_creator=(0,l.createRef)(),this.sharecard_remover=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)()}render(){var e;const{challenge:s,intl:a}=this.props,{canChangePhaseData:t,getPhaseData:i,project:l}=s,{challenge_template:n}=l||{},{what_ifs:r}=n||{},o=!t(),d=i(this.phase,this.subphase),c=null===d||void 0===d?void 0:d.share_lanes;let h=[];
2return r&&r.forEach(e=>{h=[...h,null===e||void 0===e?void 0:e.value]}),(0,N.jsx)(Ce.S,{className:"subphase-content challenge-3-1",children:(0,N.jsxs)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:[(0,N.jsx)(Tf,{review_challenge:!0,activity_button:a.formatMessage({id:"label.add_idea.bb64eb65",defaultMessage:"Add idea"}),activity_button_handler:this.handleAddShare,card_body_class:"pb-0",disable_activity_button:o,questions_to_consider:h,revision_history_button:(0,N.jsx)(rj,{field_id:"share_lanes"}),show_example:!0,show_questions_to_consider:!0,children:(0,N.jsx)("div",{className:"share-gridmap-container",children:(0,N.jsx)("div",{className:"share-grid-outer-container",children:(0,N.jsx)("div",{className:"grid-overflow",children:null!==c&&void 0!==c&&null!==(e=c[0])&&void 0!==e&&e.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ij.i,{className:"d-none d-md-block idea-masonry",columnsCountBreakPoints:{0:1,767:2,992:3},children:(0,N.jsxs)(Ij.A,{gutter:16,children:[null===c||void 0===c?void 0:c[0].map((e,s)=>(0,N.jsx)("div",{children:(0,N.jsx)(Mj,{bold:!0,color:null===e||void 0===e?void 0:e.color,field_id:"share_lanes",itemIndex:s,laneIndex:0,onEdit:this.handleEditShare,onRemove:this.confirmRemoval,readonly:o,revision_modal_title:a.formatMessage({id:"label.what_if_card.ea804ce6",defaultMessage:"'What if...' Card"}),share:e},s)},s)),(0,N.jsx)(ve.A,{className:"idea-card-placeholder d-flex align-items-center justify-content-center rounded text-decoration-none",disabled:o,onClick:this.handleAddShare,role:"button",size:"lg",variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center gap-1 text-primary",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add idea",id:"label.add_idea.bb64eb65"})]})})]})}),(0,N.jsx)(Ce.S,{className:"d-block d-md-none",children:(0,N.jsx)(Y_,{cards:null===c||void 0===c?void 0:c[0],field_id:"share_lanes",laneIndex:0,onEdit:this.handleEditShare,onRemove:this.confirmRemoval,readonly:o,revision_modal_title:a.formatMessage({id:"label.what_if_card.ea804ce6",defaultMessage:"'What if...' Card"})})})]}):(0,N.jsx)(Ij.i,{className:"idea-masonry",columnsCountBreakPoints:{0:1,767:2,992:3},children:(0,N.jsx)(Ij.A,{gutter:16,children:(0,N.jsx)(ve.A,{className:"idea-card-placeholder d-flex align-items-center justify-content-center rounded text-decoration-none",disabled:o,onClick:this.handleAddShare,variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center gap-1 text-primary",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add idea",id:"label.add_idea.bb64eb65"})]})})})})})})})}),(0,N.jsx)(je,{ref:this.confirmation_dialog}),(0,N.jsx)(Q_,{bold:!0,modal_title:"Add an Idea",ref:this.sharecard_creator,type:"idea"})]})})}}var ib=(0,P.G0)(Fa((0,Ke.Ay)(tb)));const lb=e=>{let{color:s="white",ext:a,link:t,link_color:i="blue",link_font_weight:l,primary_color:n="green"}=e;return s||(s="white"),(0,N.jsx)("a",{"aria-label":"Download your Share What You Know Document",className:"mt-3",href:t,rel:"noopener noreferrer",style:{display:"block",fontWeight:l},target:"_blank",children:a&&a.length?(0,N.jsxs)(N.Fragment,{children:[("pptx"===a||"ppt"===a)&&(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.rgF,{size:20,style:{color:"#e05a30",fontSize:14,marginRight:5}}),(0,N.jsx)(ke.A,{defaultMessage:"PowerPoint Presentation",id:"label.powerpoint_presentation.935176c7"})]}),("docx"===a||"doc"===a)&&(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.WLb,{size:20,style:{color:"#2c4098",fontSize:14,marginRight:5}}),(0,N.jsx)(ke.A,{defaultMessage:"Word document",id:"label.word_document.10eea543"})]}),"pdf"===a&&(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.kl1,{size:20,style:{color:"#db4437",fontSize:14,marginRight:5}}),(0,N.jsx)(ke.A,{defaultMessage:"PDF Document",id:"label.pdf_document.0cbeb39b"})]}),"rtf"===a&&(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.t69,{size:20,style:{color:"black",fontSize:14,marginRight:5}}),(0,N.jsx)(ke.A,{defaultMessage:"RTF Document",id:"label.rtf_document.d61aacad"})]}),"pptx"!==a&&"ppt"!==a&&"docx"!==a&&"doc"!==a&&"pdf"!==a&&"rtf"!==a&&(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.Gp9,{size:20,style:{color:n,marginRight:5}}),(0,N.jsx)(ke.A,{defaultMessage:"Uploaded resource",id:"label.uploaded_resource.80706545"})]})]}):(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.Gp9,{size:20,style:{color:n,marginRight:5}}),(0,N.jsx)(ke.A,{defaultMessage:"Uploaded resource",id:"label.uploaded_resource.80706545"})]})})},nb=e=>{const{utils:s}=(0,n.nm)(),{parseExt:a}=s,{data:t,popover:i,text:l,type:r,user:o}=e;return(0,N.jsx)(N.Fragment,{children:"file"===r?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"mt-3",children:l}),(0,N.jsx)(Ce.S,{className:"mt-3",style:{display:"flex",justifyContent:"space-between"},children:o&&(0,N.jsx)(Ua.A,{overlay:i,placement:"bottom",trigger:["hover","focus"],children:(0,N.jsx)("span",{children:(0,N.jsx)(Ya,{size:30,user:o})})})})]}),(0,N.jsx)(lb,{ext:a(null===t||void 0===t?void 0:t.link)})]}):(0,N.jsxs)(N.Fragment,{children:[o&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"mb-3",style:{display:"flex",justifyContent:"space-between"},children:o&&(0,N.jsx)(Ua.A,{overlay:i,placement:"bottom",trigger:["hover","focus"],children:(0,N.jsx)("span",{children:(0,N.jsx)(Ya,{size:30,user:o})})})})}),(0,N.jsx)(Ce.S,{children:l})]})})},rb=e=>{var s;const{utils:a}=(0,n.nm)(),{parseExt:t}=a,{className:i="",color:r="white",share:o=null,text_color:d="black"}=e,{team_members:c}=Ra(),[h,u]=(0,ne.CQ)({selected:e.selected||!1}),{data:m,file_type:g,text:p,user:x}=o,{link:v,title:f}=m||{},{user:j}=c.find(e=>e.user_id===x)||{},_=(0,N.jsx)(Hu.A,{children:(0,N.jsx)(Hu.A.Body,{children:(0,N.jsx)("p",{className:"mb-0",children:(null===j||void 0===j?void 0:j.fullname)||""})})}),b=`idea-card ${i} ${r} ${null!==h&&void 0!==h&&h.selected?"selected":""}`;switch((0,l.useEffect)(()=>{h.selected!==e.selected&&u({selected:e.selected})},[e.selected]),g){case"video":return(0,N.jsx)(Ge.A,{className:b,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("video",{controls:!0,autoPlay:!1,crossOrigin:"anonymous",preload:"auto",style:{maxHeight:"100%",maxWidth:"100%",pointerEvents:"none"},children:(0,N.jsx)("source",{className:"mb-3",src:null===m||void 0===m?void 0:m.link})}),(0,N.jsx)(nb,{popover:_,text:p,type:g,user:j}),null===e||void 0===e?void 0:e.children]})});case"image":return(0,N.jsx)(Ge.A,{className:b,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(Ge.A.Img,{className:"mb-3",src:`${m.link}`}),(0,N.jsx)(nb,{popover:_,text:p,type:g,user:j}),e.children]})});case"link":return(0,N.jsx)(Ge.A,{className:b,children:(0,N.jsxs)(Ge.A.Body,{children:[(null===m||void 0===m||null===(s=m.meta)||void 0===s?void 0:s.image)&&(0,N.jsx)(Ge.A.Img,{fluid:!0,src:`${m.meta.image}`,style:{maxHeight:200,objectFit:"cover"}}),(0,N.jsx)(Ce.S,{className:"mt-3",style:{display:"flex",justifyContent:"space-between"},children:j&&(0,N.jsx)(Ua.A,{overlay:_,placement:"bottom",trigger:["hover","focus"],children:(0,N.jsx)("span",{children:(0,N.jsx)(Ya,{size:30,user:j})})})}),(0,N.jsx)(Ce.S,{className:"mt-3",children:p}),(0,N.jsx)(Ce.S,{className:"mt-3",style:{overflow:"hidden"},children:(0,N.jsx)("a",{href:v,rel:"noopener noreferrer",target:"_blank",style:{display:"block",fontWeight:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%"},children:(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.AnD,{size:15,style:{marginRight:5}}),f||v]})})}),e.children]})});case"file":return(0,N.jsx)(Ge.A,{className:b,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"mt-3",children:p}),(0,N.jsx)(Ce.S,{className:"mt-3",style:{display:"flex",justifyContent:"space-between"},children:j&&(0,N.jsx)(Ua.A,{overlay:_,placement:"bottom",trigger:["hover","focus"],children:(0,N.jsx)("span",{children:(0,N.jsx)(Ya,{size:30,user:j})})})})]}),null===e||void 0===e?void 0:e.children,(0,N.jsx)(lb,{ext:t(null===m||void 0===m?void 0:m.link),link:v})]})});default:return(0,N.jsx)(Ge.A,{className:b,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(nb,{popover:_,text:p,type:g,user:j}),null===e||void 0===e?void 0:e.children]})})}},ob=e=>(0,N.jsx)("div",{className:"check-card-overlay "+(e.selected?"selected":""),children:null===e||void 0===e?void 0:e.children});class db extends l.Component{constructor(e){super(e),this.handleIdeaClick=(e,s)=>{const{field_id:a}=this.state,{challenge:t}=this.props,{changePhaseData:i,getPhaseData:l}=t,n=l(this.phase,this.subphase),r=(null===n||void 0===n?void 0:n[a])||{},o=(null===r||void 0===r?void 0:r.key)===e?{[a]:{}}:{[a]:{item:s,key:e}};i(this.phase,this.subphase,o)},this.flatten2DArray=e=>{if(!Array.isArray(e)||!e.length)return"";let s=[];for(let a=0;a<e.length;a++)s=s.concat(e[a]);return s},this.goTo31=()=>{const{history:e,location:s}=this.props;e.push(s.pathname.substring(0,s.pathname.length-1)+"1")},this.uploader=null,this.phase=3,this.subphase=2,this.handler=null,this.redirect=!1,this.state={field_id:"selected_idea",loaded:!1}}render(){const{field_id:e}=this.state,{challenge:s}=this.props,{canChangePhaseData:a,challenge_type:t,getPhaseData:i,isSubphaseComplete:l}=s,n="decision_making"===t,r=n&&!l(3,1),o=!a()||r,d=i(this.phase,this.subphase),c=d&&d[e]?d[e]:{},h=i(3,1),u=null===h||void 0===h?void 0:h.share_lanes;let m=[];return u&&Array.isArray(u)&&(m=this.flatten2DArray(u)),n&&Array.isArray(m)&&m.length&&(m=[...m].sort((e,s)=>Za.tM.indexOf(null===e||void 0===e?void 0:e.decision_type)-Za.tM.indexOf(null===s||void 0===s?void 0:s.decision_type))),this.state.loaded,(0,N.jsx)(Ce.S,{className:"subphase-content challenge-3-2",children:(0,N.jsx)(Uv,{el:this,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:(0,N.jsxs)(Tf,{show_example:!0,
2children:[r&&(0,N.jsxs)(We.A,{className:"d-flex flex-wrap align-items-baseline gap-1",variant:"warning",children:[(0,N.jsx)(ke.A,{defaultMessage:"Complete the Support Decisions step before choosing your team decision.",id:"label.complete_the_support_decisions_ste.c9e2f828"}),(0,N.jsx)(ve.A,{className:"p-0 align-baseline",onClick:this.goTo31,style:{textTransform:"initial"},variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Go to Support Decisions",id:"label.go_to_support_decisions.36769402"})})]}),m.length>0?(0,N.jsx)(Ce.S,{id:"idea-cards-container",children:(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2,992:3},children:(0,N.jsx)(Ij.A,{gutter:16,children:m.map((e,s)=>{let{color:a,text:t,updated_at:i,user:l}=e;a=null!=a?this.props.app.utils.getColorName(a,!0)||"green":"white";const r=`${t}${l}${i}`,d=(null===c||void 0===c?void 0:c.key)===r;return(0,N.jsxs)(Ce.S,{onClick:()=>!o&&this.handleIdeaClick(r,e),style:{pointerEvents:o&&"none"},tabIndex:0,children:[(0,N.jsx)("span",{className:"visually-hidden",children:n?d?"unselect pathway position":"select pathway position":d?"unselect idea":"select idea"}),e.decision_type&&(0,N.jsx)(Ce.S,{className:"mb-1",children:(0,N.jsx)(bo.A,{bg:"primary",children:e.decision_type})}),(0,N.jsx)(ob,{selected:d,children:(0,N.jsx)(rb,{color:a,selected:d,share:e})})]},r)})})})}):(0,N.jsxs)("div",{className:"empty-state-container d-flex flex-column align-items-center justify-content-center p-5",children:[(0,N.jsx)("h6",{className:"mb-2",children:n?(0,N.jsx)(ke.A,{defaultMessage:"No team positions yet",id:"label.no_team_positions_yet.fc0a6541"}):(0,N.jsx)(ke.A,{defaultMessage:"No ideas added",id:"label.no_ideas_added.d9e47733"})}),(0,N.jsxs)("div",{className:"instruction d-flex flex-column flex-sm-row align-items-center align-items-sm-baseline gap-1",children:[n?(0,N.jsx)(ke.A,{defaultMessage:"Add your pathway positions in the",id:"label.add_your_pathway_positions_in_the.843dd84d"}):(0,N.jsx)(ke.A,{defaultMessage:"Add an idea in the",id:"label.add_an_idea_in_the.c3b92b8a"}),(0,N.jsx)(ve.A,{onClick:this.goTo31,style:{textTransform:"initial"},variant:"link",children:n?(0,N.jsx)(ke.A,{defaultMessage:"Support Decisions step",id:"label.support_decisions_step.c3161e09"}):(0,N.jsx)(ke.A,{defaultMessage:"previous step",id:"label.previous_step.6b1d4b62"})})]})]})]})})})}}var cb=(0,P.G0)(Fa((0,Pe.y)((0,Ke.Ay)(db))));class hb extends l.Component{constructor(e){super(e),this.handleChangeText=(e,s,a)=>{const{app:t,challenge:i}=this.props,{changePhaseData:l,getPhaseData:n,setFieldStatus:r}=i,o=e.currentTarget.value||"",d=n(this.phase,this.subphase),c=((null===d||void 0===d?void 0:d.action_statement)||this.getDefaultActionStatement())[a];let h=(0,T.clone)(c);c.value=o,d.action_statement[a]=c,l(this.phase,this.subphase,d),r(s,a),this.handler.revisions.setFieldTimer(s,a,()=>{var e;const i=n(this.phase,this.subphase),l=((null===i||void 0===i?void 0:i.action_statement)||this.getDefaultActionStatement())[a];l.user=null===t||void 0===t||null===(e=t.user)||void 0===e?void 0:e.id,(0,T.isEqual)(h.value.trim(),l.value.trim())||this.handler.revisions.addChallengeDataHistory({action:"modify_field_text",action_data:{after:l,before:h},data:{statement:l},field_id:s,sub_field_id:a})},5e3)},this.getDefaultActionStatement=()=>({ending_in:{user:"",value:""},so_that:{user:"",value:""},we_will:{user:"",value:""}}),this.handleHistoryRevert=(e,s,a)=>{const{id:t,action:i,created_at:l,data:n}=a,{challenge:r}=this.props,{canChangePhaseData:o,changePhaseData:d,getPhaseData:c}=r;if(!o())return;const h=c(this.phase,this.subphase);if(i){var u;if("modify_field_text"===i)h.action_statement[s].value=(null===n||void 0===n||null===(u=n.statement)||void 0===u?void 0:u.value)||"",d(this.phase,this.subphase,h);this.handler.revisions.addChallengeDataHistory({action:"revert",action_data:{challenge_data_history_id:t,restored_from:l},data:n,field_id:this.field_id,sub_field_id:s}),this.handler.revisions.hideChallengeDataHistory()}},this.uploader=null,this.phase=4,this.subphase=1,this.handler=null,this.redirect=!1,this.field_id="action_statement"}componentDidMount(){const{challenge:e}=this.props,{changePhaseData:s,getPhaseData:a}=e,t=a(this.phase,this.subphase);(null===t||void 0===t?void 0:t.action_statement)||null||(t.action_statement=this.getDefaultActionStatement
2(),s(this.phase,this.subphase,t))}render(){var e=this;const{app:s,challenge:a,intl:t}=this.props,{canChangePhaseData:i,challenge_type:l,fieldStatusIndicator:n,getPhaseData:r,isFieldDisabled:o}=a,{utils:d}=s,c=!i(),h="decision_making"===l,u=r(this.phase,this.subphase),m=(null===u||void 0===u?void 0:u.action_statement)||this.getDefaultActionStatement(),g=h?[(0,F.A)((0,F.A)({},m.we_will),{},{key:"we_will",label:t.formatMessage({id:"label.we_recommend.9b69dfd0",defaultMessage:"We recommend"}),placeholder:t.formatMessage({id:"label.advancing_the_proposed_decision_ca.a48233db",defaultMessage:"advancing the proposed decision case as a 90-day pilot with one regional team."})}),(0,F.A)((0,F.A)({},m.so_that),{},{key:"so_that",label:t.formatMessage({id:"label.because.c5532250",defaultMessage:"Because"}),placeholder:t.formatMessage({id:"label.the_evidence_shows_clear_value_and.4a763375",defaultMessage:"the evidence shows clear value and feasibility within our governance and risk constraints."})}),(0,F.A)((0,F.A)({},m.ending_in),{},{key:"ending_in",label:t.formatMessage({id:"label.resulting_in.07b4f0c6",defaultMessage:"Resulting in"}),placeholder:t.formatMessage({id:"label.a_measurable_reduction_in_handling.e7e34667",defaultMessage:"a measurable reduction in handling time, evaluated against a defined baseline at the end of the pilot."})})]:[(0,F.A)((0,F.A)({},m.we_will),{},{key:"we_will",label:t.formatMessage({id:"label.we_will.5daab980",defaultMessage:"We will"}),placeholder:t.formatMessage({id:"label.design_a_floating_garbage_containe.f5b81c9f",defaultMessage:"design a floating garbage container designed for ports and marinas that will catch small debris in a filter, before pumping clean water back into the sea."})}),(0,F.A)((0,F.A)({},m.so_that),{},{key:"so_that",label:t.formatMessage({id:"label.so_that.7fc46a9c",defaultMessage:"So that"}),placeholder:t.formatMessage({id:"label.garbage_and_oil_from_the_waters_su.e415ecec",defaultMessage:"garbage and oil from the water's surface can be collected before the pollution can enter our oceans."})}),(0,F.A)((0,F.A)({},m.ending_in),{},{key:"ending_in",label:t.formatMessage({id:"label.ending_in.d7de3f00",defaultMessage:"Ending in"}),placeholder:t.formatMessage({id:"label.a_daily_reduction_in_marine_pollut.7c755928",defaultMessage:"a daily reduction in marine pollution and a cleaner future for everyone."})})],p=r(3,2),x=null===p||void 0===p?void 0:p.selected_idea,v=(null===x||void 0===x?void 0:x.item)||null;return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-4-1",children:(0,N.jsx)(Uv,{el:this,onHistoryRevert:this.handleHistoryRevert,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:(0,N.jsxs)(Tf,{show_example:!0,children:[(0,N.jsxs)(Ce.S,{className:"mt-3",id:"selected-idea-container",children:[(0,N.jsx)("h5",{className:"d-inline align-middle",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Team decision",id:"label.team_decision.8ebf3c00"}):(0,N.jsx)(ke.A,{defaultMessage:"Selected idea",id:"label.selected_idea.1cec06a3"})}),v&&(0,N.jsxs)(Ce.S,{className:"py-3",style:{maxWidth:"50%"},children:[v.decision_type&&(0,N.jsx)(Ce.S,{className:"mb-1",children:(0,N.jsx)(bo.A,{bg:"primary",children:v.decision_type})}),(0,N.jsx)(Mj,{dummy:!0,share:v})]})]}),(0,N.jsxs)(Ce.S,{className:"mt-3",children:[(0,N.jsxs)("h5",{children:[(0,N.jsx)("strong",{children:h?(0,N.jsx)(ke.A,{defaultMessage:"What does your team recommend? Why is it the right call given the evidence? What measurable outcomes do you expect?",id:"label.what_does_your_team_recommend_why.ccedc8b8"}):(0,N.jsx)(ke.A,{defaultMessage:"What will you do? Why will you do that? What will happen as a result?",id:"label.what_will_you_do_why_will_you_do_t.e802ec59"})}),(0,N.jsx)("br",{})]}),(0,N.jsx)(Ue.A,{fluid:!0,className:"p-0",children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)(qa.A,{id:"question-inputs-table",children:(0,N.jsx)("tbody",{children:!(null===g||void 0===g||!g.length)&&g.map(function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;const{key:i,label:l,placeholder:r,value:h}=s;return(0,N.jsx)("tr",{children:(0,N.jsxs)("td",{className:"position-relative",children:[(0,N.jsx)(Ce.S,{className:"icon-circle icon-primary",children:a+1}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{className:h?"active":"",children:(0,N.jsx)("strong",{children:l})}),(0,N.jsx)(be.A,{"aria-label":"text",as:"textarea",disabled:c||o(e.field_id,i),onChange:s=>e.handleChangeText(s,e.field_id,i),placeholder:r,readOnly:c,rows:2,value:h})]}),(0,N.jsxs)(Ce.S,{className:"input-metadata",style:{alignItems:"center",display:"flex",justifyContent:"space-between"},children:[(0,N.jsx)(Ce.S,{className:"me-auto",children:n(e.field_id,i)}),(0,N.jsxs)(Ce.S,{className:"d-flex",style:{alignItems:"center"},children:[(0,N.jsx)(Jv,{field_id:e.field_id,sub_field_id:i}),(0,N.jsx)(Yv,{full_descriptor:!0,field_id:e.field_id,size:"large",sub_field_id:i,title:t.formatMessage({id:"label.label_history.ad40cbbd",defaultMessage:"{label }History"},{label:l})}),(0,N.jsx)(Gf,{length:d.countWords(h),max:25,min:3})]})]})]})},i)})})})})})})]})]})})})}}var ub=(0,P.G0)(Fa((0,Ke.Ay)(hb)));var mb=e=>{const{choice_id:s,handleSubmit:a}=e,{project:t}=Ra(),{challenge_template:i}=t||{},{deliverable_challenges:l}=i||{};return(0,N.jsx)(Ce.S,{className:"deliverable-challenge-list-container",children:l&&l.map((e,t)=>{let{id:i}=e;return(0,N.jsx)(Em,{deliverable_challenge:e,handleSubmit:a,is_first:0===t&&!s,selected:s===i},t)})})},gb=t(56938);class pb extends l.Component{constructor(e){super(e),this.handleRemove=()=>{const{challenge:{changePhaseData:e,getPhaseData:s}}=this.props,a=s(this.phase,this.subphase),t=(null===a||void 0===a?void 0:a.deliverable_choice)||null;e(this.phase,this.subphase,{deliverable:null,deliverable_choice:t})},this.handleConfirmRemoval=()=>{var e;const{intl:{formatMessage:s}}=this.props,a=null===this||void 0===this||null===(e=this.confirmation_dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:"Remove",onClick:this.handleRemove,variant:"danger"})],body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to remove your current deliverable?",id:"label.are_you_sure_you_want_to_remove_yo.b605f1d6"}),(0,N.jsx)("br",{}
2),(0,N.jsx)(ke.A,{defaultMessage:"This action can't be undone.",id:"label.this_action_cant_be_undone.b1b3fc4b"})]}),title:s({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},this.phase=4,this.subphase=2,this.handler=null,this.deliverable_uploader=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)()}render(){const{app:e,challenge:s,intl:a}=this.props,{canChangePhaseData:t,challenge_type:i,changePhaseData:l,getPhaseData:n}=s,{styles:r}=e,o=(null===r||void 0===r?void 0:r.primary)||"",d=!t(),c=n(this.phase,this.subphase),h=(null===c||void 0===c?void 0:c.deliverable)||null,u=(null===c||void 0===c?void 0:c.deliverable_choice)||null;return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-4-2",children:(0,N.jsxs)(Uv,{el:this,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:[(0,N.jsx)(Tf,{show_example:!0,children:(0,N.jsx)(Ce.S,{className:"mt-3",children:(0,N.jsx)(mb,{choice_id:null===u||void 0===u?void 0:u.id,handleSubmit:e=>{h&&!window.confirm(a.formatMessage({id:"label.are_you_sure_you_want_to_do_this_t.8f5d2097",defaultMessage:"Are you sure you want to do this? This will clear your existing Team Deliverable"}))||(l(this.phase,this.subphase,{deliverable:null,deliverable_choice:e}),this.deliverable_uploader.current.show())}})})}),(0,N.jsx)(Ge.A,{className:"activity-card mt-3",children:(0,N.jsxs)(Ge.A.Body,{className:"card-body",children:[(0,N.jsxs)("h5",{className:"d-flex align-items-center m-0 gap-2",children:[(0,N.jsx)(xr,{challenge_type:i,color:o,phase:this.phase,size:16,subphase:this.subphase}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team deliverable",id:"label.team_deliverable.df9644d2"})})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{children:h?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ku,{deliverable:h,show_details:!1}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(ve.A,{className:"d-flex align-self-center align-items-center gap-1",disabled:d,onClick:this.handleConfirmRemoval,variant:"link",children:[(0,N.jsx)(ze.qbC,{}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})]})})]}):(0,N.jsxs)(Ce.S,{className:"deliverable-placeholder d-flex flex-column justify-content-center align-items-center p-4",children:[(0,N.jsx)(Zs.A,{fluid:!0,height:480,src:gb,width:624}),(0,N.jsx)("p",{className:"lead text-muted text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Select a deliverable type from the options above.",id:"label.select_a_deliverable_type_from_the.c6045eed"})})]})})]})}),(0,N.jsx)(Sm,{deliverable_choice:u,ref:this.deliverable_uploader,onSubmit:(e,s)=>{l(this.phase,this.subphase,{deliverable:e,deliverable_choice:s})}}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})})}}var xb=(0,P.G0)(Fa((0,Ke.Ay)(pb)));var vb=t.p+"static/media/info_icon.9a40804f896533d10d9f9655c41206c3.svg";class fb extends l.Component{constructor(){super(...arguments),this.debounceSubmit=(e,s)=>{this.timer&&clearTimeout(this.timer),this.timer=setTimeout(s,10)}}render(){const{c:e,challenge:s,challenge_template_title:a,initial_values:t,member:i,submit:l}=this.props,{team_members:n}=s||{};return(0,N.jsx)(ds.l1,{enableReinitialize:!0,initialValues:t||{},onSubmit:(e,s)=>"function"===typeof l&&l(e),render:s=>{let{errors:t,handleSubmit:l,submitCount:r,touched:o}=s;return(0,N.jsx)(_e.A,{className:"rubric-form",onSubmit:l,children:(0,N.jsxs)(Ce.S,{className:"px-0 mt-3 w-100",children:[(0,N.jsxs)(ho,{bordered:!0,hover:!1,striped:!1,style:{borderCollapse:"collapse"},children:[(0,N.jsx)(Kr,{children:(0,N.jsxs)(io,{children:[(0,N.jsxs)(so,{children:[(0,N.jsx)("span",{children:i}),(0,N.jsx)("small",{className:"text-muted",children:a})]}),(0,N.jsxs)(so,{className:"text-center",children:[(0,N.jsx)("div",{className:"popover-link",children:(0,N.jsx)(Ua.A,{newProp:"test",placement:"bottom",trigger:"focus",overlay:(0,N.jsx)(Hu.A,{bsPrefix:"solvably",id:"popover-basic",children:(0,N.jsx)(Sb,{c:e,kind:"Basic"})}),children:(0,N.jsxs)(ve.A,{className:"btn-rubric-type d-flex align-items-center gap-1 justify-content-center",onClick:e=>e.preventDefault(),variant:"link",children:[(0,N.jsx)(ke.A,{defaultMessage:"Basic",id:"label.basic.0e35f6e9"}),(0,N.jsx)(Zs.A,{alt:"",src:vb})]})})}),(0,N.jsx)("span",{className:"star","aria-label":(0,N.jsx)(ke.A,{defaultMessage:"A one-star rating",id:"label.a_one_star_rating.907b242b"}),children:"\u2605\u2606\u2606\u2606"})]}),(0,N.jsxs)(so,{className:"text-center",children:[(0,N.jsx)("div",{className:"popover-link",children:(0,N.jsx)(Ua.A,{newProp:"test",placement:"bottom",trigger:"focus",overlay:(0,N.jsx)(Hu.A,{bsPrefix:"solvably",id:"popover-basic",children:(0,N.jsx)(Sb,{c:e,kind:"Emerging"})}),children:(0,N.jsxs)(ve.A,{className:"btn-rubric-type d-flex align-items-center gap-1 justify-content-center",onClick:e=>e.preventDefault(),variant:"link",children:[(0,N.jsx)(ke.A,{defaultMessage:"Emerging",id:"label.emerging.96341c76"}),(0,N.jsx)(Zs.A,{alt:"",src:vb})]})})}),(0,N.jsx)("span",{className:"star","aria-description":(0,N.jsx)(ke.A,{defaultMessage:"A two-star rating",id:"label.a_two_star_rating.127cd8ee"}),children:"\u2605\u2605\u2606\u2606"})]}),(0,N.jsxs)(so,{className:"text-center",children:[(0,N.jsx)("div",{className:"popover-link",children:(0,N.jsx)(Ua.A,{newProp:"test",placement:"bottom",trigger:"focus",overlay:(0,N.jsx)(Hu.A,{bsPrefix:"solvably",id:"popover-basic",children:(0,N.jsx)(Sb,{c:e,kind:"Strong"})}),children:(0,N.jsxs)(ve.A,{className:"btn-rubric-type d-flex align-items-center gap-1 justify-content-center",onClick:e=>e.preventDefault(),variant:"link",children:[(0,N.jsx)(ke.A,{defaultMessage:"Strong",id:"label.strong.30a04fdc"}),(0,N.jsx)(Zs.A,{alt:"",src:vb})]})})}),(0,N.jsx)("span",{className:"star","aria-label":(0,N.jsx)(ke.A,{defaultMessage:"A three-star rating",id:"label.a_three_star_rating.0a3cd87f"}),children:"\u2605\u2605\u2605\u2606"})]}),(0,N.jsxs)(so,{className:"text-center",children:[(0,N.jsx)("div",{className:"popover-link",children:(0,N.jsx)(Ua.A,{newProp:"test",placement:"left",trigger:"focus",overlay:(0,N.jsx)(Hu.A,{bsPrefix:"solvably",id:"popover-basic",children:(0,N.jsx)(Sb,{c:e,kind:"Exemplary"})}),children:(0,N.jsxs)(ve.A,{className:"btn-rubric-type d-flex align-items-center gap-1 justify-content-center",onClick:e=>e.preventDefault(),variant:"link",children:[(0,N.jsx)(ke.A,{defaultMessage:"Exemplary",id:"label.exemplary.f897ad1b"}),(0,N.jsx)(Zs.A,{alt:"",src:vb})]})})}),(0,N.jsx)("span",{className:"star","aria-label":(0,N.jsx)(ke.A,{defaultMessage:"A four-star rating",id:"label.a_four_star_rating.7e51924d"}),children:"\u2605\u2605\u2605\u2605"})]})]})}),(0,N.jsx)(Jr,{children:!(null===n||void 0===n||!n.length)&&n.map((e,s)=>(0,N.jsx)(bb,{member:e,onSubmit:e=>this.debounceSubmit(e,l)},`${s}-${e.id}`))})]}),t.collaboration&&o.collaboration&&r>=1&&(0,N.jsx)("div",{style:{color:"red"},children:(0,N.jsx)(ke.A,{defaultMessage:"Please answer all Collaboration review questions",id:"label.please_answer_all_collaboration_re.1962054b"})}),t.creativity&&o.creativity&&r>=1&&(0,N.jsx)("div",{style:{color:"red"},children:(0,N.jsx)(ke.A,{defaultMessage:"Please answer all Creativity review questions",id:"label.please_answer_all_creativity_revie.f2116fbc"})}),t.critical&&o.critical&&r>=1&&(0,N.jsx)("div",{style:{color:"red"},children:(0,N.jsx)(ke.A,{defaultMessage:"Please answer all Critical Thinking review questions",id:"label.please_answer_all_critical_thinkin.9d02d3be"})}),t.communication&&o.communication&&r>=1&&(0,N.jsx)("div",{style:{color:"red"},children:(0,N.jsx)(ke.A,{defaultMessage:"Please answer all Communication review questions",id:"label.please_answer_all_communication_re.8dba05a0"})})]})})}})}}var jb=(0,P.G0)(Fa(fb));const _b=e=>{const{member:s,onSubmit:a}=e,{user:t}=s,{id:i,fullname:l}=t||{},{canChangePhaseData:n}=Ra(),r=!n(),{user:{id:o}}=(0,P.nm)();return t?(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{withBorder:!0,showOnline:!1,size:30,user:t}),(0,N.jsx)("strong",{children:l}),(e=>e===o)(i)&&(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"(me)",id:"label.me.cbfc8085"})})]})}),["1","2","3","4"].map(e=>(0,N.jsx)(ro,{className:"text-center",children:(0,N.jsx)(ds.D0,{component:yb,disabled:r,id:e,name:i,onClick:()=>a(i)})},`${i}-${e}`))]}):(0,N.jsx)(N.Fragment,{})};_b.defaultProps={member:{},onSubmit:Function()};var bb=_b;const Ab=["id","className","field","onClick"];var yb=e=>{let{id:s,className:a,field:{name:t,onBlur:i,onChange:l,value:n},onClick:r}=e,o=(0,he.A)(e,Ab);return(0,N.jsx)("label",{className:"d-flex align-items-center justify-content-center",children:(0,N.jsx)("input",(0,F.A)({checked:s===n,className:oa()("radio-button"),id:s,name:t,onBlur:i,onChange:l,onClick:r,type:"radio",value:s},o))})};var wb=t.p+"static/media/check-single.5abe3b720d2c0da81160c441a3e7c48f.svg";function Nb(e){let{c:s,intl:a,kind:t}=e;const i=[{c:"critical",levels:[{header_line:a.formatMessage({id:"label.a_basic_critical_thinker.c9738dd6",defaultMessage:"A basic critical thinker..."}),score:1,stars:"\u2605\u2606\u2606\u2606",type:a.formatMessage({id:"label.basic.0e35f6e9",defaultMessage:"Basic"}),values:[a.formatMessage({id:"label.shows_a_partially_developed_or_lim.c9ca231f",defaultMessage:"Shows a partially-developed or limited understanding of the problem and its importance; identifies a few specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge)."}),a.formatMessage({id:"label.rarely_or_with_assistance_gathers.c35a2a04",defaultMessage:"Rarely, or with assistance, gathers information from sources on the challenge topic; sources are at times inaccurate or not trustworthy."}),a.formatMessage({id:"label.contributes_to_the_development_of.fad59360",defaultMessage:"Contributes to the development of a partially-acceptable or unacceptable solution."})]},{header_line:a.formatMessage({id:"label.an_emerging_critical_thinker.c96eee3b",defaultMessage:"An emerging critical thinker..."}),score:2,stars:"\u2605\u2605\u2606\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.shows_an_adequate_understanding_of.4487bd28",defaultMessage:"Shows an adequate understanding of the problem and its importance; identifies some specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge)."}),a.formatMessage({id:"label.with_little_assistance_gathers_inf.56ac81f2",defaultMessage:"With little assistance, gathers information from sources on the challenge topic; uses accurate, correct, credible, and trustworthy sources most of the time."}),a.formatMessage({id:"label.contributes_to_the_development_of.d83d81c3",defaultMessage:"Contributes to the development of a reasonable, acceptable solution."})]},{header_line:a.formatMessage({id:"label.a_strong_critical_thinker.fd430e17",defaultMessage:"A strong critical thinker..."}),score:3,stars:"\u2605\u2605\u2605\u2606",type:a.formatMessage({id:"label.strong.30a04fdc",defaultMessage:"Strong"}),values:[a.formatMessage({id:"label.shows_a_clear_understanding_of_the.e1a1e022",defaultMessage:"Shows a clear understanding of the problem and its importance; identifies many specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge)."}),a.formatMessage({id:"label.with_no_assistance_gathers_informa.f0f0f876",defaultMessage:"With no assistance, gathers information from sources on the challenge topic; uses accurate, correct, credible, and trustworthy sources."}),a.formatMessage({id:"label.contributes_to_a_clear_reasonable.2245481e",defaultMessage:"Contributes to a clear, reasonable solution that is meaningful to the problem."})]},{header_line:a.formatMessage({id:"label.an_exemplary_critical_thinker.683791fb",defaultMessage:"An exemplary critical thinker..."}),score:4,stars:"\u2605\u2605\u2605\u2605",type:a.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),values:[a.formatMessage({id:"label.shows_an_in_depth_understanding_of.3ffb1f00",defaultMessage:"Shows an in-depth understanding of the problem and thoroughly and accurately identifies many specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge)."}),a.formatMessage({id:"label.independently_gathers_relevant_inf.606e061b",defaultMessage:"Independently gathers relevant information from multiple sources on the challenge topic; gathers very accurate, correct, credible, and trustworthy sources."}),a.formatMessage({id:"label.actively_contributes_and_encourage.81138e8a",defaultMessage:"Actively contributes and encourages others to develop a clear, reasonable solution that is meaningful to the problem."})]}]},{c:"communication",levels:[{header_line:a.formatMessage({id:"label.a_basic_communicator.17bef293",defaultMessage:"A basic communicator..."}),score:1,stars:"\u2605\u2606\u2606\u2606",type:a.formatMessage({id:"label.basic.0e35f6e9",defaultMessage:"Basic"}),values:[a.formatMessage({id:"label.develops_messages_to_communicate_u.52891955",defaultMessage:"Develops messages to communicate using digital media and environments, but the messages lack clarity, focus, and specificity."}),a.formatMessage({id:"label.is_sometimes_positive_and_inconsis.c8249114",defaultMessage:"Is sometimes positive, and inconsistently lets collaborators know that their opinions and ideas are valued. Delivers feedback, but sometimes comes across as lacking respect when attempting to be direct."}),a.formatMessage({id:"label.inconsistently_listens_actively_an.50feca30",defaultMessage:"Inconsistently listens actively and attentively; demonstrates interest in the speaker's message, but does not provide verbal or nonverbal feedback to indicate that the message was received and to show understanding."})]},{header_line:a.formatMessage({id:"label.an_emerging_communicator.20a
2a1242",defaultMessage:"An emerging communicator..."}),score:2,stars:"\u2605\u2605\u2606\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.develops_clear_focused_concise_and.3be02882",defaultMessage:"Develops clear, focused, concise, and specific messages when communicating using digital media and environments some of the time."}),a.formatMessage({id:"label.is_usually_positive_and_lets_colla.c08a7601",defaultMessage:"Is usually positive, and lets collaborators know that their opinions and ideas are valued most of the time. Delivers feedback in a manner that makes the recipients feel respected; can be direct, but shows care and respect most of the time."}),a.formatMessage({id:"label.listens_actively_and_attentively_m.d53729a6",defaultMessage:"Listens actively and attentively most of the time, demonstrates an interest in the speaker's message, and usually provides verbal or nonverbal feedback to indicate that the message was received and to show understanding."})]},{header_line:a.formatMessage({id:"label.a_strong_communicator.84903266",defaultMessage:"A strong communicator..."}),score:3,stars:"\u2605\u2605\u2605\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.usually_develops_clear_focused_con.71e8ca16",defaultMessage:"Usually develops clear, focused, concise, and specific messages when communicating using digital media and environments."}),a.formatMessage({id:"label.is_usually_positive_and_is_beginni.ebbab2b1",defaultMessage:"Is usually positive and is beginning to express that collaborators' opinions and ideas are valued. Delivers feedback in a manner that makes the recipients feel respected; shows care and respect."}),a.formatMessage({id:"label.listens_actively_and_attentively_d.f0c157dd",defaultMessage:"Listens actively and attentively, demonstrates an interest in the speaker's message, and provides verbal or nonverbal feedback to indicate that the message was received and to show understanding."})]},{header_line:a.formatMessage({id:"label.an_exemplary_communicator.c3e18a1d",defaultMessage:"An exemplary communicator..."}),score:4,stars:"\u2605\u2605\u2605\u2605",type:a.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),values:[a.formatMessage({id:"label.consistently_develops_a_clear_focu.738550b1",defaultMessage:"Consistently develops a clear, focused, and specific message when communicating using 21st century tools; both the sender and the receiver understand the same information as a result of the communication."}),a.formatMessage({id:"label.consistently_communicates_positive.d6434b29",defaultMessage:"Consistently communicates positively and indicates that collaborators' opinions and ideas are valued. Consistently delivers feedback in a manner that makes the recipients feel respected."}),a.formatMessage({id:"label.listens_actively_and_attentively_d.abd9ba66",defaultMessage:"Listens actively and attentively, demonstrates an interest in the speaker's message, and provides verbal or nonverbal feedback to indicate that the message was received; shows understanding."})]}]},{c:"collaboration",levels:[{header_line:a.formatMessage({id:"label.a_basic_collaborator.65a94ee6",defaultMessage:"A basic collaborator..."}),score:1,stars:"\u2605\u2606\u2606\u2606",type:a.formatMessage({id:"label.basic.0e35f6e9",defaultMessage:"Basic"}),values:[a.formatMessage({id:"label.rarely_focuses_on_the_task_and_wha.3cbd6271",defaultMessage:"Rarely focuses on the task and what needs to be done. Lets others do the work. Seldom follows through on assigned tasks."}),a.formatMessage({id:"label.shares_ideas_without_listening_or.536352ca",defaultMessage:"Shares ideas without listening or listens without sharing ideas. Tends to dominate discussions."}),a.formatMessage({id:"label.rarely_makes_compromises_to_accomp.895c3549",defaultMessage:"Rarely makes compromises to accomplish a common goal. Has some difficulty getting along with other group members."})]},{header_line:a.formatMessage({id:"label.an_emerging_collaborator.56385533",defaultMessage:"An emerging collaborator..."}),score:2,stars:"\u2605\u2605\u2606\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.focuses_on_the_task_and_what_needs.59683097",defaultMessage:"Focuses on the task and what needs to be done some of the time. Other group members must sometimes remind this person to keep on task. Does not follow through on some assigned tasks."}),a.formatMessage({id:"label.allows_for_equal_participation_by.26d901da",defaultMessage:"Allows for equal participation by both sharing ideas and listening to the ideas of others."}),a.formatMessage({id:"label.occasionally_makes_compromises_to.52c60b41",defaultMessage:"Occasionally makes compromises to accomplish a common goal. Sometimes helps keep the group working well together."})]},{header_line:a.formatMessage({id:"label.a_strong_collaborator.93476503",defaultMessage:"A strong collaborator..."}),score:3,stars:"\u2605\u2605\u2605\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.focuses_on_the_task_and_what_needs.c0adcf68",defaultMessage:"Focuses on the task and what needs to be done most of the time. Other group members can count on this person. Follows through on most assigned tasks."}),a.formatMessage({id:"label.encourages_equal_participation_by.eb4a8b73",defaultMessage:"Encourages equal participation by asking clarifying or probing questions, paraphrasing ideas, and synthesizing group thinking."}),a.formatMessage({id:"label.usually_makes_necessary_compromise.cf3afcf5",defaultMessage:"Usually makes necessary compromises to accomplish a common goal. Helps keep the group working well together."})]},{header_line:a.formatMessage({id:"label.an_exemplary_collaborator.e10367ed",defaultMessage:"An exemplary collaborator..."}),score:4,stars:"\u2605\u2605\u2605\u2605",type:a.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),values:[a.formatMessage({id:"label.consistently_stays_focused_on_the.1792ba9f",defaultMessage:"Consistently stays focused on the task and what needs to be done; very self-directed. Follows through on assigned tasks and does not depend on others to do the work."}),a.formatMessage({id:"label.actively_invites_others_to_partici.6ed03099",defaultMessage:"Actively invites others to participate equitably, promoting divergent and creative perspectives. Helps direct the group in reaching consensus."}),a.formatMessage({id:"label.consistently_makes_necessary_compr.c06c9abb",defaultMessage:"Consistently makes necessary compromises to accomplish a common goal. Always helps keep the group working well together."})]}]},{c:"creativity",levels:[{header_line:a.formatMessage({id:"label.a_basic_creative_problem_solver.1ea783bc",defaultMessage:"A basic creative problem-solver..."}),score:1,stars:"\u2605\u2606\u2606\u2606",type:a.formatMessage({id:"label.basic.0e35f6e9",defaultMessage:"Basic"}),values:[a.formatMessage({id:"label.communicates_ideas_to_meet_the_cha.456c4f32",defaultMessage:"Communicates ideas to meet the challenge, but the volume is not sufficient to spark a creative process; ideas are somewhat connected to the challenge at hand."}),a.formatMessage({id:"label.creates_a_product_that_has_a_vague.6539be3c",defaultMessage:"Creates a product that has a vague or incomplete connection to the challenge or problem. Product is not considered to be useful or unique and is not considered to be creative. (May simply replicate an existing product.)"}),a.formatMessage({id:"label.sometimes_perseveres_when_presente.213279f4",defaultMessage:"Sometimes perseveres when presented with challenges/setbacks."})]},{header_line:a.formatMessage({id:"label.an_emerging_creative_problem_solve.9c416479",defaultMessage:"An emerging creative problem-solver..."}),score:2,stars:"\u2605\u2605\u2606\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.generates_a_sufficient_volume_of_c.d6ec98e6",defaultMessage:"Generates a sufficient volume of clear ideas to meet the challenge; ideas address the challenge and are sufficiently detailed to spark a creative process."}),a.formatMessage({id:"label.uses_ideas_to_create_a_product_tha.cbe278b8",defaultMessage:"Uses ideas to create a product that is related to the challenge or problem. Product is considered to be somewhat valuable, unique, and creative."}),a.formatMessage({id:"label.usually_perseveres_when_presented.d38947f3",defaultMessage:"Usually perseveres when presented with challenges/setbacks."})]},{header_line:a.formatMessage({id:"label.a_strong_creative_problem_solver.c9243a96",defaultMessage:"A strong creative problem-solver..."}),score:3,stars:"\u2605\u2605\u2605\u2606",type:a.formatMessage({id:"label.emerging.96341c76",defaultMessage:"Emerging"}),values:[a.formatMessage({id:"label.generates_many_clear_ideas_to_meet.d2268ced",defaultMessage:"Generates many clear ideas to meet the challenge; ideas closely address the challenge and are well-detailed to spark a creative process."}),a.formatMessage({id:"label.uses_ideas_to_create_a_product_tha.694efb05",defaultMessage:"Uses ideas to create a product that is related to the challenge or problem. Product is considered to be sufficiently valuable, unique, and creative."}),a.formatMessage({id:"label.consistently_perseveres_when_prese.8cba9c23",defaultMessage:"Consistently perseveres when presented with challenges, shows resilience in situations in which failure is part of the experience, and shows confidence and an ability to take risks."})]},{header_line:a.formatMessage({id:"label.an_exemplary_creative_problem_solv.34920b8f",defaultMessage:"An exemplary creative problem-solver..."}),score:4,stars:"\u2605\u2605\u2605\u2605",type:a.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),values:[a.formatMessage({id:"label.takes_an_original_unique_and_imagi.98a07be9",defaultMessage:"Takes an original, unique, and imaginative approach to idea generation; offers ideas that are broad in their diversity."}),a.formatMessage({id:"label.uses_ideas_to_create_a_product_tha.16feadb2",defaultMessage:"Uses ideas to create a product that is directly related to the challenge or problem. Product is considered to be valuable, unique, and creative."}),a.formatMessage({id:"label.models_resilience_when_confronted.e6f66a8f",defaultMessage:"Models resilience when confronted with production challenges/setbacks. Is confident and able to take calculated risks and adapt plans."})]}]}];const l=function(){if(!s||!t)return;let e=i.filter(e=>e.c===s);if(!e)return;let a=e&&e[0]&&e[0].levels&&e[0].levels.filter(e=>e.type===t);return a&&a[0]}(),{header_line:n,score:r,stars:o,type:d,values:c}=l;return(0,N.jsx)(Ge.A,{className:"lite-definition-card",children:(0,N.jsxs)(Ce.S,{style:{padding:"10px 12px"},children:[(0,N.jsxs)("h5",{className:"mb-0",children:[d,(0,N.jsx)("span",{className:"star ms-2",children:o}),(0,N.jsxs)("span",{className:"visually-hidden",children:[r," stars"]})]}),(0,N.jsx)("hr",{}),(0,N.jsx)("h6",{children:n}),c&&c.map((e,s)=>(0,N.jsxs)(Ce.S,{style:{position:"relative"},children:[(0,N.jsx)("img",{alt:"",className:"float-start",src:wb,style:{color:"#373737",height:12,left:0,marginRight:10,marginTop:2.5,position:"absolute",top:5,width:12}}
2),(0,N.jsx)("p",{className:"bullet-text",children:e})]},s))]})})}Nb.defaultProps={c:"critical",kind:"Basic"};var Sb=(0,Ke.Ay)((0,n.G0)(Fa(Nb)));var Cb=e=>{const{user:s}=(0,P.nm)(),a=null===s||void 0===s?void 0:s.id,{phase:t,project:i,subphase:l,team_members:n}=Ra(),r=(n||[]).filter(e=>!(null!==e&&void 0!==e&&e.is_agent)&&!(null===e||void 0===e||!e.user)),o=e=>{let s=null;(null===i||void 0===i?void 0:i.challenge_data)&&i.challenge_data.forEach(e=>{e.phase===t&&e.subphase===l&&(s=e)});let a=s&&s.data&&s.data.reviews?s.data.reviews:{},n=[];for(const[t,i]of Object.entries(a)){let e=i&&i.values?i.values:{};Object.keys(e).length>=r.length&&n.push(Number.parseInt(t))}return n&&-1!==n.indexOf(e)};return(0,N.jsxs)(Ce.S,{className:"mb-5",children:[(0,N.jsxs)("div",{className:"overal-status-title d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.svy,{}),(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Teammate feedback completion status",id:"label.teammate_feedback_completion_statu.99a67ced"})})]}),(0,N.jsxs)("div",{className:"overall-status-text-background d-flex align-items-center gap-1",children:[(0,N.jsx)(jr,{path:"info_icon/info_icon_blue.svg",size:20}),(0,N.jsx)("small",{className:"fw-semibold",children:o(a)?(0,N.jsx)(ke.A,{defaultMessage:"You've just completed your feedback on your teammates. Once all your teammates have submitted you can submit the Reflect phase.",id:"label.youve_just_completed_your_feedback.419886a2"}):(0,N.jsx)(ke.A,{defaultMessage:"Please provide feedback for your team and/or yourself",id:"label.please_provide_feedback_for_your_t.8bccbd67"})})]}),(0,N.jsx)("div",{className:"mt-4",children:(0,N.jsx)(Qe.A,{className:"g-3",children:!(null===r||void 0===r||!r.length)&&r.map((e,s)=>{if(!e)return null;let{user:a}=e;if(!a)return null;let{id:t,fullname:i}=a;return i&&t?(0,N.jsx)(Ve.A,{lg:2,md:3,xs:12,children:(0,N.jsxs)("div",{className:"card card-body team-overall-status-profile box-shadow-100",children:[(0,N.jsx)(Ya,{style:{height:30,width:30},user:a}),(0,N.jsx)("small",{className:"font-weight-bold team-overall-name text-center",children:i}),o(t)?(0,N.jsx)(bo.A,{bg:"light",className:"overall-status-complete",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"danger",className:"overall-status-not-complete",children:(0,N.jsx)(ke.A,{defaultMessage:"Not completed",id:"label.not_completed.01925024"})})]})},`${s}-${t}`):null})})})]})};class Mb extends l.Component{constructor(e){super(e),this.handleSubmitReview=e=>{const{app:s,challenge:a}=this.props,{changePhaseData:t,getPhaseData:i,phase:l,setFourCSubPhaseComplete:n,subphase:r,team:o}=a,d=s.user.id;if(!d)return;const c=i(l,r);c.reviews&&"object"===typeof c.reviews||(c.reviews={}),c.reviews[d]={values:e};((null===o||void 0===o?void 0:o.members)||[]).filter(e=>!(null!==e&&void 0!==e&&e.is_agent)&&!(null===e||void 0===e||!e.user)).length<=(Object.keys(e)&&Object.keys(e).length)&&n(r),t(l,r,c)},this.handler=null}render(){const{app:e,challenge:s}=this.props,{getPhaseData:a,is_facilitator:t,phase:i,subphase:l}=s,{user:n}=e,r=a(i,l);let o=null===r||void 0===r?void 0:r.reviews,d=o&&o[n.id];return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-5-1",children:(0,N.jsx)(Uv,{el:this,onRef:e=>this.handler=e,phase:i,subphase:l,children:(0,N.jsx)(Tf,{show_example:!1,children:t?(0,N.jsx)(We.A,{className:"d-flex align-items-center justify-content-center p-5",variant:"warning",children:(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"This activity is for learners only, you are viewing as a facilitator.",id:"label.this_activity_is_for_learners_only.8dbb151b"})})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Cb,{}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"C1. Critical thinking",id:"label.c1_critical_thinking.f76666b2"})}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Q1. How well did everyone think critically?",id:"label.q1_how_well_did_everyone_think_cri.0700f229"})}),(0,N.jsx)(jb,{c:"critical",can_prev:!1,className:"mt-3",initial_values:d&&d.values,submit:this.handleSubmitReview})]})})})})}}var kb=(0,Ke.Ay)((0,P.G0)((0,Pe.y)(Fa(Mb))));class zb extends l.Component{constructor(e){super(e),this.handleSubmitReview=e=>{const{app:s,challenge:a}=this.props,{changePhaseData:t,getPhaseData:i,phase:l,setFourCSubPhaseComplete:n,subphase:r,team
2:o}=a,d=s.user.id;if(!d)return;const c=i(l,r);c.reviews&&"object"===typeof c.reviews||(c.reviews={}),c.reviews[d]={values:e};((null===o||void 0===o?void 0:o.members)||[]).filter(e=>!(null!==e&&void 0!==e&&e.is_agent)&&!(null===e||void 0===e||!e.user)).length<=(Object.keys(e)&&Object.keys(e).length)&&n(r),t(l,r,c)}}render(){const{app:e,challenge:s}=this.props,{getPhaseData:a,phase:t,subphase:i}=s,{user:l}=e,{is_facilitator:n}=s,r=a(t,i);let o=null===r||void 0===r?void 0:r.reviews,d=null===o||void 0===o?void 0:o[l.id];return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-5-2",children:(0,N.jsx)(Uv,{el:this,onRef:e=>this.handler=e,phase:t,subphase:i,children:(0,N.jsx)(Tf,{show_example:!1,children:n?(0,N.jsx)(We.A,{className:"d-flex align-items-center justify-content-center p-5",variant:"warning",children:(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"This activity is for learners only, you are viewing as a facilitator.",id:"label.this_activity_is_for_learners_only.8dbb151b"})})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Cb,{}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"C2. Communication",id:"label.c2_communication.48731913"})}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Q2. How well did everyone communicate?",id:"label.q2_how_well_did_everyone_communica.83781019"})}),(0,N.jsx)(jb,{c:"communication",className:"mt-3",initial_values:d&&d.values,submit:this.handleSubmitReview})]})})})})}}var Tb=(0,Ke.Ay)((0,P.G0)((0,Pe.y)(Fa(zb))));class Ib extends l.Component{constructor(e){super(e),this.handleSubmitReview=e=>{const{app:s,challenge:a}=this.props,{changePhaseData:t,getPhaseData:i,phase:l,setFourCSubPhaseComplete:n,subphase:r,team:o}=a,d=s.user.id;if(!d)return;const c=i(l,r);c.reviews&&"object"===typeof c.reviews||(c.reviews={}),c.reviews[d]={values:e};((null===o||void 0===o?void 0:o.members)||[]).filter(e=>!(null!==e&&void 0!==e&&e.is_agent)&&!(null===e||void 0===e||!e.user)).length<=(Object.keys(e)&&Object.keys(e).length)&&n(r),t(l,r,c)}}render(){const{app:e,challenge:s}=this.props,{getPhaseData:a,is_facilitator:t,phase:i,subphase:l}=s,{user:n}=e,r=a(i,l);let o=null===r||void 0===r?void 0:r.reviews,d=null===o||void 0===o?void 0:o[n.id];return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-5-3",children:(0,N.jsx)(Uv,{el:this,onRef:e=>this.handler=e,phase:i,subphase:l,children:(0,N.jsx)(Tf,{show_example:!1,children:t?(0,N.jsx)(We.A,{className:"d-flex align-items-center justify-content-center p-5",variant:"warning",children:(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"This activity is for learners only, you are viewing as a facilitator.",id:"label.this_activity_is_for_learners_only.8dbb151b"})})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Cb,{}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"C3. Collaboration",id:"label.c3_collaboration.0a9bbd1b"})}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Q3. How well did everyone collaborate?",id:"label.q3_how_well_did_everyone_collabora.2c915570"})}),(0,N.jsx)(jb,{c:"collaboration",className:"mt-3",initial_values:d&&d.values,submit:this.handleSubmitReview})]})})})})}}var Eb=(0,Ke.Ay)((0,P.G0)((0,Pe.y)(Fa(Ib))));class Fb extends l.Component{constructor(e){super(e),this.handleSubmitReview=e=>{const{app:s,challenge:a}=this.props,{changePhaseData:t,getPhaseData:i,phase:l,setFourCSubPhaseComplete:n,subphase:r,team:o}=a,d=s.user.id;if(!d)return;const c=i(l,r);c.reviews&&"object"===typeof c.reviews||(c.reviews={}),c.reviews[d]={values:e};((null===o||void 0===o?void 0:o.members)||[]).filter(e=>!(null!==e&&void 0!==e&&e.is_agent)&&!(null===e||void 0===e||!e.user)).length<=(Object.keys(e)&&Object.keys(e).length)&&n(r),t(l,r,c)}}render(){const{app:e,challenge:s}=this.props,{getPhaseData:a,is_facilitator:t,phase:i,subphase:l}=s,{user:n}=e,r=a(i,l);let o=null===r||void 0===r?void 0:r.reviews,d=null===o||void 0===o?void 0:o[n.id];return(0,N.jsx)(Ce.S,{className:"subphase-content challenge-5-4",children:(0,N.jsx)(Uv,{el:this,onRef:e=>{this.handler=e},phase:i,subphase:l,children:(0,N.jsx)(Tf,{show_example:!1,children:t?(0,N.jsx)(We.A,{className:"d-flex align-items-center justify-content-center p-5",variant:"warning",children:(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"This activity is for learners only, you are viewing as a facilitator.",id:"label.this_activity_is_for_learners_only.8dbb151b"})})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Cb,{}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"C4. Creativity",id:"label.c4_creativity.ad7122ac"})}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Q4. How well did everyone create?",id:"label.q4_how_well_did_everyone_create.fef8d81d"})}),(0,N.jsx)(jb,{c:"creativity",className:"mt-3",initial_values:d&&d.values,submit:this.handleSubmitReview})]})})})})}}var Rb=(0,Ke.Ay)((0,P.G0)((0,Pe.y)(Fa(Fb)))),Db={"1-1":v_,"1-2":N_,"1-3":M_,"1-4":Z_,"2-1":qf,"2-2":
2ab,"3-1":ib,"3-2":cb,"4-1":ub,"4-2":xb,"5-1":kb,"5-2":Tb,"5-3":Eb,"5-4":Rb};class Bb extends l.Component{constructor(e){super(e),this.getLane=()=>{var e;const{challenge:s}=this.props,a=s.getPhaseData(this.phase,this.subphase)||{};return Array.isArray(null===a||void 0===a||null===(e=a.share_lanes)||void 0===e?void 0:e[0])?a.share_lanes[0]:[]},this.getDecisionCard=e=>this.getLane().find(s=>(null===s||void 0===s?void 0:s.decision_type)===e)||null,this.handleChangeText=(e,s)=>{var a,t;const{app:i,challenge:l}=this.props,{changePhaseData:n,getPhaseData:r}=l;if(!l.canChangePhaseData())return;const o=e.currentTarget.value||"",d=r(this.phase,this.subphase);d.share_lanes=Array.isArray(d.share_lanes)?d.share_lanes:[],d.share_lanes[0]=Array.isArray(d.share_lanes[0])?d.share_lanes[0]:[];const c=d.share_lanes[0],h=c.findIndex(e=>(null===e||void 0===e?void 0:e.decision_type)===s);let u=null;var m,g,p;h>=0?(u=(0,T.clone)(c[h]),c[h]={id:(null===(m=c[h])||void 0===m?void 0:m.id)||(0,me.A)(),decision_type:s,text:o,updated_at:(new Date).getTime(),user:null===i||void 0===i||null===(g=i.user)||void 0===g?void 0:g.id}):c.push({id:(0,me.A)(),decision_type:s,text:o,updated_at:(new Date).getTime(),user:null===i||void 0===i||null===(p=i.user)||void 0===p?void 0:p.id});n(this.phase,this.subphase,d),null===(a=this.handler)||void 0===a||null===(t=a.revisions)||void 0===t||t.setFieldTimer(this.field_id,s,()=>{var e;const a=r(this.phase,this.subphase),t=((null===a||void 0===a||null===(e=a.share_lanes)||void 0===e?void 0:e[0])||[]).find(e=>(null===e||void 0===e?void 0:e.decision_type)===s);t&&(u&&(0,T.isEqual)((u.text||"").trim(),(t.text||"").trim())||this.handler.revisions.addChallengeDataHistory({action:u?"modify_share_card":"add_share_card",action_data:u?{after:t,before:u,lane:0}:{},data:{share:t},field_id:this.field_id,sub_field_id:t.id}))},5e3)},this.phase=3,this.subphase=1,this.field_id="share_lanes",this.handler=null}render(){const{app:e,challenge:s,intl:a}=this.props,{utils:t}=e,i=!s.canChangePhaseData(),l=a.formatMessage({id:"label.your_teams_rationale_for_this_path.9faf4ee0",defaultMessage:"Your team\u2019s rationale for this pathway (5-50 words)"});return(0,N.jsx)(Ce.S,{className:"subphase-content decision-board",children:(0,N.jsx)(Uv,{el:this,onRef:e=>this.handler=e,phase:this.phase,subphase:this.subphase,children:(0,N.jsx)(Tf,{children:(0,N.jsx)(Qe.A,{className:"g-3",children:Za.tM.map(e=>{var s;const a=this.getDecisionCard(e),n=(null===a||void 0===a?void 0:a.text)||"";return(0,N.jsx)(Ve.A,{lg:4,md:6,xs:12,children:(0,N.jsxs)(Ce.S,{className:"decision-slot border rounded h-100 d-flex flex-column bg-white shadow-sm overflow-hidden",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center flex-wrap gap-2 px-3 py-2 border-bottom",children:[(0,N.jsx)(bo.A,{bg:"primary",className:"fs-6 fw-semibold px-3 py-2",children:e}),Za.bT[e]&&(0,N.jsx)("span",{className:"text-muted small",children:Za.bT[e]})]}),(0,N.jsxs)(Ce.S,{className:"px-3 py-3 flex-grow-1 d-flex flex-column gap-2",children:[(0,N.jsx)(be.A,{"aria-label":e,as:"textarea",className:"flex-grow-1",disabled:i,onChange:s=>this.handleChangeText(s,e),placeholder:l,readOnly:i,rows:5,style:{minHeight:130},value:n}),(0,N.jsx)(Ce.S,{className:"align-self-end",children:(0,N.jsx)(Gf,{length:(null===t||void 0===t||null===(s=t.countWords)||void 0===s?void 0:s.call(t,n))||0,max:50,min:5})})]})]})},e)})})})})})}}var Pb=(0,P.G0)(Fa((0,Ke.Ay)(Bb))),Lb=(0,F.A)((0,F.A)({},Db),{},{"3-1":Pb}),Ob={"1-1":v_,"1-2":N_,"1-3":M_,"1-4":Z_,"2-1":qf,"2-2":ab,"3-1":ib,"3-2":cb,"4-1":ub,"4-2":xb,"5-1":kb,"5-2":Tb,"5-3":Eb,"5-4":Rb};var Hb=()=>{const e="criteria",s=(0,l.useRef)(null),a=(0,ja.A)(),{canChangePhaseData:t,changePhaseData:i,getPhaseData:n}=Ra(),[r,o]=(0,l.useState)(""),d=!t(),c=n(4,1)||{},h=(null===c||void 0===c?void 0:c[e])||[],u=h.reduce((e,s)=>e+(s.weight||0),0),m=100===u,g=()=>{if(!r.trim()||h.length>=7)return;const s={id:(0,me.A)(),name:r.trim(),weight:0};i(4,1,(0,F.A)((0,F.A)({},c),{},{[e]:[...h,s]})),o("")};return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-criteria-development",children:(0,N.jsx)(Uv,{el:{phase:4,subphase:1},onRef:e=>s.current=e,phase:4,subphase:1,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Define 5-7 evaluation criteria and assign weights that total exactly 100%. These criteria will be used to objectively score your top solutions in the Evaluation Grid.",id:"label.define_5_7_evaluation_criteria_and.ec4dea02"})})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Evaluation criteria",id:"label.evaluation_criteria.f797d0e1"})}),(0,N.jsx)("hr",{className:"my-3"}),(0,N.jsxs)("div",{className:"fpsi-criteria-list",children:[h.map((s,a)=>(0,N.jsxs)("div",{className:"fpsi-criteria-item",children:[(0,N.jsx)("span",{className:"fpsi-criteria-name",children:s.name}),(0,N.jsxs)("div",{className:"fpsi-weight-group",children:[(0,N.jsx)("input",{className:"fpsi-weight-slider",disabled:d,max:100,min:0,onChange:s=>((s,a)=>{const t=Math.max(0,Math.min(100,Number(a)||0)),l=h.map((e,a)=>a===s?(0,F.A)((0,F.A)({},e),{},{weight:t}):e);i(4,1,(0,F.A)((0,F.A)({},c),{},{[e]:l}))})(a,s.target.value),type:"range",value:s.weight}),(0,N.jsxs)("span",{className:"fpsi-weight-value",children:[s.weight,"%"]})]}
2),!d&&(0,N.jsx)(ve.A,{className:"fpsi-card-remove p-0",onClick:()=>(s=>{const a=h.filter((e,a)=>a!==s);i(4,1,(0,F.A)((0,F.A)({},c),{},{[e]:a}))})(a),size:"sm",style:{position:"static"},variant:"link",children:(0,N.jsx)(ze.qbC,{size:12})})]},s.id||a)),(0,N.jsxs)("div",{className:"fpsi-weight-total",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Total:",id:"label.total.18e872be"})}),(0,N.jsxs)("span",{className:"fpsi-total-value "+(m?"valid":"invalid"),children:[u,"%"]})]})]}),!m&&h.length>0&&(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:"warning",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Weights must total exactly 100%. Currently: {total}%",id:"label.weights_must_total_exactly_100perc.dda59c07",values:{total:u}})})]}),!d&&h.length<7&&(0,N.jsxs)(Ce.S,{className:"d-flex gap-2 align-items-end",children:[(0,N.jsxs)(_e.A.Group,{className:"flex-grow-1",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"New criterion",id:"label.new_criterion.c2c996bf"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>o(e.target.value),onKeyDown:e=>"Enter"===e.key&&g(),placeholder:a.formatMessage({id:"label.criterion_name.1218df84",defaultMessage:"Criterion name..."}),value:r})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",disabled:!r.trim(),onClick:g,variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add",id:"label.add.9fd728c6"})})]})]})]})})]})})})};const Ub=[{icon:"\ud83d\udd0d",key:"research_analysis",label:"Research & Analysis"},{icon:"\ud83e\udde0",key:"critical_thinking",label:"Critical Thinking"},{icon:"\ud83d\udcca",key:"analytical_categorization",label:"Analytical Categorization"}],Qb=e=>{let{competencies:s,feedback:a,overall:t,phase_tag:i,scores:l,title:n}=e;return(0,N.jsxs)("div",{className:"fpsi-eval-panel",children:[(0,N.jsxs)("div",{className:"fpsi-eval-panel-header",children:[(0,N.jsx)("span",{className:"fpsi-panel-icon",children:"\ud83d\udccb"}),(0,N.jsx)("h3",{children:n}),(0,N.jsx)("span",{className:"fpsi-phase-tag",children:i})]}),(0,N.jsxs)("div",{className:"fpsi-eval-panel-body",children:[s.map(e=>(0,N.jsxs)("div",{className:"fpsi-competency-row",children:[(0,N.jsx)("div",{className:"fpsi-comp-icon",children:e.icon}),(0,N.jsxs)("div",{className:"fpsi-comp-info",children:[(0,N.jsx)("div",{className:"fpsi-comp-name",children:e.label}),(0,N.jsx)("div",{className:"fpsi-eval-bar",children:(0,N.jsx)("div",{className:"fpsi-eval-fill",style:{width:`${l[e.key]||0}%`}})})]}),(0,N.jsxs)("div",{className:"fpsi-comp-score",children:[(0,N.jsx)("div",{className:"fpsi-score-value",children:l[e.key]||0}),(0,N.jsx)("div",{className:"fpsi-score-label",children:"/ 100"})]})]},e.key)),(0,N.jsxs)("div",{className:"fpsi-overall-score",children:[(0,N.jsx)("div",{className:"fpsi-overall-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Overall score",id:"label.overall_score.27815c9b"})}),(0,N.jsx)("div",{className:"fpsi-overall-value",children:Math.round(t)})]}),a&&(0,N.jsx)("div",{className:"fpsi-eval-summary",children:(0,N.jsx)("p",{children:a})})]})]})};var Vb=()=>{const e=(0,l.useRef)(null),{getPhaseData:s}=Ra(),a=s(1,4)||{},t=(null===a||void 0===a?void 0:a.scores)||{},i=Ub.reduce((e,s)=>e+(t[s.key]||0),0)/(Ub.length||1);return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-discover-checkpoint",children:(0,N.jsx)(Uv,{el:{phase:1,subphase:4},onRef:s=>e.current=s,phase:1,subphase:4,children:(0,N.jsx)(Tf,{children:(0,N.jsx)(Ge.A,{className:"activity-card overflow-hidden",children:(0,N.jsx)(Qb,{competencies:Ub,feedback:null===a||void 0===a?void 0:a.feedback,overall:i,phase_tag:"Phase 1",scores:t,title:"Discover Checkpoint"})})})})})};const Gb=["Low","Medium","High"];var Wb=()=>{const e="solutions",s=(0,l.useRef)(null),a=(0,ja.A)(),{canChangePhaseData:t,changePhaseData:i,getPhaseData:n}=Ra(),r={addresses_up:"",description:"",feasibility:"Medium",title:""},[o,d]=(0,l.useState)((0,F.A)({},r)),[c,h]=(0,l.useState)(!1),u=!t(),m=n(3,1)||{},g=(null===m||void 0===m?void 0:m[e])||[],p=(e,s)=>d(a=>(0,F.A)((0,F.A)({},a),{},{[e]:s})),x=g.length>=8;return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-solution-generation",children:(0,N.jsx)(Uv,{el:{phase:3,subphase:1},onRef:e=>s.current=e,phase:3,subphase:1,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm as many solutions as possible \u2014 do not self-censor! Quantity breeds quality. Each solution should include a title, description, how it addresses the underlying problem, and a feasibility rating. Aim for at least 8 solutions.",id:"label.brainstorm_as_many_solutions_as_po.d2f88217"})})]})}),(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:x?"success":"warning",children:[x?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:x?a.formatMessage({id:"label.count_solutions_added_requirement.83592472",defaultMessage:"{count} solutions added \u2014 requirement met."},{count:g.length}):a.formatMessage({id:"label.minimum_min_solutions_required_cou.e5c89c27",defaultMessage:"Minimum {min} solutions required ({count} of {min} added)"},{count:g.length,min:8})})]}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Your solutions",id:"label.your_solutions.44aa971a"})}),(0,N.jsx)("span",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"25-35 min",id:"label.25_35_min.eeeabb1d"})})]}),(0,N.jsx)("hr",{className:"my-3"}),!u&&!c&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 align-self-start",onClick:()=>h(!0),variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add solution",id:"label.add_solution.3fec7ded"})})]}),c&&(0,N.jsx)(Ge.A,{className:"bg-light mb-3",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:"Solution Title"}),(0,N.jsx)(_e.A.Control,{onChange:e=>p("title",e.target.value),placeholder:"Name your solution...",value:o.title})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:"Description"}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>p("description",e.target.value),placeholder:"Describe how this solution works...",rows:3,value:o.description})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:"How does this address the UP?"}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>p("addresses_up",e.target.value),placeholder:"Connect this solution to your UP statement...",rows:2,value:o.addresses_up})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:"Feasibility"}),(0,N.jsx)(_e.A.Select,{onChange:e=>p("feasibility",e.target.value),value:o.feasibility,children:Gb.map(e=>(0,N.jsx)("option",{value:e,children:e},e))})]}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 flex-grow-1",disabled:!o.title.trim()||!o.description.trim(),onClick:()=>
2{if(!o.title.trim()||!o.description.trim())return;const s=(0,F.A)({id:(0,me.A)()},o),a=[...g,s];i(3,1,(0,F.A)((0,F.A)({},m),{},{[e]:a})),d((0,F.A)({},r)),h(!1)},variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Save solution",id:"label.save_solution.7bc7a678"})})]}),(0,N.jsx)(ve.A,{onClick:()=>{h(!1),d((0,F.A)({},r))},variant:"outline-secondary",children:"Cancel"})]})]})}),(0,N.jsxs)("div",{className:"fpsi-solution-cards",children:[g.map((s,a)=>{var t;return(0,N.jsxs)("div",{className:"fpsi-solution-card",children:[(0,N.jsxs)("div",{className:"fpsi-solution-number",children:["Solution ",a+1]}),!u&&(0,N.jsx)(ve.A,{className:"fpsi-card-remove p-0",onClick:()=>(s=>{const a=g.filter((e,a)=>a!==s);i(3,1,(0,F.A)((0,F.A)({},m),{},{[e]:a}))})(a),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{size:12})}),(0,N.jsx)("h4",{children:s.title}),(0,N.jsx)("p",{children:s.description}),s.addresses_up&&(0,N.jsx)("p",{style:{color:"#888",fontSize:12},children:s.addresses_up}),(0,N.jsx)("span",{className:`fpsi-feasibility ${null===(t=s.feasibility)||void 0===t?void 0:t.toLowerCase()}`,children:s.feasibility})]},s.id||a)}),!u&&!c&&(0,N.jsxs)("div",{className:"fpsi-add-card-placeholder",onClick:()=>h(!0),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(!0)},role:"button",tabIndex:0,children:[(0,N.jsx)("div",{className:"fpsi-plus",children:"+"}),(0,N.jsx)("div",{children:"Add solution"})]})]})]})})]})})})};var Kb=()=>{const e=(0,l.useRef)(null),s=(0,ja.A)(),{canChangePhaseData:a,changePhaseData:t,getPhaseData:i}=Ra(),n=!a(),r=i(2,1)||{},o=i(1,2)||{},d=(null===o||void 0===o?void 0:o.challenge_statements)||[],c=i(1,3)||{},h=(null===c||void 0===c?void 0:c.selected_cluster)||"",u=(e,s)=>{t(2,1,(0,F.A)((0,F.A)({},r),{},{[e]:s}))},m=(null===r||void 0===r?void 0:r.given_that)||"",g=(null===r||void 0===r?void 0:r.how_might_we)||"",p=(null===r||void 0===r?void 0:r.so_that)||"",x=m.trim()&&g.trim()&&p.trim(),v=x?`Given that ${m}, how might we ${g}, so that ${p}?`:"";return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-underlying-problem",children:(0,N.jsx)(Uv,{el:{phase:2,subphase:1},onRef:s=>e.current=s,phase:2,subphase:1,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"The underlying problem (UP) is the heart of FPSI problem-solving. Using your research and clustered challenges from the Discover phase, draft an underlying problem statement using the template below. A strong UP identifies the key condition, proposes a desired outcome, and articulates the intended impact.",id:"label.the_underlying_problem_up_is_the_h.996a70cd"})})]})}),d.length>0&&(0,N.jsxs)("div",{className:"fpsi-discover-summary",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Your Top Challenges (from Discover)",id:"label.your_top_challenges_from_discover.d227d3d2"})}),(0,N.jsx)("ul",{children:d.slice(0,5).map((e,s)=>(0,N.jsx)("li",{children:e.statement},e.id||s))}),h&&(0,N.jsxs)("div",{className:"fpsi-critical-cluster",children:[(0,N.jsx)(ke.A,{defaultMessage:"Most Critical Cluster:",id:"label.most_critical_cluster.56a29c32"})," ",(0,N.jsx)("span",{children:h})]})]}),(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:x?"success":"warning",children:[x?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:x?s.formatMessage({id:"label.problem_statement_complete_all_thr.a59a418f",defaultMessage:"Problem statement complete \u2014 all three sections filled"}):s.formatMessage({id:"label.problem_statement_must_follow_the.dadbc854",defaultMessage:"Problem statement must follow the template format (all three sections required)"})})]}),(0,N.jsxs)("div",{className:"fpsi-up-template",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Underlying problem template",id:"label.underlying_problem_template.4baee22d"})}),(0,N.jsxs)("div",{className:"fpsi-up-segment",children:[(0,N.jsx)("label",{children:(0,N.jsx)(ke.A,{defaultMessage:"GIVEN THAT...",id:"label.given_that.76db4211"})}),(0,N.jsx)("div",{className:"fpsi-prompt-text",children:(0,N.jsx)(ke.A,{defaultMessage:"(Describe the key condition from your research)",id:"label.describe_the_key_condition_from_yo.ce0d0dfa"})}),(0,N.jsx)("textarea",{disabled:n,onChange:e=>u("given_that",e.target.value),placeholder:s.formatMessage({id:"label.describe_the_situation_or_context.ac94e3fb",defaultMessage:"Describe the situation or context..."}),rows:3,value:m})]}),(0,N.jsxs)("div",{className:"fpsi-up-segment",children:[(0,N.jsx)("label",{children:(0,N.jsx)(ke.A,{defaultMessage:"HOW MIGHT WE...",id:"label.how_might_we.39e6b5bc"})}),(0,N.jsx)("div",{className:"fpsi-prompt-text",children:(0,N.jsx)(ke.A,{defaultMessage:"(State the desired outcome)",id:"label.state_the_desired_outcome.a0570530"})}),(0,N.jsx)("textarea",{disabled:n,onChange:e=>u("how_might_we",e.target.value),placeholder:s.formatMessage({id:"label.frame_the_action_or_intervention.ce0917a4",defaultMessage:"Frame the action or intervention..."}),rows:2,value:g})]}),(0,N.jsxs)("div",{className:"fpsi-up-segment",children:[(0,N.jsx)("label",{children:(0,N.jsx)(ke.A,{defaultMessage:"SO THAT...",id:"label.so_that.6419a13e"})}),(0,N.jsx)("div",{className:"fpsi-prompt-text",children:(0,N.jsx)(ke.A,{defaultMessage:"(Articulate the intended impact)",id:"label.articulate_the_intended_impact.3a9ff50e"})}),(0,N.jsx)("textarea",{disabled:n,onChange:e=>u("so_that",e.target.value),placeholder:s.formatMessage({id:"label.describe_the_desired_outcome.b6cac1a2",defaultMessage:"Describe the desired outcome..."}),rows:3,value:p})]}),v&&(0,N.jsx)("div",{className:"fpsi-up-preview",children:(0,N.jsx)("p",{children:(0,N.jsx)("em",{children:v})})}),!v&&(0,N.jsx)("div",{className:"fpsi-up-preview",style:{opacity:.5},children:(0,N.jsx)("p",{children:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"Fill in all three sections above to see the combined statement.",id:"label.fill_in_all_three_sections_above_t.2321a680"})})})})]})]})})})};const Yb=[{icon:"\ud83c\udfaf",key:"problem_framing",label:"Problem Framing"},{icon:"\ud83d\udcac",key:"communication",label:"Communication"}];var qb=()=>{const e=(0,l.useRef)(null),{getPhaseData:s}=Ra(),a=s(2,2)||{},t=(null===a||void 0===a?void 0:a.scores)||{},i=Yb.reduce((e,s)=>e+(t[s.key]||0),0)/(Yb.length||1);return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-explore-checkpoint",children:(0,N.jsx)(Uv,{el:{phase:2,subph
2ase:2},onRef:s=>e.current=s,phase:2,subphase:2,children:(0,N.jsx)(Tf,{children:(0,N.jsx)(Ge.A,{className:"activity-card overflow-hidden",children:(0,N.jsx)(Qb,{competencies:Yb,feedback:null===a||void 0===a?void 0:a.feedback,overall:i,phase_tag:"Phase 2",scores:t,title:"Explore Checkpoint"})})})})})};const Jb=[{icon:"\ud83d\udca1",key:"creative_thinking",label:"Creative Thinking"},{icon:"\ud83e\udd1d",key:"collaboration",label:"Collaboration"}];var Xb=()=>{const e=(0,l.useRef)(null),{getPhaseData:s}=Ra(),a=s(3,3)||{},t=(null===a||void 0===a?void 0:a.scores)||{},i=Jb.reduce((e,s)=>e+(t[s.key]||0),0)/(Jb.length||1);return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-imagine-checkpoint",children:(0,N.jsx)(Uv,{el:{phase:3,subphase:3},onRef:s=>e.current=s,phase:3,subphase:3,children:(0,N.jsx)(Tf,{children:(0,N.jsx)(Ge.A,{className:"activity-card overflow-hidden",children:(0,N.jsx)(Qb,{competencies:Jb,feedback:null===a||void 0===a?void 0:a.feedback,overall:i,phase_tag:"Phase 3",scores:t,title:"Imagine Checkpoint"})})})})})};const Zb=[{key:"collaboration",label:"Collaboration"},{key:"communication",label:"Communication"},{key:"time_management",label:"Time Management"},{key:"quality_of_work",label:"Quality of Work"}],$b=[{icon:"\ud83d\udd0d",key:"research_analysis",label:"Research & Analysis"},{icon:"\ud83e\udde0",key:"critical_thinking",label:"Critical Thinking"},{icon:"\ud83d\udca1",key:"creative_problem_solving",label:"Creative Problem Solving"},{icon:"\ud83d\udcca",key:"analytical_decision_making",label:"Analytical Decision Making"},{icon:"\ud83d\udcac",key:"communication",label:"Communication"},{icon:"\ud83e\udd1d",key:"collaboration",label:"Collaboration"}],eA=[1,2,3,4,5];var sA=()=>{const e=(0,l.useRef)(null),s=(0,ja.A)(),{canChangePhaseData:a,changePhaseData:t,getPhaseData:i}=Ra(),n=!a(),r=i(5,2)||{},o=(null===r||void 0===r?void 0:r.reflections)||{},d=(null===r||void 0===r?void 0:r.team_ratings)||{},c=(null===r||void 0===r?void 0:r.final_scores)||{},h=(e,s)=>{const a=(0,F.A)((0,F.A)({},o),{},{[e]:s});t(5,2,(0,F.A)((0,F.A)({},r),{},{reflections:a}))},u=Object.keys(c).length>0,m=$b.reduce((e,s)=>e+(c[s.key]||0),0)/($b.length||1);return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-team-retrospective",children:(0,N.jsx)(Uv,{el:{phase:5,subphase:2},onRef:s=>e.current=s,phase:5,subphase:2,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Reflect on your team's journey through the FPSI process. Consider what worked well, what could be improved, and what you learned. Then rate your team's performance in key areas.",id:"label.reflect_on_your_teams_journey_thro.6180b0d9"})})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"What worked well?",id:"label.what_worked_well.d81efaf9"})}),(0,N.jsx)("p",{className:"text-muted small mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Reflect on the strengths of your team's process and collaboration.",id:"label.reflect_on_the_strengths_of_your_t.d6b2b4d4"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:n,onChange:e=>h("worked_well",e.target.value),placeholder:s.formatMessage({id:"label.describe_what_went_well_for_your_t.0c862720",defaultMessage:"Describe what went well for your team..."}),rows:4,value:(null===o||void 0===o?void 0:o.worked_well)||""})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"What would you do differently?",id:"label.what_would_you_do_differently.9f1f3a47"})}),(0,N.jsx)("p",{className:"text-muted small mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Consider what changes would improve the process if you could start over.",id:"label.consider_what_changes_would_improv.a237b778"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:n,onChange:e=>h("differently",e.target.value),placeholder:s.formatMessage({id:"label.what_changes_would_improve_the_pro.36a1d091",defaultMessage:"What changes would improve the process?"}),rows:4,value:(null===o||void 0===o?void 0:o.differently)||""})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Key learnings",id:"label.key_learnings.9e45dc4b"})}),(0,N.jsx)("p",{className:"text-muted small mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"What are the most important takeaways from this experience?",id:"label.what_are_the_most_important_takeaw.6250d91d"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:n,onChange:e=>h("key_learnings",e.target.value),placeholder:s.formatMessage({id:"label.what_are_the_most_important_takeaw.80739089",defaultMessage:"What are the most important takeaways?"}),rows:4,value:(null===o||void 0===o?void 0:o.key_learnings)||""})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Team performance ratings",id:"label.team_performance_ratings.b99cc0a4"})}),Zb.map(e=>(0,N.jsxs)("div",{className:"fpsi-rating-scale",children:[(0,N.jsx)("label",{children:(0,N.jsx)(ke.A,{defaultMessage:e.label,id:`fpsi.retrospective.rating.${e.key}`})}),(0,N.jsx)("div",{className:"fpsi-scale-options",children:eA.map(s=>(0,N.jsx)("button",{className:"fpsi-scale-btn "+(d[e.key]===s?"active":""),disabled:n,onClick:()=>
2!n&&((e,s)=>{const a=(0,F.A)((0,F.A)({},d),{},{[e]:Number(s)});t(5,2,(0,F.A)((0,F.A)({},r),{},{team_ratings:a}))})(e.key,s),children:s},s))})]},e.key))]})}),u&&(0,N.jsx)(Qb,{competencies:$b,feedback:null,overall:m,phase_tag:s.formatMessage({id:"label.final.f4ed8fa6",defaultMessage:"Final"}),scores:c,title:s.formatMessage({id:"label.final_competency_assessment.ec427f2b",defaultMessage:"Final competency assessment"})})]})})})};var aA=()=>{const e="challenge_statements",s=(0,l.useRef)(null),a=(0,ja.A)(),{canChangePhaseData:t,changePhaseData:i,getPhaseData:n}=Ra(),r={cause:"",citation:"",consequence:"",effect:"",statement:""},[o,d]=(0,l.useState)((0,F.A)({},r)),[c,h]=(0,l.useState)(!1),u=!t(),m=n(1,2)||{},g=(null===m||void 0===m?void 0:m[e])||[],p=(e,s)=>d(a=>(0,F.A)((0,F.A)({},a),{},{[e]:s})),x=g.length>=5;return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-challenge-builder",children:(0,N.jsx)(Uv,{el:{phase:1,subphase:2},onRef:e=>s.current=e,phase:1,subphase:2,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Using your research, create challenge statements that describe specific problems within the scenario. Each challenge should include a clear statement, its root cause, the effect on stakeholders, the broader consequence, and a citation. You need at least 5 challenges to proceed.",id:"label.using_your_research_create_challen.dbdc284d"})})]})}),(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:x?"success":"warning",children:[x?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:x?a.formatMessage({id:"label.count_challenge_cards_added_requir.3c41aa22",defaultMessage:"{count} challenge cards added \u2014 requirement met. You may proceed."},{count:g.length}):a.formatMessage({id:"label.minimum_min_challenges_required_co.8a72cd45",defaultMessage:"Minimum {min} challenges required ({count} of {min} added)"},{count:g.length,min:5})})]}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Your challenges",id:"label.your_challenges.902a1ee3"})}),(0,N.jsx)("span",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"20-30 min",id:"label.20_30_min.ed313785"})})]}),(0,N.jsx)("hr",{className:"my-3"}),!u&&!c&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 align-self-start",onClick:()=>h(!0),variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add challenge",id:"label.add_challenge.ff9c42f1"})})]}),c&&(0,N.jsx)(Ge.A,{className:"bg-light mb-3",children:(0,N.jsxs)(Ge.A.Body,{children:[[{key:"statement",label:"Challenge Statement",placeholder:"Describe the specific challenge...",rows:2},{key:"cause",label:"Cause",placeholder:"What is the root cause?",rows:2},{key:"effect",label:"Effect",placeholder:"Who is affected and how?",rows:2},{key:"consequence",label:"Consequence",placeholder:"What is the broader consequence?",rows:2},{key:"citation",label:"Citation",placeholder:"e.g. Future Scene, Key Fact 2",rows:1}].map(e=>(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:e.label}),e.rows>1?(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:s=>p(e.key,s.target.value),placeholder:e.placeholder,rows:e.rows,value:o[e.key]}):(0,N.jsx)(_e.A.Control,{onChange:s=>p(e.key,s.target.value),placeholder:e.placeholder,value:o[e.key]})]},e.key)),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 flex-grow-1",disabled:!o.statement.trim(),onClick:()=>{if(!o.statement.trim())return;const s=(0,F.A)({id:(0,me.A)()},o),a=[...g,s],t=(0,F.A)((0,F.A)({},m),{},{[e]:a});i(1,2,t),d((0,F.A)({},r)),h(!1)},variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Save challenge",id:"label.save_challenge.929686c1"})})]}),(0,N.jsx)(ve.A,{onClick:()=>{h(!1),d((0,F.A)({},r))},variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})})]})]})}),(0,N.jsxs)("div",{className:"fpsi-challenge-cards",children:[g.map((s,t)=>(0,N.jsxs)("div",{className:"fpsi-challenge-card",children:[(0,N.jsx)("div",{className:"fpsi-card-number",children:a.formatMessage({id:"label.challenge_num.0d65de91",defaultMessage:"Challenge {num}"},{num:t+1})}),!u&&(0,N.jsx)(ve.A,{className:"fpsi-card-remove p-0",onClick:()=>(s=>{const a=g.filter((e,a)=>a!==s),t=(0,F.A)((0,F.A)({},m),{},{[e]:a});i(1,2,t)})(t),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{size:12})}),(0,N.jsxs)("div",{className:"fpsi-field-group",children:[(0,N.jsx)("div",{className:"fpsi-field-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge statement",id:"label.challenge_statement.85ddafbd"})}),(0,N.jsx)("div",{className:"fpsi-field-value",children:s.statement})]}),s.cause&&(0,N.jsxs)("div",{className:"fpsi-field-group",children:[(0,N.jsx)("div",{className:"fpsi-field-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Cause",id:"label.cause.7ba6317a"})}),(0,N.jsx)("div",{className:"fpsi-field-value",children:s.cause})]}),s.effect&&(0,N.jsxs)("div",{className:"fpsi-field-group",children:[(0,N.jsx)("div",{className:"fpsi-field-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Effect",id:"label.effect.2252d5cf"})}),(0,N.jsx)("div",{className:"fpsi-field-value",children:s.effect})]}),s.consequence&&(0,N.jsxs)("div",{className:"fpsi-field-group",children:[(0,N.jsx)("div",{className:"fpsi-field-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Consequence",id:"label.consequence.792d3730"})}),(0,N.jsx)("div",{className:"fpsi-field-value",children:s.consequence})]}),s.citation&&(0,N.jsxs)("div",{className:"fpsi-field-group",children:[(0,N.jsx)("div",{className:"fpsi-field-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Citation",id:"label.citation.2955789a"})}),(0,N.jsx)("div",{className:"fpsi-field-value",children:s.citation})]})]},s.id||t)),!u&&!c&&(0,N.jsxs)("div",{className:"fpsi-add-card-placeholder",onClick:()=>h(!0),role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||h(!0)},children:[(0,N.jsx)("div",{className:"fpsi-plus",children:"+"}),(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add challenge",id:"label.add_challenge.ff9c42f1"})})]})]})]})})]})})})};const tA=[{icon:"\ud83d\udcd0",key:"analytical_thinking",label:"Analytical Thinking"},{icon:"\u2696\ufe0f",key:"decision_making",label:"Decision Making"}];var iA=()=>{const e=(0,l.useRef)(null),{getPhaseData:s}=Ra(),a=s(4,4)||{},t=(null===a||void 0===a?void 0:a.scores)||{},i=tA.reduce((e,s)=>e+(t[s.key]||0),0)/(tA.length||1);return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-create-checkpoint",children:(0,N.jsx)(Uv,{el:{phase:4,subphase:4},onRef:s=>e.current=s,phase:4,subphase:4,children:(0,N.jsx)(Tf,{children:(0,N.jsx)(Ge.A,{className:"activity-card overflow-hidden",children:(0,N.jsx)(Qb,{competencies:tA,feedback:null===a||void 0===a?void 0:a.feedback,overall:i,phase_tag:"Phase 4",scores:t,title:"Create Checkpoint"})})})})})};var lA=()=>{const e=(0,l.useRef)(null),{canChangePhaseData:s,changePhaseData:a,getPhaseData:t}=Ra(),i=!s(),n=t(4,2)||{},r=(null===n||void 0===n?void 0:n.grid_scores)||{},o=t(4,1)||{},d=(null===o||void 0===o?void 0:o.criteria)||[],c=t(3,2)||{},h=(null===c||void 0===c?void 0:c.selected_solutions)||[],u=t(3,1)||{},m=((null===u||void 0===u?void 0:u.solutions)||[]).filter(e=>h.includes(e.id)),g=e=>{const s=r[e]||{};let a=0,t=0;
2return d.forEach(e=>{const i=s[e.id]||0,l=(e.weight||0)/100;a+=i*l,t+=l}),t>0?a.toFixed(2):"-"};let p=null,x=-1;m.forEach(e=>{const s=Number.parseFloat(g(e.id));!isNaN(s)&&s>x&&(x=s,p=e.id)});const v=[1,2,3,4,5];return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-evaluation-grid",children:(0,N.jsx)(Uv,{el:{phase:4,subphase:2},onRef:s=>e.current=s,phase:4,subphase:2,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Score each solution (1-5) against each criterion. Weighted totals are calculated automatically. The solution with the highest weighted total becomes your recommended winner.",id:"label.score_each_solution_1_5_against_ea.c3f6a4f0"})})]})}),(0===m.length||0===d.length)&&(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:"warning",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Complete Criteria Development and Peer Review first.",id:"label.complete_criteria_development_and.dfa3524f"})})]}),m.length>0&&d.length>0&&(0,N.jsxs)("table",{className:"fpsi-eval-grid",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solution",id:"label.solution.22927695"})}),d.map(e=>(0,N.jsxs)("th",{children:[e.name,(0,N.jsx)("br",{}),(0,N.jsxs)("span",{style:{fontWeight:400,opacity:.7},children:["(",e.weight,"%)"]})]},e.id)),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Total",id:"label.total.c9b3c382"})})]})}),(0,N.jsx)("tbody",{children:m.map(e=>{const s=e.id===p;return(0,N.jsxs)("tr",{className:s?"fpsi-winner-row":"",children:[(0,N.jsxs)("td",{children:[e.title,s&&(0,N.jsx)("span",{className:"fpsi-winner-badge",children:"Winner"})]}),d.map(s=>{var t;return(0,N.jsx)("td",{className:"fpsi-score-cell",children:(0,N.jsxs)("select",{disabled:i,onChange:t=>((e,s,t)=>{const i=r[e]||{},l=(0,F.A)((0,F.A)({},r),{},{[e]:(0,F.A)((0,F.A)({},i),{},{[s]:Number(t)})});a(4,2,(0,F.A)((0,F.A)({},n),{},{grid_scores:l}))})(e.id,s.id,t.target.value),value:(null===(t=r[e.id])||void 0===t?void 0:t[s.id])||"",children:[(0,N.jsx)("option",{value:"",children:"-"}),v.map(e=>(0,N.jsx)("option",{value:e,children:e},e))]})},s.id)}),(0,N.jsx)("td",{className:"fpsi-total-cell",children:g(e.id)})]},e.id)})})]})]})})})};var nA=()=>{const e=(0,l.useRef)(null),s=(0,ja.A)(),{canChangePhaseData:a,changePhaseData:t,getPhaseData:i}=Ra(),n=!a(),r=i(4,3)||{},o=(e,s)=>{t(4,3,(0,F.A)((0,F.A)({},r),{},{[e]:s}))};return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-reflection-gate",children:(0,N.jsx)(Uv,{el:{phase:4,subphase:3},onRef:s=>e.current=s,phase:4,subphase:3,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Before moving forward, reflect on your evaluation grid results. This step bridges quantitative analysis with qualitative judgment \u2014 the numbers inform your thinking, but your team's insight matters too.",id:"label.before_moving_forward_reflect_on_y.e65cccbf"})})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Does the grid winner match your team's instinct?",id:"label.does_the_grid_winner_match_your_te.1531d8a0"})}),(0,N.jsx)("p",{className:"text-muted small mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Compare the quantitative results with your team's gut feeling. If they differ, explore why.",id:"label.compare_the_quantitative_results_w.d75da7ba"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:n,onChange:e=>o("match_instinct",e.target.value),placeholder:s.formatMessage({id:"label.reflect_on_whether_the_numbers_ali.95926e01",defaultMessage:"Reflect on whether the numbers align with your judgment..."}),rows:4,value:(null===r||void 0===r?void 0:r.match_instinct)||""})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"What would you change about your criteria?",id:"label.what_would_you_change_about_your_c.91034e5
27"})}),(0,N.jsx)("p",{className:"text-muted small mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Consider how different criteria or weights might change the outcome. What did you learn from this process?",id:"label.consider_how_different_criteria_or.f51f335f"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:n,onChange:e=>o("change_criteria",e.target.value),placeholder:s.formatMessage({id:"label.consider_how_different_criteria_or.becffcc2",defaultMessage:"Consider how different criteria or weights might change the outcome..."}),rows:4,value:(null===r||void 0===r?void 0:r.change_criteria)||""})]})})]})})})};const rA=["Social","Economic","Environmental","Political","Technological"];var oA=()=>{const e=(0,l.useRef)(null),s=(0,ja.A)(),{canChangePhaseData:a,changePhaseData:t,getPhaseData:i}=Ra(),n=!a(),r=i(1,3)||{},o=(null===r||void 0===r?void 0:r.clusters)||{},d=(null===r||void 0===r?void 0:r.selected_cluster)||"",c=i(1,2)||{},h=(null===c||void 0===c?void 0:c.challenge_statements)||[],u=e=>h.filter(s=>o[s.id]===e),m=h.filter(e=>!o[e.id]||!rA.includes(o[e.id])),g=h.length>0&&0===m.length,p={};return rA.forEach(e=>{p[e]=u(e).length}),(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-cluster-board-page",children:(0,N.jsx)(Uv,{el:{phase:1,subphase:3},onRef:s=>e.current=s,phase:1,subphase:3,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Drag your challenge cards into categories to identify patterns and connections. The five categories represent different dimensions of the problem: Social, Economic, Environmental, Political, and Technological. Some challenges may fit multiple categories \u2014 place them where they have the most impact. Identify which cluster is most critical.",id:"label.drag_your_challenge_cards_into_cat.c9cf38a6"})})]})}),0===h.length&&(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:"warning",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"No challenge statements found. Complete the Challenge Builder first.",id:"label.no_challenge_statements_found_comp.056e8414"})})]}),h.length>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:g?"success":"warning",children:[g?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:g?s.formatMessage({id:"label.all_challenges_categorized_require.c660e862",defaultMessage:"All challenges categorized \u2014 requirement met."}):s.formatMessage({id:"label.count_challenges_still_need_to_be.cbcea6d6",defaultMessage:"{count} challenge(s) still need to be categorized."},{count:m.length})})]}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Cluster board",id:"label.cluster_board.ee4bf591"})}),(0,N.jsx)("span",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"15-20 min",id:"label.15_20_min.9f5c9546"})})]}),(0,N.jsx)("hr",{className:"my-3"}),(0,N.jsx)("p",{className:"fpsi-drag-hint",children:(0,N.jsx)(ke.A,{defaultMessage:"Drag cards between columns to categorize them.",id:"label.drag_cards_between_columns_to_cate.bcc1ca8d"})}),(0,N.jsxs)(Rd.JY,{onDragEnd:e=>{const{destination:s,draggableId:i}=e;if(!s||!a(!0))return;const l=s.droppableId;if("uncategorized"===l){const e=(0,F.A)({},o);delete e[i],t(1,3,(0,F.A)((0,F.A)({},r),{},{clusters:e}))}else{const e=(0,F.A)((0,F.A)({},o),{},{[i]:l});t(1,3,(0,F.A)((0,F.A)({},r),{},{clusters:e}))}},children:[m.length>0&&(0,N.jsx)(Rd.gL,{direction:"horizontal",droppableId:"uncategorized",children:(e,s)=>(0,N.jsxs)("div",(0,F.A)((0,F.A)({ref:e.innerRef},e.droppableProps),{},{style:{background:s.isDraggingOver?"#e8f5f3":"#fff3cd",border:"2px dashed "+(s.isDraggingOver?"#008087":"#ffc107"),borderRadius:12,display:"flex",flexWrap:"wrap",gap:8,marginBottom:16,minHeight:60,padding:12,transition:"all 0.2s"},children:[(0,N.jsx)("div",{style:{color:"#856404",fontSize:11,fontWeight:600,letterSpacing:.5,marginBottom:4,textTransform:"uppercase",width:"100%"},children:(0,N.jsx)(ke.A,{defaultMessage:"Uncategorized",id:"label.uncategorized.8d40d123"})}),m.map((e,s)=>(0,N.jsx)(Rd.sx,{draggableId:e.id,index:s,isDragDisabled:n,children:(s,a)=>(0,N.jsx)("div",(0,F.A)((0,F.A)((0,F.A)({ref:s.innerRef},s.draggableProps),s.dragHandleProps),{},{className:"fpsi-cluster-item "+(a.isDragging?"dragging":""),style:(0,F.A)((0,F.A)({},s.draggableProps.style),{},{maxWidth:260}),children:e.statement}))},e.id)),e.placeholder]}))}),(0,N.jsx)("div",{className:"fpsi-cluster-board",children:rA.map(e=>{const s=u(e);return(0,N.jsx)(Rd.gL,{droppableId:e,children:(a,t)=>(0,N.jsxs)("div",(0,F.A)((0,F.A)({ref:a.innerRef},a.droppableProps),{},{className:"fpsi-cluster-column "+(t.isDraggingOver?"drag-over":""),children:[(0,N.jsx)("h4",{children:e}),(0,N.jsxs)("div",{className:"fpsi-cluster-count",children:[s.length," ",1===s.length?"challenge":"challenges"]}),(0,N.jsxs)("div",{className:"fpsi-cluster-drop-zone",children:[s.map((e,s)=>(0,N.jsx)(Rd.sx,{draggableId:e.id,index:s,isDragDisabled:n,children:(s,a)=>(0,N.jsx)("div",(0,F.A)((0,F.A)((0,F.A)({ref:s.innerRef},s.draggableProps),s.dragHandleProps),{},{className:"fpsi-cluster-item "+(a.isDragging?"dragging":""),children:e.statement}))},e.id)),a.placeholder]})]}))},e)})})]})]})}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Most critical cluster",id:"label.most_critical_cluster.9e2d9db2"})}),(0,N.jsx)("div",{className:"fpsi-category-badges",children:rA.map(e=>(0,N.jsxs)("button",{className:"fpsi-category-badge "+(d===e?"selected":""),disabled:n,onClick:()=>{return!n&&(s=e,void t(1,3,(0,F.A)((0,F.A)({},r),{},{selected_cluster:s})));var s},children:[e,(0,N.jsx)("span",{className:"fpsi-badge-count",children:p[e]})]},e))}),d&&(0,N.jsxs)("div",{className:"fpsi-critical-cluster-section",children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("div",{className:"fpsi-cc-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Most critical cluster",id:"label.most_critical_cluster.9e2d9db2"})}),(0,N.jsx)("div",{className:"fpsi-cc-value",children:d}),(0,N.jsx)("div",{className:"fpsi-cc-reason",children:(0,N.jsx)(ke.A,{defaultMessage:"Selected by team consensus",id:"label.selected_by_team_consensus.b560d31c"})})]}),(0,N.jsx)("span",{className:"fpsi-cc-badge",children:(0,N.jsx)(ke.A,{defaultMessage:"Primary focus",id:"label.primary_focus.9fbf2647"})})]})]})})]})]})})})};var dA=()=>{const e=(0,l.useRef)(null),{canChangePhaseData:s,changePhaseData:a,getPhaseData:t}=((0,ja.A)(),Ra()),i=!s(),n=t(3,2)||{},r=(null===n||void 0===n?void 0:n.ratings)||{},o=(null===n||void 0===n?void 0:n.selected_solutions)||[],d=t(3,1)||{},c=(null===d||void 0===d?void 0:d.solutions)||[],h=(e,s,t)=>{const i=r[e]||{},l=(0,F.A)((0,F.A)({},r),{},{[e]:(0,F.A)((0,F.A)({},i),{},{[s]:Number(t)})});a(3,2,(0,F.A)((0,F.A)({},n),{},{ratings:l}))},u=e=>{const s=r[e]||{},a=s.relevance||0,t=s.feasibility||0;return a||t?((a+t)/2).toFixed(1):"-"},m=[1,2,3,4,5];return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-peer-review",children:(0,N.jsx)(Uv,{el:{phase:3,subphase:2},onRef:s=>e.current=s,phase:3,subphase:2,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Rate each solution on relevance (how well it addresses the UP) and feasibility (how realistic it is to implement) on a 1-5 scale. Then select up to 5 solutions to advance to the evaluation phase.",id:"label.rate_each_solution_on_relevance_ho.a675a07d"})})]})}),0===c.length&&(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:"warning",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"No solutions foun
2d. Complete Solution Generation first.",id:"label.no_solutions_found_complete_soluti.176f44fb"})})]}),c.length>0&&(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Rate & Select Solutions",id:"label.rate_and_select_solutions.d9563c14"})}),(0,N.jsxs)("span",{className:"text-muted small",children:[o.length,"/5 selected"]})]}),(0,N.jsx)("hr",{className:"my-3"}),(0,N.jsxs)("table",{className:"fpsi-rating-table",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{width:50},children:"Select"}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solution",id:"label.solution.22927695"})}),(0,N.jsx)("th",{style:{textAlign:"center",width:100},children:"Relevance"}),(0,N.jsx)("th",{style:{textAlign:"center",width:100},children:"Feasibility"}),(0,N.jsx)("th",{style:{textAlign:"center",width:70},children:"Avg"})]})}),(0,N.jsx)("tbody",{children:c.map(e=>{var s,t,l,d;const c=o.includes(e.id);return(0,N.jsxs)("tr",{className:c?"fpsi-selected-row":"",children:[(0,N.jsx)("td",{style:{textAlign:"center"},children:(0,N.jsx)("input",{checked:c,disabled:i||!c&&o.length>=5,onChange:()=>(e=>{let s;if(o.includes(e))s=o.filter(s=>s!==e);else{if(o.length>=5)return;s=[...o,e]}a(3,2,(0,F.A)((0,F.A)({},n),{},{selected_solutions:s}))})(e.id),style:{accentColor:"#008087",cursor:"pointer",height:18,width:18},type:"checkbox"})}),(0,N.jsxs)("td",{children:[(0,N.jsx)("strong",{style:{fontSize:13},children:e.title}),(0,N.jsxs)("div",{style:{color:"#888",fontSize:12,marginTop:2},children:[null===(s=e.description)||void 0===s?void 0:s.substring(0,80),(null===(t=e.description)||void 0===t?void 0:t.length)>80?"...":""]})]}),(0,N.jsx)("td",{style:{textAlign:"center"},children:(0,N.jsxs)("select",{className:"fpsi-form-select",disabled:i,onChange:s=>h(e.id,"relevance",s.target.value),style:{fontSize:13,padding:"4px 8px",textAlign:"center",width:60},value:(null===(l=r[e.id])||void 0===l?void 0:l.relevance)||"",children:[(0,N.jsx)("option",{value:"",children:"-"}),m.map(e=>(0,N.jsx)("option",{value:e,children:e},e))]})}),(0,N.jsx)("td",{style:{textAlign:"center"},children:(0,N.jsxs)("select",{className:"fpsi-form-select",disabled:i,onChange:s=>h(e.id,"feasibility",s.target.value),style:{fontSize:13,padding:"4px 8px",textAlign:"center",width:60},value:(null===(d=r[e.id])||void 0===d?void 0:d.feasibility)||"",children:[(0,N.jsx)("option",{value:"",children:"-"}),m.map(e=>(0,N.jsx)("option",{value:e,children:e},e))]})}),(0,N.jsx)("td",{className:"fpsi-avg-cell",children:u(e.id)})]},e.id)})})]})]})})]})})})};const cA=[{key:"problem_summary",label:"Problem Summary",placeholder:"Summarize the underlying problem your solution addresses..."},{key:"solution_description",label:"Solution Description",placeholder:"Describe your winning solution in detail..."},{key:"implementation_steps",label:"Implementation Steps",placeholder:"List the key steps to implement this solution..."},{key:"timeline",label:"Timeline",placeholder:"Outline the timeline for each implementation phase..."},{key:"resources_required",label:"Resources Required",placeholder:"What resources (people, materials, technology) are needed?"},{key:"budget_estimate",label:"Budget Estimate",placeholder:"Estimate costs and funding sources..."},{key:"stakeholders",label:"Stakeholders",placeholder:"Identify key stakeholders and their roles..."},{key:"risk_assessment",label:"Risk Assessment",placeholder:"What risks exist and how will you mitigate them?"},{key:"success_metrics",label:"Success Metrics",placeholder:"How will you measure whether the solution is working?"},{key:"team_roles",label:"Team Roles",placeholder:"Assign responsibilities to team members..."},{key:"next_steps",label:"Next Steps",placeholder:"What are the immediate next steps after this plan?"}];var hA=()=>{const e=(0,l.useRef)(null),s=(0,ja.A)(),{canChangePhaseData:a,changePhaseData:t,getPhaseData:i}=Ra(),n=!a(),r=i(5,1)||{},o=(null===r||void 0===r?void 0:r.action_plan)||{},d=cA.filter(e=>(o[e.key]||"").trim().length>0).length;return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-action-plan",children:(0,N.jsx)(Uv,{el:{phase:5,subphase:1},onRef:s=>e.current=s,phase:5,subphase:1,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a detailed implementation plan for your winning solution. Complete all 11 sections to build a comprehensive roadmap that could be presented to stakeholders.",id:"label.create_a_detailed_implementation_p.8b0c7eaa"})})]})}),(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:d===cA.length?"success":"warning",children:[d===cA.length?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:d===cA.length?s.formatMessage({id:"label.all_sections_completed.de6adbdb",defaultMessage:"All sections completed."}):s.formatMessage({id:"label.count_of_total_sections_completed.0b7d2183",defaultMessage:"{count} of {total} sections completed"},{count:d,total:cA.length})})]}),(0,N.jsx)("div",{className:"fpsi-action-plan-sections",children:cA.map((e,a)=>(0,N.jsxs)("div",{className:"fpsi-action-section",children:[(0,N.jsxs)("h4",{children:[(0,N.jsx)("span",{className:"fpsi-section-number",children:a+1}),(0,N.jsx)(ke.A,{defaultMessage:e.label,id:`fpsi.action_plan.${e.key}`})]}),(0,N.jsx)("textarea",{disabled:n,onChange:s=>((e,s)=>{const a=(0,F.A)((0,F.A)({},o),{},{[e]:s});t(5,1,(0,F.A)((0,F.A)({},r),{},{action_plan:a}))})(e.key,s.target.value),value:o[e.key]||"",placeholder:s.formatMessage({id:`fpsi.action_plan.${e.key}_placeholder`,defaultMessage:e.placeholder})})]},e.key))})]})})})};var uA=()=>{const e="knowledge_cards",s=(0,l.useRef)(null),a=(0,ja.A)(),{canChangePhaseData:t,changePhaseData:i,getPhaseData:n}=Ra(),[r,o]=(0,l.useState)(""),[d,c]=(0,l.useState)(""),[h,u]=(0,l.useState)(""),[m,g]=(0,l.useState)(null),p=!t(),x=n(1,1)||{},v=(null===x||void 0===x?void 0:x[e])||[],f=v.length>=3;return(0,N.jsx)(Ce.S,{className:"subphase-content fpsi-research",children:(0,N.jsx)(Uv,{el:{phase:1,subphase:1},onRef:e=>s.current=e,phase:1,subphase:1,children:(0,N.jsxs)(Tf,{children:[(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructions",id:"label.instructions.934652dc"})}),(0,N.jsx)("p",{className:"mb-0 activity-body-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Read the Future Scene document carefully. As you research, create knowledge c
2ards capturing key facts, observations, and connections you discover. Focus on data points, cause-and-effect relationships, and stakeholder impacts.",id:"label.read_the_future_scene_document_car.941eb09a"})})]})}),(0,N.jsxs)(We.A,{className:"d-flex align-items-center gap-2",variant:f?"success":"warning",children:[f?(0,N.jsx)(ze.CMH,{}):(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:f?a.formatMessage({id:"label.count_knowledge_cards_added_requir.6be6d2ce",defaultMessage:"{count} knowledge cards added \u2014 requirement met. You may proceed."},{count:v.length}):a.formatMessage({id:"label.minimum_min_knowledge_cards_requir.cbda0c70",defaultMessage:"Minimum {min} knowledge cards required to proceed ({count} of {min} added)"},{count:v.length,min:3})})]}),(0,N.jsx)(Ge.A,{className:"activity-card",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Research notes",id:"label.research_notes.47100f87"})}),(0,N.jsx)("span",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"15-20 min",id:"label.15_20_min.9f5c9546"})})]}),(0,N.jsx)("hr",{className:"my-3"}),m&&(0,N.jsxs)(We.A,{dismissible:!0,className:"d-flex align-items-center gap-2",onClose:()=>g(null),variant:"warning",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)("span",{children:m})]}),!p&&(0,N.jsx)(Ge.A,{className:"bg-light mb-3",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>o(e.target.value),placeholder:a.formatMessage({id:"label.key_fact_or_insight.00b1e044",defaultMessage:"Key fact or insight..."}),value:r})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>c(e.target.value),placeholder:a.formatMessage({id:"label.explain_this_finding.ba1c57b8",defaultMessage:"Explain this finding..."}),rows:3,value:d})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"small fw-semibold text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Source (optional)",id:"label.source_optional.9804955b"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>u(e.target.value),placeholder:a.formatMessage({id:"label.eg_future_scene_para_3.1b3ac533",defaultMessage:"e.g. Future Scene, para 3"}),value:h})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1 align-self-start",disabled:!r.trim()||!d.trim(),onClick:()=>{var t,l;if(!r.trim()||!d.trim())return void g(a.formatMessage({id:"label.title_and_description_are_required.6b77eb70",defaultMessage:"Title and description are required."}));const n={id:(0,me.A)(),description:d.trim(),source:h.trim(),title:r.trim()},m=[...v,n],p=(0,F.A)((0,F.A)({},x),{},{[e]:m});i(1,1,p),null===(t=s.current)||void 0===t||null===(l=t.revisions)||void 0===l||l.addChallengeDataHistory({action:"add",action_data:{value:n},data:p,field_id:e,sub_field_id:n.id}),o(""),c(""),u(""),g(null)},variant:"primary",children:[(0,N.jsx)(ze.OiG,{size:14}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add knowledge card",id:"label.add_knowledge_card.b9cbcee9"})})]})]})}),(0,N.jsxs)("div",{className:"fpsi-knowledge-cards",children:[v.map((s,a)=>(0,N.jsxs)("div",{className:"fpsi-knowledge-card",children:[!p&&(0,N.jsx)(ve.A,{className:"fpsi-card-remove p-0",onClick:()=>(s=>{const a=v.filter((e,a)=>a!==s),t=(0,F.A)((0,F.A)({},x),{},{[e]:a});i(1,1,t)})(a),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{size:12})}),(0,N.jsx)("h4",{children:s.title}),(0,N.jsx)("p",{children:s.description}),s.source&&(0,N.jsx)("div",{className:"fpsi-source",children:s.source})]},s.id||a)),!p&&(0,N.jsxs)("div",{className:"fpsi-add-card-placeholder",onClick:()=>{var e;return null===(e=document.querySelector(".fpsi-form-input"))||void 0===e?void 0:e.focus()},role:"button",tabIndex:0,onKeyDown:e=>{var s;"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),null===(s=document.querySelector(".fpsi-form-input"))||void 0===s||s.focus())},children:[(0,N.jsx)("div",{className:"fpsi-plus",children:"+"}),(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add knowledge c
2ard",id:"label.add_knowledge_card.b9cbcee9"})})]})]})]})})]})})})},mA={"1-1":uA,"1-2":aA,"1-3":oA,"1-4":Vb,"2-1":Kb,"2-2":qb,"3-1":Wb,"3-2":dA,"3-3":Xb,"4-1":Hb,"4-2":lA,"4-3":nA,"4-4":iA,"5-1":hA,"5-2":sA};const gA=(0,l.forwardRef)((e,s)=>{const{children:a}=e,{challenge_type:t,has_certification:i,is_facilitator:l,phase:n,preview:r,subphase:o}=Ra(),d={classic:Db,decision_making:Lb,fpsi:mA,latest:Ob}[t]||Db,c=(null===d||void 0===d?void 0:d[`${n}-${o}`])||g_;return(0,N.jsxs)(Ce.S,{className:"challenge-content d-flex flex-column w-100 pb-3",children:[a,n&&o&&(0,N.jsx)(ff,{}),n&&o&&!r&&!l&&i&&(0,N.jsx)(Ue.A,{className:"project-internal",children:(0,N.jsx)(fx,{})}),(0,N.jsx)(c,(0,F.A)({},e)),(0,N.jsx)(jf,{})]})});gA.displayName="ChallengeContent";var pA=gA;const xA=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({error:null,visible:!1}),{error:n,visible:r}=a,o=e=>{let{error:s}=e;return t({error:s,visible:!0})},d=()=>i();return(0,l.useImperativeHandle)(s,()=>({hide:d,show:o,visible:r})),(0,N.jsxs)(xe,{centered:!0,"aria-live":"polite",backdrop:"static",className:"challenge-error-modal remove-footer-divider",id:"challengeErrorModal",onHide:d,show:r,size:"normal",children:[(0,N.jsx)(xe.Header,{closeButton:!0,className:"bg-danger text-white",children:(0,N.jsxs)("h5",{className:"mb-0 d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.BS8,{}),(0,N.jsx)(ke.A,{defaultMessage:"Error",id:"label.error.54a0e8c1"})]})}),(0,N.jsx)(xe.Body,{className:"pb-0",children:(0,N.jsx)("p",{className:"text-danger m-0",children:n})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:d,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"OK",id:"label.ok.565339bc"})})})]})});xA.displayName="ChallengeErrorModal";var vA=xA;const fA=(0,l.forwardRef)((s,a)=>{const{can_skip_submit_delay:t,cancelSubmitPhase:i,count:n,getPhaseTitle:r,getTeamMemberWithUserId:o,submission_user:d,try_submit:c,trySkipCountdown:h,trySubmitPhase:u}=Ra(),m=o(d),{formatMessage:g}=(0,ja.A)(),[p,x,v]=(0,ne.CQ)({phase:null,skipping:!1,visible:!1}),{phase:f,skipping:j,visible:_}=p,b=e=>{let{phase:s=null}=e;x({phase:s,visible:!0})},A=()=>v();(0,l.useImperativeHandle)(a,()=>({hide:A,show:b,visible:_}));const y=r(f);return(0,N.jsx)(xe,{"aria-live":"polite",backdrop:"static",className:"phase-submission-confirmation phase-submission-modal fancy-modal",id:"phaseSubmissionModal",onHide:A,show:_,size:"lg",children:c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{children:(0,N.jsxs)(Ce.S,{className:"d-flex gap-2 gap-lg-3 align-items-center",children:[(0,N.jsx)("span",{className:"phase-icon-container rounded-circle p-3",children:(0,N.jsx)(jA,{color:"white",icon:r(f).toLowerCase(),size:32,stroke:"white"})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Phase submission request",id:"label.phase_submission_request.8f56b9db"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"A teammate has requested to submit the {phase_title} phase.",id:"label.a_teammate_has_requested_to_submit.58039388",values:{phase_title:(0,N.jsx)("strong",{children:y})}})})]})]})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"If you're not ready to submit {phase_title} just yet, you can cancel the submission and we'll notify the team.",id:"label.if_youre_not_ready_to_submit_phase.ee7a92c8",values:{phase_title:(0,N.jsx)("strong",{children:y})}})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"While not recommended, you can always go back and edit your work until the challenge is completed!",id:"label.while_not_recommended_you_can_alwa.73e269b0"})}),(0,N.jsx)(Ce.S,{className:"my-2",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-lg-row align-items-start align-items-lg-center gap-3 mt-4 m-lg-0",children:[(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"Submission requested by:",description:"",id:"label.submission_requested_by.675d6490",values:{phase_title:y}})}),m&&(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"d-flex align-items-center gap-1 requester-container",text:"dark",children:[(0,N.jsx)(Ya,{showOnline:!1,size:24,user:m}),(0,N.jsx)("strong",{children:null===m||void 0===m?void 0:m.fullname})]})]})})]}),(0,N.jsxs)(xe.Footer,{className:"requested d-flex justify-content-between align-items-end",children:[(0,N.jsx)(ve.A,{onClick:async()=>{await i(f),A()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel submission",id:"label.cancel_submission.60543449"})}),(0,N.jsxs)(Ce.S,{className:"counter-container d-flex flex-column align-items-end",role:"timer",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-baseline",children:[(0,N.jsx)("small",{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Moving forward in:",id:"label.moving_forward_in.5259b98e"})}),(0,N.jsxs)("h2",{className:"counter m-0 ps-1 text-end "+(n<3?"low":""),children:[n,(0,N.jsx)("span",{"aria-hidden":"true",children:"s"}),(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"seconds",id:"label.seconds.59f006d6"})})]})]}),t&&(0,N.jsx)(Me.p0,{className:"p-0 align-self-start",loading:j,onClick:async()=>{try{x({skipping:!0}),await h(f)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;x({error:a,skipping:!1})}},size:"sm",variant:"link",loading_label:g({id:"label.skipping.e79264f8",defaultMessage:"Skipping..."}),children:(0,N.jsx)(ke.A,{defaultMessage:"Skip countdown",id:"label.skip_countdown.052ce939"})})]})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(Ce.S,{className:"d-flex gap-2 gap-lg-3 align-items-center",children:[(0,N.jsx)("span",{className:"phase-icon-container rounded-circle p-3",children:(0,N.jsx)(jA,{color:"white",icon:r(f).toLowerCase(),size:32,stroke:"white"})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Phase submission",id:"label.phase_submission.30aeb753"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"You are about to submit the {phase_title} phase.",id:"label.you_are_about_to_submit_the_phase.b0bfb6b2",values:{phase_title:(0,N.jsx)("strong",{children:y})}})})]})]})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Please make sure you have spoken with your team and everyone is ready to move on.",id:"label.please_make_sure_you_have_spoken_w.c1bff8b1"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"While not recommended, you can always go back and edit your work until the challenge is completed!",id:"label.while_not_recommended_you_can_alwa.73e269b0"})})]}),(0,N.jsxs)(xe.Footer,{className:"d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{onClick:A,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{onClick:async()=>await u(f),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})})}),jA=e=>{let s="";switch(e.icon){case"discover":s=(0,N.jsx)(hn,{color:e.color,fontSize:e.size,strokeColor:e.stroke});break;case"explore":s=(0,N.jsx)(mn,{color:e.color,fontSize:e.size,strokeColor:e.stroke});break;case"imagine":s=(0,N.jsx)(pn,{color:e.color,fontSize:e.size,strokeColor:e.stroke});break;case"create":s=(0,N.jsx)(jn,{color:e.color,fontSize:e.size,strokeColor:e.stroke});break;case"reflect":s=(0,N.jsx)(vn,{color:e.color,fontSize:e.size,strokeColor:e.stroke})}return s};fA.displayName="PhaseSubmissionModal";var _A=fA;var bA=e=>{const{onSelect:s,type_filters:a}=e,{api:t}=(0,P.nm)(),{challenge_id:i}=Ra(),[n,r,o]=(0,ne.CQ)({error:null,files:[],filter_files:[],loading:!1}),d=()=>{const{files:e}=n;return null!==e&&void 0!==e&&e.length?e.filter(e=>{let s=(null===e||void 0===e?void 0:e.file)||{};return s&&s.type?Array.isArray(a)?a.includes(s.type):void 0:[]}):[]};(0,l.useEffect)(()=>((async()=>{try{r({loading:!0});const{files:e}=await t.get("/api/challenges/files",{challenge_id:i});r({files:e,loading:!1});let s=d();r({filter_files:s})}catch({err:err}){r({error:err,loading:!1})}})(),o),[]);const{filter_files:c,loading:h}=n;return(0,N.jsx)(yA,{value:{handleSelect:e=>"function"===typeof s&&s(e)},children:(0,N.jsx)(Ce.S,{className:"challenge-file-library",children:(0,N.jsx)(Me.x_,{loading:h,children:null!==c&&void 0!==c&&c.length?(0,N.jsx)(Ij.A,{className:"files-grid",columnsCount:2,gutter:8,children:c.map((e,s)=>(0,N.jsx)(SA,{file:e},s))}):(0,N.jsx)("p",{className:"text-muted p-5 d-flex align-items-center justify-content-center bg-light rounded mt-3 lead",children:(0,N.jsx)(ke.A,{defaultMessage:"No files found",id:"label.no_files_found.949d59b7"})})})})})};const AA=l.createContext({}),yA=AA.Provider,wA=(AA.Consumer,()=>(0,l.useContext)(AA));var NA={file:e=>{const{file:s}=e,{file_name:a}=s||{},{location:t}=(null===s||void 0===s?void 0:s.file)||{},{styles:i}=(0,P.nm)(),l=null===i||void 0===i?void 0:i.primary,{parseExt:n}=(0,P.hc)(),{handleSelect:r}=wA();return(0,N.jsx)(Ge.A,{className:"preview file-preview",onClick:()=>r(s),role:"button",tabIndex:"0",children:(0,N.jsx)(Ge.A.Body,{className:"d-flex align-items-center p-4 fw-semibold",children:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center gap-1 w-100",children:(()=>{switch(n(t)){case"ppt":case"pptx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.rgF,{size:20,style:{color:"#e05a30"}}),(0,N.jsx)(Fl,{className:"flex-fill",maxWidth:200,children:a||(0,N.jsx)(ke.A,{defaultMessage:"PowerPoint Presentation",id:"label.powerpoint_presentation.935176c7"})})]});case"doc":case"docx":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.WLb,{size:20,style:{color:"#2c4098"}}),(0,N.jsx)(Fl,{className:"flex-fill",maxWidth:200,children:a||(0,N.jsx)(ke.A,{defaultMessage:"Word document",id:"label.word_document.10eea543"})})]});case"pdf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.kl1,{size:20,style:{color:"#db4437"}}
2),(0,N.jsx)(Fl,{className:"flex-fill",maxWidth:200,children:a||(0,N.jsx)(ke.A,{defaultMessage:"PDF Document",id:"label.pdf_document.0cbeb39b"})})]});case"rtf":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.t69,{size:20,style:{color:"black"}}),(0,N.jsx)(Fl,{className:"flex-fill",maxWidth:200,children:a||(0,N.jsx)(ke.A,{defaultMessage:"RTF Document",id:"label.rtf_document.d61aacad"})})]});default:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Gp9,{size:20,style:{color:l}}),(0,N.jsx)(Fl,{className:"flex-fill",maxWidth:200,children:a||(0,N.jsx)(ke.A,{defaultMessage:"Uploaded resource",id:"label.uploaded_resource.80706545"})})]})}})()})})})},image:e=>{const{file:s}=e,{file_name:a}=s||{},{location:t}=(null===s||void 0===s?void 0:s.file)||{},{handleSelect:i}=wA();return(0,N.jsx)(Ge.A,{className:"preview image-preview",onClick:()=>i(s),role:"button",tabIndex:"0",children:(0,N.jsx)(Ge.A.Img,{alt:`Uploaded challenge file with the title: ${a}`,as:hd.R,height:200,rounded:!0,src:t,width:"100%"})})},video:e=>{const{file:s}=e,{location:a}=(null===s||void 0===s?void 0:s.file)||{},{handleSelect:t}=wA();return(0,N.jsx)(Ge.A,{className:"preview video-preview",onClick:()=>t(s),role:"button",tabIndex:"0",children:(0,N.jsx)("video",{className:"w-100 rounded",src:a})})}};var SA=e=>{const{file:s}=e,{file:a}=s||{},t=(null===NA||void 0===NA?void 0:NA[null===a||void 0===a?void 0:a.type])||l.Fragment;return(0,N.jsx)(t,{file:s})};const CA=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({library_filters:[],reject:Function(),resolve:Function(),show:!1,type:"image"}),n=e=>{switch(e){case"multimedia":return["image","file","video"];case"print":return["image","file"];case"sketch":return["image"];default:return[e]}},r=e=>new Promise((s,a)=>{const{type:i}=e;t({library_filters:n(i),reject:a,resolve:s,show:!0,type:i})});(0,l.useImperativeHandle)(s,()=>({hide:i,show:r}));const{library_filters:o,show:d,type:c}=a;return(0,N.jsxs)(xe,{className:"challenge-library-modal",onHide:()=>{a.resolve(null),i()},show:d,size:"lg",children:[(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(xe.Title,{className:"d-flex",children:(0,N.jsx)(ke.A,{defaultMessage:"Team library: {type}",id:"label.team_library_type.963b4df6",values:{type:(0,N.jsx)("span",{className:"text-capitalize text-muted ps-1",children:c})}})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select a previously uploaded file.",id:"label.select_a_previously_uploaded_file.4d601a2c"})})]}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(bA,{onSelect:e=>{a.resolve(e),i()},type_filters:o})})]})});CA.displayName="ChallengeLibraryModal";const MA=(0,l.forwardRef)((e,s)=>{const{browseTeamLib:a,onOpenFileDialog:t}=e,[i,n,r]=(0,ne.CQ)({accepted_file_types:[],error:null,job_id:null,reject:Function(),resolve:Function(),show:!1,supported_extensions:[],supported_files:"",title:"Resource Upload",type:"file"}),{error:o}=i,{api:d,styles:c,utils:h}=(0,P.nm)(),{primary:u}=c,{extensionsListToString:m,file_types:g,getFileType:p,image_types:x,mapMimesToExtensions:v,video_types:f}=(0,P.hc)(),{formatMessage:j}=(0,ja.A)(),{project:_}=Ra(),b=(0,l.useRef)(),A=(0,l.useRef)(),y=(0,l.useRef)(),w=e=>new Promise((s,a)=>{let t=(null===i||void 0===i?void 0:i.title)||"";const l={file:[...g],image:[...x],multimedia:[...x,...f,...g],print:[...x,...g],sketch:[...x],video:[...f]},r=v([...l[e]]),o=j({id:"label.supports_extensions.6e814174",defaultMessage:"Supports: {extensions}"},{extensions:(0,N.jsx)("em",{children:m(r)})});switch(e){case"image":t=j({id:"label.image_upload.2a16a6b7",defaultMessage:"Image upload"});break;case"sketch":t=j({id:"label.sketch_upload.731dc6c4",defaultMessage:"Sketch upload"});break;case"video":t=j({id:"label.video_upload.bb82c0b7",defaultMessage:"Video upload"});break;case"file":t=j({id:"label.file_upload.e6ea204f",defaultMessage:"File upload"});break;case"print":t=j({id:"label.add_print_research.c69a3b35",defaultMessage:"Add print research"});break;case"multimedia":t=j({id:"label.add_multimedia.d6c9cd26",defaultMessage:"Add multimedia"})}n({accepted_file_types:null===l||void 0===l?void 0:l[e],reject:a,resolve:s,show:!0,supported_extensions:r,supported_files:o,title:t,type:e})}),S=e=>{i.resolve({file:e,type:i.type}),r()},C=e=>{i.reject(e),r()},M=e=>{n({uploading:!1}),e||n({error:"Error retrieving the uploaded file"}),S({ext:e.ext,file_name:e.file_name,link:e.location,type:e.type})},k=function(e){(function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,me.A)();n({job_id:s});const a=p(e.type);let t=null;
2return"video"===a?t="/api/challenges/upload/video":"file"===a?t="/api/challenges/upload/file":"image"===a&&(t="/api/challenges/upload/image"),t?(n({uploading:!0}),d.file(t,{challenge_id:null===_||void 0===_?void 0:_.id,job_id:s},e,e.name)):n({error:"Error uploading attachment."})})(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,me.A)()).then(e=>{let{file:s,file_name:a}=e;s.file_name=a,M(s)}).catch(e=>{var s;return n({error:null!==(s=null===e||void 0===e?void 0:e.error)&&void 0!==s?s:"Error uploading file"})})},z=(0,l.useCallback)(e=>{let s=e[0];const a=(e=>!(null===e||void 0===e||!e.type)&&!!i.accepted_file_types.includes(e.type))(s);if(!a)return n({error:`Invalid file type. Supports: ${m(null===i||void 0===i?void 0:i.supported_extensions)}`});"image"===i.type||h.image_types.includes(s.type)?b.current.show(s).then(e=>{null==e&&C(null),e.name=s.name,k(e)}).catch(e=>{C(e)}):k(s)},[i.type,i.supported_files]),{getInputProps:T,getRootProps:I,open:E}=(0,ym.VB)({noClick:!0,onDrop:z});return(0,l.useImperativeHandle)(s,()=>({hide:r,show:w})),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{backdrop:"static",dialogClassName:"share-attachment-wizard-modal expanded",onHide:()=>{i.resolve(null),r()},show:i.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("span",{style:{textTransform:"capitalize"},children:i.title})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:null!==o,variant:"danger",children:o}),(0,N.jsx)("div",{className:"document-step",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"vertically-center",md:5,children:[(0,N.jsxs)("div",(0,F.A)((0,F.A)({},I()),{},{className:"drop-zone d-flex justify-content-center align-items-center",children:[(0,N.jsx)("input",(0,F.A)({},T())),!i.uploading&&(0,N.jsxs)("div",{className:"drop-zone-content gap-1",children:[(0,N.jsx)("div",{className:"zone-icon d-flex justify-content-center",children:(0,N.jsx)(zm,{fill:u,size:56,type:"file"!==i.type?i.type:null})}),(0,N.jsx)("div",{children:(0,N.jsxs)("strong",{className:"d-flex align-items-baseline gap-1 justify-content-center",children:[(0,N.jsx)(ke.A,{defaultMessage:"Drop here or",id:"label.drop_here_or.d930668a"})," ",(0,N.jsx)(ve.A,{className:"p-0",variant:"link",onClick:"function"===typeof t?t:E,children:(0,N.jsx)(ke.A,{defaultMessage:"select file...",id:"label.select_file.2d06d5e5"})})]})}),(0,N.jsx)("small",{className:"text-muted",children:i.supported_files})]}),i.uploading&&(0,N.jsx)(Ma,{job_id:i.job_id,submitting:i.uploading})]})),a&&(0,N.jsx)("div",{className:"brws-team-lib mt-4 mb-1",children:(0,N.jsxs)(ve.A,{onClick:async()=>{const e=null===y||void 0===y?void 0:y.current;if(!e)return;const s=await e.show({type:i.type});s&&M(null===s||void 0===s?void 0:s.file)},variant:"link",children:[(0,N.jsx)("div",{className:"team-lib-icon d-inline-block",children:(0,N.jsx)(ze.g1V,{})}),(0,N.jsx)("h6",{className:"mb-0 d-inline ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Browse team library",id:"label.browse_team_library.2d86b4a7"})})]})})]}),(0,N.jsx)(Ve.A,{md:2,children:(0,N.jsx)("div",{className:"or-barrier",children:(0,N.jsx)("p",{className:"or-text",children:(0,N.jsx)("span",{children:"or"})})})}),(0,N.jsx)(Ve.A,{className:"vertically-center",md:5,children:(0,N.jsxs)("div",{className:"w-100",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Paste a link",id:"label.paste_a_link.8275f7c2"})}),(0,N.jsx)(z_,{handleLinkChange:e=>(e=>{e&&(e.type="link",e.location=e.link,S(e))})(e)})]})})]})})]})]}),(0,N.jsx)(CA,{ref:y,type:i.type}),(0,N.jsx)(za,{aspectRatio:e.aspectRatio||1,ref:b}),(0,N.jsx)(TA,{aspectRatio:e.aspectRatio||1,onComplete:e.onCompleteImageUpload,ref:A,uploadHandler:e.imageUploadHandler})]})});MA.displayName="DropzoneLinkUploadModal",MA.defaultProps={aspectRatio:1,browseTeamLib:!0,onOpenFileDialog:null};var kA=MA;const zA=(0,l.forwardRef)((e,s)=>{const{aspectRatio:a,croppable:t,maxHeight:i,maxWidth:n,onComplete:r,onHide:o,title:d,uploadHandler:c}=e,h=(0,l.useRef)(),[u,m,g]=(0,ne.CQ)({error:null,file:null,loading:!1,reject:Function(),resolve:Function(),visible:!1}),{error:p,file:x,reject:v,resolve:f,visible:j}=u,_=e=>new Promise((s,a)=>{m({file:e,reject:a,resolve:s,visible:!0})}),b=()=>{"function"===typeof f&&f(),"function"===typeof o&&o(),g()},A=()=>m({error:null});return(0,l.useImperativeHandle)(s,()=>({hide:b,promptImageUpload:_})),(0,N.jsxs)(xe,{backdrop:"static",backdropClassName:"image-upload-backdrop",className:"image-upload-modal",onHide:b,show:j,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:d})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(We.A,{dismissible:!0,onClose:A,show:p,variant:"danger",children:[p," ",(0,N.jsx)(ve.A,{onClick:()=>{A(),(null===h||void 0===h?void 0:h.current)&&h.current.resetCropper()},variant:"link",children:"Try Again."})]}),(0,N.jsx)(ya,{aspectRatio:a,croppable:t,file:x,maxHeight:i,maxWidth:n,onClose:b,onFinish:async function(e,s){try{if("function"!==typeof c)return;const a=await c(e,s);"function"==typeof r&&r(a),(e=>{"function"===typeof f&&f(e),g()})(a),b()}catch(p){m({error:(null===p||void 0===p?void 0:p.err)||(null===p||void 0===p?void 0:p.message)||p})}},onRef:e=>h.current=e})]})]})});zA.displayName="UploadImageModal",zA.defaultProps={title:(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})};var TA=zA;var IA=t.p+"static/media/Select.e84a8a8e66913336043f5d15451931b5.svg";const EA=e=>{const{aspectRatio:s,dropZoneConfig:a,fileTypeLabel:t,imageUploadHandler:i,onCompleteImageUpload:n,onOpenFileDialog:r,onUploadComplete:o,uploadHandler:d,zoneIcon:c}=e,h=(0,l.useRef)(null),u=(0,l.useRef)(null),{utils:m}=(0,P.nm)(),{file_types:g,image_types:p}=m,[x,v,f,j]=p,[_,b,A]=(0,ne.CQ)({accepted_file_types:[],error:"",job_id:null,
2supportedFiles:"",title:"Drop here or select file...",type:"file",uploading:!1});(0,l.useEffect)(()=>{const{file_type:s}=e;let a=[],t="";if("journey-editor-upload-imagery"===s)t="Supports JPG and PNG",a=[x,j,v];else a=g;b({accepted_file_types:a,supported_files:t})},[]);const y=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,me.A)();b({job_id:s,uploading:!0}),d(e,s).then(e=>{let{file:s,file_name:a}=e;s.file_name=a,o(s),b({uploading:!1})}).catch(e=>{b({error:e,uploading:!1}),o(null)})},w=(0,l.useCallback)(e=>{let s=e[0];const a=(e=>!(null===e||void 0===e||!e.type)&&!!_.accepted_file_types.includes(e.type))(s);if(!a)return b("Error: File type must be one of "+_.supported_files);"image"===_.type||m.image_types.includes(s.type)?h.current.show(s).then(e=>{e&&(e.name=s.name,y(e))}):y(s)}),{getInputProps:S,getRootProps:C,open:M}=(0,ym.VB)((0,F.A)({noClick:!0,onDrop:w},a)),{job_id:k,uploading:z}=_;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",(0,F.A)((0,F.A)({},C()),{},{className:"drop-zone",children:[(0,N.jsx)("input",(0,F.A)({},S())),z?(0,N.jsx)(Ma,{job_id:k,submitting:z}):(0,N.jsxs)("div",{className:"drop-zone-content",children:[(0,N.jsx)("div",{className:"zone-icon",children:(0,N.jsx)(Zs.A,{alt:"Drop Zone identifier",src:c})}),(0,N.jsx)("div",{children:(0,N.jsxs)("div",{className:"cta",children:[(0,N.jsx)(ke.A,{defaultMessage:"Drop here or",id:"label.drop_here_or.d930668a"})," ",(0,N.jsx)(ve.A,{className:"ps-0 dialog-opener-link",onClick:"function"===typeof r?r:M,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"select file...",id:"label.select_file.2d06d5e5"})})]})}),(0,N.jsx)("p",{className:"small text-muted text-center",children:t})]})]})),(0,N.jsx)(za,{aspectRatio:s||1,ref:h}),(0,N.jsx)(TA,{aspectRatio:s||1,onComplete:n,ref:u,uploadHandler:i})]})};EA.defaultProps={aspectRatio:1,dropZoneConfig:{},fileTypeLabel:"",imageUploadHandler:Function(),onCompleteImageUpload:Function(),onUploadComplete:Function(),uploadHandler:Function(),zoneIcon:{DropIcon:IA}};var FA=(0,l.forwardRef)((e,s)=>{const{handleAvatarSubmit:a=Function()}=e,[t,i]=(0,l.useState)(!1),[n,r]=(0,l.useState)(null),o=()=>{i(!1),r(null)};return(0,l.useImperativeHandle)(s,()=>({hide:()=>o(),setError:e=>r(e),show:()=>{i(!0)}})),(0,N.jsxs)(xe,{backdrop:"static",onHide:()=>{i(!1)},show:t,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload avatar",id:"label.upload_avatar.e9892011"})})}),(0,N.jsx)(xe.Body,{children:n?(0,N.jsxs)(We.A,{variant:"danger",children:[n,(0,N.jsx)(ve.A,{className:"p-0",variant:"link",onClick:e=>{e.preventDefault(),r(null)},children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})})]}):(0,N.jsx)(ya,{aspectRatio:1,onClose:()=>{o()},onFinish:(e,s)=>{a(e,s)}})})]})});var RA=(0,l.forwardRef)((e,s)=>{const{handleBannerSubmit:a=Function()}=e,[t,i]=(0,l.useState)(!1),[n,r]=(0,l.useState)(null),[o,d]=(0,l.useState)(!1),c=()=>{i(!1),r(null)};return(0,l.useImperativeHandle)(s,()=>({hide:()=>c(),setError:e=>r(e),setSubmitting:e=>d(e),show:()=>{i(!0)}})),(0,N.jsxs)(xe,{backdrop:"static",onHide:()=>i(!1),show:t,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload banner",id:"label.upload_banner.7f66a1ac"})})}),(0,N.jsx)(xe.Body,{children:n?(0,N.jsxs)(We.A,{variant:"danger",children:[n,(0,N.jsx)(ve.A,{className:"p-0",variant:"link",onClick:e=>{e.preventDefault(),r(null)},children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})})]}):(0,N.jsx)(ya,{aspectRatio:4,maxHeight:2e3,maxWidth:2e3,onClose:()=>c(),onFinish:(e,s)=>{a(e,s)},submitting:o})})]})});const DA=(0,l.forwardRef)((e,s)=>{const{onHide:a,onUpdateSuccess:t}=e,{api:i}=(0,P.nm)(),{formatMessage:n}=(0,ja.A)(),[r,o,d]=(0,ne.CQ)({current_tab:"basics",error:null,loading:!1,organization_id:null,show:!1,success:null,user:null,user_id:null}),c=()=>o({error:null}),h=()=>o({success:null}),u=async e=>{o({organization_id:(null===e||void 0===e?void 0:e.organization_id)||null,show:!0,user_id:null===e||void 0===e?void 0:e.user_id}),await g()},m=()=>{d(),"function"===typeof a&&a()},g=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"basics";try{const{organization_id:s,user_id:a}=r;o({error:null,loading:!0});const{user:t}=await i.get("/api/users/admin/user/get",{organization_id:s,user_id:a});o({current_tab:e,loading:!1,user:t})}catch({err:err}){o({error:err,loading:!1})}},p=async()=>{var e,s,a;const l=(null===r||void 0===r||null===(e=r.user)||void 0===e?void 0:e.emails)||[],d=null!==(s=null===l||void 0===l||null===(a=l[0])||void 0===a?void 0:a.email_address)&&void 0!==s?s:null,{organization_id:c}=r;try{if(!d)throw{err:n({id:"label.there_is_no_email_address_associat.047cf14f",defaultMessage:"There is no email address associated with this account"})};await i.post("/api/users/admin/user/forgot",{email_address:d,organization_id:c}),o({success:n({id:"label.password_reset_email_sent.afac5575",defaultMessage:"Password reset email sent"}),user_updated:!0}),"function"===typeof t&&t()}catch({err:err}){o({error:n({id:"label.there_was_an_error_sending_the_res.77ff04a2",defaultMessage:"There was an error sending the reset email to this account: {err}"},{err:err})})}},x=async e=>{if(null!=e)try{const{organization_id:s,user_id:a}=r;o({submitting:!0}),await i.post("/api/users/admin/user/set-password",{organization_id:s,password:e,user_id:a}),o({submitting:!1,success:n({id:"label.password_succesfully_changed.f483b5d8",defaultMessage:"Password succesfully changed!"}),user_updated:!0}),"function"===typeof t&&t()}catch({err:err}){o({error:n({id:"label.there_was_an_error_changing_the_pa.93d45c63",defaultMessage:"There was an error changing the password: {err}"},{err:err}),submitting:!1})}},v=async(e,s)=>{try{if(null==e||null==s)return void console.error("Incorrect use of handleAvatarSubmit");const{organization_id:a,user_id:l}=r;o({submitting:!0}),await i.file("/api/users/admin/user/avatar",{job_id:s,organization_id:a,user_id:l},e,"image.jpg"),o({submitting:!1,user_updated:!0}),"function"===typeof t&&t(),await g("images")}catch({err:err}){o({error:err,submitting:!1})}},f=async()=>{try{const{organization_id:e,user_id:s}=r;o({submitting:!0}),await i.post("/api/users/admin/user/avatar/delete",{organization_id:e,user_id:s}),o({submitting:!1,user_updated:!0}),"function"===typeof t&&t(),await g("images")}catch({err:err}){o({error:err,submitting:!1})}},j=async(e,s)=>{if(null==e||null==s)return console.error(n({id:"label.incorrect_use_of_handlebannersubmi.b603698a",defaultMessage:"Incorrect use of handleBannerSubmit"}));try{const{organization_id:a,user_id:l}=r;o({submitting:!0}),await i.file("/api/users/admin/user/banner",{job_id:s,organization_id:a,user_id:l},e,"banner_image.jpg"),o({submitting:!1,user_updated:!0}),"function"===typeof t&&t(),await g("images")}catch({err:err}){o({error:err,submitting:!1})}},_=async()=>{try{var e;const{organization_id:s,user:a,user_id:l}=r;if(null===a||void 0===a||null===(e=a.banner)||void 0===e||!e.location)return;o({submitting:!0}),await i.post("/api/users/admin/user/banner/delete",{organization_id:s,user_id:l}),o({submitting:!1,user_updated:!0}),"function"===typeof t&&t(),await g("images")}catch(err){o({error:err,submitting:!1})}};(0,l.useImperativeHandle)(s,()=>({hide:m,show:u})),(0,l.useEffect)(()=>d,[]);const{current_tab:b,error:A,loading:y,submitting:w,success:S,user:C}=r;return(0,N.jsx)(LA,{value:{current_tab:b,fetchUser:g,handleAvatarSubmit:v,handleBannerSubmit:j,handleBasicsSubmit:async e=>{try{const{organization_id:s}=r;o({submitting:!0}),await i.post("/api/users/admin/profile/basics/save",(0,F.A)((0,F.A)({},e),{},{organization_id:s})),o({submitting:!1,success:n({id:"label.user_information_updated.ac9d3418",defaultMessage:"User information updated."}),user_updated:!0}),"function"===typeof t&&t(),await g("basics")}catch({err:err}){o({error:err,submitting:!1})}},handleDeleteAvatar:f,handleDeleteBanner:_,handleEmailSubmit:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{const{organization_id:l,user_id:d}=r;o({submitting:!0}),await i.post("/api/users/admin/user/profile/contact/save",{email1:e,email2:s,email3:a,organization_id:l,user_id:d}),o({submitting:!1,success:n({id:"label.email_preferences_succesfully_chan.f0e26dd0",defaultMessage:"Email preferences succesfully changed!"}),user_updated:!0}),"function"===typeof t&&t(),await g("emails")}catch({err:err}){o({error:err,submitting:!1})}},handleHide:m,handlePasswordReset:p,handlePasswordSubmit:x,loading:y,submitting:w,user:C},children:(0,N.jsxs)(xe,{onHide:m,show:r.show,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Edit user info",id:"label.edit_user_info.02b9cd05"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Me.x_,{loading:y,children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:b,id:"edit-user-tabs",mountOnEnter:!0,role:"navigation",onSelect:()=>{c(),h()},children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"basics",ariaLabel:n({id:"label.basics_nav_tab.2097031b",defaultMessage:"Basics nav tab"}),children:(0,N.jsx)(ke.A,{defaultMessage:"Basics",id:"label.basics.8fdd2ee8"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"password",ariaLabel:n({id:"label.password_nav_tab.0364e2a5",defaultMessage:"Password nav tab"}),children:(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"images",ariaLabel:n({id:"label.avatar_banner_nav_tab.87bd4bbb",defaultMessage:"Avatar banner nav tab"}),children:(0,N.jsx)(ke.A,{defaultMessage:"Avatar & Banner",id:"label.avatar_and_banner.507fae07"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"emails",ariaLabel:n({id:"label.email_tab.214be116",defaultMessage:"email tab"}),children:(0,N.jsx)(ke.A,{defaultMessage:"Emails",id:"label.emails.37319762"})})})]})})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:c,show:A,variant:"danger",children:A}),(0,N.jsx)(We.A,{dismissible:!0,onClose:h,show:S,variant:"success",children:S}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"basics",children:(0,N.jsx)(VA,{user:C})}),(0,N.jsx)(ld.A.Pane,{eventKey:"emails",children:(0,N.jsx)(UA,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"images",children:(0,N.jsx)(WA,{handleAvatarSubmit:v,handleBannerSubmit:j,handleDeleteAvatar:f,handleDeleteBanner:_,user:C})}),(0,N.jsx)(ld.A.Pane,{eventKey:"password",children:(0,N.jsx)(HA,{handlePasswordReset:p,handlePasswordSubmit:x})})]})})})]})})})]})})});DA.displayName="EditUserModal";var BA=DA;const PA=l.createContext({}),LA=PA.Provider,OA=(PA.Consumer,()=>(0,l.useContext)(PA));var HA=e=>{const{handleHide:s,handlePasswordReset:a,handlePasswordSubmit:t}=OA(),{formatMessage:i}=(0,ja.A)(),{locale:n}=(0,P.nm)(),[r,o,d]=(0,ne.CQ)({resetting:!1,submitting:!1}),c=(0,l.useRef)(),h=async()=>{o({resetting:!0}),await a(),o({resetting:!1})},{resetting:u,submitting:m}=r;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Qe.A,{className:"mb-4",children:(0,N.jsxs)(Ve.A,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Reset password",id:"label.reset_password.e0edfeb3"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"If a user has forgotten their password, use the Reset Password function to generate a new password and have it emailed to them.",id:"label.if_a_user_has_forgotten_their_pass.08a1a170"})}),(0,N.jsx)(Me.p0,{loading:u,onClick:()=>{const e=null===c||void 0===c?void 0:c.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:"Yes",onClick:h,variant:"primary"})],body:"Would you like to send an email inform this user their account has been reset?",title:"Reset Password"})},children:(0,N.jsx)(ke.A,{defaultMessage:"Reset password",id:"label.reset_password.e0edfeb3"})})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(ds.l1,{onSubmit:async(e,s)=>{o({submitting:!0}),await t(e.password),o({submitting:!1}),await s.resetForm()},validationSchema:(0,Re.by)({locale:n,scope:"authentication.reset_password"}),initialValues:{disclaimer:!1,password:"",password_confirm:""},children:e=>{let{errors:a,handleChange:t,handleSubmit:l,touched:n,values:r}=e;return(0,N.jsx)(_e.A,{onSubmit:l,children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",md:12,children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Change password",id:"label.change_password.3f9c991f"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Alternatively, you may manually choose a new password for the user. This action will not trigger an email.",id:"label.alternatively_you_may_manually_cho.d9709777"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"New password",id:"label.new_password.3dd9df44"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"new password",isInvalid:n.password&&a.password,isValid:n.password&&!a.password,name:"password",onChange:t,readOnly:m,type:"password",value:r.password}),(0,N.jsx)(ds.Kw,{name:"password",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Confirm new password",id:"label.confirm_new_password.bf000421"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"confirm new password",isInvalid:n.password_confirm&&a.password_confirm,isValid:n.password_confirm&&!a.password_confirm,name:"password_confirm",onCh
2ange:t,readOnly:m,type:"password",value:r.password_confirm}),(0,N.jsx)(ds.Kw,{name:"password_confirm",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{className:"align-middle",children:[(0,N.jsx)(_e.A.Check,{"aria-label":"disclaimer",checked:r.disclaimer?"checked":"",isInvalid:n.disclaimer&&a.disclaimer,name:"disclaimer",onChange:t,readOnly:m,type:"checkbox",value:r.disclaimer,label:i({id:"label.i_acknowledge_that_i_am_changing_a.db9ac429",defaultMessage:"I acknowledge that I am changing another user's password"})}),(0,N.jsx)(ds.Kw,{name:"disclaimer",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:["function"===typeof s&&(0,N.jsx)(ve.A,{className:"me-1",disabled:m||u,onClick:s,size:"xl",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disabled:!r.password||!r.password_confirm||!r.disclaimer||m,loading:m,size:"xl",type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})})})}}),(0,N.jsx)(je,{ref:c})]})};var UA=e=>{var s,a,t,i,r,o,d,c,h,u,m,g;const{handleEmailSubmit:p,handleHide:x,user:v}=OA(),{locale:f,styles:j}=(0,n.nm)(),_=(0,l.useRef)(),[b,A]=(0,l.useState)(!1),y=null===v||void 0===v?void 0:v.emails.filter(e=>e.id!==v.default_email_id),w=e.emails||{email1:null!==(s=null===v||void 0===v||null===(a=v.default_email)||void 0===a?void 0:a.email_address)&&void 0!==s?s:"",email2:null!==(t=null===y||void 0===y||null===(i=y[0])||void 0===i?void 0:i.email_address)&&void 0!==t?t:"",email3:null!==(r=null===y||void 0===y||null===(o=y[1])||void 0===o?void 0:o.email_address)&&void 0!==r?r:"",ver1:null!==(d=null===v||void 0===v||null===(c=v.default_email)||void 0===c?void 0:c.verified)&&void 0!==d?d:"",ver2:null!==(h=null===y||void 0===y||null===(u=y[0])||void 0===u?void 0:u.verified)&&void 0!==h?h:"",ver3:null!==(m=null===y||void 0===y||null===(g=y[1])||void 0===g?void 0:g.verified)&&void 0!==m?m:""},S=(e,s)=>1===s?w.email1===e.email1||w.email2===e.email1||w.email3===e.email1:2===s?w.email1===e.email2||w.email2===e.email2||w.email3===e.email2:3===s?w.email1===e.email3||w.email2===e.email2||w.email3===e.email3:void 0,C=(e,s,a)=>{if(2==a||3==a){let t="";2===a&&(t=s.email2,e("email2",s.email1),e("email1",t),t=s.ver2,e("ver2",s.ver1),e("ver1",t)),3===a&&(t=s.email3,e("email3",s.email1),e("email1",t),t=s.ver3,e("ver3",s.ver1),e("ver1",t))}},{email1:M,email2:k,email3:z,ver1:T,ver2:I,ver3:E}=w,F=j&&j.primary;return(0,N.jsx)(ds.l1,{onSubmit:async e=>{A(!0),await p(e.email1,e.email2,e.email3),A(!1)},validationSchema:(0,Re.by)({locale:f,scope:"user.profile_contact"}),initialValues:{email1:M,email2:k,email3:z,ver1:T,ver2:I,ver3:E},children:e=>{_.current=e;const{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Primary email",id:"label.primary_email.d535ab1a"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"primary email",isInvalid:l.email1&&s.email1,name:"email1",onChange:a,placeholder:"Enter email",readOnly:b,type:"email",value:n.email1}),n.ver1&&S(n,1)?(0,N.jsx)(Ei.A.Text,{variant:"outline-primary",style:{borderColor:F,color:F},children:(0,N.jsx)(ke.A,{defaultMessage:"Verified",id:"label.verified.4f783840"})}):(0,N.jsx)(Ei.A.Text,{style:{borderColor:"red",color:"red"},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Unverified",id:"label.unverified.33c8e8de"})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(ds.Kw,{name:"email1",children:e=>(0,N.jsx)("small",{className:"text-danger my-1",children:e})}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"We'll never share your email with anyone else.",id:"label.well_never_share_your_email_with_a.2453687a"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Alternate emails",id:"label.alternate_emails.2b46b81e"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"secondary email",isInvalid:l.email2&&s.email2,name:"email2",onChange:a,placeholder:"Enter email",readOnly:b,type:"email",value:n.email2}),(0,N.jsx)(ve.A,{disabled:!n.email2.length||s.email2||b,onClick:()=>C(i,n,2),variant:""+(b||!n.email2.length||s.email2?"link":"outline-primary"),children:(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})}),n.email2?n.ver2&&S(n,2)?(0,N.jsx)(Ei.A.Text,{disabled:!0,style:{borderColor:F,color:F},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Verified",id:"label.verified.4f783840"})}):(0,N.jsx)(Ei.A.Text,{style:{borderColor:"red",color:"red"},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Unverified",id:"label.unverified.33c8e8de"})}):""]}),(0,N.jsx)(ds.Kw,{name:"email2",children:e=>(0,N.jsx)("small",{className:"text-danger my-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"third email",isInvalid:l.email3&&s.email3,name:"email3",onChange:a,placeholder:"Enter email",readOnly:b,type:"email",value:n.email3}),(0,N.jsx)(ve.A,{disabled:!n.email3.length||s.email3,onClick:e=>C(i,n,3),variant:""+(b||!n.email3.length||s.email3?"link":"outline-primary"),children:(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})}),n.email3?n.ver3&&S(n,3)?(0,N.jsx)(Ei.A.Text,{disabled:!0,style:{borderColor:F,color:F},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Verified",id:"label.verified.4f783840"})}):(0,N.jsx)(Ei.A.Text,{style:{borderColor:"red",color:"red"},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Unverified",id:"label.unverified.33c8e8de"})}):""]}),(0,N.jsx)(ds.Kw,{name:"email3",children:e=>(0,N.jsx)("small",{className:"text-danger my-1",children:e})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:["function"===typeof x&&(0,N.jsx)(ve.A,{className:"me-1",onClick:x,size:"xl",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{loading:b,size:"xl",type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})};const QA={id:-1,fullname:""};var VA=e=>{const{handleBasicsSubmit:s}=OA(),a=(null===e||void 0===e?void 0:e.user)||QA,{id:t,app_banned_at:i,fullname:n,lara_banned_at:r}=a||{},o=(0,l.useRef)(),d=(0,l.useRef)(),{locale:c}=(0,P.nm)(),[h,u,m]=(0,ne.CQ)({loading:!1}),{loading:g}=h,p=async e=>{const{loading:s}=h,a=o.current;if(!a||s)return;const{setFieldValue:t}=a,i=e.target.checked;await t("block_app_access",i)},x=async e=>{var s;const a=null===o||void 0===o?void 0:o.current;a&&(a.setFieldTouched(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.name,!0),a.handleChange(e))},v={block_app_access:!!i,block_lara_mentioning:!!r,fullname:n};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ds.l1,{initialValues:v,onSubmit:async e=>{const a=null===d||void 0===d?void 0:d.current;if(!a)return;const{block_app_access:i,block_lara_mentioning:l,fullname:n}=e,r=i?ci()():null,o=l?ci()():null;u({loading:!0}),await a.show({actions:[a.CancelAction(),a.Action({label:"Update",onClick:async()=>{await s({app_banned_at:r,fullname:n,lara_banned_at:o,user_id:t}),u({loading:!1})},variant:"primary"})],body:"Are you sure you want to override this user information and update it?",onHide:()=>u({loading:!1}),size:"sm",title:"Update User Info"})},validationSchema:(0,Re.by)({locale:c,scope:"user.profile_basics"}),children:e=>{o.current=e;const{errors:s,handleSubmit:a,initialValues:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:a,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"name",isInvalid:i.fullname&&s.fullname,name:"fullname",onChange:x,readOnly:g,type:"text",value:l.fullname}),s.fullname&&i.fullname&&(0,N.jsx)(ds.Kw,{name:"last_name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Switch,{checked:l.block_app_access,id:"blockAppAccessSwitch",onChange:p,label:(0,N.jsx)(ke.A,{defaultMessage:"Block user's access to the application",id:"label.block_users_access_to_the_applicat.21c6dcc9"})})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(Me.p0,{disabled:g||(0,T.isEqual)(l,t),loading:g,size:"xl",type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})}}),(0,N.jsx)(je,{ref:d})]})};const GA=l.forwardRef((e,s)=>{let{children:a,onClick:t}=e;return(0,N.jsxs)(ve.A,{ref:s,onClick:e=>{e.preventDefault(),t(e)},children:[(0,N.jsx)(ze.Mbp,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]})});var WA=e=>{var s,a,t,i;const{formatMessage:n}=(0,ja.A)(),{default_banner:r}=(0,P.hc)(),{handleAvatarSubmit:o,handleBannerSubmit:d,handleDeleteAvatar:c,handleDeleteBanner:h,user:u}=OA();let m=(null===u||void 0===u||null===(s=u.banner)||void 0===s?void 0:s.location)||r,g=(0,l.useRef)(null),p=(0,l.useRef)(null);const x=(0,l.useRef)(),v=(0,F.A)({},u);null!==v&&void 0!==v&&null!==(a=v.avatar)&&void 0!==a&&a.location||(v.avatar={location:Wa});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)("div",{className:"position-relative mb-4 mx-auto",style:{height:150,width:150},children:[(0,N.jsx)(Ya,{showOnline:!1,showTooltip:!1,size:150,user:v}),(0,N.jsxs)(li.A,{style:{bottom:10,position:"absolute",right:-25},children:[(0,N.jsx)(li.A.Toggle,{as:GA,size:"sm"}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{var e;return null===g||void 0===g||null===(e=g.current)||void 0===e?void 0:e.show()},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})}),(null===u||void 0===u||null===(t=u.avatar)||void 0===t?void 0:t.location)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{const e=null===x||void 0===x?void 0:x.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:n({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:c,variant:"danger"})],body:n({id:"label.are_you_sure_you_want_to_delete_th.3a83d5d2",defaultMessage:"Are you sure you want to delete this user's avatar image?"}),title:n({id:"label.delete_avatar.c2b1ed6e",defaultMessage:"Delete avatar"})})},children:(0,N.jsx)(ke.A,{defaultMessage:"Delete image",id:"label.delete_image.fbbc98ee"})})]})]})]})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)("div",{className:"position-relative",children:[(0,N.jsx)(hd.R,{fluid:!0,rounded:!0,alt:"User Banner",height:188,src:m,width:"100%"}),(0,N.jsxs)(li.A,{style:{bottom:15,position:"absolute",right:"2.5%"},children:[(0,N.jsx)(li.A.Toggle,{as:GA,size:"sm",variant:"primary"}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{var e;return null===p||void 0===p||null===(e=p.current)||void 0===e?void 0:e.show()},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})}),(null===u||void 0===u||null===(i=u.banner)||void 0===i?void 0:i.location)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{const e=null===x||void 0===x?void 0:x.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:n({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:h,variant:"danger"})],body:n({id:"label.are_you_sure_you_want_to_delete_th.63098b44",defaultMessage:"Are you sure you want to delete this user's banner image?"}),title:n({id:"label.delete_banner.06ad5073",defaultMessage:"Delete banner"})})},children:(0,N.jsx)(ke.A,{defaultMessage:"Delete image",id:"label.delete_image.fbbc98ee"})})]})]})]})]})})]}),(0,N.jsx)(je,{ref:x}),(0,N.jsx)(FA,{handleAvatarSubmit:o,ref:g}),(0,N.jsx)(RA,{handleBannerSubmit:d,ref:p})]})};var KA=(0,n.G0)(function(e){if(!e.type)return null;let s="";const{styles:a}=e.app,t=a&&a["gray-100"];switch(e.type){case 0:case 4:s=(0,N.jsx)(Va.Ay,{color:t,fgColor:"black",name:"Learning Tools Interoperability",round:!0,size:30,style:{verticalAlign:"initial"},title:"LTI user"})}return(0,N.jsx)("div",{className:"user-integration-icon",children:s})});const YA=e=>{const{user:s}=e,{styles:a}=(0,n.nm)();return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ce.S,{style:{fontSize:14,fontWeight:500},children:(null===s||void 0===s?void 0:s.fullname)||""})})};YA.defaultProps={user:{}};var qA=YA;const JA=e=>{const{overflow:s,showTooltip:a,style:t}=e,i=(null===t||void 0===t?void 0:t.height)||(null===t||void 0===t?void 0:t.width),l=(null===e||void 0===e?void 0:e.size)||i;return t.width=(null===t||void 0===t?void 0:t.width)||l,t.height=(null===t||void 0===t?void 0:t.height)||l,isNaN(Number(null===s||void 0===s?void 0:s.length))?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(Oa,{condition:a,wrapper:e=>(0,N.jsx)(Ua.A,{overlay:(0,N.jsx)(Qa.A,{children:(0,N.jsx)("ul",{className:"text-light list-unstyled d-flex flex-column align-items-start fw-bold small mb-0",children:(null===s||void 0===s?void 0:s.length)&&s.map((e,s)=>{let{fullname:a}=e;return(0,N.jsx)("li",{children:a},s)})})}),children:(0,N.jsx)("div",{style:{width:"max-content"},children:e})}),children:(0,N.jsx)(Ce.S,{className:"stacked-user-icons-overflow user-icon",style:t,children:(0,N.jsxs)("strong",{className:"overflow-amount small",children:["+",(null===s||void 0===s?void 0:s.length)||0]})})})};JA.defaultProps={overflow:[],overflowAmount:0,showTooltip:!1,style:{}};var XA=JA;const ZA=e=>{var s,a;const{customContents:t,customLogo:i,customMenu:n,homeLink:r,showLogin:o}=e,{isBelowBreakpoint:d}=(0,ne.vh)({breakpoint:922}),{api:c,getGroupMemberships:h,getUserOrganization:u,isLoggedIn:m,organization:g,siteUrl:p,user:x,userIsEcommerce:v,userIsFacilitator:f,userIsLearner:j,userIsModerator:_,userIsOrgAdmin:b}=(0,P.nm)(),A=(0,l.useRef)(),[y,w,S]=(0,ne.CQ)({error:null,loading:!0,organization:null}),C=e=>{var s,a,t,i;let r;switch(e){case"logged_in_left":r=null===n||void 0===n||null===(s=n.logged_in)||void 0===s?void 0:s.left;break;case"logged_in_right":r=null===n||void 0===n||null===(a=n.logged_in)||void 0===a?void 0:a.right;break;case"logged_out_left":r=null===n||void 0===n||null===(t=n.logged_out)||void 0===t?void 0:t.left;break;case"logged_out_right":r=null===n||void 0===n||null===(i=n.logged_out)||void 0===i?void 0:i.right;break;default:return(0,N.jsx)(N.Fragment,{})}return Array.isArray(r)?(0,N.jsx)(N.Fragment,{children:r.map((e,s)=>(0,N.jsx)(l.Fragment,{children:e},s))}):(0,N.jsx)(N.Fragment,{children:r})},M=()=>{var s,a,t;const i=document.location.host,l=i===p||!i;let{organization_slug:n}=null!==(s=null===e||void 0===e||null===(a=e.match)||void 0===a?void 0:a.params)&&void 0!==s?s:{},r=i.split("."),o=r.length?r[0]:"";return!(!(!l&&o||n)||!(null!==g&&void 0!==g&&g.enable_portal||null!==y&&void 0!==y&&null!==(t=y.organization)&&void 0!==t&&t.enable_portal))};(0,l.useEffect)(()=>((()=>{var s,a,t;if(null!==g&&void 0!==g&&g.logo_path||null!==(s=u())&&void 0!==s&&s.logo_path)return;let{organization_slug:i}=null!==(a=null===e||void 0===e||null===(t=e.match)||void 0===t?void 0:t.params)&&void 0!==a?a:{};!i&&g&&(i=null===g||void 0===g?void 0:g.slug),i&&c.get(`/api/organizations/get/basic/${i}`).then(e=>{let{organization:s}=e;w(e=>(0,F.A)((0,F.A)({},e),{},{loading:!1,organization:s}))}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(s),w(e=>(0,F.A)((0,F.A)({},e),{},{error:s,loading:null}))})})(),S),[]);const k=(null===(s=u())||void 0===s?void 0:s.logo_path)||(null===g||void 0===g?void 0:g.logo_path)||(null===y||void 0===y||null===(a=y.organization)||void 0===a?void 0:a.logo_path)||null;let z=i||Ye,T="/";return"string"===typeof r&&r&&(T=r),(0,N.jsx)("header",{className:"top-navigation",children:m?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(sa.A,{collapseOnSelect:!0,className:"px-3",expand:"lg",fixed:"top",id:"main_nav",role:"navigation",children:t?(0,N.jsx)(N.Fragment,{children:t}):(0,N.jsxs)(N.Fragment,{children:[M()&&k&&(0,N.jsx)(sa.A.Brand,{className:"d
2-none d-lg-inline portal-header-logo",style:{backgroundImage:`url(${k})`}}),(0,N.jsx)(sa.A.Brand,{className:"top-nav-brand",children:(0,N.jsx)(Le.Link,{"aria-label":"Go to Solvably Home",to:T,children:(0,N.jsx)(Zs.A,{alt:"Solvably logo",src:z})})}),(0,N.jsx)(sa.A.Toggle,{}),(0,N.jsxs)(sa.A.Collapse,{children:[(0,N.jsxs)(aa.A,{className:"me-auto topnav-menu-left",children:[(0,N.jsx)(pa.mu,{to:"/home",children:(0,N.jsxs)(aa.A.Link,{className:"link-col-flex",href:"/home",children:[(0,N.jsx)(ze.rQ8,{size:22}),(0,N.jsx)(ke.A,{defaultMessage:"Home",id:"label.home.3a786953"})]})}),(f()||_()||b())&&(0,N.jsx)(pa.mu,{to:"/admin/content",children:(0,N.jsxs)(aa.A.Link,{className:"link-col-flex",children:[(0,N.jsx)(va.default,{fontSize:22}),(0,N.jsx)(ke.A,{defaultMessage:"Content",id:"label.content.47bd2907"})]})}),(f()||_()||b())&&!v()&&(0,N.jsx)(pa.mu,{to:"/admin/challenge-templates",children:(0,N.jsxs)(aa.A.Link,{className:"link-col-flex",children:[(0,N.jsx)(ze.IFh,{size:22,style:{padding:"2px 0"}}),(0,N.jsx)(ke.A,{defaultMessage:"Design lab",id:"label.design_lab.9055ff21"})]})}),(j()||f())&&h(!1).length>0&&(0,N.jsx)(pa.mu,{to:"/gallery",children:(0,N.jsxs)(aa.A.Link,{className:"link-col-flex",href:"/gallery",children:[(0,N.jsx)(ze.m8Q,{size:22}),(0,N.jsx)(ke.A,{defaultMessage:"Gallery",id:"label.gallery.352cfc74"})]})}),v()&&(0,N.jsx)(pa.mu,{to:"/marketplace/talent",children:(0,N.jsxs)(aa.A.Link,{className:"link-col-flex",href:"/marketplace/talent",children:[(0,N.jsx)(ze.Tvt,{size:22}),(0,N.jsx)(ke.A,{defaultMessage:"Marketplace",id:"label.marketplace.c608981d"})]})}),C("logged_in_left")]}),(0,N.jsxs)(aa.A,{className:"topnav-menu-right ms-auto",children:[C("logged_in_right"),(f()||_())&&(0,N.jsx)(oy,{}),(0,N.jsx)(iy,{}),(0,N.jsxs)(ta.A,{align:"end",className:"btn-quaternary mb-3 mb-lg-0",id:"nav-dropdown",role:"button",title:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ya,{className:"me-2 m-lg-0",showOnline:!1,size:24,user:x}),(0,N.jsx)("span",{className:!d&&"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Account",id:"label.account.7e1b0d56"})})]}),children:[(0,N.jsx)(pa.mu,{to:"/portfolio",children:(0,N.jsx)(ta.A.Item,{active:!1,children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ya,{showOnline:!1,size:35,user:x})}),(0,N.jsxs)(Ce.S,{className:"ms-3",children:[(0,N.jsx)("h5",{className:"mb-0",style:{color:"#000"},children:(0,N.jsx)(ga,{user:x})}),(0,N.jsxs)("b",{className:"text-primary",children:[(0,N.jsx)(ke.A,{defaultMessage:"View ePortfolio",id:"label.view_eportfolio.a211e18e"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]})]})]})})}),(0,N.jsx)(ta.A.Divider,{}),(0,N.jsx)(ta.A.Item,{onClick:e=>{e.preventDefault(),A.current.showModal()},children:(0,N.jsx)(ke.A,{defaultMessage:"Switch organizations",id:"label.switch_organizations.767320ca"})}),(0,N.jsx)(pa.mu,{to:"/profile",children:(0,N.jsx)(ta.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Account settings",id:"label.account_settings.a587aa1f"})})}),(0,N.jsx)(ta.A.Divider,{}),(0,N.jsx)(ta.A.Header,{children:"Help"}),(0,N.jsx)(ta.A.Item,{active:!1,as:Le.Link,to:"/support",children:(0,N.jsx)(ke.A,{defaultMessage:"Knowledge base",id:"label.knowledge_base.f56819a3"})}),(0,N.jsx)(ta.A.Divider,{}),(0,N.jsx)(pa.mu,{to:"/logout",children:(0,N.jsx)(ta.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Log out",id:"label.log_out.49616145"})})})]}),(0,N.jsx)(ay,{ref:A})]})]}),(0,N.jsx)(ia,{})]})})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(sa.A,{collapseOnSelect:!0,expand:"lg",fixed:"top",id:"main_nav",role:"navigation",children:(0,N.jsxs)(Ue.A,{children:[M()&&k&&(0,N.jsx)(sa.A.Brand,{className:"d-none d-lg-inline portal-header-logo",style:{backgroundImage:`url(${k})`}}),(0,N.jsx)(sa.A.Brand,{children:(0,N.jsx)(Le.Link,{"aria-label":"Go to Solvably Home",to:T,children:(0,N.jsx)(Zs.A,{alt:"Solvably logo",src:z})})}),(0,N.jsx)(sa.A.Toggle,{}),(0,N.jsxs)(sa.A.Collapse,{className:"justify-content-between navbar-logged-out",children:[n&&(0,N.jsx)(aa.A,{className:"topnav-menu-left",children:C("logged_out_left")}),(0,N.jsxs)(aa.A,{className:"topnav-menu-right ms-auto",children:[C("logged_out_right"),(0,N.jsx)(aa.A.Link,{"aria-label":"Log in",as:ve.A,className:"login-btn ms-2",onClick:o,children:(0,N.jsx)(ke.A,{defaultMessage:"Log in",id:"label.log_in.c189840c"})})]})]})]})})})})};ZA.defaultProps={};var $A=(0,Pe.y)(ZA);const ey=e=>{const{id:s,alignItems:a,checked:t,label:i,name:l,onClick:n,style:r,type:o}=e;return(0,N.jsxs)(Ce.S,{className:"styled-checkbox d-flex "+(a?`align-items-${a}`:""),style:(0,F.A)({},r),children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",onClick:n,children:[(0,N.jsx)(_e.A.Control,(0,F.A)((0,F.A)({},e),{},{checked:t,id:s,name:l,type:o})),(0,N.jsx)(Ce.S,{className:"inner d-flex align-items-center justify-content-center",children:(0,N.jsx)("span",{className:""+(t?"selected":"")}
2)})]}),!!i&&(0,N.jsx)(_e.A.Label,{className:"ms-2",htmlFor:"name",children:i})]})};ey.defaultProps={checked:!1,style:{},type:"checkbox"};var sy=ey;var ay=(0,l.forwardRef)(function(e,s){const{onHide:a}=e,t=(0,Pe.W6)(),{forceRemount:i,getAllUserOrganizations:r,getUserOrganizationId:o,getUserSiteRole:d,setUserOrganizationId:c}=(0,n.nm)(),[h,u,m]=(0,ne.CQ)({selected_organization_id:o(),show:!1}),g=()=>{u({show:!0})},p=()=>{"function"===typeof a&&a(),u(e=>(0,F.A)((0,F.A)({},e),{},{show:!1}))},x=e=>{u({selected_organization_id:e})};(0,l.useImperativeHandle)(s,()=>({hideModal:p,showModal:g})),(0,l.useEffect)(()=>m,[]);const v=r(),f=d(),j=!f&&(!v||!v.length);return(0,N.jsxs)(xe,{id:"organizationSelectorModal",onHide:p,show:h.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select an Organization",description:"",id:"label.select_an_organization.3f89c932"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(Ce.S,{className:"notifications-list",children:[f&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center list-item",onClick:()=>x(null),tabindex:"0",children:[(0,N.jsx)(Ce.S,{className:"text-center",style:{width:40},children:(0,N.jsx)(sy,{checked:null===h.selected_organization_id,type:"radio"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably",description:"",id:"label.solvably.c7989556"})})," ",(0,N.jsx)(ze.Eh_,{}),(0,N.jsx)("br",{}),null===f||void 0===f?void 0:f.name]})]}),(0,N.jsx)("hr",{})]}),v.map((e,s)=>{let{organization:a,role:t}=e,{id:i}=a,n=(null===v||void 0===v?void 0:v.length)===s+1;return(0,N.jsxs)(l.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center list-item",onClick:()=>x(i),tabindex:"0",children:[(0,N.jsx)(Ce.S,{className:"text-center",style:{width:40},children:(0,N.jsx)(sy,{checked:h.selected_organization_id===i,id:i,type:"radio"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("b",{children:null===a||void 0===a?void 0:a.name}),(0,N.jsx)("br",{}),t?null===t||void 0===t?void 0:t.name:(0,N.jsx)(ke.A,{defaultMessage:"Learner",id:"label.learner.0815286c"})]})]}),!n&&(0,N.jsx)("hr",{})]},s)}),j&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ke.A,{defaultMessage:"You do not have any available memberships",description:"",id:"label.you_do_not_have_any_available_memb.e96fdf04"})})})]})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:h.saving,onClick:p,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),!j&&(0,N.jsx)(ve.A,{disabled:0===h.selected_organization_id,onClick:async()=>{0!=h.selected_organization_id&&(c(h.selected_organization_id,!0),t.push("/"),i())},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Select",id:"label.select.2a78025d"})})]})]})});var ty=e=>{const{className:s="",count:a,icon:t,show:i,sr_label:l}=e;return(0,N.jsxs)(Ce.S,{className:`badge-icon ${s}`,children:[t||(0,N.jsx)(N.Fragment,{}),i?(0,N.jsx)(bo.A,{bg:"danger",className:"count text-white",children:(0,N.jsx)("span",{className:"counter",children:a})}):(0,N.jsx)(N.Fragment,{}),(0,N.jsx)("span",{className:"visually-hidden",children:l})]})};var iy=s=>{const{api:a,subscribeNotifications:t,unsubscribeNotifications:i,userId:n}=(0,P.nm)(),{isBelowBreakpoint:r}=(0,ne.vh)({breakpoint:922}),o=(0,l.useRef)(),[d,c,h]=(0,ne.CQ)({count:0,error:null,loading:!0,page:1,page_size:5,unread_count:0,user_notifications:[],visible:!1}),{loading:u,user_notifications:m}=d,g=async()=>{try{const{page:e,page_size:s}=d,{count:t,unread_count:i,user_notifications:l}=await a.get(`/api/users/notifications/list/${e}/${s}`);c({count:t,loading:!1,unread_count:i,user_notifications:Array.isArray(l)?l:[]})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},p=async()=>{try{await a.post("/api/users/notifications/seen")}catch(e){(0,xa.Err)((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e)}},x=e=>{c(s=>(s.user_notifications.unshift(e),(0,F.A)((0,F.A)({},s),{},{count:s.count+1,page_size:s.user_notifications.length,unread_count:s.unread_count+1,user_notifications:s.user_notifications})))},v=()=>{const e=null===o||void 0===o?void 0:o.current;e&&(f(),e.show())},f=()=>{d.visible?(c({visible:!1}),setTimeout(p,1e3)):(g(),c({visible:!0}))};return(0,l.useEffect)(()=>((async()=>{await g(),await t({id:n,callback:x})})(),async()=>{await i(n),h()}),[]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ta.A,{align:"end",className:"btn-quaternary notifications-dropdown",show:d.show,onToggle:()=>{d.show?(g(),c(e=>(0,F.A)((0,F.A)({},e),{},{show:!1}))):(c(e=>(0,F.A)((0,F.A)({},e),{},{show:!0})),setTimeout(p,1e3))},title:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ty,{count:d.unread_count,icon:(0,N.jsx)(ze.jNV,{className:"me-1",size:!r&&22}),show:!!d.unread_count,sr_label:"Notifications"}),r&&(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Notifications",id:"label.notifications.78801183"})})]}),children:[(0,N.jsx)("h5",{className:"mt-1 ms-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Notifications",id:"label.notifications.78801183"})}),(0,N.jsxs)(Me.x_,{loading:u,spinner:(0,N.jsx)(ta.A.Item,{className:"d-flex justify-content-center align-items-center",children:(0,N.jsx)(Me.y$,{})}),children:[null!==m&&void 0!==m&&m.length?(0,N.jsx)(N.Fragment,{children:m.map((e,s)=>{const{data:a,event_token:t,has_seen:i}=e;let l=uy(t,a);if(l)return(0,N.jsx)(ta.A.Item,{as:"div",className:"p-0 "+(i?"":"notification-new"),onClick:v,children:(0,N.jsx)(ry,{notification:l,user_notification:e})},s)})}):(0,N.jsx)(ta.A.Item,{disabled:!0,className:"p-2 text-center",style:{minWidth:275}
2,children:(0,N.jsx)(ke.A,{defaultMessage:"No notifications found",id:"label.no_notifications_found.43817f37"})}),(0,N.jsx)(Ce.S,{className:"mt-1",children:(0,N.jsx)(ve.A,{className:"notifications-more text-center",disabled:!(null!==m&&void 0!==m&&m.length),onClick:v,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"See all",id:"label.see_all.d7a8c446"})})})]})]}),(0,N.jsx)(ny,{ref:o})]})};const ly=(0,l.forwardRef)((s,a)=>{const{onHide:t}=s,{api:i}=(0,P.nm)(),[n,r,o]=(0,ne.CQ)({count:0,error:null,loading:!1,page:1,page_size:5,user_notifications:[],visible:!1}),{count:d,error:c,loading:h,page:u,page_size:m,user_notifications:g,visible:p}=n,x=()=>{f(),r({visible:!0})},v=()=>{"function"===typeof t&&t(),o()},f=async()=>{try{const{page:e,page_size:s}=n;r({error:null,loading:!0});const{count:a,unread_count:t,user_notifications:l}=await i.get(`/api/users/notifications/list/${e}/${s}`);r({count:a,loading:!1,unread_count:t,user_notifications:Array.isArray(l)?l:[]})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;r({error:a,loading:!1})}};return(0,l.useImperativeHandle)(a,()=>({hide:v,show:x,visible:p})),(0,l.useEffect)(()=>o,[]),(0,N.jsxs)(xe,{id:"notificationsModal",onHide:v,show:p,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Notifications",id:"label.notifications.78801183"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:c,variant:"danger",children:c}),(0,N.jsxs)(Me.x_,{loading:h,children:[(0,N.jsx)(Ce.S,{className:"notifications-list d-flex flex-column",children:null!==g&&void 0!==g&&g.length?(0,N.jsx)(N.Fragment,{children:g.map((e,s)=>{const{data:a,event_token:t,has_seen:i}=e;let l=uy(t,a);if(l)return(0,N.jsx)(Ce.S,{className:`notification-item-wrapper ${i?"":"notification-new"} py-1`,children:(0,N.jsx)(ry,{notification:l,user_notification:e})},s)})}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center p-5",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No notifications found",id:"label.no_notifications_found.43817f37"})})})}),(0,N.jsx)(Ce.S,{className:"mt-3",children:(0,N.jsx)(Pr,{count:d,onChange:e=>r({page:e},f),page:u,page_size:m})})]})]})]})});ly.displayName="NotificationsModal",ly.defaultProps={onHide:Function()};var ny=ly;var ry=e=>{const{notification:s,user_notification:a}=e,{created_at:t}=a||{},{content:i,icon:l}=s||{};return(0,N.jsxs)("div",{className:"notification-item notification p-3",children:[(0,N.jsx)(Ce.S,{className:"pull-right",children:(0,N.jsx)("small",{className:"notification-time text-muted me-1",children:(0,N.jsx)(La,{value:t})})}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"notification-icon d-flex d-flex-column",children:(0,N.jsx)(Zs.A,{alt:"notification",className:"ms-1 me-2",src:l})}),(0,N.jsx)(Ce.S,{className:"notification-body d-flex flex-column",children:(0,N.jsx)("h6",{className:"mb-0 me-2",children:i})})]})]})};var oy=e=>{const{api:s,getUserOrganizationId:a}=(0,P.nm)(),{isBelowBreakpoint:t}=(0,ne.vh)({breakpoint:922}),[i,n,r]=(0,ne.CQ)({count:0,error:null,loading:!0,page:1,page_size:5,todos:[]}),o=async()=>{const{page:e,page_size:t}=i,l=a();n(e=>(0,F.A)((0,F.A)({},e),{},{error:null,loading:!0})),await s.get(`/api/facilitators/todos/${e}/${t}`,{organization_id:l}).then(e=>{let{count:s,todo_list:a}=e;const t=(null===i||void 0===i?void 0:i.todos)||[],l=Array.isArray(a)?[...t,...a]:[];n(e=>(0,F.A)((0,F.A)({},e),{},{count:s,loading:!1,todos:l}))}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n(e=>(0,F.A)((0,F.A)({},e),{},{error:s,loading:!1}))})};(0,l.useEffect)(()=>{(async()=>{await o()})()},[i.page]);const d=i.count>i.page*i.page_size;return(0,N.jsx)(ta.A,{align:"end",className:"dropdown-outline grading-dropdown btn-quaternary",disabled:i.loading,id:"nav-dropdown",title:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ty,{count:i.count,icon:(0,N.jsx)(ze.w8j,{className:"me-1"}),show:!!i.count,sr_label:"Awaiting Scoring"}),t&&(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Awaiting scoring",id:"label.awaiting_scoring.ff236bdb"})})]}),children:(0,N.jsxs)(Ce.S,{style:{maxHeight:"70vh",overflowY:"auto"},children:[(0,N.jsx)("h5",{className:"mt-1 ms-3 text-capitalize",children:(0,N.jsx)(ke.A,{defaultMessage:"Awaiting scoring",description:"",id:"label.awaiting_scoring.ff236bdb"})}),i.loading?(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsxs)(N.Fragment,{children:[i.todos.map((e,s)=>{var a;let{challenge_template:t,group_assignment_component_id:l,team:n,updated_at:r}=e;if(!n)return(0,N.jsx)(N.Fragment,{});let{assignment:o}=n;
2if(!o)return(0,N.jsx)(N.Fragment,{});let{group:d}=o,{cover_path:c,title:h}=t||{},u=`/admin/group/${null===d||void 0===d?void 0:d.id}/assignment/${null===o||void 0===o?void 0:o.id}/challenge/${l}/grade/${null===e||void 0===e?void 0:e.id}`;return(0,N.jsxs)(ta.A.Item,{href:u,children:[(0,N.jsxs)(Ce.S,{className:"p-3 d-flex flex-row",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(Zs.A,{roundedCircle:!0,src:c,style:{height:40,width:40}})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{className:"mt-0",children:h}),(0,N.jsxs)("p",{className:"mb-0",children:[(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Team name",id:"label.team_name.0952fcc6"})}),(0,N.jsx)(bo.A,{pill:!0,bg:"primary",children:null===n||void 0===n?void 0:n.name}),(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Group name",id:"label.group_name.762ebb70"})}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"ms-1",text:"dark",children:null===d||void 0===d?void 0:d.name})]}),(0,N.jsx)("p",{className:"mb-0",children:(0,N.jsx)("small",{children:(0,N.jsx)(Gh.XU,{value:r})})})]})]}),s<(null===(a=i.todos)||void 0===a?void 0:a.length)-1&&(0,N.jsx)("hr",{className:"m-0"})]},s)}),0===i.todos.length&&(0,N.jsx)(Ce.S,{className:"p-2 text-center",style:{minWidth:275},children:(0,N.jsx)(ke.A,{defaultMessage:"You're all caught up.",id:"label.youre_all_caught_up.aebca556"})}),d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("hr",{className:"m-0"}),(0,N.jsx)(Ce.S,{className:"pt-2 text-center",children:(0,N.jsx)(ve.A,{onClick:()=>{n(e=>(0,F.A)((0,F.A)({},e),{},{page:e.page+1}),o)},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Load more",id:"label.load_more.ac8991ef"})})})]})]})]})})};var dy=t.p+"static/media/assigned.dd98f4823b7bc9588a7d870893e9c1b5.svg";var cy=t.p+"static/media/generic.a405a2b838ab5ce57b8bb1340b5060e5.svg";var hy=t.p+"static/media/chat.1336bbd14248814706671d70e69ee887.svg";var uy=(e,s)=>({assignment_date_changed:{content:(0,N.jsx)(ke.A,{defaultMessage:"An assignment has been updated",id:"label.an_assignment_has_been_updated.dd0c2714"}),event_token:"assignment_date_changed",icon:dy},assignment_due_d3:{content:(0,N.jsx)(ke.A,{defaultMessage:"Assignment due in 3 days",id:"label.assignment_due_in_3_days.ff4c7008"}),event_token:"assignment_due_d3",icon:dy},assignment_due_d7:{content:(0,N.jsx)(ke.A,{defaultMessage:"Assignment due in 7 days",id:"label.assignment_due_in_7_days.b3decd0a"}),event_token:"assignment_due_d7",icon:dy},assignment_new:{content:null!==s&&void 0!==s&&s.assignment_count?(0,N.jsx)(ke.A,{defaultMessage:"You have {assignment_count} new {assignment}!",id:"label.you_have_assignment_count_new_assi.fe126f35",values:{assignment:"assignment"+((null===s||void 0===s?void 0:s.assignment_count)>1?"s":""),assignment_count:null===s||void 0===s?void 0:s.assignment_count}}):(0,N.jsx)(ke.A,{defaultMessage:"You have a new assignment!",id:"label.you_have_a_new_assignment.ce37c2b1"}),event_token:"assignment_new",icon:dy},assignment_overdue:{content:(0,N.jsx)(ke.A,{defaultMessage:"Assignment is overdue",id:"label.assignment_is_overdue.27a0bb90"}),event_token:"assignment_overdue",icon:dy},certificate_denied:{content:(0,N.jsx)(ke.A,{defaultMessage:"Your certification request has been denied.",id:"label.your_certification_request_has_bee.a61ea3c0"}),event_token:"certificate_denied",icon:cy},certificate_granted:{content:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations!",i
2d:"label.congratulations.6a9fac33"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"You've been awarded a new certificate.",id:"label.youve_been_awarded_a_new_certifica.7292a4df"})})]}),event_token:"certificate_granted",icon:cy},challenge_accepted:{content:(0,N.jsx)(ke.A,{defaultMessage:"Accept and start your first assigned challenge",id:"label.accept_and_start_your_first_assign.bee35d7f"}),event_token:"challenge_accepted",icon:da},challenge_create_step_complete:{content:(0,N.jsx)(ke.A,{defaultMessage:"Challenge Reflect phase is open",id:"label.challenge_reflect_phase_is_open.9f282825"}),event_token:"challenge_create_step_complete",icon:cy},challenge_create_step_complete_d1:{content:(0,N.jsx)(ke.A,{defaultMessage:"Challenge Reflect phase is due",id:"label.challenge_reflect_phase_is_due.2e71481c"}),event_token:"challenge_create_step_complete_d1",icon:cy},challenge_inactivity_learner:{content:(0,N.jsx)(ke.A,{defaultMessage:"A team member has started the team challenge",id:"label.a_team_member_has_started_the_team.9ff08b4b"}),event_token:"challenge_inactivity_learner",icon:cy},challenge_inactivity_team:{content:(0,N.jsx)(ke.A,{defaultMessage:"It\u2019s time to start your team challenge!",id:"label.its_time_to_start_your_team_challe.bc62ce66"}),event_token:"challenge_inactivity_team",icon:cy},challenge_progress_d1_after:{content:(0,N.jsx)(ke.A,{defaultMessage:"Check your teams\u2019 final results",id:"label.check_your_teams_final_results.350364c8"}),event_token:"challenge_progress_d1_after",icon:cy},challenge_progress_d1_before:{content:(0,N.jsx)(ke.A,{defaultMessage:"Check your teams\u2019 final progress",id:"label.check_your_teams_final_progress.7dbc761f"}),event_token:"challenge_progress_d1_before",icon:cy},challenge_progress_midpoint:{content:(0,N.jsx)(ke.A,{defaultMessage:"Check your teams\u2019 mid-way progress",id:"label.check_your_teams_mid_way_progress.12ca935c"}),event_token:"challenge_progress_midpoint",icon:cy},chat_mention:{content:(0,N.jsx)(ke.A,{defaultMessage:"Someone has tagged you in your team chat",id:"label.someone_has_tagged_you_in_your_tea.0f944819"}),event_token:"chat_mention",icon:hy},chat_team:{content:(0,N.jsx)(ke.A,{defaultMessage:"You have missed chat messages",id:"label.you_have_missed_chat_messages.57d27c1b"}),event_token:"chat_team",icon:hy},chit_chat:{content:(0,N.jsx)(ke.A,{defaultMessage:"Send your 100th chat message",id:"label.send_your_100th_chat_message.fa9371e8"}),event_token:"chit_chat",icon:da},collaborator_added:{content:(0,N.jsx)(ke.A,{defaultMessage:"You have been added as a Collaborator",id:"label.you_have_been_added_as_a_collabora.6749ee4d"}),event_token:"collaborator_added",icon:cy},curator:{content:(0,N.jsx)(ke.A,{defaultMessage:"Upload your 5th asset",id:"label.upload_your_5th_asset.34d9995e"}),event_token:"curator",icon:da},email_delivery_failure:{content:(0,N.jsx)(ke.A,{defaultMessage:"Solvably emails have failed",id:"label.solvably_emails_have_failed.8bfdd3f1"}),event_token:"email_delivery_failure",icon:cy},file_storm:{content:(0,N.jsx)(ke.A,{defaultMessage:"Upload your 25th asset",id:"label.upload_your_25th_asset.d23d23b7"}),event_token:"file_storm",icon:da},flagged_message:{content:null!==s&&void 0!==s&&s.group_name?(0,N.jsx)(ke.A,{defaultMessage:"Chats have been flagged in {group_name}",id:"label.chats_have_been_flagged_in_group_n.dcb5cf15",values:{group_name:null===s||void 0===s?void 0:s.group_name}}):(0,N.jsx)(ke.A,{defaultMessage:"Chats have been flagged",id:"label.chats_have_been_flagged.90f232d4"}),event_token:"flagged_message",icon:hy},fly_on_the_wall:{content:(0,N.jsx)(ke.A,{defaultMessage:"View a classmates public portfolio for the first time",id:"label.view_a_classmates_public_portfolio.06a1e363"}),event_token:"fly_on_the_wall",icon:da},hello_world:{content:(0,N.jsx)(ke.A,{defaultMessage:"Send your first chat message",id:"label.send_your_first_chat_message.2def41b3"}),event_token:"hello_world",icon:da},incoming:{content:(0,N.jsx)(ke.A,{defaultMessage:"Upload your first asset",id:"label.upload_your_first_asset.f4ace287"}),event_token:"incoming",icon:da},librarian:{content:(0,N.jsx)(ke.A,{defaultMessage:"Upload your 10th asset",id:"label.upload_your_10th_asset.1bda9058"}),event_token:"librarian",icon:da},look_at_me:{content:(0,N.jsx)(ke.A,{defaultMessage:"Publish a completed challenge to your portfolio for the first time",id:"label.publish_a_completed_challenge_to_y.229aad4d"}),event_token:"look_at_me",icon:da},master_solver:{content:(0,N.jsx)(ke.A,{defaultMessage:"Complete your 5th challenge",id:"label.complete_your_5th_challenge.57613ae6"}),event_token:"master_solver",icon:da},mission_accomplished:{content:(0,N.jsx)(ke.A,{defaultMessage:"Complete your first challenge",id:"label.complete_your_first_challenge.a65f86b0"}),event_token:"mission_accomplished",icon:da},mission_briefing:{content:(0,N.jsx)(ke.A,{defaultMessage:"Watch the syllabus video for the first time",id:"label.watch_the_syllabus_video_for_the_f.eff896af"}),event_token:"mission_briefing",icon:da},motor_mouth:{content:(0,N.jsx)(ke.A,{defaultMessage:"Send your 1,000th chat message",id:"label.send_your_1000th_chat_message.f3273faf"}),event_token:"motor_mouth",icon:da},nostalgia:{content:(0,N.jsx)(ke.A,{defaultMessage:"View a previously completed challenge",id:"label.view_a_previously_completed_challe.ea04e4bc"}
2),event_token:"nostalgia",icon:da},novelist:{content:(0,N.jsx)(ke.A,{defaultMessage:"Send your 500th chat message",id:"label.send_your_500th_chat_message.a8309618"}),event_token:"novelist",icon:da},phase_shifter:{content:(0,N.jsx)(ke.A,{defaultMessage:"Make a change to a previously completed phase",id:"label.make_a_change_to_a_previously_comp.844d38ad"}),event_token:"phase_shifter",icon:da},phone_a_friend:{content:(0,N.jsx)(ke.A,{defaultMessage:"Mention @lara for the first time",id:"label.mention_lara_for_the_first_time.f8a03592"}),event_token:"phone_a_friend",icon:da},ring_ring:{content:(0,N.jsx)(ke.A,{defaultMessage:"Create a video meeting for the first time",id:"label.create_a_video_meeting_for_the_fir.6b1f4d7f"}),event_token:"ring_ring",icon:da},say_cheese:{content:(0,N.jsx)(ke.A,{defaultMessage:"Upload an avatar image for the first time",id:"label.upload_an_avatar_image_for_the_fir.39c6af28"}),event_token:"say_cheese",icon:da},small_talk:{content:(0,N.jsx)(ke.A,{defaultMessage:"Send your 25th chat message",id:"label.send_your_25th_chat_message.433c236e"}),event_token:"small_talk",icon:da},team_up:{content:(0,N.jsx)(ke.A,{defaultMessage:"Create a team for the first time",id:"label.create_a_team_for_the_first_time.85278ef0"}),event_token:"team_up",icon:da},time_traveler:{content:(0,N.jsx)(ke.A,{defaultMessage:"Use the revision history for the first time",id:"label.use_the_revision_history_for_the_f.2bd52d9a"}),event_token:"time_traveler",icon:da},upload_god:{content:(0,N.jsx)(ke.A,{defaultMessage:"Upload your 100th asset",id:"label.upload_your_100th_asset.06bafdac"}),event_token:"upload_god",icon:da},veteran_solver:{content:(0,N.jsx)(ke.A,{defaultMessage:"Complete your 3rd challenge",id:"label.complete_your_3rd_challenge.d25fb80a"}),event_token:"veteran_solver",icon:da}}[e]);function my(){const[e,s]=(0,l.useState)(null),[a,t]=(0,l.useState)(""),i=(0,l.useRef)(),n=(0,Pe.W6)(),r=(0,Pe.zy)(),o=(0,P.nm)();return(0,l.useEffect)(()=>{if(!r)return;const e=js.A.parse(r.search);e.message&&(s(e.message),t("success")),e.error&&(s(e.error),t("danger")),o.logoutMessage&&(s(o.logoutMessage),t("warning"),o.resetLogoutMessage())},[]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"no-pad-xs",sm:12,children:(0,N.jsx)(Ns,{onFinish:e=>{const{hydrated:s,path:a,userId:t}=(0,Ee.eQ)();s&&e==t?window.location.href=a:n.push("/")}})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"no-pad-xs",sm:12,xs:6,children:(0,N.jsx)("a",{href:"#",rel:"noreferrer noopener",onClick:e=>{e.preventDefault(),i.current.show()},children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})})})}),(0,N.jsx)(is,{ref:i})]})}const gy=e=>{const[s,a,t]=(0,ne.CQ)({alert:null,error:null,has_seen_extinction_notice:null,isIE11:!1,show_log_in:!1}),{location:i}=(0,Pe.W6)(),{getCookie:r,isLoggedIn:o,isolatedMode:d,resetLogoutMessage:c,user:h}=(0,n.nm)(),u=(0,l.useRef)(),m=(0,l.useRef)(),g=()=>a({show_log_in:!0}),p=()=>{const e=null===u||void 0===u?void 0:u.current;if(!e)return;const{refreshToDos:s}=(null===e||void 0===e?void 0:e.facilitator_to_do)||{};"function"===typeof s&&s()},x=async()=>{const e=null===u||void 0===u?void 0:u.current;if(!e)return;const{refreshChallenges:s}=(null===e||void 0===e?void 0:e.learner_to_do)||{};s&&"function"===typeof s&&await s()};(0,l.useEffect)(()=>{var e,s,t,l;!o||null!==h&&void 0!==h&&null!==(e=h.default_email)&&void 0!==e&&e.verified||a({alert:!0}),null!==i&&void 0!==i&&i.search&&"login"===(null===(s=js.A.parse(i.search))||void 0===s?void 0:s.type)&&g();const n=r(`integration_configuration.${(0,z.A)()}`)||{};null!==n&&void 0!==n&&n.merge_accounts&&g(),p(),x();!(null===(t=window)||void 0===t||!t.MSInputMethodContext)&&!(null===(l=document)||void 0===l||!l.documentMode)&&(()=>{const e=JSON.parse(localStorage.getItem("has_seen_extinction_notice")),s=(null===e||void 0===e?void 0:e.value)||!1,a=(null===e||void 0===e?void 0:e.expiry)||(new Date).getTime(),t=(new Date).getTime()>a;if(t&&localStorage.removeItem("has_seen_extinction_notice"),t||!1===s){const e=null===m||void 0===m?void 0:m.current;if(!e)return;e.show()}})()},[]);let{id:v,children:f,className:j,customLogo:_,customMenu:b,customTopnav:A,hideFooter:y,hideHeader:w,hideTopnav:S,homeLink:C,offsetTop:M}=e,{error:k,show_log_in:T}=s;M="number"==typeof M?M:0;let I=(null===e||void 0===e?void 0:e.style)||{};return d&&(S=!0),document.documentElement.style.setProperty("--topnav-offset",S?"0px":"66px"),(0,N.jsxs)(vy,{value:{refreshFacilitatorToDos:p,refreshLearnerChallenges:x,showLogin:g},children:[!S&&(0,N.jsx)($A,{customContents:A,customLogo:_,customMenu:b,hideHeader:w,homeLink:C,onRef:e=>u.current=e,showLogin:g}),(0,N.jsxs)(Ce.S,{style:Object.assign({background:"#fafafa",display:"flex",flexDirection:"column",minHeight:"100vh",paddingBottom:y?0:"var(--footer-offset)",paddingTop:"calc("+M+"px + var(--topnav-offset))",position:"relative",width:"100%"},I),children:[(0,N.jsxs)(Ce.S,{className:`layout ${j||""}`,id:v,style:{flex:"1"},children:[f,!y&&(0,N.jsx)(Ce.S,{style:{background:"rgb(250,250,250)",bottom:0,height:"var(--footer-offset)",left:0,position:"absolute",width:"100%"},children:(0,N.jsx)(pg,{})})]}),(0,N.jsxs)(xe,{className:"modal-400",onHide:()=>{c(),a({show_log_in:!1})},show:T,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Log in to Solvably",description:"",id:"label.log_in_to_solvably.69b261d0"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>a({error:null}),show:k,variant:"danger",children:k}),(0,N.jsx)(my,{})]})]}),(0,N.jsx)(ea,{ref:m})]})]})};gy.defaultProps={hideFooter:!1,hideTopnav:!1};var py=gy;const xy=l.createContext({}),vy=xy.Provider,fy=xy.Consumer,jy=(0,l.forwardRef)((e,s)=>{const{allowBothOpen:a,children:t,defaultActiveKeyLeft:i,defaultActiveKeyRight:n,defaultLeftOpen:r,defaultRightOpen:o,hideLeftButtonsWhenOpen:d,hideRightButtonsWhenOpen:c,leftContents:h,onNavSelectLeft:u,onNavSelectRight:m,onToggleLeft:g,onToggleRight:p,rightContents:x,topnav:v}=e,{isBelowBreakpoint:f,isInRange:j}=(0,ne.vh)({breakpoint:1200,range:[922,1440]}),[_,b,A]=(0,ne.CQ)({left_open:r,right_open:o}),y=(0,l.useRef)(),w=(0,l.useRef)(),S=()=>{const e=y.current;e&&(e.show(),b({left_open:!0}))},C=()=>{const e=y.current;e&&(e.hide(),b({left_open:!1}))},M=()=>{const e=w.current;e&&(e.show(),b({right_open:!0}))},k=()=>{const e=w.current;e&&(e.hide(),b({right_open:!1}))};(0,l.useEffect)(()=>{(!a||j)&&_.left_open&&k()},[_.left_open,j]),(0,l.useEffect)(()=>{(!a||j)&&_.right_open&&C()},[_.right_open,j]);const{left_open:z,right_open:T}=_,I={hideLeft:C,hideRight:k,left_open:z,right_open:T,showLeft:S,showRight:M,toggleLeft:()=>{const e=y.current;
2e&&(e.toggle(),b({left_open:!_.left_open}))},toggleRight:()=>{const e=w.current;e&&(e.toggle(),b({right_open:!_.right_open}))}};return(0,l.useImperativeHandle)(s,()=>I),(0,N.jsxs)(Ay,{value:I,children:[v||(0,N.jsx)($A,{}),(0,N.jsxs)(Ce.S,{className:`sidebar-layout d-flex ${z&&!f?"left-open":"left-closed"} ${T?"right-open":"right-closed"}`,children:[(0,N.jsx)(Ce.S,{className:"sidebar-layout-left "+(z&&!f?"open":"closed"),children:h&&!f&&(0,N.jsx)(kg,{defaultActiveKey:i,defaultOpen:r,hideButtonsWhenOpen:d,onNavSelect:u,onToggle:e=>{e?S():C(),"function"===typeof g&&g()},ref:y,children:h})}),(0,N.jsx)(Ce.S,{className:"sidebar-layout-center",children:t}),(0,N.jsx)(Ce.S,{className:"sidebar-layout-right "+(T&&!f?"open":"closed"),children:x&&!f&&(0,N.jsx)(kg,{defaultActiveKey:n,defaultOpen:o,hideButtonsWhenOpen:c,onNavSelect:m,onToggle:e=>{e?M():k(),"function"===typeof p&&p()},ref:w,children:x})})]})]})});jy.displayName="SidebarLayout",jy.defaultProps={allowBothOpen:!0,defaultLeftOpen:!0,defaultRightOpen:!1,leftSidebar:(0,N.jsx)(N.Fragment,{}),rightSidebar:(0,N.jsx)(N.Fragment,{})};var _y=jy;const by=l.createContext({}),Ay=by.Provider,yy=(by.Consumer,()=>(0,l.useContext)(by)),wy=e=>{let{children:s,className:a,containerClass:t,fixed:i,fluid:l,offsetBottom:n,style:r}=e;a="string"===typeof a?a:"";const{getUserBanner:o,user:d}=(0,P.nm)(),{default_banner:c}=(0,P.hc)();let h=o()||c,u=(0,N.jsx)("strong",{className:"heading",style:{fontSize:23,marginLeft:20},children:null===d||void 0===d?void 0:d.fullname}),m=Boolean(i);return(0,N.jsxs)(Ce.S,{className:a,style:r||{},children:[(0,N.jsxs)(Ce.S,{style:m?{position:"fixed",width:"100%",zIndex:10}:{marginBottom:n||0},children:[(0,N.jsxs)(Ce.S,{className:"banner-container",children:[(0,N.jsx)(Ce.S,{className:"banner-image-container",children:(0,N.jsx)(Zs.A,{alt:"",className:"banner-layout-image",src:h})}),(0,N.jsx)(Ce.S,{className:"banner-bar-container",children:(0,N.jsx)(Ce.S,{className:"banner-layout-lower-bar"})})]}),(0,N.jsxs)(Ue.A,{className:t||"",fluid:l,style:{position:"relative"},children:[(0,N.jsx)(Ya,{size:79,user:d,style:{background:"white",border:"3px solid white",borderRadius:"50%",bottom:5,height:85,position:"absolute",width:85}}),(0,N.jsx)(Ce.S,{style:{bottom:0,height:50,left:105,lineHeight:"50px",position:"absolute"},children:u})]})]}),m&&(0,N.jsx)(Ce.S,{style:{height:150,marginBottom:n||0},children:"\xa0"}),s]})};wy.defaultProps={className:"banner-layout"};var Ny=wy;var Sy=(0,Ke.Ay)(e=>{const{getCookie:s}=(0,n.nm)(),a=s(`integration_configuration.${(0,z.A)()}`)||{},{email:t,fullname:i}=a;return(0,N.jsx)(py,{id:"register",children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{className:"my-3 my-lg-5 justify-content-center",children:(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)(Ge.A,{className:"registration-form-container",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably.",id:"label.welcome_to_solvably.7608ebc3"})}),(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Create your account by filling out the form below.",id:"label.create_your_account_by_filling_out.430b6b40"})}),(0,N.jsx)(cs,{buttonRight:!0,compact:!0,enableBusinessField:!0,buttonSize:"lg",defaultValues:{email_address:t,fullname:i}})]})})})})})})});function Cy(){const[e,s]=(0,l.useState)(!0),[a,t]=(0,l.useState)(null),[i,r]=(0,l.useState)([]),o=(0,n.nm)(),d=(0,Pe.W6)();return(0,l.useEffect)(()=>{const{api:e}=o;e.get("/api/learners/memberships-assignments/list").then(e=>{let{memberships:a}=e;a=Array.isArray(a)?a:[],r(a),s(!1)}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;t(a),s(!1)})},[]),(0,N.jsx)(py,{offsetTop:0,style:{backgroundColor:"#fafafa"},children:(0,N.jsxs)(Ny,{children:[e&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{t(null)},show:a,variant:"danger",children:a}),!e&&(0,N.jsx)(Ue.A,{className:"mt-4",children:i.length>0?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select which group you'd like to use for this session:",de
2scription:"",id:"label.select_which_group_youd_like_to_us.c980b77f"})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(qa.A,{style:{margin:0},children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Group name",description:"",id:"label.group_name.762ebb70"})}),(0,N.jsx)("th",{className:"d-none d-md-table-cell",children:(0,N.jsx)(ke.A,{defaultMessage:"Taught by",description:"",id:"label.taught_by.71c0e310"})}),(0,N.jsx)("th",{className:"d-none d-md-table-cell",children:(0,N.jsx)(ke.A,{defaultMessage:"Next challenge",description:"",id:"label.next_challenge.e32fb527"})}),(0,N.jsx)("th",{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",description:"",id:"label.action.64cff131"})})]})}),(0,N.jsxs)("tbody",{children:[1===i.length&&(0,N.jsx)(Pe.rd,{to:"/class/"+i[0].group.id}),i.map((e,s)=>{let a=e.assignments?e.assignments.filter(e=>{const{assignment:s}=e;if(!s)return!1;const a=s.start?new Date(s.start):null,t=s.due?new Date(s.due):null,i=new Date;return i>a&&i<t}):[];return a=a.sort((e,s)=>e.assignment.due?s.assignment.due?new Date(e.assignment.due)>new Date(s.assignment.due)?1:-1:1:-1),(0,N.jsxs)("tr",{children:[(0,N.jsxs)("td",{children:[(0,N.jsx)(Le.Link,{to:"/class/"+e.group.id,children:(0,N.jsx)("strong",{children:e.group.name})}),(0,N.jsx)("p",{children:(0,N.jsx)("strong",{children:e.group.organization.name})})]}),(0,N.jsx)("td",{className:"d-none d-md-table-cell",children:e.group.members&&e.group.members.length>0?(0,N.jsx)(N.Fragment,{children:e.group.members.map((e,s)=>(0,N.jsx)("div",{children:e.organization_member&&e.organization_member.user?(0,N.jsxs)("div",{children:[(0,N.jsx)(Ya,{size:20,style:{height:20,marginRight:10,width:20},user:e.organization_member.user}),(0,N.jsx)("strong",{children:e.organization_member.user.fullname})]}):"N/A"},s))}):(0,N.jsx)("small",{children:(0,N.jsx)("b",{className:"text-secondary",children:"N/A"})})}),(0,N.jsxs)("td",{className:"d-none d-md-table-cell",children:[!a.length&&(0,N.jsx)("div",{children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"No active challenges",description:"",id:"label.no_active_challenges.a2da83cb"})})}),a&&a.length>0&&(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>{if(s>0)return"";const{assignment:a}=e;return a?(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("small",{className:"text-secondary",style:{fontWeight:500},children:a.challenge_template.title}),a.due&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("br",{}),(0,N.jsxs)("small",{children:["Due ",(0,N.jsx)(Gh.XU,{value:new Date(a.due)})]})]})]},s):""})})]}),(0,N.jsx)("td",{children:(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{d.push("/class/"+e.group.id)},size:"sm",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Enter group",description:"",id:"label.enter_group.add698b9"})})})]},s)})]})]})})})})]}):(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:{offset:3,span:6},xs:12,children:(0,N.jsx)("p",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"You do not belong to any active classes. Please contact your administrator if you believe this is an error.",description:"",id:"label.you_do_not_belong_to_any_active_cl.0b50455b"})})})})})]})})}const My=t(98223),ky={facilitators:t(9658),group:t(19588),group_assignment:t(13084),project:t(93050),team:t(97836)};class zy extends l.Component{constructor(e){var s,a;super(e),this.synchronizePhase=()=>{const{match:e}=this.props,s=e.params.hasOwnProperty("phase")&&e.params.phase?Number(e.params.phase):"",a=e.params.hasOwnProperty("subphase")&&e.params.subphase?Number(e.params.subphase):"",{phase:t,subphase:i}=this.state;return new Promise((e,l)=>{t!=s||i!=a?this.setState({phase:s,subphase:a},()=>{e(!0)}):e(!1)})},this.loadChallengeTemplate=()=>{var e;const{app:s,match:a}=this.props,t=s.api,i=(null===(e=a.params)||void 0===e?void 0:e.challenge_template)||null;return new Promise((e,s)=>{if(!i)return e();t.get("/api/challenge-templates/challenge-template/"+i).then(s=>{let{challenge_template:a}=s;this.setState(e=>(e.project.challenge_template=a,e.challenge_template=a,e)),e()}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})},this.isPhaseComplete=e=>{const{project:s}=this.state;return!!s&&(s&&s.num_phases_complete>=e)},this.isPhaseStarted=e=>{const s=(this.state.project&&Array.isArray(this.state.project.challenge_data)?this.state.project.challenge_data:[]).filter(s=>s.phase===e);let a=!1;return s.every((e,s)=>{let{data:t}=e;return!!(0,T.isEmpty)(t)||(a=!0,!1)}),a},this.canStartPhase=e=>{const{project:s}=this.state;return!!s&&(s&&s.num_phases_complete===e-1)},this.getPhaseLink=(e,s)=>{const{challenge_template_id:a}=this.state;return"number"!==typeof e&&(e=1),"number"!==typeof s&&(s=1),`/admin/challenge-template/preview/${a}/${e=e.toString()}/${s=s.toString()}`}
2,this.getSyllabusLink=()=>{const{challenge_template_id:e}=this.state;return"/challenge-template-details/"+e},this.getHubLink=()=>{const{challenge_template_id:e}=this.state;return`/admin/challenge-template/preview/${e}`},this.getPhaseData=(e,s)=>{if(!this.state.project)return{};const{challenge_data:a}=this.state.project;if(!Array.isArray(a))return{};let t=null;for(const l of a){if(!l)continue;const{phase:a,subphase:i}=l;if(a===e&&i===s){t=l;break}}if(!t)return{};const{data:i}=t;return!i||"object"!==typeof i||Array.isArray(i)?{}:JSON.parse(JSON.stringify(i))},this.applyPhaseDataPatch=(e,s,a)=>{if(!this.state.project)return!1;const{challenge_data:t}=this.state.project;if(!Array.isArray(t))return!1;this.setState(t=>{let{challenge_data:i}=t.project;i=Array.isArray(i)?i:[];for(let l=0;l<i.length;l++){const t=i[l];if(!t)continue;let{data:n,phase:r,subphase:o}=t;r===e&&o===s&&(n=n||{},My.applyPatch(n,a),i[l].data=n)}return t.project.challenge_data=i,t})},this.changePhaseData=(e,s,a)=>{const{project:t}=this.state;if(!t)return!1;const i=Array.isArray(t.challenge_data)?t.challenge_data:[];for(let l=0;l<i.length;l++){const t=i[l];if(!t)continue;const{data:n,phase:r,subphase:o}=t;if(r!=e||o!=s)continue;const d=My.createPatch(n,a);this.applyPhaseDataPatch(e,s,d)}},this.getTeamMemberWithUserId=e=>{const{team:s}=this.state;if(!s||!s.members||!Array.isArray(s.members))return!1;for(let a=0;a<s.members.length;a++){const t=s.members[a];if(t&&t.user&&t.user.id===e)return t.user}if(!s||!s.facilitators||!Array.isArray(s.facilitators))return!1;for(let a=0;a<s.facilitators.length;a++){const t=s.facilitators[a];if(t&&t.user&&t.user.id===e)return t.user}return!1},this.canSubmitPhase=e=>{const s=this.getSubphases(e);for(let a=1;a<=s.length;a++)if(!this.canSubmitSubphase(e,a))return!1;return!0},this.canSubmitSubphase=(e,s)=>{const{app:a}=this.props,t=this.getPhaseData(e,s);if(1==e&&1==s){var i="wordCloudList";const e=t&&t[i]?t[i]:[];return!!(e&&e.length&&e.length>=10&&e.length<=25)}if(1==e&&2==s){i="identifyAudience";const e=t&&t[i]?t[i]:{},s=e&&e.text?(0,ad.G9)(e.text):"",l=e&&e.item,n=a.utils.countWords(s);return l&&n>=15&&n<=75}if(1==e&&3==s){i="constraints";let e="";const s=t&&t[i]?t[i]:{};for(e in s){if(void 0===s[e].category||void 0===s[e].text)return!1;if(""===s[e].category||""===s[e].text)return!1;if(a.utils.countWords(s[e]&&s[e].text)<5||a.utils.countWords(s[e]&&s[e].text)>25)return!1}return s&&Object.keys(s).length>=3}if(1==e&&4==s){const e=1;if(null==t.share_lanes)return!1;return Object.values(t.share_lanes).every(s=>Array.isArray(s)&&s.length>=e)}if(2==e&&1==s){var l;const e=null!==(l=null===t||void 0===t?void 0:t.need_to_knows)&&void 0!==l?l:{};for(var n in e){const s=e[n].value;a.utils.countWords(s)>=5&&a.utils.countWords(s)<=25||(r=!1)}return t&&e&&Object.keys(e).length>=3&&Object.keys(e).length<=9&&r}if(2==e&&2==s){const e=this.getPhaseData(2,1);if(!t||!t.share_lanes||!e||!e.need_to_knows)return!1;if(t.share_lanes.length!==Object.keys(e.need_to_knows).length)return!1;for(const s in t.share_lanes)if(!t.share_lanes[s]||!Object.keys(t.share_lanes[s]).length)return!1;return!0}if(3==e&&1==s){const e=t&&t.share_lanes;if(!e||!e.length||e.length<3)return!1;for(const s in e)if(!e[s]||!e[s].length)return!1;return!0}if(3==e&&2==s){i="selected_idea";const e=t&&t[i]?t[i]:{};return e&&e.hasOwnProperty("key")}if(4==e&&1==s){i="action_statement";const e=t&&t[i]?t[i]:{};var r=!0;for(var n in e){const s=e[n].value;a.utils.countWords(s)>=3&&a.utils.countWords(s)<=25||(r=!1)}return 3===Object.keys(e).length&&r}if(4==e&&2==s)return t&&t.deliverable_choice&&t.deliverable&&!(0,T.isEmpty)(t.deliverable);if(5==e&&1==s){const{members:e}=this.state.team;return(t&&t.reviews&&Object.keys(t.reviews).length)===e.length}if(5==e&&2==s){const{members:e}=this.state.team;return(t&&t.reviews&&Object.keys(t.reviews).length)===e.length}if(5==e&&3==s){const{members:e}=this.state.team;return(t&&t.reviews&&Object.keys(t.reviews).length)===e.length}if(5==e&&4==s){const{members:e}=this.state.team;return(t&&t.reviews&&Object.keys(t.reviews).length)===e.length}},this.buildPhaseSubphaseMap=e=>{const s={};let a=0;return Object.keys(e.phases).sort((e,s)=>
2e.localeCompare(s)).forEach(t=>{s[t]={},Object.keys(e.phases[t].subphases).sort((e,s)=>e.localeCompare(s)).forEach(e=>{s[t][e]=String(a++)})}),s},this.getTypeConfig=()=>{var e;const s=(null===(e=this.state.challenge_template)||void 0===e?void 0:e.challenge_type)||"classic";return Za.Ay[s]||Za.Ay.classic},this.getPhaseTitle=e=>{var s;return e&&(null===(s=this.getTypeConfig().phases[e])||void 0===s?void 0:s.title)||""},this.getPhaseDescription=e=>{var s;return(null===(s=this.getTypeConfig().phases[e])||void 0===s?void 0:s.description)||""},this.getSubphaseTitle=(e,s)=>{var a;const t=null===(a=this.getTypeConfig().phases[e])||void 0===a?void 0:a.subphases[s];return("object"===typeof t?null===t||void 0===t?void 0:t.title:t)||""},this.getSubphases=e=>{const{challenge_template_id:s}=this.state,a=this.getTypeConfig().phases[e];return a?Object.entries(a.subphases).map(a=>{let[t,i]=a;return{route:`/admin/challenge-template/preview/${s}/${e}/${t}`,title:"object"===typeof i?null===i||void 0===i?void 0:i.title:i}}):[]},this.handleSubmitPhase=e=>{const{history:s}=this.props,{challenge_template_id:a}=this.state;if(4===(e=Number.parseInt(e)||1))return;const t=e+1;s.push(`/admin/challenge-template/preview/${a}/${t}/1`)},this.calculatePhaseProgress=e=>{const{project:s}=this.state,a=Number(e),t=null===s||void 0===s?void 0:s.challenge_data,i=[];let l=0;return t?(t&&t.map((e,s)=>{const{phase:t}=e;return a!==t?"":i.push({data:e})}),i&&i.length&&i.map(e=>{const s=100/i.length,{isComplete:a}=e&&e.data;return a?l+=s:""}),!!i.length&&{progress_arr:i,progress_score:l}):i},this.getSubphaseDataKey=(e,s)=>{var a,t;return(null===(a=this.phase_subphase_map)||void 0===a||null===(t=a[e])||void 0===t?void 0:t[s])||null},this.isSubphaseComplete=(e,s)=>{const{is_complete:a}=this.getSubphaseData(e,s)||{};return!!a}
2,this.getSubphaseData=(e,s)=>{const{project:a}=this.state;if(!a)return{};const{challenge_data:t}=a||{};if(!t)return{};const i=this.getSubphaseDataKey(e,s);if(!i)return{};const l=t[i];return l||{}},this.getSubphaseCompletionCount=()=>{var e,s,a;const t=null===(e=this.state)||void 0===e||null===(s=e.project)||void 0===s?void 0:s.challenge_data;if(t)return null===(a=Object.values(t).filter(e=>null===e||void 0===e?void 0:e.is_complete))||void 0===a?void 0:a.length},this.isLastSubphase=()=>{const{phase:e,subphase:s}=this.state,a=this.getSubphases(e);return(null===a||void 0===a?void 0:a.length)===s};const{match:t}=this.props;this.state={assignment:{},challenge_id:(null===(s=t.params)||void 0===s?void 0:s.challenge_template)||null,challenge_template:null,challenge_template_id:(null===(a=t.params)||void 0===a?void 0:a.challenge_template)||null,error:null,facilitators:ky.facilitators,group:ky.group,group_assignment:ky.group_assignment,group_id:1,is_facilitator:!1,loading:!0,modal_error:null,phase:"",project:ky.project,show:!1,slug:"",subphase:"",team:ky.team,team_member:null},this.io=null,this.phase_subphase_map=this.buildPhaseSubphaseMap(Za.Ay.classic)}getProjectPage(e,s){var a;const t="latest"===((null===(a=this.state.challenge_template)||void 0===a?void 0:a.challenge_type)||"classic")?latestSubphases:Db,i=(null===t||void 0===t?void 0:t[`${e}-${s}`])||g_;return(0,N.jsx)(i,{})}async componentDidMount(){this.synchronizePhase(),await this.loadChallengeTemplate(),this.setState({loading:!1})}async componentDidUpdate(e,s){await this.synchronizePhase()}render(){const{assignment:e,challenge_template:s,challenge_template_id:a,chat:t,facilitators:i,group:l,group_assignment:n,group_id:r,group_member_assignment_id:o,group_member_id:d,is_facilitator:c,organization_member_id:h,phase:u,project:m,subphase:g,team:p,team_locations:x,team_member:v}=this.state,f=this.getProjectPage(u,g),j=this.getPhaseTitle(u);let _=null;return u&&(_=this.canSubmitPhase(u)),(0,N.jsxs)(Ce.S,{className:"assignment-wrapper-layout d-flex flex-column",children:[(0,N.jsx)(Ce.S,{className:"assignment-wrapper",children:(0,N.jsx)(nt,{value:{launchChallengeOverviewModal:Function()},children:(0,N.jsxs)(Ce.S,{className:"assignment-wrapper-inner d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsx)(Ce.S,{className:"module-container d-flex flex-column",children:(0,N.jsx)(Ce.S,{className:"module-contents",children:(0,N.jsxs)(Ia,{value:{assignment:e,calculatePhaseProgress:this.calculatePhaseProgress,can_submit_phase:_,canChangePhaseData:()=>!1,canStartPhase:this.canStartPhase,canSubmitPhase:this.canSubmitPhase,canSubmitSubphase:this.canSubmitSubphase,challenge_template:s,challenge_template_id:a,challenge_type:(null===s||void 0===s?void 0:s.challenge_type)||"classic",challenge_type_subphases:"latest"===(null===s||void 0===s?void 0:s.challenge_type)?latestSubphases:Db,changePhaseData:this.changePhaseData,chat:t,facilitators:i,fieldStatusIndicator:()=>(0,N.jsx)(N.Fragment,{}),getHubLink:this.getHubLink,getPhaseData:this.getPhaseData,getPhaseDescription:this.getPhaseDescription,getPhaseLink:this.getPhaseLink,getPhaseTitle:this.getPhaseTitle,getSubphaseCompletionCount:this.getSubphaseCompletionCount,getSubphases:this.getSubphases,getSubphaseTitle:this.getSubphaseTitle,getSyllabusLink:this.getSyllabusLink,getTeamMemberWithUserId:this.getTeamMemberWithUserId,group:l,group_assignment:n,group_id:r,group_member_assignment_id:o,group_member_id:d,handleSubmitPhase:this.handleSubmitPhase,io:this.io,is_facilitator:c,isFieldDisabled:Function(),isLastSubphase:this.isLastSubphase,isPhaseComplete:this.isPhaseComplete,isPhaseStarted:this.isPhaseStarted,isSubphaseComplete:this.isSubphaseComplete,loadGMA:Function(),organization_member_id:h,phase:u,phase_title:j,preview:!0,project:m,reloadProjectInfo:Function(),setFieldStatus:Function(),setFourCSubPhaseComplete:()=>{},setHasSeenFinalCompulsion:Function(),slug:this.state.slug,status:{completed:!1,expired:!1,overdue:!1,started:!1},subphase:g,team:p,team_locations:x,team_member:v},children:[(0,N.jsx)(p_,{}),(0,N.jsxs)(Me.x_,{loading:this.state.loading,children:[(0,N.jsx)(Ce.S,{className:"module-mode-banner preview d-flex justify-content-center p-2",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Preview mode",id:"label.preview_mode.481bc90f"})})}),(0,N.jsx)(bf,{children:f})]})]})})})]})})}),(0,N.jsxs)(xe,{"aria-live":"polite",backdrop:"static",className:"modal-danger",onHide:()=>{this.setState({modal_error:!1})},show:Boolean(this.state.modal_error),size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)("h5",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Error updating challenge",description:"",id:"label.error_updating_challenge.eefdd54f"})})}),(0,N.jsx)(xe.Body,{className:"pb-0",children:(0,N.jsx)("p",{children:this.state.modal_error})})]})]})}}var Ty=(0,P.G0)((0,Pe.y)((0,Ke.Ay)(zy)));const Iy=(0,l.forwardRef)((e,s)=>{const{api:a,locale:t}=(0,n.nm)(),[i,l,r]=((0,ja.A)(),(0,ne.CQ)({error:null,loading:!1,success:!1})),{error:o,success:d}=i;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>l({error:null}),show:o,variant:"danger",children:o}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>l({success:!1}),show:d,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Profile has been updated.",id:"label.profile_has_been_updated.f412efc3"})}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Change password",id:"label.change_password.3f9c991f"})}),(0,N.jsx)(ds.l1,{validationSchema:(0,Re.by)({locale:t,scope:"user.profile_password"}),initialValues:{current_password:"",password:"",password_confirm:""},onSubmit:e=>{var s,t;s=e.current_password,t=e.password,l({loading:!0}),a.post("/api/users/profile/password/save",{current_password:s,password:t}).then(()=>{l({loading:!1,success:!0})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;l({error:s,loading:!1})})},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"Current password"}),(0,N.jsx)(_e.A.Control,{"aria-label":"current password",isInvalid:i.current_password&&s.current_password,isValid:i.current_password&&!s.current_password,name:"current_password",onChange:a,type:"password",value:l.current_password}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(ds.Kw,{name:"current_password",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"We need your password to verify your identity.",id:"label.we_need_your_password_to_verify_yo.4e1cddf0"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"New password",id:"label.new_password.3dd9df44"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"new password",isInvalid:i.password&&s.password,isValid:i.password&&!s.password,name:"password",onChange:a,type:"password",value:l.password}),(0,N.jsx)(ds.Kw,{name:"password",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Confirm new password",id:"label.confirm_new_password.bf000421"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"confirm new password",isInvalid:i.password_confirm&&s.password_confirm,isValid:i.password_confirm&&!s.password_confirm,name:"password_confirm",onCh
2ange:a,type:"password",value:l.password_confirm}),(0,N.jsx)(ds.Kw,{name:"password_confirm",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(ve.A,{onClick:t,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})}})]})});var Ey=Iy;const Fy=(0,l.forwardRef)((e,s)=>{const{api:a,getUserAvatar:t,getUserBanner:i,locale:l,refreshUserBasics:n,setLocale:r,user:o}=(0,P.nm)(),{default_banner:d}=(0,P.hc)(),{avatar:c}=Hy(),h=(0,ja.A)(),[u,m,g]=(0,ne.CQ)({banner_error:null,dialog_error:null,error:null,show_alert:!1,show_banner:!1,show_dialog:!1,submitting:!1,updated:!1}),{banner_error:p,dialog_error:x,show_alert:v,show_banner:f,show_dialog:j,submitting:_}=u;let b=!!o.hasOwnProperty("lock_user_information")&&o.lock_user_information;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column pb-5",lg:{order:"last",span:5},children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"User avatar",id:"label.user_avatar.e75e0e7c"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center pb-2",children:(0,N.jsxs)(Ce.S,{className:"position-relative",style:{height:150,width:150},children:[(0,N.jsx)(Zs.A,{fluid:!0,roundedCircle:!0,alt:"User Avatar",src:t()}),(0,N.jsxs)(li.A,{align:"start",drop:"end",style:{bottom:10,position:"absolute",right:-25},children:[(0,N.jsx)(li.A.Toggle,{as:Ry,size:"sm"}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{m({dialog_error:null,show_dialog:!0})},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload an image...",description:"",id:"label.upload_an_image.dfdd8500"})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{window.confirm("Are you sure you want to delete your avatar?")&&(m({loading:!0}),a.post("/api/users/avatar/delete").then(()=>{m({loading:!1}),n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;m({dialog_error:s,loading:!1})}))},children:(0,N.jsx)(ke.A,{defaultMessage:"Remove image",description:"",id:"label.remove_image.da7acac1"})})]})]})]})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"User banner",id:"label.user_banner.539b8481"})}),(0,N.jsxs)(Ce.S,{className:"position-relative pb-2",children:[(0,N.jsx)(Zs.A,{fluid:!0,rounded:!0,alt:"User Banner",src:i()||d}),(0,N.jsxs)(li.A,{align:"start",drop:"end",style:{bottom:15,position:"absolute",right:"2.5%"},children:[(0,N.jsx)(li.A.Toggle,{as:Ry,size:"sm",variant:"primary"}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{m({banner_error:null,show_banner:!0})},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload an image...",description:"",id:"label.upload_an_image.dfdd8500"})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{window.confirm(h.formatMessage({id:"label.are_you_sure_you_want_to_delete_yo.5b771463",defaultMessage:"Are you sure you want to delete your banner?"}))&&(m({loading:!0}),a.post("/api/users/banner/delete").then(()=>{m({loading:!1}),n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;m({dialog_error:s,loading:!1})}))},children:(0,N.jsx)(ke.A,{defaultMessage:"Remove image",description:"",id:"label.remove_image.da7acac1"})})]})]})]})]})]}),(0,N.jsxs)(Ve.A,{className:"pb-2",lg:7,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Basic info",id:"label.basic_info.cda8d0eb"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{m({show_alert:!1})},show:v,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Profile has been updated",id:"label.profile_has_been_updated.4a0c8f30"})}),(0,N.jsx)(ds.l1,{initialValues:{fullname:o.fullname},validationSchema:(0,Re.by)({locale:l,scope:"user.profile_basics"}),onSubmit:(e,s)=>{var t;t=e.fullname,m({submitting:!0}),a.post("/api/users/profile/basics/save",{fullname:t}).then(()=>{m({show_alert:!0,show_dialog:!1,submitting:!1,updated:!0}),n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;console.error(s),alert(s),m({submitting:!1})})},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"name",disabled:b,isInvalid:i.fullname&&s.fullname,isValid:i.fullname&&!s.fullname,name:"fullname",onChange:a,type:"text",value:l.fullname}),(0,N.jsx)(ds.Kw,{name:"fullname",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(Ce.S,{className:"language-select-container mb-3",children:[(0,N.jsx)("label",{htmlFor:"language-select",style:{fontWeight:500},children:(0,N.jsx)(ke.A,{defaultMessage:"Language",id:"label.language.a4fe6526"})}),(0,N.jsxs)("select",{className:"form-control",defaultValue:o&&o.locale,id:"language-select",onChange:e=>{(e=>{e.preventDefault(),r(e.target.value),m({show_alert:!0,show_dialog:!1,submitting:!1,updated:!0})})(e)},children:[(0,N.jsx)("option",{value:"en",children:h.formatMessage({id:"label.english.ba118bf7",defaultMessage:"English"})}),(0,N.jsx)("option",{value:"zh",children:h.formatMessage({id:"label.simplified_chinese.27f04e12",defaultMessage:"Simplified chinese"})}),(0,N.jsx)("option",{value:"es",children:h.formatMessage({id:"label.spanish.3411059c",defaultMessage:"Spanish"})}),(0,N.jsx)("option",{value:"fr",children:h.formatMessage({id:"label.french.7458199f",defaultMessage:"French"})})]})]}),(0,N.jsx)(ve.A,{onClick:t,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})}})]})]}),(0,N.jsxs)(xe,{backdrop:"static",onHide:()=>{m({show_dialog:!1})},show:j,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload avatar",id:"label.upload_avatar.e9892011"})})}),(0,N.jsx)(xe.Body,{children:x?(0,N.jsxs)(We.A,{variant:"danger",children:[x,(0,N.jsx)(ve.A,{className:"p-0",onClick:e=>{e.preventDefault(),m({dialog_error:null})},variant:"link",children:(0,N.jsx)("strong",{children:h.formatMessage({id:"label.try_again.1c6ee332",defaultMessage:"Try Again."})})})]}):(0,N.jsx)(ya,{aspectRatio:1,onClose:()=>{m({show_dialog:!1})},onFinish:(e,s)=>{((e,s)=>{m({submitting:!0}),a.file("/api/users/avatar",{job_id:s},e,"image.jpg").then(e=>{let{avatar:s}=e;m({avatar:s,show_dialog:!1,submitting:!1,updated_basic:!0}),n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;m({dialog_error:s,submitting:!1})})})(e,s)},submitting:_})})]}),(0,N.jsxs)(xe,{backdrop:"static",onHide:()=>{m({show_banner:!1})},show:f,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload banner",id:"label.upload_banner.7f66a1ac"})})}),(0,N.jsx)(xe.Body,{children:p?(0,N.jsxs)(We.A,{variant:"danger",children:[p,(0,N.jsx)(ve.A,{className:"p-0",onClick:e=>{e.preventDefault(),m({dialog_error:null})},variant:"link",children:(0,N.jsx)("strong",{children:h.formatMessage({id:"label.try_again.1c6ee332",defaultMessage:"Try Again."})})})]}):(0,N.jsx)(ya,{aspectRatio:4,maxHeight:2e3,maxWidth:2e3,onClose:()=>{m({show_banner:!1})},onFinish:(e,s)=>{((e,s)=>{m({submitting:!0}),a.file("/api/users/banner",{job_id:s},e,"banner_image.jpg").then(e=>{let{banner:s}=e;m({banner:s,show_banner:!1,submitting:!1,updated_basic:!0}),n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;m({banner_error:s,submitting:!1})})})(e,s)},submitting:_})})]})]})}),Ry=l.forwardRef((e,s)=>{let{children:a,onClick:t}=e;return(0,N.jsxs)(ve.A,{ref:s,onClick:e=>{e.preventDefault(),t(e)},children:[(0,N.jsx)(ze.Mbp,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]})});var Dy=Fy;const By=(0,l.forwardRef)((e,s)=>{const{api:a,locale:t,refreshUserBasics:i,styles:n}=(0,P.nm)(),{emails:r,user:o}=Hy(),d=(0,ja.A)(),[c,h,u]=(0,ne.CQ)({email1:"",email2:"",email3:"",error:null,loaded:!1,notif:null,submitting:!1,updated:!1,ver1:"",ver2:"",ver3:""}),{email1:m,email2:g,email3:p,loaded:x,notif:v,updated:f,ver1:j,ver2:_,ver3:b}=c,A=e=>{for(const s of r)if(s&&s.email_address===e)return s.id;return!1},y=(e,s)=>1===s?m===e.email1||g===e.email1||p===e.email1:2===s?m===e.email2||g===e.email2||p===e.email2:3===s?m===e.email3||g===e.email3||p===e.email3:void 0,w=(e,s,a)=>{let t="";2===a&&(t=s.email2,e("email2",s.email1),e("email1",t),t=s.ver2,e("ver2",s.ver1),e("ver1",t)),3===a&&(t=s.email3,e("email3",s.email1),e("email1",t),t=s.ver3,e("ver3",s.ver1),e("ver1",t))};(0,l.useEffect)(()=>{const e=o.hasOwnProperty("default_email_id")?o.default_email_id:null,
2s=r.filter(s=>s.id===e),a=r.filter(s=>s.id!==e);let t="",i="",l="",n="",d="",c="";s&&s[0]&&(t=s[0].email_address,n=s[0].verified),a&&a[0]&&(i=a[0].email_address,d=a[0].verified),a&&a[1]&&(l=a[1].email_address,c=a[1].verified),h({email1:t,email2:i,email3:l,loaded:!0,ver1:n,ver2:d,ver3:c})},[]);const S=n&&n.primary;return(0,N.jsxs)(Ce.S,{className:"user-profile-contact-form-override",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Contact preferences",id:"label.contact_preferences.15afc5eb"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({notif:null}),show:v,variant:"success",children:v}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({updated:!1}),show:f,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Profile has been updated",id:"label.profile_has_been_updated.4a0c8f30"})}),x?(0,N.jsx)(ds.l1,{validationSchema:(0,Re.by)({locale:t,scope:"user.profile_contact"}),initialValues:{email1:m,email2:g,email3:p,ver1:j,ver2:_,ver3:b},onSubmit:(e,s)=>{((e,s,t)=>{h({submitting:!0}),a.post("/api/users/profile/contact/save",{email1:e,email2:s,email3:t}).then(()=>{h({show_dialog:!1,submitting:!1,updated:!0},i)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;console.error(s),alert(s),h({submitting:!1})})})(e.email1,e.email2,e.email3)},children:e=>{let{errors:s,handleChange:t,handleSubmit:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Primary email",id:"label.primary_email.d535ab1a"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"primary email",isInvalid:n.email1&&s.email1,isValid:n.email1&&!s.email1,name:"email1",onChange:t,placeholder:"Enter email",type:"email",value:r.email1}),r.ver1&&y(r,1)?(0,N.jsx)(Ei.A.Text,{style:{border:`1px solid ${S}`,color:S},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Verified",id:"label.verified.4f783840"})}):(0,N.jsx)(Ei.A.Text,{style:{border:"1px solid red",color:"red"},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Unverified",id:"label.unverified.33c8e8de"})}),!r.ver1&&!f&&y(r,1)&&(0,N.jsx)(ve.A,{variant:r.ver1?"outline-primary":"outline-danger",onClick:e=>{(e=>{if(e.length<255){const s=A(e);a.post("/api/users/resend/"+s).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;console.error(s)})}else h({error:d.formatMessage({id:"label.email_address_is_too_long_please_e.3a40f8b3",defaultMessage:'"Email Address is too long, please enter an email address no longer than 254 characters"'})})})(r.email1),h({notif:"Email Verification Resent"})},children:(0,N.jsx)(ke.A,{defaultMessage:"Resend verification",id:"label.resend_verification.1eedf1ae"})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(ds.Kw,{name:"email1",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"We'll never share your email with anyone else.",id:"label.well_never_share_your_email_with_a.2453687a"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Alternate emails",id:"label.alternate_emails.2b46b81e"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"secondary email",isInvalid:n.email2&&s.email2,isValid:n.email2&&!s.email2,name:"email2",onChange:t,placeholder:"Enter email",type:"email",value:r.email2}),(0,N.jsx)(ve.A,{disabled:!r.email2.length||s.email2,onClick:e=>{w(l,r,2)},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})}),r.email2?r.ver2&&y(r,2)?(0,N.jsx)(Ei.A.Text,{disabled:!0,style:{border:`1px solid ${S}`,color:S},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Verified",id:"label.verified.4f783840"})}):(0,N.jsx)(Ei.A.Text,{style:{border:"1px solid red",color:"red"},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Unverified",id:"label.unverified.33c8e8de"})}):""]}),(0,N.jsx)(ds.Kw,{name:"email2",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"third email",isInvalid:n.email3&&s.email3,isValid:n.email3&&!s.email3,name:"email3",onChange:t,placeholder:"Enter email",type:"email",value:r.email3}),(0,N.jsx)(ve.A,{disabled:!r.email3.length||s.email3,onClick:e=>{w(l,r,3)},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})}),r.email3?r.ver3&&y(r,3)?(0,N.jsx)(Ei.A.Text,{disabled:!0,style:{border:`1px solid ${S}`,color:S},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Verified",id:"label.verified.4f783840"})}):(0,N.jsx)(Ei.A.Text,{style:{border:"1px solid red",color:"red"},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Unverified",id:"label.unverified.33c8e8de"})}):""]}),(0,N.jsx)(ds.Kw,{name:"email3",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})}}):""]})});var Py=By;const Ly=l.createContext({}),Oy=Ly.Provider,Hy=(Ly.Consumer,()=>(0,l.useContext)(Ly)),Uy=(0,l.forwardRef)((e,s)=>{const{api:a,styles:t}=(0,n.nm)(),[i,r,o]=(0,ne.CQ)({alert:null,avatar:null,emails:null,user:null}),{alert:d,avatar:c,emails:h,user:u}=i;(0,l.useEffect)(()=>{m();const s=js.A.parse(e.location.search);s.message&&r({alert:s.message})},[]);const m=()=>{a.get("/api/users/profile/get").then(e=>{let{avatar:s,emails:a,user:t}=e;r({avatar:s,emails:a,user:t})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;r({error:s})})};return(0,N.jsx)(Oy,{value:{avatar:c,emails:h,refreshProfile:m,user:u},children:(0,N.jsx)(py,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsxs)(Ue.A,{className:"d-flex flex-column gap-3",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{r({alert:null})},show:d,style:{textAlign:"center"},variant:"success",children:(0,N.jsx)(N.Fragment,{children:d})})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Account settings",id:"label.account_settings.a587aa1f"})})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)(ld.A.Container,{defaultActiveKey:"basic",id:"admin-tabs",unmountOnExit:!0,children:u?(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"pb-5",lg:2,children:(0,N.jsxs)(aa.A,{fill:!0,className:"flex-column",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{eventKey:"basic",children:[" ",(0,N.jsx)(ke.A,{defaultMessage:"Basics",id:"label.basics.8fdd2ee8"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{eventKey:"contact",children:[" ",(0,N.jsx)(ke.A,{defaultMessage:"Contact",id:"label.contact.2b5c3d26"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{eventKey:"password",children:[" ",(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})]})})]})}),(0,N.jsx)(Ve.A,{lg:10,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"basic",children:(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Dy,{})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"contact",children:(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Py,{})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"password",children:(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Ey,{})})})]})})]}):(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})})})})})]})})})})});var Qy=Uy;var Vy=e=>(0,N.jsx)(py,{children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{className:"mt-5",style:{minHeight:"100vh"},children:(0,N.jsx)(Ve.A,{md:12,xl:{offset:3,span:6},children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Forgot something?",id:"label.forgot_something.51e32294"})}),(0,N.jsx)(us,{})]})})})})});var Gy=s=>{const a=(0,Pe.W6)(),{formatMessage:t}=(0,ja.A)(),{api:i,locale:r,refreshUserBasics:o}=(0,n.nm)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!1,success:!1});(0,l.useEffect)(()=>h,[]);const{error:u,loading:m,success:g}=d;return(0,N.jsx)(py,{offsetTop:0,children:(0,N.jsx)(Ue.A,{style:{marginTop:"25px"},children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:12,xl:{offset:3,span:6},children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Reset your password",id:"label.reset_your_password.59fa4379"})}),(0,N.jsx)("p",{style:{marginBottom:25},children:(0,N.jsx)(ke.A,{defaultMessage:"Reset your password by filling out the form below.",id:"label.reset_your_password_by_filling_out.21d674db"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:u,variant:"danger",children:u}),g?(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({success:!1}),variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Password has been successfully reset. You will be automatically redirected home...",id:"label.password_has_been_successfully_res.8758a334"})}):(0,N.jsx)(ds.l1,{initialValues:{password:"",password_confirm:""},onSubmit:async s=>await(async s=>{try{c({loading:!0}),await i.post("/api/users/reset",{password:s});try{await o(),setTimeout(()=>a.push("/"),2500)}catch(e){c({error:t({id:"label.unable_to_refresh_user_details.84e9b648",defaultMessage:"Unable to refresh user details"})})}c({loading:!1,success:!0})}catch({err:err}){w(err),c({error:err,loading:!1,success:!1})}})(null===s||void 0===s?void 0:s.password),validateOnChange:!0,validationSchema:(0,Re.by)({locale:r,scope:"authentication.reset_password"}),children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"New password",id:"label.new_password.3dd9df44"})}),(0,N.jsx)(_e.A.Control,{disabled:m,isInvalid:i.password&&s.password,isValid:i.password&&!s.password,name:"password",onChange:a,type:"password",value:l.password}),s.password&&i.password&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.password})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Confirm password",id:"label.confirm_password.5ac265f3"})}),(0,N.jsx)(_e.A.Control,{disabled:m,isInvalid:i.password_confirm&&s.password_confirm,isValid:i.password_confirm&&!s.password_confirm,name:"password_confirm",onCh
2ange:a,type:"password",value:l.password_confirm}),s.password_confirm&&i.password_confirm&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.password_confirm})]}),(0,N.jsx)(os,{style:{marginTop:25},children:(0,N.jsx)(Me.p0,{className:"btn-primary",loading:m,onClick:t,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Update password",id:"label.update_password.fe45b401"})})})]})}})]})})})})})};var Wy=e=>{const{match:s}=e,{api:a,isLoggedIn:t}=(0,n.nm)(),{formatMessage:i}=(0,ja.A)(),[r,o,d]=(0,ne.CQ)({error:!1,loading:!1,redirect:!1});(0,l.useEffect)(()=>((async()=>{await(async()=>{try{var e;const t=null===s||void 0===s||null===(e=s.params)||void 0===e?void 0:e.token;o({loading:!0}),await a.post(`/api/users/verify/${t}`,""),o({loading:!1,redirect:!0})}catch({err:err}){w(err),o({error:err,loading:!1})}})()})(),d),[]);const{error:c,loading:h,redirect:u}=r;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"vh-100 w-100 d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:c,variant:"danger",children:c}),(0,N.jsx)(Ce.S,{className:"d-flex flex-1 align-items-center justify-content-center",children:u?t?(0,N.jsx)(Pe.rd,{push:!0,to:`/profile?message=${i({id:"label.your_email_was_verified_successful.c6500390",defaultMessage:"Your email was verified successfully"})}`}):(0,N.jsx)(Pe.rd,{push:!0,to:`/?message=${i({id:"label.your_email_was_verified_successful.c6500390",defaultMessage:"Your email was verified successfully"})}`}):(0,N.jsx)(N.Fragment,{children:h&&(0,N.jsx)(Me.y$,{})})})]})})},Ky=t(71166);class Yy extends l.Component{constructor(e){super(e),this.joinClass=()=>{const{app:e,code_token:s,organizations_service:a}=this.props,{api:t}=e;this.setState({error:null,loading:!0}),t.get("/api/groups/codes/join",{code_token:s}).then(async()=>{await e.refreshUserBasics(),await a.sync(),this.setState({loading:!1,redirect:!0})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})},this.state={error:null,loading:!1,redirect:!1,show_login:!1,show_register:!1}}handleHide(){this.setState({show_login:!1,show_register:!1})}render(){const{app:e,group:s,organization:a}=this.props,{user:i}=e,{error:l,loading:n,redirect:r,show_login:o,show_register:d}=this.state;return(0,N.jsx)(py,{offsetTop:25,children:(0,N.jsxs)(Ue.A,{children:[r&&(0,N.jsx)(Pe.rd,{to:"/"}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:l,variant:"danger",children:l}),n&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!n&&!l&&(0,N.jsxs)(Ce.S,{children:[e.isLoggedIn?(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Qe.A,{className:"text-center",children:(0,N.jsxs)(Ve.A,{md:{offset:4,span:4},children:[(0,N.jsx)("img",{alt:"",className:"img-fluid",src:t(15715),style:{marginBottom:35,marginLeft:"auto",marginRight:"auto"}}),(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Join group",id:"label.join_group.48a2587a"})}),(0,N.jsx)("p",{style:{marginBottom:45,marginTop:35},children:(0,N.jsx)(ke.A,{defaultMessage:"Before joining the group, please confirm both <strong>your user information</strong> and the <strong>group details</strong>.",description:"",id:"label.before_joining_the_group_please_co.ec9a2c25",values:{strong:e=>(0,N.jsx)("strong",{children:e})}})})]})}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:{offset:2,span:4},style:{marginBottom:35},children:(0,N.jsxs)(Ge.A,{className:"text-center",children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)("strong",{children:i.fullname})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Zs.A,{fluid:!0,roundedCircle:!0,src:e.getUserAvatar(),style:{maxHeight:175,maxWidth:175}})})]})}),(0,N.jsx)(Ve.A,{md:4,style:{marginBottom:35},children:(0,N.jsxs)(Ge.A,{className:"text-center",children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"You are about to join",id:"label.you_are_about_to_join.1ff14613"})})}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h5",{children:null===s||void 0===s?void 0:s.name}),(0,N.jsx)("h6",{children:(0,N.jsx)("sub",{children:null===a||void 0===a?void 0:a.name})})]})]})})]}),(0,N.jsxs)(Ce.S,{className:"text-center",style:{marginBottom:25},children:[(0,N.jsx)(ve.A,{onClick:this.joinClass.bind(this),size:"lg",variant:"primary",children:"Join group"}),(0,N.jsx)(Ce.S,{style:{marginTop:15},children:(0,N.jsx)(ve.A,{onClick:()=>{this.setState({show_login:!0})},variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Not you? Sign in with another account",description:"",id:"label.not_you_sign_in_with_another_accou.5d06e928"})})})]})]}):(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Qe.A,{className:"text-center",children:(0,N.jsxs)(Ve.A,{md:{offset:4,span:4},children:[(0,N.jsx)("img",{alt:"",className:"img-fluid",src:t(15715),style:{marginBottom:35,marginLeft:"auto",marginRight:"auto"}}),(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Join group",id:"label.join_group.48a2587a"})}),(0,N.jsx)("p",{style:{marginTop:15},children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably! You are about to join the following group and organization:",description:"",id:"label.welcome_to_solvably_you_are_about.ace37fd2"})}),(0,N.jsxs)(Ge.A,{className:"text-center mt-5 mb-5",children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Group details",id:"label.group_details.e25e0312"})})}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h5",{children:null===s||void 0===s?void 0:s.name}),(0,N.jsx)("h6",{children:(0,N.jsx)("sub",{children:null===a||void 0===a?void 0:a.name})})]})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"In order to join this group, choose one of the options below",description:"",id:"label.in_order_to_join_this_group_choose.754ec576"})}),(0,N.jsxs)(Ky.A,{style:{justifyContent:"center",marginTop:25},children:[(0,N.jsx)(ve.A,{onClick:()=>{this.setState({show_login:!0})},size:"lg",style:{marginRight:15},variant:"primary",children:"Login"}),(0,N.jsx)(ve.A,{onClick:()=>{this.setState({show_register:!0})},size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create account",description:"",id:"label.create_account.798ca2ce"})})]})]})}),(0,N.jsxs)(xe,{onHide:this.handleHide.bind(this),show:d,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Register",id:"label.register.bb7234ec"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(cs,{onFinish:this.handleHide.bind(this)})})]})]}),(0,N.jsxs)(xe,{onHide:this.handleHide.bind(this),show:o,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Login",i
2d:"label.login.9d6322c1"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Ns,{onFinish:this.handleHide.bind(this)})})]})]})]})})}}var qy=(0,Ke.Ay)((0,n.G0)((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(B,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{organizations_service:s,ref:e=>this.comp=e}))})}}return s})(Yy)));class Jy extends l.Component{constructor(e){super(e),this.doValidateCode=e=>{this.tryValidateCode(e).then(s=>{const{group:a}=s,{organization:t}=a;this.setState({code_token:e,group:a,organization:t,show_join_dialog:!0})}).catch(e=>{this.setState({error:e})})},this.tryValidateCode=e=>{const{app:s}=this.props;return new Promise(function(a,t){s.api.post("/api/users/code/","",{code_token:e}).then(e=>{a(e)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;console.log("Error: "+s),t(s)})})},this.state={code_token:"",error:null,group:null,organization:null,show_join_dialog:!1}}render(){const{app:e}=this.props,{locale:s}=e;return(0,N.jsx)(Ce.S,{children:this.state.show_join_dialog?(0,N.jsx)(qy,{code_token:this.state.code_token,group:this.state.group,organization:this.state.organization}):(0,N.jsx)(py,{children:(0,N.jsx)(Ue.A,{style:{marginTop:25},children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{lg:{offset:3,span:6},md:{offset:2,span:8},sm:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably",id:"label.welcome_to_solvably.9fa6b41f"})}),(0,N.jsx)("p",{style:{marginBottom:25},children:(0,N.jsx)(ke.A,{defaultMessage:"Enter your registration code below to get started.",description:"",id:"label.enter_your_registration_code_below.b8739e2a"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsx)(ds.l1,{initialValues:{code_token:""},validationSchema:(0,Re.by)({locale:s,scope:"organization.group_code"}),onSubmit:(e,s)=>{this.doValidateCode(e.code_token)},render:e=>{let{dirty:s,errors:a,handleChange:t,handleSubmit:i,isSubmitting:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Registration code",id:"label.registration_code.5ac6bd1d"})}),(0,N.jsx)(_e.A.Control,{isInvalid:n.code_token&&a.code_token,isValid:n.code_token&&!a.code_token,name:"code_token",onChange:t,type:"code_token",value:r.code_token}),(0,N.jsx)(ds.Kw,{name:"code_token",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(ve.A,{className:"btn-primary float-end",onClick:i,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})}})]})})})})})})}}var Xy=(0,n.G0)(Jy);var Zy=e=>(0,N.jsx)(py,{offsetTop:0,children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Ce.S,{className:"mt-5",children:(0,N.jsx)(ns,{})})})});var $y=e=>(0,N.jsx)(py,{offsetTop:0,children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Ce.S,{className:"mt-5",children:(0,N.jsx)(as,{})})})});const ew=(0,l.forwardRef)((s,a)=>{var t;const{onHide:i}=s,{formatMessage:n}=(0,ja.A)(),{api:r,locale:o}=(0,P.nm)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!1,message:"",saving:!1,success:null,visible:!1}),{error:u,loading:m,saving:g,success:p,visible:x}=d,v=()=>c({visible:!0}),f=()=>{"function"==typeof i&&i(),h()};return(0,l.useImperativeHandle)(a,()=>({hide:f,show:v,visible:x})),(0,N.jsxs)(xe,{backdrop:"static",onHide:f,show:x,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Submit a Support Request",id:"label.submit_a_support_request.c6bc427b"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:u,variant:"danger",children:u}),p&&(0,N.jsx)(We.A,{variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"A support request has been submitted. A Solvably team member will respond to you as soon as possible.",id:"label.a_support_request_has_been_submitt.09101361"})}),m&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!u&&!m&&(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ds.l1,{onSubmit:async s=>{try{c({loading:!0});const{browser:a,category:t,description:i,email:l,operating_system:n,role:o}=s;await(async s=>{try{c({loading:!0}),await r.post("/api/site/support",s),c({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}})({browser:a,category:t,description:i,email:l,operating_system:n,role:o}),c({loading:!1,success:"A support request has been submitted. We will respond to you as soon as possible."})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1,success:null})}},validationSchema:(0,Re.by)({locale:o,scope:"misc.support_request"}),initialValues:{browser:"",category:null===(t=iw[0])||void 0===t?void 0:t.t
2icket_id,description:"",email:"",operating_system:"",role:"participant"},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,isValid:i,setFieldValue:l,touched:r,values:o}=e;return(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Account email",id:"label.account_email.316ef5f9"})}),(0,N.jsx)(_e.A.Control,{isInvalid:r.email&&s.email,isValid:r.email&&!s.email,name:"email",onChange:a,type:"text",value:o.email}),(0,N.jsx)(ds.Kw,{name:"email",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"I am...",id:"label.i_am.21179e5c"})}),(0,N.jsxs)(_e.A.Select,{name:"role",onChange:a,value:o.role,children:[(0,N.jsx)("option",{value:"participant",children:n({id:"label.a_participant.2bbeadc3",defaultMessage:"A participant"})}),(0,N.jsx)("option",{value:"facilitator",children:n({id:"label.a_facilitator.c165d8db",defaultMessage:"A facilitator"})}),(0,N.jsx)("option",{value:"administrator",children:n({id:"label.an_administrator.51049fb1",defaultMessage:"An administrator"})})]}),(0,N.jsx)(ds.Kw,{name:"role",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Category",id:"label.category.292c06f0"})}),(0,N.jsx)(_e.A.Select,{name:"category",onChange:a,value:o.category,children:(null===iw||void 0===iw?void 0:iw.length)&&iw.map((e,s)=>{let{ticket_id:a,title:t}=e;return(0,N.jsx)("option",{value:a,children:t},s)})}),(0,N.jsx)(ds.Kw,{name:"category",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),"Troubleshooting and Tech Support"===o.category&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"What operating system are you using? Please include both OS name and version.",id:"label.what_operating_system_are_you_usin.5024f46d"})}),(0,N.jsx)(_e.A.Control,{isInvalid:r.operating_system&&s.operating_system,isValid:r.operating_system&&!s.operating_system,name:"operating_system",onCh
2ange:a,type:"text",value:o.operating_system}),(0,N.jsx)(ds.Kw,{name:"operating_system",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"What browser are you using?",id:"label.what_browser_are_you_using.bd9f20ce"})}),(0,N.jsx)(_e.A.Control,{isInvalid:r.browser&&s.browser,isValid:r.browser&&!s.browser,name:"browser",onChange:a,type:"text",value:o.browser}),(0,N.jsx)(ds.Kw,{name:"browser",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Please provide a brief description of the issue.",id:"label.please_provide_a_brief_description.c789be46"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:r.description&&s.description,isValid:r.description&&!s.description,name:"description",onChange:a,rows:"4",value:o.description}),(0,N.jsx)(ds.Kw,{name:"description",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(ve.A,{className:"pull-right",disabled:g,onClick:t,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})})}})})]})]})});ew.displayName="SupportTicketModal";var sw=ew,aw=t(43624);var tw=e=>{const{details:{entries:s,eventKey:a,title:t}}=e;return(0,N.jsx)(aw.A,{eventKey:a,children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-3",children:[(0,N.jsx)("h5",{children:t}),(0,N.jsx)(Gd.A,{defaultActiveKey:"0",children:(null===s||void 0===s?void 0:s.length)&&s.map((e,s)=>(0,N.jsxs)(Gd.A.Item,{eventKey:`${s}`,children:[(0,N.jsx)(Gd.A.Header,{children:(0,N.jsx)("strong",{children:null===e||void 0===e?void 0:e.header})}),(0,N.jsx)(Gd.A.Body,{children:e.body})]},s))})]})})};var iw=[{entries:[{body:(0,N.jsx)(ke.A,{defaultMessage:"Solvably features an action learning experience unlike anything on the market. Think escape room meets digital team collaboration tech \u2013 all with a focus on solving your organizational challenges.",id:"label.solvably_features_an_action_learni.ade32e11"}),header:(0,N.jsx)(ke.A,{defaultMessage:"What is Solvably?",id:"label.what_is_solvably.d10230fb"})},{body:(0,N.jsx)(ke.A,{defaultMessage:'Simply sign in with your User ID and Password by selecting "Log In" (upper right).',id:"message.simply_sign_in_with_your_user.73442"}),header:(0,N.jsx)(ke.A,{defaultMessage:"How do I log in to Solvably?",id:"label.how_do_i_log_in_to_solvably.97cec553"})},{body:(0,N.jsx)(ke.A,{defaultMessage:"The Solvably platform incorporates multiple components, including challenges, and journeys. Courses contain digital, self-paced learning within a competency framework. Courses contain three components with content tied to the competency at hand: readings, videos, and practical application activities. Challenges allow participants to go through a team-based problem-solving process to engage with a real-world issue, conduct research, interpret findings, and apply knowledge and skills to develop a meaningful solution. Journeys incorporate a combination of courses and challenges.",id:"label.the_solvably_platform_incorporates.aba83582"}),header:(0,N.jsx)(ke.A,{defaultMessage:"How does Solvably work?",id:"label.how_does_solvably_work.f5d80651"})},{body:(0,N.jsx)(ke.A,{defaultMessage:"If enabled, there is a chat feature within the Solvably interface, which allows team members to interact, chat, share files, etc. There is a green circle indicator next to user's avatars, which indicates whether a user is currently logged into the Solvably platform.",id:"label.if_enabled_there_is_a_chat_feature.5e4b5050"}),header:(0,N.jsx)(ke.A,{defaultMessage:"How can I interact with my teammates?",id:"label.how_can_i_interact_with_my_teammat.dc0b3c3e"})},{body:(0,N.jsx)(ke.A,{defaultMessage:"Solvably is currently available in US English.",id:"label.solvably_is_currently_available_in.0918d759"}),header:(0,N.jsx)(ke.A,{defaultMessage:"What languages does Solvably support?",id:"label.what_languages_does_solvably_suppo.ba6976e6"})},{body:(0,N.jsx)(ke.A,{defaultMessage:"Solvably courses are completed by the individual participant. Solvably challenges are completed by a team. Teams consist of 2-7 participants.",id:"label.solvably_courses_are_completed_by.fbda686e"}),header:(0,N.jsx)(ke.A,{defaultMessage:"Do I need to be on a team or can I work on Solvably courses and challenges by myself?",id:"label.do_i_need_to_be_on_a_team_or_can_i.c73d675f"})}],eventKey:"#general",ticket_id:"General / Getting Started",title:(0,N.jsx)(ke.A,{defaultMessage:"General / Getting Started",id:"label.general_getting_started.69e19d69"})},{entries:[{body:(0,N.jsx)(ke.A,{defaultMessage:"You can interact with participants through the Administrator or Facilitator dashboards, where, as applicable, you will have access to view participant's progress on courses, view team's progress on challenges, and engage with participants and team
2s via the chat panel.",id:"label.you_can_interact_with_participants.bafc02e2"}),header:(0,N.jsx)(ke.A,{defaultMessage:"How can I interact with my participants and teams?",id:"label.how_can_i_interact_with_my_partici.a0393b79"})},{body:(0,N.jsx)(ke.A,{defaultMessage:"As an Administrator or Facilitator, you have access to various dashboards where you can track the progress of individual participants and teams. Certain data can also be downloaded.",id:"label.as_an_administrator_or_facilitator.5b980a7f"}),header:(0,N.jsx)(ke.A,{defaultMessage:"How can I view reports and usage statistics?",id:"label.how_can_i_view_reports_and_usage_s.7641a132"})}],eventKey:"#administrators",ticket_id:"Administrators",title:(0,N.jsx)(ke.A,{defaultMessage:"Solvably for Administrators and Facilitators",id:"label.solvably_for_administrators_and_fa.678754e9"})},{entries:[{body:(0,N.jsx)(ke.A,{defaultMessage:"Visit our {privacy_link} and {tos_link} links found at the bottom right of all Solvably pages.",id:"label.visit_our_privacy_link_and_tos_lin.d618bec6",values:{privacy_link:(0,N.jsx)("a",{href:"/privacy",rel:"noopener noreferrer",target:"_blank",children:"Privacy Policy"}),tos_link:(0,N.jsx)("a",{href:"/terms",rel:"noopener noreferrer",target:"_blank",children:"Terms of Service"})}}),header:(0,N.jsx)(ke.A,{defaultMessage:"What is the Solvably privacy policy?",id:"label.what_is_the_solvably_privacy_polic.3501f908"})}],eventKey:"#privacy",ticket_id:"Privacy",title:(0,N.jsx)(ke.A,{defaultMessage:"Privacy",id:"label.privacy.54a57c31"})},{entries:[{body:(0,N.jsx)(ke.A,{defaultMessage:'When logged into Solvably, click your avatar in the top right corner and select "Profile." From the selections on the left of the screen, select "Password" and from there, you can update your password.',id:"message.when_logged_into_solvably_click_your.40517"}),header:(0,N.jsx)(ke.A,{defaultMessage:"How can I change my password?",id:"label.how_can_i_change_my_password.c30e1106"})},{body:(0,N.jsx)(ke.A,{defaultMessage:'Within the "Log In" modal, select "Forgot Password?" and enter your email address. You will then receive an email with instructions to reset your password.',id:"message.within_the_log_in_modal_select.01302"}),header:(0,N.jsx)(ke.A,{defaultMessage:"What if I forget my password?",id:"label.what_if_i_forget_my_password.1c0f8de0"})},{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"With the rapid nature of change within browsers and the numerous devices that they run on, Solvably has a goal to be compatible with the latest version and one previous of the most common modern browsers, on the latest and most common OSes.",id:"label.with_the_rapid_nature_of_change_wi.7db5c9be"})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Latest version of Firefox, Chrome and Edge on Windows",id:"label.latest_version_of_firefox_chrome_a.e64f3ca9"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Latest version of Safari on Mac OS or iOS",id:"label.latest_version_of_safari_on_mac_os.b7a14b3d"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Latest version of Chrome on Android",id:"label.latest_version_of_chrome_on_androi.e722995d"})})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Additional requirements:",id:"label.additional_requirements.fb008689"})}),(0,N.jsx)("ul",{children:(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Must have cookies and JavaScript enabled",id:"label.must_have_cookies_and_javascript_e.727a2efd"})})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"For the participant experience, Solvably will make reasonable efforts to support common browsers on common devices.",id:"label.for_the_participant_experience_sol.931c9a9f"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"For the administrative experience, Solvably recommends using a supported web browser on an updated desktop operating system and does not actively support alternative interfaces including (but not limited to) phones, tablets, smart watches, and/or gaming devices.",id:"label.for_the_administrative_experience.0f64fcb0"})})]}),header:(0,N.jsx)(ke.A,{defaultMessage:"What browsers work best with Solvably?",id:"label.what_browsers_work_best_with_solva.8483660c"})},{body:(0,N.jsx)(ke.A,{defaultMessage:"Yes, you will need to be connected to the Internet to log in and use Solvably.",id:"label.yes_you_will_need_to_be_c
2onnected.88d53757"}),header:(0,N.jsx)(ke.A,{defaultMessage:"Do I need to be connected to the Internet to use Solvably?",id:"label.do_i_need_to_be_connected_to_the_i.1844ce6a"})}],eventKey:"#technical",ticket_id:"Troubleshooting / Technical Support",title:(0,N.jsx)(ke.A,{defaultMessage:"Troubleshooting / Technical Support",id:"label.troubleshooting_technical_support.c092f81c"})},{entries:[{body:(0,N.jsx)(ke.A,{defaultMessage:"In order to begin using Zoom with Solvably, as a learner navigate to an assignment which has teams enabled. Once within an assignment, expand the social menu by clicking on the chat/message icon located on the right side of the screen. Once open, select the voice chat option in the top left of the panel and select Zoom. A dialog will appear which will guide you through the steps towards creating a Zoom meeting for your team. During this process, you will be asked to authenticate with Zoom and allow Solvably access to certain features of Zoom. If you encounter an issue where Solvably is not permitted by your account owner, please reach out to your network administrator and seek assistance approving Solvably.",id:"label.in_order_to_begin_using_zoom_with.2ffdaffc"}),header:(0,N.jsx)(ke.A,{defaultMessage:"Adding and using Zoom",id:"label.adding_and_using_zoom.231f1d14"})},{body:(0,N.jsxs)("ol",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Login to your Zoom Account and navigate to the Zoom App Marketplace.",id:"label.login_to_your_zoom_account_and_nav.5ca63f01"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:'Click Manage >> Added Apps or search for the "Solvably" app.',id:"label.click_manage_greatergreater_added.12e81090"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:'Click the "Solvably" app.',id:"label.click_the_solvably_app.57c3d6ee"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Click Remove.",id:"label.click_remove.81e39530"})})]}),header:(0,N.jsx)(ke.A,{defaultMessage:"Removing zoom",id:"label.removing_zoom.a56c54ac"})}],eventKey:"#integrations",ticket_id:"Integrations",title:(0,N.jsx)(ke.A,{defaultMessage:"Integrations",id:"label.integrations.090512d9"})},{entries:[{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"A Credably.ai certification is a digital credential of achievement that confirms an individual has demonstrated specific competencies by completing real-world, performance-based challenges or approved learner activity data sets. The challenges are most often delivered via Solvably.com.",id:"label.a_credablyai_certification_is_a_di.ede735dd"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"What is a Credably.ai certification?",id:"label.what_is_a_credablyai_certification.a7bb6934"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"You must complete a qualifying certifying challenge on Solvably.com, or approved partner platform, and select certification. Your participation is evaluated through an AI-driven system and reviewed by a qualified Arbitrator. Upon successful completion of a challenge, or other approved activity, you may be eligible for certifications that align with the competencies demonstrated through your collaborative problem-solving, or other activities.",id:"label.you_must_complete_a_qualifying_cer.372ab5c2"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"How do I earn a certification on Credably.ai?",id:"label.how_do_i_earn_a_certification_on_c.3831ae2a"})},{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Credably.ai assesses key artificial intelligence (AI) literacy and / or human intelligence (HI) or other (e.g. core values) competencies that may include:",id:"label.credablyai_assesses_key_artificial.3ecfcb0b"})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"AI: AI use and application, responsible AI application, knowledge of AI tools and systems, data analysis, prompt engineering, AI tool selection, etc.",id:"label.ai_ai_use_and_application_responsi.d459cb35"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"HI: Critical thinking, creativity, collaboration, adaptability and resilience, strategic planning, communication, innovation mindset, etc.",id:"label.hi_critical_thinking_creativity_co.a7176d72"})})]})]}),header:(0,N.jsx)(ke.A,{defaultMessage:"What competencies are assessed in Credably.ai certifications?",id:"label.what_competencies_are_assessed_in.f199c29a"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Anyone who participates in a Credably.ai-approved Solvably challenge or program, including students, educators, corporate professionals, and independent learners \u2013 and who requests certification, including agreeing to the terms provided. If you have completed a Solvably challenge that is linked to certification, you are eligible to participate.",id:"label.anyone_who_participates_in_a_creda.f25fcdd4"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"Who can get certified?",id:"label.who_can_get_certified.7bf939e1"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:'Performance is measured using Credably.ai\'s AI-powered engine against a structured rubric of competencies, each scored as Basic, Emerging, Strong, or Exemplary, as deemed by the certification designer for that certification. In addition, with "human-in-the-loop arbitration," performance is reviewed and can be overridden by a qualified Arbitrator.',id:"label.performance_is_measured_using_cred.8da1590f"})}
2),header:(0,N.jsx)(ke.A,{defaultMessage:"How is my performance evaluated for certification?",id:"label.how_is_my_performance_evaluated_fo.0f6c7759"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:'Typically, Credably.ai AI-powered certification and "human-in-the-loop arbitration" takes up to 48 hours. However, that may vary based on certifying body, Arbitrator availability, and other factors.',id:"label.typically_credablyai_ai_powered_ce.48405aab"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"How long does it take to receive my certification after completing a challenge and requesting evaluation?",id:"label.how_long_does_it_take_to_receive_m.fcb14294"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"A printable Credably.ai certification of achievement via your Solvably ePortfolio, accessible by email and password.",id:"label.a_printable_credablyai_certificati.f059873a"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"What do I receive when I earn a certification?",id:"label.what_do_i_receive_when_i_earn_a_ce.a2adb46e"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Yes, most certifications are recognized by educational institutions and forward-thinking employers looking for talent with real-world, AI-powered problem-solving capabilities. They serve as proof of applied skill and readiness for the future of work. Check with the administrator of your Solvably challenge, certifying body for your certification, and / or specific employer for additional details.",id:"label.yes_most_certifications_are_recogn.40a60f24"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"Are Credably.ai certifications recognized by schools or employers?",id:"label.are_credablyai_certifications_reco.25a4dc8b"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most certifications do not expire, but some may have a renewal period depending on the domain, evolving technology standards (especially AI), and relationship between Solvably, Credably.ai and participating partners. Check with the administrator of your Solvably challenge or certifying body for your certification for additional details.",id:"label.most_certifications_do_not_expire.a25fcc6f"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"Do Credably.ai certifications expire?",id:"label.do_credablyai_certifications_expir.a744a8e6"})},{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Information voluntarily entered by users as part of the Challenge solution or facilitation process may be collected, stored, processed and transferred. This may include some of the following:",id:"label.information_voluntarily_entered_by.c9260f39"})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Any files (images, videos, recordings, documents, etc.) uploaded by admins/learners as part of the Challenge solution process (including in team chat).",id:"label.any_files_images_videos_recordings.122faa1f"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Any URLs entered by users as part of the Challenge solution process.",id:"label.any_urls_entered_by_users_as_part.b222a954"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Only PII necessary for authentication with the Solvably platform (email / full name are required for authentication) and any avatar / banner images uploaded by users for profile customization.",id:"label.only_pii_necessary_for_authenticat.23be5b55"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Opaque voice-chat meeting attendance records (join/leave timestamps associated with their user ID) when hosted through the Solvably platform.",id:"label.opaque_voice_chat_meeting_attendan.f746b1b6"})})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Check with the Solvably {privacy} and {agreement} for more information.",id:"label.check_with_the_solvably_privacy_an.ad168a2d",values:{agreement:(0,N.jsx)("a",{href:"/terms",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"User agreement",id:"label.user_agreement.7aa51faf"})}),privacy:(0,N.jsx)("a",{href:"/privacy",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})})}})})]}),header:(0,N.jsx)(ke.A,{defaultMessage:"What happens to the data and other information from my project?",id:"label.what_happens_to_the_data_and_other.ace485d0"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Yes, team submissions are evaluated collectively, and each eligible participant is evaluated individually and can earn a Credably.ai certification. Furthermore, team deliverables are evaluated as a collective.",id:"label.yes_team_submissions_are_evaluated.80d2e52f"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"Can I get certified as part of a team?",id:"label.can_i_get_certified_as_part_of_a_t.87fe4c7d"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"By sharing your Solvably ePortfolio via social media sites included and / or by providing a shareable link to your Solvably ePortfolio, you can share your Credably.ai certification.",id:"label.by_sharing_your_solvably_eportfoli.28257256"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"How do I include my Credably.ai certification on LinkedIn or my resume?",id:"label.how_do_i_include_my_credablyai_cer.0e0a5cf2"})},{body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"If it's been more than 7 business days, contact [email protected] with your challenge name and completion date.",id:"label.if_its_been_more_than_7_business_d.26f6242c"})}),header:(0,N.jsx)(ke.A,{defaultMessage:"What if I completed a challenge but didn't receive my certification?",id:"label.what_if_i_completed_a_challenge_bu.aefdf3b2"})}],eventKey:"#certifications",ticket_id:"Certifications",title:(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})}];var lw=e=>{const{hash:s}=(0,Pe.zy)(),a=(0,l.useRef)(),t=s||"#general";return(0,N.jsxs)(py,{offsetTop:0,children:[(0,N.jsx)(Ce.S,{style:{backgroundColor:"#e9ecef",height:100,marginBottom:25,paddingTop:"2em"},children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:9,md:12,children:(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Support center",id:"label.support_center.39f12f13"})})}),(0,N.jsx)(Ve.A,{lg:3,md:12,children:(0,N.jsx)(ve.A,{className:"pull-right",onClick:()=>{const e=null===a||void 0===a?void 0:a.current;e&&e.show()},style:{marginTop:".5em"},variant:"link",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Need Help?",id:"label.need_help.5c799f5a"})})})})]})})}),(0,N.jsx)(Ue.A,{children:(0,N.jsx)(ld.A.Container,{defaultActiveKey:t,unmountOnExit:!0,children:(0,N.jsxs)(Qe.A,{style:{paddingBottom:"2em"},children:[(0,N.jsx)(Ve.A,{sm:3,children:(0,N.jsxs)(yl.A,{children:[(0,N.jsx)(yl.A.Item,{action:!0,href:"#general",children:(0,N.jsx)(ke.A,{defaultMessage:"General / Getting Started",id:"label.general_getting_started.69e19d69"})}),(0,N.jsx)(yl.A.Item,{action:!0,href:"#administrators",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably for Administrators and Facilitators",id:"label.solvably_for_administrators_and_fa.678754e9"})}),(0,N.jsx)(yl.A.Item,{action:!0,href:"#privacy",children:(0,N.jsx)(ke.A,{defaultMessage:"Privacy policy",id:"label.privacy_policy.ba445cff"})}),(0,N.jsx)(yl.A.Item,{action:!0,href:"#technical",children:(0,N.jsx)(ke.A,{defaultMessage:"Troubleshooting / Technical Support",id:"label.troubleshooting_technical_support.c092f81c"})}),(0,N.jsx)(yl.A.Item,{action:!0,href:"#integrations",children:(0,N.jsx)(ke.A,{defaultMessage:"Integrations",id:"label.integrations.090512d9"})}),(0,N.jsx)(yl.A.Item,{action:!0,href:"#certifications",children:(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})})]})}),(0,N.jsx)(Ve.A,{sm:9,children:(0,N.jsx)(ld.A.Content,{children:!(null===iw||void 0===iw||!iw.length)&&iw.map((e,s)=>(0,N.jsx)(tw,{details:e},s))})})]})})}),(0,N.jsx)(sw,{ref:a})]})};var nw=e=>{const{styles:s}=(0,n.nm)(),a=null===s||void 0===s?void 0:s.primary;return(0,N.jsx)(py,{offsetTop:0,children:(0,N.jsxs)(Ce.S,{className:"howitworks",children:[(0,N.jsx)(Ce.S,{className:"header-outer",children:(0,N.jsx)(Ce.S,{className:"header-inner",children:(0,N.jsx)(Ue.A,{style:{maxWidth:1260,paddingBottom:60},children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:6,children:[(0,N.jsx)("h2",{className:"mt-5",children:(0,N.jsx)(ke.A,{defaultMessage:"How 
2it Works",id:"label.how_it_works.3a6dd514"})}),(0,N.jsx)("h5",{className:"text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably!",id:"label.welcome_to_solvably.3e79d3de"})}),(0,N.jsx)("p",{style:{maxWidth:500},children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably is a super-engaging way to apply learning, support a deeper understanding of self, and instinctually develop collaborative, creative problem-solving chops essential to the 21st Century workforce. You can think of it as an online escape room where you\u2019ll meet up with teammates to conquer a challenge!",id:"label.solvably_is_a_super_engaging_way_t.4bab096f"})})]}),(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsx)(Zs.A,{fluid:!0,src:t(72273),style:{zIndex:1}})})]})})})}),(0,N.jsxs)(Ce.S,{className:"how-it-works-banner-outer",children:[(0,N.jsx)(Ce.S,{className:"bg-how-it-works"}),(0,N.jsxs)(Ue.A,{className:"label-how-it-works",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"How Solvably works!",id:"label.how_solvably_works.2a46f2ea"})}),(0,N.jsx)(Ce.S,{className:"bg-how-it-works"})]})]}),(0,N.jsx)(Ce.S,{className:"how-it-works-body-outer",style:{backgroundColor:"white",paddingTop:"2em"},children:(0,N.jsx)(Ue.A,{style:{maxWidth:1260},children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"steps-col",md:8,children:[(0,N.jsxs)(Ce.S,{className:"step",children:[(0,N.jsx)(Ce.S,{className:"step-num",children:(0,N.jsx)(jr,{alt:"diploma",path:"paper-diploma/paper-diploma.svg",size:24})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Master the Problem-Solving Process",id:"label.master_the_problem_solving_process.c80eb4b1"})}),(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably\u2019s active, facilitator-guided learning experience consists of 5 phases: Discover, Explore, Imagine, Create, and Reflect. Steps within each stage vary in rigor and are designed to help you think through and further develop your collaborative, creative problem-solving chops.",id:"label.solvablys_active_facilitator_guide.a3b3998f"})})})]}),(0,N.jsxs)(Ce.S,{className:"step",children:[(0,N.jsx)(Ce.S,{className:"step-num",children:(0,N.jsx)(jr,{alt:"two human profiles",path:"users_icon/users-mm-green.svg",size:24})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Collaborate with Teammates",id:"label.collaborate_with_teammates.4808ed6b"})}),(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Ready to work together with your teammates to solve a real-world problem? Learners can work in teams of 2-7 members, brainstorming and innovating together. When a teammate is online, you will see their avatar in the Step they\u2019re currently working on. Feel free to click on that Step to join them and collaborate in real-time! Similar to Google Docs, you will see your teammates\u2019 contributions (text, images, etc.). Remember, respectful team rules always apply.",id:"label.ready_to_work_together_with_your_t.1d66304f"})})})]}),(0,N.jsxs)(Ce.S,{className:"step",children:[(0,N.jsx)(Ce.S,{className:"step-num",children:(0,N.jsx)(jr,{alt:"two speech bubbles",path:"comment_icon/double_comment_icon/double_comment.svg",size:24})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Communicate and Share Ideas",id:"label.communicate_and_share_ideas.46c1ac58"})}),(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"The messaging column on the right allows you to communicate with your teammates and is crucial to solving the problem. This live, active area is a super way to share what you\u2019re working on, discuss team strategy (i.e. divide and conquer), and mention any and all amazing ideas and info relevant to your Challenge.",id:"label.the_messaging_column_on_the_right.408131c5"})})})]}),(0,N.jsxs)(Ce.S,{className:"step",children:[(0,N.jsx)(Ce.S,{className:"step-num",children:(0,N.jsx)(jr,{alt:"pencil",path:"pencil_wide/pencil_wide.svg",size:24})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Be creative",id:"label.be_creative.93e76d97"})}),(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably is a powerful, freeform learning tool that supports thinking outside the box and recognizes that most problems do not have just one solution. So, think creatively! Challenge yourself and your teammates by sharing what you know, gathering useful information, brainstorming great ideas, and then delivering a killer presentation. All problems are standards-aligned, which means you can apply what you\u2019re learning in the classroom to your Challenge, all while wearing your creativity hat!",id:"label.solvably_is_a_powerful_freeform_le.7820bc9e"})})})]}),(0,N.jsxs)(Ce.S,{className:"step",children:[(0,N.jsx)(Ce.S,{className:"step-num",children:(0,N.jsx)(jr,{alt:"construction crane",path:"crane_icon/crane_icon.svg",size:24})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Build Your Power Rating & Your ePortfolio",id:"label.build_your_power_rating_and_your_e.5b728c16"})}),(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Reflect, the final Phase, asks you to (anonymously) evaluate yourself and your teammates on 21st Century skills demonstrated throughout the Challenge. Your facilitator can also evaluate you, so do your best work knowing each contribution matters. When you\u2019re done, the Challenge Hub will light up as a summarized storyboard and you can now show your parents, teachers, and/or employers how y
2ou solved a problem and collaborated with a team! Your My Challenges page (which can be made private or public) can serve as your very own ePortfolio of all the problems you\u2019ve solved.",id:"label.reflect_the_final_phase_asks_you_t.a96279f2"})})})]})]}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsxs)(Ge.A,{body:!0,className:"terms-card",children:[(0,N.jsxs)(Ce.S,{className:"term-outer",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably terms",id:"label.solvably_terms.b39bad61"})}),(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Be sure to get a good grasp of these important terms before you embark on your first Challenge. Talking about Challenge\u2026",id:"label.be_sure_to_get_a_good_grasp_of_the.29084c3f"})})})})]}),(0,N.jsxs)(Ce.S,{className:"term-outer",children:[(0,N.jsx)("span",{children:(0,N.jsx)(jr,{alt:"flag on hill",path:"challenge_flag/challenge_flag.svg",size:18})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})}),(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"This relates to your entire experience, encompassing each of the Phases, from beginning to end! Your Challenge has a title (ie. \u201cThe Problem with Plastics\u201d), a team, an facilitator, and a specific problem to solve.",id:"label.this_relates_to_your_entire_experi.6a5c0622"})})})})]}),(0,N.jsxs)(Ce.S,{className:"term-outer",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ze.kQ4,{color:a,size:18,style:{verticalAlign:"sub"}})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Problem",id:"label.problem.a1c5ae7b"})}),(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:[(0,N.jsx)(ke.A,{defaultMessage:"This is what you\u2019ll be solving! Each Challenge could have several relevant Problems, one of which your team will choose to solve.",id:"label.this_is_what_youll_be_solving_each.2cdfd0bc"}),(0,N.jsx)("br",{}),(0,N.jsx)("span",{className:"ms-3 mt-2",style:{display:"block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Example: In \u201cThe Problem with Plastics\u201d Challenge, the Problem our particular team is solving is How Communities Can Recycle Their Bottles (versus, say, How to Stop Coastal Wildlife from Ingesting Plastic).",id:"label.example_in_the_problem_with_plasti.4d491cb2"})})]})})})]}),(0,N.jsxs)(Ce.S,{className:"term-outer",children:[(0,N.jsx)("span",{children:(0,N.jsx)(jr,{alt:"line ruled paper",path:"document_icon/document_icon.svg",size:18})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deliverable",id:"label.deliverable.b8b36626"})}),(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"This is the final product you\u2019ll download/deliver to your facilitator! Whether it\u2019s a PowerPoint presentation, document, poster, video, etc., the deliverable is the Challenge end-product of all of your research, collaboration, and hard work.",id:"label.this_is_the_final_product_youll_do.e010dbc5"})})})})]}),(0,N.jsxs)(Ce.S,{className:"term-outer",children:[(0,N.jsx)("span",{children:(0,N.jsx)(jr,{alt:"sketch of mountain and moon",path:"img_icon/mu_green/img_icon.svg",size:18})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Artifact",id:"label.artifact.e06171a1"})}),(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"While this may sound like a nod to Indiana Jones and the Temple of Doom, it\u2019s actually just a file type, like video, audio, document, image, etc.",id:"label.while_this_may_sound_like_a_nod_to.9efd3c94"})})})})]}),(0,N.jsxs)(Ce.S,{className:"term-outer",children:[(0,N.jsx)("span",{children:(0,N.jsx)(jr,{alt:"four small rectangles",path:"framework_icon/framework_icon_mu_green.svg",size:18})}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge hub",id:"label.challenge_hub.5540cc10"})}),(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"This is your Challenge team\u2019s home base. Your HQ. Your nerve center. [Puts down thesaurus] The Challenge Hub is where each team member and facilitator can start and return to throughout the Challenge to take inventory of which Phases have been completed and to see what\u2019s left to complete!",
2id:"label.this_is_your_challenge_teams_home.4e694f42"})})})})]})]})})]})})})]})})};const rw=()=>{const[e,s]=(0,l.useState)(!1);return(0,l.useContext)(P.BR).isLoggedIn?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(ta.A,{autoClose:!0,className:"marketplace-landing-wif-menu",onClick:()=>{s(!e)},renderMenuOnMount:!0,title:(0,N.jsxs)("span",{className:"d-inline-flex align-items-center",children:[(0,N.jsx)(ze.x$1,{color:"var(--gray-500)"}),(0,N.jsx)(ke.A,{defaultMessage:"Who It's For",id:"label.who_its_for.822c84cf"})]}),children:[{name:"K-12",path:"/marketplace/k-12"},{name:"Higher Education",path:"/marketplace/hied"},{name:"Corporate",path:"/marketplace/talent"}].map((e,s)=>(0,N.jsx)("a",{className:"dropdown-item",href:e.path,children:e.name},s))})};var ow=rw,dw=t.p+"static/media/prepare-mobile-pg-1.41868c4df59f02de6cf2.png",cw=t.p+"static/media/prepare-mobile-pg-2.215ae29c3c0da145d795.png",hw=t.p+"static/media/prepare-mobile-pg-3.130f61a6cf1d8c6cdf33.png",uw=t.p+"static/media/solvably-laptop-arrows.85fd9b4940813203ed63.png";var mw=()=>(0,N.jsx)(W_.A,{className:"testimonials position-static",interval:5e3,slide:!1,children:[{author:"Solvably learner",content:"I greatly enjoyed the experience because it makes learning quite fun and being able to bounce ideas off one another as a group really helps."},{author:"World Economic Forum Future of Jobs report",content:"Complex problem solving, critical thinking, and creativity are the top three skills required to thrive in the 4th Industrial Revolution."},{author:"Solvably learner",content:"Solvably would help me be more prepared for college and career by applying real-world scenarios to what I\u2019m learning in class."},{author:"Adobe Creative Problem Solving global study",content:"86% of educators and 85% of policymakers believe students with creative problem-solving skills will be the ones who get the high-earning jobs."},{author:"Solvably learner",content:"Because it was very challenging, it made us think and actually do research and interact with our team."},{author:"National Association of Colleges and Employers",content:"72% of hiring managers say students are not prepared for the workforce."}].map((e,s)=>(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)("figure",{className:"contents",children:(0,N.jsxs)("blockquote",{className:"blockquote",children:[`"${e.content}"`,(0,N.jsx)("figcaption",{className:"",children:e.author})]})})},s))});var gw=e=>{const{url:s}=e;return(0,N.jsx)("div",{className:"landing-award-logo",id:"awardSolvably",children:s?(0,N.jsxs)("a",{href:s||"/marketplace/talent/ai",children:[(0,N.jsx)(Zs.A,{alt:"Edtech breakthrough award logo",height:200,src:t(64365),width:200}),(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Visit Solvably Marketplaces and",id:"label.visit_solvably_marketplaces_and.ffd8ced2"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Learn more TODAY!",id:"label.learn_more_today.8a96eda5"})]})]}):(0,N.jsxs)(Le.Link,{to:s||"/marketplace/talent/ai",children:[(0,N.jsx)(Zs.A,{alt:"Edtech breakthrough award logo",height:200,src:t(64365),width:200}),(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Visit Solvably Marketplaces and",id:"label.visit_solvably_marketplaces_and.ffd8ced2"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Learn more TODAY!",id:"label.learn_more_today.8a96eda5"})]})]})})};const pw=l.createContext({}),xw=pw.Provider;pw.Consumer;var vw=t.p+"static/media/solvably-landing-movie.a2acc49123388666ecd2.mp4";var fw=e=>(0,N.jsxs)(Ce.S,{className:"landing-page-movie",children:[(0,N.jsx)("video",{autoPlay:!0,className:"video-fluid",controls:!1,crossOrigin:"anonymous",height:1230,loop:!0,muted:!0,title:"solvably landing page movie",width:1920,children:(0,N.jsx)("source",{src:vw,type:"video/mp4"})}),(0,N.jsxs)("div",{className:"text-overlay",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"The first collaborative, creative problem-solving",id:"label.the_first_collaborative_creative_p.fe5721ed"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"platform for lifelong learners.",id:"label.platform_for_lifelong_learners.65e1ba3f"})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:e.onClick,children:[(0,N.jsx)(ze.Wqt,{fill:"#FFFFFF"}),(0,N.jsx)(ke.A,{defaultMessage:"Request demo",id:"label.request_demo.915b64b6"})]})]})]}),jw=t.p+"static/media/collaborate.0c23f28f007f3c806b58.png",_w=t.p+"static/media/promote.27aaef48928d59115204.png",bw=t.p+"static/media/master.5d6ac673182d96a96ac1.png";var Aw={collaborate:jw,communicate:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAFwCAYAAABO94lEAAAc60lEQVR4Xu2d+ZOeVZmG/bMG
2kLLGRIY1YccJUukkpLOQ7nQn6c6+GAEhIJHIIEQQccOARolIBiaopeO4FTWuzJQjjoaSkSoXUBgIVOUMXyzKeL8z8+qT83bf55zrqrp+oayY9/vO81x1ur90vy1BFfzhpRfTt7/6VHpg/770vslVaeLyC9LYgrPS0nf+DWI2l7/rnDR9zaJ068xkOnTw7vSD73wrvX7ihB5HAJgH3qb/AcriJz/8fjqwZ+upRavLF3EuXL1oYfr4gTv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RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglEJOuaSoAN4Q9BN0SUYlaBjLgk6gDcE3RRdglFXXX3VqagjnqkrF1/UOV8R96xdoccdADJA0E0ZW3BWZxEi1uC+2fV63AEgAwTdlIkrLuwsQsQavGvvDj3uAJABgm7K+yZXdRYhYg0+cv89etwBIAME3ZQH77y9swgRa/CbX35SjzsAZICgm/Ltrz7VWYSINfjrF36lxx0AMkDQTfnDSy+m5e86p7MMEUt25/iYHnUAyARBN+auvds7CxGxZJ84/LAecwDIBEE35ic//H5nISKW6qqLF6RXXnlZjzkAZIKgm3Pb5unOYkQs0S984gE93gCQEYJuzvPHf8H30rF4Z95zZTrx2mt6vAEgIwS9AEbfd9QFiViKyxaenX76zI/1WANAZgh6AZw8eTLdfdOuzqJELMFjRw7rkQaAASDohfDGG6/z/XQszsMfu0+PMgAMBEEviFHUualjKR595CE9wgAwIAS9MEZffj/62c/wQTm0deLyC9KPnv6uHl0AGBiCXijPH/952rd5qrNMEefL0a/8fWD/vvTySy/pcQWAOYCgF87oh88c2LOVGzvOm6sXLUwfP3BHeuH5X+rxBIA5hKBXwuhnv49+ocvohjT61aujL3uObky6fBHPxOXnvT1NX7Mo3TozmQ4dvDv94DvfSq+fOKHHEQDmgf8BIsZl00L5fWkAAAAASUVORK5CYII=",create:t.p+"static/media/create.c7b560ef1e2f9ae49b12.png",master:bw,measure:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAFwCAYAAABO94lEAAAlhUlEQVR4Xu2d+ZdWxbm2z5+lGZYDGEDBeYqotICA2szILPMkGMI8CyiCghEQBVoQjYiME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4gYyhCVsDIHITwEekCoeEXE3JT5InPGnj0uNiph2+chhIVADwgVr4iYozJn7NnjqsxDCAuBHggqXhExV3+ohPX7x4NkHspchHAQ6IEIUvG6kopXRIxjiEpYmYsQDgI9AP/92aempdOFajO7OOiWblS8ImI0Q1TCylyU+QhhINAD8MjieWoju8qfpkTE2IaohF23cK49MsETBLpnvvvuWzOgR2e1iV0c2e8addAQEWPouxJW5qPMSfAPge6ZEJ3tjz11vzpkiIgxDFEJS8d7GAh0z2xcuURtXhcnDO+pDhgiYkx9V8LKnAT/EOie8fknUls6X2i27KHiFRGr1XclrMxJ8A+B7pmhN12pNm+zzpxMxSsipqHMI3tGNeuQm3rYoxM8QKB75s7LL1abtxn7dP0FFa+ImIyNStiufsqyZE6Cfwh0z9gbt1lH9L3aLF48AhExGWUu2bOqWcE/BLpnel/2c7VxERHxJ2VOgn8IdM/Ivw3ZmxcREX+Sf0MPA4HumamD+qvNi4iIPylzEvxDoHtm/ZIFavMiIuJPypwE/xDonjn0+z1q8yIi4k/KnAT/EOie+fLECdOnyy/VBkZExAsa81HmJPiHQA/AkukT1CZGRMQLGvMRwkCgB+C9d95SmxgRES9ozEcIA4EeiLnj71UbGRGxzspchHAQ6IH45MP3Te9f+alJRETMXSmTkbkI4SDQA9L2xEa1qRER6+jO3z1mj0jwDIEekFOnTpllMyapjY2IWCflB+FkHkJYCPTAfPP112bOKH9/Ix0RMSdl/skchPAQ6BH47ttvzdLpE9VGR0QsWZl7337zjT0SIRAEeiTk2027tjxu+na5SG16RMSSlDkn845vs8eFQI/MZx8fNw+MGaYOACJiCcq32GXOQXwI9IqQcoVFU8ZTE4uI2StzTOYZpTHVQqBXjHQayx8qkL8+NG3IADP4+u78/joiJqvMJ5lTMq9kbsn8ops9Df4/iDURlICcKLkAAAAASUVORK5CYII=",promote:_w};var yw=e=>(0,N.jsx)(Qe.A,{className:"objectives",children:[{description:"the problem-solving process.",name:"master"},{description:"with teammates in real-time.",name:"collaborate"},{description:"with peers and instructors",name:"communicate"},{description:"deliver and present your solution.",name:"create"},{description:"your 21st century skills.",name:"measure"},{description:"your ePortfolio to colleges/employers",name:"promote"}].map((e,s)=>(0,N.jsx)(Ve.A,{className:`objective-card-wrapper ${e.name}`,lg:2,xs:8,children:(0,N.jsx)("div",{className:"objective-card-flipper",children:(0,N.jsxs)(Ce.S,{className:"objective-card",children:[(0,N.jsxs)("div",{className:"front",children:[(0,N.jsx)(Zs.A,{fluid:!0,src:Aw[e.name]}),(0,N.jsx)("strong",{children:e.name})]}),(0,N.jsxs)("div",{className:"back",children:[(0,N.jsx)("strong",{children:e.name}),(0,N.jsx)("p",{children:e.description})]})]})})},s))}),ww=t.p+"static/media/corporate.1f0e868873e5c28d55e8.png";var Nw={adult:t.p+"static/media/adult.5f189f01854e5a2401c5.png",corporate:ww,hied:t.p+"static/media/hied.32942638599dce80d942.png",k12:t.p+"static/media/k12.4c863bb21eb7a45d7cd6.png"};var Sw=e=>{const s=[{description:(0,N.jsx)(ke.A,{defaultMessage:"Collaborate in teams to solve pedagogically sound, standards-based challenges in Social Studies, Science, Math, CTE, STEAM, ELA, and PD.",id:"label.collaborate_in_teams_to_solve_peda.e133ec0a"}),icon:null===Nw||void 0===Nw?void 0:Nw.k12,name:(0,N.jsx)(ke.A,{defaultMessage:"K-12",id:"label.k_12.d8f43b36"}),path:"/marketplace/k-12"},{description:(0,N.jsx)(ke.A,{defaultMessage:"Develop the 21st Century workforce skills you need by communicating with your peers to solve engaging, real-world problems that speak to the future.",id:"label.develop_the_21st_century_workforce.84ed4038"}),icon:null===Nw||void 0===Nw?void 0:Nw.hied,name:(0,N.jsx)(ke.A,{defaultMessage:"Higher education",id:"label.higher_education.70eaebd2"}),path:"/marketplace/hied"},{description:(0,N.jsx)(ke.A,{defaultMessage:"Take training content to the next level by using Solvably\\u2019s creative problem solving / design thinking framework to engage continuous productivity and growth.",id:"label.take_training_content_to_the_next.262ae45b"}),icon:null===Nw||void 0===Nw?void 0:Nw.corporate,name:(0,N.jsx)(ke.A,{defaultMessage:"Corporate",id:"label.corporate.a0347299"}),path:"/marketplace/talent"}];return(0,N.jsx)(Qe.A,{className:"audiences",children:s.map((e,s)=>(0,N.jsxs)(Ve.A,{className:`audience-card ${e.name} d-flex flex-column justify-content-between`,lg:3,xs:8,children:[(0,N.jsxs)(Ce.S,{className:"audience-card-inner",children:[(0,N.jsx)(Le.Link,{to:e.path,children:(0,N.jsx)(Zs.A,{fluid:!0,src:e.icon})}),(0,N.jsx)("p",{className:"name",children:e.name}),(0,N.jsx)("p",{className:"description",children:e.description})]}),(0,N.jsx)("p",{className:"m-0",children:(0,N.jsx)(Le.Link,{to:e.path,children:(0,N.jsx)(ve.A,{children:(0,N.jsx)(ke.A,{defaultMessage:"More info",id:"label.more_info.7dd4d97d"})})})})]},s))})};const Cw=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({error:!1}),n=(0,l.useRef)(),r=e=>{t({error:e})},o=e=>{n.current.show()},{error:d}=a,c={logged_in:{right:(0,N.jsx)(ow,{})},logged_out:{right:(0,N.jsx)(ow,{})}};return(0,l.useImperativeHandle)(s,()=>({handleDemoClick:o,setError:r})),(0,N.jsx)(py,{customMenu:c,children:(0,N.jsxs)(xw,{value:{error:d,setError:r},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{t({error:null})},show:d,variant:"danger",children:d}),(0,N.jsxs)("div",{className:"landing-page",children:[(0,N.jsx)(fw,{onClick:o}),(0,N.jsxs)(Ce.S,{className:"landing-page-contents",children:[(0,N.jsxs)("section",{className:"section-welcome",children:[(0,N.jsxs)(Ue.A,{className:"heading text-center heading-container pb-2 px-2",children:[(0,N.jsx)("p",{className:"subheading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably",id:"label.welcome_to_solvably.9fa6b41f"})}),(0,N.jsx)("p",{className:"heading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"The future has spoken.",id:"label.the_future_has_spoken.b539e1ad"})})]}),(0,N.jsx)(Ce.S,{className:"d-none d-sm-none d-md-block text-center",children:(0,N.jsx)(Zs.A,{alt:"solvably landing page on a laptop",fluid:!0,src:uw,style:{width:1200}})}),(0,N.jsx)(Ce.S,{className:"d-block d-md-none d-flex justify-content-center text-center pb-4",children:(0,N.jsxs)(W_.A,{children:[(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;Scaffolded, scalable framwork",className:"prepare-img-mobile",src:dw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"Longitudinal efficacy tracking and reporting",className:"prepare-img-mobile",src:cw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"360 degree competency evaluations",className:"prepare-img-mobile",src:hw})})]})}),(0,N.jsxs)(Ue.A,{className:"body text-center heading-container px-2",children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tomorrow's workforce requires agile, problem-solving candidates who use critical thinking, creativity, and collaboration to get things done. Solvably is the first digital platform that best prepares today's learners for tomorrow's workforce by supporting the development of crucial 21st Century workforce readiness competencies.",id:"label.tomorrows_workforce_requires_agile.389543f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"An academically sound learning framework for collaborative, creative problem solving, Solvably incorporates elements of problem- and project based learning, design thinking, gamification, and inquiry based learning. In addition to its library of 450+ ready-to-go, pedagogically sound learning challenges,Solvably is also an easy-to-author tool for instructors, professors, and employers!",id:"label.an_academically_sound_learning_fra.24241cb4"})}),(0,N.jsx)("div",{className:"text-center mt-4",children:(0,N.jsx)(ve.A,{onClick:o,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Learn more",id:"label.learn_more.1445799c"})})})]})]}),(0,N.jsxs)("section",{className:"transformative-learning",children:[(0,N.jsxs)(Ue.A,{className:"heading text-center",children:[(0,N.jsx)("p",{className:"subheading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Transformative learning",id:"label.transformative_learning.072c327b"})}),(0,N.jsxs)("p",{className:"heading-text",children:[(0,N.jsx)(ke.A,{defaultMessage:"Solve real-world problems and",id:"label.solve_real_world_problems_and.ae1a1e8d"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"develop 21st Century skills.",id:"label.develop_21st_century_skills.bbd5f3d4"})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably brings together design thinking, collaboration, and real-world problem solving, enabling learners to develop the skills they need to thrive in the future. Unlike traditional edtech, the Solvably experience centers learning around solving an authentic challenge or problem. It's true learning by doing!",id:"label.solvably_brings_together_design_th.ec8bae98"})})]}),(0,N.jsx)(Ue.A,{children:(0,N.jsx)(yw,{})})]}),(0,N.jsx)("section",{className:"full-cta",children:(0,N.jsx)(Ce.S,{className:"full-cta-center flex-fill",children:(0,N.jsxs)(ve.A,{className:"text-decoration-none",onClick:o,variant:"link",children:[(0,N.jsxs)("p",{className:"problem-solver d-flex align-items-center gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Be a problem solver",id:"label.be_a_problem_solver.07e9a137"}),(0,N.jsx)(ze.X6T,{className:"ms-1",fill:"#FFFFFF",size:32})]}),(0,N.jsxs)("p",{className:"contact-us d-flex align-items-center gap-3",children:[(0,N.jsx)(ke.A,{defaultMessage:"Contact us",id:"label.contact_us.47aaf31b"}),(0,N.jsx)(ze.maD,{fill:"#FFFFFF"})]})]})})}),(0,N.jsxs)("section",{className:"lifelong-solution",children:[(0,N.jsxs)(Ue.A,{className:"heading text-center",children:[(0,N.jsx)("p",{className:"subheading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"A lifelong solution",id:"label.a_lifelong_solution.0067f471"})}),(0,N.jsx)("p",{className:"heading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"All Learners Welc
2ome!",id:"label.all_learners_welcome.407adf04"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably is for lifelong learners. From the classroom, to the boardroom, to the great outdoors, it's the go-to solution for collaborative, creative problem solvers.",id:"label.solvably_is_for_lifelong_learners.d6df8bd8"})})]}),(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Sw,{})})]}),(0,N.jsxs)("section",{className:"the-buzz",children:[(0,N.jsxs)("div",{className:"heading",children:[(0,N.jsx)("p",{className:"subheading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"The buzz",id:"label.the_buzz.e54ea003"})}),(0,N.jsx)("p",{className:"heading-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Don't just take our word for it.",id:"label.dont_just_take_our_word_for_it.3af1aa19"})})]}),(0,N.jsx)(mw,{})]})]}),(0,N.jsx)(gw,{})]}),(0,N.jsx)(fs,{generic:!0,ref:n})]})})});Cw.displayName="Landing";var Mw=Cw;var kw={shesolves:(0,l.lazy)(()=>t.e(817).then(t.bind(t,88817)))};const zw=e=>{var s,a;const t=(null===e||void 0===e?void 0:e.slug)||(null===e||void 0===e||null===(s=e.match)||void 0===s||null===(a=s.params)||void 0===a?void 0:a.organization_slug),i=t?kw[t]:null;return i?(0,N.jsx)(l.Suspense,{fallback:(0,N.jsx)(Me.x_,{loading:!0}),children:(0,N.jsx)(i,(0,F.A)({},e))}):(0,N.jsx)(Mw,(0,F.A)({},e))};zw.displayName="PortalLanding";var Tw=zw;var Iw=e=>{const s=(0,l.useRef)(),a=(0,l.useRef)(),t=(0,l.useRef)(),[i,n]=(0,l.useState)(1),r={widgets:{assignment:null===s||void 0===s?void 0:s.current,competencies:null===a||void 0===a?void 0:a.current,progress:null===t||void 0===t?void 0:t.current}};return(0,N.jsx)(Fw,{value:(0,F.A)({},r),children:(0,N.jsx)(py,{className:"learner-dashboard d-flex flex-column",children:(0,N.jsx)(tN,{children:(0,N.jsxs)(Ue.A,{className:"pb-3 pt-0 pt-lg-2 d-flex flex-column gap-5",children:[(0,N.jsx)(aN.Assignments,{ref:s}),(0,N.jsx)(aN.Competencies,{ref:a}),(0,N.jsx)(aN.Progress,{ref:t})]})})})})};const Ew=l.createContext({}),Fw=Ew.Provider;Ew.Consumer;Ew.displayName="LearnerDashboardContext";const Rw=(0,l.forwardRef)((s,a)=>{var t,i,n,r;const{api:o}=(0,P.nm)(),[d,c]=(0,ne.CQ)({competencies:null,error:null,loading:!0}),{error:h,loading:u}=d,m=[{colors:{muted:"rgba(23, 162, 184, .2)",normal:"rgba(23, 162, 184, 1)"},icon:nh.critical_white,name:"critical-thinking",score:Number.parseFloat(null===d||void 0===d||null===(t=d.competencies)||void 0===t?void 0:t[0])||0},{colors:{muted:"rgba(253, 126, 20, .2)",normal:"rgba(253, 126, 20, 1)"},icon:nh.communicator_white,name:"communication",score:Number.parseFloat(null===d||void 0===d||null===(i=d.competencies)||void 0===i?void 0:i[1])||0},{colors:{muted:"rgba(124, 89, 216, .2)",normal:"rgba(124, 89, 216, 1)"},icon:nh.collaborator_white,name:"collaboration",score:Number.parseFloat(null===d||void 0===d||null===(n=d.competencies)||void 0===n?void 0:n[2])||0},{colors:{muted:"rgba(0, 128, 188, .2)",normal:"rgba(0, 128, 188, 1)"},icon:nh.creativity_white,name:"creativity",score:Number.parseFloat(null===d||void 0===d||null===(r=d.competencies)||void 0===r?void 0:r[3])||0}];(0,l.useEffect)(()=>{(async()=>{try{c({loading:!0});const{competencies:e}=await o.get("/api/users/details/avg-competencies");c({competencies:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}})()},[]),(0,l.useImperativeHandle)(a,()=>({error:h,loading:u}));const g={competencies:m,error:h,loading:u};return(0,N.jsx)(Pw,{value:(0,F.A)({},g),children:(0,N.jsxs)("section",{className:"competencies-widget d-flex flex-column gap-2",id:"competencies",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies",id:"label.competencies.ec64b47c"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:h,variant:"danger",children:h}),(0,N.jsx)(Me.x_,{loading:u,spinner:(0,N.jsx)(Hw,{}),children:(0,N.jsx)(Uw,{})})]})})});Rw.displayName="CompetenciesWidget";var Dw=Rw;const Bw=l.createContext({}),Pw=Bw.Provider;Bw.Consumer;Bw.displayName="CompetenciesWidgetContext";const Lw=()=>(0,l.useContext)(Bw);var Ow=t(89365);var Hw=e=>{const{competencies:s}=Lw();return(0,N.jsx)(Qe.A,{className:"competencies-placeholder m-0 gy-3 gy-lg-0",children:s.map((e,s)=>{let{colors:a,icon:t,name:i}=e;return(0,N.jsx)(Ve.A,{lg:3,sm:6,xs:12,children:(0,N.jsxs)(Rh.A,{animation:"wave",as:Ge.A,className:`competency-card placeholder-card p-0 border-0 flex-row flex-sm-column ${i}`,children:[(0,N.jsxs)(Ce.S,{className:"card-img border-0 d-flex flex-column align-items-center justify-content-center justify-content-sm-end",children:[(0,N.jsx)(Zs.A,{alt:`${i} competency icon`,src:t}),(0,N.jsx)("h4",{className:"text-capitalize",children:i.replace("-"," ")})]}),(0,N.jsxs)(Ge.A.Body,{className:"pb-3",children:[(0,N.jsxs)("div",{className:"d-flex gap-1",children:[(0,N.jsx)("h1",{children:"-"}),(0,N.jsx)("h1",{children:"-"})]}),(0,N.jsx)(Ow.G,{allowFraction:!0,allowHover:!0,readonly:!0,transition:!0,className:"stars stars-placeholder",emptyColor:null===a||void 0===a?void 0:a.muted,fillColor:null===a||void 0===a?void 0:a.normal,iconsCount:4,initialValue:0,size:32})]})]})},s)})})};var Uw=e=>{const{competencies:s}=Lw();return(0,N.jsx)(Qe.A,{className:"competency-card-list m-0 gy-3 gy-lg-0",children:s.map((e,s)=>(0,N.jsx)(Qw,{competency:e},s))})};var Qw=e=>{const{competency:s}=e,{colors:a,icon:t,name:i,score:l}=s,n=oa()(`competency-card p-0 border-0 flex-row flex-sm-column ${i}`,{"no-score":!l});return(0,N.jsx)(Ve.A,{lg:3,sm:6,xs:12,children:(0,N.jsxs)(Ge.A,{className:n,children:[(0,N.jsxs)(Ce.S,{className:"card-img border-0 d-flex flex-column align-items-center justify-content-center justify-content-sm-end",children:[(0,N.jsx)(Zs.A,{alt:`${i} competency icon`,src:t}),(0,N.jsx)("h4",{className:"text-capitalize",children:i.replace("-"," ")})]}),(0,N.jsx)(Ge.A.Body,{children:l?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"d-flex",children:(0,N.jsx)("h1",{children:l.toFixed(1)})}),(0,N.jsx)(Ow.G,{allowFraction:!0,allowHover:!0,readonly:!0,transition:!0,className:"stars stars-placeholder",emptyColor:null===a||void 0===a?void 0:a.muted,fillColor:null===a||void 0===a?void 0:a.normal,iconsCount:4,initialValue:l,size:32})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"d-flex gap-1",children:[(0,N.jsx)("h1",{children:"-"}),(0,N.jsx)("h1",{children:"-"})]}),(0,N.jsx)(Ow.G,{allowFraction:!0,allowHover:!0,readonly:!0,transition:!0,className:"stars stars-placeholder",emptyColor:null===a||void 0===a?void 0:a.muted,fillColor:null===a||void 0===a?void 0:a.normal,iconsCount:4,initialValue:0,size:32})]})})]})})},Vw=t(6079),Gw=t(92729);const Ww=e=>{let{end_date:s,hidden_series_ids:a,longitudinal_efficacy:t,show_date_range:i,start_date:l,subt
2itle:n}=e;const{isBelowBreakpoint:r}=(0,ne.vh)({breakpoint:576}),[o,d,c]=(0,ne.CQ)({opacity:{Collaboration:1,Communication:1,Creativity:1,"Critical Thinking":1}}),{opacity:h}=o,u=e=>{let{stroke:s}=e;return(0,N.jsx)("text",{dy:-4,fill:s,fontSize:14,textAnchor:"middle",transform:"rotate(-90)",x:-130,y:20,style:{fill:"#212529",fontWeight:500},children:(0,N.jsx)(ke.A,{defaultMessage:"C value",id:"label.c_value.b5de30f3"})})},m=e=>{let{color:s,cx:a,cy:t}=e;return(0,N.jsxs)("svg",{children:[(0,N.jsx)("circle",{cx:a,cy:t,fill:s,opacity:.2,r:"12.5",strokeWidth:"2"}),(0,N.jsx)("circle",{cx:a,cy:t,fill:"white",r:"6",stroke:`${s}`,strokeWidth:"2"})]})},g=t?(e=>{const s=[];return e.forEach((e,a)=>{var t,i,n,r,o,d,c,h;const u=ci()(l).add(a,"days").format("MMM D"),m={amt:4,Collaboration:(null===e||void 0===e||null===(t=e.collaboration)||void 0===t||null===(i=t.toFixed)||void 0===i?void 0:i.call(t,2))||0,Communication:(null===e||void 0===e||null===(n=e.communication)||void 0===n||null===(r=n.toFixed)||void 0===r?void 0:r.call(n,2))||0,Creativity:(null===e||void 0===e||null===(o=e.creativity)||void 0===o||null===(d=o.toFixed)||void 0===d?void 0:d.call(o,2))||0,"Critical Thinking":(null===e||void 0===e||null===(c=e.critical)||void 0===c||null===(h=c.toFixed)||void 0===h?void 0:h.call(c,2))||0,name:u};s.push(m)}),s})(t):null,p=["rgba(23, 162, 184, 1)","rgba(253, 126, 20, 1)","rgba(124, 89, 216, 1)","rgba(0, 128, 188, 1)","black","#be0000","orange"],x=["Critical Thinking","Communication","Collaboration","Creativity"];return(0,N.jsxs)(Ce.S,{className:"longitudinal-efficacy-graph",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1 mb-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center flex-fill",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Longitudinal efficacy",id:"label.longitudinal_efficacy.4ff0c8d9"})}),i&&(0,N.jsxs)("small",{className:"text-secondary",children:[(0,N.jsx)(Gh.XU,{value:l})," \u2013 ",(0,N.jsx)(Gh.XU,{value:s})]})]}),(0,N.jsx)("small",{children:n||(0,N.jsx)(ke.A,{defaultMessage:"Changes in C value by ascending date",id:"label.changes_in_c_value_by_ascending_da.9a421a1d"})})]}),(0,N.jsx)(jt.u,{maxHeight:350,minHeight:300,width:"100%",children:(0,N.jsxs)(Vw.b,{data:g,margin:{bottom:5,left:0,right:30,top:5},children:[(0,N.jsx)(bt.d,{stroke:"#d1d1d1",vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name",interval:"preserveStartEnd"}),(0,N.jsx)(yt.h,{domain:[0,4],label:(0,N.jsx)(u,{}),ticks:[0,1,1.5,2,2.5,3,3.5,4]}),(0,N.jsx)(wt.m,{content:(0,N.jsx)(Yw,{})}),x&&x.map((e,s)=>{const t=p[s];return-1!==a.indexOf(s)?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Gw.N,{activeDot:(0,N.jsx)(m,{color:t}),dataKey:e,dot:!1,stroke:t,strokeOpacity:null===h||void 0===h?void 0:h[e],strokeWidth:3,type:"monotone"},s)})}),(0,N.jsx)(Nt.s,{align:"center",iconType:"plainline",layout:r?"vertical":"horizontal",onMouseEnter:e=>{const{dataKey:s}=e,a=(0,F.A)({},o.opacity);Object.entries(o.opacity).forEach(e=>{let[t]=e;return a[t]=t===s?1:.3}),d({opacity:a})},onMouseLeave:()=>c(),verticalAlign:"bottom"})]})})]})};Ww.defaultProps={hidden_series_ids:[],longitudinal_efficacy:[],show_date_range:!1};var Kw=Ww;var Yw=e=>{const{active:s,label:a,payload:t}=e,i=(()=>{var e,s,a,i,l,n,r,o;const[d,c,h,u]=t||[];if(!c||!d||!h||!u)return[{name:"Communication"},{name:"Critical Thinking"},{name:"Collaboration"},{name:"Creativity"}];return[{color:null===c||void 0===c?void 0:c.color,name:"Communication",value:(null===(e=(s=Number.parseFloat(null===c||void 0===c?void 0:c.value)).toFixed)||void 0===e?void 0:e.call(s,2))||""},{color:null===d||void 0===d?void 0:d.color,name:"Critical Thinking",value:(null===(a=(i=Number.parseFloat(null===d||void 0===d?void 0:d.value)).toFixed)||void 0===a?void 0:a.call(i,2))||""},{color:null===h||void 0===h?void 0:h.color,name:"Collaboration",value:(null===(l=(n=Number.parseFloat(null===h||void 0===h?void 0:h.value)).toFixed)||void 0===l?void 0:l.call(n,2))||""},{color:null===u||void 0===u?void 0:u.color,name:"Creativity",value:(null===(r=(o=Number.parseFloat(null===u||void 0===u?void 0:u.value)).toFixed)||void 0===r?void 0:r.call(o,2))||""}]})();return s&&t?(0,N.jsxs)("div",{className:"solvably-graph-tooltip d-flex flex-column gap-1",children:[(0,N.jsx)("span",{className:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Longitudinal efficacy",id:"label.longitudinal_efficacy.4ff0c8d9"})}),(0,N.jsx)("span",{className:"date m-0 mb-2 text-muted",children:a}),!!i&&i.map((e,s)=>(0,N.jsx)("span",{className:"number m-0 mb-2",style:{color:(null===e||void 0===e?void 0:e.color)||""},children:`${(null===e||void 0===e?void 0:e.name)||""}: ${(null===e||void 0===e?void 0:e.value)||""}`},s))]}):null};const qw=e=>{let{stroke:s}=e;return(0,N.jsx)("text",{dy:-4,fill:s,fontSize:14,style:{fill:"#212529",fontWeight:500},textAnchor:"middle",transform:"rotate(-90)",x:-130,y:20,children:"C Value"})};var Jw=e=>(0,N.jsx)(Rh.A,{animation:"wave",as:Ge.A,className:"longitudinal-efficacy-graph-placeholder flex-fill d-flex flex=column",children:(0,N.jsxs)(Rh.A,{as:Ge.A.Body,bg:"light",children:[(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1 mb-3",children:[(0,N.jsx)("h5",{className:"m-0 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Longitudinal efficacy",id:"label.longitudinal_efficacy.4ff0c8d9"})}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Changes in C Value by Ascending Date",id:"label.changes_in_c_value_by_ascending_da.76cf266a"})})]})}),(0,N.jsx)(jt.u,{height:300,width:"100%",children:(0,N.jsxs)(Vw.b,{className:"pe-none",margin:{bottom:5,left:0,right:30,top:5},children:[(0,N.jsx)(bt.d,{stroke:"var(--gray-600)",vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{domain:[0,4],label:(0,N.jsx)(qw,{}),ticks:[0,1,1.5,2,2.5,3,3.5,4]})]})})]})});function Xw(e){let{default_end:s,default_range:a="month",default_start:t,max_date_range:i="180",onRef:n,onSelect:r,range:o}=e;const[d,c]=(0,l.useState)(!1),[h,u]=(0,l.useState)(t),[m,g]=(0,l.useState)(s),[p,x]=(0,l.useState)(a),v=(0,ja.A)(),f=(0,l.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=e&&e.start_date?e.start_date:ci()().subtract(30,"days").toDate().getTime(),a=e&&e.end_date?e.end_date:ci()().toDate().getTime(),t=e&&e.selected_range?e.selected_range:p||"month";c(!0),u(s),g(a),x(t)},[p]),j=(0,l.useCallback)(()=>{c(!1)},[]),_=(0,l.useCallback)(e=>{let{date_select:s,end_date:a,start_date:t}=e;"function"==typeof r&&r({end_date:a,selected_range:s,start_date:t}),j()},[r,j]);(0,l.useEffect)(()=>("function"==typeof n&&n({show:f}),o&&x(o),()=>{"function"==typeof n&&n(void 0)}),[]),(0,l.useEffect)(()=>{"function"==typeof n&&n({show:f})},[f]);let b=ci()(new Date),A=b.clone().subtract(7,"days"),y=b.clone().subtract(30,"days"),w=b.clone().subtract(90,"days"),S=b.clone().subtract(180,"days");const C=ci()(m).subtract(1,"year").toDate(),M=ci()().toDate();return(0,N.jsx)(xe,{className:"date-picker-modal",dialogClassName:"react-datepicker-modal",onHide:j,show:d,children:(0,N.jsx)(ds.l1,{enableReinitialize:!0,initialValues:{date_select:p,end_date:m,start_date:h},onSubmit:(e,s)=>{_(e)},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldTouched:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsx)(_e.A,{onSubmit:t,children:(0,N.jsxs)(xe.Body,{className:"pt-0 px-0",children:[(0,N.jsx)(Ce.S,{className:"range-selector-header",children:(0,N.jsxs)(_e.A.Select,{className:"date-range-selector",isInvalid:n.date_select&&s.date_select,isValid:n.date_select&&!s.date_select,label:"date_select",name:"date_select",value:r.date_select,onChange:e=>{"six_month"===e.target.value&&(l("start_date",ci()(S).toDate().getTime()),l("end_date",ci()(b).toDate().getTime()),u(ci()(S).toDate().getTime()),g(ci()(b).toDate().getTime())),"three_month"===e.target.value&&(l("start_date",ci()(w).toDate().getTime()),l("end_date",ci()(b).toDate().getTime()),u(ci()(w).toDate().getTime()),g(ci()(b).toDate().getTime())),"month"===e.target.value&&(l("start_date",ci()(y).toDate().getTime()),l("end_date",ci()(b).toDate().getTime()),u(ci()(y).toDate().getTime()),g(ci()(b).toDate().getTime())),"week"===e.target.value&&(l("start_date",ci()(A).toDate().getTime()),l("end_date",ci()(b).toDate().getTime()),u(ci()(A).toDate().getTime()),g(ci()(b).toDate().getTime())),a(e),x(e.target.value)},children:[(0,N.jsx)("option",{value:"week",children:v.formatMessage({id:"label.past_7_days.8a28e5fd",defaultMessage:"Past 7 days"})}),(0,N.jsx)("option",{value:"month",children:v.formatMessage({id:"label.past_30_days.ea8721e4",defaultMessage:"Past 30 days"})}),(0,N.jsx)("option",{value:"three_month",children:v.formatMessage({id:"label.past_90_days.013125e2",defaultMessage:"Past 90 days"})}),(0,N.jsx)("option",{value:"six_month",children:v.formatMessage({id:"label.past_180_days.2666a988",defaultMessage:"Past 180 days"})}),(0,N.jsx)("option",{value:"custom",children:v.formatMessage({id:"label.custom.494ca78f",defaultMessage:"Custom"})})]})}),(0,N.jsxs)(Qe.A,{className:"p-2 g-0",children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(Ce.S,{className:"text-center p-relative",children:[(0,N.jsx)(Ce.S,{className:"date-picker-header-container",children:(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",description:"",id:"label.start_date.81696931"})})}),(0,N.jsx)(Oi(),{inline:!0,className:"google-meet-datepicker",dateFormat:"MMM d, yyyy",maxDate:M,minDate:C,selected:r.start_date,showPopperArrow:!1,onChange:e=>{l("start_date",e.getTime()),i("start_date"),l("date_select","custom"),x("custom")}})]})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)(Ce.S,{className:"date-picker-header-container",children:(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",description:"",id:"label.end_date.14303aa0"})})}),(0,N.jsx)(Oi(),{inline:!0,className:"google-meet-datepicker",dateFormat:"MMM d, yyyy",maxDate:M,minDate:C,selected:r.end_date,showPopperArrow:!1,onChange:e=>{l("end_date",e.getTime()),i("end_date"),l("date_select","custom"),x("custom")}})]})})]}),(0,N.jsxs)(Ce.S,{className:"px-2 d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{className:"me-1",onClick:j,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",description:"",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{onClick:t,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Apply",description:"",id:"label.apply.31e392d1"})})]})]})})}})})}const Zw=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),i=(0,l.useRef)(),[n,r]=(0,ne.CQ)({end_date:ci()().toDate().getTime(),error:null,loading:!1,longitudinal_efficacy:null,selected_range:"three_month",start_date:ci()().subtract(90,"days").toDate().getTime()}),{end_date:o,error:d,loading:c,longitudinal_efficacy:h,selected_range:u,start_date:m}=n,g=async()=>{try{r({error:null,loading:!0});const e=ci()(n.start_date).toISOString(),s=ci()(n.end_date).toISOString(),{longitudinal_efficacy:a}=await t.get("/api/users/longitudinal-efficacy",{end_date:s,start_date:e});r({loading:!1,longitudinal_efficacy:a})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;r({error:a,loading:!1})}};(0,l.useEffect)(()=>{g()},[]);const p={end_date:o,error:d,loading:c,longitudinal_efficacy:h,selected_range:u,start_date:m};return(0,l.useImperativeHandle)(a,()=>(0,F.A)({},p)),(0,N.jsxs)(sN,{value:(0,F.A)({},p),children:[(0,N.jsxs)("section",{className:"progress-widget d-flex flex-column gap-2",id:"progress",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:d,variant:"danger",children:d}),(0,N.jsxs)(ve.A,{className:"mb-3 align-self-start",disabled:c,onClick:()=>{const e=null===i||void 0===i?void 0:i.current;e&&e.show({end_date:o,selected_range:u,start_date:m})},variant:"secondary",children:[ci()(m).format("MMM DD, YYYY")," - ",ci()(o).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(Me.x_,{loading:c,spinner:(0,N.jsx)(Jw,{}),children:(0,N.jsx)(Ge.A,{className:c?"":"floating",children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Kw,{longitudinal_efficacy:h,start_date:m})})})})]}),(0,N.jsx)(Xw,{onRef:e=>i.current=e,onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;return r({end_date:s,selected_range:a,start_date:t},g)}})]})});Zw.displayName="ProgressWidget";var $w=Zw;const eN=l.createContext({}),sN=eN.Provider;eN.Consumer;eN.displayName="ProgressWidgetContext";var aN={Assignments:Hr,Competencies:Dw,Progress:$w};var tN=e=>{var s;const{children:a}=e,{getUserBanner:t,user:i}=(0,P.nm)(),{default_banner:l,getAchievementIcon:n}=(0,P.hc)(),r=t()||l,{icon_token:o,name:d}=(null===i||void 0===i||null===(s=i.pinned_achievement)||void 0===s?void 0:s.achievement)||{};return(0,N.jsxs)(Ce.S,{className:"learner-banner-layout d-flex flex-column",children:[(0,N.jsxs)(Ce.S,{className:"banner-container d-flex flex-column justify-content-end",children:[(0,N.jsxs)(Ce.S,{className:"banner-image-container d-flex align-items-end",children:[(0,N.jsx)(Zs.A,{alt:"",className:"banner-image",src:r}),(0,N.jsx)(Ue.A,{className:"name-container flex-fill",children:(0,N.jsx)("h1",{className:"text-white",children:i.fullname})})]}),(0,N.jsx)(Ce.S,{className:"banner-bar d-flex",children:(0,N.jsxs)(Ue.A,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(Ce.S,{className:"avatar-container",children:(0,N.jsx)(Ya,{showOnline:!1,size:80,user:i,withBorder:!0,customIcon:o&&(0,N.jsx)(Zs.A,{alt:`${d} achievement icon`,className:"portfolio-badge",src:n(o)})})}),(0,N.jsx)("h5",{className:"m-0 d-none d-md-block",children:(null===i||void 0===i?void 0:i.about_title)||"Problem Solver"})]}),(0,N.jsxs)(Ce.S,{className:"link-container d-flex gap-2",children:[(0,N.jsxs)(Le.Link,{as:ve.A,className:"d-flex align-items-center gap-1 fw-semibold",to:"/portfolio",children:[(0,N.jsx)(ze.NBi,{}),(0,N.jsx)(ke.A,{defaultMessage:"ePortfolio",id:"label.eportfolio.1bab7cd9"})]}),(0,N.jsx)("div",{className:"divider"}),(0,N.jsxs)(Le.Link,{as:ve.A,className:"d-flex align-items-center gap-1 fw-semibold",to:"/profile",children:[(0,N.jsx)(ze.Pcn,{}),(0,N.jsx)(ke.A,{defaultMessage:"Account",id:"label.account.7e1b0d56"})]})]})]})})]}),(0,N.jsx)(Ce.S,{className:"flex-fill",children:a})]})};const iN=l.createContext({});iN.Provider,iN.Consumer;var lN=t(33956),nN=t(60034);class rN extends l.Component{constructor(s){super(s),this.fetchItemTypes=async()=>{try{const{app:e}=this.props,{api:s}=e;this.setState({loading:!0});const{item_types:a}=await s.get("/api/shopping/item-types/list"),t={};a.map(e=>t[e.name]=(0,F.A)({},e)),this.setState({item_types:t,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,loading:!1})}},this.loadCart=async()=>{const{app:e}=this.props,s=e.getCookie("shoppingCartToken");s&&await e.api.get("/api/shopping/cart/get",{cart_token:s}).then(e=>{let{cart:s,items:a}=e;this.setState({cart:s,cart_items:a,loading:!1}),this.setCartCookie(s)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.addToCart=async(s,a,t)=>{try{const{cart:e,item_types:i}=this.state,{app:l}=this.props,n=(null===i||void 0===i?void 0:i[s])||{},r=(null===t||void 0===t?void 0:t.quantity)||n.min,o=null===t||void 0===t?void 0:t.onAdd;this.setState({loading:!0});const{cart:d,item:c,items:h}=await l.api.post("/api/shopping/cart/item/add",{cart_token:null===e||void 0===e?void 0:e.token,item_id:a,item_type:s,quantity:r});this.setState({cart:d,cart_items:h,loading:!1}),this.setCartCookie(d),"function"===typeof o&&o(d,h,c)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,loading:!1})}},this.removeFromCart=(e,s)=>{var a,t;const i=null===this||void 0===this||null===(a=this.confirm_delete)||void 0===a?void 0:a.current;if(!i)return;const{app:l}=this.props,{cart:n}=this.state,r=null===s||void 0===s?void 0:s.onRemove,o=this.getCartItemById(e),d=(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are yo
2u sure you want to remove {itemName} from your cart?",id:"label.are_you_sure_you_want_to_remove_it.0e04c501",values:{itemName:(0,N.jsx)("strong",{style:{color:"var(--brand-primary)"},children:(null===o||void 0===o||null===(t=o.challenge_template)||void 0===t?void 0:t.title)||(0,N.jsx)(ke.A,{defaultMessage:"one item",id:"label.one_item.195ab644"})})}})});i.show({actions:[i.CancelAction(),i.OKAction({onClick:async()=>{this.setState({loading:!0}),await l.api.post(`/api/shopping/cart/item/remove/${e}`,{cart_token:null===n||void 0===n?void 0:n.token}).then(e=>{let{cart:s,items:a}=e;this.setState({cart:s,cart_items:a,loading:!1}),"function"===typeof r&&r(s,a,o)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}})],body:d})},this.updateItemQuantity=async(e,s)=>{const{cart:a}=this.state,{app:t}=this.props;this.setState({loading:!0}),await t.api.post(`/api/shopping/cart/item/set/quantity/${e}`,{cart_token:null===a||void 0===a?void 0:a.token,quantity:s}).then(e=>{let{cart:s,items:a}=e;this.setState({cart:s,cart_items:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.attemptPromoCode=async e=>{const{app:s}=this.props,{cart:a}=this.state;this.setState({loading:!0});let t="";return await s.api.post("/api/shopping/cart/promo/apply",{cart_token:null===a||void 0===a?void 0:a.token,code:e}).then(e=>{let{cart:s}=e;this.setState({cart:s,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),t=s}),t},this.removePromoCode=()=>{const{app:e}=this.props,{cart:s}=this.state;this.setState({loading:!0});const a=(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to remove the current promo code from your cart?",id:"label.are_you_sure_you_want_to_remove_th.cf01afbc"})});this.confirm_delete.show({actions:[this.confirm_delete.CancelAction(),this.confirm_delete.OKAction({onClick:async()=>{this.setState({loading:!0}),await e.api.post("/api/shopping/cart/promo/apply",{cart_token:null===s||void 0===s?void 0:s.token,code:null}).then(e=>{let{cart:s}=e;this.setState({cart:s,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}})],body:a,onHide:e=>e.hide()})},this.initStripe=async()=>{var e,s;const{client_key:a}=(null===(e=this.props)||void 0===e||null===(s=e.app)||void 0===s?void 0:s.shopping)||{},t=await(0,nN.c)(a);this.setState({stripe:t})},this.setCartCookie=e=>{var s;const{setCookie:a}=(null===(s=this.props)||void 0===s?void 0:s.app)||{},t=new Date(Date.now()+6048e5);a("shoppingCartToken",null===e||void 0===e?void 0:e.token,{expires:t})},this.deleteCartCookie=()=>{var e;const{deleteCookie:s}=(null===(e=this.props)||void 0===e?void 0:e.app)||{};s("shoppingCartToken"),this.setState({cart:null,cart_items:[]})},this.getCartItemById=e=>{const{cart_items:s}=this.state;return s.find(s=>s.id===e)},this.getCartItemByItemId=(e,s)=>{const{cart_items:a}=this.state;return a.find(a=>a.item_id===s&&a.item_type==e)},this.isInCart=(e,s)=>{const{cart_items:a}=this.state;return!!a.find(a=>(null===a||void 0===a?void 0:a.item_id)===s&&a.item_type==e)},this.showCheckout=()=>{this.checkout_modal&&this.checkout_modal.show()},this.hideCheckout=()=>{this.checkout_modal&&this.checkout_modal.hide()},this.getCartTotal=()=>{const{cart:e}=this.state;return null===e||void 0===e?void 0:e.total},this.getFormattedPrice=(e,s)=>{var a;const t=e/100;return s?null===(a=t.toFixed)||void 0===a?void 0:a.call(t,s):t},this.getCartDiscount=()=>{const{cart:e}=this.state,s=null===e||void 0===e?void 0:e.total,a=null===e||void 0===e?void 0:e.subtotal;return s&&a?a-s:0},this.getCartCurrencySymbol=()=>"$",this.isPriceOverLimit=()=>{var e,s;return(null===(e=this.state)||void 0===e||null===(s=e.cart)||void 0===s?void 0:s.total)>this.PURCHASE_LIMIT},this.checkout_modal=null,this.confirm_delete=(0,l.createRef)(),this.PURCHASE_LIMIT=2e6,this.state={cart:{},cart_items:[],error:null,item_types:null,loading:!1,stripe:null}}async componentDidMount(){const{app:e,onRef:s}=this.props;"function"===typeof s&&s(this);const{shopping:a}=e||{};null!==a&&void 0!==a&&a.enabled&&(await this.fetchItemTypes(),await this.initStripe(),await this.loadCart())}componentWillUnmount(){const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}render(){const{children:e}=this.props,{cart:s,cart_items:a,error:t,item_types:i,loading:l,stripe:n}=this.state;return(0,N.jsx)(lN.Elements,{stripe:n,children:(0,N.jsxs)(cN,{value:{addToCart:this.addToCart,attemptPromoCode:this.attemptPromoCode,cart:s,cart_items:a,deleteC
2artCookie:this.deleteCartCookie,error:t,getCartCurrencySymbol:this.getCartCurrencySymbol,getCartDiscount:this.getCartDiscount,getCartItemByItemId:this.getCartItemByItemId,getCartTotal:this.getCartTotal,getFormattedPrice:this.getFormattedPrice,hideCheckoutL:this.hideCheckout,isInCart:this.isInCart,isPriceOverLimit:this.isPriceOverLimit,item_types:i,loadCart:this.loadCart,loading:l,PURCHASE_LIMIT:this.PURCHASE_LIMIT,removeFromCart:this.removeFromCart,removePromoCode:this.removePromoCode,setCartCookie:this.setCartCookie,showCheckout:this.showCheckout,stripe:n,updateItemQuantity:this.updateItemQuantity},children:[e,(0,N.jsx)(SS,{ref:e=>this.checkout_modal=e}),(0,N.jsx)(je,{ref:this.confirm_delete})]})})}}var oN=(0,P.G0)(rN);const dN=l.createContext({}),cN=dN.Provider,hN=(dN.Consumer,()=>(0,l.useContext)(dN));var uN=t.p+"static/media/cart-minus-icon.96ef41a5b3ee3248bb0fdaa4ef62b0a1.svg";var mN=e=>{const{disabled:s,item_id:a,item_type:t,onAdd:i,onRemove:n,quantity:r,stretch:o}=e,{addToCart:d,getCartItemByItemId:c,isInCart:h,removeFromCart:u}=hN(),[m,g]=(0,l.useState)(!1);return(0,N.jsx)(ve.A,{className:`shopping-add-remove-button ${o?"w-100":""} ${h(t,a)?"active":""}`,disabled:s,onClick:async e=>{if(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),g(!0),h(t,a)){const e=c(t,a);await u(null===e||void 0===e?void 0:e.id,{onRemove:n})}else await d(t,a,{onAdd:i,quantity:r});g(!1)},size:"lg",children:m?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsx)(N.Fragment,{children:h(t,a)?(0,N.jsxs)("span",{children:[(0,N.jsx)(Zs.A,{className:"me-1",height:16,src:uN,width:16}),(0,N.jsx)(ke.A,{defaultMessage:"Remove from Cart",id:"label.remove_from_cart.acefc50b"})]}):(0,N.jsxs)("span",{children:[(0,N.jsx)(ze._xK,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Add to Cart",id:"label.add_to_cart.cd77718c"})]})})})};const gN=e=>{var s,a;const{component:t,component_type:i,onRequestInfo:l,onShowDetails:n,readOnly:r}=e,{id:o,author_avatar_image_path:d,author_name:c,cover_path:h,subjects:u,title:m,total_est_completion_time:g}=t,p=null===u||void 0===u||null===(s=u[0])||void 0===s||null===(a=s.subjects)||void 0===a?void 0:a.name,x=hN(),v=!(0,T.isEmpty)(x);return(0,N.jsxs)(Ge.A,{className:"marketplace-challenge-card "+(r?"read-only":""),onClick:()=>{r||"function"===typeof n&&n(i,t)},children:[(0,N.jsxs)(Ce.S,{className:"marketplace-challenge-card-upper",children:[(0,N.jsx)(Ce.S,{className:"card-banner",style:{backgroundImage:`url("${h||pc}")`}}),(0,N.jsxs)(Ce.S,{className:"card-heading",children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",children:(0,N.jsx)("p",{className:"challenge-title h6 m-0 pr-2 text-truncate",children:m})}),(0,N.jsxs)(Ce.S,{className:"challenge-author pb-3 mt-2",children:[(0,N.jsx)(Ce.S,{className:"challenge-author-avatar-container me-2",children:(0,N.jsx)(Ce.S,{className:"author-avatar",style:{backgroundImage:`url("${d||Ga}")`}})}),(0,N.jsxs)(Ce.S,{className:"challenge-author-details",children:[(0,N.jsx)("span",{className:"author-name",children:c}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})})]})]})]})]}),(0,N.jsxs)(Ce.S,{className:"marketplace-challenge-card-lower",children:[(0,N.jsxs)(Ce.S,{className:"challenge-details",children:[p&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("small",{className:"text-start text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Topic",id:"label.topic.7e61847d"})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(bo.A,{pill:!0,bg:"primary",className:"mt-2",text:"light",children:p})})]}),(0,N.jsxs)("small",{className:"time-estimate my-3 d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.obD,{color:"var(--primary)"})," ",g," minutes"]})]}),!r&&v&&(0,N.jsxs)(Ce.S,{className:"card-cta-container",children:[(0,N.jsx)(mN,{item_id:o,item_type:i,stretch:!0}),(0,N.jsx)(ve.A,{className:"w-100 mt-3 fw-semibold",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r||"function"===typeof l&&l(i,t)},variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Request info",id:"label.request_info.d16675ee"})})]})]})]})};gN.defaultProps={component:{}
2,component_type:"",onRequestInfo:Function(),onShowDetails:Function(),readOnly:!1};var pN=gN;const xN=(0,l.forwardRef)((e,s)=>{var a,t,i;const{disabled:n,feedback:r,max:o,maxCharWidth:d,min:c,name:h,onChange:u,value:m}=e,[g,p]=(0,ne.CQ)({quantity:m||c||0}),{quantity:x}=g,v=ul.Ik().shape({[h]:ul.ai().min(c,`A minimum of ${c} is required`).max(o,`A maximum of ${o} is allowed`)}),f=e=>p({quantity:e},()=>u(null===g||void 0===g?void 0:g.quantity)),j=()=>null===g||void 0===g?void 0:g.quantity,{errors:_,handleChange:b,handleSubmit:A,setFieldError:y,setFieldValue:w,touched:S,values:C}=(0,ds.Wx)({initialValues:{[h]:x},onSubmit:Function(),validateOnChange:!0,validationSchema:v});return(0,l.useEffect)(()=>{p({quantity:C[h]},()=>u(g.quantity))},[C]),(0,l.useImperativeHandle)(s,()=>({getQuantity:j,quantity:x})),(0,N.jsx)(_e.A,{onSubmit:A,children:(0,N.jsxs)(Xl.A,{className:"quantity-picker d-flex flex-column",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(ve.A,{"aria-label":"Decrement quantity",className:"decrement",disabled:n||x<=c,onClick:()=>{if(n)return;const e=Number.parseInt(C[h])||0;(0,T.inRange)(C[h],c+1,o+1)?(w(h,e-1),f(e-1)):e<=c+1?(w(h,c),f(c),y(h,`A minimum quantity of ${c} is required`)):e>=o&&(w(h,o),f(o))},variant:"outline-primary",children:(0,N.jsx)(ze.iu5,{})}),(0,N.jsx)(be.A,{autoComplete:"off",disabled:n,htmlSize:d||(null===C||void 0===C||null===(a=C[h])||void 0===a||null===(t=a.toString)||void 0===t||null===(i=t.call(a))||void 0===i?void 0:i.length)||1,inputMode:"numeric",isInvalid:!(null===_||void 0===_||!_[h]),max:o,min:c,name:h,onChange:b,onKeyPress:e=>{const{key:s,preventDefault:a}=e,t=Number.parseInt(s);isNaN(t)&&a()},type:"number",value:Number.parseInt(C[h])||0}),(0,N.jsx)(ve.A,{"aria-label":"Increment quantity",className:"increment",disabled:n||x>=o,onClick:()=>{if(n)return;const e=Number.parseInt(C[h])||0;(0,T.inRange)(C[h],c,o)?(w(h,e+1),f(e+1)):e<=c+1?(w(h,c),f(c)):e>=o&&(w(h,o),f(o),y(h,`Maximum quantity of ${o} reached`))},variant:"outline-primary",children:(0,N.jsx)(ze.OiG,{})})]}),!!r&&(null===_||void 0===_?void 0:_[h])&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:null===_||void 0===_?void 0:_[h]})]})})});xN.displayName="QuantityPicker",xN.defaultProps={disabled:!1,feedback:!0,min:0,name:"quantity",onChange:Function()};var vN=xN;var fN=t.p+"static/media/pen-3-white.dc9d0473ae41613c3b630a03e0952659.svg";const jN=e=>{const{deleteHandler:s,disabled:a,height:t,imageClassName:i,placeholder:n,round:r,uploadHandler:o,useDefault:d,width:c}=e,h=e.src?e.src:d?xo:"",u=(0,l.forwardRef)((e,s)=>{let{children:t,onClick:i,rest:l}=e;return(0,N.jsxs)(ve.A,(0,F.A)((0,F.A)({className:"d-flex align-items-center justify-content-center border border-3 border-white rounded-circle",disabled:a,ref:s,onClick:e=>{e.preventDefault(),i(e)},style:{opacity:1}},l),{},{children:[(0,N.jsx)(Zs.A,{className:"icon",src:fN}),t]}))});return(0,N.jsxs)(Ce.S,{className:"icon-uploader position-relative",style:{height:t,width:c},children:[h?(0,N.jsx)(Me.R_,{height:"100%",imageClassname:`border ${i}`,rounded:!r,roundedCircle:r,src:h,width:"100%"}):(0,N.jsx)(Ce.S,{className:"p-3 bg-light border text-muted d-flex align-items-center justify-content-center h-100 "+(r?"rounded-circle":"rounded"),children:(0,N.jsx)("span",{className:"text-center",children:n||(0,N.jsx)(ke.A,{defaultMessage:"Upload an image",id:"label.upload_an_image.25d0eba6"})})}),(0,N.jsxs)(li.A,{className:"position-absolute edit-portfolio-modal-dropdowns",drop:"end",onSelect:e=>{switch(e){case"upload":return o();case"delete":return s()}},style:{bottom:-10,right:-10,zIndex:2},children:[(0,N.jsx)(li.A.Toggle,{as:u,size:"sm"}),(0,N.jsxs)(li.A.Menu,{className:"icon-uploader-dropdown",children:[(0,N.jsx)(li.A.Item,{as:"button",eventKey:"upload",type:"button",children:null!==e&&void 0!==e&&e.src?(0,N.jsx)(ke.A,{defaultMessage:"Change image",id:"label.change_image.87b8b008"}):(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})}),"function"===typeof s&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(li.A.Divider,{}
2),(0,N.jsx)(li.A.Item,{as:"button",eventKey:"delete",type:"button",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete image",id:"label.delete_image.fbbc98ee"})})]})]})]})]})};jN.defaultProps={deleteHandler:null,height:"auto",imageClassName:"",uploadHandler:Function(),width:100};const _N=(0,l.forwardRef)((e,s)=>{const{onRequestInfo:a}=e,{addToCart:t,getCartCurrencySymbol:i,getCartItemByItemId:n,getFormattedPrice:r,isInCart:o,item_types:d,showCheckout:c}=hN(),[h,u]=(0,ne.CQ)({error:!1,item:{},item_type:null,loading:!1,quantity:0,quantity_valid:!0,type:"",visible:!1}),{item:m,item_type:g,quantity:p,quantity_valid:x,type:v,visible:f}=h,{challenge_statement:j,description:_,title:b}=m||{},A=o(v,null===m||void 0===m?void 0:m.id),y=i(),w=(e,s)=>{const a=n(e,null===s||void 0===s?void 0:s.id),t=null===d||void 0===d?void 0:d[e];u({item:s,item_type:t,quantity:(null===a||void 0===a?void 0:a.quantity)||t.min,type:e,visible:!0})},S=()=>{u({item:{},quantity:0,type:"",visible:!1})};return(0,l.useImperativeHandle)(s,()=>({hide:S,show:w,visible:f})),(0,N.jsxs)(xe,{className:"shopping-item-details-modal",id:"shoppingItemDetailsModal",show:f,size:"lg",children:[(0,N.jsx)(xe.Header,{className:"pb-0",closeButton:!0,onHide:S}),(0,N.jsx)(xe.Body,{className:"pt-0",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-none d-lg-flex flex-column",md:4,children:[(0,N.jsx)(pN,{component:m,readOnly:!0}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center mt-2",onClick:()=>{"function"===typeof a&&(S(),a(v,m))},variant:"link",children:[(0,N.jsx)(ze.__w,{className:"me-1"}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Request more info",id:"label.request_more_info.58739703"})})]})]}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:8,children:[(0,N.jsx)("h3",{className:"mb-4",children:b}),(0,N.jsx)("h5",{className:"text-capitalize",children:v}),(0,N.jsx)("p",{children:(0,ad.G9)(_||j,{preserveNewlines:!0})}),(0,N.jsxs)("h6",{children:[y,r(null===g||void 0===g?void 0:g.price)," / learner"]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h6",{className:"me-auto mb-0",children:"Number of learners"}),(0,N.jsx)(vN,{disabled:A,feedback:!1,max:null===g||void 0===g?void 0:g.max,min:null===g||void 0===g?void 0:g.min,onChange:e=>{let s=!0;(0,T.inRange)(e,g.min,g.max+1)||(s=!1),u({quantity:e,quantity_valid:s})},value:p})]}),!x&&(0,N.jsx)("small",{className:"text-danger text-end",children:(0,N.jsx)(ke.A,{defaultMessage:`A valid quantity between ${null===g||void 0===g?void 0:g.min} and ${null===g||void 0===g?void 0:g.max}
2 is required`,id:"message.invalid_quantity"})}),(0,N.jsxs)(Ce.S,{className:"py-3 d-flex justify-content-between",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Total",id:"label.total.c9b3c382"})}),(0,N.jsxs)("h5",{className:x?"text-primary":"text-secondary",children:[y,r(p*((null===g||void 0===g?void 0:g.price)||0))]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{className:"me-2",disabled:!x,onClick:async()=>{o(v,null===m||void 0===m?void 0:m.id)||await t(v,null===m||void 0===m?void 0:m.id,{quantity:p}),S(),c()},size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Buy now",id:"label.buy_now.9c0e74e6"})}),(0,N.jsx)(mN,{disabled:!x,item_id:null===m||void 0===m?void 0:m.id,item_type:v,onAdd:S,onRemove:()=>{u({quantity:g.min,quantity_valid:!0,visible:!1})},quantity:p})]})]})]})})]})});_N.displayName="ShoppingItemDetailsModal";var bN=_N;var AN=e=>{const{enablePromo:s=!0,readOnly:a,summary:t}=e,{cart:i,cart_items:n,getCartCurrencySymbol:r,getCartTotal:o,getFormattedPrice:d,isPriceOverLimit:c}=hN(),{shopping_promo_id:h}=i||{},u=o(),m=c(),g=r();let p;const[x,v]=(0,l.useState)(!1),f=n.filter((e,s)=>{if(s<5)return e}),j=n.filter((e,s)=>{if(s>=5)return e});return(0,N.jsxs)(Ce.S,{className:"shopping-list "+(t?"summary":""),children:[(0,N.jsx)("div",{className:"shopping-list-items-container px-3",ref:e=>p=e,children:t?(0,N.jsxs)(N.Fragment,{children:[(null===n||void 0===n?void 0:n.length)>5?(0,N.jsxs)(N.Fragment,{children:[f.map((e,s)=>(0,N.jsx)(yN,{item:e,readOnly:a},s)),(0,N.jsxs)(Ce.S,{className:"order-summary-collapse d-flex flex-column justify-content-center",children:[(0,N.jsx)(Ce.S,{className:"collapse "+(x?"show":""),children:(0,N.jsx)(N.Fragment,{children:j.map((e,s)=>(0,N.jsx)(yN,{item:e,readOnly:a},s))})}),(0,N.jsx)(ve.A,{className:"align-self-center my-3 text-decoration-none",onClick:()=>v(!x),variant:"link",children:(0,N.jsx)("strong",{children:x?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Show less",id:"label.show_less.94ea9b1d"})," ",(0,N.jsx)(ze.Ucs,{})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Show more",id:"label.show_more.f5c9bd13"})," ",(0,N.jsx)(ze.Vr3,{})]})})})]})]}):(0,N.jsx)(N.Fragment,{children:n.map((e,s)=>(0,N.jsx)(yN,{item:e,readOnly:a},s))}),h&&(0,N.jsx)(SN,{})]}):(0,N.jsx)(N.Fragment,{children:n.map((e,s)=>(0,N.jsx)(yN,{item:e,readOnly:a},s))})}),!a&&s&&(0,N.jsx)(wN,{}),m&&(0,N.jsx)("small",{className:"text-danger px-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Maximum purchase of $20,000 exceeded",id:"label.maximum_purchase_of_dollar20000_ex.9bdb0d82"})}),(0,N.jsx)(Ce.S,{className:"shopping-list-total py-3",children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"Total",id:"label.total.c9b3c382"})}),(0,N.jsx)("p",{className:"h5 m-0 total-price",children:m?(0,N.jsx)("s",{className:"text-muted",children:`${g}${d(u,2)}`}):`${g}${d(u,2)}`})]})})]})};var yN=e=>{var s,a;const t=(0,l.useRef)(),{item:i,readOnly:n}=e,{cartridge_template:r,challenge_template:o,group_assignment_template:d,price:c,quantity:h,type:u}=i||{},m=o||r||d,g=c*h,{cover_path:p,subjects:x,title:v}=m||{},f=null===x||void 0===x||null===(s=x[0])||void 0===s||null===(a=s.subjects)||void 0===a?void 0:a.name,{getCartCurrencySymbol:j,getFormattedPrice:_,removeFromCart:b,updateItemQuantity:A}=hN(),y=j(),[w,S]=(0,ne.CQ)({editing:!1,quantity_valid:!0,render_quantity:h,updating:!1}),{editing:C,quantity_valid:M,render_quantity:k,updating:z}=w,T=e=>{S({quantity_valid:e>=(null===u||void 0===u?void 0:u.min)&&e<=(null===u||void 0===u?void 0:u.max),render_quantity:e})};return(0,l.useEffect)(()=>{T(h)},[h]),(0,N.jsx)(Ce.S,{className:"shopping-list-item py-3 "+(n?"read-only":""),children:(0,N.jsxs)(Ce.S,{className:"item-inner",children:[(0,N.jsx)(Ce.S,{className:"item-image-container me-3",children:(0,N.jsx)(Ce.S,{className:"item-image",style:{backgroundImage:`url(${p||pc})`}})}),(0,N.jsxs)(Ce.S,{className:"item-details pe-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"item-title-subject d-flex flex-column",children:[(0,N.jsx)("strong",{className:"item-title",children:v}),(0,N.jsx)("span",{className:"item-subject pb-2",children:f})]}),!n&&(0,N.jsx)(Ce.S,{className:"d-flex flex-column align-items-center justify-content-end",children:C?(0,N.jsx)(ve.A,{className:"text-decoration-none mb-2",disabled:!M,onClick:async()=>
2{if(!t.current||z)return;S({updating:!0});const e=t.current.getQuantity();await A(null===i||void 0===i?void 0:i.id,e),S({editing:!1,updating:!1})},variant:"link",children:z?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsx)(ze.CMH,{color:M?"var(--brand-primary)":"var(--gray-600)"})}):(0,N.jsx)(ve.A,{className:"text-decoration-none",onClick:()=>S({editing:!0}),variant:"link",children:(0,N.jsx)(ze.Mbp,{color:"var(--gray-600)"})})})]}),(0,N.jsx)(Ce.S,{className:"item-price-breakdown",children:n?(0,N.jsxs)("p",{className:"m-0",children:[(0,N.jsx)("span",{children:`${y}${_(c)} x ${h} learners = `}),(0,N.jsx)("strong",{children:`${y}${_(g)||0}`})]}):(0,N.jsx)(N.Fragment,{children:C?(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(_e.A.Label,{className:`breakdown mb-0 ${z?"text-muted":""} text-truncate mw-100`,htmlFor:`quantityInput-${null===i||void 0===i?void 0:i.id}`,children:[(0,N.jsx)("span",{children:`${y}${_(c)} x ${k} learners =`}),(0,N.jsx)("strong",{children:` ${y}${_(c*k)||0}`})]}),(0,N.jsxs)(Ei.A,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)(vN,{max:null===u||void 0===u?void 0:u.max,min:null===u||void 0===u?void 0:u.min,onChange:T,ref:t,value:h}),(0,N.jsxs)(ve.A,{"aria-label":"Remove item",className:"remove-button text-danger text-decoration-none",id:"removeItemButton",onClick:e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),b(null===i||void 0===i?void 0:i.id)},variant:"link",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})]})]})]}):(0,N.jsxs)("span",{className:"breakdown",children:[(0,N.jsx)("span",{children:`${y}${_(c)} x ${h} learners =`}),(0,N.jsx)("strong",{children:` ${y}${_(g)||0}`})]})})})]})]})})};var wN=e=>{const{attemptPromoCode:s,cart:a,getCartCurrencySymbol:t,getCartDiscount:i,getFormattedPrice:n,removePromoCode:r}=hN(),{shopping_promo_id:o}=a||{},d=t(),[c,h]=(0,l.useState)(""),[u,m]=(0,l.useState)("");return(0,N.jsx)(Ce.S,{className:"promo-code-container px-3",children:o?(0,N.jsxs)(Ce.S,{className:"promo-item py-3 d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{className:"me-3 promo-icon",children:(0,N.jsx)(ze.Tsk,{color:"var(--brand-primary)",size:16})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Promo code",id:"label.promo_code.ec0c2188"})}),(0,N.jsx)("p",{className:"pb-2 m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Discount applied",id:"label.discount_applied.ebb00c78"})}),(0,N.jsx)("p",{className:"m-0",children:(0,N.jsxs)("strong",{className:"discount",children:["-",d,n(i(),2)]})})]})]}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",children:(0,N.jsx)(ve.A,{className:"remove-button",id:"removePromoButton",onClick:async()=>await r(),variant:"link",children:(0,N.jsx)(ze.RCe,{})})})]}):(0,N.jsx)(_e.A,{onSubmit:async e=>{e.preventDefault(),m("");const a=await s(c);m(a),u||h("")},children:(0,N.jsxs)(_e.A.Group,{className:"py-3",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"promoCode",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Promo code",id:"label.promo_code.ec0c2188"})})}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(_e.A.Control,{"aria-describedby":"promoCodeApply","aria-label":"Promo code",id:"promoCode",isInvalid:u,name:"promoCode",onChange:e=>{var s;return h(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},placeholder:"Enter promo code here",value:c}),(0,N.jsx)(ve.A,{className:"promo-code-apply px",disabled:!c,id:"promoCodeApply",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Apply",id:"label.apply.31e392d1"})})]}),u&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:u})]})})})},NN=t(41947);var SN=e=>{const{getCartCurrencySymbol:s,getCartDiscount:a,getFormattedPrice:t}=hN(),i=t(a(),2),l=s();return(0,N.jsx)(Ce.S,{className:"shopping-list-item py-3 read-only",children:(0,N.jsxs)(Ce.S,{className:"item-inner",children:[(0,N.jsx)(Ce.S,{className:"item-image-container me-3",children:(0,N.jsx)(Ce.S,{className:"item-image border-0",style:{backgroundImage:`url(${NN})`}})}),(0,N.jsxs)(Ce.S,{className:"item-details",children:[(0,N.jsxs)(Ce.S,{className:"item-title-subject d-flex flex-column",children:[(0,N.jsx)("strong",{className:"item-title text-truncate",children:(0,N.jsx)(ke.A,{defaultMessage:"Promo code",id:"label.promo_code.ec0c2188"})}),(0,N.jsx)("span",{className:"item-subject pb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Discount applied",id:"label.discount_applied.ebb00c78"})})]}),(0,N.jsxs)(Ce.S,{className:"item-price-breakdown",children:["-",l,i]})]})]})})};const CN=l.createContext({}),MN=CN.Provider,kN=(CN.Consumer,()=>(0,l.useContext)(CN));var zN=e=>{const{api:s}=(0,P.nm)(),a=(0,ja.A)(),{cart:t,getCartCurrencySymbol:i,getCartTotal:n,getFormattedPrice:r,isPriceOverLimit:o}=hN(),d=o(),{payment_details:c,setCheckoutPhase:h,setError:u,setModalPhase:m,setOrder
2Number:g,setPaymentIntent:p,setPaymentMethod:x,setStripeError:v,stripe_error:f}=kN(),{billing_details:j}=c||{},{address:_,email:b,name:A}=j||{},{country:y,postal_code:S}=_||{},C=(0,lN.useStripe)(),M=(0,lN.useElements)(),[k,z]=(0,l.useState)(!1),T=async e=>{const{error:a,order_number:i,payment_intent:l,payment_method:r,requires_action:o}=e||{},{client_secret:d}=l||{};if(a)w(a),u(a);else if(o){const{error:e,paymentIntent:a}=await C.handleCardAction(d);if(e)w("Stripe Error:",e),v(null===e||void 0===e?void 0:e.message),m(3);else{const e=await(async e=>{const a=n();return await s.post("/api/shopping/checkout",{cart_token:null===t||void 0===t?void 0:t.token,stripe_payment_intent_id:null===e||void 0===e?void 0:e.id,total:a}).then(e=>{var s;return p(null===e||void 0===e||null===(s=e.payment_intent)||void 0===s?void 0:s.id),e}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;w(s),u(s),z(!1),m(3)})})(a);await T(e)}}else r?x(r):w("No paymentMethod returned!"),l?p(null===l||void 0===l?void 0:l.id):w("No paymentIntent returned!"),i?g(i):w("No order_number returned!"),m(2)},I={style:{base:{"::placeholder":{color:"#373737"},backgroundColor:"#FFFFFF",color:"#141414",fontSize:"16px"},invalid:{color:"#FF544EFF",iconColor:"#FF544EFF"}}},E=ul.Ik().shape({country:ul.Yj().required("Country is required").oneOf(["US"],"Invalid country selected."),email:ul.Yj().required("Email address is required.").email("Email address not valid."),name:ul.Yj().required("Name issued on credit card is required."),postal_code:ul.Yj().required("ZIP / Postal Code is required.").matches(/^[0-9]{5}(?:-[0-9]{4})?$/,"ZIP / Postal Code format invalid.")});return(0,N.jsx)(Ce.S,{className:"stripe-checkout",children:(0,N.jsx)(ds.l1,{onSubmit:async e=>{const{country:a,email:i,name:l,postal_code:r}=e,o=M.getElement(lN.CardElement);z(!0);const d=await C.createPaymentMethod({billing_details:{address:{country:a,postal_code:r},email:i,name:l},card:o,type:"card"});z(!1),v(null),await(async e=>{const{error:a,paymentMethod:i}=e;if(a)return w(a),void v(null===a||void 0===a?void 0:a.message);m(1);const l=n();await s.post("/api/shopping/checkout",{cart_token:null===t||void 0===t?void 0:t.token,stripe_payment_method_id:null===i||void 0===i?void 0:i.id,total:l}).then(e=>{z(!1),T(e)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;w(s),m(0),h(1),u(s)})})(d)},validationSchema:E,initialValues:{country:y||"US",email:b||"",name:A||"",postal_code:S||""},children:e=>{let{errors:s,handleChange:t,handleSubmit:l,touched:o,values:c}=e;return(0,N.jsxs)(_e.A,{id:"paymentForm",onSubmit:l,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"checkoutEmail",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",description:"",id:"label.email.969ccbd3"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Email address",disabled:k||d,id:"checkoutEmail",isInvalid:o.email&&s.email,isValid:o.email&&!s.email,name:"email",onChange:t,placeholder:"[email protected]",type:"email",value:c.email}),s.email&&o.email&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.email})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"stripeCardElement",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Card information",description:"",id:"label.card_information.fca47526"})})}),(0,N.jsx)(lN.CardElement,{className:"form-control "+(f?"is-invalid":""),disabled:k||d,id:"stripeCardElement",style:{fontSize:16},options:(0,F.A)((0,F.A)({},I),{},{hidePostalCode:!0})}),f&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:f})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"stripeNameOnCard",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name on card",description:"",id:"label.name_on_card.18bf091e"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Name on card",disabled:k||d,id:"stripeNameOnCard",isInvalid:o.name&&s.name,isValid:o.name&&!s.name,name:"name",onChange:t,placeholder:"Jane Doe",value:c.name}),s.name&&o.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"stripeCountry",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Country or region",description:"",id:"label.country_or_region.8d2360ed"})})}),(0,N.jsxs)("select",{"aria-label":"Country",className:`form-control ${o.country&&!s.country?"is-valid":""} ${o.country&&s.country?"is-invalid":""}`,disabled:k||d,id:"stripeCountry",name:"country",onChange:t,value:c.country,children:[(0,N.jsx)("option",{disabled:!0,children:a.formatMessage({id:"label.select_country.c28f2f09",defaultMessage:"Select country"})}),(0,N.jsx)("option",{value:"US",children:a.formatMessage({id:"label.united_states.5e7a7275",defaultMessage:"United states"})})]}),s.country&&o.country&&(0,N.jsx)(_e.A.Control.Feedback,{className:"mb-3",type:"invalid",children:s.country})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"Postal code",disabled:k||d,id:"stripePostalCode",isInvalid:o.postal_code&&s.postal_code,isValid:o.postal_code&&!s.postal_code,name:"postal_code",onChange:t,placeholder:"ZIP / Postal code",value:c.postal_code}),s.postal_code&&o.postal_code&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.postal_code})]}),(0,N.jsx)(ve.A,{className:"w-100",disabled:k||d,id:"submit",size:"lg",type:"submit",children:(0,N.jsx)("span",{id:"button-text",children:d?a.formatMessage({id:"label.contact_us_for_large_orders.d9385ab9",defaultMessage:"Contact Us for Large Orders"}):(0,N.jsx)(N.Fragment,{children:k?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):`Pay ${i()}${r(n(),2)}`})})})]})}})})},TN=t(27127);const IN=e=>{const{isLoggedIn:s}=(0,P.nm)(),{isBelowBreakpoint:a}=(0,ne.vh)({breakpoint:922}),{cart_items:t,isPriceOverLimit:i,refreshCart:l,showCheckout:n}=hN(),r=i(),[o,d]=(0,ne.CQ)({cart_items:t,error:null,loading:!1,visible:!1}),c=()=>d({visible:!1}),{visible:h}=o;return(0,N.jsxs)(li.A,{align:"end",as:TN.A,autoClose:"outside",className:"shopping-cart-dropdown "+(s?"logged-in dropdown-outline me-0 me-lg-3 mb-lg-0 ":""),id:"shoppingCartDropdown",onToggle:()=>d({visible:!o.visible}),show:h,children:[(0,N.jsxs)(li.A.Toggle,{as:Fg.A,className:"d-flex align-items-center",children:[(0,N.jsx)(ty,{count:null===t||void 0===t?void 0:t.length,icon:(0,N.jsx)(ze.AsH,{color:"var(--gray-500)",size:!a&&22}),show:!(null===t||void 0===t||!t.length),sr_label:"Shopping Cart"}),(!s||a)&&(0,N.jsx)("span",{className:""+(null!==t&&void 0!==t&&t.length?"ms-2":""),children:(0,N.jsx)(ke.A,{defaultMessage:"Cart",id:"label.cart.6d2d59ae"})})]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center px-3 pb-2",children:[(0,N.jsx)("span",{className:"h5 m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Your cart",id:"label.your_cart.7eb1262c"})}),(0,N.jsx)(bh.A,{onClick:c})]}),null!==t&&void 0!==t&&t.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(AN,{}),(0,N.jsx)(Ce.S,{className:"px-3 mb-2",children:(0,N.jsx)(ve.A,{className:"w-100",disabled:!(null!==t&&void 0!==t&&t.length)||r,onClick:()=>{c(),n()},size:"lg",children:r?" Contact Us for Large Orders":"Review & Check Out"})})]}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center p-3 lead text-muted",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Your cart is empty",id:"label.your_cart_is_empty.5bd2e469"})})})]})]})};IN.displayName="ShoppingCartDropdown";var EN=IN;var FN=e=>{const{loadCart:s}=hN(),[a,t]=(0,l.useState)(!1),i=()=>t(!a),n=async()=>await s();return(0,N.jsxs)(Ve.A,{className:"account-cta-container",children:[(0,N.jsxs)(Ce.S,{className:"pb-3",children:[(0,N.jsx)(Ce.S,{className:"create-account mb-1",children:(0,N.jsx)("p",{className:"h5 m-0",children:a?"Login":"Create an account"})}),(0,N.jsx)(Ce.S,{className:"login-register-form-switcher d-flex align-items-center gap-1",children:a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Need an account?",id:"label.need_an_account.d24daaf3"})}),(0,N.jsx)(ve.A,{className:"p-0",onClick:i,variant:"link",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create an account",id:"label.create_an_account.86033f75"})})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Already have an account?",id:"label.already_have_an_account.e77fea93"})}),(0,N.jsx)(ve.A,{className:"p-0",onClick:i,variant:"link",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Log in",id:"label.log_in.c189840c"})})})]})})]}),a?(0,N.jsx)(Ns,{onFinish:n}):(0,N.jsx)(cs,{buttonSize:"lg",buttonStretch:!0,compact:!0,enableBusinessField:!0,enableDisclaimer:!0,onFinish:n,buttonLabel:(0,N.jsx)(ke.A,{defaultMessage:"Create my account",id:"label.create_my_account.862d3b26"})})]})};var RN=s=>{const{doLocalLogout:a,tryServerLogout:t,user:i,verifyLogin:r}=(0,n.nm)(),[o,d]=(0,l.useState)(!1);return(0,N.jsx)(Ce.S,{className:"user-account-info pb-4",children:(0,N.jsxs)(Me.x_,{loading:o,children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Logged in as",id:"label.logged_in_as.d74622e9"})}),(0,N.jsxs)(Ce.S,{className:"user d-flex justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ya,{showOnline:!1,size:24,user:i}),(0,N.jsx)("p",{className:"h5 mb-0 ms-2",children:(null===i||void 0===i?void 0:i.fullname)||""})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-baseline gap-1",children:[(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Not you?",id:"label.not_you.5b978f5d"})}),(0,N.jsx)(ve.A,{className:"p-0 fw-bold",onClick:async()=>{try{d(!0);await r()&&await t(),a(),d(!1)}catch(e){(0,xa.Failure)(err),d(!1)}},variant:"link",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Log out",id:"label.log_out.49616145"})})})]})]})]})})};var DN=e=>{const s=(0,l.useContext)(n.BR),{isLoggedIn:a}=s,{setCheckoutPhase:t}=kN();return(0,N.jsx)(Ve.A,{className:"checkout-phase-0 py-3 flex-fill",xs:12,children:a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(RN,{}),(0,N.jsx)(ve.A,{className:"w-100",onClick:()=>t(1),size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Continue to Payment",id:"label.continue_to_payment.bac1555a"})})]}):(0,N.jsx)(FN,{})})};var BN=e=>(0,N.jsxs)(Ve.A,{className:"checkout-phase-1 pb-3",xs:12,children:[(0,N.jsxs)(Ge.A,{className:"d-flex d-lg-none mt-3",children:[(0,N.jsx)("p",{className:"h5 mt-3 ms-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Your order",id:"label.your_order.f159e18f"})}),(0,N.jsx)(AN,{})]}),(0,N.jsx)("p",{className:"h5 my-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Payment information",id:"label.payment_information.f43cea24"})}),(0,N.jsx)(zN,{})]});var PN=e=>{const s=(0,l.useContext)(n.BR),{isLoggedIn:a}=s,{checkout_phase:t,setCheckoutPhase:i}=kN();return(0,N.jsxs)(Ve.A,{className:"checkout-phase-tracker d-flex px-5 pb-5 align-items-center",xs:12,children:[(0,N.jsx)(Ce.S,{className:`account-icon-container ${0===t?"active":""} ${a?"authenticated":""}`,children:(0,N.jsx)(ve.A,{className:"checkout-icon account",onClick:()=>i(0),variant:"link",children:a?(0,N.jsx)(ze.CMH,{size:20}):(0,N.jsx)(ze.pXu,{size:20})})}),(0,N.jsx)(Ce.S,{className:"checkout-phase-tracker-progress-bar-container "+(a?"authenticated":""),children:(0,N.jsx)("div",{className:"bar"})}),(0,N.jsx)(Ce.S,{className:`payment-icon-container ${1===t?"active":""} ${a?"authenticated":""} `,children:(0,N.jsx)(ve.A,{className:"checkout-icon payment",disabled:!a,onClick:()=>i(1),variant:"link",children:(0,N.jsx)(ze.x1c,{size:20})})})]})};const LN={0:e=>{const{checkout_phase:s}=kN();return(0,N.jsxs)(Qe.A,{className:"modal-phase-0 mx-0",children:[(0,N.jsx)(Ve.A,{className:"checkout-list d-none d-lg-block",lg:{order:0,span:6},xs:{order:1,span:12},children:(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)("p",{className:"h5",children:(0,N.jsx)(ke.A,{defaultMessage:"Your order",id:"label.your_order.f159e18f"})})}),(0,N.jsx)(AN,{})]})}),(0,N.jsx)(Ve.A,{className:"checkout-flow",lg:{order:1,span:6},xs:{order:0,span:12},children:(0,N.jsxs)(Qe.A,{className:"mx-0 h-100 d-flex flex-column",children:[(0,N.jsx)(PN,{}),(()=>{switch(s){case 0:return(0,N.jsx)(DN,{});case 1:return(0,N.jsx)(BN,{});default:return(0,N.jsx)(N.Fragment,{})}})()]})})]})},1:e=>(0,N.jsx)(Ce.S,{className:"modal-phase-1",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column justify-content-center align-items-center text-center",children:[(0,N.jsx)(Me.y$,{}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Processing payment",id:"label.processing_payment.19725515"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This should only take a few moments",id:"label.this_should_only_take_a_few_moment.033c3746"})})]})}),2:s=>{var a;const{getUserOrganizationMembership:t}=(0,P.nm)(),i=t(),l=!(null===i||void 0===i||null===(a=i.group_memberships)||void 0===a||!a.length),{hideModal:n,lau
2nchOnboardWizard:r,order_number:o,payment_method:d,stripe_payment_intent_id:c}=kN(),{billing_details:h,card:u}=d||{},{address:m,email:g,name:p}=h||{},{country:x,postal_code:v}=m||{},[f,j]=(0,ne.CQ)({error:null,loading:!1}),{error:_,loading:b}=f,A=()=>{j({loading:!0}),fetch("/api/shopping/cart/purchase/receipt",{body:JSON.stringify({stripe_payment_intent_id:c}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"}).then(e=>e.blob()).then(s=>{try{j({loading:!1}),y(s)}catch(err){var a,t;const i=(null===(a=e)||void 0===a?void 0:a.err)||(null===(t=e)||void 0===t?void 0:t.message)||e;j({error:i,loading:!1})}}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;j({error:s,loading:!1})})},y=e=>{const s="solvably_order_confirmation.pdf";if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(e,s);else{const a=URL.createObjectURL(e),t=document.createElement("a");t.href=a,t.download=s,document.body.appendChild(t),t.click(),setTimeout(function(){document.body.removeChild(t),window.URL.revokeObjectURL(a)},0)}};return(0,N.jsxs)(Ce.S,{className:"modal-phase-2 px-4",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>j({error:null}),show:_,variant:"danger",children:_}),(0,N.jsx)(Qe.A,{className:"cta-container pb-3 justify-content-center",children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column justify-content-center align-items-center text-center",md:8,xs:12,children:[(0,N.jsx)(Ce.S,{className:"success-icon mb-3",children:(0,N.jsx)(ze.CMH,{color:"var(--brand-primary)",size:48})}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Payment complete",id:"label.payment_complete.df1d649b"})}),(0,N.jsx)("p",{children:l?(0,N.jsx)(ke.A,{defaultMessage:"Thank you for your purchase. The below content can now be assigned to your learners.",id:"label.thank_you_for_your_purchase_the_be.1cba32aa"}):(0,N.jsx)(ke.A,{defaultMessage:"Thank you for your purchase. Next, set up your modules by assigning them to a class with your learners.",id:"label.thank_you_for_your_purchase_next_s.ced749dc"})}),l?(0,N.jsx)(Le.Link,{className:"btn btn-primary btn-lg",onClick:n,to:"/home",children:(0,N.jsx)(ke.A,{defaultMessage:"Go to dashboard",id:"label.go_to_dashboard.f085ee86"})}):(0,N.jsx)(ve.A,{className:"my-3",onClick:r,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Set up class",id:"label.set_up_class.86aab1d2"})})]})}),(0,N.jsxs)(Qe.A,{className:"order-details pt-4 pb-3",children:[(0,N.jsxs)(Ve.A,{className:"payment d-flex flex-column ps-0",lg:6,xs:12,children:[(0,N.jsxs)(Ce.S,{className:"mb-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Order #",id:"label.order.a458d68f"})}),(0,N.jsx)(ve.A,{className:"p-0 text-decoration-none d-lg-none",disabled:b,onClick:A,variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center",children:[b?(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}):(0,N.jsx)(ze.mSE,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Download / Print",id:"label.download_print.adf58201"})]})})]}),(0,N.jsx)("p",{children:o})]}),(0,N.jsxs)(Ce.S,{className:"mb-3 mb-lg-0",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Card",id:"label.card.be3702e3"})}),(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{className:"text-capitalize",children:`${null===u||void 0===u?void 0:u.brand} `}),(0,N.jsxs)("span",{children:["\u2022\u2022\u2022 ",null===u||void 0===u?void 0:u.last4]})]})]})]}),(0,N.jsxs)(Ve.A,{className:"billing d-flex justify-content-between pe-0 ps-0 ps-lg-3",lg:6,xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Bill to",id:"label.bill_to.9ec78118"})}),(0,N.jsx)("p",{className:"mb-0",children:p}),(0,N.jsx)("p",{className:"mb-0",children:v}),(0,N.jsx)("p",{className:"mb-0",children:x}),(0,N.jsx)("p",{className:"mb-0",children:g})]}),(0,N.jsx)(ve.A,{className:"align-self-start p-0 text-decoration-none d-none d-lg-flex",disabled:b,onClick:A,variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center",children:[b?(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}):(0,N.jsx)(ze.mSE,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Download / Print",id:"label.download_print.adf58201"})]})})]})]}),(0,N.jsx)(Qe.A,{className:"order-summary",children:(0,N.jsx)(Ve.A,{className:"px-0",xs:12,children:(0,N.jsx)(Ge.A,{className:"mb-3 mb-lg-0",children:(0,N.jsxs)(Ge.A.Body,{className:"px-0 pb-0",children:[(0,N.jsx)("h5",{className:"ps-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Items",id:"label.items.fb8e7a1a"})}),(0,N.jsx)(AN,{readOnly:!0,summary:!0})]})})})})]})},3:e=>{const{setCheckoutPhase:s,setModalPhase:a,setStripeError:t,stripe_error:i}=kN(),n=(0,N.jsx)(ke.A,{defaultMessage:"An unknown error occurred.",id:"label.an_unknown_error_occurred.30aa69b2"}),[r,o]=(0,l.useState)(!1);return(0,N.jsx)(Ce.S,{className:"modal-phase-3",children:(0,N.jsx)(Qe.A,{className:"cta-container justify-content-center",children:(0,N.jsxs)(Ve.A,{className:"d-flex flex-column justify-content-center align-items-center text-center",md:8,xs:12,children:[(0,N.jsx)(Ce.S,{className:"failure-icon mb-3",children:(0,N.jsx)(ze.hUO,{color:"var(--deep-red)",size:48})}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Payment incomplete",id:"label.payment_incomplete.63be64f9"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Something went wrong while processing the payment. Please try again. If the error persists, please contact us for support.",id:"label.something_went_wrong_while_process.7afc42bd"})}),(0,N.jsx)(ve.A,{className:"my-3",onClick:()=>{t(null),a(0),s(1)},size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})}),(0,N.jsxs)(ve.A,{onClick:()=>o(!r),variant:"link",children:[r?"Hide ":"Show ",(0,N.jsx)(ke.A,{defaultMessage:"Details",id:"label.details.45989de4"})]}),(0,N.jsx)(Ce.S,{className:"collapse "+(r?"show":""),children:(0,N.jsx)("p",{className:"text-danger text-center",children:i||n})})]})})})}};const ON=l.createContext({}),HN=ON.Provider,UN=(ON.Consumer,()=>(0,l.useContext)(ON));var QN=t(15282);var VN=e=>{const{group:s,handleCreateAdditionalAssignment:a,handleCreateAdditionalGroup:t,hide:i,skipAssignmentCreation:l}=UN();return(0,N.jsxs)(Ce.S,{className:"text-center py-3",children:[(0,N.jsx)(Ce.S,{className:"icon-circle mb-3",style:{backgroundColor:"var(--gray-200)",height:96,width:96},children:(0,N.jsx)(Ce.S,{className:"icon-circle absolute-transform-middle",children:(0,N.jsx)(ze.CMH,{size:48,style:{color:"var(--primary)"}})})}),(0,N.jsx)("h2",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Ready to get learning!",id:"label.ready_to_get_learning.8ebd65db"})}),(0,N.jsxs)("p",{className:"mb-3",children:[(0,N.jsx)(ke.A,{defaultMessage:"You've successfully assigned your content to {name}.",id:"label.youve_successfully_assigned_your_c.ceb5b234",values:{name:(0,N.jsx)("b",{children:null===s||void 0===s?void 0:s.name})}}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Your learners are ready to start!",id:"label.your_learners_are_ready_to_start.67fcc47b"})]}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:{offset:3,span:6},children:(0,N.jsxs)(Ce.S,{className:"d-grid gap-2",children:[!l&&(0,N.jsxs)(ve.A,{block:!0,className:"d-flex align-items-center justify-content-center",onClick:a,size:"xl",variant:"secondary",children:[(0,N.jsx)(QN.default,{className:"me-1",fontSize:24,style:{color:"var(--primary)"}}),(0,N.jsx)(ke.A,{defaultMessage:"Create another assignment",id:"label.create_another_assignment.2089a1d5"})]}),(0,N.jsxs)(ve.A,{block:!0,className:"d-flex align-items-center justify-content-center",onClick:t,size:"xl",variant:"secondary",children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Create another group",id:"label.create_another_group.0581ee48"})]}),(0,N.jsxs)(Le.Link,{className:"btn btn-primary btn-xl d-flex align-items-center justify-content-center",onClick:i,to:"/home",children:[(0,N.jsx)(ze.rQ8,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Continue to Solvably Home",id:"label.continue_to_solvably_home.62f897c0"})]})]})})})]})};const GN=(0,l.forwardRef)((e,s)=>{const{size:a,title:t}=e,{getAllUserOrganizations:i,userId:n}=(0,P.nm)(),[r,o]=(0,ne.CQ)({organization_id:null,reject:Function(),resolve:Function(),visible:!1}),{organization_id:d,resolve:c,visible:h}=r,u=(0,l.useRef)(),m=e=>new Promise((s,a)=>{o({organization_id:e,reject:a,resolve:s,visible:!0})}),g=()=>{c(null),o({organization_id:null,reject:Function(),resolve:Function(),visible:!1})};return(0,l.useImperativeHandle)(s,()=>({hide:g,show:m,visible:h})),(0,N.jsxs)(xe,{className:"group-picker-modal",onHide:g,show:h,size:a,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:t||(0,N.jsx)(ke.A,{defaultMessage:"Select group",id:"label.select_group.720c488f"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)($c,{allowMultiSelect:!1,exploded:!0,include_sub_orgs:!1,organization_id:d,organization_memberships:i(),ref:u,scopeToUser:n,searchable:!1,selectorType:"radio",submitOnSelect:!1})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:()=>{const e=null===u||void 0===u?void 0:u.current;e&&(c(e.getFullSelection()),g())},children:(0,N.jsx)(ke.A,{defaultMessage:"Select",id:"label.select.2a78025d"})})})]})});GN.displayName="GroupPickerModal",GN.defaultProps={onSelect:Function(),size:"lg"};var WN=GN;var KN={0:e=>{const{getGroupMemberships:s}
2=(0,P.nm)(),{getStepIcon:a,getStepMetadata:t,handleChooseExistingGroup:i,handleCreateGroup:l}=UN(),{is_active:n,status:r}=t(0),o=s(!1);return(0,N.jsxs)(Ce.S,{className:`step-row ${r}`,children:[(0,N.jsx)(Ce.S,{className:"step-col",children:a(1)}),(0,N.jsxs)(Ce.S,{className:"step-col",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create a group",id:"label.create_a_group.e3c48775"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Choose a name for your new group",id:"label.choose_a_name_for_your_new_group.ed0191d3"})}),n&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{onClick:l,size:"xl",variant:"primary",children:[(0,N.jsx)(ke.A,{defaultMessage:"start",id:"label.start.cced28c6"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]}),o.length>0&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"mt-2",children:(0,N.jsx)(ve.A,{onClick:i,variant:"link",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"or choose an existing group",id:"label.or_choose_an_existing_group.3348aab6"})})})})})]})]})]})},1:e=>{const{getStepIcon:s,getStepMetadata:a,handleInviteAdditionalLearners:t,handleInviteLearners:i}=UN(),{is_active:l,is_complete:n,status:r}=a(1);return(0,N.jsxs)(Ce.S,{className:`step-row ${r}`,children:[(0,N.jsx)(Ce.S,{className:"step-col",children:s(2)}),(0,N.jsxs)(Ce.S,{className:"step-col",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Invite learners",id:"label.invite_learners.889d2954"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Import an existing roster or add manually",id:"label.import_an_existing_roster_or_add_m.c5b80fb2"})}),l&&(0,N.jsxs)(ve.A,{onClick:i,size:"xl",variant:"primary",children:[(0,N.jsx)(ke.A,{defaultMessage:"start",id:"label.start.cced28c6"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]}),n&&(0,N.jsxs)(ve.A,{onClick:t,size:"xl",variant:"secondary",children:[(0,N.jsx)(ke.A,{defaultMessage:"Invite additional learners",id:"label.invite_additional_learners.a6a1e99f"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]})]})]})},2:e=>{const{getStepIcon:s,getStepMetadata:a,handleCreateAssignment:t}=UN(),{is_active:i,status:l}=a(2);return(0,N.jsxs)(Ce.S,{className:`step-row ${l}`,children:[(0,N.jsx)(Ce.S,{className:"step-col",children:s(3)}),(0,N.jsxs)(Ce.S,{className:"step-col",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assign content",id:"label.assign_content.356ddfec"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select at least one challenge to assign to learners",id:"label.select_at_least_one_challenge_to_a.7c676089"})}),i&&(0,N.jsxs)(ve.A,{onClick:t,size:"xl",variant:"primary",children:[(0,N.jsx)(ke.A,{defaultMessage:"start",id:"label.start.cced28c6"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]})]})]})},3:e=>{const{getStepIcon:s,getStepMetadata:a,handleCreateTeams:t,skipAssignmentCreation:i}=UN(),l=i?2:3,{is_active:n,status:r}=a(l);return(0,N.jsxs)(Ce.S,{className:`step-row ${r}`,children:[(0,N.jsx)(Ce.S,{className:"step-col",children:s(l+1)}),(0,N.jsxs)(Ce.S,{className:"step-col",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create teams",id:"label.create_teams.0ff8ad9b"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Drag and drop your learners into teams",id:"label.drag_and_drop_your_learners_into_t.6f947e7c"})}),n&&(0,N.jsxs)(ve.A,{onClick:t,size:"xl",variant:"primary",children:[(0,N.jsx)(ke.A,{defaultMessage:"start",id:"label.start.cced28c6"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]})]})]})},4:VN};const YN=(0,l.forwardRef)((s,a)=>{const{add_facilitator:t,enable_redirect:i,onCreate:n,organization:r}=s,{formatMessage:o}=(0,ja.A)(),{api:d,locale:c,userIsEcommerce:h}=(0,P.nm)(),u=(0,Pe.W6)(),[m,g]=(0,ne.CQ)({error:null,group:null,loading:!1,reject:Function(),resolve:Function(),visible:!1}),{error:p,loading:x,reject:v,resolve:f,visible:j}=m,_=()=>g({error:null}),b=()=>new Promise((e,s)=>{if(!r)return s(o({id:"label.invalid_organization.b1ac4858",defaultMessage:"Invalid organization"}));g({error:null,group:null,loading:!1,reject:s,resolve:e,visible:!0})}),A=()=>{f(),g({visible:!1})};return(0,l.useImperativeHandle)(a,()=>({hide:A,show:b,visible:j})),(0,N.jsx)(xe,{onHide:A,show:j,children:(0,N.jsx)(ds.l1,{onSubmit:async s=>{let{name:a,section:l,slug:o}=s;try{g({error:null,loading:!0});const s=await(async(s,a,t)=>{try{const e=null===r||void 0===r?void 0:r.id;
2if(!e)return v(intl.formatMessage({id:"label.invalid_organization.b1ac4858",defaultMessage:"Invalid organization"}));g({loading:!0});const{group:i}=await d.post("/api/groups/add",{name:s,organization_id:e,section:t,slug:a});return g({group:i,loading:!1},n),i}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,loading:!1})}})(a,o,l);if(t&&await(async s=>{try{const e=null===r||void 0===r?void 0:r.id;if(!e)return v(intl.formatMessage({id:"label.invalid_organization.b1ac4858",defaultMessage:"Invalid organization"}));g({loading:!0}),await d.post("/api/facilitators/group/add",{group_id:s,organization_id:e}),g({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,loading:!1})}})(null===s||void 0===s?void 0:s.id),i)return u.push(`/admin/group/${null===s||void 0===s?void 0:s.id}`);g({loading:!1,visible:!1}),(e=>{f(e),A()})(s)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,loading:!1})}},validateOnMount:!0,validationSchema:(0,Re.by)({locale:c,scope:"organization.add_group"}),initialValues:{name:"",section:"",slug:""},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,isValid:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create a group",id:"label.create_a_group.e3c48775"})}),h()&&(0,N.jsx)("p",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"You will assign at least one of the challenges you purchased to this group",id:"label.you_will_assign_at_least_one_of_th.5d358db3"})})]}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:_,show:p,variant:"danger",children:p}),(0,N.jsx)(Me.x_,{loading:x,children:(0,N.jsx)(_e.A,{onSubmit:t,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{disabled:x,isInvalid:n.name&&s.name,isValid:n.name&&!s.name,name:"name",onChange:a,type:"text",value:r.name,onKeyUp:e=>{l("slug",Rr()(e.target.value,{lower:!0,remove:/[*+~.()'"!:@]/g}))}}),s.name&&n.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]})})})]}),(0,N.jsxs)(xe.Footer,{className:"border-0",children:[(0,N.jsx)(ve.A,{onClick:A,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!i,onClick:t,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})})});YN.displayName="AdminGroupEditor",YN.defaultProps={add_facilitator:!1,enable_redirect:!1,onCreate:Function(),organization:null};var qN=YN;const JN=l.createContext({}),XN=JN.Provider,ZN=(JN.Consumer,()=>(0,l.useContext)(JN));var $N=t(17084),eS=t(6787);const sS=e=>{const{force_password_change:s,generate_passwords:a,generateUsersList:t,handlePrevious:i,hide:n,is_wizard:r,loading:o,lock_user_information:d,setModalState:c,silent:h}=ZN(),u=(0,ja.A)(),[m,g]=(0,l.useState)(!1),p=()=>g(!m),x=ul.Ik().shape({default_password:ul.Yj().min(4,"Password does not meet length requirements").max(20,"Password does not meet length requirements (max 20 characters)").matches(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,20}$/,"Password format invalid - Password must be at least 4 characters, no more than 20 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit.")}),v=(0,N.jsxs)("h6",{className:"d-flex align-items-center",children:[(0,N.jsx)(ke.A,{defaultMessage:"Create passwords",description:"",id:"label.create_passwords.03653ce9"})," ",(0,N.jsx)(Ua.A,{delay:{hide:200},flip:!0,placement:"right",overlay:(0,N.jsx)(Qa.A,{className:"step-1",id:"automaticPasswordsTooltip",children:(0,N.jsxs)("ul",{className:"text-white list-unstyled text-align-left",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:'Choose "Automatically" to send learners a link to choose their own passwords',description:"",id:"label.choose_automatically_to_send_learn.0d613c5c"})}),(0,N.jsx)("br",{}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:'Choose "Manually" to create passwords and send them to your learners',description:"",id:"label.choose_manually_to_create_password.9a75b2e5"})})]})}),children:(0,N.jsx)(ze.gZZ,{className:"ms-2",color:"var(--gray-700)"})})]});return(0,N.jsx)(ds.l1,{onSubmit:async(e,s)=>{const a=1==e.generate_passwords;await c((0,F.A)((0,F.A)({},e),{},{generate_passwords:a})),t(),await c({step:2})},validationSchema:x,initialValues:{default_password:"",force_password_change:s,generate_passwords:a,lock_user_information:d,num_learners:1,silent:h},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,isValid:l,setFieldValue:d,touched:c,values:h}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)($N.A,{className:"modal-step-1",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(os,{children:[v,(0,N.jsx)(_e.A.Check,{checked:1==h.generate_passwords,label:u.formatMessage({id:"label.automatically.a15c6adf",defaultMessage:"Automatically"}),name:"generate_passwords",onChange:a,type:"radio",value:1}),(0,N.jsx)(_e.A.Check,{checked:0==h.generate_passwords,label:u.formatMessage({id:"label.manually.57d0ea1c",defaultMessage:"Manually"}),name:"generate_passwords",onChange:a,type:"radio",value:0})]})}),0==h.generate_passwords&&(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{isInvalid:s.default_password,isValid:h.default_password&&!s.default_password,name:"default_password",onChange:a,placeholder:u.formatMessage({id:"label.default_password_optional.a65d7ea5",defaultMessage:"Default password (optional)"}),type:"text",value:h.default_password}),s.default_password&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.default_password})]})}),(0,N.jsx)(ve.A,{className:"px-0",onClick:p,style:{fontWeight:600},variant:"link",children:m?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Fewer options",description:"",id:"label.fewer_options.ef9870d3"})}),(0,N.jsx)(ze.Ucs,{className:"ms-2"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"More options",description:"",id:"label.more_options.bc79cdff"})}),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})}),(0,N.jsxs)(Ce.S,{className:"px-4 py-3 collapse "+(m?"show mt-2":""),style:{backgroundColor:"var(--gray-200)",borderRadius:8},children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:!h.silent,className:"ps-0 d-flex align-items-center",label:u.formatMessage({id:"label.send_learners_their_account_creden.b9d41d22",defaultMessage:"Send learners their account credentials via email"}),name:"silent",onClick:()=>{d("silent",!h.silent)}})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:h.force_password_change,className:"ps-0 d-flex align-items-center",label:u.formatMessage({id:"label.force_learners_to_change_their_pas.163ee503",defaultMessage:"Force learners to change their passwords on first login"}
2),name:"force_password_change",onChange:a})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:h.lock_user_information,className:"ps-0 d-flex align-items-center",label:u.formatMessage({id:"label.allow_learners_to_modify_their_nam.7b59fc60",defaultMessage:"Allow learners to modify their names"}),name:"lock_user_information",onChange:a})})})]})]}),(0,N.jsxs)(eS.A,{children:[r?(0,N.jsx)(ve.A,{className:"me-auto",disabled:o,onClick:i,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})}):(0,N.jsx)(ve.A,{disabled:o,onClick:n,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!l,size:"lg",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})]})]})}})};const aS=l.createContext({}),tS=aS.Provider,iS=(aS.Consumer,()=>(0,l.useContext)(aS));var lS=e=>{const{creationError:s,field:a,formError:t,onBlur:i,onChange:n,row:r,user:o,value:d}=e,{editUser:c,loading:h,resetFieldCreationValidity:u}=iS(),m=(0,l.useRef)(),[g,p]=(0,l.useState)(!1),x=()=>{p(!0)},v=e=>{s&&u(a,o),c(o,a,e.target.value),p(!1),"function"===typeof i&&i()},f=e=>{n(e)},j=e=>{const{key:s}=e;"Enter"===s&&m.current&&m.current.blur()},_=t||s||"";return(0,N.jsx)("td",{className:"p-3",children:_?(0,N.jsx)(Ua.A,{flip:!0,placement:"right",overlay:(0,N.jsx)(Qa.A,{id:`inputFeedbackTooltip-${r}-${a}`,children:_}),children:(0,N.jsx)(Xl.A,{className:"admin-create-user-editor-cell w-100 mb-0",style:{minWidth:150},children:(0,N.jsx)(be.A,{className:`w-100 ${g?"":"naked"} ${h?"text-muted":""}`,disabled:h,isInvalid:_,name:a,onBlur:v,onChange:f,onFocus:x,onKeyPress:j,placeholder:"\u2014",ref:m,value:d})})}):(0,N.jsx)(Xl.A,{className:"admin-create-user-editor-cell w-100 mb-0",style:{minWidth:150},children:(0,N.jsx)(be.A,{className:`w-100 ${g?"":"naked"} ${h?"text-muted":""}`,disabled:h,isInvalid:!!_,name:a,onBlur:v,onChange:f,onFocus:x,onKeyPress:j,placeholder:"\u2014",ref:m,value:d})})})};var nS=e=>{const{creation_errors:s,row:a}=e,{editUser:t,generate_passwords:i,loading:n,removeUser:r,users:o}=iS(),{locale:d}=(0,P.nm)(),[c,h]=(0,l.useState)(o[a]),{email_address:u,fullname:m,password:g}=c||{};(0,l.useEffect)(()=>{h(o[a])},[o,a]);const p=null!==s&&void 0!==s&&s.length?s.filter(e=>e.row===a):[],x=e=>{var s;if(null===p||void 0===p||!p.length)return;return null===(s=p.filter(s=>s.field===e)[0])||void 0===s?void 0:s.message};return(0,N.jsx)(ds.l1,{enableReinitialize:!0,validateOnChange:!1,validateOnMount:!0,validationSchema:(0,Re.by)({locale:d,scope:"user.add_user"}),initialValues:{email_address:u,fullname:m,generate_passwords:i,password:g},onSubmit:(e,s)=>{for(const{key:a,value:i}in e)t(c,a,i)},children:e=>{let{errors:s,handleChange:t,touched:l,validateForm:o,values:d}=e;return(0,N.jsxs)(_e.A,{as:"tr",children:[(0,N.jsx)("input",{hidden:!0,name:"generate_passwords",type:"checkbox",value:d.generate_passwords}),(0,N.jsx)(lS,{creationError:x("email_address"),field:"email_address",formError:s.email_address,onBlur:o,onChange:t,row:a,touched:l.email_address,user:c,value:d.email_address}),!i&&(0,N.jsx)(lS,{creationError:x("password"),field:"password",formError:s.password,onBlur:o,onChange:t,row:a,touched:l.password,user:c,value:d.password}),(0,N.jsx)(lS,{creationError:x("fullname"),field:"fullname",formError:s.fullname,onBlur:o,onChange:t,row:a,touched:l.fullname,user:c,value:d.fullname}),(0,N.jsx)("td",{className:"text-end p-3",children:(0,N.jsx)(ve.A,{"aria-label":"remove user",className:"text-secondary",onClick:()=>r(c),style:n?{cursor:"not-allowed"}:{},variant:"link",children:(0,N.jsx)(ze.RCe,{})})})]})}})};class rS extends l.Component{constructor(e){super(e),this.clearError=()=>{this.setState({error:null})},this.addUser=e=>{const{default_password:s,generate_passwords:a}=this.state;a?e.password=this.generatePassword(8):!a&&s&&(e.password=s),this.setState(s=>{const a=(null===s||void 0===s?void 0:s.users)||[];return a.push(e),{users:a}})},this.addBlankUser=()=>{this.addUser({})},this.editUser=(e,s,a)=>{const{users:t}=this.state,i=t.indexOf(e),l=[...t];l[i][s]=a,this.setState({users:l})},this.removeUser=e=>{var s,a;const t=null===this||void 0===this||null===(s=this.confirm_remove_dialog)||void 0===s?void 0:s.current;if(!t)return;const i=(null===(a=this.state)||void 0===a?void 0:a.users)||[];t.show({actions:[t.CancelAction(),t.Action({label:"Remove",onClick:()=>{this.resetRowCreationValidity(e);const s=i.filter(s=>s!==e);this.setState({users:s})},variant:"danger"})],body:"Are you sure you want to remove this user?",title:"Confirm Removal"})},this.generatePassword=e=>{const s=["abcdefghijklmnopqrstuvwxyz","!@#$%^&*()-+<>","1234567890","ABCDEFGHIJKLMNOPQRSTUVWXYZ"];let a="";for(let t=0;t<e;t++){let i;switch(t){case 0:i=s[0];break;case 2:i=s[2];break;case e-1:i=s[1];break;default:i=s[3]}a+=i.charAt(Math.floor(Math.random()*i.length))}return a},this.randomizePasswords=()=>{const{users:e}=this.state,s=[...e];for(const a of e)null!==a&&void 0!==a&&a.password||(a.password=this.generatePassword(8));this.setState({users:s})},this.applyDefaultPasswords=()=>{const{default_password:e,users:s}=this.state,a=[...s];if(e){for(const a of s)a.password=e;this.setState({users:a})}},this.handleGeneratePasswordsToggle=e=>{const s=e.target.checked;this.setState({generate_passwords:s}),s?this.randomizePasswords():this.applyDefaultPasswords()},this.handlePrevious=()=>{const{onPrevious:e}=this.props;"function"===typeof e&&e()},this.handleCancel=()=>{const{onCancel:e}=this.props;"function"===typeof e&&e()},this.resetRowCreationValidity=e=>{const{creation_errors:s,users:a}=this.state;if(null===s||void 0===s||!s.length)return;const t=a.indexOf(e),i=s.filter(e=>(null===e||void 0===e?void 0:e.row)!==t);this.setState({creation_errors:i})},this.resetFieldCreationValidity=(e,s)=>{const{creation_errors:a,users:t}=this.state;if(null===a||void 0===a||!a.length)return;const i=t.indexOf(s),l=a.filter(e=>e.row===i).filter(s=>s.field===e),n=a.filter(e=>e!==l[0]);this.setState({creation_errors:n})},this.handleCreateUsers=async()=>{const{onCreate:e,onCreationSuccess:s}=this.props,{force_password_change:a,generate_passwords:t,lock_user_information:i,silent:l,users:n}=this.state,r={force_password_change:a,generate_passwords:t,lock_user_information:i,silent:l,users:n};"function"===typeof e&&(this.setState({loading:!0}),await e(r).then(()=>{this.setState({loading:!1}),"function"===typeof s&&s(n)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,a=null===e||void 0===e?void 0:e.data;Array.isArray(a)?this.setState({creation_errors:a,error:s,loading:!1}):this.setState({error:s,loading:!1})}
2))};const{config:s}=e,{default_password:a,force_password_change:t,generate_passwords:i,lock_user_information:n,silent:r,users:o}=s;this.state={default_password:a,error:null,force_password_change:t,generate_passwords:i,loading:!1,lock_user_information:n,silent:r,users:[...o]},this.confirm_remove_dialog=(0,l.createRef)()}render(){const{intl:e,is_wizard:s}=this.props,{creation_errors:a,error:t,generate_passwords:i,loading:l,users:n}=this.state,r=(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:["Automatic passwords:",(0,N.jsx)("small",{className:"fw-semibold",children:i?"ON":"OFF"}),(0,N.jsx)(Ua.A,{delay:{hide:200},flip:!0,placement:"bottom",overlay:(0,N.jsx)(Qa.A,{className:"step-2",id:"automaticPasswordsTooltip",children:i?e.formatMessage({id:"label.we_will_send_learners_a_link_to_ch.a753ae0d",defaultMessage:"We will send learners a link to choose their own passwords"}):e.formatMessage({id:"label.you_will_need_to_create_passwords.f4c76d5c",defaultMessage:"You will need to create passwords and send them to your learners"})}),children:(0,N.jsx)("div",{className:"d-flex align-items-center",children:(0,N.jsx)(ze.gZZ,{color:"var(--gray-700)"})})})]});return(0,N.jsxs)(tS,{value:{creation_errors:a,editUser:this.editUser,error:t,generate_passwords:i,loading:l,removeUser:this.removeUser,resetFieldCreationValidity:this.resetFieldCreationValidity,users:n},children:[(0,N.jsxs)(Ce.S,{className:"mb-3",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:t,variant:"danger",children:t}),(0,N.jsxs)(Ce.S,{className:"add-user-cta d-flex flex-column-reverse flex-lg-row gap-2 gap-lg-0 justify-content-between mb-3",children:[(0,N.jsxs)(ve.A,{onClick:this.addBlankUser,size:"lg",children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Add learner",description:"",id:"label.add_learner.efc76f3d"})]}),(0,N.jsx)(_e.A.Switch,{checked:i,className:"align-self-start align-self-lg-end",id:"automaticPasswordsSwitch",label:r,onChange:this.handleGeneratePasswordsToggle})]}),(0,N.jsxs)(qa.A,{className:"add-users-table",responsive:!0,size:"sm",striped:!(null===n||void 0===n||!n.length),children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsxs)("th",{className:"text-start",children:[(0,N.jsx)(ke.A,{defaultMessage:"Email",description:"",id:"label.email.969ccbd3"})," *"]}),!i&&(0,N.jsx)("th",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"Password *",description:"",id:"label.password.7c6dc119"})}),(0,N.jsx)("th",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",description:"",id:"label.name.dcd1d522"})}),(0,N.jsx)("th",{})]})}),(0,N.jsx)("tbody",{children:null!==n&&void 0!==n&&n.length?(0,N.jsx)(N.Fragment,{children:n&&n.map((e,s)=>(0,N.jsx)(nS,{creation_errors:a,loading:l,row:s,user:e},s))}):(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center p-3 text-muted",colSpan:5,children:(0,N.jsx)(ke.A,{defaultMessage:"No users",description:"",id:"label.no_users.f15ad1bc"})})})})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(ve.A,{className:"me-auto",disabled:l,onClick:this.handlePrevious,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})}),!s&&(0,N.jsx)(ve.A,{className:"me-2",disabled:l,onClick:this.handleCancel,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:l||!(null!==n&&void 0!==n&&n.length),onClick:this.handleCreateUsers,size:"lg",style:{minWidth:127},children:l?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsx)(ke.A,{defaultMessage:"Create users",id:"label.create_users.22cad49e"})})]}),(0,N.jsx)(je,{ref:this.confirm_remove_dialog})]})}}var oS=(0,Ke.Ay)(rS);const dS=e=>{const{createUsers:s,default_password:a,force_password_change:t,generate_passwords:i,handleCreationSuccess:l,hide:n,is_wizard:r,lock_user_information:o,setStep:d,silent:c,users:h}=ZN(),u={default_password:a,force_password_change:t,generate_passwords:i,lock_user_information:o,silent:c,users:h};return(0,N.jsx)($N.A,{children:(0,N.jsx)(oS,{config:u,is_wizard:r,onCancel:n,onCreate:s,onCreationSuccess:l,onPrevious:()=>d(1)})})};var cS=s=>{const{is_wizard:a,onClose:t,onNext:i,users:l}=s,[n,r]=(0,ne.CQ)({error:null,loading:!1}),{error:o,loading:d}=n;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)($N.A,{className:"d-flex flex-column justify-content-center text-center align-items-center",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:o,variant:"danger",children:o}),(0,N.jsx)("h1",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learners added successfully!",id:"label.learners_added_successfully.7899b0b8"})}),(0,N.jsx)(ve.A,{onClick:async()=>{null!==l&&void 0!==l&&l.length&&(r({loading:!0}),await(async s=>{try{const e={learners:s},a=await fetch("/api/users/groups/members/credentials",{body:JSON.stringify(e),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"});if("application/pdf"!==a.headers.get("Content-Type")){const e=await a.json();if(!e.success)throw(null===e||void 0===e?void 0:e.message)||"Unknown error";return}const t=await a.blob();if(!t)throw"Unable to open file";const i="learner_logins.pdf";if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(t,i);else{const e=URL.createObjectURL(t),s=document.createElement("a");s.href=e,s.download=i,document.body.appendChild(s),s.click(),setTimeout(function(){document.body.removeChild(s),window.URL.revokeObjectURL(e)},0)}}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;r({error:a})}})(l),r({loading:!1}))},size:"lg",variant:"link",children:(0,N.jsx)(Ce.S,{className:"h4 d-flex align-items-baseline",children:d?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}),(0,N.jsx)(ke.A,{defaultMessage:"Downloading...",id:"label.downloading.f976eb28"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.WCW,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Download credentials",id:"label.download_credentials.96bf1922"})]})})}
2),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"These credentials should be distributed to your learners",id:"label.these_credentials_should_be_distri.7bbaea65"})})]}),(0,N.jsx)(eS.A,{children:a?(0,N.jsx)(ve.A,{onClick:i,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})}):(0,N.jsx)(ve.A,{onClick:t,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})};const hS=e=>{const{created_users:s,handleNext:a,is_wizard:t}=ZN();return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(cS,{is_wizard:t,onClose:a,onNext:a,users:s})})};class uS extends l.Component{constructor(e){super(e),this.show=e=>new Promise((s,a)=>{this.resolve=s,this.reject=a,this.setState((0,F.A)((0,F.A)({},e),{},{show:!0}))}),this.hide=()=>{const{onHide:e}=this.props;"function"===typeof e&&e(),"function"===typeof this.resolve&&this.resolve(),this.resetModal()},this.setModalState=e=>new Promise((s,a)=>{this.setState(e,s)}),this.resetModal=()=>{this.setState({created_users:[],creation_errors:null,default_password:"",error:!1,force_password_change:!1,generate_passwords:!0,loading:!1,lock_user_information:!1,num_learners:1,show:!1,step:1,success:!1,users:[]})},this.setStep=e=>{this.setState({step:e})},this.handlePrevious=()=>{const{onPrevious:e}=this.props;"function"===typeof e&&e(),this.hide()},this.handleNext=()=>{const{onNext:e}=this.props;"function"===typeof e&&e();const{created_users:s}=this.state;this.resolve(s),this.hide()},this.createUsers=async e=>{const{app:s,group_id:a,organization_id:t}=this.props,{force_password_change:i,generate_passwords:l,lock_user_information:n,silent:r,users:o}=e||{};if(null!==o&&void 0!==o&&o.length)return this.setState({error:null}),await s.api.post("/api/organizations/members/create",{force_password_change:i,generate_passwords:l,group_id:a,lock_user_information:n,organization_id:t,silent:r,users:o})},this.generateUsersList=()=>{const{default_password:e,generate_passwords:s,num_learners:a}=this.state,t=[];for(let i=0;i<a;i++){const a={fullname:"",password:s?this.generatePassword(8):e};t.push(a)}this.setState(e=>({users:(Array.isArray(e.users)?e.users:[]).concat(t)}))},this.generatePassword=e=>{const s=["abcdefghijklmnopqrstuvwxyz","!@#$%^&*()-+<>","1234567890","ABCDEFGHIJKLMNOPQRSTUVWXYZ"];let a="";for(let t=0;t<e;t++){let i;switch(t){case 0:i=s[0];break;case 2:i=s[2];break;case e-1:i=s[1];break;default:i=s[3]}a+=i.charAt(Math.floor(Math.random()*i.length))}return a},this.setForcePasswordChange=e=>{this.setState({force_password_change:e})},this.setLockUserInformation=e=>{this.setState({lock_user_information:e})},this.setSilent=e=>{this.setState({silent:!!e})},this.setGeneratePasswords=e=>{this.setState({generate_passwords:e})},this.handleCreationSuccess=e=>{const{onCreationSuccess:s}=this.props;"function"===typeof s&&s(),this.setState({created_users:e,loading:!1,step:3})},this.resolve=null,this.reject=null,this.state={created_users:[],creation_errors:null,default_password:"",error:!1,force_password_change:!1,generate_passwords:!1,loading:!1,lock_user_information:!1,num_learners:1,show:!1,silent:!1,step:1,success:!1,users:[]}}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}componentWillUnmount(){const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}render(){const{group:e,is_wizard:s,organization:a}=this.props,{created_users:t,creation_errors:i,default_password:l,error:n,force_password_change:r,generate_passwords:o,loading:d,lock_user_information:c,num_learners:h,show:u,silent:m,step:g,success:p,users:x}=this.state,v=e?null===e||void 0===e?void 0:e.name:a?null===a||void 0===a?void 0:a.name:"";return(0,N.jsx)(XN,{value:{created_users:t,createUsers:this.createUsers,creation_errors:i,default_password:l,error:n,force_password_change:r,generate_passwords:o,generatePassword:this.generatePassword,generateUsersList:this.generateUsersList,handleCreationSuccess:this.handleCreationSuccess,handleNext:this.handleNext,handlePrevious:this.handlePrevious,hide:this.hide,is_wizard:s,isValidDate:this.isValidDate,loading:d,lock_user_information:c,num_learners:h,resetModal:this.resetModal,setForcePasswordChange:this.setForcePasswordChange,setGeneratePasswords:this.setGeneratePasswords,setLockUserInformation:this.setLockUserInformation,setModalState:this.setModalState,setSilent:this.setSilent,setStep:this.setStep,show:this.show,silent:m,success:p,users:x},children:(0,N.jsxs)(xe,{backdrop:"static",className:`admin-user-creation-modal step-${g}
2 modal-add-users`,id:"modalAddUsers",onHide:this.hide,show:u,size:""+(1===g?"":"xl"),children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h4",{children:(()=>{switch(g){case 1:return(0,N.jsx)(ke.A,{defaultMessage:"Add learners",id:"label.add_learners.b696770f"});case 2:return(0,N.jsx)(ke.A,{defaultMessage:"Manage learners",id:"label.manage_learners.f56d7cd7"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(0,N.jsx)("p",{className:"m-0",children:(()=>{switch(g){case 1:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Manually add learners to",id:"label.manually_add_learners_to.e332a739"}),(0,N.jsx)("strong",{style:{color:"var(--gray-700"},children:v})]});case 2:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Add, edit, and remove learners from",id:"label.add_edit_and_remove_learners_from.ea036360"}),(0,N.jsx)("strong",{style:{color:"var(--gray-700"},children:v})]});default:return(0,N.jsx)(N.Fragment,{})}})()})]})}),(()=>{switch(g){case 1:return(0,N.jsx)(sS,{});case 2:return(0,N.jsx)(dS,{});case 3:return(0,N.jsx)(hS,{});default:return(0,N.jsx)(N.Fragment,{})}})()]})})}}var mS=(0,Ke.Ay)((0,n.G0)(uS));const gS=l.createContext({}),pS=gS.Provider,xS=(gS.Consumer,()=>(0,l.useContext)(gS)),vS=e=>{const{clearError:s,clearFile:a,error:i,file:l,force_password_change:n,handlePrevious:r,handleShowUploadDialog:o,is_wizard:d,loading:c,lock_user_information:h,setForcePasswordChange:u,setLockUserInformation:m,setSilent:g,setStep:p,silent:x}=xS(),v=(0,ja.A)(),{parseExt:f}=(0,P.hc)(),{styles:j}=(0,P.nm)(),{primary:_}=j;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:s,show:i,variant:"danger",children:i}),l?(0,N.jsx)(Ge.A,{className:"file-preview mb-4",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)(zm,{ext:f(null===l||void 0===l?void 0:l.name),fill:_,size:64,type:"file"}),(0,N.jsx)("h5",{className:"mt-2 text-center text-truncate mw-100",children:null===l||void 0===l?void 0:l.name}),(0,N.jsx)(ve.A,{onClick:a,variant:"link",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Choose another file",id:"label.choose_another_file.26eac8f8"})})})]})}):(0,N.jsxs)(Ce.S,{className:"import-steps d-flex flex-column mb-4",children:[(0,N.jsxs)(Ce.S,{className:"import-step d-flex mb-3 flex-column",children:[(0,N.jsxs)(Ce.S,{className:"import-step-upper d-flex",children:[(0,N.jsx)(Ce.S,{className:"step-number me-2",children:(0,N.jsx)("h6",{children:"1"})}),(0,N.jsxs)(Ce.S,{className:"step-details",children:[(0,N.jsx)("span",{className:"h6 step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Download template",id:"label.download_template.332b7401"})}),(0,N.jsx)("p",{className:"step-description",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a roster of learners using the following CSV template",id:"label.create_a_roster_of_learners_using.4d701bc4"})})]})]}),(0,N.jsx)(Ce.S,{className:"import-step-lower",children:(0,N.jsxs)(ve.A,{className:"csv-template-download",download:!0,href:t(22251),rel:"noopener noreferrer",size:"lg",target:"_blank",variant:"secondary",children:[(0,N.jsx)(ze.mSE,{className:"me-1"}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Download CSV Template",id:"label.download_csv_template.11439f2e"})})]})})]}),(0,N.jsxs)(Ce.S,{className:"import-step d-flex mb-4 flex-column",children:[(0,N.jsxs)(Ce.S,{className:"import-step-upper d-flex",children:[(0,N.jsx)(Ce.S,{className:"step-number me-2",children:(0,N.jsx)("h6",{children:"2"})}),(0,N.jsxs)(Ce.S,{className:"step-details",children:[(0,N.jsx)("span",{className:"h6 step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload roster",id:"label.upload_roster.59724897"})}),(0,N.jsx)("p",{className:"step-description",children:(0,N.jsx)(ke.A,{defaultMessage:"Then, upload your CSV roster file",id:"label.then_upload_your_csv_roster_file.23d9394e"})})]})]}),(0,N.jsx)(Ce.S,{className:"import-step-lower",children:(0,N.jsxs)(ve.A,{className:"csv-template-download",onClick:o,size:"lg",children:[c?(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}):(0,N.jsx)(ze.mSE,{className:"me-1"}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload CSV Roster File",id:"label.upload_csv_roster_file.72c7db1c"})})]})})]})]}),(0,N.jsx)(Xl.A,{children:(0,N.jsx)(Zl.A,{checked:!x,className:"d-flex align-items-center",label:v.formatMessage({id:"label.send_learners_their_account_creden.b9d41d22",defaultMessage:"Send learners their account credentials via email"}),name:"silent",onClick:()=>{g(!x)}})}),(0,N.jsx)(Xl.A,{children:(0,N.jsx)(Zl.A,{checked:n,className:"d-flex align-items-center",onChange:u,label:(0,N.jsx)(ke.A,{defaultMessage:"Force learners to change their passwords on first login",id:"label.force_learners_to_change_their_pas.163ee503"})})}),(0,N.jsx)(Xl.A,{children:(0,N.jsx)(Zl.A,{checked:h,className:"d-flex align-items-center",onChange:m,label:(0,N.jsx)(ke.A,{defaultMessage:"Allow learners to modify their names",id:"label.allow_learners_to_modify_their_nam.7b59fc60"})})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsxs)(Ce.S,{className:"d-flex",style:{flex:1},children:[d&&(0,N.jsx)(ve.A,{className:"me-auto",onClick:r,size:"lg",variant:"secondary",children:"Previous"}),l&&(0,N.jsx)(ve.A,{className:"ms-auto",onClick:()=>p(2),size:"lg",children:"Next"})]})})]})};const fS=e=>{const{createUsers:s,default_password:a,force_password_change:t,generate_passwords:i,handleCreationSuccess:l,hide:n,is_wizard:r,lock_user_information:o,setStep:d,silent:c,users:h}=xS(),u={default_password:a,force_password_change:t,generate_passwords:i,lock_user_information:o,silent:c,users:h};return(0,N.jsx)($N.A,{children:(0,N.jsx)(oS,{config:u,is_wizard:r,onCancel:n,onCreate:s,onCreationSuccess:l,onPrevious:()=>d(1)})})};const jS=e=>{const{created_users:s,handleNext:a,hide:t,is_wizard:i}=xS();return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(cS,{is_wizard:i,onClose:t,onNext:a,users:s})})};class _S extends l.Component{constructor(e){super(e),this.show=e=>new Promise((s,a)=>{this.resolve=s,this.reject=a,this.setState((0,F.A)((0,F.A)({},e),{},{show:!0}))}),this.hide=()=>{const{onHide:e}=this.props;"function"===typeof e&&e(),"function"===typeof this.resolve&&this.resolve(),this.resetModal()},this.resetModal=()=>{this.setState({created_users:[],error:!1,file:null,force_password_change:!1,loading:!1,lock_user_details:!1,show:!1,show_upload_dialog:!1,silent:!1,step:1,users:[]})},this.clearError=()=>{this.setState({error:null})},this.clearFile=()=>{this.setState({file:null})},this.handlePrevious=()=>{const{onPrevious:e}=this.props;"function"===typeof e&&e(),this.hide()},this.handleNext=()=>{const{created_users:e}=this.state;this.resolve(e),this.hide();const{onNext:s}=this.props;"function"===typeof s&&s()},this.setStep=e=>{this.setState({step:e})},this.handleCreationSuccess=e=>{const{onCreationSuccess:s}=this.props;"function"===typeof s&&s(),this.setState({created_users:e,loading:!1,step:3})},this.handleFileUpload=async e=>{const{app:s,intl:a}=this.props,{type:t}=e;this.setState({loading:!0}),"text/csv"!==t&&"application/vnd.ms-excel"!==t?this.setState({error:a.formatMessage({id:"label.invali
2d_file_type_detected_accepta.905b0ff3",defaultMessage:"Invalid file type detected, acceptable file types are: CSV"}),loading:!1}):(this.setState({file:e}),await s.api.file("/api/organizations/members/import",e).then(e=>{if(!e)return!1;const s=null!==e&&void 0!==e&&e.users?[...e.users]:[];this.setState({loading:!1,show_upload_dialog:!1,users:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})}))},this.handleShowUploadDialog=()=>{this.setState({show_upload_dialog:!0})},this.handleHideUploadDialog=()=>{this.setState({show_upload_dialog:!1})},this.setForcePasswordChange=e=>{var s;const a=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.checked;this.setState({force_password_change:a})},this.setLockUserInformation=e=>{var s;const a=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.checked;this.setState({lock_user_information:a})},this.setSilent=e=>{this.setState({silent:e})},this.createUsers=async e=>{const{app:s,group_id:a,organization_id:t}=this.props,{force_password_change:i,generate_passwords:l,lock_user_information:n,silent:r,users:o}=e||{};if(null!==o&&void 0!==o&&o.length)return this.setState({error:null}),await s.api.post("/api/organizations/members/create",{force_password_change:i,generate_passwords:l,group_id:a,lock_user_information:n,organization_id:t,silent:r,users:o})},this.resolve=null,this.reject=null,this.state={created_users:[],error:!1,file:null,force_password_change:!1,loading:!1,lock_user_details:!1,show:!1,show_upload_dialog:!1,silent:!1,step:1,users:[]}}componentDidMount(){const{onRef:e}=this.props;"function"===typeof e&&e(this)}componentWillUnmount(){const{onRef:e}=this.props;"function"===typeof e&&e(void 0)}render(){const{group:e,is_wizard:s,organization:a}=this.props,{created_users:t,error:i,file:l,force_password_change:n,loading:r,lock_user_information:o,show:d,show_upload_dialog:c,silent:h,step:u,users:m}=this.state,g=e?null===e||void 0===e?void 0:e.name:a?null===a||void 0===a?void 0:a.name:"";return(0,N.jsxs)(pS,{value:{clearError:this.clearError,clearFile:this.clearFile,created_users:t,createUsers:this.createUsers,error:i,file:l,force_password_change:n,handleCreationSuccess:this.handleCreationSuccess,handleHideUploadDialog:this.handleHideUploadDialog,handleNext:this.handleNext,handlePrevious:this.handlePrevious,handleShowUploadDialog:this.handleShowUploadDialog,hide:this.hide,is_wizard:s,lock_user_information:o,setForcePasswordChange:this.setForcePasswordChange,setLockUserInformation:this.setLockUserInformation,setSilent:this.setSilent,setStep:this.setStep,silent:h,users:m},children:[(0,N.jsxs)(xe,{backdrop:"static",className:`admin-user-import-modal step-${u}`,id:"adminUserImportModal",onHide:this.hide,show:d,size:1===u?"":"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,className:"d-flex flex-column",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h4",{children:(()=>{switch(u){case 1:return(0,N.jsx)(ke.A,{defaultMessage:"Import users",id:"label.import_users.f8e8e1b7"});case 2:return(0,N.jsx)(ke.A,{defaultMessage:"Manage learners",id:"label.manage_learners.f56d7cd7"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(0,N.jsx)("p",{className:"m-0",children:(()=>{switch(u){case 1:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Import a CSV roster file for",id:"label.import_a_csv_roster_file_for.c007765a"}),(0,N.jsx)("strong",{style:{color:"var(--gray-700"},children:g})]});case 2:return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Add, edit, and remove learners from",id:"label.add_edit_and_remove_learners_from.ea036360"}),(0,N.jsx)("strong",{style:{color:"var(--gray-700"},children:g})]});default:return(0,N.jsx)(N.Fragment,{})}})()})]})}),(()=>{switch(u){case 1:return(0,N.jsx)(vS,{});case 2:return(0,N.jsx)(fS,{});case 3:return(0,N.jsx)(jS,{});default:return(0,N.jsx)(N.Fragment,{})}})()]}),(0,N.jsxs)(xe,{className:"csv-upload-dialog",id:"csvUploadDialog",onHide:this.handleHideUploadDialog,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload CSV Roster File",id:"label.upload_csv_roster_file.72c7db1c"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(fa,{is_custom:!0,onSubmit:this.handleFileUpload,submitting:r})})]})]})}}var bS=(0,Ke.Ay)((0,n.G0)(_S));const AS=(0,l.forwardRef)((s,a)=>{const{is_wizard:t,onNext:i}=s,{formatMessage:n}=(0,ja.A)(),[r,o]=(0,ne.CQ)({error:null,group:null,loading:!1,organization:null,reject:Function(),resolve:Function(),step:1,users:[],visible:!1}),{error:d,group:c,loading:h,organization:u,resolve:m,visible:g}=r,p=(0,l.useRef)(),x=(0,l.useRef)(),v=(0,l.useRef)(),f=()=>{m(),o({visible:!1})},j=async s=>{try{let e;switch(s){case"create":e=null===p||void 0===p?void 0:p.current;break;case"import":e=null===x||void 0===x?void 0:x.current;break;case"add":e=null===v||void 0===v?void 0:v.current}if(!e)return;o({visible:!1});const a=await e.show();o({visible:!0}),(null===a||void 0===a?void 0:a.length)&&(e=>{m(e),f()})(a)}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;o({error:a,visible:!0})}},_={hide:f,show:async(e,s)=>new Promise((a,t)=>{if(!e)return t(n({id:"label.organization_not_provided.2c2c45b9",defaultMessage:"Organization not provided"}));o({error:null,group:s,loading:!1,organization:e,reject:t,resolve:a,visible:!0})}),visible:g};return(0,l.useImperativeHandle)(a,()=>(0,F.A)({},_)),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{className:"add-user-wizard",onHide:f,show:g,children:[(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add learners",id:"label.add_learners.b696770f"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Import a roster or add learners manually",id:"label.import_a_roster_or_add_learners_ma.569ff1ab"})})]}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:d,variant:"danger",children:d}),(0,N.jsx)(Me.x_,{loading:h,children:(0,N.jsx)(Ce.S,{className:"steps-container",children:(0,N.jsxs)("div",{className:"d-flex flex-column gap-3",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center justify-content-center gap-1",onClick:()=>j("import"),size:"lg",variant:"secondary",children:[(0,N.jsx)(ze.PiR,{}),(0,N.jsx)(ke.A,{defaultMessage:"Import From a CSV File...",id:"label.import_from_a_csv_file.3f2798cd"})]}),(0,N.jsxs)(ve.A,{block:!0,className:"d-flex align-items-center justify-content-center gap-1",onClick:()=>j("create"),size:"lg",variant:"primary",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add learners manually",id:"label.add_learners_manually.f297908d"})]})]})})})]})]}),(0,N.jsx)(mS,{group:c,group_id:null===c||void 0===c?void 0:c.id,is_wizard:t,onNext:i,onPrevious:()=>o({visible:!0}),onRef:e=>p.current=e,organization:u,organization_id:null===u||void 0===u?void 0:u.id}),(0,N.jsx)(bS,{group:c,group_id:null===c||void 0===c?void 0:c.id,is_wizard:t,onNext:i,onPrevious:()=>o({visible:!0}),onRef:e=>x.current=e,organization:u,organization_id:null===u||void 0===u?void 0:u.id})]})});AS.displayName="AddUserWizard";var yS=AS;const wS=(0,l.forwardRef)((s,a)=>{const{onHide:t,skipAssignmentCreation:i}=s,n=(0,l.useRef)(),r=(0,l.useRef)(),o=(0,l.useRef)(),d=(0,l.useRef)(),c=(0,l.useRef)(),[h,u,m]=(0,ne.CQ)({error:null,group:null,group_assignment:null,loading:!1,step:0,step_data:new Array(4).fill({}),visible:!1}),{error:g,group:p,loading:x,step:v,visible:f}=h,{getUserOrganization:j,getUserOrganizationId:_}=(0,P.nm)(),b=e=>u({visible:e}),A=()=>{t(),m()},y=()=>u({step:Math.min(4,h.step+1)}),w=e=>(null===h||void 0===h?void 0:h.step)>e,S=e=>(null===h||void 0===h?void 0:h.step)===e,C=e=>(null===h||void 0===h?void 0:h.step)<e,M=e=>{switch(!0){case S(e):return"active";case w(e):return"complete";case C(e):return"locked";default:return""}},k=(e,s)=>{const a=(0,T.clone)(h.step_data);a[e]=s,console.log(a),u({step_data:a})},z=async()=>{try{const e=null===n||void 0===n?void 0:n.current;if(!e)return;let s=j();b(!1);const a=await e.show(s,p);b(!0),a&&y()}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(a),b(!0)}},I={getStepIcon:e=>{const s=S(e),a=w(e),t=C(e),i=`step-icon ${s?"active":""} ${a?"complete":""} ${t?"locked":""}`;return(0,N.jsxs)(Ce.S,{className:i,children:[a&&(0,N.jsx)(Zs.A,{height:24,src:Dn.complete,width:24}),t||s?(0,N.jsx)(N.Fragment,{children:e}):""]})},getStepMetadata:e=>({is_active:S(e),is_complete:w(e),is_locked:C(e),status:M(e)}
2),group:p,handleChooseExistingGroup:()=>{try{const e=d.current;if(!e)return;u({visible:!1},async()=>{const s=await e.show(_());s&&(k(0,s),u({group:s,step:2})),b(!0)})}catch(e){(0,xa.Err)(e),b(!0)}},handleCreateAdditionalAssignment:()=>{u({error:null,group_assignment:null,step:2})},handleCreateAdditionalGroup:()=>{u({error:null,group:null,group_assignment:null,step:0})},handleCreateAssignment:async()=>{try{const e=null===r||void 0===r?void 0:r.current;if(!e)return;b(!1);const{assignment:s}=await e.show();u({group_assignment:s,visible:!0},y)}catch(e){(0,xa.Err)(e),b(!0)}},handleCreateGroup:async()=>{try{const e=null===o||void 0===o?void 0:o.current;if(!e)return;b(!1);const s=await e.show();b(!0),s&&((e=>{k(0,e),u({group:e})})(s),y())}catch(e){const a=(null===e||void 0===e?void 0:e.message)||e;u({error:a,visible:!0})}},handleCreateTeams:async()=>{try{const e=null===c||void 0===c?void 0:c.current,{group_assignment:s}=h;if(!e||!s)return;b(!1);const a=await e.show({group_assignment:s});u({step:a&&4,teams:a,visible:!0})}catch(e){(0,xa.Err)(e),b(!0)}},handleInviteAdditionalLearners:()=>{u({error:null,group_assignment:null,step:1},z)},handleInviteLearners:z,hide:A,show:function(){u({error:null,loading:!1,step:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,visible:!0})},skipAssignmentCreation:i};(0,l.useImperativeHandle)(a,()=>(0,F.A)({},I));const E=KN[v]||l.Fragment;return(0,N.jsxs)(HN,{value:(0,F.A)({},I),children:[(0,N.jsxs)(xe,{backdrop:"static",className:"facilitator-onboard-wizard",onHide:A,show:f,size:4===v?"lg":"",children:[4!==v&&(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex flex-column",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Getting started",id:"label.getting_started.831d0f72"})}),(0,N.jsx)("p",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete the following to get up and running",id:"label.complete_the_following_to_get_up_a.0db3b8e7"})})]}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>u({error:null}),show:g,variant:"danger",children:g}),(0,N.jsx)(Me.x_,{loading:x,children:(0,N.jsx)(Ce.S,{className:"steps-container",children:(0,N.jsx)(E,{})})})]})]}),(0,N.jsx)(qN,{add_facilitator:!0,enable_redirect:!1,organization:j(),ref:o}),(0,N.jsx)(WN,{ref:d,size:"normal"}),(0,N.jsx)(yS,{is_wizard:!0,ref:n,onNext:()=>{b(!0),y()}}),(0,N.jsx)(cc,{ref:r}),(0,N.jsx)(rc,{group:p,ref:c})]})});wS.displayName="FacilitatorOnboardingWizard",wS.defaultProps={onHide:Function(),skipAssignmentCreation:!1};const NS=(0,l.forwardRef)((e,s)=>{const{getAllUserOrganizations:a,refreshUserBasics:t,setUserOrganizationId:i,userId:n}
2=(0,P.nm)(),{deleteCartCookie:r}=hN(),[o,d]=(0,ne.CQ)({checkout_phase:0,error:!1,loading:!1,modal_phase:0,order_number:null,payment_intent_client_secret:null,payment_method:null,stripe_error:null,visible:!1}),{checkout_phase:c,error:h,loading:u,modal_phase:m,order_number:g,payment_method:p,stripe_error:x,stripe_payment_intent_id:v,visible:f}=o,j=(0,l.useRef)(),_=()=>{d({checkout_phase:0,modal_phase:0,visible:!0})},b=()=>{1!==m&&d({visible:!1}),2===m&&r()},A={checkout_phase:c,error:h,hideModal:b,launchOnboardWizard:async()=>{const e=null===j||void 0===j?void 0:j.current;if(!e)return;await t();const s=a().find(e=>(null===e||void 0===e?void 0:e.organization.purchaser_user_id)===n);s?(await i(null===s||void 0===s?void 0:s.organization_id),b(),e.show()):d({error:"Could not find e-commerce organization for this user"})},loading:u,modal_phase:m,order_number:g,payment_method:p,setCheckoutPhase:e=>d({checkout_phase:e}),setError:e=>d({error:e}),setModalPhase:e=>d({modal_phase:e}),setOrderNumber:e=>d({order_number:e}),setPaymentIntent:e=>d({stripe_payment_intent_id:e}),setPaymentMethod:e=>d({payment_method:e}),setStripeError:e=>d({stripe_error:e}),show:_,showModal:_,stripe_error:x,stripe_payment_intent_id:v,visible:f};(0,l.useImperativeHandle)(s,()=>(0,F.A)({},A));const y=(null===LN||void 0===LN?void 0:LN[m])||l.Fragment;return(0,N.jsxs)(MN,{value:(0,F.A)({},A),children:[(0,N.jsxs)(xe,{backdrop:"static",className:`shopping-checkout-modal phase-${m}`,enforceFocus:!0,id:"shoppingCheckoutModal",onHide:b,show:f,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:1!==m,children:0===m&&(0,N.jsx)("span",{className:"h3",children:(0,N.jsx)(ke.A,{defaultMessage:"Checkout",id:"label.checkout.99e71f48"})})}),(0,N.jsxs)(xe.Body,{className:"p-0 p-lg-3",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:h,variant:"danger",children:h}),(0,N.jsx)(y,{})]})]}),(0,N.jsx)(wS,{ref:j})]})});NS.displayName="ShoppingCheckoutModal";var SS=NS;var CS=s=>{const[a,t]=(0,ne.CQ)({coe_data:null,components:[],count:0,loading:!0,page:1,page_size:20}),{api:i}=(0,P.nm)(),{coe:n,launchDemoDialog:r,launchItemDetailsModal:o,shopping_enabled:d}=AC(),c=dC("#FFFFFF"),{coe_data:h,components:u,count:m,loading:g,page:p,page_size:x}=a,v=Math.min(p*x,m),f=async()=>{try{const{coe_data:e}=a;t({loading:!0});const{components:s,count:l}=await i.post(`/api/marketplace/coe/${p}/${x}`,{coe:null===e||void 0===e?void 0:e.token});t({components:s,count:l,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;t({error:a,loading:!1})}},j=e=>{e.preventDefault(),r()};return(0,l.useEffect)(()=>{const e=c.find(e=>(null===e||void 0===e?void 0:e.token)===n);e?t({coe_data:e,loading:!1},f):window.location="/marketplace/talent"},[n]),(0,N.jsx)(Me.x_,{flexFill:!0,loading:g,children:(0,N.jsxs)(Ce.S,{className:"p-0 marketplace-tm-coe",children:[(0,N.jsxs)(Ce.S,{className:"section-hero",style:{backgroundColor:null===h||void 0===h?void 0:h.color_light},children:[(0,N.jsx)(Ce.S,{className:"cover-image-abs",children:(0,N.jsx)(Zs.A,{className:"hero-img",src:null===h||void 0===h?void 0:h.hero_image_path})}),(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"col-text",lg:{order:"last",span:12},md:{order:"last",span:12},sm:{order:"last",span:12},xl:{order:"first",span:8},xs:{order:"last",span:12},children:[(0,N.jsx)(Ce.S,{className:"mb-3",children:(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center gap-1",style:{color:null===h||void 0===h?void 0:h.color},to:"/marketplace/talent",children:[(0,N.jsx)(ze.QVr,{}),(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Back to All Centers of Excellence",id:"label.back_to_all_centers_of_excellence.25634a88"})})]})}),(0,N.jsx)("h1",{className:"display-4",children:null===h||void 0===h?void 0:h.name}),(0,N.jsx)("p",{children:null===h||void 0===h?void 0:h.description}),(0,N.jsxs)(Ce.S,{className:"py-4 py-xl-0 pt-xl-4",children:[(0,N.jsx)(ve.A,{onClick:j,size:"lg",style:{backgroundColor:null===h||void 0===h?void 0:h.color,borderColor:null===h||void 0===h?void 0:h.color,color:"white"},children:(0,N.jsx)(ke.A,{defaultMessage:"Get started",id:"label.get_started.61e8d44a"})}),(0,N.jsx)(ve.A,{onClick:j,size:"lg",style:{backgroundColor:"white",borderColor:null===h||void 0===h?void 0:h.color,color:null===h||void 0===h?void 0:h.color,marginLeft:15},children:(0,N.jsx)(ke.A,{defaultMessage:"Learn more",id:"label.learn_more.1445799c"})})]})]}),(0,N.jsx)(Ve.A,{className:"col-img text-right d-xl-none d-lg-block d-md-block d-sm-block",lg:{order:"first",span:12},md:{order:"first",span:12},sm:{order:"first",span:12},xs:{order:"first",span:12},children:(0,N.jsx)(Ce.S,{className:"cover-image",children:(0,N.jsx)(Zs.A,{className:"hero-img",src:null===h||void 0===h?void 0:h.hero_image_path})})})]})})]}),(0,N.jsx)(Ce.S,{className:"section-challenge_templates mt-4",children:(0,N.jsxs)(Ue.A,{className:"p-0",children:[(0,N.jsx)(Qe.A,{className:"search-results-counter mt-2 px-2 px-sm-0 mx-0",children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)(Ce.S,{className:"float-right text-muted",children:m>0?`Showing ${(p-1)*x+1}-${v} of ${m} results`:"0 results"})})}),u&&u.length>0&&(0,N.jsx)(Qe.A,{className:"px-2 px-sm-0 mx-0",children:u&&u.map((e,s)=>{let{cartridge_template_stub:a,challenge_template_stub:t,group_assignment_template_stub:i,type:l}=e;const n=(null===a||void 0===a?void 0:a.current)||(null===t||void 0===t?void 0:t.current)||(null===i||void 0===i?void 0:i.current);return(0,N.jsx)(Ve.A,{lg:4,md:6,sm:6,style:{paddingBottom:30},xl:3,xs:12,children:d?(0,N.jsx)(pN,{component:n,component_type:l,onRequestInfo:r,onShowDetail
2s:o}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Kh,{component:n,type:l})})},s)})}),!u||0===u.length&&(0,N.jsx)("h6",{className:"text-center text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No matching challenges found.",id:"label.no_matching_challenges_found.91726c41"})})]})})]})})},MS=t.p+"static/media/design-lab.88d8f97cf1f819d37b81.png",kS=t.p+"static/media/prepare3.c20a4317dcf9567d6f7a.png",zS=t.p+"static/media/inspire.1dd3b0d49cd343b917d0.png",TS=t.p+"static/media/awards.f98e4fb636504ac9ddbf.png",IS=t.p+"static/media/hero.fa9484d59b189b6952d9.png";var ES=e=>{const{canNext:s,canPrev:a,controlSize:t="md",hideControls:i=!1,onNext:l,onPrev:n,outsideControls:r,showPermControls:o=!1}=e,d=`${r?" outside":""}${o?" visible":""}${i?" d-none":""}`;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:`card-scroller-control card-scroller-control-${t} ${a?"":"disabled"} prev ${d}`,onClick:n,children:(0,N.jsx)(ze.QVr,{size:32})}),(0,N.jsx)(ve.A,{className:`card-scroller-control card-scroller-control-${t} ${s?"":"disabled"} next ${d}`,onClick:l,children:(0,N.jsx)(ze.Z0P,{size:32})})]})};class FS extends l.Component{constructor(e,s){super(e,s),this.state={canNext:!0,canPrev:!1,cardOffset:0,isAnimating:!1,isMobile:window.innerWidth<=(null===e||void 0===e?void 0:e.mobileBreakpoint),scrollProgressPct:0},this.ref=s,this.scroller=(0,l.createRef)(),this.scrollerContainer=(0,l.createRef)(),this.reset=this.reset.bind(this),this.handleNext=this.handleNext.bind(this),this.handlePrev=this.handlePrev.bind(this),this.handleResize=this.handleResize.bind(this),this.getCurrentOffset=this.getCurrentOffset.bind(this),this.calculateNumNextsRemaining=this.calculateNumNextsRemaining.bind(this)}calculateNumNextsRemaining(e){if(this.scrollerContainer.current){var s,a,t;const{cardWidth:i}=this.props,l=this.scrollerContainer.current.clientWidth;return((null===(s=this.scroller)||void 0===s||null===(a=s.current)||void 0===a||null===(t=a.children)||void 0===t?void 0:t.length)||0)+e/i-Math.floor(l/i)}}getCurrentOffset(){var e,s,a;if(null===(e=this.scroller)||void 0===e||null===(s=e.current)||void 0===s||null===(a=s.style)||void 0===a||!a.transform)return 0;const t=this.scroller.current.style.transform||"";return(0,T.parseInt)(t.replace("translateX(",""))}getScrollProgressPct(){const e=this.getCurrentOffset(),s=this.calculateNumNextsRemaining(e),a=this.calculateNumNextsRemaining(0);return a>0?Math.floor((a-s)/a*100):0}handleResize(){const{mobileBreakpoint:e}=this.props;this.setState({isMobile:window.innerWidth<=e},()=>{if(this.state.isMobile)this.scroller.current&&(this.scroller.current.style.transform="translateX(0px)");else if(this.scroller.current){const e=this.getCurrentOffset();if(this.calculateNumNextsRemaining(e)>=0&&this.state.cardOffset<=0)return;this.setState(e=>({cardOffset:e.cardOffset-1}))}})}handleNext(){if(!this.scroller.current||!this.scrollerContainer.current)return!1;const e=this.getCurrentOffset(),s=this.calculateNumNextsRemaining(e),a=s-1>0,t=this.state.cardOffset-1;s>0?(this.scroller.current.style.transform=`translateX(${this.props.cardWidth*t}px)`,this.setState({canPrev:!0,cardOffset:t,scrollProgressPct:this.getScrollProgressPct()})):this.state.isAnimating||this.setState({isAnimating:!0},()=>{this.scroller.current.classList.add("bump-next"),setTimeout(()=>{this.scroller.current.classList.remove("bump-next"),this.setState({isAnimating:!1})},this.props.animationDuration)}),this.setState({canNext:a})}handlePrev(){if(!this.scroller.current)return!1;if(this.state.cardOffset<0){const e=this.state.cardOffset+1;this.scroller.current.style.transform=`translateX(${this.props.cardWidth*e}px)`,this.setState(e=>({canNext:!0,cardOffset:e.cardOffset+1,scrollProgressPct:this.getScrollProgressPct()}))}else this.state.isAnimating||this.setState({isAnimating:!0},()=>{this.scroller.current.classList.add("bump-prev"),setTimeout(()=>{this.scroller.current.classList.remove("bump-prev"),this.setState({isAnimating:!1})},this.props.animationDuration)});this.setState(e=>({canPrev:e.cardOffset+1<0}))}reset(){this.scroller.current&&this.setState({cardOffset:0},()=>{this.scroller.current.style.transform=`translateX(${this.props.cardWidth*this.state.cardOffset}px)`;const e=this.calculateNumNextsRemaining(this.getCurrentOffset());this.setState(s=>({canNext:e-1>0,canPrev:s.cardOffset+1<0}))})}componentDidMount(){window.addEventListener("resize",this.handleResize)}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}render(){const{canNext:e,canPrev:s,isMobile:a,scrollProgressPct:t}=this.state,{backgroundImage:i,children:l,controlSize:n="md",header:r,hideControls:o=!1,minHeight:d,offsetLeft:c=0,outsideControls:h=!1,placeholder:u,showPermControls:m=!1}=this.props;return(0,N.jsxs)("div",{className:"card-scroller-container "+(a?"mobile":""),ref:this.scrollerContainer,style:{backgroundImage:i},children:[r&&"function"==typeof r&&r(t),l?(0,N.jsxs)("div",{className:"card-scroller-contents",style:{marginLeft:c},children:[(0,N.jsx)("div",{className:"card-scroller",ref:this.scroller,style:{minHeight:d},children:l}
2),!a&&(0,N.jsx)(ES,{canNext:e,canPrev:s,controlSize:n,hideControls:o,onNext:this.handleNext,onPrev:this.handlePrev,outsideControls:h,showPermControls:m})]}):(0,N.jsx)("p",{className:"lead text-center text-muted pt-5",children:u||"No Cards Found"})]})}}var RS=FS;const DS=e=>{const s=dC().sort((e,s)=>e.carousel_order>s.carousel_order?1:-1);return(0,N.jsx)(Ce.S,{className:"coe-wrapper",children:(0,N.jsx)(RS,{animationDuration:300,cardWidth:232,controlSize:"sm",minHeight:320,mobileBreakpoint:768,outsideControls:!0,showPermControls:!0,children:(null===s||void 0===s?void 0:s.length)&&s.map((e,s)=>(0,N.jsx)(Le.Link,{className:"coe-card-wrapper",to:`/marketplace/talent/${null===e||void 0===e?void 0:e.token}`,children:(0,N.jsx)(uC,{coe:e})},s))})})};var BS=e=>{const{shopping:s}=(0,P.nm)(),{coe:a}=AC(),t=(0,l.useRef)(),i=()=>{const e=null===t||void 0===t?void 0:t.current;e&&e.show()};return(0,N.jsx)(N.Fragment,{children:a?(0,N.jsx)(CS,{}):(0,N.jsxs)(Ce.S,{className:"p-0 marketplace-tm storefront talent",children:[(0,N.jsx)(Ce.S,{className:"section-hero pb-5 pt-4",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"col-text d-flex flex-column",lg:{order:"last",span:8},md:{order:"last",span:12},sm:{order:"last",span:12},style:{placeContent:"center"},xl:{order:"first",span:8},xs:{order:"last",span:12},children:[(0,N.jsx)("h1",{className:"display-4 fw-semibold",children:(0,N.jsx)(ke.A,{defaultMessage:"Supercharge your training and assessment",id:"label.supercharge_your_training_and_asse.23cc09d3"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably TALENT is a digital learning and assessment solution that drives behavioral change via remote, collaborative experiences. Employees work in teams to solve relevant business challenges while learning, developing and tracking the workforce competencies that matter.",id:"label.solvably_talent_is_a_digital_learn.27f5bf70"})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-3",children:[(0,N.jsx)(ve.A,{className:"btn-asymmetric align-self-start",onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Request demo",id:"label.request_demo.915b64b6"})}),!(null===s||void 0===s||!s.enabled)&&(0,N.jsx)(Le.Link,{className:"btn btn-link p-0 d-flex align-self-start",to:"/marketplace/pricing",children:(0,N.jsx)(ke.A,{defaultMessage:"View pricing",id:"label.view_pricing.434dc3a5"})})]})]}),(0,N.jsx)(Ve.A,{className:"col-img d-flex hero-img-container d-flex flex-column",lg:{order:"first",span:12},md:{order:"first",span:12},sm:{order:"first",span:12},style:{placeContent:"center"},xl:{order:"last",span:4},xs:{order:"first",span:12},children:(0,N.jsx)(Zs.A,{className:"hero-img",src:IS})})]})})}),(0,N.jsxs)(Ce.S,{className:"section-coe pt-5",children:[(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{className:"m-0",children:[(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)("h2",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Select from an existing library",id:"label.select_from_an_existing_library.fb7b1eef"})})}),(0,N.jsx)(Ve.A,{className:"mx-auto",md:8,children:(0,N.jsx)("p",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Unlock workforce potential by selecting an in-demand / on-demand challenge from one of our Centers of Excellence libraries",id:"label.unlock_workforce_potential_by_sele.7f64548d"})})}),(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)(DS,{})})]})}),(0,N.jsx)(Ce.S,{className:"section-author pt-5 mt-3",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column mt-4",lg:7,children:[(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Customize your own learning",id:"label.customize_your_own_learning.940f7b77"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create, edit and customize your own scalable Solvably TALENT challenges or library of challenges with our easy-to-use {designLab} authoring tool.",id:"label.create_edit_and_customize_your_own.99208b47",values:{designLab:(0,N.jsx)("em",{children:"Design Lab"})}})}),(0,N.jsx)(Ce.S,{className:"mt-3 btn-create-challenge",children:(0,N.jsx)(ve.A,{onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a Challenge",id:"label.create_a_challenge.9bc9d341"})})})]}),(0,N.jsx)(Ve.A,{className:"col-img d-flex justify-content-center py-2",lg:5,children:(0,N.jsx)(Zs.A,{className:"design-lab-img align-middle ml-n5",src:MS})})]})})}),(0,N.jsx)(Ce.S,{className:"section-prepare p-0 pt-5",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)("h2",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Prepare for the future of work",id:"label.prepare_for_the_future_of_work.3c3419f5"})})}),(0,N.jsx)(Ve.A,{md:{offset:1,span:10},children:(0,N.jsx)("p",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably TALENT fills the void of existing assessment and learning programs with:",id:"label.solvably_talent_fills_the_void_of.f141f9bf"})})})]}),(0,N.jsx)(Ce.S,{className:"d-block d-md-none d-flex justify-content-center text-center",children:(0,N.jsxs)(W_.A,{children:[(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;Scaffolded, scalable framwork",className:"prepare-img-mobile",src:dw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"Longitudinal efficacy tracking and reporting",className:"prepare-img-mobile",src:cw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"360 degree competency evaluations",className:"prepare-img-mobile",src:hw})})]})})]})}),(0,N.jsx)(Ce.S,{className:"section-prepare",children:(0,N.jsx)(Ue.A,{fluid:!0,children:(0,N.jsx)(Qe.A,{className:"d-none d-sm-none d-md-block",children:(0,N.jsx)(Ve.A,{className:"d-flex justify-content-center text-center",md:12,children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;360 degree competency evaluations;Longitudinal efficacy tracking and reporting;Scaffolded, scalable framwork",className:"prepare-img",src:kS,style:{maxWidth:"1200px"}})})})})})]}
2),(0,N.jsx)(Ce.S,{className:"section-inspire",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:6,style:{placeContent:"center"},children:[(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Inspire innovation",id:"label.inspire_innovation.156bc0d9"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Empower a speak-up culture, unleash actionable ideas and solutions, and drive continuous improvement using Solvably TALENT's scaffolded, creative problem-solving framework.",id:"label.empower_a_speak_up_culture_unleash.0301bb26"})}),(0,N.jsx)(Ce.S,{className:"text-start",children:(0,N.jsx)(ve.A,{onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Learn more",id:"label.learn_more.1445799c"})})})]}),(0,N.jsx)(Ve.A,{className:"col-img position-relative inspire-img-container d-flex flex-columns",lg:{order:"last",span:6},md:{order:"first",span:12},sm:{order:"first",span:12},style:{placeItems:"center"},xl:{order:"last",span:6},xs:{order:"first",span:12},children:(0,N.jsx)(Zs.A,{className:"inspire-img",src:zS})})]})})}),(0,N.jsx)(Ce.S,{className:"section-contest py-5",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{className:"d-flex justify-content-center",children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",lg:8,style:{placeContent:"center"},children:[(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Run your own challenge-based contest",id:"label.run_your_own_challenge_based_conte.754c1ecc"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Who doesn't like a little friendly competition? Establish a valid talent pipeline, best identify \"high potentials\" and drive strategic, mission-critical KPIs and business objectives with Solvably TALENT's Contest app.",id:"label.who_doesnt_like_a_little_friendly.ab91f7ce"})}),(0,N.jsx)(Ce.S,{className:"d-none d-sm-none d-md-none",children:(0,N.jsx)(ve.A,{onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Run a contest",id:"label.run_a_contest.5c844f22"})})})]}),(0,N.jsx)(Ve.A,{className:"col-img position-relative inspire-img-container",lg:{order:"first",span:4},md:{order:1,span:7},sm:{order:1,span:10},xl:{order:"first",span:4},xs:{order:1,span:12},children:(0,N.jsx)(Zs.A,{className:"contest-img img-fluid",src:TS})}),(0,N.jsx)(Ve.A,{className:"pt-3",xs:{order:2,span:12},children:(0,N.jsx)(Ce.S,{className:"text-center d-md-block d-lg-none d-xl-none",children:(0,N.jsx)(ve.A,{onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Run a contest",id:"label.run_a_contest.5c844f22"})})})})]})})}),(0,N.jsx)(Ce.S,{className:"section-get-started py-5",children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{className:"px-2",children:(0,N.jsxs)(Ve.A,{className:"get-started-card d-flex flex-column justify-content-center text-center",md:12,children:[(0,N.jsx)("h2",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Get started today!",id:"label.get_started_today.dfc3d54d"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Take your learning to a new level with Solvably. Contact us today to schedule a demo.",id:"label.take_your_learning_to_a_new_level.e9a12d4f"})}),(0,N.jsx)(ve.A,{className:"btn-asymmetric mx-auto",onClick:i,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Request demo",id:"label.request_demo.915b64b6"})})]})})})}),(0,N.jsx)(fs,{ref:t}),(0,N.jsx)(gw,{})]})})},PS=t.p+"static/media/coe-leadership.0a5e2eb99c9eb89790c8.jpg",LS=t.p+"static/media/coe-diversity.33a72669dfdc269814a8.jpg",OS=t.p+"static/media/coe-wellbeing.550314e6d821f2d071f2.jpg",HS=t.p+"static/media/coe-sales.04384fe8d5eb50d4875a.jpg",US=t.p+"static/media/coe-data.1a86d2a48e669a93908d.jpg";var QS={ai:t.p+"static/media/coe-ai.c8d0bfa62555a4754697.jpg",compliance:"data:image/jpeg;base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FfXYbBYPBxUMHhqGGgraUaUIPTbWKTWnS7PisXmOOx0nPF4qviZP/n9UnNfdJtHFc+v8/8AGup9tlZaJW/VnJzecr2te/8AwP1CgkKACgAoAKACgAoAKACgAoAKACgAoAKAClZdUm1s7ar8R36a27X69wpg23uFAgoAKACgApf1smvmn/wBppbq/wA2vxXfYUEjoSPxP+NG+9rdldX9bPW3TsCdndXT8nZ/fb5Cc+ufrzTd2lFv3F9np8txuV3d791o/V/1cKP6/rREt3CgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAKACgAoAfsPt+v8AhQAbD7fr/hQAbD7fr/hQAbD7fr/hQAbD7fr/AIUAGw+36/4UAGw+36/4UAGw+36/4UAGw+36/wCFABsPt+v+FABsPt+v+FABsPt+v+FABsPt+v8AhQAbD7fr/hQAbD7fr/hQAbD7fr/hQAbD7fr/AIUAGw+36/4UAGw+36/4UAGw+36/4UAGw+36/wCFABsPt+v+FABsPt+v+FABsPt+v+FABsPt+v8AhQAbD7fr/hQAbD7fr/hQAP/Z",leadership:PS,sales:HS,wellbeing:OS},VS=t.p+"static/media/coe-compliance-hero.8b54cccf6ccc0efddddf.png",GS=t.p+"static/media/coe-innovation-hero.5ab23411ab9846aaa987.png",WS=t.p+"static/media/coe-leadership-hero.b97b002f8020727b8b97.png",KS=t.p+"static/media/coe-diversity-hero.bc63e8ea841491da10fa.png",YS=t.p+"static/media/coe-wellbeing-hero.769c70115495484cb899.png",qS=t.p+"static/media/coe-ethics-hero.110b93b233c11ba5d15c.png",JS=t.p+"static/media/coe-sales-hero.527c85b09c321f171fbe.png",XS=t.p+"static/media/coe-data-hero.b636a91ae9ae278684af.png";
2var ZS={ai:t.p+"static/media/coe-ai-hero.cfa689404439ee32c6f7.png",compliance:VS,data:XS,diversity:KS,ethics:qS,innovation:GS,leadership:WS,sales:JS,wellbeing:YS};const $S={dark:"#5849b8",light:"rgb(245, 244, 255)"},eC={dark:"#D34E3F",light:"rgba(211, 78, 63, .05)"},sC={dark:"#856bab",light:"rgba(134, 104, 172, .05)"},aC={dark:"#ce6d3a",light:"rgba(207, 110, 53, .05)"},tC={dark:"#1DA1BE",light:"rgba(29, 161, 190, .05)"},iC={dark:"#3682af",light:"rgba(53, 128, 176, .05)"},lC={dark:"#0b8187",light:"rgba(0, 128, 135, .05)"},nC={dark:"#9C775A",light:"rgba(156, 119, 90, .05)"},rC={dark:"#cb8529",light:"rgba(203, 134, 30, .05)"},oC=e=>(0,N.jsxs)("svg",{fill:"none",height:"14",viewBox:"0 0 14 14",width:"14",xmlns:"http://www.w3.org/2000/svg",children:[(0,N.jsx)("path",{d:"M1 7H13",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"}),(0,N.jsx)("path",{d:"M7 1L13 7L7 13",stroke:e,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})]}),dC=e=>[{arrow:oC($S.dark),card_image_path:QS.ai,carousel_order:1,color:$S.dark,color_light:$S.light,description:"Systemically future-proof your organization, division, or team for AI with evidence-based\ntraining from Solvably\u2019s AI Center of Excellence. Engage and empower employees to learn,\nshare, and apply AI solutions to relevant job role or functional challenges. Benefit from\nemployee-produced, actionable deliverables tied to key business metrics, as well as skill\nevaluations, and gain an AI competitive advantage.",description_short:"Future-proof your company for AI",hero_image_path:ZS.ai,icon:(0,N.jsx)(ze.BuW,{fill:e||$S.dark}),name:"AI",subjects:[],token:"ai"},{arrow:oC(eC.dark),card_image_path:QS.compliance,carousel_order:7,color:eC.dark,color_light:eC.light,description:"Cultivate and maintain an ethical workplace with authentic, team-based workplace experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Cultivate and maintain an ethical workplace",hero_image_path:ZS.compliance,icon:(0,N.jsx)(ze.aZA,{fill:e||eC.dark}),name:"Compliance",subjects:[],token:"compliance"},{arrow:oC(sC.dark),card_image_path:QS.data,carousel_order:4,color:sC.dark,color_light:sC.light,description:"Leverage data for enhanced decision making and minimized company risk with authentic, team-based Data Literacy workplace experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Leverage data for enhanced decision making",hero_image_path:ZS.data,icon:(0,N.jsx)(ze.YYR,{fill:e||sC.dark}),name:"Data Literacy",subjects:[],token:"data-literacy"},{arrow:oC(aC.dark),card_image_path:QS.diversity,carousel_order:5,color:aC.dark,color_light:aC.light,description:"Build a culture of safety and belonging with authentic, team-based Diversity, Equity and Inclusion workplace experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Build a culture of safety and belonging",hero_image_path:ZS.diversity,icon:(0,N.jsx)(ze.M5n,{fill:e||aC.dark}),name:"Diversity & Inclusion",subjects:[],token:"diversity"},{arrow:oC(tC.dark),card_image_path:QS.ethics,carousel_order:8,color:tC.dark,color_light:tC.light,description:"Make an impact on behavior, culture and values with authentic, team-based workplace experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Impact behavior, culture, and values",hero_image_path:ZS.ethics,icon:(0,N.jsx)(ze.PMT,{fill:e||tC.dark}),name:"Ethics",subjects:[],token:"ethics"},{arrow:oC(lC.dark),card_image_path:QS.leadership,carousel_order:2,color:lC.dark,color_light:lC.light,description:"Improve team performance and the power of influence for company success with authentic, team-based Leadership workplace experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Improve team performance for company success",hero_image_path:ZS.leadership,icon:(0,N.jsx)(ze.DDN,{fill:e||lC.dark}),name:"Leadership",subjects:[],token:"leadership"},{arrow:oC(iC.dark),card_image_path:QS.innovation,carousel_order:3,color:iC.dark,color_light:iC.light,description:"Foster creativity and design thinking with authentic, team-based Innovation experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Foster creativity and design thinking",hero_image_path:ZS.innovation,icon:(0,N.jsx)(ze.Cer,{fill:e||iC.dark}),name:"Innovation",subjects:[],token:"innovation"},{arrow:oC(nC.dark),card_image_path:QS.sales,carousel_order:9,color:nC.dark,color_light:nC.light,description:"Surpass goals and sell at a higher level with authentic, team-based workplace experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Surpass goals and sell at a higher level",hero_image_path:ZS.sales,icon:(0,N.jsx)(ze.wJQ,{fill:e||nC.dark}),name:"Sales",subjects:[],token:"sales"},{arrow:oC(rC.dark),card_image_path:QS.wellbeing,carousel_order:6,color:rC.dark,color_light:rC.light,description:"Address key issues and support peak performance with authentic, team-based Well-being experiences. Select one or more challenges below or create your own via our DesignLab.",description_short:"Address key issues and support peak performance",hero_image_path:ZS.wellbeing,icon:(0,N.jsx)(ze.szJ,{fill:e||rC.dark}),name:"Well-being",subjects:[],token:"wellbeing"}];var cC=()=>{const{isBelowBreakpoint:e}=(0,ne.vh)({breakpoint:922}),{isLoggedIn:s}=(0,P.nm)(),a=dC("#FFFFFF");return(0,N.jsxs)(li.A,{as:TN.A,className:"marketplace-tm-coe-library-menu d-flex d-lg-block flex-column flex-lg-row "+(s?"logged-in dropdown-outline me-3 mb-lg-0 ":""),id:"marketplaceTmCoeLibrary",children:[(0,N.jsx)(li.A.Toggle,{as:Fg.A,className:"flex-fill d-flex",children:(0,N.jsxs)(Ce.S,{className:"d-inline-flex align-items-center",children:[(0,N.jsx)(ze.svy,{color:"var(--gray-500)",size:!e&&22}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Library",id:"label.library.dc20b3d5"})})]})}),(0,N.jsx)(li.A.Menu,{children:a.map((e,s)=>(0,N.jsxs)(li.A.Item,{as:Le.Link,className:`coe-menu-${e.token}`,to:`/marketplace/talent/${null===e||void 0===e?void 0:e.token}`,children:[(0,N.jsx)("div",{className:"coe-menu-icon",style:{backgroundColor:null===e||void 0===e?void 0:e.color},children:null===e||void 0===e?void 0:e.icon}),(0,N.jsx)("span",{className:"coe-menu-name",children:(0,N.jsx)(ke.A,{defaultMessage:null===e||void 0===e?void 0:e.name,id:`label.${null===e||void 0===e?void 0:e.token}`})}),(0,N.jsx)("span",{className:"coe-menu-arrow",children:null===e||void 0===e?void 0:e.arrow})]},s))})]})};const hC=e=>{var s;const{card_image_path:a,color:t,description_short:i,icon:l,name:n,token:r}=null!==(s=null===e||void 0===e?void 0:e.coe)&&void 0!==s?s:{};return(0,N.jsxs)(Ge.A,{className:"coe-card p-0",children:[(0,N.jsx)(Ge.A.Img,{className:"w-100",src:a,style:{height:134},variant:"top"}),(0,N.jsx)(Ce.S,{className:`coe-card-icon bg-white coe-icon-${r}`,children:l}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(Ge.A.Title,{style:{color:t},children:n}),(0,N.jsx)(Ge.A.Text,{style:{fontSize:14},children:i}),(0,N.jsxs)(Ge.A.Link,{className:"d-flex align-items-center gap-1",style:{color:t},children:["View ",(0,N.jsx)(ze.Z0P,{fill:t,fontSize:"10px"})]})]})]})};hC.defaultProps={coe:{}};var uC=hC,mC=t.p+"static/media/talent-logo.6917ca32b63eac6033e4.png";const gC=["k-12","hied","talent","pricing"],pC=["talent","pricing"];var xC=e=>{var s,a,t,i;const[n,r]=(0,ne.CQ)({coe_slug:(null===e||void 0===e||null===(s=e.match)||void 0===s||null===(a=s.params)||void 0===a?void 0:a.coe_slug)||null,storefront:null===e||void 0===e||null===(t=e.match)||void 0===t||null===(i=t.params)||void 0===i?void 0:i.storefront}),{coe_slug:o,storefront:d}=n;(0,l.useEffect)(()=>{var s,a,t,i;r({coe_slug:(null===e||void 0===e||null===(s=e.match)||void 0===s||null===(a=s.params)||void 0===a?void 0:a.coe_slug)||null,storefront:null===e||void 0===e||null===(t=e.match)||void 0===t||null===(i=t.params)||void 0===i?void 0:i.storefront})},[e.match.params]);const c=(0,Pe.W6)(),h=(0,l.useRef)(),u=(0,l.useRef)(),m=(0,l.useRef)();gC.includes(d)||c.push("/");const{shopping:g}=(0,P.nm)(),p=pC.includes(d)&&!(null===g||void 0===g||!g.enabled),x=(e,s)=>{const a=null===h||void 0===h?void 0:h.current;a&&a.show(e,s)},v={default:{logged_in:{right:[(0,N.jsx)(rw,{},"WIFMenu")]},logged_out:{right:[(0,N.jsx)(rw,{},"WIFMenu")]}},shopping:{logged_in:{right:[(0,N.jsx)(cC,{}),(0,N.jsx)(rw,{},"WIFMenu"),p&&(0,N.jsx)("div",{style:{width:16}},"spacer"),p&&(0,N.jsx)(EN,{},"ShoppingCartDropdown")]},logged_out:{left:(0,N.jsx)(cC,{}),right:[(0,N.jsx)(rw,{},"WIFMenu"),p&&(0,N.jsx)("div",{style:{width:16}},"spacer"),p&&(0,N.jsx)(EN,{},"ShoppingCartDropdown")]}}},f={hied:{customMenu:v.default},"k-12":{customMenu:v.default},pricing:{customMenu:v.default},talent:{customLogo:mC,customMenu:v.shopping,hideHIW:!0,homeLink:o&&"/marketplace/talent",style:{backgroundColor:"#fff"}}},j=(null===kC||void 0===kC?void 0:kC[d])||l.Fragment,_={coe:o,launchDemoDialog:x,launchItemDetailsModal:(e,s)=>{let a;if(p){if(a=null===u||void 0===u?void 0:u.current,!a)return;a.show(e,s)}else{if(a=null===m||void 0===m?void 0:m.current,!a)return;a.show({assignable:!1,component_id:null===s||void 0===s?void 0:s.id,selectable:!1,type:e})}},shopping_enabled:p,storefront:d};return(0,N.jsxs)(bC,{value:_,children:[(0,N.jsxs)(Oa,{condition:p,wrapper:e=>(0,N.jsx)(oN,{children:e}),children:[(0,N.jsx)(py,(0,F.A)((0,F.A)({className:"marketplace d-flex flex-column"},null===f||void 0===f?void 0:f[d]),{},{children:(0,N.jsx)(Oa,{condition:["k-12","hied"].includes(d),wrapper:e=>(0,N.jsx)(zC,{children:e}),children:(0,N.jsx)(j,{})})})),p&&(0,N.jsx)(bN,{onRequestInfo:x,ref:u}),(0,N.jsx)(Uh,{ref:m})]}),(0,N.jsx)(vs,{ref:h})]})};var vC=t.p+"static/media/topic_bookmark.2ef68d799c490abd7adb4c8374575d7c.svg";var fC=t.p+"static/media/challenge_flag.b76691411846271e14025bd417bebaa1.svg";var jC=e=>{const{subject:s}
2=e,{id:a,component_count:t,cover_path:i,icon_path:l,name:n,topic_count:r}=s,{formatMessage:o}=(0,ja.A)(),{getSubjectBackground:d,getSubjectIcon:c}=(0,P.hc)(),{handleSubjectSearch:h}=EC();return(0,N.jsx)(Ve.A,{className:"marketplace-search-subject-card",style:{marginRight:10,paddingBottom:30},tabIndex:"1",children:(0,N.jsxs)(Ge.A,{className:"subject-card",onClick:()=>h(a),style:{cursor:"pointer"},children:[(0,N.jsxs)("div",{className:"subject-card-img",style:{backgroundImage:`url(${i||d(n)})`},children:[(0,N.jsx)("div",{className:"overlay"}),(0,N.jsx)("h5",{children:n}),(0,N.jsx)("div",{className:"fap-button",children:l?(0,N.jsx)("img",{src:l,width:20}):c(n)})]}),(0,N.jsxs)(yl.A,{className:"list-dm",variant:"flush",children:[(0,N.jsxs)(yl.A.Item,{className:"d-flex",children:[(0,N.jsx)(Zs.A,{alt:"",src:fC,style:{height:18,marginRight:8,width:18}}),(0,N.jsx)("strong",{className:"me-2",children:t}),(0,N.jsx)("span",{children:(0,N.jsx)(hc.A,{value:t,one:o({id:"label.module.f148224a",defaultMessage:"Module"}),other:o({id:"label.modules.76c86c4c",defaultMessage:"Modules"})})})]}),(0,N.jsxs)(yl.A.Item,{className:"d-flex",children:[(0,N.jsx)(Zs.A,{alt:"",src:vC,style:{height:18,marginRight:8,width:18}}),(0,N.jsx)("strong",{className:"me-2",children:r}),(0,N.jsx)("span",{className:"ml-1",children:(0,N.jsx)(hc.A,{value:r,one:o({id:"label.topic.7e61847d",defaultMessage:"Topic"}),other:o({id:"label.topics.e22820fc",defaultMessage:"Topics"})})})]})]})]})},a)};const _C=l.createContext({}),bC=_C.Provider;_C.Consumer;_C.displayName="MarketplaceContext";const AC=()=>(0,l.useContext)(_C);var yC=e=>{const{launchDemoDialog:s}=AC(),{count:a,handleBack:t,handleChangePage:i,loading:l,mode:n,page:r,page_size:o,searching:d}=EC();return(0,N.jsx)(Ue.A,{fluid:!0,className:"p-0 marketplace-k12 storefront hied d-flex flex-column flex-fill",children:(0,N.jsxs)(Me.x_,{flexFill:!0,loading:l,children:[(0,N.jsx)(wC,{}),(0,N.jsx)(HC,{}),(0,N.jsx)(LC,{filter_audience_category_slug:"hied",ownerFilter:!1}),0==n&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(RC,{}),(0,N.jsxs)(Ce.S,{"aria-hidden":!0,className:"coe-or-text text-center mb-5",children:[(0,N.jsx)("hr",{}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"or",id:"label.or.7175517a"})}),(0,N.jsx)("hr",{})]}),(0,N.jsx)(Ce.S,{className:"section-author pt-5 mt-3",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column mt-4",lg:7,children:[(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Customize your own learning",id:"label.customize_your_own_learning.940f7b77"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create, edit and customize your own scalable Solvably challenges or library of challenges with our easy-to-use {designLab} authoring tool.",id:"label.create_edit_and_customize_your_own.f40d6acb",values:{designLab:(0,N.jsx)("em",{children:"Design Lab"})}})}),(0,N.jsx)(Ce.S,{className:"mt-3 btn-create-challenge",children:(0,N.jsx)(ve.A,{onClick:s,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a Challenge",id:"label.create_a_challenge.9bc9d341"})})})]}),(0,N.jsx)(Ve.A,{className:"col-img d-flex justify-content-center py-2",lg:5,children:(0,N.jsx)(Zs.A,{className:"design-lab-img align-middle ml-n5",src:MS})})]})})}),(0,N.jsx)(Ce.S,{className:"section-prepare p-0 pt-5",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)("h2",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Prepare for the future of learning",id:"label.prepare_for_the_future_of_learning.44ec3bbe"})})}),(0,N.jsx)(Ve.A,{md:{offset:1,span:10},children:(0,N.jsx)("p",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably fills the void of existing learning programs with:",id:"label.solvably_fills_the_void_of_existin.75ef0a6d"})})})]}),(0,N.jsx)(Ce.S,{className:"d-block d-md-none d-flex justify-content-center text-center",children:(0,N.jsxs)(W_.A,{children:[(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;Scaffolded, scalable framework",className:"prepare-img-mobile",src:dw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"Longitudinal efficacy tracking and reporting",className:"prepare-img-mobile",src:cw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"360 degree competency evaluations",className:"prepare-img-mobile",src:hw})})]})})]})}),(0,N.jsx)(Ce.S,{className:"section-prepare",children:(0,N.jsx)(Ue.A,{fluid:!0,children:(0,N.jsx)(Qe.A,{className:"d-none d-sm-none d-md-block",children:(0,N.jsx)(Ve.A,{className:"d-flex justify-content-center text-center",md:12,children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;360 degree competency evaluations;Longitudinal efficacy tracking and reporting;Scaffolded, scalable framwork",className:"prepare-img",src:kS,style:{maxWidth:"1200px"}})})})})}),(0,N.jsx)(Ce.S,{className:"section-get-started py-5",children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{className:"px-2",children:(0,N.jsxs)(Ve.A,{className:"get-started-card d-flex flex-column justify-content-center text-center",md:12,children:[(0,N.jsx)("h2",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Get started today!",id:"label.get_started_today.dfc3d54d"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Take your learning to a new level with Solvably. Contact us today to schedule a demo.",id:"label.take_your_learning_to_a_new_level.e9a12d4f"})}),(0,N.jsx)(ve.A,{className:"btn-asymmetric mx-auto",onClick:s,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Request demo",id:"label.request_demo.915b64b6"})})]})})})})]}),1==n&&(0,N.jsxs)(Ce.S,{children:[d&&(0,N.jsx)(Ce.S,{className:"text-center mt-5",children:(0,N.jsx)(Me.y$,{})}
2),!d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ue.A,{className:"pt-4",children:(0,N.jsxs)(ve.A,{className:"fw-bold d-flex align-items-center gap-1",onClick:t,variant:"link",children:[(0,N.jsx)(ze.AiM,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})]})}),(0,N.jsx)(OC,{}),(0,N.jsx)(Ce.S,{className:"pb-2",children:(0,N.jsx)(Lr,{count:a,onChange:i,page:r,page_size:o})})]})]}),(0,N.jsx)(gw,{url:"/marketplace/hied/ai"})]})})};var wC=e=>(0,N.jsx)(Ce.S,{className:"storefront-banner",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)(Qe.A,{className:"d-none d-lg-flex position-relative",children:[(0,N.jsx)(Ve.A,{className:"p-5 position-relative d-flex align-items-center",lg:6,style:{zIndex:1},children:(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably for Higher Ed",id:"label.welcome_to_solvably_for_higher_ed.fb2be66c"})})}),(0,N.jsxs)(Ve.A,{className:"p-5 position-relative text-white",lg:6,style:{zIndex:1},children:[(0,N.jsx)("h2",{className:"text-white fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"Infuse college-to-career with problem solving",id:"label.infuse_college_to_career_with_prob.8ee5d4a0"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Higher Education is at a pivotal moment in time as colleges and universities experience a sea change in learning needs and teaching approaches, brought on by advances in technology, student demands for engagement, and a pronounced shift in required skills in the workforce.",id:"label.higher_education_is_at_a_pivotal_m.8710a2a3"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"College students are now laser-focused on a future workforce that is increasingly dictating the jobs that will be overtaken by new technology and the skills they will need to prepare them for any and all challenges they'll face on the job.",id:"label.college_students_are_now_laser_foc.692c9fc1"})})]}),(0,N.jsx)("div",{className:"marketplace-overlay"})]}),(0,N.jsxs)(W_.A,{className:"d-block d-lg-none p-3",controls:!1,children:[(0,N.jsxs)(W_.A.Item,{children:[(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably for Higher Ed",id:"label.welcome_to_solvably_for_higher_ed.fb2be66c"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"College students are now laser-focused on a future workforce that is increasingly dictating the jobs that will be overtaken by new technology and the skills they will need to prepare them for any and all challenges they'll face on the job.",id:"label.college_students_are_now_laser_foc.692c9fc1"})})]}),(0,N.jsxs)(W_.A.Item,{children:[(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Infuse college-to-career with problem solving",id:"label.infuse_college_to_career_with_prob.8ee5d4a0"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Higher Education is at a pivotal moment in time as colleges and universities experience a sea change in learning needs and teaching approaches, brought on by advances in technology, student demands for engagement, and a pronounced shift in required skills in the workforce.",id:"label.higher_education_is_at_a_pivotal_m.8710a2a3"})})]})]})]})});var NC=e=>{const{launchDemoDialog:s}=AC(),{count:a,handleBack:t,handleChangePage:i,loading:l,mode:n,page:r,page_size:o,searching:d}=EC();return(0,N.jsx)(Ue.A,{fluid:!0,className:"p-0 marketplace-k12 storefront k12 d-flex flex-column flex-fill",children:(0,N.jsxs)(Me.x_,{flexFill:!0,loading:l,children:[(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(SC,{}),(0,N.jsx)(HC,{}),(0,N.jsx)(LC,{ownerFilter:!1}),0==n&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(RC,{}),(0,N.jsxs)(Ce.S,{"aria-hidden":!0,className:"coe-or-text text-center mb-5",children:[(0,N.jsx)("hr",{}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"or",id:"label.or.7175517a"})}),(0,N.jsx)("hr",{})]}),(0,N.jsx)(Ce.S,{className:"section-author pt-5 mt-3",children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column mt-4",lg:7,children:[(0,N.jsx)("h2",{children:(0,N.jsx)(ke.A,{defaultMessage:"Customize your own learning",id:"label.customize_your_own_learning.940f7b77"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create, edit and customize your own scalable Solvably challenges or library of challenges with our easy-to-use {designLab} authoring tool.",id:"label.create_edit_and_customize_your_own.f40d6acb",values:{designLab:(0,N.jsx)("em",{children:"Design Lab"})}})}),(0,N.jsx)(Ce.S,{className:"mt-3 btn-create-challenge",children:(0,N.jsx)(ve.A,{onClick:s,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a Challenge",id:"label.create_a_challenge.9bc9d341"})})})]}),(0,N.jsx)(Ve.A,{className:"col-img d-flex justify-content-center py-2",lg:5,children:(0,N.jsx)(Zs.A,{className:"design-lab-img align-middle ml-n5",src:MS})})]})})}),(0,N.jsx)(Ce.S,{className:"section-prepare p-0 pt-5",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)("h2",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Prepare for the future of learning",id:"label.prepare_for_the_future_of_learning.44ec3bbe"})})}),(0,N.jsx)(Ve.A,{md:{offset:1,span:10},children:(0,N.jsx)("p",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably fills the void of existing learning programs with:",id:"label.solvably_fills_the_void_of_existin.75ef0a6d"})})})]}),(0,N.jsx)(Ce.S,{className:"d-block d-md-none d-flex justify-content-center text-center",children:(0,N.jsxs)(W_.A,{children:[(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;Scaffolded, scalable framework",className:"prepare-img-mobile",src:dw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"Longitudinal efficacy tracking and reporting",className:"prepare-img-mobile",src:cw})}),(0,N.jsx)(W_.A.Item,{children:(0,N.jsx)(Zs.A,{alt:"360 degree competency evaluations",className:"prepare-img-mobile",src:hw})})]})})]})}),(0,N.jsx)(Ce.S,{className:"section-prepare",children:(0,N.jsx)(Ue.A,{fluid:!0,children:(0,N.jsx)(Qe.A,{className:"d-none d-sm-none d-md-block",children:(0,N.jsx)(Ve.A,{className:"d-flex justify-content-center text-center",md:12,children:(0,N.jsx)(Zs.A,{alt:"True remote and blended, collaborative experiences;Facilitator administration;360 degree competency evaluations;Longitudinal efficacy tracking and reporting;Scaffolded, scalable framwork",className:"prepare-img",src:kS,style:{maxWidth:"1200px"}})})})})}),(0,N.jsx)(Ce.S,{className:"section-get-started py-5",children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{className:"px-2",children:(0,N.jsxs)(Ve.A,{className:"get-started-card d-flex flex-column justify-content-center text-center",md:12,children:[(0,N.jsx)("h2",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Get started today!",id:"label.get_started_today.dfc3d54d"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Take your Talent Management to a new level with Solvably TALENT. Contact us today to schedule a demo.",id:"label.take_your_talent_management_to_a_
2n.6abdda78"})}),(0,N.jsx)(ve.A,{className:"btn-asymmetric mx-auto",onClick:s,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Request demo",id:"label.request_demo.915b64b6"})})]})})})})]}),1==n&&(0,N.jsxs)(Ce.S,{children:[d&&(0,N.jsx)(Ce.S,{className:"text-center mt-5",children:(0,N.jsx)(Me.y$,{})}),!d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ue.A,{className:"pt-4",children:(0,N.jsxs)(ve.A,{className:"fw-bold d-flex align-items-center gap-1",onClick:t,variant:"link",children:[(0,N.jsx)(ze.AiM,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})]})}),(0,N.jsx)(OC,{}),(0,N.jsx)(Ce.S,{className:"pb-2",children:(0,N.jsx)(Lr,{count:a,onChange:i,page:r,page_size:o})})]})]})]}),(0,N.jsx)(gw,{url:"/marketplace/k-12/ai"})]})})};var SC=e=>{const{launchDemoDialog:s}=AC(),a=()=>setTimeout(()=>{var e,s,a,t;return null===(e=document)||void 0===e||null===(s=e.getElementById)||void 0===s||null===(a=s.call(e,"marketplace-search-bar"))||void 0===a||null===(t=a.focus)||void 0===t?void 0:t.call(a)},100);return(0,N.jsx)(Ce.S,{className:"storefront-banner",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)(Qe.A,{className:"d-none d-lg-flex position-relative",children:[(0,N.jsxs)(Ve.A,{className:"p-5 position-relative d-flex flex-column justify-content-between",lg:6,style:{zIndex:1},children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably K-12",id:"label.welcome_to_solvably_k_12.87765736"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"The world's first standards-aligned, collaborative, creative problem-solving experience that develops 21st century workforce readiness competencies.",id:"label.the_worlds_first_standards_aligned.20a78f48"})})]}),(0,N.jsx)(ve.A,{className:"find-challenge d-block align-self-start",onClick:a,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Find a Challenge",id:"label.find_a_challenge.5d38073f"})})]}),(0,N.jsxs)(Ve.A,{className:"p-5 position-relative d-flex flex-column justify-content-between",lg:6,style:{zIndex:1},children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Create your own Challenge",id:"label.create_your_own_challenge.2d553024"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Author and deploy your very own standards-aligned Solvably challenge in minutes with our easy-to-use challenge creation tool.",id:"label.author_and_deploy_your_very_own_st.93fa8275"})})]}),(0,N.jsx)(ve.A,{className:"create-challenge align-self-start",onClick:s,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a Challenge",id:"label.create_a_challenge.9bc9d341"})})]}),(0,N.jsx)("div",{className:"marketplace-overlay"})]}),(0,N.jsxs)(W_.A,{className:"d-block d-lg-none p-3",controls:!1,children:[(0,N.jsxs)(W_.A.Item,{children:[(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to Solvably K-12",id:"label.welcome_to_solvably_k_12.87765736"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"The world's first standards-aligned, collaborative, creative problem-solving experience that develops 21st century workforce readiness competencies.",id:"label.the_worlds_first_standards_aligned.20a78f48"})}),(0,N.jsx)(ve.A,{className:"find-challenge d-block mb-3",onClick:a,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Find a Challenge",id:"label.find_a_challenge.5d38073f"})})]}),(0,N.jsxs)(W_.A.Item,{children:[(0,N.jsx)("h2",{className:"fw-bold text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Create your own Challenge",id:"label.create_your_own_challenge.2d553024"})}),(0,N.jsx)("p",{className:"text-white",children:(0,N.jsx)(ke.A,{defaultMessage:"Author and deploy your very own standards-aligned Solvably challenge in minutes with our easy-to-use challenge creation tool.",id:"label.author_and_deploy_your_very_own_st.93fa8275"})}),(0,N.jsx)(ve.A,{className:"create-challenge mb-3",onClick:s,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a Challenge",id:"label.create_a_challenge.9bc9d341"})})]})]})]})})};
2var CC=e=>{const{getCartCurrencySymbol:s,getFormattedPrice:a,item_types:t}=hN(),i=Object.values(t||{}),l={cartridge:Ec,challenge:Ic,journey:Fc},n=e=>["cartridge","journey"].includes(e),r=e=>{let{name:s}=e;return"cartridge"===s?"third party":s};return(0,N.jsxs)(Ce.S,{className:"marketplace-pricing d-flex flex-column pb-5 gap-1 gap-lg-5 flex-fill",children:[(0,N.jsx)(Ce.S,{className:"pricing-banner d-flex align-items-center justify-content-center p-5 p-lg-4",children:(0,N.jsx)("p",{className:"display-4 fw-bold mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably content pricing",id:"label.solvably_content_pricing.3a6b40e6"})})}),(0,N.jsxs)(Ue.A,{className:"flex-fill pt-3 pt-lg-5 d-flex flex-column gap-5",children:[(0,N.jsxs)(Ce.S,{className:"p-3 bg-light rounded",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably pricing",id:"label.solvably_pricing.7d56f294"})}),(0,N.jsxs)("ul",{children:[(0,N.jsxs)("li",{children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Per learner, per challenge:",id:"label.per_learner_per_challenge.60e5fe53"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Pricing is based on each learner's participation in a single specific challenge.",id:"label.pricing_is_based_on_each_learners.c9b68e6d"})})]}),(0,N.jsxs)("li",{children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team requirement:",id:"label.team_requirement.afd58e9f"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"A minimum number of seats is required for each challenge due to its collaborative nature.",id:"label.a_minimum_number_of_seats_is_requi.aa293bbf"})})]}),(0,N.jsxs)("li",{children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team setup:",id:"label.team_setup.727401c1"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Purchasers can set up their teams after completing the transaction.",id:"label.purchasers_can_set_up_their_teams.40438bd6"})})]}),(0,N.jsxs)("li",{children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Non-refundable:",id:"label.non_refundable.8e3109cc"})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"All fees are final and n
2on-refundable.",id:"label.all_fees_are_final_and_non_refunda.38199995"})})]})]}),(0,N.jsx)("span",{className:"d-flex gap-1",children:(0,N.jsx)(ke.A,{defaultMessage:"For any questions, please contact us.",id:"label.for_any_questions_please_contact_u.3e2cf789"})})]}),(0,N.jsx)(Qe.A,{className:"m-0 d-flex flex-column flex-lg-row gap-3 gap-lg-0 py-lg-5",children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map((e,t)=>(0,N.jsxs)(Ve.A,{className:"card-container "+(n(e.name)?"coming-soon":""),lg:12/((null===i||void 0===i?void 0:i.length)||1),xs:12,children:[(0,N.jsxs)(Ge.A,{className:""+(n(e.name)?"":"box-shadow-close-100"),children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)(Ge.A.Img,{alt:`${r(e)} icon`,className:"d-flex flex-column align-items-center justify-content-center",src:null===l||void 0===l?void 0:l[null===e||void 0===e?void 0:e.name],style:{height:100},variant:"top"})}),(0,N.jsxs)(Ge.A.Body,{className:"pb-3 d-flex flex-column  gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center justify-content-center",children:[(0,N.jsx)(Ge.A.Title,{as:"h3",className:"text-capitalize fw-semibold",children:r(e)}),(0,N.jsxs)(Ce.S,{className:"price d-flex gap-1 align-items-baseline",children:[(0,N.jsx)("h1",{className:"text-primary",children:n(e.name)?(0,N.jsx)(N.Fragment,{children:"\u2014"}):(0,N.jsxs)(N.Fragment,{children:[s(),a(e.price,0)]})}),(0,N.jsx)("span",{className:"fw-semibold text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"/ seat",id:"label.seat.864ca978"})})]}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Minimum order of {count} seats required to get started.",id:"label.minimum_order_of_count_seats_requi.3fdac04f",values:{count:(0,N.jsx)("strong",{children:n(e.name)?"\u2014\u2014\u2014":e.min})}})}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Contact us for orders over {count} seats.",id:"label.contact_us_for_orders_over_count_s.20aa9e35",values:{count:(0,N.jsx)("strong",{children:n(e.name)?"\u2014\u2014\u2014":e.max})}})})]}),(0,N.jsx)(Le.Link,{className:"btn btn-primary btn-asymmetric flex-fill flex-lg-grow-0 d-lg-none",to:"/marketplace/talent",children:(0,N.jsx)(ke.A,{defaultMessage:"Get started",id:"label.get_started.61e8d44a"})})]})]}),!!n(e.name)&&(0,N.jsx)("h2",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Coming soon",id:"label.coming_soon.4f7d6401"})})]},t))}):(0,N.jsx)(MC,{})}),(0,N.jsx)(Ce.S,{className:"d-none d-lg-flex justify-content-center p-lg-3",children:(0,N.jsx)(Le.Link,{className:"btn btn-primary btn-asymmetric btn-xl flex-fill flex-lg-grow-0",to:"/marketplace/talent",children:(0,N.jsx)(ke.A,{defaultMessage:"Get started",id:"label.get_started.61e8d44a"})})})]})]})};var MC=e=>(0,N.jsxs)(Rh.A,{animation:"wave",as:Qe.A,className:"pricing-cards-placeholder d-flex flex-column flex-lg-row gap-3 gap-lg-0 m-0",children:[(0,N.jsx)(Ve.A,{className:"placeholder-col d-flex",lg:4,xs:12,children:(0,N.jsx)(Rh.A,{as:Ge.A,bg:"primary",className:"flex-fill",xs:12})}),(0,N.jsx)(Ve.A,{className:"placeholder-col d-flex",lg:4,xs:12,children:(0,N.jsx)(Rh.A,{as:Ge.A,bg:"primary",className:"flex-fill",xs:12})}),(0,N.jsx)(Ve.A,{className:"placeholder-col d-flex",lg:4,xs:12,children:(0,N.jsx)(Rh.A,{as:Ge.A,bg:"primary",className:"flex-fill",xs:12})})]}),kC={hied:yC,"k-12":NC,pricing:CC,talent:BS};var zC=s=>{const{children:a}=s,{api:t}=(0,P.nm)(),{coe:i,storefront:n}=AC(),r=(0,Pe.W6)(),o={hied:2,"k-12":1},[d,c]=(0,ne.CQ)({audiences:null,components:null,components_count:0,count:0,error:null,loading:!0,mode:0,page:1,page_size:20,search_params:{},searching:!1,standards_count:0,subjects:null,subjects_count:0,subtopics:null,topics:null}),{audiences:h,components:u,components_count:m,count:g,error:p,loading:x,mode:v,page:f,page_size:j,searching:_,standards_count:b,subjects:A,subjects_count:y,topics:w}=d,S=e=>c({mode:e}),C=async()=>{const{used_subjects:e}=await t.get("/api/marketplace/list/used-subjects/",{filter_audience_category_slug:n});c({subjects:e})},M=async()=>{const{audiences:e}
2=await t.get("/api/marketplace/list/audiences/");c({audiences:e})},k=async()=>{const{topics:e}=await t.get("/api/marketplace/list/topics/");c({topics:e})},z=async()=>{const{subtopics:e}=await t.get("/api/marketplace/list/subtopics/");c({subtopics:e})},T=async()=>{const{entries_count:e}=await t.get("/api/marketplace/count/standard-entries/");c({standards_count:e})},I=async()=>{const{subjects_count:e}=await t.get("/api/marketplace/count/subjects/");c({subjects_count:e})},E=async()=>{const{count:e}=await t.get("/api/marketplace/count/challenges/");c({components_count:e})},R=async function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;try{const e={mode:1,page:a||1,searching:!0};a||(e.search_params=s),c(e);const{page:i,page_size:l,search_params:r}=d,{components:h,count:u}=await t.post(`/api/marketplace/components/search/${i}/${l}`,(0,F.A)((0,F.A)({},r),{},{selected_audience_category_ids:[null===o||void 0===o?void 0:o[n]]}));c({components:h,count:u,searching:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,searching:null})}};(0,l.useEffect)(()=>{Promise.all([C(),M(),k(),z(),T(),I(),E()]).then(()=>{if(c({loading:!1}),i){var e,s;const a=null===d||void 0===d||null===(e=d.subjects)||void 0===e||null===(s=e.find)||void 0===s?void 0:s.call(e,e=>(null===e||void 0===e?void 0:e.slug)===i);R({selected_subject_ids:[null===a||void 0===a?void 0:a.id]})}}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})})},[]);const D={audiences:h,components:u,components_count:m,count:g,error:p,fetchUsedSubjects:C,handleBack:()=>{r.push(`/marketplace/${n}`),S(0)},handleChangePage:e=>R({},e),handleSearch:R,handleSubjectSearch:e=>{let s=A.find(s=>s.id==e),a=(null===s||void 0===s?void 0:s.slug)||"";r.push(`/marketplace/${n}/${a}`),R({selected_subject_ids:[e]})},loading:x,mode:v,page:f,page_size:j,searching:_,setMode:S,standards_count:b,subjects:A,subjects_count:y,topics:w};return(0,N.jsxs)(IC,{value:D,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:p,variant:"danger",children:p}),a]})};const TC=l.createContext({}),IC=TC.Provider;TC.Consumer;TC.displayName="SearchableStorefrontContext";const EC=()=>(0,l.useContext)(TC);var FC=t(68203);var RC=e=>{const{subjects:s}=EC();return(0,N.jsx)(Ce.S,{className:"marketplace-search-subjects",style:{minWidth:"100%"},children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)("h3",{className:"my-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Centers of Excellence",id:"label.centers_of_excellence.f138c544"})}),(0,N.jsx)(Ue.A,{fluid:!0,className:"mb-5",children:(0,N.jsx)(FC.A,(0,F.A)((0,F.A)({},{dots:!1,infinite:!1,initialSlide:0,responsive:[{breakpoint:1025,settings:{dots:!0,infinite:!0,slidesToScroll:3,slidesToShow:3}},{breakpoint:600,settings:{initialSlide:2,slidesToScroll:2,slidesToShow:2}},{breakpoint:480,settings:{slidesToScroll:1,slidesToShow:1}}],slidesToScroll:1,slidesToShow:6,style:{width:"100%"}}),{},{children:!(null===s||void 0===s||!s.length)&&s.map((e,s)=>(0,N.jsx)(jC,{subject:e},s))}))})]})})},DC=t(66511);const BC=e=>{let{children:s,eventKey:a}=e;const[t,i]=(0,l.useState)(0===a),n=t?"expanded":"",r=(0,DC.M)(a,()=>{i(!t)});return(0,N.jsx)(ve.A,{className:n,onClick:r,style:{padding:0},variant:"link",children:s})},PC=e=>{const{defaults:s,filter_audience_category_slug:a,noFormatting:t,size:i}=e,{api:n,isLoggedIn:r}=(0,P.nm)(),{formatMessage:o}=(0,ja.A)(),{handleSearch:d}=EC(),[c,h]=(0,ne.CQ)({audiences:[],deliverables:[],est_time_max:"",est_time_min:"",loading:!0,organization_id:null,search_term:"",selected_audience_ids:[],selected_standards_category_ids:[],selected_standards_entry_ids:[],selected_subject_ids:[],selected_subtopic_ids:[],selected_topic_ids:[],subjects:[],subtopics:[],topics:[]});let{audiences:u,deliverables:m,est_time_max:g,est_time_min:p,loading:x,organization_id:v,search_term:f,selected_audience_ids:j,selected_subject_ids:_,selected_subtopic_ids:b,selected_topic_ids:A,subjects:y,subtopics:w,topics:S}=c;const C=(0,l.useRef)(),M=async()=>{const e=v||"",{used_subjects:s}=await n.get(`/api/marketplace/list/used-subjects/${e}`,{filter_audience_category_slug:a});h({subjects:s}
2)},k=async()=>{const{audiences:e}=await n.get("/api/marketplace/list/audiences/");h({audiences:e})},z=async()=>{const{topics:e}=await n.get("/api/marketplace/list/topics/");h({topics:e})},T=async()=>{const{subtopics:e}=await n.get("/api/marketplace/list/subtopics/");h({subtopics:e})},I=(e,s)=>{let a=c[e];return a=Array.isArray(a)?a:[],-1!==a.indexOf(s)},E=e=>{var s;null===e||void 0===e||null===(s=e.preventDefault)||void 0===s||s.call(e),d({deliv:m&&m.length?m:void 0,max:g||void 0,min:p||void 0,organization_id:v,search_term:f||void 0,selected_audience_ids:j&&j.length?j:void 0,selected_subject_ids:_&&_.length?_:void 0,selected_subtopic_ids:b&&b.length?b:void 0,selected_topic_ids:A&&A.length?A:void 0})},F=async()=>{const{organizations:e}=await n.get("/api/organizations/ids-name");h({organizations:e})};(0,l.useEffect)(()=>{if(s){let{deliv:e,grades:a,max:t,min:i,search:l,subjects:n,subtopics:r,topics:o}=s;h(s=>(l&&(s.search_term=l),n&&(s.selected_subject_ids=n),a&&(s.selected_audience_ids=a),o&&(s.selected_topic_ids=o),r&&(s.selected_subtopic_ids=o),i&&(s.est_time_min=i),t&&(s.est_time_max=t),e&&(s.deliverables=e),s))}h({loading:!0}),Promise.all([M(),k(),z(),T(),r&&F()]).then(()=>{h({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:s,loading:!1})})},[]);const R=["Video","Storyboard","Visual","Audio","File","Slideshow"],D=null!==_&&void 0!==_&&_.length?"primary":"secondary",B=null!==A&&void 0!==A&&A.length?"primary":"secondary",L=null!==j&&void 0!==j&&j.length?"primary":"secondary",O=p||g?"primary":"secondary";return(0,N.jsx)(Ce.S,{className:`challenge-search challenge-search-${i} ${t?"":" challenge-search-full"}`,children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(_e.A,{onSubmit:E,role:"search",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:5,xs:12,children:(0,N.jsxs)(Ei.A,{className:"search-container",children:[(0,N.jsx)(be.A,{"aria-label":o({id:"label.title.7e8cd205",defaultMessage:"Title"}),className:"form-control",disabled:x,id:"marketplace-search-bar",name:"search",onChange:e=>h({search_term:e.target.value}),placeholder:o({id:"label.title.7e8cd205",defaultMessage:"Title"}),readOnly:x,ref:C,type:"search",value:f}),(0,N.jsx)(ve.A,{"aria-label":o({id:"label.search_challenges.37a3da6e",defaultMessage:"Search challenges"}),disabled:x,type:"submit",variant:"primary",children:(0,N.jsx)(ze.KSO,{style:{color:"white",marginLeft:"5px"}})})]})}),(0,N.jsxs)(Ve.A,{className:"filters",lg:7,xs:12,children:[(0,N.jsxs)(li.A,{className:"challenge-filter me-3",children:[(0,N.jsxs)(li.A.Toggle,{disabled:x,size:i,variant:D,children:[(0,N.jsx)(ke.A,{defaultMessage:"Subject",id:"label.subject.68971283"})," ",_&&_.length?(0,N.jsxs)("span",{children:["(",_.length,")"]}):""]}),(0,N.jsx)(li.A.Menu,{children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsxs)(yl.A,{style:{maxHeight:300,overflowY:"auto"},children:[y&&y.map((e,s)=>{let{id:a,name:t}=e;const i=I("selected_subject_ids",a);return(0,N.jsx)(yl.A.Item,{variant:i?"primary":"",onClick:e=>{i?_.splice(_.indexOf(a),1):_.push(a),h({selected_subject_ids:_},E)},children:(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":t,checked:i,label:t})},s)}),y&&0===y.length&&(0,N.jsx)("span",{className:"p-3",children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects found.",id:"label.no_subjects_found.9d06f935"})})]})})})]}),(0,N.jsxs)(li.A,{className:"challenge-filter me-3",children:[(0,N.jsxs)(li.A.Toggle,{disabled:x,size:i,variant:L,children:[(0,N.jsx)(ke.A,{defaultMessage:"Grade",id:"label.grade.839e20fb"})," ",j.length?(0,N.jsxs)("span",{children:["(",j.length,")"]}):""]}),(0,N.jsx)(li.A.Menu,{children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(yl.A,{style:{maxHeight:300,overflowY:"auto"},children:(null===u||void 0===u?void 0:u.length)&&u.map((e,s)=>{let{id:t,category:i,name:l}=e;if(i!=a)return(0,N.jsx)(N.Fragment,{});const n=I("selected_audience_ids",t);return(0,N.jsx)(yl.A.Item,{variant:n?"primary":"",onClick:e=>{n?j.splice(j.indexOf(t),1):j.push(t),h({selected_audience_ids:j},d)},children:(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":l,checked:n,label:l})},s)})})})})]}),(0,N.jsxs)(li.A,{className:"challenge-filter me-3",children:[(0,N.jsxs)(li.A.Toggle,{disabled:x,size:i,variant:B,children:[(0,N.jsx)(ke.A,{defaultMessage:"Topic",id:"label.topic.7e61847d"})," ",A.length?(0,N.jsxs)("span",{children:["(",A.length,")"]}):""]}),(0,N.jsx)(li.A.Menu,{style:{minWidth:250},children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(yl.A,{style:{maxHeight:300,overflowY:"auto"},children:(null===S||void 0===S?void 0:S.length)&&S.map((e,s)=>{let{id:a,name:t}=e;const i=I("selected_topic_ids",a);return(0,N.jsx)(yl.A.Item,{variant:i?"primary":"",onClick:e=>
2{i?A.splice(A.indexOf(a),1):A.push(a),h({selected_topic_ids:A},d)},children:(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":t,checked:i,label:t})},s)})})})})]}),(0,N.jsxs)(li.A,{className:"challenge-filter me-3",children:[(0,N.jsx)(li.A.Toggle,{disabled:x,size:i,variant:O,children:(0,N.jsx)(ke.A,{defaultMessage:"Time",id:"label.time.33b93476"})}),(0,N.jsx)(li.A.Menu,{children:(0,N.jsx)(Ce.S,{className:"form-inline",children:(0,N.jsxs)(Ce.S,{className:"d-flex p-2",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Control,{"aria-label":o({id:"label.minimum_estimated_time_in_minutes.144c7578",defaultMessage:"Minimum estimated time in minutes"}),as:"select",name:"est_time_min",value:c.est_time_min,onChange:e=>{h({est_time_min:e.target.value},d)},children:[(0,N.jsx)("option",{value:"",children:o({id:"label.min.dea79332",defaultMessage:"Min"})}),(0,N.jsx)("option",{value:30,children:"30"}),(0,N.jsx)("option",{value:60,children:"60"}),(0,N.jsx)("option",{value:90,children:"90"}),(0,N.jsx)("option",{value:120,children:"120"}),(0,N.jsx)("option",{value:180,children:"180"})]})}),(0,N.jsx)(Ce.S,{className:"p-1",children:"-"}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Control,{"aria-label":o({id:"label.maximum_estimated_time_in_minutes.d7b70e4a",defaultMessage:"Maximum estimated time in minutes"}),as:"select",name:"est_time_max",value:g,onChange:e=>{h({est_time_max:e.target.value},d)},children:[(0,N.jsx)("option",{value:"",children:o({id:"label.max.a1a5936d",defaultMessage:"Max"})}),(0,N.jsx)("option",{value:30,children:"30"}),(0,N.jsx)("option",{value:60,children:"60"}),(0,N.jsx)("option",{value:90,children:"90"}),(0,N.jsx)("option",{value:120,children:"120"}),(0,N.jsx)("option",{value:180,children:"180"})]})}),(0,N.jsx)(Ce.S,{className:"p-2",children:(0,N.jsx)(ke.A,{defaultMessage:"mins",id:"label.mins.0c843ea5"})})]})})})]}),(0,N.jsxs)(li.A,{className:"challenge-filter me-3",drop:"down",children:[(0,N.jsx)(li.A.Toggle,{disabled:x,size:i,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"More",id:"label.more.d47d7cb0"})}),(0,N.jsx)(li.A.Menu,{alignRight:!0,className:"more-filter",children:(0,N.jsxs)(Gd.A,{defaultActiveKey:"0",children:[(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)(BC,{eventKey:"0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Subtopic",id:"label.subtopic.79a01754"})," ",b.length?(0,N.jsxs)("span",{children:["(",b.length,")"]}):""]})}),(0,N.jsx)(Gd.A.Collapse,{eventKey:"0",children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(yl.A,{style:{maxHeight:300,overflowY:"auto"},children:(null===w||void 0===w?void 0:w.length)&&w.map((e,s)=>{let{id:a,name:t}=e;const i=I("selected_subtopic_ids",a);return(0,N.jsx)(yl.A.Item,{variant:i?"primary":"",onClick:e=>{i?b.splice(b.indexOf(a),1):b.push(a),h({selected_subtopic_ids:b},d)},children:(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":t,checked:i,label:t})},s)})})})})]}),(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)(BC,{eventKey:"1",children:[(0,N.jsx)(ke.A,{defaultMessage:"Deliverable formats",id:"label.deliverable_formats.3b66a39f"})," ",m.length?(0,N.jsxs)("span",{children:["(",m.length,")"]}):""]})}),(0,N.jsx)(Gd.A.Collapse,{eventKey:"1",children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(yl.A,{style:{maxHeight:300,overflowY:"auto"},children:(null===R||void 0===R?void 0:R.length)>0&&R.map((e,s)=>{const a=Boolean(-1!==m.indexOf(e));return(0,N.jsx)(yl.A.Item,{variant:a?"primary":"",onClick:s=>{a?m.splice(m.indexOf(e),1):m.push(e),h({deliverables:m},d)},children:(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":e,checked:a,label:e})},s)})})})})]})]})})]})]})]})})})})};PC.defaultProps={defaults:{},filter_audience_category_slug:"k-12",size:"lg"};var LC=PC;var OC=e=>{const{isLoggedIn:s}=(0,P.nm)(),{launchDemoDialog:a,launchItemDetailsModal:t,shopping_enabled:i}=AC(),{components:l,count:n,page:r,page_size:o}=EC(),d=(r-1)*o+o<=n?(r-1)*o+o:n;return(0,N.jsx)(Ce.S,{className:"challenge-search challenge-search-lg challenge-search-full",style:{borderBottom:0,borderTop:0},children:(0,N.jsxs)(Ue.A,{className:"p-0",children:[(0,N.jsx)(Qe.A,{className:"search-results-counter mt-2",children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)(Ce.S,{className:"text-end text-muted",children:n>0?`Showing ${(r-1)*o+1} - ${d} of ${n} results`:"0 results"})})}),null!==l&&void 0!==l&&l.length?(0,N.jsx)(Qe.A,{children:l&&l.map((e,l)=>{let{cartridge_template_stub:n,challenge_template_stub:r,group_assignment_template_stub:o,type:d}=e;const c=r||n||o,h=null===c||void 0===c?void 0:c.current;return(0,N.jsx)(Ve.A,{lg:4,md:6,sm:6,style:{paddingBottom:30},xl:3,xs:12,children:i?(0,N.jsx)(pN,{component:h,component_type:d,onRequestInfo:a,onShowDetail
2s:t}):(0,N.jsx)(Kh,{component:h,onClick:s&&function(){t(d,h)},type:d})},l)})}):(0,N.jsx)(Ce.S,{className:"text-center text-secondary p-5",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"No matching challenges found.",id:"label.no_matching_challenges_found.91726c41"})})})]})})};var HC=e=>{const{components_count:s,standards_count:a,subjects_count:t}=EC();return(0,N.jsx)(Ce.S,{className:"marketplace-stat-counters",children:(0,N.jsx)(Ue.A,{className:"marketplace-stat-counter-container py-2",id:"marketplace-search",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"text-items heading text-center justify-content-end",style:{padding:"0 0 0 20px"},xs:4,children:[(0,N.jsx)("strong",{children:`${t}`}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Subjects",id:"label.subjects.1a7529ab"})})]}),(0,N.jsxs)(Ve.A,{className:"text-items center heading justify-content-center text-center",xs:4,children:[(0,N.jsx)("strong",{children:`${s}`}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})})]}),(0,N.jsxs)(Ve.A,{className:"text-items heading text-center justify-content-start",style:{padding:"0 20px 0 0"},xs:4,children:[(0,N.jsx)("strong",{children:(0,N.jsx)(Gh.Gr,{value:a})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Standards",id:"label.standards.b9a13629"})})]})]})})})},UC=t(65711);const QC=(0,l.createContext)({}),VC=QC.Provider,GC=(QC.Consumer,()=>(0,l.useContext)(QC));var WC=t(21496);const KC=(0,l.forwardRef)((s,a)=>{var t;const[i,n,r]=(0,ne.CQ)({all_achievements:[],error:null,loading:!0,saved:!1,visible:!1}),{all_achievements:o,loading:d,visible:c}=i,h=(0,l.useRef)(),u=(0,l.useRef)(),{api:m}=(0,P.nm)(),{loadPortfolioOverview:g,user:p}=GC(),{formatMessage:x}=(0,ja.A)(),{default_banner:v,getAchievementIcon:f}=(0,Be.hc)(),j=(null===p||void 0===p||null===(t=p.banner)||void 0===t?void 0:t.location)||v,_=async()=>{try{n({loading:!0});const{achievements:e}=await m.get("/api/users/profile/all/achievements");n({all_achievements:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},b=()=>{n({visible:!0},_)},A=()=>r();(0,l.useImperativeHandle)(a,()=>({hide:A,show:b,visible:c}));const y=o.map(e=>({label:(0,N.jsxs)("span",{children:[(0,N.jsx)("img",{alt:null===e||void 0===e?void 0:e.name,src:f(e.icon_token),style:{height:30,width:30}}),(0,N.jsx)("span",{style:{marginLeft:6},children:null===e||void 0===e?void 0:e.name})]}),value:null===e||void 0===e?void 0:e.user_achievements[0].id})),w={about_description:(null===p||void 0===p?void 0:p.about_description)||"",about_email:(null===p||void 0===p?void 0:p.about_email)||"",about_title:(null===p||void 0===p?void 0:p.about_title)||"",user_achievement_id:(null===p||void 0===p?void 0:p.user_achievement_id)||""};return(0,N.jsxs)(xe,{className:"edit-portfolio-modal",onHide:A,show:c,children:[(0,N.jsxs)(Me.x_,{loading:d,children:[(0,N.jsxs)("section",{className:"edit-banner-section",children:[(0,N.jsxs)(Ce.S,{className:"banner-container",children:[(0,N.jsx)(Zs.A,{fluid:!0,alt:`${(null===p||void 0===p?void 0:p.fullname)||""}'s banner'}`,className:"banner-image",src:j}),(0,N.jsx)("p",{className:"h3",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit details",id:"label.edit_details.fd9c61ac"})})]}),(0,N.jsxs)("div",{className:"icon-container",children:[(0,N.jsx)(Ya,{className:"portfolio-edit-avatar",showOnline:!1,size:110,user:p,withBorder:!0}),(0,N.jsxs)(li.A,{className:"position-absolute edit-portfolio-modal-dropdowns",style:{left:88,top:70,zIndex:2},children:[(0,N.jsx)(li.A.Toggle,{as:JC,size:"sm"}),(0,N.jsxs)(li.A.Menu,{className:"avatar-menu-dropdown",style:{transform:"none"},popperConfig:{modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}}]},children:[(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{const e=null===h||void 0===h?void 0:h.current;e&&e.promptImageUpload()},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload image",description:"",id:"label.upload_image.ffe4df6c"})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{as:"button",onClick:async()=>{try{if(!window.confirm(x({id:"label.are_you_sure_you_want_to_delete_yo.5b771463",defaultMessage:"Are you sure you want to delete your banner?"})))return;await m.post("/api/users/avatar/delete"),g()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},children:(0,N.jsx)(ke.A,{defaultMessage:"Delete image",description:"",id:"label.delete_image.fbbc98ee"})})]})]}),(0,N.jsxs)(li.A,{className:"banner-dropdown-toggle",children:[(0,N.jsx)(li.A.Toggle,{as:ZC,size:"sm"}),(0,N.jsxs)(li.A.Menu,{className:"banner-menu-dropdown",style:{transform:"none"},popperConfig:{modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}}]},children:[(0,N.jsx)(li.A.Item,{as:"button",onClick:()=>{const e=null===u||void 0===u?void 0:u.current;e&&e.promptImageUpload()},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload image",description:"",id:"label.upload_image.ffe4df6c"})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{as:"button",onClick:async()=>{try{if(!window.confirm(x({id:"label.are_you_sure_you_want_to_delete_yo.5b771463",defaultMessage:"Are you sure you want to delete your banner?"})))return;await m.post("/api/users/banner/delete"),g()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},children:(0,N.jsx)(ke.A,{defaultMessage:"Delete image",description:"",id:"label.delete_image.fbbc98ee"})})]})]})]})]}),(0,N.jsx)("section",{className:"edit-form-section h-100",children:(0,N.jsx)(ds.l1,{initialValues:w,onSubmit:async s=>{let{about_description:a,about_email:t,about_title:i,user_achievement_id:l}=s;try{n({loading:!0}),await m.post("/api/users/profile/set/info",{about_description:a,about_email:t,about_title:i,user_achievement_id:l}),g(!0),A()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},children:e=>{let{handleChange:s,handleSubmit:a,setFieldValue:t,values:i}=e;return(0,N.jsxs)(_e.A,{className:"d-flex flex-column justify-content-between h-100",onSubmit:a,children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:6,xs:12,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)("div",{className:"form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",description:"",id:"label.name.dcd1d522"})}),(0,N.jsx)(Le.Link,{to:"/profile",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit in Account Settings",description:"",id:"label.edit_in_account_settings.6bda6e6d"})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:"Title"}
2),(0,N.jsx)(_e.A.Control,{name:"about_title",onChange:s,type:"text",value:i.about_title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Badge",description:"",id:"label.badge.002474e3"})}),(0,N.jsx)(WC.Ay,{maxMenuHeight:250,name:"user_achievement_id",options:y,components:{IndicatorSeparator:()=>null},defaultValue:y.find(e=>e.value===i.user_achievement_id),onChange:e=>{t("user_achievement_id",e.value)}})]})]}),(0,N.jsxs)(Ve.A,{md:6,xs:12,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"About",description:"",id:"label.about.4efca0d1"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",name:"about_description",onChange:s,rows:4,type:"textarea",value:i.about_description})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Contact",description:"",id:"label.contact.2b5c3d26"})}),(0,N.jsx)(_e.A.Control,{name:"about_email",onChange:s,type:"email",value:i.about_email})]})]})]}),(0,N.jsxs)("div",{className:"form-buttons",children:[(0,N.jsx)(ve.A,{onClick:A,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",description:"",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Done",description:"",id:"label.done.11a6767d"})})]})]})}})})]}),(0,N.jsx)(TA,{aspectRatio:1,onComplete:g,ref:h,uploadHandler:async(s,a)=>{try{const{avatar:e}=await m.file("/api/users/avatar",{job_id:a},s,"image.jpg");return{file:e}}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}}}),(0,N.jsx)(TA,{aspectRatio:4,maxHeight:1920,maxWidth:1920,onComplete:g,ref:u,uploadHandler:async(s,a)=>{try{const{banner:e}=await m.file("/api/users/banner",{job_id:a},s,"image.jpg");return{file:e}}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}}})]})});KC.displayName="EditPortfolioModal";var YC=KC;const qC=(0,l.forwardRef)((e,s)=>{let{children:a,className:t,onClick:i}=e;return(0,N.jsxs)(ve.A,{className:"edit-photo-btn d-flex align-items-center justify-content-center",href:"",ref:s,onClick:e=>{e.preventDefault(),i(e)},children:[(0,N.jsx)("img",{className:"icon",src:fN}),a]})});qC.displayName="CustomEditAvatarToggle";var JC=qC;const XC=(0,l.forwardRef)((e,s)=>{let{children:a,className:t,onClick:i}=e;return(0,N.jsxs)(ve.A,{className:"edit-banner-btn d-flex align-items-center",href:"",ref:s,onClick:e=>{e.preventDefault(),i(e)},children:[(0,N.jsx)("img",{className:"icon",src:fN}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Edit banner",id:"label.edit_banner.7334ff79"})}),a]})});XC.displayName="CustomEditBannerToggle";var ZC=XC;const $C=[{id:1,c:"critical",levels:[{header_line:"A basic critical thinker...",stars:"\u2605\u2606\u2606\u2606",type:"Basic",values:["Shows a partially-developed or limited understanding of the problem and its importance; identifies a few specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).","Rarely, or with assistance, gathers information from sources on the challenge topic; sources are at times inaccurate or not trustworthy.","Contributes to the development of a partially-acceptable or unacceptable solution."]},{header_line:"An emerging critical thinker...",stars:"\u2605\u2605\u2606\u2606",type:"Emerging",values:["
2Shows an adequate understanding of the problem and its importance; identifies some specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).","With little assistance, gathers information from sources on the challenge topic; uses accurate, correct, credible, and trustworthy sources most of the time.","Contributes to the development of a reasonable, acceptable solution."]},{header_line:"A strong critical thinker...",stars:"\u2605\u2605\u2605\u2606",type:"Strong",values:["Shows a clear understanding of the problem and its importance; identifies many specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).","With no assistance, gathers information from sources on the challenge topic; uses accurate, correct, credible, and trustworthy sources.","Contributes to a clear, reasonable solution that is meaningful to the problem."]},{header_line:"An exemplary critical thinker...",stars:"\u2605\u2605\u2605\u2605",type:"Exemplary",values:["Shows an in-depth understanding of the problem and thoroughly and accurately identifies many specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).","Independently gathers relevant information from multiple sources on the challenge topic; gathers very accurate, correct, credible, and trustworthy sources.","Actively contributes and encourages others to develop a clear, reasonable solution that is meaningful to the problem."]}],name:"Critical Thinking"},{id:2,c:"communication",levels:[{header_line:"A basic communicator...",stars:"\u2605\u2606\u2606\u2606",type:"Basic",values:["Develops messages to communicate using digital media and environments, but the messages lack clarity, focus, and specificity.","Is sometimes positive, and inconsistently lets collaborators know that their opinions and ideas are valued. Delivers feedback, but sometimes comes across as lacking respect when attempting to be direct.","Inconsistently listens actively and attentively; demonstrates interest in the speaker\u2019s message, but does not provide verbal or nonverbal feedback to indicate that the message was received and to show understanding."]},{header_line:"An emerging communicator...",stars:"\u2605\u2605\u2606\u2606",type:"Emerging",values:["Develops clear, focused, concise, and specific messages when communicating using digital media and environments some of the time.","Is usually positive, and lets collaborators know that their opinions and ideas are valued most of the time. Delivers feedback in a manner that makes the recipients feel respected; can be direct, but shows care and respect most of the time.","Listens actively and attentively most of the time, demonstrates an interest in the speaker\u2019s message, and usually provides verbal or nonverbal feedback to indicate that the message was received and to show understanding."]},{header_line:"A strong communicator...",stars:"\u2605\u2605\u2605\u2606",type:"Strong",values:["Usually develops clear, focused, concise, and specific messages when communicating using digital media and environments.","Is usually positive and is beginning to express that collaborators\u2019 opinions and ideas are valued. Delivers feedback in a manner that makes the recipients feel respected; shows care and respect.","Listens actively and attentively, demonstrates an interest in the speaker\u2019s message, and provides verbal or nonverbal feedback to indicate that the message was received and to show understanding."]},{header_line:"An exemplary communicator...",stars:"\u2605\u2605\u2605\u2605",type:"Exemplary",values:["Consistently develops a clear, focused, and specific message when communicating using 21st century tools; both the sender and the receiver understand the same information as a result of the communication.","Consistently communicates positively and indicates that collaborators\u2019 opinions and ideas are valued. Consistently delivers feedback in a manner that makes the recipients feel respected.","Listens actively and attentively, demonstrates an interest in the speaker\u2019s message, and provides verbal or nonverbal feedback to indicate that the message was received; shows understanding."]}],name:"Communication"},{id:3,c:"collaboration",levels:[{header_line:"A basic collaborator...",stars:"\u2605\u2606\u2606\u2606",type:"Basic",values:["Rarely focuses on the task and what needs to be done. Lets others do the work. Seldom follows through on assigned tasks.","Shares ideas without listening or listens without sharing ideas.  Tends to dominate discussions.","Rarely makes compromises to accomplish a common goal. Has some difficulty getting along with other group members."]},{header_line:"An emerging collaborator...",stars:"\u2605\u2605\u2606\u2606",type:"Emerging",values:["Focuses on the task and what needs to be done some of the time. Other group members must sometimes remind this person to keep on task. Does not follow through on some assigned tasks.","Allows for equal participation by both sharing ideas and listening to the ideas of others.","Occasionally makes compromises to accomplish a common goal. Sometimes helps keep the group working well together."]},{header_line:"A strong collaborator...",stars:"\u2605\u2605\u2605\u2606",type:"Strong",values:["Focuses on the task and what needs to be done most of the time. Other group members can count on this person. Follows through on most assigned tasks.","Encourages equal participation by asking clarifying or probing questions, paraphrasing ideas, and synthesizing group thinking.","Usually makes necessary compromises to accomplish a common goal. Helps keep the group working well together."]},{header_line:"An exemplary collaborator...",stars:"\u2605\u2605\u2605\u2605",type:"Exemplary",values:["Consistently stays focused on the task and what needs to be done; very self-directed. Follows through on assigned tasks and does not depend on others to do the work.","Actively invites others to participate equitably, promoting divergent and creative perspectives. Helps direct the group in reaching consensus.","Consistently makes necessary compromises to accomplish a common goal. Always helps keep the group working well together."]}],name:"Collaboration"},{id:4,c:"creativity",levels:[{header_line:"A basic creative problem-solver...",stars:"\u2605\u2606\u2606\u2606",type:"Basic",values:["Communicates ideas to meet the challenge, but the volume is not sufficient to spark a creative process; ideas are somewhat connected to the challenge at hand.","Creates a product that has a vague or incomplete connection to the challenge or problem. Product is not considered to be useful or unique and is not considered to be creative. (May simply replicate an existing product.)","Sometimes perseveres when presented with challenges/setbacks."]},{header_line:"An emerging creative problem-solver...",stars:"\u2605\u2605\u2606\u2606",type:"Emerging",values:["Generates a sufficient volume of clear ideas to meet the challenge; ideas address the challenge and are sufficiently detailed to spark a creative process.","Uses ideas to create a product that is related to the challenge or problem. Product is considered to be somewhat valuable, unique, and creative.","Usually perseveres when presented with challenges/setbacks."]},{header_line:"A strong creative problem-solver...",stars:"\u2605\u2605\u2605\u2606",type:"Strong",values:["Generates many clear ideas to meet the challenge; ideas closely address the challenge and are well-detailed to spark a creative process.","Uses ideas to create a product that is related to the challenge or problem. Product is considered to be sufficiently valuable, unique, and creative.","Consistently perseveres when presented with challenges, shows resilience in situations in which failure is part of the experience, and shows confidence and an ability to take risks."]},{header_line:"An exemplary creative problem-solver...",stars:"\u2605\u2605\u2605\u2605",type:"Exemplary",values:["Takes an original, unique, and imaginative approach to idea generation; offers ideas that are broad in their diversity.","Uses ideas to create a product that is directly related to the challenge or problem. Product is considered to be valuable, unique, and creative.","Models resilience when confronted with production challenges/setbacks. Is confident and able to take calculated risks and adapt plans."]}],name:"Creativity"}];var eM=e=>{const s=(0,l.useRef)(),{achievements:a,is_owner:t}=GC(),{getAchievementIcon:i}=(0,Be.hc)();return(0,N.jsxs)(Ce.S,{className:"portfolio-achievements d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Achievements",id:"label.achievements.74cf2bc6"})}),t&&(0,N.jsx)(ve.A,{onClick:()=>{const e=null===s||void 0===s?void 0:s.current;e&&e.show()},variant:"quaternary",children:(0,N.jsx)(jr,{path:"pencil-edit/pencil-edit-2.svg",size:16})})]}),null!==a&&void 0!==a&&a.length?(0,N.jsx)(Qe.A,{children:a.map(e=>{let{id:s,alt:a,description:t,icon_token:l,name:n,published:r}=e;return(0,N.jsxs)(Ve.A,{className:"d-flex flex-column align-items-center mb-2",lg:2,md:3,xl:2,xs:4,children:[(0,N.jsx)(a
2M,{alt:a,description:t,height:65,iconSrc:i(l),id:s,name:n,width:65},s),(0,N.jsx)("h6",{className:"text-center",style:{marginTop:11},children:n})]},s)})}):(0,N.jsx)(Ce.S,{className:"text-center text-muted",children:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"No achievements to display",id:"label.no_achievements_to_display.69321a8f"})})}),(0,N.jsx)(iM,{ref:s})]})};const sM=e=>{const{id:s,alt:a,className:t,description:i,height:l,iconSrc:n,onSelect:r,selected:o,width:d}=e,c="function"===typeof r,h=()=>{if("function"!==typeof r)return null;r()},u=oa()({"toggle-icon":c},{"toggle-icon--selected":o});return(0,N.jsxs)("div",{className:`achievement ${t} `,onClick:h,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h())},role:"button",tabIndex:0,children:[(0,N.jsx)(Ua.A,{placement:"bottom",overlay:(0,N.jsx)(Qa.A,{id:s,children:(0,N.jsx)("div",{children:i})}),children:(0,N.jsx)(Zs.A,{alt:a,src:n,style:{height:l,width:d}})}),(0,N.jsx)("div",{className:u,children:o&&(0,N.jsx)("i",{className:"fa fa-check"})})]})};sM.defaultProps={id:123,alt:"",className:"",description:"",height:0,iconSrc:"",name:"",onSelect:null,selected:!1,width:0};var aM=sM;const tM=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),{getAchievementIcon:i}=(0,P.hc)(),{achievements:n,loadPortfolioAchievements:r}=GC(),[o,d,c]=(0,ne.CQ)({achievements:[],error:null,loading:!1,selected_achievement_ids:[],visible:!1}),{achievements:h,error:u,loading:m,selected_achievement_ids:g,visible:p}=o,x=async()=>{try{d({loading:!0});const{achievements:e}=await t.get("/api/users/profile/all/achievements");d({achievements:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}},v=()=>{d({selected_achievement_ids:n.map(e=>e.id),visible:!0},x)},f=()=>c();return(0,l.useImperativeHandle)(a,()=>({hide:f,show:v,visible:p})),(0,N.jsxs)(xe,{className:"portfolio-achievement-selection-modal portfolio-achievements",onHide:f,show:p,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select achievements",id:"label.select_achievements.2e08cb66"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:u,variant:"danger",children:u}),(0,N.jsxs)(Me.x_,{loading:m,children:[(0,N.jsx)(Qe.A,{className:"m-0",children:h.map(e=>(0,N.jsxs)(Ve.A,{className:"d-flex flex-column align-items-center",md:3,xl:2,xs:4,children:[(0,N.jsx)(aM,(0,F.A)((0,F.A)({},e),{},{alt:e.description,height:70,iconSrc:i(e.icon_token),width:70,onSelect:()=>{d(s=>{let a=s.selected_achievement_ids.indexOf(e.id);return-1==a?s.selected_achievement_ids.push(e.id):s.selected_achievement_ids.splice(a,1),s})},selected:-1!==g.indexOf(e.id)})),(0,N.jsx)("h6",{className:"text-center",style:{marginTop:11},children:null===e||void 0===e?void 0:e.name})]},e.id))}),!h||0==h.length&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No achievements found",id:"label.no_achievements_found.0842b3c3"})})})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:f,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{onClick:async()=>{try{d({loading:!0}),await t.post("/api/users/profile/set/achievements",{achievement_ids:null===o||void 0===o?void 0:o.selected_achievement_ids}),r(!0),f()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]})]})});tM.displayName="AchievementSelectionModal";var iM=tM;var lM=s=>{const{api:a}=(0,P.nm)(),{portfolio_token:t}=GC(),[i,n]=(0,ne.CQ)({certificates:[],error:null,loading:!0,page:1,page_size:10}),{certificates:r,loading:o}=i;return(0,l.useEffect)(()=>{(async()=>{try{n({loading:!0});const{page:e,page_size:s}=i,{certificates:l}=await a.get(`/api/users/profile/public/certificates/${e}/${s}`,{portfolio_token:t});n({certificates:l,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}})()},[]),(0,N.jsxs)(Ce.S,{className:"certificates d-flex flex-column gap-3",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Earned certificates",id:"label.earned_certificates.25330c61"})}),(0,N.jsx)(Me.x_,{loading:o,spinner:(0,N.jsx)(oM,{}),children:null!==r&&void 0!==r&&r.length?(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2,992:3},children:(0,N.jsx)(Ij.A,{gutter:16,children:!(null===r||void 0===r||!r.length)&&r.map((e,s)=>(0,N.jsx)(rM,{certificate:e},s))})}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center border rounded p-5",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No certificates found",id:"label.no_certificates_found.1
2a880827"})})})})]})};const nM=e=>{const{certificate:s}=e,{id:a,certification_template:t,created_at:i}=s||{},{title:n}=t||{},r=(0,l.useRef)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ge.A,{className:"certificate-card box-shadow-100 box-shadow-hover-200",onClick:()=>(e=>{const s=null===r||void 0===r?void 0:r.current;s&&s.show({certificate:e})})(s),role:"button",children:[(0,N.jsx)("div",{style:{borderBottom:"1px solid var(--gray-200)"},children:(0,N.jsx)(Su,{thumbnail:!0,certificate_id:a})}),(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)(Ge.A.Title,{children:n}),(0,N.jsx)(Ge.A.Subtitle,{className:"d-flex justify-content-between",children:(0,N.jsxs)("small",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{className:"text-muted",children:"Issued:"}),(0,N.jsx)("span",{children:(0,N.jsx)(Gh.XU,{value:i})})]})})]})]}),(0,N.jsx)(Au,{ref:r})]})};nM.defaultProps={certificate:{}};var rM=nM;var oM=e=>(0,N.jsx)(Rh.A,{animation:"wave",className:"portfolio-certificates-placeholder",children:(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2,992:3},children:(0,N.jsx)(Ij.A,{gutter:16,children:Array(3).fill().map((e,s)=>(0,N.jsxs)(Ce.S,{className:"w-100 d-flex flex-column gap-2",children:[(0,N.jsx)(Rh.A,{bg:"secondary",className:"w-100",style:{aspectRatio:1.4375,borderTopLeftRadius:4,borderTopRightRadius:4}}),(0,N.jsx)(Rh.A,{as:"h4",bg:"secondary",className:"rounded",size:"lg",xl:12}),(0,N.jsx)(Rh.A,{as:"strong",bg:"secondary",className:"rounded",xl:9})]},s))})})});var dM=e=>{const[s,a]=(0,ne.CQ)({loading:!0}),{loading:t}=s,{challenges:i,fetchPortfolioChallenges:n,is_owner:r}=GC(),o=(0,l.useRef)();return(0,l.useEffect)(()=>{(async()=>{a({loading:!0}),await n(),a({loading:!1})})()},[]),(0,N.jsxs)(Ce.S,{className:"portfolio-solutions d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge solutions",id:"label.challenge_solutions.7bfdb890"})}),!!r&&(0,N.jsx)(ve.A,{onClick:()=>{const e=null===o||void 0===o?void 0:o.current;e&&e.show()},variant:"quaternary",children:(0,N.jsx)(jr,{path:"pencil-edit/pencil-edit-2.svg",size:16})})]}),(0,N.jsx)(Me.x_,{loading:t,spinner:(0,N.jsx)(pM,{}),children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(Qe.A,{children:i.map((e,s)=>(0,N.jsx)(Ve.A,{className:"d-md-flex justify-content-md-around",lg:4,md:6,children:(0,N.jsx)(gM,{challenge:e})},e.id))}):(0,N.jsx)(Ce.S,{className:"text-center text-muted",children:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"No published challenges to display",id:"label.no_published_challenges_to_display.dfbb3f8c"})})})}),(0,N.jsx)(uM,{ref:o})]})};var cM=e=>{let{children:s,onSelect:a,selected:t}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("div",{className:"selectable-overlay "+(t?"selected":""),onClick:()=>"function"==typeof a&&a(!t),onKeyDown:e=>("Enter"==e.key||" "==e.key)&&"function"==typeof a&&a(!t),role:"button",tabIndex:0,children:s})})};const hM=(0,l.forwardRef)((s,a)=>{var t;const{api:i}=(0,P.nm)(),{challenges:n,fetchPortfolioChallenges:r}=GC(),[o,d,c]=(0,ne.CQ)({challenges:[],error:null,loading:!0,selected_challenge_ids:(null===n||void 0===n||null===(t=n.map)||void 0===t?void 0:t.call(n,e=>e.id))||[],visible:!1}),{challenges:h,error:u,loading:m,selected_challenge_ids:g,visible:p}=o,x=()=>{(async()=>{try{d({loading:!0});const{challenges:e}=await i.get("/api/users/profile/all/challenges/1/1000");d({challenges:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}})(),d({visible:!0})},v=()=>c();return(0,l.useImperativeHandle)(a,()=>({hide:v,show:x,visible:p})),(0,N.jsxs)(xe,{className:"portfolio-solution-selection-modal user-profile-root",onHide:v,show:p,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select solutions",id:"label.select_solutions.b683d896"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:u,variant:"danger",children:u}),(0,N.jsx)(Me.x_,{loading:m,children:(0,N.jsx)(Qe.A,{className:"solution-content-wrapper m-0",children:null!==h&&void 0!==h&&h.length?(0,N.jsx)(N.Fragment,{children:h.map(e=>(0,N.jsx)(Ve.A,{className:"d-md-flex justify-content-md-around",lg:4,md:6,xs:12,children:(0,N.jsx)(cM,{onSelect:()=>{d(s=>{let a=s.selected_challenge_ids.indexOf(e.id);return-1===a?s.selected_challenge_ids.push(e.id):s.selected_challenge_ids.splice(a,1),s})},selected:-1!==g.indexOf(e.id),children:(0,N.jsx)(gM,{canRedirect:!1,challenge:e})})},e.id))}):(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No completed challenges found",id:"label.no_completed_challenges_found.0cdd703b"})})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:v,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{onClick:async()=>{try{const{selected_challenge_ids:e}=o;d({loading:!0}),await i.post("/api/users/profile/set/challenges",{challenge_ids:e}),r(!0),v()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]})]})});hM.displaName="SolutionSelectionModal";var uM=hM;const mM=e=>{var s,a,t;const{canRedirect:i,challenge:n}=e,r=(0,l.useRef)(),{challenge_template:o,members:d,team:c}=n,{cover_path:h,title:u}=o,m=null===d||void 0===d||null===(s=d[0])||void 0===s?void 0:s.certification_request,g=null===n||void 0===n||null===(a=n.members)||void 0===a||null===(t=a[0])||void 0===t?void 0:t.group_member_assignment_component,p=(null===c||void 0===c?void 0:c.members)||[];let x=[];p&&p.length>0&&(x=p.map(e=>e.user));return(0,N.jsxs)(Ge.A,{className:"challenge-template-solution-card",children:[(0,N.jsxs)("a",{className:"text-decoration-none",href:"#",onClick:e=>{e.preventDefault();const s=null===r||void 0===r?void 0:r.current;if(!s)return;const{id:a,group_member_assignment_id:t}=g;s.show({group_member_assignment_component_id:a,group_member_assignment_id:t})},style:{color:"initial",pointerEvents:i?"auto":"none"},children:[(0,N.jsx)("div",{className:"challenge-template-image",style:{backgroundImage:`url(${h||pc})`}}),!!m&&(0,N.jsx)(_u,{certification_request:m}),(0,N.jsxs)("div",{className:"solution-content",children:[(0,N.jsx)("h5",{className:"challenge-template-team-title",children:null===c||void 0===c?void 0:c.name}),(0,N.jsx)("div",{className:"sc-title",children:(0,N.jsx)(El,{ellipsis:"...",lines:1,children:u})}),(0,N.jsx)("div",{className:"sc-subject-container d-flex justify-content-start align-items-center mt-3",children:(0,N.jsx)(tn,{className:"challenge-template-team-lane",offset:-12,size:24,users:x})})]})]}),(0,N.jsx)(r_,{is_admin:!1,ref:r})]})};mM.defaultProps={canRedirect:!0,challenge:{},show_certified:!1};var gM=mM;var pM=e=>(0,N.jsx)(Rh.A,{animation:"wave",as:Qe.A,className:"portfolio-solutions-placeholder",children:Array(3).fill().map((e,s)=>(0,N.jsx)(Ve.A,{className:"d-md-flex justify-content-md-around",lg:4,md:6,children:(0,N.jsxs)(Ge.A,{className:"challenge-template-solution-card",children:[(0,N.jsx)(Rh.A,{bg:"secondary",className:"card-img",style:{borderBottomLeftRadius:0,borderBottomRightRadius:0,height:110}}),(0,N.jsxs)(Ge.A.Body,{className:"solution-content",children:[(0,N.jsx)(Rh.A,{as:"h5",bg:"secondary",xs:9}),(0,N.jsx)(Rh.A,{as:"p",bg:"secondary",xs:7}),(0,N.jsx)("br",{}),(0,N.jsx)(Rh.A,{as:"h3",bg:"secondary",className:"rounded-circle",xs:2})]})]})},s))}),xM=t(59462),vM=t(36495);var fM=e=>{const{four_c_avg_scores:s,getCompetencyRating:a,is_owner:t,stats:i,user:n}=GC(),{total_challenges:r=0,total_collaborators:o=0,total_time_seconds:d=0}=i,{published_competencies:c}=n,{styles:h}=(0,P.nm)(),u=null===h||void 0===h?void 0:h.primary,m=(0,l.useRef)(),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const s=null===m||void 0===m?void 0:m.current;s&&s.show(e)},p=(0,N.jsx)(jr,{path:"pencil-edit/pencil-edit-2.svg",size:16}),x=(()=>{const e=null===n||void 0===n?void 0:n.published_greatest_competency;return!!e&&a(e)})(),v=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const s=null===n||void 0===n?void 0:n.published_competencies;if(!s)return!1;const t=null===n||void 0===n?void 0:n.published_greatest_competency;let i=[...s];if(t&&e){let e=i.indexOf(t);-1!==e&&i.splice(e,1)}return i.map(e=>a(e))}(!0),f=(()=>{var e;return null===s||void 0===s||null===(e=s.map)||void 0===e?void 0:e.call(s,(e,s)=>a(s+1))})();return(0,N.jsxs)(Ue.A,{className:"overview pb-3",fluid:"xl",children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsx)(Ge.A,{className:"mb-2",children:(0,N.jsxs)("div",{className:"d-flex align-items-center p-2 justify-content-lg-center gap-3",children:[(0,N.jsx)(vM.default,{color:u,fontSize:52}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h1",{className:"mb-0",children:Math.round(d/3600)}),(0,N.jsx)(ke.A,{defaultMessage:"Active hours",id:"label.active_hours.e57bf8d5"})]})]})})}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsx)(Ge.A,{className:"mb-2",children:(0,N.jsxs)("div",{className:"d-flex align-items-center justify-content-lg-center p-2 gap-3",children:[(0,N.jsx)(QN.default,{color:u,fontSize:52}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h1",{className:"mb-0",children:r}),(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solutions",id:"label.solutions.900fe12f"})})]})]})})}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsx)(Ge.A,{className:"mb-2",children:(0,N.jsxs)("div",{className:"d-flex align-items-center justify-content-lg-center p-2 gap-3",children:[(0,N.jsx)(xM.default,{color:u,fontSize:52}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h1",{className:"mb-0",children:o}),(0,N.jsx)("div",{children:(0,N.jsx)(ke.A,{defaultMessage:"Collaborators",id:"label.collaborators.439c0bdd"})})]})]})})})]}),!!c.length&&r>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between",style:{marginTop:"32px"},children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Greatest strength",id:"label.greatest_strength.f1197daf"})}),t&&(0,N.jsx)("div",{onClick:()=>g(2),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&g(2),role:"button",tabIndex:0,children:p})]}),(0,N.jsx)(Qe.A,{style:{margin:"15px 0px 39px 0px"},children:(0,N.jsx)(kM,{competency:x})}),(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Growth opportunities",id:"label.growth_opportunities.71552d06"})}),t&&(0,N.jsx)("div",{onClick:()=>g(1),onKeyDown:e=>("Enter"===e.key||" "===e.key)&&g(1),role:"button",tabIndex:0,children:p})]}),v.length>0?(0,N.jsx)(Qe.A,{className:"flex-md-nowrap m-0",children:v.map((e,s)=>(0,N.jsx)(zM,{competency:e},s))}):(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)("div",{className:"text-center text-muted mt-4 mb-4",children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"No growth opportunities available.",id:"label.no_growth_opportunities_available.3444b77d"})})})})})]}),(!c||0===c.length)&&(0,N.jsx)(N.Fragment,{children:t?(0,N.jsx)(N.Fragment,{children:r>0?(0,N.jsx)("div",{className:"competencies-placeholder d-flex align-items-center justify-content-center border rounded p-5 mt-4",children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-2",onClick:()=>g(1),size:"xl",variant:"primary",children:[(0,N.jsx)(ke.A,{defaultMessage:"Select your competencies",id:"label.select_your_competencies.e948bb00"}),(0,N.jsx)(ze.uO9,{className:"d-none d-lg-block"})]})}):(0,N.jsx)("div",{className:"competencies-placeholder p-5 border rounded text-center text-muted lead mt-4",children:(0,N.jsx)("em",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies can be selected once you have completed at least 1 challenge.",id:"label.competencies_can_be_selected_once.a067b38c"})})})}):(0,N.jsx)("div",{className:"text-center text-muted mt-4",children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"No visible competencies",id:"label.no_visible_competencies.36c6cfcc"})})})}),(0,N.jsx)(yM,{competencies:f,ref:m})]})};var jM=e=>{const{competencies:s=[],competencies_draft:a=[],currentStep:t=-1,onCancel:i,onDone:n,onNext:r,publishCompetencies:o}=e,[d,c]=(0,ne.CQ)({drafts_exist:a.length>0}),{drafts_exist:h}=d;if((0,l.useEffect)(()=>{a.length>0?c({drafts_exist:!0}):c({drafts_exist:!1})},[a]),1!==t)return null;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select competencies",id:"label.select_competencies.bc81756a"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(Qe.A,{className:"content-wrapper m-0",children:s.length>0?s.map((e,s)=>(0,N.jsx)(Ve.A,{className:"flex-fill",lg:3,md:6,xs:12,children:(0,N.jsx)("div",{className:"competence-card-overlay 
2selected",children:(0,N.jsx)(zM,{clickable:!0,competencies_draft:a,competency:e,selected:null===a||void 0===a?void 0:a.includes(e.competency_id),onClick:()=>{o(s+1)}})})},s)):(0,N.jsx)("i",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No competencies available.",id:"label.no_competencies_available.c564d623"})})}),(0,N.jsx)(Qe.A,{style:{marginTop:32},children:(0,N.jsx)(Ve.A,{className:"d-flex flex-column justify-content-center align-items-end",children:(0,N.jsxs)("div",{className:"mb-3",children:[(0,N.jsx)(ve.A,{className:"me-3",onClick:()=>i(),style:{padding:"1rem"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",description:"",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{onClick:()=>{h?r():n()},style:{padding:"1rem"},variant:"primary",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"}):(0,N.jsx)(ke.A,{defaultMessage:"Done",id:"label.done.11a6767d"})})]})})})]})]})};var _M=e=>{const{competencies:s=[],competencies_draft:a=[],currentStep:t=-1,greatest_draft:i,initStep:n,onDone:r,onPrev:o,setGreatestDraft:d}=e,[c,h]=(0,ne.CQ)({is_greatest_selected:!1,valid:!0}),{is_greatest_selected:u,valid:m}=c,g=[];s.forEach(e=>{a.forEach(s=>{e.competency_id===s&&g.push(e)})});const p=g.length>0;return(0,l.useEffect)(()=>{null!==i?(h({is_greatest_selected:!0}),m||h({valid:!0})):h({is_greatest_selected:!1})},[i,m]),2!==t?null:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("div",{className:"d-flex flex-column justify-content-between",children:(0,N.jsx)("h3",{style:{marginBottom:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Select greatest strength",id:"label.select_greatest_strength.98cedfc0"})})})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(Qe.A,{className:"content-wrapper",noGutters:!1,children:[!m&&(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)(We.A,{style:{fontSize:"16px",marginBottom:12,marginTop:0},variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Please select your greatest strength before proceeding.",id:"label.please_select_your_greatest_streng.67bc88b0"})})}),p?g.map((e,s)=>(0,N.jsx)(Ve.A,{className:"d-md-flex justify-content-md-around",lg:6,md:12,xs:12,children:(0,N.jsx)("div",{className:"competence-card-overlay selected",children:(0,N.jsx)(kM,{clickable:!0,className:"selectable",competency:e,onSelect:e=>d(e),selected:i===e.competency_id})})},s)):(0,N.jsx)("i",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Select a competency in the previous step.",id:"label.select_a_competency_in_the_previou.dfd33541"})})]}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{className:`d-flex mt-3 mt-md-0 ${2!==n?"justify-content-between":"justify-content-end"} align-items-center`,md:12,children:[1===n&&(0,N.jsx)(ve.A,{onClick:()=>o(),style:{padding:"1rem"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})}),(0,N.jsx)(ve.A,{disabled:!m,onClick:()=>{u&&null!==i&&a.includes(i)?(h({valid:!0}),r()):h({valid:!1})},style:{padding:"1rem"},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Done",id:"label.done.11a6767d"})})]})})]})]})},bM={Step0:jM,Step1:_M};const AM=(0,l.forwardRef)((e,s)=>{const{competencies:a=[]}=e,{handlePublishCompetencies:t,user:i}=GC(),{published_competencies:n,published_greatest_competency:r}=i,[o,d,c]=(0,ne.CQ)({competencies_draft:[],greatest_draft:null,init_step:1,step:1,visible:!1}),{competencies_draft:h,greatest_draft:u,init_step:m,step:g,visible:p}=o,x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;d({competencies_draft:[...new Set([...n,r].filter(e=>null!=e))],greatest_draft:r,init_step:e,step:e,visible:!0})},v=()=>c();return(0,l.useImperativeHandle)(s,()=>({hide:v,show:x,visible:p})),(0,N.jsx)(xe,{className:"competence-selection-modal",onHide:v,show:p,children:(0,N.jsx)("div",{className:"modal-wrapper",children:1===g?(0,N.jsx)(bM.Step0,{competencies:a,competencies_draft:h,currentStep:g,onCancel:()=>c(),onNext:()=>d({step:2}),publishCompetencies:e=>(e=>{if(h.includes(e)){const s=h.filter(s=>s!==e).sort();d({competencies_draft:s})}else d({competencies_draft:[...o.competencies_draft,e].sort((e,s)=>e-s)})})(e),onDone:async()=>{await t(h,null,!0)}}):(0,N.jsx)(bM.Step1,{competencies:a,competencies_draft:h,currentStep:g,greatest_draft:u,initStep:m,onPrev:()=>d({step:1}),setGreatestDraft:e=>d({greatest_draft:e}),onDone:async()=>{await t(h,u,!0)}})})})});AM.displayName="CompetencySelectionModal";var yM=AM;var wM=e=>{let s=e.stars;const a=[];for(;s>=1;)a.push((0,N.jsx)(ze.gt3,{color:"#EDB230"})),s--;for(e.stars%1>0&&a.push((0,N.jsx)(ze.gVl,{color:"#EDB230"}));a.length<e.max;)a.push((0,N.jsx)(ze.gt3,{color:"#EDB230",style:{opacity:.2}}));return(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>(0,N.jsx)("span",{children:e},s))})};var NM=t.p+"static/media/curvy-banner-orange.2035aa718ac38e282a28727fda31d777.svg";var SM=t.p+"static/media/curvy-banner-purple.cf2c06c68dc1cf5c259325a521efb90c.svg";var CM=t.p+"static/media/curvy-banner-blue.ed50945add75843e149583313aa44d78.svg";var MM=t.p+"static/media/curvy-banner-turq.03020f9b7b614f3b2a4cf84e41f39346.svg";var kM=e=>
2{const{className:s,clickable:a,competency:t,onSelect:i,selected:l}=e,{level:n,stars:r}=t,{formatMessage:o}=(0,ja.A)(),[d,c]=(0,ne.CQ)({selected:l,show_more:!1}),{show_more:h}=d;let u="",m="",g="";switch(t.slug){case"critical":u=MM,m=nh.critical_white,g="#17A2BB";break;case"communication":u=NM,m=nh.communicator_white,g="#ff7300";break;case"creativity":u=CM,m=nh.creativity_white,g="#0080BC";break;case"collaboration":u=SM,m=nh.collaborator_white,g="#7C59D8"}const p=oa()(`greatest-str ${(null===t||void 0===t?void 0:t.slug)||""}`,{"cursor-pointer":!!a,expanded:h,selected:l},s);return(0,N.jsxs)(Ge.A,{className:p,onClick:()=>i(t.competency_id),children:[(0,N.jsx)("div",{className:"bg-shape",style:{backgroundColor:`${g}`},children:(0,N.jsx)(Zs.A,{alt:`${(null===t||void 0===t?void 0:t.slug)||""} icon`,className:"strength-icon",src:m})}),(0,N.jsxs)(Ge.A.Body,{className:"p-3",children:[(0,N.jsx)("h1",{className:"evaluation",children:null===t||void 0===t?void 0:t.name}),(0,N.jsx)("h3",{children:null===n||void 0===n?void 0:n.type}),(0,N.jsx)(wM,{max:4,stars:r}),(0,N.jsx)("div",{className:"content",children:(0,N.jsx)(El,{ellipsis:(0,N.jsx)("span",{children:"..."}),lines:h?100:3,children:null===n||void 0===n?void 0:n.values.map((e,s)=>(0,N.jsx)("p",{children:e},s))})}),(0,N.jsx)(ve.A,{className:"truncate-toggle",style:{color:g},variant:"link",onClick:e=>{e.preventDefault(),e.stopPropagation(),c(e=>(e.show_more=!e.show_more,e))},children:o(h?{id:"label.show_less.94ea9b1d",defaultMessage:"Show less"}:{id:"label.read_more.dc6ec451",defaultMessage:"Read more..."})})]})]})};var zM=e=>{var s;const{competency:a,onClick:t,selected:i}=e,{formatMessage:l}=(0,ja.A)(),[n,r]=(0,ne.CQ)({selected:i||!1,show_more:!1}),{selected:o,show_more:d}=n,{level:c,stars:h}=a;let u="",m="",g="";switch(a.slug){case"critical":u=MM,m=nh.critical_white,g="#17A2B8";break;case"communication":u=NM,m=nh.communicator_white,g="#FF9954";break;case"creativity":u=CM,m=nh.creativity_white,g="#0080BC";break;case"collaboration":u=SM,m=nh.collaborator_white,g="#7C59D8"}const p=oa()(`competence-card p-0 ${(null===a||void 0===a?void 0:a.slug)||""}`,{"cursor-pointer":!(null===e||void 0===e||!e.clickable),expanded:d,selected:o},{chrome:!(null===(s=window)||void 0===s||!s.chrome)});return(0,N.jsx)(Ge.A,{className:p,onClick:()=>{"function"===typeof t&&(r({selected:!n.selected}),t())},children:(0,N.jsxs)("div",{className:"h-100 position-relative",children:[(0,N.jsx)("div",{children:(0,N.jsxs)("div",{className:"improvement-image",style:{backgroundImage:`url(${u})`},children:[(0,N.jsx)("h5",{children:null===a||void 0===a?void 0:a.name}),(0,N.jsx)("span",{children:(0,N.jsx)("img",{src:m,style:{height:34,width:34}})})]})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Qe.A,{noGutters:!0,className:"h-100 d-flex flex-column justify-content-between align-items-start",children:(0,N.jsxs)(Ve.A,{className:"card-body-text",xs:12,children:[(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("p",{className:"mb-1",children:null===c||void 0===c?void 0:c.type}),(0,N.jsx)(wM,{max:4,stars:h})]}),(0,N.jsx)("div",{children:(0,N.jsx)(El,{ellipsis:(0,N.jsx)("span",{children:"..."}),lines:d?100:3,children:null===c||void 0===c?void 0:c.values.map((e,s)=>(0,N.jsx)("div",{children:e},s))})}),(0,N.jsx)("div",{children:(0,N.jsx)(ve.A,{className:"truncate-toggle",style:{color:g,paddingLeft:0},variant:"link",onClick:e=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),r(e=>(e.show_more=!e.show_more,e))},children:l(d?{id:"label.show_less.94ea9b1d",defaultMessage:"Show less"}:{id:"label.read_more.dc6ec451",defaultMessage:"Read more..."})})})]})})})]})})};const TM={Achievements:eM,Certificates:lM,Overview:fM,Solutions:dM};var IM=t(21606);const EM=e=>{const{className:s,disabled:a,facebookMessage:t,pill:i,toggleLabel:l,translucent:n,twitterMessage:r,url:o,variant:d}=e,{styles:c}=(0,P.nm)(),h=(null===c||void 0===c?void 0:c.primary)||"",u=!!document.documentMode,m=oa()(`social-media-share-dropdown-button ${s}`,{pill:i,translucent:n});return(0,N.jsxs)(li.A,{className:m,disabled:a,id:"social-media-share-dropdown-button",variant:d,children:[(0,N.jsx)(li.A.Toggle,{className:"d-flex align-items-center gap-2",children:l}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{className:"py-2",children:(0,N.jsxs)(IM.wk,{className:"btn-block text-start d-flex align-items-center gap-1",url:o,children:[(0,N.jsx)(jr,{path:"social_media/linked-in.svg",size:24}),(0,N.jsx)(ke.A,{defaultMessage:"LinkedIn",id:"label.linkedin.dd84425b"})]})}),(0,N.jsx)(li.A.Item,{className:"py-2",children:(0,N.jsxs)(IM.uI,{className:"btn-block text-start d-flex align-items-center gap-1",quote:t,url:o,children:[(0,N.jsx)(jr,{path:"social_media/facebook.svg",size:24}),(0,N.jsx)(ke.A,{defaultMessage:"Facebook",id:"label.facebook.d41f5b49"})]})}),(0,N.jsx)(li.A.Item,{className:"py-2",children:(0,N.jsxs)(IM.r6,{className:"btn-block text-start d-flex align-items-center gap-1",title:r,url:o,children:[(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{backgroundColor:"black",borderRadius:4,height:24,width:24},children:(0,N.jsx)(jr,{path:"social_media/x.svg",size:18})}),(0,N.jsx)(ke.A,{defaultMessage:"X (Twitter)",id:"label.x_twitter.89c9b653"})]})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsxs)(li.A.Item,{className:"d-flex justify-content-start align-items-center gap-1",onClick:()=>{u?window.clipboardData.setData("Text",o):navigator.clipboard.writeText(o)},children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center",style:{width:24},children:(0,N.jsx)(ze.paH,{color:h,size:20})}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Copy link",id:"label.copy_link.dbf362d4"})})]})]})]})};EM.defaultProps={disabled:!1,facebookMessage:"",pill:!1,toggleLabel:"",translucent:!1,twitterMessage:"",url:"",variant:"primary"};var FM=EM;const RM=e=>(0,N.jsx)("svg",{className:e.className,fill:"currentColor",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg",children:(0,N.jsx)("path",{d:"M9.83596 2.91352L13.8366 6.91414L5.1494 15.6013L1.58253 15.9951C1.10503 16.0479 0.701589 15.6441 0.754714 15.1666L1.15159 11.5973L9.83596 2.91352ZM16.311 2.31789L14.4325 0.439453C13.8466 -0.146484 12.8963 -0.146484 12.3103 0.439453L10.5432 2.20664L14.5438 6.20727L16.311 4.44008C16.8969 3.85383 16.8969 2.90383 16.311 2.31789Z",fill:e.color})});var DM=e=>{const{handleEditPortfolio:s}=e,{siteUrl:a,styles:t}=(0,P.nm)(),i=null===t||void 0===t?void 0:t.black,{achievements:l,is_owner:n,user:r}=GC(),{getAchievementIcon:o}=(0,P.hc)(),{formatMessage:d}=(0,ja.A)(),[c,h]=(0,ne.CQ)({is_truncated:!0,truncate_lines:3}),{is_truncated:u}=c,m=`https://${a}/portfolio/${r.portfolio_token}`,g=null!==r.dob&&ci()().diff(r.dob,"years")<13;return(0,N.jsxs)(Ge.A,{className:"portfolio-sidebar",children:[(0,N.jsxs)("section",{className:"sidebar-buttons",children:[(0,N.jsx)(FM,{
2className:"share-btn",disabled:g,url:m,variant:"primary",facebookMessage:d({id:"label.check_out_my_solvably_portfolio_an.f47e4cb8",defaultMessage:'"Check out my Solvably portfolio and how this platform is helping me grow!"'}),toggleLabel:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.A$,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Share portfolio",id:"label.share_portfolio.6d620d65"})})]}),twitterMessage:d({id:"label.check_out_my_solvably_portfolio_an.f47e4cb8",defaultMessage:'"Check out my Solvably portfolio and how this platform is helping me grow!"'})}),n&&(0,N.jsxs)(ve.A,{className:"edit-about-btn",variant:"secondary",onClick:()=>{"function"==typeof s&&s()},children:[(0,N.jsx)(RM,{className:"me-1 edit-btn-icon",color:i}),(0,N.jsx)("span",{className:"edit-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit details",id:"label.edit_details.fd9c61ac"})})]})]}),(0,N.jsx)("section",{className:"d-md-none",children:(0,N.jsx)("div",{className:"d-flex flex-column align-items-start",children:r.about_description?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(El,{ellipsis:"...",lines:u?3:0,children:(0,N.jsx)("div",{children:(0,N.jsx)("div",{children:r.about_description})})}),!u&&r.about_email&&(0,N.jsx)("div",{className:"mt-3",children:(0,N.jsx)("a",{href:`mailto:${r.about_email}`,children:r.about_email})}),(0,N.jsx)(ve.A,{className:"position-relative mt-3 px-0 text-decoration-none",onClick:()=>h({is_truncated:!c.is_truncated}),style:{boxShadow:"none"},variant:"link",children:u?(0,N.jsx)(ke.A,{defaultMessage:"Read more...",id:"label.read_more.dc6ec451"}):(0,N.jsx)(ke.A,{defaultMessage:"Show less",id:"label.show_less.94ea9b1d"})})]}):(0,N.jsx)("em",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No description provided.",id:"label.no_description_provided.2527a18a"})})})}),(0,N.jsxs)("section",{className:"d-none d-md-block",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"About",id:"label.about.4efca0d1"})}),(0,N.jsx)("div",{children:r.about_description?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(El,{ellipsis:"...",lines:0,children:(0,N.jsx)("div",{children:r.about_description})})}):(0,N.jsx)("em",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No description provided",id:"label.no_description_provided.41183d01"})})}),(0,N.jsxs)("section",{style:{marginTop:32},children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Contact",id:"label.contact.2b5c3d26"})}),r.about_email?(0,N.jsx)("a",{href:`mailto:${r.about_email}`,children:r.about_email}):(0,N.jsx)("em",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No contact provided",id:"label.no_contact_provided.39cc5e1b"})})]})]}),(0,N.jsxs)("section",{className:"d-none d-xl-block",style:{marginTop:32},children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Achievements",id:"label.achievements.74cf2bc6"})}),(0,N.jsxs)(Qe.A,{children:[l.map((e,s)=>s>=5?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(Ve.A,{xs:2,children:(0,N.jsx)(aM,(0,F.A)({alt:e.alt,height:41,iconSrc:o(e.icon_token),width:41},e))},s)),l&&l.length>5&&(0,N.jsx)(Ve.A,{xs:2,children:(0,N.jsx)("div",{className:"d-flex justify-content-center bg-primary align-items-center text-white rounded-circle",style:{height:37,width:37},children:(0,N.jsxs)("h5",{style:{fontSize:"1.25rem",left:2,marginBottom:0,position:"relative"},children:[l.length-5,"+"]})})}),!l||0==l.length&&(0,N.jsx)("em",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No published achievements",id:"label.no_published_achievements.3762c93f"})})]})]})]})};var BM=e=>{var s,a,t;const{children:i,style:l}=e,{formatMessage:n}=(0,ja.A)(),{user:r}=GC(),o=null===r||void 0===r||null===(s=r.pinned_achievement)||void 0===s||null===(a=s.achievement)||void 0===a?void 0:a.icon_token,{default_banner:d,getAchievementIcon:c}=(0,Be.hc)(),h=(null===r||void 0===r||null===(t=r.banner)||void 0===t?void 0:t.location)||d;return(0,N.jsxs)(Ce.S,{style:l||{},children:[(0,N.jsxs)(Ce.S,{className:"portfolio-banner mb-lg-3",children:[(0,N.jsx)(Ce.S,{className:"banner-container",children:(0,N.jsx)(Ce.S,{className:"banner-image-container",children:(0,N.jsx)("img",{alt:"",className:"banner-layout-image",src:h})})}),(0,N.jsxs)(Ue.A,{className:"d-flex justify-content-center justify-content-md-start justify-content-lg-start",children:[(0,N.jsx)(Ya,{className:"portfolio-avatar",showOnline:!1,size:98,user:r,customIcon:o?(0,N.jsx)("img",{alt:"",className:"portfolio-badge",src:c(o)}):null}),(0,N.jsxs)("div",{className:"title-section",children:[(0,N.jsx)("h2",{className:"name",children:(0,N.jsx)(ga,{user:r})}),(0,N.jsx)("h5",{className:"title",children:(null===r||void 0===r?void 0:r.about_title)||n({id:"label.problem_solver.6def486e",defaultMessage:"Problem solver"})})]})]})]}),i]})};class PM extends l.Component{constructor(s){var a,t,i;super(s),a=this,this.fetchPortfolioChallenges=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{app:s}=a.props,{api:t}=s;e&&a.setState({loading:!0});const{challenges:i}=await t.get("/api/users/profile/public/challenges/1/1000",{portfolio_token:a.portfolio_token});a.setState({challenges:i}),e&&a.setState({loading:!1})},this.loadPortfolioOverview=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{app:s}=a.props,{api:t}=s;e&&a.setState({loading:!0});const{four_c_avg_scores:i,user:l}=await t.get("/api/users/profile/public/overview",{portfolio_token:a.portfolio_token});l.published_competencies=Array.isArray(l.published_competencies)?l.published_competencies:[],a.setState({four_c_avg_scores:i,user:l}),e&&a.setState({loading:!1})},this.loadPortfolioUserStats=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{app:s}=a.props,{api:t}=s;e&&a.setState({loading:!0});const i=await t.get("/api/users/profile/public/stats",{portfolio_token:a.portfolio_token});a.setState({stats:i}),e&&a.setState({loading:!1})},this.loadPortfolioAchievements=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{app:s}=a.props,{api:t}=s;e&&a.setState({loading:!0});const{achievements:i}=await t.get("/api/users/profile/public/achievements",{portfolio_token:a.portfolio_token});a.setState({achievements:i}),e&&a.setState({loading:!1})},this.handlePublishAchievements=async e=>{const{app:s}=this.props,{api:a}=s;this.setState({loading:!0}),a.post("/api/users/profile/set/achievements",{achievement_ids:e}).then(()=>{this.setState({loading:!1}),this.loadPortfolioAchievements(!0)}).catch(e=>{this.setState({error:e})})},this.getDeliverableIcon=(e,s,a,t)=>{switch(e){case"image":return(0,N.jsx)(ze.R1W,{className:"deliverable-icon",fill:a,size:s});case"video":return(0,N.jsx)(ze.Zgf,{className:"deliverable-icon",fill:a,size:s});case"file":return(e=>{switch(e){case"ppt":case"pptx":return(0,N.jsx)(ze.rgF,{className:"deliverable-icon",fill:a,size:s});case"doc":case"docx":return(0,N.jsx)(ze.WLb,{className:"deliverable-icon",fill:a,size:s});case"pdf":return(0,N.jsx)(ze.kl1,{className:"deliverable-icon",fill:a,size:s});case"rtf":return(0,N.jsx)(ze.t69,{className:"deliverable-icon",fill:a,size:s});default:return(0,N.jsx)(ze.Gp9,{className:"deliverable-icon",fill:a,size:s})}})(t);default:return(0,N.jsx)(ze.t69,{className:"deliverable-icon",fill:a,size:s})}},this.handlePublishCompetencies=async function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{app:l}=a.props,{api:n}=l;i&&a.setState({loading:!0});try{await n.post("/api/users/profile/set/competencies/greatest",{competency:t}),await n.post("/api/users/profile/set/competencies/visible",{competencies:s}),a.setState({loading:!1})}catch(e){const t=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;a.setState({error:t,loading:!1})}await a.loadPortfolioOverview()},this.getCompetencyRating=e=>{const{four_c_avg_scores:s}=this.state;if(!s)return!1;const a=$C.find(s=>s.id==e);if(!a)return!1;const t=s[e-1];if(null==t)return!1;let i=0;i=t<1.5?1:t<2?1.5:t<2.5?2:t<3?2.5:t<3.5?3:t<4?3.5:4;const l=(null===a||void 0===a?void 0:a.name)||"",n=(null===a||void 0===a?void 0:a.c)||"",r=((null===a||void 0===a?void 0:a.levels)||[])[Math.min(Math.max(1,Number.parseInt(Math.round(t)))-1,3)];return{competency_id:e,level:r,name:l,score:t,slug:n,stars:i}},this.handleSelect=e=>{this.setState({active_tab:e})},this.state={achievements:[],active_membership:{has_access:!1},active_tab:(null===(t=(i=window.location.hash).replace)||void 0===t?void 0:t.call(i,"#",""))||"overview",challenges:[],error:null,four_c_avg_scores:[0,0,0,0],is_owner:!1,loading:!0,stats:{},user:null},this.portfolio_token="",this.edit_portfolio_dialog=(0,l.createRef)(),this.handleSelect=this.handleSelect.bind(this)}componentDidMount(){const{app:e,intl:s,match:a}=this.props,{params:t}=a,i=(null===t||void 0===t?void 0:t.portfolio_token)||e.isLoggedIn&&e.user.portfolio_token||null;if(!i)return void this.setState({error:s.formatMessage({id:"label.invali
2d_portfolio_provided.6e139843",defaultMessage:"Invalid portfolio provided"}),loading:!1});const l=e.isLoggedIn&&e.user.portfolio_token==i;this.portfolio_token=i,this.setState({error:null,is_owner:l,loading:!0}),Promise.all([this.loadPortfolioUserStats(),this.loadPortfolioAchievements(),this.loadPortfolioOverview()]).then(()=>{this.setState({error:null,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{achievements:e,active_tab:s,challenges:a,error:t,four_c_avg_scores:i,is_owner:l,loading:n,stats:r,user:o}=this.state;return(0,N.jsx)(VC,{value:{achievements:e,challenges:a,error:t,fetchPortfolioChallenges:this.fetchPortfolioChallenges,four_c_avg_scores:i,getCompetencyRating:this.getCompetencyRating,getDeliverableIcon:this.getDeliverableIcon,handlePublishAchievements:this.handlePublishAchievements,handlePublishCompetencies:this.handlePublishCompetencies,is_owner:l,loading:n,loadPortfolioAchievements:this.loadPortfolioAchievements,loadPortfolioOverview:this.loadPortfolioOverview,loadPortfolioUserStats:this.loadPortfolioUserStats,portfolio_token:this.portfolio_token,stats:r,user:o},children:(0,N.jsxs)(py,{children:[n&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:t,variant:"danger",children:t}),!n&&!t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ue.A,{fluid:!0,className:"user-profile-root",children:(0,N.jsx)(BM,{offsetBottom:25,children:(0,N.jsxs)(Ue.A,{className:"content-wrapper",fluid:"xl",children:[(0,N.jsx)("div",{className:"tab-wrapper",children:(0,N.jsxs)(UC.A,{activeKey:s,defaultActiveKey:s,id:"admin-tabs",mountOnEnter:!0,onSelect:this.handleSelect,unmountOnExit:!0,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary tabs-portfolio-row flex-nowrap justify-content-between justify-content-md-start",variant:"pills",children:[(0,N.jsx)(TN.A,{children:(0,N.jsx)(Fg.A,{eventKey:"overview",href:"#overview",children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})})}),(0,N.jsx)(TN.A,{children:(0,N.jsx)(Fg.A,{eventKey:"solutions",href:"#solutions",children:(0,N.jsx)(ke.A,{defaultMessage:"Solutions",id:"label.solutions.900fe12f"})})}),(0,N.jsx)(TN.A,{children:(0,N.jsx)(Fg.A,{eventKey:"achievements",href:"#achievements",children:(0,N.jsx)(ke.A,{defaultMessage:"Achievements",id:"label.achievements.74cf2bc6"})})}),(0,N.jsx)(TN.A,{children:(0,N.jsx)(Fg.A,{eventKey:"certificates",href:"#certificates",children:(0,N.jsx)(ke.A,{defaultMessage:"Certificates",id:"label.certificates.16f63792"})})})]}),(0,N.jsx)(Qe.A,{className:"panes-wrapper",children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"overview",children:(0,N.jsx)(TM.Overview,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"solutions",children:(0,N.jsx)(TM.Solutions,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"achievements",children:(0,N.jsx)(TM.Achievements,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"certificates",children:(0,N.jsx)(TM.Certificates,{})})]})})]})}),(0,N.jsx)("div",{className:"sidebar-wrapper",children:(0,N.jsx)(DM,{handleEditPortfolio:()=>this.edit_portfolio_dialog.current.show(),handleToggleProfile:()=>{}})})]})})}),(0,N.jsx)(YC,{ref:this.edit_portfolio_dialog})]})]})})}}var LM=(0,Ke.Ay)((0,n.G0)(PM));var OM=e=>{const s=(0,ja.A)(),{fan_favorites:a,heart_warmers:t,most_liked:i,my_solutions:l,new_solutions:n,on_fire:r,search_text:o,total_challenges_count:d}=ak();return(0,N.jsx)(N.Fragment,{children:d?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"gallery-upper d-flex justify-content-center mb-5",children:(0,N.jsxs)(Ce.S,{className:"gallery-upper-inner pt-5",children:[(0,N.jsx)(Ue.A,{className:"gallery-filter mb-5",children:(0,N.jsxs)(Qe.A,{className:"w-100",style:{flex:1},children:[(0,N.jsx)(Ve.A,{children:(0,N.jsx)("span",{className:"h1 d-inline mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Gallery",description:"",id:"label.gallery.352cfc74"})})}),(0,N.jsx)(rk,{search_text:o})]})}),(0,N.jsx)(wk,{})]})}),(0,N.jsxs)(Ce.S,{className:"gallery-lower scrollers",children:[(0,N.jsx)(dk,{challenges:a,section:"fan_favorites",title:s.formatMessage({id:"label.fan_favorites.ed792aae",defaultMessage:"Fan favorites"})}),(0,N.jsx)(dk,{challenges:l,section:"my_solutions",title:s.formatMessage({id:"label.my_solutions.592b0e46",defaultMessage:"My solutions"})}),(0,N.jsx)(dk,{challenges:n,section:"new_solutions",title:s.formatMessage({id:"label.new_solutions.17badbe3",defaultMessage:"New solutions"})}),(0,N.jsx)(dk,{challenges:i,section:"most_liked",title:s.formatMessage({id:"label.most_liked.9553b1f2",defaultMessage:"Most liked"})}),(0,N.jsx)(dk,{challenges:t,section:"heart_warmers",title:s.formatMessage({id:"label.heart_warmers.745aaddd",defaultMessage:"Heart warmers"})}),(0,N.jsx)(dk,{challenges:r,section:"on_fire",title:s.formatMessage({id:"label.on_fire.16b56720",defaultMessage:"On fire"})})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ue.A,{className:"gallery-upper",children:(0,N.jsx)(Ce.S,{className:"gallery-filter d-block pt-5 ",children:(0,N.jsxs)(Qe.A,{className:"w-100",children:[(0,N.jsx)(Ve.A,{children:(0,N.jsx)("span",{className:"h1 d-inline mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Gallery",description:"",id:"label.gallery.352cfc74"})})}),(0,N.jsx)(rk,{search_text:o})]})})}),(0,N.jsx)(gk,{})]})})};var HM=t.p+"static/media/icon-thumb.a6e1983fbcfcc09b223c2ccea50aa51e.svg";var UM=t.p+"static/media/icon-heart.2d2f2259c7226b762e09a2da557d3c85.svg";var QM=t.p+"static/media/icon-fire.e0654394976d046e542a305e285f0930.svg";var VM=t.p+"static/media/icon-sparkle.f72cac860d0395f13deeb8423364345b.svg";var GM=t.p+"static/media/icon-star.8ebab612b38e3b92945405ee49403c68.svg";var WM=e=>{const s=(0,l.useContext)(n.BR),{styles:a}=s,t=a&&a.primary;let i=(null===e||void 0===e?void 0:e.width)||45,r=(null===e||void 0===e?void 0:e.he
2ight)||45,o=null;switch(e.category){case"fan_favorites":case"get_featured":o=(0,N.jsx)(Zs.A,{height:r,src:GM,width:i});break;case"new_solutions":o=(0,N.jsx)(Zs.A,{height:r,src:VM,width:i});break;case"most_liked":case"give_reactions":o=(0,N.jsx)(Zs.A,{height:r,src:HM,width:i});break;case"heart_warmers":o=(0,N.jsx)(Zs.A,{height:r,src:UM,width:i});break;case"on_fire":o=(0,N.jsx)(Zs.A,{height:r,src:QM,width:i});break;case"my_solutions":default:o=(0,N.jsx)(ze.x$1,{size:i,style:{color:t}});break;case"search_results":o=(0,N.jsx)(ze.KSO,{size:i,style:{color:t}});break;case"browse_solutions":o=(0,N.jsx)(ze.Ny1,{size:i,style:{color:t}})}return o};var KM=e=>{const{categories:s,category:a,navigateToCategoryList:t,resetFiltersAndRefresh:i,search_text:l}=ak(),n=(null===s||void 0===s?void 0:s[a])||[],r=a.replace("-","_"),o=()=>{switch(r){case"fan_favorites":return(0,N.jsx)(ke.A,{defaultMessage:"Fan favorites",id:"label.fan_favorites.ed792aae"});case"new_solutions":return(0,N.jsx)(ke.A,{defaultMessage:"New solutions",id:"label.new_solutions.17badbe3"});case"most_liked":return(0,N.jsx)(ke.A,{defaultMessage:"Most liked",id:"label.most_liked.9553b1f2"});case"heart_warmers":return(0,N.jsx)(ke.A,{defaultMessage:"Heart warmers",id:"label.heart_warmers.745aaddd"});case"on_fire":return(0,N.jsx)(ke.A,{defaultMessage:"On fire",id:"label.on_fire.16b56720"});case"my_solutions":return(0,N.jsx)(ke.A,{defaultMessage:"My solutions",id:"label.my_solutions.592b0e46"});case"search_results":return(0,N.jsx)(ke.A,{defaultMessage:"Search results",id:"label.search_results.e978b00d"});default:return(0,N.jsx)(ke.A,{defaultMessage:"Gallery",id:"label.gallery.352cfc74"})}};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ue.A,{className:"gallery-upper",children:(0,N.jsx)(Ce.S,{className:`gallery-filter d-block pt-5 ${a}`,children:(0,N.jsxs)(Qe.A,{className:"w-100",children:[(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(ve.A,{onClick:()=>t("",""),variant:"link",children:[(0,N.jsx)(ze.QVr,{})," ",(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Back to Gallery",id:"label.back_to_gallery.ee316703"})})]})}),(0,N.jsx)(rk,{search_text:l}),(0,N.jsxs)(Ve.A,{className:"d-flex",xs:12,children:[(0,N.jsx)(Ce.S,{className:"category-icon",children:(0,N.jsx)(WM,{category:r,height:48,width:48})}),(0,N.jsx)("span",{className:"category-title",children:(0,N.jsx)(o,{})})]})]})})}),(0,N.jsx)(Ue.A,{className:"gallery-lower",children:n.length>0?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"list-card-container",children:n.map((e,s)=>(0,N.jsx)(tk,{challenge:e},s))})}):(0,N.jsxs)(Ce.S,{className:"no-solutions",children:[(0,N.jsx)("p",{className:"lead text-center text-muted",children:"No solutions found."}),(0,N.jsx)(ve.A,{className:"btn-xl",onClick:i,children:(0,N.jsx)(ke.A,{defaultMessage:"Reset filters",id:"label.reset_filters.10afa984"})})]})})]})},YM=t(42407);const qM=(0,l.forwardRef)((e,s)=>{const{reactions:a,reactionType:t}=e;return(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({className:`reaction-contributor-popover ${t}`,id:`${t}ReactionContributorPopover`},e),{},{ref:s,children:(0,N.jsxs)("ul",{className:"text-white list-unstyled d-flex flex-column justify-content-start text-align-left",children:[(0,N.jsx)("strong",{className:"text-white text-capitalize",children:t}),a.map((e,s)=>{let{user:a}=e;return(0,N.jsx)("li",{children:(null===a||void 0===a?void 0:a.fullname)||"-"},s)})]})}))});qM.displayName="ReactionBreakdownPopover";var JM=qM;var XM=e=>{const{challenge:s,tooltip:a}=e,t=(null===s||void 0===s?void 0:s.reactions)||[],i={fire:[],like:[],love:[]};t.map(e=>i[e.type]=[...i[e.type],e]);const n=(a,t)=>{const{onClick:i}=e;a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),"function"===typeof i&&i(s,t)};return(0,N.jsx)(Ce.S,{className:"challenge-solution-reactions-counter",children:["like","love","fire"].map(e=>{var s;const t=i[e],r=null===(s=YM.default[e])||void 0===s?void 0:s.active,o=(null===t||void 0===t?void 0:t.length)||0;return(0,N.jsx)(l.Fragment,{children:a?(0,N.jsx)(N.Fragment,{children:(null===t||void 0===t?void 0:t.length)>0&&(0,N.jsx)(Ua.A,{onClick:n,overlay:s=>(0,N.jsx)(JM,(0,F.A)({reactions:t,reactionType:e},s)),placement:"bottom",children:(0,N.jsxs)(ve.A,{className:`reaction ${e} text-decoration-none`,onClick:s=>n(s,e),style:{cursor:"pointer"},variant:"link",children:[(0,N.jsx)(Zs.A,{alt:`${e} reaction icon`,height:20,src:r,width:20}),(0,N.jsx)("span",{className:`${e}-count`,children:o})]})})}):(0,N.jsx)(N.Fragment,{children:o>0&&(0,N.jsxs)(Ce.S,{className:`reaction ${e}`,onClick:s=>n(s,e),children:[(0,N.jsx)(Zs.A,{alt:`${e} reaction icon`,height:20,src:r,width:20}),(0,N.jsx)("span",{className:`${e}-count`,children:o})]})})},`reactions-${e}`)})})};var ZM=e=>{var s;const a=(0,l.useContext)(n.BR),{challenge:t,onError:i,onSuccess:r}=e,{team:o}=t||{},d=(null===t||void 0===t?void 0:t.reactions)||[],c=null===o||void 0===o||null===(s=o.assignment)||void 0===s?void 0:s.group_id,[h,u]=(0,l.useState)(d.find(e=>e.user_id===a.user.id)||{}),[m,g]=(0,l.useState)(!(0,T.isEmpty)(h));(0,l.useEffect)(()=>{const e=((null===t||void 0===t?void 0:t.reactions)||[]).find(e=>e.user_id===a.user.id)||{};u(e),g(!(0,T.isEmpty)(e))},[t]);const p=(null===h||void 0===h?void 0:h.type)||"like",[x,v]=(0,l.useState)(!1),[f,j]=(0,l.useState)(!1);(0,l.useEffect)(()=>v(f),[f]);const[_,b]=(0,l.useState)(!1),[A,y]=(0,l.useState)(null),w=()=>{clearTimeout(A),y(null),j(!0)},S=()=>{y(setTimeout(()=>{j(!1)},500))},[C,M]=(0,l.useState)(null),[k,z]=(0,l.useState)(null),I=async e=>{const{api:s}=a;b(!0),await s.post("/api/challenges/reaction/add",{challenge_id:null===t||void 0===t?void 0:t.id,group_id:c,type:e}).catch(e=>{let{err:s}=e;b(!1),i(s)})},E=async e=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),_||((0,T.isEmpty)(h)?(await I("like"),await r().then(()=>{j(!1),b(!1)})):(await(async()=>{const{api:e}=a;b(!0),await e.post("/api/challenges/reaction/delete",{challenge_reaction_id:null===h||void 0===h?void 0:h.id}).catch(e=>{let{err:s}=e;b(!1),i(s)})})(),await r().then(()=>{j(!1),b(!1)})))},F=async(e,s)=>{e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),_||((null===h||void 0===h?void 0:h.type)===s?j(!1):(j(!1),(0,T.
2isEmpty)(h)?(await I(s),await r().then(()=>{b(!1)})):(await(async e=>{const{api:s}=a;b(!0),await s.post("/api/challenges/reaction/update",{challenge_reaction_id:null===h||void 0===h?void 0:h.id,type:e}).catch(e=>{let{err:s}=e;b(!1),i(s)})})(s),await r().then(()=>{b(!1)}))))},R=(0,N.jsx)(Hu.A,{className:"reaction-options",id:"reactionOptions",children:(0,N.jsx)("div",{className:"d-flex",onMouseEnter:w,onMouseLeave:S,children:["like","love","fire"].map((e,s)=>(0,N.jsx)(ve.A,{className:`reaction reaction-${e} ${e===(null===h||void 0===h?void 0:h.type)?"selected":""}`,id:`reactionOption-${e}-${null===t||void 0===t?void 0:t.id}`,onClick:s=>F(s,e),variant:"link",children:(0,N.jsx)(Zs.A,{alt:`${e} reaction icon`,height:24,src:YM.default[e].active,width:24})},s))})});return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ua.A,{overlay:R,placement:"top",show:x,children:(0,N.jsx)(ve.A,{className:`challenge-solution-reaction-button d-flex align-items-center gap-1 ${p} ${m?"active":""}`,id:`challengeSolutionReactionButton-${null===t||void 0===t?void 0:t.id}`,onClick:e=>E(e),onContextMenu:e=>e.preventDefault(),onMouseEnter:w,onMouseLeave:S,onTouchEnd:e=>{Date.now()-C<500?clearTimeout(k):(e.preventDefault(),j(!0)),M(null)},onTouchStart:e=>{const s=Date.now();M(s),z(setTimeout(()=>{e.preventDefault(),j(!0)},500))},children:_?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Zs.A,{alt:`${p} reaction icon`,height:20,src:YM.default[p][m?"active":"inactive"],width:20}),(0,N.jsx)("span",{style:{paddingLeft:4,textTransform:"capitalize"},children:p})]})})})})};const $M=l.createContext({}),ek=$M.Provider,sk=$M.Consumer,ak=()=>(0,l.useContext)($M);var tk=e=>{var s,a;const{challenge:t}=e,{styles:i}=(0,n.nm)(),l=null===i||void 0===i?void 0:i["primary-900"],{getDeliverableIcon:r,handleError:o,parseCardData:d,refreshChallenges:c,showSolutionModal:h}=ak(),u=d(t);return(0,N.jsxs)(Ge.A,{body:!0,className:"gallery-scroller-card",onClick:e=>h(e,null===t||void 0===t?void 0:t.id),children:[(0,N.jsxs)(Ce.S,{className:"gallery-scroller-card-header",style:{backgroundImage:`url("${(null===u||void 0===u?void 0:u.challenge_templates_image)||(null===t||void 0===t||null===(s=t.challenge_template)||void 0===s?void 0:s.cover_path)}")`},children:[(0,N.jsxs)(Ce.S,{className:"header-top",children:[(0,N.jsx)("span",{className:"team-name h5",children:null===u||void 0===u?void 0:u.team_name}),r(null===u||void 0===u?void 0:u.deliverable_type,80,"rgba(255, 255, 255, 0.3)",null===u||void 0===u?void 0:u.deliverable_ext)]}),(0,N.jsx)(Ce.S,{className:"team-avatars",children:(0,N.jsx)(tn,{borderSize:2,offset:1.5,size:24,users:null===u||void 0===u?void 0:u.team_members})})]}),(0,N.jsx)(Ce.S,{className:"gallery-scroller-card-body",children:(0,N.jsxs)(Ce.S,{className:"card-details",children:[(0,N.jsx)("p",{className:"title",children:null===t||void 0===t||null===(a=t.challenge_template)||void 0===a?void 0:a.title}),(0,N.jsx)("p",{className:"solution",children:`We will ${null===u||void 0===u?void 0:u.we_will}`})]})}),(0,N.jsxs)(Ce.S,{className:"gallery-scroller-card-footer",children:[(0,N.jsxs)(Ce.S,{className:"challenge-metadata",children:[(0,N.jsxs)(Ce.S,{className:"d-flex pb-3",children:[(0,N.jsxs)("small",{className:"deliverable me-1",children:[r(null===u||void 0===u?void 0:u.deliverable_type,12,l,null===u||void 0===u?void 0:u.deliverable_ext),(0,N.jsx)("span",{children:null===u||void 0===u?void 0:u.deliverable_choice})]}),(0,N.jsxs)("small",{className:"submitted-date",children:[(0,N.jsx)(ze.Cer,{}),(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:null===u||void 0===u?void 0:u.completed_date,year:"numeric"})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex group",children:[(0,N.jsx)(Zs.A,{className:"avatar",height:24,src:null===u||void 0===u?void 0:u.group_avatar,width:24}),(0,N.jsx)("div",{className:"name",children:null===u||void 0===u?void 0:u.group_name})]})]}),(0,N.jsxs)(Ce.S,{className:"gallery-reactions-container",children:[(0,N.jsx)(ZM,{challenge:t,onError:o,onSuccess:c}),(0,N.jsx)(XM,{challenge:t})]})]})]})};var ik=t.p+"static/media/icon-calendar.09ee2a70b66a06605bffcab6192ae357.svg";var lk=t.p+"static/media/icon-filter.8276bf0d6a0806d5a02af19e67e34463.svg";const nk=(0,l.forwardRef)(function(e,s){const{icon:a,label:t,onClick:i}=e;return(0,N.jsxs)(ve.A,{className:"text-dark",ref:s,variant:"link",onClick:e=>{e.preventDefault(),i(e)},children:[(0,N.jsx)(Zs.A,{alt:`${t} icon`,"aria-hidden":!0,height:24,src:a,width:24}),(0,N.jsx)("span",{children:t})]})});var rk=e=>{const{galleryIsPublic:s,getGroupAvatar:a}=(0,n.nm)(),{challenge_templates:t,date_range:i,date_range_display:r,memberships:o,searchChallenges:d,selected_challenge_templates:c,selected_groups:h,updateDateRangeAndRefresh:u,updateSelectedChallengeTemplatesAndRefresh:m,updateSelectedGroupsAndRefresh:g}=ak();let p=(0,l.useRef)();const[x,v]=(0,l.useState)(!1),[f,j]=(0,l.useState)(!1),[_,b]=(0,l.useState)((null===e||void 0===e?void 0:e.search_text)||"");(0,l.useEffect)(()=>{b(e.search_text)},[e.search_text]);const A=()=>v(!x),y=(e,s)=>{switch(e){case"group":return h.includes(s);case"challenge_template":return c.includes(s);default:return!1}},w=(!_||!_.length)&&!f;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ve.A,{className:"filters",sm:8,xs:12,children:[(0,N.jsxs)(li.A,{className:"me-1",onToggle:A,show:x,children:[(0,N.jsx)(li.A.Toggle,{as:nk,icon:lk,label:"Filter",onClick:A}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Header,{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Filter gallery",id:"label.filter_gallery.022b898b"})}),(0,N.jsx)(ve.A,{onClick:()=>v(!1),variant:"link",children:(0,N.jsx)(ze.QCr,{})})]}),!s&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(yl.A,{children:[(0,N.jsx)(yl.A.Item,{disabled:!0,children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Classes",id:"label.classes.84637286"})})}),o&&o.map((e,s)=>{let{group:t,group_id:i}=e;return(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)(_e.A.Group,{controlId:`checkbox-${i}`,children:(0,N.jsxs)("div",{className:"d-flex justify-content-center align-items-center",children:[(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":null===t||void 0===t?void 0:t.name,checked:y("group",i),onClick:()=>(e=>g(e))(i)}),(0,N.jsx)(Zs.A,{className:"ms-2",height:24,roundedCircle:!0,src:a(t),width:24}),(0,N.jsx)(_e.A.Label,{className:"ms-2",children:(0,N.jsx)("p",{className:"mb-0",children:null===t||void 0===t?void 0:t.name})})]})})},s)})]}),(0,N.jsx)(li.A.Divider,{style:{margin:"12px 20px"}})]}),(0,N.jsxs)(yl.A,{children:[(0,N.jsx)(yl.A.Item,{disabled:!0,children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})})}),t&&t.map((e,s)=>{let{id:a,cover_path:t,title:i}=e;return(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)(_e.A.Group,{controlId:`checkbox-${a}`,children:(0,N.jsxs)("div",{className:"d-flex align-items-center justify-content-center",children:[(0,N.jsx)(_e.A.Check,{readOnly:!0,"aria-label":i,checked:y("challenge_template",a),onClick:()=>m(a)}),(0,N.jsx)(Zs.A,{className:"ms-2",height:24,roundedCircle:!0,src:t,width:24}),(0,N.jsx)(_e.A.Label,{className:"ms-2",children:(0,N.jsx)("p",{className:"mb-0",children:i})})]})})},s)})]})]})]}),(0,N.jsxs)(ve.A,{className:"text-dark",onClick:()=>p.current&&p.current.show(i),variant:"link",children:[(0,N.jsx)(Zs.A,{alt:"calendar icon","aria-hidden":!0,height:24,src:ik,width:24}),(0,N.jsx)("span",{children:r})]}),(0,N.jsx)(_e.A,{onSubmit:e=>{e.preventDefault(),d(_)},children:(0,N.jsxs)(Ei.A,{style:{maxWidth:275},children:[(0,N.jsx)(be.A,{"aria-label":"Search solutions",onBlur:()=>j(!1),onChange:e=>b(e.target.value),onFocus:()=>j(!0),placeholder:"Search solutions",style:w?{background:"transparent"}:{},value:_}),(0,N.jsx)(ve.A,{disabled:w,type:"submit",variant:"primary",children:(0,N.jsx)(ze.KSO,{})})]})})]}),(0,N.jsx)(Xw,{onRef:e=>p.current=e,onSelect:e=>u(e),range:"six_month"})]})};var ok={fan_favorites:{lg:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABSgAAAEXCAMAAACZLFrRAAAA6lBMVEUAAAAAAAAAAP//AP////+AAICAgICAgP9VVapVVf+qVf+AQL+AQP+AgL+AgP9mM8xmZsyZZsyZZv9VVdWAVdVtSdttbduSSduSSf9gYN+AQL+AQN+AYN9xVcZxVeOOVcaOVeOATcyATeaAZsyAZuZ0RtF0XdF0XeiLXdGLXeiAVdWAVep2TtiJTthtSci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3ruqQTvodLtRFMVxkiT9/iD4Z3Z0ezT81/cmk8n0q3lZzr6YTmrF0WhYO/50lqXpoF/r9XpJ/I/wQZ2g3W616o/3bmv4U/4DSC8IosNWONEAAAAASUVORK5CYII=",sm:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV8AAAEXCAMAAAA9YLeyAAAAflBMVEUAAAAAAAD/AACAAAD/AACqAAC/AACZAADMAACqAADVAAC2AADbAAC/AACqAADGAACzAADMAAC5AADRAAC/AACxAADEAAC2AADIAAC7AAC/AAC0AADDAAC4AADGAAC8AAC/AAC2AADCAAC5AADFAAC8AAC/AAC4AADCAAD////y5qtNAAAAKXRSTlMAAQECAgMEBQUGBgcHCAkJCgoLCwwNDQ4ODxARERISExQVFRYWFxgZGZcuXZwAAAABYktHRCnKt4UkAAADn0lEQVR42u3b63aaShiA4SkRorKJhxIIxANq0H3/V7jTQ9runtOGKPq8f/j/rFkfM6OE8Knopmraw796yT7pJtWeRme+UWnhduibbEh06DtsQXTom+Dt0jdqMHTpW1Lo0jexc+jUt4LQpW/kWNGp7w2DTn2Nh259bc669XW26NbX661bXwR8+YovX77iy5ev+PIVX758xZcvX/Hly1d8+YovX77iy5ev+PLlK758xZcvX/Hly1d8+fIVX77iy5ev+PLlK758+YovX/Hly1d8+fIVX758xZev+PLlK758+YovX77iy1d8+fIVX758xZcvX/HlK758+YovX77iy5ev+PIVX758xZcvX/Hly1d8+YovX77iy5ev+PLlK758xZcvX/Hly1d8+fJFwJev+PLlK758+YovX/Hly1d8+fIVX758xZev+PLlK758+YovX77iy1d8+fIVX758xZcvX/HlK758+YovX77iy5ev+PIVX758xZcvX/Hly1d8+YovX77iy5ev+PLlK758xZcvX/Hly1d8+fIVX77iy5ev+PLlK77Pqd00q0VdlUX+1G1RVtX9cr3Z7fn+qWqzKOc342QQft5VMsrmRbVoWr6/1b6p8+w6Cs8uStJZcd/s+f5wzS6LmyT8bfF4Wi53fP/ftp7+Pe2Xq3k4Ldct33ftqmwQOin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KrfCodXO327eIEvRd6lh4h7/87r/P6kzzUfOkdkp1E4+JpJfzR79nFxPTpvsf1/JLfPs+LP5znqLS8HnSbSb15sdvp/FL/+DdD6Kh+con1wMcfJ+etsMvvp/+BsltN8mCZkHz2b49NeOsju/vE0LRfXq/V6fXeVsbl7rK4XZTHJR8N+76R9OIP2b5F1IyoxwTH/AAAAAElFTkSuQmCC"}};var dk=e=>{const{challenges:s,section:a,title:t}=e,i=(0,l.useContext)($M),{navigateToCategoryList:n,toKebab:r}=i,o=(0,l.useRef)(),[d,c]=(0,l.useState)((null===s||void 0===s?void 0:s.length)||0);(0,l.useEffect)(()=>
2{if(o.current){((null===s||void 0===s?void 0:s.length)||0)!==d&&(o.current.reset(),c((null===s||void 0===s?void 0:s.length)||0))}},[s,d]);const h=e=>{let{scrollProgressPct:s}=e;return(0,N.jsxs)(Ce.S,{className:`gallery-scroller-header ${a}`,children:[(0,N.jsx)(Ce.S,{className:"gallery-scroller-progress-bar",style:{width:s+"%"}}),(0,N.jsx)("h2",{className:"gallery-scroller-header-title",children:t}),(0,N.jsxs)(ve.A,{className:"gallery-scroller-header-link",onClick:()=>n(r(a)),variant:"link",children:["See All ",(0,N.jsx)(ze.Z0P,{})]})]})};return(0,N.jsx)("div",{className:"gallery-scroller",children:(0,N.jsx)(RS,{animationDuration:300,backgroundImage:`url("${ok[a].lg}")`,cardWidth:310,header:e=>(0,N.jsx)(h,{scrollProgressPct:e}),hideControls:!s.length,mobileBreakpoint:768,ref:o,children:s.length>0?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(tk,{challenge:e},s))}):(0,N.jsx)(Ce.S,{className:"no-challenges",children:(0,N.jsx)("p",{className:"lead text-muted text-center",children:(0,N.jsx)(ke.A,{defaultMessage:'No "{title}" solutions found. Be the first to react!',description:"",id:"message.no_solutions_found_be_the_first.64879",values:{title:t}})})})})})};class ck extends l.Component{constructor(e,s){super(e,s),this.state={show:!1},this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.handleHide=this.handleHide.bind(this)}show(){this.setState({show:!0})}hide(){this.setState({show:!1})}handleHide(){const{onHide:e}=this.props;"function"===typeof e&&e(),this.hide()}componentDidMount(){"function"===typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"===typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{app:e,intl:s}=this.props,{styles:a}=e,t=a&&a.primary,i=e.userIsLearner(),{show:l}=this.state,n=[{category:"browse_solutions",subtitle:s.formatMessage({id:"label.the_gallery_contains_solutions_fro.9a71ece5",defaultMessage:"The Gallery contains solutions from your {learner}, organized into categories"},{learner:i?"learners":"classmates"}),title:s.formatMessage({id:"label.browse_solutions.c0ab52e7",defaultMessage:"Browse solutions"})},{category:"give_reactions",subtitle:s.formatMessage({id:"label.leave_a_like_love_or_fire_reaction.b70facb3",defaultMessage:"Leave a Like, Love, or Fire reaction on your favorite solutions"}),title:s.formatMessage({id:"label.give_reactions.ee397703",defaultMessage:"Give reactions"})},{category:"get_featured",subtitle:s.formatMessage({id:"label.solutions_with_the_most_reactions.77780d11",defaultMessage:"Solutions with the most reactions will be featured at the top of the Gallery"}),title:s.formatMessage({id:"label.get_featured.aa4a8ee1",defaultMessage:"Get featured"})}];return(0,N.jsxs)(xe,{className:"gallery-welcome-modal",id:"galleryWelcomeModal",onBackdropClick:this.handleHide,onHide:this.handleHide,show:l,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(Ce.S,{className:"gallery-welcome-modal-hero",children:[(0,N.jsx)(Ce.S,{className:"hero-icon",children:(0,N.jsx)(ze.m8Q,{fill:t,size:48})}),(0,N.jsx)("p",{className:"h1 heading",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to the gallery",description:"",id:"label.welcome_to_the_gallery.c2eca03a"})}),(0,N.jsx)("p",{className:"lead subheading",children:(0,N.jsx)(ke.A,{defaultMessage:"Here, you can browse and react to teams' solutions. Solutions with the most reactions will be featured at the top of the Gallery.",description:"",id:"label.here_you_can_browse_and_react_to_t.20f7ec49"})}),(0,N.jsx)(ve.A,{className:"gallery-welcome-modal-cta btn-xl",onClick:this.handleHide,children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Continue",description:"",id:"label.continue.31fbef16"})})})]}),(0,N.jsx)(Qe.A,{className:"gallery-welcome-modal-legend",noGutters:!0,children:(0,N.jsx)(Ve.A,{className:"legend-column",md:12,xs:12,children:n.map((e,s)=>(0,N.jsx)(hk,{category:null===e||void 0===e?void 0:e.category,subtitle:null===e||void 0===e?void 0:e.subtitle,title:null===e||void 0===e?void 0:e.title},s))})})]})]})}}const hk=e=>{const{category:s,subtitle:a,title:t}=e;return(0,N.jsxs)(Ce.S,{className:"modal-legend-item",children:[(0,N.jsx)(Ce.S,{className:`icon-container ${s}`,children:(0,N.jsx)(WM,{category:s,height:32,width:32})}),(0,N.jsxs)(Ce.S,{className:"modal-legend-item-description",children:[(0,N.jsx)("p",{className:"h5 title",children:t}),(0,N.jsx)("p",{className:"subtitle",children:a})]})]})};var uk=(0,Ke.Ay)((0,n.G0)(ck));var mk=t.p+"static/media/icon-filter-white.6812054c6e01f79da76342bbcfdc8bf4.svg";var gk=e=>
2{const s=(0,l.useContext)($M),{resetFiltersAndRefresh:a}=s;return(0,N.jsx)(Ce.S,{className:"gallery-no-filter-results-container",children:(0,N.jsxs)(Ce.S,{className:"no-filter-results",children:[(0,N.jsx)("p",{className:"h3 title",children:(0,N.jsx)(ke.A,{defaultMessage:"No solutions",description:"",id:"label.no_solutions.157f944b"})}),(0,N.jsx)("p",{className:"subtitle",children:(0,N.jsx)(ke.A,{defaultMessage:"We couldn't find any solutions for the selected filters",description:"",id:"label.we_couldnt_find_any_solutions_for.627917ea"})}),(0,N.jsxs)(ve.A,{onClick:a,size:"lg",children:[(0,N.jsx)(Zs.A,{alt:"filter icon","aria-hidden":!0,height:24,src:mk,width:24}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Reset filters",description:"",id:"label.reset_filters.10afa984"})})]})]})})};const pk=e=>{const{category:s,subtitle:a,title:t}=e;return(0,N.jsxs)(Ce.S,{className:"legend-item",children:[(0,N.jsx)(Ce.S,{className:`icon-container ${s}`,children:(0,N.jsx)(WM,{category:s,height:32,width:32})}),(0,N.jsxs)(Ce.S,{className:"legend-item-description",children:[(0,N.jsx)("p",{className:"h3 title",children:t}),(0,N.jsx)("p",{className:"subtitle",children:a})]})]})};var xk=e=>{const s=(0,l.useContext)(n.BR),a=(0,ja.A)(),t=s.userIsLearner(),i=[{category:"browse_solutions",subtitle:a.formatMessage({id:"label.the_gallery_contains_solutions_fro.52db564e",defaultMessage:"The gallery contains solutions from your {learner}, organized into categories"},{learner:t?"learners":"classmates"}),title:a.formatMessage({id:"label.browse_solutions.c0ab52e7",defaultMessage:"Browse solutions"})},{category:"give_reactions",subtitle:a.formatMessage({id:"label.leave_a_like_love_or_fire_reaction.b70facb3",defaultMessage:"Leave a Like, Love, or Fire reaction on your favorite solutions"}),title:a.formatMessage({id:"label.give_reactions.ee397703",defaultMessage:"Give reactions"})},{category:"get_featured",subtitle:a.formatMessage({id:"label.solutions_with_the_most_reactions.77780d11",defaultMessage:"Solutions with the most reactions will be featured at the top of the Gallery"}),title:a.formatMessage({id:"label.get_featured.aa4a8ee1",defaultMessage:"Get featured"})}];let r=a.formatMessage({id:"label.once_teams_complete_a_challenge_co.286eb0f9",defaultMessage:"Once teams complete a challenge, come back here to browse solutions, give reactions and/or get featured."}),o=(0,N.jsxs)(ve.A,{className:"gallery-null-state-cta",href:"/home",size:"lg",children:[(0,N.jsx)(ze.rQ8,{size:24}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Home",description:"",id:"label.home.3a786953"})})]});const{styles:d}=s,c=d&&d.primary;return(0,N.jsx)(Ce.S,{className:"gallery-null-state",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)(Ce.S,{className:"gallery-null-state-hero",children:[(0,N.jsx)(Ce.S,{className:"hero-icon",children:(0,N.jsx)(ze.m8Q,{fill:c,size:48})}),(0,N.jsx)("p",{className:"h1 heading",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome to the gallery",description:"",id:"label.welcome_to_the_gallery.c2eca03a"})}),(0,N.jsx)("p",{className:"lead subheading",children:r}),o]}),(0,N.jsx)(Ce.S,{className:"gallery-null-state-legend",children:i.map((e,s)=>(0,N.jsx)(pk,{category:null===e||void 0===e?void 0:e.category,subtitle:null===e||void 0===e?void 0:e.subtitle,title:null===e||void 0===e?void 0:e.title},s))})]})})};var vk=t.p+"static/media/ribbon-fan-favorite.d012ceefda2f01c670bb7f241a942c6c.svg";var fk=t.p+"static/media/ribbon-fire.83ccd238470add8e8207309165db53b9.svg";var jk=t.p+"static/media/ribbon-love.f0f7010132ea170bde5db5fb15f7d031.svg";var _k={fan_favorite:vk,heart_warmer:jk,most_liked:t.p+"static/media/ribbon-like.b7be15000f2a4f58379d7db13c943b79.svg",on_fire:fk};const bk=(0,l.forwardRef)(function(e,s){var a;const{activeType:t,data:i,ind:l}=e,{challenge:r,slug:o,title:d}=i||{},{utils:c}=(0,n.nm)(),{getDeliverableIcon:h,handleError:u,parseCardData:m,refreshChallenges:g,showSolutionModal:p,toKebab:x}=ak(),v=m(r);return(0,N.jsx)("div",{className:"feature-card-container",children:(0,N.jsxs)(Ge.A,{body:!0,className:`feature-card ${t} ${1===l?"active":""} ${x(o)}`,onClick:e=>p(e,null===r||void 0===r?void 0:r.id),ref:s,children:[(0,N.jsxs)(Ce.S,{className:"feature-card-upper",children:[(0,N.jsxs)(Ce.S,{className:"details",children:[(0,N.jsx)("span",{className:"award-title",children:d}),(0,N.jsx)("span",{className:"team-name",children:(null===r||void 0===r||null===(a=r.challenge_template)||void 0===a?void 0:a.title)||(null===v||void 0===v?void 0:v.team_name)}),(0,N.jsx)(Ce.S,{className:"team-avatars",children:(0,N.jsx)(tn,{borderSize:2,offset:1===l?2.25:2,size:1===l?40:32,users:null===v||void 0===v?void 0:v.team_members})})]}),(0,N.jsx)(Ce.S,{className:"ribbon-container",children:(0,N.jsx)(Zs.A,{alt:`${(null===i||void 0===i?void 0:i.title)||""} award ribbon`,className:"ribbon",height:137,src:_k[o],width:114})})]}),(0,N.jsx)(Ce.S,{className:"feature-card-lower",children:r?(0,N.jsxs)(Ce.S,{className:"challenge-metadata",children:[(0,N.jsx)("p",{className:"challenge-name",children:null===v||void 0===v?void 0:v.course_title}),(0,N.jsx)("span",{className:"solution",children:`We will ${null===v||void 0===v?void 0:v.we_will}`})]}):(0,N.jsx)("div",{className:"challenge-metadata justify-content-center h-100",children:(0,N.jsxs)("p",{className:"text-muted text-center align-self-center",children:["No solution chosen yet.",(0,N.jsx)("br",{}),"Be the first to react!"]})})}),(0,N.jsx)(Ce.S,{className:"feature-card-footer",children:r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"challenge-icons d-flex",children:[(0,N.jsxs)(Ce.S,{className:"deliverable",children:[(0,N.jsx)("div",{className:"icon",children:h(v.deliverable_type,14,"#FFFFFF",v.deliverable_ext)}),(0,N.jsx)("div",{className:"choice",children:null===v||void 0===v?void 0:v.deliverable_choice})]}),(0,N.jsxs)(Ce.S,{className:"group",children:[(0,N.jsx)(Zs.A,{className:"avatar",height:24,src:v.group_avatar,width:24}),(0,N.jsx)("div",{className:"name",children:v.group_name})]})]}),(0,N.jsxs)(Ce.S,{className:"feature-reactions-container",children:[(0,N.jsx)(ZM,{challenge:r,onError:u,onSuccess:g}),(0,N.jsx)(XM,{challenge:r})]})]})})]})})});var Ak=bk;class yk extends l.Component{constructor(e){super(e),this.startCarouselTimer=()=>{this.setState({carouselRestartTimer:null,carouselTimer:setInterval(this.animateNext,this.carouselInterval)})},this.state={cards:this.props.gallery.featured_cards||[],carouselRestartTimer:null,carouselTimer:null,isAnimating:!1},this.carouselInterval=5e3,this.mouseLeaveDelay=3e4,this.cardContainer=(0,l.createRef)(),this.nextActiveCard=(0,l.createRef)(),this.prevActiveCard=(0,l.createRef)(),this.currentActiveCard=(0,l.createRef)(),this.sleep=this.sleep.bind(this),this.animateNext=this.animateNext.bind(this),this.animatePrev=this.animatePrev.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this)}sleep(e){return new Promise((s,a)=>{setTimeout(s,e)})}animatePrev(){this.state.isAnimating||this.state.cards.length&&this.numFeaturedSolutions()&&this.setState({isAnimating:!0},async()=>{const e=this.cardContainer.current;e&&e.classList.add("slide-backwards"),await this.sleep(300).then(()=>{this.setState(e=>{let s=(0,T.clone)(e.cards);return s=[s[s.length-1],...s],s.pop(),{cards:s,isAnimating:!1}},()=>{this.cardContainer.current.classList.remove("slide-backwards")})})})}animateNext(){this.state.isAnimating||this.state.cards.length&&this.numFeaturedSolutions()&&this.setState(e=>{let s=(0,T.clone)(e.cards);return s=[...s,s[0]],{cards:s,isAnimating:!0}},async()=>{const e=this.cardContainer.current;e&&e.classList.add("slide-forwards"),await this.sleep(300).then(()=>{this.setState(e=>{const s=(0,T.clone)(e.cards);return s.shift(),{cards:s,isAnimating:!1}},()=>{this.cardContainer.current.classList.remove("slide-forwards")})})})}handleMouseEnter(){const{clearTimers:e}=this.props.gallery;this.state.isMobile||e()}handleMouseLeave(){const{startCarouselRestartTimer:e}=this.props.gallery;this.state.isMobile||e()}numFeaturedSolutions(){let{cards:e}=this.state;return e.filter(e=>null===e||void 0===e?void 0:e.challenge).length}handleResize(){const{carouselRestartTimer:e,carouselTimer:s,clearTimers:a,startCarouselTimer:t}=this.props.gallery;this.setState({isMobile:window.innerWidth<768},()=>{const{isMobile:i}=this.state;i&&a(),s||e||i||t()})}componentDidMount(){const{startCarouselTimer:e}=this.props.gallery;this.setState({isMobile:window.innerWidth<=768},()=>{this.state.isMobile||e(this.animateNext)}),window.addEventListener("resize",this.handleResize.bind(this))}componentWillUnmount(){window.removeEventListener("resize",this.handleResize.bind(this))}componentDidUpdate(e,s,a){const t=e.gallery.featured_cards,i=this.props.gallery.featured_cards;(0,T.isEqual)(t,i)||this.setState(e=>{const s=(0,T.clone)(e.cards);
2return s.forEach((e,a)=>{s[a]=i.find(s=>s.slug===e.slug)}),{cards:s}})}render(){const{cards:e,isMobile:s}=this.state,{gallery:a}=this.props,t=e=>{switch(e){case 0:return this.prevActiveCard;case 1:return this.currentActiveCard;case 2:return this.nextActiveCard;default:return null}},i=e=>{switch(e){case 0:return"prev-active";case 1:return"current-active";case 2:return"next-active";default:return""}};return(0,N.jsx)(Me.x_,{loading:!(null===a||void 0===a||!a.loading),children:(0,N.jsxs)(Ce.S,{className:"gallery-featured-carousel "+(s?"mobile":""),onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,children:[(0,N.jsx)("div",{className:"gallery-featured-carousel-inner",ref:this.cardContainer,children:e.map((e,s)=>(0,N.jsx)(Ak,{activeType:i(s),data:e,ind:s,ref:t(s)},s))}),!this.state.isMobile&&(0,N.jsx)(ES,{canNext:!0,canPrev:!0,hideControls:!this.numFeaturedSolutions(),onNext:this.animateNext,onPrev:this.animatePrev})]})})}}var wk=(0,n.G0)((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(sk,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{gallery:s,ref:e=>{this.comp=e}}))})}}return s})(yk));const Nk=e=>Za.Ay[e]||Za.Ay.classic,Sk=(e,s)=>{var a,t,i;return null===(a=Nk(e))||void 0===a||null===(t=a.phases)||void 0===t||null===(i=t[s])||void 0===i?void 0:i.title},Ck=(e,s)=>{var a,t,i;return null===(a=Nk(e))||void 0===a||null===(t=a.phases)||void 0===t||null===(i=t[s])||void 0===i?void 0:i.tagline},Mk=(e,s,a)=>{var t,i,l,n;const r=null===(t=Nk(e))||void 0===t||null===(i=t.phases)||void 0===i||null===(l=i[s])||void 0===l||null===(n=l.subphases)||void 0===n?void 0:n[a];return"object"===typeof r?null===r||void 0===r?void 0:r.title:r};const kk=[{hash:"theChallenge",name:"The Challenge"},{hash:"ourAudience",name:"Our Audience"},{hash:"ourSolution",name:"Our Solution"},{hash:"finalDeliverable",name:"Final Deliverable"}],zk=[{hash:"sectionDiscover",phase:1,sub_locations:[{hash:"defineChallenge",phase:1,subphase:1},{hash:"identifyAudience",phase:1,subphase:2},{hash:"establishConstraints",phase:1,subphase:3},{hash:"shareWhatYouKnow",phase:1,subphase:4}]},{hash:"sectionExplore",phase:2,sub_locations:[{hash:"research",phase:2,subphase:2}]},{hash:"sectionImagine",phase:3,sub_locations:[{hash:"brainstorm",phase:3,subphase:1},{hash:"chooseAnIdea",phase:3,subphase:2}]},{hash:"sectionCreate",phase:4,sub_locations:[{hash:"actionStatement",phase:4,subphase:1},{hash:"deliverable",phase:4,subphase:2}]}],Tk=e=>({overview:kk,process:zk.map(s=>({hash:s.hash,name:Sk(e,s.phase),sub_locations:s.sub_locations.map(s=>({hash:s.hash,name:Mk(e,s.phase,s.subphase)}))}))});Tk("classic");var Ik=t(18547);const Ek=l.createContext({}),Fk=Ek.Provider,Rk=(Ek.Consumer,()=>(0,l.useContext)(Ek));var Dk=e=>{const s=(0,l.useContext)(Ek),{bannerStickied:a,hideScrollspy:t,scrollspyVisible:i}=s,n=(null===s||void 0===s?void 0:s.scrollSpyLocations)||[],r=n.map(e=>null===e||void 0===e?void 0:e.hash),o=e=>null===e||void 0===e?void 0:e.sub_locations.map(e=>null===e||void 0===e?void 0:e.hash),d=e=>{const s=e.getBoundingClientRect().top+window.pageYOffset;window.scrollTo({behavior:"smooth",top:s+-192})};return(0,N.jsx)("aside",{className:`gallery-detail-scroll-nav ${i?"show":"hide"} ${a?"stickied":""}`,children:(0,N.jsxs)(Ce.S,{className:"scroll-nav-content",children:[(0,N.jsxs)("div",{className:"scroll-nav-header",children:[(0,N.jsx)("span",{className:"h5",children:"Contents"}),(0,N.jsx)(ve.A,{className:"close-btn",onClick:t,variant:"link",children:(0,N.jsx)(ze.QCr,{fill:"#575757"})})]}),(0,N.jsx)(Xj.A,{className:"nav nav-pills flex-column scrollspy",componentTag:"nav",currentClassName:"parent-active",items:r,offset:-250,scrolledPastClassName:"passed",children:n.map((e,s)=>{var a;return(0,N.jsxs)("div",{className:"nav-item nest-parent "+(null!==e&&void 0!==e&&e.sub_locations?"":"no-children"),children:[(0,N.jsx)(Ik.Vq,{className:"nav-link parent-link",onClick:()=>t(),scroll:d,smooth:!0,to:`#${null===e||void 0===e?void 0:e.hash}`,children:null===e||void 0===e?void 0:e.name},s),(null===e||void 0===e?void 0:e.sub_locations)&&(0,N.jsx)(Xj.A,{className:"nav nav-pills flex-column nested-scrollspy",componentTag:"nav",currentClassName:"child-active",items:o(e),offset:-250,
2children:null===e||void 0===e||null===(a=e.sub_locations)||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)("div",{className:"nav-item nest-child",children:(0,N.jsx)(Ik.Vq,{className:"nav-link child-link",onClick:()=>t(),scroll:d,smooth:!0,to:`#${null===e||void 0===e?void 0:e.hash}`,children:null===e||void 0===e?void 0:e.name},s)},s))})]},s)})})]})})};var Bk=e=>{const{views:s}=e;return(0,N.jsx)(Ce.S,{className:"gallery-detail-view-counter",children:(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.Ny1,{size:20})," ",`${s} view${s>1?"s":""}`]})})};var Pk=e=>{const s=(0,l.useContext)(n.BR),a=(0,ja.A)(),{user:t}=s,i=(0,l.useContext)(Ek),{handleError:r,refreshChallenge:o}=i,d=(null===i||void 0===i?void 0:i.challenge)||{},{hideReactions:c,hideViews:h}=e,u="https://"+s.siteUrl+"/gallery/view/"+d.token;return(0,N.jsx)(Ce.S,{className:"gallery-detail-cta-strip",children:(0,N.jsxs)(Ce.S,{className:"cta-strip-contents",children:[(0,N.jsx)(Ce.S,{className:"cta-strip-left",children:!c&&(0,N.jsxs)(N.Fragment,{children:[t&&(0,N.jsx)(ZM,{challenge:d,onError:r,onSuccess:o}),(0,N.jsx)(XM,{reactions:null===d||void 0===d?void 0:d.reactions})]})}),(0,N.jsxs)(Ce.S,{className:"cta-strip-right",children:[!h&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Bk,{views:i.views||0})}),window.innerWidth>576&&(0,N.jsx)(FM,{className:"share-btn",facebookMessage:a.formatMessage({id:"label.check_out_my_solvably_solution_and.aa657b44",defaultMessage:"Check out my Solvably solution and how this platform is helping me grow!"}),linkedinMessage:a.formatMessage({id:"label.check_out_my_solvably_solution_and.aa657b44",defaultMessage:"Check out my Solvably solution and how this platform is helping me grow!"}),twitterMessage:a.formatMessage({id:"label.check_out_my_solvably_solution_and.aa657b44",defaultMessage:"Check out my Solvably solution and how this platform is helping me grow!"}),url:u,variant:"primary",toggleLabel:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.A$,{fill:"#FFFFFF",size:16})," Share"]})})]})]})})};var Lk=e=>{const{stickied:s}=e,{siteUrl:a}=(0,P.nm)(),{formatMessage:t}=(0,ja.A)(),{default_banner:i}=(0,P.hc)(),{isBelowBreakpoint:l}=(0,ne.vh)({breakpoint:576}),{isBelowBreakpoint:n}=(0,ne.vh)({breakpoint:1200}),{challenge:r,showScrollspy:o}=Rk(),{challenge_template:d,team:c}=r||{},h=((null===c||void 0===c?void 0:c.members)||[]).map(e=>e.user);return(0,N.jsx)(Ce.S,{className:"gallery-detail-banner",style:{backgroundImage:`url("${(null===d||void 0===d?void 0:d.banner_path)||i}")`},children:(0,N.jsxs)(Ce.S,{className:"gallery-detail-contents",children:[l&&(0,N.jsx)(FM,{className:"share-btn",pill:!0,translucent:!0,url:`https://${a}/gallery/view/${null===r||void 0===r?void 0:r.token}`,facebookMessage:t({id:"label.check_out_my_solvably_solution_and.aa657b44",defaultMessage:"Check out my Solvably solution and how this platform is helping me grow!"}),linkedinMessage:t({id:"label.check_out_my_solvably_solution_and.aa657b44",defaultMessage:"Check out my Solvably solution and how this platform is helping me grow!"}),toggleLabel:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.A$,{fill:"#FFFFFF",size:16})," Share"]}),twitterMessage:t({id:"label.check_out_my_solvably_solution_and.aa657b44",defaultMessage:"Check out my Solvably solution and how this platform is helping me grow!"})}),(0,N.jsx)("p",{className:(l?s?"h4":"h1 pt-3":s?"text-start h2":"display-4")+"  challenge-template-name",children:null===d||void 0===d?void 0:d.title}),(0,N.jsx)("p",{className:(l?"h4":"h3")+"  team-name",children:null===c||void 0===c?void 0:c.name}),n&&(0,N.jsx)(ve.A,{className:"pill translucent scrollspy-toggle",onClick:o,variant:"link",children:(0,N.jsx)(ze.OXb,{fill:"#FFFFFF",size:20})}),(0,N.jsx)(Ce.S,{className:"team-avatars",children:(0,N.jsx)(tn,{borderSize:4,offset:-12,showOnline:!1,showTooltip:!0,size:48,users:h})})]})})};var Ok=t.p+"static/media/icon-deliverable.da67019fde8e2b40081f1714ffd2a987.svg";var Hk=t.p+"static/media/icon-challenge.83bf9086fbe844629f03b0e36ee64f52.svg";var Uk=t.p+"static/media/icon-solution.7efb00ff95c92fa47d56d3a0cba423a4.svg";var Qk={audience:t.p+"static/media/icon-audience.3f2991f1655524f97b3a01025da45a12.svg",challenge:Hk,deliverable:Ok,solution:Uk};var Vk=e=>{var s,a,t,i,n,r;const{challenge:{challenge_data:o=[],challenge_template:d={}}}=Rk(),{challenge_statement:c,overview:h}=d,u=o.find(e=>1===e.phase&&2===e.subphase)||{},m=(null===u||void 0===u||null===(s=u.data)||void 0===s?void 0:s.identifyAudience)||{},g=Array.isArray(null===m||void 0===m?void 0:m.gallery)?null===m||void 0===m||null===(a=m.gallery[0])||void 0===a?void 0:a.value:"",p=(null===m||void 0===m?void 0:m.text)||"No Audience Text Found",x=o.find(e=>4===e.phase&&1===e.subphase)||{},v=null===x||void 0===x||null===(t=x.data)||void 0===t?void 0:t.action_statement,f=o.find(e=>4===e.phase&&2===e.subphase)||{},{deliverable:j,deliverable_choice:_}=(null===f||void 0===f?void 0:f.data)||{},[b,A]=(0,l.useState)(!0);return(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)("section",{className:"overview-section the-challenge",id:"theChallenge",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:null===Qk||void 0===Qk?void 0:Qk.challenge,width:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"The challenge",id:"label.the_challenge.a99d3c07"})})]}),(0,N.jsx)(Ce.S,{dangerouslySetInnerHTML:{__html:c}}),(0,N.jsxs)(Ce.S,{className:"collapse "+(b?"":"show"),children:[(0,N.jsx)("span",{className:"h4",children:"Overview"}),(0,N.jsx)(Ce.S,{dangerouslySetInnerHTML:{__html:h}})]}),(0,N.jsx)(ve.A,{className:"p-0",onClick:()=>A(!b),variant:"link",children:b?"Read More...":"Show Less"})]}),(0,N.jsxs)("section",{className:"overview-section our-audience",id:"ourAudience",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:null===Qk||void 0===Qk?void 0:Qk.audience,width:24})}),(0,N.jsx)("span",{className:"h2",children:"Our Audience"})]}),(0,N.jsxs)(Qe.A,{className:"audience",children:[(0,N.jsx)(Ve.A,{md:5,xs:12,children:(0,N.jsx)(Zs.A,{alt:"identified audie
2nce",fluid:!0,rounded:!0,src:g})}),(0,N.jsx)(Ve.A,{children:(0,ad.G9)(p,{preserveNewlines:!0})})]})]}),(0,N.jsxs)("section",{className:"overview-section our-solution",id:"ourSolution",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:null===Qk||void 0===Qk?void 0:Qk.solution,width:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"Our solution",id:"label.our_solution.c129a84d"})})]}),(0,N.jsxs)(Ce.S,{className:"solution d-flex flex-column gap-2",children:[(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("em",{className:"text-primary fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"We will",id:"label.we_will.5daab980"})}),(0,N.jsx)("span",{children:(null===v||void 0===v||null===(i=v.we_will)||void 0===i?void 0:i.value)||"..."})]}),(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("em",{className:"text-primary fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"So that",id:"label.so_that.7fc46a9c"})}),(0,N.jsx)("span",{children:(null===v||void 0===v||null===(n=v.so_that)||void 0===n?void 0:n.value)||"..."})]}),(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("em",{className:"text-primary fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"Ending in",id:"label.ending_in.d7de3f00"})}),(0,N.jsx)("span",{children:(null===v||void 0===v||null===(r=v.ending_in)||void 0===r?void 0:r.value)||"..."})]})]})]}),(0,N.jsxs)("section",{className:"overview-section final-deliverable",id:"finalDeliverable",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:null===Qk||void 0===Qk?void 0:Qk.deliverable,width:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"Final deliverable",id:"label.final_deliverable.ac8cbb05"})})]}),(0,N.jsx)(Ku,{deliverable:j,deliverable_choice:_})]})]})};var Gk=t.p+"static/media/icon-discover.c99c4167bce50b7a762fd8b0ee6646f2.svg";var Wk=e=>{var s;const{phase:a,subphase:t}=e,i=(0,l.useContext)(n.BR),{utils:r}=i,{challenge:o}=Rk(),d=(null===o||void 0===o||null===(s=o.challenge_template)||void 0===s?void 0:s.challenge_type)||"classic",[c,h]=(0,l.useState)(!1),u=(0,l.useRef)(null),m=((e,s,a)=>{var t,i,l,n,r;return null===(t=Nk(e))||void 0===t||null===(i=t.phases)||void 0===i||null===(l=i[s])||void 0===l||null===(n=l.subphases)||void 0===n||null===(r=n[a])||void 0===r?void 0:r.description})(d,a,t),g=m||r.getSubphaseDescription(a,t);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"subphase-info-button",onClick:()=>h(!c),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),ref:u,variant:"link",children:(0,N.jsx)(Zs.A,{"aria-hidden":!0,height:18,src:Gj,width:18})}),(0,N.jsx)(bi.A,{placement:"left",show:c,target:u.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({className:"subphase-popover",id:"overlay-example"},e),{},{children:g}))})]})};var Kk=e=>{var s,a,t,i,l;const{challenge:{challenge_data:n=[],challenge_template:r={}},getCardMinHeight:o}=Rk(),d=(null===r||void 0===r?void 0:r.challenge_type)||"classic",c="classic"===d,h=n.filter(e=>1===e.phase)||[],[u,m,g,p]=h||[],x=(null===u||void 0===u||null===(s=u.data)||void 0===s?void 0:s.wordCloudList)||[],v=(null===m||void 0===m||null===(a=m.data)||void 0===a?void 0:a.identifyAudience)||{},f=(null===v||void 0===v?void 0:v.gallery)||[],j=null===f||void 0===f||null===(t=f[0])||void 0===t?void 0:t.value,_=(0,ad.G9)(null===v||void 0===v?void 0:v.text,{preserveNewlines:!0}),b=Object.entries((null===g||void 0===g||null===(i=g.data)||void 0===i?void 0:i.constraints)||{}).map(e=>null===e||void 0===e?void 0:e[1])||[],{guiding_questions:A=[]}=r,y=null===p||void 0===p||null===(l=p.data)||void 0===l?void 0:l.share_lanes;return(0,N.jsxs)("section",{className:"process-section section-discover",id:"sectionDiscover",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:Gk,width:24})}),(0,N.jsxs)(Ce.S,{className:"headings",children:[(0,N.jsx)("span",{className:"h2 heading",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Discover",id:"label.discover.d4a33d5b"}):Sk(d,1)}),(0,N.jsx)("span",{className:"subheading",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Identify and understand the problem",id:"label.identify_and_understand_the_proble.8f9d39b1"}):Ck(d,1)||(0,N.jsx)(ke.A,{defaultMessage:"Identify and understand the problem",id:"label.identify_and_understand_the_proble.8f9d39b1"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection define-challenge",id:"defineChallenge",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Define challenge",id:"label.define_challenge.d70fcbc4"}):Mk(d,1,1)}),(0,N.jsx)(Wk,{phase:1,subphase:1})]}),(0,N.jsx)(Ce.S,{className:"word-cloud-container",children:(0,N.jsx)(wr,{list:x})})]}),(0,N.jsxs)(Ce.S,{className:"subsection identify-audience",id:"identifyAudience",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Identify audience",id:"label.identify_audience.be621a4b"}):Mk(d,1,2)}),(0,N.jsx)(Wk,{phase:1,subphase:2})]}),(0,N.jsx)("p",{children:_}),(0,N.jsx)(Zs.A,{alt:"The audience this challenge aims to help",className:"audience-image",fluid:!0,src:j})]}),(0,N.jsxs)(Ce.S,{className:"subsection establish-constraints",id:"establishConstraints",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Establish constraints",id:"label.establish_constraints.14d6acce"}):Mk(d,1,3)}),(0,N.jsx)(Wk,{phase:1,subphase:3})]}),(0,N.jsx)(Ce.S,{className:"constraints-container",children:b.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"constraint",children:[(0,N.jsx)(Ce.S,{className:"category",children:null===e||void 0===e?void 0:e.category}),(0,N.jsx)(Ce.S,{className:"text",children:null===e||void 0===e?void 0:e.text})]},s))})]}
2),(0,N.jsxs)(Ce.S,{className:"subsection share-what-you-know",id:"shareWhatYouKnow",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:c?(0,N.jsx)(ke.A,{defaultMessage:"Share what you know",id:"label.share_what_you_know.7250b581"}):Mk(d,1,4)}),(0,N.jsx)(Wk,{phase:1,subphase:4})]}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-3",children:!(null===A||void 0===A||!A.length)&&A.map((e,s)=>{var a;return(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1",children:[(0,N.jsx)("em",{className:"fw-semibold",children:e}),!(null===y||void 0===y||null===(a=y[s])||void 0===a||!a.length)&&(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2},children:(0,N.jsx)(Ij.A,{gutter:16,children:y[s].map((e,s)=>(0,N.jsx)(Jj,{card:e,style:{minHeight:o(e)}},s))})})]},s)})})]})]})};var Yk=e=>{var s,a;const{challenge:{challenge_data:t=[],challenge_template:i={}},getCardMinHeight:l}=Rk(),n=(null===i||void 0===i?void 0:i.challenge_type)||"classic",r="classic"===n,o=t.find(e=>2===e.phase&&1===e.subphase)||{},d=Object.values((null===o||void 0===o||null===(s=o.data)||void 0===s?void 0:s.need_to_knows)||{}).map(e=>{let{value:s}=e;return s}),c=t.find(e=>2===e.phase&&2===e.subphase)||{},h=(null===c||void 0===c||null===(a=c.data)||void 0===a?void 0:a.share_lanes)||[];return(0,N.jsxs)("section",{className:"process-section section-explore",id:"sectionExplore",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:zj,width:24})}),(0,N.jsxs)(Ce.S,{className:"headings",children:[(0,N.jsx)("span",{className:"h2 heading",children:r?(0,N.jsx)(ke.A,{defaultMessage:"Explore",id:"label.explore.3b73900b"}):Sk(n,2)}),(0,N.jsx)("span",{className:"subheading",children:r?(0,N.jsx)(ke.A,{defaultMessage:"Learn what you need to know",id:"label.learn_what_you_need_to_know.aeeae8fc"}):Ck(n,2)||(0,N.jsx)(ke.A,{defaultMessage:"Learn what you need to know",id:"label.learn_what_you_need_to_know.aeeae8fc"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection research",id:"research",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:r?(0,N.jsx)(ke.A,{defaultMessage:"Research",id:"label.research.979d6300"}):Mk(n,2,2)}),(0,N.jsx)(Wk,{phase:2,subphase:1})]}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-3",children:d.map((e,s)=>{var a;return(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1",children:[(0,N.jsx)("em",{className:"fw-semibold",children:e}),!(null===(a=h[s])||void 0===a||!a.length)&&(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2},children:(0,N.jsx)(Ij.A,{gutter:16,children:h[s].map((e,s)=>(0,N.jsx)(Jj,{card:e,style:{minHeight:l(e)}},s))})})]},s)})})]})]})};const qk=e=>{const{lane:s}=e,a=Array.isArray(s)?s:[];return(0,N.jsx)(Ce.S,{className:"decision-board-preview d-flex flex-column gap-3",children:Za.tM.map(e=>{const s=(e=>a.find(s=>(null===s||void 0===s?void 0:s.decision_type)===e)||null)(e);return(0,N.jsxs)(Ce.S,{className:"decision-slot border rounded bg-white shadow-sm overflow-hidden",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center flex-wrap gap-2 px-3 py-2 border-bottom",children:[(0,N.jsx)(bo.A,{bg:"primary",children:e}),Za.bT[e]&&(0,N.jsx)("span",{className:"text-muted small",children:Za.bT[e]})]}),(0,N.jsx)(Ce.S,{className:"px-3 py-3",children:(null===s||void 0===s?void 0:s.text)||"..."})]},e)})})};var Jk=e=>{var s,a,t,i,l,n;const{challenge:{challenge_data:r=[],challenge_template:o={}},getCardMinHeight:d}=Rk(),c=(null===o||void 0===o?void 0:o.challenge_type)||"classic",h="classic"===c,u="decision_making"===c,m=r.find(e=>3===e.phase&&1===(null===e||void 0===e?void 0:e.subphase))||{},g=null===m||void 0===m||null===(s=m.data)||void 0===s||null===(a=s.share_lanes)||void 0===a?void 0:a[0],p=r.find(e=>3===e.phase&&2===(null===e||void 0===e?void 0:e.subphase))||{},x=(null===p||void 0===p||null===(t=p.data)||void 0===t||null===(i=t.selected_idea)||void 0===i?void 0:i.item)||{};return(0,N.jsxs)("section",{className:"process-section section-imagine",id:"sectionImagine",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:Ej,width:24})}),(0,N.jsxs)(Ce.S,{className:"headings",children:[(0,N.jsx)("span",{className:"h2 heading",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Imagine",id:"label.imagine.7108efed"}):Sk(c,3)}),(0,N.jsx)("span",{className:"subheading",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm and generate ideas",id:"label.brainstorm_and_generate_ideas.b71bfd80"}):Ck(c,3)||(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm and generate ideas",id:"label.brainstorm_and_generate_ideas.b71bfd80"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection brainstorm",id:"brainstorm",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm",id:"label.brainstorm.914af5cb"}):Mk(c,3,1)}),(0,N.jsx)(Wk,{phase:3,subphase:1})]}),u?(0,N.jsx)(qk,{lane:null===m||void 0===m||null===(l=m.data)||void 0===l||null===(n=l.share_lanes)||void 0===n?void 0:n[0]}):(null===g||void 0===g?void 0:g.length)&&(0,N.jsx)(Ce.S,{children:!(null===g||void 0===g||!g.length)&&(0,N.jsx)(Ij.i,{columnsCountBreakPoints:{0:1,768:2},children:(0,N.jsx)(Ij.A,{gutter:16,children:g.map((e,s)=>(0,N.jsx)(Jj,{card:e,style:{minHeight:d(e)}},s))})})})]}),(0,N.jsxs)(Ce.S,{className:"subsection choose-an-idea",id:"chooseAnIdea",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Choose an Idea",id:"label.choose_an_idea.19b2cf12"}):Mk(c,3,2)}),(0,N.jsx)(Wk,{phase:3,subphase:2})]}),(0,N.jsxs)(Ce.S,{className:"chosen-idea",children:[u&&(null===x||void 0===x?void 0:x.decision_type)&&(0,N.jsx)(Ce.S,{className:"mb-1",children:(0,N.jsx)(bo.A,{bg:"primary",children:x.decision_type})}),(0,N.jsx)(Jj,{card:x,style:{minHeight:300}})]})]})]})};var Xk=e=>{var s;const{challenge:a}=Rk(),{challenge_data:t=[],challenge_template:i={}}=a||{},l=(null===i||void 0===i?void 0:i.challenge_type)||"classic",n="classic"===l,r=t.find(e=>4===e.phase&&1===e.subphase)||{},o=t.find(e=>4===e.phase&&2===e.subphase)||{},{ending_in:d,so_that:c,we_will:h}=(null===r||void 0===r||null===(s=r.data)||void 0===s?void 0:s.action_statement)||{},{deliverable:u,deliverable_choice:m}=(null===o||void 0===o?void 0:o.data)||{};return(0,N.jsxs)("section",{className:"process-section section-create",id:"sectionCreate",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)(Ce.S,{className:"icon",children:(0,N.jsx)(Zs.A,{height:24,src:Dj,width:24})}),(0,N.jsxs)(Ce.S,{className:"headings",children:[(0,N.jsx)("span",{className:"h2 heading",children:n?(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"}):Sk(l,4)}
2),(0,N.jsx)("span",{className:"subheading",children:n?(0,N.jsx)(ke.A,{defaultMessage:"Make your ideas come to life",id:"label.make_your_ideas_come_to_life.8cc80824"}):Ck(l,4)||(0,N.jsx)(ke.A,{defaultMessage:"Make your ideas come to life",id:"label.make_your_ideas_come_to_life.8cc80824"})})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection action-statement",id:"actionStatement",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:n?(0,N.jsx)(ke.A,{defaultMessage:"Action statement",id:"label.action_statement.22fcbfc8"}):Mk(l,4,1)}),(0,N.jsx)(Wk,{phase:4,subphase:1})]}),(0,N.jsxs)(Ce.S,{className:"statements d-flex flex-column gap-2",children:[(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("em",{className:"text-primary fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"We will",id:"label.we_will.5daab980"})}),(0,N.jsx)("span",{children:(null===h||void 0===h?void 0:h.value)||"..."})]}),(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("em",{className:"text-primary fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"So that",id:"label.so_that.7fc46a9c"})}),(0,N.jsx)("span",{children:(null===c||void 0===c?void 0:c.value)||"..."})]}),(0,N.jsxs)("span",{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("em",{className:"text-primary fw-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"Ending in",id:"label.ending_in.d7de3f00"})}),(0,N.jsx)("span",{children:(null===d||void 0===d?void 0:d.value)||"..."})]})]})]}),(0,N.jsxs)(Ce.S,{className:"subsection deliverable",id:"deliverable",children:[(0,N.jsxs)(Ce.S,{className:"subsection-header",children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:n?(0,N.jsx)(ke.A,{defaultMessage:"Deliverable",id:"label.deliverable.b8b36626"}):Mk(l,4,2)}),(0,N.jsx)(Wk,{phase:4,subphase:2})]}),(0,N.jsx)(Ku,{deliverable:u,deliverable_choice:m})]})]})};var Zk=e=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Kk,{}),(0,N.jsx)(Yk,{}),(0,N.jsx)(Jk,{}),(0,N.jsx)(Xk,{})]}),$k=t(23749);var ez=()=>{const{activeTab:e,setActiveTab:s}=Rk();return(0,N.jsxs)(Ce.S,{className:"gallery-detail-tabs",children:[(0,N.jsxs)(aa.A,{activeKey:e,className:"flex-row tabs-primary mt-4 mb-3",onSelect:s,children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{className:"gallery-detail-tab",eventKey:"overview",children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{className:"gallery-detail-tab",eventKey:"process",children:(0,N.jsx)(ke.A,{defaultMessage:"Process",id:"label.process.e083bd83"})})})]}),(0,N.jsxs)($k.A,{activeKey:e,defaultActiveKey:"overview",unmountOnExit:!0,children:[(0,N.jsx)(ld.A,{eventKey:"overview",children:(0,N.jsx)(Vk,{})}),(0,N.jsx)(ld.A,{eventKey:"process",children:(0,N.jsx)(Zk,{})})]})]})};const sz=s=>{var a,t;const{match:{params:i}}=s,{api:n,isLoggedIn:r,userId:o}=(0,P.nm)(),[d,c]=(0,ne.CQ)({activeTab:"overview",bannerStickied:!1,challenge:{},challenge_id:null,error:null,isAnonymous:null===(null===(a=s.app)||void 0===a?void 0:a.user),isTeamMember:!1,loading:!1,scrollspyVisible:!1,views:0}),{activeTab:h,bannerStickied:u,challenge:m,error:g,isTeamMember:p,loading:x,scrollspyVisible:v,views:f}=d,j=async()=>{try{const{challenge_id:e}=d,{challenge:s,views:a}=await n.get(`/api/challenges/get/gallery_details/${e}`);c({challenge:s,loading:!1,views:a})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},_=e=>c({activeTab:e});(0,l.useEffect)(()=>{(async()=>{var s;const a=null===i||void 0===i?void 0:i.challenge_token,t=await(async s=>{try{let{challenge_id:e}=await n.get(`/api/challenges/id/${s}`);return e}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a})}})(a);if(c({challenge_id:t,loading:!0}),await(async()=>{try{const{challenge_id:e}=d;await n.get(`/api/challenges/view/gallery/${e}`)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a})}})(),await j(),r)return;const{challenge:l}=d,{team:h}=l||{},{members:u}=h||{};if(!l)return;u||c({isTeamMember:!1});const m=null===h||void 0===h||null===(s=h.members)||void 0===s?void 0:s.find(e=>{let{user:s}=e;return(null===s||void 0===s?void 0:s.id)===o});c({isTeamMember:!!m})})()},[]);const b=(null===m||void 0===m||null===(t=m.challenge_template)||void 0===t?void 0:t.challenge_type)||"classic",A=Tk(b)[h]||[],y=[],w={activeTab:h,bannerStickied:u,challenge:m,getCardMinHeight:e=>["link","doc"].includes(null===e||void 0===e?void 0:e.file_type)?200:150,handleError:e=>c({error:e}),hideScrollspy:()=>c({scrollspyVisible:!1}),isTeamMember:p,refreshChallenge:j,scrollSpyLocations:A,scrollspyVisible:v,setActiveTab:_,showScrollspy:()=>c({scrollspyVisible:!0}),views:f};return(0,N.jsx)(py,{children:(0,N.jsx)(Ce.S,{className:"gallery-detail",children:(0,N.jsxs)(Fk,{value:w,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:g,variant:"danger",children:g}),(0,N.jsx)(Me.x_,{loading:x,children:(0,T.isEmpty)(m)?(0,N.jsx)(Ce.S,{className:"challenge-not-found",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge not found",id:"label.challenge_not_found.a29799fa"})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(lv.RenderPropSticky,{onFixedToggle:()=>c({bannerStickied:!d.bannerStickied}),positionRecheckInterval:250,topOffset:80,children:e=>{let{holderRef:s,holderStyles:a,isFixed:t,wrapperRef:i,wrapperStyles:l}=e;return(0,N.jsx)(Ce.S,{className:"gallery-detail-hero",children:(0,N.jsx)("div",{ref:s,style:(0,F.A)((0,F.A)({},a),{marginBottom:t?195:0}),children:(0,N.jsxs)("div",{className:"  "+(t?"stickied":""),ref:i,style:t?(0,F.A)((0,F.A)({},l),y):l,children:[(0,N.jsx)(Lk,{stickied:t}),(0,N.jsx)(Pk,{})]})})})}})}),(0,N.jsxs)(Ce.S,{className:"gallery-detail-content-wrapper",children:[(0,N.jsx)(Ce.S,{className:"content-center",children:(0,N.jsx)(ez,{})}),(0,N.jsx)(Dk,{})]}),"overview"===h&&(0,N.jsx)(Ce.S,{className:"see-our-process",children:(0,N.jsxs)("div",{className:"text-contents d-flex flex-column",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Want to learn more?",id:"label.want_to_learn_more.4a6ffc46"})}),(0,N.jsx)(ve.A,{className:"p-0",onClick:()=>{window.scrollTo({behavior:"smooth",top:0}),_("process")},variant:"link",children:(0,N.jsxs)("span",{className:"h3",children:[(0,N.jsx)(ke.A,{defaultMessage:"See our process",id:"label.see_our_process.263709d2"}),(0,N.jsx)(ze.Z0P,{fill:"#FFFFFF",size:24})]})})]})})]})})]})})})};var az=e=>{var s,a;const{reaction:t}=e,{type:i,user:l}=t||{},n=null===l||void 0===l||null===(s=l.organization_memberships)||void 0===s?void 0:s[0],r=(null===n||void 0===n||null===(a=n.role)||void 0===a?void 0:a.name)||"Learner",{userId:o}=(0,P.nm)(),d=null===l||void 0===l?void 0:l.fullname,c=YM.default[i].active,h="/portfolio"+((null===l||void 0===l?void 0:l.id)!==o?`/${null===l||void 0===l?void 0:l.portfolio_token}`:"");return(0,N.jsxs)(Le.Link,{className:"list-group-item border-0 d-flex justify-content-between align-items-center",to:h,children:[(0,N.jsxs)(Ce.S,{className:"user-info d-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:32,user:l}),(0,N.jsxs)(Ce.S,{className:"user-details d-flex flex-column ml-2",children:[(0,N.jsx)("strong",{children:d}),(0,N.jsx)("span",{style:{fontSize:14},children:r})]})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Zs.A,{alt:`${i} reaction icon`,height:20,src:c,width:20})})]})};const tz=(0,l.forwardRef)((e,s)=>{var a;
2const t=(0,P.nm)(),[i,n]=(0,l.useState)({fire:[],like:[],love:[]}),[r,o]=(0,l.useState)(!1),[d,c]=(0,l.useState)("all"),[h,u]=(0,l.useState)(!0),[m,g]=(0,l.useState)(null),p=()=>{n({}),o(!1),u(!0),g(null)};(0,l.useImperativeHandle)(s,()=>({hide:p,show:function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all";o(!0),u(!0),c(s),(async e=>{var s,a,i;const l=null===e||void 0===e?void 0:e.id,r=null===e||void 0===e||null===(s=e.team)||void 0===s||null===(a=s.assignment)||void 0===a||null===(i=a.group)||void 0===i?void 0:i.organization_id;await t.api.get(`/api/challenges/reactions/${l}/${r}`).then(e=>{let{reactions:s}=e;n(s),u(!1)}).catch(e=>{g(e),u(!1)})})(e)}}));const x=["like","love","fire"];let v=[];return Object.values(i).forEach(e=>v=[...v,...e]),(0,N.jsxs)(xe,{backdropClassName:"reaction-breakdown-modal-backdrop",dialogClassName:"reaction-breakdown-modal-dialog",id:"reactionBreakdownModal",onHide:p,show:r,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)("span",{className:"h3",children:(0,N.jsx)(ke.A,{defaultMessage:"Reactions",id:"label.reactions.8a7ede6b"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{g(null)},show:m,variant:"danger",children:m}),(0,N.jsxs)(ld.A.Container,{activeKey:d,defaultActiveKey:"all",id:"reactionBreakdownTabs",mountOnEnter:!0,onSelect:c,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"all",children:(0,N.jsx)(ke.A,{defaultMessage:"All",id:"label.all.a52ace42"})})}),x.map((e,s)=>{var a;const t=(null===(a=i[e])||void 0===a?void 0:a.length)||0,l=YM.default[e][t>0?"active":"inactive"];return(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:`d-flex align-items-center gap-1 ${e} ${t?"":"empty"}`,eventKey:e,children:[(0,N.jsx)(Zs.A,{alt:`${e} reaction icon`,height:20,src:l,width:20}),(0,N.jsx)("span",{className:`${e}-count ml-1`,children:t})]})},s)})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"all",children:h?(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center p-2",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsx)(N.Fragment,{children:null!==(a=v)&&void 0!==a&&a.length?(0,N.jsx)(yl.A,{children:v.map((e,s)=>(0,N.jsx)(az,{reaction:e},s))}):(0,N.jsxs)("p",{className:"text-center p-3 text-muted",children:[(0,N.jsx)(ke.A,{defaultMessage:"No reactions yet.",id:"label.no_reactions_yet.820c14c2"}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Be the first to react!",id:"label.be_the_first_to_react.5125e80a"})]})})}),x.map((e,s)=>{var a;return(0,N.jsx)(ld.A.Pane,{eventKey:e,children:h?(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center p-2",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsx)(N.Fragment,{children:null!==(a=i[e])&&void 0!==a&&a.length?(0,N.jsx)(yl.A,{children:i[e].map((e,s)=>(0,N.jsx)(az,{reaction:e},s))}):(0,N.jsxs)("p",{className:"text-center p-3 text-muted",children:[(0,N.jsx)(ke.A,{defaultMessage:'No "{type}" reactions yet.',id:"label.no_type_reactions_yet.2fce2240",values:{type:e}}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Be the first to react!",id:"label.be_the_first_to_react.5125e80a"})]})})},s)})]})]})]})]})});tz.displayName="ReactionBreakdownModal";var iz=tz;const lz={1:{id:"sectionDiscover",className:"section-discover"},2:{id:"sectionExplore",className:"section-explore"},3:{id:"sectionImagine",className:"section-imagine"},4:{id:"sectionCreate",className:"section-create"}},nz={"1-1":{id:"defineChallenge",className:"define-challenge"},"1-2":{id:"identifyAudience",className:"identify-audience"},"1-3":{id:"establishConstraints",className:"establish-constraints"},"1-4":{id:"shareWhatYouKnow",className:"share-what-you-know share-grid-outer-container",headerClassName:"d-flex flex-row justify-content-between"},"2-1":{id:"needToKnow",className:"research"},"2-2":{id:"research",className:"research"},"3-1":{id:"brainstorm",className:"brainstorm"},"3-2":{id:"chooseAnIdea",className:"choose-an-idea"},"4-1":{id:"actionStatement",className:"action-statement"},"4-2":{id:"deliverable",className:"deliverable"}},rz=e=>{var s;return(null===(s=lz[e])||void 0===s?void 0:s.id)||`section-phase-${e}`},oz=e=>{var s;return(null===(s=lz[e])||void 0===s?void 0:s.className)||`section-phase-${e}`},dz=(e,s)=>{var a;return(null===(a=nz[`${e}-${s}`])||void 0===a?void 0:a.id)||`phase-${e}-sub-${s}`},cz={classic:{"2-1":"Need to Know"}},hz=(e,s,a)=>{var t;return(null===(t=cz[e])||void 0===t?void 0:t[`${s}-${a}
2`])||null};const uz=[{hash:"theChallenge",name:"The Challenge"},{hash:"ourAudience",name:"Our Audience"},{hash:"ourSolution",name:"Our Solution"},{hash:"finalDeliverable",name:"Final Deliverable"}],mz=(e,s)=>{const a=(null===e||void 0===e?void 0:e.phases)||{};return Object.entries(a).filter(e=>{let[s]=e;return Number(s)<=4}).map(e=>{let[a,t]=e;const i=Number(a),l=(null===t||void 0===t?void 0:t.subphases)||{};return{hash:rz(i),name:null===t||void 0===t?void 0:t.title,sub_locations:Object.entries(l).map(e=>{let[a,t]=e;const l=Number(a),n="object"===typeof t?null===t||void 0===t?void 0:t.title:t;return{hash:dz(i,l),name:hz(s,i,l)||n}})}})},gz=e=>{const s=Za.Ay[e]||Za.Ay.classic;return{overview:uz,process:mz(s,e)}};gz("classic");const pz=(0,l.forwardRef)((s,a)=>{var t,i;const{hideChallengeHubButton:n,onHide:r,onPublishUpdate:o}=s,{api:d,userId:c}=(0,P.nm)(),h=(0,Pe.W6)(),u=(0,l.useRef)(),[m,g,p]=(0,ne.CQ)({activeTab:"overview",bannerStickied:!1,challenge:{},challenge_id:null,error:null,isAnonymous:null===(null===(t=s.app)||void 0===t?void 0:t.user),isTeamMember:!1,loading:!1,parent_hash:"",scrollspyVisible:!1,updating_published_status:!1,views:0,visible:!1}),{activeTab:x,bannerStickied:v,challenge:f,challenge_id:j,error:_,is_published:b,isTeamMember:A,loading:y,parent_hash:w,scrollspyVisible:S,updating_published_status:C,views:M,visible:k}=m,z=(null===f||void 0===f||null===(i=f.challenge_template)||void 0===i?void 0:i.challenge_type)||"classic",T=Za.Ay[z]||Za.Ay.classic,I=gz(z)[x]||[],E=async e=>{var s;e&&(g({challenge:{},challenge_id:null,error:null,loading:!0,parent_hash:(null===h||void 0===h||null===(s=h.location)||void 0===s?void 0:s.hash)||"",visible:!0}),await R(e),g({loading:!1}),!m.isTeamMember&&D(e))},F=()=>{"function"===typeof r&&r(),h.push(`${h.location.pathname}${w}`),p()},R=async s=>{try{var a;const{challenge:e,views:t}=await d.get(`/api/challenges/get/gallery_details/${s}`),{team:i}=e||{},l=null===i||void 0===i||null===(a=i.members)||void 0===a?void 0:a.find(e=>{var s;return(null===e||void 0===e||null===(s=e.user)||void 0===s?void 0:s.id)===c}),n=l&&(null===l||void 0===l?void 0:l.group_member_assignment),{is_published:r}=n||{};g({challenge:e,challenge_id:null===e||void 0===e?void 0:e.id,is_published:r,isTeamMember:!!l,views:t})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,loading:!1})}},D=async s=>{try{await d.get(`/api/challenges/view/gallery/${s}`)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a})}},B=e=>g({activeTab:e}),L=()=>"function"===typeof o&&o();return(0,l.useImperativeHandle)(a,()=>({hide:F,show:E,visible:k})),(0,N.jsxs)(fz,{value:{activeTab:x,bannerStickied:v,challenge:f,challenge_type:z,config:T,handleError:e=>g({error:e}),hideChallengeHubButton:n,hideScrollspy:()=>g({scrollspyVisible:!1}),is_published:b,isPhaseComplete:e=>(null===f||void 0===f?void 0:f.num_phases_complete)>=e,isPhaseStarted:e=>{var s;return((null===(s=m.challenge)||void 0===s?void 0:s.challenge_data)||[]).filter(s=>s.phase===e).some(e=>{let{data:s}=e;return s&&Object.keys(s).length>0})},isPhaseUnlocked:e=>((null===f||void 0===f?void 0:f.num_phases_complete)||0)>=e-1,isTeamMember:A,refreshChallenge:R,scrollSpyLocations:I,scrollspyVisible:S,setActiveTab:B,setChallengePublishedStatus:async()=>{try{if(!A)return;g({updating_published_status:!0});const{is_published:e}=await d.post("/api/users/profile/set/challenge",{challenge_id:j,is_published:!e});g({is_published:e,updating_published_status:!1}),L()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a})}},showReactionBreakdown:(e,s)=>{const a=null===u||void 0===u?void 0:u.current;a&&a.show(e,s)},showScrollspy:()=>g({scrollspyVisible:!0}),updating_published_status:C,views:M},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:_,variant:"danger",children:_}),(0,N.jsx)(xe,{centered:!0,className:"challenge-solution-details "+(v?"stickied":""),dialogClassName:"solution-modal-dialog",id:"challengeSolutionDetail
2sModal",onEscapeKeyDown:F,onHide:F,show:k,size:"xl",children:(0,N.jsx)(Me.x_,{loading:y,spinner:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,onHide:F}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center flex-fill h-100",children:(0,N.jsx)(Me.y$,{})})]}),children:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(nv(),{className:"banner-sticky-holder",onFixedToggle:e=>g({bannerStickied:e}),positionRecheckInterval:100,stickyClassName:"banner-sticky",topOffset:0,children:(0,N.jsx)(wz,{onHide:F,stickied:v})}),(0,N.jsx)(Az,{}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(Ce.S,{className:"challenge-solution-details-content-wrapper",children:[(0,N.jsx)(Ce.S,{className:"content-center",children:(0,N.jsx)(Hz,{})}),(0,N.jsx)(_z,{})]}),"overview"===x&&(0,N.jsx)(Ce.S,{className:"see-our-process",children:(0,N.jsxs)("div",{className:"text-contents d-flex flex-column",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Want to learn more?",id:"label.want_to_learn_more.4a6ffc46"})}),(0,N.jsx)(ve.A,{className:"p-0",onClick:()=>{const e=document.querySelector(".challenge-solution-details");e&&(e.scrollTo({behavior:"smooth",top:0}),B("process"))},variant:"link",children:(0,N.jsxs)("span",{className:"h3 d-flex align-items-center gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"See our process",id:"label.see_our_process.263709d2"})}),(0,N.jsx)(ze.Z0P,{fill:"#FFFFFF",size:24})]})})]})})]})]})})}),(0,N.jsx)(iz,{ref:u})]})});pz.displayName="ChallengeSolutionDetailsModal",pz.defaultProps={onHide:Function(),onPublishUpdate:Function()};var xz=pz;const vz=l.createContext({}),fz=vz.Provider,jz=(vz.Consumer,()=>(0,l.useContext)(vz));var _z=e=>{const s=jz(),{bannerStickied:a,hideScrollspy:t,scrollspyVisible:i}=s,l=(null===s||void 0===s?void 0:s.scrollSpyLocations)||[],n=l.map(e=>null===e||void 0===e?void 0:e.hash),r=e=>null===e||void 0===e?void 0:e.sub_locations.map(e=>null===e||void 0===e?void 0:e.hash),o=e=>{document.getElementById(e).scrollIntoView({behavior:"smooth",block:"start",inline:"start"}),t()},d=e=>{const s=document.querySelector(".challenge-solution-details"),t=e.getBoundingClientRect().top+s.scrollTop,i=a?-130:-315;s&&s.scrollTo({behavior:"smooth",top:t+i})};return(0,N.jsx)("aside",{className:`challenge-solution-details-scroll-nav ${i?"show":"hide"} ${a?"is-stickied":""}`,children:(0,N.jsxs)(Ce.S,{className:"scroll-nav-content",children:[(0,N.jsxs)("div",{className:"scroll-nav-header",children:[(0,N.jsx)("span",{className:"h5",children:(0,N.jsx)(ke.A,{defaultMessage:"Contents",id:"label.contents.437aea62"})}),(0,N.jsx)(ve.A,{className:"close-btn",id:"scrollNavCloseButton",onClick:t,variant:"link",children:(0,N.jsx)(ze.QCr,{fill:"#575757"})})]}),(0,N.jsx)(Xj.A,{className:"nav nav-pills flex-column scrollspy",componentTag:"nav",currentClassName:"parent-active",items:n,offset:-250,rootEl:".challenge-solution-details",scrolledPastClassName:"passed",children:l.map((e,s)=>{var a;return(0,N.jsxs)("div",{className:"nav-item nest-parent "+(null!==e&&void 0!==e&&e.sub_locations?"":"no-children"),children:[(0,N.jsx)(aa.A.Link,{className:"nav-link parent-link",onClick:()=>o(e.hash),scroll:d,smooth:!0,to:`#${null===e||void 0===e?void 0:e.hash}`,children:null===e||void 0===e?void 0:e.name},s),(null===e||void 0===e?void 0:e.sub_locations)&&(0,N.jsx)(Xj.A,{className:"nav nav-pills flex-column nested-scrollspy",componentTag:"nav",currentClassName:"child-active",items:r(e),offset:-250,rootEl:".challenge-solution-details",children:null===e||void 0===e||null===(a=e.sub_locations)||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)("div",{className:"nav-item nest-child",children:(0,N.jsx)(aa.A.Link,{className:"nav-link child-link",onClick:()=>o(e.hash),scroll:d,smooth:!0,to:`#${null===e||void 0===e?void 0:e.hash}`,children:null===e||void 0===e?void 0:e.name},s)},s))})]},s)})})]})})};var bz=e=>{const{views:s}=e;return(0,N.jsx)(Ce.S,{className:"challenge-solution-detail-view-counter",children:(0,N.jsxs)("span",{children:[(0,N.jsx)(ze.Ny1,{size:20})," ",`${s} view${s>1?"s":""}`]})})};var Az=e=>{const{siteUrl:s,user:a}=(0,n.nm)(),{challenge:t,handleError:i,refreshChallenge:r,showReactionBreakdown:o,views:d}=jz(),[c,h]=(0,l.useState)(window.innerWidth<=768),u=()=>{h(window.innerWidth<=768)};return(0,l.useLayoutEffect)(()=>(window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}
2),[]),(0,N.jsx)(Ce.S,{className:"challenge-solution-details-cta-strip",children:(0,N.jsxs)(Ce.S,{className:"cta-strip-contents",children:[(0,N.jsxs)(Ce.S,{className:"cta-strip-left",children:[a&&(0,N.jsx)(ZM,{challenge:t,onError:i,onSuccess:()=>r(null===t||void 0===t?void 0:t.id)}),(0,N.jsx)(XM,{challenge:t,onClick:o,tooltip:!0})]}),(0,N.jsx)(Ce.S,{className:"cta-strip-right",children:(0,N.jsx)(bz,{views:d||0})})]})})};var yz=t.p+"static/media/icon-challenge-hub.253ea7f434640bcd13a23a4f39d2d5e9.svg";var wz=e=>{const{onHide:s,stickied:a}=e,{siteUrl:t}=(0,n.nm)(),{bannerStickied:i,challenge:r,hideChallengeHubButton:o,is_published:d,isTeamMember:c,setChallengePublishedStatus:h,showScrollspy:u,updating_published_status:m}=jz(),{challenge_template:g,team:p}=r||{},x=((null===p||void 0===p?void 0:p.members)||[]).map(e=>e.user),[v,f]=(0,l.useState)(window.innerWidth<=768),j=()=>{f(window.innerWidth<=768)};(0,l.useLayoutEffect)(()=>(window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}),[]);const _=i||v?"icon-only":"";return(0,N.jsxs)("div",{className:"challenge-solution-details-banner",style:{backgroundImage:`url("${null===g||void 0===g?void 0:g.banner_path}")`},children:[(0,N.jsxs)("div",{className:"banner-inner",children:[(0,N.jsx)("div",{className:"buttons-container",children:c&&(0,N.jsx)("div",{className:"owner-buttons",children:!o&&(0,N.jsxs)(Le.Link,{className:`btn btn-translucent btn-pill text-white ${_}`,to:(()=>{var e,s;const a=null===r||void 0===r||null===(e=r.members)||void 0===e||null===(s=e[0])||void 0===s?void 0:s.group_member_assignment_component,{id:t,group_member_assignment_id:i}=a||{};return i&&t?`/assignment/${i}/${t}/content`:"#"})(),children:[(0,N.jsx)(Zs.A,{alt:"Challenge Hub icon",className:"me-2",src:yz}),(0,N.jsx)(ke.A,{defaultMessage:"Challenge hub",id:"label.challenge_hub.5540cc10"})]})})}),(0,N.jsxs)(Ce.S,{className:"challenge-solution-details-contents",children:[(0,N.jsx)("p",{className:(window.innerWidth>576?a?"text-start h2":"display-4":a?"h4":"display-4 pt-3")+"  challenge-template-name",children:null===g||void 0===g?void 0:g.title}),(0,N.jsx)("p",{className:(window.innerWidth>576?"h3":"h4")+"  team-name",children:null===p||void 0===p?void 0:p.name}),window.innerWidth<1200&&(0,N.jsx)(Ce.S,{className:"scrollspy-toggle-container",children:(0,N.jsx)(ve.A,{className:"pill translucent scrollspy-toggle",onClick:u,variant:"link",children:(0,N.jsx)(ze.OXb,{fill:"#FFFFFF",size:20})})})]})]}),(0,N.jsxs)(ve.A,{className:"modal-close-btn",id:"modalCloseButton",onClick:s,variant:"link",children:[(0,N.jsx)("span",{"aria-hidden":!0,children:"\xd7"}),(0,N.jsx)("span",{className:"sr-only",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})]}),(0,N.jsx)(Ce.S,{className:"team-avatars",children:(0,N.jsx)(tn,{borderSize:4,offset:-12,showOnline:!1,size:48,users:x})})]})};var Nz=e=>{const{phase:s,subphase:a}=e,{group_member_assignment_component_id:t,group_member_assignment_id:i,view:l}=(0,Pe.g)(),{isPhaseStarted:n,isPhaseUnlocked:r,isTeamMember:o}=jz(),d=n(s),c=r(s);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"p-5 text-center",style:{border:"2px dashed #ccc",borderRadius:10},children:[!o&&(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Incomplete",id:"label.incomplete.75f33cdf"})}),o&&(0,N.jsxs)(N.Fragment,{children:[c&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Le.Link,{to:`/assignment/${i}/${t}/${l}/${s}/${a}`,children:[d?(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Resume",id:"label.resume.d640c742"})}):(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})})," ",(0,N.jsx)(ze.Z0P,{})]})}),!c&&(0,N.jsxs)(Ce.S,{style:{color:"#777"},children:[(0,N.jsx)(ze.JhU,{})," ",(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Locked",id:"label.locked.a424e33d"})})]})]})]})})},Sz=t(42111),Cz=t(55132),Mz=t(39564);var kz=e=>{var s,a,t,i,r,o;const{styles:d}=(0,n.nm)(),c=d&&d.primary,{challenge:h,isPhaseComplete:u}=jz(),m=(null===h||void 0===h?void 0:h.challenge_data)||[],{challenge_statement:g,overview:p}=(null===h||void 0===h?void 0:h.challenge_template)||{},x=m.find(e=>1===e.phase&&2===e.subphase),v=(null===x||void 0===x||null===(s=x.data)||void 0===s?void 0:s.identifyAudience)||{},f=(null===v||void 0===v||null===(a=v.item)||void 0===a?void 0:a.value)||"",j=(null===v||void 0===v?void 0:v.text)||"No Audience Text Found",_=m.find(e=>4===e.phase&&1===e.subphase),b=(null===_||void 0===_||null===(t=_.data)||void 0===t?void 0:t.action_statement)||{},A=m.find(e=>4===e.phase&&2===e.subphase),{deliverable:y,deliverable_choice:w}=(null===A||void 0===A?void 0:A.data)||{},[S,C]=(0,l.useState)(!0);return(0,N.jsxs)(Ue.A,{children:[(0,N.jsxs)("section",{className:"overview-section the-challenge",id:"theChallenge",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Sz.default,{color:c,fontSize:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"The challenge",description:"",id:"label.the_challenge.a99d3c07"})})]}),(0,N.jsx)(Ce.S,{dangerouslySetInnerHTML:{__html:g}}),(0,N.jsxs)(Ce.S,{className:"collapse "+(S?"":"show"),children:[(0,N.jsx)("span",{className:"h4",children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",description:"",id:"label.overview.d4b1ea57"})}),(0,N.jsx)(Ce.S,{dangerouslySetInnerHTML:{__html:p}})]}),(0,N.jsx)(ve.A,{className:"p-0",onClick:()=>C(!S),variant:"link",children:S?(0,N.jsx)(ke.A,{defaultMessage:"Read More...",description:"",id:"label.read_more.dc0131a0"}):(0,N.jsx)(ke.A,{defaultMessage:"Show less",description:"",id:"label.show_less.94ea9b1d"})})]}),(0,N.jsxs)("section",{className:"overview-section our-audience",id:"ourAudience",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Mz.default,{color:c,fontSize:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"Our audience",description:"",id:"label.our_audience.269e1b45"})})]}),u(1)?(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Qe.A,{className:"audience",children:[(0,N.jsx)(Ve.A,{md:5,xs:12,children:(0,N.jsx)(Zs.A,{alt:"identified audie
2nce",fluid:!0,rounded:!0,src:f})}),(0,N.jsx)(Ve.A,{children:(0,ad.G9)(j,{preserveNewlines:!0})})]})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Nz,{phase:1,subphase:2})})]}),(0,N.jsxs)("section",{className:"overview-section our-solution",id:"ourSolution",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(Cz.default,{color:c,fontSize:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"Our solution",description:"",id:"label.our_solution.c129a84d"})})]}),u(4)?(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"solution",children:[(0,N.jsxs)("p",{children:[(0,N.jsxs)("strong",{children:[(0,N.jsx)(ke.A,{defaultMessage:"We will",description:"",id:"label.we_will.5daab980"})," "]}),(null===b||void 0===b||null===(i=b.we_will)||void 0===i?void 0:i.value)||"..."]}),(0,N.jsxs)("p",{children:[(0,N.jsxs)("strong",{children:[(0,N.jsx)(ke.A,{defaultMessage:"So that",description:"",id:"label.so_that.7fc46a9c"})," "]}),(null===b||void 0===b||null===(r=b.so_that)||void 0===r?void 0:r.value)||"..."]}),(0,N.jsxs)("p",{children:[(0,N.jsxs)("strong",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Ending in",description:"",id:"label.ending_in.d7de3f00"})," "]}),(null===b||void 0===b||null===(o=b.ending_in)||void 0===o?void 0:o.value)||"..."]})]})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Nz,{phase:4,subphase:1})})]}),(0,N.jsxs)("section",{className:"overview-section final-deliverable",id:"finalDeliverable",children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)("div",{className:"icon",children:(0,N.jsx)(cr.default,{color:c,fontSize:24})}),(0,N.jsx)("span",{className:"h2",children:(0,N.jsx)(ke.A,{defaultMessage:"Final deliverable",description:"",id:"label.final_deliverable.ac8cbb05"})})]}),u(4)?(0,N.jsx)(Ku,{deliverable:y,deliverable_choice:w}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Nz,{phase:4,subphase:2})})]})]})};const zz=e=>{let{entry:s}=e;const{deliverable:a,deliverable_choice:t}=(null===s||void 0===s?void 0:s.data)||{};return(0,N.jsx)(Ku,{deliverable:a,deliverable_choice:t})};zz.before=e=>{var s;let{entry:a}=e;const{deliverable_choice:t}=(null===a||void 0===a?void 0:a.data)||{};return(0,N.jsx)("div",{className:"remove-nested-padding mb-2",dangerouslySetInnerHTML:{__html:null!==(s=null===t||void 0===t?void 0:t.specifics)&&void 0!==s?s:""}})};const Tz={"1-1":e=>{var s;let{entry:a}=e;const t=(null===a||void 0===a||null===(s=a.data)||void 0===s?void 0:s.wordCloudList)||[];return(0,N.jsx)(Ce.S,{className:"word-cloud-container",children:(0,N.jsx)(wr,{list:t})})},"1-2":e=>{var s,a;let{entry:t}=e;const i=(null===t||void 0===t||null===(s=t.data)||void 0===s?void 0:s.identifyAudience)||{},l=(null===i||void 0===i||null===(a=i.item)||void 0===a?void 0:a.value)||"",n=(0,ad.G9)(null===i||void 0===i?void 0:i.text,{preserveNewlines:!0});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:n}),(0,N.jsx)(Zs.A,{alt:"The audience this challenge aims to help",className:"audience-image",fluid:!0,src:l})]})},"1-3":e=>{var s;let{entry:a}=e;const t=Object.entries((null===a||void 0===a||null===(s=a.data)||void 0===s?void 0:s.constraints)||{}).map(e=>e[1])||[];return(0,N.jsx)(Ce.S,{className:"constraints-container",children:null===t||void 0===t?void 0:t.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"constraint",children:[(0,N.jsx)(Ce.S,{className:"category",children:null===e||void 0===e?void 0:e.category}),(0,N.jsx)(Ce.S,{className:"text",children:null===e||void 0===e?void 0:e.text})]},s))})},"1-4":e=>{var s;let{challenge:a,entry:t}=e;const{guiding_questions:i=[]}=(null===a||void 0===a?void 0:a.challenge_template)||{},l=null===t||void 0===t||null===(s=t.data)||void 0===s?void 0:s.share_lanes;return(0,N.jsx)(N.Fragment,{children:null===i||void 0===i?void 0:i.map((e,s)=>{var a;return(0,N.jsxs)("div",{className:"w-100 share-what-you-know-container",children:[(0,N.jsxs)("div",{className:"question-container",children:[(0,N.jsx)("div",{className:"q-wrapper",children:s+1}),(0,N.jsx)("span",{className:"m-0",children:e})]}),(0,N.jsx)("div",{className:"share-grid",children:null===l||void 0===l||null===(a=l[s])||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)(vj,{dummy:!0,share:e,showContributions:!1},s))})]},s)})})},"2-1":e=>{var s,a;let{entry:t}=e;const i=Object.values(null!==(s=null===t||void 0===t||null===(a=t.data)||void 0===a?void 0:a.need_to_knows)&&void 0!==s?s:{});return(0,N.jsx)("div",{className:"need-to-know-grid gallery",children:null===i||void 0===i?void 0:i.map((e,s)=>(0,N.jsx)(Ge.A,{className:"need-to-know-card gallery-card",style:{maxWidth:216},children:(0,N.jsx)("div",{className:"need-to-know-inner",children:(0,N.jsxs)("div",{className:"d-flex flex-nowrap",children:[(0,N.jsx)("div",{className:"index",children:s+1}),(0,N.jsx)("div",{className:"description",children:e.value})]})})},s))})},"2-2":e=>{var s,a,t,i;let{challenge:l,entry:n}=e;const r=((null===l||void 0===l?void 0:l.challenge_data)||[]).find(e=>2===e.phase&&1===e.subphase),o=Object.values(null!==(s=null===r||void 0===r||null===(a=r.data)||void 0===a?void 0:a.need_to_knows)&&void 0!==s?s:{}),d=null!==(t=null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.share_lanes)&&void 0!==t?t:[];return(0,N.jsx)("div",{children:null===o||void 0===o?void 0:o.map((e,s)=>{var a;return(0,N.jsxs)("div",{className:"w-100",children:[(0,N.jsxs)("div",{className:"question-container",children:[(0,N.jsx)("div",{className:"q-wrapper",children:s+1}),(0,N.jsx)("span",{className:"m-0",children:e.value})]}),(0,N.jsx)("div",{className:"share-grid",children:null===d||void 0===d||null===(a=d[s])||void 0===a?void 0:a.map((e,s)=>(0,N.jsx)(Mj,{dummy:!0,share:e,showContributions:!1},s))})]},s)})})},"3-1":e=>{var s;let{entry:a}=e;const{share_lanes:t}=(null===a||void 0===a?void 0:a.data)||[];return(0,N.jsx)("div",{className:"share-grid",children:(null===t||void 0===t?void 0:t.length)>0&&(null===t||void 0===t||null===(s=t[0])||void 0===s?void 0:s.map((e,s)=>(0,N.jsx)(Mj,{dummy:!0,share:e,showContributions:!1},s)))})},"3-2":e=>{var s,a;let{entry:t}=e;const i=(null===t||void 0===t||null===(s=t.data)||void 0===s||null===(a=s.selected_idea)||void 0===a?void 0:a.item)||{};return(0,N.jsx)(Ce.S,{className:"chosen-idea",children:(0,N.jsx)(Mj,{dummy:!0,share:i,showContributions:!1})})},"4-1":e=>{var s;let{entry:a}=e;const{ending_in:t,so_that:i,we_will:l}=(null===a||void 0===a||null===(s=a.data)||void 0===s?void 0:s.action_statement)||{};return(0,N.jsxs)(Ce.S,{className:"statements",children:[(0,N.jsxs)("p",{children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"We will",description:"",id:"label.we_will.5daab980"})}),(null===l||void 0===l?void 0:l.value)||"..."]}),(0,N.jsxs)("p",{children:[(0,N.jsxs)("strong",{children:[(0,N.jsx)(ke.A,{defaultMessage:"So that",description:"",id:"label.so_that.7fc46a9c"})," "]}),(null===i||void 0===i?void 0:i.value)||"..."]}),(0,N.jsxs)("p",{children:[(0,N.jsxs)("strong",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Ending in",description:"",id:"label.ending_in.d7de3f00"})," "]}),(null===t||void 0===t?void 0:t.value)||"..."]})]})},"4-2":zz},Iz={decision_making:{"3-1":e=>{var s,a;let{entry:t}=e;const i=Array.isArray(null===t||void 0===t||null===(s=t.data)||void 0===s||null===(a=s.share_lanes)||void 0===a?void 0:a[0])?t.data.share_lanes[0]:[];return(0,N.jsx)(Ce.S,{className:"decision-board-preview d-flex flex-column gap-3",children:Za.tM.map(e=>{const s=(e=>i.find(s=>(null===s||void 0===s?void 0:s.decision_type)===e)||null)(e);return(0,N.jsxs)(Ce.S,{className:"decision-slot border rounded bg-white shadow-sm overflow-hidden",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center flex-wrap gap-2 px-3 py-2 border-bottom",children:[(0,N.jsx)(bo.A,{bg:"primary",children:e}),Za.bT[e]&&(0,N.jsx)("span",{className:"text-muted small",children:Za.bT[e]})]}),(0,N.jsx)(Ce.S,{className:"px-3 py-3",children:(null===s||void 0===s?void 0:s.text)||"..."})]},e)})})},"3-2":e=>{var s,a;let{entry:t}=e;const i=(null===t||void 0===t||null===(s=t.data)||void 0===s||null===(a=s.selected_idea)||void 0===a?void 0:a.item)||{};return(0,N.jsxs)(Ce.S,{className:"chosen-idea",children:[(null===i||void 0===i?void 0:i.decision_type)&&(0,N.jsx)(Ce.S,{className:"mb-1",children:(0,N.jsx)(bo.A,{bg:"primary",children:i.decision_type})}),(0,N.jsx)(Mj,{dummy:!0,share:i,showContributions:!1})]})}}},Ez=(e,s,a)=>{var t;const i=`${s}-${a}
2`,l=null===(t=Iz[e])||void 0===t?void 0:t[i];if(l)return l;return("classic"===e||"decision_making"===e)&&Tz[i]||null},Fz={classic:{"2-2":{phase:2,subphase:1}}};const Rz={1:(0,N.jsx)(ke.A,{defaultMessage:"Identify and understand the problem",description:"",id:"label.identify_and_understand_the_proble.8f9d39b1"}),2:(0,N.jsx)(ke.A,{defaultMessage:"Learn what you need to know",description:"",id:"label.learn_what_you_need_to_know.aeeae8fc"}),3:(0,N.jsx)(ke.A,{defaultMessage:"Brainstorm and generate ideas",description:"",id:"label.brainstorm_and_generate_ideas.b71bfd80"}),4:(0,N.jsx)(ke.A,{defaultMessage:"Make your ideas come to life",description:"",id:"label.make_your_ideas_come_to_life.8cc80824"})},Dz=e=>Rz[e]||null;var Bz=e=>{var s,a,t,i;const{phase:r,subphase:o}=e,{utils:d}=(0,n.nm)(),{config:c}=jz(),[h,u]=(0,l.useState)(!1),m=(0,l.useRef)(null),g=(null===c||void 0===c||null===(s=c.phases)||void 0===s||null===(a=s[r])||void 0===a||null===(t=a.subphases)||void 0===t||null===(i=t[o])||void 0===i?void 0:i.description)||d.getSubphaseDescription(r,o);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{className:"subphase-info-button",onBlur:()=>u(!1),onFocus:()=>u(!0),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),ref:m,variant:"link",children:(0,N.jsx)(Zs.A,{"aria-hidden":!0,height:18,src:Gj,width:18})}),(0,N.jsx)(bi.A,{placement:"left",show:h,target:m.current,children:e=>(0,N.jsx)(Qa.A,(0,F.A)((0,F.A)({className:"subphase-popover",id:"overlay-example"},e),{},{children:g}))})]})};const Pz={1:fj,2:zj,3:Ej,4:Dj};var Lz=e=>{const{challenge_type:s,phase:a,phaseConfig:t}=e,{challenge:i,isPhaseComplete:l}=jz(),{challenge_data:n=[]}=i||{},r=(null===t||void 0===t?void 0:t.subphases)||{},o=(e=>Pz[e]||null)(a),d="classic"===s?Dz(a):(null===t||void 0===t?void 0:t.tagline)||Dz(a),c=l(a);return(0,N.jsxs)("section",{className:`process-section ${oz(a)}`,id:rz(a),children:[(0,N.jsxs)(Ce.S,{className:"heading",children:[(0,N.jsx)(Ce.S,{className:"icon",children:o&&(0,N.jsx)(Zs.A,{height:32,src:o,width:32})}),(0,N.jsxs)(Ce.S,{className:"headings",children:[(0,N.jsx)("span",{className:"h2 heading",children:null===t||void 0===t?void 0:t.title}),(0,N.jsx)("span",{className:"subheading",children:d})]})]}),Object.entries(r).map(e=>{let[t,r]=e;const o=Number(t),d=dz(a,o),h=((e,s)=>{var a;return(null===(a=nz[`${e}-${s}`])||void 0===a?void 0:a.className)||""})(a,o),u=((e,s)=>{var a;return(null===(a=nz[`${e}-${s}`])||void 0===a?void 0:a.headerClassName)||""})(a,o),m=Ez(s,a,o),g=((e,s,a)=>{var t;return(null===(t=Fz[e])||void 0===t?void 0:t[`${s}-${a}`])||{phase:s,subphase:a}})(s,a,o),p=n.find(e=>e.phase===a&&e.subphase===o),x="object"===typeof r?null===r||void 0===r?void 0:r.title:r;return(0,N.jsxs)(Ce.S,{className:`subsection ${h}`,id:d,children:[(0,N.jsxs)(Ce.S,{className:`subsection-header ${u}`.trim(),children:[(0,N.jsx)("p",{className:"subsection-heading h4",children:x}),(0,N.jsx)(Bz,{phase:g.phase,subphase:g.subphase})]}),(null===m||void 0===m?void 0:m.before)&&m.before({challenge:i,entry:p,isPhaseComplete:l}),c&&m?(0,N.jsx)(m,{challenge:i,entry:p,isPhaseComplete:l}):c&&!m?(0,N.jsx)(Ce.S,{className:"p-4 text-center text-muted",style:{border:"2px dashed #ccc",borderRadius:10},children:(0,N.jsx)(ke.A,{defaultMessage:"No preview available for this step.",id:"label.no_preview_available_for_this_step.d258a91a"})}):(0,N.jsx)(Nz,{phase:a,subphase:o})]},t)})]})};var Oz=e=>{const{challenge_type:s,config:a}=jz(),t=(null===a||void 0===a?void 0:a.phases)||{};return(0,N.jsx)(N.Fragment,{children:Object.entries(t).filter(e=>{let[s]=e;return Number(s)<=4}).map(e=>{let[a,t]=e;return(0,N.jsx)(Lz,{challenge_type:s,phase:Number(a),phaseConfig:t},a)})})};var Hz=()=>{const{activeTab:e,challenge:s,setActiveTab:a}=jz();return(0,N.jsxs)(Ce.S,{className:"challenge-solution-details-tabs",children:[(0,N.jsxs)(aa.A,{activeKey:e,className:"flex-row tabs-primary mt-4 mb-3",onSelect:a,children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{className:"gallery-detail-tab",eventKey:"overview",children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{className:"gallery-detail-tab",eventKe
2y:"process",children:(0,N.jsx)(ke.A,{defaultMessage:"Process",id:"label.process.e083bd83"})})})]}),(0,N.jsxs)($k.A,{activeKey:e,defaultActiveKey:"overview",children:[(0,N.jsx)(ld.A,{eventKey:"overview",children:"overview"===e&&!(0,T.isEmpty)(s)&&(0,N.jsx)(kz,{})}),(0,N.jsx)(ld.A,{eventKey:"process",children:"process"===e&&!(0,T.isEmpty)(s)&&(0,N.jsx)(Oz,{})})]})]})};class Uz extends l.Component{constructor(e){var s,a,t;super(e),this.loadMostReactedChallenges=async()=>{const{date_range:e,page:s,page_size:a,selected_challenge_templates:t,selected_groups:i}=this.state,{app:l}=this.props,{api:n}=l;await n.post(`/api/challenges/published/list/fan-favorites/${s}/${a}`,{challenge_templates:t,date_range:e,groups:i}).then(e=>{let{challenges:s}=e;this.setState({fan_favorites:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadMostRecentChallenges=async()=>{const{date_range:e,page:s,page_size:a,selected_challenge_templates:t,selected_groups:i}=this.state,{app:l}=this.props,{api:n}=l;await n.post(`/api/challenges/published/list/most-recent/${s}/${a}`,{challenge_templates:t,date_range:e,groups:i}).then(e=>{let{challenges:s}=e;this.setState({new_solutions:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadMostLikedChallenges=async()=>{const{date_range:e,page:s,page_size:a,selected_challenge_templates:t,selected_groups:i}=this.state,{app:l}=this.props,{api:n}=l;await n.post(`/api/challenges/published/list/most-liked/${s}/${a}`,{challenge_templates:t,date_range:e,groups:i}).then(e=>{let{challenges:s}=e;this.setState({most_liked:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadMostLovedChallenges=async()=>{const{date_range:e,page:s,page_size:a,selected_challenge_templates:t,selected_groups:i}=this.state,{app:l}=this.props,{api:n}=l;await n.post(`/api/challenges/published/list/heart-warmers/${s}/${a}`,{challenge_templates:t,date_range:e,groups:i}).then(e=>{let{challenges:s}=e;this.setState({heart_warmers:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadMostFiredChallenges=async()=>{const{date_range:e,page:s,page_size:a,selected_challenge_templates:t,selected_groups:i}=this.state,{app:l}=this.props,{api:n}=l;await n.post(`/api/challenges/published/list/on-fire/${s}/${a}`,{challenge_templates:t,date_range:e,groups:i}).then(e=>{let{challenges:s}=e;this.setState({on_fire:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadMyChallenges=async()=>{const{date_range:e,page:s,page_size:a,selected_challenge_templates:t,selected_groups:i}=this.state,{app:l}=this.props,{api:n}=l;await n.post(`/api/challenges/published/list/my-solutions/${s}/${a}`,{challenge_templates:t,date_range:e,groups:i}).then(e=>{let{challenges:s}=e;this.setState({my_solutions:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadChallengeTemplatesList=async()=>{const{selected_groups:e}=this.state,{app:s}=this.props,{api:a}=s;await a.post("/api/challenge-templates/list/by-groups-list",{groups:e}).then(e=>{let{challenge_templates:s}=e;const a=Array.isArray(s)?null===s||void 0===s?void 0:s.map(e=>null===e||void 0===e?void 0:e.id):[];this.setState({challenge_templates:s,selected_challenge_templates:a},()=>{this.loadChallenges()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.loadChallenges=async()=>{await Promise.all([this.loadMostReactedChallenges(),this.loadMostRecentChallenges(),this.loadMostLikedChallenges(),this.loadMostLovedChallenges(),this.loadMostFiredChallenges(),this.loadMyChallenges()]).then(()=>{const{fan_favorites:e,heart_warmers:s,most_liked:a,most_recent:t,my_solutions:i,new_solutions:l,on_fire:n}=this.state,r=[{challenge:n[0],slug:"on_fire",title:"On Fire"},{challenge:e[0],slug:"fan_favorite",title:"Fan Favorite"},{challenge:a[0],slug:"most_liked",title:"Most Liked"},{challenge:s[0],slug:"heart_warmer",title:"Heart Warmer"}];let o=0;
2[e,a,s,n,i,l,t].forEach(e=>Array.isArray(e)&&(o+=e.length)),this.setState({featured_cards:r,total_challenges_count:o})}).catch(e=>{this.setState({error:e})})},this.loadUnfilteredChallengeCount=async e=>{const{app:s}=this.props,{api:a}=s;return await a.post("/api/challenges/get/published/count",{groups:e}).then(e=>{let{count:s}=e;return this.setState({unfiltered_total:s}),s}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.searchChallenges=async e=>{const{date_range:s,page:a,page_size:t,search_category_filter:i,selected_challenge_templates:l,selected_groups:n}=this.state,{app:r}=this.props,{api:o}=r;this.setState({loading:!0}),await o.post(`/api/challenges/published/list/search/${a}/${t}`,{category:i,challenge_templates:l,date_range:s,groups:n,search_text:e}).then(s=>{let{challenges:a}=s;this.setState({loading:!1,search_results:a,search_text:e},()=>this.navigateToCategoryList("search-results"))}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.showSolutionModal=(e,s)=>{this.solution_modal&&this.solution_modal.show(s)},this.showGalleryWelcomeModal=()=>{this.welcome_modal&&this.welcome_modal.show()},this.getHasSeenGalleryWelcome=()=>localStorage.getItem("has_seen_gallery_welcome"),this.setHasSeenGalleryWelcome=e=>{localStorage.setItem("has_seen_gallery_welcome",e)},this.updateSelectedGroupsAndRefresh=e=>{var s;e&&(this.state.selected_groups.includes(e)&&(null===(s=this.state.selected_groups)||void 0===s?void 0:s.length)<=1||this.setState(s=>{let a=[...s.selected_groups];return a.includes(e)?a=a.filter(s=>s!==e):a.push(e),{selected_groups:a}},async()=>{await this.loadChallenges()}))},this.updateSelectedChallengeTemplatesAndRefresh=e=>{var s;e&&(this.state.selected_challenge_templates.includes(e)&&(null===(s=this.state.selected_challenge_templates)||void 0===s?void 0:s.length)<=1||this.setState(s=>{let a=[...s.selected_challenge_templates];return a.includes(e)?a=a.filter(s=>s!==e):a.push(e),{selected_challenge_templates:a}},async()=>{await this.loadChallenges()}))},this.updateDateRangeAndRefresh=e=>{if(!e)return;let s;switch(null===e||void 0===e?void 0:e.selected_range){case"week":s="Past Week";break;case"month":s="Past Month";break;case"three_month":s="Past 3 Months";break;case"six_month":s="Past 6 Months";break;case"nine_months":s="Past 9 Months";break;default:s="Custom"}this.setState({date_range:e,date_range_display:s},async()=>{await this.loadChallenges()})},this.parseCardData=e=>{var s,a,t,i,l,n,r,o,d,c,h,u,m,g,p,x,v;const{app:f}=this.props,{challenge_templates:j,completed:_,team:b,views:A}=e||{},y=(null===b||void 0===b?void 0:b.members)||[];let w=[];y&&y.map(e=>{w=[...w,null===e||void 0===e?void 0:e.user]});const N=(null===e||void 0===e?void 0:e.challenge_data)||[],S=(null===(s=N.find(e=>4===(null===e||void 0===e?void 0:e.phase)&&1===(null===e||void 0===e?void 0:e.subphase)))||void 0===s||null===(a=s.data)||void 0===a?void 0:a.action_statement)||{},C=(null===(t=N.find(e=>4===(null===e||void 0===e?void 0:e.phase)&&2===(null===e||void 0===e?void 0:e.subphase)))||void 0===t?void 0:t.data)||{};return{challenge_templates_image:(null===j||void 0===j?void 0:j.cover_path)||"",challenge_templates_title:(null===j||void 0===j?void 0:j.title)||"",completed_date:_||"",deliverable_choice:(null===C||void 0===C||null===(i=C.deliverable_choice)||void 0===i?void 0:i.title)||"",deliverable_ext:(null===C||void 0===C||null===(l=C.deliverable)||void 0===l||null===(n=l.file)||void 0===n?void 0:n.ext)||"",deliverable_type:(null===C||void 0===C||null===(r=C.deliverable)||void 0===r||null===(o=r.file)||void 0===o?void 0:o.type)||(null===C||void 0===C||null===(d=C.deliverable)||void 0===d?void 0:d.subtype),group_avatar:(null===b||void 0===b||null===(c=b.assignment)||void 0===c||null===(h=c.group)||void 0===h||null===(u=h.avatar)||void 0===u?void 0:u.location)||f.getGroupAvatar(""),group_id:(null===b||void 0===b||null===(m=b.assignment)||void 0===m||null===(g=m.group)||void 0===g?void 0:g.id)||"",group_name:(null===b||void 0===b||null===(p=b.assignment)||void 0===p||null===(x=p.group)||void 0===x?void 0:x.name)||"",team_members:w,team_name:(null===b||void 0===b?void 0:b.name)||"",views_count:A?A.length:0,we_will:(null===S||void 0===S||null===(v=S.we_will)||void 0===v?void 0:v.value)||"..."}}
2,this.resetFiltersAndRefresh=()=>{const{challenge_templates:e,memberships:s}=this.state;let a=[];s.forEach(e=>{let{group_id:s}=e;return s&&a.push(s)});let t=[];e.forEach(e=>(null===e||void 0===e?void 0:e.id)&&t.push(e.id)),this.setState({date_range:this.defaultDateRange,search_text:"",selected_challenge_templates:t,selected_groups:a},async()=>{this.setState({loading:!0},()=>this.navigateToCategoryList("")),await this.loadChallenges(),this.setState({loading:!1})})},this.handleError=e=>{this.setState({error:e})},this.navigateToCategoryList=(e,s)=>{const{history:a}=this.props,{search_category_filter:t,search_text:i}=this.state,l=e?"search-results"!==e?e:t:""===e?null:t,n="undefined"!==typeof s?s:i;this.setState({category:e,search_category_filter:l,search_text:n},()=>a.push(`/gallery/${e}`))},this.parseClasses=()=>{const{app:e}=this.props,{user:s}=e,a=(null===s||void 0===s?void 0:s.organization_memberships)||[];let t=[];for(const i of a){const e=(null===i||void 0===i?void 0:i.group_memberships)||[];for(const s of e)t=[...t,s]}return t},this.setPage=e=>{this.setState({page:e},()=>{this.loadChallenges()})},this.toKebab=e=>e.replace("_","-"),this.clearTimers=()=>{const{carouselRestartTimer:e,carouselTimer:s}=this.state;clearInterval(s),clearTimeout(e),this.setState({carouselRestartTimer:null,carouselTimer:null})},this.startCarouselTimer=e=>{this.setState({animationCallback:e,carouselRestartTimer:null,carouselTimer:setInterval(e,this.CAROUSEL_INTERVAL)})},this.startCarouselRestartTimer=()=>{this.setState({carouselRestartTimer:setTimeout(()=>this.startCarouselTimer(this.state.animationCallback),this.MOUSE_LEAVE_DELAY)})},this.getDeliverableIcon=(e,s,a,t)=>{switch(e){case"image":return(0,N.jsx)(ze.R1W,{className:"deliverable-icon",fill:a,size:s});case"video":return(0,N.jsx)(ze.Zgf,{className:"deliverable-icon",fill:a,size:s});case"file":return(e=>{switch(e){case"ppt":case"pptx":return(0,N.jsx)(ze.rgF,{className:"deliverable-icon",fill:a,size:s});case"doc":case"docx":return(0,N.jsx)(ze.WLb,{className:"deliverable-icon",fill:a,size:s});case"pdf":return(0,N.jsx)(ze.kl1,{className:"deliverable-icon",fill:a,size:s});case"rtf":return(0,N.jsx)(ze.t69,{className:"deliverable-icon",fill:a,size:s});default:return(0,N.jsx)(ze.Gp9,{className:"deliverable-icon",fill:a,size:s})}})(t);default:return(0,N.jsx)(ze.t69,{className:"deliverable-icon",fill:a,size:s})}};const i=ci()().subtract(6,"months").toDate().getTime(),l=ci()().toDate().getTime();this.defaultDateRange={end_date:l,start_date:i},this.CAROUSEL_INTERVAL=5e3,this.MOUSE_LEAVE_DELAY=3e4,this.state={animationCallback:()=>{},carouselRestartTimer:null,carouselTimer:null,category:(null===(s=this.props)||void 0===s||null===(a=s.match)||void 0===a||null===(t=a.params)||void 0===t?void 0:t.category)||null,challenge_templates:[],count:0,date_range:this.defaultDateRange,date_range_display:"Past 6 Months",error:null,fan_favorites:[],heart_warmers:[],loading:!0,memberships:[],most_liked:[],my_solutions:[],new_solutions:[],on_fire:[],page:1,page_size:20,search_category_filter:null,search_results:[],search_text:"",selected_challenge_templates:[],selected_groups:[],unfiltered_total:null}}componentDidMount(){this.setState({memberships:this.parseClasses()},async()=>{let e=[];this.state.memberships.forEach(s=>{let{group_id:a}=s;return a&&e.push(a)});(e.length?await this.loadUnfilteredChallengeCount(e):0)?this.setState({loading:!0,selected_groups:e},async()=>{await this.loadChallengeTemplatesList(),this.setState({loading:!1},()=>{this.getHasSeenGalleryWelcome()||this.showGalleryWelcomeModal()})}):this.setState({loading:!1})})}componentDidUpdate(e,s){var a,t,i;const l=s.category,n=null===(a=this.props)||void 0===a||null===(t=a.match)||void 0===t||null===(i=t.params)||void 0===i?void 0:i.category;l!==n&&l!==n&&this.setState({category:n})}render(){const{carouselRestartTimer:e,carouselTimer:s,category:a,challenge_templates:t,count:i,date_range:l,date_range_display:n,error:r,fan_favorites:o,featured_cards:d,featured_challenges:c,heart_warmers:h,loading:u,memberships:m,most_liked:g,my_solutions:p,new_solutions:x,on_fire:v,page:f,page_size:j,search_results:_,search_text:b,selected_challenge_templates:A,selected_groups:y,total_challenges_count:w,unfiltered_total:S}=this.state,C={"fan-favorites":o,"heart-warmers":h,"most-liked":g,"my-solutions":p,"new-solutions":x,"on-fire":v};return(0,N.jsx)(py,{className:"d-flex flex-column",children:(0,N.jsxs)(ek,{value:{carouselRestartTimer:e,carouselTimer:s,categories:C,category:a,challenge_templates:t,clearTimers:this.clearTimers,count:i,date_range:l,date_range_display:n,fan_favorites:o,featured_cards:d,featured_challenges:c,getDeliverableIcon:this.getDeliverableIcon,handleError:this.handleError,heart_warmers:h,loading:u,memberships:m,most_liked:g,my_solutions:p,navigateToCategoryList:this.navigateToCategoryList,new_solutions:x,on_fire:v,page:f,page_size:j,parseCardData:this.parseCardData,refreshChallenges:this.loadChallenges,refreshMostFiredChallenges:this.loadMostFiredChallenges,refreshMostLikedChallenges:this.loadMostLikedChallenges,refreshMostLovedChallenges:this.loadMostLovedChallenges,refreshMostReactedChallenges:this.loadMostReactedChallenges,refreshMostRecentChallenges:this.loadMostRecentChallenges,refreshMyChallenges:this.loadMyChallenges,resetFiltersAnd
2Refresh:this.resetFiltersAndRefresh,search_results:_,search_text:b,searchChallenges:this.searchChallenges,selected_challenge_templates:A,selected_groups:y,setPage:this.setPage,showSolutionModal:this.showSolutionModal,startCarouselRestartTimer:this.startCarouselRestartTimer,startCarouselTimer:this.startCarouselTimer,toKebab:this.toKebab,total_challenges_count:w,unfiltered_total:S,updateDateRangeAndRefresh:this.updateDateRangeAndRefresh,updateSelectedChallengeTemplatesAndRefresh:this.updateSelectedChallengeTemplatesAndRefresh,updateSelectedGroupsAndRefresh:this.updateSelectedGroupsAndRefresh},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:r,variant:"danger",children:r}),(0,N.jsx)(Ce.S,{className:"gallery-walk flex-fill",id:"galleryWalk",children:(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"flex-fill",loading:u,children:S?(0,N.jsx)(N.Fragment,{children:a?(0,N.jsx)(KM,{history:this.props.history}):(0,N.jsx)(OM,{})}):(0,N.jsx)(xk,{})})}),(0,N.jsx)(xz,{onPublishUpdate:this.refreshChallenges,ref:e=>this.solution_modal=e}),(0,N.jsx)(uk,{onHide:()=>this.setHasSeenGalleryWelcome(!0),onRef:e=>this.welcome_modal=e})]})})}}var Qz=(0,P.G0)((0,Pe.y)(Uz));var Vz=e=>{const{location:s}=e,a=js.A.parse(null===s||void 0===s?void 0:s.search);return(0,N.jsx)(py,{children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{className:"mt-5",children:(0,N.jsx)(Ve.A,{md:12,xl:12,children:(0,N.jsxs)(We.A,{show:!0,variant:"danger",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Error",description:"",id:"label.error.54a0e8c1"})}),a.message?(0,N.jsx)("strong",{children:a.message}):(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"Unknown error",description:"",id:"label.unknown_error.27c2ccd9"})})]})})})})})};var Gz=e=>{var s,a,t;const i=(0,l.useRef)(),n=(0,Pe.W6)(),{api:r,getUserOrganization:o,getUserOrganizationId:d,user:c,userHasRight:h,utils:u}=(0,P.nm)(),m=(0,l.useRef)(),[g,p,x]=(0,ne.CQ)({active_tab:"groups",assignments_count:0,count:0,error:null,filter_token:"active",group_assignments:[],groups:[],groups_count:0,learners_count:0,loading:!1,organization_id:(null===e||void 0===e||null===(s=e.match)||void 0===s||null===(a=s.params)||void 0===a?void 0:a.organization_id)||d()||null,page:1,page_size:10,sort_direction:"ASC",sort_token:"name",teams_count:0}),v=async()=>{try{const{count:e}=await r.get(`/api/facilitators/organization/groups/count/${null===g||void 0===g?void 0:g.organization_id}`);p({groups_count:e})}catch({err:err}){p({error:err})}},f=async()=>{try{const{count:e}=await r.get(`/api/facilitators/organization/groups/memberships/count/${null===g||void 0===g?void 0:g.organization_id}`);p({learners_count:e})}catch({err:err}){p({error:err})}},j=async()=>{try{const{count:e}=await r.get(`/api/facilitators/organization/groups/assignments/teams/count/${null===g||void 0===g?void 0:g.organization_id}`);p({teams_count:e})}catch({err:err}){p({error:err})}},_=async()=>{try{const{count:e}=await r.get(`/api/facilitators/organization/groups/assignments/count/${null===g||void 0===g?void 0:g.organization_id}`);p({assignments_count:e})}catch({err:err}){p({error:err})}},b=async e=>{try{p({loading:!0});const{page:s,page_size:a,sort_direction:t,sort_token:i}=e,{count:l,groups:n}=await r.post(`/api/facilitators/organization/groups/memberships/list/${null===e||void 0===e?void 0:e.organization_id}/${s}/${a}`,{sort_direction:t,sort_token:i});p({count:l,groups:n,loading:!1})}catch({err:err}){p({error:err,loading:!1})}},A=async e=>{try{const{filter_token:s,page:a,page_size:t,sort_direction:i,sort_token:l}=e;p({loading:!0});const{count:n,group_assignments:o}=await r.post(`/api/facilitators/organization/groups/assignments/list/${null===e||void 0===e?void 0:e.organization_id}/${a}/${t}`,{filter_token:s,sort_direction:i,sort_token:l});p({count:n,group_assignments:o,loading:!1})}catch(s){p({error:(null===s||void 0===s?void 0:s.err)||(null===s||void 0===s?void 0:s.message),loading:!1})}},y=e=>{p({filter_token:e},async e=>await A(e))};(0,l.useLayoutEffect)(()=>(()=>{const e=window.location.hash.substring(1);["groups","assignments"].includes(e)&&p({active_tab:e})})(),[]),(0,l.useEffect)(()=>(p({loading:!0}),Promise.all([v(),f(),j(),_()]).finally(()=>{p({loading:!1})}),x),[]),(0,l.useEffect)(()=>{(async()=>{switch(null===g||void 0===g?void 0:g.active_tab){case"groups":return await b(g);case"assignments":return await A(g);default:;}})()},[null===g||void 0===g?void 0:g.active_tab]);const{assignments_count:w,count:S,group_assignments:C,groups:M,groups_count:k,learners_count:z,loading:T,organization_id:I,page:E,page_size:F,sort_direction:R,sort_token:D,teams_count:B}=g,L=(null===c||void 0===c||null===(t=c.banner)||void 0===t?void 0:t.location)||(null===u||void 0===u?void 0:u.default_banner)||"";return(0,N.jsx)(Kz,{value:{assignments_count:w,count:S,group_assignments:C,groups:M,groups_count:k,handleChangePage:e=>p({page:e},async e=>{switch(null===e||void 0===e?void 0:e.active_tab){case"groups":return await b(e);case"assignments":return await A(e);default:return}}),handleSort:(e,s)=>{const a=e!==g.sort_token?"ASC":s;p({page:1,sort_direction:a,sort_token:e},async e=>{switch(null===e||void 0===e?void 0:e.active_tab){case"groups":return await b(e);case"assignments":return await A(e);default:return}})},learners_count:z,loading:T,organization_id:I,page:E,page_size:F,sort_direction:R,sort_token:D,teams_count:B},children:(0,N.jsxs)(py,{className:"facilitator-overview",children:[(0,N.jsx)(Ce.S,{className:"facilitator-overview-banner",style:{backgroundImage:`url("${L}")`},children:(0,N.jsx)(eT,{})}),(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>p({error:null}),show:g.error,variant:"danger",children:g.error}),(0,N.jsxs)(ld.A.Container,{activeKey:g.active_tab,id:"learnerAssignmentTabs",mountOnEnter:!0,onSelect:e=>{e!==g.active_tab&&p({active_tab:e,count:0,group_assignments:[],groups:[]})},role:"navigation",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary mt-4 mt-lg-0",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"groups",href:"#groups",children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"assignments",href:"#assignments",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsxs)(ld.A.Pane,{eventKey:"groups",children:[(0,N.jsxs)(Ce.S,{className:"clearfix mb-3",children:[h("manage_group",I)&&(0,N.jsx)(ve.A,{className:"float-end",onClick:async()=>{const e=null===m||void 0===m?void 0:m.current;e&&e.show()},size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"New group",id:"label.new_group.df796c65"})}),(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner groups",id:"label.learner_groups.9cb0b28e"})})]}),(0,N.jsx)(qz,{})]}),(0,N.jsxs)(ld.A.Pane,{eventKey:"assignments",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-lg-row justify-content-lg-between align-items-start align-items-lg-center mb-3 gap-2",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between justify-content-lg-end w-100 gap-2",children:[(0,N.jsxs)(Yh.A,{"aria-label":"Basic example",children:[(0,N.jsx)(ve.A,{active:"active"===g.filter_token,onClick:()=>y("active"),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",id:"label.active.92340695"})}),(0,N.jsx)(ve.A,{active:"completed"===g.filter_token,onClick:()=>y("completed"),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})})]}),(0,N.jsx)(ve.A,{disabled:!k,onClick:async()=>{const e=null===i||void 0===i?void 0:i.current;if(!e||!k)return;const{assignment:s}=await e.show()||{};s&&n.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`)},size:"lg",variant:k?"secondary":"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"New assignment",id:"label.new_assignment.1ee23709"})})]})]}),(0,N.jsx)(Zz,{})]})]})})})]})]}),(0,N.jsx)(cc,{ref:i}
2),(0,N.jsx)(qN,{add_facilitator:!0,enable_redirect:!0,organization:o(),ref:m})]})})};const Wz=l.createContext({}),Kz=Wz.Provider,Yz=(Wz.Consumer,()=>(0,l.useContext)(Wz));var qz=e=>{const{count:s,groups:a,handleChangePage:t,handleSort:i,loading:l,page:n,page_size:r,sort_direction:o,sort_token:d}=Yz();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ho,{defaultSortDirection:o,defaultSortToken:d,onSort:i,responsive:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"learners_count",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"assignments_count",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"created_at",children:(0,N.jsx)(ke.A,{defaultMessage:"Created",id:"label.created.d70b9e24"})})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:l,children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>(0,N.jsx)(Xz,{group:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:4,children:(0,N.jsx)("span",{className:"d-flex justify-content-center align-items-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No groups found.",id:"label.no_groups_found.ffb3951a"})})})})})]}),(0,N.jsx)(Lr,{count:s,onChange:t,page:n,page_size:r})]})};var Jz=t.p+"static/media/notification-icon.091eaa120383c7e1ffa182c130068ff0.svg";var Xz=e=>{var s;const{group:a}=e,t=(0,Pe.W6)(),{getGroupAvatar:i}=(0,n.nm)();return(0,N.jsxs)(io,{onClick:()=>t.push(`/admin/group/${null===a||void 0===a?void 0:a.id}`),style:{cursor:"pointer"},children:[(0,N.jsxs)(ro,{children:[(0,N.jsx)(Zs.A,{roundedCircle:!0,alt:"",height:40,src:(null===a||void 0===a||null===(s=a.avatar)||void 0===s?void 0:s.location)||i(a),width:40}),(0,N.jsx)("strong",{className:"ms-2",children:null===a||void 0===a?void 0:a.name})]}),(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column justify-content-center text-center",children:[(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.learner_count}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"align-self-center",text:"dark",children:(0,N.jsxs)("small",{className:"d-flex align-items-center",children:[(0,N.jsx)(ze.z5x,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"{count} Online",id:"label.count_online.61fba920",values:{count:null===a||void 0===a?void 0:a.online_learner_count}})]})})]})}),(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column justify-content-center text-center",children:[(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.assignment_count}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"align-self-center",text:"dark",children:(0,N.jsxs)("small",{className:"d-flex align-items-center",children:[(0,N.jsx)(Zs.A,{alt:"",className:"me-1",height:14,src:Jz,width:14}),(0,N.jsx)(ke.A,{defaultMessage:"{count} Active",id:"label.count_active.30a8fd59",values:{count:null===a||void 0===a?void 0:a.active_assignment_count}})]})})]})}),(0,N.jsx)(ro,{className:"text-center",children:(0,N.jsx)("span",{children:(0,N.jsx)(Gh.XU,{value:null===a||void 0===a?void 0:a.created_at})})})]})};var Zz=e=>{const{count:s,group_assignments:a,handleChangePage:t,handleSort:i,loading:l,page:n,page_size:r,sort_direction:o,sort_token:d}=Yz();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ho,{defaultSortDirection:o,defaultSortToken:d,onSort:i,responsive:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{name:"group",children:(0,N.jsx)(ke.A,{defaultMessage:"Group",id:"label.group.34ca0e76"})}),(0,N.jsx)(ho.Th,{name:"learners_count",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})}),(0,N.jsx)(ho.Th,{name:"teams_count",children:(0,N.jsx)(ke.A,{defaultMessage:"Teams",id:"label.teams.1e1a1c07"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"start",children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"due",children:(0,N.jsx)(ke.A,{defaultMessage:"Due",id:"label.due.9071738f"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:l,children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>(0,N.jsx)($z,{assignment:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:6,children:(0,N.jsx)("span",{className:"d-flex justify-content-center align-items-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No assignments found.",id:"label.no_assignments_found.bbef98fc"})})})})})]}),(0,N.jsx)(Lr,{count:s,onChange:t,page:n,page_size:r})]})};var $z=e=>{const{assignment:s}=e,a=(0,Pe.W6)(),{allow_teams:t,due:i,group:l,learners_count:n,start:r,teams_count:o,title:d,type:c}=s||{};return(0,N.jsxs)(io,{onClick:()=>a.push(`/admin/group/${null===l||void 0===l?void 0:l.id}/assignment/${null===s||void 0===s?void 0:s.id}`),style:{cursor:"pointer"},children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ad,{component:(()=>{var e,a;return"journey"===c?s:null===s||void 0===s||null===(e=s.group_assignment_components)||void 0===e||null===(a=e[0])||void 0===a?void 0:a[`${c}_template`]})(),type:c}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-3",children:[(0,N.jsx)("strong",{children:d}),(0,N.jsx)("small",{className:"text-muted text-capitalize",children:c})]})]})}),(0,N.jsx)(ro,{children:(0,N.jsx)("span",{children:null===l||void 0===l?void 0:l.name})}),(0,N.jsx)(ro,{className:"text-center",children:n}),(0,N.jsx)(ro,{className:"text-center",children:t?o:"-"}),(0,N.jsx)(ro,{children:(0,N.jsx)("span",{className:r?"":"text-muted",children:r?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:r}),", ",(0,N.jsx)(Gh.ib,{value:r})]}):(0,N.jsx)(ke.A,{defaultMessage:"No start date",id:"label.no_start_date.e7a39256"})})}),(0,N.jsx)(ro,{children:(0,N.jsx)("span",{className:i?"":"text-muted",children:i?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:i}),", ",(0,N.jsx)(Gh.ib,{value:i})]}):(0,N.jsx)(ke.A,{defaultMessage:"No due date",id:"label.no_due_date.6139ed04"})})})]})};var eT=e=>{const{user:s}=(0,n.nm)(),{assignments_count:a,groups_count:t,learners_count:i,teams_count:l}=Yz();return(0,N.jsxs)(Ue.A,{className:"facilitator-overview-header card d-flex flex-column flex-lg-row justify-content-between align-items-center p-4",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ya,{showOnline:!1,size:64,user:s}),(0,N.jsx)("h2",{className:"ms-3 mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Welcome back, {name}",id:"label.welcome_back_name.112b1022",values:{name:null===s||void 0===s?void 0:s.fullname}})})]}),(0,N.jsxs)(Ce.S,{className:"counts-container d-flex mt-2 mt-lg-0",children:[(0,N.jsx)(sT,{count:t,label:1===t?(0,N.jsx)(ke.A,{defaultMessage:"group",id:"label.group.ad936fcb"}):(0,N.jsx)(ke.A,{defaultMessage:"groups",id:"label.groups.4ed379d4"})}),(0,N.jsx)(sT,{count:a,label:1===a?(0,N.jsx)(ke.A,{defaultMessage:"assignment",id:"label.assignment.ce7a7c10"}):(0,N.jsx)(ke.A,{defaultMessage:"assignments",id:"label.assignments.ef8dcf71"})}),(0,N.jsx)(sT,{count:l,label:1===l?(0,N.jsx)(ke.A,{defaultMessage:"team",id:"label.team.ca8b22d0"}):(0,N.jsx)(ke.A,{defaultMessage:"teams",id:"label.teams.fadff6cf"})}),(0,N.jsx)(sT,{count:i,label:1===i?(0,N.jsx)(ke.A,{defaultMessage:"learner",id:"label.learner.1210f10c"}):(0,N.jsx)(ke.A,{defaultMessage:"learners",id:"label.learners.dc2ae857"})})]})]})};var sT=e=>{const{count:s,label:a}=e;return(0,N.jsxs)(Ce.S,{className:"count-widget groups d-flex flex-column",children:[(0,N.jsx)("h2",{children:s}),(0,N.jsx)("small",{className:"text-muted count-widget-label",children:a})]})},aT=Gz;const tT=l.createContext({}),iT=tT.Provider,lT=tT.Consumer,nT=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(lT,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin_organization:s,ref:e=>this.comp=e}))})}}return s},rT=()=>(0,l.useContext)(tT);const oT=l.createContext({}),dT=oT.Provider,cT=(oT.Consumer,()=>(0,l.useContext)(oT));var hT=e=>{const{handleSort:s,include_sub_orgs:a,loading:t,organizations:i,sort_direction:l,sort_token:n}=cT();return(0,N.jsxs)(ho,{defaultSortDirection:l,defaultSortToken:n,onSort:s,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),a&&(0,N.jsx)(ho.Th,{sortable:!0,name:"parent",children:(0,N.jsx)(ke.A,{defaultMessage:"Parent organization",id:"label.parent_organization.e6512a33"})}),(0,N.jsx)(ho.Th,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"})}),(0,N.jsx)(ho.Th,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"})}),(0,N.jsx)(ho.Th,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Sub-organizations",id:"label.sub_organizations.d02f11ef"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:a?6:5,loading:t,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map(e=>(0,N.jsx)(uT,{sub_org:e},null===e||void 0===e?void 0:e.id))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:a?6:5,children:(0,N.jsx)(ke.A,{defaultMessage:"No organizations foun
2d.",id:"label.no_organizations_found.2a91b4a9"})})})})]})};var uT=e=>{var s,a,t,i;const{sub_org:l}=e,{group_count:n,organization_count:r,user_count:o}=l||{},{userHasRight:d,userIsSiteAdmin:c}=((0,Pe.W6)(),(0,P.nm)()),{organization_id:h}=rT(),{handleDeleteOrganization:u,include_sub_orgs:m}=cT(),g=c()||0==(null===l||void 0===l?void 0:l.active_assignment_count);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{className:"fw-semibold",to:`/admin/organization/${null===l||void 0===l?void 0:l.id}`,children:null===l||void 0===l?void 0:l.name})}),m&&(0,N.jsx)(ro,{children:(null===(s=l.parent)||void 0===s?void 0:s.id)===h?(0,N.jsx)(N.Fragment,{children:null===(a=l.parent)||void 0===a?void 0:a.name}):(0,N.jsx)(Le.Link,{className:"fw-semibold",to:`/admin/organization/${null===(t=l.parent)||void 0===t?void 0:t.id}`,children:null===(i=l.parent)||void 0===i?void 0:i.name})}),(0,N.jsx)(ro,{className:"text-center",hiddenBelow:"lg",children:o}),(0,N.jsx)(ro,{className:"text-center",hiddenBelow:"lg",children:n}),(0,N.jsx)(ro,{className:"text-center",hiddenBelow:"lg",children:r}),(0,N.jsx)(ro,{className:"text-end",children:d("manage_organization",h)?(0,N.jsx)("div",{className:"d-flex justify-content-end gap-2",children:d("manage_organization",null===l||void 0===l?void 0:l.id)&&(0,N.jsx)(ve.A,{disabled:!g,onClick:()=>u(l),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})}):"-"})]})};const mT=["defaultSelected","onToggle"],gT=(0,l.forwardRef)((e,s)=>{var a;const{defaultSelected:t,onToggle:i}=e,n=(0,he.A)(e,mT),{parseBinary:r}=null!==(a=null===Re._$||void 0===Re._$?void 0:Re._$.binary)&&void 0!==a?a:{},[o,d,c]=(0,ne.CQ)({selected:r(t)}),h=(0,l.useRef)(!1),u=()=>d({selected:r(!o.selected)}),{selected:m}=o;return(0,l.useEffect)(()=>{null!==h&&void 0!==h&&h.current?i(m):h.current=!0},[m,h]),(0,l.useImperativeHandle)(s,()=>({selected:m,toggleSelected:u})),(0,N.jsx)(_e.A.Switch,(0,F.A)({checked:m,onChange:u},n))});gT.displayName="SubOrganizationFilterSwitch",gT.defaultProps={id:"subOrganizationFilterSwitch",defaultSelected:0,onToggle:Function()};var pT=gT;const xT=(0,l.forwardRef)((e,s)=>{var a;const{className:t,defaultSelected:i,onChange:n}=e,r=null===Re._$||void 0===Re._$||null===(a=Re._$.binary)||void 0===a?void 0:a.parseBinary,[o,d]=(0,ne.CQ)({selected:r(i)}),c=(0,l.useRef)(!1),h=()=>d({selected:r(!o.selected)}),{selected:u}=o;return(0,l.useEffect)(()=>{null!==c&&void 0!==c&&c.current?n(u):c.current=!0},[u,c]),(0,l.useImperativeHandle)(s,()=>({selected:u,toggleSelected:h})),(0,N.jsxs)(li.A,{autoClose:"outside",className:t,onSelect:h,children:[(0,N.jsx)(li.A.Toggle,{size:"sm",children:0==u?(0,N.jsx)(ke.A,{defaultMessage:"Active",description:"",id:"label.active.92340695"}):(0,N.jsx)(ke.A,{defaultMessage:"Archived",description:"",id:"label.archived.bdb86505"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsxs)(li.A.Item,{className:"d-flex",eventKey:0,children:[(0,N.jsx)(_e.A.Check,{checked:0==u,id:"archiveFilterActive",name:"archive_filter",style:{pointerEvents:"none"},type:"radio"}),(0,N.jsx)(_e.A.Label,{className:"ms-1 me-3 mb-0",htmlFor:"archiveFilterActive",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",description:"",id:"label.active.92340695"})})]}),(0,N.jsxs)(li.A.Item,{className:"d-flex",eventKey:1,children:[(0,N.jsx)(_e.A.Check,{checked:1==u,id:"activeFilterArchived",name:"archive_filter",type:"radio"}),(0,N.jsx)(_e.A.Label,{className:"ms-1 me-3 mb-0",htmlFor:"activeFilterArchived",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",description:"",id:"label.archived.bdb86505"})})]})]})]})});var vT=xT;const fT=l.createContext({}),jT=(fT.Provider,fT.Consumer),_T=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(jT,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin:s,ref:e=>this.comp=e}))})}}return s},bT=e=>
2{let{alignRight:s,children:a,ctaIcon:t,sidebarChildren:i,style:r}=e;const{getCookie:o,setCookie:d}=(0,n.nm)(),{parseBinary:c}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},[h,u]=(0,l.useState)(!0);(0,ne.Ee)(()=>u(!!c(o("sidebarOpen"))));let m=(0,N.jsxs)(Ce.S,{className:"sidebar",children:[(0,N.jsx)(ve.A,{className:"sidebar-cta",onClick:()=>{u(!h),d("sidebarOpen",c(!h))},children:t}),(0,N.jsx)(Ce.S,{className:"sidebar-content",children:i})]});return(0,N.jsx)(Ce.S,{className:"layout-sidebar-container",children:(0,N.jsxs)(Ce.S,{className:"layout-sidebar"+(h?" open":"")+(s?" right":" left"),style:r||{},children:[!s&&m,(0,N.jsx)(Ce.S,{className:"sidebar-body",style:r,children:a}),s&&m]})})};bT.defaultProps={alignRight:!1,ctaIcon:(0,N.jsx)(ze.OXb,{})};class AT extends l.Component{constructor(e){super(e);const{app:s}=e;this.state={has_site_access:Boolean(s.user.role)}}render(){const e=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{style:{paddingBottom:this.props.hasTopPadding?"var(--footer-offset)":0},children:[" ",this.props.children]}),(0,N.jsx)(Ce.S,{style:{background:"rgb(250,250,250)",bottom:0,height:"var(--footer-offset)",left:0,position:"absolute",width:"100%"},children:(0,N.jsx)(pg,{})})]});return(0,N.jsx)(py,{customTopnav:this.props.CustomTopNav,hideFooter:!0,style:{background:"#fafafa"},children:(0,N.jsx)(N.Fragment,{children:e})})}}AT.defaultProps={hasTopPadding:!0};var yT=(0,n.G0)(AT);class wT extends l.Component{constructor(e){super(e),this.state={}}render(){const{app:e}=this.props;let s=e.userHasSiteRole(),a=!1,t=!1,i=null;s||(i=e.userHasOrgRole("organization_admin"),i&&(a=!0)),s||a||(i=e.userHasOrgRole("facilitator"),i&&(t=!0));let l=!t&&!a&&!s;return(0,N.jsxs)(N.Fragment,{children:[!l&&(0,N.jsx)(bT,{sidebarChildren:(0,N.jsx)(Ce.S,{className:"sidebar-admin",children:(0,N.jsxs)(Ce.S,{className:"sidebar-admin-container",children:[(0,N.jsx)(Ce.S,{className:"sidebar-heading",children:(0,N.jsx)(ke.A,{defaultMessage:"MAIN MENU",description:"",id:"label.main_menu.cb2a4958"})}),s&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.YXz,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin#users",children:(0,N.jsx)(ke.A,{defaultMessage:"Users",description:"",id:"label.users.6b0cc904"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.iM1,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin#organizations",children:(0,N.jsx)(ke.A,{defaultMessage:"Organizations",description:"",id:"label.organizations.2730183d"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.vd0,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin#library",children:(0,N.jsx)(ke.A,{defaultMessage:"Library",description:"",id:"label.library.dc20b3d5"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.gks,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin#social",children:(0,N.jsx)(ke.A,{defaultMessage:"Social",description:"",id:"label.social.f1b7505a"})})]})]}),a&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.$BV,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin/organization/"+i+"/#dashboard",children:(0,N.jsx)(ke.A,{defaultMessage:"Dashboard",description:"",id:"label.dashboard.
267b69646"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.YXz,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin/organization/"+i+"/#users",children:(0,N.jsx)(ke.A,{defaultMessage:"Users",description:"",id:"label.users.6b0cc904"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.gks,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin/organization/"+i+"/#organizations",children:(0,N.jsx)(ke.A,{defaultMessage:"Sub-Organizations",description:"",id:"label.sub_organizations.7a1ff7a1"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.gks,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin/organization/"+i+"/#groups",children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",description:"",id:"label.groups.39bbb719"})})]})]}),t&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.$BV,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin/groups/"+i+"/#dashboard",children:(0,N.jsx)(ke.A,{defaultMessage:"My dashboard",description:"",id:"label.my_dashboard.f4c56c94"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.IFh,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/admin/challenge-templates",children:(0,N.jsx)(ke.A,{defaultMessage:"Design lab",description:"",id:"label.design_lab.9055ff21"})})]})]}),(0,N.jsx)(Ce.S,{className:"sidebar-heading mt-4",children:(0,N.jsx)(ke.A,{defaultMessage:"MANAGE",description:"",id:"label.manage.7f54bef9"})}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.aBc,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/profile",children:(0,N.jsx)(ke.A,{defaultMessage:"My profile",description:"",id:"label.my_profile.271c62fa"})})]}),(0,N.jsxs)(Ce.S,{className:"sidebar-item",children:[(0,N.jsx)(ze.axc,{className:"text-primary"})," ",(0,N.jsx)("a",{href:"/logout",children:(0,N.jsx)(ke.A,{defaultMessage:"Log out",description:"",id:"label.log_out.49616145"})})]})]})}),children:this.props.children}),l&&(0,N.jsx)(N.Fragment,{children:this.props.children})]})}}(0,n.G0)(wT);class NT extends l.Component{constructor(s){super(s),this.clearError=()=>this.setState({error:null}),this.refreshOrganizations=async()=>{try{var s,a;const e=null===(s=this.sub_org_switch)||void 0===s?void 0:s.current,t=null===(a=this.archive_filter)||void 0===a?void 0:a.current;if(!e||!t)return;const{selected:i}=e,{selected:l}=t,{admin_organization:n,app:r}=this.props,{organization:o,setSubOrgBadgeCount:d}=n||{},c=(null===o||void 0===o?void 0:o.id)||"",{api:h}=r||{},{page:u,page_size:m,search_term:g,sort_direction:p,sort_token:x}=this.state;this.setState({loading:!0,organizations:null});const{count:v,organizations:f}=await h.get(`/api/organizations/list/${u}/${m}`,{filter_archived:l,include_sub_orgs:i,organization_id:c,search_term:g,sort_direction:p,sort_token:x});this.setState({count:v,loading:!1,organizations:f}),d(v)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,loading:!1})}},this.startSearch=e=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1,search_term:e},this.refreshOrganizations)},1e3)},this.deleteOrganization=async s=>{try{const{app:e}=this.props,a=e.api;this.setState({error:null,loading:!0,organizations:null}),await a.get("/api/organizations/delete",{organization_id:s}),this.setState({loading:!1}),await this.refreshOrganizations()}catch(e){this.setState({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message),loading:!1})}},this.handleDeleteOrganization=e=>{var s;const{intl:a}=this.props,{formatMessage:t}=a,i=null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;i&&i.show({actions:[i.CancelAction(),i.Action({label:t({id:"label.delete_organization.a70d189a",defaultMessage:"Delete organization"}),onClick:()=>this.deleteOrganization(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete {organization}?",id:"label.are_you_sure_you_want_to_delete_or.9af5cefa",values:{organization:(0,N.jsx)("strong",{children:null===e||void 0===e?void 0:e.name})}})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can not be undone.",id:"label.this_action_can_not_be_und
2one.128d24d0"})})]}),title:t({id:"label.delete_organization.a70d189a",defaultMessage:"Delete organization"})})},this.includeSubOrgs=()=>{var e,s;return!(null===this||void 0===this||null===(e=this.sub_org_switch)||void 0===e||null===(s=e.current)||void 0===s||!s.selected)},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshOrganizations),this.handleChangeStatusFilter=()=>this.setState({page:1},this.refreshOrganizations),this.launchOrganizationEditor=()=>{var e;const s=null===this||void 0===this||null===(e=this.organization_editor)||void 0===e?void 0:e.current;s&&s.show()},this.state={count:0,error:null,loading:!0,organizations:null,page:1,page_size:10,search_term:"",show_organization_editor:!1,sort_direction:"ASC",sort_token:"name"},this.search_timer=null,this.sub_org_switch=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)(),this.archive_filter=(0,l.createRef)(),this.organization_editor=(0,l.createRef)()}componentDidMount(){this.refreshOrganizations()}render(){const{admin_organization:e,app:s}=this.props,{userHasRight:a}=s,{organization_id:t}=e||{},{count:i,error:l,loading:n,organizations:r,page:o,page_size:d,sort_direction:c,sort_token:h}=this.state,u=this.includeSubOrgs();return(0,N.jsxs)(dT,{value:{handleDeleteOrganization:this.handleDeleteOrganization,handleSort:this.handleSort,include_sub_orgs:u,loading:n,organizations:r,sort_direction:c,sort_token:h},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Sub-organizations",id:"label.sub_organizations.d02f11ef"})}),a("manage_organization",t)&&(0,N.jsx)(ve.A,{onClick:this.launchOrganizationEditor,style:{marginBottom:10},children:(0,N.jsx)(ke.A,{defaultMessage:"Add organization",id:"label.add_organization.0ca876da"})})]}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:l,variant:"danger",children:l}),(0,N.jsxs)(Qe.A,{className:"mb-2 align-items-center",children:[(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,sm:12,children:(0,N.jsxs)(Ei.A,{className:"mb-1",size:"sm",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(_e.A.Control,{onChange:e=>{var s;return this.startSearch(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},placeholder:"Search"})]})}),(0,N.jsx)(Ve.A,{className:"mb-1",md:2,sm:12,children:(0,N.jsx)(vT,{defaultSelected:!1,onChange:this.handleChangeStatusFilter,ref:this.archive_filter})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(Ce.S,{className:"d-inline-flex float-end",children:[(0,N.jsx)(_e.A.Label,{className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Include sub-organizations",id:"label.include_sub_organizations.b8a90835"})}),(0,N.jsx)(pT,{defaultSelected:!1,onToggle:this.refreshOrganizations,ref:this.sub_org_switch})]})})]}),(0,N.jsx)(hT,{}),(0,N.jsx)(Lr,{count:i,onChange:e=>this.setState({page:e},this.refreshOrganizations),page:o,page_size:d}),(0,N.jsx)(dF,{ref:this.organization_editor})]})}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}var ST=(0,Ke.Ay)((0,P.G0)(_T(nT(NT))));class CT extends l.Component{constructor(e){super(e),this.refreshCertifications=async()=>{var e;const{admin_organization:s,app:a}=this.props,t=null===(e=s.organization)||void 0===e?void 0:e.id;try{this.setState({certifications:null,loading:!0});const{certifications:e,count:s}=await a.api.get(`/api/organizations/certifications/list/${this.state.page}/${this.state.page_size}`,{organization_id:t,sort_direction:this.state.sort_direction,sort_token:this.state.sort_token});this.setState({certifications:e,count:s,loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.saveSettings=async e=>{const{admin_organization:s,app:a}=this.props,{organization_id:t}=s;let{enable_certification_filter:i}=e;try{this.setState({loading:!0}),await a.api.post("/api/organizations/certification-filter/enable",{enable_certification_filter:i,organization_id:t}),this.setState({loading:!1},()=>s.refreshOrganization())}catch({err:err}){this.setState({error:err,loading:!1})}},this.addCertifications=async e=>{if(null===e||void 0===e||!e.length)return;const{admin_organization:s,app:a}=this.props,{organization_id:t}=s;try{this.setState({picker_loading:!0}),await a.api.post("/api/organizations/certifications/add",{certification_ids:e,organization_id:t}),this.setState({picker_loading:!1},()=>this.refreshCertifications())}catch({err:err}){this.setState({error:err,picker_loading:!1})}},this.removeCertification=async e=>{const{app:s}=this.props;try{this.setState({loading:!0}),await s.api.post(`/api/organizations/certifications/remove/${null===e||void 0===e?void 0:e.id}`),this.setState({loading:!1},()=>this.refreshCertifications())}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleRemoveCertification=e=>{var s,a,t,i;const l=null===(s=this.dialog)||void 0===s?void 0:s.current;if(!l)return;const{admin_organization:n,intl:r}=this.props,{formatMessage:o}=r,d=(null===e||void 0===e||null===(a=e.certification_template_stub)||void 0===a||null===(t=a.current)||void 0===t?void 0:t.t
2itle)||"";l.show({actions:[l.CancelAction(),l.Action({label:o({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:()=>this.removeCertification(e),variant:"danger"})],body:o({id:"label.remove_access_to_title_from_org.239573d7",defaultMessage:"Remove access to {title} from {org}"},{org:null===(i=n.organization)||void 0===i?void 0:i.name,title:d}),title:o({id:"label.remove_certification_access.676cc564",defaultMessage:"Remove certification access"})})},this.searchCertifications=async e=>{const{admin_organization:s,app:a}=this.props,{organization:t}=s,{picker_page:i,picker_page_size:l,picker_search:n}=this.state,r=e||i,o=(null===t||void 0===t?void 0:t.parent_id)||null;try{this.setState({picker_loading:!0});const{certification_templates:e,count:s}=await a.api.post(`/api/certification-templates/search/${r}/${l}`,{organization_id:o,search_term:n});this.setState({picker_count:s,picker_loading:!1,picker_page:r,picker_results:e||[]})}catch({err:err}){this.setState({error:err,picker_loading:!1})}},this.openPicker=()=>this.setState({picker_open:!0,picker_page:1,picker_search:""},()=>this.searchCertifications(1)),this.closePicker=()=>this.setState({picker_open:!1,picker_results:[],picker_search:""}),this.handleAccessAll=e=>{var s;const a=null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{admin_organization:t,intl:i}=this.props,{organization:l}=t,{formatMessage:n}=i;l.enable_certification_filter!=(null===e||void 0===e?void 0:e.enable_certification_filter)&&a.show({actions:[a.CancelAction(),a.Action({label:n({id:"label.give_access.ad2cee8f",defaultMessage:"Give access"}),onClick:()=>this.saveSettings(e),variant:"primary"})],body:n({id:"label.name_will_have_access_to_all_certi.e9f116e3",defaultMessage:"{name} will have access to all certifications"},{name:null===l||void 0===l?void 0:l.name}),title:n({id:"label.give_access_to_all_certifications.2b65d549",defaultMessage:"Give access to all certifications"})})},this.handleAccessSelected=e=>{var s;const a=null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{admin_organization:t,intl:i}=this.props,{organization:l}=t,{formatMessage:n}=i;l.enable_certification_filter!=(null===e||void 0===e?void 0:e.enable_certification_filter)&&a.show({actions:[a.CancelAction(),a.Action({label:n({id:"label.restrict_access.0b18fffc",defaultMessage:"Restrict access"}),onClick:()=>this.saveSettings(e),variant:"primary"})],body:n({id:"label.name_will_only_have_access_to_sele.b21b3264",defaultMessage:"{name} will only have access to selected certifications"},{name:null===l||void 0===l?void 0:l.name}),title:n({id:"label.restrict_certification_access.7591f0d5",defaultMessage:"Restrict certification access"})})},this.state={certifications:null,count:0,error:null,loading:!0,page:1,page_size:10,picker_count:0,picker_loading:!1,picker_open:!1,picker_page:1,picker_page_size:8,picker_results:[],picker_search:"",sort_direction:"ASC",sort_token:"title"},this.dialog=(0,l.createRef)()}componentDidMount(){this.refreshCertifications()}render(){const{admin_organization:e}=this.props,{certifications:s,count:a,error:t,loading:i,page:l,page_size:n,picker_count:r,picker_loading:o,picker_open:d,picker_page:c,picker_page_size:h,picker_results:u,picker_search:m}=this.state,{organization:g}=e,{enable_certification_filter:p}=g,x=new Set((s||[]).map(e=>e.certification_template_stub_id)),v=!(null===g||void 0===g||!g.parent_id),f=v?(0,N.jsx)(ke.A,{defaultMessage:"All parent organization certifications",id:"label.all_parent_organization_certificat.bbfadce1"}):(0,N.jsx)(ke.A,{defaultMessage:"All certifications",id:"label.all_certifications.4af98858"}),j=v?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{children:[null===g||void 0===g?void 0:g.name," "]}),(0,N.jsx)(ke.A,{defaultMessage:"will have access to all certifications available to the parent organization",id:"label.will_have_access_to_all_certificat.51079190"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{children:[null===g||void 0===g?void 0:g.name," "]}),(0,N.jsx)(ke.A,{defaultMessage:"will have access to all certifications, including newly created ones",id:"label.will_have_access_to_all_certificat.5fedfd03"})]});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certification access",id:"label.certification_access.6f589215"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:t,variant:"danger",children:t}),(0,N.jsxs)(Ge.A,{body:!0,className:"mt-3 mb-2",children:[(0,N.jsxs)(_e.A,{className:"admin-certification-settings",children:[(0,N.jsxs)(Ce.S,{className:"d-flex mb-2",onClick:()=>this.handleAccessAll({enable_certification_filter:!1}),children:[(0,N.jsx)(sy,{checked:0==p,className:"d-flex flex-column",type:"radio"}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:f})}),(0,N.jsx)("span",{children:j})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex mb-2",children:[(0,N.jsx)(Ce.S,{className:"d-flex",onClick:()=>this.handleAccessSelected({enable_certification_filter:!0}),children:(0,N.jsx)(sy,{checked:1==p,className:"d-flex flex-column",type:"radio"})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Selected certifications only",id:"label.selected_certifications_only.d0543780"})})}),(0,N.jsxs)("span",{children:[null===g||void 0===g?void 0:g.name," ",(0,N.jsx)(ke.A,{defaultMessage:"will only have access to certifications selected below",id:"label.will_only_have_access_to_certifica.20469c22"})]})]}),p&&(0,N.jsxs)(ve.A,{className:"ms-auto mb-2 d-flex align-items-center",onClick:this.openPicker,size:"sm",variant:"tertiary",children:[(0,N.jsx)(ze.OiG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Select certifications",id:"label.select_certifications.25c03dbe"})]})]})]}),p&&(0,N.jsx)(Me.x_,{loading:i,spinner:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Me.y$,{})}),children:null!==s&&void 0!==s&&s.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(qa.A,{hover:!0,responsive:!0,striped:!0,className:"mb-0 table-rounded",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)("th",{})]})}),(0,N.jsx)("tbody",{children:s.map((e,s)=>{var a;const t=null===e||void 0===e||null===(a=e.certification_template_stub)||void 0===a?void 0:a.current;return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[null!==t&&void 0!==t&&t.icon_path?(0,N.jsx)("img",{alt:"",src:t.icon_path,style:{flexShrink:0,height:28,objectFit:"contain",width:28}}):(0,N.jsx)(ze.veT,{className:"text-muted",size:18,style:{flexShrink:0}}
2),(0,N.jsx)("strong",{children:null===t||void 0===t?void 0:t.title})]})}),(0,N.jsx)("td",{className:"text-muted small",children:(null===t||void 0===t?void 0:t.description)||"\u2014"}),(0,N.jsx)("td",{className:"text-end",children:(0,N.jsx)(ve.A,{className:"text-danger p-0",onClick:()=>this.handleRemoveCertification(e),variant:"link",children:(0,N.jsx)(ze.QCr,{})})})]},s)})})]}),(0,N.jsx)(Lr,{count:a,onChange:e=>this.setState({page:e},this.refreshCertifications),page:l,page_size:n})]}):(0,N.jsx)(Ge.A,{body:!0,className:"justify-content-center align-items-center text-center",style:{backgroundColor:"rgba(213, 217, 220, 0.32)",border:"0px"},children:(0,N.jsxs)(Ce.S,{style:{width:"240px"},children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"No certifications",id:"label.no_certifications.c5a3d374"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This organization does not have access to any certifications",id:"label.this_organization_does_not_have_ac.8e1e26b7"})}),(0,N.jsxs)(ve.A,{onClick:this.openPicker,children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Add certifications",id:"label.add_certifications.8d2370c0"})]})]})})})]}),(0,N.jsxs)(xe,{onHide:this.closePicker,show:d,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select certifications",id:"label.select_certifications.25c03dbe"})})}),(0,N.jsxs)(xe.Body,{className:"p-0",children:[(0,N.jsx)(Ce.S,{className:"p-3 border-bottom",children:(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(_e.A.Control,{className:"flex-grow-1",onChange:e=>this.setState({picker_search:e.target.value}),onKeyDown:e=>"Enter"===e.key&&(e.preventDefault(),this.searchCertifications(1)),placeholder:"Search certifications...",value:m}),(0,N.jsx)(ve.A,{onClick:()=>this.searchCertifications(1),children:(0,N.jsx)(ze.KSO,{})})]})}),(0,N.jsxs)(Me.x_,{loading:o,children:[(0,N.jsxs)(yl.A,{variant:"flush",children:[null===u||void 0===u?void 0:u.map((e,s)=>{const a=x.has(e.certification_template_stub_id);return(0,N.jsxs)(yl.A.Item,{action:!a,className:"d-flex align-items-center gap-3 py-3 "+(a?"opacity-50":""),onClick:a?void 0:()=>this.addCertifications([e.id]),style:a?{cursor:"default"}:{},children:[e.icon_path?(0,N.jsx)("img",{alt:"",src:e.icon_path,style:{flexShrink:0,height:32,objectFit:"contain",width:32}}):(0,N.jsx)(ze.veT,{className:"text-muted",size:22,style:{flexShrink:0}}),(0,N.jsxs)(Ce.S,{className:"flex-grow-1",children:[(0,N.jsx)("strong",{className:"d-block",children:e.title}),e.description&&(0,N.jsx)("small",{className:"d-block text-muted",children:e.description})]}),a&&(0,N.jsx)("small",{className:"text-muted ms-auto",style:{flexShrink:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Added",id:"label.added.6b02e0d3"})})]},s)}),!(null!==u&&void 0!==u&&u.length)&&!o&&(0,N.jsx)(yl.A.Item,{className:"text-center text-muted py-4",children:(0,N.jsx)(ke.A,{defaultMessage:"No certifications found",id:"label.no_certifications_found.5c62e166"})})]}),(0,N.jsx)(Ce.S,{className:"p-2",children:(0,N.jsx)(Lr,{count:r,onChange:e=>this.setState({picker_page:e},()=>this.searchCertifications(e)),page:c,page_size:h})})]})]})]}),(0,N.jsx)(je,{ref:this.dialog})]})}}var MT=(0,Ke.Ay)((0,n.G0)(_T(nT(CT))));const kT=l.createContext({}),zT=kT.Provider,TT=kT.Consumer,IT=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(TT,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{dashboard:s,ref:e=>{this.comp=e}}))})}}return s},ET=()=>(0,l.useContext)(kT);var FT=s=>{const{type:a}=s,{api:t}=(0,P.nm)(),{end_date:i,group_id:n,organization_id:r,selected_date_end:o,selected_date_start:d,start_date:c}=ET(),[h,u,m]=(0,ne.CQ)({data:null,error:null,loading:!0}),{data:g,error:p,loading:x}=h,v=e=>[{learners:null===e||void 0===e?void 0:e.lt_12,name:"< 12"},{learners:null===e||void 0===e?void 0:e.btw_12_24,name:"12-24"},{learners:null===e||void 0===e?void 0:e.btw_24_72,name:"24-72"},{learners:null===e||void 0===e?void 0:e.btw_72_120,name:"72-120"},{learners:null===e||void 0===e?void 0:e.gt_120,name:"> 120"}];return(0,l.useEffect)(()=>{(async()=>{try{const e=ci()(c).toISOString(),s=ci()(i).toISOString();u({loading:!0});const l=await t.get("/api/organizations/gmas/component/completion-breakdown",{component_type:a,end_date:s,group_id:n,organization_id:r,start_date:e});u({data:v(l),loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}})()},[d,o]),(0,N.jsxs)(Ge.A,{className:"p-3",style:{height:470},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>u({error:null}),show:p,variant:"danger",children:p}),(0,N.jsxs)(Ce.S,{style:{display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Completion time",id:"label.completion_time.b7f18169"})}),(0,N.jsxs)("span",{className:"selected-date",children:[d," - ",o]})]}),(0,N.jsx)("p",{children:(()=>{switch(a){case"challenge":return(0,N.jsx)(ke.A,{defaultMessage:"Distribution of learners by hours to challenge completion",id:"label.distribution_of_learners_by_hours.57c59711"});case"cartridge":return(0,N.jsx)(ke.A,{defaultMessage:"Distribution of learners by hours to cartridge completion",id:"label.distribution_of_learners_by_hours.cf34cb7a"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(0,N.jsx)(Me.x_,{loading:x,spinner:(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:230,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.y$,{})}),children:(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(jt.u,{height:"100%",width:"100%",children:(0,N.jsxs)(_t.E,{data:g,height:300,width:500,margin:{bottom:20,left
2:0,right:30,top:20},children:[(0,N.jsx)(bt.d,{strokeDasharray:"3 0",vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{axisLine:!1,label:{angle:-90,position:"middle",value:"Number of learners",viewBox:(()=>{const e={height:262,width:60,x:0,y:20};if(!g)return e;const{learners:s}=g[0]||{};return!s||s>3?e:{height:262,width:60,x:-20,y:20}})()}}),(0,N.jsx)(wt.m,{}),(0,N.jsx)(Nt.s,{wrapperStyle:{bottom:15,position:"relative"}}),(0,N.jsx)(St.y,{background:{fill:"#eee"},dataKey:"learners",fill:"var(--primary)",label:"Hours to completion",maxBarSize:50,name:"Hours to completion"})]})})})})]})},RT=t(9649);var DT=t.p+"static/media/clock.1d438294fdef74c48b75503495ff2357.svg";var BT=s=>{const{api:a}=(0,P.nm)(),{end_date:t,group_id:i,organization_id:n,start_date:r}=ET(),[o,d]=(0,ne.CQ)({error:null,loading:!1,total_facilitators:null,total_learners:null,total_time:null,total_time_facilitators:null,total_time_learners:null}),{loading:c,total_facilitators:h,total_learners:u,total_time:m,total_time_facilitators:g,total_time_learners:p}=o;(0,l.useEffect)(()=>{(async()=>{try{d({loading:!0});const e=ci()(r).toISOString(),s=ci()(t).toISOString(),l=await a.get("/api/organizations/metrics/general",{end_date:s,group_id:i,organization_id:n,start_date:e}),{total_facilitators:o,total_learners:c,total_time:h,total_time_facilitators:u,total_time_learners:m}=l;d({loading:!1,total_facilitators:o,total_learners:c,total_time:h,total_time_facilitators:u,total_time_learners:m})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}})()},[r,t]);const x=(0,RT.convertSeconds)(m),v=(0,RT.convertSeconds)(p),f=(0,RT.convertSeconds)(g);return(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsxs)(Me.x_,{loading:c,children:[(0,N.jsx)(Zs.A,{className:"float-end",height:52,src:DT,width:52}),(0,N.jsx)("h2",{children:x.value+" "+x.label}),(0,N.jsx)("p",{children:"time on platform"}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:v.value+" "+v.label}),(0,N.jsx)("small",{children:"spent by learners"})]}),(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:f.value+" "+f.label}),(0,N.jsx)("small",{children:"spent by facilitators"})]})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:u}),(0,N.jsx)("small",{children:"unique learners"})]}),(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:h}),(0,N.jsx)("small",{children:"unique facilitators"})]})]})]})})};const PT=t(17643);function LT(e,s){return e=Math.ceil(e),s=Math.floor(s),Math.floor(Math.random()*(s-e))+e}const OT=[];for(let e=0;e<30;e++)OT.push({amt:1e3,document:LT(1,1e3),image:LT(1,1e3),messages:LT(1,1e3),name:PT().subtract(e,"days").format("MMM Do"),video:LT(1,1e3)});function HT(e){let{stroke:s}=e;return(0,N.jsx)("text",{dy:-4,fill:s,fontSize:14,textAnchor:"middle",transform:"rotate(-90)",x:-130,y:20,children:"Number of Assets"})}OT.reverse();const UT=e=>{let{active:s,label:a,name:t,payload:i,styles:l}=e;const n=l&&l.primary,r=l&&l["gray-300"],o=l&&l["gray-400"],d=l&&l["gray-700"];return s&&i?(0,N.jsxs)("div",{className:"solvably-graph-tooltip",children:[(0,N.jsx)("p",{className:"name m-0 mb-1",children:t}),(0,N.jsx)("p",{className:"date m-0 mb-2",children:a}),i[0]&&(0,N.jsxs)("p",{className:"number m-0 mb-2",style:{color:r},children:["Videos: ",i[0].value]}),i[1]&&(0,N.jsxs)("p",{className:"number m-0 mb-2",style:{color:o},children:["Documents: ",i[1].value]}),i[2]&&(0,N.jsxs)("p",{className:"number m-0 mb-2",style:{color:d},children:["Images: ",i[2].value]}),i[3]&&(0,N.jsxs)("p",{className:"number m-0 mb-2",style:{color:n},children:["Messages: ",i[3].value]})]}):null};function QT(e){let{app:s,data:a}=e;const{styles:t}=s,i=t&&t.primary,l=t&&t["gray-300"],n=t&&t["gray-400"],r=t&&t["gray-700"],o="rgba(0,0,0,.12)";let d=23;a&&a.length>25&&(d=5);const{documents_total:c,images_total:h,messages_total:u,videos_total:m}=function(e){let s=0,a=0,t=0,i=0;
2return e&&e.forEach(e=>{const{document:l,image:n,messages:r,video:o}=e;s+=o,a+=l,t+=n,i+=r}),{documents_total:a,images_total:t,messages_total:i,videos_total:s}}(a),g=[{color:l,type:"rect",value:`Videos (${m})`},{color:n,type:"rect",value:`Documents (${c})`},{color:r,type:"rect",value:`Images (${h})`},{color:i,type:"rect",value:`Messages (${u})`}];return(0,N.jsx)(jt.u,{height:350,width:"100%",children:(0,N.jsxs)(_t.E,{data:a,margin:{bottom:5,left:20,right:30,top:0},children:[(0,N.jsx)(bt.d,{stroke:o,vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name",domain:["auto","auto"],interval:"preserveStartEnd",stroke:o,tickLine:!1,width:20,tick:{fontSize:"13px",fontWeight:500}}),(0,N.jsx)(yt.h,{axisLine:!1,label:(0,N.jsx)(HT,{}),stroke:o,tick:{fontSize:"13px",fontWeight:500},tickLine:!1,width:30}),(0,N.jsx)(wt.m,{content:(0,N.jsx)(UT,{name:"Assets",styles:t})}),(0,N.jsx)(Nt.s,{align:"left",height:40,iconSize:10,iconType:"plainline",payload:g,verticalAlign:"bottom",wrapperStyle:{bottom:15,position:"relative",textTransform:"capitalize"}}),(0,N.jsx)(St.y,{dataKey:"video",fill:l,maxBarSize:d,stackId:"a",stroke:l}),(0,N.jsx)(St.y,{dataKey:"document",fill:n,maxBarSize:d,stackId:"a",stroke:n}),(0,N.jsx)(St.y,{dataKey:"image",fill:r,maxBarSize:d,stackId:"a",stroke:r}),(0,N.jsx)(St.y,{dataKey:"messages",fill:i,maxBarSize:d,stackId:"a",stroke:i})]})})}QT.defaultProps={data:OT};var VT=(0,n.G0)(QT);var GT=()=>{const{end_date:s,group_id:a,organization_id:t,selected_date_end:i,selected_date_start:n,start_date:r}=ET(),{api:o}=(0,P.nm)(),[d,c]=(0,ne.CQ)({data:null,error:null,loading:!1}),{data:h,error:u,loading:m}=d,g=(e,a,t,i)=>{const l=Math.abs(ci()(r).diff(ci()(s),"days"))+1;return new Array(l).fill(0).map((s,l)=>({document:Number(t[l]),image:Number(a[l]),messages:Number(e[l]),name:ci()(ci()(r).add(l,"days")).format("MMMM Do"),video:Number(i[l])}))};return(0,l.useEffect)(()=>{(async()=>{try{const e=ci()(r).toISOString(),i=ci()(s).toISOString();c({loading:!0});const{docs:l,images:n,messages:d,videos:h}=await o.get("/api/organizations/engagements",{end_date:i,group_id:a,organization_id:t,start_date:e});c({data:g(d,n,l,h),loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}})()},[n,i]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:u,variant:"danger",children:u}),(0,N.jsxs)(Ge.A,{className:"p-3",style:{height:470},children:[(0,N.jsxs)(Ce.S,{style:{display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto mb-1",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Learner engagement",description:"",id:"label.learner_engagement.289b27c1"})}),(0,N.jsxs)("span",{className:"selected-date",children:[n," - ",i]})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Number of assets submitted by ascending date",description:"",id:"label.number_of_assets_submitted_by_asce.d2d5c9e9"})}),(0,N.jsx)(Me.x_,{loading:m,spinner:(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:350,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.Up,{})}),children:(0,N.jsx)(Ce.S,{className:"bar-chart-has-bg",style:{height:350,width:"100%"},children:(0,N.jsx)(VT,{data:h})})})]})]})};var WT=s=>{var a;const{type:t}=s,{api:i}=(0,P.nm)(),{end_date:n,group_id:r,organization_id:o,selected_date_end:d,selected_date_start:c,start_date:h}=ET(),u=null===Re._$||void 0===Re._$||null===(a=Re._$.time)||void 0===a?void 0:a.convertSeconds,[m,g,p]=(0,ne.CQ)({error:null,learner_time:0,loading:!0,total_assignments:0,total_completed_assignments:0,total_learners:0}),{error:x,learner_time:v,loading:f,total_assignments:j,total_completed_assignments:_,total_learners:b}=m,A=u(v),y=(0,N.jsx)(Ge.A,{children:(0,N.jsx)(Ge.A.Body,{className:"d-flex align-items-center justify-content-center",children:(0,N.jsx)(Me.y$,{})})});return(0,l.useEffect)(()=>{(async()=>{try{const e=ci()(h).toISOString(),s=ci()(n).toISOString();g({loading:!0});const{learner_time:a,total_assignments:l,total_completed_assignments:d,total_learners:c}=await i.get("/api/organizations/gmas/component/metrics/general",{component_type:t||"",end_date:s,group_id:r,organization_id:o,start_date:e});g({learner_time:a,loading:!1,total_assignments:l,total_completed_assignments:d,total_learners:c})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,loading:!1})}})()},[c,d]),(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:x,variant:"danger",children:x}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:3,children:(0,N.jsx)(Me.x_,{loading:f,spinner:y,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)("h3",{children:[null===A||void 0===A?void 0:A.value," ",null===A||void 0===A?void 0:A.label]}),(0,N.jsx)("p",{children:(()=>{switch(t){case"challenge":return(0,N.jsx)(ke.A,{defaultMessage:"learner time in challenges",id:"label.learner_time_in_challenges.e8c60de6"});case"cartridge":return(0,N.jsx)(ke.A,{defaultMessage:"learner time in cartridge",id:"label.learner_time_in_cartridge.918b5b57"})}})()})]})})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:3,children:(0,N.jsx)(Me.x_,{loading:f,spinner:y,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:b}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"unique learners",id:"label.unique_learners.447e433c"})})]})})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:3,children:(0,N.jsx)(Me.x_,{loading:f,spinner:y,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:j}),(0,N.jsx)("p",{children:(()=>{switch(t){case"challenge":return(0,N.jsx)(ke.A,{defaultMessage:"challenges assigned",id:"label.challenges_assigned.7f8e567c"});case"cartridge":return(0,N.jsx)(ke.A,{defaultMessage:"cartridge assigned",id:"label.cartridge_assigned.058cfad3"})}})()})]})})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:3,children:(0,N.jsx)(Me.x_,{loading:f,spinner:y,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:_}),(0,N.jsx)("p",{children:(()=>{switch(t){case"challenge":return(0,N.jsx)(ke.A,{defaultMessage:"challenges completed",id:"label.challenges_completed.19c8c600"});case"cartridge":return(0,N.jsx)(ke.A,{defaultMessage:"cartridge completed",id:"label.cartridge_completed.20d96594"})}})()})]})})})]})};var KT=s=>{const{type:a}=s,[t,i,n]=(0,ne.CQ)({data:null,error:null,loading:!0}),{data:r,error:o,loading:d}=t,{api:c}=((0,l.useRef)(),(0,P.nm)()),{end_date:h,group_id:u,organization_id:m,selected_date_end:g,selected_date_start:p,start_date:x}=ET(),v=e=>e.map((e,s)=>{let{assigned:a,completed:t,started:i}=e;return{assigned:a,completed:t,name:ci()(ci()(x).add(s,"days")).format("MMMM Do"),started:i}});return(0,l.useEffect)(()=>{(async()=>{try{const e=ci()(x).toISOString(),s=ci()(h).toISOString();i({loading:!0});const{results:t}=await c.get("/api/organizations/gmas/component/status-breakdown",{component_type:a||"",end_date:s,group_id:u,organization_id:m,start_date:e});i({data:v(t),loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}})()},[p,g]),(0,N.jsxs)(Ge.A,{className:"p-3",style:{height:470},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>i({error:null}),show:o,variant:"danger",children:o}),(0,N.jsxs)(Ce.S,{style:{display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto mb-1",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Learner progress",id:"label.learner_progress.6520dd5d"})}),(0,N.jsxs)("span",{className:"visually-hidden selected-date",children:[p," - ",g]})]}),(0,N.jsx)("p",{children:(()=>{switch(a){case"challenge":return(0,N.jsx)(ke.A,{defaultMessage:"Learner challenges progress by date",id:"label.learner_challenges_progress_by_dat.ea00ffd5"});case"cartridge":return(0,N.jsx)(ke.A,{defaultMessage:"Learner cartridges progress by date",id:"label.learner_cartridges_progress_by_dat.7341c6f3"});default:return(0,N.jsx)(N.Fragment,{})}})()}),(0,N.jsx)(Me.x_,{loading:d,spinner:(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:330,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.y$,{})}),children:(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(jt.u,{height:"100%",width:"100%",children:(0,N.jsxs)(_t.E,{data:r,height:300,width:500,margin:{left:0,right:30,top:20},children:[(0,N.jsx)(bt.d,{strokeDasharray:"3 3"}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{}),(0,N.jsx)(wt.m,{}),(0,N.jsx)(Nt.s,{wrapperStyle:{bottom:15,position:"relative"}}
2),(0,N.jsx)(St.y,{dataKey:"completed",fill:"var(--report-tonal-band-a)",stackId:"a"}),(0,N.jsx)(St.y,{dataKey:"started",fill:"var(--report-tonal-band-b)",stackId:"a"}),(0,N.jsx)(St.y,{dataKey:"assigned",fill:"var(--secondary)",stackId:"a"})]})})})})]})};var YT=t.p+"static/media/message.30375a3a7d74cbc0e11198351c944044.svg";var qT=s=>{const{api:a}=(0,P.nm)(),{end_date:t,group_id:i,organization_id:n,start_date:r}=ET(),[o,d]=(0,ne.CQ)({error:null,loading:!1,total_facilitators:null,total_learners:null,total_messages:null,total_messages_facilitators:null,total_messages_learners:null}),{loading:c,total_facilitators:h,total_learners:u,total_messages:m,total_messages_facilitators:g,total_messages_learners:p}=o;return(0,l.useEffect)(()=>{(async()=>{try{d({loading:!0});const e=ci()(r).toISOString(),s=ci()(t).toISOString(),l=await a.get("/api/organizations/metrics/messages",{end_date:s,group_id:i,organization_id:n,start_date:e}),{total_facilitators:o,total_learners:c,total_messages:h,total_messages_facilitators:u,total_messages_learners:m}=l;d({loading:!1,total_facilitators:o,total_learners:c,total_messages:h,total_messages_facilitators:u,total_messages_learners:m})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}})()},[r,t]),(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Me.x_,{loading:c,children:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Zs.A,{className:"float-end",height:52,src:YT,width:52}),(0,N.jsx)("h2",{children:m}),(0,N.jsx)("p",{children:"messages sent"}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:p}),(0,N.jsx)("small",{children:"sent by learners"})]}),(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:g}),(0,N.jsx)("small",{children:"sent by facilitators"})]})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:u}),(0,N.jsx)("small",{children:"unique learners"})]}),(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:h}),(0,N.jsx)("small",{children:"unique facilitators"})]})]})]})})})};var JT=s=>{const{api:a}=(0,P.nm)(),{end_date:t,group_id:i,organization_id:n,selected_date_end:r,selected_date_start:o,start_date:d}=ET(),[c,h]=(0,ne.CQ)({count:0,error:null,loading:!1,page:1,page_size:4,results:null,sort_direction:"DESC",sort_token:"tmap"}),{count:u,loading:m,page:g,page_size:p,results:x,sort_direction:v,sort_token:f}=c,j=async()=>{try{const{page:e,page_size:s,sort_direction:l,sort_token:r}=c,o=ci()(d).toISOString(),u=ci()(t).toISOString();h({loading:!0});const{count:m,results:g}=await a.get("/api/organizations/groups/most-active",{end_date:u,group_id:i,organization_id:n,page:e,page_size:s,sort_direction:l,sort_token:r,start_date:o});h({count:m,loading:!1,results:g})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:a,loading:!1})}};return(0,l.useEffect)(()=>{j()},[d,t]),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)("h4",{className:"d-inline-block me-auto",children:(0,N.jsx)(ke.A,{defaultMessage:"Most active groups",id:"label.most_active_groups.f08677c5"})}),(0,N.jsxs)("span",{className:"selected-date",children:[o," - ",r]})]}),(0,N.jsx)(Ce.S,{className:"mt-1 mb-3",children:(0,N.jsxs)(ho,{defaultSortDirection:v,defaultSortToken:f,hover:!(null===x||void 0===x||!x.length),onSort:(e,s)=>{h({sort_direction:s,sort_token:e},j)},children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Class",id:"label.class.4f3a9bd0"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"tmap",children:(0,N.jsx)(ke.A,{defaultMessage:"Time on Challenge",id:"label.time_on_challenge.ecd9f2e1"})})]})}),(0,N.jsx)(ho.Tbody,{cols:5,loading:m,children:null!==x&&void 0!==x&&x.length?(0,N.jsx)(N.Fragment,{children:x.map(e=>{const{id:s,name:a,section:t,total_s:i}=e;let l=(0,RT.convertSeconds)(i);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsxs)(ho.Td,{children:[(0,N.jsx)(Le.Link,{to:`/admin/group/${s}`,children:(0,N.jsx)("strong",{children:a})}),t&&(0,N.jsx)("span",{className:"d-block",children:t})]}),(0,N.jsx)(ho.Td,{children:i?(0,N.jsxs)(Fl,{inline:!0,children:[l.value," ",l.label]}):"-"})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No groups foun
2d",id:"label.no_groups_found.463d5fb4"})})})})]})}),(0,N.jsx)(Pr,{count:u,onChange:e=>h({page:e},j),page:g,page_size:p})]})};class XT extends l.Component{constructor(e){super(e),this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.getMostActiveFacilitators)},this.state={count:0,loading:!1,page:1,page_size:4,results:null,sort_direction:"DESC",sort_token:"total_time"}}getMostActiveFacilitators(){const{app:e,dashboard:s}=this.props,{end_date:a,group_id:t,organization_id:i,start_date:l}=s,{page:n,page_size:r,sort_direction:o,sort_token:d}=this.state,{api:c}=e,h=ci()(l).toISOString(),u=ci()(a).toISOString();this.setState({loading:!0}),c.get(`/api/organizations/facilitators/list/${n}/${r}`,{end_date:u,group_id:t,organization_id:i,page:n,page_size:r,sort_direction:o,sort_token:d,start_date:h}).then(e=>{let{count:s,results:a}=e;this.setState({count:s,loading:!1,results:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}componentDidMount(){this.getMostActiveFacilitators()}render(){const{dashboard:e}=this.props,{selected_date_end:s,selected_date_start:a}=e,{count:t,loading:i,page:l,page_size:n,results:r,sort_direction:o,sort_token:d}=this.state,{convertSeconds:c}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{};return(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Most active facilitators",id:"label.most_active_facilitators.2fe8db4e"})}),(0,N.jsxs)("span",{className:"selected-date",children:[a," - ",s]})]}),(0,N.jsx)(Ce.S,{className:"mt-1 mb-3",children:(0,N.jsxs)(ho,{defaultSortDirection:o,defaultSortToken:d,onSort:this.handleSort,textResize:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Instructor name",id:"label.instructor_name.906e5229"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"total_time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time spent online",id:"label.time_spent_online.fbfef977"})})]})}),(0,N.jsx)(ho.Tbody,{cols:2,loading:i,children:null!==r&&void 0!==r&&r.length?(0,N.jsx)(N.Fragment,{children:r.map((e,s)=>{const{user:a}=e,{fullname:t}=a;let i=a&&a.total_time?a.total_time:0,l=c(i/1e3);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)("span",{style:{color:"var(--primary)"},children:(0,N.jsx)("strong",{children:t})})}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Fl,{inline:!0,children:[l.value," ",l.label]})})]},`${s}`)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"2",children:(0,N.jsx)(ke.A,{defaultMessage:"No facilitators found.",id:"label.no_facilitators_found.2e55d8bc"})})})})]})}),(0,N.jsx)(Lr,{count:t,onChange:e=>this.setState({page:e},()=>this.getMostActiveFacilitators),page:l,page_size:n})]})}}var ZT=(0,P.G0)(IT(XT));class $T extends l.Component{constructor(e){super(e),this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.getMostActiveSubOrgs)},this.state={count:0,error:null,loading:!1,page:1,page_size:4,results:null,sort_direction:"DESC",sort_token:"tmap"}}getMostActiveSubOrgs(){const{app:e,dashboard:s}=this.props,{end_date:a,group_id:t,organization_id:i,start_date:l}=s,{page_number:n,page_size:r,sort_direction:o,sort_token:d}=this.state,{api:c}=e,h=ci()(l).toISOString(),u=ci()(a).toISOString();this.setState({loading:!0}),c.get("/api/organizations/subs/most-active",{end_date:u,group_id:t,organization_id:i,page_number:n,page_size:r,sort_direction:o,sort_token:d,start_date:h}).then(e=>{let{count:s,results:a}=e;this.setState({count:s,loading:!1,results:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}componentDidMount(){this.getMostActiveSubOrgs()}render(){var e;const{dashboard:s}=this.props,{selected_date_end:a,selected_date_start:t}=s,{count:i,loading:l,page:n,page_size:r,results:o,sort_direction:d,sort_token:c}=this.state,{convertSeconds:h}=null!==(e=null===Re._$||void 0===Re._$?void 0:Re._$.time)&&void 0!==e?e:{};return(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Most active sub-organizations",id:"label.most_active_sub_organizations.a25a747c"})}),(0,N.jsxs)("span",{className:"selected-date",children:[t," - ",a]})]}),(0,N.jsx)(Ce.S,{className:"mt-1 mb-3",children:(0,N.jsxs)(ho,{defaultSortDirection:d,defaultSortToken:c,onSort:this.handleSort,textResize:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Sub organization",id:"label.sub_organization.7c8bac58"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"tmap",children:(0,N.jsx)(ke.A,{defaultMessage:"Time on Challenge",id:"label.time_on_challenge.ec
2d9f2e1"})})]})}),(0,N.jsx)(ho.Tbody,{cols:5,loading:l,children:null!==o&&void 0!==o&&o.length?(0,N.jsx)(N.Fragment,{children:o.map(e=>{const{id:s,name:a,total_s:t}=e;let i=h(t);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{to:`/admin/organization/${s}`,children:(0,N.jsx)("strong",{children:a})},s)}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Fl,{inline:!0,children:t?(0,N.jsxs)(N.Fragment,{children:[i.value," ",i.label]}):"-"})})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No sub organizations found.",id:"label.no_sub_organizations_found.f12e31e5"})})})})]})}),(0,N.jsx)(Pr,{count:i,onChange:e=>this.setState({page:e},this.getMostActiveSubOrgs),page:n,page_size:r})]})}}var eI=(0,P.G0)(IT($T));function sI(e){let{stats:s}=e;return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Qe.A,{children:s&&s.map((e,s)=>{const{colorCoded:a,label:t,value:i}=e;let l="";return a&&i<=14&&(l="warning"),a&&i<=7&&(l="danger"),(0,N.jsx)(Ve.A,{className:`${l}`,lg:3,md:6,sm:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:i}),(0,N.jsx)("p",{children:t})]})},`${s}-${i}`)})})})}sI.defaultProps={stats:[{colorCoded:!1,label:"Statistic 1",value:"36%"},{colorCoded:!1,label:"Statistic 2",value:"2"},{colorCoded:!1,label:"Statistic 3",value:"2/9"},{colorCoded:!1,label:"Statistic 4",value:"1,000"}]};var aI=(0,n.G0)(_T(sI));var tI=e=>{const[s,a]=(0,l.useState)(null),t=ET(),i=null===t||void 0===t?void 0:t.organization,n=(null===i||void 0===i?void 0:i.enable_provisioning)||!1;return(0,l.useEffect)(()=>{const{organization:e}=t;let s=-1,i=e&&e.contracts;i&&i.length&&(s=0,i.forEach(e=>{let{is_active:a}=e,t=ci()(e.end_date).diff(ci()(),"days");a&&t>s&&(s=t)}));let l=[{colorCoded:!1,label:"Licenses Purchased",value:e&&e.max_active_members?e.max_active_members:"N/A"},{colorCoded:!1,label:"Licenses In Use",value:e&&e.active_members?e.active_members:"N/A"},{colorCoded:!0,label:"Licenses Available",value:e&&e.active_members&&e.max_active_members?e.max_active_members-e.active_members>=0?e.max_active_members-e.active_members:0:"N/A"},{colorCoded:!0,label:"Days Left to Renew",value:s>=0?s:"N/A"}];a(l)},[]),n?(0,N.jsx)(aI,{stats:s}):(0,N.jsx)(N.Fragment,{})};const iI=t(17643);function lI(e,s){return e=Math.ceil(e),s=Math.floor(s),Math.floor(Math.random()*(s-e)+e)}const nI=[];for(let e=0;e<30;e++)nI.push({amt:1e4,"Learners Online":lI(1,1e4),name:iI().subtract(e,"days").format("MMM Do")});nI.reverse();class rI extends l.Component{render(){const{name:e,stroke:s}=this.props;return(0,N.jsx)("text",{dy:-4,fill:s,fontSize:14,textAnchor:"middle",transform:"rotate(-90)",x:-130,y:20,children:e})}}class oI extends l.Component{render(){const{color:e,cx:s,cy:a}=this.props;return(0,N.jsxs)("svg",{children:[(0,N.jsx)("circle",{cx:s,cy:a,fill:e,opacity:.2,r:"12.5",strokeWidth:"2"}),(0,N.jsx)("circle",{cx:s,cy:a,fill:"white",r:"6",stroke:`${e}`,strokeWidth:"2"})]})}}const dI=e=>{let{active:s,label:a,name:t,payload:i}=e;return s&&i?(0,N.jsxs)("div",{className:"solvably-graph-tooltip",children:[(0,N.jsx)("p",{className:"name m-0",children:t}),(0,N.jsx)("p",{className:"date m-0 mb-2",children:a}),i[0]&&(0,N.jsx)("p",{className:"number m-0 mb-2",children:i[0].value})]}):null};class cI extends l.Component{constructor(e){super(e),this.state={hidden_series_ids:[],show_all:!0}}render(){const{color:e,data:s,height:a,name:t,width:i}=this.props;return s?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{height:a,width:i},children:(0,N.jsx)(jt.u,{height:300,width:"100%",children:(0,N.jsxs)(Vw.b,{data:s,margin:{bottom:5,left:10,right:30,top:5},children:[(0,N.jsx)(bt.d,{stroke:"#d1d1d1",vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{label:(0,N.jsx)(rI,{name:t})}),(0,N.jsx)(wt.m,{content:(0,N.jsx)(dI,{name:t})}),(0,N.jsx)(Gw.N,{activeDot:(0,N.jsx)(oI,{color:e}),dataKey:t,dot:!1,stroke:e,strokeWidth:3,type:"monotone"})]})})}),(0,N.jsxs)(Ce.S,{style:{marginBottom:10,marginLeft:60,maxWidth:"100%"},children:[(0,N.jsx)("span",{style:{backgroundColor:e,display:"inline-block",height:2,verticalAlign:"middle",width:20}}),(0,N.jsx)("span",{style:{fontSize:12,fontWeight:500,marginLeft:5},children:t})]})]}):(0,N.jsx)(Ce.S,{children:"N/A"})}}cI.defaultProps={color:"var(--primary)",data:nI,four_cs:["Communication","Critical","Collaboration","Creativity"],height:350,name:"Learners Online",width:"100%"};var hI=cI;var uI=s=>{const{api:a}=(0,P.nm)(),{end_date:t,group_id:i,organization_id:n,selected_date_end:r,selected_date_start:o,start_date:d}=ET(),[c,h]=(0,ne.CQ)({data:null,error:null,filter:"all",loading:!1}),{data:u,error:m,filter:g,loading:p}=c,x=async()=>{try{const e=ci()(d).toISOString(),s=ci()(t).toISOString(),l=c.filter||"";h({loading:!0});const{results:r}=await a.get("/api/organizations/users-online/",{end_date:s,group_id:i,organization_id:n,role_slug:l,start_date:e});h({data:v(r),loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:a,loading:!1})}},v=e=>e.map((e,s)=>({name:ci()(d).add(s,"days").format("MMMM Do"),"Users Online":Number(e)}));(0,l.useEffect)(()=>{x()},[d,t]);const f=()=>{switch(g){case"learners":return(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"});case"admins":return(0,N.jsx)(ke.A,{defaultMessage:"Facilitators",id:"label.facilitators.1cdd53ff"});default:return(0,N.jsx)(ke.A,{defaultMessage:"All",id:"label.all.a52ace42"})}};return(0,N.jsxs)(Ce.S,{className:"users-online-graph",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({error:null}),show:m,variant:"danger",children:m}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-baseline",children:[(0,N.jsxs)("h4",{className:"me-auto text-capitalize mb-0 d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(f,{})}),(0,N.jsx)(ke.A,{defaultMessage:"online",id:"label.online.f6fc84c9"})]}),(0,N.jsxs)("span",{className:"selected-date",children:[o," - ",r]}),(0,N.jsxs)(li.A,{className:"ms-3 primary round px-2 py-1",onSelect:e=>h({filter:e},x),children:[(0,N.jsxs)(li.A.Toggle,{id:"dropdown-custom-components",children:["Filter by ",(0,N.jsx)(f,{})]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{eventKey:"all",children:(0,N.jsx)(ke.A,{defaultMessage:"All users",id:"label.all_users.f7898130"})}),(0,N.jsx)(li.A.Item,{eventKey:"learners",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})}),(0,N.jsx)(li.A.Item,{eventKey:"admins",children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitators",id:"label.facilitators.1cdd53ff"})})]})]})]}),(0,N.jsxs)("p",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{className:"text-capitalize",children:(0,N.jsx)(f,{})}),(0,N.jsx)(ke.A,{defaultMessage:"online by ascending date",id:"label.online_by_ascending_date.ff95c2f4"})]}),(0,N.jsx)(Me.x_,{loading:p,spinner:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center w-100",style:{height:330},children:(0,N.jsx)(Me.y$,{})}),children:(0,N.jsx)(Ce.S,{className:"solvably-line-chart w-100",style:{height:330},children:(0,N.jsx)(hI,{data:u,height:300,name:"Users Online",width:"100%"})})})]})]})};var mI=s=>{const{api:a}=(0,P.nm)(),{end_date:t,group_id:i,organization_id:n,selected_date_end:r,selected_date_start:o,start_date:d}=ET(),[c,h]=(0,ne.CQ)({data:null,error:null,filter:"all",loading:!1}),{data:u,error:m,filter:g,loading:p}=c,x=async()=>{try{const e=ci()(d).toISOString(),s=ci()(t).toISOString(),l=c.filter||"";h({loading:!0});const{results:r}=await a.get("/api/organizations/users-registered",{end_date:s,group_id:i,organization_id:n,role_slug:l,start_date:e});h({data:v(r),loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:a,loading:!1})}},v=e=>e.map((e,s)=>({name:ci()(d).add(s,"days").format("MMMM Do"),"Users registered":Number(e)}));(0,l.useEffect)(()=>{x()},[d,t]);const f=()=>{switch(g){case"learners":return(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"});case"admins":return(0,N.jsx)(ke.A,{defaultMessage:"Facilitators",id:"label.facilitators.1cdd53ff"});default:return(0,N.jsx)(ke.A,{defaultMessage:"All",id:"label.all.a52ace42"})}};return(0,N.jsxs)(Ce.S,{className:"users-registered-graph",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({error:null}),show:m,variant:"danger",children:m}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-baseline",children:[(0,N.jsxs)("h4",{className:"me-auto text-capitalize mb-0 d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(f,{})}),(0,N.jsx)(ke.A,{defaultMessage:"registered",id:"label.registered.b1a9e561"})]}),(0,N.jsxs)("span",{className:"selected-date",children:[o," - ",r]}),(0,N.jsxs)(li.A,{className:"ms-3 primary round px-2 py-1",onSelect:e=>h({filter:e},x),children:[(0,N.jsxs)(li.A.Toggle,{id:"dropdown-custom-components",children:["Filter by ",(0,N.jsx)(f,{})]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{eventKey:"all",children:(0,N.jsx)(ke.A,{defaultMessage:"All users",id:"label.all_users.f7898130"})}),(0,N.jsx)(li.A.Item,{eventKey:"learners",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})}),(0,N.jsx)(li.A.Item,{eventKey:"admins",children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitators",id:"label.facilitators.1cdd53ff"})})]})]})]}),(0,N.jsxs)("p",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{className:"text-capitalize",children:(0,N.jsx)(f,{})}),(0,N.jsx)(ke.A,{defaultMessage:"registered by ascending date",id:"label.registered_by_ascending_date.a0a54ce8"})]}),(0,N.jsx)(Me.x_,{loading:p,spinner:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center w-100",style:{height:330},children:(0,N.jsx)(Me.y$,{})}),children:(0,N.jsx)(Ce.S,{className:"solvably-line-chart w-100",style:{height:330},children:(0,N.jsx)(hI,{data:u,height:300,name:"Users Registered",width:"100%"})})})]})]})};var gI=t.p+"static/media/call.63855f98e7ac221b7f4018543f97ea4f.svg";var pI=s=>{const{api:a}=(0,P.nm)(),{end_date:t,group_id:i,organization_id:n,start_date:r}=ET(),[o,d]=(0,ne.CQ)({error:null,loading:!1,total_calls:null,total_calls_facilitators:null,total_calls_learners:null,total_facilitators:null,total_learners:null,total_time_facilitators:null,total_time_learners:null}),{loading:c,total_calls:h,total_facilitators:u,total_learners:m,total_time_facilitators:g,total_time_learners:p}=o;(0,l.useEffect)(()=>{(async()=>{try{d({loading:!0});const e=ci()(r).toISOString(),s=ci()(t).toISOString(),l=await a.get("/api/organizations/metrics/calls",{end_date:s,group_id:i,organization_id:n,start_date:e}),{total_calls:o,total_calls_facilitators:c,total_calls_learners:h,total_facilitators:u,total_learners:m,total_time_facilitators:g,total_time_learners:p}=l;d({loading:!1,total_calls:o,total_calls_facilitators:c,total_calls_learners:h,total_facilitators:u,total_learners:m,total_time_facilitators:g,total_time_learners:p})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}})()},[r,t]);const x=(0,RT.convertSeconds)(p),v=(0,RT.convertSeconds)(g);return(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Me.x_,{loading:c,children:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Zs.A,{className:"float-end",height:52,src:gI,width:52}),(0,N.jsx)("h2",{children:h}),(0,N.jsx)("p",{children:"voice calls made"}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:`${x.value} ${x.label}`}),(0,N.jsx)("small",{children:"spent by learners"})]}),(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:`${v.value} ${v.label}`}),(0,N.jsx)("small",{children:"spent by facilitators"})]})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:m}),(0,N.jsx)("small",{children:"unique learners"})]}),(0,N.jsxs)(Ve.A,{className:"mb-3",lg:6,children:[(0,N.jsx)("h6",{className:"mb-0",children:u}),(0,N.jsx)("small",{children:"unique facilitators"})]})]})]})})})};var xI=s=>{const{formatMessage:a}=(0,ja.A)(),{api:t}=(0,P.nm)(),{end_date:i,group_id:n,organization_id:r,selected_date_end:o,selected_date_start:d,start_date:c}=ET(),[h,u]=(0,ne.CQ)({error:null,loading:!1,longitudinal_efficacy:[]}),{error:m,loading:g,longitudinal_efficacy:p}=h;return(0,l.useEffect)(()=>{(async()=>{try{const e=ci()(c).toISOString(),s=ci()(i).toISOString();u({loading:!0});const{longitudinal_efficacy:a}=await t.get("/api/organizations/longitudinal-efficacy",{end_date:s,group_id:n,organization_id:r,start_date:e});u({loading:!1,longitudinal_efficacy:a})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}})()},[d,o]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>u({error:null}),show:m,variant:"danger",children:m}),(0,N.jsx)(Me.x_,{loading:g,spinner:(0,N.jsx)(Jw,{}),children:(0,N.jsx)(Ge.A,{className:g?"":"floating",children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Kw,{end_date:o,longitudinal_efficacy:p,show_date_range:!0,start_date:d,subtitle:a({id:"label.longitudinal_efficacy_is_a_simple.ff232ed7",defaultMessage:"Longitudinal efficacy is a simple moving average of the last 7 days of 4C values"})})})})})]})};const vI=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{parseBinary:t}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},i=ET(),n=null===i||void 0===i?void 0:i.organization,[r,o,d]=(0,ne.CQ)({error:null,include_sub_orgs:0,loading:!1,show:!1}),c=e=>o({end_date:null===e||void 0===e?void 0:e.end_date,show:!0,start_date:null===e||void 0===e?void 0:e.start_date}),h=()=>{d(),"function"===typeof a&&a()};return(0,l.useImperativeHandle)(s,()=>({hide:h,show:c})),(0,l.useEffect)(()=>d,[]),(0,N.jsxs)(xe,{onHide:h,show:r.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner progress report",id:"label.learner_progress_report.b57bf23a"})})}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,onSubmit:e=>{let s=null===e||void 0===e?void 0:e.start_date,a=null===e||void 0===e?void 0:e.end_date;const t=ci()(s).toISOString(),i=ci()(a).toISOString();setTimeout(()=>{window.location=`/api/organizations/learner-progress/list?organization_id=${(null===n||void 0===n?void 0:n.id)||""}&include_sub_orgs=${r.include_sub_orgs}&start_date=${t}&end_date=${i}`},150)},initialValues:{end_date:null===r||void 0===r?void 0:r.end_date,include_sub_orgs:null===r||void 0===r?void 0:r.include_sub_orgs,start_date:null===r||void 0===r?void 0:r.start_date},children:e=>{let{handleSubmit:s,setFieldTouched:a,setFieldValue:i,values:l}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(_e.A,{onSubmit:s,children:[(0,N.jsxs)(xe.Body,{className:"pt-0",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{o({error:null})},show:r.error,variant:"danger",children:r.error}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Export a CSV report with the progress of each learning module for each learner",id:"label.export_a_csv_report_with_the_progr.1a038275"})}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{sm:6,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{className:"mb-0",htmlFor:"startDate",children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)(_c(),{id:"startDate",name:"start_date",value:l.start_date,onChange:e=>{"undefined"!==typeof e.unix&&(i("start_date",1e3*e.unix()),a("start_date"))}})]})}),(0,N.jsx)(Ve.A,{sm:6,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{className:"mb-0",htmlFor:"endDate",children:(0,N.jsx)(ke.A,{defaultMessage:"End date",id:"label.end_date.14303aa0"})}),(0,N.jsx)(_c(),{id:"endDate",name:"end_date",value:l.end_date,onChange:e=>{"undefined"!==typeof e.unix&&(i("end_date",1e3*e.unix()),a("end_date"))}})]})})]}),(null===n||void 0===n?void 0:n.organization_count)>0&&(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{children:(0,N.jsx)(_e.A.Switch,{checked:!(null===l||void 0===l||!l.include_sub_orgs
2),onChange:()=>o({include_sub_orgs:t(!r.include_sub_orgs)}),label:(0,N.jsx)(ke.A,{defaultMessage:"Include sub-organizations",id:"label.include_sub_organizations.b8a90835"})})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:h,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsxs)(ve.A,{type:"submit",children:[(0,N.jsx)(ze.WCW,{}),"\xa0",(0,N.jsx)(ke.A,{defaultMessage:"Download csv",id:"label.download_csv.e21e7e4c"})]})]})]})})}})]})});vI.displayName="LearnerProgressReport";var fI=vI;const jI=e=>{const{children:s,count:a,headerRight:t,label:i,showCount:l}=e;return(0,N.jsxs)(Ce.S,{className:"mb-5",children:[(0,N.jsxs)(Ce.S,{className:"admin-dashboard-bay-header-container mb-3",children:[(0,N.jsx)("h3",{className:"m-0",children:i}),l&&(0,N.jsx)(bo.A,{pill:!0,bg:"secondary",className:"ms-2",style:{maxHeight:23},children:a}),t]}),s]})};jI.defaultProps={count:0,headerRight:!1,label:"Bay Label",showCount:!1};var _I=jI;class bI extends l.Component{constructor(e){super(e),this.state={end_date:ci()().toDate().getTime(),start_date:ci()().subtract(1,"month").toDate().getTime()},this.picker=null,this.progress_report=(0,l.createRef)()}handleSelectDate(e){let{end_date:s,start_date:a}=e;this.setState({loading:!0}),this.setState({end_date:s,start_date:a}),this.setState({loading:!1})}render(){const{admin_organization:e,app:s}=this.props,{organization:a,organization_id:t}=e,{end_date:i,error:l,loading:n,start_date:r}=this.state,o=ci()(i).format("MM/DD/YY"),d=ci()(r).format("MM/DD/YY");return(0,N.jsxs)(zT,{value:{end_date:i,organization:a,organization_id:t,selected_date_end:o,selected_date_start:d,start_date:r},children:[(0,N.jsxs)(Ue.A,{className:"admin-organization-dashboard",children:[n&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!n&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"m1-2 mb-5 clearfix",children:[(0,N.jsxs)(ve.A,{className:"me-3",variant:"secondary",onClick:()=>{this.picker&&this.picker.show({end_date:i,start_date:r})},children:[ci()(r).format("MMM DD, YYYY")," - ",ci()(i).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{this.progress_report.current.show({end_date:i,start_date:r})},children:(0,N.jsx)(ke.A,{defaultMessage:"Progress report",description:"",id:"label.progress_report.c1ea47b7"})})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsx)(_I,{label:"General usage",children:(0,N.jsx)(BT,{})})}),(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsx)(_I,{label:"Messages",children:(0,N.jsx)(qT,{})})}),(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsx)(_I,{label:"Voice calls",children:(0,N.jsx)(pI,{})})})]}),(0,N.jsx)(_I,{label:"User metrics",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"online",id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"online",children:(0,N.jsx)(ke.A,{defaultMessage:"Online",description:"",id:"label.online.0d21bd52"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"registered",children:(0,N.jsx)(ke.A,{defaultMessage:"Registered",description:"",id:"label.registered.2351ee99"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"online",children:(0,N.jsx)(uI,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"registered",children:(0,N.jsx)(mI,{})})]})]})}),(0,N.jsx)(_I,{label:"Module metrics",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"challenges",id:"admin-module-tabs",mountOnEnter:!0,children:[(0,N.jsx)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"challenges",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",description:"",id:"label.challenges.40b9c8f4"})})})}),(0,N.jsx)(ld.A.Content,{children:(0,N.jsxs)(ld.A.Pane,{eventKey:"challenges",children:[(0,N.jsx)(WT,{type:"challenge"}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(KT,{type:"challenge"})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(FT,{type:"challenge"})})]}),(0,N.jsxs)(Qe.A,{className:"mt-3",children:[(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(GT,{})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(xI,{})})]})]})})]})}),(0,N.jsxs)(_I,{label:"Organization metrics",children:[(0,N.jsx)(tI,{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"mt-3",lg:6,children:(0,N.jsx)(eI,{})}),(0,N.jsx)(Ve.A,{className:"mt-3",lg:6,children:(0,N.jsx)(JT,{})}),(0,N.jsx)(Ve.A,{className:"mt-3",lg:6,children:(0,N.jsx)(ZT,{})})]})]})]})]}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{this.handleSelectDate(e)}}),(0,N.jsx)(fI,{ref:this.progress_report})]})}}var AI=(0,P.G0)((0,Pe.y)(_T(nT(bI))));var yI=e=>{const{userHasRight:s}=(0,P.nm)(),{organization:a}=rT(),t=!!s("manage_organization",null===a||void 0===a?void 0:a.id)&&!(null!==a&&void 0!==a&&a.parent_id);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ge.A,{className:"settings-tabs",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"general",id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"general",children:(0,N.jsx)(ke.A,{defaultMessage:"General settings",id:"label.general_settings.2a1660d9"})})}),t&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"tags",children:(0,N.jsx)(ke.A,{defaultMessage:"Content tags",id:"label.content_tags.c25b4d57"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"notifications",children:(0,N.jsx)(ke.A,{defaultMessage:"Email notifications",id:"label.email_notifications.aab79ba9"})})})]})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"general",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(wI,{})})}),t&&(0,N.jsx)(ld.A.Pane,{eventKey:"tags",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(NI,{})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"notifications",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(zI,{})})})]})})]})})})]})};var wI=s=>{var a,t,i,n,r,o,d,c,h,u,m;const{formatMessage:g}=(0,ja.A)(),{api:p,env:x,getUserSiteRole:v,locale:f,siteUrl:j}=(0,P.nm)(),{organization_id:_,refreshOrganization:b}=rT(),[A,y]=(0,ne.CQ)({error:null,loading:!0,organization:null,saved:!1}),{error:w,loading:S,organization:C,saved:M}=A,k=(0,l.useRef)(),z=(0,l.useRef)(),T=async()=>{try{y({loading:!0});const{organization:e}=await p.get("/api/organizations/get",{organization_id:_});y({error:null,loading:!1,organization:e})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a,loading:!1})}},I=async()=>{try{const{organization:e}=A,s=!(null!==e&&void 0!==e&&e.enable_portal);y({loading:!0}),await p.post("/api/organizations/portal/enable",{enable_portal:s,organization_id:_}),y({enable_portal:s,loading:!1},T)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a,loading:!1})}},E=async()=>{try{const{organization:e}=A,s=!(null!==e&&void 0!==e&&e.enable_chat_bot);y({loading:!0}),await p.post("/api/organizations/chatbot/enable",{enable_chat_bot:s,organization_id:_}),y({enable_chat_bot:s,loading:!1},T)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a,loading:!1})}},F=async()=>{try{const{organization:e}=A,s=!(null!==e&&void 0!==e&&e.enable_auto_evaluation);y({loading:!0}),await p.post("/api/organizations/settings/auto-evaluation",{enable_auto_evaluation:s,organization_id:_}),y({enable_auto_evaluation:s,loading:!1},T)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a,loading:!1})}},R=async()=>{const e=null===z||void 0===z?void 0:z.current;if(e)return null!==C&&void 0!==C&&C.archived_at?D():void e.show({actions:[e.CancelAction(),e.Action({label:g({id:"label.archive.66f4804e",defaultMessage:"Archive"}),onClick:D,variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to archive {organization}?",id:"label.are_you_sure_you_want_to_archive_o.a916584b",values:{organization:(0,N.jsx)("strong",{children:(null===C||void 0===C?void 0:C.name)||"this organization"})}})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Once archived, learners will no longer have access to this organization.",id:"label.once_archived_learners_will_no_lon.163a26bc"})})]}),title:g({id:"label.confirm_archival.d808a9a3",defaultMessage:"Confirm archival"})})},D=async()=>{try{const{organization:e}=A,s=!(null!==e&&void 0!==e&&e.archived_at);await p.post("/api/organizations/archive",{is_archived:s,organization_id:_}),y({loading:!1},T)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a,loading:!1})}};(0,l.useEffect)(()=>{T()},[]);const B=v(),L=!!B&&"site_admin"===B.slug;
2return(0,N.jsxs)(Ce.S,{className:"general-settings",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>y({error:null}),show:w,variant:"danger",children:w}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>y({saved:null}),show:M,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Organization details saved successfully.",id:"label.organization_details_saved_success.dba6e551"})}),(0,N.jsx)(Me.x_,{loading:S,children:(0,N.jsx)(ds.l1,{onSubmit:async s=>{try{y({loading:!0});const{organization:e}=await p.post("/api/organizations/save",{banner_image_path:s.banner_image_path,enable_portal:s.enable_portal,feature_subtitle:s.feature_subtitle,feature_tag_line:s.feature_tag_line,feature_title:s.feature_title,logo_path:s.logo_path,name:s.name,organization_id:_,slug:s.slug,theme_color:s.theme_color});y({loading:!1,organization:e,saved:!0},b)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a,loading:!1})}},validateOnChange:!0,validationSchema:(0,Re.by)({locale:f,scope:"organization.update_organization"}),initialValues:{banner_image_path:null!==(a=null===C||void 0===C?void 0:C.banner_image_path)&&void 0!==a?a:"",enable_auto_evaluation:null!==(t=null===C||void 0===C?void 0:C.enable_auto_evaluation)&&void 0!==t&&t,enable_chat_bot:null!==(i=null===C||void 0===C?void 0:C.enable_chat_bot)&&void 0!==i&&i,enable_portal:null!==(n=null===C||void 0===C?void 0:C.enable_portal)&&void 0!==n?n:"",feature_subtitle:null!==(r=null===C||void 0===C?void 0:C.feature_subtitle)&&void 0!==r?r:"",feature_tag_line:null!==(o=null===C||void 0===C?void 0:C.feature_tag_line)&&void 0!==o?o:"",feature_title:null!==(d=null===C||void 0===C?void 0:C.feature_title)&&void 0!==d?d:"",is_archived:!(null===C||void 0===C||!C.archived_at),logo_path:null!==(c=null===C||void 0===C?void 0:C.logo_path)&&void 0!==c?c:"",name:null!==(h=null===C||void 0===C?void 0:C.name)&&void 0!==h?h:"",slug:null!==(u=null===C||void 0===C?void 0:C.slug)&&void 0!==u?u:"",theme_color:null!==(m=null===C||void 0===C?void 0:C.theme_color)&&void 0!==m?m:""},children:e=>{var s;let{errors:a,handleChange:t,handleSubmit:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A,{className:"d-flex flex-column gap-2",onSubmit:i,children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:6,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"General settings",id:"label.general_settings.2a1660d9"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{disabled:S,isInvalid:n.name&&a.name,isValid:n.name&&!a.name,name:"name",onChange:t,placeholder:"Name",type:"text",value:r.name}),a.name&&n.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.name})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Slug",id:"label.slug.d15387ec"})}),(0,N.jsx)(_e.A.Control,{disabled:S,isInvalid:n.slug&&a.slug,isValid:n.slug&&!a.slug,name:"slug",onChange:t,placeholder:"Slug",type:"text",value:r.slug}),a.slug&&n.slug&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.slug})]}),L&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Chatbot",id:"label.chatbot.4db675e0"})}),(0,N.jsx)(_e.A.Switch,{checked:r.enable_chat_bot,disabled:!0,id:"enableChatBotSwitch",onChange:E,label:r.enable_chat_bot?(0,N.jsx)(ke.A,{defaultMessage:"Enabled",id:"label.enabled.92c1cdfd"}):(0,N.jsx)(ke.A,{defaultMessage:"Disabled",id:"label.disabled.75081b59"})})]}),(0,N.jsxs)(os,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Portal",id:"label.portal.b65ffe0c"})}),(0,N.jsx)(_e.A.Switch,{checked:r.enable_portal,id:"enablePortalSwitch",onChange:I,label:r.enable_portal?(0,N.jsx)(ke.A,{defaultMessage:"Enabled",id:"label.enabled.92c1cdfd"}):(0,N.jsx)(ke.A,{defaultMessage:"Disabled",id:"label.disabled.75081b59"})})]}),r.enable_portal&&(0,N.jsx)(Ce.S,{children:(0,N.jsxs)("a",{href:"local"!==x?`https://${r.slug}.${j}/`:`/portal/${r.slug}`,rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(ze.EQc,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})]})})]}),(0,N.jsx)(os,{children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"auto-evaluation",children:(0,N.jsx)(ke.A,{defaultMessage:"Auto-evaluation",id:"label.auto_evaluation.83b5fb9b"})}),(0,N.jsx)(_e.A.Switch,{checked:r.enable_auto_evaluation,id:"enableAutoEvaluationSwitch",name:"auto-evaluation",onChange:F,label:null!==r&&void 0!==r&&r.enable_auto_evaluation?(0,N.jsx)(ke.A,{defaultMessage:"Enabled",id:"label.enabled.92c1cdfd"}):(0,N.jsx)(ke.A,{defaultMessage:"Disabled",id:"label.disabled.75081b59"})})]})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(_e.A.Switch,{checked:!(0,$h.parseBinary)(r.is_archived),id:"archivalSwitch",onChange:R,label:(0,N.jsx)(N.Fragment,{children:(0,$h.parseBinary)(r.is_archived)?(0,N.jsx)(ke.A,{defaultMessage:"Inactive - Archived",id:"label.inactive_archived.879d68af"}):(0,N.jsx)(ke.A,{defaultMessage:"Active",id:"label.active.92340695"})})})]}),r.enable_portal&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Featured title",id:"label.featured_title.375c4541"})}),(0,N.jsx)(_e.A.Control,{disabled:S,isInvalid:n.feature_title&&a.feature_title,isValid:n.feature_title&&!a.feature_title,name:"feature_title",onCh
2ange:t,placeholder:"Featured title",type:"text",value:r.feature_title}),a.feature_title&&n.feature_title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.slug})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Featured subtitle",id:"label.featured_subtitle.6c351f2c"})}),(0,N.jsx)(_e.A.Control,{disabled:S,isInvalid:n.feature_subtitle&&a.feature_subtitle,isValid:n.feature_subtitle&&!a.feature_subtitle,name:"feature_subtitle",onChange:t,placeholder:"Featured subtitle",type:"text",value:r.feature_subtitle}),a.feature_subtitle&&n.feature_subtitle&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.feature_subtitle})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Featured tag line",id:"label.featured_tag_line.3ba7824f"})}),(0,N.jsx)(_e.A.Control,{disabled:S,isInvalid:n.feature_tag_line&&a.feature_tag_line,isValid:n.feature_tag_line&&!a.feature_tag_line,name:"feature_tag_line",onChange:t,placeholder:"Featured tag line",type:"text",value:r.feature_tag_line}),a.feature_tag_line&&n.feature_tag_line&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.feature_tag_line})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Theme color",id:"label.theme_color.59b6a651"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{children:"#"}),(0,N.jsx)(_e.A.Control,{disabled:S,isInvalid:n.theme_color&&a.theme_color,isValid:n.theme_color&&!a.theme_color,name:"theme_color",onChange:t,placeholder:"Theme color",value:r.theme_color}),(0,N.jsx)(Ei.A.Text,{children:r.theme_color&&r.theme_color.length&&(0,N.jsx)(Ce.S,{style:{backgroundColor:`#${r.theme_color}`,height:20,width:30}})})]}),a.theme_color&&n.theme_color&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.theme_color})]})]})]}),r.enable_portal?(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsxs)(Ge.A,{className:"text-center",children:[(0,N.jsx)(Ge.A.Header,{className:"h5 m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Logo",id:"label.logo.d707dc2f"})}),(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-2",children:[!(null===r||void 0===r||null===(s=r.logo_path)||void 0===s||!s.length)&&(0,N.jsx)(Zs.A,{fluid:!0,rounded:!0,alt:"Portal logo",className:"border",src:r.logo_path,style:{objectFit:"contain"}}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:()=>(async e=>{const s=null===k||void 0===k?void 0:k.current;if(!s)return;const a=await s.promptImageUpload();a&&e("logo_path",a.location)})(l),children:[(0,N.jsx)(ke.A,{defaultMessage:"Upload logo",id:"label.upload_logo.c3330082"}),(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"Small image (150x50) in JPG or PNG format for use as the logo image on the portal home page header",id:"label.small_image_150x50_in_jpg_or_png_f.c140b02c"})})})]}),r.logo_path&&r.logo_path.length&&(0,N.jsx)(ve.A,{className:"ms-1",onClick:()=>l("logo_path",""),size:"sm",variant:"default",children:(0,N.jsx)(ze.qbC,{})})]})]})]})}):(0,N.jsx)(Ve.A,{md:6})]}),(0,N.jsx)(_e.A.Group,{className:"d-flex justify-content-end justify-content-md-start",children:(0,N.jsx)(ve.A,{onClick:i,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})})]})})}})}),(0,N.jsx)(je,{ref:z}),(0,N.jsx)(TA,{aspectRatio:2.75,ref:k,uploadHandler:async(s,a)=>{try{const e="organization_logo.jpg";return await p.file("/api/organizations/upload/logo",{job_id:a,organization_id:_},s,e)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;y({error:a})}}})]})};var NI=e=>{const{api:s}=(0,P.nm)(),{organization_id:a}=rT(),t=(0,l.useRef)(null),[i,n,r]=(0,ne.CQ)({applied_tag_sets:null,error:null,loading:!1}),o=async()=>{try{n({loading:!0,tag_sets:[]});const{applied_tag_sets:e}=await s.get("/api/organizations/tags/applied",{organization_id:a});n({applied_tag_sets:e,loading:!1})}catch({err:err}){n({error:err,loading:!1})}};(0,l.useEffect)(()=>{r(),o()},[]);
2const{applied_tag_sets:d,error:c,loading:h}=i;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center mb-2",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Products enabled",id:"label.products_enabled.38fa57d7"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Le.Link,{to:`/admin/tags/${a}`,children:(0,N.jsxs)(ve.A,{variant:"secondary",children:[(0,N.jsx)(ze.BuZ,{className:"me-2"})," Manage Tags"]})}),(0,N.jsxs)(ve.A,{className:"ms-2",variant:"primary",onClick:()=>{t.current.show()},children:[(0,N.jsx)(ze.OiG,{className:"me-2"})," Add Tag Sets"]})]})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:c,variant:"danger",children:c}),h&&(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsxs)(ho,{children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:2,loading:h,children:null!==d&&void 0!==d&&d.length?(0,N.jsx)(N.Fragment,{children:d.map((e,t)=>{let{tag_set:i}=e;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"font-weight-bold",children:null!==i&&void 0!==i&&i.organization_id?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Le.Link,{className:"text-dark",to:`/admin/tags/${a}/${null===i||void 0===i?void 0:i.id}`,children:null===i||void 0===i?void 0:i.name})}):(0,N.jsxs)(N.Fragment,{children:[null===i||void 0===i?void 0:i.name," ",(0,N.jsx)(ze.Eh_,{className:"text-primary ms-2"})]})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)(ve.A,{onClick:()=>(async e=>{try{n({loading:!0}),await s.post("/api/organizations/tags/delete",{organization_id:a,tag_set_id:e}),n({loading:!1}),o()}catch({err:err}){n({error:err,loading:!1})}})(null===i||void 0===i?void 0:i.id),variant:"link",children:"Delete"})})]},t)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:2,children:(0,N.jsx)(ke.A,{defaultMessage:"No tag sets applied",id:"label.no_tag_sets_applied.af3034f5"})})})})]}),(0,N.jsx)(CI,{onHide:o,ref:t})]})};const SI=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t}=(0,P.nm)(),{organization_id:i}=rT(),[n,r,o]=(0,ne.CQ)({error:null,loading:!1,selected_tag_set_ids:[],show:!1,tag_sets:[]}),d=async e=>{r({show:!0}),await(async()=>{try{r({loading:!0,tag_sets:[]});const{tag_sets:e}=await t.get("/api/organizations/tags/eligible",{organization_id:i});r({loading:!1,tag_sets:e})}catch({err:err}){r({error:err,loading:!1})}})()},c=()=>{"function"==typeof a&&a(),o()};(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>o,[]);const{error:h,loading:u,selected_tag_set_ids:m,show:g,tag_sets:p}=n;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ue.A,{backdrop:"static",keyboard:!1,show:g,children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,onHide:c,children:(0,N.jsx)(ue.A.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add tag sets",id:"label.add_tag_sets.65dc32ee"})})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:h,variant:"danger",children:h}),(0,N.jsxs)(ho,{children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})})})}),(0,N.jsx)(ho.Tbody,{cols:1,loading:u,children:null!==p&&void 0!==p&&p.length?(0,N.jsx)(N.Fragment,{children:p.map((e,s)=>{let a=-1!==m.indexOf(null===e||void 0===e?void 0:e.id);return(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"font-weight-bold",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(_e.A.Control,{checked:a,className:"me-2 form-check-input",id:"tag_set["+(null===e||void 0===e?void 0:e.id)+"]",name:"tag_set",onChange:s=>{var a;a=null===e||void 0===e?void 0:e.id,r(e=>{let s=e.selected_tag_set_ids.indexOf(a);return-1!==s?e.selected_tag_set_ids.splice(s,1):e.selected_tag_set_ids.push(a),e})},type:"checkbox"}),null===e||void 0===e?void 0:e.name]})})},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:1,children:(0,N.jsx)(ke.A,{defaultMessage:"No tag sets available",id:"label.no_tag_set
2s_available.6119a5e5"})})})})]})]}),(0,N.jsxs)(ue.A.Footer,{children:[(0,N.jsx)(ve.A,{onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!(null!==m&&void 0!==m&&m.length),variant:"primary",onClick:async()=>{await(async e=>{try{r({loading:!0}),await t.post("/api/organizations/tags/add",{organization_id:i,tag_set_ids:e}),r({loading:!1}),c()}catch({err:err}){r({error:err,loading:!1})}})(m)},children:(0,N.jsx)(ke.A,{defaultMessage:`Select ${m.length} items`,id:"label.select_items"})})]})]})})});SI.displayName="OrganizationTagSelector";var CI=SI;class MI extends l.Component{constructor(e){super(e),this.state={count:0,error:null,integrations:[],loading:!0,page:1,page_size:20,saving:!1,show_dialog:!1}}refreshIntegrations(){const{admin_organization:e,app:s}=this.props,a=s.api,{organization_id:t}=e,{page:i,page_size:l}=this.state;this.setState({integration:null,loading:!0}),a.get("/api/organizations/integrations/list/"+i+"/"+l,{organization_id:t}).then(e=>{let{count:s,integrations:a}=e;this.setState({count:s,integrations:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}getIntegrationType(e){let s="";if(5===e)s="SCORM";return s}componentDidMount(){}render(){return(0,N.jsx)(Ce.S,{children:this.state.integration?(0,N.jsx)("div",{style:{marginBottom:"20px"},children:(0,N.jsxs)("p",{children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Integration type:",description:"",id:"label.integration_type.2050c0ee"})})," ",(0,N.jsx)("span",{children:this.state.integration_type})]})}):(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"No integrations found",description:"",id:"label.no_integrations_found.24dd958b"})})})}}(0,P.G0)(_T(nT(MI)));const kI=(0,l.forwardRef)((e,s)=>{var a,t,i,n,r,o,d,c,h,u,m;const{api:g}=(0,P.nm)(),{organization_id:p}=rT(),[x,v,f]=(0,ne.CQ)({error:null,loading:!1,notifications:[]}),j=async()=>{try{v({loading:!0,notifications:[]});const{notifications:e}=await g.get("/api/organizations/notifications",{organization_id:p});v({loading:!1,notifications:e})}catch({err:err}){v({error:err,loading:!1})}},_=e=>{v({loading:!0}),g.post("/api/organizations/notifications/enable",{event_token:e,organization_id:p}).then(()=>{j()}).catch(e=>{v({loading:!1})})};(0,l.useEffect)(()=>{j()},[]);const{error:b,loading:A,notifications:y}=x;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>v({error:null}),show:b,variant:"danger",children:b}),A&&(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",children:(0,N.jsx)(Me.y$,{})}),!A&&!b&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:6,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",description:"",id:"label.assignments.2c7e21f6"})}),(0,N.jsx)("p",{className:"body-regular",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners when they recieve assignments and remind them when assignments are due",description:"",id:"label.notify_learners_when_they_recieve.c3925736"})})]}),(0,N.jsxs)(Ve.A,{md:5,children:[(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(a=y.assignment_new)&&void 0!==a&&a.is_enabled?1:0,onChange:()=>{_("assignment_new")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"New assignment",description:"",id:"label.new_assignment.1ee23709"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners when they receive a new assignment",description:"",id:"label.notify_learners_when_they_receive.d6517ad0"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(t=y.assignment_due_d7)&&void 0!==t&&t.is_enabled?1:0,onChange:()=>{_("assignment_due_d7")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment due in 7 days",description:"",id:"label.assignment_due_in_7_days.b3decd0a"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners when their assignment is due in seven days",description:"",id:"label.notify_learners_when_their_assignm.bf50b985"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(i=y.assignment_due_d3)&&void 0!==i&&i.is_enabled?1:0,onChange:()=>{_("assignment_due_d3")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment due in 3 days",description:"",id:"label.assignment_due_in_3_days.ff4c7008"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners when their assignment is due in three days",description:"",id:"label.notify_learners_when_their_assignm.2b053137"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(n=y.assignment_overdue)&&void 0!==n&&n.is_enabled?1:0,onChange:()=>{_("assignment_overdue")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment overdue",description:"",id:"label.assignment_overdue.a599046f"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners one day after their assignment is due",description:"",id:"label.notify_learners_one_day_after_thei.490f
264f7"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(r=y.assignment_date_changed)&&void 0!==r&&r.is_enabled?1:0,onChange:()=>{_("assignment_date_changed")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Due date changed",description:"",id:"label.due_date_changed.dcf97e3f"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners if the assignment due date has changed",description:"",id:"label.notify_learners_if_the_assignment.532dcde8"})})]})})]})]})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:6,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",description:"",id:"label.challenges.40b9c8f4"})}),(0,N.jsx)("p",{className:"body-regular",children:(0,N.jsx)(ke.A,{defaultMessage:"Remind learners to complete their challenges and notify them of team activity",description:"",id:"label.remind_learners_to_complete_their.73e13461"})})]}),(0,N.jsxs)(Ve.A,{md:5,children:[(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(o=y.challenge_inactivity_team)&&void 0!==o&&o.is_enabled?1:0,onChange:()=>{_("challenge_inactivity_team")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Team challenge reminder",description:"",id:"label.team_challenge_reminder.128bd552"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Remind teams to complete their challenge if they haven\u2019t started",description:"",id:"label.remind_teams_to_complete_their_cha.28920653"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(d=y.challenge_create_step_complete)&&void 0!==d&&d.is_enabled?1:0,onChange:()=>{_("challenge_create_step_complete"),_("challenge_create_step_complete_d1")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Reflect phase reminders",description:"",id:"label.reflect_phase_reminders.54e68df6"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Remind learners to complete the Reflect phase after their deliverable is submitted",description:"",id:"label.remind_learners_to_complete_the_re.4740dced"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(c=y.challenge_inactivity_learner)&&void 0!==c&&c.is_enabled?1:0,onChange:()=>{_("challenge_inactivity_learner")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Teammates started challenge",description:"",id:"label.teammates_started_challenge.c48930a0"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Notify learners when their team has started without them",description:"",id:"label.notify_learners_when_their_team_ha.131d9841"})})]})})]})]})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:6,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitation",description:"",id:"label.facilitation.08d6b267"})}),(0,N.jsx)("p",{className:"body-regular",children:(0,N.jsx)(ke.A,{defaultMessage:"Send facilitators challenge progress reports for their teams/learners",description:"",id:"label.send_facilitators_challenge_progre.ce08998d"})})]}),(0,N.jsxs)(Ve.A,{md:5,children:[(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(h=y.challenge_progress_midpoint)&&void 0!==h&&h.is_enabled?1:0,onChange:()=>{_("challenge_progress_midpoint")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Mid-challenge progress report",description:"",id:"label.mid_challenge_progress_report.882b282e"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Send facilitators the team/learner progress midway through the challenge (or after 2 weeks)",description:"",id:"label.send_facilitators_the_teamlearner.fbc0f813"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(u=y.challenge_progress_d1_before)&&void 0!==u&&u.is_enabled?1:0,onChange:()=>{_("challenge_progress_d1_before")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Last day challenge progress report",description:"",id:"label.last_day_challenge_progress_report.2b98f3c0"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Send facilitators the team/learner progress one day before the challenge due date",description:"",id:"label.send_facilitators_the_teamlearner.5788eba7"})})]})})]}),(0,N.jsxs)(os,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)(_e.A.Switch,{checked:null!==(m=y.challenge_progress_d1_after)&&void 0!==m&&m.is_enabled?1:0,onChange:()=>{_("challenge_progress_d1_after")}})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)("p",{className:"body-medium mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Final challenge progress report",description:"",id:"label.final_challenge_progress_report.99e1eb11"})}),(0,N.jsx)("p",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Send facilitators the team/learner progress one day after the challenge due date",description:"",id:"label.send_facilitators_the_teamlearner.88029482"})})]})})]})]})]})]})})]})});kI.displayName="OrganizationNotifications";var zI=kI;class TI extends l.Component{constructor(e){super(e),this.refreshContent=async()=>{const{admin_organization:e,app:s}=this.props,a=s.api,t=e.organization?e.organization.id:"";try{this.setState({content:null,loading:!0});const{content:e,count:s}=await a.get(`/api/organizations/content/list/${this.state.page}/${this.state.page_size}`,{organization_id:t,sort_direction:this.state.sort_direction,sort_token:this.state.sort_token});this.setState({content:e,count:s,loading:!1})}catch({err:err}){this.setState({error:err,loading:null})}},this.fetchParentContentScope=()=>{const{admin_organization:e}=this.props,{organization:s}=e;null!==s&&void 0!==s&&s.parent_id&&this.setState({parent_organization_id:s.parent_id})},this.saveSettings=async e=>{const{admin_organization:s,app:a}=this.props,{organization_id:t}=s;let{enable_content_filter:i}=e;try{this.setState({loading:!0}),await a.api.post("/api/organizations/content-filter/enable",{enable_content_filter:i,organization_id:t}),this.setState({loading:!1},()=>{s.refreshOrganization()})}catch({err:err}){this.setState({error:err,loading:!1})}},this.addContent=async e=>{if(!e)return;const{admin_organization:s,app:a}=this.props,{organization:t,organization_id:i}=s;try{this.setState({loading:!0}),await a.api.post("/api/organizations/content/add",{content_items:e,organization_id:i}),this.setState({loading:!1},()=>{this.refreshContent();let s=`Gave ${null===t||void 0===t?void 0:t.name} access to <strong>${null===e||void 0===e?void 0:e.length} items</strong>`;this.showConfirmation({body:s,icon:(0,N.jsx)(ze.A7C,{className:"text-success me-2"})})})}catch({err:err}){this.setState({error:err,loading:!1})}},this.launchContentSelector=async()=>{const e=this.assignment_component_picker.current;if(!e)return;const{parent_organization_id:s}=this.state,a=await e.show({multi_select:!0,organization_id:s||void 0,scope:["challenge","journey","cartridge"]});a&&this.addContent(null===a||void 0===a?void 0:a.selections)},this.launchAgentSelector=async()=>{const e=this.agent_picker.current;if(!e)return;const{content:s}=this.state,a=(s||[]).filter(e=>{var s;return"agent"===(null===e||void 0===e?void 0:e.type)&&(null===e||void 0===e||null===(s=e.agent_persona_stub)||void 0===s?void 0:s.id)}).map(e=>e.agent_persona_stub.id),t=await e.show({already_added_ids:a});if(!t||!t.length)return;const i=t.map(e=>({stub_id:e,type:"agent"}));this.addContent(i)},this.handleAccessAllContent=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{admin_organization:t,intl:i}=this.props,{organization:l}=t,{enable_content_filter:n}=l,{formatMessage:r}=i;n!=(null===e||void 0===e?void 0:e.enable_content_filter)&&a.show({actions:[a.CancelAction({label:r({id:"label.cancel.19766ed6",defaultMessage:"Cancel"})}),a.Action({label:r({id:"label.give_access.ad2cee8f",defaultMessage:"Give access"}),onClick:()=>this.saveSettings(e),variant:"primary"}
2)],body:r({id:"label.organization_name_will_have_access.d7abd85b",defaultMessage:"{organization_name} will have access to all content in the catalog, including all new content added"},{organization_name:null===l||void 0===l?void 0:l.name}),title:r({id:"label.give_access_to_all_content.b665630f",defaultMessage:"Give access to all content"})})},this.handleAccessSelectedContent=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{admin_organization:t,intl:i}=this.props,{organization:l}=t,{enable_content_filter:n}=l,{formatMessage:r}=i;n!=(null===e||void 0===e?void 0:e.enable_content_filter)&&a.show({actions:[a.CancelAction({label:r({id:"label.cancel.19766ed6",defaultMessage:"Cancel"})}),a.Action({label:r({id:"label.remove_access.bb349bfe",defaultMessage:"Remove access"}),onClick:()=>this.saveSettings(e),variant:"primary"})],body:r({id:"label.organization_name_will_only_have_a.5f4c3940",defaultMessage:"{organization_name} will only have access to selected content, not the full catalog"},{organization_name:null===l||void 0===l?void 0:l.name}),title:r({id:"label.remove_access_to_all_content.6c3000d9",defaultMessage:"Remove access to all content"})})},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshContent),this.clearError=()=>this.setState({error:null}),this.showConfirmation=e=>{var s;const a=null===(s=this.confirmation_toast)||void 0===s?void 0:s.current;a&&a.show(e)},this.state={content:null,count:0,error:null,loading:!0,page:1,page_size:10,parent_organization_id:null,sort_direction:"ASC",sort_token:"title"},this.dialog=(0,l.createRef)(),this.assignment_component_picker=(0,l.createRef)(),this.confirmation_toast=(0,l.createRef)(),this.agent_picker=(0,l.createRef)()}componentDidMount(){this.refreshContent(),this.fetchParentContentScope()}render(){const{admin_organization:e}=this.props,{content:s,count:a,error:t,loading:i,page:l,page_size:n,sort_direction:r,sort_token:o}=this.state,{organization:d}=e,{enable_content_filter:c}=d,h=!(null===d||void 0===d||!d.parent_id),u=h?(0,N.jsx)(ke.A,{defaultMessage:"All parent organization content",id:"label.all_parent_organization_content.f9099e4d"}):(0,N.jsx)(ke.A,{defaultMessage:"All content",id:"label.all_content.cd588d55"}),m=h?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{children:[null===d||void 0===d?void 0:d.name," "]}),(0,N.jsx)(ke.A,{defaultMessage:"will have access to all content available to the parent organization",id:"label.will_have_access_to_all_content_av.f0fe0dae"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{children:[null===d||void 0===d?void 0:d.name," "]}),(0,N.jsx)(ke.A,{defaultMessage:"will have access to all content in the catalog, including all new content added",id:"label.will_have_access_to_all_content_in.129991f2"})]});return(0,N.jsxs)(FI,{value:{clearError:this.clearError,handleSort:this.handleSort,showConfirmation:this.showConfirmation,sort_direction:r,sort_token:o},children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Content access",id:"label.content_access.374c9734"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:t,variant:"danger",children:t}),(0,N.jsxs)(Ge.A,{body:!0,className:"mt-3 mb-2 ",children:[(0,N.jsxs)(_e.A,{className:"admin-content-settings",children:[(0,N.jsxs)(Ce.S,{className:"d-flex mb-2",onClick:()=>{this.handleAccessAllContent({enable_content_filter:!1})},children:[(0,N.jsx)(sy,{checked:0==c,className:"d-flex flex-column",type:"radio"}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:u})}),(0,N.jsx)("span",{children:m})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex mb-2",children:[(0,N.jsx)(Ce.S,{className:"d-flex",onClick:()=>{this.handleAccessSelectedContent({enable_content_filter:!0})},children:(0,N.jsx)(sy,{checked:1==c,className:"d-flex flex-column",type:"radio"})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Selected content only",id:"label.selected_content_only.b25d621c"})})}),(0,N.jsxs)("span",{children:[null===d||void 0===d?void 0:d.name," ",(0,N.jsx)(ke.A,{defaultMessage:"will only have access to content selected below",id:"label.will_only_have_access_to_content_s.ded8bc32"})]})]}),c&&(0,N.jsxs)(Ce.S,{className:"ms-auto d-flex gap-2",children:[(0,N.jsxs)(ve.A,{className:"mb-2 d-flex align-items-center btn-add-content",onClick:this.lau
2nchContentSelector,size:"sm",variant:"tertiary",children:[(0,N.jsx)(ze.OiG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Select content",id:"label.select_content.4526f686"})]}),(0,N.jsxs)(ve.A,{className:"mb-2 d-flex align-items-center btn-add-agents",onClick:this.launchAgentSelector,size:"sm",variant:"tertiary",children:[(0,N.jsx)(ze.OiG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Add agents",id:"label.add_agents.b66ec4b2"})]})]})]})]}),c&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Me.x_,{loading:i,spinner:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Me.y$,{})}),children:null!==s&&void 0!==s&&s.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(DI,{content:s,onRefresh:()=>{this.refreshContent()},organization:d}),(0,N.jsx)(Lr,{count:a,onChange:e=>this.setState({page:e},this.refreshContent),page:l,page_size:n})]}):(0,N.jsx)(Ge.A,{body:!0,className:"justify-content-center align-items-center text-center",style:{backgroundColor:"rgba(213, 217, 220, 0.32)",border:"0px"},children:(0,N.jsxs)(Ce.S,{style:{width:"240px"},children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"No content",id:"label.no_content.8154c75a"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This organization does not have access to any content",id:"label.this_organization_does_not_have_ac.d28391db"})}),(0,N.jsxs)(ve.A,{onClick:()=>this.launchContentSelector(),children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Add content",id:"label.add_content.006e1fbb"})]})]})})}),(0,N.jsx)(cd,{ref:this.assignment_component_picker}),(0,N.jsx)(HI,{ref:this.agent_picker})]})]}),(0,N.jsx)(je,{ref:this.dialog}),(0,N.jsx)(PI,{ref:this.confirmation_toast})]})}}var II=(0,Ke.Ay)((0,n.G0)(_T(nT(TI))));const EI=l.createContext({}),FI=EI.Provider,RI=(EI.Consumer,()=>(0,l.useContext)(EI));var DI=e=>{const{content:s,onRefresh:a,organization:t}=e,{handleSort:i,showConfirmation:n,sort_direction:r,sort_token:o}=RI(),{formatMessage:d}=(0,ja.A)(),c=(0,P.nm)(),{api:h}=c,[u,m]=(0,ne.CQ)({error:null,loading:!1}),{loading:g}=u,p=(0,l.useRef)(null),x=e=>"journey"===e?"group_assignment_template_stub":"agent"===e?"agent_persona_stub":`${e}_template_stub`,v=e=>{const s=null===p||void 0===p?void 0:p.current;if(!s)return;const i=null===e||void 0===e?void 0:e[x(null===e||void 0===e?void 0:e.type)],l=null===i||void 0===i?void 0:i.current;s.show({actions:[s.CancelAction({label:d({id:"label.cancel.19766ed6",defaultMessage:"Cancel"})}),s.Action({label:d({id:"label.remove_content_type.a288b9ca",defaultMessage:"Remove {content_type}"},{content_type:null===e||void 0===e?void 0:e.type}),onClick:()=>(async e=>{try{const s=null===e||void 0===e?void 0:e[x(null===e||void 0===e?void 0:e.type)];let t=(null===s||void 0===s?void 0:s.current)||{};m({loading:!0}),await h.post(`/api/organizations/content/remove/${null===e||void 0===e?void 0:e.id}`),"function"==typeof a&&a();const i=`${d({id:"label.removed_access_to.795fe80c",defaultMessage:"Removed access to"})} <strong>${null===t||void 0===t?void 0:t.title}</strong>`;d({id:"label.removed_access_to.795fe80c",defaultMessage:"Removed access to"}),n({body:i})}catch({err:err}){m({error:err})}})(e),variant:"danger"})],body:d({id:"label.remove_access_to_title_from_organi.24a0f20b",defaultMessage:"Remove access to {title} from {organization_name}"},{organization_name:null===t||void 0===t?void 0:t.name,title:(0,N.jsx)("strong",{children:null===l||void 0===l?void 0:l.title})}),title:d({id:"label.remove_access_to_content_type.40a643db",defaultMessage:"Remove access to {content_type}"},{content_type:null===e||void 0===e?void 0:e.type})})};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ho,{defaultSortDirection:r,defaultSortToken:o,onSort:i,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:g,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(LI,{content:e,onRemove:v},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No content found",id:"label.no_content_found.7e47bdc2"})})})})]}),(0,N.jsx)(je,{ref:p})]})};const BI=(0,l.forwardRef)((e,s)=>{const{clearError:a}=RI(),[t,i,n]=(0,ne.CQ)({body:"",icon:"",show:!1}),r=e=>{let{body:s,icon:a}=e;i({body:s,icon:a,show:!0})},o=()=>{a(),n()};(0,l.useImperativeHandle)(s,()=>
2({hide:o,show:r}));const{body:d,icon:c,show:h}=t;return(0,N.jsx)(la.A,{autohide:!1,className:"confirmation-toast d-flex align-items-center",onClose:o,show:h,children:(0,N.jsxs)(la.A.Header,{className:"flex-fill",closeVariant:"white",children:[c," ",(0,N.jsx)("div",{className:"flex-fill",dangerouslySetInnerHTML:{__html:d}})]})})});BI.displayName="ConfirmationToast";var PI=BI;var LI=e=>{const{content:s,onRemove:a}=e,t=(null===s||void 0===s?void 0:s[(()=>{switch(s.type){case"journey":return"group_assignment_template_stub";case"agent":return"agent_persona_stub";default:return`${s.type}_template_stub`}})()])||{},i=(null===t||void 0===t?void 0:t.tags)||[];let l=(null===t||void 0===t?void 0:t.current)||{};return(0,N.jsxs)(io,{className:"content-item-row",children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ad,{component:l,size:32,type:null===s||void 0===s?void 0:s.type}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column ms-2",style:{maxWidth:500},children:(0,N.jsx)("span",{style:{fontWeight:500},children:null===l||void 0===l?void 0:l.title})})]})}),(0,N.jsx)(ro,{style:{textTransform:"capitalize"},children:null===s||void 0===s?void 0:s.type}),(0,N.jsx)(ro,{className:"text-start",children:i&&i.map(e=>{var s;return(0,N.jsx)(bo.A,{pill:!0,variant:"secondary",children:null===e||void 0===e||null===(s=e.tags)||void 0===s?void 0:s.name},null===e||void 0===e?void 0:e.id)})}),(0,N.jsx)(ro,{className:"text-end",children:(0,N.jsx)(ve.A,{className:"btn-remove-content",onClick:()=>a(s),size:"sm",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})})]})};const OI=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),{formatMessage:i}=(0,ja.A)(),[n,r,o]=(0,ne.CQ)({already_added_ids:[],error:null,loading:!1,resolve:Function(),search_term:"",selected_ids:[],show:!1,stubs:[]}),d=(0,l.useRef)(),c=function(){let{already_added_ids:e=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(s=>{r({already_added_ids:e,error:null,loading:!0,resolve:s,search_term:"",selected_ids:[],show:!0,stubs:[]}),u()})},h=()=>{n.resolve(null),o()},u=async()=>{try{const e=await t.get("/api/agent-templates/personas/list");r({loading:!1,stubs:(null===e||void 0===e?void 0:e.stubs)||[]})}catch(e){r({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||"Failed to load agents",loading:!1})}},m=e=>{const s=n.selected_ids.includes(e)?n.selected_ids.filter(s=>s!==e):[...n.selected_ids,e];r({selected_ids:s})};(0,l.useImperativeHandle)(a,()=>({hide:h,show:c})),(0,l.useEffect)(()=>o,[]);const{already_added_ids:g,error:p,loading:x,search_term:v,selected_ids:f,show:j,stubs:_}=n,b=v.trim().toLowerCase(),A=_.filter(e=>{var s,a,t,i,l;if(g.includes(e.id))return!1;if(!b)return!0;const n=(null===e||void 0===e||null===(s=e.current)||void 0===s||null===(a=s.name)||void 0===a?void 0:a.toLowerCase())||"",r=(null===e||void 0===e||null===(t=e.current)||void 0===t||null===(i=t.category)||void 0===i||null===(l=i.name)||void 0===l?void 0:l.toLowerCase())||"";return n.includes(b)||r.includes(b)});return(0,N.jsxs)(xe,{backdrop:"static",onHide:h,show:j,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add agents",id:"label.add_agents.b66ec4b2"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:!!p,variant:"danger",children:p}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 mb-3",children:[(0,N.jsx)(ze.KSO,{className:"text-muted"}),(0,N.jsx)(_e.A.Control,{onChange:e=>r({search_term:e.target.value}),ref:d,value:v,placeholder:i({id:"label.search_by_name_or_category.6eb99d04",defaultMessage:"Search by name or category..."})})]}),x?(0,N.jsx)(Ce.S,{className:"text-center text-muted py-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Loading agents...",id:"label.loading_agents.a4e0608f"})}):0===A.length?(0,N.jsx)(Ce.S,{className:"text-center text-muted py-4",children:(0,N.jsx)(ke.A,{defaultMessage:"No agents available.",id:"label.no_agents_available.c4763d2f"})}):(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-2",children:A.map(e=>{var s,a;const t=null===e||void 0===e?void 0:e.current,i=f.includes(e.id);return(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 p-2 border rounded",onClick:()=>m(e.id),role:"button",style:{background:i?"rgba(13,110,253,0.08)":"transparent",curs
2or:"pointer"},children:[(0,N.jsx)(_e.A.Check,{checked:i,onChange:()=>m(e.id),type:"checkbox"}),null!==t&&void 0!==t&&t.avatar_path?(0,N.jsx)(md,{name:(null===t||void 0===t?void 0:t.name)||"?",size:32,src:t.avatar_path}):(0,N.jsx)(Ce.S,{style:{alignItems:"center",background:(null===t||void 0===t||null===(s=t.category)||void 0===s?void 0:s.color)||"#6c757d",borderRadius:"50%",color:"#fff",display:"flex",flexShrink:0,fontSize:14,height:32,justifyContent:"center",width:32},children:((null===t||void 0===t?void 0:t.name)||"?").charAt(0).toUpperCase()}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-grow-1",children:[(0,N.jsx)("strong",{children:null===t||void 0===t?void 0:t.name}),(0,N.jsxs)("small",{className:"text-muted",children:[null!==t&&void 0!==t&&null!==(a=t.category)&&void 0!==a&&a.name?(0,N.jsx)(bo.A,{pill:!0,bg:"info",children:t.category.name}):null,null!==e&&void 0!==e&&e.organization?(0,N.jsx)("span",{className:"ms-2",children:e.organization.name}):(0,N.jsx)(ze.Eh_,{className:"ms-2 text-primary",title:"Global"})]})]})]},e.id)})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:h,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!f.length,onClick:()=>{n.resolve(n.selected_ids.slice()),o()},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:`Add ${f.length} agent${1===f.length?"":"s"}`,id:"client.src.pages.admin.components.organization.AdminContent.AgentPicker.submit"})})]})]})});OI.displayName="AgentPickerModal";var HI=OI;const UI=l.createContext({}),QI=UI.Provider,VI=(UI.Consumer,()=>(0,l.useContext)(UI));var GI=e=>{const{groups:s,handleSort:a,include_sub_orgs:t,loading:i,sort_direction:l,sort_token:n}=VI();return(0,N.jsxs)(ho,{defaultSortDirection:l,defaultSortToken:n,onSort:a,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),t&&(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitator Name(s)",id:"label.facilitator_names.9b0bbc25"})}),(0,N.jsx)(ho.Th,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Active learners",id:"label.active_learners.17262d42"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:t?6:5,loading:i,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map(e=>(0,N.jsx)(WI,{group:e},null===e||void 0===e?void 0:e.id))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:t?6:5,children:(0,N.jsx)(ke.A,{defaultMessage:"No groups found.",id:"label.no_groups_found.ffb3951a"})})})})]})};var WI=e=>{const{group:s}=e,{styles:a,userHasRight:t,userIsSiteAdmin:i}=((0,Pe.W6)(),(0,P.nm)()),{organization_id:l}=rT(),{getFacilitators:n,getLearners:r,handleDelete:o,include_sub_orgs:d}=VI(),c=n(s),h=r(s),{id:u,name:m}=(null===s||void 0===s?void 0:s.organization)||{},g=i()||0==(null===s||void 0===s?void 0:s.active_assignment_count);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsx)(_d,{group:s,size:45})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{className:"fw-semibold",to:`/admin/group/${null===s||void 0===s?void 0:s.id}`,children:null===s||void 0===s?void 0:s.name})}),d&&(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{className:"fw-semibold",to:`/admin/organization/${u}`,children:m})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:(0,N.jsx)("ul",{className:"list-unstyled mb-0",children:!(null===c||void 0===c||!c.length)&&c.map((e,s)=>{var a,t;let i=(null===e||void 0===e||null===(a=e.organization_member)||void 0===a||null===(t=a.user)||void 0===t?void 0:t.fullname)||"";return s!==(null===c||void 0===c?void 0:c.length)-1&&(i+=","),(0,N.jsx)("li",{children:i},s)})})}),(0,N.jsx)(ro,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)("span",{className:"text-center",children:(null===h||void 0===h?void 0:h.length)||0})}),(0,N.jsx)(ro,{className:"text-end",children:t("manage_organization",l)?(0,N.jsx)("div",{className:"d-flex justify-content-end gap-2",children:t("manage_group",l)&&(0,N.jsx)(ve.A,{disabled:!g,onClick:()=>o(s),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})}):"-"})]},null===s||void 0===s?void 0:s.id)};class KI extends l.Component{constructor(s){super(s),this.clearError=()=>this.setState({error:null}),this.refreshGroups=async()=>{try{var s,a;const e=null===(s=this.sub_org_switch)||void 0===s?void 0:s.current,t=null===(a=this.archive_filter)||void 0===a?void 0:a.current;if(!e||!t)return;const{selected:i}=e,{selected:l}=t,{page:n,page_size:r,search_term:o,sort_direction:d,sort_token:c}=this.state,{admin_organization:h,app:u}=this.props,m=u.api,{organization:g,setGroupBadgeCount:p}=h,x=(null===g||void 0===g?void 0:g.id)||"";this.setState({groups:null,loading:!0});const{count:v,groups:f}=await m.get(`/api/organizations/groups/list/${n}/${r}`,{filter_archived:l,include_sub_orgs:i,organization_id:x,search_term:o,sort_direction:d,sort_token:c});this.setState({count:v,groups:f,loading:!1}),p(v)}catch(e){const{err:a,message:t}=e||{};this.setState({error:a||t,loading:!1})}},this.startSearch=e=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1,search_term:e},this.refreshGroups)},1e3)},this.deleteGroup=e=>{const{app:s}=this.props;s.api.post("/api/groups/delete",{group_id:e}).then(()=>{this.refreshGroups()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.getFacilitators=e=>{var s,a;return(null===e||void 0===e||null===(s=e.members)||void 0===s||null===(a=s.filter)||void 0===a?void 0:a.call(s,e=>{var s;return 3===(null===(s=e.organization_member)||void 0===s?void 0:s.role_id)}))||[]},this.getLearners=e=>{var s,a;return(null===e||void 0===e||null===(s=e.members)||void 0===s||null===(a=s.filter)||void 0===a?void 0:a.call(s,e=>{var s;return!(null!==(s=e.organization_member)&&void 0!==s&&s.role_id)&&!(null!==e&&void 0!==e&&e.archived_at)}))||[]},this.includeSubOrgs=()=>{var e,s;return!(null===this||void 0===this||null===(e=this.sub_org_switch)||void 0===e||null===(s=e.current)||void 0===s||!s.selected)},this.handleSort=(e,s)=>this.setState({page:1,sort_direction:s,sort_token:e},this.refreshGroups),this.handleChangeStatusFilter=()=>this.setState({page:1},this.refreshGroups),this.handleDelete=e=>{var s;const{intl:a}=this.props,{formatMessage:t}=a,i=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;i&&i.show({actions:[i.CancelAction(),i.Action({label:t({id:"label.delete_group.3f7374ac",defaultMessage:"Delete group"}),onClick:()=>this.deleteGroup(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete {group}?",id:"label.are_you_sure_you_want_to_delete_gr.e78edb7f",values:{group:(0,N.jsx)("strong",{children:null===e||void 0===e?void 0:e.name})}})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can not be undone.",id:"label.this_action_can_not_be_und
2one.128d24d0"})})]}),title:t({id:"label.delete_group.3f7374ac",defaultMessage:"Delete group"})})},this.state={count:0,error:null,groups:null,integration:{},loading:!0,page:1,page_size:10,search_term:"",sort_direction:"ASC",sort_token:"name"},this.search_timer=null,this.group_editor=null,this.sub_org_switch=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)(),this.archive_filter=(0,l.createRef)()}componentDidMount(){this.refreshGroups()}render(){var e;const{admin_organization:s,app:a}=this.props,{organization:t,organization_id:i}=s,l=this.includeSubOrgs(),{count:n,error:r,groups:o,loading:d,page:c,page_size:h,sort_direction:u,sort_token:m}=this.state;return(0,N.jsxs)(QI,{value:{getFacilitators:this.getFacilitators,getLearners:this.getLearners,groups:o,handleDelete:this.handleDelete,handleSort:this.handleSort,include_sub_orgs:l,loading:d,sort_direction:u,sort_token:m},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"})}),a.userHasRight("manage_group",i)&&(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ve.A,{onClick:null===this||void 0===this||null===(e=this.group_editor)||void 0===e?void 0:e.show,style:{marginBottom:10},children:(0,N.jsx)(ke.A,{defaultMessage:"Add group",id:"label.add_group.94901258"})})})]}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:r,variant:"danger",children:r}),(0,N.jsxs)(Qe.A,{className:"mb-2 align-items-center",children:[(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,sm:12,children:(0,N.jsxs)(Ei.A,{className:"mb-1",size:"sm",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(_e.A.Control,{onChange:e=>{var s;return this.startSearch(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},placeholder:"Search"})]})}),(0,N.jsx)(Ve.A,{className:"mb-1",md:2,sm:12,children:(0,N.jsx)(vT,{defaultSelected:!1,onChange:()=>{this.handleChangeStatusFilter()},ref:this.archive_filter})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(Ce.S,{className:"d-inline-flex float-end",children:[(0,N.jsx)(_e.A.Label,{className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Include sub-organizations",id:"label.include_sub_organizations.b8a90835"})}),(0,N.jsx)(pT,{defaultSelected:!1,onToggle:this.refreshGroups,ref:this.sub_org_switch})]})})]}),(0,N.jsx)(GI,{}),(0,N.jsx)(Lr,{count:n,onChange:e=>this.setState({page:e},this.refreshGroups),page:c,page_size:h}),(0,N.jsx)(qN,{onCreate:this.refreshGroups,organization:t,ref:e=>this.group_editor=e})]})}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}var YI=(0,Ke.Ay)((0,P.G0)(_T(nT(KI))));class qI extends l.Component{constructor(e){super(e),this.refreshReports=async()=>{try{const{page:e,page_size:s,sort_direction:a,sort_token:t}=this.state,{admin_organization:i,app:l}=this.props,n=null===i||void 0===i?void 0:i.organization_id,r=null===l||void 0===l?void 0:l.api;this.setState({loading:!0,reports:null,selected_reports:[]});const{count:o,reports:d}=await r.get(`/api/organizations/social/list/${e}/${s}`,{organization_id:n,sort_direction:a,sort_token:t});this.setState({count:o,loading:!1,reports:d})}catch({err:err}){this.setState({error:err,loading:null})}},this.updateSelectedReports=e=>{const{selected_reports:s}=this.state,{admin_organization:a,app:t}=this.props,i=null===a||void 0===a?void 0:a.organization_id,l=null===t||void 0===t?void 0:t.api;if(null===s||void 0===s||!s.length)return;const n=[];this.setState({loading:!0});for(const r of s)r&&n.push(l.post("/api/organizations/social/flag",{flag_id:r,organization_id:i,status:e}));Promise.all(n).then(()=>{this.setState({all_selected:!1,loading:!1,selected_reports:[]},this.refreshReports)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.updateReport=async(e,s)=>{try{const{admin_organization:a,app:t}=this.props,i=null===a||void 0===a?void 0:a.organization_id,l=t.api;this.setState({all_selected:!1,loading:!0,selected_reports:[]}),await l.post("/api/organizations/social/flag",{flag_id:e,organization_id:i,status:s}),this.setState({loading:!1},this.refreshReports)}catch({err:err}){this.setState({error:err,loading:!1})}},this.undoReport=async e=>{try{const{admin_organization:s,app:a}=this.props,t=null===s||void 0===s?void 0:s.organization_id,i=a.api;this.setState({loading:!0}),await i.post("/api/organizations/social/flag/undo",{flag_id:e,organization_id:t}),this.setState({loading:!1},this.refreshReports)}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleChangePage=e=>this.setState({all_selected:!1,page:e,selected_reports:[]},this.refreshReports),this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshReports),this.handleDismissSelectedReports=()=>{var e;const{intl:s}=this.props,a=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s.formatMessage({id:"label.yes_dismiss.9fa01db5",defaultMessage:"Yes, Dismiss"}),onClick:()=>this.updateSelectedReports(1),variant:"danger"})],body:s.formatMessage({id:"label.are_you_sure_you_want_to_dismiss_a.c3352ee6",defaultMessage:"Are you sure you want to dismiss all selected messages?"}),size:"sm",title:"Dismiss"})},this.handleHideSelectedReports=()=>{var e;const{intl:s}=this.props,a=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s.formatMessage({id:"label.hide_message.50165099",defaultMessage:"Hide message"}),onClick:()=>this.updateSelectedReports(2),variant:"danger"})],body:s.formatMessage({id:"label.are_you_sure_you_want_to_hide_all.a3e7c243",defaultMessage:"Are you sure you want to hide all selected messages?"}),size:"sm",title:"Hide"})},this.handleDeleteSelectedReports=()=>{var e;const{intl:s}=this.props,a=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s.formatMessage({id:"label.delete_message.87e7176a",defaultMessage:"Delete message"}),onClick:()=>this.updateSelectedReports(3),variant:"danger"})],body:s.formatMessage({id:"label.are_you_sure_you_want_to_delete_al.ce06eafc",defaultMessage:"Are you sure you want to delete all selected messages?"}),size:"sm",title:s.formatMessage({id:"label.delete.e2d0a549",defaultMessage:"Delete"})})},this.handleViewReportContent=(e,s)=>{var a,t;e.preventDefault();const{intl:i}=this.props,l=null===this||void 0===this||null===(a=this.dialog)||void 0===a?void 0:a.current;l&&l.show({actions:[l.CancelAction()],body:(0,N.jsx)("img",{src:null===s||void 0===s||null===(t=s.file)||void 0===t?void 0:t.location,style:{borderRadius:"4px",height:"100%",width:"100%"},alt:i.formatMessage({id:"label.the_content_of_the_file_attachment.bd762ced",defaultMessage:"The content of the file attachment for this flagged message"})}),size:"sm",title:i.formatMessage({id:"label.view_content.a1eee7df",defaultMessage:"View content"})})},this.handleViewReportDetails=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!t)return;const{comments:i,type:l}=e||{};let n="";switch(l){case 0:n=a.formatMessage({id:"label.inappropriate_content.940bd85c",defaultMessage:"Inappropriate content"});break;case 1:n=a.formatMessage({id:"label.spam_or_duplicate_comments.31442e34",defaultMessage:"Spam or duplicate comments"});break;case 2:n=a.formatMessage({id:"label.other.f97e9da0",defaultMessage:"Other"})}t.show({actions:[t.CancelAction()],body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Reason:",id:"label.reason.3425d108"})," ",n,(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),"Comment: ",i||"-"]}),size:"sm",title:a.formatMessage({id:"label.view_details.d1bf045b",defaultMessage:"View details"})})},this.handleDismissSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.yes_dismiss.9fa01db5",defaultMessage:"Yes, Dismiss"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,1),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_dismiss_t.be41db06",defaultMessage:"Are you sure you want to dismiss this message?"}),size:"sm",title:"Dismiss"})},this.handleHideSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.hide_message.50165099",defaultMessage:"Hide message"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,2),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_hide_this.34309a76",defaultMessage:"Are you sure you want to hide this message?"}),size:"sm",title:a.formatMessage({id:"label.hide.ac20a57b",defaultMessage:"Hide"})})},this.handleDeleteSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.delete_message.87e7176a",defaultMessage:"Delete message"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,3),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_delete_th.a221ce62",defaultMessage:"Are you sure you want to delete this message?"}),size:"sm",title:a.formatMessage({id:"label.delete.e2d0a549",defaultMessage:"Delete"})})},this.handleUndoSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.undo_action.20bb2a9b",defaultMessage:"Undo action"}),onClick:()=>{this.undoReport(null===e||void 0===e?void 0:e.id),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_undo_this.f0415c73",defaultMessage:"Are you sure you want to undo this report? This message will be restored and visible to learners."}),size:"sm",title:a.formatMessage({id:"label.undo.a8283ade",defaultMessage:"Undo"})})},this.isSelectedReport=e=>
2this.state.selected_reports.includes(e),this.getSelectableReports=()=>{var e;const{reports:s}=this.state;return null===s||void 0===s||null===(e=s.filter)||void 0===e?void 0:e.call(s,e=>0===(null===e||void 0===e?void 0:e.status))},this.toggleSelectAll=()=>{const{all_selected:e}=this.state,s=this.getSelectableReports().map(e=>null===e||void 0===e?void 0:e.id),a=e?[]:[...s];this.setState({all_selected:!e,selected_reports:a})},this.toggleSelection=e=>{const{selected_reports:s}=this.state,a=this.getSelectableReports(),t=this.isSelectedReport(e)?s.filter(s=>s!==e):[...s,e];this.setState({all_selected:(null===a||void 0===a?void 0:a.length)===(null===t||void 0===t?void 0:t.length),selected_reports:t})},this.state={all_selected:!1,count:0,error:null,loading:!0,page:1,page_size:20,reports:null,selected_reports:[],sort_direction:"DESC",sort_token:"created_at"},this.dialog=(0,l.createRef)()}componentDidMount(){this.refreshReports()}render(){var e;const{admin_organization:s,app:a,intl:t}=this.props,{styles:i,userHasRight:l}=a,{all_selected:n,count:r,error:o,loading:d,page:c,page_size:h,reports:u,selected_reports:m,sort_direction:g,sort_token:p}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Social content moderation",id:"label.social_content_moderation.0
2d9bcb85"})}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{disabled:0===(null===m||void 0===m?void 0:m.length),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"With selected",id:"label.with_selected.338a14ac"})}),(0,N.jsxs)(li.A.Menu,{align:"end",children:[(0,N.jsx)(li.A.Item,{onClick:this.handleDismissSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Dismiss",id:"label.dismiss.48845bff"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleHideSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Hide",id:"label.hide.ac20a57b"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleDeleteSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})]})]}),(0,N.jsxs)(Ge.A,{body:!0,className:"social-dashboard",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:o,variant:"danger",children:o}),(0,N.jsxs)(ho,{defaultSortDirection:g,defaultSortToken:p,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(_e.A.Check,{checked:n,disabled:!(null!==(e=this.getSelectableReports())&&void 0!==e&&e.length),onClick:this.toggleSelectAll,type:"checkbox","aria-label":t.formatMessage({id:"label.toggle_select_all_reports.506c8d39",defaultMessage:"Toggle select all reports"})})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"status",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"content",children:(0,N.jsx)(ke.A,{defaultMessage:"Content",id:"label.content.47bd2907"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"author",children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"reporter",children:(0,N.jsx)(ke.A,{defaultMessage:"Reported by",id:"label.reported_by.c170bc77"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"created_at",children:(0,N.jsx)(ke.A,{defaultMessage:"Date",id:"label.date.99c40ab4"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:d,children:null!==u&&void 0!==u&&u.length?(0,N.jsx)(N.Fragment,{children:u.map(e=>{var a,t;let{created_at:i,creator:n,status:r,team_message:o}=e,d=null===o||void 0===o?void 0:o.message,{body:c,user:h}=d||{},u=h.fullname,m=n.fullname,g="",p="";switch(r){case 0:g="open",p="primary";break;case 1:g="dismissed",p="secondary";break;case 2:g="hidden",p="warning";break;case 3:g="deleted",p="danger"}return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(_e.A.Check,{checked:this.isSelectedReport(null===e||void 0===e?void 0:e.id),disabled:0!==(null===e||void 0===e?void 0:e.status),id:`report-${null===e||void 0===e?void 0:e.id}`,name:`report-${null===e||void 0===e?void 0:e.id}`,onChange:()=>this.toggleSelection(null===e||void 0===e?void 0:e.id),type:"checkbox"})}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)(bo.A,{bg:p,children:g})}),(0,N.jsx)(ho.Td,{className:"social-dashboard-message-content",children:"image"===(null===o||void 0===o||null===(a=o.file)||void 0===a?void 0:a.type)&&null!==o&&void 0!==o&&null!==(t=o.file)&&void 0!==t&&t.location?(0,N.jsx)(ve.A,{className:"p-0",onClick:e=>this.handleViewReportContent(e,o),variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"View content",id:"label.view_content.a1eee7df"})}):(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:c}})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:u}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:m}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:(0,N.jsx)(Gh.XU,{value:new Date(i)})}),(0,N.jsx)(ho.Td,{className:"text-end",children:l("manage_user",null===s||void 0===s?void 0:s.organization_id)?(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[0===r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onClick:()=>this.handleDismissSingleReport(e),size:"sm",variant:"outline-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Dismiss",id:"label.dismiss.48845bff"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleHideSingleReport(e),size:"sm",variant:"outline-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Hide",id:"label.hide.ac20a57b"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleDeleteSingleReport(e),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]}),0!==r&&(0,N.jsx)(ve.A,{onClick:()=>this.handleUndoSingleReport(e),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Undo",id:"label.undo.a8283ade"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleViewReportDetails(e),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Details",id:"label.details.45989de4"})})]}):"-"})]},null===e||void 0===e?void 0:e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"7",children:(0,N.jsx)(ke.A,{defaultMessage:"No reports found.",id:"label.no_reports_found.38387272"})})})})]}),(0,N.jsx)(Lr,{count:r,onChange:this.handleChangePage,page:c,page_size:h}),(0,N.jsx)(je,{ref:this.dialog})]})]})}}var JI=(0,Ke.Ay)((0,P.G0)(_T(nT(qI))));const XI=l.createContext({}),ZI=XI.Provider,$I=(XI.Consumer,()=>(0,l.useContext)(XI));var eE=e=>{const{handleSort:s,include_sub_orgs:a,loading:t,members:i,sort_direction:l,sort_token:n}=$I();return(0,N.jsxs)(ho,{defaultSortDirection:l,defaultSortToken:n,onSort:s,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{style:{width:30}}),(0,N.jsx)(ho.Th,{sortable:!0,name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),a&&(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Organizations",id:"label.organizations.2730183d"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"email_address",children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),!a&&(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"role",children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"last_online",children:(0,N.jsx)(ke.A,{defaultMessage:"Last online",id:"label.last_online.ca050a43"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"total_time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time online",id:"label.time_online.34b5594c"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:t,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map(e=>(0,N.jsx)(sE,{user:e},null===e||void 0===e?void 0:e.id))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:a?8:7,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found",id:"label.no_users_found.bf1e104f"})})})})]})};var sE=e=>{var s,a,t,i;const{user:l}=e,{default_email:n,integrations:r,last_online:o,organization_memberships:d,total_time:c}=l,{organization_id:h}=rT(),{getRoleFilter:u,handleArchiveToggle:m,handleRemoveUser:g,include_sub_orgs:p,launchUserDetailsModal:x}=$I(),{styles:v,userHasOrgRole:f,userHasRight:j}=(0,P.nm)(),_=f("organization_admin")||j("manage_group_user",h),b=null===n||void 0===n?void 0:n.email_address,{convertSeconds:A}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},y=ci()(o).format("M/D/YYYY, h:mm a"),w=c?A(l.total_time/1e3):null,S=null===r||void 0===r||null===(s=r[0])||void 0===s?void 0:s.type,C=d.find(e=>(null===e||void 0===e?void 0:e.organization_id)===h);let M=(0,T.sortBy)(d,e=>{var s;return null===e||void 0===e||null===(s=e.organization)||void 0===s?void 0:s.name});"learner"===u()&&(M=M.filter(e=>!e.role_id));const k=e=>e.organization_id===h,z=d.find(e=>(null===e||void 0===e?void 0:e.organization_id)==h),I=!!z,E=null===z||void 0===z?void 0:z.archived_at,F=_&&I,R=_&&I,D=I&&0==(null===z||void 0===z?void 0:z.active_assignment_count);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsx)(Ya,{user:l})}),(0,N.jsx)(ro,{children:_?(0,N.jsx)("a",{className:"fw-semibold text-decoration-none",href:"#",onClick:e=>{e.preventDefault(),x(null===l||void 0===l?void 0:l.id)},children:(0,N.jsx)(Fl,{inline:!0,maxWidth:175,children:null===l||void 0===l?void 0:l.fullname})}):(0,N.jsx)(Fl,{inline:!0,maxWidth:175,children:null===l||void 0===l?void 0:l.fullname})}),p&&(0,N.jsx)(ro,{children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column",children:!(null===(a=M)||void 0===a||!a.length)&&M.map((e,s)=>{var a,t;return(0,N.jsx)(ph,{className:"p-0 fw-semibold transform-none fs-6",condition:!0,disabled:k(e),to:`/admin/organization/${null===e||void 0===e?void 0:e.organization_id}`,tooltipPlacement:"right",variant:"link",tooltipContent:null!==e&&void 0!==e&&e.role_id?null===e||void 0===e||null===(a=e.role)||void 0===a?void 0:a.name:(0,N.jsx)(ke.A,{defaultMessage:"Learner",id:"label.learner.0815286c"}),children:`${null===e||void 0===e||null===(t=e.organization)||void 0===t?void 0:t.name}`},s)})})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:b?(0,N.jsx)(Fl,{inline:!0,maxWidth:200,children:b}):"-"}),!p&&(0,N.jsx)(ro,{hiddenBelow:"lg",children:C&&null!==C&&void 0!==C&&C.role_id?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ke.A,{defaultMessage:null===C||void 0===C||null===(t=C.role)||void 0===t?void 0:t.name,id:`label.roles.${null===C||void 0===C||null===(i=C.role)||void 0===i?void 0:i.slug}`})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner",id:"label.learner.0815286c"})})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:o?y:"- -"}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:c?`${w.value} ${w.label}`:"- -"}),(0,N.jsxs)(ro,{className:"text-end",children:[(0,N.jsx)(KA,{type:S}),j("manage_organization",h)?(0,N.jsxs)("div",{className:"d-inline-flex gap-2 ms-2",children:[R&&(0,N.jsx)(ve.A,{onClick:()=>m(l,E),size:"sm",variant:"outline-secondary",children:E?(0,N.jsx)(ke.A,{defaultMessage:"Activate",id:"label.activate.24433c70"}):(0,N.jsx)(ke.A,{defaultMessage:"Archive",id:"label.archive.66f4804e"})}),F&&(0,N.jsx)(ve.A,{disabled:!D,onClick:()=>g(l),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})]}):"-"]})]})};const aE=(0,l.forwardRef)((e,s)=>{const{defaultSelection:a,onChange:t}=e,i=(0,l.useRef)(!1),[n,r,o]=(0,ne.CQ)({selection:a}),{selection:d}=n;return(0,l.useImperativeHandle)(s,()=>({selection:d})),(0,l.useEffect)(()=>{null!==i&&void 0!==i&&i.current?t(d):i.current=!0},[d,i]),(0,N.jsxs)(li.A,{autoClose:"outside",onSelect:e=>r({selection:e}),children:[(0,N.jsx)(li.A.Toggle,{size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Role: {selection}",id:"label.role.02552",values:{selection:d}})}),(0,N.jsx)(li.A.Menu,{children:["all","admin","learner"].map((e,s)=>
2(0,N.jsxs)(li.A.Item,{className:"d-flex",eventKey:e,children:[(0,N.jsx)(_e.A.Check,{checked:e===d,className:"me-1",style:{pointerEvents:"none"},type:"radio"}),(0,T.capitalize)(e)]},s))})]})});aE.displayName="UsersRoleFilterDropdown",aE.defaultProps={defaultSelection:"all",onChange:Function()};var tE=aE;const iE=(0,l.forwardRef)((e,s)=>{const{onHide:a,organization_id:t}=e,{api:i}=(0,P.nm)(),[n,r,o]=(0,ne.CQ)({count:0,error:null,loading:!1,organization_users:[],page:1,page_size:20,search_term:"",selected_user_ids:[],show:!1}),{count:d,error:c,loading:h,organization_users:u,page:m,page_size:g,search_term:p,selected_user_ids:x,show:v}=n,f=(0,l.useRef)(),j=async()=>{try{r({loading:!0});const{count:e,organization_users:s}=await i.get(`/api/organizations/${t}/users/directory/list/${m}/${g}`,{exclude_existing:1,search_term:p});r({count:e,loading:!1,organization_users:s})}catch({err:err}){throw r({error:err}),err}},_=async e=>{r({show:!0}),await j()},b=()=>{o(),"function"===typeof a&&a()},A=async function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r(a=>{let t=x.indexOf(null===e||void 0===e?void 0:e.user_id);return-1!==t?s&&a.selected_user_ids.splice(t,1):a.selected_user_ids.push(null===e||void 0===e?void 0:e.user_id),a})},y=e=>-1!==x.indexOf(null===e||void 0===e?void 0:e.user_id);return(0,l.useImperativeHandle)(s,()=>({hide:b,show:_})),(0,l.useEffect)(()=>{j()},[m,g]),(0,l.useEffect)(()=>{f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{j()},1e3)},[p]),(0,l.useEffect)(()=>o,[]),(0,N.jsxs)(xe,{onHide:b,show:v,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add users from directory",id:"label.add_users_from_directory.a3d0029f"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:c,variant:"danger",children:c}),(0,N.jsx)(Me.x_,{loading:h,children:u&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(Ei.A,{className:"me-2",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search for user by name or email...",value:p,onChange:e=>{r({search_term:e.target.value})}})]}),(0,N.jsx)(Yh.A,{"aria-label":"Records shown",children:[20,100,1e3].map(e=>(0,N.jsx)(ve.A,{active:g==e,variant:"secondary",onClick:()=>{r({page:1,page_size:e})},children:e}))})]}),(0,N.jsxs)(ho,{hover:!0,striped:!0,className:"table-rounded text-resize mt-2",children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{style:{width:30},children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(_e.A.Check,{checked:!1,onChange:()=>{let e=!1;for(let s of u)y(s)&&(e=!0),A(s);if(e)for(let s of u)y(s)&&A(s,!0)},value:1})})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",style:{width:30}}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})})]})}),(0,N.jsxs)(ho.Tbody,{children:[u.map(e=>{const{user:s}=e,{default_email:a,fullname:t}=s;let i=a&&a.email_address;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(_e.A.Check,{checked:y(e),value:1,onChange:s=>{A(e,!0)}})})}),(0,N.jsx)(ho.Td,{className:"px-1",hiddenBelow:"lg",children:(0,N.jsx)(Ya,{user:s})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Fl,{maxWidth:250,placement:"bottom",children:t})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:(0,N.jsx)(Fl,{maxWidth:250,placement:"bottom",children:i||"-"})})]},s.id)}),0===u.length&&(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No users found.",id:"label.no_users_found.ce0171e5"})})})]})]}),(0,N.jsx)(Lr,{count:d,onChange:e=>{r({page:e})},page:m,page_size:g})]})})]}),(0,N.jsxs)(xe.Footer,{className:"text-end",children:[(0,N.jsx)(ve.A,{disabled:h,onClick:b,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsxs)(ve.A,{disabled:h||!(null!==x&&void 0!==x&&x.length),onClick:async()=>{try{r({loading:!0}),await i.post("/api/organizations/members/add",{organization_id:t,user_ids:x}),b()}catch({err:err}){throw r({error:err}),err}},variant:"primary",children:["Select ",null===x||void 0===x?void 0:x.length," users"]})]})]})});iE.displayName="AdminUserDirectoryModal";var lE=iE;var nE=e=>{const s=(0,l.useRef)(),a=(0,l.useRef)(),[t,i]=(0,l.useState)(!1),{api:n,userHasRight:r,userIsFullSiteAdmin:o,userIsSiteAdmin:d}=(0,P.nm)(),{formatMessage:c}=(0,ja.A)(),{credentials_sent:h,getOrganizationMembership:u,handleUserUpdated:m,launchEditRoleModal:g,loading:p,organization_id:x,sending_credentials:v,sendUserCredentials:f,user:j,user_id:_}=LE(),{default_email:b,fullname:A}=j||{},y=async()=>{try{i(!0),await n.post("/api/auth/impersonate",{returnTo:window.location.href,user_id:_}),window.location.href="/"}catch({err:err}){i(!1);const s=null===a||void 0===a?void 0:a.current;null===s||void 0===s||s.show({actions:[s.CancelAction()],body:err||"Unable to log in as this user"})}},w=r("manage_user",x);return(0,N.jsxs)(Ge.A,{className:"user-credentials-widget mb-5",children:[(0,N.jsx)(Me.x_,{loading:p,children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"me-4",children:(0,N.jsx)(Ya,{size:90,user:j})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-1",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-3",children:[(0,N.jsx)(Ce.S,{className:"identification",children:(0,N.jsx)("h2",{className:"full-name",children:A})}),(0,N.jsxs)(Ce.S,{className:"cta-container d-flex",style:{height:"min-content"},children:[w&&(0,N.jsxs)(ve.A,{className:"align-self-start d-flex align-items-center",onClick:()=>{const e=null===s||void 0===s?void 0:s.current;e&&e.show({organization_id:x,user_id:_})},size:"sm",children:[(0,N.jsx)(ze.Mbp,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),o()&&(0,N.jsxs)(Me.p0,{className:"align-self-start d-flex align-items-center ms-2",loading:t,onClick:()=>{const e=null===a||void 0===a?void 0:a.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:c({id:"label.log_in_as_user.fd7f1ae4",defaultMessage:"Log in as user"}),onClick:y}
2)],body:c({id:"label.you_will_be_logged_in_as_fullname.2d2e1f4a",defaultMessage:"You will be logged in as {fullname} until you exit. Continue?"},{fullname:A}),title:c({id:"label.log_in_as_this_user.9e7e7679",defaultMessage:"Log in as this user?"})})},size:"sm",variant:"secondary",children:[(0,N.jsx)(ze.Zu,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Log in as this user",id:"label.log_in_as_this_user.049406c7"})]})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(Ce.S,{className:"user-role d-flex flex-column border-end w-50 me-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between pe-3",children:[d()?(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably role",id:"label.solvably_role.99545"})}):(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization role",id:"label.organization_role.01109"})}),w&&(0,N.jsx)(ve.A,{className:"align-self-start d-flex align-items-center p-0",onClick:()=>g(!d()&&x),size:"sm",variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})})]}),(0,N.jsx)("p",{children:(()=>{var e,s,a;return x&&!d()?(null===(e=u(x))||void 0===e||null===(s=e.role)||void 0===s?void 0:s.name)||"Learner":(null===j||void 0===j||null===(a=j.role)||void 0===a?void 0:a.name)||"None"})()})]}),(0,N.jsxs)(Ce.S,{className:"user-email flex-1",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)(Fl,{as:"p",className:"text-muted mb-0",maxWidth:300,placement:"bottom",children:(null===b||void 0===b?void 0:b.email_address)||(0,N.jsx)(ke.A,{defaultMessage:"None",id:"label.none.dc937b59"})})]})]})]})]})}),(0,N.jsx)(BA,{onUpdateSuccess:m,ref:s}),(0,N.jsx)(je,{ref:a})]})};const rE=e=>{const{allowSeeMore:s,className:a,limit:t,pagenated:i}=e,{api:n,userIsSiteAdmin:r}=(0,P.nm)(),{handleAssignmentCardClick:o,handleHide:d,organization_id:c,setActiveTab:h,user_id:u}=((0,Pe.W6)(),LE()),[m,g,p]=(0,ne.CQ)({assignments:[],collapsed:!0,count:0,error:null,loading:!1,page:1,page_size:t}),x=async()=>{try{const{page:e,page_size:s}=m;g({loading:!0});const{assignments:a,count:t}=await n.get(`/api/users/details/active-assignments/${e}/${s}`,{organization_id:r()?null:c,user_id:u});g({assignments:a,count:t,loading:!1})}catch({err:err}){g({error:err,loading:!0})}},v=e=>{var s,a,t;const{assignment:i,total_est_time_mins:l}=e||{},{type:n}=i||{};let r;return"challenge"===n?null===i||void 0===i||null===(s=i.group_assignment_components)||void 0===s||null===(a=s[0])||void 0===a?void 0:a[`${n}_template`]:(r=(null===i||void 0===i?void 0:i.group_assignment_template)||i,null!==(t=r)&&void 0!==t&&t.total_est_time_mins||(r.total_est_time_mins=l),r)};(0,l.useEffect)(()=>(x(),p),[]);const{assignments:f,count:j,error:_,loading:b,page:A,page_size:y}=m;return(0,N.jsxs)(Ce.S,{className:`d-flex flex-column active-assignments-widget ${a||""}`,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:_,variant:"danger",children:_}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Working on",id:"label.working_on.006abaf3"})}),s&&!(null===f||void 0===f||!f.length)&&(0,N.jsx)(ve.A,{disabled:!(null!==f&&void 0!==f&&f.length),onClick:()=>h("development"),variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"See more",id:"label.see_more.bab37d62"})})]}),(0,N.jsxs)(Me.x_,{loading:b,children:[null!==f&&void 0!==f&&f.length?(0,N.jsx)(Qe.A,{className:"completed-assignments assignment-component-card-row justify-content-start mx-0",children:f.map((e,s)=>{var a,t;return(0,N.jsx)(Kh,{component:v(e),modules:null===e||void 0===e||null===(a=e.assignment)||void 0===a?void 0:a.group_assignment_components,onClick:()=>o(e),timestamp:null===e||void 0===e?void 0:e.start,timestamp_label:"Started",type:null===e||void 0===e||null===(t=e.assignment)||void 0===t?void 0:t.type},s)})}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center p-5 rounded assignments-placeholder",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No active assignments",id:"label.no_active_assignments.d0db6fa9"})})}),i&&j>6&&(0,N.jsx)(Lr,{className:"mt-3",count:j,onChange:e=>g({page:e},x),page:A,page_size:y})]})]})};rE.defaultProps={allowSeeMore:!1,limit:1e3,pagenated:!0};var oE=rE;const dE=e=>{const{className:s,limit:a,pagenated:t}=e,{api:i,userIsSiteAdmin:n}=(0,P.nm)(),{handleAssignmentCardClick:r,handleHide:o,organization_id:d,user_id:c}=((0,Pe.W6)(),LE()),[h,u,m]=(0,ne.CQ)({assignments:[],collapsed:!0,count:0,error:null,loading:!1,page:1,page_size:a}),g=async()=>{try{const{page:e,page_size:s}=h;u({loading:!0});const{assignments:a,count:t}=await i.get(`/api/users/details/completed-assignments/${e}/${s}`,{organization_id:n()?null:d,user_id:c});u({assignments:a,count:t,loading:!1})}catch({err:err}){u({error:err,loading:!0})}}
2,p=e=>{var s,a;const{type:t}=e;switch(t){case"challenge":case"cartridge":return null===e||void 0===e||null===(s=e.group_assignment_components)||void 0===s||null===(a=s[0])||void 0===a?void 0:a[`${t}_template`];case"journey":return e}};(0,l.useEffect)(()=>(g(),m),[]);const{assignments:x,count:v,error:f,loading:j,page:_,page_size:b}=h;return(0,N.jsxs)(Ce.S,{className:`d-flex flex-column active-assignments-widget ${s||""}`,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>u({error:null}),show:f,variant:"danger",children:f}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between mb-2",children:(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})})}),(0,N.jsxs)(Me.x_,{loading:j,children:[null!==x&&void 0!==x&&x.length?(0,N.jsx)(Qe.A,{className:"active-assignments assignment-component-card-row justify-content-start mx-0",children:x.map((e,s)=>{var a,t;return(0,N.jsx)(Kh,{component:p(null===e||void 0===e?void 0:e.assignment),modules:null===e||void 0===e||null===(a=e.assignment)||void 0===a?void 0:a.group_assignment_components,onClick:()=>r(e),timestamp:null===e||void 0===e?void 0:e.completed,timestamp_label:(0,N.jsx)(ze.A7C,{className:"me-1",color:"var(--success)"}),type:null===e||void 0===e||null===(t=e.assignment)||void 0===t?void 0:t.type},s)})}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center p-5 rounded assignments-placeholder",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No completed assignments",id:"label.no_completed_assignments.aa120cd1"})})}),t&&v>6&&(0,N.jsx)(Lr,{className:"mt-3",count:v,onChange:e=>u({page:e},g),page:_,page_size:b})]})]})};dE.defaultProps={limit:1e3,pagenated:!0};var cE=dE;const hE=(0,l.forwardRef)((e,s)=>{const{onHide:a,onUpdate:t}=e,{api:i}=(0,P.nm)(),{formatMessage:n}=(0,ja.A)(),{user_id:r}=LE(),{fetchGroupMemberships:o,setSuccess:d}=NE(),[c,h,u]=(0,ne.CQ)({error:null,loading:!1,organization_id:null,selected_groups:[],show:!1,step:0}),m=e=>{h({organization_id:(null===e||void 0===e?void 0:e.default_organization_id)||null,show:!0,step:null!==e&&void 0!==e&&e.default_organization_id?1:0})},g=()=>{u(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m})),(0,l.useEffect)(()=>u,[]);const p=(null===pE||void 0===pE?void 0:pE[null===c||void 0===c?void 0:c.step])||l.Fragment,{error:x,loading:v,organization_id:f,selected_groups:j}=c;return(0,N.jsx)(vE,{value:{clearError:()=>h({error:null}),default_organization_id:f,error:x,handleAddMemberships:async()=>{try{const{selected_groups:e}=c;h({loading:!0}),await i.post("/api/groups/memberships/user/add-multiple",{group_ids:e,organization_id:f,user_id:r}),h({loading:!1}),g(),"function"===typeof t&&t(),d(n({id:"label.group_memberships_created_successf.6214f84b",defaultMessage:"Group memberships created successfully"})),o()}catch({err:err}){h({error:err,loading:!1})}},handleHide:g,loading:v,organization_id:f,selected_groups:j,setOrganizationId:e=>h({organization_id:e}),setSelectedGroups:e=>h({selected_groups:e}),setStep:e=>h({step:e})},children:(0,N.jsx)(xe,{onHide:g,show:c.show,children:(0,N.jsx)(p,{})})})});hE.displayName="AddGroupMembershipsModal";var uE=hE;const mE=e=>{const{clearError:s,error:a,handleHide:t,organization_id:i,setOrganizationId:n,setStep:r}=fE(),{user_id:o}=LE(),{organization_ids:d}=NE(),c=(0,l.useRef)();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select organization",id:"label.select_organization.99e5009d"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:s,show:a,variant:"danger",children:a}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select the organization with the group(s) you'd like to add this user to",id:"label.select_the_organization_with_the_g.54169ee4"})}),null!==d&&void 0!==d&&d.length?(0,N.jsx)(Dc,{allowGlobal:!1,allowMultiSelect:!1,exploded:!0,onSelectionChange:e=>n(e),organization_id:i,organization_ids:d,ref:c,searchable:!1,selectorType:"radio",showRole:!0,submitOnSelect:!1,user_id:o}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center text-muted p-5",children:(0,N.jsx)(ke.A,{defaultMessage:"User does not belong to any organizations",id:"label.user_does_not_belong_to_any_organi.e2353e85"})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:t,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!i,onClick:()=>r(1),size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})]})]})};const gE=e=>{const{userId:s,userIsOrgAdmin:a,userIsSiteAdmin:t}=(0,P.nm)(),{existing_membership_ids:i,organization_memberships:n}=NE(),{clearError:r,default_organization_id:o,error:d,handleAddMemberships:c,handleHide:h,loading:u,organization_id:m,selected_groups:g,setOrganizationId:p,setSelectedGroups:x,setStep:v}=fE(),f=(0,l.useRef)();return(0,l.useEffect)(()=>{(async()=>{const e=null===f||void 0===f?void 0:f.current;e&&await e.refresh()})()},[]),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add to groups",id:"label.add_to_groups.9808ae11"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:r,show:d,variant:"danger",children:d}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add this user to one or more groups",id:"label.add_this_user_to_one_or_more_group.04f5d042"})}),(0,N.jsx)($c,{allowMultiSelect:!0,excludedIds:i,exploded:!0,include_sub_orgs:t()||a(),onSelectionChange:x,organization_id:m,organization_memberships:n,ref:f,scopeToUser:t()||a()?null:s,searchable:!1,selectorType:"checkbox",submitOnSelect:!1})]}
2),(0,N.jsxs)(xe.Footer,{className:"d-flex",children:[!o&&(0,N.jsx)(ve.A,{onClick:()=>v(0),size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-self-end",children:[!!o&&(0,N.jsx)(ve.A,{className:"me-2",onClick:h,size:"lg",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disabled:u||!(null!==g&&void 0!==g&&g.length),loading:u,onClick:c,size:"lg",children:(0,N.jsx)(hc.A,{value:null===g||void 0===g?void 0:g.length,one:(0,N.jsx)(ke.A,{defaultMessage:"Add to 1 group",id:"label.add_to_1_group.4729f8ad"}),other:(0,N.jsx)(ke.A,{defaultMessage:"Add to {count} groups",id:"label.add_to_count_groups.68b2921e",values:{count:(null===g||void 0===g?void 0:g.length)||0}})})})]})]})]})};var pE=[mE,gE];const xE=l.createContext({}),vE=xE.Provider,fE=(xE.Consumer,()=>(0,l.useContext)(xE)),jE=(0,l.forwardRef)((e,s)=>{const{onUpdate:a,organization_id:t}=e,{api:i,userIsOrgAdmin:n,userIsSiteAdmin:r}=(0,P.nm)(),{user:o,user_id:d}=LE(),{formatMessage:c}=(0,ja.A)(),h=(0,l.useRef)(),u=(0,l.useRef)(),m=(0,l.useRef)(),g=(0,l.useRef)(),[p,x,v]=(0,ne.CQ)({error:null,existing_membership_ids:[],group_memberships:[],loading:!1,organization_ids:[],organization_memberships:[],sort_direction:"ASC",sort_token:"name",success:null}),f=e=>x({success:e}),j=async()=>{try{const{sort_direction:e,sort_token:s}=p,a=r()||n()?1:0,{group_memberships:l}=await i.get("/api/organizations/group-memberships/list/1/1000",{include_sub_orgs:a,organization_id:t,sort_direction:e,sort_token:s,user_id:d}),o=l.map(e=>null===e||void 0===e?void 0:e.group_id);x({existing_membership_ids:o,group_memberships:l})}catch({err:err}){x({error:err})}},_=async()=>{x({loading:!0}),await j(),x({loading:!1})},b=async()=>{try{var e;const s=r()||n()?1:0,{organization_memberships:a}=await i.get("/api/organizations/memberships/list/1/1000",{include_sub_orgs:s,organization_id:t,user_id:d}),l=((null===a||void 0===a||null===(e=a.filter)||void 0===e?void 0:e.call(a,e=>2!==(null===e||void 0===e?void 0:e.role_id)))||[]).map(e=>null===e||void 0===e?void 0:e.organization_id);x({organization_ids:l,organization_memberships:a})}catch({err:err}){x({error:err})}},A=()=>{x({loading:!0}),Promise.all([b(),j()]).finally(()=>{x({loading:!1})})};(0,l.useImperativeHandle)(s,()=>({refreshMemberships:A})),(0,l.useEffect)(()=>{A()},[]);const{error:y,existing_membership_ids:w,group_memberships:S,loading:C,organization_ids:M,organization_memberships:k,sort_direction:z,sort_token:T,submitting:I,success:E}=p;return(0,N.jsxs)(wE,{value:{existing_membership_ids:w,fetchGroupMemberships:j,group_memberships:S,handleLaunchGroupsPicker:async()=>{const e=await(async()=>{var e,s;const a=null===g||void 0===g?void 0:g.current;if(!a)return;const t=(null===p||void 0===p||null===(e=p.organization_memberships)||void 0===e||null===(s=e.map)||void 0===s?void 0:s.call(e,e=>null===e||void 0===e?void 0:e.organization_id))||[];return await a.show({organization_ids:t})})();if(!e)return;const s=await(async e=>{const s=null===m||void 0===m?void 0:m.current;if(s)return await s.show({organization_id:e})})(e);null!==s&&void 0!==s&&s.length},handleRemoveMembership:async e=>{var s;const t=null===u||void 0===u?void 0:u.current;t&&await t.show({actions:[t.CancelAction(),t.Action({label:c({id:"label.remove_membership.253027fa",defaultMessage:"Remove membership"}),onClick:async()=>await(async e=>{try{const{id:s,group:t}=e||{};await i.post("/api/groups/members/delete",{group_id:null===t||void 0===t?void 0:t.id,group_member_id:s}),"function"===typeof a&&await a(),f(c({id:"label.user_successfully_removed_from_nam.a31778a1",defaultMessage:"User successfully removed from {name}"},{name:(0,N.jsx)("strong",{children:null===t||void 0===t?void 0:t.name})})),await _()}catch({err:err}){x({error:err})}})(e),variant:"danger"})],body:c({id:"label.are_you_sure_you_want_to_remove_na.a1136cd9",defaultMessage:"Are you sure you want to remove {name} from {group_name}?"},{group_name:(0,N.jsx)("strong",{children:null===e||void 0===e||null===(s=e.group)||void 0===s?void 0:s.name}),name:(0,N.jsx)("strong",{children:(null===o||void 0===o?void 0:o.fullname)||""})}),title:c({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},handleSort:(e,s)=>{const a=e!==p.sort_token?"ASC":s;x({sort_direction:a,sort_token:e},_)},loading:C,organization_ids:M,organization_memberships:k,setSuccess:f,sort_direction:z,sort_token:T,submitting:I},children:[(0,N.jsxs)(Ce.S,{className:"group-memberships-widget d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>x({error:null}),show:y,variant:"danger",children:y}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>x({success:null}),show:E,variant:"success",children:E}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"})}),(0,N.jsxs)(ph,{condition:!(null!==M&&void 0!==M&&M.length),disabled:!(null!==M&&void 0!==M&&M.length),onClick:()=>{const e=null===h||void 0===h?void 0:h.current;if(!e)return;const s=n()||r(),{organization_ids:a}=p;let i;i=s?1===(null===a||void 0===a?void 0:a.length)?a[0]:null:t,e.show({default_organization_id:i})},variant:"link",tooltipContent:(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"User does not belong to any organizations",id:"label.user_does_not_belong_to_any_organi.e2353e85"})}),children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Add groups",id:"label.add_groups.ef2674e4"})]})]}),(0,N.jsx)(bE,{})]}),(0,N.jsx)(je,{ref:u}),(0,N.jsx)(uE,{onUpdate:a,ref:h})]})});jE.displayName="GroupMembershipsWidget";var _E=jE;var bE=e=>{const{userHasRight:s}=(0,P.nm)(),{organization_id:a}=LE(),{group_memberships:t,handleSort:i,loading:l,sort_direction:n,sort_token:r}=NE(),o=s("manage_group_user",a);return(0,N.jsxs)(ho,{defaultSortDirection:n,defaultSortToken:r,onSort:i,striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"role",children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"organization",children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})}),o&&(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:o?4:3,loading:l,children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>(0,N.jsx)(AE,{membership:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:o?4:3,children:(0,N.jsx)(ke.A,{defaultMessage:"No group memberships found",id:"label.no_group_memberships_found.66cb4203"})})})})]})};var AE=e=>{const{membership:s}=e,{group:a,organization_member:t}=s,{organization:i,role:n}=t,[r,o]=(0,l.useState)(!1),{getUserOrganizationMembership:d,userHasRight:c,userId:h,userIsAdmin:u,userIsSiteAdmin:m}=(0,P.nm)(),{organization_id:g}=LE(),{handleRemoveMembership:p,submitting:x}=NE(),v=!(null===s||void 0===s||!s.archived_at);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{className:"font-weight-bold",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(_d,{group:null===s||void 0===s?void 0:s.group,showTooltip:!0,size:32}),(0,N.jsx)(Ce.S,{className:"ms-2 d-flex flex-column",children:(0,N.jsx)(Le.Link,{className:"font-weight-bold text-dark",to:`/admin/group/${null===a||void 0===a?void 0:a.id}`,children:null===a||void 0===a?void 0:a.name})}),v&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bo.A,{bg:"secondary",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})})})]})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:(null===n||void 0===n?void 0:n.name)||"Learner"}),(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{className:"font-weight-bold text-dark",to:`/admin/organization/${null===i||void 0===i?void 0:i.id}`,children:null===i||void 0===i?void 0:i.name})}),c("manage_group_user",g)&&(0,N.jsx)(ro,{children:(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(Me.p0,{disabled:r||x||!(()=>{const{organization_member:e}=s||{};if(!c("manage_group_user",g)||!u()||!m()&&(null===e||void 0===e?void 0:e.user_id)===h)return!1;if(null!==e&&void 0!==e&&e.role_id){const s=d(),{role_id:a}=s||{};switch(a){case 3:return 3!==e.role_id;case 7:return!1}}return!(!m()&&(null===s||void 0===s?void 0:s.active_assignment_count)>0)})(),loading:r,onClick:async()=>{o(!0),await p(s),o(!1)},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})})})]})};const yE=l.createContext({}),wE=yE.Provider,NE=(yE.Consumer,()=>(0,l.useContext)(yE)),SE=(0,l.forwardRef)((s,a)=>{const{onUpdate:t}=s,{api:i,userIsOrgAdmin:n,userIsSiteAdmin:r}=(0,P.nm)(),{organization_id:o,user:d,user_id:c}=LE(),{formatMessage:h}=(0,ja.A)(),u=(0,l.useRef)(),m=(0,l.useRef)(),[g,p,x]=(0,ne.CQ)({error:null,existing_membership_ids:[],loading:!1,organization_memberships:[],sort_direction:"ASC",sort_token:"name",success:null}),v=async()=>{try{const{sort_direction:e,sort_token:s}=g;p({loading:!0});const a=r()||n()?1:0,{organization_memberships:t}=await i.get("/api/organizations/memberships/list/1/1000",{include_sub_orgs:a,organization_id:o,sort_direction:e,sort_token:s,user_id:c}),l=t.map(e=>null===e||void 0===e?void 0:e.organization_id);p({existing_membership_ids:l,loading:!1,organization_memberships:t})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;p({error:a,loading:!1})}},f=async e=>{try{await i.post(`/api/organizations/member/delete/${c}`,{organization_id:e}),"function"===typeof t&&await t(),(e=>{p({success:e})})(h({id:"label.organization_membership_removed_su.04c016d1",defaultMessage:"Organization membership removed successfully"})),await v()}catch({err:err}){p({error:err})}},j=()=>{const e=null===u||void 0===u?void 0:u.current;e&&e.show()};(0,l.useEffect)(()=>{v()},[]),(0,l.useImperativeHandle)(a,()=>({refreshMemberships:v}));const{error:_,existing_membership_ids:b,loading:A,organization_memberships:y,sort_direction:w,sort_token:S,success:C}=g;return(0,N.jsxs)(EE,{value:{existing_membership_ids:b,fetchOrganizationMemberships:v,handleAddMembership:async e=>{try{await i.post("/api/organizations/member/add",{organization_id:e,user_id:c}),p({success:"Organization membership added successfully"}),await v()}catch({err:err}){p({error:err})}},handleRemoveOrgMembership:async e=>{const s=null===m||void 0===m?void 0:m.current;s&&await s.show({actions:[s.CancelAction(),s.Action({label:h({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:async()=>await f(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to remove <strong>{name}</strong> from <strong>{org_name}</strong>?",id:"label.are_you_sure_you_want_to_remove_na.69730b2d",values:{name:null===d||void 0===d?void 0:d.fullname,org_name:null===e||void 0===e?void 0:e.name,strong:e=>(0,N.jsx)("strong",{children:e})}})}),size:"normal",title:h({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},handleSort:(e,s)=>{const a=e!==g.sort_token?"ASC":s;p({sort_direction:a,sort_token:e},v)},launchAddMembershipModal:j,loading:A,organization_memberships:y,sort_direction:w,sort_token:S},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>p({error:null}),show:_,variant:"danger",children:_}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>p({success:null}),show:C,variant:"success",children:C}),(0,N.jsxs)(Ce.S,{className:"organization-memberships-widget d-flex flex-column mb-5",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-3 center",children:[(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Organizations",id:"label.organizations.2730183d"})}),(0,N.jsxs)(ve.A,{className:"p-0 d-flex align-items-center",onClick:j,variant:"link",children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Add organization",id:"label.add_organization.0ca876da"})]})]}),(0,N.jsx)(ME,{})]}),(0,N.jsx)(je,{ref:m}),(0,N.jsx)(TE,{onUpdate:t,ref:u})]})});SE.displayName="OrganizationMembershipsWidget";var CE=SE;var ME=e=>{const{handleSort:s,loading:a,organization_memberships:t,sort_direction:i,sort_token:l}=FE();return(0,N.jsxs)(ho,{defaultSortDirection:i,defaultSortToken:l,onSort:s,striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"role",children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:a,children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>(0,N.jsx)(kE,{membership:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:4,children:(0,N.jsx)(ke.A,{defaultMessage:"No organization memberships found",id:"label.no_organization_memberships_found.b9fbd6e6"})})})})]})};var kE=e=>{var s;const{membership:a}=e,{group_memberships:t,organization:i,role:l}=a,{launchEditRoleModal:n}=LE(),{fetchOrganizationMemberships:r,handleRemoveOrgMembership:o}=FE(),d=(null===t||void 0===t||null===(s=t.map)||void 0===s?void 0:s.call(t,e=>e.group))||[],c=!(null===a||void 0===a||!a.archived_at);return(0,N.jsxs)(io,{children:[(0,N.jsxs)(ro,{children:[(0,N.jsx)(Le.Link,{className:"font-weight-bold text-dark",to:`/admin/organization/${null===i||void 0===i?void 0:i.id}`,children:null===i||void 0===i?void 0:i.name}),c&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bo.A,{bg:"secondary",className:"ms-2",style:{verticalAlign:"middle"},children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})})})]}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:(null===l||void 0===l?void 0:l.name)||"Learner"}),(0,N.jsx)(ro,{children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(pd,{list:d,maxIcons:4,offset:-4,showTooltip:!0,size:32,type:"group"}):(0,N.jsx)("span",{className:"text-muted small",children:2===(null===a||void 0===a?void 0:a.role_id)?(0,N.jsx)(ke.A,{defaultMessage:"N/A",id:"label.na.e2f79e5b"}):(0,N.jsx)(ke.A,{defaultMessage:"None",id:"label.none.dc937b59"})})}),(0,N.jsx)(ro,{children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{onClick:()=>n(null===i||void 0===i?void 0:i.id,r),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit role",id:"label.edit_role.70542"})}),(0,N.jsx)(ve.A,{onClick:async()=>await o(i),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})]})})]})};const zE=(0,l.forwardRef)((e,s)=>{const{onHide:a,onUpdate:t}=e,i=(0,l.useRef)(),{organization_id:n}=LE(),{existing_membership_ids:r,handleAddMembership:o}=FE(),[d,c,h]=(0,ne.CQ)({error:null,has_selection:!1,loading:!1,show:!1}),u=e=>{c({show:!0}),(()=>{const e=null===i||void 0===i?void 0:i.current;e&&e.refresh()})()},m=()=>{h(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:m,show:u})),(0,l.useEffect)(()=>h,[]);const{error:g,has_selection:p,loading:x,show:v}=d;return(0,N.jsxs)(xe,{contentClassName:"p-0",onHide:m,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add to organization",id:"label.add_to_organization.0e0cb636"})})}),(0,N.jsxs)(xe.Body,{className:"p-1",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:g,variant:"danger",children:g}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column px-3 pb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Add this user to an organization",id:"label.add_this_user_to_an_organization.30b50a8c"})}),(0,N.jsx)(Dc,{allowGlobal:!1,allowMultiSelect:!1,disableTopParent:!0,excludedIds:r,exploded:!1,maxHeight:600,onSelectionChange:e=>c({has_selection:!!e}),organization_id:n,ref:i,searchable:!0,selectorType:"radio",submitOnSelect:!1})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:m
2,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disabled:x||!p,loading:x,onClick:async()=>{const e=(()=>{const e=null===i||void 0===i?void 0:i.current;if(e)return e.getSelection()||null})();c({loading:!0}),await o(e),c({loading:!1}),"function"===typeof t&&t(),m()},children:(0,N.jsx)(ke.A,{defaultMessage:"Add",id:"label.add.9fd728c6"})})]})]})});zE.displayName="AddOrgMembershipModal";var TE=zE;const IE=l.createContext({}),EE=IE.Provider,FE=(IE.Consumer,()=>(0,l.useContext)(IE)),RE=(0,l.forwardRef)((e,s)=>{const{onHide:a,onUserUpdated:t,organization_id:i}=e,n=(0,l.useRef)(),r=(0,l.useRef)(),o=(0,l.useRef)(),{api:d}=(0,P.nm)(),{formatMessage:c}=(0,ja.A)(),[h,u,m]=(0,ne.CQ)({active_key:"overview",credentials_sent:!1,error:null,loading:!1,sending_credentials:!1,show:!1,success:null,user:null,user_id:null}),g=()=>u({error:null}),p=e=>u({success:e}),x=()=>u({success:null}),v=async e=>{u({show:!0,user_id:null===e||void 0===e?void 0:e.user_id}),await j()},f=()=>{m(),"function"===typeof a&&a()},j=async()=>{try{u({loading:!0});const{user_id:e}=h,{user:s}=await d.get("/api/users/profile/basics/get-by-id",{user_id:e});u({loading:!1,user:s})}catch({err:err}){u({error:err,loading:!1})}},_=e=>{e&&p(e),"function"===typeof t&&t(),j()},b=e=>{var s,a,t;return null===h||void 0===h||null===(s=h.user)||void 0===s||null===(a=s.organization_memberships)||void 0===a||null===(t=a.find)||void 0===t?void 0:t.call(a,s=>s.organization_id===e)},A=()=>{_(c({id:"label.role_updated_successfully.ecdb7886",defaultMessage:"Role updated successfully"}))},y=(e,s)=>{const a=null===n||void 0===n?void 0:n.current;a&&a.show({group_member_assignment_component_id:s,group_member_assignment_id:e})};(0,l.useImperativeHandle)(s,()=>({hide:f,show:v})),(0,l.useEffect)(()=>m,[]);const{credentials_sent:w,error:S,loading:C,sending_credentials:M,success:k,user:z,user_id:T}=h;return(0,N.jsxs)(PE,{value:{clearError:g,clearSuccess:x,credentials_sent:w,fetchUser:j,getOrganizationMembership:b,handleAssignmentCardClick:e=>{var s;const{id:a,assignment:t,group_member_assignment_components:i}=e,{type:l}=t||{},n=null===i||void 0===i||null===(s=i[0])||void 0===s?void 0:s.id;switch(l){case"challenge":case"cartridge":return y(a,n);case"journey":return y(a);default:return}},handleHide:f,handleUserUpdated:_,launchEditRoleModal:(e,s)=>{const a=null===r||void 0===r?void 0:r.current;if(!a)return;const t=()=>{"function"===typeof s&&s(),A()},i=e?{context:"organization",onSuccess:t,organization_member:b(e)}:{context:"site",onSuccess:t,user:z};a.show(i)},loading:C,onUserUpdated:t,organization_id:i,sending_credentials:M,sendUserCredentials:async()=>{try{const{credentials_sent:e,user:s}=h;if(e)return;const{default_email:a,name:t}=s,{email_address:i}=a;u({sending_credentials:!0}),await d.post("/api/users/send/credentials",{email:i,name:t}),u({credentials_sent:!0,sending_credentials:!1})}catch({err:err}){u({error:err,sending_credentials:!1})}}
2,setActiveTab:e=>{const s=o.current;s&&s.setActiveTab(e)},setSuccess:p,user:z,user_id:T},children:[(0,N.jsxs)(xe,{id:"userDetailsModal",onHide:f,show:h.show,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0}),(0,N.jsxs)(xe.Body,{className:"px-5",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:g,show:S,variant:"danger",children:S}),(0,N.jsx)(We.A,{dismissible:!0,onClose:x,show:k,variant:"success",children:k}),(0,N.jsx)(nE,{}),(0,N.jsx)(YE,{ref:o})]})]}),(0,N.jsx)(XE,{hideOnSuccess:!0,ref:r}),(0,N.jsx)(r_,{is_admin:!0,onHide:f,ref:n})]})});RE.displayName="UserDetailsModal";var DE=RE;const BE=l.createContext({}),PE=BE.Provider,LE=(BE.Consumer,()=>(0,l.useContext)(BE));var OE=e=>(0,N.jsxs)(Ce.S,{className:"user-details-development d-flex flex-column",children:[(0,N.jsx)(oE,{className:"mb-5",limit:6}),(0,N.jsx)(cE,{limit:6})]});var HE=e=>{const{handleUserUpdated:s,organization_id:a}=LE(),t=(0,l.useRef)(),i=(0,l.useRef)();return(0,N.jsxs)(Ce.S,{className:"user-details-memberships d-flex flex-column",children:[(0,N.jsx)(CE,{onUpdate:()=>{const e=null===i||void 0===i?void 0:i.current;e&&(e.refreshMemberships(),s())},ref:t}),(0,N.jsx)(_E,{onUpdate:()=>{const e=null===t||void 0===t?void 0:t.current;e&&e.refreshMemberships()},organization_id:a,ref:i})]})};var UE=e=>(0,N.jsxs)(Ce.S,{className:"user-details-overview",children:[(0,N.jsx)(GE,{}),(0,N.jsx)(oE,{allowSeeMore:!0,limit:3,pagenated:!1})]});var QE=t.p+"static/media/completed-assignments.672d99540424a43cd8560b1afb76b8ff.svg";var VE=t.p+"static/media/collaborators.2084360080feb217e5c9e9e651ac0d4e.svg";var GE=e=>{const{api:s,userIsSiteAdmin:a}=(0,P.nm)(),{formatMessage:t}=(0,ja.A)(),{organization_id:i,user_id:n}=LE(),[r,o,d]=(0,ne.CQ)({collaborators:0,completed_assignments:0,error:null,loading:!1,total_time:0});(0,l.useEffect)(()=>((async()=>{try{o({loading:!0});const{collaborators:e,completed_assignments:t,total_time:l}=await s.get("/api/users/details/stats",{organization_id:a()?null:i,user_id:n});o({collaborators:e,completed_assignments:t,loading:!1,total_time:l})}catch({err:err}){o({error:err,loading:!1})}})(),d),[]);const{collaborators:c,completed_assignments:h,error:u,loading:m,total_time:g}=r,p=g/1e3/60||0;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:u,variant:"danger",children:u}),(0,N.jsxs)(Qe.A,{className:"overview-stats mb-5",children:[(0,N.jsx)(WE,{icon:DT,loading:m,value:(0,N.jsx)(Vh,{duration:p,label_type:"short"}),label:t({id:"label.time_active.ca539a3b",defaultMessage:"time active"})}),(0,N.jsx)(WE,{icon:QE,loading:m,value:h,label:t({id:"label.completed_modules.b642b583",defaultMessage:"completed modules"})}),(0,N.jsx)(WE,{icon:VE,loading:m,value:c,label:t({id:"label.collaborators.0e7166bc",defaultMessage:"collaborators"})})]})]})};var WE=e=>{const{icon:s,label:a,loading:t,value:i}=e;return(0,N.jsx)(Ve.A,{className:"overview-stat-widget mb-3 mb-lg-0",lg:4,xs:12,children:(0,N.jsx)(Ge.A,{children:(0,N.jsx)(Me.x_,{loading:t,spinnerContainerClassName:"p-3",children:(0,N.jsxs)(Ge.A.Body,{body:!0,className:"d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{className:"stat-widget-icon me-3",children:(0,N.jsx)(Zs.A,{fluid:!0,alt:"",src:s})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column flex-1",children:[(0,N.jsx)("h2",{className:"stat-widget-value",children:i}),(0,N.jsx)("span",{className:"stat-widget-label small text-muted",children:a})]})]})})})})};var KE=e=>{const{getUserOrganizationId:s}=(0,P.nm)();return(0,N.jsx)(Ce.S,{className:"user-details-groups d-flex flex-column",children:(0,N.jsx)(_E,{organization_id:s()})})};var YE=(0,l.forwardRef)((e,s)=>{const{userIsAdmin:a,userIsFacilitator:t,userIsModerator:i}=(0,P.nm)(),[n,r]=(0,ne.CQ)({active_key:"overview"}),{active_key:o}=n,d=e=>r({active_key:e});return(0,l.useImperativeHandle)(s,()=>({active_key:o,setActiveTab:d})),(0,N.jsxs)(ld.A.Container,{activeKey:o,defaultActiveKey:"overview",id:"admin-tabs",mountOnEnter:!0,onSelect:d,unmountOnExit:!0,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary mw-100 mx-0",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center",eventKe
2y:"overview",children:[(0,N.jsx)(ze.x7F,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center",eventKey:"development",children:[(0,N.jsx)(ze.hko,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Development",id:"label.development.21b6a798"})]})}),!a()||t()||i()?(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center",eventKey:"groups",children:[(0,N.jsx)(ze.M5n,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"})]})}):(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center",eventKey:"memberships",children:[(0,N.jsx)(ze.ph9,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Memberships",id:"label.memberships.b50f1a42"})]})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"overview",children:(0,N.jsx)(qE.Overview,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"development",children:(0,N.jsx)(qE.Development,{})}),!a()||t()||i()?(0,N.jsx)(ld.A.Pane,{eventKey:"groups",children:(0,N.jsx)(qE.Groups,{})}):(0,N.jsx)(ld.A.Pane,{eventKey:"memberships",children:(0,N.jsx)(qE.Memberships,{})})]})]})}),qE={Development:OE,Groups:KE,Memberships:HE,Overview:UE};const JE=(0,l.forwardRef)((e,s)=>{const{hideOnSuccess:a,onHide:t}=e,{api:i,locale:n}=(0,P.nm)(),{formatMessage:r}=(0,ja.A)(),[o,d,c]=(0,ne.CQ)({context:null,error:null,loading:!1,onSuccess:null,organization_member:null,show:!1,success:null,user:null}),h=()=>d({error:null}),u=()=>d({success:null}),m=e=>{d({context:null===e||void 0===e?void 0:e.context,onSuccess:e.onSuccess,organization_member:null===e||void 0===e?void 0:e.organization_member,show:!0,user:null===e||void 0===e?void 0:e.user})},g=()=>{c(),"function"===typeof t&&t()},p=async e=>{try{const{onSuccess:s,user:t}=o;if(d({loading:!0}),await i.post("/api/site/user/role",{role:e,user_id:null===t||void 0===t?void 0:t.id}),"function"===typeof s&&s(),a)return g();d({loading:!1,success:r({id:"label.organization_member_role_updated_s.adb4d5bc",defaultMessage:"Organization member role updated successfully."})})}catch({err:err}){d({error:err,loading:!1})}},x=async e=>{try{const{onSuccess:s,organization_member:t}=o;if(d({loading:!0}),await i.post("/api/organizations/member/role",{organization_id:null===t||void 0===t?void 0:t.organization_id,organization_member_id:null===t||void 0===t?void 0:t.id,role:e}),"function"===typeof s&&s(),a)return g();d({loading:!1,success:r({id:"label.user_role_updated_successfully.0f836f90",defaultMessage:"User role updated successfully."})})}catch({err:err}){d({error:err,loading:!1})}};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m})),(0,l.useEffect)(()=>c,[]);const{context:v,error:f,loading:j,success:_}=o,b=(()=>{var e,s,a,t;const{context:i}=o;switch(i){case"site":return(null===o||void 0===o||null===(e=o.user)||void 0===e||null===(s=e.role)||void 0===s?void 0:s.slug)||"";case"organization":return(null===o||void 0===o||null===(a=o.organization_member)||void 0===a||null===(t=a.role)||void 0===t?void 0:t.slug)||"";default:return null}})(),A=(()=>{const{context:e}=o;switch(e){case"site":return[{name:r({id:"label.site_admin.b230e617",defaultMessage:"Site admin"}),value:"site_admin"},{name:r({id:"label.arbitrator.293d421f",defaultMessage:"Arbitrator"}),value:"arbitrator"},{name:r({id:"label.none.dc937b59",defaultMessage:"None"}),value:""}];case"organization":return[{name:r({id:"label.organization_admin.276bbcae",defaultMessage:"Organization admin"}),value:"organization_admin"},{name:r({id:"label.facilitator.49c5d7ad",defaultMessage:"Facilitator"}),value:"facilitator"},{name:r({id:"label.moderator.6748ec8b",defaultMessage:"Moderator"}),value:"moderator"},{name:r({id:"label.arbitrator.293d421f",defaultMessage:"Arbitrator"}),value:"organization_arbitrator"},{name:r({id:"label.learner.0815286c",defaultMessage:"Learner"}),value:""}];default:return[]}})();return(0,N.jsxs)(xe,{onHide:g,show:o.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Edit role",id:"label.edit_role.70542"})})}),(0,N.jsx)(ds.l1,{initialValues:{role:b},onSubmit:async e=>{const{context:s}=o,a=null===e||void 0===e?void 0:e.role;switch(s){case"site":return await p(a);case"organization":return await x(a)}},validationSchema:(0,Re.by)({locale:n,scope:("site"===v?"user":"organization_member")+".edit_role"}),children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:h,show:f,variant:"danger",children:f}),(0,N.jsx)(We.A,{dismissible:!0,onClose:u,show:_,variant:"success",children:_}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsx)(_e.A.Select,{disabled:j,isInvalid:i.role&&s.role,isValid:i.role&&!s.role,name:"role",onChange:a,readOnly:j,value:l.role,children:!(null===A||void 0===A||!A.length)&&A.map((e,s)=>{let{name:a,value:t}=e;return(0,N.jsx)("option",{value:t,children:a},s)})}),(0,N.jsx)(ds.Kw,{name:"role",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:j,onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(Me.p0,{loading:j,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});JE.displayName="EditRoleModal";var XE=JE;const ZE=l.createContext({}),$E=ZE.Provider,eF=ZE.Consumer,sF=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(eF,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin_group:s,ref:e=>{this.comp=e}}))})}}return s},aF=()=>(0,l.useContext)(ZE);class tF extends l.Component{constructor(s){super(s),this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.refreshUsers=async()=>{try{var s,a,t;const e=null===(s=this.sub_org_switch)||void 0===s?void 0:s.current,i=null===(a=this.role_filter)||void 0===a?void 0:a.current,l=null===(t=this.archive_filter)||void 0===t?void 0:t.current;if(!e||!i||!l)return;const{selected:n}=e,{selected:r}=l,{selection:o}=i,{admin_organization:d,app:c}=this.props,{organization:h,setUserBadgeCount:u}=d,m=(null===h||void 0===h?void 0:h.id)||"",{api:g}=c,{page:p,page_size:x,search_term:v,sort_direction:f,sort_token:j}=this.state;this.setState({error:null,loading:!0,members:null});const{count:_,members:b}=await g.get(`/api/organizations/members/list/${p}/${x}`,{filter_archived:r,include_sub_orgs:n,organization_id:m,role:o,search_term:v,sort_direction:f,sort_token:j});this.setState({count:_,loading:!1,members:b}),u(_)}catch(e){const{err:a,message:t}=e||{};this.setState({error:a||t,loading:!1})}},this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},this.refreshUsers)},1e3)},this.deleteUser=e=>{const{admin_organization:s,app:a,intl:t}=this.props,{refreshOrganization:i}=s||{},l=a.api,{formatMessage:n}=t,r=s.organization?s.organization.id:"";this.setState({error:null,loading:!0}),l.post(`/api/organizations/member/delete/${e}`,{organization_id:r}).then(()=>{this.setState({loading:!1,success:n({id:"label.user_removed_successfully.d552e1d1",defaultMessage:"User removed successfully."})}),(0,T.isFunction)(i)&&i(),this.refreshUsers()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.toggleUserStatus=e=>{const{admin_organization:s,app:a,intl:t}=this.props,i=a.api,{formatMessage:l}=t,{organization:n}=s;this.setState({error:null,loading:!0}),i.post(`/api/organizations/member/archive/${e}`,{organization_id:null===n||void 0===n?void 0:n.id}).then(()=>{this.setState({loading:!1,success:l({id:"label.user_updated_successfully.c54ffa5d",defaultMessage:"User updated successfully."})}),this.refreshUsers()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.handleShowUserCreationModal=()=>{this.user_creation_modal&&this.user_creation_modal.show()},this.handleShowUserImportModal=()=>{this.user_import_modal&&this.user_import_modal.show()},this.handleShowUserDirectoryModal=()=>{this.user_directory_modal.current&&this.user_directory_modal.current.show()},this.handleRemoveUser=e=>{var s;const a=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{formatMessage:i}=t;a.show({actions:[a.CancelAction(),a.Action({label:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"}),onClick:()=>this.deleteUser(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to remove {user} from this organization?",id:"label.are_you_sure_you_want_to_remove_us.f03012bc",values:{user:(0,N.jsx)("strong",{children:(null===e||void 0===e?void 0:e.fullname)||""})}})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Note: this will remove the user from all groups and assignments within this organization.",id:"label.note_this_will_remove_the_user_fro.9f5da8bf"})})]}),title:"Remove User"})},this.handleArchiveToggle=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.confirmation_dialog)||void 0===a?void 0:a.current;if(!t)return;const{intl:i}=this.props,{formatMessage:l}=i;s?this.toggleUserStatus(null===e||void 0===e?void 0:e.id):t.show({actions:[t.CancelAction(),t.Action({label:l({id:"label.archive_user.3390dac7",defaultMessage:"Archive user"}),onClick:()=>this.toggleUserStatus(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to archive {user} from this organization?",id:"label.are_you_sure_you_want_to_archive_u.73abca45",values:{user:(0,N.jsx)("strong",{children:(null===e||void 0===e?void 0:e.fullname)||""})}})})}),title:"Archive User"})},this.launchUserDetailsModal=e=>{var s;const a=null===this||void 0===this||null===(s=this.user_details_modal)||void 0===s?void 0:s.current;a&&a.show({user_id:e})},this.handleSort=(e,s)=>this.setState({page:1,sort_direction:s,sort_token:e},this.refreshUsers),this.handleChangeSearchTerm=e=>{let s=e.target.value;this.setState({search_term:s}),this.startSearch()},this.handleChangePage=e=>this.setState({page:e},this.refreshUsers),this.includeSubOrgs=()=>{var e,s;return!(null===this||void 0===this||null===(e=this.sub_org_switch)||void 0===e||null===(s=e.current)||void 0===s||!s.selected)},this.handleSubOrgToggle=()=>this.setState({page:1},this.refreshUsers),this.getRoleFilter=()=>{var e,s;return null===(e=this.role_filter)||void 0===e||null===(s=e.current)||void 0===s?void 0:s.selection},this.handleChangeRoleFilter=()=>this.setState({page:1},this.refreshUsers),this.handleChangeStatusFilter=()=>this.setState({page:1},this.refreshUsers),this.state={count:0,error:null,loading:!0,members:null,page:1,page_size:20,search_term:"",show_create_user_editor:!1,show_import_user_editor:!1,sort_direction:"DESC",sort_token:"role",success:null},this.search_timer=null,this.user_import_modal=null,this.user_creation_modal=null,this.user_directory_modal=(0,l.createRef)(),this.user_details_modal=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)(),this.sub_org_switch=(0,l.createRef)(),this.role_filter=(0,l.createRef)(),this.archive_filter=(0,l.createRef)()}componentDidMount(){this.refreshUsers()}render(){const{admin_organization:e,app:s}=this.props,{organization:a,organization_id:t}=e,{count:i,error:l,loading:n,members:r,page:o,page_size:d,search_term:c,sort_direction:h,sort_token:u,success:m}=this.state,{refreshOrganization:g}=e||{},p=this.includeSubOrgs(),x=()=>{"function"===typeof g&&g()};return(0,N.jsxs)(ZI,{value:{getRoleFilter:this.getRoleFilter,handleArchiveToggle:this.handleArchiveToggle,handleRemoveUser:this.handleRemoveUser,handleSort:this.handleSort,include_sub_orgs:p,launchUserDetailsModal:this.lau
2nchUserDetailsModal,loading:n,members:r,sort_direction:h,sort_token:u},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"})}),s.userHasRight("manage_user",t)&&(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{disabled:"demo"===s.user.account_type,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add user",id:"label.add_user.eec5c73a"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:this.handleShowUserDirectoryModal,style:{paddingLeft:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Add from directory",id:"label.add_from_directory.e08fe3ff"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleShowUserCreationModal,style:{paddingLeft:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Create user",id:"label.create_user.f06da128"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleShowUserImportModal,style:{paddingLeft:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Import users from CSV",id:"label.import_users_from_csv.307baf3b"})})]})]})})]}),(0,N.jsxs)(Ge.A,{body:!0,className:"overflow-visible",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:l,variant:"danger",children:l}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:m,variant:"success",children:m}),(0,N.jsxs)(Qe.A,{className:"mb-2 align-items-center",children:[(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,sm:12,children:(0,N.jsxs)(Ei.A,{className:"mb-1",size:"sm",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:this.handleChangeSearchTerm,placeholder:"Search",readOnly:n,value:c})]})}),(0,N.jsx)(Ve.A,{className:"mb-1",md:2,sm:12,children:(0,N.jsx)(tE,{onChange:this.handleChangeRoleFilter,ref:this.role_filter})}),(0,N.jsx)(Ve.A,{className:"mb-1",md:2,sm:12,children:(0,N.jsx)(vT,{defaultSelected:!1,onChange:()=>{this.handleChangeStatusFilter()},ref:this.archive_filter})})]})}),(0,N.jsx)(Ve.A,{children:(0,N.jsxs)(Ce.S,{className:"d-inline-flex float-end",children:[(0,N.jsx)(_e.A.Label,{className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Include sub-organizations",id:"label.include_sub_organizations.b8a90835"})}),(0,N.jsx)(pT,{defaultSelected:!1,onToggle:this.handleSubOrgToggle,ref:this.sub_org_switch})]})})]}),(0,N.jsx)(eE,{}),(0,N.jsx)(Lr,{count:i,onChange:this.handleChangePage,page:o,page_size:d})]}),(0,N.jsx)(DE,{onUserUpdated:this.refreshUsers,organization_id:t,ref:this.user_details_modal}),(0,N.jsx)(mS,{onCreationSuccess:x,onHide:this.refreshUsers,onRef:e=>this.user_creation_modal=e,organization:a,organization_id:t}),(0,N.jsx)(bS,{onCreationSuccess:x,onHide:this.refreshUsers,onRef:e=>this.user_import_modal=e,organization:a,organization_id:t}),(0,N.jsx)(lE,{onHide:this.refreshUsers,organization_id:t,ref:this.user_directory_modal}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}var iF=(0,Ke.Ay)((0,n.G0)((0,Pe.y)(_T(nT(sF(tF))))));var lF=e=>{const{userHasRight:s}=(0,P.nm)(),{active_key:a,organization:t,organization_counts:i,setActiveTab:l}=rT();return(0,N.jsxs)(ld.A.Container,{activeKey:a,id:"admin-tabs",mountOnEnter:!0,unmountOnExit:!0,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",onSelect:l,variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"dashboard",children:[(0,N.jsx)(ze.$BV,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Dashboard",id:"label.dashboard.
267b69646"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"users",children:[(0,N.jsx)(ze.YXz,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",style:{verticalAlign:"middle"},children:i.user_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"organizations",children:[(0,N.jsx)(ze.ph9,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Sub-Organizations",id:"label.sub_organizations.7a1ff7a1"}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",style:{verticalAlign:"middle"},children:i.organization_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"groups",children:[(0,N.jsx)(ze.aQJ,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Groups",id:"label.groups.39bbb719"}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",style:{verticalAlign:"middle"},children:i.group_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"social",children:[(0,N.jsx)(ze.uN,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Social",id:"label.social.f1b7505a"})]})}),s("manage_organization",null===t||void 0===t?void 0:t.parent_id)&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"content",children:[(0,N.jsx)(ze.vd0,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Content",id:"label.content.47bd2907"})]})}),s("manage_organization",null===t||void 0===t?void 0:t.parent_id)&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"certifications",children:[(0,N.jsx)(ze.veT,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"settings",children:[(0,N.jsx)(ze.Pcn,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"})]})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"dashboard",children:(0,N.jsx)(nF.Dashboard,{organization_id:null===t||void 0===t?void 0:t.id})}),(0,N.jsx)(ld.A.Pane,{eventKey:"users",children:(0,N.jsx)(nF.Users,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"organizations",children:(0,N.jsx)(nF.SubOrganizations,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"groups",children:(0,N.jsx)(nF.Groups,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"social",children:(0,N.jsx)(nF.Social,{})}),s("manage_organization",null===t||void 0===t?void 0:t.parent_id)&&(0,N.jsx)(ld.A.Pane,{eventKey:"content",children:(0,N.jsx)(nF.Content,{})}),s("manage_organization",null===t||void 0===t?void 0:t.parent_id)&&(0,N.jsx)(ld.A.Pane,{eventKey:"certifications",children:(0,N.jsx)(nF.Certifications,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"settings",children:(0,N.jsx)(nF.Settings,{})})]})})})]})},nF={Certifications:MT,Content:II,Dashboard:AI,Groups:YI,Settings:yI,Social:JI,SubOrganizations:ST,Users:iF};class rF extends l.Component{constructor(e){super(e),this.state={error:null,groups:[],loading:!0,show:!1},this.show=this.show.bind(this),this.resolve=null,this.reject=null}show(){return new Promise((e,s)=>{this.resolve=e,this.reject=s,this.loadGroups(),this.setState({show:!0})})}handleHide(){this.setState({show:!1}),this.reject()}handleSelect(e){this.resolve(e),this.setState({show:!1})}loadGroups(){const{app:e}=this.props,s=e.getUserOrganizationId();return this.setState({error:null,loading:!0}),new Promise((a,t)=>{e.api.get(`/api/facilitators/organization/groups/memberships/list/${s}`,{organization_id:s}).then(e=>{let{groups:s}=e;s=Array.isArray(s)?s:[],this.setState({groups:s,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})})}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"==typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{error:e,groups:s,loading:a,show:t}=this.state,{app:i}=this.props;return(0,N.jsx)(xe,{className:"admin-group-selector",onHide:()=>{this.handleHide()},show:t,children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex flex-column",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Choose a group",description:"",id:"label.choose_a_group.005a6177"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Choose a group to assign content",id:"label.choose_a_group_to_assign_content.a53e606e"})})]}),(0,N.jsxs)(xe.Body,{children:[a&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:e,variant:"danger",children:e}),!a&&(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>{let{group:a}=e,t=null===a||void 0===a?void 0:a.learner_count,l=null===a||void 0===a?void 0:a.active_assignment_count;return(0,N.jsxs)(Ce.S,{className:"d-flex mb-3 px-2 py-2 class",role:"button",tabIndex:0,onClick:e=>{e.preventDefault(),this.handleSelect(a)},children:[(0,N.jsx)(Ce.S,{className:"align-self-center me-3",children:(0,N.jsx)(Zs.A,{fluid:!0,roundedCircle:!0,alt:"",src:i.getGroupAvatar(a),style:{maxHeight:32,maxWidth:32}})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{className:"mb-1",children:null===a||void 0===a?void 0:a.name}),(0,N.jsxs)("p",{className:"mb-0",children:[0==l&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ke.A,{defaultMessage:"No active challenges",id:"label.no_active_challenges.a2da83cb"})}),0!=l&&(0,N.jsxs)(N.Fragment,{children:[l," ",(0,N.jsx)(ke.A,{defaultMessage:"Active Challenge(s)",id:"label.active_challenges.54e7596c"})]}),(0,N.jsx)("span",{className:"mx-2",children:(0,N.jsx)(ze.Qp1,{size:5})}),t," ",(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})]})]})]},s)})})]})]})})}}(0,Pe.y)((0,Ke.Ay)((0,n.G0)(rF)));const oF=(0,l.forwardRef)((e,s)=>{var a,t,i,n,r,o,d,c;const{onHide:h}=e,[u,m,g]=(0,ne.CQ)({error:null,saving:!1,show:!1,slug_touched:!1}),{error:p,saving:x,show:v,slug_touched:f}=u,j=(0,Pe.W6)(),{api:_,locale:b,refreshUserBasics:A}=(0,P.nm)(),{organization_id:y}=rT(),w=(0,ds.Wx)({initialValues:{enable_auto_evaluation:!1,name:"",slug:""},onSubmit:async e=>{const{enable_auto_evaluation:s,name:a,slug:t}=e,i=await S({enable_auto_evaluation:s,name:a,slug:t});i&&j.push(`/admin/organization/${null===i||void 0===i?void 0:i.id}`)},validationSchema:(0,Re.by)({locale:b,scope:"organization.add_organization"})}),S=async e=>{m({error:null,saving:!0});try{const{organization:s}=await _.post("/api/organizations/add",(0,F.A)({organization_id:y},e));return await A(),m({saving:!1},M),s}catch({err:err}){m({error:err,saving:!1})}},C=e=>
2{m({show:!0})},M=()=>{"function"===typeof h&&h(),w.resetForm(),g()};return(0,l.useImperativeHandle)(s,()=>({hide:M,show:C})),(0,N.jsx)(xe,{onHide:M,show:v,children:(0,N.jsx)(ds.QI,{value:w,children:(0,N.jsxs)(_e.A,{onSubmit:w.handleSubmit,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create organization",id:"label.create_organization.f14e1b22"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>m({error:null}),show:p,variant:"danger",children:p}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{disabled:x,isInvalid:(null===w||void 0===w||null===(a=w.touched)||void 0===a?void 0:a.name)&&(null===w||void 0===w||null===(t=w.errors)||void 0===t?void 0:t.name),isValid:(null===w||void 0===w||null===(i=w.touched)||void 0===i?void 0:i.name)&&!(null!==w&&void 0!==w&&null!==(n=w.errors)&&void 0!==n&&n.name),name:"name",onChange:null===w||void 0===w?void 0:w.handleChange,onKeyUp:async e=>{f||await w.setFieldValue("slug",Rr()(e.target.value,{lower:!0,remove:/[*+~.()'"!:@]/g}))},type:"text",value:null===w||void 0===w?void 0:w.values.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Slug",id:"label.slug.d15387ec"})}),(0,N.jsx)(_e.A.Control,{disabled:x,isInvalid:(null===w||void 0===w||null===(r=w.touched)||void 0===r?void 0:r.slug)&&(null===w||void 0===w||null===(o=w.errors)||void 0===o?void 0:o.slug),isValid:(null===w||void 0===w||null===(d=w.touched)||void 0===d?void 0:d.slug)&&!(null!==w&&void 0!==w&&null!==(c=w.errors)&&void 0!==c&&c.slug),name:"slug",onChange:null===w||void 0===w?void 0:w.handleChange,onKeyUp:()=>m({slug_touched:!0}),type:"text",value:null===w||void 0===w?void 0:w.values.slug}),(0,N.jsx)(ds.Kw,{name:"slug",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:w.values.enable_auto_evaluation,name:"enable_auto_evaluation",onChange:async e=>await w.setFieldValue(e.target.name,e.target.checked),label:(0,N.jsx)(ke.A,{defaultMessage:"Enable auto-evaluation",id:"label.enable_auto_evaluation.c9d2d319"})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:x,onClick:M,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(Me.p0,{disabled:x||!(null!==w&&void 0!==w&&w.isValid),loading:x,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})})]})]})})})});oF.displayName="OrganizationCreationModal",oF.defaultProps={onHide:Function()};var dF=oF;new De.A;const cF=new Ee.Ay,hF={error:null,errors:null,existing_users:[],select_all:!1,select_all_existing:!1,selected_users:[],step:1,success:!1,users:[]};class uF extends l.Component{constructor(e){super(e),this.updateUsers=()=>{const{app:e,group_id:s,organization_id:a}=this.props,t=e.api,{selected_users:i}=this.state;i.length&&(this.setState({error:null,errors:null,loading:!0}),t.post("/lti/users/update",{force_password_change:!0,group_id:s,lock_user_information:!0,organization_id:a,users:i}).then(e=>{this.setState({loading:!1,step:2,success:!0})}).catch(e=>{const s=null===e||void 0===e?void 0:e.data,a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,errors:s,loading:!1})}))},this.loadLTIUsers=async()=>{const{group_id:e}=this.props;this.setState({loading:!0});try{let{existing_users:s,users:a}=await(e=>new Promise((s,a)=>{cF.get("/lti/teachers/learners",{group_id:e}).then(e=>{let{existing_users:a,users:t}=e;s({existing_users:a,users:t})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;a(s)})}))(e);a||(a=[]),this.setState({existing_users:s,loading:!1,users:a})}catch(err){this.setState({error:err,loading:!1})}},this.handleAddUser=e=>{const s=this.state.selected_users;let a=[];a=s.includes(e)?s.filter(s=>s!=e):[...s,e],this.setState({selected_users:a})},this.resetForm=()=>{this.setState(hF)},this.handleChange=e=>{const{name:s,value:a}=e.target;this.setState({[s]:a})},this.handleChangeEvent=(e,s,a)=>{this.setState(t=>{let i=t.users;Array.isArray(i)||(i=[]);const l=i[a];return l[e]=s,i[a]=l,{users:i}})},this.handleHide=()=>{"function"==typeof this.props.onHide&&this.props.onHide(),this.resetForm()},this.handleSubmit=()=>{"function"==typeof this.props.onSubmit&&this.props.onSubmit(),this.resetForm()},this.state=hF,this.handleChange=this.handleChange.bind(this)}render(){const{error:e,loading:s,success:a}=this.state;return(0,N.jsx)(xe,{className:"modal-import-users modal-step-2",onHide:this.handleHide,onShow:this.loadLTIUsers,show:this.props.show,size:"lg",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Synchronize LTI Roster",id:"label.synchronize_lti_roster.be4a59c9"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({success:null}),show:a,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners updated successfully!",id:"label.learners_updated_successfully.023b7ee7"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e}),s?(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Me.y$,{})}):(0,N.jsx)(N.Fragment,{children:1===this.state.step&&(0,N.jsxs)(Ce.S,{children:[this.state.errors&&this.state.errors.length>0&&(0,N.jsx)(xF,{errors:this.state.errors}),(0,N.jsx)(Gd.A,{defaultActiveKey:"0",children:(0,N.jsxs)(Gd.A.Item,{eventKey:"0",children:[(0,N.jsx)(Gd.A.Button,{variant:"link",children:(0,N.jsx)("h5",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"New Users without Account",id:"label.new_users_without_account.594da5ab"})})}),(0,N.jsx)(Gd.A.Body,{className:"p-0",children:(0,N.jsxs)(qa.A,{hover:!0,striped:!0,className:"import-users-table",size:"sm",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:this.state.users&&this.state.users.length>0&&(0,N.jsx)("input",{type:"checkbox",onClick:()=>{let e;this.state.select_all?(e=this.state.selected_users.filter(e=>!this.state.users.includes(e)),this.setState({select_all:!1,selected_users:e})):(e=this.state.users.filter(e=>!this.state.selected_users.includes(e)),this.setState(s=>({select_all:!0,selected_users:[...s.selected_users,...e]})))}})}),(0,N.jsx)("th",{}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",description:"",id:"label.name.dcd1d522"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",description:"",id:"label.email.969ccbd3"})})]})}),(0,N.jsxs)("tbody",{children:[this.state.users&&this.state.users.map((e,s)=>{const a=e.external_user_id?e.external_user_id:"",t=e.fullname?e.fullname:"",i=e.email?e.email:"",l=s+1,n=this.state.selected_users.includes(e);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(_e.A.Control,{checked:n,id:"user["+s+"]",name:"user["+s+"]",onChange:s=>{this.handleAddUser(e)},style:{display:"inline-block"},type:"checkbox"})}),(0,N.jsx)("td",{children:l}),(0,N.jsx)("td",{className:"text-start",children:(0,N.jsx)(pF,{onChange:e=>{this.handleChangeEvent("fullname",e,s)},value:t})}),(0,N.jsx)("td",{className:"text-start",children:(0,N.jsx)(pF,{onChange:e=>{this.handleChangeEvent("email",e,s)},value:i})})]},s),this.state.error&&(i.length&&this.state.errors.email===i||this.state.errors.external_user_id===a)&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{colSpan:4,children:(0,N.jsx)("small",{style:{color:"#c40808",dis
2play:"block"},children:this.state.errors.message})})})]})}),this.state.users&&0===this.state.users.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colSpan:4,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found.",description:"",id:"label.no_users_found.ce0171e5"})})})]})]})})]})}),(0,N.jsx)(Gd.A,{defaultActiveKey:"0",children:(0,N.jsxs)(Gd.A.Item,{className:"mt-3",eventKey:"0",children:[(0,N.jsx)(Gd.A.Header,{eventKey:"1",variant:"link",children:(0,N.jsx)("h5",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"New Users with Existing Accounts",id:"label.new_users_with_existing_accounts.cc1c9430"})})}),(0,N.jsx)(Gd.A.Body,{className:"p-0",children:(0,N.jsxs)(qa.A,{hover:!0,striped:!0,className:"import-users-table",size:"sm",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:this.state.existing_users&&this.state.existing_users.length>0&&(0,N.jsx)("input",{type:"checkbox",onClick:()=>{let e;this.state.select_all_existing?(e=this.state.selected_users.filter(e=>!this.state.existing_users.includes(e)),this.setState({select_all_existing:!1,selected_users:e})):(e=this.state.existing_users.filter(e=>!this.state.selected_users.includes(e)),this.setState(s=>({select_all_existing:!0,selected_users:[...s.selected_users,...e]})))}})}),(0,N.jsx)("th",{}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",description:"",id:"label.name.dcd1d522"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",description:"",id:"label.email.969ccbd3"})})]})}),(0,N.jsxs)("tbody",{children:[this.state.existing_users&&this.state.existing_users.map((e,s)=>{const a=e.fullname?e.fullname:"",t=e.email?e.email:"",i=s+1,l=this.state.selected_users.includes(e);return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(_e.A.Control,{checked:l,id:"existing_user["+s+"]",name:"existing_user",onChange:s=>{this.handleAddUser(e)},style:{display:"inline-block"},type:"checkbox"})}),(0,N.jsx)("td",{children:i}),(0,N.jsx)("td",{className:"text-start",children:a}),(0,N.jsx)("td",{className:"text-start",children:t})]},s)}),this.state.existing_users&&0===this.state.existing_users.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colSpan:7,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found.",description:"",id:"label.no_users_found.ce0171e5"})})})]})]})})]})})]})})]}),(0,N.jsxs)(xe.Footer,{children:[(1===this.state.step||2===this.state.step)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ve.A,{disabled:this.state.loading,onClick:()=>{this.handleHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})}),1===this.state.step&&(0,N.jsx)(ve.A,{disabled:this.state.loading||!this.state.selected_users.length,onClick:()=>this.updateUsers(),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:`Import users (${this.state.selected_users.length})`,id:"label.add_users"})})]})]})})}}var mF=(0,Ke.Ay)((0,n.G0)(_T(uF)));class gF extends l.Component{constructor(e){super(e),this.state={editing:!1}}render(){const{onChange:e,value:s}=this.props;return this.state.editing?(0,N.jsx)("input",{className:"form-control",onBlur:()=>this.onBlur(),onChange:s=>e(s.target.value),ref:"input",value:s}):(0,N.jsx)("div",{onClick:()=>this.onFocus(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||this.onFocus()},role:"button",tabIndex:0,children:s||(0,N.jsx)(ze.Mbp,{})})}onFocus(){this.setState({editing:!0},()=>{this.refs.input.focus()})}onBlur(){this.setState({editing:!1})}}var pF=gF;var xF=e=>(0,N.jsxs)(Ce.S,{style:{marginTop:"1em"},children:[(0,N.jsx)("h6",{children:"Errors"}),(0,N.jsxs)(qa.A,{hover:!0,striped:!0,className:"add-users-table",size:"sm",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{}),(0,N.jsx)("th",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"Email",description:"",id:"label.email.969ccbd3"})}),(0,N.jsx)("th",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"Message",description:"",id:"label.message.2f77668a"})})]})}),(0,N.jsx)("tbody",{children:e.errors.map((e,s)=>{let a=e.email_address?e.email_address:"",t=e.message?e.message:"",i=s+1;return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:i}),(0,N.jsx)("td",{children:a}),(0,N.jsx)("td",{children:t})]},s)})})]})]}),vF=t(11076);class fF extends l.Component{constructor(s){var a,t;super(s),this._isMounted=!1,this.clearError=()=>this.setState({error:null}),this.getTabKeyFromHash=()=>{var e,s,a,t,i;return(null===this||void 0===this||null===(e=this.props)||void 0===e||null===(s=e.history)||void 0===s||null===(a=s.location)||void 0===a||null===(t=a.hash)||void 0===t||null===(i=t.replace)||void 0===i?void 0:i.call(t,"#",""))||"dashboard"},this.refreshOrganization=async()=>{try{const{app:e}=this.props,s=e.api,{organization_id:a}=this.state,{organization:t,tree:i}
2=await s.get("/api/organizations/get",{include_sub_org_counts:0,organization_id:a});let l=(null===t||void 0===t?void 0:t.user_count)||0,n=(null===t||void 0===t?void 0:t.organization_count)||0,r=(null===t||void 0===t?void 0:t.group_count)||0,o=(null===t||void 0===t?void 0:t.challenge_count)||0;this.setState({error:null,loading:!1,organization:t,organization_counts:{challenge_count:o,group_count:r,organization_count:n,user_count:l},organization_tree:i})}catch(e){this.setState({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message),loading:!1})}},this.setActiveTabKey=e=>{const{history:s}=this.props;this._isMounted&&(this.setState({active_key:e}),s.push(`${s.location.pathname}#${e}`))},this.setGroupBadgeCount=e=>{this.setState(s=>({organization_counts:(0,F.A)((0,F.A)({},s.organization_counts),{},{group_count:e})}))},this.setUserBadgeCount=e=>{this.setState(s=>({organization_counts:(0,F.A)((0,F.A)({},s.organization_counts),{},{user_count:e})}))},this.setSubOrgBadgeCount=e=>{this.setState(s=>({organization_counts:(0,F.A)((0,F.A)({},s.organization_counts),{},{organization_count:e})}))},this.state={active_key:this.getTabKeyFromHash(),error:null,loading:!0,organization:null,organization_counts:{challenge_count:0,group_count:0,organization_count:0,user_count:0},organization_id:(null===s||void 0===s||null===(a=s.match)||void 0===a||null===(t=a.params)||void 0===t?void 0:t.organization_id)||(null===s||void 0===s?void 0:s.organization_id)||null,organization_tree:null}}componentWillUnmount(){this._isMounted=!1}componentDidMount(){this._isMounted=!0,this.refreshOrganization()}componentDidUpdate(e,s){var a,t,i,l,n;const{active_key:r}=this.state,o=this.getTabKeyFromHash(),d=null===e||void 0===e||null===(a=e.match)||void 0===a||null===(t=a.params)||void 0===t?void 0:t.organization_id,c=null===(i=this.props)||void 0===i||null===(l=i.match)||void 0===l||null===(n=l.params)||void 0===n?void 0:n.organization_id;d!==c&&this.setState({loading:!0,organization_id:c},this.refreshOrganization),o!==r&&this.setState({active_key:o})}render(){const{app:e}=this.props,{userHasRight:s,userIsSiteAdmin:a}=e,{active_key:t,error:i,loading:l,organization:n,organization_counts:r,organization_tree:o}=this.state,d=(null===n||void 0===n?void 0:n.id)||null;return n&&d&&!s("manage_organization",d)?(0,N.jsx)(Pe.rd,{to:"/admin"}):(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Me.x_,{loading:l,children:(0,N.jsxs)(iT,{value:{active_key:t,loading:l,organization:n,organization_counts:r,organization_id:d,organization_tree:o,refreshOrganization:this.refreshOrganization,setActiveTab:this.setActiveTabKey,setGroupBadgeCount:this.setGroupBadgeCount,setSubOrgBadgeCount:this.setSubOrgBadgeCount,setUserBadgeCount:this.setUserBadgeCount},children:[(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsxs)(vF.A,{children:[a()&&(0,N.jsx)(pa.mu,{to:"/admin",children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.f35,{className:"me-1",size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Site",id:"label.site.fa795581"})]})}),!(null===o||void 0===o||!o.length)&&o.map((e,s)=>(0,N.jsxs)(vF.A.Item,{href:`/admin/organization/${e.id}`,children:[(0,N.jsx)(ze.ymh,{className:"me-1",size:12}),null===e||void 0===e?void 0:e.name]},s)),n&&(0,N.jsxs)(vF.A.Item,{active:!0,children:[(0,N.jsx)(ze.ymh,{className:"me-1",size:12}),null===n||void 0===n?void 0:n.name]})]}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization manager",id:"label.organization_manager.c61f1f17"})}),n&&(0,N.jsx)("h4",{children:null===n||void 0===n?void 0:n.name})]})}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:i,variant:"danger",children:i}),!l&&(0,N.jsx)(lF,{})]})})]})})})})})}}var jF=(0,P.G0)((0,Pe.y)(_T(fF)));const _F={approved:["approved"],awaiting_evaluation:["awaiting_evaluation"],denied:["denied"],pending:["pending"],processing:["processing"],reviewed:["approved","denied"]};var bF=s=>{const{organization_id:a}=s,{api:t}=(0,P.nm)(),{formatMessage:i}=(0,ja.A)(),n=(0,l.useRef)(),[r,o,d]=(0,ne.CQ)({certification_requests:[],count:0,error:null,loading:!1,page:1,page_size:20,search_term:"",sort_direction:"DESC",sort_token:"date",status_filter:""}),{certification_requests:c,count:h,error:u,loading:m,page:g,page_size:p,search_term:x,sort_direction:v,sort_token:f,status_filter:j}=r,_=()=>o({error:null}),b=async()=>{try{o({loading:!0});const{page:e,page_size:s,search_term:i,sort_direction:l,sort_token:n,status_filter:d}=r,{certification_requests:c,count:h=0}=await t.post(`/api/certifications/requests/search/${e}/${s}`,(0,F.A)({search_term:i,sort_direction:l,sort_token:n,status_filters:_F[d]||[]},a?{organization_id:a}:{}));o({certification_requests:c,count:h,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}},A=e=>{var s;null===e||void 0===e||null===(s=e.preventDefault)||void 0===s||s.call(e),o({page:1},b)},y=[{label:i({id:"label.all_statuses.8ee57323",defaultMessage:"All statuses"}),value:""},{label:i({id:"label.reviewed_approved_denied.64a36b78",defaultMessage:"Reviewed (approved + denied)"}),value:"reviewed"},{label:i({id:"label.awaiting_evaluation.e584d7cd",defaultMessage:"Awaiting evaluation"}),value:"awaiting_evaluation"},{label:i({id:"label.processing.c8e3e92a",defaultMessage:"Processing"}),value:"processing"},{label:i({id:"label.pending_review.f1c45f3f",defaultMessage:"Pending review"}),value:"pending"},{label:i({id:"label.approved.87b42e40",defaultMessage:"Approved"}),value:"approved"},{label:i({id:"label.denied.da404deb",defaultMessage:"Denied"}),value:"denied"}];(0,l.useEffect)(()=>{b()},[]);const w={certification_requests:c,clearError:_,error:u,fetchCertificationRequests:b,handleSort:(e,s)=>o({page:1,sort_direction:s,sort_token:e},b),launchCertificateViewer:e=>{const s=null===n||void 0===n?void 0:n.current;s&&s.show({certificate:e})},loading:m,search_term:x,setError:e=>o({error:e}
2),setLoading:e=>o({loading:e}),sort_direction:v,sort_token:f};return(0,N.jsx)(yF,{value:(0,F.A)({},w),children:(0,N.jsxs)(Ce.S,{className:"certification-requests-widget",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Requests",id:"label.requests.ada27592"})}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:_,show:u,variant:"danger",children:u}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center gap-3",children:[(0,N.jsx)(_e.A,{onSubmit:A,style:{width:"40%"},children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(be.A,{disabled:m,onChange:e=>(e=>o({search_term:e}))(e.target.value),placeholder:"Search",readOnly:m}),(0,N.jsx)(ve.A,{disabled:m,type:"submit",children:(0,N.jsx)(ze.KSO,{})})]})}),(0,N.jsx)(_e.A.Select,{"aria-label":i({id:"label.filter_by_status.94d5a770",defaultMessage:"Filter by status"}),disabled:m,onChange:e=>(e=>o({page:1,status_filter:e},b))(e.target.value),style:{width:"auto"},value:j,children:y.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,N.jsx)(Me.p0,{"aria-label":"refresh requests",className:"align-self-center d-flex align-items-center gap-1",loading:m,onClick:A,size:"sm",title:"Refresh requests",variant:"link",children:(0,N.jsx)(ze.KP4,{})})]}),(0,N.jsx)(CF,{}),(0,N.jsx)(Lr,{count:h,onChange:e=>o({page:e},b),page:g,page_size:p})]})}),(0,N.jsx)(Au,{ref:n})]})})};const AF=(0,l.createContext)({}),yF=AF.Provider,wF=(AF.Consumer,()=>(0,l.useContext)(AF)),NF=e=>{const{status:s}=e,{formatMessage:a}=(0,ja.A)(),t={bg:"",className:"",content:"",text:""};switch(s){case"awaiting_evaluation":t.bg="warning",t.text="white",t.className="fw-semibold",t.content=a({id:"label.awaiting_evaluation.e584d7cd",defaultMessage:"Awaiting evaluation"});break;case"processing":t.bg="info",t.text="white",t.className="fw-semibold",t.content=a({id:"label.processing.c8e3e92a",defaultMessage:"Processing"});break;case"pending":t.bg="light",t.text="black",t.content=a({id:"label.pending_arbitration.fd219dfc",defaultMessage:"Pending arbitration"});break;case"approved":t.bg="success",t.text="white",t.className="fw-semibold",t.content=a({id:"label.approved.87b42e40",defaultMessage:"Approved"});break;case"denied":t.bg="danger",t.text="white",t.className="fw-semibold",t.content=a({id:"label.denied.da404deb",defaultMessage:"Denied"})}return(0,N.jsx)(bo.A,{bg:t.bg,className:t.className,text:t.text,children:t.content})},SF=s=>{var a,t,i,n,r,o;const{certificate:d,challenge_member:c,request:h}=s,{id:u,status:m}=h,{clearError:g,fetchCertificationRequests:p,launchCertificateViewer:x,setError:v,setLoading:f}=wF(),j=null===c||void 0===c||null===(a=c.challenge)||void 0===a||null===(t=a.group_assignment_component)||void 0===t?void 0:t.team_evaluation,_=null===c||void 0===c||null===(i=c.team_member)||void 0===i?void 0:i.team;let b=null===_||void 0===_?void 0:_.members;b=null!==(n=b)&&void 0!==n&&n.length?b.map(e=>e.user):[];const{api:A,userCanArbitrate:y,userCanManageEvaluations:w}=(0,P.nm)(),S=null!==(r=null===y||void 0===y?void 0:y())&&void 0!==r&&r,C=null!==(o=null===w||void 0===w?void 0:w())&&void 0!==o&&o,{formatMessage:M}=(0,ja.A)(),k=(0,l.useRef)(),z=(0,l.useRef)(),T=()=>{var e,s,a;const t=null===z||void 0===z?void 0:z.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:M({id:"label.evaluate.966591fe",defaultMessage:"Evaluate"}),onClick:I,variant:"primary"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action will trigger evaluations for the following team member(s):",id:"label.this_action_will_trigger_evaluatio.5e852ec3"})}),(0,N.jsx)("h5",{children:null===_||void 0===_?void 0:_.name}),(0,N.jsx)("hr",{}),(0,N.jsx)("ul",{className:"list-unstyled",children:j?(0,N.jsx)("li",{className:"fw-semibold",children:null===c||void 0===c||null===(e=c.team_member)||void 0===e||null===(s=e.user)||void 0===s?void 0:s.fullname}):(0,N.jsx)(N.Fragment,{children:(null===(a=b)||void 0===a?void 0:a.length)&&b.map(e=>(0,N.jsx)("li",{className:"fw-semibold",children:null===e||void 0===e?void 0:e.fullname},null===e||void 0===e?void 0:e.id))})})]}),title:"Trigger evaluation"})},I=async()=>{try{var s;g(),f(!0),await A.post("/api/certifications/trigger-evaluation",{challenge_id:null===c||void 0===c||null===(s=c.challenge)||void 0===s?void 0:s.id,challenge_member_id:!!j&&(null===c||void 0===c?void 0:c.id)}),await p()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;v(a),f(!1)}},E=async()=>{try{g(),f(!0),await A.post("/api/certifications/request/delete",{certification_request_id:u}),await p()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;v(a),f(!1)}};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:["processing"===m&&(0,N.jsx)("span",{className:"text-muted small align-self-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Processing...",id:"label.processing.f40a853e"})}),"awaiting_evaluation"===m&&C&&(0,N.jsx)(ve.A,{onClick:T,size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Evaluate",id:"label.evaluate.966591fe"})}),"awaiting_evaluation"!==m&&"processing"!==m&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{as:Le.Link,size:"sm",to:`/admin/certification-request/${u}`,variant:"outline-secondary",children:"pending"===m&&S?(0,N.jsx)(ke.A,{defaultMessage:"Arbitrate",id:"label.arbitrate.ef30be74"}):(0,N.jsx)(ke.A,{defaultMessage:"Review",id:"label.review.aff0766a"})}),"pending"===m&&C&&(0,N.jsx)(ve.A,{onClick:T,size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Re-evaluate",id:"label.re_evaluate.9537b3cf"})}),!!d&&(0,N.jsx)(ve.A,{onClick:()=>x(d),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Certificate",id:"label.certificate.2a93a8a4"})}),(0,N.jsx)(ve.A,{onClick:async()=>{const e=null===k||void 0===k?void 0:k.current;e&&e.show({challenge_member_id:c.id})},size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Report",id:"label.report.b6ce788d"})})]}),C&&(0,N.jsx)(ve.A,{onClick:()=>{const e=null===z||void 0===z?void 0:z.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:M({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:E,variant:"danger"})],body:M({id:"label.delete_this_certification_request.5c339719",defaultMessage:"Delete this certification request? This removes the request, its certificate, and its evaluation so the learner can request certification again. This cannot be undone."}),title:M({id:"label.delete_certification_request.ba356886",defaultMessage:"Delete certification request?"})})},size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]}),(0,N.jsx)(Xh,{ref:k}),(0,N.jsx)(je,{ref:z})]})};
2var CF=e=>{const{certification_requests:s,handleSort:a,loading:t,sort_direction:i,sort_token:l}=wF();return(0,N.jsxs)(ho,{rounded:!0,defaultSortDirection:i,defaultSortToken:l,hover:!(null===s||void 0===s||!s.length),onSort:a,children:[(0,N.jsxs)(ho.Thead,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:"Certification"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"user",children:"User"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"challenge",children:"Challenge"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"team",children:"Team"}),(0,N.jsx)(ho.Th,{name:"status",children:"Status"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"date",children:"Date requested"}),(0,N.jsx)(ho.Th,{className:"text-end",children:"Actions"})]}),(0,N.jsx)(ho.Tbody,{cols:7,loading:t,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(MF,{certification_request:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:7,children:(0,N.jsx)("span",{className:"d-flex align-items-center justify-content-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No requests found",id:"label.no_requests_found.4b5d17fa"})})})})})]})};var MF=e=>{var s,a,t,i,l,n,r,o,d,c;const{certification_request:h}=e,{certificate:u,certification_template:m,challenge_member:g,created_at:p,status:x,user:v}=h||{},{challenge:f}=g||{},j=null===g||void 0===g||null===(s=g.team_member)||void 0===s?void 0:s.team,_=null===g||void 0===g||null===(a=g.challenge)||void 0===a||null===(t=a.group_assignment_component)||void 0===t?void 0:t.group_assignment_id,b=null===g||void 0===g||null===(i=g.challenge)||void 0===i||null===(l=i.group_assignment_component)||void 0===l||null===(n=l.assignment)||void 0===n?void 0:n.group_id,A=null===g||void 0===g||null===(r=g.challenge)||void 0===r||null===(o=r.group_assignment_component)||void 0===o?void 0:o.id,y=null===g||void 0===g||null===(d=g.challenge)||void 0===d?void 0:d.id;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(Me.R_,{rounded:!0,height:50,imageHeight:50,imageWidth:50,src:(null===m||void 0===m?void 0:m.icon_path)||xo,width:50}),(0,N.jsx)("strong",{children:null===m||void 0===m?void 0:m.title})]})}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(Ya,{showOnline:!1,size:24,user:v}),(0,N.jsx)("span",{children:null===v||void 0===v?void 0:v.fullname})]})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{rel:"nooperner noreferrer",target:"_blank",to:`/admin/group/${b}/assignment/${_}/challenge/${A}/view/${y}`,children:null===f||void 0===f||null===(c=f.challenge_template)||void 0===c?void 0:c.title})}),(0,N.jsx)(ho.Td,{children:(null===j||void 0===j?void 0:j.name)||"-"}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Ce.S,{className:"d-flex gap-1 align-items-center text-capitalize",children:(0,N.jsx)(NF,{status:x})})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Gh.XU,{value:p})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)(SF,{certificate:u,challenge_member:g,request:h})})]})};var kF=e=>{const{organization_id:s}=e;return(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsxs)(Ue.A,{className:"arbitrator-dashboard pb-4",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1 mb-3",children:[(0,N.jsx)("h2",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification review",id:"label.certification_review.719d87a8"})}),(0,N.jsx)("p",{className:"text-muted m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Review certification requests for your organization, and approve or deny each one.",id:"label.review_certification_requests_for.798ba7be"})})]}),(0,N.jsx)(bF,{organization_id:s})]})})})};var zF=s=>{const{api:a}=(0,P.nm)(),[t,i,n]=(0,ne.CQ)({certificates:[],certification_templates:[],count:0,error:null,loading:!1,page:1,page_size:20,search_term:"",sort_direction:"ASC",sort_token:"title"}),{certificates:r,certification_templates:o,count:d,error:c,loading:h,page:u,page_size:m,search_term:g,sort_direction:p,sort_token:x}=t,v=(0,l.useRef)(),f=async()=>{try{i({loading:!0});const{page:e,page_size:s,search_term:l,sort_direction:n,sort_token:r}=t,{certification_templates:o,count:d=0}=await a.post(`/api/certification-templates/search/${e}/${s}`,{search_term:l,sort_direction:n,sort_token:r});i({certification_templates:o,count:d,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}};(0,l.useEffect)(()=>{f()},[]);const j={certificates:r,certification_templates:o,deleteCertificationTemplate:async s=>{try{i({loading:!0}),await a.post("/api/certification-templates/stub/delete",{certification_template_stub_id:s}),i({loading:!1},f)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}},error:c,fetchCertificationTemplates:f,handleSort:(e,s)=>i({page:1,sort_direction:s,sort_token:e},f),loading:h,search_term:g,sort_direction:p,sort_token:x};return(0,N.jsxs)(IF,{value:(0,F.A)({},j),children:[(0,N.jsx)(Ce.S,{className:"certification-templates-widget",children:(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>i({error:null}),show:c,variant:"danger",children:c}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)(_e.A,{onSubmit:e=>{e.preventDefault(),i({page:1},f)},style:{width:"40%"},children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(be.A,{disabled:h,onChange:e=>(e=>i({search_term:e}))(e.target.value),placeholder:"Search",readOnly:h}),(0,N.jsx)(ve.A,{diabled:h,type:"submit",children:(0,N.jsx)(ze.KSO,{})})]})}),(0,N.jsxs)(ve.A,{className:"d-flex justify-self-center align-items-center gap-1",disabled:h,onClick:()=>{const e=v.current;e&&e.show()},children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"New certification",id:"label.new_certification.52a6dc34"})})]})]}),(0,N.jsx)(FF,{}),(0,N.jsx)(Lr,{count:d,onChange:e=>i({page:e},f),page:u,page_size:m})]})})}),(0,N.jsx)(BF,{ref:v})]})};const TF=(0,l.createContext)({}),IF=TF.Provider,EF=(TF.Consumer,()=>(0,l.useContext)(TF));var FF=e=>{const{certification_templates:s,handleSort:a,loading:t,sort_direction:i,sort_token:l}=EF();return(0,N.jsxs)(ho,{rounded:!0,defaultSortDirection:i,defaultSortToken:l,hover:!(null===s||void 0===s||!s.length),onSort:a,children:[(0,N.jsxs)(ho.Thead,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{name:"type",children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"date",children:(0,N.jsx)(ke.A,{defaultMessage:"Created",id:"label.created.d70b9e24"})}),(0,N.jsx)(ho.Th,{name:"challenges",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})}),(0,N.jsx)(ho.Th,{name:"certificates",children:(0,N.jsx)(ke.A,{defaultMessage:"Granted",id:"label.granted.62026a42"})}),(0,N.jsx)(ho.Th,{name:"certificates",children:(0,N.jsx)(ke.A,{defaultMessage:"Requests",id:"label.requests.ada27592"})}),(0,N.jsx)(ho.Th,{name:"published",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]}),(0,N.jsx)(ho.Tbody,{cols:8,loading:t,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(RF,{certification_template:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:8,children:(0,N.jsx)("span",{className:"d-flex align-items-center justify-content-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No templates found",id:"label.no_templates_found.186e4883"})})})})})]})};var RF=e=>{const{certification_template:s}=e,{certificates:a,certification_requests:t,certification_template_stub_id:i,certification_type:n,challenge_templates:r,created_at:o,icon_path:d,published:c,title:h}=s||{},{deleteCertificationTemplate:u}=EF(),{formatMessage:m}=(0,ja.A)(),g=(0,l.useRef)(),p=d||xo;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(Me.R_,{roun
2ded:!0,height:50,imageHeight:50,imageWidth:50,src:p,width:50}),(0,N.jsx)(Le.Link,{className:"fw-bold text-decoration-none",to:`/admin/certification-template/${i}`,children:h})]})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(LF,{type:n})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Gh.XU,{value:o})}),(0,N.jsx)(ho.Td,{children:(null===r||void 0===r?void 0:r.length)||0}),(0,N.jsx)(ho.Td,{children:(null===a||void 0===a?void 0:a.length)||0}),(0,N.jsx)(ho.Td,{children:(null===t||void 0===t?void 0:t.length)||0}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(PF,{status:c})}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{as:Le.Link,size:"sm",to:`/admin/certification-template/${i}`,variant:"outline-secondary",children:c?(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"}):(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})}),!(null!==t&&void 0!==t&&t.length)&&(0,N.jsx)(ve.A,{onClick:()=>{const e=g.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:"Delete",onClick:()=>u(i),variant:"danger"})],body:(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete {title}?",id:"label.are_you_sure_you_want_to_delete_ti.e7364779",values:{title:(0,N.jsx)("strong",{children:h})}})}),(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can not be undone.",id:"label.this_action_can_not_be_undone.128d24d0"})})]}),size:"sm",title:m({id:"label.confirm_deletion.fa57243d",defaultMessage:"Confirm deletion"})})},size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})}),(0,N.jsx)(je,{ref:g})]})};const DF=(0,l.forwardRef)((s,a)=>{const[t,i,n]=(0,ne.CQ)({error:null,loading:!1,visible:!1}),{error:r,visible:o}=t,d=(0,Pe.W6)(),{api:c,locale:h}=(0,P.nm)(),{formatMessage:u}=(0,ja.A)(),m=()=>i({error:null}),g=()=>{i({visible:!0})},p=()=>n();return(0,l.useImperativeHandle)(a,()=>({hide:p,show:g,visible:o})),(0,N.jsx)(xe,{onHide:p,show:o,children:(0,N.jsx)(ds.l1,{onSubmit:async s=>{try{i({loading:!0});const{title:e}=s,{certification_template:a,stub:t}=await c.post("/api/certification-templates/create",{title:e});p(),d.push(`/admin/content-authoring/certification/${null===t||void 0===t?void 0:t.id}/${null===a||void 0===a?void 0:a.id}`)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}},validationSchema:(0,Re.by)({locale:h,scope:"content_authoring.add_certification_template"}),validatorOnChange:!0,initialValues:{title:""},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"New certification",id:"label.new_certification.52a6dc34"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:m,show:r,variant:"danger",children:r}),(0,N.jsxs)(Xl.A,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Certification title",isInvalid:(null===i||void 0===i?void 0:i.title)&&(null===s||void 0===s?void 0:s.title),isValid:(null===i||void 0===i?void 0:i.title)&&!(null!==s&&void 0!==s&&s.title),name:"title",onChange:a,value:null===l||void 0===l?void 0:l.title,placeholder:u({id:"label.enter_a_title.38d974bb",defaultMessage:"Enter a title..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:p,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}
2),(0,N.jsx)(ve.A,{disabled:!(null!==l&&void 0!==l&&l.title),onClick:t,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"})})]})]})}})})});DF.displayName="NewCertificationTemplateModal";var BF=DF;var PF=e=>{const{status:s}=e;switch(s){case 1:return(0,N.jsx)(bo.A,{bg:"success",className:"fw-semibold",color:"white",children:(0,N.jsx)(ke.A,{defaultMessage:"Published",id:"label.published.2ef42ec2"})});case 2:return(0,N.jsx)(bo.A,{bg:"dark",className:"fw-semibold",color:"white",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})});default:return(0,N.jsx)(bo.A,{bg:"light",text:"black",children:(0,N.jsx)(ke.A,{defaultMessage:"Unpublished",id:"label.unpublished.b6e07310"})})}};var LF=e=>{const{type:s}=e;return"decision_making"===s?(0,N.jsx)(bo.A,{bg:"info",className:"fw-semibold",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"Decision making",id:"label.decision_making.612e16dd"})}):(0,N.jsx)(bo.A,{bg:"secondary",className:"fw-semibold",color:"white",children:(0,N.jsx)(ke.A,{defaultMessage:"Solution",id:"label.solution.22927695"})})};const OF=s=>{const{api:a}=(0,P.nm)(),{formatMessage:t}=(0,ja.A)(),[i,n,r]=(0,ne.CQ)({competencies:[],count:0,error:null,loading:!1,message:null,page:1,page_size:10,scope:"global",search_term:"",sort_direction:"DESC",sort_token:"date"}),{competencies:o,error:d,loading:c,message:h,page:u,page_size:m,scope:g,search_term:p,sort_direction:x,sort_token:v}=i,f=(0,l.useRef)(),j=async()=>{const{page:s,page_size:t,scope:l,search_term:r,sort_direction:o,sort_token:d}=i;try{n({loading:!0});const{competencies:e,count:i}=await a.get(`/api/certification-templates/competencies/search/${s}/${t}`,{page:s,page_size:t,scope:l,search_term:r,sort_direction:o,sort_token:d});n({competencies:e,count:i,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},_=async e=>{let{competency_id:s,organization_id:t}=e;await a.post(`/api/certification-templates/competency/set/organization/${s}`,{organization_id:t||null})},b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const s=null===f||void 0===f?void 0:f.current;s&&s.show({competency:e})};(0,l.useEffect)(()=>{j()},[]);const A={changeCompetencyOrganization:async s=>{let{competency_id:a,organization_id:i}=s;try{n({loading:!0}),await _({competency_id:a,organization_id:i}),n({loading:!1,message:t({id:"label.competency_ownership_updated_succe.381a8d83",defaultMessage:"Competency ownership updated successfully."})}),await j()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},competencies:o,createCompetency:async e=>{let{name:s,organization_id:i=null,rubric:l}=e;await a.post("/api/certification-templates/competency/create",{name:s,organization_id:i,rubric:l}),n({message:t({id:"label.competency_created_successfully.313d7051",defaultMessage:"Competency created successfully."})})},deleteCompetency:async s=>{try{n({loading:!0}),await a.post("/api/certification-templates/competency/delete",{competency_id:s}),n({loading:!1,message:t({id:"label.competency_deleted_successfully.29e2a028",defaultMessage:"Competency deleted successfully."})}),await j()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},error:d,handleSort:(e,s)=>{n({sort_direction:s,sort_token:e},async()=>await j())},launchCompetencyWizard:b,loading:c,page:u,page_size:m,scope:g,search_term:p,searchCompetencies:j,sort_direction:x,sort_token:v,updateCompetency:async s=>{let{competency_id:i,rubric:l}=s;try{n({loading:!0}),await a.post("/api/certification-templates/competency/rubric/save",{competency_id:i,rubric:l}),n({loading:!1,message:t({id:"label.competency_updated_successfully.7a662643",defaultMessage:"Competency updated successfully."})})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},updateCompetencyOrganization:_};return(0,N.jsxs)(UF,{value:(0,F.A)({},A),children:[(0,N.jsx)(Ce.S,{className:"competencies-widget",children:(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies",id:"label.competencies.ec64b47c"})}),"global"===g&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",onClick:()=>b(),children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"New competency",id:"label.new_competency.f7aac9b3"})]})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:d,variant:"danger",children:d}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({message:null}),show:h,variant:"success",children:h}),(0,N.jsxs)(aa.A,{activeKey:g,className:"flex-row tabs-primary",onSelect:e=>{e!==g&&n({page:1,scope:e},async()=>await j())},variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"global",children:(0,N.jsx)(ke.A,{defaultMessage:"Global",id:"label.global.a258b30f"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"custom",children:(0,N.jsx)(ke.A,{defaultMessage:"Custom",id:"label.custom.494ca78f"})})})]}),(0,N.jsx)(VF,{})]})})}),(0,N.jsx)(CR,{ref:f})]})};const HF=(0,l.createContext)({}),UF=HF.Provider,QF=(HF.Consumer,()=>(0,l.useContext)(HF)),VF=e=>{const{competencies:s,handleSort:a,loading:t,sort_direction:i,sort_token:l}=QF();return(0,N.jsxs)(ho,{rounded:!0,defaultSortDirection:i,defaultSortToken:l,hover:!(null===s||void 0===s||!s.length),onSort:a,children:[(0,N.jsxs)(ho.Thead,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Scope",id:"label.scope.b073f6c6"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"type",children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"date",children:(0,N.jsx)(ke.A,{defaultMessage:"Date created",id:"label.date_created.fa91f762"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]}),(0,N.jsx)(ho.Tbody,{cols:5,loading:t,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(SR,{competency:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:5,children:(0,N.jsx)("span",{className:"d-flex align-items-center justify-content-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No templates found",id:"label.no_templates_found.186e4883"})})})})})]})};const GF=(0,l.forwardRef)((e,s)=>{var a,t;const{onHide:i}=e,[n,r,o]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1,version_description:null!==(a=null===e||void 0===e?void 0:e.description)&&void 0!==a?a:"",version_title:null!==(t=null===e||void 0===e?void 0:e.title)&&void 0!==t?t:""}),{show:d}=n,c=(0,ds.Wx)({enableReinitialize:!0,initialValues:{version_description:n.version_description,version_title:n.version_title},onSubmit:e=>{v(e)}}),{errors:h,handleChange:u,handleSubmit:m,touched:g,values:p}=c,x=(e,s)=>new Promise((a,t)=>{r({reject:t,resolve:a,show:!0,version_description:s,version_title:e})}),v=e=>{n.resolve(e),f()},f=()=>{n.resolve(null),o(),"function"===typeof i&&i()};return(0,l.useImperativeHandle)(s,()=>({hide:f,show:x})),(0,N.jsxs)(xe,{onHide:f,show:d,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Version details",id:"label.ver
2sion_details.c05702e1"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(ds.QI,{value:c,children:(0,N.jsxs)(_e.A,{onSubmit:m,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Version name"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"version name",className:"form-control",name:"version_title",onChange:u,type:"text",value:p.version_title,isInvalid:g.version_title&&h.version_title,isValid:g.version_title&&!h.version_title}),h.version_title&&g.version_title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:h.version_title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Description of changes",description:"",id:"label.description_of_changes.b73fb4ce"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Description of changes",as:"textarea",className:"form-control",name:"version_description",onChange:u,placeholder:"Describe the changes made in this version",rows:4,value:p.version_description,isInvalid:g.version_description&&h.version_description,isValid:g.version_description&&!h.version_description})]}),(0,N.jsxs)(os,{className:"d-flex justify-content-end mb-0 align-items-center",children:[(0,N.jsx)(ve.A,{className:"d-flex align-items-center",onClick:f,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"CANCEL",description:"",id:"label.cancel.ad8d6985"})}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"SAVE",description:"",id:"label.save.c210bfdf"})})]})]})})})]})});GF.displayName="EditJourneyVersionInfoModal";const WF=e=>{const{primary:s,published:a}=e,t=a?"success":"warning";return(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-1",children:[(0,N.jsx)(bo.A,{pill:!0,bg:t,children:a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.A7C,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Published",id:"label.published.2ef42ec2"})]}):(0,N.jsx)(ke.A,{defaultMessage:"Not published",id:"label.not_published.c6520016"})}),s&&(0,N.jsxs)(bo.A,{pill:!0,bg:"primary",children:[(0,N.jsx)(ze.gt3,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Primary",id:"label.primary.efe10c80"})]})]})};WF.defaultProps={primary:!1,published:null};var KF=WF;const YF=(0,l.forwardRef)((s,a)=>{const t=(0,n.nm)(),{api:i}=t,{collaborators:r,type:o}=s,[d,c]=(0,ne.CQ)({count:0,error:null,loading:!1,members:null,page:1,page_size:10,search_term:"",show:!1,success:null}),h=()=>{c({show:!0},()=>{m()})},u=(0,l.useRef)(null);(0,l.useImperativeHandle)(a,()=>({show:h}));const m=async()=>{var a,t,l,n;const{organization_id:r}=s;c({loading:!0,members:null});try{let e=null,s=0,h=null;switch(o){case"challenge":h=await i.get("/api/challenge-templates/collaborators/list/"+d.page+"/"+d.page_size,{organization_id:r,search_term:d.search_term}),e=null===(a=h)||void 0===a?void 0:a.members,s=null===(t=h)||void 0===t?void 0:t.count;break;case"journey":h=await i.get("/api/group-assignment-templates/collaborators/list/"+d.page+"/"+d.page_size,{organization_id:r,search_term:d.search_term}),e=null===(l=h)||void 0===l?void 0:l.members,s=null===(n=h)||void 0===n?void 0:n.count}c({count:s,loading:!1,members:e})}catch(e){c({error:e,loading:null})}},g=()=>{const{onHide:e}=s;"function"==typeof e&&e(),c({error:null,loading:!1,show:!1,success:null})},{count:p,error:x,loading:v,members:f,page:j,page_size:_,search_term:b,success:A}=d;return(0,N.jsxs)(ue.A,{show:d.show,size:"lg",onHide:()=>{g()},children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,children:(0,N.jsx)(ue.A.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add user",id:"label.add_user.eec5c73a"})})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,show:x,variant:"danger",onClose:()=>{c({error:null})},children:x}),(0,N.jsx)(We.A,{dismissible:!0,show:A,variant:"success",onClose:()=>{c({success:null})},children:(0,N.jsx)(ke.A,{defaultMessage:"Successfully added user",id:"label.successfully_added_user.1e59575c"})}),v&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!v&&f&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search for user by name or email...",value:b,onChange:e=>{var s;c({search_term:e.target.value}),s=e.target.value,u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{c({page:1,search_term:s},()=>{m()})},1e3)}})]}),(0,N.jsxs)(ho,{textResize:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{style:{width:30}}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsxs)(ho.Tbody,{children:[f.map(e=>{var a,t;const l=e.user||l,n=null===l||void 0===l?void 0:l.fullname,d=null===l||void 0===l||null===(a=l.default_email)||void 0===a?void 0:a.email_address,h=(null===l||void 0===l||null===(t=l.avatar)||void 0===t?void 0:t.location)||Wa,u=(e=>(0,T.find)(r,s=>{let{user_id:a}=s;return e.id===a}))(l);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"px-1",children:(0,N.jsx)("img",{alt:"",className:"rounded-circle",src:h,style:{height:25,width:25}})}),(0,N.jsx)(ho.Td,{children:n}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:d||"-"}),(0,N.jsx)(ho.Td,{className:"text-end px-1",children:(0,N.jsx)(ve.A,{disabled:u,onClick:()=>{(async e=>{const{stub_id:a}=s,t=1;try{c({loading:!0,success:!1});let s=null;switch(o){case"challenge":s=await i.get(`/api/challenge-templates/collaborators/add/${a}`,{organization_member_id:e,role:t});break;case"journey":s=await i.get(`/api/group-assignment-templates/collaborators/add/${a}`,{organization_member_id:e,role:t})}c({loading:!1,success:!0},()=>{g()})}catch(err){c({error:err,loading:!1})}})(e.id)},children:(0,N.jsx)(ke.A,{defaultMessage:"Add",description:"",id:"label.add.9fd728c6"})})})]},l.id)}),0===f.length&&(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No users found.",id:"label.no_users_found.ce0171e5"})})})]})]}
2),(0,N.jsx)(Lr,{count:p,page:j,page_size:_,onChange:e=>{c({page:e},()=>{m()})}})]})]}),(0,N.jsx)(ue.A.Footer,{children:(0,N.jsx)(ve.A,{disabled:v,variant:"secondary",onClick:()=>{g()},children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})});var qF=YF;var JF=e=>{const s=(0,P.nm)(),{api:a,user:t}=s,{type:i}=e,[n,r]=(0,ne.CQ)({loading:!1,sort_direction:"",sort_token:""}),o=(0,l.useRef)(),{contributors:d,refreshStub:c}=e,{loading:h,sort_direction:u,sort_token:m}=n,g=t.id,p={EDITOR:1,OWNER:0},x=(e=>{const s=(0,T.find)(d,s=>s.user_id===e);return s&&s.role===p.EDITOR})(g);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ho,{defaultSortDirection:u,defaultSortToken:m,onSort:(e,s)=>{r({sort_direction:s,sort_token:e})},children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Date added",id:"label.date_added.3321b9f6"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Permissions",id:"label.permissions.abccc78c"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:h,children:null!==d&&void 0!==d&&d.length?(0,N.jsx)(N.Fragment,{children:d.map((t,l)=>{var n;const{created_at:d,role:c,user:h}=t,{fullname:u}=h,m=(null===h||void 0===h||null===(n=h.default_email)||void 0===n?void 0:n.email_address)||"",g=d?ci()(d).calendar():"N/A";return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsxs)(ho.Td,{children:[(0,N.jsx)(Ya,{user:h}),(0,N.jsxs)("div",{className:"d-inline-block ms-2",style:{verticalAlign:"middle"},children:[(0,N.jsx)("div",{children:u}),m&&(0,N.jsx)("div",{className:"text-secondary",children:m})]})]}),(0,N.jsx)(ho.Td,{className:"truncate__email",hiddenBelow:"lg",children:g}),(0,N.jsxs)(ho.Td,{hiddenBelow:"lg",children:[0==c&&(0,N.jsx)(ke.A,{defaultMessage:"Owner",description:"",id:"label.owner.4b1b8aa3"}),1==c&&(0,N.jsx)(ke.A,{defaultMessage:"Editor",description:"",id:"label.editor.936a161c"})]}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[s.userIsSiteAdmin()&&(0,N.jsxs)(ve.A,{disabled:x,size:"sm",variant:"outline-secondary",onClick:e=>{e.preventDefault(),(e=>{o.current.showModal(e)})(t)},children:[(0,N.jsx)(ze.uO9,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit role",id:"label.edit_role.70542"})]}),(0,N.jsxs)(ve.A,{disabled:x,size:"sm",variant:"outline-danger",onClick:s=>{s.preventDefault(),(async t=>{if(!window.confirm("Are you sure you want to remove this contributor?"))return;const{refreshStub:l}=e,{id:n}=t;try{r({loading:!0});let e=null;switch(i){case"challenge":const{challenge_template_stub_id:s}=t;e=await a.get(`/api/challenge-templates/collaborators/remove/${s}`,{id:n});break;case"journey":const{group_assignment_template_stub_id:i}=t;e=await a.get(`/api/group-assignment-templates/collaborators/remove/${i}`,{id:n})}r({loading:!1,success:!0},()=>{l()})}catch(s){r({error:s,loading:!1})}})(t)},children:[(0,N.jsx)(ze.qbC,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})]})]})})]},`${l}`)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No collaborators found.",id:"label.no_collaborators_found.54de06bf"})})})})]}),(0,N.jsx)(ZF,{ref:o,type:i,onHide:()=>{c()}})]})};const XF=(0,l.forwardRef)((s,a)=>{const{formatMessage:t}=(0,ja.A)(),{api:i,locale:n}=(0,P.nm)(),{onHide:r,type:o}=s,[d,c,h]=(0,ne.CQ)({contributor:null,error:null,saving:!1,show:!1}),u=e=>{c(s=>(0,F.A)((0,F.A)({},s),{},{contributor:e,error:null,saving:!1,show:!0}))};(0,l.useImperativeHandle)(a,()=>({showModal:u}));const m=()=>{c({show:!1}),"function"==typeof r&&r()},{contributor:g,error:p,saving:x,show:v}=d;return(0,N.jsx)(ue.A,{onHide:()=>{m()},show:v,children:(0,N.jsx)(ds.l1,{initialValues:{role:null===g||void 0===g?void 0:g.role},onSubmit:(s,a)=>(async s=>{const{contributor:a}=d,{challenge_template_stub_id:t,group_assignment_template_stub_id:l,user_id:n}=a;c(e=>(0,F.A)((0,F.A)({},e),{},{error:null,saving:!0}));try{let e=null;switch(o){case"challenge":e=await i.get(`/api/challenge-templates/collaborators/edit/${t}`,{role:s,user_id:n});break;case"journey":e=await i.get(`/api/group-assignment-templates/collaborators/edit/${l}`,{role:s,user_id:n})}c(e=>(0,F.A)((0,F.A)({},e),{},{saving:!1}),()=>{m()})}catch(e){c(a=>(0,F.A)((0,F.A)({},a),{},{error:e,saving:!1}))}})(s.role),validationSchema:(0,Re.by)({locale:n,scope:"content_authoring.collaborator_role"}),children:e=>{let{dirty:s,errors:a,handleChange:i,handleSubmit:l,isSubmitting:n,touched:r,values:o}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,children:(0,N.jsx)(ue.A.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Edit role",id:"label.edit_role.70542"})})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{c(e=>(0,F.A)((0,F.A)({},e),{},{error:null}))},show:p,variant:"danger",children:p}),(0,N.jsx)(_e.A,{onSubmit:l,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsxs)(_e.A.Select,{disabled:x,isInvalid:r.role&&a.role,isValid:r.role&&!a.role,name:"role",onChange:i,value:o.role,children:[(0,N.jsx)("option",{value:0,children:t({id:"label.owner.4b1b8aa3",defaultMessage:"Owner"})}),(0,N.jsx)("option",{value:1,children:t({id:"label.editor.936a161c",defaultMessage:"Editor"})})]}),(0,N.jsx)(ds.Kw,{name:"role",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})]}),(0,N.jsxs)(ue.A.Footer,{children:[(0,N.jsx)(ve.A,{disabled:x,onClick:m,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:x,onClick:l,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})})});var ZF=XF;const $F=(0,l.forwardRef)((e,s)=>{var a,t;const{onHide:i}=e,[n,r,o]=(0,ne.CQ)({edit_version_description:!1,edit_version_title:!1,loading:!0,reject:null,resolve:null,show:!1,template:null}),d=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((a,t)=>{r({hide_make_primary:(null===s||void 0===s?void 0:s.hide_make_primary)||!1,reject:t,resolve:a,show:!0,template:e})})},c=()=>{n.resolve(null),o(),"function"===typeof i&&i()};(0,l.useImperativeHandle)(s,()=>({hide:c,show:d}));const h=(0,ds.Wx)({enableReinitialize:!0,initialValues:{make_primary:!1,version_description:(null===(a=n.template)||void 0===a?void 0:a.version_description)||"",version_title:(null===(t=n.template)||void 0===t?void 0:t.ver
2sion_title)||""},onSubmit:e=>{const{make_primary:s,version_description:a,version_title:t}=e;(e=>{n.resolve(e),c()})({make_primary:s,version_description:a,version_title:t})}}),{handleChange:u,handleSubmit:m,resetForm:g,values:p}=h,{edit_version_description:x,edit_version_title:v,hide_make_primary:f,show:j,template:_}=n;return(0,N.jsxs)(xe,{onHide:c,show:j,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{children:['Publish "',null===_||void 0===_?void 0:_.version_title,'" ']})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(ds.QI,{value:h,children:(0,N.jsxs)(_e.A,{onSubmit:m,children:[(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Version name",id:"label.version_name.c5be1c55"})}),(0,N.jsxs)("div",{className:(v?"d-none":"d-flex")+" align-items-center text-secondary",children:[null===p||void 0===p?void 0:p.version_title,(0,N.jsx)(ve.A,{style:{color:"var(--gray-100)"},variant:"link",onClick:e=>{r({edit_version_title:!0})},children:(0,N.jsx)(ze.F7,{})})]}),(0,N.jsx)(_e.A.Control,{className:(!1===v?"d-none":"")+" mt-1",name:"version_title",onBlur:()=>r({edit_version_title:!1}),onChange:u,type:"text",value:p.version_title}),(0,N.jsx)("div",{className:"body-medium mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Description of changes",id:"label.description_of_changes.b73fb4ce"})}),(0,N.jsxs)("div",{className:(x?"d-none":"d-flex")+" align-items-center text-secondary",children:[p.version_description||"Add small description of change(s) to this version.",(0,N.jsx)(ve.A,{style:{color:"var(--gray-100)"},variant:"link",onClick:e=>{r({edit_version_description:!0})},children:(0,N.jsx)(ze.F7,{})})]}),(0,N.jsx)(_e.A.Control,{as:"textarea",className:(!1===x?"d-none":"")+" mt-1",name:"version_description",onChange:u,placeholder:"Add small description of change(s) to this version.",type:"text",value:p.version_description,onBlur:()=>{r({edit_version_description:!1})}}),!f&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("div",{className:"border-light w-100 my-4",style:{border:"1px solid",height:1}}),(0,N.jsxs)("div",{className:"d-flex",children:[(0,N.jsx)(_e.A.Check,{inline:!0,checked:p.make_primary,id:"publish-journeymodal-stub-details-checkbox",name:"make_primary",onChange:u,type:"checkbox"}),(0,N.jsxs)("div",{children:[(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Make primary version",i
2d:"label.make_primary_version.42ee7fc0"})}),(0,N.jsx)("div",{className:"body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"Make this the default version for new assignments",id:"label.make_this_the_default_version_for.e0b0e398"})})]})]})]}),(0,N.jsxs)("div",{className:"w-100 d-flex justify-content-end",style:{marginTop:32},children:[(0,N.jsx)(ve.A,{className:"me-3",variant:"light",onClick:()=>{g(),c()},children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsxs)(ve.A,{type:"submit",children:[(0,N.jsx)(ze.uoG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Publish",id:"label.publish.859390eb"})]})]})]})})})]})});$F.displayName="PublishTemplateModal";var eR=$F;const sR=e=>{let{active:s,label:a,payload:t}=e;const i=t&&t[0]&&t[0].value?t[0].value:"";return s&&t?(0,N.jsx)("div",{className:"bar-has-bg-tooltip",children:(0,N.jsx)("p",{className:"label m-0",children:`${aR(a)} : ${i}`})}):null},aR=e=>{switch(e){case"1C":return"Critical Thinking";case"2C":return"Communication";case"3C":return"Collaboration";case"4C":return"Creativity"}};function tR(e){let{app:s,bars:a,data:t,legend:i,responsive_height:l,responsive_width:n,tooltip:r,y_axis_domain:o}=e;const{styles:d}=s,c=d&&d.primary,h=d&&d.secondary;return(0,N.jsx)(jt.u,{className:"bar-chart-has-bg",height:l,width:n,children:(0,N.jsxs)(_t.E,{data:t,children:[(0,N.jsx)(bt.d,{strokeDasharray:"3 3"}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{domain:o,width:10}),r&&(0,N.jsx)(wt.m,{content:(0,N.jsx)(sR,{})}),i&&(0,N.jsx)(Nt.s,{}),a&&a.map(e=>{const{dataKey:s}=e;return(0,N.jsx)(St.y,{background:h,dataKey:s,fill:c,radius:[4,4,0,0]},s)})]})})}tR.defaultProps={bars:[{background:{fill:"rgb(209,229,236)"},dataKey:"score",fill:"rgb(19,126,189)"}],chart_height:300,chart_width:500,data:[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}],legend:!1,responsive_height:"100%",responsive_width:"100%",tooltip:!0,y_axis_domain:[0,4]};var iR=(0,n.G0)(tR),lR=t(933);var nR=s=>{var a,t;const i=(0,P.nm)(),{api:n,locale:r,userHasRight:o,userIsSiteAdmin:d}=i,c=(0,Pe.W6)(),{formatMessage:h}=(0,ja.A)(),{stub_id:u}=(0,Pe.g)(),[m,g]=(0,ne.CQ)({active_key:"active",copied:!1,deleted:!1,efficacy:null,end_date:ci()().toDate().getTime(),error:null,loading:!0,resume_editing:!1,start_date:ci()().subtract(1,"month").toDate().getTime(),stub:null}),p=(0,l.useRef)(null),x=(0,l.useRef)(null),v=(0,l.useRef)(null),f=(0,l.useRef)(null),j=(0,l.useRef)(null),_=(0,l.useRef)(null),b=(0,l.useRef)(null),A=(0,l.useRef)(null),y=(0,l.useRef)(null),{completion:w,deleted:S,efficacy:C,end_date:M,error:k,loading:z,resume_editing:T,start_date:I,stub:E}=m,F=(null===E||void 0===E?void 0:E.current)||{},{audiences:R,author_avatar_image_path:D,author_name:B,certification_template:L,is_primary:O,subjects:H,title:U,total_est_completion_time:Q,total_learners_assigned:V,updated_at:G,version_title:W}=F,K=()=>new Promise((e,s)=>{n.get(`/api/challenge-templates/stub/${u}`).then(s=>{let{stub:a}=s;g({resume_editing:0===a.current.published,stub:a},()=>{e()})}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;s(a)})}),Y=()=>{const e=m.stub&&m.stub.primary_key_id;if(!e)return;let{end_date:s,start_date:a}=m;return a=ci()(a).toISOString(),s=ci()(s).toISOString(),new Promise((t,i)=>{n.get("/api/challenge-templates/stats/efficacy/"+e,{end_date:s,start_date:a}).then(e=>{g({efficacy:e},()=>{t()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i(s)})})},q=()=>{const e=m.stub&&m.stub.primary_key_id;if(!e)return;let{end_date:s,start_date:a}=m;return a=ci()(a).toISOString(),s=ci()(s).toISOString(),new Promise((t,i)=>{n.get("/api/challenge-templates/stats/completion/"+e,{end_date:s,start_date:a}).then(e=>{g({completion:e},()=>{t()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i(s)})})},J=async e=>{var s,a;if(!$(e))return;let t=!1;e||(e=m.stub.current,t=!0);const i=await(null===(s=b.current)||void 0===s?void 0:s.show(e,{hide_make_primary:t}));if(!i)return;const{make_primary:l,version_description:r,version_title:o}=i;g({loading:!0}),n.post("/api/challenge-templates/publish/"+(null===(a=e)||void 0===a?void 0:a.id),{make_primary:l,version_description:r,version_title:o}).then(async e=>{let{challenge_template:s}=e;g({loading:!1}),await K()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})})},X=async()=>{try{g({loading:!0}),await K(),await Y(),await q(),g({loading:!1})}catch(e){g({error:e,loading:!1})}},Z=e=>{e&&F&&(g({loading:!0}),n.post(`/api/tags/association/delete/${e}`).then(()=>{g({loading:!1}),X()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})}
2))},$=s=>{const a=(0,Re.by)({locale:r,scope:"content_authoring.challenge_editor.full_template"});if(!a||!s)return!1;try{return a.validateSync(s),!0}catch(e){return!1}},ee=new URLSearchParams((0,Pe.zy)().search);(0,l.useEffect)(()=>{ee.get("copied")&&g({copied:!0})},ee),(0,l.useEffect)(()=>{X()},[]);const se=ci()(G).calendar(),ae=E&&E.organization,te=null===F||void 0===F||null===(a=F.stub)||void 0===a?void 0:a.tags,ie=$(F);return(0,N.jsxs)(yT,{children:[(0,N.jsx)(Ce.S,{className:"admin-challenge-stub-page",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:k,variant:"danger",children:k}),(0,N.jsx)(Me.x_,{loading:z,children:S?(0,N.jsxs)(Ce.S,{className:"deleted-notice d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)("h4",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge deleted successfully.",id:"label.challenge_deleted_successfully.ca2ddcd4"})}),d()?(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/home#library",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Library",id:"label.return_to_library.554d8dd9"})]}):(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/admin/challenge-templates",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Design Lab",id:"label.return_to_design_lab.fa853fe0"})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(vF.A,{className:"mt-4",children:[!d()&&(0,N.jsx)(pa.mu,{to:"/admin/challenge-templates",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Design lab",id:"label.design_lab.9055ff21"})})}),d()&&(0,N.jsx)(pa.mu,{to:"/admin#library",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Site",id:"label.site.fa795581"})})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge editor",id:"label.challenge_editor.9ad7fa13"})})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)("h1",{className:"m-0",children:U})}),(0,N.jsxs)(Ve.A,{className:"d-flex justify-content-end",lg:6,children:[(0,N.jsx)(ve.A,{className:"d-inline-block ms-auto align-self-center",disabled:0==F.published,onClick:async()=>{const{stub:e}=m,s=null===e||void 0===e?void 0:e.current,a=null===j||void 0===j?void 0:j.current;if(!a||!s)return;const{assignment:t}=await a.show({component:s,component_type:"challenge"})||{};t&&c.push(`/admin/group/${null===t||void 0===t?void 0:t.group_id}/assignment/${null===t||void 0===t?void 0:t.id}`)},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Assign challenge",description:"",id:"label.assign_challenge.808f7730"})}),(0,N.jsxs)(Le.Link,{className:"btn btn-primary d-inline-flex align-items-center align-self-center ms-2",to:`/admin/content-authoring/challenge/${null===E||void 0===E?void 0:E.id}/${null===F||void 0===F?void 0:F.id}/0`,children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(ve.A,{className:"ms-2 d-inline-flex align-items-center align-self-center",variant:"primary",onClick:async()=>{const e=null===p||void 0===p?void 0:p.current;e&&e.show({actions:[e.Action({label:h({id:"label.cancel.19766ed6",defaultMessage:"Cancel"}),variant:"secondary"}),e.Action({label:h({id:"label.copy_challenge.d171e53c",defaultMessage:"Copy challenge"}),onClick:()=>function(e){let s=null;g({loading:!0}),(i.userIsFacilitator()||i.userIsOrgAdmin())&&(s=i.getUserOrganizationId()),n.get("/api/challenge-templates/copy/"+e,{organization_id:s}).then(e=>{let{challenge_template:s,stub:a}=e;g({copied:!0,loading:!1}),c.push(`/admin/challenge-template/${a.id}`)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})})}(null===E||void 0===E?void 0:E.id),variant:"primary"})],body:h({id:"label.are_you_sure_you_want_to_copy_this.2f853eed",defaultMessage:"Are you sure you want to copy this challenge?"}),size:"sm",title:h({id:"label.copy_challenge.d171e53c",defaultMessage:"Copy challenge"})})},children:[(0,N.jsx)(ze.paH,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Copy",description:"",id:"label.copy.e21f935f"})]}),!V&&(0,N.jsxs)(ve.A,{className:"ms-2 d-inline-flex align-items-center align-self-center",onClick:async()=>{const e=null===p||void 0===p?void 0:p.current;e&&(V||await e.show({actions:[e.CancelAction(),e.Action({label:h({id:"label.delete_challenge.da83620f",defaultMessage:"Delete challenge"}),onClick:async()=>await(async()=>{try{g({loading:!0}),await n.post(`/api/challenge-templates/delete/stub/${u}`),g({deleted:!0,loading:!1,stub:null})}catch({err:err}){g({error:err,loading:!1})}})(),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this challenge?",id:"label.are_you_sure_you_want_to_delete_th.6a8e5914"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can't be und
2one.",id:"label.this_action_cant_be_undone.b1b3fc4b"})})]}),title:h({id:"label.delete_challenge.da83620f",defaultMessage:"Delete challenge"})}))},variant:"danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({copied:!1}),show:m.copied,variant:"success",children:(0,N.jsx)("h6",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge copied successfully.",id:"label.challenge_copied_successfully.3e6a8bfc"})})}),T&&(0,N.jsxs)(Ce.S,{className:"challenge-not-published",children:[(0,N.jsx)(Ce.S,{className:"dismiss-toggle",children:(0,N.jsx)(ve.A,{onClick:()=>g({resume_editing:!1}),style:{padding:12},variant:"light",children:(0,N.jsx)(ze.QCr,{})})}),(0,N.jsx)("h5",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge not published",id:"label.challenge_not_published.4e81d889"})}),(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Publish this challenge to make it available to facilitators via the catalog",id:"label.publish_this_challenge_to_make_it.4e0b8db6"})}),(0,N.jsxs)(ve.A,{className:"d-inline-block",disabled:!ie,onClick:()=>J(F),children:[(0,N.jsx)(ze.uoG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish challenge",id:"label.publish_challenge.d58a7aef"})]}),(0,N.jsxs)(Le.Link,{className:"btn btn-secondary btn-xl ms-2",to:`/admin/content-authoring/challenge/${u}/${null===E||void 0===E||null===(t=E.current)||void 0===t?void 0:t.id}`,children:[(0,N.jsx)(ze.F7,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Keep editing",id:"label.keep_editing.e76fd2ad"})]})]}),(0,N.jsx)(Ce.S,{body:!0,style:{marginTop:47},children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-baseline",children:[(0,N.jsx)("h3",{className:"d-inline-block",style:{marginRight:24},children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge details",id:"label.challenge_details.be6df044"})}),(0,N.jsx)("div",{className:"d-flex",children:(0,N.jsx)(bo.A,{bg:"gray-alt",className:"d-inline-block",children:se})})]}),B&&(0,N.jsxs)(Ce.S,{style:{marginBottom:10,marginTop:10},children:[D&&(0,N.jsx)(Ce.S,{style:{display:"inline-block",verticalAlign:"middle"},children:(0,N.jsx)("img",{alt:"",className:"img-circle",src:D,style:{height:30,width:30}})}),(0,N.jsxs)(Ce.S,{style:{display:"inline-block",marginLeft:10,verticalAlign:"middle"},children:[(0,N.jsx)(Ce.S,{className:"heading",style:{fontSize:14,fontWeight:500,lineHeight:"20px"},children:B}),(0,N.jsx)("small",{className:"text-muted",style:{lineHeight:"16px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})})]})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(qa.A,{className:"table-borderless mb-0",size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top",width:125},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})})})}),(0,N.jsx)("td",{children:(0,N.jsxs)("p",{className:"body d-inline-block",children:[W," ",O&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Primary",id:"label.primary.efe10c80"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{className:"d-inline-block body",children:F.total_learners_assigned})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Subjects",id:"label.subjects.1a7529ab"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:!(null===H||void 0===H||!H.length)&&H.map((e,s)=>{var a;const t=null===e||void 0===e||null===(a=e.subjects)||void 0===a?void 0:a.name,i=s+1===H.length;return(0,N.jsx)(l.Fragment,{children:t&&(0,N.jsxs)("span",{className:i?"":"me-2",children:[t,i?"":","]},`${s}-${t}`)},s)})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",id:"label.duration.4fc52a3c"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:(0,N.jsx)(Vh,{duration:Q,label_type:"long",unit:"minutes"})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Audience",id:"label.audience.545c0235"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:!(null===R||void 0===R||!R.length)&&R.map((e,s)=>{var a;const t=null===e||void 0===e||null===(a=e.audiences)||void 0===a?void 0:a.name,i=s+1===R.length;return t?(0,N.jsxs)("span",{className:i?"":"me-2",children:[t,i?"":","]},`${s}-${t}`):(0,N.jsx)(N.Fragment,{})})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})})})}),(0,N.jsx)("td",{children:(0,N.jsxs)("p",{children:[ae?(0,N.jsxs)(N.Fragment,{children:[null===ae||void 0===ae?void 0:ae.name," ",o("manage_organization",ae.id)?(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===ae||void 0===ae?void 0:ae.id}`,children:(0,N.jsx)(ve.A,{className:"ms-1",size:"sm",variant:"secondary",children:(0,N.jsx)(ze.EQc,{className:"align-baseline",size:12.5})})}):null===ae||void 0===ae?void 0:ae.name]}):(0,N.jsx)(ze.Eh_,{className:"text-primary"}),o("manage_challenge")&&(0,N.jsx)(ve.A,{className:"ms-1",onClick:()=>{const{stub:e}=m;f.current.show({body:"Select an organization to make the owner of this challenge. Note: Existing users will not lose access.",preselected_organization_id:null===e||void 0===e?void 0:e.organization_id})},size:"sm",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:L?(0,N.jsx)(N.Fragment,{children:d()?(0,N.jsx)(Le.Link,{className:"fw-semibold",target:"_blank",to:`/admin/certification-template/${L.certification_template_stub_id}`,children:L.title}):(0,N.jsx)("strong",{children:L.title})}):(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No certification attached",id:"label.no_certification_attached.448e21e9"})})})})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center mb-3",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),o("manage_organization",null===ae||void 0===ae?void 0:ae.id)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{ref:A,variant:"primary",onClick:()=>{y.current.show()},children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Apply tags",id:"label.apply_tags.68bc4cb4"})]}),(0,N.jsx)(To,{onSelect:async e=>{e&&F&&(g({loading:!0}),n.post(`/api/tags/association/add/${null===e||void 0===e?void 0:e.id}`,{selections:[{component_id:null===F||void 0===F?void 0:F.id,type:"challenge"}]}).then(()=>{g({loading:!1}),X()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})}
2))},organization_id:(null===E||void 0===E?void 0:E.organization_id)||null,ref:y,target:A,onRemove:e=>{}})]})]}),!(null===te||void 0===te||!te.length)&&te.map(e=>{let{id:s,tag:a}=e;return(0,N.jsx)(Co,{onRemove:()=>(e=>{const s=null===p||void 0===p?void 0:p.current;s&&s.show({actions:[s.CancelAction(),s.OKAction({onClick:()=>Z(e)})],body:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this tag?",id:"label.are_you_sure_you_want_to_delete_th.6e645b48"})})})(s),size:"lg",tag:a},s)}),(!te||!te.length)&&(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})]})]})}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how your challenge will appear to facilitators via the catalog",id:"label.heres_how_your_challenge_will_appe.22fdd4e1"})}),(0,N.jsx)(Kh,{component:F,type:"challenge"})]})})]})}),(0,N.jsx)(Ce.S,{style:{marginTop:61},children:(0,N.jsxs)("h3",{children:[(0,N.jsx)(ke.A,{defaultMessage:"User metrics",id:"label.user_metrics.f9aba01e"}),(0,N.jsxs)(ve.A,{className:"float-end",variant:"primary",onClick:()=>{v.current&&v.current.show({end_date:M,start_date:I})},children:[ci()(I).format("MMM DD, YYYY")," - ",ci()(M).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{className:"user-metrics",children:[(0,N.jsx)(Ve.A,{lg:12,xl:6,children:(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:61},children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge use",id:"label.challenge_use.81e9ffe1"})}),(0,N.jsx)(vR,{challenge_template_id:null===F||void 0===F?void 0:F.id,end_date:M,start_date:I})]})}),(0,N.jsx)(Ve.A,{md:4,xl:2,children:(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:61},children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Completion rate",id:"label.completion_rate.85a9d6f4"})})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h1",{className:"d-inline-block",children:w&&null!==w.completion_rate?w.completion_rate+"%":"N/A"}),(0,N.jsx)(Sz.default,{className:"float-end",fontSize:40}),(0,N.jsx)(Sa.A,{now:w&&null!==w.completion_rate?w.completion_rate:0}),(0,N.jsxs)(Ce.S,{style:{fontSize:14,fontWeight:400,marginTop:16},children:[(0,N.jsx)("span",{className:"me-2",children:w?w.total_completed:"-"}),(0,N.jsx)("span",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners completed",id:"label.learners_completed.49ff3db9"})}),(0,N.jsx)("br",{}),(0,N.jsx)("span",{className:"me-2",children:w?w.total_in_progress:"-"}),(0,N.jsx)("span",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners in progress",id:"label.learners_in_progress.a2435e22"})})]})]})}),(0,N.jsx)(Ve.A,{md:4,xl:2,children:(0,N.jsx)(Ge.A,{body:!0,style:{marginBottom:61},children:(0,N.jsxs)(Ce.S,{className:"w-100",children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Efficacy",id:"label.efficacy.cdf0c3f1"})})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h1",{className:"d-inline-block me-2",children:C&&null!==C.average?C.average:"N/A"}),C&&null!==C.average&&(0,N.jsx)("h3",{className:"percent-change d-inline-block me-2",children:"/ 4.0"}),(0,N.jsx)(iR,{responsive_height:100,responsive_width:"100%",data:C?[{amt:4,name:"1C",score:Number(C.critical)},{amt:4,name:"2C",score:Number(C.communication)},{amt:4,name:"3C",score:Number(C.collaboration)},{amt:4,name:"4C",score:Number(C.creativity)}]:null})]})})}),(0,N.jsx)(Ve.A,{md:4,xl:2,children:(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:61},children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Average score",id:"label.average_score.e4870be7"})})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h1",{className:"d-inline-block",children:w&&null!==w.average_score?w.average_score+"%":"N/A"}),(0,N.jsx)(lR.default,{className:"float-end text-primary",fontSize:40}),(0,N.jsx)(Dt,{barSize:5,color:"purple",customScoreLabel:(0,N.jsx)(ze.uCC,{className:"text-primary",size:40}),label:!1,value:w&&null!==w.average_score?w.average_score:"N/A"})]})})]}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Manage versions",id:"label.manage_versions.f461c6ca"})}),(0,N.jsx)(oR,{onNewVersion:async()=>{try{var e;const s=await(null===(e=_.current)||void 0===e?void 0:e.show());if(!s)return;const{template:a,values:t}=s;g({loading:!0});const{challenge_template:i}=await n.post("/api/challenge-templates/version/create/"+a.id,{title:t.title,version_description:t.version_description,version_title:t.version_title});c.push(`/admin/content-authoring/challenge/${u}/${null===i||void 0===i?void 0:i.id}`),g({loading:!1})}catch(k){g({error:k,loading:!1})}},onPublishVersion:J,stub_id:null===E||void 0===E?void 0:E.id,validateTemplate:$}),!(null===E||void 0===E||!E.organization_id)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{marginTop:61},children:(0,N.jsxs)("h3",{children:[(0,N.jsxs)(ve.A,{className:"float-end",onClick:()=>{const{contributors:e,stub:s}=m;x.current.show(s.id,e)},style:{textDecoration:"none"},variant:"link",children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}}),(0,N.jsx)(ke.A,{defaultMessage:"Add collaborators",id:"label.add_collaborators.9906a14d"})]}),(0,N.jsx)(ke.A,{defaultMessage:"Manage collaborators",id:"label.manage_collaborators.361afb60"})]})}),(0,N.jsx)("hr",{}
2),(0,N.jsx)(JF,{contributors:null===E||void 0===E?void 0:E.contributors,refreshStub:K,stub_id:null===E||void 0===E?void 0:E.id,type:"challenge"})]})]})})]})}),(0,N.jsx)(Xw,{onRef:e=>{v.current=e},onSelect:e=>{let{end_date:s,start_date:a}=e;g({end_date:s,start_date:a}),Y(),q()}}),(0,N.jsx)(yR,{ref:_,stub_id:u}),(0,N.jsx)(eR,{ref:b,type:"journey"}),(0,N.jsx)(qF,{collaborators:null===E||void 0===E?void 0:E.contributors,onHide:K,organization_id:null===E||void 0===E?void 0:E.organization_id,ref:x,stub_id:null===E||void 0===E?void 0:E.id,type:"challenge"}),(0,N.jsx)(NR,{ref:f,onSubmit:e=>{(e=>{const{stub:s}=m;g({loading:!0}),n.post(`/api/challenge-templates/stub/set/organization/${null===s||void 0===s?void 0:s.id}`,{organization_id:e}).then(()=>{g({loading:!1}),K()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})})})(e||null)}}),(0,N.jsx)(cc,{ref:j}),(0,N.jsx)(je,{ref:p})]})};var rR=e=>{const{deleteVersion:s,handleArchive:a,handleRestore:t,handleSort:i,makeVersionPrimary:l,primary:n,promptNewVersionName:r,publishVersion:o,sort_direction:d,sort_token:c,stub_id:h,validateTemplate:u,versions:m}=e,g=(0,Pe.W6)();return(0,N.jsxs)(ho,{defaultSortDirection:d,defaultSortToken:c,onSort:i,textResize:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"completed",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})}),(0,N.jsx)(ho.Th,{className:"text-center",hiddenBelow:"md",children:(0,N.jsx)(ke.A,{defaultMessage:"Healthy links",id:"label.healthy_links.e15dca0f"})}),(0,N.jsx)(ho.Th,{className:"text-center",hiddenBelow:"md",children:(0,N.jsx)(ke.A,{defaultMessage:"Unhealthy links",id:"label.unhealthy_links.b2af95dd"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{children:null!==m&&void 0!==m&&m.length?(0,N.jsx)(N.Fragment,{children:m.map(e=>{let{id:i,num_healthy_links:d,num_unhealthy_links:c,published:m,stub:p,title:x,total_learners_assigned:v,total_learners_completed:f,total_learners_started:j,updated_at:_,version_description:b,version_title:A}=e,y=n.id==e.id;const w=u(e),S=!y&&0===m&&w,C=ci()(_).calendar();return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)("span",{children:x})}),(0,N.jsx)(ho.Td,{className:"text-center",children:b?(0,N.jsx)(Ua.A,{placement:"top",trigger:"hover",overlay:(0,N.jsx)(Qa.A,{children:b}),children:(0,N.jsx)("div",{children:A})}):(0,N.jsx)(N.Fragment,{children:A})}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(KF,{primary:i===(null===p||void 0===p?void 0:p.primary_key_id),published:1===m})}),(0,N.jsx)(ho.Td,{className:"text-center",children:v}),(0,N.jsx)(ho.Td,{className:"text-center",children:j}),(0,N.jsx)(ho.Td,{className:"text-center",children:f}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"md",children:d||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"md",children:c||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:C}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[S&&(0,N.jsxs)(ve.A,{onClick:()=>o(e),size:"sm",variant:"outline-success",children:[(0,N.jsx)(ze.uoG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish",id:"label.publish.859390eb"})]}),!y&&1===m&&(0,N.jsxs)(ve.A,{onClick:()=>l(i),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.CMH,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})]}),(0,N.jsxs)(ve.A,{onClick:()=>g.push(`/admin/content-authoring/challenge/${h}/${i}/0`),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(ve.A,{onClick:()=>r(e),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.p2D,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})]}),2===m&&(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-success",onClick:s=>{s.preventDefault(),t(e.id)},children:[(0,N.jsx)(ze.OKX,{className:"me-1"}
2),(0,N.jsx)(ke.A,{defaultMessage:"Restore",id:"label.restore.a76e13b9"})]}),!y&&1===m&&(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-danger",onClick:s=>{s.preventDefault(),a(e.id)},children:[(0,N.jsx)(ze.Wlj,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Archive",id:"label.archive.66f4804e"})]}),0===m&&!y&&(0,N.jsxs)(ve.A,{onClick:()=>s(i),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.qbC,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},i)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"10",children:(0,N.jsx)(ke.A,{defaultMessage:"No versions found.",id:"label.no_versions_found.2e724551"})})})})]})};var oR=s=>{const{onNewVersion:a=null,onPublishVersion:t=null,stub_id:i,validateTemplate:n}=s,{formatMessage:r}=(0,ja.A)(),{api:o}=(0,P.nm)(),[d,c]=(0,ne.CQ)({archived:[],error:null,loading:!1,primary:null,sort_direction:"ASC",sort_token:"title",stub:null,tab:"active",versions:[]}),h=(0,l.useRef)(null),u=()=>{if(!i)return;const{sort_direction:e,sort_token:s}=d;return new Promise((a,t)=>{o.get(`/api/challenge-templates/stub/versions/${i}`,{sort_direction:e,sort_token:s}).then(e=>{let{archived:s,primary:t,stub:i,versions:l}=e;c({archived:s,primary:t,stub:i,versions:l},()=>{a()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1},()=>{t(s)})})})},m=async s=>{try{if(!s)return;c({loading:!0}),await o.post("/api/challenge-templates/archive",{challenge_template_id:s}),await u(),c({loading:!1,tab:"archived"})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},g=async s=>{try{if(!s)return;c({loading:!0}),await o.post("/api/challenge-templates/restore",{challenge_template_id:s}),await u(),c({loading:!1,tab:"active"})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},p=(e,s)=>{c({loading:!0}),o.post("/api/challenge-templates/version/rename/"+e,{title:s}).then(async e=>{let{challenge_template:s}=e;await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})})};(0,l.useEffect)(()=>{u()},[i]);const{archived:x,error:v,loading:f,primary:j,sort_direction:_,sort_token:b,tab:A,versions:y}=d,w={deleteVersion:e=>{e&&window.confirm(r({id:"label.are_you_sure_you_want_to_delete_th.714a9e3a",defaultMessage:"Are you sure you want to delete this version? After you delete a version, you may no longer access it."}))&&(c({loading:!0}),o.post("/api/challenge-templates/delete/"+e).then(async()=>{await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})}))},handleArchive:e=>{const s=null===h||void 0===h?void 0:h.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Archive",onClick:()=>m(e),variant:"danger"})],body:r({id:"label.are_you_sure_you_want_to_archive_t.846e3369",defaultMessage:"Are you sure you want to archive this version?"}),title:r({id:"label.confirm_archival.d808a9a3",defaultMessage:"Confirm archival"})})},handleRestore:e=>{const s=null===h||void 0===h?void 0:h.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Restore",onClick:()=>g(e),variant:"primary"})],body:r({id:"label.are_you_sure_you_want_to_restore_t.29c412e3",defaultMessage:"Are you sure you want to restore this version?"}),title:r({id:"label.confirm_restoration.18736f66",defaultMessage:"Confirm restoration"})})},handleSort:async(e,s)=>{c({sort_direction:s,sort_token:e},async()=>await u())},makeVersionPrimary:e=>{e&&window.confirm(r({id:"label.are_you_sure_you_want_to_make_this.a8ccf029",defaultMessage:"Are you sure you want to make this version the primary?"}))&&(c({loading:!0}),o.get("/api/challenge-templates/primary/"+e).then(async e=>{let{challenge_template:s}=e;await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})}
2))},primary:j,promptNewVersionName:e=>{const s=null===h||void 0===h?void 0:h.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:r({id:"label.rename.3064d79a",defaultMessage:"Rename"}),onClick:()=>{const a=s.getInputValue();if(!a||!a.length||a.length>64)return window.alert(r({id:"label.invalid_challenge_title_provided.e65450e5",defaultMessage:"Invalid challenge title provided"})),!1;p(e.id,a)},variant:"danger"})],body:r({id:"label.provide_a_name_for_this_version.f2cafea2",defaultMessage:"Provide a name for this version"}),prompt:s.TextPrompt({initialValue:e?e.version_title:""}),size:"sm",title:r({id:"label.rename_version.c098ca09",defaultMessage:"Rename version"})})},publishVersion:async e=>{"function"==typeof t&&t(e)},sort_direction:_,sort_token:b,stub_id:i};return(0,N.jsxs)(Ce.S,{className:"admin-challenge-stub-versions-table",children:[f&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})})}),(0,N.jsx)(We.A,{dismissible:!0,show:v,variant:"danger",onClose:()=>{c({error:null})},children:v}),!f&&(0,N.jsxs)(Ce.S,{className:"position-relative",children:[(0,N.jsxs)(ld.A.Container,{mountOnEnter:!0,defaultActiveKey:"active",id:"challenge-stub-versions-table-tabs",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>{c({tab:"active"})},children:(0,N.jsx)(aa.A.Link,{active:"active"==A,eventKey:"active",href:"#active",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",description:"",id:"label.active.92340695"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>{c({tab:"archived"})},children:(0,N.jsx)(aa.A.Link,{active:"archived"===A,eventKey:"archived",href:"#archived",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",description:"",id:"label.archived.bdb86505"})})})]}),(0,N.jsx)("div",{className:"position-absolute",style:{right:0,top:0},children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:async e=>{"function"===typeof a&&a()},style:{textDecoration:"none"},variant:"link",children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}})," NEW VERSION"]})})]}),(0,N.jsx)(rR,(0,F.A)((0,F.A)({},w),{},{validateTemplate:n,versions:"active"===A?y:x}))]}),(0,N.jsx)(je,{ref:h})]})};t(23489);const dR=t(17643);function cR(e,s){return e=Math.ceil(e),s=Math.floor(s),Math.floor(Math.random()*(s-e)+e)}const hR=[];for(let e=0;e<30;e++)hR.push({amt:1e4,name:dR().subtract(e,"days").format("MMM Do"),"Users Online":cR(1,1e4)}
2);function uR(e){let{height:s,name:a,stroke:t}=e;const i=s/2*-1;return(0,N.jsx)("text",{dy:-4,fill:t,fontSize:14,style:{fill:"#141414",fontWeight:500},textAnchor:"middle",transform:"rotate(-90)",x:i,y:20,children:a})}function mR(e){let{color:s,cx:a,cy:t}=e;return(0,N.jsxs)("svg",{children:[(0,N.jsx)("circle",{cx:a,cy:t,fill:s,opacity:.2,r:"12.5",strokeWidth:"2"}),(0,N.jsx)("circle",{cx:a,cy:t,fill:"white",r:"6",stroke:`${s}`,strokeWidth:"2"})]})}hR.reverse();const gR=e=>{let{active:s,custom_tooltip_label_1:a,label:t,name:i,payload:l}=e;const n=l&&l[0]&&l[0].value?l[0].value:"";return s&&l?(0,N.jsxs)("div",{className:"solvably-graph-tooltip",children:[(0,N.jsx)("p",{className:"name m-0",children:a||i}),(0,N.jsx)("p",{className:"date m-0 mb-2",children:t}),l[0]&&(0,N.jsx)("p",{className:"number m-0 mb-2",children:n})]}):null};function pR(e){let{color:s,custom_tooltip_label_1:a,data:t,dep_label:i,height:l,legend:n,margin:r,width:o}=e;return t?(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{style:{height:l,width:o},children:(0,N.jsx)(jt.u,{height:"100%",width:"100%",children:(0,N.jsxs)(Vw.b,{data:t,margin:r,children:[(0,N.jsx)(bt.d,{stroke:"#d1d1d1",vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name"}),n&&(0,N.jsx)(Nt.s,{}),(0,N.jsx)(yt.h,{label:(0,N.jsx)(uR,{height:l,name:i})}),(0,N.jsx)(wt.m,{content:(0,N.jsx)(gR,{custom_tooltip_label_1:a,name:i})}),(0,N.jsx)(Gw.N,{activeDot:(0,N.jsx)(mR,{color:s}),dataKey:i,dot:!1,stroke:s,strokeWidth:3,type:"monotone"})]})})})}):(0,N.jsx)(Ce.S,{children:"N/A"})}pR.defaultProps={color:"#008087",custom_tooltip_label_1:null,data:hR,dep_label:"Users Online",height:350,legend:!1,margin:{bottom:0,left:5,right:5,top:5},width:"100%"};var xR=pR;var vR=e=>{const s=(0,n.nm)(),{api:a}=s,[t,i]=(0,ne.CQ)({error:null,graph_data:null,loading:!1}),r=async()=>{try{let{challenge_template_id:s,end_date:t,start_date:l}=e;if(!s)return;l=ci()(l).toISOString(),t=ci()(t).toISOString(),i({loading:!0});let{results:n}=await a.get(`/api/challenge-templates/stats/usage/${s}`,{end_date:t,start_date:l});n=Array.isArray(n)?n:[];const r=[];for(let e=0;e<n.length;e++){const s=n[e];r.push({Hours:s,name:ci()(l).add(e,"days").format("MMM Do")})}i({graph_data:r,loading:!1})}catch({err:err}){i({error:err,loading:!1})}};(0,l.useEffect)(()=>{r()},[e.challenge_template_id,e.start_date,e.end_date]),(0,l.useEffect)(()=>{r()},[]);const{error:o,graph_data:d,loading:c}=t;return(0,N.jsxs)(Me.x_,{loading:c,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>i({error:null}),show:o,variant:"danger",children:t.error}),d?(0,N.jsx)(xR,{custom_tooltip_label_1:"Hours on Challenge",data:d,dep_label:"Hours",height:160}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center text-muted h-100",children:(0,N.jsx)(ke.A,{defaultMessage:"No usage data found",id:"label.no_usage_data_found.fc502edf"})})]})};class fR extends l.Component{constructor(e){super(e),this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.viewLinkDetails)},this.state={count:0,error:null,filter:"",loading:!1,page:1,page_size:20,results:[]}}viewLinkDetails(){const{app:e,challenge_template_id:s}=this.props,a=e.api,{filter:t,sort_direction:i,sort_token:l}=this.state;this.setState({loading:!0,results:null}),a.get("/api/reports/links/get/"+s+"/"+this.state.page+"/"+this.state.page_size,{link_filter:t,sort_direction:i,sort_token:l}).then(e=>{let{count:s,results:a}=e;this.setState({count:s,loading:!1,results:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}handleHide(){"function"==typeof this.props.onHide&&this.props.onHide()}render(){const{intl:e,show:s}=this.props,{loading:a,results:t}=this.state;return(0,N.jsxs)(ue.A,{backdrop:"static",onHide:()=>{this.handleHide()},onShow:()=>{this.viewLinkDetails()},show:s,size:"lg",children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,children:(0,N.jsx)(ue.A.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Link health",id:"label.link_health.191251b4"})})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:3,children:(0,N.jsxs)("select",{className:"form-control mb-3",onChange:e=>{this.setState({filter:e.target.value},()=>
2this.viewLinkDetails())},value:this.state.filter,children:[(0,N.jsx)("option",{children:e.formatMessage({id:"label.all.a52ace42",defaultMessage:"All"})}),(0,N.jsx)("option",{value:"working",children:e.formatMessage({id:"label.working.a92f0449",defaultMessage:"Working"})}),(0,N.jsx)("option",{value:"broken",children:e.formatMessage({id:"label.broken.cab6a859",defaultMessage:"Broken"})}),(0,N.jsx)("option",{value:"other",children:e.formatMessage({id:"label.other.f97e9da0",defaultMessage:"Other"})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsxs)(ho,{defaultSortDirection:this.state.sort_direction,defaultSortToken:this.state.sort_token,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"challenge_template",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge template",id:"label.challenge_template.b8476b56"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"link_src",children:(0,N.jsx)(ke.A,{defaultMessage:"Link",id:"label.link.a6a32dbc"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"status",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"section",children:(0,N.jsx)(ke.A,{defaultMessage:"Section",id:"label.section.dfca5da5"})})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:a,children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:t.map(e=>{let s=e.challenge_template,a=e.link_src,t=e.section,i=e.http_status_code,l="";return"200"==i?l="success":0==i?l="danger":200!=i&&(l="warning"),(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)("a",{href:`/admin/challenge-template/${null===s||void 0===s?void 0:s.id}`,target:"_blank",children:null===s||void 0===s?void 0:s.title})}),(0,N.jsx)(ho.Td,{style:{maxWidth:"350px"},children:(0,N.jsx)("a",{href:a,target:"_blank",children:a})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(bo.A,{pill:!0,bg:l,children:0==i?"Error":i})}),(0,N.jsx)(ho.Td,{children:t})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No results Found",id:"label.no_results_found.756384dc"})})})})]}),(0,N.jsx)(Lr,{count:this.state.count,onChange:e=>this.setState({page:e},this.viewLinkDetails),page:this.state.page,page_size:this.state.page_size})]})})]})]})}}(0,Ke.Ay)((0,P.G0)(_T(fR)));const jR=ul.Ik().shape({description_of_change:ul.Yj(),title:ul.Yj().min(5,"Title must be more than 4 characters long").max(100,"Title must be less than 100 characters long").required("Title required"),version_title:ul.Yj().min(1,"Version name must be at least 1 characters long").max(10,"Version name must be less than 10 characters long").required("Version name required")}),_R=(0,l.forwardRef)((e,s)=>{var a,t;const{handleCreateVersion:i=Function(),handlePrevious:n=Function(),onHide:r,showModal:o}=e,[d,c,h]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1});(0,l.useEffect)(()=>{null!=e.template&&c({template:e.template})},[e.template]);const{show:u}=d,m=(0,ds.Wx)({enableReinitialize:!0,initialValues:{title:null!==(a=null===e||void 0===e||null===(t=e.template)||void 0===t?void 0:t.title)&&void 0!==a?a:"",version_description:"",version_title:""},onSubmit:e=>{i(e)},validationSchema:jR}),{errors:g,handleChange:p,handleSubmit:x,touched:v,values:f}=m,j=e=>new Promise((s,a)=>{c({reject:a,resolve:s,show:!0,template:e})}),_=()=>{"function"===typeof(null===d||void 0===d?void 0:d.resolve)&&d.resolve(null),h(),"function"===typeof r&&r()};return(0,l.useImperativeHandle)(s,()=>({hide:_,show:j})),(0,N.jsxs)(xe,{onHide:_,show:u||o,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Version details",id:"label.version_details.c05702e1"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)("div",{className:"d-flex align-items-center mb-3",style:{backgroundColor:"var(--gray-200)",color:"var(--primary)",padding:"16px 8px 16px 21px"},children:[(0,N.jsx)(ze.ELu,{style:{marginRight:17}})," ",(0,N.jsx)("span",{style:{color:"var(--black)"},children:"This version will remain unpublished by default"})]}),(0,N.jsx)(ds.QI,{value:m,children:(0,N.jsxs)(_e.A,{noValidate:!0,onSubmit:x,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Journey title"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"title",className:"form-control",isInvalid:v.title&&g.title,isValid:v.title&&!g.title,name:"title",onCh
2ange:p,type:"text",value:f.title}),g.title&&v.title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:g.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Version name"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"version_title",className:"form-control",name:"version_title",onChange:p,placeholder:"E.g. 1.2",type:"text",value:f.version_title,isInvalid:v.version_title&&g.version_title,isValid:v.version_title&&!g.version_title}),g.version_title&&v.version_title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:g.version_title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Description of changes",description:"",id:"label.description_of_changes.b73fb4ce"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Description of changes",as:"textarea",className:"form-control",name:"version_description",onChange:p,placeholder:"Describe the changes made in this version",rows:4,value:f.version_description,isInvalid:v.version_description&&g.version_description,isValid:v.version_description&&!g.version_description})]}),(0,N.jsxs)(os,{className:"d-flex justify-content-between mb-0 align-items-center",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:n,variant:"secondary",children:[(0,N.jsx)(ze.QVr,{style:{marginRight:8}})," ",(0,N.jsx)(ke.A,{defaultMessage:"PREVIOUS",description:"",id:"label.previous.08d90c23"})]}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"CREATE VERSION",description:"",id:"label.create_version.64c203a1"})})]})]})})]})]})});_R.displayName="NewVersionDetailsModal";var bR=_R;const AR=(0,l.forwardRef)((e,s)=>{const{onHide:a,stub_id:t}=e,{api:i}=(0,P.nm)(),[n,r,o]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1,sort_direction:"ASC",sort_token:"title",step:0,template:null,versions:[]}),{loading:d,show:c,step:h,template:u,version_selected:m,versions:g}=n,p=e=>r({version_selected:e}),x=(0,l.useRef)(null),v=async()=>{try{r({loading:!0});const{versions:e}=await i.get("/api/challenge-templates/stub/versions/"+t,{sort_direction:n.sort_direction,sort_token:n.sort_token});r({loading:!1,versions:e})}catch(e){}};(0,l.useEffect)(()=>{n.show&&v()},[n.show]),(0,l.useEffect)(()=>{v()},[n.sort_token,n.sort_direction]);const f=e=>new Promise((e,s)=>{r({reject:s,resolve:e,show:!0})}),j=()=>{n.resolve(null),o(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:j,show:f}));return(0,N.jsxs)(N.Fragment,{children:[0===h?(0,N.jsxs)(xe,{dialogClassName:"new-challenge-version-modal",onHide:j,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select a version to start from",description:"",id:"label.select_a_version_to_start_from.241fd248"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(ho,{defaultSortDirection:n.sort_direction,defaultSortToken:n.sort_token,onSort:async(e,s)=>{r({sort_direction:s,sort_token:e}),await v()},children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"checkbox-col"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"completed",children:(0,N.jsx)("div",{className:"d-flex flex-nowrap",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:9,loading:d,children:g.map(e=>{const{id:s,published:a=null,stub:t=null,title:i,total_learners_assigned:l=0,total_learners_completed:n=0,total_learners_started:r=0,updated_at:o,version_title:d}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ho.Tr,{className:""+(m===s?"row-selected":""),onClick:()=>p(s),children:[(0,N.jsx)(ho.Td,{className:"checkbox-col",children:(0,N.jsx)(sy,{checked:m===s,id:s,type:"radio"})}),(0,N.jsx)(ho.Td,{className:"text-center",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,N.jsx)("span",{children:i})}),(0,N.jsx)(ho.Td,{className:"text-center",children:d}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(WF,{primary:s===(null===t||void 0===t?void 0:t.primary_key_id),published:1===a})}),(0,N.jsx)(ho.Td,{className:"text-center",children:l}),(0,N.jsx)(ho.Td,{className:"text-center",children:r}),(0,N.jsx)(ho.Td,{className:"text-center",children:n}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(Gh.XU,{value:o})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)(ve.A,{onClick:e=>(async(e,s)=>{var a;
2e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const{component:t}=await(null===(a=x.current)||void 0===a?void 0:a.show({component_id:s,selectable:!0,type:"challenge"}))||{};t&&p(null===t||void 0===t?void 0:t.id)})(e,s),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})})})]},s)})})})]}),(0,N.jsx)("div",{children:(0,N.jsx)("div",{className:"w-100 d-flex justify-content-end",children:(0,N.jsx)(ve.A,{disabled:d||!m,onClick:()=>{const e=n.versions.find(e=>e.id===m);r({step:1,template:e})},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})})})]})]}):(0,N.jsx)(bR,{handleCreateVersion:e=>(e=>{n.resolve(e),j()})({template:n.template,values:e}),handlePrevious:()=>r({step:0}),onHide:()=>{o()},showModal:0!==h,template:u}),(0,N.jsx)(Uh,{ref:x})]})});AR.displayName="NewVersionModal";var yR=AR;const wR=(0,l.forwardRef)((e,s)=>{const{excludedIds:a,onHide:t,onSubmit:i,returnType:n}=e,r=(0,l.useRef)(),[o,d,c]=(0,ne.CQ)({body:"",count:0,error:null,loading:!1,organization_ids:[],organizations:[],page:1,page_size:1e3,preselected_organization_id:void 0,reject:Function(),resolve:Function(),search_term:"",selected_organization_ids:[],show:!1,submitting:!1}),h=async e=>new Promise(async(s,a)=>{d({body:(null===e||void 0===e?void 0:e.body)||"",error:null,loading:!1,organization_ids:(null===e||void 0===e?void 0:e.organization_ids)||[],preselected_organization_id:null===e||void 0===e?void 0:e.preselected_organization_id,reject:a,resolve:s,show:!0}),m()}),u=()=>{o.resolve(),c(),"function"===typeof t&&t()},m=()=>{const e=null===r||void 0===r?void 0:r.current;e&&e.refresh()};(0,l.useImperativeHandle)(s,()=>({hide:u,show:h})),(0,l.useEffect)(()=>c,[]);const{body:g,error:p,loading:x,preselected_organization_id:v,show:f}=o;return(0,N.jsxs)(xe,{contentClassName:"px-0 pb-0",onHide:u,show:f,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select an organization",id:"label.select_an_organization.48326f52"})})}),(0,N.jsxs)(xe.Body,{className:"p-1",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:p,variant:"danger",children:p}),!!g&&(0,N.jsx)(Ce.S,{className:"d-flex flex-column px-3 pb-3",children:g}),(0,N.jsx)(Dc,{allowMultiSelect:!1,disableAll:x,excludedIds:a,exploded:!1,onSubmit:async e=>{d({loading:!0}),"function"===typeof i&&await i(e),d({loading:!1}),u()},preselectedOrganizationId:v,ref:r,returnType:n||"id",searchable:!0,selectorLabel:(0,N.jsx)(ze.Z0P,{}),selectorType:"button",submitOnSelect:!0})]})]})});wR.displayName="OrganizationPickerModal";var NR=wR;const SR=e=>{const{competency:s}=e,{created_at:a,name:t,organization:i,organization_id:n,rubric:r,usage_count:o}=s,{changeCompetencyOrganization:d,deleteCompetency:c,launchCompetencyWizard:h}=QF(),{formatMessage:u}=(0,ja.A)(),m=(0,l.useRef)(),g=(0,l.useRef)(),p=o>0;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center gap-3",children:(0,N.jsx)("strong",{children:t})})}),(0,N.jsx)(ho.Td,{children:n?(0,N.jsx)(bo.A,{bg:"info",children:(0,N.jsx)(ke.A,{defaultMessage:"Custom \u2014 {org}",id:"label.custom_org.2cab5734",values:{org:(null===i||void 0===i?void 0:i.name)||u({id:"label.organization.d764d425",defaultMessage:"Organization"})}})}):(0,N.jsx)(bo.A,{bg:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Global",id:"label.global.a258b30f"})})}),(0,N.jsx)(ho.Td,{children:Array.isArray(r)?(0,N.jsx)(ke.A,{defaultMessage:"Single",id:"label.single.8888a029"}):(0,N.jsx)(ke.A,{defaultMessage:"Multi ({subs} part)",id:"label.multi_subs_part.0a9b5e57",values:{subs:r?Object.keys(r).length:0}})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Gh.XU,{value:a})}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{onClick:()=>h(s),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit rubric",id:"label.edit_rubric.4f1560c2"})}),(0,N.jsx)(ve.A,{onClick:()=>{const e=null===g||void 0===g?void 0:g.current;e&&e.show({body:u({id:"label.select_the_organization_that_shoul.f598c535",defaultMessage:'Select the organization that should own "{name}". Choose Global to make it available to every tenant.'},{name:t}),preselected_organization_id:n||void 0})},size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change organization",id:"label.change_organization.bbe3b669"})}),(0,N.jsx)(ve.A,{disabled:p,onClick:()=>{const e=null===m||void 0===m?void 0:m.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:u({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:()=>c(s.id),variant:"danger"})],body:u({id:"label.are_you_sure_you_want_to_delete_na.db7e1f9d",defaultMessage:"Are you sure you want to delete {name}? This action cannot be undone."},{name:t}),size:"sm",title:u({id:"label.delete_competency.7dfcb963",defaultMessage:"Delete competency"})})},size:"sm",title:p?u({id:"label.used_by_count_certifications.897e16ea",defaultMessage:"Used by {count} certification(s)"},{count:o}):"",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})}),(0,N.jsx)(NR,{onSubmit:e=>d({competency_id:s.id,organization_id:e||null}),ref:g}),(0,N.jsx)(je,{ref:m})]})};const CR=(0,l.forwardRef)((s,a)=>{const{createCompetency:t,searchCompetencies:i,updateCompetency:n,updateCompetencyOrganization:r}=QF(),{formatMessage:o}=(0,ja.A)(),[d,c,h]=(0,ne.CQ)({competency:null,editing:!1,error:null,loading:!1,organization:null,organization_id:null,original_organization_id:null,rubric:null,step:0,type:null,visible:!1}),{competency:u,editing:m,error:g,loading:p,organization:x,organization_id:v,original_organization_id:f,rubric:j,step:_,type:b,visible:A}=d,y=(0,l.useRef)(),w=(0,l.useRef)(),S=function(){!(arguments.length>0&&void 0!==arguments[0]&&arguments[0])&&i(),h()},C=async()=>{try{c({loading:!0});const{competency:e,organization_id:s,rubric:a}=d,{name:i}=e||{};await t({name:i,organization_id:s,rubric:a}),S()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},M=_<1,k=_>0,z={addConstraint:e=>{let{level:s,sub:a=null}=e;const{rubric:t}=d,i=a&&t[a],l=a?null===i||void 0===i?void 0:i[s]:null===t||void 0===t?void 0:t[s];if(Array.isArray(l)){switch(b){case"single":t[s]=[...l,""];break;case"multi":i[s]=[...l,""];break;default:return}c({rubric:t})}},changeConstraint:e=>{let{index:s,level:a,sub:t,value:i}=e;const{rubric:l}=d,n=t&&l[t],r=(null===n||void 0===n?void 0:n[a])||(null===l||void 0===l?void 0:l[a]);Array.isArray(r)&&"string"===typeof(null===r||void 0===r?void 0:r[s])&&(r[s]=i,c({rubric:l}))},clearError:()=>c({error:null}),competency:u,confirmCompetencyCreation:()=>{const e=null===y||void 0===y?void 0:y.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:o({id:"label.create.4759498a",defaultMessage:"Create"}),onClick:C,variant:"primary"})],body:o({id:"label.please_ensure_the_competency_name.5f2576aa",defaultMessage:"Please ensure the competency name is correct, you will not be able to edit or remove it once created."}),size:"sm",title:"Confirm creation"})},editing:m,error:g,has_next:M,has_prev:k,hide:S,isRubricValid:()=>{const{rubric:e}=d,s=e=>null===e||void 0===e?void 0:e.every(e=>Array.isArray(e)&&e.length>0&&e.every(e=>Boolean(null===e||void 0===e?void 0:e.trim())));return"single"===b?Array.isArray(e)&&e.length>0&&s(e):e&&Object.keys(e).length>0&&Object.values(e).every(e=>Array.isArray(e)&&e.length>0&&s(e))},launchOrganizationPicker:()=>{const e=null===w||void 0===w?void 0:w.current;e&&e.show({body:m?"Select an organization to own this competency. Note: only Site Admins can move it back to Global.":"Select an organization to own this competency. Choose Global to make it available across the platform.",preselected_organization_id:v||void 0})},loading:p,next:()=>M&&c({step:_+1}),organization:x,organization_id:v,persistRubric:async()=>{const s=null===u||void 0===u?void 0:u.id,a=j,t=v,i=v!==f;c({loading:!0});try{await n({competency_id:s,rubric:a}),i&&await r({competency_id:s,organization_id:t})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;return void c({error:a,loading:!1})}S()},prev:()=>k&&c({step:_-1}),removeConstraint:e=>{let{index:s,level:a,sub:t=null}=e;const{rubric:i}=d,l=t&&i[t],n=(null===l||void 0===l?void 0:l[a])||(null===i||void 0===i?void 0:i[a]);if(!Array.isArray(n)||"string"!==typeof(null===n||void 0===n?void 0:n[s]))return;const r=n.filter((e,a)=>a!==s);t?i[t][a]=r:i[a]=r,c({rubric:i})},rubric:j,setState:c,show:async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{competency:s=null}=e,a=(null===s||void 0===s?void 0:s.organization_id)||null;c({competency:s,editing:!!s,organization:(null===s||void 0===s?void 0:s.organization)||null,organization_id:a,original_organization_id:a,rubric:(null===s||void 0===s?void 0:s.rubric)||[[""],[""],[""],[""]],step:s?1:0,type:(null===s||void 0===s?void 0:s.type)||"single",visible:!0})},step:_,type:b,visible:A};(0,l.useImperativeHandle)(a,()=>(0,F.A)({},z));const T=TR[_]||l.Fragment;return(0,N.jsxs)(kR,{value:(0,F.A)({},z),children:[(0,N.jsxs)(xe,{onHide:()=>S(!1),show:A,size:"lg",children:[(0,N.jsx)(T,{}),(0,N.jsx)(IR,{}),(0,N.jsx)(je,{ref:y})]}),(0,N.jsx)(NR,{onSubmit:e=>{const s=(null===e||void 0===e?void 0:e.id)||null;c({organization:e||null,organization_id:s})},ref:w,returnType:"object"})]})});CR.displayName="CompetencyWizard";const MR=(0,l.createContext)({}),kR=MR.Provider,zR=(MR.Consumer,()=>(0,l.useContext)(MR));var TR=[e=>{const{competency:s,launchOrganizationPicker:a,organization:t,organization_id:i,setState:l}=zR();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{className:"d-flex gap-1",children:(0,N.jsx)("span",{className:"fw-normal",children:(0,N.jsx)(ke.A,{defaultMessage:"New competency",id:"label.new_competency.f7aac9b3"})})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(_e.A,{children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{name:"name",onChange:e=>l({competency:(0,F.A)((0,F.A)({},s),{},{name:e.target.value})}),value:(null===s||void 0===s?void 0:s.name)||""})]}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Owner",id:"label.owner.4b1b8aa3"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[i?(0,N.jsxs)(bo.A,{bg:"info",className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.ymh,{size:11}),(null===t||void 0===t?void 0:t.name)||`Organization #${i}`]}):(0,N.jsxs)(bo.A,{bg:"secondary",className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.Eh_,{size:11}),(0,N.jsx)(ke.A,{defaultMessage:"Global",id:"label.global.a258b30f"})]}),(0,N.jsx)(ve.A,{onClick:a,size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Global competencies are visible to every tenant. Org-owned competencies are only visible within that organization.",id:"label.global_competencies_are_visible_to.d10541f8"})})]})]})})]})},e=>{const{clearError:s,competency:a,editing:t,error:i,launchOrganizationPicker:n,organization:r,organization_id:o,rubric:d,type:c}=zR();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{className:"d-flex gap-1",children:[(0,N.jsx)("span",{className:"fw-normal flex-shrink-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit rubric |",id:"label.edit_rubric_or.35105925",values:{name:null===a||void 0===a?void 0:a.name}})}),(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.name})]})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:s,show:i,variant:"danger",children:i}),t&&(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Owner",id:"label.owner.4b1b8aa3"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[o?(0,N.jsxs)(bo.A,{bg:"info",className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.ymh,{size:11}),(null===r||void 0===r?void 0:r.name)||`Organization #${o}`]}):(0,N.jsxs)(bo.A,{bg:"secondary",className:"d-flex align-items-center gap-1",children:[(0,N.jsx)(ze.Eh_,{size:11}),(0,N.jsx)(ke.A,{defaultMessage:"Global",id:"label.global.a258b30f"})]}),(0,N.jsx)(ve.A,{onClick:n,size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change owner",id:"label.change_owner.2877dfbf"})})]})]}),"single"===c?(0,N.jsx)(yl.A,{className:"bg-light d-flex",children:!!d&&d.map((e,s)=>(0,N.jsx)(ER,{ind:s,level:e},s))}):(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-3",children:!!d&&Object.entries(d).map((e,s)=>{var a;let[t,i]=e;return(0,N.jsxs)(l.Fragment,{children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{children:t}),(0,N.jsx)(yl.A,{className:"bg-light",children:i.map((e,s)=>(0,N.jsx)(ER,{ind:s,level:e,sub:t},s))})]}),s<(null===(a=Object.keys(i))||void 0===a?void 0:a.length)-1&&(0,N.jsx)("hr",{})]},s)})})]})]})}];const IR=()=>{const{competency:e,confirmCompetencyCreation:s,editing:a,has_next:t,has_prev:i,hide:l,isRubricValid:n,loading:r,next:o,persistRubric:d,prev:c}=zR();return(0,N.jsxs)(xe.Footer,{children:[i&&!a?(0,N.jsx)(ve.A,{disabled:!i,onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}):(0,N.jsx)(ve.A,{onClick:l,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),t?(0,N.jsx)(ve.A,{disabled:!a&&!(null!==e&&void 0!==e&&e.name),onClick:o,children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})}):(0,N.jsx)(N.Fragment,{children:a?(0,N.jsx)(Me.p0,{disabled:!n(),loading:r,onClick:d,children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})}):(0,N.jsx)(Me.p0,{disabled:!n(),loading:r,onClick:s,children:(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"})})})]})},ER=e=>{const{ind:s,level:a,sub:t}=e,{addConstraint:i,changeConstraint:n,loading:r,removeConstraint:o}=zR(),d=(0,l.useRef)(),{formatMessage:c}=(0,ja.A)(),h=e=>{let{level:s}=e;switch(s){case 1:return(0,N.jsx)(ke.A,{defaultMessage:"Basic",id:"label.basic.0e35f6e9"});case 2:return(0,N.jsx)(ke.A,{defaultMessage:"Emerging",id:"label.emerging.96341c76"});case 3:return(0,N.jsx)(ke.A,{defaultMessage:"Strong",id:"label.strong.30a04fdc"});case 4:return(0,N.jsx)(ke.A,{defaultMessage:"Exemplary",id:"label.exemplary.f897ad1b"})}};return(0,N.jsxs)(yl.A.Item,{className:"d-flex gap-3 py-3 flex-column fw-semibold lead",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(h,{level:s+1})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-fill flex-column gap-1 p-0",children:[!(null===a||void 0===a||!a.length)&&a.map((e,a)=>(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:r,readOnly:r,rows:2,value:e,onCh
2ange:e=>{var i;return n({index:a,level:s,sub:t,value:null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.value})}}),(0,N.jsx)(ve.A,{"aria-label":"Remove constraint",className:"text-danger",variant:"secondary",onClick:()=>(e=>{const s=null===d||void 0===d?void 0:d.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:c({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:()=>o(e),variant:"danger"})],body:c({id:"label.are_you_sure_you_want_to_remove_th.c9efe801",defaultMessage:"Are you sure you want to remove this constraint?"}),size:"sm",title:c({id:"label.remove_constraint.fb8bb95f",defaultMessage:"Remove constraint"})})})({index:a,level:s,sub:t}),children:(0,N.jsx)(ze.QCr,{})})]},a)),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center justify-content-center gap-1",disabled:r,onClick:()=>i({level:s,sub:t}),variant:"secondary",children:[(0,N.jsx)(ke.A,{defaultMessage:"Add constraint",id:"label.add_constraint.728a4aa7"}),(0,N.jsx)(ze.OiG,{})]})]}),(0,N.jsx)(je,{ref:d})]},s)};var FR=s=>{const{api:a}=(0,P.nm)(),[t,i,n]=(0,ne.CQ)({certification_accreditors:[],count:0,error:null,loading:!1,page:1,page_size:20,search_term:"",sort_direction:"ASC",sort_token:"name"}),{certification_accreditors:r,count:o,error:d,loading:c,page:h,page_size:u,search_term:m,sort_direction:g,sort_token:p}=t,x=((0,l.useRef)(0),(0,l.useRef)()),v=async()=>{try{i({loading:!0});const{page:e,page_size:s,search_term:l,sort_direction:n,sort_token:r}=t,{certification_accreditors:o,count:d=0}=await a.post(`/api/certification-accreditors/search/${e}/${s}`,{search_term:l,sort_direction:n,sort_token:r});i({certification_accreditors:o,count:d,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}};(0,l.useEffect)(()=>{v()},[]);const f={certification_accreditors:r,createAccreditor:async function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{await a.post("/api/certification-accreditors/create",s),v()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}},deleteAccreditor:async s=>{try{i({loading:!0}),await a.post("/api/certification-accreditors/delete",{certification_accreditor_id:s}),i({loading:!1},v)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}},error:d,fetchAccreditors:v,handleSort:(e,s)=>i({page:1,sort_direction:s,sort_token:e},v),loading:c,search_term:m,sort_direction:g,sort_token:p,updateAccreditor:async function(s){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{await a.post(`/api/certification-accreditors/save/${s}`,t),v()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}}};return(0,N.jsxs)(DR,{value:(0,F.A)({},f),children:[(0,N.jsx)(Ce.S,{className:"accreditors-widget",children:(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certifying bodies",id:"label.certifying_bodies.e7ab414e"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>i({error:null}),show:d,variant:"danger",children:d}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)(_e.A,{onSubmit:e=>{e.preventDefault(),i({page:1},v)},style:{width:"40%"},children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(be.A,{disabled:c,onChange:e=>(e=>i({search_term:e}))(e.target.value),placeholder:"Search",readOnly:c}),(0,N.jsx)(ve.A,{diabled:c,type:"submit",children:(0,N.jsx)(ze.KSO,{})})]})}),(0,N.jsxs)(ve.A,{className:"d-flex justify-self-center align-items-center gap-1",disabled:c,onClick:()=>{const e=x.current;e&&e.show()},children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"New certifying body",id:"label.new_certifying_body.d563dd89"})})]})]}),(0,N.jsx)(PR,{}),(0,N.jsx)(Lr,{count:o,onChange:e=>i({page:e},v),page:h,page_size:u})]})})}),(0,N.jsx)(VR,{ref:x})]})};const RR=(0,l.createContext)({}),DR=RR.Provider,BR=(RR.Consumer,()=>
2(0,l.useContext)(RR));var PR=e=>{const{certification_accreditors:s,handleSort:a,loading:t,sort_direction:i,sort_token:l}=BR();return(0,N.jsxs)(ho,{rounded:!0,defaultSortDirection:i,defaultSortToken:l,hover:!(null===s||void 0===s||!s.length),onSort:a,children:[(0,N.jsxs)(ho.Thead,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:"Name"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"organization",children:"Organization"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"date",children:"Date created"}),(0,N.jsx)(ho.Th,{className:"text-end",children:"Actions"})]}),(0,N.jsx)(ho.Tbody,{cols:5,loading:t,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(LR,{certification_accreditor:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{colSpan:5,children:(0,N.jsx)("span",{className:"d-flex align-items-center justify-content-center text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No templates found",id:"label.no_templates_found.186e4883"})})})})})]})};var LR=e=>{const{certification_accreditor:s}=e,{certification_templates:a,created_at:t,is_universal:i,logo_path:n,name:r,organization:o}=s||{},{deleteAccreditor:d}=BR(),{formatMessage:c}=(0,ja.A)(),h=(0,l.useRef)(),u=(0,l.useRef)(),m=n||xo;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[i?(0,N.jsx)(fh,{tooltipPlacement:"bottom",tooltipContent:(0,N.jsx)(ke.A,{defaultMessage:"Available globally",id:"label.available_globally.46a4f311"}),children:(0,N.jsx)(ze.Eh_,{color:"var(--brand-primary)"})}):(0,N.jsx)(fh,{tooltipPlacement:"bottom",tooltipContent:(0,N.jsx)(ke.A,{defaultMessage:"Scoped to organization",id:"label.scoped_to_organization.f8d2ae2a"}),children:(0,N.jsx)(ze.ph9,{color:"var(--secondary)"})}),(0,N.jsx)(Me.R_,{rounded:!0,height:50,imageClassname:"border",imageHeight:50,imageStyle:{objectFit:"contain"},imageWidth:50,src:m,width:50}),(0,N.jsx)("strong",{children:r})]})}),(0,N.jsx)(ho.Td,{children:o?(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===o||void 0===o?void 0:o.id}`,children:null===o||void 0===o?void 0:o.name}):(0,N.jsx)("span",{className:"text-muted",children:"N/A"})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Gh.XU,{value:t})}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{disabled:1===(null===s||void 0===s?void 0:s.id),onClick:()=>{const e=h.current;e&&e.show({certification_accreditor:s})},size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})}),(0,N.jsx)(ve.A,{disabled:1===(null===s||void 0===s?void 0:s.id)||!(null===a||void 0===a||!a.length),onClick:()=>{const e=u.current;!e||null!==a&&void 0!==a&&a.length||e.show({actions:[e.CancelAction(),e.Action({label:"Delete",onClick:()=>d(s.id),variant:"danger"})],body:(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete {name} as an accreditor?",id:"label.are_you_sure_you_want_to_delete_na.b101420a",values:{name:(0,N.jsx)("strong",{children:r})}})}),(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can not be undone.",id:"label.this_action_can_not_be_undone.128d24d0"})})]}),size:"sm",title:c({id:"label.confirm_deletion.fa57243d",defaultMessage:"Confirm deletion"})})},size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})}),(0,N.jsx)(VR,{ref:h}),(0,N.jsx)(je,{ref:u})]})};const OR=["onHide","onSubmit"],HR=(0,l.forwardRef)((e,s)=>{const{onHide:a,onSubmit:t}=e,i=(0,he.A)(e,OR),{allowMultiSelect:n}=i,r=(0,l.useRef)(),[o,d,c]=(0,ne.CQ)({body:"",count:0,error:null,loading:!1,organization_ids:[],organizations:[],page:1,page_size:1e3,preselected_organization_id:void 0,reject:Function(),resolve:Function(),search_term:"",selected_organization_ids:[],show:!1,submitting:!1}),h=async e=>new Promise((s,a)=>{d({body:(null===e||void 0===e?void 0:e.body)||"",error:null,loading:!1,organization_ids:(null===e||void 0===e?void 0:e.organization_ids)||[],preselected_organization_id:null===e||void 0===e?void 0:e.preselected_organization_id,reject:a,resolve:s,show:!0}),m()}),u=()=>{o.resolve(),c(),"function"===typeof a&&a()},m=()=>{const e=null===r||void 0===r?void 0:r.current;e&&e.refresh()};(0,l.useImperativeHandle)(s,()=>({hide:u,show:h})),(0,l.useEffect)(()=>c,[]);const{body:g,error:p,loading:x,preselected_organization_id:v,show:f}=o;return(0,N.jsxs)(xe,{contentClassName:"px-0 pb-0",onHide:u,show:f,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:n?(0,N.jsx)(ke.A,{defaultMessage:"Select organizations",id:"label.select_organizations.6aaaef5d"}):(0,N.jsx)(ke.A,{defaultMessage:"Select an organization",id:"label.select_an_organization.48326f52"})})}),(0,N.jsxs)(xe.Body,{className:"p-1",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:p,variant:"danger",children:p}),!!g&&(0,N.jsx)(Ce.S,{className:"d-flex flex-column px-3 pb-3",children:g}
2),(0,N.jsx)(Dc,(0,F.A)({disableAll:x,onSubmit:async e=>{d({loading:!0}),"function"===typeof t&&await t(e),d({loading:!1}),u()},preselectedOrganizationId:v,ref:r},i))]})]})});HR.displayName="OrganizationPickerModal";var UR=HR;const QR=(0,l.forwardRef)((s,a)=>{var t,i,n;const{createAccreditor:r,fetchAccreditors:o,updateAccreditor:d}=BR(),c=(0,l.useRef)(),h=(0,l.useRef)(),u=(0,l.useRef)(),[m,g,p]=(0,ne.CQ)({certification_accreditor:null,error:null,loading:!1,mode:"new",organization:null,uploading:!1,visible:!1}),{certification_accreditor:x,error:v,loading:f,mode:j,organization:_,uploading:b,visible:A}=m,{api:y,locale:w}=(0,P.nm)(),{formatMessage:S}=(0,ja.A)(),C=(0,ds.Wx)({initialValues:{logo_path:null!==(t=null===x||void 0===x?void 0:x.logo_path)&&void 0!==t?t:"",name:null!==(i=null===x||void 0===x?void 0:x.name)&&void 0!==i?i:"",organization_id:null!==(n=null===x||void 0===x?void 0:x.organization_id)&&void 0!==n?n:void 0,signatory_name:(null===x||void 0===x?void 0:x.signatory_name)||"",signatory_signature_path:(null===x||void 0===x?void 0:x.signatory_signature_path)||"",signatory_title:(null===x||void 0===x?void 0:x.signatory_title)||""},onSubmit:async s=>{try{switch(g({loading:!0}),j){case"new":await r(s);break;case"edit":await d(null===x||void 0===x?void 0:x.id,s)}H(),o()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,loading:!1})}},validateOnBlur:!0,validateOnChange:!0,validationSchema:(0,Re.by)({locale:w,scope:"certification.add_accreditor"})}),{errors:M,handleChange:k,handleSubmit:z,resetForm:T,setFieldTouched:I,setFieldValue:E,touched:R,values:D}=C,B=e=>R[e]&&M[e]?M[e]:null,L=e=>(0,N.jsx)("small",(0,F.A)({className:"text-danger"},e)),O=async function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{certification_accreditor:a=null}=s;a&&(await E("name",(null===a||void 0===a?void 0:a.name)||""),await E("logo_path",(null===a||void 0===a?void 0:a.logo_path)||""),await E("organization_id",(null===a||void 0===a?void 0:a.organization_id)||void 0),await E("signatory_name",(null===a||void 0===a?void 0:a.signatory_name)||""),await E("signatory_title",(null===a||void 0===a?void 0:a.signatory_title)||""),await E("signatory_signature_path",(null===a||void 0===a?void 0:a.signatory_signature_path)||"")),g({certification_accreditor:a,mode:a?"edit":"new",organization:null!==(e=null===a||void 0===a?void 0:a.organization)&&void 0!==e?e:null,visible:!0})},H=()=>{p(),T()},U=async()=>{const e=null===c||void 0===c?void 0:c.current;e&&await e.show()};return(0,l.useImperativeHandle)(a,()=>({hide:H,show:O,visible:A})),(0,N.jsxs)(xe,{onHide:H,show:A,size:"lg",children:[(0,N.jsx)(ds.QI,{value:C,children:(0,N.jsxs)(_e.A,{onSubmit:z,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:"new"===j?(0,N.jsx)(ke.A,{defaultMessage:"New certifying body",id:"label.new_certifying_body.d563dd89"}):(0,N.jsx)(ke.A,{defaultMessage:"Edit certifying body",id:"label.edit_certifying_body.a9dce1c4"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:v,variant:"danger",children:v}),(0,N.jsxs)(Qe.A,{className:"gy-3",children:[(0,N.jsx)(Ve.A,{lg:6,xs:12,children:(0,N.jsxs)(Xl.A,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Certification name",isInvalid:(null===R||void 0===R?void 0:R.name)&&(null===M||void 0===M?void 0:M.name),isValid:(null===R||void 0===R?void 0:R.name)&&!(null!==M&&void 0!==M&&M.name),name:"name",onChange:k,value:null===D||void 0===D?void 0:D.name,placeholder:S({id:"label.ex_credably_certificates.3d635f61",defaultMessage:"ex. Credably Certificates"})}),B("name")&&(0,N.jsx)(L,{children:B("name")})]})}),(0,N.jsx)(Ve.A,{lg:6,xs:12,children:(0,N.jsxs)(Xl.A,{className:"d-flex flex-column",children:[(0,N.jsx)(_e.A.Label,{className:"d-flex gap-1",children:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})})}),_?(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(Fl,{inline:!0,as:"strong",maxWidth:300,placement:"bottom",children:_.name}),(0,N.jsx)(ve.A,{className:"p-0",onClick:U,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]}):(0,N.jsx)(ve.A,{onClick:U,variant:"secondary",style:{borderColor:M.organization_id&&"var(--danger)"},children:(0,N.jsx)(ke.A,{defaultMessage:"Select organization",id:"label.select_organization.99e5009d"})}),B("organization_id")&&(0,N.jsx)(L,{children:B("organization_id")})]})}),(0,N.jsx)(Ve.A,{lg:6,xs:12,children:(0,N.jsxs)(Xl.A,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"logo_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Logo",id:"label.logo.d707dc2f"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center",children:(0,N.jsx)(jN,{disabled:f||b,height:200,src:D.logo_path,uploadHandler:async()=>{try{const e=null===h||void 0===h?void 0:h.current;if(!e)return;const s=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;await E("logo_path",null===s||void 0===s?void 0:s.location),await I("logo_path",!0),setTimeout(async()=>{await C.validateForm()},0)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,uploading:!1})}},width:200})}),B("logo_path")&&(0,N.jsx)(L,{children:B("logo_path")})]})}),(0,N.jsx)(Ve.A,{lg:6,xs:12,children:(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)(Ge.A.Title,{children:"Signatory"})}),(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3",children:[(0,N.jsxs)(Xl.A,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"signatory_name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Signatory name",isInvalid:(null===R||void 0===R?void 0:R.signatory_name)&&(null===M||void 0===M?void 0:M.signatory_name),isValid:(null===R||void 0===R?void 0:R.signatory_name)&&!(null!==M&&void 0!==M&&M.signatory_name),name:"signatory_name",onChange:k,value:null===D||void 0===D?void 0:D.signatory_name,placeholder:S({id:"label.ex_dr_john_smith.517bfb8a",defaultMessage:"ex. Dr. John Smith"})}),B("signatory_name")&&(0,N.jsx)(L,{children:B("signatory_name")})]}),(0,N.jsxs)(Xl.A,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"signatory_title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Signatory title",isInvalid:(null===R||void 0===R?void 0:R.signatory_title)&&(null===M||void 0===M?void 0:M.signatory_title),isValid:(null===R||void 0===R?void 0:R.signatory_title)&&!(null!==M&&void 0!==M&&M.signatory_title),name:"signatory_title",onCh
2ange:k,value:null===D||void 0===D?void 0:D.signatory_title,placeholder:S({id:"label.ex_director_of_certifications.462e0fb8",defaultMessage:"ex. Director of Certifications"})}),B("signatory_title")&&(0,N.jsx)(L,{children:B("signatory_title")})]}),(0,N.jsxs)(Xl.A,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"signatory_signature_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Signature",id:"label.signature.f1a73e22"})}),(0,N.jsx)(jN,{disabled:f||b,height:!D.signatory_signature_path&&100,imageClassName:"p-2",src:D.signatory_signature_path,uploadHandler:async()=>{try{const e=null===u||void 0===u?void 0:u.current;if(!e)return;const s=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;await E("signatory_signature_path",null===s||void 0===s?void 0:s.location),await I("signatory_signature_path",!0),setTimeout(async()=>{await C.validateForm()},0)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,uploading:!1})}},width:"100%"}),B("signatory_signature_path")&&(0,N.jsx)(L,{children:B("signatory_signature_path")})]})]})]})})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:H,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{type:"submit",children:"new"===j?(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"}):(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})})]})]})}),(0,N.jsx)(UR,{allowGlobal:!1,excludedIds:_?[_.id]:[],onSubmit:async e=>{g({organization:e}),await E("organization_id",e.id)},preselected_organization_id:D.organization_id,ref:c,returnType:"object",selectorLabel:(0,N.jsx)(ze.Z0P,{}),selectorType:"button",submitOnSelect:!0}),(0,N.jsx)(TA,{aspectRatio:1,ref:h,uploadHandler:(e,s)=>{const a=`certification-accreditor-logo-${(0,me.A)()}.jpg`;return y.file("/api/certification-accreditors/upload/logo",{job_id:s},e,a)}}),(0,N.jsx)(TA,{aspectRatio:NaN,ref:u,uploadHandler:(e,s)=>{const a=`certification-accreditor-signature-${(0,me.A)()}.jpg`;return y.file("/api/certification-accreditors/upload/signature",{job_id:s},e,a)}})]})});QR.displayName="AccreditorEditorModal";var VR=QR;const GR=e=>{const{userIsFullSiteAdmin:s}=(0,P.nm)(),a=s(),[t,i,l]=(0,ne.CQ)({active_key:"requests",error:null,loading:!1}),{active_key:n}=t,r={active_key:n};return(0,N.jsx)(YR,{value:(0,F.A)({},r),children:(0,N.jsxs)(Ce.S,{className:"admin-certifications d-flex flex-column gap-3",children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:(0,N.jsxs)("h4",{className:"m-0 d-flex align-items-center gap-2",children:[(0,N.jsx)(Wh.QbB,{color:"var(--brand-primary)"}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})})]})}),(0,N.jsxs)(ld.A.Container,{activeKey:n,id:"admin-tabs",mountOnEnter:!0,role:"navigation",unmountOnExit:!0,children:[(0,N.jsxs)(aa.A,{activeKey:n,className:"flex-row tabs-primary",onSelect:e=>i({active_key:e}),variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"requests",children:[(0,N.jsx)(ze.aZA,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Requests",id:"label.requests.ada27592"})]})}),a&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"certifications",children:[(0,N.jsx)(ze.veT,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"certifying-bodies",children:[(0,N.jsx)(ze.dVW,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Certifying bodies",id:"label.certifying_bodies.e7ab414e"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"competencies",children:[(0,N.jsx)(ze.gt3,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Competencies",id:"label.competencies.ec64b47c"})]})})]})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"requests",children:(0,N.jsx)(bF,{})}),a&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"certifications",children:(0,N.jsx)(zF,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"certifying-bodies",children:(0,N.jsx)(FR,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"competencies",children:(0,N.jsx)(OF,{})})]})]})]})]})})};GR.displayName="AdminCertifications";var WR=GR;const KR=(0,l.createContext)({}),YR=KR.Provider;KR.Consumer;class qR extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.refreshOrganizations=()=>{var e;const s=null===(e=this.archive_filter)||void 0===e?void 0:e.current;if(!s)return;const{selected:a}=s,{app:t}=this.props,i=t.api,{page:l,page_size:n,search_term:r,sort_direction:o,sort_token:d}=this.state;this.setState({loading:!0,organizations:null}),i.get(`/api/organizations/list/${l}/${n}`,{filter_archived:a,search_term:r,sort_direction:o,sort_token:d}).then(e=>{let{count:s,organizations:a}=e;this.setState({count:s,loading:!1,organizations:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})},this.startSearch=e=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1,search_term:e},()=>{this.refreshOrganizations()})},1e3)},this.deleteOrganization=e=>{const{app:s,intl:a}=this.props,t=s.api;window.confirm(a.formatMessage({id:"label.are_you_sure_you_want_to_delete_th.3df4fbe8",defaultMessage:"Are you sure you want to delete this organization?"}))&&(this.setState({loading:!0,organizations:null}),t.get("/api/organizations/delete",{organization_id:e}).then(()=>{this.setState({loading:!1}),this.refreshOrganizations()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})}))},this.provisionOrganization=e=>this.provisioning_editor.show(e),this.handleChangeStatusFilter=()=>this.setState({page:1},this.refreshOrganizations),this.launchOrganizationEditor=()=>{var e;const s=null===this||void 0===this||null===(e=this.organization_editor)||void 0===e?void 0:e.current;s&&s.show()},this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.refreshOrganizations)},this.state={count:0,error:null,loading:!0,organizations:null,page:1,page_size:10,search_term:"",show_organization_editor:!1,sort_direction:"ASC",sort_token:"name",view_type:0},this.search_timer=null,this.provisioning_editor=null,this.archive_filter=(0,l.createRef)(),this.organization_editor=(0,l.createRef)()}componentDidMount(){this.refreshOrganizations()}render(){const{app:e,intl:s}=this.props,{formatMessage:a}=s,{styles:t,userHasRight:i}=e,l=e.getUserSiteRole(),n=!!l&&"site_admin"===l.slug,r={active_learners:a({id:"label.the_number_of_unique_learners_that.863dfe56",defaultMessage:"The number of unique learners that currently belong to an active group within this organization"}),total_members:a({id:"label.the_number_of_total_members_learne.6f8a6046",defaultMessage:"The number of total members (learners, facilitators, admins...) within this organization"})},{count:o,error:d,loading:c,organizations:h,page:u,page_size:m,sort_direction:g,sort_token:p,view_type:x}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsxs)("h4",{children:[(0,N.jsx)(ze.ph9,{className:"text-primary",size:20})," ",(0,N.jsx)(ke.A,{defaultMessage:"Organizations",id:"label.organizations.2730183d"})]}),i("manage_organization")&&0===x&&(0,N.jsx)(ve.A,{onClick:this.lau
2nchOrganizationEditor,style:{marginBottom:10},children:(0,N.jsx)(ke.A,{defaultMessage:"Add organization",id:"label.add_organization.0ca876da"})})]}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:d,variant:"danger",children:d}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,sm:12,children:(0,N.jsxs)(Ei.A,{className:"float-start",size:"sm",style:{marginBottom:10},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:e=>this.startSearch(e.target.value),placeholder:"Search"})]})}),(0,N.jsx)(Ve.A,{md:2,sm:12,children:(0,N.jsx)(vT,{defaultSelected:!1,onChange:this.handleChangeStatusFilter,ref:this.archive_filter})})]})})}),0===x&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ho,{defaultSortDirection:g,defaultSortToken:p,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",name:"name",style:{minWidth:100},children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{className:"text-center align-middle",hiddenBelow:"lg",children:(0,N.jsx)(Ua.A,{placement:"top",overlay:(0,N.jsx)(Qa.A,{children:r.active_learners}),children:(0,N.jsx)("span",{style:{cursor:"help"},children:(0,N.jsx)(ke.A,{defaultMessage:"Active learners",id:"label.active_learners.17262d42"})})})}),(0,N.jsx)(ho.Th,{className:"text-center align-middle",hiddenBelow:"lg",children:(0,N.jsx)(Ua.A,{placement:"top",overlay:(0,N.jsx)(Qa.A,{children:r.total_members}),children:(0,N.jsx)("span",{style:{cursor:"help"},children:(0,N.jsx)(ke.A,{defaultMessage:"Members",id:"label.members.1044a4c0"})})})}),(0,N.jsx)(ho.Th,{className:"text-center align-middle",hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Provisioned",id:"label.provisioned.a73be043"})}),(0,N.jsx)(ho.Th,{className:"text-center align-middle",hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Active contracts",id:"label.active_contracts.d4eadb8e"})}),(0,N.jsx)(ho.Th,{className:"text-end align-middle",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:8,loading:c,children:null!==h&&void 0!==h&&h.length?(0,N.jsx)(N.Fragment,{children:h.map(s=>{const a=Array.isArray(s.contracts)?s.contracts.filter(e=>e.is_active):[],t=a.length?a[0]:0;let i="";if(t.end_date){const e=ci()(t.end_date);var l=e.diff(ci()(),"days");const s=e.diff(ci()(),"months");i=s<3?`${l} days remaining`:`${s} months remaining`}const r=n||(null===s||void 0===s?void 0:s.active_assignment_count)>0;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===s||void 0===s?void 0:s.id}`,children:(0,N.jsx)("b",{children:s.name})})}),(0,N.jsxs)(ho.Td,{className:"text-center",hiddenBelow:"lg",children:[s.active_members,null!==s&&void 0!==s&&s.enable_provisioning?(0,N.jsxs)("small",{children:["/",s.max_active_members]}):""]}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"lg",children:s.total_members}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"lg",children:s.enable_provisioning?"Yes":"No"}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"lg",children:s.enable_provisioning?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"m-0",children:a.length}),a.length>0?(0,N.jsx)("small",{className:l<7?"text-danger":"text-success",children:i}):""]}):"N/A"}),(0,N.jsx)(ho.Td,{className:"text-end",children:e.userHasRight("manage_organization")?(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{onClick:()=>this.provisionOrganization(s.id),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Provision",id:"label.provision.41112adc"})}),(0,N.jsx)(ve.A,{disabled:!r,onClick:()=>this.deleteOrganization(s.id),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]}):"-"})]},s.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No organizations foun
2d.",id:"label.no_organizations_found.2a91b4a9"})})})})]}),(0,N.jsx)(Lr,{count:o,onChange:e=>this.setState({page:e},this.refreshOrganizations),page:u,page_size:m})]}),(0,N.jsx)(dF,{ref:this.organization_editor}),(0,N.jsx)(aD,{onHide:this.refreshOrganizations,onRef:e=>this.provisioning_editor=e})]})})]})}}var JR=(0,Ke.Ay)((0,P.G0)(_T(qR)));class XR extends l.Component{constructor(e){super(e),this.state={custom_time_frame:!0,error:null,loading:!1,organization_id:null,show:!1,time_frame:12}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}handleHide(){const{onHide:e}=this.props;"function"==typeof e&&e(),this.setState({error:null,loading:!1,organization_id:null,show:!1})}show(e){this.setState({error:!1,loading:!1,organization_id:e,show:!0})}createContract(e){let{classification:s,end_date:a,internal_notes:t,is_active:i,po_number:l,price_per_license:n,start_date:r,title:o,total_licenses:d}=e;const{app:c}=this.props,{organization_id:h}=this.state,u=c.api;this.setState({error:!1,loading:!0}),u.post("/api/organizations/contracts/add",{classification:s,end_date:a,internal_notes:t,is_active:i,organization_id:h,po_number:l,price_per_license:n,start_date:r,title:o,total_licenses:d}).then(e=>{let{organization:s}=e;this.setState({loading:!1,show:!1}),"function"==typeof this.props.onHide&&this.props.onHide()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{custom_time_frame:e,time_frame:s}=this.state,{app:a,intl:t}=this.props,{locale:i}=a,l=(e,s)=>{const a=e.getDate();return e.setMonth(e.getMonth()+ +s),e.getDate()!==a&&e.setDate(0),e},n=new Date,r=l(new Date,s);return(0,N.jsx)(xe,{backdropClassName:"second-modal",onHide:()=>{this.handleHide()},show:this.state.show,size:"lg",children:(0,N.jsx)(ds.l1,{validateOnChange:!0,validationSchema:(0,Re.by)({locale:i,scope:"organization.add_contract"}),initialValues:{classification:null,end_date:r,internal_notes:"",is_active:1,po_number:"",price_per_license:"",start_date:n,title:"",total_licenses:0},onSubmit:(e,s)=>{this.createContract(e)},children:a=>{let{dirty:i,errors:n,handleChange:r,handleSubmit:o,isSubmitting:d,setFieldTouched:c,setFieldValue:h,touched:u,values:m}=a;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create contract",id:"label.create_contract.7e21e046"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"text-center",md:12,children:(0,N.jsx)(Me.y$,{})})}),!this.state.loading&&(0,N.jsxs)(_e.A,{onSubmit:o,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Titles",id:"label.titles.3b23a123"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:u.title&&n.title,isValid:u.title&&!n.title,name:"title",onChange:r,placeholder:"(optional)",type:"text",value:m.title}),n.title&&u.title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:n.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Internal notes",id:"label.internal_notes.d8ecfc07"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:this.state.saving,isInvalid:u.internal_notes&&n.internal_notes,isValid:u.internal_notes&&!n.internal_notes,name:"internal_notes",onChange:r,placeholder:"(optional)",rows:"3",value:m.internal_notes}),n.internal_notes&&u.internal_notes&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:n.internal_notes})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Total licenses",id:"label.total_licenses.542f1a06"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:u.total_licenses&&n.total_licenses,isValid:u.total_licenses&&!n.total_licenses,name:"total_licenses",onChange:r,type:"text",value:m.total_licenses}),n.total_licenses&&u.total_licenses&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:n.total_licenses})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)(_c(),{disabled:this.state.saving,isInvalid:u.start_date&&n.start_date,isValid:u.start_date&&!n.start_date,name:"start_date",value:m.start_date,onChange:e=>{var s;(0,di.isMoment)(e)&&(h("start_date",null===e||void 0===e||null===(s=e.utc)||void 0===s?void 0:s.call(e).toISOString()),c("start_date"))}}),n.start_date&&u.start_date&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:n.start_date})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",id:"label.end_date.14303aa0"})}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:6,md:6,sm:12,children:(0,N.jsxs)(_e.A.Select,{id:"form-height-set",name:"time_frame",value:m.time_frame,onChange:e=>{e.target.value>0?this.setState({custom_time_frame:!1,time_frame:e.target.value}):this.setState({custom_time_frame:!0,time_frame:12}),h("end_date",l(new Date,e.target.value).toISOString()),c("end_date"),h("time_frame",e.target.value)},children:[(0,N.jsx)("option",{value:0,children:t.formatMessage({id:"label.custom.494ca78f",defaultMessage:"Custom"})}),(0,N.jsx)("option",{value:3,children:t.formatMessage({id:"label.3_months.1248c71c",defaultMessage:"3 Months"})}),(0,N.jsx)("option",{value:6,children:t.formatMessage({id:"label.6_months.782827a6",defaultMessage:"6 Months"})}),(0,N.jsx)("option",{value:12,children:t.formatMessage({id:"label.12_months.c9cb68d9",defaultMessage:"12 Months"})}),(0,N.jsx)("option",{value:18,children:t.formatMessage({id:"label.18_months.3bc5c762",defaultMessage:"18 Months"})}),(0,N.jsx)("option",{value:24,children:t.formatMessage({id:"label.24_months.3dd2578f",defaultMessage:"24 Months"})}),(0,N.jsx)("option",{value:36,children:t.formatMessage({id:"label.36_months.5f1c7a0f",defaultMessage:"36 Months"})})]})}),(0,N.jsx)(Ve.A,{lg:6,md:6,sm:12,children:(0,N.jsx)(_c(),{disabled:this.state.saving,isInvalid:u.end_date&&n.end_date,isValid:u.end_date&&!n.end_date,name:"end_date",value:e?m.end_date:l(new Date,s),inputProps:{disabled:!this.state.custom_time_frame},onChange:e=>{var s;(0,di.isMoment)(e)&&(h("end_date",null===e||void 0===e||null===(s=e.utc)||void 0===s?void 0:s.call(e).toISOString()),c("end_date"))}})})]}),n.end_date&&u.end_date&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:n.end_date})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Classification",id:"label.classification.72f04995"})}),(0,N.jsxs)(_e.A.Select,{name:"classification",value:m.classification,onChange:e=>{h("classification",e.target.value)},children:[(0,N.jsx)("option",{value:null,children:t.formatMessage({id:"label.none.dc937b59",defaultMessage:"None"})}),(0,N.jsx)("option",{value:"pilot",children:t.formatMessage({id:"label.pilot.383e2d94",defaultMessage:"Pilot"})}),(0,N.jsx)("option",{value:"demo",children:t.formatMessage({id:"label.demo.8a2cc067",defaultMessage:"Demo"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Cost per license",id:"label.cost_per_license.0ec21725"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{id:"inputGroupPrepend",children:"$"}),(0,N.jsx)(_e.A.Control,{required:!0,className:"form-cost-license",isInvalid:u.price_per_license&&n.price_per_license,isValid:u.price_per_license&&!n.price_per_license,name:"price_per_license",onChange:r,placeholder:"cost per license",type:"text",value:m.price_per_license}
2),(0,N.jsx)(Ei.A.Text,{id:"inputGroupApend",children:".00"}),n.price_per_license&&u.price_per_license&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:n.price_per_license})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"PO #",id:"label.po.4e1faa17"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:u.po_number&&n.po_number,isValid:u.po_number&&!n.po_number,name:"po_number",onChange:r,placeholder:"(optional)",type:"text",value:m.po_number}),n.po_number&&u.po_number&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:n.po_number})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:()=>{this.handleHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",description:"",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:o,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",description:"",id:"label.save_changes.dd0ae7a5"})})]})]})}})})}}var ZR=(0,Ke.Ay)((0,n.G0)(_T(XR)));class $R extends l.Component{constructor(e){super(e),this.state={error:null,loading:!1,organization_id:null,show:!1}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}handleHide(){const{onHide:e}=this.props;"function"==typeof e&&e(),this.setState({error:null,loading:!1,organization_id:null,show:!1})}show(e){this.setState({error:!1,loading:!1,organization_id:e,show:!0})}createContact(e){let{contact_address:s,contact_address2:a,contact_city:t,contact_country:i,contact_email_address:l,contact_name:n,contact_postal_code:r,contact_region:o}=e;const{app:d}=this.props,{organization_id:c}=this.state,h=d.api;this.setState({error:!1,loading:!0}),h.get("/api/organizations/contacts/add",{contact_address:s,contact_address2:a,contact_city:t,contact_country:i,contact_email_address:l,contact_name:n,contact_postal_code:r,contact_region:o,organization_id:c}).then(e=>{let{organization:s}=e;this.setState({loading:!1,show:!1}),"function"==typeof this.props.onHide&&this.props.onHide()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}editContact(e){let{contact_address:s,contact_address2:a,contact_city:t,contact_country:i,contact_email_address:l,contact_id:n,contact_name:r,contact_postal_code:o,contact_region:d}=e;const{app:c}=this.props,{organization_id:h}=this.state,u=c.api;this.setState({error:!1,loading:!0}),u.post("/api/organizations/contacts/edit",{contact_address:s,contact_address2:a,contact_city:t,contact_country:i,contact_email_address:l,contact_id:n,contact_name:r,contact_postal_code:o,contact_region:d,organization_id:h}).then(()=>{this.setState({loading:!1,show:!1}),"function"==typeof this.props.onHide&&this.props.onHide()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{app:e,contact:s}=this.props,{locale:a}
2=e,t=s&&s.id,i=s&&s.contact_name,l=s&&s.contact_email_address,n=s&&s.contact_address,r=s&&s.contact_address2,o=s&&s.contact_city,d=s&&s.contact_region,c=s&&s.contact_country,h=s&&s.contact_postal_code;return(0,N.jsx)(xe,{backdropClassName:"second-modal",onHide:()=>{this.handleHide()},show:this.state.show,size:"lg",children:(0,N.jsx)(ds.l1,{validationSchema:(0,Re.by)({locale:a,scope:"organization.add_contact"}),initialValues:{contact_address:s?n:"",contact_address2:s?r:"",contact_city:s?o:"",contact_country:s?c:"",contact_email_address:s?l:"",contact_id:s?t:"",contact_name:s?i:"",contact_postal_code:s?h:"",contact_region:s?d:""},onSubmit:(e,a)=>{s?this.editContact(e):this.createContact(e)},children:e=>{let{dirty:s,errors:a,handleChange:t,handleSubmit:i,isSubmitting:l,setFieldTouched:n,setFieldValue:r,touched:o,values:d}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new contact",id:"label.create_new_contact.1d503bce"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"text-center",md:12,children:(0,N.jsx)(Me.y$,{})})}),!this.state.loading&&(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_name&&a.contact_name,isValid:o.c
2ontact_name&&!a.contact_name,name:"contact_name",onChange:t,placeholder:"Contact Name",type:"text",value:d.contact_name}),(0,N.jsx)(ds.Kw,{name:"contact_name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Email address",id:"label.email_address.f2488fd4"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_email_address&&a.contact_email_address,isValid:o.contact_email_address&&!a.contact_email_address,name:"contact_email_address",onChange:t,placeholder:"Contact Email",type:"text",value:d.contact_email_address}),(0,N.jsx)(ds.Kw,{name:"contact_email_address",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Address",id:"label.address.56ef8f20"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_address&&a.contact_address,isValid:o.contact_address&&!a.contact_address,name:"contact_address",onChange:t,placeholder:"(optional)",type:"text",value:d.contact_address}),(0,N.jsx)(ds.Kw,{name:"contact_address",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Alt address",id:"label.alt_address.bd210c77"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_address2&&a.contact_address2,isValid:o.c
2ontact_address2&&!a.contact_address2,name:"contact_address2",onChange:t,placeholder:"(optional)",type:"text",value:d.contact_address2}),(0,N.jsx)(ds.Kw,{name:"contact_address2",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"City",id:"label.city.fc33f732"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_city&&a.contact_city,isValid:o.contact_city&&!a.contact_city,name:"contact_city",onChange:t,placeholder:"(optional)",type:"text",value:d.contact_city}),(0,N.jsx)(ds.Kw,{name:"contact_city",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"State / Region",id:"label.state_region.9630a4b0"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_region&&a.contact_region,isValid:o.contact_region&&!a.contact_region,name:"contact_region",onChange:t,placeholder:"(optional)",type:"text",value:d.contact_region}),(0,N.jsx)(ds.Kw,{name:"contact_region",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Country",id:"label.country.701d021d"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_country&&a.contact_country,isValid:o.contact_country&&!a.contact_country,name:"contact_country",onChange:t,placeholder:"(optional)",type:"text",value:d.contact_country}),(0,N.jsx)(ds.Kw,{name:"contact_country",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Postal code",id:"label.postal_code.ae53cea8"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.contact_postal_code&&a.contact_postal_code,isValid:o.c
2ontact_postal_code&&!a.contact_postal_code,name:"contact_postal_code",onChange:t,placeholder:"(optional)",type:"text",value:d.contact_postal_code}),(0,N.jsx)(ds.Kw,{name:"contact_postal_code",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:()=>{this.handleHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",description:"",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",description:"",id:"label.save_changes.dd0ae7a5"})})]})]})}})})}}var eD=(0,n.G0)(_T($R));class sD extends l.Component{constructor(e){super(e),this.toggleProvisioning=()=>{const{organization:e}=this.state;e&&(e.enable_provisioning?this.disableProvisioning():this.enableProvisioning())},this.state={contact:null,error:null,loading:!0,organization:null,organization_id:null,show:!1},this.contract_editor=null,this.contact_editor=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}handleHide(){const{onHide:e}=this.props;this.setState({error:null,loading:!0,organization:null,organization_id:null,show:!1},()=>{"function"==typeof e&&e()})}show(e){const{app:s}=this.props,a=s.api;this.setState({error:!1,loading:!0,organization_id:e,show:!0}),a.get("/api/organizations/get",{organization_id:e}).then(e=>{let{organization:s}=e;this.setState({loading:!1,organization:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}enableProvisioning(){const{app:e}=this.props,{organization_id:s}=this.state,a=e.api;this.setState({error:!1,loading:!0}),a.get("/api/organizations/provisioning/enable",{organization_id:s}).then(e=>{let{organization:s}=e;this.setState({loading:!1,organization:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}disableProvisioning(){const{app:e}=this.props,{organization_id:s}=this.state,a=e.api;this.setState({error:!1,loading:!0}),a.get("/api/organizations/provisioning/disable",{organization_id:s}).then(e=>{let{organization:s}=e;this.setState({loading:!1,organization:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}terminateContract(e){const{app:s}=this.props,{organization_id:a}=this.state,t=s.api;this.setState({error:!1,loading:!0}),t.get("/api/organizations/contracts/terminate/"+e,{organization_id:a}).then(()=>{this.setState({loading:!1}),this.show(a)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}deleteContact(e){const s=e.id,{app:a}=this.props,{organization_id:t}=this.state,i=a.api;this.setState({error:!1,loading:!0}),i.post("/api/organizations/contacts/delete",{contact_id:s,organization_id:t}).then(()=>{this.setState({loading:!1,show:!1}),"function"==typeof this.props.onHide&&this.props.onHide(),this.show(t)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}setMaxActiveLearners(e){const{app:s}=this.props,{organization_id:a}=this.state,t=s.api;this.setState({error:!1,loading:!0}),t.get("/api/organizations/provisioning/set/max",{max_active_members:e,organization_id:a}).then(()=>{this.setState({loading:!1}),this.show(a)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{organization:e,organization_id:s}=this.state,{intl:a}=this.props,t=e&&Array.isArray(e.contracts)?e.contracts.filter(e=>e.is_active):[],i=e&&Array.isArray(e.contacts)?e.contacts.filter(e=>e):[],l=e&&Array.isArray(e.contracts)?e.contracts.filter(e=>!e.is_active):[];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe,{onHide:()=>{this.handleHide()},show:this.state.show,size:"xl",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Provision organization",description:"",id:"label.provision_organization.1112845b"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"text-center",md:12,children:(0,N.jsx)(Me.y$,{})})}),!this.state.loading&&e&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)("h3",{children:e.name})}),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Switch,{checked:e.enable_provisioning,id:"enableChatBotSwitch",label:(0,N.jsx)(ke.A,{defaultMessage:"Enable provisioning",id:"label.enable_provisioning.f1fd853c"}),onChange:this.toggleProvisioning})})]}),!!e.enable_provisioning&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:6,children:(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})})}),(0,N.jsx)(qa.A,{bordered:!0,hover:!0,className:"m-0",size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(ke.A,{defaultMessage:"Total members",description:"",id:"label.total_members.9a19d697"})}),(0,N.jsx)("td",{className:"text-center",children:e.total_members})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(ke.A,{defaultMessage:"Active learners",description:"",id:"label.active_learners.17262d42"})}),(0,N.jsx)("td",{className:"text-center",children:e.active_members})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(ke.A,{defaultMessage:"Maximum active learners",description:"",id:"label.maximum_active_learners.d6382b33"})}),(0,N.jsxs)("td",{className:"text-center",children:[e.max_active_members," ",(0,N.jsx)(ve.A,{className:"p-0",variant:"link",onClick:s=>{s.preventDefault();let t=window.prompt("Provide the maximum number of active learners this organization may have at any time. Note: existing users will not lose access to this organization if it has an active contract.",e.max_active_members);if(null!==t){if(t=Number.parseInt(t),isNaN(t)||t<0)return window.alert(a.formatMessage({id:"label.invali
2d_value_provided_try_again.7d3c875d",defaultMessage:"Invalid value provided. Try again"}));this.setMaxActiveLearners(t)}},children:(0,N.jsx)(ze.Mbp,{})})]})]})]})})]})})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"clearfix",children:[(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{this.contact_editor.show(s)},size:"sm",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add contact",description:"",id:"label.add_contact.a02ce0df"})}),(0,N.jsx)("h5",{style:{marginTop:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Contacts",description:"",id:"label.contacts.b450645d"})})]}),(0,N.jsxs)(qa.A,{bordered:!0,responsive:!0,striped:!0,className:"mt-2",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",description:"",id:"label.name.dcd1d522"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",description:"",id:"label.email.969ccbd3"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Address",description:"",id:"label.address.56ef8f20"})}),(0,N.jsx)("th",{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",description:"",id:"label.actions.ff8059dc"})})]})}),(0,N.jsxs)("tbody",{children:[i.map((e,a)=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:e.contact_name?e.contact_name:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"Unnamed",description:"",id:"label.unnamed.e504e615"})})}),(0,N.jsx)("td",{children:e.contact_email_address?e.contact_email_address:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"no email provided",description:"",id:"label.no_email_provided.d9d98112"})})}),(0,N.jsx)("td",{children:e.contact_address?e.contact_address:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"no address provided",description:"",id:"label.no_address_provided.7fbfa984"})})}),(0,N.jsx)("td",{children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{size:"sm",variant:"link",onClick:a=>{a.preventDefault(),window.confirm("Are you sure you want to edit this contact?")&&(this.setState({contact:e}),this.contact_editor.show(s))},children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",description:"",id:"label.edit.464c4ffd"})}),(0,N.jsx)(ve.A,{size:"sm",variant:"secondary",onClick:s=>{s.preventDefault(),window.confirm("Are you sure you want to delete this contact?")&&this.deleteContact(e)},children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",description:"",id:"label.delete.e2d0a549"})})]})})]},a)),0===i.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colspan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No contacts available",description:"",id:"label.no_contacts_available.91e6475e"})})})]})]})]})})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"clearfix",children:[(0,N.jsx)(ve.A,{className:"float-end",size:"sm",variant:"primary",onClick:()=>{this.contract_editor.show(s)},children:(0,N.jsx)(ke.A,{defaultMessage:"Add contract",description:"",id:"label.add_contract.452996cb"})}),(0,N.jsx)("h5",{style:{marginTop:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Active contracts",description:"",id:"label.active_contracts.d4eadb8e"})})]}),(0,N.jsxs)(qa.A,{bordered:!0,responsive:!0,striped:!0,className:"mt-2",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",description:"",id:"label.title.7e8cd205"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Licenses",description:"",id:"label.licenses.6d5d9004"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",description:"",id:"label.start_date.81696931"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",description:"",id:"label.end_date.14303aa0"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Classification",description:"",id:"label.classification.72f04995"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Cost per license",description:"",id:"label.cost_per_license.0ec21725"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"PO #",description:"",id:"label.po.4e1faa17"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Creator",description:"",id:"label.creator.88447b83"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",description:"",id:"label.actions.ff8059dc"})})]})}),(0,N.jsxs)("tbody",{children:[t.map((e,s)=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:e.title?e.title:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"Untitled",id:"label.untitled.f59ab8d1"})})}),(0,N.jsx)("td",{children:e.total_licenses}),(0,N.jsxs)("td",{children:[(0,N.jsx)(Gh.XU,{value:new Date(e.start_date)}),"\xa0",(0,N.jsx)(Gh.ib,{value:new Date(e.start_date)})]}),(0,N.jsxs)("td",{children:[(0,N.jsx)(Gh.XU,{value:new Date(e.end_date)}),"\xa0",(0,N.jsx)(Gh.ib,{value:new Date(e.end_date)})]}),(0,N.jsx)("td",{children:e.classification?e.classification:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"None",description:"",id:"label.none.dc937b59"})})}),(0,N.jsx)("td",{children:`$${e.price_per_license?e.price_per_license:"0.00"}`}),(0,N.jsx)("td",{children:e.po_number?e.po_number:a.formatMessage({id:"label.na.e2f79e5b",defaultMessage:"N/A"})}),(0,N.jsx)("td",{children:e.creator?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ya,{className:"me-2",size:20,style:{verticalAlign:"top"},user:e.creator}),(0,N.jsx)(ga,{user:e.creator})]}):"N/A"}),(0,N.jsx)("td",{children:(0,N.jsx)(ve.A,{size:"sm",variant:"secondary",onClick:s=>{s.preventDefault(),window.confirm(a.formatMessage({id:"label.are_you_sure_you_want_to_terminate.1cebc189",defaultMessage:"Are you sure you want to terminate this contract?"}))&&this.terminateContract(e.id)},children:(0,N.jsx)(ke.A,{defaultMessage:"Terminate",description:"",id:"label.terminate.f913f092"})})})]},s)),0===t.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colspan:"9",children:(0,N.jsx)(ke.A,{defaultMessage:"No contracts",description:"",id:"label.no_contracts.5966e2a1"})})})]})]})]})})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(Ce.S,{className:"clearfix",children:(0,N.jsx)("h5",{style:{marginTop:0},children:(0,N.jsx)(ke.A,{defaultMessage:"Inactive contracts",description:"",id:"label.inactive_contracts.2cda311a"})})}),(0,N.jsxs)(qa.A,{bordered:!0,responsive:!0,striped:!0,className:"mt-2",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Licenses",description:"",id:"label.licenses.6d5d9004"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",description:"",id:"label.start_date.81696931"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",description:"",id:"label.end_date.14303aa0"})})]})}),(0,N.jsxs)("tbody",{children:[l.map((e,s)=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:e.total_licenses}),(0,N.jsxs)("td",{children:[(0,N.jsx)(Gh.XU,{value:new Date(e.start_date)}),"\xa0",(0,N.jsx)(Gh.ib,{value:new Date(e.start_date)})]}),(0,N.jsxs)("td",{children:[(0,N.jsx)(Gh.XU,{value:new Date(e.end_date)}),"\xa0",(0,N.jsx)(Gh.ib,{value:new Date(e.end_date)})]})]},s)),0===l.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colspan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No contracts",description:"",id:"label.no_contracts.5966e2a1"})})})]})]})]})})})]})]})]})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{this.handleHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",description:"",id:"label.close.7d9eb7ac"})})})]})}),(0,N.jsx)(ZR,{onHide:()=>{this.show(this.state.organization_id)},onRef:e=>{this.contract_editor=e}}),(0,N.jsx)(eD,{contact:this.state.contact,onRef:e=>{this.contact_editor=e},onHide:()=>{this.setState({contact:null}),this.show(this.state.organization_id)}})]})}}var aD=(0,Ke.Ay)((0,n.G0)(_T(sD)));var tD=s=>{const{api:a}=(0,P.nm)(),{end_date:t,start_date:i}=gD(),[n,r,o]=(0,ne.CQ)({count:0,loading:!1,orgs:[],page:1,page_size:4,sort_direction:"DESC",sort_token:"total_seconds"}),{count:d,loading:c,orgs:h,page:u,page_size:m,sort_direction:g,sort_token:p}=n,x=async()=>{try{const{page:e,page_size:s,sort_direction:l,sort_token:o}=n,d=ci()(i).utc().toISOString(),c=ci()(t).utc().toISOString();r({loading:!0});const{count:h,results:u}=await a.get("/api/site/dashboard/active-organizations",{end_date:c,page:e,page_size:s,sort_direction:l,sort_token:o,start_date:d});r({count:h,loading:!1,orgs:u})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;r({error:a,loading:!1})}};(0,l.useEffect)(()=>{i&&t&&x()},[i,t]);const v=ci()(t).format("MM/DD/YY"),f=ci()(i).format("MM/DD/YY");return(0,N.jsx)(nD,{value:{count:d,handleSort:(e,s)=>r({page:1,sort_direction:s,sort_token:e},x),loading:c,orgs:h,page:u,page_size:m,sort_direction:g,sort_token:p},children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)("h4",{className:"d-inline-block me-auto",children:(0,N.jsx)(ke.A,{defaultMessage:"Most active organizations",id:"label.most_active_organizations.c21505a7"})}),(0,N.jsxs)("span",{className:"selected-date",children:[f," - ",v]})]}),(0,N.jsx)(Ce.S,{className:"mt-1 mb-3",children:(0,N.jsx)(iD,{})}),(0,N.jsx)(Lr,{count:d,onChange:e=>r({page:e},x),page:u,page_size:m})]})})};var iD=e=>{var s;const{convertSeconds:a}=null!==(s=null===Re._$||void 0===Re._$?void 0:Re._$.time)&&void 0!==s?s:{},{handleSort:t,loading:i,orgs:l,sort_direction:n,sort_token:r}=rD();return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ho,{defaultSortDirection:n,defaultSortToken:r,onSort:t,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Organization name",id:"label.organization_name.9a807d52"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-end",name:"total_seconds",children:(0,N.jsx)(ke.A,{defaultMessage:"Total time",id:"label.total_time.f448bdef"})})]})}),(0,N.jsx)(ho.Tbody,{cols:2,loading:i,children:null!==l&&void 0!==l&&l.length?(0,N.jsx)(N.Fragment,{children:l.map(e=>{let{id:s,name:t,total_seconds:i}=e;const l=a(i);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{to:`/admin/organization/${s}`,children:(0,N.jsx)(Fl,{inline:!0,as:"strong",maxWidth:350,children:t})},s)}),(0,N.jsxs)(ho.Td,{className:"text-end",children:[null===l||void 0===l?void 0:l.value," ",null===l||void 0===l?void 0:l.label]})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"2",children:(0,N.jsx)(ke.A,{defaultMessage:"No organizations foun
2d",id:"label.no_organizations_found.538995db"})})})})]})})};const lD=l.createContext({}),nD=lD.Provider,rD=(lD.Consumer,()=>(0,l.useContext)(lD));function oD(e){let{app:s,data:a,responsive_height:t,responsive_width:i}=e;const{styles:l}=s,n=l&&l.primary,r=l&&l.secondary;return(0,N.jsx)(jt.u,{height:t,width:i,children:(0,N.jsxs)(_t.E,{data:a,layout:"horizontal",margin:{bottom:5,left:20,right:30,top:5},children:[(0,N.jsx)(bt.d,{strokeDasharray:"3 3"}),(0,N.jsx)(At.W,{dataKey:"date"}),(0,N.jsx)(yt.h,{}),(0,N.jsx)(wt.m,{}),(0,N.jsx)(St.y,{dataKey:"started",fill:n}),(0,N.jsx)(St.y,{dataKey:"completed",fill:r}),(0,N.jsx)(Nt.s,{})]})})}oD.defaultProps={bars:[{background:{fill:"rgb(209,229,236)"},dataKey:"started",fill:"rgb(19,126,189)"}],bg_color:"rgb(209,229,236)",chart_height:300,chart_width:500,colors:["#00AD00","#008087","#17A2B8","#F4A800","black","#FF544E","orange"],data:[{completed:2400,date:"Dec 10",started:4e3},{completed:1398,date:"Dec 11",started:3e3},{completed:9800,date:"Dec 12",started:2e3},{completed:3908,date:"Dec 13",started:2780},{completed:4800,date:"Dec 14",started:1890},{completed:3800,date:"Dec 15",started:2390},{completed:4300,date:"Dec 16",started:3490}],legend:!0,responsive_height:"100%",responsive_width:"100%",tooltip:!0};var dD=(0,n.G0)(oD);class cD extends l.Component{constructor(e){super(e),this.refreshData=()=>{this.getLearnersOnline(),this.getUsersRegistered(),this.getTimeOnPlatform(),this.getChallengesSummary(),this.getMostActiveChallenges()},this.handleHide=()=>{this.setState({show:!1})},this.handleSelectDate=e=>{const s=e.start_date,a=e.end_date;this.setState({end_date:a,page_number_challenges_ma:1,page_number_classes_ma:1,page_number_facilitators_ma:1,start_date:s},()=>{this.refreshData()})},this.getMostActiveChallenges=()=>{const{app:e}=this.props,{end_date:s,page_number_challenges_ma:a,page_size_challenges_ma:t,sort_direction_challenges_ma:i,sort_token_challenges_ma:l,start_date:n}=this.state,{api:r}=e,o=ci()(n).utc().toISOString(),d=ci()(s).utc().toISOString();r.get("/api/site/dashboard/active-challenges",{end_date:d,page_number:a,page_size:t,sort_direction:i,sort_token:l,start_date:o}).then(e=>{let{count:s,results:a}=e;this.setState({challenges_ma:a,count_challenges_ma:s,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.getLearnersOnline=()=>{const{app:e}=this.props,{end_date:s,start_date:a}=this.state,{api:t}=e,i=ci()(a).utc().toISOString(),l=ci()(s).utc().toISOString(),n=this.state.learners_online_filter||"";this.setState({org_online_loading:!0}),t.get("/api/site/dashboard/users-online",{end_date:l,role_slug:n,start_date:i}).then(e=>{let{user_counts_array:s}=e;this.setState({learners_online:s,org_online_loading:!1},()=>{this.formatLearnersOnline(n)})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,org_online_loading:!1})})},this.getUsersRegistered=()=>{const{app:e}=this.props,{end_date:s,start_date:a}=this.state,{api:t}=e,i=ci()(a).utc().toISOString(),l=ci()(s).utc().toISOString(),n=this.state.learners_online_filter||"";this.setState({org_registered_loading:!0}),t.get("/api/site/dashboard/users-registered",{end_date:l,role_slug:n,start_date:i}).then(e=>{let{user_counts_array:s}=e;this.setState({learners_registered:s,org_registered_loading:!1},()=>{this.formatLearnersRegistered(n)})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,org_registered_loading:!1})})},this.getTimeOnPlatform=()=>{const{app:e}=this.props,{end_date:s,start_date:a}=this.state,{api:t}=e,i=ci()(a).utc().toISOString(),l=ci()(s).utc().toISOString();this.setState({time_on_platform_loading:!0}),t.get("/api/site/dashboard/time-on-platform",{end_date:l,start_date:i}).then(e=>{let{user_counts_array:s}=e;this.setState({time_on_platform:s,time_on_platform_loading:!1},()=>{this.formatTimeOnPlatform()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,time_on_platform_loading:!1})})},this.getChallengesSummary=()=>{const{app:e}=this.props,{end_date:s,start_date:a}=this.state,{api:t}=e,i=ci()(a).utc().toISOString(),l=ci()(s).utc().toISOString();this.setState({time_on_platform_loading:!0}),t.get("/api/site/dashboard/challenges-summary",{end_date:l,start_date:i}).then(e=>{this.setState({challenges_summary_data:e,challenges_summary_loading:!1},()=>{})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({challenges_summary_loading:!1,error:s})})},this.formatLearnersOnline=()=>{const e=864e5,{end_date:s,learners_online:a}=this.state,t=new Date(s),i=a&&a.length?a.length:0,l=[];for(let r=0;r<i;r++){let s="";switch(new Date(t-e*r).getMonth()){case 0:s="Jan";break;case 1:s="Feb";break;case 2:s="Mar";break;case 3:s="Apr";break;case 4:s="May";break;case 5:s="Jun";break;case 6:s="Jul";break;case 7:s="Aug";break;case 8:s="Sep";break;case 9:s="Oct";break;case 10:s="Nov";break;case 11:s="Dec"}l.push({"Users online":Number(a[r]),name:`${s} ${new Date(t-e*r).getDate()}`})}const n=l&&Array.isArray(l)&&[...l].reverse();this.setState({formatted_learners_online:n})},this.formatTimeOnPlatform=()=>{const{end_date:e,time_on_platform:s}=this.state,a=[];for(let i=0;i<s.length;i++){const t=s[i],l=ci()(e).subtract(i,"days"),n=l.format("MMM");a.push({name:`${n} ${l.date()}`,"User hours":Number((t/3600).toFixed(3))})}const t=a.reverse();this.setState({formatted_time_on_platform:t})},this.formatLearnersRegistered=()=>{const{end_date:e,learners_registered:s}=this.state,a=[];for(let i=0;i<s.length;i++){const t=ci()(e).subtract(i,"days"),l=t.format("MMM");a.push({name:`${l} ${t.date()}`,"Users registered":Number(s[i])})}const t=a.reverse();this.setState({formatted_learners_registered:t})},this.handleSelectOrgOnline=e=>this.setState({learners_online_filter:e},this.getLearnersOnline),this.handleSortMostActiveChallenges=(e,s)=>{this.setState({sort_direction_challenges_ma:s,sort_token_challenges_ma:e},this.getMostActiveChallenges)},this.state={challenge_files_count_total:"- -",challenges_ma:[],count_classes_ma:0,count_facilitators_ma:0,end_date:ci()().toDate().getTime(),facilitator_tmap_total:"- -",learner_tmap_total:"- -",learners_online_filter:"all",messages_count_total:"- -",new_learners_count:"- -",org_assignments_loading:!1,org_efficacy_loading:!1,org_engagements_loading:!1,org_long_efficacy_loading:!1,org_online_loading:!1,org_registered_loading:!1,page_number_challenges_ma:1,page_number_classes_ma:1,page_number_facilitators_ma:1,page_size_challenges_ma:4,page_size_classes_ma:4,page_size_facilitators_ma:4,sort_direction_challenges_ma:"DESC",sort_direction_classes_ma:"DESC",sort_direction_facilitators_ma:"DESC",sort_token_challenges_ma:"tmap",sort_token_classes_ma:"tmap",sort_token_facilitators_ma:"total_time",start_date:ci()().subtract(1,"month").toDate().getTime(),time_on_platform_loading:!1,unique_learners_online:"- -"},this.picker=null}componentDidMount(){this.refreshData()}componentDidUpdate(e,s,a){e.admin_group.id!==this.props.admin_group.id&&this.refreshData()}render(){const{intl:e}=this.props,{challenges_ma:s,challenges_summary_data:a,end_date:t,formatted_learners_online:i,formatted_learners_registered:l,formatted_time_on_platform:n,learners_online_filter:r,org_online_loading:o,org_registered_loading:d,sort_direction_challenges_ma:c,sort_token_challenges_ma:h,start_date:u,time_on_platform_loading:m}=this.state,{convertSeconds:g}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},p=ci()(t).format("MM/DD/YY"),x=ci()(u).format("MM/DD/YY");let v="";switch(r){case"learners":v=e.formatMessage({id:"label.learners.b8b5ae57",defaultMessage:"Learners"});break;case"admins":v=e.formatMessage({id:"label.facilitators.1cdd53ff",defaultMessage:"Facilitators"});break;default:v=e.formatMessage({id:"label.all.a52ace42",defaultMessage:"All"})}return(0,N.jsxs)(mD,{value:{end_date:t,start_date:u},children:[(0,N.jsxs)(Ue.A,{className:"admin-dashboard",children:[(0,N.jsx)(Ce.S,{className:"mt-2 mb-4 clearfix",children:(0,N.jsx)(Ce.S,{className:"d-inline-block float-end",children:(0,N.jsxs)(ve.A,{variant:"primary",onClick:()=>{this.picker&&this.picker.show({end_date:t,start_date:u})},children:[ci()(u).format("MMM DD, YYYY")," - ",ci()(t).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})})}),(0,N.jsx)(_I,{label:"User metrics",children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{lg:12,children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"online",id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"online",children:(0,N.jsx)(ke.A,{defaultMessage:"Online",description:"",id:"label.online.0d21bd52"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"registered",children:(0,N.jsx)(ke.A,{defaultMessage:"Registered",description:"",id:"label.registered.2351ee99"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"online",children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"baseline",display:"flex"},children:[(0,N.jsxs)("h4",{className:"me-auto mb-0",style:{display:"inline-block"},children:[v," ",(0,N.jsx)(ke.A,{defaultMessage:"online",description:"",id:"label.online.f6fc84c9"})]}),(0,N.jsxs)("span",{className:"selected-date",children:[x," - ",p]}),(0,N.jsxs)(li.A,{className:"ms-3 primary round px-2 py-1",children:[(0,N.jsx)(li.A.Toggle,{id:"dropdown-custom-components",children:(0,N.jsxs)("span",{className:"me-2",children:[(0,N.jsx)(ke.A,{defaultMessage:"Filter  by",description:"",id:"label.filter_by.415ba8a2"})," ",v]})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{eventKey:"Users",onClick:()=>this.handleSelectOrgOnline("all"),children:(0,N.jsx)(ke.A,{defaultMessage:"All users",id:"label.all_users.f7898130"})}),(0,N.jsx)(li.A.Item,{eventKey:"Learners",onClick:()=>this.handleSelectOrgOnline("learners"),children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",description:"",id:"label.learners.b8b5ae57"})}),(0,N.jsx)(li.A.Item,{eventKey:"Facilitators",onClick:()=>this.handleSelectOrgOnline("admins"),children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitators",description:"",id:"label.facilitators.1cdd53ff"})})]})]})]}),(0,N.jsxs)("p",{children:[" ",v," ",(0,N.jsx)(ke.A,{defaultMessage:"online by ascending date",description:"",id:"label.online_by_ascending_date.ff95c2f4"})]}),o?(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:330,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.Up,{})}):(0,N.jsx)(Ce.S,{className:"solvably-line-chart",style:{height:330,width:"100%"},children:(0,N.jsx)(hI,{data:i,height:300,name:"Users online",width:"100%"})})]})}),(0,N.jsx)(ld.A.Pane,{eventKey:"registered",children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"baseline",display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto mb-0",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Users registered",description:"",id:"label.users_registered.960b77dd"})}),(0,N.jsxs)("span",{className:"selected-date",children:[x," - ",p]})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Users registered by ascending date",description:"",id:"label.users_registered_by_ascending_date.1e395f03"})}),d?(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:330,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.Up,{})}):(0,N.jsx)(Ce.S,{className:"solvably-line-chart",style:{height:330,width:"100%"},children:(0,N.jsx)(hI,{data:l,height:300,name:"Users registered",width:"100%"})})]})})]})})})]})})})}),(0,N.jsx)(_I,{label:"Time on platform",children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"baseline",display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto mb-0",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Time on platform",description:"",id:"label.time_on_platform.283100f0"})}),(0,N.jsxs)("span",{className:"selected-date",children:[x," - ",p]})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"User hours by ascending date",description:"",id:"label.user_hours_by_ascending_date.cdd3e162"})}),m?(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:330,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.Up,{})}):(0,N.jsx)(Ce.S,{className:"solvably-line-chart",style:{height:330,width:"100%"},children:(0,N.jsx)(hI,{data:n,height:300,name:"User hours",width:"100%"})})]})})})}),(0,N.jsx)(_I,{label:"Challenges",children:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"baseline",display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto mb-0",style:{display:"inline-block"},children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges started and completed",description:"",id:"label.challenges_started_and_completed.aca4bbad"})}),(0,N.jsxs)("span",{className:"selected-date",children:[x," - ",p]})]}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"User hours by ascending date",description:"",id:"label.user_hours_by_ascending_date.cdd3e162"})}),m?(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",height:330,justifyContent:"center",width:"100%"},children:(0,N.jsx)(Me.Up,{})}):(0,N.jsx)(Ce.S,{className:"solvably-line-chart",style:{height:330,width:"100%"},children:(0,N.jsx)(dD,{data:a,height:300,name:"User hours",width:"100%"})})]})})})}),(0,N.jsx)(_I,{label:"Activity",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"mt-1",lg:6,children:(0,N.jsx)(tD,{})}),(0,N.jsx)(Ve.A,{className:"mt-1",lg:6,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{style:{display:"flex"},children:[(0,N.jsx)("h4",{className:"me-auto",style:{display:"inline-block"},children:"Most active challenges"}),(0,N.jsxs)("span",{className:"selected-date",children:[x," - ",p]})]}),(0,N.jsx)(Ce.S,{className:"mt-1 mb-3",children:(0,N.jsxs)(ho,{defaultSortDirection:c,defaultSortToken:h,onSort:this.handleSortMostActiveChallenges,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge name",id:"label.challenge_name.b3d6d2ad"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-end",name:"tmap",children:(0,N.jsx)(ke.A,{defaultMessage:"Total time",id:"label.total_time.f448bdef"})})]})}),(0,N.jsx)(ho.Tbody,{children:s.length?(0,N.jsx)(N.Fragment,{children:s.map(e=>{const{challenge_template_stub_id:s,title:a,total_seconds:t}=e,i=g(t);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{to:`/admin/challenge-template/${s}`,children:(0,N.jsx)("strong",{children:a})},s)}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)(Fl,{inline:!0,children:[i.value," ",i.label]})})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No challenges found.",id:"label.no_challenges_found.611bf615"})})})})]})}),(0,N.jsx)(Lr,{count:this.state.count_challenges_ma,page:this.state.page_number_challenges_ma,page_size:this.state.page_size_challenges_ma,onChange:e=>{this.setState({page_number_challenges_ma:e},()=>{this.getMostActiveChallenges()})}})]})})]})})]}),(0,N.jsx)(Xw,{onRef:e=>this.picker=e,onSelect:this.handleSelectDate})]})}}
2var hD=(0,Ke.Ay)((0,P.G0)((0,Pe.y)(_T(sF(cD)))));const uD=l.createContext({}),mD=uD.Provider,gD=(uD.Consumer,()=>(0,l.useContext)(uD));var pD=e=>{const[s,a]=(0,ne.CQ)({activeKey:"purchases",loading:!1}),{activeKey:t,loading:i}=s;return(0,N.jsxs)(Ce.S,{className:"admin-shopping",children:[(0,N.jsxs)("h5",{className:"d-inline-flex align-items-center gap-2",children:[(0,N.jsx)(ze.AsH,{className:"text-primary",size:20}),(0,N.jsx)(ke.A,{defaultMessage:"Shopping management",id:"label.shopping_management.c189dfa8"})]}),(0,N.jsx)(Me.x_,{loading:i,children:(0,N.jsxs)(ld.A.Container,{activeKey:t,defaultActiveKey:"purchases",id:"adminShoppingTabs",mountOnEnter:!0,onSelect:e=>a({activeKey:e}),children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"purchases",children:(0,N.jsx)(ke.A,{defaultMessage:"Purchases",id:"label.purchases.a0718ef8"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"promos",children:(0,N.jsx)(ke.A,{defaultMessage:"Promos",id:"label.promos.ce509347"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"pricing",children:(0,N.jsx)(ke.A,{defaultMessage:"Pricing",id:"label.pricing.dfe95783"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"purchases",children:"purchases"===t&&(0,N.jsx)(kD.Purchases,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"promos",children:"promos"===t&&(0,N.jsx)(kD.Promos,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"pricing",children:"pricing"===t&&(0,N.jsx)(kD.Pricing,{})})]})]})})]})};var xD=e=>{const[s,a]=(0,l.useState)(null),[t,i]=(0,l.useState)(!1),{api:r}=(0,n.nm)(),o=()=>{a(null),e.handleHide()};return(0,N.jsxs)(xe,{onHide:()=>{o()},show:e.show,size:"md",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Issue Refund?",id:"label.issue_refund.76254ac8"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>a(null),show:s,variant:"danger",children:s}),t&&(0,N.jsx)("div",{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!t&&(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to issue this refund?",description:"",id:"label.are_you_sure_you_want_to_issue_thi.b3726bbd"})})}),(0,N.jsxs)(Ve.A,{className:"d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{onClick:()=>{e.handleHide()},style:{marginRight:8},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{onClick:()=>(async()=>{if(null!=e.purchase_id){try{i(!0),await r.post(`/api/shopping/purchase/refund/${e.purchase_id}`),i(!1),e.loadPurchases(),o()}catch(s){i(!1),a(null===s||void 0===s?void 0:s.err)}e.issueRefund()}})(),children:(0,N.jsx)(ke.A,{defaultMessage:"Yes",id:"label.yes.85a39ab3"})})]})]})]})]})};const vD=["cartridge_template","challenge_template","group_assignment_template","price","quantity"],fD=e=>{const[s,a]=(0,l.useState)(null),[t,i]=(0,l.useState)(!0),[r,o]=(0,l.useState)({organization:{},organization_member:{},payment_intent:{},payment_method:{},shopping_purchase:{},shopping_purchase_items:[]}),d=(0,ja.A)(),{api:c}=(0,n.nm)(),h={requires_action:d.formatMessage({id:"label.customer_did_not_complete_the_chec.b8eaeab1",defaultMessage:"Customer did not complete the checkout."}),requires_payment_method:d.formatMessage({id:"label.customers_payment_failed_on_the_ch.86ab13bc",defaultMessage:"Customer's payment failed on the checkout page."}),succeeded:d.formatMessage({id:"label.customer_completed_payment_on_the.d482d25a",defaultMessage:"Customer completed payment on the checkout page."})},[u,m]=(0,l.useState)("challenges"),{billing_details:g,card:p}=r.payment_method||{},{address:x,email:v,name:f}=g||{},{country:j,postal_code:_}=x||{},{currency:b,order_number:A,total:y}=r.shopping_purchase,{status:w}=r.payment_intent,{id:S,name:C}=r.organization,{group_memberships:M=[]}=r.organization_member;return(0,N.jsxs)(xe,{className:"admin-purchase-detail-modal",onHide:()=>{"function"==typeof e.onHide&&e.onHide(),a(null)},show:e.show,size:"lg",onShow:()=>{(async()=>{try{i(!0);const s=await c.get("/api/shopping/purchase/"+e.purchaseId);o(s),i(!1)}catch(s){a(s.err),i(!1)}})()},children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Purchase details",id:"label.purchase_details.8a7b2d4d"})})}),(0,N.jsxs)(xe.Body,{children:[t&&(0,N.jsx)("div",{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>a(null),show:s,variant:"danger",children:s}),!t&&null==s&&(0,N.jsxs)("div",{className:"purchase-detail-content px-3",children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"payment d-flex flex-column ps-0",lg:6,xs:12,children:[(0,N.jsx)("div",{className:"mb-3",children:(0,N.jsx)("div",{className:"d-flex",children:(0,N.jsxs)("h5",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Order #",id:"label.order.a458d68f"})," ",A]})})}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Card",id:"label.card.be3702e3"})}),(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{className:"text-capitalize",children:`${null===p||void 0===p?void 0:p.brand} `}),(0,N.jsxs)("span",{children:["\u2022\u2022\u2022 ",null===p||void 0===p?void 0:p.last4]})]})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Transaction status",id:"label.transaction_status.7c347b38"})}),(0,N.jsx)("p",{children:h[w]})]})]}),(0,N.jsx)(Ve.A,{className:"billing d-flex justify-content-between pe-0 ps-0 ps-lg-3",lg:6,xs:12,children:(0,N.jsxs)("div",{className:"d-flex flex-column",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Bill to",id:"label.bill_to.9ec78118"})}),(0,N.jsx)("p",{className:"mb-0",children:f}),(0,N.jsx)("p",{className:"mb-0",children:_}),(0,N.jsx)("p",{className:"mb-0",children:j}),(0,N.jsx)("p",{className:"mb-0",children:v})]})})]}),(0,N.jsx)(Qe.A,{className:"order-summaries",children:(0,N.jsx)(Ve.A,{className:"px-0",xs:12,children:(0,N.jsxs)(ld.A.Container,{activeKey:u,defaultActiveKey:"challenges",id:"invoiceDetailsTabs",mountOnEnter:!0,onSelect:e=>m(e),children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"challenges",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"provisioned",children:(0,N.jsx)(ke.A,{defaultMessage:"Provisioned",id:"label.provisioned.a73be043"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"challenges",children:(0,N.jsx)(Ge.A,{className:"mb-3 mb-lg-0 mt-3",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h5",{style:{paddingLeft:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Items",id:"label.items.fb8e7a1a"})}),(0,N.jsxs)("div",{className:"shopping-list",children:[(0,N.jsx)("div",{className:"shopping-list-items-container px-3",children:r.shopping_purchase_items.length>0&&r.shopping_purchase_items.map((e,s)=>{let{cartridge_template:a,challenge_template:t,group_assignment_template:i,price:l,quantity:n}=e;(0,he.A)(e,vD);const r=a||t||i||null;return(0,N.jsx)("div",{className:"shopping-list-item py-3 read-only",children:(0,N.jsxs)("div",{className:"item-inner",children:[(0,N.jsx)("div",{className:"item-image-container me-3",children:(0,N.jsx)("div",{className:"item-image",style:{backgroundImage:`url(${(null===r||void 0===r?void 0:r.cover_path)||pc})`}})}),(0,N.jsxs)("div",{className:"item-details pe-3",children:[(0,N.jsx)("div",{className:"item-title-subject d-flex flex-column align-self-center",children:(0,N.jsx)("strong",{className:"item-title",children:null===r||void 0===r?void 0:r.title})}),(0,N.jsx)("div",{className:"item-price-breakdown",children:(0,N.jsxs)("p",{className:"m-0 text-end",children:[(0,N.jsxs)("span",{className:"d-block",children:[(0,N.jsx)(Gh.Gr,{currency:b,style:"currency",value:l/100})," x ",n,"\xa0",(0,N.jsx)(ke.A,{defaultMessage:"learners",id:"label.learners.dc2ae857"})]}),(0,N.jsx)("strong",{children:(0,N.jsx)(Gh.Gr,{currency:b,style:"currency",value:l/100*n})})]})})]})]})},s)})}),(0,N.jsx)("div",{className:"shopping-list-total py-3",children:(0,N.jsxs)("div",{className:"d-flex justify-content-between",children:[(0,N.jsx)("p",{className:"h6",children:(0,N.jsx)(ke.A,{defaultMessage:"Total",id:"label.total.c9b3c382"})}),(0,N.jsx)("p",{className:"h5 m-0 total-price",children:(0,N.jsx)(Gh.Gr,{currency:b,style:"currency",value:y/100})})]})})]})]})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"provisioned",children:(0,N.jsxs)(Ge.A,{className:"mt-3",children:[(0,N.jsx)("h5",{className:"ps-3 pt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Memberships",id:"label.memberships.b50f1a42"})}),(0,N.jsxs)(qa.A,{className:"m-0",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",description:"",id:"label.groups.39bbb719"})})]})}),(0,N.jsx)("tbody",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(Le.Link,{to:"/admin/organization/"+S,children:C})}),(0,N.jsx)("td",{children:M.length>0?M.map(e=>{var s,a;const{group:t}=e,i=null!==(s=null===t||void 0===t?void 0:t.id)&&void 0!==s?s:-1,l=null!==(a=null===t||void 0===t?void 0:t.name)&&void 0!==a?a:"Unknown";return(0,N.jsx)("div",{children:(0,N.jsx)(Le.Link,{to:"/admin/group/"+i,children:l})},i)}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"None",id:"label.none.dc937b59"})})})})]})})]})]})})]})})})]})})})]})]})]})};
2class jD extends l.Component{constructor(e){var s;super(e),s=this,this.loadPurchases=async()=>{const{app:e}=this.props,{page:s,page_size:a,search_term:t,sort_direction:i,sort_token:l}=this.state;this.setState({loading:!0}),await e.api.get(`/api/shopping/purchases/list/${s}/${a}`,{search_term:t,sort_direction:i,sort_token:l}).then(e=>{let{count:s,purchases:a}=e;this.setState({count:s,loading:!1,purchases:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.handleSort=(e,s)=>{this.setState({page:1,sort_direction:s,sort_token:e},async()=>{await this.loadPurchases()})},this.issueRefund=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null==e)return;const{app:{api:a}}=s.props;try{s.setState({loading:!0}),await a.post(`/api/shopping/purchase/refund/${e}`),await s.loadPurchases()}catch({err:err}){s.setState({error:err,loading:!1})}},this.startSearch=e=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1,search_term:e},()=>{this.loadPurchases()})},1e3)},this.styledPurchaseStatus=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(null==e)return;let s=(0,N.jsx)("span",{className:"text-center",style:{textTransform:"capitalize"},children:(0,N.jsx)(ke.A,{defaultMessage:e,id:"label.status"})});switch(e){case"failed":return(0,N.jsx)(bo.A,{bg:"danger",children:s});case"pending":return(0,N.jsx)(bo.A,{bg:"warning",children:s});case"succeeded":return(0,N.jsx)(bo.A,{bg:"primary",children:s});default:return s}},this.state={count:0,display_purchase_details:null,display_refund_prompt:null,error:null,loading:!0,page:1,page_size:20,purchases:[],search_term:"",sort_direction:"DESC",sort_token:"created_at"},this.search_timer=null}componentDidMount(){this.loadPurchases()}render(){const{count:e,error:s,loading:a,page:t,page_size:i,purchases:l,sort_direction:n,sort_token:r}=this.state;return(0,N.jsxs)(Ge.A,{body:!0,className:"admin-shopping",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:s,variant:"danger",children:s}),(0,N.jsxs)(Ei.A,{className:"float-start",size:"sm",style:{marginBottom:10,marginRight:10,width:"40%"},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:e=>this.startSearch(e.target.value),placeholder:"Search"})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(ho,{defaultSortDirection:n,defaultSortToken:r,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"date",children:(0,N.jsx)(ke.A,{defaultMessage:"Date",id:"label.date.99c40ab4"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{className:"sortable",children:(0,N.jsx)(ke.A,{defaultMessage:"Email address",id:"label.email_address.f2488fd4"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"subtotal",children:(0,N.jsx)(ke.A,{defaultMessage:"Subtotal",id:"label.subtotal.8c0f2cb3"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"total",children:(0,N.jsx)(ke.A,{defaultMessage:"Total",id:"label.total.c9b3c382"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"refundstatus",children:(0,N.jsx)(ke.A,{defaultMessage:"Refund status",id:"label.refund_status.1ea741c5"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:a,children:null!==l&&void 0!==l&&l.length?(0,N.jsx)(N.Fragment,{children:l.map(e=>{var s,a,t,i;const{fullname:l}=e.user,n=null!==(s=null===(a=e.user)||void 0===a||null===(t=a.default_email)||void 0===t?void 0:t.email_address)&&void 0!==s?s:"-",{id:r,created_at:o,currency:d,subtotal:c,total:h}=e,u=ci()(o).format("M/D/YYYY, h:mm a");return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"purchase_date",children:o?u:"-"}),(0,N.jsxs)(ho.Td,{children:[(0,N.jsx)(Fl,{inline:!0,children:l}),(0,N.jsx)("br",{})]}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Fl,{inline:!0,maxWidth:150,children:[" ",n," "]})}),(0,N.jsx)(ho.Td,{className:"",children:c?(0,N.jsx)(Gh.Gr,{currency:d,style:"currency",value:c/100}):"-"}),(0,N.jsx)(ho.Td,{className:"",children:h?(0,N.jsx)(Gh.Gr,{currency:d,style:"currency",value:h/100}):"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:null!==e&&void 0!==e&&null!==(i=e.refund)&&void 0!==i&&i.status?this.styledPurchaseStatus(e.refund.status):"-"}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{size:"sm",variant:"primary"}),(0,N.jsxs)(li.A.Menu,{alignRight:!0,children:[(0,N.jsx)(li.A.Item,{href:"#",onClick:()=>{this.setState({display_purchase_details:r})},children:(0,N.jsx)(ke.A,{defaultMessage:"View invoice",id:"label.view_invoice.24cb98ea"})}),null===e.refund&&(0,N.jsx)(li.A.Item,{href:"#",onClick:()=>{this.setState({display_refund_prompt:r})},children:(0,N.jsx)(ke.A,{defaultMessage:"Issue refund",id:"label.issue_refund.973b1645"})})]})]})})]},r)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-danger",colSpan:"7",children:(0,N.jsx)(ke.A,{defaultMessage:"No purchases found",id:"label.no_purchases_found.7131dc7f"})})})})]})}
2),(0,N.jsx)(Lr,{count:e,onChange:e=>{this.setState({page:e},()=>{this.loadPurchases()})},page:t,page_size:i}),(0,N.jsx)(fD,{onHide:()=>this.setState({display_purchase_details:null}),purchaseId:this.state.display_purchase_details,show:!!this.state.display_purchase_details}),(0,N.jsx)(xD,{handleHide:()=>this.setState({display_refund_prompt:null}),issueRefund:e=>this.issueRefund(e),loadPurchases:this.loadPurchases,purchase_id:this.state.display_refund_prompt,show:Boolean(this.state.display_refund_prompt)})]})}}var _D=(0,n.G0)((0,Ke.Ay)(jD));class bD extends l.Component{constructor(e){super(e),this.state={error:null,saving:!1,show:!1},this.handleHide=this.handleHide.bind(this)}createCode(e){const{app:s}=this.props,a=s.api;return this.setState({error:null,saving:!0}),a.post("/api/shopping/promos/add",{code:e.code,discount_pct:e.discount_pct,end:e.end,maximum_discount_amount:e.maximum_discount_amount,maximum_discount_currency:e.maximum_discount_currency,start:e.start}).then(()=>{this.handleHide()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,saving:!1})})}editCode(e,s){const{app:a}=this.props,t=a.api;return this.setState({error:null,saving:!0}),t.post("/api/shopping/promos/edit",{code:s.code,code_id:e,discount_pct:s.discount_pct,end:s.end,maximum_discount_amount:s.maximum_discount_amount,maximum_discount_currency:s.maximum_discount_currency,start:s.start}).then(()=>{this.handleHide()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,saving:!1})})}handleHide(){"function"==typeof this.props.onHide&&this.props.onHide(),this.setState({show:!1})}show(){this.setState({show:!0})}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}render(){const{app:e,promo_code:s}=this.props,{locale:a}=e;return(0,N.jsx)(xe,{onHide:this.handleHide,show:this.state.show,children:(0,N.jsx)(ds.l1,{validationSchema:(0,Re.by)({locale:a,scope:"shopping.add_promo_code"}),initialValues:{code:(null===s||void 0===s?void 0:s.code)||"",discount_pct:(null===s||void 0===s?void 0:s.discount_pct)||0,end:(null===s||void 0===s?void 0:s.end)||new Date,maximum_discount_amount:(null===s||void 0===s?void 0:s.maximum_discount_amount)||"",maximum_discount_currency:(null===s||void 0===s?void 0:s.maximum_discount_currency)||"usd",start:(null===s||void 0===s?void 0:s.start)||new Date},onSubmit:(e,a)=>{let t={code:e.code,discount_pct:e.discount_pct,end:e.end,maximum_discount_amount:e.maximum_discount_amount,maximum_discount_currency:e.maximum_discount_currency,start:e.start};s?this.editCode(s.id,t):this.createCode(t)},render:e=>{let{dirty:a,errors:t,handleChange:i,handleSubmit:l,isSubmitting:n,setFieldTouched:r,setFieldValue:o,touched:d,values:c}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:(s?"Edit":"Create")+" Promo Code",id:"label.create_promo_code"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsxs)(_e.A,{onSubmit:l,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Promo code",id:"label.promo_code.ec0c2188"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:d.code&&t.code,isValid:d.code&&!t.code,name:"code",onChange:i,type:"text",value:c.code}),t.code&&d.code&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:t.code})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Discount percent",id:"label.discount_percent.200ec138"})}),(0,N.jsxs)(Ei.A,{className:"mb-3",children:[(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:d.discount_pct&&t.discount_pct,isValid:d.discount_pct&&!t.discount_pct,name:"discount_pct",onChange:i,type:"text",value:c.discount_pct}),(0,N.jsx)(Ei.A.Text,{children:"%"})]}),t.discount_pct&&d.discount_pct&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:t.discount_pct})]})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Maximum discount amount",id:"label.maximum_discount_amount.66cd4dbc"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{children:"$"}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:d.maximum_discount_amount&&t.maximum_discount_amount,isValid:d.maximum_discount_amount&&!t.maximum_discount_amount,name:"maximum_discount_amount",type:"text",value:c.maximum_discount_amount?c.maximum_discount_amount/100:c.maximum_discount_amount,onChange:e=>{let s=Number.parseInt(e.target.value)||0;s*=100,o("maximum_discount_amount",s)}})]}),t.maximum_discount_amount&&d.maximum_discount_amount&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:t.maximum_discount_amount})]})})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)(_c(),{disabled:this.state.saving,isInvalid:d.start&&t.start,isValid:d.start&&!t.start,name:"start_date",value:c.start,onCh
2ange:e=>{"undefined"!==typeof e.unix&&(o("start",new Date(1e3*e.unix())),r("start"))}}),t.start&&d.start&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:t.start})]})}),(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"End date",id:"label.end_date.14303aa0"})}),(0,N.jsx)(_c(),{disabled:this.state.saving,isInvalid:d.end&&t.end,isValid:d.end&&!t.end,name:"end",value:c.end,onChange:e=>{"undefined"!==typeof e.unix&&(o("end",new Date(1e3*e.unix())),r("end"))}}),t.end&&d.end&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:t.end})]})})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:()=>{this.handleHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:l,variant:"primary",children:"Save changes"})]})]})}})})}}var AD=(0,n.G0)(_T(nT(bD)));class yD extends l.Component{constructor(e){super(e),this.state={count:0,error:null,loading:!0,page:1,page_size:20,promo_code:null,promos:[],sort_direction:"DESC",sort_token:"created_at"},this.dialog=(0,l.createRef)(),this.promo_code_editor=null,this.handleSort=this.handleSort.bind(this)}async loadPromos(){const{app:e}=this.props,{page:s,page_size:a,sort_direction:t,sort_token:i}=this.state;this.setState({loading:!0}),e.api.get(`/api/shopping/promos/list/${s}/${a}`,{sort_direction:t,sort_token:i}).then(e=>{let{count:s,promos:a}=e;this.setState({count:s,loading:!1,promos:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}handleSort(e,s){this.setState({page:1,sort_direction:s,sort_token:e},async()=>{await this.loadPromos()})}deletePromoCode(e){const{app:s}=this.props,a=s.api;this.setState({loading:!0}),a.post("/api/shopping/promos/delete",{code_id:e}).then(()=>{this.loadPromos()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}expirePromoCode(e){const{app:s}=this.props,a=s.api;this.setState({loading:!0}),a.post("/api/shopping/promos/expire",{code_id:e}).then(()=>{this.loadPromos()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}componentDidMount(){this.loadPromos()}render(){const{app:e}=this.props,{count:s,error:a,loading:t,page:i,page_size:l,promos:n,sort_direction:r,sort_token:o}=this.state;return(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:a,variant:"danger",children:a}),t&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!t&&!a&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{children:[e.userHasRight("manage_shopping")&&(0,N.jsx)(ve.A,{className:"float-end mb-2",onClick:()=>{this.promo_code_editor.show()},size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Add promo code",description:"",id:"label.add_promo_code.cff81502"})}),(0,N.jsxs)(ho,{defaultSortDirection:r,defaultSortToken:o,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"code",children:(0,N.jsx)(ke.A,{defaultMessage:"Code",id:"label.code.340f4630"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"discount_pct",children:(0,N.jsx)(ke.A,{defaultMessage:"Discount %",id:"label.discount_percent.c21068bb"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"maximum_discount_amount",children:(0,N.jsx)(ke.A,{defaultMessage:"Maximum discount",id:"label.maximum_discount.b97d28b1"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"start",children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"end",children:(0,N.jsx)(ke.A,{defaultMessage:"End date",id:"label.end_date.14303aa0"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:t,children:null!==n&&void 0!==n&&n.length?(0,N.jsx)(N.Fragment,{children:this.state.promos.map(e=>{const s=new Date,a=new Date(e.start),t=new Date(e.end),i=t<=s?"Expired":"Active",l=e.maximum_discount_amount?e.maximum_discount_amount/100:null;let n="";switch(i){case"Active":n="primary";break;case"Expired":n="secondary"}return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)("strong",{children:e.code})}),(0,N.jsxs)(ho.Td,{children:[e.discount_pct,"%"]}),(0,N.jsx)(ho.Td,{children:null!=l?"$"+l:"-"}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Gh.XU,{value:a})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Gh.XU,{value:t})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(bo.A,{bg:n,children:i})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{size:"sm",variant:"primary"}),(0,N.jsxs)(li.A.Menu,{align:"end",children:["Active"==i&&(0,N.jsx)(li.A.Item,{href:"#",onClick:()=>{this.dialog.current.show({actions:[this.dialog.current.CancelAction(),this.dialog.current.Action({label:"Expire",onClick:()=>this.expirePromoCode(e.id),variant:"danger"})],body:"Are you sure you want to expire this promo code?",size:"sm",title:"Expire promo code"})},children:(0,N.jsx)(ke.A,{defaultMessage:"Expire",id:"label.expire.1c29efcc"})}),(0,N.jsx)(li.A.Item,{onClick:()=>{this.setState({promo_code:e}),this.promo_code_editor.show()},children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})}),(0,N.jsx)(li.A.Item,{onClick:()=>{this.dialog.current.show({actions:[this.dialog.current.CancelAction(),this.dialog.current.Action({label:"Delete",onClick:()=>this.deletePromoCode(e.id),variant:"danger"})],body:"Are you sure you want to delete this promo code?",size:"sm",title:"Delete promo code"})},children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-danger",colSpan:"7",children:(0,N.jsx)(ke.A,{defaultMessage:"No promos found",id:"label.no_promos_found.25c8acd3"})})})})]})]}),(0,N.jsx)(Lr,{count:s,onChange:e=>this.setState({page:e},this.loadPurchases),page:i,page_size:l}),(0,N.jsx)(AD,{onHide:()=>this.setState({promo_code:null},this.loadPromos),onRef:e=>this.promo_code_editor=e,promo_code:this.state.promo_code}),(0,N.jsx)(je,{ref:this.dialog})]})]})}}var wD=(0,P.G0)(yD);var ND=s=>{const{api:a}=(0,P.nm)(),[t,i]=(0,ne.CQ)({error:null,item_types:[],loading:!0}),{error:n,item_types:r,loading:o}=t,d=async()=>{const{item_types:e}=await a.get("/api/shopping/item-types/list");i({item_types:e})};(0,l.useEffect)(()=>{i({error:null,loading:!0}),Promise.all([d()]).then(()=>{i({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:s,loading:!1})})},[]);const c={handleFetchItemTypes:async()=>{try{i({loading:!0}),await d(),i({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i({error:a,loading:!1})}}};return(0,N.jsx)(CD,{value:(0,F.A)({},c),children:(0,N.jsxs)(Ce.S,{className:"admin-shopping-settings pb-3",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>i({error:null}),show:n,variant:"danger",children:n}),(0,N.jsx)(Me.x_,{loading:o,children:(0,N.jsx)(Qe.A,{className:"m-0 gap-3 gap-lg-0",children:(null===r||void 0===r?void 0:r.length)&&r.map((e,s)=>(0,N.jsx)(MD,{item_type:e},s))})})]})})};const SD=l.createContext({}),CD=SD.Provider;SD.Consumer;SD.displayName="AdminShoppingPricingContext";var MD=s=>{const{item_type:a}=s,{max:t,min:i,name:r,price:o}=a,{api:d}=(0,n.nm)(),{formatMessage:c}=(0,ja.A)(),{handleFetchItemTypes:h}=(0,l.useContext)(SD),u=(0,l.useRef)(),[m,g]=(0,ne.CQ)({editing:!1,error:null,saving:!1}),{editing:p,error:x,saving:v}=m,f=e=>Number.parseInt(e||0)/100,j=e=>100*Number.parseInt(e||0),_=()=>g({editing:!m.editing}),{errors:b,handleChange:A,handleSubmit:y,initialValues:w,resetForm:S,values:C}=(0,ds.Wx)({initialValues:{max:t,min:i,price:f(o)},onSubmit:s=>{const t=null===u||void 0===u?void 0:u.current;if(!t)return;const{max:i,min:l,price:n}=a,{max:r,min:o,price:m}=s,p=!(0,T.isEqual)(n,j(m)),x=!(0,T.isEqual)(l,o),v=!(0,T.isEqual)(i,r);t.show({actions:[t.CancelAction(),t.Action({label:c({id:"label.confirm.eebdd24a",defaultMessage:"Confirm"}),onClick:()=>(async s=>{let{max:t,min:i,price:l}=s;try{g({error:null,saving:!0}),await d.post("/api/shopping/item-type/set",{id:null===a||void 0===a?void 0:a.id,max:t,min:i,price:j(l)}),g({editing:!1,saving:!1}),await h()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:a,saving:!1})}})(s)})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"You are about to make the following changes:",id:"label.you_are_about_to_make_the_followin.332a399f"})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h5",{className:"text-capitalize",children:a.name}),p&&(0,N.jsxs)("p",{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Unit price:",id:"label.unit_price.ce9109d8"})}),(0,N.jsxs)("small",{className:"text-muted text-decoration-line-through fw-semibold",children:["$",f(n).toFixed(2)]}),(0,N.jsx)(ze.Z0P,{}),(0,N.jsxs)("span",{className:"fw-bold",children:["$",m.toFixed(2)]})]}),x&&(0,N.jsxs)("p",{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Min quantity:",id:"label.min_quantity.cca67c5f"})}),(0,N.jsx)("small",{className:"text-muted text-decoration-line-through fw-semibold",children:l}),(0,N.jsx)(ze.Z0P,{}),(0,N.jsx)("sma",{className:"fw-bold",children:o})]}),v&&(0,N.jsxs)("p",{className:"d-flex gap-1 align-items-center",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Max quantity:",id:"label.max_quantity.799ca957"})}),(0,N.jsx)("small",{className:"text-muted text-decoration-line-through fw-semibold",children:i}),(0,N.jsx)(ze.Z0P,{}),(0,N.jsx)("strong",{className:"fw-bold",children:r})]}),(0,N.jsx)("hr",{}),(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Changes will be reflected immediately for all users throughout the SaaS Marketplace.",id:"label.changes_will_be_reflected_immediat.b198bc4f"})})]}),title:c({id:"label.review_changes.6a47708f",defaultMessage:"Review changes"})})}});return(0,N.jsxs)(Ve.A,{lg:4,xs:12,children:[(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(_e.A,{onSubmit:y,children:[(0,N.jsx)(Ge.A.Header,{className:"d-flex align-items-center justify-content-between",children:(0,N.jsx)(Ge.A.Title,{className:"text-capitalize",children:r})}),(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-2",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:x,variant:"danger",children:x}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Unit price",id:"label.unit_price.e5018fc9"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{children:"$"}),(0,N.jsx)(_e.A.Control,{autoComplete:"off",disabled:!p||v,inputMode:"numeric",isInvalid:!(null===b||void 0===b||!b.price),min:0,name:"price",onChange:A,onKeyPress:e=>{const{key:s,preventDefault:a}=e,t=Number.parseInt(s);isNaN(t)&&a()},readOnly:!p||v,type:"number",value:C.price}),(0,N.jsx)(Ei.A.Text,{children:".00"})]})]}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Order quantity",id:"label.order_quantity.b50b863a"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-3",children:[(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ke.A,{defaultMessage:"Min",id:"label.min.dea79332"})}),(0,N.jsx)(_e.A.Control,{autoComplete:"off",disabled:!p||v,inputMode:"numeric",min:1,name:"min",onChange:A,type:"number",value:C.min})]}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ke.A,{defaultMessage:"Max",id:"label.max.a1a5936d"})}),(0,N.jsx)(_e.A.Control,{autoComplete:"off",disabled:!p||v,inputMode:"numeric",min:C.min+1,name:"max",onChange:A,type:"number",value:C.max})]})]})]})]}),(0,N.jsx)(Ge.A.Footer,{className:"d-flex justify-content-end gap-2",children:p?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onClick:async()=>{_(),await S()},size:"sm",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}
2),(0,N.jsx)(Me.p0,{disabled:v||(0,T.isEqual)(w,C),loading:v,size:"sm",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]}):(0,N.jsx)(ve.A,{onClick:_,size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})})})]})}),(0,N.jsx)(je,{ref:u})]})},kD={Pricing:ND,Promos:wD,Purchases:_D};const zD=(0,l.createContext)({}),TD=zD.Provider,ID=()=>(0,l.useContext)(zD);var ED=()=>{var s,a,t,i,n;const r=ID(),{formatMessage:o}=(0,ja.A)(),d=async()=>{r.setState({challenge_options:[],error:null,generating:!0,selected_option:null});try{const e=await r.api.post("/api/challenge-wizard/generate-options",{audience:r.audience_name,context_notes:`${r.organization_type?`Organization type: ${r.organization_type}. `:""}${r.context_notes}`,desired_outcome:r.desired_outcome,problem_description:r.problem_description,subject:r.subject_name,use_ai:!!r.use_ai}),s=Array.isArray(null===e||void 0===e?void 0:e.options)?e.options:[];r.setState({challenge_options:s,error:s.length?null:"The AI didn't return any options. Please try again.",generating:!1})}catch(e){r.setState({error:(null===e||void 0===e?void 0:e.err)||"Failed to generate options.",generating:!1})}},c=Array.isArray(r.challenge_options)?r.challenge_options:[];(0,l.useEffect)(()=>{c.length||r.generating||d()},[]);const h=(null===(s=r.title)||void 0===s?void 0:s.length)>=4&&(null===(a=r.challenge_statement)||void 0===a?void 0:a.length)>=100;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 02",id:"label.step_02.47a2334b"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Pick your mission",id:"label.pick_your_mission.c29cf6ae"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"We generated challenge options based on your inputs. Select the one that excites you most, or write your own.",id:"label.we_generated_challenge_options_bas.37b4142e"})}),r.error&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r.setState({error:null}),variant:"danger",children:r.error}),r.generating?(0,N.jsxs)(Ce.S,{className:"ccw-generating",children:[(0,N.jsx)(qt.A,{animation:"border",className:"mb-3",variant:"primary"}),(0,N.jsx)("h3",{className:"ccw-generating-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Generating challenge options...",id:"label.generating_challenge_options.394c5c26"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-challenge-cards",children:c.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"ccw-challenge-card "+(r.selected_option===s?"selected":""),onClick:()=>(e=>{const s=c[e];s&&r.setState({challenge_statement:s.challenge_statement,selected_option:e,show_custom:!1,title:s.title})})(s),role:"button",children:[(0,N.jsx)(Ce.S,{className:"ccw-card-number",children:s+1}),(0,N.jsx)("h5",{children:e.title}),(0,N.jsx)("p",{children:e.challenge_statement})]},s))}),(0,N.jsxs)(Ce.S,{className:"mb-3",children:[(0,N.jsxs)("button",{className:"ccw-other-toggle",onClick:()=>{r.setState({challenge_statement:r.custom_statement,selected_option:null,show_custom:!r.show_custom,title:r.custom_title})},type:"button",children:[(0,N.jsx)(ze.OiG,{size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Write my own",id:"label.write_my_own.d6f5896b"})]}),r.show_custom&&(0,N.jsxs)(Ce.S,{className:"mt-3",style:{animation:"ccw-fade-up 0.2s ease"},children:[(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge title",id:"label.challenge_title.f741a3ee"})}),(0,N.jsx)(_e.A.Control,{maxLength:100,onChange:e=>r.setState({custom_title:e.target.value,title:e.target.value}),placeholder:o({id:"label.your_challenge_title.7df8316d",defaultMessage:"Your challenge title..."}),value:r.custom_title}),(0,N.jsxs)("small",{className:"ccw-char-count",children:[(null===(t=r.custom_title)||void 0===t?void 0:t.length)||0," / 100"]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge statement",id:"label.challenge_statement.85ddafbd"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",maxLength:2e3,onChange:e=>r.setState({challenge_statement:e.target.value,custom_statement:e.target.value}),placeholder:o({id:"label.your_mission_should_you_choose_to.62e31396",defaultMessage:"Your mission, should you choose to accept it..."}),rows:3,value:r.custom_statement}),(0,N.jsxs)("small",{className:"ccw-char-count",children:[(null===(i=r.custom_statement)||void 0===i?void 0:i.length)||0," / 2,000",((null===(n=r.custom_statement)||void 0===n?void 0:n.length)||0)<100&&(0,N.jsx)("span",{className:"text-warning ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"(min 100 characters)",id:"label.min_100_characters.ddc696b1"})})]})]})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-actions",children:[(0,N.jsx)(ve.A,{onClick:()=>r.prevStep(),variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsxs)(ve.A,{disabled:r.generating,onClick:d,variant:"outline-secondary",children:[(0,N.jsx)(ze.DIg,{className:"me-1",size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Regenerate",id:"label.regenerate.1651031b"})]}),(0,N.jsxs)(ve.A,{disabled:!h,onClick:()=>r.nextStep(),size:"lg",children:[(0,N.jsx)(ke.A,{defaultMessage:"Configure challenge",id:"label.configure_challenge.f0acb947"}),(0,N.jsx)(ze.Z0P,{className:"ms-2",size:14})]})]})]})]})};const FD=["Basic","Emerging","Strong","Exemplary"];var RD=()=>{var s;const a=ID(),{formatMessage:t}=(0,ja.A)(),[i,n]=(0,ne.CQ)({cert_search:"",certifications:[],competencies:[],editor_error:null,editor_generating:!1,editor_name:"",editor_open:!1,editor_original_name:null,editor_rubric:[[],[],[],[]],loading:!0,loading_recs:!1,mode:a.certification_template_id?"existing":a.certification_title||null!==(s=a.new_competencies)&&void 0!==s&&s.length?"create":"none"});(0,l.useEffect)(()=>{(async()=>{try{const[e,s]=await Promise.all([a.api.get("/api/challenge-wizard/certifications"),a.api.get("/api/certification-templates/global-competencies")]);n({certifications:(null===e||void 0===e?void 0:e.certifications)||[],competencies:(null===s||void 0===s?void 0:s.competencies)||[],loading:!1})}catch(e){n({loading:!1})}})()},[]);const r=()=>a.selected_competency_ids.length+a.new_competencies.length>=8,o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!e&&r()||n({editor_error:null,editor_generating:!1,editor_name:(null===e||void 0===e?void 0:e.name)||"",editor_open:!0,editor_original_name:(null===e||void 0===e?void 0:e.name)||null,editor_rubric:null!==e&&void 0!==e&&e.rubric&&Array.isArray(e.rubric)?e.rubric.map(e=>[...e]):[[],[],[],[]]})},d=()=>n({editor_error:null,editor_generating:!1,editor_name:"",editor_open:!1,editor_original_name:null,editor_rubric:[[],[],[],[]]}),c=(()=>{return"none"===i.mode||("existing"===i.mode?!!a.certification_template_id:"create"===i.mode&&(!(null===(e=a.certification_title)||void 0===e||!e.trim()||a.certification_title.trim().length<4)&&a.selected_competency_ids.length+a.new_competencies.length>0));var e})(),h=i.cert_search.trim().toLowerCase(),u=h?i.certifications.filter(e=>{var s,a;return(e.title||"").toLowerCase().includes(h)||((null===(s=e.stub)||void 0===s||null===(a=s.organization)||void 0===a?void 0:a.name)||"").toLowerCase().includes(h)}):i.certifications;return i.loading?(0,N.jsx)(Ce.S,{className:"ccw-generating",children:(0,N.jsx)(qt.A,{animation:"border",variant:"primary"})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 04",id:"label.step_04.9850cf71"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Attach a certification",id:"label.attach_a_certification.37f581fa"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"Link this challenge to a certification so teams develop specific competencies. You can skip, pick an existing certification, or author a new one.",id:"label.link_this_challenge_to_a_certifica.79c033c4"})}),a.error&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>a.setState({error:null}),variant:"danger",children:a.error}),(0,N.jsx)(Ce.S,{className:"ccw-cert-modes d-flex flex-wrap gap-3 mb-3",children:[{desc:t({id:"label.skip_this_no_cert_will_be_attached.4f33d212",defaultMessage:"Skip this \u2014 no cert will be attached."}),icon:(0,N.jsx)(ze.Rqy,{color:"var(--gray-400)",size:22}),key:"none",title:t({id:"label.no_certification.9acc4575",defaultMessage:"No certification"})},{desc:t({id:"label.attach_a_certification_you_already.4a95b680",defaultMessage:"Attach a certification you already have access to."}),icon:(0,N.jsx)(ze.SBv,{color:"var(--primary)",size:22}),key:"existing",title:t({id:"label.use_existing.616e9d01",defaultMessage:"Use existing"})}
2,{desc:t({id:"label.design_a_certification_with_compet.f55acd18",defaultMessage:"Design a certification with competencies and rubrics."}),icon:(0,N.jsx)(ze.T_n,{color:"var(--primary)",size:22}),key:"create",title:t({id:"label.author_new.78727c0d",defaultMessage:"Author new"})}].map(e=>{const s=i.mode===e.key;return(0,N.jsxs)(Ce.S,{className:"ccw-cert-mode-tile",onClick:()=>{return"none"===(s=e.key)?a.setState({certification_template_id:null,certification_title:"",custom_competency_names:[],new_competencies:[],selected_competency_ids:[]}):"existing"===s?a.setState({certification_title:"",new_competencies:[]}):"create"===s&&a.setState({certification_template_id:null}),void n({mode:s});var s},role:"button",style:{alignItems:"flex-start",background:s?"rgba(13,110,253,0.06)":"#fff",border:"1px solid "+(s?"var(--primary)":"var(--gray-300)"),borderRadius:8,cursor:"pointer",display:"flex",flex:"1 1 260px",flexDirection:"column",gap:8,minWidth:0,padding:16,position:"relative",transition:"border-color 0.15s ease, background 0.15s ease"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 w-100",children:[(0,N.jsx)(Ce.S,{style:{alignItems:"center",background:s?"var(--primary)":"transparent",border:"1.5px solid "+(s?"var(--primary)":"var(--gray-300)"),borderRadius:"50%",color:"#fff",display:"flex",flexShrink:0,height:18,justifyContent:"center",width:18},children:s&&(0,N.jsx)(ze.CMH,{size:10})}),e.icon,(0,N.jsx)("strong",{style:{fontSize:15},children:e.title})]}),(0,N.jsx)("p",{className:"m-0 text-muted",style:{fontSize:13,lineHeight:1.4},children:e.desc})]},e.key)})}),"existing"===i.mode&&(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)(_e.A.Control,{className:"mb-2",onChange:e=>n({cert_search:e.target.value}),placeholder:t({id:"label.search_certifications.a4ce710c",defaultMessage:"Search certifications..."}),value:i.cert_search}),0===u.length?(0,N.jsx)(Ce.S,{className:"text-muted text-center py-3",children:(0,N.jsx)(ke.A,{defaultMessage:"No certifications available. Create a new one instead, or skip this step.",id:"label.no_certifications_available_create.c1bff234"})}):(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-2",style:{maxHeight:320,overflowY:"auto"},children:u.map(e=>{var s;const t=a.certification_template_id===e.id,i=null===(s=e.stub)||void 0===s?void 0:s.organization;return(0,N.jsx)(Ce.S,{className:"ccw-agent-card "+(t?"selected":""),onClick:()=>{return s=e.id,void a.setState({certification_template_id:s});var s},role:"button",children:(0,N.jsxs)(Ce.S,{className:"ccw-agent-card-left",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-check",children:t&&(0,N.jsx)(ze.CMH,{size:10})}),(0,N.jsx)(Ce.S,{className:"ccw-agent-avatar",children:(0,N.jsx)(ze.SBv,{color:"var(--primary)",size:18})}),(0,N.jsxs)(Ce.S,{className:"ccw-agent-info",children:[(0,N.jsxs)(Ce.S,{className:"ccw-agent-name",children:[e.title,i?(0,N.jsx)(bo.A,{bg:"light",className:"ms-2",text:"dark",children:i.name}):(0,N.jsx)(ze.Eh_,{className:"ms-2 text-primary",size:12,title:"Global"})]}),e.description&&(0,N.jsx)("p",{className:"ccw-agent-rationale",children:e.description})]})]})},e.id)})})]}),"create"===i.mode&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification name",id:"label.certification_name.2a747624"})}),(0,N.jsx)(_e.A.Control,{maxLength:100,onChange:e=>a.setState({certification_title:e.target.value}),placeholder:t({id:"label.eg_design_thinking_practitioner.f8d4af1c",defaultMessage:"e.g. Design Thinking Practitioner"}),value:a.certification_title||""})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,N.jsxs)("label",{className:"ccw-form-label mb-0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Competencies",id:"label.competencies.ec64b47c"})," ",(0,N.jsxs)("small",{className:"text-muted",children:[a.selected_competency_ids.length+a.new_competencies.length," / ",8]})]}),(0,N.jsxs)(ve.A,{disabled:i.loading_recs||0===i.competencies.length,onClick:async()=>{n({loading_recs:!0});try{const e=await a.api.post("/api/challenge-wizard/recommend-competencies",{audience:a.audience_name,challenge_statement:a.challenge_statement,problem_description:a.problem_description,subject:a.subject_name,title:a.title}),t=(null===e||void 0===e?void 0:e.recommendations)||[],i=new Set(a.selected_competency_ids);for(const l of t){var s;if(null!==l&&void 0!==l&&null!==(s=l.competency)&&void 0!==s&&s.id){if(i.size+a.new_competencies.length>=8)break;i.add(l.competency.id)}}a.setState({selected_competency_ids:[...i]})}catch(e){a.setState({error:(null===e||void 0===e?void 0:e.err)||"Failed to recommend competencies."})}n({loading_recs:!1})},size:"sm",variant:"outline-secondary",children:[i.loading_recs?(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}):(0,N.jsx)(ze.T_n,{className:"me-1",size:11}),(0,N.jsx)(ke.A,{defaultMessage:"AI recommend",id:"label.ai_recommend.513166c9"})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-skill-grid",children:[i.competencies.map(e=>{const s=a.selected_competency_ids.includes(e.id);return(0,N.jsxs)(Ce.S,{className:"ccw-skill-card "+(s?"selected":""),onClick:()=>(e=>{const s=[...a.selected_competency_ids],t=s.indexOf(e);if(t>=0)s.splice(t,1);else{if(s.length+a.new_competencies.length>=8)return;s.push(e)}a.setState({selected_competency_ids:s})})(e.id),role:"button",children:[(0,N.jsx)(Ce.S,{className:"ccw-skill-check",children:s&&(0,N.jsx)(ze.CMH,{size:10})}),(0,N.jsx)("span",{children:e.name})]},`existing-${e.id}`)}),a.new_competencies.map(e=>(0,N.jsxs)(Ce.S,{className:"ccw-skill-card selected",onClick:()=>o(e),role:"button",title:t({id:"label.click_to_edit_rubric.e4f573d6",defaultMessage:"Click to edit rubric"}),style:{background:"rgba(122, 85, 216, 0.06)",borderColor:"var(--purple)",paddingRight:28,position:"relative"},children:[(0,N.jsx)(Ce.S,{className:"ccw-skill-check",style:{background:"var(--purple)"},children:(0,N.jsx)(ze.CMH,{size:10})}),(0,N.jsx)("span",{children:e.name}),(0,N.jsx)("button",{"aria-label":t({id:"label.remove_competency.
211e8a043",defaultMessage:"Remove competency"}),onClick:s=>{var t;s.stopPropagation(),t=e.name,a.setState({new_competencies:a.new_competencies.filter(e=>e.name!==t)})},type:"button",style:{background:"transparent",border:"none",color:"var(--gray-500)",cursor:"pointer",padding:2,position:"absolute",right:6,top:6},children:(0,N.jsx)(ze.QCr,{size:10})})]},`custom-${e.name}`)),(0,N.jsxs)(Ce.S,{className:"ccw-skill-card ccw-custom-add",onClick:()=>o(),role:"button",style:r()?{opacity:.5,pointerEvents:"none"}:void 0,children:[(0,N.jsx)(ze.OiG,{className:"mb-2",color:"var(--gray-400)",size:18}),(0,N.jsx)("span",{style:{color:"var(--gray-500)",fontSize:13},children:(0,N.jsx)(ke.A,{defaultMessage:"Create new",id:"label.create_new.9f3df753"})})]})]})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-actions",children:[(0,N.jsx)(ve.A,{onClick:()=>a.prevStep(),variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsxs)(ve.A,{disabled:!c,onClick:()=>a.nextStep(),size:"lg",children:[(0,N.jsx)(ke.A,{defaultMessage:"Choose AI teammates",id:"label.choose_ai_teammates.79d3e3b6"}),(0,N.jsx)(ze.Z0P,{className:"ms-2",size:14})]})]}),(0,N.jsxs)(ue.A,{centered:!0,backdrop:"static",onHide:d,show:i.editor_open,size:"lg",children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,children:(0,N.jsx)(ue.A.Title,{children:i.editor_original_name?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Mbp,{className:"me-2",size:14}),(0,N.jsx)(ke.A,{defaultMessage:"Edit competency",id:"label.edit_competency.b633dcf6"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.OiG,{className:"me-2",size:14}),(0,N.jsx)(ke.A,{defaultMessage:"New competency",id:"label.new_competency.f7aac9b3"})]})})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({editor_error:null}),show:!!i.editor_error,variant:"danger",children:i.editor_error}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Competency name",id:"label.competency_name.a303cfca"})}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,maxLength:120,onChange:e=>n({editor_name:e.target.value}),placeholder:t({id:"label.eg_stakeholder_analysis.b14a70a4",defaultMessage:"e.g. Stakeholder Analysis"}),value:i.editor_name})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,N.jsx)(_e.A.Label,{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Rubric",id:"label.rubric.f13a7850"})}),(0,N.jsxs)(ve.A,{disabled:i.editor_generating||!i.editor_name.trim(),onClick:async()=>{const s=(i.editor_name||"").trim();if(s.length<2)n({editor_error:t({id:"label.enter_a_name_before_generating_a_r.871e38ce",defaultMessage:"Enter a name before generating a rubric."})});else{n({editor_error:null,editor_generating:!0});try{const e=await a.api.post("/api/challenge-wizard/generate-rubric",{audience:a.audience_name,challenge_statement:a.challenge_statement,competency_name:s,subject:a.subject_name,title:a.title}),t=null===e||void 0===e?void 0:e.rubric;if(!Array.isArray(t))throw new Error("Bad rubric response");n({editor_generating:!1,editor_rubric:t})}catch(e){n({editor_error:(null===e||void 0===e?void 0:e.err)||t({id:"label.failed_to_generate_rubric.7d3bc75a",defaultMessage:"Failed to generate rubric."}),editor_generating:!1})}}},size:"sm",variant:"outline-secondary",children:[i.editor_generating?(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm"}):i.editor_rubric.some(e=>e.length>0)?(0,N.jsx)(ze.DIg,{className:"me-1",size:11}):(0,N.jsx)(ze.T_n,{className:"me-1",size:11}),i.editor_rubric.some(e=>e.length>0)?(0,N.jsx)(ke.A,{defaultMessage:"Regenerate with AI",id:"label.regenerate_with_ai.ccf805df"}):(0,N.jsx)(ke.A,{defaultMessage:"AI generate rubric",id:"label.ai_generate_rubric.671cbf75"})]})]}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-3",children:FD.map((e,s)=>{const a=i.editor_rubric[s]||[];return(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-1",children:[(0,N.jsx)("strong",{style:{fontSize:13},children:e}),0===a.length&&(0,N.jsx)("p",{className:"text-muted small m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No constraints yet.",id:"label.no_constraints_yet.18d5a177"})}),a.map((e,a)=>(0,N.jsxs)(Ce.S,{className:"d-flex gap-1",children:[(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>((e,s,a)=>{const t=i.editor_rubric.map(e=>[...e]);t[e][s]=a,n({editor_rubric:t})})(s,a,e.target.value),rows:2,size:"sm",value:e}),(0,N.jsx)(ve.A,{onClick:()=>((e,s)=>{const a=i.editor_rubric.map((a,t)=>t===e?a.filter((e,a)=>a!==s):a);n({editor_rubric:a})})(s,a),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ze.QCr,{size:9})})]},a)),(0,N.jsxs)(ve.A,{className:"align-self-start",onClick:()=>(e=>{const s=i.editor_rubric.map(e=>[...e]);s[e]=[...s[e],""],n({editor_rubric:s})})(s),size:"sm",variant:"link",children:[(0,N.jsx)(ze.OiG,{className:"me-1",size:9}),(0,N.jsx)(ke.A,{defaultMessage:"Add constraint",id:"label.add_constraint.728a4aa7"})]})]},s)})})]}),(0,N.jsxs)(ue.A.Footer,{children:[(0,N.jsx)(ve.A,{onClick:d,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!i.editor_name.trim()||i.editor_generating,onClick:()=>{const e=(i.editor_name||"").trim();if(e.length<2)return void n({editor_error:t({id:"label.enter_a_competency_name_at_least_2.c7ef6b77",defaultMessage:"Enter a competency name (at least 2 characters)."})});const s=e.toLowerCase(),l=i.competencies.some(e=>
2e.name.toLowerCase()===s),r=a.new_competencies.some(e=>e.name.toLowerCase()===s&&e.name!==i.editor_original_name);if(l||r)return void n({editor_error:t({id:"label.a_competency_with_that_name_alread.6fc3d5fb",defaultMessage:"A competency with that name already exists."})});const o=i.editor_rubric.map(e=>(e||[]).map(e=>(e||"").trim()).filter(Boolean)),c={name:e,rubric:o.some(e=>e.length>0)?o:null},h=[...a.new_competencies],u=i.editor_original_name?h.findIndex(e=>e.name===i.editor_original_name):-1;u>=0?h[u]=c:h.push(c),a.setState({new_competencies:h}),d()},children:(0,N.jsx)(ke.A,{defaultMessage:"Save competency",id:"label.save_competency.3080e025"})})]})]})]})},DD=t(78712);const BD={bandcamp:DD.buv,canva:DD.IZ3,creative_cloud_express:ze.Wqt,google_docs:DD.VS1,google_sheets:DD.CZR,google_slides:DD.MDe,powtoon:ze.UUG,prezi:DD.xdy,soundcloud:DD.xwK,vimeo:DD.$Ss,youtube:DD.KVB},PD=[{icon:ze.rgF,pattern:/power\s*point/i},{icon:ze.WLb,pattern:/word/i},{icon:ze.Ru,pattern:/excel|spreadsheet/i},{icon:ze.rgF,pattern:/slide/i},{icon:ze.Zgf,pattern:/video/i},{icon:ze.EVA,pattern:/audio/i},{icon:ze.R1W,pattern:/visual|image/i}],LD=["slideshow","presentation","video","document"],OD=["slideshow","presentation","video","document"],HD=e=>{const s=(e||"").toLowerCase(),a=OD.findIndex(e=>s.includes(e));return-1===a?OD.length:a};var UD=()=>{const s=ID(),[a,t]=(0,ne.CQ)({deliverable_configs:[],loading:!0});(0,l.useEffect)(()=>{(async()=>{try{const e=await s.api.get("/api/challenge-templates/deliverables/configurations/list"),a=((null===e||void 0===e?void 0:e.deliverable_configurations)||e||[]).filter(e=>{var s;const a=((null===(s=e.deliverable_categories)||void 0===s?void 0:s.title)||"").toLowerCase();return LD.some(e=>a.includes(e))});t({deliverable_configs:a,loading:!1})}catch(e){t({loading:!1})}})()},[]);const i=s.deliverable_config_ids.length>0;return a.loading?(0,N.jsx)(Ce.S,{className:"ccw-generating",children:(0,N.jsx)(qt.A,{animation:"border",variant:"primary"})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 03",id:"label.step_03.2351ef0f"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Configure your challenge",id:"label.configure_your_challenge.6dcfea7a"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"Choose how teams will present their solution.",id:"label.choose_how_teams_will_present_thei.c9ef9bbd"})}),s.error&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>s.setState({error:null}),variant:"danger",children:s.error}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Deliverable format",id:"label.deliverable_format.0be7af01"})}),Object.entries(a.deliverable_configs.reduce((e,s)=>{var a;const t=(null===(a=s.deliverable_categories)||void 0===a?void 0:a.title)||"Other";return e[t]||(e[t]=[]),e[t].push(s),e},{})).sort((e,s)=>{let[a]=e,[t]=s;return HD(a)-HD(t)}).map(e=>{let[a,t]=e;const i=[...t].sort((e,s)=>(/powerpoint/i.test(e.title)?0:1)-(/powerpoint/i.test(s.title)?0:1));return(0,N.jsxs)(Ce.S,{className:"mb-3",children:[(0,N.jsx)("small",{className:"text-muted fw-bold d-block mb-2",children:a}),(0,N.jsx)(Ce.S,{className:"ccw-deliverable-cards",children:i.map(e=>{const a=(e=>{const s=BD[null===e||void 0===e?void 0:e.type];if(s)return s;const a=(null===e||void 0===e?void 0:e.title)||"";for(const t of PD)if(t.pattern.test(a))return t.icon;return ze.t69})(e),t=s.deliverable_config_ids.includes(e.id);return(0,N.jsxs)(Ce.S,{className:"ccw-deliverable-card "+(t?"selected":""),onClick:()=>(e=>{const a=[...s.deliverable_config_ids],t=a.indexOf(e);t>=0?a.splice(t,1):a.push(e),s.setState({deliverable_config_ids:a})})(e.id),role:"button",children:[(0,N.jsx)(Ce.S,{className:"ccw-del-icon",children:(0,N.jsx)(a,{color:"var(--gray-500, #6c757d)",size:32})}),(0,N.jsx)("h6",{children:e.title})]},e.id)})})]},a)})]}),(0,N.jsxs)(Ce.S,{className:"ccw-actions",children:[(0,N.jsx)(ve.A,{onClick:()=>s.prevStep(),variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsxs)(ve.A,{disabled:!i,onClick:()=>s.nextStep(),size:"lg",children:[(0,N.jsx)(ke.A,{defaultMessage:"Attach certification",id:"label.attach_certification.c78393e5"}),(0,N.jsx)(ze.Z0P,{className:"ms-2",size:14})]})]})]})};const QD=[{label:"Select type...",value:""},{label:"Upload Video",value:"Video"},{label:"YouTube URL",value:"YouTube"},{label:"Vimeo URL",value:"Vimeo"}];var VD=()=>{var e;const s=ID(),{formatMessage:a}=(0,ja.A)(),t=(0,l.useRef)(),i=(0,l.useRef)(),n=(0,l.useRef)(),[r,o]=(0,ne.CQ)({resource_title:"",resource_url:"",show_resource_form:!1,uploading_video:!1}),d=()=>(e,a)=>s.api.file("/api/challenge-wizard/upload/image",{job_id:a},e,"image.jpg"),c=()=>{const e=r.resource_title.trim(),a=r.resource_url.trim();e&&a&&(s.setState({custom_guiding_resources:[...s.custom_guiding_resources,{title:e,url:a}]}),o({resource_title:"",resource_url:"",show_resource_form:!1}))},h=!!s.trigger_content_type&&!(null===(e=s.trigger_content_url)||void 0===e||!e.trim()),u=Array.isArray(s.custom_guiding_resources)&&s.custom_guiding_resources.some(e=>(null===e||void 0===e?void 0:e.title)&&(null===e||void 0===e?void 0:e.url)),m=h&&u;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 06",id:"label.step_06.550eaf1d"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Customize your challenge",id:"label.customize_your_challenge.bed46061"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"Add the trigger video and guiding resources teams need to dig into this challenge. Cover and banner images are optional.",id:"label.add_the_trigger_video_and_guiding.39b37c79"})}),s.error&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>s.setState({error:null}),variant:"danger",children:s.error}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Trigger video",id:"label.trigger_video.ac9bb520"})}),(0,N.jsx)("p",{className:"text-muted",style:{fontSize:"0.85rem",marginBottom:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload a video or paste a YouTube/Vimeo URL to introduce the challenge.",id:"label.upload_a_video_or_paste_a_youtubev.3d5a49a0"})}),(0,N.jsxs)(Ce.S,{className:"ccw-form-row",style:{marginBottom:8},children:[(0,N.jsx)(Ce.S,{className:"ccw-form-group",style:{flex:"0 0 180px"},children:(0,N.jsx)(_e.A.Select,{onChange:e=>s.setState({trigger_content_type:e.target.value,trigger_content_url:""}),size:"sm",value:s.trigger_content_type,children:QD.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))})}),(0,N.jsx)(Ce.S,{className:"ccw-form-group",style:{flex:1},children:"Video"===s.trigger_content_type?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{disabled:r.uploading_video,onClick:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.click()},size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.BzO,{className:"me-1",size:14}),r.uploading_video?a({id:"label.uploading.5ce44dd7",defaultMessage:"Uploading\u2026"}):s.trigger_content_url?a({id:"label.replace_video.e9594fc5",defaultMessage:"Replace video"}):a({id:"label.upload_video.ea79e833",defaultMessage:"Upload video"})]}),(0,N.jsx)("input",{hidden:!0,accept:"video/mp4,video/webm,video/ogg",onChange:async e=>{var a;const t=null===(a=e.target.files)||void 0===a?void 0:a[0];if(t){o({uploading_video:!0});try{const e=await s.api.file("/api/challenge-wizard/upload/video",{},t,t.name);null!==e&&void 0!==e&&e.location&&s.setState({trigger_content_type:"Video",trigger_content_url:e.location})}catch(err){s.setState({error:(null===err||void 0===err?void 0:err.err)||(null===err||void 0===err?void 0:err.message)||"Failed to upload video."})}o({uploading_video:!1}),n.current&&(n.current.value="")}},ref:n,type:"file"}),s.trigger_content_url&&!r.uploading_video&&(0,N.jsx)("small",{className:"text-success ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Video uploaded",id:"label.video_uploaded.e34e6cd7"})})]}):s.trigger_content_type?(0,N.jsx)(_e.A.Control,{onChange:e=>s.setState({trigger_content_url:e.target.value}),size:"sm",value:s.trigger_content_url,placeholder:a({id:"ccw.customize.url.ph",defaultMessage:"YouTube"===s.trigger_content_type?"https://youtube.com/watch?v=...":"https://vimeo.com/..."})}):null})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Guiding resources",id:"label.guiding_resources.27a607fa"})}),(0,N.jsx)("p",{className:"text-muted",style:{fontSize:"0.85rem",marginBottom:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Add links to articles, videos, or documents that will help teams research the problem.",id:"label.add_links_to_articles_videos_or_do.b78e4e16"})}),s.custom_guiding_resources.length>0&&(0,N.jsx)(Ce.S,{className:"ccw-resource-list",children:s.custom_guiding_resources.map((e,a)=>(0,N.jsxs)(Ce.S,{className:"ccw-resource-item",children:[(0,N.jsxs)(Ce.S,{className:"ccw-resource-info",children:[(0,N.jsx)(ze.AnD,{className:"me-2",color:"var(--gray-400)",size:12}),(0,N.jsx)("strong",{children:e.title}),(0,N.jsx)("small",{className:"text-muted ms-2",children:e.url})]}),(0,N.jsx)("button",{className:"ccw-resource-remove",onClick:()=>(e=>{const a=[...s.custom_guiding_resources];a.splice(e,1),s.setState({custom_guiding_resources:a})})(a),type:"button",children:(0,N.jsx)(ze.QCr,{size:12})})]},a))}),r.show_resource_form?(0,N.jsxs)(Ce.S,{className:"ccw-resource-form",children:[(0,N.jsx)(_e.A.Control,{autoFocus:!0,className:"mb-2",onChange:e=>o({resource_title:e.target.value}),placeholder:a({id:"label.resource_title.666b41db",defaultMessage:"Resource title"}),size:"sm",value:r.resource_title}),(0,N.jsxs)(Ce.S,{className:"ccw-custom-input-row",children:[(0,N.jsx)(_e.A.Control,{onChange:e=>o({resource_url:e.target.value}),onKeyDown:e=>"Enter"===e.key&&c(),placeholder:a({id:"label.https.e98a62ef",defaultMessage:"https://..."}),size:"sm",value:r.resource_url}),(0,N.jsx)(ve.A,{onClick:c,size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Add",id:"label.add.9fd728c6"})})]})]}):(0,N.jsxs)(ve.A,{onClick:()=>o({show_resource_form:!0}),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.OiG,{className:"me-1",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Add resource",id:"label.add_resource.03cf099b"})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsxs)("label",{className:"ccw-form-label",children:[(0,N.jsx)(ke.A,{defaultMessage:"Custom images",id:"label.custom_images.0a6403c5"}),(0,N.jsxs)("span",{className:"ccw-optional",children:[" (",(0,N.jsx)(ke.A,{defaultMessage:"optional",id:"label.o
2ptional.ec91fdd9"}),")"]})]}),(0,N.jsx)("p",{className:"text-muted",style:{fontSize:"0.85rem",marginBottom:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Upload custom banner and course card images. Defaults will be used if not provided.",id:"label.upload_custom_banner_and_course_ca.bc8ba690"})}),(0,N.jsxs)(Ce.S,{className:"ccw-image-uploads",children:[(0,N.jsx)(Ce.S,{className:"ccw-image-upload-card",onClick:async()=>{const e=null===t||void 0===t?void 0:t.current;if(e)try{const a=await e.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;s.setState({banner_path:a.location})}catch(err){s.setState({error:(null===err||void 0===err?void 0:err.err)||"Failed to upload banner."})}},role:"button",children:s.banner_path?(0,N.jsx)("img",{alt:"Banner",className:"ccw-image-preview ccw-banner-preview",src:s.banner_path}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.dkL,{color:"var(--gray-400)",size:24}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Banner (2000x500)",id:"label.banner_2000x500.778304eb"})})]})}),(0,N.jsx)(Ce.S,{className:"ccw-image-upload-card",onClick:async()=>{const e=null===i||void 0===i?void 0:i.current;if(e)try{const a=await e.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;s.setState({cover_path:a.location})}catch(err){s.setState({error:(null===err||void 0===err?void 0:err.err)||"Failed to upload cover image."})}},role:"button",children:s.cover_path?(0,N.jsx)("img",{alt:"Cover",className:"ccw-image-preview",src:s.cover_path}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.dkL,{color:"var(--gray-400)",size:24}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Course card (750x500)",id:"label.course_card_750x500.6e622307"})})]})})]}),(0,N.jsx)(TA,{aspectRatio:4,maxHeight:2e3,maxWidth:2e3,ref:t,uploadHandler:d()}),(0,N.jsx)(TA,{aspectRatio:1.5,maxHeight:500,maxWidth:750,ref:i,uploadHandler:d()})]}),(0,N.jsxs)(Ce.S,{className:"ccw-actions",children:[(0,N.jsx)(ve.A,{onClick:()=>s.prevStep(),variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsxs)(ve.A,{disabled:!m,onClick:()=>s.nextStep(),size:"lg",children:[(0,N.jsx)(ke.A,{defaultMessage:"Review & generate",id:"label.review_and_generate.e8e63505"}),(0,N.jsx)(ze.Z0P,{className:"ms-2",size:14})]})]})]})};const GD=[{label:"Healthcare + AI",prompt:"How can we use AI to improve patient wait times in rural healthcare clinics?"},{label:"Sustainability",prompt:"How can we use AI to reduce food waste in school cafeterias by 40%?"},{label:"Education + AI",prompt:"How can we use AI to personalize learning paths for students with different learning styles?"},{label:"Supply Chain",prompt:"How can we use AI to predict and prevent supply chain disruptions for small businesses?"}],WD=[{icon:ze.SMR,label:"Standards-aligned"},{icon:ze.YXz,label:"Team-based"},{icon:ze.Wqt,label:"AI-powered"},{icon:ze.A7C,label:"Credably certified"}];var KD=()=>{const e=ID(),{formatMessage:s}=(0,ja.A)(),[a,t]=(0,l.useState)(""),i=a.trim().length>=10,n=()=>{i&&(e.setState({problem_description:a.trim()}),e.nextStep())};return(0,N.jsxs)(Ce.S,{className:"ccw-landing",children:[(0,N.jsxs)(Ce.S,{className:"ccw-hero",children:[(0,N.jsx)(Ce.S,{className:"ccw-hero-badge",children:(0,N.jsx)(ke.A,{defaultMessage:"A few questions. One complete challenge. Zero guesswork.",id:"label.a_few_questions_one_complete_chall.a0162d8a"})}),(0,N.jsx)("h1",{className:"ccw-hero-title",children:(0,N.jsx)(ke.A,{defaultMessage:"What challenge do you{br}want to solve for today?",id:"label.what_challenge_do_youbrwant_to_sol.9dfcb7d1",values:{br:(0,N.jsx)("br",{})}})}),(0,N.jsx)("p",{className:"ccw-hero-sub",children:(0,N.jsx)(ke.A,{defaultMessage:"Describe a problem and we'll build a complete, ready-to-launch Solvably challenge with rubrics, learning objectives, and everything in between.",id:"label.describe_a_problem_and_well_build.7f465b4a"})}),(0,N.jsxs)(Ce.S,{className:"ccw-search-container",children:[(0,N.jsxs)(Ce.S,{className:"ccw-search-box",children:[(0,N.jsx)(Ce.S,{className:"ccw-search-icon",children:(0,N.jsxs)("svg",{fill:"none",height:"24",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",width:"24",children:[(0,N.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,N.jsx)("path",{d:"m21 21-4.3-4.3"})]})}),(0,N.jsx)("input",{autoFocus:!0,className:"ccw-search-input",onChange:e=>t(e.target.value),onKeyDown:e=>{"Enter"===e.key&&i&&n()},placeholder:s({id:"label.eg_how_can_we_use_ai_to_reduce_emp.0cc3ea7e",defaultMessage:"e.g. How can we use AI to reduce employee onboarding time by 50%..."}),type:"text",value:a}),(0,N.jsx)("button",{className:"ccw-go-button "+(i?"active":""),disabled:!i,onClick:n,type:"button",children:(0,N.jsx)(ze.Z0P,{size:16})})]}),(0,N.jsxs)(Ce.S,{className:"ccw-search-helpers",children:[(0,N.jsx)("span",{className:"ccw-helper
2-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Try:",id:"label.try.02895382"})}),GD.map(e=>(0,N.jsx)("button",{className:"ccw-helper-chip",onClick:()=>{return s=e.prompt,void t(s);var s},type:"button",children:e.label},e.label))]})]})]}),(0,N.jsx)(Ce.S,{className:"ccw-trust-badges",children:WD.map(e=>{let{icon:s,label:a}=e;return(0,N.jsxs)(Ce.S,{className:"ccw-trust-item",children:[(0,N.jsx)(s,{className:"ccw-trust-icon",size:16}),(0,N.jsx)("span",{children:a})]},a)})})]})};const YD=Object.entries(Za.Ay).filter(e=>{let[s]=e;return"latest"!==s}),qD=[{label:"Select...",value:""},{label:"K-12 School",value:"k12"},{label:"Higher Education",value:"higher-ed"},{label:"Corporate / Business",value:"corporate"},{label:"Nonprofit / Community",value:"nonprofit"},{label:"Government / Public Sector",value:"government"},{label:"Other",value:"other"}];const JD=["What if","How might we","Imagine if","Consider if"],XD=["Recall","Skill/Concept","Strategic Thinking","Extended Thinking"],ZD=["Basic","Emerging","Strong","Exemplary"];var $D=()=>{var s,a;const t=ID(),{api:i}=(0,P.nm)(),{formatMessage:n}=(0,ja.A)(),[r,o]=(0,l.useState)(null),[d,c]=(0,l.useState)("challenge"),[h,u]=(0,l.useState)({}),[m,g]=(0,l.useState)({existing:null,global_competencies:[],loading:!1}),p=t.certification_template_id?"existing":t.certification_title||null!==(s=t.new_competencies)&&void 0!==s&&s.length?"create":"none",x=(e,s,a)=>{const i=[...t.what_ifs||[]];i[e]=(0,F.A)((0,F.A)({},i[e]||{}),{},{[s]:a}),t.setState({what_ifs:i})},v=(e,s,a)=>{const i=[...t.learning_goals||[]];i[e]=(0,F.A)((0,F.A)({},i[e]||{}),{},{[s]:a}),t.setState({learning_goals:i})};(0,l.useEffect)(()=>{t.content_generated||t.generating||(async()=>{t.setState({error:null,generating:!0});try{const e=await i.get("/api/certification-templates/global-competencies"),s=(null===e||void 0===e?void 0:e.competencies)||[],a=[...t.selected_competency_ids.map(e=>{var a;return null===(a=s.find(s=>s.id===e))||void 0===a?void 0:a.name}).filter(Boolean),...t.custom_competency_names],l=await i.post("/api/challenge-wizard/generate-content",{audience:t.audience_name,challenge_statement:t.challenge_statement,competencies:a,deliverable:"Selected deliverable",desired_outcome:t.desired_outcome,problem_description:t.problem_description,subject:t.subject_name,title:t.title,use_ai:!!t.use_ai});t.setState({challenge_requirements:l.challenge_requirements||"",content_generated:!0,generating:!1,guiding_questions:l.guiding_questions||[],learning_goals:l.learning_goals||[],overview:l.overview||"",video_script:l.video_script||"",what_ifs:l.what_ifs||[]})}catch(e){t.setState({error:(null===e||void 0===e?void 0:e.err)||"Failed to generate content.",generating:!1})}})()},[]),(0,l.useEffect)(()=>{let s=!1;return(async()=>{if("none"!==p){g(e=>(0,F.A)((0,F.A)({},e),{},{loading:!0}));try{if("existing"===p&&t.certification_template_id){const e=await i.get(`/api/certification-templates/get/${t.certification_template_id}`);if(s)return;return void g({existing:(null===e||void 0===e?void 0:e.certification_template)||null,global_competencies:[],loading:!1})}if("create"===p){const e=(t.selected_competency_ids||[]).length>0?await i.get("/api/certification-templates/global-competencies"):{competencies:[]};if(s)return;g({existing:null,global_competencies:(null===e||void 0===e?void 0:e.competencies)||[],loading:!1})}}catch(e){if(s)return;g({existing:null,global_competencies:[],loading:!1})}}else g({existing:null,global_competencies:[],loading:!1})})(),()=>{s=!0}},[p,t.certification_template_id,null===(a=t.selected_competency_ids)||void 0===a?void 0:a.length]);const f=s=>{let{section:a}=s;return(0,N.jsxs)(ve.A,{className:"ccw-review-regen-btn",disabled:null!==r,onClick:()=>(async s=>{o(s);try{const e=await i.post("/api/challenge-wizard/regenerate-section",{audience:t.audience_name,challenge_statement:t.challenge_statement,problem_description:t.problem_description,section:s,subject:t.subject_name,title:t.title,use_ai:!!t.use_ai});null!==e&&void 0!==e&&e[s]&&t.setState({[s]:e[s]})}catch(e){t.setState({error:(null===e||void 0===e?void 0:e.err)||`Failed to regenerate ${s}.`})}o(null)})(a),size:"sm",variant:"outline-secondary",children:[r===a?(0,N.jsx)(qt.A,{animation:"border",className:"me-1",size:"sm",style:{height:10,width:10}}):(0,N.jsx)(ze.DIg,{className:"me-1",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Regenerate",id:"label.regenerate.1651031b"})]})},j=e=>{let{section:s}=e;return(0,N.jsx)(ve.A,{className:"ccw-review-regen-btn",onClick:()=>(e=>u(s=>(0,F.A)((0,F.A)({},s),{},{[e]:!s[e]})))(s),size:"sm",variant:h[s]?"primary":"outline-secondary",children:h[s]?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.CMH,{className:"me-1",size:10}
2),(0,N.jsx)(ke.A,{defaultMessage:"Done",id:"label.done.11a6767d"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Mbp,{className:"me-1",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]})})},_=e=>{if(!e)return(0,N.jsx)("p",{className:"text-muted small m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No rubric defined for this competency.",id:"label.no_rubric_defined_for_this_compete.91c69178"})});const s=e=>(0,N.jsx)(yl.A,{variant:"flush",children:(e||[]).map((e,s)=>(0,N.jsxs)(yl.A.Item,{className:"px-0",children:[(0,N.jsx)("strong",{style:{fontSize:12},children:ZD[s]||`Level ${s+1}`}),0===(e||[]).length?(0,N.jsx)("p",{className:"text-muted small m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No constraints.",id:"label.no_constraints.75f09b01"})}):(0,N.jsx)("ul",{className:"m-0 ps-3 small",children:e.map((e,s)=>(0,N.jsx)("li",{children:e},s))})]},s))});return Array.isArray(e)?s(e):(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-3",children:Object.entries(e).map((a,t)=>{let[i,n]=a;return(0,N.jsxs)(l.Fragment,{children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{className:"m-0",children:i}),s(n)]}),t<Object.keys(e).length-1&&(0,N.jsx)("hr",{className:"my-2"})]},t)})})},b=(e,s)=>(0,N.jsx)(Gd.A,{alwaysOpen:!0,children:e.map((e,a)=>(0,N.jsxs)(Gd.A.Item,{eventKey:`${s}-${a}`,children:[(0,N.jsxs)(Gd.A.Header,{children:[(0,N.jsx)("span",{className:"fw-semibold",children:null===e||void 0===e?void 0:e.name}),null!==e&&void 0!==e&&e.organization_id?(0,N.jsx)(bo.A,{bg:"info",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Custom",id:"label.custom.494ca78f"})}):null]}),(0,N.jsx)(Gd.A.Body,{children:_(null===e||void 0===e?void 0:e.rubric)})]},`${s}-${a}`))});return t.generating&&!t.content_generated?(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"ccw-generating",children:[(0,N.jsx)(qt.A,{animation:"border",className:"mb-4",style:{height:48,width:48},variant:"primary"}),(0,N.jsx)("h3",{className:"ccw-generating-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Building your challenge...",id:"label.building_your_challenge.8d24bfea"})}),(0,N.jsxs)(Ce.S,{className:"ccw-gen-steps",children:[(0,N.jsxs)(Ce.S,{className:"ccw-gen-step done",children:[(0,N.jsx)(Ce.S,{className:"ccw-gen-check",children:(0,N.jsx)(ze.CMH,{size:12})}),(0,N.jsx)(ke.A,{defaultMessage:"Crafting challenge overview & requirements",id:"label.crafting_challenge_overview_and_re.7dea2bfc"})]}),(0,N.jsxs)(Ce.S,{className:"ccw-gen-step active",children:[(0,N.jsx)(Ce.S,{className:"ccw-gen-check"}),(0,N.jsx)(ke.A,{defaultMessage:"Generating guiding questions & learning objectives",id:"label.generating_guiding_questions_and_l.0e18c48e"})]}),(0,N.jsxs)(Ce.S,{className:"ccw-gen-step",children:[(0,N.jsx)(Ce.S,{className:"ccw-gen-check"}),(0,N.jsx)(ke.A,{defaultMessage:"Preparing your complete challenge",id:"label.preparing_your_complete_challenge.c99453ad"})]})]})]})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 07",id:"label.step_07.fae7281d"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Review your challenge",id:"label.review_your_challenge.99e43bee"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"Here's what we generated. Review and regenerate sections as needed, then save to continue building in the editor.",id:"label.heres_what_we_generated_review_and.bb5a65c1"})}),t.error&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>t.setState({error:null}),variant:"danger",children:t.error}),(0,N.jsxs)(ld.A.Container,{activeKey:d,onSelect:c,children:[(0,N.jsxs)(aa.A,{className:"ccw-review-tabs",variant:"tabs",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"challenge",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"questions",children:(0,N.jsx)(ke.A,{defaultMessage:"Questions",id:"label.questions.9a72221a"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"learning",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning",id:"label.learning.8b45bb20"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"video",children:(0,N.jsx)(ke.A,{defaultMessage:"Video script",id:"label.video_script.f736af6f"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"certification",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})})})]}),(0,N.jsxs)(ld.A.Content,{className:"ccw-review-tab-content",children:[(0,N.jsxs)(ld.A.Pane,{eventKey:"challenge",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})}),(0,N.jsx)(j,{section:"challenge"})]}),h.challenge?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_e.A.Label,{className:"small text-muted mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{className:"mb-3",onChange:e=>t.setState({title:e.target.value}),value:t.title||""}),(0,N.jsx)(_e.A.Label,{className:"small text-muted mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge statement",id:"label.challenge_statement.85ddafbd"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>t.setState({challenge_statement:e.target.value}),rows:4,value:t.challenge_statement||""})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h4",{style:{marginBottom:8},children:t.title}),(0,N.jsx)("p",{className:"ccw-review-content",children:t.challenge_statement})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(j,{section:"overview"}),(0,N.jsx)(f,{section:"overview"})]})]}),h.overview?(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>t.setState({overview:e.target.value}),rows:6,value:t.overview||""}):(0,N.jsx)(Ce.S,{className:"ccw-review-content",dangerouslySetInnerHTML:{__html:t.overview}})]}),(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Requirements",id:"label.requirements.e0cdd07f"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(j,{section:"challenge_requirements"}),(0,N.jsx)(f,{section:"challenge_requirements"})]})]}),h.challenge_requirements?(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>t.setState({challenge_requirements:e.target.value}),rows:6,value:t.challenge_requirements||""}):(0,N.jsx)(Ce.S,{className:"ccw-review-content",dangerouslySetInnerHTML:{__html:t.challenge_requirements}})]})]}),(0,N.jsxs)(ld.A.Pane,{eventKey:"questions",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Guiding questions",id:"label.guiding_questions.53a932b3"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(j,{section:"guiding_questions"}),(0,N.jsx)(f,{section:"guiding_questions"})]})]}),h.guiding_questions?(0,N.jsxs)(N.Fragment,{children:[(t.guiding_questions||[]).map((e,s)=>(0,N.jsxs)(Ce.S,{className:"d-flex align-items-start gap-2 mb-2",children:[(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>((e,s)=>{const a=[...t.guiding_questions||[]];a[e]=s,t.setState({guiding_questions:a})})(s,e.target.value),rows:2,value:e||""}),(0,N.jsx)(ve.A,{onClick:()=>(e=>{const s=[...t.guiding_questions||[]];s.splice(e,1),t.setState({guiding_questions:s})})(s),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ze.QCr,{size:10})})]},s)),(0,N.jsxs)(ve.A,{onClick:()=>{t.setState({guiding_questions:[...t.guiding_questions||[],""]})},size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.OiG,{className:"me-1",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Add question",id:"label.add_question.f9496b76"})]})]}):(0,N.jsx)("ol",{className:"ccw-review-list",children:t.guiding_questions.map((e,s)=>(0,N.jsx)("li",{children:e},s))})]}),(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"What-If Questions",id:"label.what_if_questions.9e7a80df"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(j,{section:"what_ifs"}),(0,N.jsx)(f,{section:"what_ifs"})]})]}),h.what_ifs?(0,N.jsxs)(N.Fragment,{children:[(t.what_ifs||[]).map((e,s)=>(0,N.jsxs)(Ce.S,{className:"d-flex align-items-start gap-2 mb-2",children:[(0,N.jsx)(_e.A.Select,{onChange:e=>x(s,"type",e.target.value),style:{flex:"0 0 160px"},value:e.type||"What if",children:JD.map(e=>(0,N.jsx)("option",{value:e,children:e},e))}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>x(s,"value",e.target.value),rows:2,value:e.value||""}),(0,N.jsx)(ve.A,{onClick:()=>(e=>{const s=[...t.what_ifs||[]];s.splice(e,1),t.setState({what_ifs:s})})(s),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ze.QCr,{size:10})})]},s)),(0,N.jsxs)(ve.A,{onClick:()=>{t.setState({what_ifs:[...t.what_ifs||[],{type:"What if",value:""}]})},size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.OiG,{className:"me-1",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Add what-if",id:"label.add_what_if.ef109c5e"})]})]}):(0,N.jsx)("ul",{className:"ccw-review-list",children:t.what_ifs.map((e,s)=>(0,N.jsxs)("li",{children:[(0,N.jsx)("strong",{children:e.type})," ",e.value]},s))})]})]}),(0,N.jsx)(ld.A.Pane,{eventKey:"learning",children:(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learning goals",id:"label.learning_goals.9e640a9e"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(j,{section:"learning_goals"}),(0,N.jsx)(f,{section:"learning_goals"})]})]}),h.learning_goals?(0,N.jsxs)(N.Fragment,{children:[(t.learning_goals||[]).map((e,s)=>(0,N.jsxs)(Ce.S,{className:"d-flex align-items-start gap-2 mb-2",children:[(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>v(s,"value",e.target.value),rows:2,value:e.value||""}),(0,N.jsx)(_e.A.Select,{onChange:e=>v(s,"dok",e.target.value),style:{flex:"0 0 180px"},value:e.dok||"Skill/Concept",children:XD.map(e=>(0,N.jsx)("option",{value:e,children:e},e))}),(0,N.jsx)(ve.A,{onClick:()=>(e=>{const s=[...t.learning_goals||[]];s.splice(e,1),t.setState({learning_goals:s})})(s),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ze.QCr,{size:10})})]},s)),(0,N.jsxs)(ve.A,{onClick:()=>{t.setState({learning_goals:[...t.learning_goals||[],{dok:"Skill/Concept",value:""}]})},size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.OiG,{className:"me-1",size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Add learning goal",id:"label.add_learning_goal.f7af
21625"})]})]}):(0,N.jsx)("ul",{className:"ccw-review-list",children:t.learning_goals.map((e,s)=>(0,N.jsxs)("li",{children:[e.value,(0,N.jsx)("span",{className:"ms-2 badge bg-secondary",style:{fontSize:"0.65rem"},children:e.dok})]},s))})]})}),(0,N.jsx)(ld.A.Pane,{eventKey:"certification",children:(()=>{if("none"===p)return(0,N.jsxs)(Ce.S,{className:"ccw-review-section text-muted d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.Rqy,{}),(0,N.jsx)(ke.A,{defaultMessage:"No certification will be attached to this challenge.",id:"label.no_certification_will_be_attached.947a5860"})]});if(m.loading)return(0,N.jsx)(Ce.S,{className:"ccw-review-section d-flex justify-content-center py-4",children:(0,N.jsx)(qt.A,{animation:"border",variant:"primary"})});if("existing"===p){const e=m.existing;if(!e)return(0,N.jsx)(Ce.S,{className:"ccw-review-section text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Could not load the selected certification.",id:"label.could_not_load_the_selected_certif.92b9ca2c"})});const s=e.competencies||[];return(0,N.jsxs)(Ce.S,{className:"ccw-review-section d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.SBv,{color:"var(--primary)"}),(0,N.jsx)("h4",{className:"m-0",children:e.title}),e.organization_id?null:(0,N.jsx)(ze.Eh_,{className:"text-primary",size:14,title:"Global"})]}),e.description&&(0,N.jsx)("p",{className:"ccw-review-content m-0",children:e.description}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies ({count})",id:"label.competencies_count.0de18e8a",values:{count:s.length}})}),0===s.length?(0,N.jsx)("p",{className:"text-muted small m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No competencies attached to this certification.",id:"label.no_competencies_attached_to_this_c.bce9ec57"})}):b(s,"existing")]})]})}const e=[...(t.selected_competency_ids||[]).map(e=>m.global_competencies.find(s=>s.id===e)).filter(Boolean),...(t.new_competencies||[]).map(e=>(0,F.A)((0,F.A)({},e),{},{organization_id:-1}))];return(0,N.jsxs)(Ce.S,{className:"ccw-review-section d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.SBv,{color:"var(--primary)"}),(0,N.jsx)("h4",{className:"m-0",children:t.certification_title||n({id:"label.untitled_certification.12614be7",defaultMessage:"Untitled certification"})}),(0,N.jsx)(bo.A,{bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"New",id:"label.new.18fdd549"})})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Competencies ({count})",id:"label.competencies_count.0de18e8a",values:{count:e.length}})}),0===e.length?(0,N.jsx)("p",{className:"text-muted small m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No competencies selected \u2014 go back to the certification step to add some.",id:"label.no_competencies_selected_go_back_t.cbee21c1"})}):b(e,"create")]})]})})()}),(0,N.jsx)(ld.A.Pane,{eventKey:"video",children:(0,N.jsxs)(Ce.S,{className:"ccw-review-section",children:[(0,N.jsxs)(Ce.S,{className:"ccw-review-section-header",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Video script",id:"label.video_script.f736af6f"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(j,{section:"video_script"}),(0,N.jsx)(f,{section:"video_script"})]})]}),h.video_script?(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>t.setState({video_script:e.target.value}),placeholder:n({id:"label.write_or_paste_the_video_script.6781cd4b",defaultMessage:"Write or paste the video script..."}),rows:10,value:t.video_script||""}):t.video_script?(0,N.jsx)(Ce.S,{className:"ccw-review-content",dangerouslySetInnerHTML:{__html:t.video_script}}):(0,N.jsx)("p",{className:"text-muted",style:{fontStyle:"italic"},children:(0,N.jsx)(ke.A,{defaultMessage:"No video script generated yet. Click Regenerate to create one.",id:"label.no_video_script_generated_yet_clic.e0fe12d4"})})]})})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-actions",children:[(0,N.jsx)(ve.A,{onClick:()=>t.prevStep(),variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsx)(ve.A,{disabled:t.loading,onClick:async()=>{t.setState({error:null,loading:!0});try{var s,a;let e=t.certification_template_id||null;if(!e&&(null===(s=t.certification_title)||void 0===s?void 0:s.trim())&&t.selected_competency_ids.length+((null===(a=t.new_competencies)||void 0===a?void 0:a.length)||0)>0){var l;const s=await i.post("/api/challenge-wizard/create-certification",{competency_ids:t.selected_competency_ids,description:`Certification attached to the "${t.title}" challenge.`,new_competencies:(t.new_competencies||[]).map(e=>({name:e.name,rubric:e.rubric})),title:t.certification_title});e=(null===s||void 0===s||null===(l=s.certification)||void 0===l?void 0:l.id)||null}const n=await i.post("/api/challenge-wizard/create",{agent_persona_stub_ids:t.no_agents?[]:t.agent_persona_stub_ids,audience_category_id:t.audience_category_id?Number.parseInt(t.audie
2nce_category_id):null,audience_ids:t.audience_ids,author_avatar_path:t.author_avatar_path,author_bio:t.author_bio,author_email:t.author_email,author_name:t.author_name,author_phone:t.author_phone,banner_path:t.banner_path,certification_template_id:e,challenge_requirements:t.challenge_requirements,challenge_statement:t.challenge_statement,challenge_type:t.challenge_type||"classic",cover_path:t.cover_path,custom_guiding_resources:t.custom_guiding_resources,deliverable_config_ids:t.deliverable_config_ids,desired_outcome:t.desired_outcome,estimated_value:t.estimated_value,guiding_questions:t.guiding_questions,learning_goals:t.learning_goals,overview:t.overview,problem_description:t.problem_description,subject_id:t.subject_id?Number.parseInt(t.subject_id):null,target_audience:t.target_audience,title:t.title,total_est_completion_time:t.total_est_completion_time?Number.parseInt(t.total_est_completion_time):null,trigger_content_type:t.trigger_content_type,trigger_content_url:t.trigger_content_url,video_script:t.video_script,what_ifs:t.what_ifs});t.setState({loading:!1}),t.hide(n)}catch(e){t.setState({error:(null===e||void 0===e?void 0:e.err)||"Failed to create challenge.",loading:!1})}},size:"lg",children:t.loading?(0,N.jsx)(qt.A,{animation:"border",size:"sm"}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.dIn,{className:"me-2",size:14}),(0,N.jsx)(ke.A,{defaultMessage:"Save & Open in Editor",id:"label.save_and_open_in_editor.2b229e50"})]})})]})]})},eB=[KD,()=>{var s,a,t,i;const n=ID(),{formatMessage:r}=(0,ja.A)(),o=(0,l.useRef)(),[d,c]=(0,ne.CQ)({audience_categories:[],audiences:[],loading:!0,subjects:[]});(0,l.useEffect)(()=>{(async()=>{try{const[e,s,a]=await Promise.all([n.api.get("/api/subjects/list"),n.api.get("/api/authoring/list/audience-categories"),n.api.get("/api/authoring/list/audiences")]);c({audience_categories:(null===s||void 0===s?void 0:s.audience_categories)||[],audiences:(null===a||void 0===a?void 0:a.audiences)||[],loading:!1,subjects:(null===e||void 0===e?void 0:e.subjects)||[]})}catch(e){c({loading:!1})}})()},[]);(0,l.useEffect)(()=>{if(!n.audience_category_id||!d.audiences.length)return;const e=new Set(d.audiences.filter(e=>e.audience_category_id===n.audience_category_id).map(e=>e.id)),s=Array.isArray(n.audience_ids)?n.audience_ids:[],a=s.filter(s=>e.has(s));a.length!==s.length&&n.setState({audience_ids:a})},[n.audience_category_id,d.audiences]);const h=d.audiences.filter(e=>e.audience_category_id===n.audience_category_id),u=Array.isArray(n.audience_ids)?n.audience_ids:[],m=(null===(s=n.problem_description)||void 0===s?void 0:s.length)>=10&&(null===(a=n.desired_outcome)||void 0===a?void 0:a.length)>0&&(null===(t=n.author_name)||void 0===t?void 0:t.length)>=4&&(null===(i=n.author_email)||void 0===i?void 0:i.length)>0&&!!n.audience_category_id&&!!n.subject_id&&u.length>0&&n.total_est_completion_time>=30&&n.total_est_completion_time<=600;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 01",id:"label.step_01.d9d561d3"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Let's shape your challenge",id:"label.lets_shape_your_challenge.2fdebd58"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"Help us understand the specifics so we can craft something amazing.",id:"label.help_us_understand_the_specifics_s.af01f42f"})}),n.error&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n.setState({error:null}),variant:"danger",children:n.error}),YD.length>1&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-section-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge type",id:"label.challenge_type.0f7ea265"})}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)(_e.A.Select,{"aria-label":r({id:"label.challenge_type.0f7ea265",defaultMessage:"Challenge type"}),onChange:e=>n.setState({challenge_type:e.target.value}),value:n.challenge_type||"classic",children:YD.map(e=>{let[s,a]=e;return(0,N.jsx)("option",{value:s,children:a.label},s)})}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Set
2s the phase model for this challenge. Decision Making uses the Discover \u2192 Explore \u2192 Decide \u2192 Create \u2192 Reflect framework.",id:"label.sets_the_phase_model_for_this_chal.e5e3fd8e"})})]})]}),(0,N.jsx)(Ce.S,{className:"ccw-section-label",children:(0,N.jsx)(ke.A,{defaultMessage:"About you",id:"label.about_you.428f4d00"})}),(0,N.jsxs)(Ce.S,{className:"ccw-form-row",children:[(0,N.jsxs)(Ce.S,{className:"ccw-form-group",style:{flex:1},children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Your name",id:"label.your_name.2c6b2e25"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>n.setState({author_name:e.target.value}),placeholder:r({id:"label.your_full_name.538b4111",defaultMessage:"Your full name"}),value:n.author_name})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group ccw-avatar-group",children:[(0,N.jsxs)("label",{className:"ccw-form-label",children:[(0,N.jsx)(ke.A,{defaultMessage:"Photo",id:"label.photo.d84eebad"}),(0,N.jsxs)("span",{className:"ccw-optional",children:[" (",(0,N.jsx)(ke.A,{defaultMessage:"optional",id:"label.optional.ec91fdd9"}),")"]})]}),(0,N.jsx)(Ce.S,{className:"ccw-avatar-upload",onClick:async()=>{const e=null===o||void 0===o?void 0:o.current;if(e)try{const s=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;n.setState({author_avatar_path:s.location})}catch(err){n.setState({error:(null===err||void 0===err?void 0:err.err)||"Failed to upload avatar."})}},role:"button",children:n.author_avatar_path?(0,N.jsx)("img",{alt:"Avatar",className:"ccw-avatar-img",src:n.author_avatar_path}):(0,N.jsx)(ze.p5B,{color:"var(--gray-400)",size:16})})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Email address",id:"label.email_address.f2488fd4"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>n.setState({author_email:e.target.value}),placeholder:r({id:"label.youremailcom.97af051a",defaultMessage:"[email protected]"}),type:"email",value:n.author_email}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Your email will not be displayed publicly. We use your contact info for follow-up only.",id:"label.your_email_will_not_be_displayed_p.2f207e7a"})})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-row",children:[(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsxs)("label",{className:"ccw-form-label",children:[(0,N.jsx)(ke.A,{defaultMessage:"Phone",id:"label.phone.63dceb88"}),(0,N.jsxs)("span",{className:"ccw-optional",children:[" (",(0,N.jsx)(ke.A,{defaultMessage:"optional",id:"label.optional.ec91fdd9"}),")"]})]}),(0,N.jsx)(_e.A.Control,{onChange:e=>n.setState({author_phone:e.target.value}),placeholder:r({id:"label.555_555_5555.c4076213",defaultMessage:"(555) 555-5555"}),type:"tel",value:n.author_phone})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsxs)("label",{className:"ccw-form-label",children:[(0,N.jsx)(ke.A,{defaultMessage:"Type of organization",id:"label.type_of_organization.a070c7e3"}),(0,N.jsxs)("span",{className:"ccw-optional",children:[" (",(0,N.jsx)(ke.A,{defaultMessage:"optional",id:"label.optional.ec91fdd9"}),")"]})]}),(0,N.jsx)(_e.A.Select,{onChange:e=>n.setState({organization_type:e.target.value}),value:n.organization_type,children:qD.map(e=>(0,N.jsx)("option",{value:e.value,children:e.label},e.value))})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsxs)("label",{className:"ccw-form-label",children:[(0,N.jsx)(ke.A,{defaultMessage:"Short bio",id:"label.short_bio.81aa4ccb"}),(0,N.jsxs)("span",{className:"ccw-optional",children:[" (",(0,N.jsx)(ke.A,{defaultMessage:"optional",id:"label.optional.ec91fdd9"}),")"]})]}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>n.setState({author_bio:e.target.value}),placeholder:r({id:"label.tell_us_a_bit_about_yourself_and_y.fc9ded2c",defaultMessage:"Tell us a bit about yourself and your expertise..."}),rows:2,value:n.author_bio})]}),(0,N.jsx)(Ce.S,{className:"ccw-section-label",style:{marginTop:16},children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge details",id:"label.challenge_details.be6df044"})}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"What's the core problem?",id:"label.whats_the_core_problem.e7abd114"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>n.setState({problem_description:e.target.value}),placeholder:r({id:"label.eg_employee_onboarding_takes_too_l.58e43f8b",defaultMessage:"e.g. Employee onboarding takes too long and new hires feel lost in their first 90 days"}),rows:2,value:n.problem_description})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-row",children:[(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Who's the target audience?",id:"label.whos_the_target_audience.ca1326c3"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>n.setState({target_audience:e.target.value}),placeholder:r({id:"label.eg_customer_service_teams_leadersh.0817636a",defaultMessage:"e.g. Customer Service teams, Leadership, Village in Kenya, etc."}),value:n.target_audience})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Subject / Category",id:"label.subject_category.e945837d"})}),(0,N.jsxs)(_e.A.Select,{onChange:e=>n.setState({subject_id:e.target.value||null}),value:n.subject_id||"",children:[(0,N.jsx)("option",{value:"",children:r({id:"label.select_subject.53ea71ad",defaultMessage:"Select subject..."})}),d.subjects.map(e=>(0,N.jsx)("option",{value:e.id,children:e.name},e.id))]})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsxs)(_e.A.Select,{onChange:e=>
2n.setState({audience_category_id:e.target.value?Number.parseInt(e.target.value):null}),value:n.audience_category_id||"",children:[(0,N.jsx)("option",{value:"",children:r({id:"label.select_audience_category.62de6f4a",defaultMessage:"Select audience category..."})}),d.audience_categories.map(e=>(0,N.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),n.audience_category_id&&(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience roles",id:"label.audience_roles.09864"})}),(0,N.jsx)("small",{className:"text-muted d-block mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Select one or more specific audiences within this category.",id:"message.select_one_or_more_specific_audiences.90456"})}),0===h.length?(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No audiences available for this category.",id:"label.no_audiences_available_for_this_ca.90abfcbf"})}):(0,N.jsx)(Ce.S,{className:"d-flex flex-wrap gap-2",children:h.map(e=>{const s=u.includes(e.id);return(0,N.jsxs)("button",{className:"ccw-skill-card "+(s?"selected":""),onClick:s=>{s.preventDefault(),(e=>{const s=Array.isArray(n.audience_ids)?n.audience_ids:[],a=s.includes(e)?s.filter(s=>s!==e):[...s,e];n.setState({audience_ids:a})})(e.id)},style:{cursor:"pointer"},type:"button",children:[s&&(0,N.jsx)(Ce.S,{className:"ccw-skill-check",children:(0,N.jsx)(ze.CMH,{size:10})}),(0,N.jsx)("span",{children:e.name||e["short-name"]||e.short_name||`#${e.id}`})]},e.id)})})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-row",children:[(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Desired outcome",id:"label.desired_outcome.4f192d51"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>n.setState({desired_outcome:e.target.value}),placeholder:r({id:"label.eg_reduce_customer_service_tickets.f373a73d",defaultMessage:"e.g. Reduce customer service tickets from 3 weeks to 1 week, improve sales 10%"}),value:n.desired_outcome})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)("label",{className:"ccw-form-label",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated time (min)",id:"label.estimated_time_min.6a306761"})}),(0,N.jsx)(_e.A.Control,{max:600,min:30,placeholder:"60",type:"number",value:n.total_est_completion_time||"",onChange:e=>{const s=Number.parseInt(e.target.value,10);n.setState({total_est_completion_time:Number.isFinite(s)?s:null})}}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Between 30 and 600 minutes.",id:"label.between_30_and_600_minutes.cba7dbd1"})})]})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsxs)("label",{className:"ccw-form-label",children:[(0,N.jsx)(ke.A,{defaultMessage:"If this challenge is solved, about how much money would your organization save or earn in a year?",id:"label.if_this_challenge_is_solved_about.9f49c485"}),(0,N.jsxs)("span",{className:"ccw-optional",children:[" (",(0,N.jsx)(ke.A,{defaultMessage:"optional",id:"label.optional.ec91fdd9"}),")"]})]}),(0,N.jsx)(_e.A.Control,{onChange:e=>n.setState({estimated_value:e.target.value}),placeholder:r({id:"label.eg_dollar500kyear_dollar1m_in_new.002a8609",defaultMessage:"e.g. $500K/year, $1M in new revenue"}),value:n.estimated_value}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimate annual cost savings or new revenue generated. A rough estimate is fine.",id:"label.estimate_annual_cost_savings_or_ne.2cfc170a"})})]}),(0,N.jsxs)(Ce.S,{className:"ccw-form-group",children:[(0,N.jsx)(_e.A.Check,{checked:!!n.use_ai,id:"ccw-use-ai",label:r({id:"label.include_ai_as_a_tool_teams_can_use.8ad2a4b0",defaultMessage:"Include AI as a tool teams can use to solve this challenge"}),onChange:e=>n.setState({use_ai:e.target.checked}),type:"checkbox"}),(0,N.jsx)("small",{className:"text-muted d-block mt-1",children:(0,N.jsx)(ke.A,{defaultMessage:"When enabled, generated options and content will frame AI as a resource teams can leverage. Leave off for challenges where AI isn't the focus.",id:"label.when_enabled_generated_options_and.84b333b7"})})]}),(0,N.jsx)(Ce.S,{className:"ccw-actions",children:(0,N.jsxs)(ve.A,{disabled:!m,onClick:()=>{const e=d.subjects.find(e=>e.id===Number.parseInt(n.subject_id));
2n.setState({audience_name:n.target_audience||"",subject_name:(null===e||void 0===e?void 0:e.name)||""}),n.nextStep()},size:"lg",children:[(0,N.jsx)(ke.A,{defaultMessage:"Generate challenge options",id:"label.generate_challenge_options.d5d97d7d"}),(0,N.jsx)(ze.Z0P,{className:"ms-2",size:14})]})}),(0,N.jsx)(TA,{aspectRatio:1,maxHeight:500,maxWidth:500,ref:o,uploadHandler:(e,s)=>n.api.file("/api/challenge-wizard/upload/image",{job_id:s},e,"author_avatar.jpg")})]})},ED,UD,RD,()=>{const s=ID(),{formatMessage:a}=(0,ja.A)(),[t,i]=(0,ne.CQ)({agents:[],create_description:"",creating:!1,error:null,loading:!0,show_create:!1});(0,l.useEffect)(()=>{(async()=>{try{const e=await s.api.post("/api/challenge-wizard/recommend-agents",{audience:s.audience_name,challenge_statement:s.challenge_statement,subject:s.subject_name,title:s.title});i({agents:(null===e||void 0===e?void 0:e.agents)||[],loading:!1})}catch(e){i({error:"Failed to load agent recommendations.",loading:!1})}})()},[]);return t.loading?(0,N.jsxs)(Ce.S,{className:"ccw-generating",children:[(0,N.jsx)(qt.A,{animation:"border",className:"mb-4",style:{height:48,width:48},variant:"primary"}),(0,N.jsx)("h3",{className:"ccw-generating-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Analyzing agent fit...",id:"label.analyzing_agent_fit.78dd9aa3"})}),(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"We're evaluating which AI teammates would be the best fit for this challenge.",id:"label.were_evaluating_which_ai_teammates.2a2b7155"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ccw-step-number",children:(0,N.jsx)(ke.A,{defaultMessage:"STEP 05",id:"label.step_05.0cb3e886"})}),(0,N.jsx)("h2",{className:"ccw-step-title",children:(0,N.jsx)(ke.A,{defaultMessage:"Add AI teammates",id:"label.add_ai_teammates.1a9228ef"})}),(0,N.jsx)("p",{className:"ccw-step-desc",children:(0,N.jsx)(ke.A,{defaultMessage:"Select AI agent personas to join teams as collaborative teammates. Agents are ranked by relevance to your challenge.",id:"label.select_ai_agent_personas_to_join_t.ebb29907"})}),(s.error||t.error)&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{s.setState({error:null}),i({error:null})},variant:"danger",children:s.error||t.error}),(0,N.jsxs)(Ce.S,{className:"ccw-agent-list",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-card ccw-agent-none "+(s.no_agents?"selected":""),onClick:()=>{s.setState({agent_persona_stub_ids:[],no_agents:!s.no_agents})},role:"button",children:(0,N.jsxs)(Ce.S,{className:"ccw-agent-card-left",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-check",children:s.no_agents&&(0,N.jsx)(ze.CMH,{size:10})}),(0,N.jsx)(Ce.S,{className:"ccw-agent-avatar",children:(0,N.jsx)(ze.Rqy,{color:"var(--gray-400)",size:24})}),(0,N.jsxs)(Ce.S,{className:"ccw-agent-info",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-name",children:(0,N.jsx)(ke.A,{defaultMessage:"None",id:"label.none.dc937b59"})}),(0,N.jsx)("p",{className:"ccw-agent-rationale",children:(0,N.jsx)(ke.A,{defaultMessage:"No AI agents for this challenge",id:"label.no_ai_agents_for_this_challenge.575efeae"})})]})]})}),t.show_create?(0,N.jsxs)(Ce.S,{className:"ccw-agent-card",style:{alignItems:"stretch",flexDirection:"column"},children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-2",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.T_n,{color:"var(--primary)",size:14}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Design a new teammate",id:"label.design_a_new_teammate.ea5f5e01"})})]}),(0,N.jsx)("button",{className:"ccw-resource-remove",disabled:t.creating,onClick:()=>i({create_description:"",show_create:!1}),type:"button",children:(0,N.jsx)(ze.QCr,{size:12})})]}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,as:"textarea",disabled:t.creating,onChange:e=>i({create_description:e.target.value}),rows:3,value:t.create_description,placeholder:a({id:"label.describe_this_teammate_their_role.9741fa78",defaultMessage:"Describe this teammate \u2014 their role, personality, and what they bring to the team. The AI will fill in the rest."})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end mt-2",children:(0,N.jsx)(ve.A,{disabled:t.creating||t.create_description.trim().length<10,onClick:async()=>{const a=t.create_description.trim();if(!(a.length<10)){i({creating:!0});try{const e=await s.api.post("/api/challenge-wizard/create-agent",{audience:s.audience_name,challenge_statement:s.challenge_statement,description:a,subject:s.subject_name,title:s.title}),l=null===e||void 0===e?void 0:e.agent;if(!l)throw new Error("No agent returned");
2i({agents:[l,...t.agents],create_description:"",creating:!1,show_create:!1}),s.setState({agent_persona_stub_ids:[...s.agent_persona_stub_ids,l.stub_id],no_agents:!1})}catch(e){i({creating:!1,error:(null===e||void 0===e?void 0:e.err)||"Failed to create agent."})}}},size:"sm",children:t.creating?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(qt.A,{animation:"border",className:"me-2",size:"sm"}),(0,N.jsx)(ke.A,{defaultMessage:"Designing...",id:"label.designing.204bccfb"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.T_n,{className:"me-1",size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Create teammate",id:"label.create_teammate.746a4e13"})]})})})]}):(0,N.jsx)(Ce.S,{className:"ccw-agent-card",onClick:()=>i({show_create:!0}),role:"button",style:{borderStyle:"dashed"},children:(0,N.jsxs)(Ce.S,{className:"ccw-agent-card-left",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-check",children:(0,N.jsx)(ze.OiG,{size:10})}),(0,N.jsx)(Ce.S,{className:"ccw-agent-avatar",children:(0,N.jsx)(ze.T_n,{color:"var(--primary)",size:20})}),(0,N.jsxs)(Ce.S,{className:"ccw-agent-info",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-name",children:(0,N.jsx)(ke.A,{defaultMessage:"Create a new agent",id:"label.create_a_new_agent.fe7aef65"})}),(0,N.jsx)("p",{className:"ccw-agent-rationale",children:(0,N.jsx)(ke.A,{defaultMessage:"Describe the teammate you want and we'll design them for this challenge.",id:"label.describe_the_teammate_you_want_and.4b7d6dda"})})]})]})})]}),0===t.agents.length?(0,N.jsxs)(Ce.S,{className:"ccw-agents-empty",children:[(0,N.jsx)(ze.y8Q,{className:"mb-3",color:"var(--gray-400)",size:48}),(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No published agent personas available. You can add them later in the challenge editor.",id:"label.no_published_agent_personas_availa.65919929"})})]}):(0,N.jsx)(Ce.S,{className:"ccw-agent-list",children:(e=>{const a=null===(e=t.agents.find(e=>!e.is_new))||void 0===e?void 0:e.stub_id;return t.agents.map(e=>{const t=s.agent_persona_stub_ids.includes(e.stub_id),i=e.stub_id===a;return(0,N.jsxs)(Ce.S,{className:"ccw-agent-card "+(t?"selected":""),onClick:()=>(e=>{const a=[...s.agent_persona_stub_ids],t=a.indexOf(e);t>=0?a.splice(t,1):a.push(e),s.setState({agent_persona_stub_ids:a,no_agents:!1})})(e.stub_id),role:"button",children:[(0,N.jsxs)(Ce.S,{className:"ccw-agent-card-left",children:[(0,N.jsx)(Ce.S,{className:"ccw-agent-check",children:t&&(0,N.jsx)(ze.CMH,{size:10})}),(0,N.jsx)(Ce.S,{className:"ccw-agent-avatar",children:e.avatar_path?(0,N.jsx)("img",{alt:e.name,src:e.avatar_path}):(0,N.jsx)(ze.y8Q,{color:"var(--gray-400)",size:24})}),(0,N.jsxs)(Ce.S,{className:"ccw-agent-info",children:[(0,N.jsxs)(Ce.S,{className:"ccw-agent-name",children:[e.name,e.category&&(0,N.jsx)("span",{className:"ccw-agent-badge",style:{backgroundColor:e.category.color||"var(--gray-300)"},children:e.category.name})]}),e.rationale&&(0,N.jsx)("p",{className:"ccw-agent-rationale",children:e.rationale}),!e.rationale&&e.style&&(0,N.jsx)("p",{className:"ccw-agent-rationale",children:e.style})]})]}),e.is_new?(0,N.jsx)("span",{className:"ccw-agent-rec-badge",children:(0,N.jsx)(ke.A,{defaultMessage:"New",id:"label.new.18fdd549"})}):i?(0,N.jsx)("span",{className:"ccw-agent-rec-badge",children:(0,N.jsx)(ke.A,{defaultMessage:"Best fit",id:"label.best_fit.54879da2"})}):null]},e.stub_id)})})()}),(0,N.jsxs)(Ce.S,{className:"ccw-actions",children:[(0,N.jsx)(ve.A,{onClick:()=>s.prevStep(),variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Back",id:"label.back.76900f1b"})}),(0,N.jsxs)(ve.A,{onClick:()=>s.nextStep(),size:"lg",children:[(0,N.jsx)(ke.A,{defaultMessage:"Customize challenge",id:"label.customize_challenge.8a63256d"}),(0,N.jsx)(ze.Z0P,{className:"ms-2",size:14})]})]})]})},VD,$D];const sB=["Define","Select","Configure","Certification","Agents","Customize","Review"],aB=(0,l.forwardRef)((e,s)=>{const{api:a}=(0,P.nm)(),[t,i,n]=(0,ne.CQ)({agent_persona_stub_ids:[],audience_category_id:null,audience_ids:[],audience_name:"",author_avatar_path:"",author_bio:"",author_email:"",author_name:"",author_phone:"",banner_path:"",certification_template_id:null,certification_title:"",challenge_options:[],challenge_requirements:"",challenge_statement:"",challenge_type:"classic",content_generated:!1,context_notes:"",cover_path:"",custom_competency_names:[],custom_guiding_resources:[],custom_statement:"",custom_title:"",deliverable_config_ids:[],desired_outcome:"",error:null,estimated_value:"",generating:!1,guiding_questions:[],learning_goals:[],loading:!1,new_competencies:[],no_agents:!1,organization_type:"",overview:"",problem_description:"",resolve:Function(),selected_competency_ids:[],selected_option:null,show_custom:!1,step:0,subject_id:null,
2subject_name:"",target_audience:"",title:"",total_est_completion_time:60,trigger_content_type:"",trigger_content_url:"",use_ai:!1,video_script:"",visible:!1,what_ifs:[]}),r=()=>new Promise(e=>{i({resolve:e,visible:!0})}),o=e=>{t.resolve(e||null),n()},d=e=>i({error:null,step:e});if((0,l.useImperativeHandle)(s,()=>({hide:o,show:r})),!t.visible)return null;const{step:c}=t,h=eB[c],u=0===c,m=c-1;return(0,N.jsx)(TD,{value:(0,F.A)((0,F.A)({},t),{},{api:a,goToStep:d,hide:o,nextStep:()=>d(t.step+1),prevStep:()=>d(Math.max(0,t.step-1)),setState:i}),children:(0,N.jsxs)(Ce.S,{className:"ccw-overlay",children:[(0,N.jsxs)(Ce.S,{className:"ccw-header",children:[(0,N.jsxs)(Ce.S,{className:"ccw-header-left",children:[(0,N.jsx)(ze.T_n,{color:"var(--primary)",size:18}),(0,N.jsxs)("span",{className:"ccw-header-title",children:[(0,N.jsx)("span",{className:"ccw-accent",children:(0,N.jsx)(ke.A,{defaultMessage:"AI",id:"label.ai.11fb682b"})})," ",(0,N.jsx)(ke.A,{defaultMessage:"Challenge builder",id:"label.challenge_builder.577746c0"})]})]}),!u&&(0,N.jsx)(Ce.S,{className:"ccw-progress",children:sB.map((e,s)=>(0,N.jsxs)(l.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"ccw-step-node",children:[(0,N.jsx)(Ce.S,{className:`ccw-step-dot ${s===m?"active":""} ${s<m?"completed":""}`,children:s<m?(0,N.jsx)(ze.CMH,{size:12}):(0,N.jsx)("span",{children:s+1})}),(0,N.jsx)("span",{className:"ccw-step-label "+(s===m?"active":""),children:e})]}),s<sB.length-1&&(0,N.jsx)(Ce.S,{className:"ccw-step-line",children:(0,N.jsx)(Ce.S,{className:"ccw-step-line-fill",style:{width:s<m?"100%":"0%"}})})]},e))}),(0,N.jsx)("button",{className:"ccw-header-close",onClick:()=>o(null),type:"button",children:(0,N.jsx)(ze.QCr,{size:18})})]}),(0,N.jsx)(Ce.S,{className:"ccw-body "+(u?"ccw-body-landing":""),children:(0,N.jsx)(Ce.S,{className:u?"ccw-landing-container":"ccw-step-container",children:h&&(0,N.jsx)(h,{})},c)})]})})});aB.displayName="ChallengeCreationWizard";var tB=aB;class iB extends l.Component{constructor(s){super(s),this.createNewPersona=function(e){const{app:s,history:a}=this.props,t=s.api;this.setState({loading:!0}),t.post("/api/agent-templates/personas/create",{name:e,slug:e.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}).then(e=>{let{stub:s}=e;a.push("/admin/agent-template/"+s.id)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.refreshPersonas)},this.handleChangeOrganization=e=>{var s;const a=null===(s=this.change_organization_modal)||void 0===s?void 0:s.current;a&&(this.active_stub=e,a.show({body:"Select an organization to make the owner of this agent. Leave unselected for a global agent accessible to all organizations.",preselected_organization_id:null===e||void 0===e?void 0:e.organization_id}))},this.setAgentOrganization=async s=>{const a=this.active_stub;if(!a)return;const{app:t}=this.props;this.setState({loading:!0});try{await t.api.post(`/api/agent-templates/personas/stub/set/organization/${a.id}`,{organization_id:s||null}),this.active_stub=null,this.refreshPersonas()}catch(e){this.setState({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,loading:!1})}},this.state={count:0,error:null,loading:!0,page:1,page_size:10,personas:null,sort_direction:"ASC",sort_token:"name"},this.search_term="",this.new_agent_persona_editor=null,this.dialog=(0,l.createRef)(),this.change_organization_modal=(0,l.createRef)(),this.active_stub=null}componentDidMount(){this.refreshPersonas()}refreshPersonas(){const{app:e}=this.props,s=e.api;this.setState({loading:!0,personas:null}),s.get("/api/agent-templates/personas/list").then(e=>{let{stubs:s}=e;this.setState({count:(null===s||void 0===s?void 0:s.length)||0,loading:!1,personas:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}handleRemoveConfirm(e){var s,a;const t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!t)return;const i=(null===e||void 0===e||null===(a=e.stub)||void 0===a?void 0:a.id)||(null===e||void 0===e?void 0:e.agent_persona_stub_id);t.show({actions:[t.CancelAction(),t.Action({label:"Remove",onClick:()=>{this.handleStubDelete(i).then(()=>{this.refreshPersonas()}).catch(()=>{this.refreshPersonas()})},variant:"primary"})],body:"Are you sure you want to delete this agent persona?",size:"sm",title:"Removal Confirmation"})}handleStubDelete(e){const{app:s}=this.props,a=s.api;return this.setState({error:null,loading:!0}),new Promise((s,t)=>{a.post("/api/agent-templates/personas/delete/"+e).then(()=>{this.setState({loading:!1}),s()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),t(s)})})}render(){const{error:e,loading:s,personas:a,sort_direction:t,sort_token:i}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:!!e,variant:"danger",children:e}),(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{md:9}),(0,N.jsx)(Ve.A,{className:"text-end",md:3,children:(0,N.jsxs)(ve.A,{variant:"primary",onClick:async()=>{let e=await this.new_agent_persona_editor.promptNewAgentPersonaTitle();e&&this.createNewPersona(e)},children:[(0,N.jsx)("span",{className:"me-1",children:(0,N.jsx)(ze.OiG,{})}),(0,N.jsx)(ke.A,{defaultMessage:"New agent persona",id:"label.new_agent_persona.05192d01"})]})})]}),(0,N.jsxs)(ho,{defaultSortDirection:t,defaultSortToken:i,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Category",id:"label.category.292c06f0"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Owner",id:"label.owner.4b1b8aa3"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Updated",id:"label.updated.3a5ecca1"})}),(0,N.jsx)(ho.Th,{style:{textAlign:"right"},children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:s,children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map(e=>{let s=null===e||void 0===e?void 0:e.current,a=(null===s||void 0===s?void 0:s.name)||"",t=null===s||void 0===s?void 0:s.category,i=null===s||void 0===s?void 0:s.published,l=null===e||void 0===e?void 0:e.organization,n=(0,N.jsx)(Ce.S,{children:l?l.name:(0,N.jsx)(ze.Eh_,{className:"text-primary"})});return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center gap-2",to:"/admin/agent-template/"+e.id,children:[null!==s&&void 0!==s&&s.avatar_path?(0,N.jsx)(md,{name:a||"?",size:32,src:s.avatar_path}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{background:(null===t||void 0===t?void 0:t.color)||"#6c757d",borderRadius:"50%",color:"#fff",flexShrink:0,fontSize:14,height:32,width:32},children:(a||"?").charAt(0).toUpperCase()}),(0,N.jsx)("b",{children:a})]})}),(0,N.jsx)(ho.Td,{children:null!==t&&void 0!==t&&t.name?(0,N.jsx)(bo.A,{pill:!0,bg:"info",children:t.name}):"-"}),(0,N.jsx)(ho.Td,{children:1===i?(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"align-middle",text:"dark",children:[(0,N.jsx)(ze.A7C,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Published",id:"label.published.2ef42ec2"})]}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"align-middle",children:(0,N.jsx)(ke.A,{defaultMessage:"Unpublished",id:"label.unpublished.b6e07310"})})}),(0,N.jsx)(ho.Td,{className:"text-center",children:n}),(0,N.jsx)(ho.Td,{children:null!==s&&void 0!==s&&s.updated_at?ci()(s.updated_at).format("MMM D, YYYY"):"-"}),(0,N.jsx)(ho.Td,{style:{textAlign:"right",whiteSpace:"nowrap"},children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(Le.Link,{className:"btn btn-outline-secondary btn-sm",to:"/admin/agent-template/"+e.id,children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})}),(0,N.jsxs)(ve.A,{onClick:()=>this.handleChangeOrganization(e),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.ymh,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Change org",id:"label.change_org.a24f3cb5"})]}),(0,N.jsx)(ve.A,{onClick:()=>{this.handleRemoveConfirm(s)},size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No agent personas found.",id:"label.no_agent_personas_found.351dd3aa"})})})})]}),(0,N.jsx)(Lr,{count:this.state.count,page:this.state.page,page_size:this.state.page_size,onChange:e=>{this.setState({page:e},()=>this.refreshPersonas())}})]}),(0,N.jsx)(je,{ref:this.dialog}),(0,N.jsx)(NR,{onSubmit:e=>this.setAgentOrganization(e||null),ref:this.change_organization_modal}),(0,N.jsx)(rB,{onRef:e=>this.new_agent_persona_editor=e})]})}}var lB=(0,Pe.y)((0,P.G0)(_T(iB)));
2class nB extends l.Component{constructor(e){super(e),this.promptNewAgentPersonaTitle=()=>(this.setState({agreed:!1,show:!0}),new Promise((e,s)=>{this.resolve=e,this.reject=s})),this.handleSubmit=e=>this.setState({show:!1},()=>this.resolve(null===e||void 0===e?void 0:e.title)),this.handleHide=()=>this.setState({show:!1}),this.state={agreed:!1,show:!1},this.resolve=null,this.reject=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"==typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{agreed:e,show:s,title:a}=this.state,{intl:t}=this.props,{formatMessage:i}=t;return(0,N.jsx)(xe,{onHide:this.handleHide,show:s,children:(0,N.jsx)(ds.l1,{onSubmit:this.handleSubmit,validateOnChange:!0,initialValues:{title:a||""},validate:e=>{const s={};return e.title&&0!==e.title.trim().length||(s.title=i({id:"label.a_name_is_required.437fd48f",defaultMessage:"A name is required"})),s},children:s=>{let{errors:a,handleChange:t,handleSubmit:l,touched:n,values:r}=s;return(0,N.jsxs)(_e.A,{onSubmit:l,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new agent persona",id:"label.create_new_agent_persona.e19c06ad"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Provide a name for the new agent persona",id:"label.provide_a_name_for_the_new_agent_p.a1025abb"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Agent persona name",isInvalid:(null===n||void 0===n?void 0:n.title)&&(null===a||void 0===a?void 0:a.title),isValid:(null===n||void 0===n?void 0:n.title)&&!(null!==a&&void 0!==a&&a.title),name:"title",onChange:t,value:null===r||void 0===r?void 0:r.title,placeholder:i({id:"label.enter_a_name.bac4a4cb",defaultMessage:"Enter a name..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:e,id:"new-agent-persona-disclaimer",onClick:()=>this.setState({agreed:!e}),label:(0,N.jsx)("p",{className:"m-0",style:{maxWidth:"80%"},children:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have reviewed and am responsible for the configuration of this AI agent persona.",id:"label.i_agree_that_i_have_reviewed_and_a.b1578389"})})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:this.handleHide,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:!(null!==r&&void 0!==r&&r.title)||!e,onClick:l,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"})})]})]})}})})}}const rB=(0,Ke.Ay)(nB);class oB extends l.Component{constructor(e){super(e),this.createNewChallengeTemplate=function(e){const{app:s,history:a}=this.props,{api:t,userIsSiteAdmin:i}=s,l=this;this.setState({loading:!0}),t.post("/api/challenge-templates/create",{contributor:i()?0:1,title:e}).then(e=>{let{challenge_template:s,stub:t}=e;a.push("/admin/challenge-template/"+t.id)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;l.setState({error:s,loading:!1})})},this.changeSearchTerm=async e=>{this.search_term=e},this.changeSearchFilters=async e=>{const{selected_audience_ids:s,selected_organization_id:a,selected_subject_ids:t,selected_tag_ids:i}=e;this.selected_organization_id=a,this.selected_audience_ids=s,this.selected_subject_ids=t,this.selected_tag_ids=i},this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.refreshChallengeTemplates)},this.state={challenge_template:null,challenge_templates:null,count:0,error:null,loading:!0,page:1,page_size:10,redirect:null,role_editor_user:null,sort_direction:"ASC",sort_token:"title",stub:null},this.selected_organization_id="",this.selected_audience_ids=[],this.selected_subject_ids=[],this.selected_tag_ids=[],this.search_term="",this.new_challenge_template_editor=null,this.dialog=(0,l.createRef)()}refreshChallengeTemplates(){const{app:e}=this.props,s=e.api,{page:a,page_size:t,sort_direction:i,sort_token:l}=this.state;this.setState({challenge_templates:null,loading:!0}),s.post(`/api/marketplace/challenges/search/${a}/${t}`,{include_unpublished:1,search_term:this.search_term,selected_audience_ids:this.selected_audience_ids,selected_organization_id:this.selected_organization_id,selected_subject_ids:this.selected_subject_ids,selected_tag_ids:this.selected_tag_ids,sort_direction:i,sort_token:l}).then(e=>{let{challenge_templates:s,count:a}=e;this.setState({challenge_templates:s,count:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}handleRemoveConfirm(e){var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:"Remove",onClick:()=>{this.handleStubDelete(e.challenge_template_stub_id).then(()=>{this.refreshChallengeTemplates()}).catch(e=>{this.refreshChallengeTemplates()})},variant:"primary"})],body:"Are you sure you want to delete this challenge template?",size:"sm",title:"Removal Confirmation"})}handleStubDelete(e){const{app:s}=this.props,a=s.api;return this.setState({error:null,loading:!0}),new Promise((s,t)=>{a.post("/api/challenge-templates/delete/stub/"+e).then(()=>{this.setState({loading:!1}),s()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null}),t(s)})})}componentDidMount(){}render(){const{challenge_templates:e,error:s,loading:a}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:s,variant:"danger",children:s}),(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{md:9,children:(0,N.jsx)(Uo,{value:{attemptSearch:this.refreshChallengeTemplates.bind(this),changePage:(e,s)=>this.setState({page:e},s),changeSearchFilters:this.changeSearchFilters,changeSearchTerm:this.changeSearchTerm,count:0,search_term:""},children:(0,N.jsx)(Do,{noPadding:!0,include_unpublished:1})})}),(0,N.jsx)(Ve.A,{className:"text-end",md:3,children:(0,N.jsxs)(ve.A,{variant:"primary",onClick:async()=>{const e=await this.new_challenge_template_editor.promptNewChallengeTemplateTitle();e&&this.createNewChallengeTemplate(e)},children:[(0,N.jsx)("span",{className:"me-1",children:(0,N.jsx)(ze.OiG,{})}),"New Challenge"]})})]}),(0,N.jsxs)(ho,{defaultSortDirection:this.state.sort_direction,defaultSortToken:this.state.sort_token,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Owner",id:"label.owner.4b1b8aa3"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Usage",id:"label.usage.8d59829c"})}),(0,N.jsx)(ho.Th,{style:{textAlign:"right"},children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:a,children:null!==e&&void 0!==e&&e.length?(0,N.jsx)(N.Fragment,{children:e.map(e=>{const s=null===e||void 0===e?void 0:e.title,a=null===e||void 0===e?void 0:e.stub,t=a&&a.organization,i=(null===e||void 0===e?void 0:e.published)||!1,l=null===e||void 0===e?void 0:e.total_learners_assigned,n=null===e||void 0===e?void 0:e.total_learners_completed,r=null===e||void 0===e?void 0:e.total_learners_started,o=(0,N.jsx)(Ce.S,{children:t?t.name:(0,N.jsx)(ze.Eh_,{className:"text-primary"})});return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{style:{width:40},children:(0,N.jsx)(Ad,{component:e,size:40,type:"challenge"})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{push:!0,to:"/admin/challenge-template/"+a.id,children:(0,N.jsx)("b",{children:s})})}),(0,N.jsx)(ho.Td,{children:i?(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"ms-2 align-middle",text:"dark",children:[(0,N.jsx)(ze.A7C,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Published",id:"label.published.2ef42ec2"})]}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"ms-2 align-middle",children:(0,N.jsx)(ke.A,{defaultMessage:"Unpublished",id:"label.unpublished.b6e07310"})})}),(0,N.jsx)(ho.Td,{className:"text-center",children:o}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(Ce.S,{className:"text-center me-1",children:[(0,N.jsx)("b",{children:l}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"assigned",id:"label.assigned.2ebb9294"})})]}),(0,N.jsxs)(Ce.S,{className:"text-center me-1",children:[(0,N.jsx)("b",{children:r}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})})]}),(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)("b",{children:n}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})})]})]})}),(0,N.jsx)(ho.Td,{style:{textAlign:"right",whiteSpace:"nowrap"},children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(Le.Link,{className:"btn btn-outline-secondary btn-sm",to:"/admin/challenge-template/"+a.id,children:"Edit"}),(0,N.jsx)(ve.A,{onClick:s=>{this.handleRemoveConfirm(e)},size:"sm",variant:"outline-danger",children:"Delete"})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No challenges found.",id:"label.no_challenges_found.611bf615"})})})})]}),(0,N.jsx)(Lr,{count:this.state.count,page:this.state.page,page_size:this.state.page_size,onChange:e=>{this.setState({page:e},()=>{this.refreshChallengeTemplates(this.state.sort_token,this.state.sort_direction)})}})]}),(0,N.jsx)(je,{ref:this.dialog}),(0,N.jsx)(hB,{onRef:e=>{this.new_challenge_template_editor=e}})]})}}var dB=(0,Pe.y)((0,P.G0)(_T(oB)));
2class cB extends l.Component{constructor(e){super(e),this.promptNewChallengeTemplateTitle=()=>(this.setState({agreed:!1,show:!0}),new Promise((e,s)=>{this.resolve=e,this.reject=s})),this.handleSubmit=e=>this.setState({show:!1},()=>this.resolve(null===e||void 0===e?void 0:e.title)),this.handleHide=()=>this.setState({show:!1}),this.state={agreed:!1,show:!1},this.resolve=null,this.reject=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"==typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{agreed:e,show:s,title:a}=this.state,{app:t,intl:i}=this.props,{common:l,locale:n}=t,{getValidator:r}=(null===l||void 0===l?void 0:l.validators)||{},{formatMessage:o}=i;return(0,N.jsx)(xe,{onHide:this.handleHide,show:s,children:(0,N.jsx)(ds.l1,{onSubmit:this.handleSubmit,validationSchema:r({locale:n,scope:"content_authoring.add_challenge"}),validatorOnChange:!0,initialValues:{title:a||""},children:s=>{let{errors:a,handleChange:t,handleSubmit:i,touched:l,values:n}=s;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new challenge",id:"label.create_new_challenge.9991856e"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Provide a title for the new challenge",id:"label.provide_a_title_for_the_new_challe.355f6cde"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Challenge title",isInvalid:(null===l||void 0===l?void 0:l.title)&&(null===a||void 0===a?void 0:a.title),isValid:(null===l||void 0===l?void 0:l.title)&&!(null!==a&&void 0!==a&&a.title),name:"title",onChange:t,value:null===n||void 0===n?void 0:n.title,placeholder:o({id:"label.enter_a_title.38d974bb",defaultMessage:"Enter a title..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:e,id:"new-challenge-template-disclaimer",onClick:()=>this.setState({agreed:!e}),label:(0,N.jsx)("p",{className:"m-0",style:{maxWidth:"80%"},children:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have, or have obtained permission to use all content provided for this module.",id:"label.i_agree_that_i_have_or_have_obtain.3f819a39"})})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:this.handleHide,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:!(null!==n&&void 0!==n&&n.title)||!e,onClick:i,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})})]})]})}})})}}const hB=(0,Ke.Ay)((0,P.G0)(cB));class uB extends l.Component{constructor(e){super(e),this.createNewCartridgeTemplate=function(e){const{app:s,history:a}=this.props,t=s.api,i=this;this.setState({loading:!0}),t.post("/api/cartridge-templates/create",{contributor:1,title:e}).then(e=>{let{cartridge_template:s,stub:t}=e;a.push("/admin/cartridge-template/"+t.id)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i.setState({error:s,loading:!1})})},this.changeSearchTerm=async e=>{this.search_term=e},this.changeSearchFilters=async e=>{console.log("### CHANGE FILTERS",e);const{selected_audience_ids:s,selected_organization_id:a,selected_subject_ids:t,selected_tag_ids:i}=e;this.selected_organization_id=a,this.selected_audience_ids=s,this.selected_subject_ids=t,this.selected_tag_ids=i},this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.refreshCartridgeTemplates)},this.state={cartridge_template:null,cartridge_templates:null,count:0,error:null,loading:!0,page:1,page_size:10,redirect:null,role_editor_user:null,sort_direction:"ASC",sort_token:"title",stub:null},this.selected_organization_id="",this.selected_audience_ids=[],this.selected_subject_ids=[],this.selected_tag_ids=[],this.search_term="",this.new_cartridge_template_editor=null,this.dialog=(0,l.createRef)()}refreshCartridgeTemplates(){const{app:e}=this.props,s=e.api,{page:a,page_size:t,sort_direction:i,sort_token:l}=this.state;this.setState({cartridge_templates:null,loading:!0}),console.log("### SUBJECT IDS",this.selected_subject_ids),s.post(`/api/marketplace/cartridges/search/${a}/${t}`,{include_unpublished:1,search_term:this.search_term,selected_audience_ids:this.selected_audience_ids,selected_organization_id:this.selected_organization_id,selected_subject_ids:this.selected_subject_ids,selected_tag_ids:this.selected_tag_ids,sort_direction:i,sort_token:l}).then(e=>{let{cartridge_templates:s,count:a}=e;this.setState({cartridge_templates:s,count:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}handleRemoveConfirm(e){var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:"Remove",onClick:()=>{this.handleStubDelete(e.cartridge_template_stub_id).then(()=>{this.refreshCartridgeTemplates()}).catch(e=>{this.refreshCartridgeTemplates()})},variant:"primary"})],body:"Are you sure you want to delete this cartridge template?",size:"sm",title:"Removal Confirmation"})}handleStubDelete(e){const{app:s}=this.props,a=s.api;return this.setState({error:null,loading:!0}),new Promise((s,t)=>{a.post("/api/cartridge-templates/delete/stub/"+e).then(()=>{this.setState({loading:!1}),s()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null}),t(err)})})}componentDidMount(){}render(){const{cartridge_templates:e,error:s,loading:a,sort_direction:t,sort_token:i}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:s,variant:"danger",children:s}),(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{md:9,children:(0,N.jsx)(Uo,{value:{attemptSearch:this.refreshCartridgeTemplates.bind(this),changePage:(e,s)=>this.setState({page:e},s),changeSearchFilters:this.changeSearchFilters,changeSearchTerm:this.changeSearchTerm,count:0,search_term:""},children:(0,N.jsx)(Fo,{noPadding:!0,include_unpublished:1})})}),(0,N.jsx)(Ve.A,{className:"text-end",md:3,children:(0,N.jsxs)(ve.A,{variant:"primary",onClick:async()=>{const e=await this.new_cartridge_template_editor.promptNewCartridgeTemplateTitle();e&&this.createNewCartridgeTemplate(e)},children:[(0,N.jsx)("span",{className:"me-1",children:(0,N.jsx)(ze.OiG,{})}),"New Cartridge"]})})]}),(0,N.jsxs)(ho,{defaultSortDirection:t,defaultSortToken:i,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Owner",id:"label.owner.4b1b8aa3"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Usage",id:"label.usage.8d59829c"})}),(0,N.jsx)(ho.Th,{style:{textAlign:"right"},children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:a,children:null!==e&&void 0!==e&&e.length?(0,N.jsx)(N.Fragment,{children:e.map(e=>{const s=null===e||void 0===e?void 0:e.title,a=null===e||void 0===e?void 0:e.stub,t=a&&a.organization,i=(null===e||void 0===e?void 0:e.published)||!1,l=null===e||void 0===e?void 0:e.total_learners_assigned,n=null===e||void 0===e?void 0:e.total_learners_completed,r=null===e||void 0===e?void 0:e.total_learners_started,o=(0,N.jsx)(Ce.S,{children:t?t.name:(0,N.jsx)(ze.Eh_,{className:"text-primary"})});return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{style:{width:75},children:(0,N.jsx)(Ad,{component:e,size:45,type:"cartridge"})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{push:!0,to:"/admin/cartridge-template/"+a.id,children:(0,N.jsx)("b",{children:s})})}),(0,N.jsx)(ho.Td,{children:i?(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"ms-2 align-middle",text:"dark",children:[(0,N.jsx)(ze.A7C,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Published",id:"label.published.2ef42ec2"})]}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"ms-2 align-middle",children:(0,N.jsx)(ke.A,{defaultMessage:"Unpublished",id:"label.unpublished.b6e07310"})})}),(0,N.jsx)(ho.Td,{className:"text-center",children:o}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(Ce.S,{className:"text-center me-1",children:[(0,N.jsx)("b",{children:l}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"assigned",id:"label.assigned.2ebb9294"})})]}),(0,N.jsxs)(Ce.S,{className:"text-center me-1",children:[(0,N.jsx)("b",{children:r}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})})]}),(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)("b",{children:n}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})})]})]})}),(0,N.jsx)(ho.Td,{style:{textAlign:"right",whiteSpace:"nowrap"},children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(Le.Link,{className:"btn btn-outline-secondary btn-sm",to:"/admin/cartridge-template/"+a.id,children:"Edit"}),(0,N.jsx)(ve.A,{onClick:s=>{this.handleRemoveConfirm(e)},size:"sm",variant:"outline-danger",children:"Delete"})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No cartridges found.",id:"label.no_cartridges_found.6804f2ae"})})})})]}),(0,N.jsx)(Lr,{count:this.state.count,page:this.state.page,page_size:this.state.page_size,onChange:e=>{this.setState({page:e},()=>this.refreshCartridgeTemplates(this.state.sort_token,this.state.sort_direction))}})]}),(0,N.jsx)(je,{ref:this.dialog}),(0,N.jsx)(pB,{onRef:e=>this.new_cartridge_template_editor=e})]})}}var mB=(0,Pe.y)((0,P.G0)(_T(uB)));class gB extends l.Component{constructor(e){super(e),this.promptNewCartridgeTemplateTitle=()=>(this.setState({agreed:!1,show:!0}),new Promise((e,s)=>{this.resolve=e,this.reject=s})),this.handleSubmit=e=>this.setState({show:!1},()=>this.resolve(null===e||void 0===e?void 0:e.title)),this.handleHide=()=>this.setState({show:!1}),this.state={agreed:!1,show:!1},this.resolve=null,this.reject=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"==typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{agreed:e,show:s,title:a}=this.state,{app:t,intl:i}=this.props,{common:l,locale:n}=t,{getValidator:r}=(null===l||void 0===l?void 0:l.validators)||{},{formatMessage:o}=i;return(0,N.jsx)(xe,{onHide:this.handleHide,show:s,children:(0,N.jsx)(ds.l1,{onSubmit:this.handleSubmit,validationSchema:r({locale:n,scope:"content_authoring.add_cartridge"}),validatorOnChange:!0,initialValues:{title:a||""},children:s=>{let{errors:a,handleChange:t,handleSubmit:i,touched:l,values:n}=s;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new cartridge",id:"label.create_new_cartridge.81e566d7"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Provide a title for the new cartridge",id:"label.provide_a_title_for_the_new_cartri.3ec5d5ee"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Cartridge title",isInvalid:(null===l||void 0===l?void 0:l.title)&&(null===a||void 0===a?void 0:a.title),isValid:(null===l||void 0===l?void 0:l.title)&&!(null!==a&&void 0!==a&&a.title),name:"title",onCh
2ange:t,value:null===n||void 0===n?void 0:n.title,placeholder:o({id:"label.enter_a_title.38d974bb",defaultMessage:"Enter a title..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{children:(0,N.jsx)(_e.A.Check,{checked:e,id:"new-cartridge-template-disclaimer",onClick:()=>this.setState({agreed:!e}),label:(0,N.jsx)("p",{className:"m-0",style:{maxWidth:"80%"},children:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have, or have obtained permission to use all content provided for this module.",id:"label.i_agree_that_i_have_or_have_obtain.3f819a39"})})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:this.handleClose,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:!(null!==n&&void 0!==n&&n.title)||!e,onClick:i,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})})]})]})}})})}}const pB=(0,Ke.Ay)((0,P.G0)(gB));class xB extends l.Component{constructor(e){super(e),this.refreshJourneyTemplates=async()=>{const{api:e}=this.props.app,{page:s,page_size:a,sort_direction:t,sort_token:i}=this.state;this.setState({journey_templates:null,loading:!0});try{const{count:l,group_assignment_templates:n}=await e.post(`/api/marketplace/journeys/search/${s}/${a}`,{include_unpublished:1,search_term:this.search_term,selected_audience_ids:this.selected_audience_ids,selected_organization_id:this.selected_organization_id,selected_subject_ids:this.selected_subject_ids,selected_tag_ids:this.selected_tag_ids,sort_direction:t,sort_token:i});this.setState({count:l,journey_templates:n,loading:!1})}catch(n){var l;this.setState({error:null!==(l=null===n||void 0===n?void 0:n.message)&&void 0!==l?l:n,loading:null})}},this.handleNewJourney=()=>{const{app:e,history:s}=this.props;null!=this.new_journey_template_prompt&&this.new_journey_template_prompt.promptNewJourneyTemplateTitle().then(async a=>{const t=await e.api.post("/api/group-assignment-templates/create",{contributor:1,title:a}),{group_assignment_template:i,stub:l}=t;s.push(`/admin/content-authoring/journey/${l.id}/${i.id}`)}).catch(e=>{})},this.handleDeleteJourney=async e=>{var s;const{app:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:"Remove",onClick:async()=>{this.setState({loading:!0});try{await a.api.post(`/api/group-assignment-templates/delete/stub/${e}`),this.setState({loading:!1},()=>{this.refreshJourneyTemplates()})}catch({err:err}){this.setState({error:(null===err||void 0===err?void 0:err.message)||err,loading:!1})}},variant:"primary"})],body:"Are you sure you want to delete this journey template?",size:"sm",title:"Removal Confirmation"})},this.changeSearchTerm=async e=>{this.search_term=e},this.handleSort=(e,s)=>{this.setState({sort_direction:s,sort_token:e},this.refreshJourneyTemplates)},this.changeSearchFilters=async e=>{let{selected_audience_ids:s,selected_organization_id:a,selected_subject_ids:t,selected_tag_ids:i}=e;this.selected_organization_id=a,this.selected_tag_ids=i,this.selected_audience_ids=s,this.selected_subject_ids=t},this.state={count:0,error:null,journey_templates:null,loading:!0,page:1,page_size:100,sort_direction:"ASC",sort_token:"title"},this.selected_organization_id="",this.selected_tag_ids=[],this.selected_audience_ids=[],this.selected_subject_ids=[],this.search_term="",this.new_journey_template_prompt=null,this.dialog=(0,l.createRef)()}componentDidMount(){}render(){const{count:e,error:s,journey_templates:a,loading:t,page:i,page_size:l,sort_direction:n,sort_token:r}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:s,variant:"danger",children:s}),(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{md:9,children:(0,N.jsx)(Uo,{value:{attemptSearch:this.refreshJourneyTemplates.bind(this),changePage:(e,s)=>this.setState({page:e},s),changeSearchFilters:this.changeSearchFilters,changeSearchTerm:this.changeSearchTerm,count:0,search_term:""},children:(0,N.jsx)(Po,{noPadding:!0,include_unpublished:1})})}),(0,N.jsx)(Ve.A,{className:"text-end",md:3,children:(0,N.jsxs)(ve.A,{onClick:this.handleNewJourney,children:[(0,N.jsx)("span",{className:"me-1",children:(0,N.jsx)(ze.OiG,{})}),"New Journey"]})})]}),(0,N.jsxs)(ho,{defaultSortDirection:n,defaultSortToken:r,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Owner",id:"label.owner.4b1b8aa3"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Usage",id:"label.usage.8d59829c"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:t,children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map(e=>{let s=null===e||void 0===e?void 0:e.current,a=(null===e||void 0===e?void 0:e.published)||!1,t=s&&s.organization,i=null===e||void 0===e?void 0:e.total_learners_assigned,l=null===e||void 0===e?void 0:e.total_learners_completed,n=null===e||void 0===e?void 0:e.total_learners_started,r=(0,N.jsx)(Ce.S,{children:t?t.name:(0,N.jsx)(ze.Eh_,{className:"text-primary"})});return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{style:{width:40},children:(0,N.jsx)(Ad,{component:e,type:"journey",width:40})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)("b",{children:(0,N.jsx)(Le.Link,{to:"/admin/journey-template/"+s.id,children:null===e||void 0===e?void 0:e.title})})}),(0,N.jsx)(ho.Td,{children:a?(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"ms-2 align-middle",text:"dark",children:[(0,N.jsx)(ze.A7C,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Published",id:"label.published.2ef42ec2"})]}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"ms-2 align-middle",children:(0,N.jsx)(ke.A,{defaultMessage:"Unpublished",id:"label.unpublished.b6e07310"})})}),(0,N.jsx)(ho.Td,{className:"text-center",children:r}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(Ce.S,{className:"text-center me-1",children:[(0,N.jsx)("b",{children:i}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"assigned",id:"label.assigned.2ebb9294"})})]}),(0,N.jsxs)(Ce.S,{className:"text-center me-1",children:[(0,N.jsx)("b",{children:n}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})})]}),(0,N.jsxs)(Ce.S,{className:"text-center",children:[(0,N.jsx)("b",{children:l}),(0,N.jsx)("br",{}),(0,N.jsx)(bo.A,{bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})})]})]})}),(0,N.jsx)(ho.Td,{style:{textAlign:"right"},children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(Le.Link,{className:"btn btn-outline-secondary btn-sm",to:"/admin/journey-template/"+s.id,children:"Edit"}),(0,N.jsx)(ve.A,{disabled:!!i,onClick:()=>this.handleDeleteJourney(null===s||void 0===s?void 0:s.id),size:"sm",variant:"outline-danger",children:"Delete"})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No journey templates found.",id:"label.no_journey_templates_found.7248851d"})})})})]}
2),(0,N.jsx)(Lr,{count:e,page:i,page_size:l,onChange:e=>{this.setState({page:e},()=>{this.refreshJourneyTemplates()})}})]}),(0,N.jsx)(je,{ref:this.dialog}),(0,N.jsx)(jB,{onRef:e=>{this.new_journey_template_prompt=e}})]})}}var vB=(0,Pe.y)((0,P.G0)(_T(xB)));class fB extends l.Component{constructor(e){super(e),this.promptNewJourneyTemplateTitle=()=>(this.setState({agreed:!1,show:!0}),new Promise((e,s)=>{this.resolve=e,this.reject=s})),this.handleSubmit=e=>this.setState({show:!1},()=>this.resolve(null===e||void 0===e?void 0:e.title)),this.handleHide=()=>this.setState({show:!1}),this.state={agreed:!1,show:!1},this.resolve=null,this.reject=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"==typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{show:e}=this.state,{app:s,intl:a}=this.props,{common:t,locale:i}=s,{getValidator:l}=(null===t||void 0===t?void 0:t.validators)||{},{formatMessage:n}=a;return(0,N.jsx)(xe,{onHide:this.handleHide,show:e,children:(0,N.jsx)(ds.l1,{onSubmit:this.handleSubmit,validateOnChange:!0,validationSchema:l({locale:i,scope:"content_authoring.add_group_assignment_template"}),initialValues:{title:""},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"New journey",id:"label.new_journey.ede0eb62"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlForm:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Journey title",isInvalid:(null===i||void 0===i?void 0:i.title)&&(null===s||void 0===s?void 0:s.title),isValid:(null===i||void 0===i?void 0:i.title)&&!(null!==s&&void 0!==s&&s.title),name:"title",onChange:a,value:null===l||void 0===l?void 0:l.title,placeholder:n({id:"label.enter_a_title.38d974bb",defaultMessage:"Enter a title..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:this.handleHide,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}
2),(0,N.jsx)(ve.A,{disabled:!(null!==l&&void 0!==l&&l.title),type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Create journey",id:"label.create_journey.62cb0779"})})]})]})}})})}}const jB=(0,Ke.Ay)((0,P.G0)(fB));class _B extends l.Component{constructor(e){super(e),this.launchChallengeWizard=async()=>{var e;const s=await(null===(e=this.challenge_wizard.current)||void 0===e?void 0:e.show());null!==s&&void 0!==s&&s.stub&&(window.location.href="/admin/challenge-template/"+s.stub.id)},this.state={error:null,loading:!0},this.challenge_wizard=(0,l.createRef)()}componentDidMount(){}render(){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsxs)("h4",{children:[(0,N.jsx)(ze.Wqt,{className:"text-primary"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Library",id:"label.library.dc20b3d5"})]}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsxs)(ve.A,{onClick:this.launchChallengeWizard,variant:"primary",children:[(0,N.jsx)(ze.T_n,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"AI Challenge Builder",id:"label.ai_challenge_builder.0c2c3a0d"})]}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{id:"dropdown-manage",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Manage",id:"label.manage.5a234448"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{href:"/admin/subjects",children:"Subjects"}),(0,N.jsx)(li.A.Item,{href:"/admin/tags",children:"Tags"})]})]})]})]}),(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"challenges",id:"admin-library-tabs",mountOnEnter:!0,role:"navigation",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"challenges",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",description:"",id:"label.challenges.40b9c8f4"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"journeys",children:(0,N.jsx)(ke.A,{defaultMessage:"Journeys",description:"",id:"label.journeys.8a953125"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"cartridges",children:(0,N.jsx)(ke.A,{defaultMessage:"Third party",description:"",id:"label.third_party.f3c6dbcc"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"agents",children:(0,N.jsx)(ke.A,{defaultMessage:"Agents",description:"",id:"label.agents.279b44d2"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"challenges",children:(0,N.jsx)(dB,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"journeys",children:(0,N.jsx)(vB,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"cartridges",children:(0,N.jsx)(mB,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"agents",children:(0,N.jsx)(lB,{})})]})})})]}),(0,N.jsx)(tB,{ref:this.challenge_wizard})]})}}var bB=(0,n.G0)(_T(_B));class AB extends l.Component{constructor(e){super(e),this.refreshReports=async()=>{try{const{page:e,page_size:s,sort_direction:a,sort_token:t}=this.state,{admin_group:i,app:l}=this.props,n=null===l||void 0===l?void 0:l.api;this.setState({loading:!0,reports:null,selected_reports:[]});const{count:r,reports:o}=await n.get(`/api/site/social/list/${e}/${s}`,{sort_direction:a,sort_token:t});this.setState({count:r,loading:!1,reports:o})}catch({err:err}){this.setState({error:err,loading:null})}},this.updateSelectedReports=e=>{const{selected_reports:s}=this.state,{app:a}=this.props,t=null===a||void 0===a?void 0:a.api;if(null===s||void 0===s||!s.length)return;const i=[];this.setState({loading:!0});for(const l of s)l&&i.push(t.post("/api/site/social/flag",{flag_id:l,status:e}));Promise.all(i).then(()=>{this.setState({all_selected:!1,loading:!1,selected_reports:[]},this.refreshReports)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.updateReport=async(e,s)=>{try{const{app:a}=this.props,t=a.api;this.setState({all_selected:!1,loading:!0,selected_reports:[]}),await t.post("/api/site/social/flag",{flag_id:e,status:s}),this.setState({loading:!1},this.refreshReports)}catch({err:err}){this.setState({error:err,loading:!1})}},this.undoReport=async e=>{try{const{app:s}=this.props,a=s.api;this.setState({loading:!0}),await a.post("/api/site/social/flag/undo",{flag_id:e}),this.setState({loading:!1},this.refreshReports)}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleChangePage=e=>this.setState({all_selected:!1,page:e,selected_reports:[]},this.refreshReports),this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshReports),this.handleDismissSelectedReports=()=>{var e;const s=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;if(!s)return;const{intl:a}=this.props;s.show({actions:[s.CancelAction(),s.Action({label:a.formatMessage({id:"label.yes_dismiss.9fa01db5",defaultMessage:"Yes, Dismiss"}),onClick:()=>this.updateSelectedReports(1),variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_dismiss_a.c3352ee6",defaultMessage:"Are you sure you want to dismiss all selected messages?"}),size:"sm",title:"Dismiss"})},this.handleHideSelectedReports=()=>{var e;const s=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;if(!s)return;const{intl:a}=this.props;s.show({actions:[s.CancelAction(),s.Action({label:a.formatMessage({id:"label.hide_message.50165099",defaultMessage:"Hide message"}),onClick:()=>this.updateSelectedReports(2),variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_hide_all.a3e7c243",defaultMessage:"Are you sure you want to hide all selected messages?"}),size:"sm",title:"Hide"})},this.handleDeleteSelectedReports=()=>{var e;const s=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;if(!s)return;const{intl:a}=this.props;s.show({actions:[s.CancelAction(),s.Action({label:a.formatMessage({id:"label.delete_message.87e7176a",defaultMessage:"Delete message"}),onClick:()=>this.updateSelectedReports(3),variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_delete_al.ce06eafc",defaultMessage:"Are you sure you want to delete all selected messages?"}),size:"sm",title:a.formatMessage({id:"label.delete.e2d0a549",defaultMessage:"Delete"})})},this.handleViewReportContent=(e,s)=>{var a,t;e.preventDefault();const i=null===this||void 0===this||null===(a=this.dialog)||void 0===a?void 0:a.current;if(!i)return;const{intl:l}=this.props;i.show({actions:[i.CancelAction()],body:(0,N.jsx)("img",{src:null===s||void 0===s||null===(t=s.file)||void 0===t?void 0:t.location,style:{borderRadius:"4px",height:"100%",width:"100%"},alt:l.formatMessage({id:"label.the_content_of_the_file_attachment.bd762ced",defaultMessage:"The content of the file attachment for this flagged message"})}),size:"sm",title:l.formatMessage({id:"label.view_content.a1eee7df",defaultMessage:"View content"})})},this.handleViewReportDetails=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{comments:i,type:l}=e||{};let n="";switch(l){case 0:n=t.formatMessage({id:"label.inappropriate_content.940bd85c",defaultMessage:"Inappropriate content"});break;case 1:n=t.formatMessage({id:"label.spam_or_duplicate_comments.31442e34",defaultMessage:"Spam or duplicate comments"});break;case 2:n=t.formatMessage({id:"label.other.f97e9da0",defaultMessage:"Other"})}a.show({actions:[a.CancelAction()],body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Reason:",id:"label.reason.3425d108"})," ",n,(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),(0,N.jsx)(ke.A,{defaultMessage:"Comment:",id:"label.comment.2edf06ba"})," ",i||"-"]}),size:"sm",title:t.formatMessage({id:"label.view_details.d1bf045b",defaultMessage:"View details"})})},this.handleDismissSingleReport=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:t.formatMessage({id:"label.yes_dismiss.9fa01db5",defaultMessage:"Yes, Dismiss"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,1),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:t.formatMessage({id:"label.are_you_sure_you_want_to_dismiss_t.be41db06",defaultMessage:"Are you sure you want to dismiss this message?"}),size:"sm",title:"Dismiss"})},this.handleHideSingleReport=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:t.formatMessage({id:"label.hide_message.50165099",defaultMessage:"Hide message"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,2),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:t.formatMessage({id:"label.are_you_sure_you_want_to_hide_this.34309a76",defaultMessage:"Are you sure you want to hide this message?"}),size:"sm",title:t.formatMessage({id:"label.hide.ac20a57b",defaultMessage:"Hide"})})},this.handleDeleteSingleReport=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:t.formatMessage({id:"label.delete_message.87e7176a",defaultMessage:"Delete message"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,3),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:t.formatMessage({id:"label.are_you_sure_you_want_to_delete_th.a221ce62",defaultMessage:"Are you sure you want to delete this message?"}),size:"sm",title:t.formatMessage({id:"label.delete.e2d0a549",defaultMessage:"Delete"})})},this.handleUndoSingleReport=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props;a.show({actions:[a.CancelAction(),a.Action({label:t.formatMessage({id:"label.undo_action.20bb2a9b",defaultMessage:"Undo action"}),onClick:()=>{this.undoReport(null===e||void 0===e?void 0:e.id),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:t.formatMessage({id:"label.are_you_sure_you_want_to_undo_this.f0415c73",defaultMessage:"Are you sure you want to undo this report? This message will be restored and visible to learners."}),size:"sm",title:t.formatMessage({id:"label.undo.a8283ade",defaultMessage:"Undo"})})},this.isSelectedReport=e=>
2this.state.selected_reports.includes(e),this.getSelectableReports=()=>{var e;const{reports:s}=this.state;return null===s||void 0===s||null===(e=s.filter)||void 0===e?void 0:e.call(s,e=>0===(null===e||void 0===e?void 0:e.status))},this.toggleSelectAll=()=>{const{all_selected:e}=this.state,s=this.getSelectableReports().map(e=>null===e||void 0===e?void 0:e.id),a=e?[]:[...s];this.setState({all_selected:!e,selected_reports:a})},this.toggleSelection=e=>{const{selected_reports:s}=this.state,a=this.getSelectableReports(),t=this.isSelectedReport(e)?s.filter(s=>s!==e):[...s,e];this.setState({all_selected:(null===a||void 0===a?void 0:a.length)===(null===t||void 0===t?void 0:t.length),selected_reports:t})},this.state={all_selected:!1,count:0,error:null,loading:!0,page:1,page_size:20,reports:null,selected_reports:[],sort_direction:"DESC",sort_token:"created_at"},this.dialog=(0,l.createRef)()}componentDidMount(){this.refreshReports()}render(){var e;const{app:s,intl:a}=this.props,{styles:t}=s,{all_selected:i,count:l,error:n,loading:r,page:o,page_size:d,reports:c,selected_reports:h,sort_direction:u,sort_token:m}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("h4",{children:[(0,N.jsx)(ze.onj,{className:"text-primary me-1",size:20}),(0,N.jsx)(ke.A,{defaultMessage:"Social content moderation",id:"label.social_content_moderation.0
2d9bcb85"})]}),(0,N.jsxs)(Ge.A,{body:!0,className:"social-dashboard",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:n,variant:"danger",children:n}),r?(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"text-end mb-2",children:(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{disabled:0===h.length,size:"sm",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"With selected",description:"",id:"label.with_selected.338a14ac"})}),(0,N.jsxs)(li.A.Menu,{align:"end",children:[(0,N.jsx)(li.A.Item,{onClick:this.handleDismissSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Dismiss",id:"label.dismiss.48845bff"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleHideSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Hide",id:"label.hide.ac20a57b"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleDeleteSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})]})}),(0,N.jsxs)(ho,{defaultSortDirection:u,defaultSortToken:m,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"align-middle",children:(0,N.jsx)(_e.A.Check,{checked:i,disabled:!(null!==(e=this.getSelectableReports())&&void 0!==e&&e.length),onClick:this.toggleSelectAll,type:"checkbox","aria-label":a.formatMessage({id:"label.toggle_select_all_reports.506c8d39",defaultMessage:"Toggle select all reports"})})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",hiddenBelow:"lg",name:"status",children:(0,N.jsx)("span",{className:"d-inline-flex align-items-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",name:"content",children:(0,N.jsx)("span",{className:"d-inline-flex align-items-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Content",id:"label.content.47bd2907"})})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",hiddenBelow:"lg",name:"author",children:(0,N.jsx)("span",{className:"d-inline-flex align-items-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",hiddenBelow:"lg",name:"group",children:(0,N.jsxs)("span",{className:"d-inline-flex align-items-center",children:[(0,N.jsx)(ke.A,{defaultMessage:"Group",description:"",id:"label.group.34ca0e76"})," / ",(0,N.jsx)(ke.A,{defaultMessage:"Assigned challenge",description:"",id:"label.assigned_challenge.657ce242"})]})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",hiddenBelow:"lg",name:"reporter",children:(0,N.jsx)("span",{className:"d-inline-flex align-items-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Reported by",id:"label.reported_by.c170bc77"})})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"align-middle",hiddenBelow:"lg",name:"created_at",children:(0,N.jsx)("span",{className:"d-inline-flex align-items-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Date",id:"label.date.99c40ab4"})})}),(0,N.jsx)(ho.Th,{className:"text-end align-middle",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:8,loading:r,children:null!==c&&void 0!==c&&c.length?(0,N.jsx)(N.Fragment,{children:c.map(e=>{var a,t;const{created_at:i,creator:l,status:n,team_message:r}=e,o=null===r||void 0===r?void 0:r.message,{body:d,user:c}=o||{},h=c.fullname,u=l.fullname;let m="",g="";switch(n){case 0:m="open",g="primary";break;case 1:m="dismissed",g="secondary";break;case 2:m="hidden",g="warning";break;case 3:m="deleted",g="danger"}const{team:p}=r||{},{assignment:x}=p,{group:v}=x;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(_e.A.Check,{checked:this.isSelectedReport(null===e||void 0===e?void 0:e.id),disabled:0!==(null===e||void 0===e?void 0:e.status),id:`report-${null===e||void 0===e?void 0:e.id}`,name:`report-${null===e||void 0===e?void 0:e.id}`,onChange:()=>this.toggleSelection(null===e||void 0===e?void 0:e.id),type:"checkbox"})}),(0,N.jsx)(ho.Td,{className:"align-middle text-center",hiddenBelow:"lg",children:(0,N.jsx)(bo.A,{bg:g,children:m})}),(0,N.jsx)(ho.Td,{className:"social-dashboard-message-content",children:"image"===(null===r||void 0===r||null===(a=r.file)||void 0===a?void 0:a.type)&&null!==r&&void 0!==r&&null!==(t=r.file)&&void 0!==t&&t.location?(0,N.jsx)(ve.A,{className:"p-0",variant:"link",onClick:e=>this.handleViewReportContent(e,r),children:(0,N.jsx)(ke.A,{defaultMessage:"View content",id:"label.view_content.a1eee7df"})}):(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:d}})}),(0,N.jsx)(ho.Td,{className:"align-middle",hiddenBelow:"lg",children:h}),(0,N.jsxs)(ho.Td,{className:"align-middle",hiddenBelow:"lg",children:[(0,N.jsx)("a",{href:"/admin/group/"+v.id,children:v.name}),(0,N.jsx)("span",{children:" / "}),(0,N.jsx)("a",{href:"/admin/group/"+v.id+"/assignment/"+x.id,children:x.name?x.name:"View"})]}),(0,N.jsx)(ho.Td,{className:"align-middle",hiddenBelow:"lg",children:u}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:(0,N.jsx)(Gh.XU,{value:new Date(i)})}),(0,N.jsx)(ho.Td,{className:"text-end",children:s.userHasRight("manage_organization")?(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[0===n&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onClick:()=>this.handleDismissSingleReport(e),size:"sm",variant:"outline-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Dismiss",id:"label.dismiss.48845bff"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleHideSingleReport(e),size:"sm",variant:"outline-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Hide",id:"label.hide.ac20a57b"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleDeleteSingleReport(e),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]}),0!==n&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ve.A,{onClick:()=>this.handleUndoSingleReport(e),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Undo",id:"label.undo.a8283ade"})})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleViewReportDetails(e),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Details",id:"label.details.45989de4"})})]}):"-"})]},null===e||void 0===e?void 0:e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"8",children:(0,N.jsx)(ke.A,{defaultMessage:"No reports found.",id:"label.no_reports_found.38387272"})})})})]}
2),(0,N.jsx)(Lr,{count:l,onChange:this.handleChangePage,page:o,page_size:d})]}),(0,N.jsx)(je,{ref:this.dialog})]})]})}}var yB=(0,Ke.Ay)((0,P.G0)(_T(AB)));class wB extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.fetchUsers=async()=>{try{const{page:e,page_size:s,search_term:a,sort_direction:t,sort_token:i}=this.state,{app:n}=this.props,r=n.api;this.setState({loading:!0,users:null});const{count:o,users:d}=await r.get(`/api/site/users/list/${e}/${s}`,{search_term:a,sort_direction:t,sort_token:i});d.forEach(e=>e.ref=l.createRef(null)),this.setState({count:o,loading:!1,users:d})}catch({err:err}){this.setState({error:err,loading:null})}},this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},this.fetchUsers)},1e3)},this.handleChangeSearchTerm=e=>{let s=e.target.value;this.setState({search_term:s}),this.startSearch()},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.fetchUsers),this.handleChangePage=e=>this.setState({page:e},this.fetchUsers),this.launchUserDetailsModal=e=>{var s;const a=null===this||void 0===this||null===(s=this.user_details_modal)||void 0===s?void 0:s.current;a&&a.show({user_id:e})},this.state={count:0,error:null,loading:!0,page:1,page_size:20,role_editor_user:null,search_term:"",show_pw_editor:null,show_user_viewer:null,sort_direction:"DESC",sort_token:"role",users:null},this.search_timer=null,this.user_details_modal=(0,l.createRef)()}async componentDidMount(){await this.fetchUsers()}render(){const{count:e,error:s,loading:a,page:t,page_size:i,search_term:l,sort_direction:n,sort_token:r,users:o}=this.state;return(0,N.jsxs)(CB,{value:{fetchUsers:this.fetchUsers,handleSort:this.handleSort,launchUserDetailsModal:this.launchUserDetailsModal,loading:a,search_term:l,sort_direction:n,sort_token:r,users:o},children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center mb-2",children:[(0,N.jsx)(ze.YXz,{className:"text-primary me-1",size:20}),(0,N.jsx)("h4",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"})})]}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:s,variant:"danger",children:s}),(0,N.jsxs)(Ei.A,{className:"float-start",size:"sm",style:{marginBottom:10,width:"40%"},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{disabled:a,onChange:this.handleChangeSearchTerm,placeholder:"Search",readOnly:a,value:l})]}),(0,N.jsx)(kB,{}
2),(0,N.jsx)(Lr,{count:e,onChange:this.handleChangePage,page:t,page_size:i})]}),(0,N.jsx)(DE,{onUserUpdated:this.fetchUsers,ref:this.user_details_modal})]})}}var NB=(0,n.G0)(_T(wB));const SB=l.createContext({}),CB=SB.Provider,MB=(SB.Consumer,()=>(0,l.useContext)(SB));var kB=e=>{const{handleSort:s,loading:a,sort_direction:t,sort_token:i,users:l}=MB(),{isBelowBreakpoint:n}=(0,ne.vh)({breakpoint:922});return(0,N.jsxs)(ho,{defaultSortDirection:t,defaultSortToken:i,onSort:s,responsive:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"email_address",style:{width:250},children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"role",children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"last_online",children:(0,N.jsx)(ke.A,{defaultMessage:"Last online",id:"label.last_online.ca050a43"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"total_time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time spent online",id:"label.time_spent_online.fbfef977"})})]})}),(0,N.jsx)(ho.Tbody,{cols:n?2:6,loading:a,children:null!==l&&void 0!==l&&l.length?(0,N.jsx)(N.Fragment,{children:l.map((e,s)=>(0,N.jsx)(zB,{user:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:n?2:6,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found",id:"label.no_users_found.bf1e104f"})})})})]})};var zB=e=>{var s;const{isBelowBreakpoint:a}=(0,ne.vh)({breakpoint:922}),{launchUserDetailsModal:t}=MB(),{userHasRight:i}=(0,P.nm)(),{user:l}=e,n=null===Re._$||void 0===Re._$||null===(s=Re._$.time)||void 0===s?void 0:s.convertSeconds,{default_email:r,fullname:o,last_online:d,role:c}=l||{},h=null===r||void 0===r?void 0:r.email_address,u=ci()(d).format("M/D/YYYY, h:mm a"),m=null!==l&&void 0!==l&&l.total_time?n(l.total_time/1e3):null,g=i("manage_user");return(0,N.jsxs)(io,{className:g?"cursor-pointer":"",onClick:()=>g&&t(null===l||void 0===l?void 0:l.id),children:[(0,N.jsx)(ro,{children:(0,N.jsx)(Ya,{redirToProfile:!0,size:a?30:45,user:l})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Ce.S,{className:"d-flex flex-column",children:(0,N.jsx)(Fl,{inline:!0,maxWidth:a?150:200,children:o})})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:h?(0,N.jsx)(Fl,{inline:!0,maxWidth:200,children:h}):"-"}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:c?(0,N.jsx)(ke.A,{defaultMessage:null===c||void 0===c?void 0:c.name,id:"label.roles."+(null===c||void 0===c?void 0:c.slug)}):(0,N.jsx)(ke.A,{defaultMessage:"Regular",id:"label.regular.b455784a"})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:d?u:"- -"}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:m?`${m.value} ${m.label}`:"- -"})]})};const TB=l.createContext({}),IB=TB.Provider,EB=(TB.Consumer,e=>{const{className:s,length:a,max:t,min:i}=e,l=i&&a<i,n=t&&a>t;return(0,N.jsx)("div",{className:`character-count ${s}`,children:(0,N.jsxs)("span",{className:l||n?"text-danger":"",children:[(0,N.jsxs)("span",{className:"me-1",children:[a||0,t?"/"+t:""]}),(0,N.jsx)(ke.A,{defaultMessage:"characters",id:"label.characters.25d939ff"})]})})});EB.defaultProps={length:0,max:3e3,min:0};var FB=EB;var RB=e=>{const s=(0,P.nm)(),{locale:a}=s,t=(0,l.useContext)(TB),{file:i,file_ext:n,file_name:r,handleError:o,handleFileDrop:d,handleFileNameChange:c,resetFile:h,selected_teams:u,sendMessageBroadcast:m}=t,[g,p]=(0,l.useState)(!1),[x,v]=(0,l.useState)(null),[f,j]=(0,l.useState)(!1),_=()=>j(!1),b=(0,l.useRef)();return(0,N.jsxs)(Ge.A,{body:!0,className:"mt-3",children:[(0,N.jsx)(ds.l1,{initialValues:{body:"",text_body:""},validationSchema:(0,Re.by)({locale:a,scope:"message.add_message"}),onChange:(e,s)=>{(0,Re.by)({locale:a,scope:"message.add_message"}).validate({text_body:s.body})},onSubmit:async(e,s)=>{window.confirm(`Are you sure you want to send this message to the ${null===u||void 0===u?void 0:u.length} selected teams?`)&&(0,Re.by)({locale:a,scope:"message.add_message"}).validate({body:null===e||void 0===e?void 0:e.body,text_body:null===e||void 0===e?void 0:e.text_body}).then(async()=>{await m(e.body,e.text_body).then(()=>{s.setFieldValue("body",""),s.setFieldTouched("body",!1),s.setFieldValue("text_body",""),s.setFieldTouched("text_body",!1)})}).catch(e=>{s.setFieldError("body",e&&e.message)})},children:e=>{var s;let{errors:a,handleChange:t,handleSubmit:l,isValid:d,setFieldValue:c,touched:m,values:x}=e;return(0,N.jsx)(Ce.S,{className:"message-box-container",children:(0,N.jsxs)(_e.A,{className:"message-box-upper",onSubmit:l,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Message",description:"",id:"label.message.2f77668a"})}),(0,N.jsx)(ds.D0,{autocomplete:"off",className:"quill-parent",isInvalid:m.body&&a.body,isValid:m.body&&!a.body,name:"body",onChange:e=>t(e,x),placeholder:"Compose a message to be broadcast...",value:x.body,children:e=>{let{field:s}=e;return(0,N.jsx)(_p(),{"aria-label":"Compose a message",formats:["bold","code","italic","link","strike","script","underline","blockquote","indent","list","align","code-block","image","video","formula"],id:"admin-lara-broadcast-message-box",onChange:s.onChange(s.name),placeholder:"Compose a message to be broadcast...",ref:b,value:s.value,modules:{toolbar:[["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]]},onKeyDown:e=>{var s;const a=null===b||void 0===b||null===(s=b.current)||void 0===s?void 0:s.editor;
2a&&c("text_body",a.getText()),16===e.keyCode&&p(!0)},onKeyUp:e=>{var s;const a=null===b||void 0===b||null===(s=b.current)||void 0===s?void 0:s.editor;16===e.keyCode&&p(!1),13!==e.keyCode||g?13!==e.keyCode&&a&&c("text_body",a.getText()):e.preventDefault()}})}}),a.text_body&&m.text_body&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.text_body}),(0,N.jsxs)(Ce.S,{className:"message-box-lower",children:[(0,N.jsxs)(Ce.S,{className:"attachment-container",children:[(0,N.jsx)(ve.A,{"aria-label":"Attach a file",className:"ql-attachMedia me-auto p-0",type:"button",variant:"link",onClick:e=>{e.preventDefault(),j(!0)},children:(0,N.jsx)(ze.EHs,{})}),i&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("span",{className:"attachment",children:["Attached file: ",r&&n?`${r}.${n}`:null===i||void 0===i?void 0:i.name]}),(0,N.jsx)(ve.A,{onClick:h,size:"sm",variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",description:"",id:"label.remove.c3812fc4"})})]})]}),(0,N.jsx)(FB,{length:null===x||void 0===x||null===(s=x.text_body.trim())||void 0===s?void 0:s.length,max:500,min:1})]})]}),(0,N.jsx)(os,{className:"mb-0",children:(0,N.jsxs)(ve.A,{className:"pull-right d-flex",disabled:!d||!(null!==u&&void 0!==u&&u.length),size:"lg",variant:"primary",onClick:()=>{null!==u&&void 0!==u&&u.length?l(x):o("No teams selected.")},children:[(0,N.jsx)(ze.uCC,{"aria-hidden":!0,size:14}),"  ",(0,N.jsx)(ke.A,{defaultMessage:"Send to {selected_teams} teams",description:"",id:"label.send_to_selected_teams_teams.bf65cfd1",values:{selected_teams:null===u||void 0===u?void 0:u.length}})]})})]})})}}),(0,N.jsxs)(xe,{backdrop:"static",onHide:_,show:f,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:"Upload File"})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>v(null),show:x,variant:"danger",children:x}),(0,N.jsx)(os,{children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{name:"file_name",onChange:c,placeholder:"File Name (optional)",type:"text",value:r}),(0,N.jsxs)(Ei.A.Text,{id:"inputGroupPrepend",children:[".",n]})]})}),(0,N.jsx)(Ce.S,{style:{clear:"both"},children:(0,N.jsx)(fa,{onSubmit:(e,s)=>{d(e).then(()=>{_()})}})})]})]})]})};var DB=e=>{const s=(0,l.useContext)(TB),{assignments:a,assignments_loading:t,groups:i,groups_loading:n,handleUpdateSelectedAssignments:r,handleUpdateSelectedGroups:o,handleUpdateSelectedOrg:d,handleUpdateSelectedSubOrg:c,organizations:h,orgs_loading:u,resetFilters:m,selected_assignments:g,selected_groups:p,selected_organization:x,selected_sub_organization:v,sub_organizations:f,sub_orgs_loading:j,teams_count:_}=s;return(0,N.jsxs)(Ce.S,{className:"broadcast-table-filters",children:[(0,N.jsx)(Ce.S,{className:"teams-count",children:(0,N.jsxs)("p",{className:"h6",children:["Teams found: ",_]})}),(0,N.jsxs)(Ce.S,{className:"filters",children:[(0,N.jsxs)(li.A,{align:"end",children:[(0,N.jsx)(li.A.Toggle,{className:"organization",size:"sm",children:u?(0,N.jsx)("div",{className:"spinner-container",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm"})}):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organizations",id:"label.organizations.2730183d"})})}),(0,N.jsx)(li.A.Menu,{children:h&&h.map((e,s)=>{const a=x===(null===e||void 0===e?void 0:e.id);return(0,N.jsx)(li.A.Item,{className:""+(a?"active":""),onClick:()=>d(null===e||void 0===e?void 0:e.id),children:null===e||void 0===e?void 0:e.name},s)})})]}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{className:"sub-organization",disabled:!(null!==f&&void 0!==f&&f.length),size:"sm",children:j?(0,N.jsx)("div",{className:"spinner-container",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm"})}):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Sub-Organizations",description:"",id:"label.sub_organizations.7a1ff7a1"})})}),(0,N.jsx)(li.A.Menu,{children:f&&f.map((e,s)=>{const a=v===(null===e||void 0===e?void 0:e.id);return(0,N.jsxs)(li.A.Item,{className:""+(a?"active":""),onClick:()=>c(null===e||void 0===e?void 0:e.id),children:[(0,N.jsx)(_e.A.Check,{checked:a,className:"me-2",readOnly:!0,type:"checkbox"}),null===e||void 0===e?void 0:e.name]},s)})})]}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{className:"group",disabled:!(null!==i&&void 0!==i&&i.length),size:"sm",children:n?(0,N.jsx)("div",{className:"spinner-container",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm"})}):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Groups",description:"",id:"label.groups.39bbb719"})})}),(0,N.jsx)(li.A.Menu,{children:i&&i.map((e,s)=>{const a=p.includes(null===e||void 0===e?void 0:e.id);return(0,N.jsxs)(li.A.Item,{className:""+(a?"active":""),onClick:()=>o(null===e||void 0===e?void 0:e.id),children:[(0,N.jsx)(_e.A.Check,{checked:a,className:"me-2",readOnly:!0,t
2ype:"checkbox"}),null===e||void 0===e?void 0:e.name]},s)})})]}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{className:"assignment",disabled:!(null!==a&&void 0!==a&&a.length),size:"sm",children:t?(0,N.jsx)("div",{className:"spinner-container",children:(0,N.jsx)(qt.A,{animation:"border",size:"sm"})}):(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",description:"",id:"label.assignments.2c7e21f6"})})}),(0,N.jsx)(li.A.Menu,{children:a&&a.map((e,s)=>{const a=g.includes(null===e||void 0===e?void 0:e.id);return(0,N.jsxs)(li.A.Item,{className:""+(a?"active":""),onClick:()=>r(null===e||void 0===e?void 0:e.id),children:[(0,N.jsx)(_e.A.Check,{checked:a,className:"me-2",readOnly:!0,type:"checkbox"}),null===e||void 0===e?void 0:e.title]},s)})})]}),(0,N.jsx)(ve.A,{className:"reset-button",onClick:m,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Reset",description:"",id:"label.reset.daee7606"})})]})]})};var BB=e=>{const s=(0,l.useContext)(TB),{getIDsArray:a,handleSort:t,loading:i,select_all_teams:n,selected_organization:r,selected_sub_organization:o,selected_teams:d,sort_direction:c,sort_token:h,teams:u,toggleSelectAllTeams:m,toggleSelectedTeam:g}=s;return(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(DB,{}),(0,N.jsx)(Ce.S,{className:"teams-table-container",children:(0,N.jsxs)(ho,{defaultSortDirection:c,defaultSortToken:h,onSort:(e,s)=>{(r||o)&&t(e,s)},children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"sortable",children:(0,N.jsx)(_e.A.Check,{checked:n,disabled:!(null!==u&&void 0!==u&&u.length),onClick:m,readOnly:!0,type:"checkbox"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"team",children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"group",children:(0,N.jsx)(ke.A,{defaultMessage:"Group",id:"label.group.34ca0e76"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"group_assignment",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment",id:"label.assignment.153cdaae"})})]})}),(0,N.jsx)(ho.Tbody,{cols:8,loading:i,children:u.length?(0,N.jsx)(N.Fragment,{children:u.map((e,s)=>{var t,i,l,n,r,o;const c=a(d).includes(null===e||void 0===e?void 0:e.id);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(_e.A.Check,{checked:c,onClick:()=>g(e),readOnly:!0,type:"checkbox"})}),(0,N.jsx)(ho.Td,{children:null===e||void 0===e?void 0:e.name}),(0,N.jsx)(ho.Td,{children:null===e||void 0===e||null===(t=e.assignment)||void 0===t||null===(i=t.group)||void 0===i||null===(l=i.organization)||void 0===l?void 0:l.name}),(0,N.jsx)(ho.Td,{children:null===e||void 0===e||null===(n=e.assignment)||void 0===n||null===(r=n.group)||void 0===r?void 0:r.name}),(0,N.jsx)(ho.Td,{children:null===e||void 0===e||null===(o=e.assignment)||void 0===o?void 0:o.title})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:8,children:r?(0,N.jsx)(ke.A,{defaultMessage:"No teams found",id:"label.no_teams_found.c83a06f9"}):(0,N.jsx)(ke.A,{defaultMessage:"No organization selected",id:"label.no_organization_selected.278cd177"})})})})]})})]})};const PB=l.createContext({}),LB=PB.Provider,OB=PB.Consumer;class HB extends l.Component{constructor(e){super(e),this.state={assignments:[],assignments_count:0,assignments_loading:!1,error:null,file_ext:"",file_name:"",file_type:"",groups:[],groups_count:0,groups_loading:!1,loading:!1,organization_count:0,organizations:[],orgs_loading:!1,page:1,page_size:20,response:null,select_all_teams:!1,selected_assignments:[],selected_groups:[],selected_organization:null,selected_sub_organization:null,selected_teams:[],show:!1,sort_direction:"ASC",sort_token:"team",sub_orgs_loading:!1,teams:[],teams_count:0,teams_loading:!1},this.image_types=["image/gif","image/jpeg","image/png"],this.video_types=["video/mp4","video/ogg","video/webm","video/mpeg"],this.file_types=["image/gif","image/jpeg","image/png","video/mp4","video/ogg","video/mpeg","application/pdf","application/msword","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-word.document.macroEnabled.12","application/vnd.ms-word.template.macroEnabled.12","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/vnd.adobe.photoshop","application/x-photoshop","application/photoshop","application/psd","image/psd"],this.getFileType=this.getFileType.bind(this),this.getIDsArray=this.getIDsArray.bind(this),this.handleDeselectAllTeams=this.handleDeselectAllTeams.bind(this),this.handleError=this.handleError.bind(this),this.handleFileDrop=this.handleFileDrop.bind(this),this.handleFileNameChange=this.handleFileNameChange.bind(this),this.handleHide=this.handleHide.bind(this),this.handleSelectAllTeams=this.handleSelectAllTeams.bind(this),this.handleSort=this.handleSort.bind(this),this.handleUpdateSelectedAssignments=this.handleUpdateSelectedAssignments.bind(this),this.handleUpdateSelectedGroups=this.handleUpdateSelectedGroups.bind(this),this.handleUpdateSelectedOrg=this.handleUpdateSelectedOrg.bind(this),this.handleUpdateSelectedSubOrg=this.handleUpdateSelectedSubOrg.bind(this),this.handleUpdateSelectedTeam
2s=this.handleUpdateSelectedTeams.bind(this),this.hide=this.hide.bind(this),this.loadAssignments=this.loadAssignments.bind(this),this.loadGroups=this.loadGroups.bind(this),this.loadOrganizations=this.loadOrganizations.bind(this),this.loadTeams=this.loadTeams.bind(this),this.resetFile=this.resetFile.bind(this),this.resetFilters=this.resetFilters.bind(this),this.sendMessageBroadcast=this.sendMessageBroadcast.bind(this),this.show=this.show.bind(this),this.sortTeams=this.sortTeams.bind(this),this.toggleSelectAllTeams=this.toggleSelectAllTeams.bind(this),this.toggleSelectedTeam=this.toggleSelectedTeam.bind(this)}async loadOrganizations(){const{app:e}=this.props;this.setState({orgs_loading:!0}),await e.api.get("/api/organizations/list/1/10000",{sort_direction:"ASC",sort_token:"name"}).then(e=>{let{count:s,organizations:a}=e;this.setState({organization_count:s,organizations:a,orgs_loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,orgs_loading:!1})})}async loadSubOrganizations(){const{app:e}=this.props,{selected_organization:s}=this.state;this.setState({sub_orgs_loading:!0}),await e.api.get("/api/organizations/list/1/10000",{organization_id:s,sort_direction:"ASC",sort_token:"name"}).then(e=>{let{count:s,organizations:a}=e;this.setState({sub_organization_count:s,sub_organizations:a,sub_orgs_loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,sub_orgs_loading:!1})})}async loadGroups(){const{app:e}=this.props,{selected_organization:s,selected_sub_organization:a}=this.state;this.setState({groups_loading:!0}),await e.api.get("/api/organizations/groups/list/1/10000",{organization_id:a||s}).then(e=>{let{count:s,groups:a}=e;this.setState({groups:a,groups_count:s,groups_loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,groups_loading:!1})})}async loadAssignments(){const{app:e}=this.props,{selected_groups:s}=this.state;if(null===s||void 0===s||!s.length)return this.setState({assignments:[],assignments_count:0});this.setState({assignments_loading:!0}),await e.api.post("/api/assignments/list-by-group-list/",{groups:s}).then(e=>{let{assignments:s,count:a}=e;this.setState({assignments:s,assignments_count:a,assignments_loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({assignments_loading:!1,error:s})})}async loadTeams(){const{app:e}=this.props,{selected_assignments:s,selected_groups:a,selected_organization:t,selected_sub_organization:i,sort_direction:l,sort_token:n}=this.state;this.setState({loading:!0}),await e.api.post("/api/teams/active/list",{assignments:s,groups:a,organization_id:i||t,sort_direction:l,sort_token:n}).then(e=>{let{count:s,teams:a}=e;this.setState({loading:!1,teams:a,teams_count:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}async sendMessageBroadcast(e,s){var a;console.log("### SMB");const{file_ext:t,file_pending:i,file_type:l,selected_teams:n}=this.state;let{file_name:r}=this.state;const{admin_lara:o,app:d}=this.props,{activeKey:c,handleRefresh:h}=o,u=this.getIDsArray(n);if(null===u||void 0===u||!u.length)return void this.setState({error:"No teams selected"});const m=(0,me.A)();r=null!==(a=r)&&void 0!==a&&a.length?`${r}.${t}`:null===i||void 0===i?void 0:i.name,this.setState({loading:!0}),await d.api.file("/api/site/lara/chat/broadcast",{body:e,file_type:l,job_id:m,teams:u,text:s},i,r).then(()=>{this.setState({file_ext:"",file_name:"",file_pending:null,loading:!1,response:"Message broadcast successful."},()=>{"sent"===c&&h("sent")})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}async handleFileDrop(e){const{name:s,type:a}=e,t=s.split(".").pop(),i=this.getFileType(a);
2i?await this.setState({file_ext:t,file_pending:e,file_type:i}):this.setState({error:"Invalid file type detected. Acceptable file types are: DOC, DOCX, JFIF, JPE, JPEG, JPG, M4V, MP4, MPEG, MPG, PDF, PNG, PPT, PPTX, and WEBM.",uploading:!1})}getFileType(e){return"string"!==typeof e&&(e=""),e=e.toLowerCase(),-1!==this.image_types.indexOf(e)?"image":-1!==this.video_types.indexOf(e)?"video":-1!==this.file_types.indexOf(e)&&"file"}resetFile(){this.setState({file_ext:"",file_name:"",file_pending:null,file_type:""})}handleFileNameChange(e){this.setState({file_name:e.currentTarget.value})}getIDsArray(e){return e.map(e=>null===e||void 0===e?void 0:e.id)}handleSort(e,s){this.setState({page:1,sort_direction:s,sort_token:e},async()=>{await this.loadTeams()})}show(){const{onShow:e}=this.props;"function"===typeof e&&e(),this.setState({show:!0},async()=>{await this.loadOrganizations()})}hide(){this.setState({show:!1})}handleHide(){const{onHide:e}=this.props;"function"===typeof e&&e(),this.hide(),this.reset()}handleError(e){this.setState({error:e})}reset(){this.setState({assignments:[],assignments_count:0,error:null,file_ext:"",file_name:"",file_pending:null,file_type:"",groups:[],groups_count:0,organization_count:0,organizations:[],page:1,page_size:20,response:null,selected_assignments:[],selected_groups:[],selected_organization:null,selected_sub_organization:null,selected_teams:[],sort_direction:"ASC",sort_token:"team",sub_organizations:[],sub_organizations_count:0,teams:[],teams_count:0})}resetFilters(){this.setState({assignments:[],selected_assignments:[],selected_groups:[]},async()=>{await this.loadTeams(),this.handleSelectAllTeams()})}handleUpdateSelectedOrg(e){this.setState({assignments:[],groups:[],selected_assignments:[],selected_groups:[],selected_organization:e,selected_sub_organization:null,sub_organizations:[]},async()=>{await this.loadSubOrganizations(),await this.loadGroups(),await this.loadTeams(),this.handleSelectAllTeams()})}handleUpdateSelectedSubOrg(e){const{selected_sub_organization:s}=this.state,a=s===e?null:e;this.setState({assignments:[],groups:[],selected_assignments:[],selected_groups:[],selected_sub_organization:a},async()=>{await this.loadGroups(),await this.loadTeams(),this.handleSelectAllTeams()})}handleUpdateSelectedGroups(e){const{selected_groups:s}=this.state,a=s.includes(e)?(0,T.remove)(s,s=>s!==e):[...s,e];this.setState({selected_assignments:[],selected_groups:a},async()=>{await this.loadAssignments(),await this.loadTeams(),this.handleSelectAllTeams()})}handleUpdateSelectedAssignments(e){const{selected_assignments:s}=this.state,a=s.includes(e)?(0,T.remove)(s,s=>s!==e):[...s,e];this.setState({selected_assignments:a},async()=>{await this.loadTeams(),this.handleSelectAllTeams()})}handleUpdateSelectedTeams(){const{selected_assignments:e,selected_groups:s,selected_organization:a,selected_sub_organization:t,teams:i}=this.state;let l=(0,T.clone)(i);t?l=l.filter(e=>{var s,a,i;return(null===e||void 0===e||null===(s=e.assignment)||void 0===s||null===(a=s.group)||void 0===a||null===(i=a.organization)||void 0===i?void 0:i.id)===t}):a&&(l=l.filter(e=>{var s,t,i;return(null===e||void 0===e||null===(s=e.assignment)||void 0===s||null===(t=s.group)||void 0===t||null===(i=t.organization)||void 0===i?void 0:i.id)===a})),null!==s&&void 0!==s&&s.length&&(l=l.filter(e=>{var a,t;return s.includes(null===e||void 0===e||null===(a=e.assignment)||void 0===a||null===(t=a.group)||void 0===t?void 0:t.id)})),null!==e&&void 0!==e&&e.length&&(l=l.filter(s=>{var a,t;return e.includes(null===s||void 0===s||null===(a=s.assignment)||void 0===a||null===(t=a.challenge_template)||void 0===t?void 0:t.id)})),l=l.sort(this.sortTeams),this.setState({selected_teams:l})}toggleSelectedTeam(e){var s;const{selected_teams:a,teams:t}=this.state;let i;i=this.getIDsArray(a).includes(null===e||void 0===e?void 0:e.id)?a.filter(s=>(null===s||void 0===s?void 0:s.id)!==(null===e||void 0===e?void 0:e.id)):[...a,e];const l=(null===t||void 0===t?void 0:t.length)===(null===(s=i)||void 0===s?void 0:s.length);this.setState({select_all_teams:l,selected_teams:i})}sortTeams(e,s){var a,t,i,l,n,r,o,d,c,h,u,m,g,p;const{sort_direction:x,sort_token:v}=this.state;let f,j;switch(v){case"team":default:f=null===e||void 0===e?void 0:e.name,j=null===s||void 0===s?void 0:s.name;break;case"organization":f=null===e||void 0===e||null===(a=e.assignment)||void 0===a||null===(t=a.group)||void 0===t||null===(i=t.organization)||void 0===i?void 0:i.name,j=null===s||void 0===s||null===(l=s.assignment)||void 0===l||null===(n=l.group)||void 0===n||null===(r=n.organization)||void 0===r?void 0:r.name;break;case"group":f=null===e||void 0===e||null===(o=e.assignment)||void 0===o||null===(d=o.group)||void 0===d?void 0:d.name,j=null===s||void 0===s||null===(c=s.assignment)||void 0===c||null===(h=c.group)||void 0===h?void 0:h.name;break;case"group_assignment":f=null===e||void 0===e||null===(u=e.assignment)||void 0===u||null===(m=u.challenge_template)||void 0===m?void 0:m.title,j=null===s||void 0===s||null===(g=s.assignment)||void 0===g||null===(p=g.challenge_template)||void 0===p?void 0:p.title}switch(f=f.toUpperCase(),j=j.toUpperCase(),x){case"ASC":return f<j?-1:f>j?1:0;case"DESC":return f<j?1:f>j?-1:0;default:return 0}}handleSelectAllTeams(){const{teams:e}=this.state;this.setState({select_all_teams:!0,selected_teams:e})}handleDeselectAllTeams(){this.setState({select_all_teams:!1,selected_teams:[]})}toggleSelectAllTeams(){const{select_all_teams:e}=this.state;e?(this.handleDeselectAllTeams(),this.setState({select_all_teams:!1})):(this.handleSelectAllTeams(),this.setState({select_all_teams:!0}))}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}componentWillUnmount(){"function"==typeof this.props.onRef&&this.props.onRef(void 0)}render(){const{assignments:e,assignments_loading:s,error:a,file_ext:t,file_name:i,file_pending:l,file_type:n,groups:r,groups_loading:o,loading:d,organizations:c,orgs_loading:h,response:u,select_all_teams:m,selected_assignments:g,selected_groups:p,selected_organization:x,selected_sub_organization:v,selected_teams:f,show:j,sort_direction:_,sort_token:b,sub_organizations:A,sub_orgs_loading:y,teams:w,teams_count:S,teams_loading:C}=this.state;return(0,N.jsx)(xe,{centered:!0,className:"admin-lara-broadcast-modal",id:"adminLaraBroadcastModal",onHide:this.handleHide,show:j,size:"xl",children:(0,N.jsxs)(IB,{value:{assignments:e,assignments_loading:s,file:l,file_ext:t,file_name:i,file_type:n,getIDsArray:this.getIDsArray,groups:r,groups_loading:o,handleDeselectAllTeams:this.handleDeselectAllTeams,handleError:this.handleError,handleFileDrop:this.handleFileDrop,handleFileNameChange:this.handleFileNameChange,handleSelectAllTeams:this.handleSelectAllTeams,handleSort:this.handleSort,handleUpdateSelectedAssignments:this.handleUpdateSelectedAssignments,handleUpdateSelectedGroups:this.handleUpdateSelectedGroups,handleUpdateSelectedOrg:this.handleUpdateSelectedOrg,handleUpdateSelectedSubOrg:this.handleUpdateSelectedSubOrg,handleUpdateSelectedTeam
2s:this.handleUpdateSelectedTeams,loadAssignments:this.loadAssignments,loadGroups:this.loadGroups,loading:d,loadTeams:this.loadTeams,organizations:c,orgs_loading:h,resetFile:this.resetFile,resetFilters:this.resetFilters,select_all_teams:m,selected_assignments:g,selected_groups:p,selected_organization:x,selected_sub_organization:v,selected_teams:f,sendMessageBroadcast:this.sendMessageBroadcast,sort_direction:_,sort_token:b,sub_organizations:A,sub_orgs_loading:y,teams:w,teams_count:S,teams_loading:C,toggleSelectAllTeams:this.toggleSelectAllTeams,toggleSelectedTeam:this.toggleSelectedTeam},children:[(0,N.jsx)(xe.Header,{closeButton:!0,onHide:this.handleHide,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Broadcast a Message",id:"label.broadcast_a_message.956b90af"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null,response:null}),show:a||u,variant:a?"danger":"success",children:a||u}),d&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"filter-container",children:(0,N.jsx)(BB,{})}),(0,N.jsx)(RB,{})]})]})]})})}}var UB=(0,n.G0)((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(OB,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin_lara:s,ref:e=>{this.comp=e}}))})}}return s})(HB));var QB=e=>{var s;const a=(0,l.useContext)(PB),{handleError:t}=a,{message:i,tab:n}=((0,l.useContext)(P.BR),e),{created_at:r,message:o,team:d}=i||{},{assignment:c}=d||{},{group:h}=c||{},{organization:u}=h||{};return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsx)(Gh.XU,{value:r})}),"mentions"===n&&(0,N.jsx)(ro,{children:(0,N.jsx)("span",{children:(0,ad.G9)(null===o||void 0===o||null===(s=o.user)||void 0===s?void 0:s.fullname)})}),(0,N.jsx)(ro,{className:"admin-lara-table-message-body",children:(0,N.jsx)("span",{children:(0,ad.G9)(null===o||void 0===o?void 0:o.body,{preserveNewlines:!0})})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===u||void 0===u?void 0:u.id}`,children:(0,ad.G9)(null===u||void 0===u?void 0:u.name)})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===h||void 0===h?void 0:h.id}`,children:(0,ad.G9)(null===h||void 0===h?void 0:h.name)})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===h||void 0===h?void 0:h.id}/assignment/${null===c||void 0===c?void 0:c.id}`,children:(0,ad.G9)(null===c||void 0===c?void 0:c.title)})}),(0,N.jsx)(ro,{children:(0,ad.G9)(null===d||void 0===d?void 0:d.name)})]})};var VB=e=>{const{count:s,tab:a}=e,t=(null===e||void 0===e?void 0:e.messages)||[],i=(0,l.useContext)(PB),{error:n,handleError:r,handlePage:o,handleSort:d,loading:c,loadMentions:h,loadSent:u,page:m,page_size:g,sort_direction:p,sort_token:x}=i,v=(0,l.useRef)(),f=async()=>{switch(a){case"mentions":await h();break;case"sent":await u()}};return(0,l.useLayoutEffect)(()=>{f()},[]),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r(null),show:n,variant:"danger",children:n}),(0,N.jsxs)(Ce.S,{className:"admin-lara-table",children:[(0,N.jsx)(Ce.S,{className:"admin-lara-table-top d-flex justify-content-end",children:(0,N.jsx)(ve.A,{onClick:f,variant:"link",children:(0,N.jsx)(ze.DIg,{fill:"#008087",size:16})})}),(0,N.jsxs)(ho,{defaultSortDirection:p,defaultSortToken:x,onSort:(e,s)=>d(e,s,a),children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"date",children:(0,N.jsx)(ke.A,{defaultMessage:"Date",id:"label.date.99c40ab4"})}),"mentions"===a&&(0,N.jsx)(ho.Th,{sortable:!0,name:"sender",children:(0,N.jsx)(ke.A,{defaultMessage:"Sender",id:"label.sender.c299f9b8"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Message body",id:"label.message_body.7136799d"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"organization",children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",id:"label.organization.d764d425"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"group",children:(0,N.jsx)(ke.A,{defaultMessage:"Group",id:"label.group.34ca0e76"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"assignment",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment",id:"label.assignment.153cdaae"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"team",children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})})]})}),(0,N.jsx)(ho.Tbody,{cols:8,loading:c,children:t.length?(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>(0,N.jsx)(QB,{message:e,tab:a},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"8",children:(0,N.jsx)(ke.A,{defaultMessage:"No messages found.",id:"label.no_messages_found.94775700"})})})})]})]}),(0,N.jsx)(Lr,{count:s,onChange:e=>o(e,a),page:m,page_size:g}),(0,N.jsx)(je,{ref:v})]})};class GB extends l.Component{constructor(e){super(e),this.state={activeKey:"mentions",count:0,error:null,loading:!1,mentions:[],page:1,page_size:20,reports:null,
2sent:[],sort_direction:"DESC",sort_token:"created_at"},this.handleError=this.handleError.bind(this),this.handleSort=this.handleSort.bind(this),this.handlePage=this.handlePage.bind(this),this.loadMentions=this.loadMentions.bind(this),this.loadSent=this.loadSent.bind(this),this.handleRefresh=this.handleRefresh.bind(this),this.handleSelect=this.handleSelect.bind(this)}async loadMentions(){const{app:e}=this.props,{page:s,page_size:a,sort_direction:t,sort_token:i}=this.state;this.setState({loading:!0}),e.api.get(`api/site/messages/lara/mentions/${s}/${a}`,{sort_direction:t,sort_token:i}).then(e=>{let{count:s,messages:a}=e;this.setState({loading:!1,mentions:a,mentions_count:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}async loadSent(){const{app:e}=this.props,{page:s,page_size:a,sort_direction:t,sort_token:i}=this.state;this.setState({loading:!0}),e.api.get(`api/site/messages/lara/sent/${s}/${a}`,{sort_direction:t,sort_token:i}).then(e=>{let{count:s,messages:a}=e;this.setState({loading:!1,sent:a,sent_count:s})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}async handleRefresh(e){switch(e){case"mentions":await this.loadMentions();break;case"sent":await this.loadSent()}}handleError(e){this.setState({error:e})}handleSort(e,s,a){this.setState({page:1,sort_direction:s,sort_token:e},async()=>{await this.handleRefresh(a)})}handlePage(e,s){this.setState({page:e},async()=>{await this.handleRefresh(s)})}handleSelect(e){this.setState({activeKey:e,mentions_count:0,page:1,sent_count:0})}render(){var e;const{activeKey:s,error:a,loading:t,mentions:i,mentions_count:l,page:n,page_size:r,sent:o,sent_count:d,sort_direction:c,sort_token:h}=this.state;return(0,N.jsx)(Ce.S,{className:"admin-lara-tab",children:(0,N.jsxs)(LB,{value:{activeKey:s,error:a,handleError:this.handleError,handlePage:this.handlePage,handleRefresh:this.handleRefresh,handleSort:this.handleSort,loading:t,loadMentions:this.loadMentions,loadSent:this.loadSent,mentions:i,mentions_count:l,page:n,page_size:r,sent:o,sent_count:d,sort_direction:c,sort_token:h},children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(Ce.S,{className:"tab-title",children:(0,N.jsxs)("h4",{className:"m-0 d-flex align-items-center gap-2",children:[(0,N.jsx)(ze.y8Q,{fill:"var(--primary)",size:24}),(0,N.jsx)(ke.A,{defaultMessage:"Lara management",id:"label.lara_management.16f515e7"})]})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",disabled:!0,onClick:null===this||void 0===this||null===(e=this.broadcast_modal)||void 0===e?void 0:e.show,size:"sm",children:[(0,N.jsx)(ze.Uhg,{}),(0,N.jsx)(ke.A,{defaultMessage:"Broadcast",id:"label.broadcast.17bc9178"})]})]}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{lg:12,children:(0,N.jsxs)(ld.A.Container,{activeKey:s,defaultActiveKey:"mentions",id:"adminLaraTabs",mountOnEnter:!0,onSelect:this.handleSelect,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"mentions",children:(0,N.jsx)(ke.A,{defaultMessage:"Mentions",description:"",id:"label.mentions.6f32e692"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"sent",children:(0,N.jsx)(ke.A,{defaultMessage:"Sent",description:"",id:"label.sent.c16bc82b"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"mentions",children:"mentions"===s&&(0,N.jsx)(VB,{count:l,messages:i,tab:"mentions"})}),(0,N.jsx)(ld.A.Pane,{eventKey:"sent",children:"sent"===s&&(0,N.jsx)(VB,{count:d,messages:o,tab:"sent"})})]})})})]})})}),(0,N.jsx)(UB,{onRef:e=>this.broadcast_modal=e})]})})}}var WB=(0,n.G0)(_T(GB));const KB=500,YB="agent_interaction_limit_per_challenge",qB={day:"numeric",hour:"numeric",minute:"2-digit",month:"short",year:"numeric"},JB=e=>{const s=String(null!==e&&void 0!==e?e:"").trim();return s.length?/^\d+$/.test(s)?Number(s):NaN:null};var XB=()=>{var s;const{api:a}=(0,P.nm)(),{formatDate:t,formatMessage:i}=(0,ja.A)(),[n,r]=(0,ne.CQ)({error:null,loaded:!1,loading:!0,saving:!1,settings:null,success:!1}),{error:o,loaded:d,loading:c,saving:h,settings:u,success:m}=n,g=e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;return"string"===typeof s&&s.length?s:i({id:"label.something_went_wrong_please_try_ag.3ccd9d65",defaultMessage:"Something went wrong. Please try again."})},p=async()=>{try{r({error:null,loading:!0});const e=await a.get("/api/site/settings");r({loaded:!0,loading:!1,settings:(null===e||void 0===e?void 0:e.settings)||null})}catch(e){r({error:g(e),loading:!1})}},x=JB(null===u||void 0===u?void 0:u.agent_interaction_limit_per_challenge),v=(0,l.useMemo)(()=>{const e=i({id:"label.enter_a_whole_number_from_min_to_m.5ddacfa5",defaultMessage:"Enter a whole number from {min} to {max}, or leave blank for the default of {fallback}."},{fallback:100,max:KB,min:1});return ul.Ik().shape({[YB]:ul.ai().transform((e,s)=>JB(s)).nullable().typeError(e).integer(e).min(1,e).max(KB,e)})},[i]),{errors:f,handleBlur:j,handleChange:_,handleSubmit:b,isValid:A,values:y}=(0,ds.Wx)({enableReinitialize:!0,initialValues:{[YB]:null===x?"":String(x)},onSubmit:async s=>{const t=JB(s[YB]);if(t!==x)try{r({error:null,saving:!0,success:!1});const e=await a.post("/api/site/settings",{agent_interaction_limit_per_challenge:t});r({saving:!1,settings:(null===e||void 0===e?void 0:e.settings)||(0,F.A)((0,F.A)({},u),{},{agent_interaction_limit_per_challenge:t}),success:!0})}catch(e){r({error:g(e),saving:!1})}},validationSchema:v});(0,l.useEffect)(()=>{p()},[]);const w=JB(y[YB])!==x,S=null!==u&&void 0!==u&&u.updated_at?new Date(u.updated_at):null,C=S&&!isNaN(S.getTime())?t(S,qB):null,M=(null===u||void 0===u||null===(s=u.updated_by)||void 0===s?void 0:s.fullname)||null;return(0,N.jsx)(Ge.A,{className:"ai-limits mb-4",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h5",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"AI teammate reply limit",id:"label.ai_teammate_reply_limit.c6b8599b"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:!!o,variant:"danger",children:o}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({success:!1}),show:m,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"The AI teammate reply limit has been saved.",id:"label.the_ai_teammate_reply_limit_has_be.e40ef85f"})}),(0,N.jsx)(Me.x_,{loading:c,children:d?(0,N.jsxs)(_e.A,{noValidate:!0,onSubmit:b,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{lg:4,md:6,xs:12,children:(0,N.jsxs)(_e.A.Group,{controlId:"ai-interaction-limit-per-challenge",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Responses per AI teammate, per challenge",id:"label.responses_per_ai_teammate_per_chal.1b828462"})}),(0,N.jsx)(_e.A.Control,{autoComplete:"off",disabled:h,inputMode:"numeric",isInvalid:!!f[YB],name:YB,onBlur:j,onChange:_,placeholder:String(100),type:"text",value:y[YB]}),(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:f[YB]})]})})}),(0,N.jsxs)("ul",{className:"text-muted small mt-3 mb-3 ps-3",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Each AI teammate gets this many responses for a 
2whole challenge. It is their own \u2014 one teammate running out does not quieten the others.",id:"label.each_ai_teammate_gets_this_many_re.cb59d603"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Chatting and changes an AI teammate makes to the challenge both count against it, and it does not reset between steps.",id:"label.chatting_and_changes_an_ai_teammat.cf6e3811"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Leave the field blank for the default of {fallback}. To lift the limit in practice, use {max}.",id:"label.leave_the_field_blank_for_the_defa.40bc0fe7",values:{fallback:100,max:KB}})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"After half of a teammate's responses are used, they stop commenting on edits and nudging the team, and only reply to learners' chat messages.",id:"label.after_half_of_a_teammates_response.52f0b8f0"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"A change applies from the next AI teammate reply.",id:"label.a_change_applies_from_the_next_ai.2418cc88"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Use a whole number from {min} to {max}.",id:"label.use_a_whole_number_from_min_to_max.5fdcd781",values:{max:KB,min:1}})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center flex-wrap gap-3",children:[(0,N.jsx)(Me.p0,{disabled:!w||!A,loading:h,size:"sm",type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})}),!!C&&(0,N.jsx)("small",{className:"text-muted",children:M?(0,N.jsx)(ke.A,{defaultMessage:"Last changed by {name} on {date}",id:"label.last_changed_by_name_on_date.12e7286c",values:{date:C,name:M}}):(0,N.jsx)(ke.A,{defaultMessage:"Last changed on {date}",id:"label.last_changed_on_date.665dd9ea",values:{date:C}})})]})]}):(0,N.jsx)(ve.A,{onClick:p,size:"sm",variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Try again",id:"label.try_again.d8b8392e"})})})]})})};const ZB={currency:"USD",maximumFractionDigits:4,minimumFractionDigits:2,style:"currency"},$B={month:"long",timeZone:"UTC",year:"numeric"},eP={day:"numeric",hour:"numeric",minute:"2-digit",month:"short",timeZoneName:"short",year:"numeric"},sP=e=>Number(e)||0,aP=e=>{const s=e?new Date(e):null;return s&&!isNaN(s.getTime())?s:null};var tP=()=>{var s,a,t;const{api:i}=(0,P.nm)(),{formatDate:n,formatMessage:r,formatNumber:o}=(0,ja.A)(),[d,c]=(0,ne.CQ)({error:null,loading:!0,usage:null}),{error:h,loading:u,usage:m}=d,g=async()=>{try{c({error:null,loading:!0});const e=await i.get("/api/site/llm/usage");c({loading:!1,usage:e||null})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:"string"===typeof a&&a.length?a:r({id:"label.something_went_wrong_please_try_ag.3ccd9d65",defaultMessage:"Something went wrong. Please try again."}),loading:!1})}};(0,l.useEffect)(()=>{g()},[]);const p={agent_orchestrator:r({id:"label.ai_teammates.ffe0a928",defaultMessage:"AI teammates"}),agent_recommender:r({id:"label.ai_teammate_recommendations.1fbe9ef1",defaultMessage:"AI teammate recommendations"}),agent_test_chat:r({id:"label.persona_test_chat.d01ed54d",defaultMessage:"Persona test chat"}),challenge_wizard:r({id:"label.challenge_wizard.e3939806",defaultMessage:"Challenge wizard"}),competency_scorer:r({id:"label.live_competency_scoring.f2f14720",defaultMessage:"Live competency scoring"}),decision_evaluation:r({id:"label.decision_evaluation.84612025",defaultMessage:"Decision evaluation"}),member_evaluation:r({id:"label.member_evaluation.73b5d6c2",defaultMessage:"Member evaluation"}),team_evaluation:r({id:"label.team_evaluation.b60426de",defaultMessage:"Team evaluation"}),test_tools:r({id:"label.developer_tools.96f0c06b",defaultMessage:"Developer tools"})},x=e=>Object.prototype.hasOwnProperty.call(p,e),v=e=>{const s=sP(e);return s>0&&s<.01?r({id:"label.less_amount.c4b1f495",defaultMessage:"< {amount}"},{amount:o(.01,ZB)}):o(s,ZB)},f=e=>!(null===e||void 0===e||!e.has_unpriced)||sP(null===e||void 0===e?void 0:e.unmetered_calls)>0,j=(null===m||void 0===m?void 0:m.totals)||{},_=Array.isArray(null===m||void 0===m?void 0:m.by_feature)?m.by_feature:[],b=Array.isArray(null===m||void 0===m?void 0:m.by_model)?m.by_model:[],A=sP(j.unmetered_calls),y=b.filter(e=>!(null!==e&&void 0!==e&&e.priced)).length,w=sP(null===m||void 0===m?void 0:m.retention_days),S=sP(null===m||void 0===m||null===(s=m.daily_limit)||void 0===s?void 0:s.used),C=sP(null===m||void 0===m||null===(a=m.daily_limit)||void 0===a?void 0:a.limit),M=aP(null===m||void 0===m||null===(t=m.period)||void 0===t?void 0:t.start),k=aP(null===m||void 0===m?void 0:m.as_of),z=r({id:"label.no_price_set.c21d106c",defaultMessage:"No price set"}),T=r({id:"label.partial.a4d50fb8",defaultMessage:"Partial"}
2),I=r({id:"label.some_of_these_calls_are_not_includ.f8287995",defaultMessage:"Some of these calls are not included in this figure because they have no token data or use a model with no price set."}),E=!!j.has_unpriced&&!sP(j.estimated_cost),F=(0,N.jsx)(bo.A,{bg:"warning",className:"ms-2",text:"dark",title:I,children:T}),R=f(j)?(0,N.jsxs)(N.Fragment,{children:[v(j.estimated_cost),F]}):v(j.estimated_cost),D=[{colorCoded:!1,label:r({id:"label.estimated_cost_month_to_date.d8d293fb",defaultMessage:"Estimated cost (month to date)"}),value:E?z:R},{colorCoded:!1,label:r({id:"label.ai_calls.6f056595",defaultMessage:"AI calls"}),value:o(sP(j.calls))},{colorCoded:!1,label:r({id:"label.input_tokens.dd856eeb",defaultMessage:"Input tokens"}),value:o(sP(j.input_tokens))},{colorCoded:!1,label:r({id:"label.output_tokens.a9b50ea0",defaultMessage:"Output tokens"}),value:o(sP(j.output_tokens))},{colorCoded:!1,label:r({id:"label.failed_calls.7d047f1c",defaultMessage:"Failed calls"}),value:o(sP(j.failures))},{colorCoded:!1,label:r({id:"label.calls_today_daily_limit.8d0f06aa",defaultMessage:"Calls today / daily limit"}),value:C>0?`${o(S)} / ${o(C)}`:o(S)}];return(0,N.jsx)(Ge.A,{className:"ai-usage",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-start justify-content-between flex-wrap gap-2 mb-3",children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{className:"mb-1",children:(0,N.jsx)(ke.A,{defaultMessage:"AI usage and estimated cost",id:"label.ai_usage_and_estimated_cost.64aa8ce1"})}),!!m&&!!M&&(0,N.jsx)("small",{className:"text-muted",children:k?(0,N.jsx)(ke.A,{defaultMessage:"Month to date for {period} (UTC), as of {time}",id:"label.month_to_date_for_period_utc_as_of.f4582fa8",values:{period:n(M,$B),time:n(k,eP)}}):(0,N.jsx)(ke.A,{defaultMessage:"Month to date for {period} (UTC)",id:"label.month_to_date_for_period_utc.c898e0e2",values:{period:n(M,$B)}})})]}),(0,N.jsxs)(ve.A,{className:"d-inline-flex align-items-center gap-1",disabled:u,onClick:g,size:"sm",variant:"outline-primary",children:[(0,N.jsx)(ze.DIg,{size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Refresh",id:"label.refresh.0e916101"})]})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:!!h,variant:"danger",children:h}),(0,N.jsx)(Me.x_,{loading:u,children:!!m&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"ai-usage-stats mb-4",children:(0,N.jsx)(aI,{stats:D})}),(0,N.jsxs)(We.A,{className:"mb-4",variant:"warning",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"These figures are estimates",id:"label.these_figures_are_estimates.7869793f"})}),(0,N.jsxs)("ul",{className:"mt-2 mb-0 ps-3",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Costs are estimated from logged token counts at list prices, and cover this environment only.",id:"label.costs_are_estimated_from_logged_to.b3eb3373"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"They exclude taxes, credits and discounts, and will not match the AWS invoice.",id:"label.they_exclude_taxes_credits_and_dis.a9664db6"})}),(0,N.jsxs)("li",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Calls with no token data and models with no price set are not included in the dollar figure.",id:"label.calls_with_no_token_data_and_model.63689a66"}),A>0&&(0,N.jsx)("strong",{className:"d-block",children:(0,N.jsx)(hc.A,{value:A,one:r({id:"label.count_call_this_month_has_no_token.4b859fbe",defaultMessage:"{count} call this month has no token data."},{count:o(A)}),other:r({id:"label.count_calls_this_month_have_no_tok.7b08dd53",defaultMessage:"{count} calls this month have no token data."},{count:o(A)})})}),y>0&&(0,N.jsx)("strong",{className:"d-block",children:(0,N.jsx)(hc.A,{value:y,one:r({id:"label.count_model_used_this_month_has_no.f6cd1845",defaultMessage:"{count} model used this month has no price set."},{count:o(y)}),other:r({id:"label.count_models_used_this_month_have.436115ba",defaultMessage:"{count} models used this month have no price set."},{count:o(y)})})})]}),w>0&&(0,N.jsx)("li",{children:(0,N.jsx)(hc.A,{value:w,one:r({id:"label.usage_history_is_kept_for_c
2ount_da.5cc1e30d",defaultMessage:"Usage history is kept for {count} day."},{count:o(w)}),other:r({id:"label.usage_history_is_kept_for_count_da.fc2b8cb8",defaultMessage:"Usage history is kept for {count} days."},{count:o(w)})})})]})]}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"By feature",id:"label.by_feature.97cc3cfc"})}),(0,N.jsxs)(ho,{responsive:!0,className:"mb-4",children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Feature",id:"label.feature.3d377ae9"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"AI calls",id:"label.ai_calls.6f056595"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Input tokens",id:"label.input_tokens.dd856eeb"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Output tokens",id:"label.output_tokens.a9b50ea0"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated cost",id:"label.estimated_cost.9ccba222"})})]})}),(0,N.jsx)(ho.Tbody,{children:_.length?_.map((e,s)=>{const a="string"===typeof(null===e||void 0===e?void 0:e.caller)?e.caller:"",t=!(null===e||void 0===e||!e.has_unpriced)&&!sP(null===e||void 0===e?void 0:e.estimated_cost);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:x(a)?p[a]:(0,N.jsx)("span",{title:a||void 0,children:(0,N.jsx)(ke.A,{defaultMessage:"Other",id:"label.other.f97e9da0"})})}),(0,N.jsx)(ho.Td,{className:"text-end",children:o(sP(null===e||void 0===e?void 0:e.calls))}),(0,N.jsx)(ho.Td,{className:"text-end",children:o(sP(null===e||void 0===e?void 0:e.input_tokens))}),(0,N.jsx)(ho.Td,{className:"text-end",children:o(sP(null===e||void 0===e?void 0:e.output_tokens))}),(0,N.jsx)(ho.Td,{className:"text-end",children:t?(0,N.jsx)(bo.A,{bg:"secondary",children:z}):(0,N.jsxs)(N.Fragment,{children:[v(null===e||void 0===e?void 0:e.estimated_cost),f(e)&&F]})})]},`${s}-${a}`)}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No AI calls have been recorded this month",id:"label.no_ai_calls_have_been_recorded_thi.e64b9dc5"})})})})]}),(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"By model",id:"label.by_model.2fbd410f"})}),(0,N.jsxs)(ho,{responsive:!0,className:"mb-0",children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Model",id:"label.model.5e2c614c"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Price per 1M tokens",id:"label.price_per_1m_tokens.b4988932"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"AI calls",id:"label.ai_calls.6f056595"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Input tokens",id:"label.input_tokens.dd856eeb"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Output tokens",id:"label.output_tokens.a9b50ea0"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated cost",id:"label.estimated_cost.9ccba222"})})]})}),(0,N.jsx)(ho.Tbody,{children:b.length?b.map((e,s)=>(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"ai-usage-model",children:(null===e||void 0===e?void 0:e.model)||(0,N.jsx)(ke.A,{defaultMessage:"Unknown model",id:"label.unknown_model.38951853"})}),(0,N.jsx)(ho.Td,{children:null!==e&&void 0!==e&&e.priced?(0,N.jsx)(ke.A,{defaultMessage:"{input} in / {output} out",id:"label.input_in_output_out.359367c2",values:{input:o(sP(null===e||void 0===e?void 0:e.input_price),ZB),output:o(sP(null===e||void 0===e?void 0:e.output_price),ZB)}}):(0,N.jsx)(bo.A,{bg:"secondary",children:z})}),(0,N.jsx)(ho.Td,{className:"text-end",children:o(sP(null===e||void 0===e?void 0:e.calls))}),(0,N.jsx)(ho.Td,{className:"text-end",children:o(sP(null===e||void 0===e?void 0:e.input_tokens))}),(0,N.jsx)(ho.Td,{className:"text-end",children:o(sP(null===e||void 0===e?void 0:e.output_tokens))}),(0,N.jsx)(ho.Td,{className:"text-end",children:null!==e&&void 0!==e&&e.priced?(0,N.jsxs)(N.Fragment,{children:[v(null===e||void 0===e?void 0:e.estimated_cost),f(e)&&F]}):(0,N.jsx)("span",{className:"text-muted",children:"\u2014"})})]},`${s}-${null===e||void 0===e?void 0:e.model}`)):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No AI calls have been recorded this month",id:"label.no_ai_calls_have_been_recorded_thi.e64b9dc5"})})})})]})]})})]})})};var iP={Ai:()=>(0,N.jsxs)(Ce.S,{className:"admin-ai",children:[(0,N.jsxs)("h5",{className:"d-inline-flex align-items-center gap-2 mb-3",children:[(0,N.jsx)(ze.KuA,{className:"text-primary",size:20}),(0,N.jsx)(ke.A,{defaultMessage:"AI limits and usage",id:"label.ai_limits_and_usage.48dc4caf"})]}),(0,N.jsx)(XB,{}),(0,N.jsx)(tP,{})]}),Certifications:WR,Dashboard:hD,Lara:WB,Library:bB,Organizations:JR,Shopping:pD,Social:yB,Users:NB};var lP=s=>{const{api:a,shopping:t,userHasRight:i,userIsFullSiteAdmin:n,userIsSiteArbitrator:r}=(0,P.nm)(),{hash:o}=(0,Pe.zy)(),d=n(),c=r(),[h,u]=(0,ne.CQ)({active_key:c?"certifications":"dashboard",error:null,loading:!0,site_counts:{challenge_count:0,group_count:0,organization_count:0,user_count:0}}),{active_key:m,error:g,loading:p,site_counts:x}=h;return(0,l.useEffect)(()=>{(async()=>{await(async()=>{try{u({loading:!0});const{organization:e}=await a.get("/api/site/get"),s=e.user_count||0,t=e.organization_count||0;u({loading:!1,site_counts:{organization_count:t,user_count:s}})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}})()})()},[]),(0,l.useEffect)(()=>{(e=>{u({active_key:e})})(o.slice(1)||(c?"certifications":"dashboard"))},[o]),(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{className:"admin-site",offsetBottom:25,children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Me.x_,{loading:p,children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Site administration",id:"label.site_administration.9438ec47"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>u({error:null}),show:g,variant:"danger",children:g}),(0,N.jsxs)(ld.A.Container,{activeKey:m,id:"admin-tabs",mountOnEnter:!0,role:"navigation",unmountOnExit:!0,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary mb-3",variant:"pills",children:[d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKe
2y:"dashboard",href:"#dashboard",children:[(0,N.jsx)(ze.$BV,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Dashboard",id:"label.dashboard.67b69646"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"users",href:"#users",children:[(0,N.jsx)(ze.YXz,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",style:{verticalAlign:"middle"},children:x.user_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"organizations",href:"#organizations",children:[(0,N.jsx)(ze.ymh,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Organizations",id:"label.organizations.2730183d"}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",style:{verticalAlign:"middle"},children:x.organization_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{"aria-label":"Library Nav Tab",className:"d-flex align-items-center gap-1",eventKey:"library",href:"#library",children:[(0,N.jsx)(ze.vd0,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Library",id:"label.library.dc20b3d5"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{"aria-label":"Social Nav Tab",className:"d-flex align-items-center gap-1",eventKey:"social",href:"#social",children:[(0,N.jsx)(ze.uN,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Social",id:"label.social.f1b7505a"})]})}),i("manage_chat_bot")&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{"aria-label":"Lara Nav Tab",className:"d-flex align-items-center gap-1",eventKey:"lara",href:"#lara",children:[(0,N.jsx)(ze.y8Q,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Lara",id:"label.lara.2ca74c87"})]})}),(null===t||void 0===t?void 0:t.enabled)&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{"aria-label":"Shopping Nav Tab",className:"d-flex align-items-center gap-1",eventKey:"shopping",href:"#shopping",children:[(0,N.jsx)(ze.AsH,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Shopping",id:"label.shopping.b5b68f9d"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"ai",href:"#ai",children:[(0,N.jsx)(ze.KuA,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"AI",id:"label.ai.11fb682b"})]})})]}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{"aria-label":"Certifications Nav Tab",className:"d-flex align-items-center gap-1",eventKey:"certifications",href:"#certifications",children:[(0,N.jsx)(ze.veT,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})]})})]}),(0,N.jsxs)(ld.A.Content,{children:[d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"dashboard",children:(0,N.jsx)(iP.Dashboard,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"users",children:(0,N.jsx)(iP.Users,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"organizations",children:(0,N.jsx)(iP.Organizations,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"library",children:(0,N.jsx)(iP.Library,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"social",children:(0,N.jsx)(iP.Social,{})}),i("manage_chat_bot")&&(0,N.jsx)(ld.A.Pane,{eventKey:"lara",children:(0,N.jsx)(iP.Lara,{})}),(null===t||void 0===t?void 0:t.enabled)&&i("manage_shopping")&&(0,N.jsx)(ld.A.Pane,{eventKey:"shopping",children:(0,N.jsx)(iP.Shopping,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"ai",children:(0,N.jsx)(iP.Ai,{})})]}),(0,N.jsx)(ld.A.Pane,{eventKey:"certifications",children:(0,N.jsx)(iP.Certifications,{})})]})]})]})})})})};var nP=(0,n.G0)(e=>{const{getUserOrganization:s,getUserOrganizationId:a,getUserOrganizationMembership:t,userHasSiteRole:i}=(0,n.nm)(),l=t();return(0,N.jsx)(N.Fragment,{children:(()=>{var e;if(!s()&&!i())return(0,N.jsx)(Pe.rd,{to:"/"});if(!s())return(0,N.jsx)(lP,{});if(null===l||void 0===l||!l.role)return(0,N.jsx)(Pe.rd,{to:"/"});switch(null===l||void 0===l||null===(e=l.role)||void 0===e?void 0:e.slug){case"facilitator":case"moderator":return(0,N.jsx)(aT,{organization_id:a()});case"organization_arbitrator":return(0,N.jsx)(kF,{organization_id:a()});default:return(0,N.jsx)(jF,{organization_id:a()})}})()})});class rP extends l.Component{constructor(e){super(e),this.resetError=()=>this.setState({error:null}),this.resetMessage=()=>this.setState({message:null}),this.changePage=e=>this.setState({page:e},this.refreshAssignments),this.refreshAssignments=async()=>{try{const{page:e,page_size:s}=this.state,{admin_group:a,app:t}=this.props,i=t.api,l=a.group?a.group.id:"";this.setState({assignments:null,loading:!0});const{assignments:n,count:r}=await i.get(`/api/assignments/list/${e}/${s}`,{group_id:l});this.setState({assignments:n,count:r,loading:!1})}catch({err:err}){this.setState({error:err,loading:null})}},this.attemptDeleteAssignment=async e=>{try{var s;const{admin_group:a,app:t}=this.props,{api:i}=t,l=null===a||void 0===a||null===(s=a.group)||void 0===s?void 0:s.id;this.setState({assignments:null,loading:!0}),await i.post("/api/assignments/delete",{group_assignment_id:null===e||void 0===e?void 0:e.id,group_id:l}),await this.refreshAssignments()}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleDeleteAssignment=(e,s)=>{var a;
2e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const t=null===this||void 0===this||null===(a=this.confirmation_dialog)||void 0===a?void 0:a.current;if(!t)return;const{intl:i}=this.props;t.show({actions:[t.CancelAction(),t.Action({label:"Delete",onClick:async()=>await this.attemptDeleteAssignment(s),variant:"danger"})],body:i.formatMessage({id:"label.are_you_sure_you_want_to_delete_ti.e7364779",defaultMessage:"Are you sure you want to delete {title}?"},{title:(0,N.jsx)("strong",{children:null===s||void 0===s?void 0:s.title})}),title:i.formatMessage({id:"label.confirm_deletion.fa57243d",defaultMessage:"Confirm deletion"})})},this.launchAssignmentWizard=async()=>{const{admin_group:e,history:s}=this.props,{group:a}=e;if(!this.assignment_wizard)return;const{assignment:t}=await this.assignment_wizard.show({group_id:a.id,organization_id:null===a||void 0===a?void 0:a.organization_id})||{};t&&s.push(`/admin/group/${null===t||void 0===t?void 0:t.group_id}/assignment/${null===t||void 0===t?void 0:t.id}`)},this.getAssignmentComponent=e=>{var s,a;return"journey"===(null===e||void 0===e?void 0:e.type)?e:(null===e||void 0===e||null===(s=e.group_assignment_components)||void 0===s||null===(a=s[0])||void 0===a?void 0:a[`${null===e||void 0===e?void 0:e.type}_template`])||{}},this.navigateToAssignment=(e,s)=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const{admin_group:a,history:t}=this.props,i=null===a||void 0===a?void 0:a.group_id;i&&s&&t.push(`/admin/group/${i}/assignment/${s}`)},this.assignment_wizard=null,this.confirmation_dialog=(0,l.createRef)(),this.state={assignments:null,count:0,error:null,loading:!0,message:null,page:1,page_size:20}}componentDidMount(){this.refreshAssignments()}render(){const{admin_group:e,app:s}=this.props,{group:a}=e,{organization_id:t}=a,{assignments:i,count:l,error:n,loading:r,message:o,page:d,page_size:c}=this.state;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"})}),s.userHasRight("manage_assignment",t)&&(0,N.jsx)(ve.A,{disabled:(null===a||void 0===a?void 0:a.archived_at)||r,onClick:this.launchAssignmentWizard,size:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"New assignment",id:"label.new_assignment.1ee23709"})})]}),(0,N.jsx)(Ge.A,{className:"mb-3",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.resetError,show:n,variant:"danger",children:n}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.resetMessage,show:o,variant:"info",children:o}),(0,N.jsxs)(ho,{hover:!0,striped:!0,className:"table-rounded",children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Due",id:"label.due.9071738f"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:8,loading:r,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map((e,t)=>{var i,l;const n=(null===e||void 0===e?void 0:e.title)||"",r=(null===e||void 0===e?void 0:e.type)||"",o=(null===e||void 0===e?void 0:e.learners_count)||0,d=(null===e||void 0===e?void 0:e.due)||null,c=(null===e||void 0===e?void 0:e.start)||null,h=this.getAssignmentComponent(e),u=null===e||void 0===e||null===(i=e.group_assignment_components)||void 0===i||null===(l=i[0])||void 0===l?void 0:l.certification_template;return(0,N.jsxs)(ho.Tr,{className:"cursor-pointer",onClick:s=>this.navigateToAssignment(s,null===e||void 0===e?void 0:e.id),children:[(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ad,{component:h,size:24,type:r}),(0,N.jsx)("strong",{className:"ms-2",children:(0,N.jsx)(Fl,{maxWidth:200,placement:"bottom",children:n})})]})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:(0,N.jsx)("span",{className:"text-capitalize",children:(0,N.jsx)(ke.A,{defaultMessage:"{type}",id:"label.type.76cba713",values:{type:r}})})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:o}),(0,N.jsx)(ho.Td,{className:"text-muted",hiddenBelow:"lg",children:c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:c})," | ",(0,N.jsx)(Gh.ib,{value:c})]}):(0,N.jsx)(ke.A,{defaultMessage:"No start date",id:"label.no_start_date.e7a39256"})}),(0,N.jsx)(ho.Td,{className:"text-muted",hiddenBelow:"lg",children:d?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:d})," | ",(0,N.jsx)(Gh.ib,{value:d})]}):(0,N.jsx)(ke.A,{defaultMessage:"No due date",id:"label.no_due_date.6139ed04"})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:u?(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[u.icon_path?(0,N.jsx)("img",{alt:"",src:u.icon_path,style:{flexShrink:0,height:20,objectFit:"contain",width:20}}):(0,N.jsx)(ze.veT,{className:"text-muted",size:14,style:{flexShrink:0}}),(0,N.jsx)(Fl,{maxWidth:140,placement:"bottom",children:u.title})]}):(0,N.jsx)("span",{className:"text-muted",children:"\u2014"})}),(0,N.jsx)(ho.Td,{className:"text-end",children:!a.archived_at&&s.userHasRight("manage_group",null===a||void 0===a?void 0:a.organization_id)&&(0,N.jsx)(ve.A,{onClick:s=>this.handleDeleteAssignment(s,e),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})})]},t)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:8,children:"No assignments found"})})})]}
2),(0,N.jsx)(Lr,{count:l,onChange:this.changePage,page:d,page_size:c})]})}),(0,N.jsx)(cc,{ref:e=>this.assignment_wizard=e}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})}}var oP=(0,P.G0)((0,Pe.y)((0,Ke.Ay)(_T(sF(rP)))));var dP=e=>{const{group:s,group_id:a,organization:t,organization_id:i}=aF(),[n,r,o]=(0,ne.CQ)({end_date:ci()().toDate().getTime(),error:null,selected_range:"month",start_date:ci()().subtract(1,"month").toDate().getTime()}),{end_date:d,error:c,loading:h,start_date:u}=n,m=ci()(d).format("MM/DD/YY"),g=ci()(u).format("MM/DD/YY"),p=(0,l.useRef)();return(0,N.jsxs)(zT,{value:{end_date:d,group:s,group_id:a,organization:t,organization_id:i,selected_date_end:m,selected_date_start:g,start_date:u},children:[(0,N.jsxs)(Ue.A,{className:"admin-organization-dashboard",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:c,variant:"danger",children:c}),(0,N.jsxs)(Me.x_,{loading:h,children:[(0,N.jsx)(Ce.S,{className:"m1-2 mb-5 clearfix",children:(0,N.jsxs)(ve.A,{className:"me-3",onClick:()=>{const e=null===p||void 0===p?void 0:p.current;e&&e.show({end_date:d,start_date:u})},variant:"secondary",children:[ci()(u).format("MMM DD, YYYY")," - ",ci()(d).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsx)(_I,{label:"General usage",children:(0,N.jsx)(BT,{})})}),(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsx)(_I,{label:"Messages",children:(0,N.jsx)(qT,{})})}),(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsx)(_I,{label:"Voice calls",children:(0,N.jsx)(pI,{})})})]}),(0,N.jsx)(_I,{label:"User metrics",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"online",id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"online",children:(0,N.jsx)(ke.A,{defaultMessage:"Online",id:"label.online.0d21bd52"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"registered",children:(0,N.jsx)(ke.A,{defaultMessage:"Registered",id:"label.registered.2351ee99"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"online",children:(0,N.jsx)(uI,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"registered",children:(0,N.jsx)(mI,{})})]})]})}),(0,N.jsx)(_I,{label:"Module metrics",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"challenges",id:"admin-module-tabs",mountOnEnter:!0,unmountOnExit:!0,children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"challenges",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"cartridges",children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridges",id:"label.cartridges.ba6afb58"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsxs)(ld.A.Pane,{eventKey:"challenges",children:[(0,N.jsx)(WT,{type:"challenge"}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(KT,{type:"challenge"})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(FT,{type:"challenge"})})]}),(0,N.jsx)(Qe.A,{className:"mt-3",children:(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(GT,{})})})]}),(0,N.jsxs)(ld.A.Pane,{eventKey:"cartridges",children:[(0,N.jsx)(WT,{type:"cartridge"}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(KT,{type:"cartridge"})}),(0,N.jsx)(Ve.A,{className:"mb-3",lg:6,children:(0,N.jsx)(FT,{type:"cartridge"})})]})]})]})]})})]})]}),(0,N.jsx)(Xw,{onRef:e=>p.current=e,onSelect:e=>{const s=e.start_date,a=e.end_date,t=e.selected_range;r({end_date:a,selected_range:t,start_date:s})}})]})};class cP extends l.Component{constructor(s){super(s),this.handleSubmit=async s=>{try{const{code_token:e,expires:a,is_active:t}=s,{admin_group:i,app:l,code:n,onSave:r}=this.props,{group_id:o}=i||{},{id:d}=n||{},{api:c}=l;this.setState({saving:!0}),n?await c.post("/api/groups/codes/save",{code_token:e,expires:a,group_code_id:d,group_id:o,is_active:t}):await c.post("/api/groups/codes/add",{code_token:e,expires:a,group_id:o,is_active:t}),this.setState({saving:!1,show_dialog:!1}),"function"==typeof r&&r()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,saving:!1})}},this.generateCode=e=>{e="function"==typeof e?e:function(){};t(92426).randomBytes(4,(s,a)=>{const t=a.toString("hex").toUpperCase();e(!s&&t)})},this.state={error:null,saving:!1}}render(){const{app:e,code:s,intl:a}=this.props,{locale:t}=e,{parseBinary:i}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},{formatMessage:l}=a,n=s?s.code_token:"",r=s&&!s.is_active?0:1,o=s&&Number.parseInt(new Date(s.expires).getTime())||"",d=ci()(),c=e=>e.isAfter(d);return(0,N.jsx)(xe,{onHide:()=>{"function"==typeof this.props.onHide&&this.props.onHide()},show:this.props.show,children:(0,N.jsx)(ds.l1,{onSubmit:this.handleSubmit,validationSchema:(0,Re.by)({locale:t,scope:"organization.add_group_code"}),initialValues:{code_token:n,expires:o,is_active:i(r)},render:e=>{let{errors:a,handleChange:t,handleSubmit:i,setFieldTouched:n,setFieldValue:r,touched:o,values:d}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:(s?"Edit":"Add")+" Registration Code",id:"label.add_code"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Code",id:"label.code.340f4630"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:o.code_token&&a.code_token,isValid:o.c
2ode_token&&!a.code_token,name:"code_token",onChange:t,type:"text",value:d.code_token}),(0,N.jsx)(ve.A,{onClick:()=>{this.generateCode(e=>{r("code_token",e)})},variant:"outline-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Generate",description:"",id:"label.generate.49e49bb4"})})]}),(0,N.jsx)(ds.Kw,{name:"code_token",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Expiration date",id:"label.expiration_date.8ccc3fd4"})}),(0,N.jsx)(_c(),{disabled:this.state.saving,isInvalid:o.expires&&a.expires,isValid:o.expires&&!a.expires,isValidDate:c,name:"expires",value:d.expires,inputProps:{placeholder:l({id:"label.select_expiration_date.0076ffac",defaultMessage:"Select expiration date"})},onChange:e=>{let s="function"==typeof e.unix?1e3*e.unix():null;r("expires",s),n("expires")}}),(0,N.jsx)(ds.Kw,{name:"expires",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsxs)(_e.A.Select,{disabled:this.state.saving,isInvalid:o.is_active&&a.is_active,isValid:o.is_active&&!a.is_active,name:"is_active",onChange:t,value:null===d||void 0===d?void 0:d.is_active,children:[(0,N.jsx)("option",{value:1,children:l({id:"label.active.92340695",defaultMessage:"Active"})}),(0,N.jsx)("option",{value:0,children:l({id:"label.inactive.ac7c949f",defaultMessage:"Inactive"})})]}),a.is_active&&o.is_active&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:a.is_active})]})]}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Disclaimer: By using this feature you acknowledge that this service will not be used for users under 13 years of age or that you have obtained verifiable parental consent for this user.",description:"",id:"label.disclaimer_by_using_this_feature_y.78d20a4d"})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:()=>{"function"==typeof this.props.onHide&&this.props.onHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",description:"",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:this.state.saving,onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",description:"",id:"label.save_changes.dd0ae7a5"})})]})]})}})})}}var hP=(0,Ke.Ay)((0,n.G0)(_T(sF(cP))));const uP=t(70352);class mP extends l.Component{constructor(e){super(e),this.state={error:null,success:!1}}copyToClipboard(e){this.input.select(),document.execCommand("copy"),e.target.focus(),this.setState({success:!0})}render(){const{app:e}=this.props,s=window.location.protocol+"//"+uP.join(e.siteUrl,"/code");return(0,N.jsx)(xe,{onHide:()=>{"function"==typeof this.props.onHide&&this.props.onHide(),this.setState({success:!1})},show:this.props.show,children:(0,N.jsx)(ds.l1,{initialValues:{registration_link:s},render:e=>{let{values:s}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Registration link",id:"label.registration_link.d00b5f04"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsx)(_e.A,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Registration link",id:"label.registration_link.d00b5f04"})}),(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(_e.A.Control,{readOnly:!0,name:"registration_link",ref:e=>this.input=e,type:"text",value:s.registration_link}),document.queryCommandSupported("copy")&&(0,N.jsxs)(ve.A,{onClick:this.copyToClipboard.bind(this),variant:"outline-secondary",children:[(0,N.jsx)(ze.zU_,{})," Copy"]})]}),this.state.success&&(0,N.jsx)("p",{className:"text-success",style:{marginBottom:"0px",marginTop:"10px"},children:"Copy success!"})]})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:()=>{"function"==typeof this.props.onHide&&this.props.onHide()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})}})})}}var gP=(0,n.G0)(_T(sF(mP)));class pP extends l.Component{constructor(e){super(e),this.deleteCode=e=>{const{admin_group:s,app:a}=this.props,{api:t}=a,{group_id:i}=s||{};this.setState({codes:null,loading:!0}),t.post("/api/groups/codes/delete",{group_code_id:e,group_id:i}).then(()=>{this.refreshCodes()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})},this.state={codes:[],count:0,edit_code:null,error:null,loading:!0,page:1,page_size:20,saving:!1,show_dialog:!1,show_link_dialog:!1}}refreshCodes(){const{admin_group:e,app:s}=this.props,{api:a}=s,{group_id:t}=e,{page:i,page_size:l}=this.state;this.setState({codes:null,loading:!0}),a.get(`/api/groups/codes/list/${i}/${l}`,{group_id:t}).then(e=>{let{codes:s,count:a}=e;this.setState({codes:s,count:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}componentDidMount(){this.refreshCodes()}render(){const{intl:e}=this.props,{formatMessage:s}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("h5",{className:"clearfix",children:[(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{this.setState({show_dialog:!0})},size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Add registration code",id:"label.add_registration_code.a434b586"})}),(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{this.setState({show_link_dialog:!0})},size:"sm",style:{marginRight:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Get link",id:"label.get_link.74008e16"})}),(0,N.jsx)(ke.A,{defaultMessage:"Registration codes",id:"label.registration_codes.ca8df6d5"})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:Boolean(this.state.error),variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!this.state.loading&&!this.state.error&&this.state.codes&&(0,N.jsxs)(qa.A,{responsive:!0,className:"table-striped table-rounded",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Code",description:"",id:"label.code.340f4630"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Expiration date",description:"",id:"label.expiration_date.8ccc3fd4"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",description:"",id:"label.status.920e413c"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Action",description:"",id:"label.action.64cff131"})})]})}),(0,N.jsxs)("tbody",{children:[this.state.codes&&this.state.codes.map(e=>{const a=new Date,t=new Date(e.expires),i=null!==e&&void 0!==e&&e.expires&&t<=a?s({id:"label.expired.424a2551",defaultMessage:"Expired"}):e.is_active?s({id:"label.active.92340695",defaultMessage:"Active"}):s({id:"label.inactive.ac7c949f",defaultMessage:"Inactive"});return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:e.code_token}),(0,N.jsx)("td",{children:e.expires?(0,N.jsx)(Gh.XU,{day:"2-digit",month:"long",value:new Date(t),year:"numeric"}):(0,N.jsx)(ke.A,{defaultMessage:"Never",description:"",id:"label.never.6300ef80"})}),(0,N.jsx)("td",{children:(0,N.jsx)("span",{children:i})}),(0,N.jsxs)("td",{children:[(0,N.jsx)(ve.A,{className:"ps-0 pe-0",onClick:()=>{this.setState({edit_code:e,show_dialog:!0})},variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",description:"",id:"label.edit.464c4ffd"})}),"\xa0",(0,N.jsx)(ve.A,{className:"ps-0 pe-0",onClick:()=>{window.confirm("Are you sure you want to delete this code?")&&this.deleteCode(e.id)},variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",description:"",id:"label.delete.e2d0a549"})})]})]},e.code_token)}),!this.state.loading&&!this.state.error&&0===this.state.codes.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No codes found.",id:"label.no_codes_found.479df5f2"})})})]})]}),(0,N.jsx)(gP,{onHide:()=>{this.setState({show_link_dialog:!1})},show:this.state.show_link_dialog}),(0,N.jsx)(hP,{code:this.state.edit_code,onHide:()=>{this.setState({edit_code:null,show_dialog:!1})},onSave:()=>{this.refreshCodes(),this.setState({edit_code:null,show_dialog:!1})},show:this.state.show_dialog})]})}}var xP=(0,n.G0)(_T(sF((0,Ke.Ay)(pP))));class vP extends l.Component{constructor(e){super(e),this.addIntegration=async(e,s)=>{try{const{admin_group:a,app:t}=this.props,i=t.api;this.setState({loading:!0}),await i.post("/api/groups/integrations/add",{data:s,external_integration_id:null===s||void 0===s?void 0:s.lti_deployment_id,group_id:a.group_id,type:e}),this.setState({loading:!1,show_dialog:!1},()=>{"function"==typeof this.props.onSave&&this.props.onSave()})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleSubmit=async(e,s)=>{await this.addIntegration(e.type,e.data)},this.handleChangeDataField=async(e,s,a,t)=>{var i,l;const n=null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.name,r=null===e||void 0===e||null===(l=e.target)||void 0===l?void 0:l.value,o=(0,F.A)({},s.data);o[n]=r,await a("data",o),await t("data",!0)},this.state={error:null,loading:!1}}render(){const{error:e,loading:s}=this.state,{app:a,intl:t,onHide:i,show:l}=this.props,{locale:n}=a;return(0,N.jsx)(xe,{onHide:()=>"function"===typeof i&&i(),show:l,children:(0,N.jsx)(ds.l1,{initialValues:{data:{lti_client_id:"",lti_deployment_id:"",lti_platform:"",lti_platform_endpoint:""},external_integration_id:"",type:4},onSubmit:this.handleSubmit,validateOnChange:!0,validateOnMount:!0,validationSchema:(0,Re.by)({locale:n,scope:"organization.add_group_integration"}),children:a=>{var l,n,r,o,d,c,h,u,m,g,p,x,v,f,j,_,b,A,y,w;let{errors:S,handleChange:C,handleSubmit:M,isValid:k,setFieldTouched:z,setFieldValue:T,touched:I,validateForm:E,values:F}=a;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add integration",id:"label.add_integration.02a81fed"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e}),(0,N.jsxs)(_e.A,{onSubmit:M,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Integration type",id:"label.integration_type.bc10dc39"})}),(0,N.jsx)(_e.A.Select,{disabled:s,isInvalid:I.type&&S.type,isValid:I.type&&!S.type,name:"type",onChange:C,value:F.type,children:(0,N.jsx)("option",{value:4,children:t.formatMessage({id:"label.lti_advantage.51766402",defaultMessage:"LTI Advantage"})})}),(0,N.jsx)(ds.Kw,{name:"type",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),4==F.type&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Platform name",id:"label.platform_name.b36295f8"})}),(0,N.jsxs)(_e.A.Select,{disabled:this.state.saving,isInvalid:(null===I||void 0===I||null===(l=I.data)||void 0===l?void 0:l.lti_platform)&&(null===S||void 0===S||null===(n=S.data)||void 0===n?void 0:n.lti_platform),isValid:(null===I||void 0===I||null===(r=I.data)||void 0===r?void 0:r.lti_platform)&&!(null!==S&&void 0!==S&&null!==(o=S.data)&&void 0!==o&&o.lti_platform),name:"lti_platform",onCh
2ange:e=>this.handleChangeDataField(e,F,T,z),value:null===F||void 0===F||null===(d=F.data)||void 0===d?void 0:d.lti_platform,children:[(0,N.jsx)("option",{value:"",children:t.formatMessage({id:"label.select.2a78025d",defaultMessage:"Select"})}),(0,N.jsx)("option",{value:"canvas",children:t.formatMessage({id:"label.canvas_lms.fd01c53a",defaultMessage:"Canvas LMS"})})]}),(0,N.jsx)(ds.Kw,{name:"data.lti_platform",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Client ID",id:"label.client_id.8726db01"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:(null===I||void 0===I||null===(c=I.data)||void 0===c?void 0:c.lti_client_id)&&(null===S||void 0===S||null===(h=S.data)||void 0===h?void 0:h.lti_client_id),isValid:(null===I||void 0===I||null===(u=I.data)||void 0===u?void 0:u.lti_client_id)&&!(null!==S&&void 0!==S&&null!==(m=S.data)&&void 0!==m&&m.lti_client_id),name:"lti_client_id",onChange:e=>this.handleChangeDataField(e,F,T,z),type:"text",value:null===F||void 0===F||null===(g=F.data)||void 0===g?void 0:g.lti_client_id}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(ds.Kw,{name:"data.lti_client_id",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"The Tool Client ID is generated by the Platform (LMS)",description:"",id:"label.the_tool_client_id_is_generated_by.b151987d"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Deployment ID",id:"label.deployment_id.ce537acf"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:(null===I||void 0===I||null===(p=I.data)||void 0===p?void 0:p.lti_deployment_id)&&(null===S||void 0===S||null===(x=S.data)||void 0===x?void 0:x.lti_deployment_id),isValid:(null===I||void 0===I||null===(v=I.data)||void 0===v?void 0:v.lti_deployment_id)&&!(null!==S&&void 0!==S&&null!==(f=S.data)&&void 0!==f&&f.lti_deployment_id),name:"lti_deployment_id",onChange:e=>this.handleChangeDataField(e,F,T,z),type:"text",value:null===F||void 0===F||null===(j=F.data)||void 0===j?void 0:j.lti_deployment_id}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(ds.Kw,{name:"data.lti_deployment_id",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"The Deployment ID is created when an external app is configured in a Platform",description:"",id:"label.the_deployment_id_is_created_when.9b73b413"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Platform endpoint",id:"label.platform_endpoint.31ff1581"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:(null===I||void 0===I||null===(_=I.data)||void 0===_?void 0:_.lti_platform_endpoint)&&(null===S||void 0===S||null===(b=S.data)||void 0===b?void 0:b.lti_platform_endpoint),isValid:(null===I||void 0===I||null===(A=I.data)||void 0===A?void 0:A.lti_platform_endpoint)&&!(null!==S&&void 0!==S&&null!==(y=S.data)&&void 0!==y&&y.lti_platform_endpoint),name:"lti_platform_endpoint",onChange:e=>this.handleChangeDataField(e,F,T,z),type:"text",value:null===F||void 0===F||null===(w=F.data)||void 0===w?void 0:w.lti_platform_endpoint}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(ds.Kw,{name:"data.lti_platform_endpoint",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"The URL where the platform instance is hosted",description:"",id:"label.the_url_where_the_platform_instanc.1547b1a4"})})]})]})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:s,onClick:()=>{"function"==typeof i&&i()},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(Me.p0,{disabled:s,loading:s,onClick:M,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"})})]})]})}})})}}var fP=(0,n.G0)((0,Ke.Ay)(_T(sF(vP))));
2class jP extends l.Component{constructor(e){super(e),this.deleteIntegration=e=>{const{admin_group:s,app:a}=this.props,{api:t}=a,{group_id:i}=s||{};this.setState({integrations:null,loading:!0}),t.post("/api/groups/integrations/delete",{group_id:i,group_integration_id:e}).then(()=>{this.refreshIntegrations()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})},this.state={count:0,error:null,integrations:[],loading:!0,page:1,page_size:20,saving:!1,show_dialog:!1}}refreshIntegrations(){const{page:e,page_size:s}=this.state,{admin_group:a,app:t}=this.props,{api:i}=t,{group_id:l}=a||{};this.setState({integrations:null,loading:!0}),i.get(`/api/groups/integrations/list/${e}/${s}`,{group_id:l}).then(e=>{let{count:s,integrations:a}=e;this.setState({count:s,integrations:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}getIntegrationType(e){let s="";if(4===e)s="LTI 1.3";return s}componentDidMount(){this.refreshIntegrations()}render(){const{error:e,integrations:s,loading:a,show_dialog:t}=this.state;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("h5",{className:"clearfix",children:[(0,N.jsx)(ve.A,{className:"float-end",onClick:()=>{this.setState({show_dialog:!0})},size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Add integration",id:"label.add_integration.02a81fed"})}),(0,N.jsx)(ke.A,{defaultMessage:"Integrations",id:"label.integrations.090512d9"})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:Boolean(e),variant:"danger",children:e}),a&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!a&&!e&&s&&(0,N.jsxs)(qa.A,{responsive:!0,className:"table-striped table-rounded",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deployment ID",id:"label.deployment_id.ce537acf"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsxs)("tbody",{children:[s&&s.map(e=>(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:this.getIntegrationType(e.type)}),(0,N.jsx)("td",{children:null!==e&&void 0!==e&&e.external_integration_id?null===e||void 0===e?void 0:e.external_integration_id:"N/A"}),(0,N.jsx)("td",{children:(0,N.jsx)(ve.A,{onClick:()=>{window.confirm("Are you sure you want to delete this integration?")&&this.deleteIntegration(e.id)},variant:"link",children:"Delete"})})]},e.id)),!a&&!e&&0===s.length&&(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colSpan:"3",children:(0,N.jsx)(ke.A,{defaultMessage:"No integrations found.",id:"label.no_integrations_found.8af9ade8"})})})]})]}),(0,N.jsx)(fP,{onHide:()=>{this.setState({show_dialog:!1})},onSave:()=>{this.refreshIntegrations(),this.setState({show_dialog:!1})},show:t})]})}}var _P=(0,n.G0)((0,Ke.Ay)(_T(sF(jP))));class bP extends l.Component{constructor(e){super(e),this.state={error:null,loading:!1}}render(){return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!this.state.loading&&(0,N.jsx)(Ge.A,{className:"settings-tabs",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"general",id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"general",children:"General"})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"codes",children:"Registration codes"})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"integration",children:"Integrations"})})]})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"general",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(wP,{})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"codes",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(xP,{})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"integration",children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(_P,{})})})]})})]})})]})]})}}var AP=(0,n.G0)(_T(sF(bP)));class yP extends l.Component{constructor(e){super(e),this.loadGroupSettings=()=>{const{admin_group:e,app:s}=this.props,a=s.api,{group_id:t}=e,{parseBinary:i}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{};this.setState({integrations:null,loading:!0,name:null,slug:null}),a.get("/api/groups/get",{group_id:t}).then(e=>{let{group:s}=e;const{archived_at:a,name:t,section:l,slug:n}=s;this.setState({error:null,is_archived:i(!!a),loading:!1,name:t,section:l,slug:n})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.toggleIsArchived=()=>{const{admin_group:e,app:s}=this.props,a=s.api,{group_id:t}=e;let{is_archived:i}=this.state;const{parseBinary:l}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{};if(!i&&!window.confirm("Are you sure you want to archive this group? Once the group is archived, group learners will no longer have access to the group"))return!1;this.setState({loading:!0}),a.post("/api/groups/toggle-archive",{group_id:t,is_archived:l(!i)}).then(s=>{let{group:a}=s;
2this.setState({is_archived:l(!!a.archived_at),loading:!1,saved:!0},()=>{e.refreshGroup()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.showAvatarUploader=()=>{this.setState({dialog_error:null,show_dialog:!0})},this.handleAvatarSubmit=(e,s)=>{const{admin_group:a,app:t}=this.props,{group_id:i}=a;this.setState({loading:!0}),t.api.file("/api/groups/settings/avatar",{group_id:i,job_id:s},e,"image.jpg").then(()=>{this.setState({loading:!1,show_dialog:!1}),a.refreshGroup()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({dialog_error:s,submitting:!1})})},this.state={dialog_error:null,error:null,is_archived:0,loading:!0,name:"",saved:!1,section:"",show_alert:!1,show_dialog:!1,slug:""}}componentDidMount(){this.loadGroupSettings()}saveGroup(e,s,a){const{admin_group:t,app:i}=this.props,l=i.api,{group_id:n}=t;this.setState({loading:!0}),l.post("/api/groups/save",{group_id:n,name:e,section:a,slug:s}).then(()=>{this.setState({loading:!1,name:e,saved:!0,section:a,slug:s},()=>{t.refreshGroup()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}render(){const{error:e,is_archived:s}=this.state,{admin_group:a,app:t}=this.props,{locale:i}=t,{group:l}=a,{parseBinary:n}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{};return console.log(s),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({saved:null})},show:this.state.saved,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Group details saved successfully.",id:"label.group_details_saved_successfully.1b56022e"})}),this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!this.state.loading&&!this.state.error&&(0,N.jsx)(ds.l1,{initialValues:{name:this.state.name,section:this.state.section?this.state.section:"",slug:this.state.slug},validationSchema:(0,Re.by)({locale:i,scope:"organization.add_group"}),onSubmit:(e,s)=>{this.saveGroup(e.name,e.slug,e.section)},children:e=>{let{dirty:a,errors:i,handleChange:r,handleSubmit:o,isSubmitting:d,setFieldValue:c,touched:h,values:u}=e;return(0,N.jsx)(Ce.S,{children:(0,N.jsx)(_e.A,{onSubmit:o,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:8,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"General settings",id:"label.general_settings.2a1660d9"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(_e.A.Switch,{checked:!!n(s),className:"ps-0",id:"archivalSwitch",onChange:this.toggleIsArchived,label:(0,N.jsx)(N.Fragment,{children:n(s)?(0,N.jsx)(ke.A,{defaultMessage:"Inactive - Archived",id:"label.inactive_archived.879d68af"}):(0,N.jsx)(ke.A,{defaultMessage:"Active",id:"label.active.92340695"})})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:h.name&&i.name,isValid:h.name&&!i.name,name:"name",onChange:r,type:"text",value:u.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Slug",id:"label.slug.d15387ec"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:h.slug&&i.slug,isValid:h.slug&&!i.slug,name:"slug",onChange:r,type:"text",value:u.slug}),(0,N.jsx)(ds.Kw,{name:"slug",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Section name",id:"label.section_name.7c0faddc"})}),(0,N.jsx)(_e.A.Control,{disabled:this.state.saving,isInvalid:h.section&&i.section,isValid:h.section&&!i.section,name:"section",onChange:r,placeholder:"(optional)",type:"text",value:u.section}),(0,N.jsx)(ds.Kw,{name:"section",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(ve.A,{disabled:l.is_archived,onClick:o,type:"submit",variant:"primary",children:"Submit"})]}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsxs)(Ge.A,{className:"text-center",children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)(ke.A,{defaultMessage:"Avatar",id:"label.avatar.ca8e826d"})}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(Zs.A,{roundedCircle:!0,alt:"Class Avatar",src:t.getGroupAvatar(l),style:{display:"block",height:150,marginBottom:15,marginLeft:"auto",marginRight:"auto",width:150}}),(0,N.jsx)(ve.A,{onClick:this.showAvatarUploader.bind(this),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload avatar",id:"label.upload_avatar.e9892011"})})]})]})})]})})})}}),(0,N.jsxs)(xe,{backdrop:"static",onHide:()=>{this.setState({show_dialog:!1})},show:this.state.show_dialog,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload avatar",id:"label.upload_avatar.e9892011"})})}),(0,N.jsx)(xe.Body,{children:this.state.dialog_error?(0,N.jsxs)(We.A,{variant:"danger",children:[this.state.dialog_error,(0,N.jsx)(ve.A,{onClick:e=>{e.preventDefault(),this.setState({dialog_error:null})},variant:"link",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Try Again.",id:"label.try_again.1c6ee332"})})})]}):(0,N.jsx)(ya,{aspectRatio:1,onClose:()=>{this.setState({show_dialog:!1})},onFinish:(e,s)=>{this.handleAvatarSubmit(e,s)},submitting:this.state.submitting})})]})]})}}var wP=(0,n.G0)((0,Ke.Ay)(_T(sF(yP))));var NP=s=>{const{api:a}=(0,P.nm)(),{group_id:t}=aF(),i=(0,l.useRef)(),n=(0,l.useRef)(),[r,o]=(0,ne.CQ)({assignments:null,count:0,error:null,loading:!0,members:null,
2sort_direction:"ASC",sort_token:"created_at"}),{assignments:d,error:c,loading:h,members:u}=r,m=async()=>{try{const{sort_direction:e,sort_token:s}=r;o({assignments:null,error:null,loading:!0,members:null});const{assignments:i,members:l}=await a.get("/api/groups/grades/list",{group_id:t,sort_direction:e,sort_token:s});o({assignments:i,loading:!1,members:l})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}},g=async(s,i)=>{try{o({loading:!0}),await a.post("/api/groups/grades/set",{group_id:t,group_member_assignment_component_id:s,score:i}),await m(),o({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}},p=(e,s,a)=>{var t,i;const l=d.find(e=>e.id===a);return(null===l||void 0===l||null===(t=l.group_assignment_components)||void 0===t||null===(i=t[0])||void 0===i?void 0:i.group_member_assignment_components).find(a=>a.group_assignment_component_id===s&&a.group_member_id===e)};return(0,l.useEffect)(()=>{m()},[]),(0,N.jsxs)(Ce.S,{className:"admin-gradebook",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Gradebook",id:"label.gradebook.201b49b6"})}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:c,variant:"danger",children:c}),(0,N.jsxs)(Me.x_,{loading:h,children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center gap-1 justify-content-end mb-2",children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center  justify-content-center gap-1",disabled:!u||!u.length||h,onClick:()=>{const e=null===n||void 0===n?void 0:n.current;e&&e.show()},size:"sm",variant:"primary",children:[(0,N.jsx)(ze.WCW,{}),(0,N.jsx)(ke.A,{defaultMessage:"Export to CSV",id:"label.export_to_csv.73194761"})]})}),!(null!==d&&void 0!==d&&d.length)&&(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No assigned challenges found for this group",id:"label.no_assigned_challenges_found_for_t.3061fc94"})}),!(null!==u&&void 0!==u&&u.length)&&(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No learners found for this group",id:"label.no_learners_found_for_this_group.cabe41b8"})}),!(null===d||void 0===d||!d.length)&&!(null===u||void 0===u||!u.length)&&(0,N.jsx)("div",{className:"w-100",style:{maxHeight:800},children:(0,N.jsxs)(qa.A,{className:"table-gradebook",style:{maxHeight:800},children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"cell-header",children:(0,N.jsx)("b",{children:(0,N.jsx)("u",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner",id:"label.learner.0815286c"})})})}),d&&d.map((e,s)=>{let{group_assignment_components:a,title:t,type:i}=e;return(0,N.jsx)(N.Fragment,{children:a.map(a=>{let l=(null===a||void 0===a?void 0:a.challenge_template)||(null===a||void 0===a?void 0:a.cartridge_template)||null,n=(null===l||void 0===l?void 0:l.title)||"";return(0,N.jsx)("td",{className:"text-center",children:(0,N.jsxs)("small",{children:[(0,N.jsx)("b",{children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===e||void 0===e?void 0:e.group_id}/assignment/${null===e||void 0===e?void 0:e.id}`,children:t})}),"journey"===i&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("br",{}),n]})]})},`${s}-${null===e||void 0===e?void 0:e.id}`)})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"cell-header",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Group average",id:"label.group_average.bd3bc8da"})})}),d.map(e=>{let{group_assignment_components:s}=e;return(0,N.jsx)(N.Fragment,{children:s.map(e=>{let{id:s,group_member_assignment_components:a}=e;const t=a.map(e=>{var s;return null===e||void 0===e||null===(s=e.challenge_member)||void 0===s?void 0:s.score}).filter(e=>"number"===typeof e),i=t.length,l=t.reduce((e,s)=>e+s,0),n=i>0?(l/i).toFixed(2):null;return(0,N.jsx)("td",{className:"text-center cell-header",children:null!=n?(0,N.jsx)("b",{children:Number(n)}):"-"},s)})})})]}),u.map(e=>{let{id:s,organization_member:{user:a}}=e;return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"cell-subheader",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(Ya,{showOnline:!1,size:25,user:a,withBorder:!0}),(0,N.jsx)("strong",{children:a.fullname})]})}),d.map(e=>{let{id:a,group_assignment_components:t}=e;return(0,N.jsx)(l.Fragment,{children:t.map(e=>{let{id:t}=e;const l=p(s,t,a),{id:n,challenge_member:r}=l||{},o=null===r||void 0===r?void 0:r.score;return(0,N.jsx)("td",{className:"cell-grade text-center",children:l?(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2 justify-content-center",children:[(0,N.jsx)("strong",{children:"number"===typeof o?o:"-"}),(0,N.jsx)(ve.A,{className:"p-0",onClick:()=>function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const a=null===i||void 0===i?void 0:i.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:"Save",onClick:()=>{const s=Number.parseInt(a.getInputValue());if(isNaN(s)||s<0||s>100)return window.alert("Invalid score provided. Please supply a score between 0 and 100"),!1;g(e,s)},variant:"primary"})],body:"Provide a numeric score (0-100) for this assignment",prompt:a.NumberPrompt({initialValue:s}),size:"sm",title:"Modify Score"})}(n,o),variant:"link",children:(0,N.jsx)(ze.Mbp,{size:".75em"})})]}):(0,N.jsx)("em",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"Not assigned",id:"label.not_assigned.13075c23"})})},n||t)})},a)})]},s)})]})})]})]}
2),(0,N.jsx)(zP,{getGroupMemberAssignmentComponent:p,group_assignments:d,group_members:u,ref:n}),(0,N.jsx)(je,{ref:i})]})},SP=t(30503),CP=t(9222),MP=t(31019);const kP=(0,l.forwardRef)((e,s)=>{const{getGroupMemberAssignmentComponent:a,group_assignments:t,group_members:i}=e,{group:n}=aF(),{formatMessage:r}=(0,ja.A)(),[o,d,c]=(0,ne.CQ)({csv_format:"standard",error:null,saving:!1,select_all:!1,selected_assignment_components:[],visible:!1}),{csv_format:h,error:u,saving:m,select_all:g,selected_assignment_components:p,visible:x}=o,v=`${ci()().format("M-D-YYYY")}-Grades-${n.name}.csv`,f=()=>d({visible:!0}),j=()=>c(),_=e=>p.includes(e);return(0,l.useImperativeHandle)(s,()=>({hide:j,show:f,visible:x})),(0,N.jsxs)(xe,{backdrop:"static",className:"gradebook-export-modal",onHide:j,show:x,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Export Gradebook to CSV",id:"label.export_gradebook_to_csv.99f0e49b"})})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:u,variant:"danger",children:u}),(0,N.jsxs)(_e.A,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"})}),(0,N.jsxs)(qa.A,{bordered:!0,responsive:!0,children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{className:"text-center",style:{width:40},children:(0,N.jsx)(_e.A.Check,{onClick:()=>d({select_all:!g}),type:"checkbox"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})})]})}),(0,N.jsx)("tbody",{children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>{const{group_assignment_components:a,type:t}=e;return(0,N.jsx)(N.Fragment,{children:a&&a.map((a,i)=>{var l,n;let{title:r}=e,o=(null===a||void 0===a||null===(l=a.challenge_template)||void 0===l?void 0:l.title)||(null===a||void 0===a||null===(n=a.cartridge_template)||void 0===n?void 0:n.title)||"";r="journey"===t?(0,N.jsxs)(N.Fragment,{children:[r,(0,N.jsx)("br",{}),(0,N.jsx)("small",{children:o})]}):r;const c=_(null===a||void 0===a?void 0:a.id);return(0,N.jsxs)("tr",{className:c?"table-assignment-selected":"",children:[(0,N.jsx)("td",{className:"text-center",children:(0,N.jsx)(_e.A.Check,{checked:g||c,name:"assignment["+(null===a||void 0===a?void 0:a.id)+"]",type:"checkbox",onChange:e=>{d(e=>(c?e.selected_assignment_components.splice(e.selected_assignment_components.indexOf(null===a||void 0===a?void 0:a.id),1):e.selected_assignment_components.push(null===a||void 0===a?void 0:a.id),e))}})}),(0,N.jsx)("td",{children:r})]},`${s}-${null===a||void 0===a?void 0:a.id}`)})})})}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colSpan:"2",children:(0,N.jsx)(ke.A,{defaultMessage:"No assigned challenges found",id:"label.no_assigned_challenges_found.3288530d"})})})})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"CSV Format",id:"label.csv_format.108ce92a"})}),(0,N.jsxs)(_e.A.Select,{name:"csv_format",onChange:e=>d({[e.target.name]:e.target.value}),value:h,children:[(0,N.jsx)("option",{value:"standard",children:r({id:"label.standard_csv.87c35163",defaultMessage:"Standard CSV"})}),(0,N.jsx)("option",{value:"canvas",children:r({id:"label.canvas_lms.fd01c53a",defaultMessage:"Canvas LMS"})}),(0,N.jsx)("option",{value:"blackboard",children:r({id:"label.blackboard_lms.0e1d6e2d",defaultMessage:"BlackBoard LMS"})}),(0,N.jsx)("option",{value:"moodle",children:r({id:"label.moodle_lms.da4d4126",defaultMessage:"Moodle LMS"})}),(0,N.jsx)("option",{value:"brightspace",children:r({id:"label.brightspace_desire2learn.5278d21b",defaultMessage:"BrightSpace (Desire2Learn)"})})]})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:m,onClick:j,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(MP.CSVLink,{className:"btn btn-primary "+(null!==t&&void 0!==t&&t.length?"":"disabled"),data:(()=>{const e=new CP.iX({formatters:{string:(0,SP.Yj)({quote:""})}});let s=[];
2return i?(i.forEach(e=>{var i,l,r;const{organization_member:o}=e,{user:d}=o,{fullname:c}=d;let u={};"standard"===h?u={Name:d.fullname}:"canvas"===h?u={Section:n.name,Student:c}:"blackboard"===h?u={"Grade columns":"",Name:d.fullname,Username:null===d||void 0===d||null===(i=d.default_email)||void 0===i?void 0:i.email_address}:"moodle"===h?u={Username:null===d||void 0===d||null===(l=d.default_email)||void 0===l?void 0:l.email_address}:"brightspace"===h&&(u={"Org Defined ID":"",Username:null===d||void 0===d||null===(r=d.default_email)||void 0===r?void 0:r.email_address}),t.forEach(s=>{const{group_assignment_components:t}=s;t.forEach(t=>{var i,l;if(!(g||_(null===t||void 0===t?void 0:t.id)))return;const n=a(null===e||void 0===e?void 0:e.id,null===t||void 0===t?void 0:t.id,s.id),{challenge_member:r}=n||{},o="number"===typeof(null===r||void 0===r?void 0:r.score)?r.score:"",d=(null===t||void 0===t||null===(i=t.challenge_template)||void 0===i?void 0:i.title)||(null===t||void 0===t||null===(l=t.cartridge_template)||void 0===l?void 0:l.title)||"
2-";"blackboard"===h?u[`${d} [Total pts:100]`]=o:"brightspace"===h?u[`${d} Points Grade`]=o:u[d]=o})}),s.push(u)}),s.length?e.parse(s):null):s})(),filename:v,children:(0,N.jsx)(ke.A,{defaultMessage:"Download",id:"label.download.d6eafe82"})})]})]})});kP.displayName="GradebookExportModal";var zP=kP;const TP=(0,l.forwardRef)((s,a)=>{const{group:t,onHide:i}=s,{api:n}=(0,P.nm)(),{isBelowBreakpoint:r}=(0,ne.vh)({breakpoint:922}),[o,d,c]=(0,ne.CQ)({count:0,error:null,loading:!1,organization_members:[],page:1,page_size:20,reject:Function(),resolve:Function(),search_term:"",selected_organization_member_ids:[],visible:!1}),{count:h,error:u,loading:m,organization_members:g,page:p,page_size:x,resolve:v,search_term:f,selected_organization_member_ids:j,visible:_}=o,b=null===t||void 0===t?void 0:t.organization_id,A=null===t||void 0===t?void 0:t.id,y=(0,l.useRef)(),w=async()=>{try{const{page:e,page_size:s,search_term:a}=o;d({loading:!0});const{count:t,members:i}=await n.get(`/api/organizations/members-exclude-group/list/${e}/${s}`,{group_id:A,organization_id:b,search_term:a});d({count:t,loading:!1,organization_members:i})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}},S=()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(w,1e3)},C=async()=>new Promise(async(e,s)=>{d({reject:s,resolve:e,visible:!0}),await w()}),M=()=>{v(),c(),i()},k=e=>-1!==j.indexOf(null===e||void 0===e?void 0:e.id),z=e=>d({page:1,page_size:e},w),T=()=>(null===j||void 0===j?void 0:j.length)&&(null===j||void 0===j?void 0:j.length)===(null===g||void 0===g?void 0:g.length);return(0,l.useImperativeHandle)(a,()=>({hide:M,show:C})),(0,l.useEffect)(()=>c,[]),(0,N.jsxs)(xe,{onHide:M,show:_,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add existing users from organization",id:"label.add_existing_users_from_organizati.331fa826"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:u,variant:"danger",children:u}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsxs)(Ei.A,{className:"me-2",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:e=>{var s;return d({search_term:(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)||""},S)},placeholder:"Search for user by name or email...",value:f})]}),(0,N.jsxs)(Yh.A,{"aria-label":"Records shown",children:[(0,N.jsx)(ve.A,{active:20===x,onClick:()=>z(20),variant:"secondary",children:"20"}),(0,N.jsx)(ve.A,{active:100===x,onClick:()=>z(100),variant:"secondary",children:"100"}),(0,N.jsx)(ve.A,{active:1e3===x,onClick:()=>z(1e3),variant:"secondary",children:"1000"})]})]}),(0,N.jsxs)(ho,{className:"mt-2",textResize:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{style:{width:30},children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(_e.A.Check,{checked:T(),onChange:()=>{const e=T()?[]:g.map(e=>{let{id:s}=e;return s});d({selected_organization_member_ids:e})},value:1})})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",style:{width:30}}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:m,children:null!==g&&void 0!==g&&g.length?(0,N.jsx)(N.Fragment,{children:g.map(e=>{const{user:s}=e,{default_email:a,fullname:t}=s;let i=a&&a.email_address;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(_e.A.Check,{checked:k(e),onChange:s=>(async e=>{const s=k(e)?o.selected_organization_member_ids.filter(s=>s!==e.id):[...o.selected_organization_member_ids,e.id];d({selected_organization_member_ids:s})})(e),value:1})})}),(0,N.jsx)(ho.Td,{className:"px-1",hiddenBelow:"lg",children:(0,N.jsx)(Ya,{user:s})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Fl,{maxWidth:250,placement:"bottom",children:t})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Fl,{maxWidth:r?100:250,placement:"bottom",children:i||"-"})})]},s.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:4,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found.",id:"label.no_users_found.ce0171e5"})})})})]}),(0,N.jsx)(Lr,{count:h,disabled:m,onChange:e=>d({page:e},w),page:p,page_size:x})]}),(0,N.jsxs)(xe.Footer,{className:"text-end",children:[(0,N.jsx)(ve.A,{disabled:m,onClick:M,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsxs)(ve.A,{disabled:m||!(null!==j&&void 0!==j&&j.length),onClick:async()=>{try{d({loading:!0}),await n.post("/api/groups/members/bulk-add",{group_id:null===t||void 0===t?void 0:t.id,organization_member_ids:j}),v(j),M()}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;d({error:a,loading:!1})}},variant:"primary",children:["Select ",null===j||void 0===j?void 0:j.length," users"]})]})]})});TP.displayName="AdminAddUserEditor",TP.defaultProps={onHide:Function()};var IP=TP;class EP extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.deleteUser=e=>{const{admin_group:s,app:a,intl:t}=this.props,{api:i}=a,{formatMessage:l}=t,{group_id:n,refreshGroup:r}=s||{};this.setState({error:null,loading:!0}),i.post("/api/groups/members/delete",{group_id:n,group_member_id:e}).then(()=>{this.setState({loading:!1,success:l({id:"label.user_removed_successfully.d552e1d1",defaultMessage:"User removed successfully."})}),(0,T.isFunction)(r)&&r(),this.refreshUsers()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.toggleUserStatus=e=>{const{admin_group:s,app:a,intl:t}=this.props,{api:i}=a,{formatMessage:l}=t,{group_id:n}=s||{};this.setState({error:null,loading:!0}),i.post("/api/groups/members/toggle-archive",{group_id:n,group_member_id:e}).then(()=>{this.setState({loading:!1,success:l({id:"label.user_updated_successfully.c54ffa5d",defaultMessage:"User updated successfully."})}),this.refreshUsers()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.handleChangeStatusFilter=()=>this.setState({page:1},this.refreshUsers),this.handleShowUserImportModal=()=>{this.user_import_modal&&this.user_import_modal.show()},this.handleShowUserCreationModal=()=>{this.user_creation_modal&&this.user_creation_modal.show()},this.handleRemoveUser=e=>{var s;const a=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;let{organization_member:t}=e,{user:i}=t;const{admin_group:l,intl:n}=this.props,{formatMessage:r}=n,{group:o}=l;a.show({actions:[a.CancelAction(),a.Action({label:r({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"}),onClick:()=>this.deleteUser(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to remove {user} from {group}?",id:"label.are_you_sure_you_want_to_remove_us.33e86d70",values:{group:(0,N.jsx)("strong",{children:null===o||void 0===o?void 0:o.name}),user:(0,N.jsx)("strong",{children:(null===i||void 0===i?void 0:i.fullname)||""})}})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Note: the user will still remain in the organization.",id:"label.note_the_user_will_still_remain_in.e2a18f11"})})]}),title:r({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"})})},this.handleArchiveToggle=e=>{var s;const a=null===this||void 0===this||null===(s=this.confirmation_dialog)||void 0===s?void 0:s.current;if(!a)return;let{archived_at:t,organization_member:i}=e,{user:l}=i;const{admin_group:n,intl:r}=this.props,{formatMessage:o}=r,{group:d}=n;t?this.toggleUserStatus(null===e||void 0===e?void 0:e.id):a.show({actions:[a.CancelAction(),a.Action({label:o({id:"label.archive_user.3390dac7",defaultMessage:"Archive user"}),onClick:()=>this.toggleUserStatus(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to archive {user} from {group}?",id:"label.are_you_sure_you_want_to_archive_u.facdb110",values:{group:(0,N.jsx)("strong",{children:null===d||void 0===d?void 0:d.name}),user:(0,N.jsx)("strong",{children:(null===l||void 0===l?void 0:l.fullname)||""})}})})}),title:o({id:"label.archive_user.3390dac7",defaultMessage:"Archive user"})})},this.launchUserDetailsModal=e=>{var s;const a=null===this||void 0===this||null===(s=this.user_details_modal)||void 0===s?void 0:s.current;a&&a.show({user_id:e})},this.handleShowAddUserModal=()=>{this.add_user_modal.current&&this.add_user_modal.current.show()},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshUsers),this.state={count:0,error:null,loading:!0,members:null,page:1,page_size:20,search_term:"",show_create_user_editor:null,show_import_user_editor:null,show_sso_import_user_editor:null,sort_direction:"DESC",sort_token:"role",success:null},this.search_timer=null,this.user_import_modal=null,this.user_creation_modal=null,this.user_details_modal=(0,l.createRef)(),this.confirmation_dialog=(0,l.createRef)(),this.archive_filter=(0,l.createRef)(),this.add_user_modal=(0,l.createRef)()}refreshUsers(){var e;const{admin_group:s,app:a}=this.props,{page:t,page_size:i,search_term:l,sort_direction:n,sort_token:r}=this.state,o=a.api,d=null===s||void 0===s?void 0:s.group_id,c=null===(e=this.archive_filter)||void 0===e?void 0:e.current;if(!c)return;const{selected:h}=c;this.setState({loading:!0,users:null}),o.get(`/api/groups/members/list/${t}/${i}`,{filter_archived:h,group_id:d,search_term:l,sort_direction:n,sort_token:r}).then(e=>{let{count:s,members:a}=e;this.setState({count:s,loading:!1,members:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})})}startSearch(){this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState(e=>({page:1}),()=>{this.refreshUsers()})},1e3)}componentDidMount(){this.refreshUsers()}render(){var e,s;const{admin_group:a,admin_organization:t,app:i}=this.props,{styles:l,userHasRight:n,userIsSiteAdmin:r}=i,o=null===Re._$||void 0===Re._$||null===(e=Re._$.time)||void 0===e?void 0:e.convertSeconds,d=null===a||void 0===a?void 0:a.group,c=null===a||void 0===a?void 0:a.group.id,h=null===a||void 0===a||null===(s=a.group)||void 0===s?void 0:s.organization_id,{error:u,loading:m,members:g,search_term:p,sort_direction:x,sort_token:v,success:f}=this.state,{refreshOrganization:j}=t||{},{refreshGroup:_}=a||{},b=()=>{"function"===typeof j&&j(),"function"===typeof _&&_()},A=n("manage_user",h),y=n("manage_group_user",h),w=r();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"})}),y&&(0,N.jsxs)(li.A,{className:"float-end",style:{marginRight:"10px"},children:[(0,N.jsx)(li.A.Toggle,{disabled:!(!d.archived_at&&"demo"!==i.user.account_type),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add user",description:"",id:"label.add_user.eec5c73a"})}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:this.handleShowAddUserModal,style:{paddingLeft:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Add user",description:"",id:"label.add_user.eec5c73a"})}),(0,N.jsx)(li.A.Item,{onClick:()=>this.handleShowUserCreationModal(),style:{paddingLeft:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Create user",description:"",id:"label.create_user.f06da128"})}),(0,N.jsx)(li.A.Item,{onClick:()=>this.handleShowUserImportModal(),style:{paddingLeft:"15px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Import users from CSV",description:"",id:"label.import_users_from_csv.307baf3b"})}),i.isLTIUser(c)&&(0,N.jsx)(li.A.Item,{style:{paddingLeft:"15px"},onClick:()=>{this.setState({show_sso_import_user_editor:!0})},children:(0,N.jsx)(ke.A,{defaultMessage:"Synchronize LTI roster",description:"",id:"label.synchronize_lti_roster.5be65ef4"})})]})]})]}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:u,variant:"danger",children:u}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:f,variant:"success",children:f}),(0,N.jsx)(Qe.A,{className:"mb-2 align-items-center",children:(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,sm:12,children:(0,N.jsxs)(Ei.A,{className:"mb-1",size:"sm",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search",value:p,onChange:e=>{let s=e.target.value;this.setState({search_term:s}),this.startSearch()}})]})}),(0,N.jsx)(Ve.A,{className:"mb-1",md:2,sm:12,children:(0,N.jsx)(vT,{defaultSelected:!1,onChange:()=>{this.handleChangeStatusFilter()},ref:this.archive_filter})})]})})}),(0,N.jsxs)(ho,{defaultSortDirection:x,defaultSortToken:v,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{style:{width:30}}),(0,N.jsx)(ho.Th,{sortable:!0,name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"email_address",children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"role",children:(0,N.jsx)(ke.A,{defaultMessage:"Role",id:"label.role.67457"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"last_online",children:(0,N.jsx)(ke.A,{defaultMessage:"Last online",id:"label.last_online.ca050a43"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"total_time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time spent online",id:"label.time_spent_online.fbfef977"})}),A&&(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:A?7:6,loading:m,children:null!==g&&void 0!==g&&g.length?(0,N.jsx)(N.Fragment,{children:g.map(e=>{var s,a;let{organization_member:t}=e,{user:i}=t,l=null===i||void 0===i?void 0:i.fullname,r=i.default_email&&i.default_email.email_address,d=i&&i.last_online,c=ci()(d).format("M/D/YYYY, h:mm a"),u=i.total_time?o(i.total_time/1e3):null,m=null===e||void 0===e||null===(s=e.organization_member)||void 0===s?void 0:s.role;const g=null===i||void 0===i?void 0:i.id;let p=i.integrations&&i.integrations.length&&(null===(a=i.integrations[0])||void 0===a?void 0:a.type),x=w||
20==(null===e||void 0===e?void 0:e.active_assignment_count);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Ya,{user:i})}),(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Fl,{inline:!0,maxWidth:175,children:l})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:r?(0,N.jsx)(Fl,{inline:!0,maxWidth:200,children:r}):"-"}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:m?(0,N.jsx)(ke.A,{defaultMessage:null===m||void 0===m?void 0:m.name,id:`label.roles.${m.slug}`}):(0,N.jsx)(ke.A,{defaultMessage:"Learner",id:"label.learner.0815286c"})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:d?c:"- -"}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:u?`${u.value} ${u.label}`:"- -"}),n("manage_user",h)&&(0,N.jsxs)(ho.Td,{className:"text-end",children:[(0,N.jsx)(KA,{type:p}),(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{onClick:()=>this.launchUserDetailsModal(g),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})}),y&&(0,N.jsx)(ve.A,{onClick:()=>this.handleArchiveToggle(e),size:"sm",variant:"outline-secondary",children:null!==e&&void 0!==e&&e.archived_at?(0,N.jsx)(ke.A,{defaultMessage:"Activate",id:"label.activate.24433c70"}):(0,N.jsx)(ke.A,{defaultMessage:"Archive",id:"label.archive.66f4804e"})}),!(null!==e&&void 0!==e&&e.archived_at)&&y&&(0,N.jsx)(ph,{condition:!x,disabled:!x,onClick:()=>this.handleRemoveUser(e),size:"sm",tooltipPlacement:"right",variant:"outline-danger",tooltipContent:(0,N.jsx)(ke.A,{defaultMessage:"You may not remove a user after they have started an assignment",description:"",id:"label.you_may_not_remove_a_user_after_th.55938845"}),children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})},null===i||void 0===i?void 0:i.id)]})]})]},i.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:A?7:6,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found",id:"label.no_users_found.bf1e104f"})})})})]}),(0,N.jsx)(Lr,{count:this.state.count,page:this.state.page,page_size:this.state.page_size,onChange:e=>this.setState({page:e},()=>{this.refreshUsers()})}),(0,N.jsx)(DE,{organization_id:h,ref:this.user_details_modal}),(0,N.jsx)(IP,{group:d,onHide:()=>this.refreshUsers(),organization_id:h,ref:this.add_user_modal}),(0,N.jsx)(mS,{"\u0192":!0,group:d,group_id:c,onCreationSuccess:b,onHide:()=>this.refreshUsers(),onRef:e=>this.user_creation_modal=e,organization_id:h}),(0,N.jsx)(bS,{group:d,group_id:c,onCreationSuccess:b,onHide:()=>this.refreshUsers(),onRef:e=>this.user_import_modal=e,organization_id:h}),(0,N.jsx)(mF,{group_id:c,member:this.state.show_sso_import_user_editor,organization_id:h,show:Boolean(this.state.show_sso_import_user_editor),onHide:()=>{this.setState({show_sso_import_user_editor:null}),this.refreshUsers()}}),(0,N.jsx)(je,{ref:this.confirmation_dialog})]})]})}}var FP=(0,Ke.Ay)((0,P.G0)(_T(sF(EP))));class RP extends l.Component{constructor(e){super(e),this.refreshReports=async()=>{try{const{page:e,page_size:s,sort_direction:a,sort_token:t}=this.state,{admin_group:i,app:l}=this.props,n=null===i||void 0===i?void 0:i.group_id,r=null===l||void 0===l?void 0:l.api;this.setState({loading:!0,reports:null,selected_reports:[]});const{count:o,reports:d}=await r.get(`/api/groups/social/list/${e}/${s}`,{group_id:n,sort_direction:a,sort_token:t});this.setState({count:o,loading:!1,reports:d})}catch({err:err}){this.setState({error:err,loading:null})}},this.updateSelectedReports=e=>{const{selected_reports:s}=this.state,{admin_group:a,app:t}=this.props,i=null===a||void 0===a?void 0:a.group_id,l=null===t||void 0===t?void 0:t.api;if(null===s||void 0===s||!s.length)return;const n=[];this.setState({loading:!0});for(const r of s)r&&n.push(l.post("/api/groups/social/flag",{flag_id:r,group_id:i,status:e}));Promise.all(n).then(()=>{this.setState({all_selected:!1,loading:!1,selected_reports:[]},this.refreshReports)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})},this.updateReport=async(e,s)=>{try{const{admin_group:a,app:t}=this.props,i=null===a||void 0===a?void 0:a.group_id,l=t.api;this.setState({all_selected:!1,loading:!0,selected_reports:[]}),await l.post("/api/groups/social/flag",{flag_id:e,group_id:i,status:s}),this.setState({loading:!1},this.refreshReports)}catch({err:err}){this.setState({error:err,loading:!1})}},this.undoReport=async e=>{try{const{admin_group:s,app:a}=this.props,t=null===s||void 0===s?void 0:s.group_id,i=a.api;this.setState({loading:!0}),await i.post("/api/groups/social/flag/undo",{flag_id:e,group_id:t}),this.setState({loading:!1},this.refreshReports)}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleChangePage=e=>this.setState({all_selected:!1,page:e,selected_reports:[]},this.refreshReports),this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshReports),this.handleDismissSelectedReports=()=>{var e;const{intl:s}=this.props,a=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s.formatMessage({id:"label.yes_dismiss.9fa01db5",defaultMessage:"Yes, Dismiss"}),onClick:()=>this.updateSelectedReports(1),variant:"danger"})],body:s.formatMessage({id:"label.are_you_sure_you_want_to_dismiss_a.c3352ee6",defaultMessage:"Are you sure you want to dismiss all selected messages?"}),size:"sm",title:"Dismiss"})},this.handleHideSelectedReports=()=>{var e;const{intl:s}=this.props,a=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s.formatMessage({id:"label.hide_message.50165099",defaultMessage:"Hide message"}),onClick:()=>this.updateSelectedReports(2),variant:"danger"})],body:s.formatMessage({id:"label.are_you_sure_you_want_to_hide_all.a3e7c243",defaultMessage:"Are you sure you want to hide all selected messages?"}),size:"sm",title:"Hide"})},this.handleDeleteSelectedReports=()=>{var e;const{intl:s}=this.props,a=null===this||void 0===this||null===(e=this.dialog)||void 0===e?void 0:e.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s.formatMessage({id:"label.delete_message.87e7176a",defaultMessage:"Delete message"}),onClick:()=>this.updateSelectedReports(3),variant:"danger"})],body:s.formatMessage({id:"label.are_you_sure_you_want_to_delete_al.ce06eafc",defaultMessage:"Are you sure you want to delete all selected messages?"}),size:"sm",title:s.formatMessage({id:"label.delete.e2d0a549",defaultMessage:"Delete"})})},this.handleViewReportContent=(e,s)=>{var a,t;e.preventDefault();const{intl:i}=this.props,l=null===this||void 0===this||null===(a=this.dialog)||void 0===a?void 0:a.current;l&&l.show({actions:[l.CancelAction()],body:(0,N.jsx)("img",{src:null===s||void 0===s||null===(t=s.file)||void 0===t?void 0:t.location,style:{borderRadius:"4px",height:"100%",width:"100%"},alt:i.formatMessage({id:"label.the_content_of_the_file_attachment.bd762ced",defaultMessage:"The content of the file attachment for this flagged message"})}),size:"sm",title:i.formatMessage({id:"label.view_content.a1eee7df",defaultMessage:"View content"})})},this.handleViewReportDetails=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!t)return;const{comments:i,type:l}=e||{};let n="";switch(l){case 0:n=a.formatMessage({id:"label.inappropriate_content.940bd85c",defaultMessage:"Inappropriate content"});break;case 1:n=a.formatMessage({id:"label.spam_or_duplicate_comments.31442e34",defaultMessage:"Spam or duplicate comments"});break;case 2:n=a.formatMessage({id:"label.other.f97e9da0",defaultMessage:"Other"})}t.show({actions:[t.CancelAction()],body:(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Reason:",id:"label.reason.3425d108"})," ",n,(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),"Comment: ",i||"-"]}),size:"sm",title:a.formatMessage({id:"label.view_details.d1bf045b",defaultMessage:"View details"})})},this.handleDismissSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.yes_dismiss.9fa01db5",defaultMessage:"Yes, Dismiss"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,1),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_dismiss_t.be41db06",defaultMessage:"Are you sure you want to dismiss this message?"}),size:"sm",title:"Dismiss"})},this.handleHideSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.hide_message.50165099",defaultMessage:"Hide message"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,2),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_hide_this.34309a76",defaultMessage:"Are you sure you want to hide this message?"}),size:"sm",title:a.formatMessage({id:"label.hide.ac20a57b",defaultMessage:"Hide"})})},this.handleDeleteSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.delete_message.87e7176a",defaultMessage:"Delete message"}),onClick:()=>{this.updateReport(null===e||void 0===e?void 0:e.id,3),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_delete_th.a221ce62",defaultMessage:"Are you sure you want to delete this message?"}),size:"sm",title:a.formatMessage({id:"label.delete.e2d0a549",defaultMessage:"Delete"})})},this.handleUndoSingleReport=e=>{var s;const{intl:a}=this.props,t=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:a.formatMessage({id:"label.undo_action.20bb2a9b",defaultMessage:"Undo action"}),onClick:()=>{this.undoReport(null===e||void 0===e?void 0:e.id),this.setState({all_selected:!1,selected_reports:[]})},variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_undo_this.f0415c73",defaultMessage:"Are you sure you want to undo this report? This message will be restored and visible to learners."}),size:"sm",title:a.formatMessage({id:"label.undo.a8283ade",defaultMessage:"Undo"})})},this.isSelectedReport=e=>
2this.state.selected_reports.includes(e),this.getSelectableReports=()=>{var e;const{reports:s}=this.state;return null===s||void 0===s||null===(e=s.filter)||void 0===e?void 0:e.call(s,e=>0===(null===e||void 0===e?void 0:e.status))},this.toggleSelectAll=()=>{const{all_selected:e}=this.state,s=this.getSelectableReports().map(e=>null===e||void 0===e?void 0:e.id),a=e?[]:[...s];this.setState({all_selected:!e,selected_reports:a})},this.toggleSelection=e=>{const{selected_reports:s}=this.state,a=this.getSelectableReports(),t=this.isSelectedReport(e)?s.filter(s=>s!==e):[...s,e];this.setState({all_selected:(null===a||void 0===a?void 0:a.length)===(null===t||void 0===t?void 0:t.length),selected_reports:t})},this.state={all_selected:!1,count:0,error:null,loading:!0,page:1,page_size:20,reports:null,selected_reports:[],sort_direction:"DESC",sort_token:"created_at"},this.dialog=(0,l.createRef)()}componentDidMount(){this.refreshReports()}render(){var e;const{admin_group:s,app:a,intl:t}=this.props,{styles:i,userHasRight:l}=a,{all_selected:n,count:r,error:o,loading:d,page:c,page_size:h,reports:u,selected_reports:m,sort_direction:g,sort_token:p}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-2",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Social content moderation",id:"label.social_content_moderation.0
2d9bcb85"})}),(0,N.jsxs)(li.A,{children:[(0,N.jsx)(li.A.Toggle,{disabled:0===(null===m||void 0===m?void 0:m.length),variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"With selected",id:"label.with_selected.338a14ac"})}),(0,N.jsxs)(li.A.Menu,{align:"end",children:[(0,N.jsx)(li.A.Item,{onClick:this.handleDismissSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Dismiss",id:"label.dismiss.48845bff"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleHideSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Hide",id:"label.hide.ac20a57b"})}),(0,N.jsx)(li.A.Item,{onClick:this.handleDeleteSelectedReports,children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})]})]}),(0,N.jsxs)(Ge.A,{body:!0,className:"social-dashboard",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:o,variant:"danger",children:o}),(0,N.jsxs)(ho,{defaultSortDirection:g,defaultSortToken:p,onSort:this.handleSort,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(_e.A.Check,{checked:n,disabled:!(null!==(e=this.getSelectableReports())&&void 0!==e&&e.length),onClick:this.toggleSelectAll,type:"checkbox","aria-label":t.formatMessage({id:"label.toggle_select_all_reports.506c8d39",defaultMessage:"Toggle select all reports"})})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"status",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"content",children:(0,N.jsx)(ke.A,{defaultMessage:"Content",id:"label.content.47bd2907"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"author",children:(0,N.jsx)(ke.A,{defaultMessage:"Author",id:"label.author.d95082a2"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"reporter",children:(0,N.jsx)(ke.A,{defaultMessage:"Reported by",id:"label.reported_by.c170bc77"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"created_at",children:(0,N.jsx)(ke.A,{defaultMessage:"Date",id:"label.date.99c40ab4"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:d,children:null!==u&&void 0!==u&&u.length?(0,N.jsx)(N.Fragment,{children:u.map(e=>{var a,t;let{created_at:i,creator:n,status:r,team_message:o}=e,d=null===o||void 0===o?void 0:o.message,{body:c,user:h}=d||{},u=h.fullname,m=n.fullname,g="",p="";switch(r){case 0:g="open",p="primary";break;case 1:g="dismissed",p="secondary";break;case 2:g="hidden",p="warning";break;case 3:g="deleted",p="danger"}return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(_e.A.Check,{checked:this.isSelectedReport(null===e||void 0===e?void 0:e.id),disabled:0!==(null===e||void 0===e?void 0:e.status),id:`report-${null===e||void 0===e?void 0:e.id}`,name:`report-${null===e||void 0===e?void 0:e.id}`,onChange:()=>this.toggleSelection(null===e||void 0===e?void 0:e.id),type:"checkbox"})}),(0,N.jsx)(ho.Td,{className:"text-center",hiddenBelow:"lg",children:(0,N.jsx)(bo.A,{bg:p,children:g})}),(0,N.jsx)(ho.Td,{className:"social-dashboard-message-content",children:"image"===(null===o||void 0===o||null===(a=o.file)||void 0===a?void 0:a.type)&&null!==o&&void 0!==o&&null!==(t=o.file)&&void 0!==t&&t.location?(0,N.jsx)(ve.A,{className:"p-0",onClick:e=>this.handleViewReportContent(e,o),variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"View content",id:"label.view_content.a1eee7df"})}):(0,N.jsx)("div",{dangerouslySetInnerHTML:{__html:c}})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:u}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:m}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:(0,N.jsx)(Gh.XU,{value:new Date(i)})}),(0,N.jsx)(ho.Td,{className:"text-end",children:l("manage_group_user",null===s||void 0===s?void 0:s.organization_id)?(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[0===r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ve.A,{onClick:()=>this.handleDismissSingleReport(e),size:"sm",variant:"outline-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Dismiss",id:"label.dismiss.48845bff"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleHideSingleReport(e),size:"sm",variant:"outline-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Hide",id:"label.hide.ac20a57b"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleDeleteSingleReport(e),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]}),0!==r&&(0,N.jsx)(ve.A,{onClick:()=>this.handleUndoSingleReport(e),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Undo",id:"label.undo.a8283ade"})}),(0,N.jsx)(ve.A,{onClick:()=>this.handleViewReportDetails(e),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Details",id:"label.details.45989de4"})})]}):"-"})]},null===e||void 0===e?void 0:e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"7",children:(0,N.jsx)(ke.A,{defaultMessage:"No reports found.",id:"label.no_reports_found.38387272"})})})})]}),(0,N.jsx)(Lr,{count:r,onChange:this.handleChangePage,page:c,page_size:h}),(0,N.jsx)(je,{ref:this.dialog})]})]})}}var DP=(0,Ke.Ay)((0,P.G0)(_T(sF(RP))));class BP extends l.Component{constructor(e){super(e),this._isMounted=!1,this.state={active_key:"dashboard",error:null,group:null,group_counts:{user_count:0},group_tree:null,loading:!0}}refreshGroup(){const{app:e}=this.props,{group_id:s}=this.props.match.params;e.api.get("/api/groups/get",{group_id:s}).then(e=>{let{group:s,tree:a}=e;this.setState({error:null,group:s,group_counts:{assignment_count:s.assignment_count,user_count:s.user_count},group_tree:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}componentDidMount(){this._isMounted=!0,this.refreshGroup(),window.addEventListener("hashchange",()=>{this.setDefaultActiveTabKey()},!1),this.setDefaultActiveTabKey()}componentWillUnmount(){this._isMounted=!1,window.removeEventListener("hashchange",()=>{this.setDefaultActiveTabKey()},!1)}setDefaultActiveTabKey(){let e=window.location.hash.substr(1);e||(e="dashboard"),this.setActiveTabKey(e)}setActiveTabKey(e){this._isMounted&&this.setState({active_key:e})}render(){var e;const{app:s}=this.props,{active_key:a,group:t,group_tree:i,loading:l}=this.state,n=(null===t||void 0===t?void 0:t.id)||null,r=(null===t||void 0===t?void 0:t.organization_id)||null,o=(null===t||void 0===t?void 0:t.organization)||null;return(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Me.x_,{loading:l,children:r?(0,N.jsx)($E,{value:{group:t,group_id:n,organization:o,organization_id:r,refreshGroup:this.refreshGroup.bind(this)},children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[t?(0,N.jsxs)(vF.A,{children:[s.userIsSiteAdmin()&&(0,N.jsx)(pa.mu,{to:"/admin",children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.f35,{className:"me-1",size:12}),"Site"]})}),!s.userIsSiteAdmin()&&(s.userHasOrgRole("facilitator",r)||s.userHasOrgRole("moderator",r))&&(0,N.jsx)(pa.mu,{to:"/home",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"My dashboard",id:"label.my_dashboard.f4c56c94"})})}),s.userHasRight("manage_organization",r)&&(0,N.jsx)(N.Fragment,{children:i&&i.map(e=>(0,N.jsx)(pa.mu,{to:"/admin/organization/"+e.id,children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.ymh,{className:"me-1",size:12}),null===e||void 0===e?void 0:e.name]},e.id)},e.id))}),(0,N.jsxs)(vF.A.Item,{active:!0,children:[(0,N.jsx)(ze.aQJ,{className:"me-1",size:12}),null===t||void 0===t?void 0:t.name]})]}):"",(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Group dashboard",id:"label.group_dashboard.5f107669"})}),(0,N.jsx)("h4",{children:null===(e=this.state.group)||void 0===e?void 0:e.name}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),(0,N.jsxs)(ld.A.Container,{activeKey:a,id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKe
2y:"dashboard",href:"#dashboard",children:[(0,N.jsx)(ze.$BV,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Dashboard",id:"label.dashboard.67b69646"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"users",href:"#users",children:[(0,N.jsx)(ze.YXz,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Users",id:"label.users.6b0cc904"}),(0,N.jsx)(bo.A,{bg:"light",style:{verticalAlign:"middle"},text:"dark",children:this.state.group_counts.user_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"assignments",href:"#assignments",children:[(0,N.jsx)(ze.kkc,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Assignments",id:"label.assignments.2c7e21f6"}),(0,N.jsx)(bo.A,{bg:"light",style:{verticalAlign:"middle"},text:"dark",children:this.state.group_counts.assignment_count})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"social",href:"#social",children:[(0,N.jsx)(ze.uN,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Social",id:"label.social.f1b7505a"})]})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"gradebook",href:"#gradebook",children:[(0,N.jsx)(ze.v$b,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Gradebook",id:"label.gradebook.201b49b6"})]})}),(0,N.jsx)("hr",{}),s.userHasRight("manage_group",r)&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:"settings",href:"#settings",style:{marginLeft:"auto"},children:[(0,N.jsx)(ze.Pcn,{size:13}),(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"})]})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"dashboard",children:(0,N.jsx)(dP,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"users",children:(0,N.jsx)(FP,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"assignments",children:(0,N.jsx)(oP,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"social",children:(0,N.jsx)(DP,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"gradebook",children:(0,N.jsx)(NP,{})}),s.userHasRight("manage_group",r)&&(0,N.jsx)(ld.A.Pane,{eventKey:"settings",children:(0,N.jsx)(AP,{})})]})})})]})]})})})}):(0,N.jsx)(Pe.rd,{to:"/admin"})})})})})}}var PP=(0,n.G0)(_T(BP));const LP=l.createContext({}),OP=LP.Provider,HP=LP.Consumer,UP=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(HP,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin_assignment:s,ref:e=>{this.comp=e}}))})}}return s},QP=()=>(0,l.useContext)(LP),VP=(0,l.forwardRef)((s,a)=>{const{onHide:t,onSuccess:i}=s,{api:n,styles:r}=(0,P.nm)(),[o,d,c]=(0,ne.CQ)({error:null,group_id:null,group_member_assignment:null,group_member_assignment_id:null,loading:!1,selected_team:null,show:!1,teams:[]}),h=async()=>{try{const{group_member_assignment_id:e}=o,{teams:s}=await n.get(`/api/teams/existing/${e}`);d({teams:s})}catch({err:err}){throw d({error:err}),err}},u=async()=>{try{const{group_id:e,group_member_assignment_id:s}=o,{group_member_assignment:a}=await n.get("/api/assignments/member/get",{group_id:e,group_member_assignment_id:s});d({group_member_assignment:a})}catch({err:err}){throw d({error:err}),err}},m=e=>{d({group_id:null===e||void 0===e?void 0:e.group_id,group_member_assignment_id:null===e||void 0===e?void 0:e.group_member_assignment_id,loading:!0,show:!0}),Promise.all([h(),u()]).finally(()=>d({loading:!1}))},g=()=>{c(),"function"===typeof t&&t()};(0,l.useImperativeHandle)(a,()=>({hide:g,show:m})),(0,l.useEffect)(()=>c,[]);const p=null===r||void 0===r?void 0:r.primary,x=(()=>{const{group_member_assignment:e,teams:s}=o,a=null===e||void 0===e?void 0:e.team;return s.filter(e=>{const s=Array.isArray(e.members)?e.members:[],t=null===e||void 0===e?void 0:e.challenge;return(null===a||void 0===a?void 0:a.id)!==(null===e||void 0===e?void 0:e.id)&&((null===t||void 0===t||!t.completed)&&(null===s||void 0===s?void 0:s.length)<7)})})(),{error:v,group_member_assignment:f,loading:j,selected_team:_,show:b}=o,A=null===f||void 0===f?void 0:f.group_member,y=null===A||void 0===A?void 0:A.organization_member,S=null===y||void 0===y?void 0:y.user,C=null===f||void 0===f?void 0:f.team;return(0,N.jsxs)(xe,{onHide:g,show:b,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Transfer learner",id:"label.transfer_learner.68ce70b8"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:v,variant:"danger",children:v}),(0,N.jsxs)(Me.x_,{loading:j,children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner to transfer",id:"label.learner_to_transfer.37dc9fbe"})}),(0,N.jsxs)(Ce.S,{className:"transfer-learner-name",children:[(0,N.jsx)(Ya,{size:24,user:S}),(0,N.jsxs)(Ce.S,{className:"transfer-learner-text",children:[(0,N.jsx)("h6",{children:null===S||void 0===S?void 0:S.fullname}),(0,N.jsx)("h6",{className:"mb-0",children:C?null===C||void 0===C?void 0:C.name:(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No team",id:"label.no_team.e3924f28"})})})]})]}),(0,N.jsx)("h6",{className:"mt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Transfer to team",id:"label.transfer_to_team.97d059c9"})}),(0,N.jsx)("hr",{}),(0,N.jsxs)("div",{className:"transfer-learner-info mb-3 d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ze.ELu,{style:{color:p}})}),(0,N.jsx)(Ce.S,{className:"transfer-learner-information",children:(0,N.jsx)(ke.A,{defaultMessage:"Teams can have up to 7 team members. Only showing teams with available openings and non-completed challenges",id:"label.teams_can_have_up_to_7_team_member.14502504"})})]}),null!==x&&void 0!==x&&x.length?(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select a team",id:"label.select_a_team.f7f8b89b"})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(qa.A,{bordered:!0,className:"mt-3",children:(0,N.jsx)("tbody",{children:x.map(e=>{e&&e.challenge,(Array.isArray(e.members)?e.members:[]).map(e=>e&&e.user);let s=_&&(null===_||void 0===_?void 0:_.id)==(null===e||void 0===e?void 0:e.id);return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{width:45},children:(0,N.jsx)(Ce.S,{onClick:()=>{d(s?{selected_team:null}:{selected_team:e})},children:(0,N.jsx)(sy,{checked:s,type:"radio"})})}),(0,N.jsx)("td",{children:(0,N.jsx)("h6",{className:"m-0",children:e.name})})]},e.id)})})})})]}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)("h6",{className:"text-warning text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"No teams available with open spots",id:"label.no_teams_available_with_open_spots.f7b4552f"})})})]})]}),(0,N.jsxs)(xe.Footer,{className:"text-end",children:[(0,N.jsx)(ve.A,{disabled:!_,onClick:async()=>{try{const{group_member_assignment:e,selected_team:s}=o,a=null===e||void 0===e?void 0:e.team,t=null===e||void 0===e?void 0:e.group_member,l=null===t||void 0===t?void 0:t.organization_member,r=null===l||void 0===l?void 0:l.user;if(!r||!s||!e)return;d({loading:!0}),r&&null!==a&&void 0!==a&&a.id&&await(async(e,s)=>{try{await n.post("/api/teams/members/remove/",{team_id:s,user_id:e})}catch({err:err}){throw d({error:err}),err}})(r.id,a.id),await(async(e,s,a,t)=>{try{await n.post("/api/teams/members/transfer/",{group_member_assignment_id:t,password:a,team_id:s,user_id:e})}catch({err:err}){throw d({error:err}),err}})(null===r||void 0===r?void 0:r.id,null===s||void 0===s?void 0:s.id,null===s||void 0===s?void 0:s.password,null===e||void 0===e?void 0:e.id),d({loading:!1}),"function"===typeof i&&i(),g()}catch(e){w(e),d({loading:!1})}},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Transfer",id:"label.transfer.dde8bef7"})}),(0,N.jsx)(ve.A,{onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})})]})]})});VP.displayName="TeamMemberTransferModal";
2var GP=VP;class WP extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.setSuccess=e=>this.setState({success:e}),this.refreshUsers=()=>{const{admin_assignment:e,app:s}=this.props,{assignment_component_id:a,group_id:t}=e,{page:i,page_size:l,search_term:n,sort_direction:r,sort_token:o}=this.state,d=s.api;return this.setState({loading:!0}),new Promise((e,s)=>{d.get(`/api/cartridges/members/list/${i}/${l}`,{group_assignment_component_id:a,group_id:t,search_term:n,sort_direction:r,sort_token:o}).then(async s=>{let{count:a,members:t}=s;this.setState({count:a,loading:!1,members:t}),e()}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a,loading:!1}),s()})})},this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},()=>{this.refreshUsers()})},1e3)},this.handleFacilitation=async e=>{try{var s,a;const{app:t}=this.props,i=t.api;await i.post("/api/teams/members/facilitator/add",{team_id:null===e||void 0===e||null===(s=e.group_member_assignment)||void 0===s?void 0:s.team_id}),await window.open(`/assignment/${null===e||void 0===e||null===(a=e.group_member_assignment)||void 0===a?void 0:a.id}/${null===e||void 0===e?void 0:e.id}/content`)}catch({err:err}){throw this.setState({error:err}),err}},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshUsers),this.removeUserFromAssignment=async e=>{try{const{admin_assignment:s,app:a}=this.props,{api:t}=a,{assignment_id:i,group_id:l}=s;this.setState({loading:!0}),await t.post("/api/assignments/member/remove",{group_assignment_id:i,group_id:l,group_member_assignment_id:e}),await this.refreshUsers(),this.setState({loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleRemoveUser=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{formatMessage:i}=t;a.show({actions:[a.CancelAction(),a.Action({label:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"}),onClick:()=>this.removeUserFromAssignment(e),variant:"danger"})],body:i({id:"label.are_you_sure_you_want_to_remove_th.bd44bd23",defaultMessage:"Are you sure you want to remove this user from the assignment?"}),size:"sm",title:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"})})},this.handleTransferMember=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.transfer_dialog)||void 0===a?void 0:a.current;t&&t.show({group_id:e,group_member_assignment_id:s})},this.muteTeamMember=async(e,s)=>{try{var a;const{admin_assignment:t,app:i}=this.props,{api:l}=i,n=null===t||void 0===t||null===(a=t.group)||void 0===a?void 0:a.organization_id,r=[e];this.setState({loading:!0}),await l.post("/api/teams/members/update_muted_status",{is_muted:s,organization_id:n,team_member_ids:r}),await this.refreshUsers(),this.setState({loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleMuteMember=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.dialog)||void 0===a?void 0:a.current;if(!t)return;const{intl:i}=this.props,{formatMessage:l}=i,n=s?"mute":"unmute";t.show({actions:[t.CancelAction(),t.Action({label:(0,T.capitalize)(n),onClick:()=>this.muteTeamMember(e,s),variant:"danger"})],body:l({id:"label.are_you_sure_you_want_to_mute_phra.01ebb2c8",defaultMessage:"Are you sure you want to {mute_phrase} this team member?"},{mute_phrase:n}),size:"sm",title:l({id:"label.mute_phrase_team_member.4546a7e5",defaultMessage:"{mute_phrase} Team Member"},{mute_phrase:(0,T.capitalize)(n)})})},this.launchAddMemberModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.add_member_modal)||void 0===e?void 0:e.current;s&&s.show()},this.handleTransferSuccess=()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.learner_successfully_transferred_t.d26b9772",defaultMessage:"Learner successfully transferred to new team"}))},this.state={count:0,error:null,loading:!1,members:[],page:1,page_size:32,search_term:"",sort_direction:"ASC",sort_token:"fullname",success:null},this.search_timer=null,this.dialog=(0,l.createRef)(),this.add_member_modal=(0,l.createRef)(),this.transfer_dialog=(0,l.createRef)()}componentDidMount(){this.refreshUsers()}render(){const{admin_assignment:e,app:s}=this.props,{group:a}=e,{count:t,error:i,loading:l,members:n,page:r,page_size:o,search_term:d,sort_direction:c,sort_token:h,success:u}=this.state;return(0,N.jsxs)($P,{value:{handleFacilitation:this.handleFacilitation,handleMuteMember:this.handleMuteMember,handleRemoveUser:this.handleRemoveUser,handleSort:this.handleSort,handleTransferMember:this.handleTransferMember,loading:l,members:n,sort_direction:c,sort_token:h},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:i,variant:"danger",children:i}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:u,variant:"success",children:u}),(0,N.jsx)(_I,{count:t,label:"Learners",showCount:!0,headerRight:(0,N.jsxs)(Ce.S,{className:"mb-2 ms-auto",style:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"flex-end"},children:[(0,N.jsxs)(Ei.A,{className:"me-2",size:"sm",style:{maxWidth:342},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search learners",value:d||"",onChange:e=>{this.setState({search_term:e.target.value}),this.startSearch()}})]}),s.userHasRight("manage_group",null===a||void 0===a?void 0:a.organization_id)&&(0,N.jsx)(ve.A,{onClick:this.lau
2nchAddMemberModal,style:{whiteSpace:"nowrap"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add learner",id:"label.add_learner.efc76f3d"})})]}),children:(0,N.jsxs)(Ce.S,{className:"teams-container",children:[(0,N.jsx)(YP,{}),(0,N.jsx)(Lr,{count:t,onChange:e=>this.setState({page:e},this.refreshUsers),page:r,page_size:o})]})}),(0,N.jsx)(dL,{onAdd:this.refreshUsers,ref:this.add_member_modal}),(0,N.jsx)(VP,{onHide:this.refreshUsers,onSuccess:this.handleTransferSuccess,ref:this.transfer_dialog}),(0,N.jsx)(je,{ref:this.dialog})]})}}var KP=(0,n.G0)((0,Ke.Ay)(_T(UP(WP))));var YP=e=>{const{handleSort:s,loading:a,members:t,sort_direction:i,sort_token:l}=eL();return(0,N.jsxs)(ho,{defaultSortDirection:i,defaultSortToken:l,onSort:s,striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"team_name",children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"progress",style:{minWidth:120},children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",style:{minWidth:145},children:(0,N.jsx)(ke.A,{defaultMessage:"Engagement",id:"label.engagement.ea68771a"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",style:{minWidth:145},children:(0,N.jsx)(ke.A,{defaultMessage:"Score",id:"label.score.38e5a46c"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:a,children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>(0,N.jsx)(qP,{gmac:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"7",children:(0,N.jsx)(ke.A,{defaultMessage:"No learners found",id:"label.no_learners_found.4b76b226"})})})})]})};var qP=e=>{var s;const{gmac:a}=e,{userHasRight:t}=(0,P.nm)(),{handleMuteMember:i,handleRemoveUser:l,handleTransferMember:n}=eL(),{group:r,handleLaunchFacilitation:o,launchResponseHistory:d}=QP(),{convertSeconds:c}=null!==(s=null===Re._$||void 0===Re._$?void 0:Re._$.time)&&void 0!==s?s:{},{cartridge:h,completed:u,group_member:m,group_member_assignment:g,score:p,start:x,total_time_seconds:v}=a||{},{completion_pct:f=0,data:j}=h||{},{organization_member:_}=m||{},{user:b}=_||{},{team_member:A}=g||{},{team:y}=A||{},w=c(v),S=!(null===m||void 0===m||!m.archived_at);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{style:{alignItems:"center",display:"flex",flexDirection:"row"},children:[(0,N.jsx)(Ya,{user:b}),(0,N.jsxs)(Ce.S,{className:"ms-3 d-flex",children:[(0,N.jsx)("span",{children:(0,N.jsx)(qA,{user:b})}),S&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bo.A,{bg:"secondary",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})})})]})]})}),null==y?(0,N.jsx)(ro,{className:"no-team-column",hiddenBelow:"lg",children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"No team",id:"label.no_team.e3924f28"})})}):(0,N.jsx)(ro,{className:"team-column",hiddenBelow:"lg",children:null===y||void 0===y?void 0:y.name}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:A?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"mb-1 progress-container "+(u?"completed":""),children:(0,N.jsx)(Sa.A,{label:`${f}%`,now:f,style:{height:16}})}),(0,N.jsxs)(Ce.S,{children:[!x&&(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Not started",id:"label.not_started.ba35f0c4"})}),x&&!u&&(0,N.jsx)(bo.A,{pill:!0,bg:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"In progress",id:"label.in_progress.c1f88e9d"})}),u&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})})]})]}):(0,N.jsx)(bo.A,{pill:!0,bg:"danger",children:(0,N.jsx)(ke.A,{defaultMessage:"No team",id:"label.no_team.e3924f28"})})}),(0,N.jsx)(ro,{className:"truncate__email",hiddenBelow:"lg",children:(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.w_X,{size:14}),null!==w&&void 0!==w&&w.value?`${w.value} ${w.label}`:"-"]})}),(0,N.jsx)(ro,{hiddenBelow:"lg",children:p?`${p}%`:"-"}),(0,N.jsx)(ro,{className:"text-end",children:t("manage_team",null===r||void 0===r?void 0:r.organization_id)&&(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsxs)(ve.A,{onClick:()=>o(y,a),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.$hd,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Facilitate",id:"label.facilitate.b7fbd970"})]}),!!x&&!!j&&(0,N.jsxs)(ve.A,{onClick:()=>d({gmac:a,team:y,user:b}),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.OKX,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"History",id:"label.history.0e769600"})]}),(0,N.jsxs)(ve.A,{onClick:()=>l(null===a||void 0===a?void 0:a.group_member_assignment_id),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.Dby,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})]}),(0,N.jsxs)(ve.A,{onClick:()=>n(null===r||void 0===r?void 0:r.id,null===a||void 0===a?void 0:a.group_member_assignment_id),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.yk7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Transfer",id:"label.transfer.dde8bef7"})]}),A&&(0,N.jsx)(ve.A,{onClick:()=>i(null===A||void 0===A?void 0:A.id,!(null!==A&&void 0!==A&&A.is_muted)),size:"sm",variant:"outline-warning",children:null!==A&&void 0!==A&&A.is_muted?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.j1Q,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Unmute",id:"label.unmute.ce4ee4ef"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.gq7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Mute",id:"label.mute.8dd6857b"})]})})]})})]},a.id)};const JP=(0,l.forwardRef)((s,a)=>{const{onHide:t}=s,{api:i}=(0,P.nm)(),{handleLaunchFacilitation:n}=QP(),[r,o,d]=(0,ne.CQ)({cartridge_history:null,error:null,gmac:null,loading:!0,show:!1,team:null,user:null}),c=e=>{o({gmac:(null===e||void 0===e?void 0:e.gmac)||null,show:!0,team:(null===e||void 0===e?void 0:e.team)||null,user:(null===e||void 0===e?void 0:e.user)||null},u)},h=()=>{d(),"function"===typeof t&&t()},u=async()=>{try{const{gmac:e}=r;o({loading:!0});const{cartridge_history:s}=await i.get(`/api/cartridges/history/get/${null===e||void 0===e?void 0:e.cartridge_id}`);o({cartridge_history:s,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}};(0,l.useImperativeHandle)(a,()=>({hide:h,show:c})),(0,l.useEffect)(()=>d,[]);const{cartridge_history:m,gmac:g,loading:p,team:x,user:v}=r;return(0,N.jsxs)(xe,{onHide:h,show:r.show,children:[(0,N.jsxs)(xe.Header,{closeButton:!0,className:"d-flex flex-column align-items-start gap-1",children:[(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Response history",id:"label.response_history.c48cb701"})}),(0,N.jsx)("span",{children:null===v||void 0===v?void 0:v.fullname})]}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Me.x_,{loading:p,children:(0,N.jsx)(yl.A,{children:null!==m&&void 0!==m&&m.length?(0,N.jsx)(N.Fragment,{children:m.map((e,s)=>(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsxs)("span",{className:"font-weight-bold",children:[(0,N.jsx)(Gh.XU,{day:"numeric",month:"short",value:null===e||void 0===e?void 0:e.created_at,year:"numeric"}),", ",(0,N.jsx)(Gh.ib,{value:null===e||void 0===e?void 0:e.created_at})]}),(0,N.jsx)(ve.A,{onClick:()=>n(x,g,null===e||void 0===e?void 0:e.id),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Launch",id:"label.launch.ccf56ef5"})})]},s))}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No responses found",id:"label.no_responses_found.2064dea0"})})})})})]})});JP.displayName="ResponseHistoryModal";var XP=JP;const ZP=l.createContext({}),$P=ZP.Provider,eL=(ZP.Consumer,()=>(0,l.useContext)(ZP));class sL extends l.Component{constructor(e){var s,a,t,i,n,r,o,d;super(e),this._isMounted=!1,this.fetchAssignmentTeams=async()=>{try{const{group_assignment_id:e}=this.state,{app:s}=this.props,a=s.api;this.setState({loading_teams:!0});const{count:t,teams:i}=await a.get(`/api/teams/group-assignment/existing/${e}`);(0,oc.flushSync)(()=>{this.setState({loading_teams:!1,teams:i,teams_count:t})})}catch({err:err}){this.setState({error:err,loading_teams:!1})}},this.fetchAssignment=async()=>{try{const{group_assignment_id:e,group_id:s}=this.state,{app:a}=this.props,t=a.api,{assignment:i}=await t.get("/api/assignments/get",{group_assignment_id:e,group_id:s});(0,oc.flushSync)(()=>{this.setState({assignment:i})})}catch({err:err}){this.setState({error:err})}}
2,this.fetchAssignmentComponent=async()=>{var e,s,a;try{const{assignment:t,group_id:i}=this.state;let l;if("journey"===(null===t||void 0===t?void 0:t.type))l=null===this||void 0===this||null===(e=this.state)||void 0===e?void 0:e.group_assignment_component_id;else l=null===t||void 0===t||null===(s=t.group_assignment_components)||void 0===s||null===(a=s[0])||void 0===a?void 0:a.id;if(!l)return;const{app:n}=this.props,r=n.api,{assignment_component:o}=await r.get("/api/assignments/component/get",{group_assignment_component_id:l,group_id:i});(0,oc.flushSync)(()=>{this.setState({assignment_component:o})})}catch({err:err}){this.setState({error:err})}},this.fetchAssignmentData=async()=>{this.setState({loading:!0}),await this.fetchGroup(),await this.fetchAssignment(),await this.fetchAssignmentComponent(),await this.fetchAssignmentTeams();const e=this.getDashboardType();switch(e){case"challenge":case"single_challenge":await this.fetchAssignmentComponentChallenges();break;case"cartridge":case"single_cartridge":await this.fetchAssignmentComponentCartridges()}this.setDefaultActiveTabKey(),this.setState({current_dashboard:e,loading:!1})},this.fetchGroup=async()=>{try{const{app:e}=this.props,{group_id:s}=this.props.match.params,a=e.api;this.setState({error:null,group:null,group_tree:null});const{group:t,tree:i}=await a.get("/api/groups/get",{group_id:s});(0,oc.flushSync)(()=>{this.setState({group:t,group_tree:i})})}catch({err:err}){this.setState({error:err})}},this.fetchAssignmentComponentChallenges=async()=>{try{const{assignment_component:e}=this.state,{app:s}=this.props,a=s.api;this.setState({challenges:[],challenges_count:0,error:null});const{challenges:t,count:i}=await a.get(`/api/challenges/group-assignment-component/existing/${null===e||void 0===e?void 0:e.id}`);this.setState({challenges:t,challenges_count:i})}catch({err:err}){this.setState({error:err})}},this.fetchAssignmentComponentCartridges=async()=>{try{const{assignment_component:e}=this.state,{app:s}=this.props,a=s.api;this.setState({cartridges:[],cartridges_count:0,error:null});const{cartridges:t,count:i}=await a.get(`/api/cartridges/group-assignment-component/existing/${null===e||void 0===e?void 0:e.id}`);this.setState({cartridges:t,cartridges_count:i})}catch({err:err}){this.setState({error:err})}},this.changeTeamPassword=async(e,s)=>{try{const{app:a,intl:t}=this.props,{formatMessage:i}=t,{api:l}=a;await l.post("/api/teams/password/change/",{new_password:s,team_id:e}),this.setState({success:i({id:"label.password_updated_successfully.eb737b99",defaultMessage:"Password updated successfully"})})}catch({err:err}){this.setState({error:err})}},this.updateTeamName=async(e,s)=>{try{const{app:a,intl:t}=this.props,{formatMessage:i}=t,{api:l}=a;await l.post("/api/teams/save/",{team_id:e,team_name:s}),this.setState({success:i({id:"label.team_updated_successfully.6557b7f1",defaultMessage:"Team updated successfully"})})}catch({data:OT,err:err}){this.setState({error:err,validation_errors:(null===OT||void 0===OT?void 0:OT.errors)||[]})}},this.deleteTeam=async e=>{try{const{app:s,intl:a}=this.props,{formatMessage:t}=a,{api:i}=s;await i.post("/api/teams/delete/",{team_id:e}),this.setState({success:t({id:"label.team_deleted_successfully.ee0db216",defaultMessage:"Team deleted successfully"})})}catch({err:err}){this.setState({error:err})}},this.setLoading=(e,s)=>this.setState({loading:e},s),this.clearError=()=>this.setState({error:null}),this.getRouteParams=()=>{var e,s;return(null===this||void 0===this||null===(e=this.props)||void 0===e||null===(s=e.match)||void 0===s?void 0:s.params)||{}},this.updateRouteParams=e=>{const s=this.getRouteParams(),a=(null===s||void 0===s?void 0:s.group_id)||null,t=(null===s||void 0===s?void 0:s.group_assignment_id)||null,i=(null===s||void 0===s?void 0:s.group_assignment_component_id)||null,l=(null===s||void 0===s?void 0:s.action)||null;console.log("updating..."),this.setState({action:l,group_assignment_component_id:i,group_assignment_id:t,group_id:a},async()=>e&&await this.fetchAssignmentData())},this.setAssignmentUpdated=e=>this.setState({assignment_updated:e}),this.getDashboardType=()=>{const{assignment:e,assignment_component:s}=this.state;return"journey"===(null===e||void 0===e?void 0:e.type)?(null===s||void 0===s?void 0:s.type)||"journey":`single_${null===e||void 0===e?void 0:e.type}`},this.calculateAverageChallengeProgress=()=>{const{challenges:e,teams:s,teams_count:a}=this.state;let t=0;if(a&&e){const a=14;let i=0;for(let s of e){const{num_subphases_complete:e}=s;i+=e}t=Math.round(i/(a*(null===s||void 0===s?void 0:s.length))*100)||0}return t},this.tallyChallengeProgress=()=>{const{challenges:e}=this.state;if(null===e||void 0===e||!e.length)return{completed:0,in_progress:0,not_started:0};let s=0,a=0,t=0;for(const i of e){const{created_at:e,is_complete:l,updated_at:n}=i;l?s++:n&&n!==e?a++:t++}return{completed:s,in_progress:a,not_started:t}},this.calculateAverageCartridgeProgress=()=>{const{cartridges:e}=this.state;return Math.min(Math.round(e.reduce((e,s)=>e+(null===s||void 0===s?void 0:s.completion_pct),0)/e.length),100)||0},this.tallyCartridgeProgress=()=>{const{cartridges:e}=this.state;if(null===e||void 0===e||!e.length)return{completed:0,in_progress:0,not_started:0};let s=0,a=0,t=0;for(let i of e){const{completed:e,created_at:l,updated_at:n}=i;e&&(s+=1),n&&n!==l&&!e&&(a+=1),n&&n!==l||(t+=1)}return{completed:s,in_progress:a,not_started:t}},this.getTeamChallenge=e=>{var s;const{challenges:a}=this.state;return(null===a||void 0===a||null===(s=a.find)||void 0===s?void 0:s.call(a,s=>(null===s||void 0===s?void 0:s.team_id)===e))||null},this.getTeamCartridge=e=>{var s;const{cartridges:a}=this.state;return(null===a||void 0===a||null===(s=a.find)||void 0===s?void 0:s.call(a,s=>{let{group_member_assignment_component:a}=s,{group_member_assignment:t}=a;return(null===t||void 0===t?void 0:t.team_id)==e}))||null},this.setDefaultActiveTabKey=()=>{const e=window.location.hash.substring(1)||"home";this.setActiveTab(e)},this.setActiveTab=e=>{var s;e!==(null===this||void 0===this||null===(s=this.state)||void 0===s?void 0:s.active_key)&&this._isMounted&&this.setState({active_key:e})},this.getComponentTitle=()=>{var e;const{intl:s}=this.props,{formatMessage:a}=s,{assignment_component:t}=this.state;return(null===t||void 0===t||null===(e=t[`${null===t||void 0===t?void 0:t.type}_template`])||void 0===e?void 0:e.title)||a({id:"label.module.f148224a",defaultMessage:"Module"})},this.launchResponseHistory=e=>{var s;const a=null===(s=this.response_history_modal)||void 0===s?void 0:s.current;a&&a.show(e)},this.handleLaunchFacilitation=async(e,s,a)=>{try{const{app:t}=this.props,i=t.api,l=null===e||void 0===e?void 0:e.id,n=null===s||void 0===s?void 0:s.group_member_assignment_id,r=null===s||void 0===s?void 0:s.id;if(!l||!r||!n)return;await i.post("/api/teams/members/facilitator/add",{team_id:l});let o=`/assignment/${n}/${r}/content`;a&&(o+=`?cartridge_history_id=${a}`),await window.open(o)}catch({err:err}){this.setState({error:err})}},this.state={action:(null===e||void 0===e||null===(s=e.match)||void 0===s||null===(a=s.params)||void 0===a?void 0:a.action)||null,active_key:"home",assignment:null,assignment_component:null,assignment_updated:!1,cartridges:[],challenges:[],current_dashboard:null,error:null,facilitation_requests:[],group:null,group_assignment_component_id:(null===e||void 0===e||null===(t=e.match)||void 0===t||null===(i=t.params)||void 0===i?void 0:i.group_assignment_component_id)||null,group_assignment_id:(null===e||void 0===e||null===(n=e.match)||void 0===n||null===(r=n.params)||void 0===r?void 0:r.group_assignment_id)||null,group_id:(null===e||void 0===e||null===(o=e.match)||void 0===o||null===(d=o.params)||void 0===d?void 0:d.group_id)||null,group_tree:null,loading:!0,loading_teams:!1,teams:null,teams_count:0},this.response_history_modal=(0,l.createRef)()}
2componentDidMount(){this._isMounted=!0,this.updateRouteParams(!0),window.addEventListener("hashchange",()=>this.setDefaultActiveTabKey,!1),this.setDefaultActiveTabKey()}componentWillUnmount(){this._isMounted=!1}componentDidUpdate(e,s,a){const t=e.match.params,i=this.getRouteParams(),l=!(0,T.isEqual)(null===t||void 0===t?void 0:t.group_assignment_id,null===i||void 0===i?void 0:i.group_assignment_id),n=!(0,T.isEqual)(null===t||void 0===t?void 0:t.group_assignment_component_id,null===i||void 0===i?void 0:i.group_assignment_component_id);(0,T.isEqual)(t,i)||(n&&this.setState({assignment_component:null}),this.updateRouteParams(l||n))}render(){const{app:e}=this.props,{userHasRight:s}=e,{active_key:a,assignment:t,assignment_component:i,assignment_updated:l,challenges:n,current_dashboard:r,error:o,group:d,group_id:c,group_tree:h,loading:u,teams:m,teams_count:g}=this.state,p=null===d||void 0===d?void 0:d.organization_id;return(0,N.jsx)(yT,{children:(0,N.jsxs)(OP,{value:{active_key:a,assignment:t,assignment_component:i,assignment_component_id:null===i||void 0===i?void 0:i.id,assignment_component_type:null===i||void 0===i?void 0:i.type,assignment_id:null===t||void 0===t?void 0:t.id,assignment_type:null===t||void 0===t?void 0:t.type,assignment_updated:l,calculateAverageCartridgeProgress:this.calculateAverageCartridgeProgress,calculateAverageChallengeProgress:this.calculateAverageChallengeProgress,challenges:n,changeTeamPassword:this.changeTeamPassword,current_dashboard:r,deleteTeam:this.deleteTeam,fetchAssignment:async()=>{this.setState({loading:!0}),await this.fetchAssignment(),this.setState({loading:!1})},getTeamCartridge:this.getTeamCartridge,getTeamChallenge:this.getTeamChallenge,group:d,group_id:c,group_tree:h,handleLaunchFacilitation:this.handleLaunchFacilitation,launchResponseHistory:this.launchResponseHistory,refreshAssignment:async()=>{await this.fetchAssignment()},setActiveTab:this.setActiveTab,setAssignmentUpdated:this.setAssignmentUpdated,tallyCartridgeProgress:this.tallyCartridgeProgress,tallyChallengeProgress:this.tallyChallengeProgress,teams:m,teams_count:g,updateRouteParams:this.updateRouteParams,updateTeamName:this.updateTeamName},children:[(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsx)(Me.x_,{loading:u||!r,children:p&&s("manage_assignment",p)?(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsx)(rL,{}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-between",children:(0,N.jsx)("h3",{children:(()=>"journey"===(null===t||void 0===t?void 0:t.type)?"journey"===r?null===t||void 0===t?void 0:t.title:this.getComponentTitle():null===t||void 0===t?void 0:t.title)()})})]})}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:o,variant:"danger",children:o}),(0,N.jsx)(QO,{})]})})]})})}):(0,N.jsx)(Pe.rd,{to:"/admin"})})}),(0,N.jsx)(XP,{ref:this.response_history_modal})]})})}}var aL=(0,Ke.Ay)((0,P.G0)(_T(sL)));class tL extends l.Component{constructor(e){super(e),this.state={hidden_team_series_ids:[],show_all:!0}}render(){const{app:e,data:s,height:a,teams:t,width:i}=this.props,{hidden_team_series_ids:n}=this.state;if(!t)return(0,N.jsx)(Ce.S,{children:"N/A"});const{styles:r}=e,o=[r&&r["report-blue"],"#D6A4FF",r&&r["gray-400"],"#FFD400",r&&r.brand_orange,r&&r.brand_teal,r&&r.brand_lime];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{height:a,margin:"auto",width:i},children:(0,N.jsx)(jt.u,{height:a,width:"100%",children:(0,N.jsxs)(Vw.b,{data:s,margin:{bottom:5,left:20,right:30,top:5},children:[(0,N.jsx)(bt.d,{stroke:"rgba(0,0,0,.12)",vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{axisLine:!1,tickLine:!1}),(0,N.jsx)(wt.m,{}),t&&t.map((e,s)=>{const{id:a,name:t}=e;return-1!==n.indexOf(a)?(0,N.jsx)(l.Fragment,{},a):(0,N.jsx)(Gw.N,{dataKey:t,stroke:o[s%7],type:"monotone"},a)})]})})}),(0,N.jsxs)(Ce.S,{className:"vertical-scroll mt-3",children:[(0,N.jsx)("div",{className:"breakdown-dataset-container",children:(0,N.jsx)("h6",{className:"visually-hidden font-weight-bold",children:"Breakdown by Teams"})}),t&&t.map((e,s)=>{const{id:a,name:t}=e,i=-1!==n.indexOf(a);return(0,N.jsxs)(ve.A,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variant:"link",onClick:e=>{e.preventDefault(),this.setState(e=>{const s=e.hidden_team_series_ids.indexOf(a);return-1===s?e.hidden_team_series_ids.push(a):e.hidden_team_series_ids.splice(s,1),e})},children:[i?(0,N.jsx)(ze.EaG,{style:{color:o[s%7],marginRight:7.5}}):(0,N.jsx)(ze.A7C,{style:{color:o[s%7],marginRight:7.5}}),t&&t.length<=10?(0,N.jsx)("span",{style:{verticalAlign:"middle"},children:t}):(0,N.jsx)("span",{style:{verticalAlign:"middle"},children:`${t&&t.substring(0,10)}...`})]},s)})]})]})}}tL.defaultProps={height:350,width:"100%"};var iL=tL;class lL extends l.Component{constructor(e){super(e),this._isMounted=!1;const s=ci()(new Date),a=s.clone().subtract(30,"days");this.state={asset_count:0,end_date:s.toDate().getTime(),is_component_of_journey:!1,most_uploaded:"Messages",past_range_agg:{},selected_data:[],selected_teams:[],start_date:a.toDate().getTime(),team_id:null,team_tmaps:null,tmap_range:"month",total_tmaps:null}}refreshAnyDayTMAP(){const{admin_assignment:e,app:s,match:a}=this.props,{api:t}=s,{assignment:i,assignment_id:l}=e;let{end_date:n,start_date:r}=this.state;r=ci()(r).toISOString(),n=ci()(n).toISOString(),t.get(`/api/facilitators/groups/assignment/teams/tmap/count-any-date/${l}/${r}/${n}`,{group_assignment_components_ids:i.group_assignment_components.map(e=>e.id)}).then(e=>{var s,t;let{teams:i,total:l}=e;this.setState({is_component_of_journey:null!==(null!==(s=null===(t=a.params)||void 0===t?void 0:t.assignment_component_id)&&void 0!==s?s:null),team_tmaps:i,total_tmaps:l},()=>this.formatAnyData())}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}formatAnyData(){var e,s;const{admin_assignment:a}=this.props,{teams:t}=a,{end_date:i,start_date:l,team_tmaps:n}=this.state,{convertSeconds:r}=null!==(e=null===Re._$||void 0===Re._$?void 0:Re._$.time)&&void 0!==e?e:{},o=ci()(l),d=ci()(i).diff(o,"days"),c=[];for(let g=0;g<d;g++){const e={};for(const s in n){const a=n[s]||[],i=t.find(e=>e.id==s);if(!i)continue;const l=a[g];e[i.name]=Math.round(l/3600*100)/100||0}e.name=ci()(i).endOf("day").subtract(d,"days").add(g+1,"days").endOf("day").format("MMMM Do"),c.push(e)}let h=null,u=0,m=0;for(const g in n){const e=n[g]||[],s=t.find(e=>e.id==g),a=e.reduce((e,s)=>e+s,0);a>u&&(u=a,h=s),m+=a}this.setState({days_number:d,most_active_team:null===(s=h)||void 0===s?void 0:s.name,past_range_agg:r(m),selected_data:c})}componentDidMount(){const{admin_assignment:e}=this.props,{teams:s}=e;this._isMounted=!0,this.refreshAnyDayTMAP(),this.setState({selected_teams:s})}componentWillUnmount(){this._isMounted=!1}render(){var e,s;const{end_date:a,selected_data:t,selected_teams:i,start_date:l,tmap_range:n}=this.state,{admin_assignment:r,app:o}=this.props,{assignment:d}=r;ci()(new Date).clone().subtract(7,"days");let c="",h="";const u=(null===d||void 0===d||null===(e=d.type)||void 0===e||null===(s=e.toLowerCase)||void 0===s?void 0:s.call(e))||"";if(this.state.is_component_of_journey){var m;const[e]=d.group_assignment_components.filter(e=>e.id==this.props.match.params.assignment_component_id);null!==(m=null===e||void 0===e?void 0:e.type)&&void 0!==m&&m&&(c=(0,N.jsx)(ke.A,{defaultMessage:"Teams time on Challenge",description:"",id:"label.teams_time_on_challenge.27ba5ed1"}),h=(0,N.jsx)(ke.A,{defaultMessage:"Time spent in challenge by ascending date",description:"",id:"label.time_spent_in_challenge_by_ascendi.a3eb4f45"}))}else"journey"===u?(c=(0,N.jsx)(ke.A,{defaultMessage:"Teams time on Journey",description:"",id:"label.teams_time_on_journey.24e5084d"}),h=(0,N.jsx)(ke.A,{defaultMessage:"Time spent in journey by ascending date",description:"",id:"label.time_spent_in_journey_by_ascending.1cce8369"})):"challenge"===u&&(c=(0,N.jsx)(ke.A,{defaultMessage:"Teams time on Challenge",description:"",id:"label.teams_time_on_challenge.27ba5ed1"}),h=(0,N.jsx)(ke.A,{defaultMessage:"Time spent in challenge by ascending date",description:"",id:"label.time_spent_in_challenge_by_ascendi.a3eb4f45"}));return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"time-on-platform-outer-container",children:[(0,N.jsx)(Ce.S,{className:"time-on-platform-inner-container",children:(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)(Ce.S,{className:"filters-container",children:(0,N.jsxs)(Ce.S,{className:"filters-container",children:[(0,N.jsxs)(Ce.S,{className:"me-auto mb-0",children:[(0,N.jsx)("h4",{children:c}),(0,N.jsx)("p",{children:h})]}),(0,N.jsxs)(ve.A,{className:"float-end",variant:"secondary",onClick:()=>{this.picker&&this.picker.show({end_date:a,selected_range:n,start_date:l})},children:[ci()(l).format("MMM DD, YYYY")," - ",ci()(a).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,start_date:t,tmap_range:a}),this.refreshAnyDayTMAP()}})]})})})}),(0,N.jsx)(iL,{app:o,data:t,teams:i}
2)]})})}}lL.defaultProps={teams:[{name:"Team Awesome"}]};var nL=(0,Ke.Ay)((0,Pe.y)((0,n.G0)(_T(UP(lL)))));var rL=e=>{const{userHasOrgRole:s,userIsSiteAdmin:a}=(0,P.nm)(),{assignment:t,current_dashboard:i,group:l,group_tree:n}=QP(),r=null===l||void 0===l?void 0:l.organization_id,o=["challenge"].includes(i);return(0,N.jsx)(vF.A,{children:(0,N.jsxs)(N.Fragment,{children:[a()&&(0,N.jsx)(pa.mu,{to:"/admin",children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.f35,{className:"me-1",size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Site",id:"label.site.fa795581"})]})}),!a()&&(s("facilitator",r)||s("moderator",r))&&(0,N.jsx)(pa.mu,{to:"/home",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"My dashboard",id:"label.my_dashboard.f4c56c94"})})}),(0,N.jsx)(N.Fragment,{children:n&&n.map(e=>(0,N.jsx)(pa.mu,{to:`/admin/organization/${null===e||void 0===e?void 0:e.id}`,children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.ymh,{className:"me-1",size:12}),null===e||void 0===e?void 0:e.name]},null===e||void 0===e?void 0:e.id)},null===e||void 0===e?void 0:e.id))}),(0,N.jsx)(pa.mu,{to:`/admin/group/${null===l||void 0===l?void 0:l.id}`,children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.aQJ,{className:"me-1",size:12}),null===l||void 0===l?void 0:l.name]})}),o?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(pa.mu,{to:`/admin/group/${null===l||void 0===l?void 0:l.id}/assignment/${null===t||void 0===t?void 0:t.id}`,children:(0,N.jsxs)(vF.A.Item,{children:[(0,N.jsx)(ze.kkc,{className:"me-1",size:12}),null===t||void 0===t?void 0:t.title]})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Module",id:"label.module.f148224a"})})]}):(0,N.jsxs)(vF.A.Item,{active:!0,children:[(0,N.jsx)(ze.kkc,{className:"me-1",size:12}),(null===t||void 0===t?void 0:t.title)||(0,N.jsx)(ke.A,{defaultMessage:"Assignment",id:"label.assignment.153cdaae"})]})]})})};const oL=(0,l.forwardRef)((e,s)=>{const{onAdd:a,onHide:t}=e,[i,n,r]=(0,ne.CQ)({assigning:!1,count:0,error:null,loading:!1,members:[],page:1,page_size:20,search_term:"",show:!1,success:!1}),o=(0,l.useRef)(),{api:d}=(0,P.nm)(),{assignment:c,group:h}=QP(),u=async e=>{n({show:!0}),await g()},m=()=>{r(),"function"===typeof t&&t()},g=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];try{var s,a;const{search_term:t}=i;e||n({loading:!0,members:null});let{count:l,members:r}=await d.get(`/api/assignments/members/unassigned/list/${_}/${b}`,{group_assignment_id:null===c||void 0===c?void 0:c.id,group_id:null===h||void 0===h?void 0:h.id,search_term:t});r=(null===(s=r)||void 0===s||null===(a=s.filter)||void 0===a?void 0:a.call(s,e=>{var s;return!(null!==e&&void 0!==e&&null!==(s=e.organization_member)&&void 0!==s&&s.role_id)}))||[],n({count:l,loading:!1,members:r})}catch({err:err}){n({error:err,loading:!1})}};(0,l.useImperativeHandle)(s,()=>({hide:m,show:u})),(0,l.useEffect)(()=>r,[]);const{assigning:p,count:x,error:v,loading:f,members:j,page:_,page_size:b,search_term:A,show:y,success:w}=i;return(0,N.jsx)(mL,{value:{assignUser:async e=>{try{n({assigning:!0,error:null}),await d.post("/api/assignments/members/add",{group_assignment_id:null===c||void 0===c?void 0:c.id,group_id:null===h||void 0===h?void 0:h.id,group_member_id:e}),"function"===typeof a&&a(),await g(!0),n({assigning:!1,success:!0})}catch({err:err}){n({assigning:!1,error:err,success:!1})}},loading:f,members:j},children:(0,N.jsxs)(xe,{onHide:m,show:y,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Assign learners",id:"label.assign_learners.dfa8e460"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:v,variant:"danger",children:v}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({success:!1}),show:w,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Successfully assigned user",id:"label.successfully_assigned_user.7404d545"})}),(0,N.jsxs)(Ei.A,{className:"search-field",children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:e=>{n({search_term:e.target.value}),(e=>{null!==o&&void 0!==o&&o.current&&clearTimeout(null===o||void 0===o?void 0:o.current),o.current=setTimeout(()=>{n({page:1,search_term:e}),g()},1e3)})(e.target.value)},placeholder:"Search for user by name...",value:A})]}),(0,N.jsx)(cL,{loading:f,members:j}),(0,N.jsx)(Pr,{count:x,onChange:async e=>{n({page:e}),await g()},page:_,page_size:b})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{disabled:p,onClick:m,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})})});oL.displayName="AddMemberModal";var dL=oL;var cL=e=>{const{loading:s,members:a}=gL();return(0,N.jsxs)(qa.A,{hover:!0,responsive:!0,striped:!0,className:"table-rounded mt-3",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{width:30}}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Email",id:"label.email.969ccbd3"})}),(0,N.jsx)("th",{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)("tbody",{children:(0,N.jsx)(Me.x_,{loading:s,spinner:(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center",colSpan:"4",children:(0,N.jsx)(Me.y$,{})})})}),children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>(0,N.jsx)(hL,{member:e},s))}):(0,N.jsx)("tr",{children:(0,N.jsx)("td",{className:"text-center text-muted",colSpan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No learners found",id:"label.no_learners_found.4b76b226"})})})})})]})};var hL=e=>{const{member:s}
2=e;let{organization_member:a}=s,{user:t}=a;const{default_email:i,fullname:n}=t,r=(null===i||void 0===i?void 0:i.email_address)||"",{assignUser:o}=gL(),[d,c]=(0,l.useState)(!1);return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)(Ya,{size:25,user:t})}),(0,N.jsx)("td",{children:(0,N.jsx)(Fl,{maxWidth:250,placement:"bottom",children:n})}),(0,N.jsx)("td",{children:(0,N.jsx)(Fl,{maxWidth:250,placement:"bottom",children:r||"-"})}),(0,N.jsx)("td",{children:(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(Me.p0,{loading:d,onClick:async()=>{c(!0),await o(null===s||void 0===s?void 0:s.id),c(!1)},children:(0,N.jsx)(ke.A,{defaultMessage:"Assign",id:"label.assign.8ece895c"})})})})]},t.id)};const uL=l.createContext({}),mL=uL.Provider,gL=(uL.Consumer,()=>(0,l.useContext)(uL));class pL extends l.Component{constructor(e){super(e),this.fetchLearners=async()=>{try{const{admin_assignment:e,app:s}=this.props,{api:a}=s,{assignment_component_id:t,group_id:i}=e,{page:l,page_size:n,search_term:r,sort_direction:o,sort_token:d}=this.state;this.setState({loading:!0});const{count:c,members:h}=await a.get(`/api/challenges/members/list/${l}/${n}`,{group_assignment_component_id:t,group_id:i,search_term:r,sort_direction:o,sort_token:d});this.setState({count:c,loading:!1,members:h})}catch({err:err}){this.setState({error:err,loading:!1})}},this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.setSuccess=e=>this.setState({success:e}),this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},this.fetchLearners)},1e3)},this.format4CData=e=>{let s=[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}];return e&&(e.critical||e.critical_score)&&(s[0].score=e.critical||e.critical_score||0),e&&(e.communication||e.communication_score)&&(s[1].score=e.communication||e.communication_score||0),e&&(e.collaboration||e.collaboration_score)&&(s[2].score=e.collaboration||0),e&&(e.creativity||e.creativity_score)&&(s[3].score=e.creativity||0),s},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.fetchLearners),this.handleChangeSearchTerm=e=>{this.setState({search_term:e.target.value}),this.startSearch()},this.removeUserFromAssignment=async e=>{try{const{admin_assignment:s,app:a}=this.props,{api:t}=a,{assignment_id:i,group_id:l}=s;this.setState({loading:!0}),await t.post("/api/assignments/member/remove",{group_assignment_id:i,group_id:l,group_member_assignment_id:e}),await this.fetchLearners(),this.setState({loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleRemoveUser=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{formatMessage:i}=t;a.show({actions:[a.CancelAction(),a.Action({label:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"}),onClick:()=>this.removeUserFromAssignment(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:i({id:"label.are_you_sure_you_want_to_remove_th.bd44bd23",defaultMessage:"Are you sure you want to remove this user from the assignment?"}),size:"sm",title:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"})})},this.handleTransferMember=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.transfer_dialog)||void 0===a?void 0:a.current;t&&t.show({group_id:e,group_member_assignment_id:s})},this.muteTeamMember=async(e,s)=>{try{var a;const{admin_assignment:t,app:i}=this.props,{api:l}=i,n=null===t||void 0===t||null===(a=t.group)||void 0===a?void 0:a.organization_id,r=[e];this.setState({loading:!0}),await l.post("/api/teams/members/update_muted_status",{is_muted:s,organization_id:n,team_member_ids:r}),await this.fetchLearners(),this.setState({loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleMuteMember=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.dialog)||void 0===a?void 0:a.current;if(!t)return;const{intl:i}=this.props,{formatMessage:l}=i,n=s?"mute":"unmute";t.show({actions:[t.CancelAction(),t.Action({label:(0,T.capitalize)(n),onClick:()=>this.muteTeamMember(e,s),variant:"danger"})],body:l({id:"label.are_you_sure_you_want_to_mute_phra.01ebb2c8",defaultMessage:"Are you sure you want to {mute_phrase} this team member?"},{mute_phrase:n}
2),size:"sm",title:l({id:"label.mute_phrase_team_member.4546a7e5",defaultMessage:"{mute_phrase} Team Member"},{mute_phrase:(0,T.capitalize)(n)})})},this.launchAddMemberModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.add_member_modal)||void 0===e?void 0:e.current;s&&s.show()},this.handleTransferSuccess=()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.learner_successfully_transferred_t.d26b9772",defaultMessage:"Learner successfully transferred to new team"}))},this.state={count:0,error:null,loading:!1,members:[],page:1,page_size:32,search_term:"",sort_direction:"ASC",sort_token:"fullname",success:null},this.dialog=(0,l.createRef)(),this.add_member_modal=(0,l.createRef)(),this.transfer_dialog=(0,l.createRef)(),this.search_timer=null}async componentDidMount(){await this.fetchLearners()}render(){const{admin_assignment:e,app:s}=this.props,{group:a}=e,{count:t,error:i,loading:l,members:n,page:r,page_size:o,search_term:d,sort_direction:c,sort_token:h,success:u}=this.state;return(0,N.jsxs)(jL,{value:{format4CData:this.format4CData,handleMuteMember:this.handleMuteMember,handleRemoveUser:this.handleRemoveUser,handleSort:this.handleSort,handleTransferMember:this.handleTransferMember,loading:l,members:n,page:r,page_size:o,search_term:d,sort_direction:c,sort_token:h},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:i,variant:"danger",children:i}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:u,variant:"success",children:u}),(0,N.jsx)(_I,{count:t,label:"Learners",showCount:!0,headerRight:(0,N.jsxs)(Ce.S,{className:"mb-2 ms-auto d-flex align-items-center justify-content-end",children:[(0,N.jsxs)(Ei.A,{className:"me-2",size:"sm",style:{maxWidth:342},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{disabled:l,onChange:this.handleChangeSearchTerm,placeholder:"Search learners",readOnly:l,value:d||""})]}),s.userHasRight("manage_group",null===a||void 0===a?void 0:a.organization_id)&&(0,N.jsx)(ve.A,{onClick:this.launchAddMemberModal,style:{whiteSpace:"nowrap"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add learner",id:"label.add_learner.efc76f3d"})})]}),children:(0,N.jsxs)(Ce.S,{className:"teams-container",children:[(0,N.jsx)(vL,{}),(0,N.jsx)(Lr,{count:t,onChange:e=>this.setState({page:e},this.fetchLearners),page:r,page_size:o})]})}),(0,N.jsx)(dL,{onAdd:this.fetchLearners,ref:this.add_member_modal}),(0,N.jsx)(GP,{onHide:this.fetchLearners,onSuccess:this.handleTransferSuccess,ref:this.transfer_dialog}),(0,N.jsx)(je,{ref:this.dialog})]})}}var xL=(0,n.G0)((0,Ke.Ay)(_T(UP(pL))));var vL=e=>{const{handleSort:s,loading:a,members:t,sort_direction:i,sort_token:l}=_L(),{assignment:n}=QP(),{allow_teams:r}=n;return(0,N.jsxs)(ho,{defaultSortDirection:i,defaultSortToken:l,onSort:s,striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),r&&(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"team_name",children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})}),(0,N.jsx)(ho.Th,{name:"progress",style:{minWidth:120},children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(ho.Th,{children:n.enable_grading?(0,N.jsx)(ke.A,{defaultMessage:"Results",id:"label.results.219c4a6c"}):(0,N.jsx)(ke.A,{defaultMessage:"4C Avg",id:"label.4c_avg.7a552cdb"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"engagements",style:{minWidth:145},children:(0,N.jsx)(ke.A,{defaultMessage:"Engagement",id:"label.engagement.ea68771a"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:r?7:6,loading:a,children:null!==t&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:t.map((e,s)=>(0,N.jsx)(NL,{gmac:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:r?7:6,children:(0,N.jsx)(ke.A,{defaultMessage:"No users found",id:"label.no_users_found.bf1e104f"})})})})]})};const fL=l.createContext({}),jL=fL.Provider,_L=(fL.Consumer,()=>(0,l.useContext)(fL)),bL=e=>{let{active:s,label:a,payload:t}=e;const i=t&&t[0]&&t[0].value?t[0].value:"";return s?(0,N.jsx)("div",{className:"bar-has-bg-tooltip",children:(0,N.jsx)("p",{className:"label m-0",children:`${AL(a)}: ${i}`})}):null},AL=e=>{switch(e){case"1C":return"Critical Thinking";case"2C":return"Communication";case"3C":return"Collaboration";case"4C":return"Creativity"}};class yL extends l.Component{render(){const{app:e,bars:s,data:a,legend:t,tooltip:i,y_axis_domain:l}=this.props,{styles:n}=e,r=n&&n.primary,o=n&&n["gray-200"];return(0,N.jsx)("div",{className:"bar-chart-has-bg",children:(0,N.jsxs)(_t.E,{data:a,height:90,width:80,children:[(0,N.jsx)(At.W,{dataKey:"name",interval:0}),(0,N.jsx)(yt.h,{domain:l,interval:1,width:10}),i&&(0,N.jsx)(wt.m,{allowEscapeViewBox:{x:!0,y:!0},content:(0,N.jsx)(bL,{})}),t&&(0,N.jsx)(Nt.s,{}),s&&s.map(e=>{let{background:s,dataKey:a,fill:t}=e;return t=t||r,s=s||{fill:o},(0,N.jsx)(St.y,{background:s,barSize:8,dataKey:a,fill:t},a)})]})})}}yL.defaultProps={bars:[{dataKey:"score"}],chart_height:300,chart_width:500,data:[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}],legend:!1,responsive_height:"100%",responsive_width:"100%",tooltip:!0,y_axis_domain:[0,4]};var wL=(0,n.G0)(yL);var NL=e=>{const{userHasRight:s}=(0,P.nm)(),{assignment:a,assignment_component:t,group:i,handleLaunchFacilitation:l}=QP(),{allow_teams:n}=a,{format4CData:r,handleMuteMember:o,handleRemoveUser:d,handleTransferMember:c}=_L(),{gmac:h}=e,{challenge_member:u,group_member_assignment:m}=h||{},{challenge:g,files_count:p,four_c_score:x,four_c_score_average:v,message_count:f,score:j,start:_,team_member:b}=u||{},{num_phases_complete:A}=g||{},{team:y}=b||{},{group_member:w}=m||{},{organization_member:S}=w||{},{user:C}=S||{},M=r(x),k=!(null===w||void 0===w||!w.archived_at),z=!(null===a||void 0===a||!a.enable_grading),T=z?!(!g||!g.is_graded):null!=v,I=z?j:v,{convertSeconds:E}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},F=(null===g||void 0===g?void 0:g.completion_pct)||0,R=E(null===u||void 0===u?void 0:u.total_time_seconds);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ya,{user:C}),(0,N.jsxs)(Ce.S,{className:"ms-3 d-flex",children:[(0,N.jsx)("span",{children:(0,N.jsx)(qA,{user:C})}),k&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bo.A,{bg:"secondary",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})})})]})]})}),n&&(0,N.jsx)(N.Fragment,{children:y?(0,N.jsx)(ro,{className:"team-column",children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===i||void 0===i?void 0:i.id}/assignment/${null===a||void 0===a?void 0:a.id}/challenge/${null===t||void 0===t?void 0:t.id}/view/${null===g||void 0===g?void 0:g.id}`,children:null===y||void 0===y?void 0:y.name})}):(0,N.jsx)(ro,{className:"no-team-column",children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"No team",id:"label.no_team.e3924f28"})})})}),(0,N.jsx)(ro,{children:b?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"mb-1 progress-container "+(5===A?"completed":""),children:(0,N.jsx)(Sa.A,{label:`${F}%`,now:F,style:{height:16}})}),(0,N.jsxs)(Ce.S,{children:[!_&&(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"me-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Not started",id:"label.not_started.ba35f0c4"})}),_&&A>=1&&A<5&&(0,N.jsx)(bo.A,{pill:!0,bg:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"In progress",id:"label.in_progress.c1f88e9d"})}),_&&5===A&&(!!j||!(null!==a&&void 0!==a&&a.enable_grading))&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})}),_&&5===A&&!j&&(null===a||void 0===a?void 0:a.enable_grading)&&(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)("span",{className:"text-capitalize",children:(0,N.jsx)(ke.A,{defaultMessage:"Awaiting scoring",id:"label.awaiting_scoring.ff236bdb"})})})]})]}):(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bo.A,{pill:!0,bg:"danger",children:(0,N.jsx)(ke.A,{defaultMessage:"No team",id:"label.no_team.e3924f28"})})})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Ce.S,{className:"two__graphics",style:{display:"flex",flexDirection:"row"},children:T?(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{className:"text-center me-3",children:(0,N.jsx)(Ce.S,{className:"facilitator-dashboard-four-c-bar-chart",children:(0,N.jsx)(wL,{data:M})})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Dt,{barSize:5,fontSize:12,height:45,value:
2I,width:45})}),(0,N.jsx)("p",{className:"mb-0"+(z?"":" text-center small text-secondary"),children:z?(0,N.jsx)(ke.A,{defaultMessage:"Score",id:"label.score.38e5a46c"}):(0,N.jsx)(ke.A,{defaultMessage:"4C Avg",id:"label.4c_avg.7a552cdb"})})]})]}):(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ce.S,{className:"text-center me-3",children:(0,N.jsx)(Ce.S,{className:"facilitator-dashboard-four-c-bar-chart empty",children:(0,N.jsx)(wL,{tooltip:!1,bars:[{background:{fill:"rgba(53,53,53,.38)"},dataKey:"score",fill:"rgba(53,53,53,.38)"}]})})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ce.S,{className:"mb-4",style:{opacity:.38},children:(0,N.jsx)(Dt,{barSize:5,bgColor:"rgba(53,53,53,.38)",color:"rgba(53,53,53,.38)",fontSize:12,height:45,width:45})})})]})})}),(0,N.jsxs)(ro,{children:[(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.w_X,{className:"me-1",size:14}),null!==R&&void 0!==R&&R.value?`${R.value} ${R.label}`:"-"]}),(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.g5D,{className:"me-1",size:14}),f||"-"]}),(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.M1W,{className:"me-1",size:14}),p||"-"]})]}),(0,N.jsx)(ro,{className:"text-end",children:s("manage_team",null===i||void 0===i?void 0:i.organization_id)&&(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[y&&!n&&(0,N.jsxs)(ve.A,{onClick:async()=>await l(y,h),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.$hd,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Facilitate",id:"label.facilitate.b7fbd970"})]}),(0,N.jsxs)(ve.A,{onClick:()=>d(m),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.Dby,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",description:"",id:"label.remove.c3812fc4"})]}),n&&(0,N.jsxs)(ve.A,{onClick:()=>c(null===i||void 0===i?void 0:i.id,null===m||void 0===m?void 0:m.id),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.yk7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Transfer",id:"label.transfer.dde8bef7"})]}),b&&(0,N.jsx)(ve.A,{onClick:()=>o(null===b||void 0===b?void 0:b.id,!(null!==b&&void 0!==b&&b.is_muted)),size:"sm",variant:"outline-warning",children:null!==b&&void 0!==b&&b.is_muted?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.j1Q,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Unmute",id:"label.unmute.ce4ee4ef"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.gq7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Mute",id:"label.mute.8dd6857b"})]})})]})})]})};const SL=(0,N.jsx)(ke.A,{defaultMessage:"If enabled, meeting options will be displayed to the learner in the chat panel.",description:"",id:"label.if_enabled_meeting_options_will_be.b6d51c55"}),CL=(0,N.jsx)(ke.A,{defaultMessage:"Note that changes to this field will not be reflected on the modules.",description:"",id:"label.note_that_changes_to_this_field_wi.1030a8af"}),ML=(0,N.jsx)(ke.A,{defaultMessage:"Start date controls when the module can be started by the learner. If no start date is provided, the module can be started upon becoming visible",id:"label.start_date_controls_when_the_modul.5ee02233"}),kL=(0,N.jsx)(ke.A,{defaultMessage:"Due date controls when the module is due. Learners can still complete the module beyond this date but will be marked as late",id:"label.due_date_controls_when_the_module.f16ffac5"});ke.A;var zL=e=>{const s=(0,l.useRef)(),a=(0,l.useRef)(),t=(0,l.useRef)(),{formatMessage:i}=(0,ja.A)(),{api:r,locale:o,orgHasNotification:d}=(0,n.nm)(),{assignment:c,assignment_id:h,assignment_updated:u,group:m,group_id:g,refreshAssignment:p,setAssignmentUpdated:x}=QP(),[v,f,j]=(0,ne.CQ)({active_key:"general",clear_due:!1,clear_start:!1,due_date_changed:!1,error:null,loading:!1,module_updated:!1,notify_users:!1});(0,l.useEffect)(()=>j,[]);const _=()=>f({error:null}),b=()=>x(!1),A=e=>f({module_updated:e}),y=e=>f({notify_users:e}),w=e=>f({due_date_changed:e}),S=async e=>{try{const{allow_late_completion:s,assign_to_new:a,can_learners_create_teams:t,due:i,enable_voice_chat:l,start:n,title:o}=e||{},{notify_users:d}=v;f({error:null,loading:!0}),await r.post("/api/assignments/update",{allow_late_completion:s,assign_to_new:a,assignment_id:h,can_learners_create_teams:t,due:i,enable_voice_chat:l,group_id:g,notify_users:d,start:n,title:o}),f({loading:!1}),"function"===typeof p&&await p(),x(!0),w(!1)}catch({err:err}){f({error:err,loading:!1})}},{active_key:C,clear_due:M,clear_start:k,due_date_changed:z,error:T,loading:I,module_updated:E}=v,F="journey"===(null===c||void 0===c?void 0:c.type),R=null===c||void 0===c?void 0:c.allow_teams,D=e=>{var a,t,i,l;let n=null!==s&&void 0!==s&&null!==(a=s.current)&&void 0!==a&&null!==(t=a.values)&&void 0!==t&&t.due?ci()(null===s||void 0===s||null===(i=s.current)||void 0===i||null===(l=i.values)||void 0===l?void 0:l.due):null;return!(n&&!n.isAfter(e))},B=e=>{var a,t,i,l;let n=null!==s&&void 0!==s&&null!==(a=s.current)&&void 0!==a&&null!==(t=a.values)&&void 0!==t&&t.start?ci()(null===s||void 0===s||null===(i=s.current)||void 0===i||null===(l=i.values)||void 0===l?void 0:l.start):null;return!n||!n.isAfter(e)};return(0,N.jsxs)(BL,{value:{launchModuleSettings:(e,s)=>{const t=null===a||void 0===a?void 0:a.current;t&&t.show({assignment:e,component:s})},setModuleUpdated:A},children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ge.A,{className:"settings-tabs assignment-settings-tabs",children:(0,N.jsxs)(ld.A.Container,{activeKey:C,mountOnEnter:!0,children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>{f({active_key:"general"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"general",children:(0,N.jsx)(ke.A,{defaultMessage:"General",id:"label.general.c910d474"})})}),F&&(0,N.jsx)(aa.A.Item,{onClick:()=>{f({active_key:"modules"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"modules",children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",id:"label.modules.76c86c4c"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>{f({active_key:"scorm"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"scorm",children:(0,N.jsx)(ke.A,{defaultMessage:"SCORM",id:"label.scorm.a
274a0349"})})})]})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsxs)(ld.A.Pane,{eventKey:"general",children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment settings",id:"label.assignment_settings.61b86bce"})}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,validateOnBlur:!0,validateOnChange:!0,validationSchema:(0,Re.by)({locale:o,scope:"assignment.update_assignment"}),initialValues:{allow_late_completion:null!==c&&void 0!==c&&c.allow_late_completion?1:0,assign_to_new:null!==c&&void 0!==c&&c.assign_to_new?1:0,can_learners_create_teams:null!==c&&void 0!==c&&c.can_learners_create_teams?1:0,due:(null===c||void 0===c?void 0:c.due)||null,enable_voice_chat:null!==c&&void 0!==c&&c.enable_voice_chat?1:0,start:(null===c||void 0===c?void 0:c.start)||null,title:null===c||void 0===c?void 0:c.title},onSubmit:async e=>{await d(null===m||void 0===m?void 0:m.organization_id,"assignment_date_changed")&&z?(e=>{const s=null===t||void 0===t?void 0:t.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Yes, notify",onClick:async()=>{y(!0),S(e)},variant:"primary"}),s.Action({label:"No",onClick:async()=>{y(!1),S(e)},variant:"primary"})],body:i({id:"label.would_you_like_to_alert_learnersfa.a6d9f3ea",defaultMessage:"Would you like to alert learners/facilitators of due date changes?"}),size:"sm",title:i({id:"label.notify_users.4958de7f",defaultMessage:"Notify users"})})})(e):S(e)},children:e=>{s.current=e;const{errors:a,handleChange:t,handleSubmit:l,setFieldTouched:n,setFieldValue:r,touched:d,values:h}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:_,show:T,variant:"danger",children:T}),(0,N.jsx)(We.A,{dismissible:!0,onClose:b,show:u,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Assignment updated successfully",id:"label.assignment_updated_successfully.10430f1b"})}),(0,N.jsxs)(_e.A,{onSubmit:l,children:[(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Assignment name",id:"label.assignment_name.51447ee0"}),"\xa0",(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})})]}),(0,N.jsx)(_e.A.Control,{isInvalid:d.title&&a.title,isValid:d.title&&!a.title,name:"title",onChange:t,readOnly:I,type:"text",value:h.title,"aria-label":i({id:"label.name.82a3537f",defaultMessage:"name"}),placeholder:i({id:"label.assignment_1.b7aa4555",defaultMessage:"Assignment 1"})}),a.title&&d.title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-inline-flex flex-column me-3",children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"}),(0,N.jsx)("small",{className:"ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})}),F&&(0,N.jsx)("span",{className:"ms-1",children:(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:CL})})})]}),(0,N.jsxs)(Ei.A,{className:"d-flex flex-nowrap",children:[k?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(_c(),{disabled:I,initialValue:h.start,isInvalid:d.start&&a.start,isValid:d.start&&!a.start,isValidDate:D,locale:o,name:"start",value:h.start,inputProps:{placeholder:"No start date",style:{borderBottomRightRadius:0,borderTopRightRadius:0},value:h.start&&ci()(h.start).format("M/D/YYYY, h:mm a")},onChange:async e=>{await r("start",e),await n("start",!0)}}),(0,N.jsx)(ve.A,{disabled:I,size:"sm",variant:"secondary","aria-label":i({id:"label.clear_start_date.4adc9fa5",defaultMessage:"Clear start date"}),onClick:async()=>{f({clear_start:!0}),await r("start",null),f({clear_start:!1})},children:(0,N.jsx)(ze.QCr,{})})]}),a.start&&d.start&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-flex",type:"invalid",children:a.start})]}),(0,N.jsxs)(Ce.S,{className:"d-inline-flex flex-column",children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Due date",id:"label.due_date.e1cb6d30"}),(0,N.jsx)("small",{className:"ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})}),F&&(0,N.jsx)("span",{className:"ms-1",children:(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:CL})})})]}),(0,N.jsxs)(Ei.A,{className:"d-flex flex-nowrap",children:[M?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(_c(),{disabled:I,isInvalid:d.due&&a.due,isValid:d.due&&!a.due,isValidDate:B,locale:o,name:"due",value:h.due,inputProps:{placeholder:"No due date",style:{borderBottomRightRadius:0,borderTopRightRadius:0},value:h.due&&ci()(h.due).format("M/D/YYYY, h:mm a")},onChange:async e=>{await r("due",e),await n("due",!0),w(!0)}}),(0,N.jsx)(ve.A,{disabled:I,size:"sm",variant:"secondary","aria-label":i({id:"label.clear_due_date.72fb7ef3",defaultMessage:"Clear due date"}),onClick:async()=>{f({clear_due:!0}),await r("due",null),f({clear_due:!1}),w(!0)},children:(0,N.jsx)(ze.QCr,{})})]}),a.due&&d.due&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:a.due})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Allow learners to complete beyond due date?",id:"label.allow_learners_to_complete_beyond.89a4094c"})}),(0,N.jsxs)(_e.A.Select,{disabled:I,isInvalid:d.allow_late_completion&&a.allow_late_completion,isValid:d.allow_late_completion&&!a.allow_late_completion,name:"allow_late_completion",onChange:t,readOnly:I,style:{maxWidth:130},value:h.allow_late_completion,children:[(0,N.jsx)("option",{value:1,children:i({id:"label.yes.85a39ab3",defaultMessage:"Yes"})}),(0,N.jsx)("option",{value:0,children:i({id:"label.no.1ea442a1",defaultMessage:"No"})})]})]}),R&&(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Allow learners to form their own teams?",id:"label.allow_learners_to_form_their_own_t.afb88d12"})}),(0,N.jsxs)(_e.A.Select,{disabled:I,isInvalid:d.can_learners_create_teams&&a.can_learners_create_teams,isValid:d.can_learners_create_teams&&!a.can_learners_create_teams,name:"can_learners_create_teams",onChange:t,readOnly:I,style:{maxWidth:130},value:h.can_learners_create_teams,children:[(0,N.jsx)("option",{value:1,children:i({id:"label.yes.85a39ab3",defaultMessage:"Yes"})}),(0,N.jsx)("option",{value:0,children:i({id:"label.no.1ea442a1",defaultMessage:"No"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Auto-assign to new learners",id:"label.auto_assign_to_new_learners.32c03a7f"})}),(0,N.jsxs)(_e.A.Select,{disabled:v.loading,isInvalid:d.assign_to_new&&a.assign_to_new,isValid:d.assign_to_new&&!a.assign_to_new,name:"assign_to_new",onChange:t,readOnly:I,style:{maxWidth:130},value:h.assign_to_new,children:[(0,N.jsx)("option",{value:0,children:i({id:"label.disabled.75081b59",defaultMessage:"Disabled"})}),(0,N.jsx)("option",{value:1,children:i({id:"label.enabled.92c1cdfd",defaultMessage:"Enabled"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Enable voice chat",id:"label.enable_voice_chat.69f224b5"}),(0,N.jsx)("span",{className:"ms-1",children:(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:SL})})})]}),(0,N.jsxs)(_e.A.Select,{disabled:I,isInvalid:d.enable_voice_chat&&a.enable_voice_chat,isValid:d.enable_voice_chat&&!
2a.enable_voice_chat,name:"enable_voice_chat",onChange:t,readOnly:I,style:{maxWidth:130},value:h.enable_voice_chat,children:[(0,N.jsx)("option",{value:0,children:i({id:"label.disabled.75081b59",defaultMessage:"Disabled"})}),(0,N.jsx)("option",{value:1,children:i({id:"label.enabled.92c1cdfd",defaultMessage:"Enabled"})})]})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Grading",id:"label.grading.64dc41e1"})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)("span",{className:"badge "+(null!==c&&void 0!==c&&c.enable_grading?"bg-success":"bg-secondary"),children:null!==c&&void 0!==c&&c.enable_grading?(0,N.jsx)(ke.A,{defaultMessage:"Enabled",id:"label.enabled.92c1cdfd"}):(0,N.jsx)(ke.A,{defaultMessage:"Disabled",id:"label.disabled.75081b59"})})}),(0,N.jsx)("small",{className:"text-muted d-block mt-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Set when the assignment is created.",id:"label.set_when_the_assignment_is_created.94f99c6a"})})]}),(0,N.jsx)(Me.p0,{loading:I,onClick:l,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]}),"journey"===(null===c||void 0===c?void 0:c.type)&&(0,N.jsx)(ld.A.Pane,{eventKey:"modules",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",id:"label.modules.76c86c4c"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>A(!1),show:E,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Module updated successfully",id:"label.module_updated_successfully.b6206f56"})}),(0,N.jsx)(FL,{})]})}),(0,N.jsx)(ld.A.Pane,{eventKey:"scorm",children:(0,N.jsx)(XO,{})})]})})]})})}),(0,N.jsx)(IL,{onHide:()=>{p()},ref:a}),(0,N.jsx)(je,{ref:t})]})};const TL=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{setModuleUpdated:t}=PL(),[i,n,r]=(0,ne.CQ)({assignment:null,component:null,error:null,loading:!1,show:!1}),o=e=>n({assignment:null===e||void 0===e?void 0:e.assignment,component:null===e||void 0===e?void 0:e.component,show:!0}),d=()=>{r(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:d,show:o,visible:i.show})),(0,l.useEffect)(()=>r,[]);const{assignment:c,component:h}=i;return(0,N.jsxs)(xe,{onHide:d,show:i.show,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Module settings",id:"label.module_settings.f547b810"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(EL,{assignment:c,component:h,onUpdateSuccess:()=>{d(),"function"===typeof t&&t(!0)}})})]})});TL.displayName="ModuleSettingsModal";var IL=TL;var EL=e=>
2{const{assignment:s,component:a,onUpdateSuccess:t}=e,i=null===a||void 0===a?void 0:a.id,n=null===s||void 0===s?void 0:s.group_id,{api:r,common:o,locale:d}=(0,P.nm)(),{getValidator:c}=(null===o||void 0===o?void 0:o.validators)||{},[h,u,m]=(0,ne.CQ)({error:null,loading:!1,success:!1}),g=()=>u({error:null}),p=()=>u({success:!1});let x=s&&s.is_started;(0,l.useEffect)(()=>m,[]);const{error:v,loading:f,success:j}=h;return(0,N.jsx)(ds.l1,{enableReinitialize:!0,onSubmit:async e=>{let{allow_late_completion:s,due:a,start:l}=e;try{u({error:null,loading:!0,success:!1}),await r.post("/api/assignments/component/update",{allow_late_completion:s,due:a,group_assignment_component_id:i,group_id:n,start:l}),u({loading:!1,success:!0}),"function"===typeof t&&t()}catch({err:err}){u({error:err,loading:!1})}},validationSchema:c({locale:d,scope:"assignment.update_assignment_component"}),initialValues:{allow_late_completion:null!==a&&void 0!==a&&a.allow_late_completion?1:0,due:(null===a||void 0===a?void 0:a.due)||null,start:(null===a||void 0===a?void 0:a.start)||null},children:e=>{let{errors:a,handleChange:t,handleSubmit:i,setFieldTouched:l,setFieldValue:n,touched:r,values:o}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:g,show:v,variant:"danger",children:h.error}),(0,N.jsx)(We.A,{dismissible:!0,onClose:p,show:j,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Saved successfully",id:"label.saved_successfully.75de35db"})}),(0,N.jsx)(Me.x_,{loading:f,children:(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"}),(0,N.jsx)("span",{className:"ms-1",children:(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:ML})})})]}),(0,N.jsx)(_c(),{isInvalid:r.start&&a.start,isValid:r.start&&!a.start,name:"start",value:o.start,inputProps:{disabled:f||x,placeholder:"No start date",value:o.start&&ci()(o.start).format("M/D/YYYY, h:mm a")},isValidDate:e=>{let a=null!==s&&void 0!==s&&s.start?ci()(null===s||void 0===s?void 0:s.start):null,t=null!==s&&void 0!==s&&s.due?ci()(null===s||void 0===s?void 0:s.due):null,i=(null===o||void 0===o?void 0:o.due)||null;return!(a&&e<a)&&(!(t&&e>t)&&!(i&&e>=i))},onChange:async e=>{await n("start",e||null),await l("start",!0)},renderInput:(e,s,a)=>(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(ve.A,{onClick:s,variant:"primary",children:(0,N.jsx)(ze.itz,{})}),(0,N.jsx)(_e.A.Control,{readOnly:!0,value:o.start?ci()(o.start).format("M/D/YYYY, h:mm a"):"No start date"}),!!o.start&&(0,N.jsx)(ve.A,{onClick:()=>n("start",null),variant:"danger",children:(0,N.jsx)(ze.QCr,{})})]})}),a.start&&r.start&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:a.start})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Due date",id:"label.due_date.e1cb6d30"}),(0,N.jsx)("span",{className:"ms-1",children:(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:kL})})})]}),(0,N.jsx)(_c(),{isInvalid:r.due&&a.due,isValid:r.due&&!a.due,name:"due",value:o.due,inputProps:{disabled:f||x,placeholder:"No due date",value:o.due&&ci()(o.due).format("M/D/YYYY, h:mm a")},isValidDate:e=>{let a=null!==s&&void 0!==s&&s.start?ci()(null===s||void 0===s?void 0:s.start):null,t=null!==s&&void 0!==s&&s.due?ci()(null===s||void 0===s?void 0:s.due):null,i=(null===o||void 0===o?void 0:o.start)||null;return!(a&&e<a)&&(!(t&&e>t)&&!(i&&e<=i))},onChange:async e=>{await n("due",e||null),await l("due",!0)},renderInput:(e,s,a)=>(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(ve.A,{onClick:s,variant:"primary",children:(0,N.jsx)(ze.itz,{})}),(0,N.jsx)(_e.A.Control,{readOnly:!0,value:o.due?ci()(o.due).format("M/D/YYYY, h:mm a"):"No due date"}),!!o.due&&(0,N.jsx)(ve.A,{onClick:()=>n("due",null),variant:"danger",children:(0,N.jsx)(ze.QCr,{})})]})}),a.due&&r.due&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:a.due})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Allow learners to complete beyond due date?",id:"label.allow_learners_to_complete_beyond.89a4094c"})}),(0,N.jsxs)(_e.A.Select,{disabled:f,isInvalid:r.allow_late_completion&&a.allow_late_completion,isValid:r.allow_late_completion&&!a.allow_late_completion,name:"allow_late_completion",onChange:t,readOnly:f,style:{maxWidth:130},value:o.allow_late_completion,children:[(0,N.jsx)("option",{value:1,children:(0,N.jsx)(ke.A,{defaultMessage:"Yes",id:"label.yes.85a39ab3"})}),(0,N.jsx)("option",{value:0,children:(0,N.jsx)(ke.A,{defaultMessage:"No",id:"label.no.1ea442a1"})})]})]}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(ve.A,{type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})})]})})]})}})};var FL=e=>{const{assignment:s}=QP(),{group_assignment_components:a}=s||{},t=a&&a.find(e=>0==(null===e||void 0===e?void 0:e.order));return(0,N.jsxs)(ho,{className:"text-resize",striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Order",id:"label.order.6be09082"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Start date",id:"label.start_date.81696931"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Due date",id:"label.due_date.e1cb6d30"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:(0,T.sortBy)(a,e=>e.order).map((e,s)=>{const a=t?s+1:Number.parseInt(null===e||void 0===e?void 0:e.order);return(0,N.jsx)(RL,{component:e,order:a},s)})}):(0,N.jsx)(N.Fragment,{})})]})};var RL=e=>{const{component:s}=e,a=(null===s||void 0===s?void 0:s.challenge_template)||{},{assignment:t}=QP(),{launchModuleSettings:i}=PL();return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{style:{width:"2rem"},children:(null===e||void 0===e?void 0:e.order)||1}),(0,N.jsxs)(ro,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ad,{className:"me-2",component:a,size:32,type:null===s||void 0===s?void 0:s.type}),(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.title})]}),(0,N.jsx)(ro,{className:"text-capitalize",children:null===s||void 0===s?void 0:s.type}),(0,N.jsx)(ro,{children:null!==s&&void 0!==s&&s.start?(0,N.jsx)(Gh.XU,{value:s.start}):(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No start date",id:"label.no_start_date.e7a39256"})})}),(0,N.jsx)(ro,{children:null!==s&&void 0!==s&&s.due?(0,N.jsx)(Gh.XU,{value:s.due}):(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No due date",id:"label.no_due_date.6139ed04"})})}),(0,N.jsx)(ro,{className:"text-end",children:(0,N.jsx)(ve.A,{onClick:()=>{"function"===typeof i&&i(t,s)},size:"sm",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})})})]})};const DL=l.createContext({}),BL=DL.Provider,PL=(DL.Consumer,()=>(0,l.useContext)(DL));var LL=e=>{const{assignment:s,assignment_component:a}=QP();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Module settings",id:"label.module_settings.f547b810"})}),(0,N.jsx)(Ge.A,{body:!0,className:"admin-challenge-settings",children:(0,N.jsx)(EL,{assignment:s,component:a})})]})};
2function OL(e){let{completed:s,link:a,members:t,progress:i,score:l,team_name:n,users:r}=e;const o=t?t.map(e=>e&&Kd(e)):r,d=e=>a?(0,N.jsx)(Le.Link,{className:"font-weight-bold text-body",to:a,children:e.children}):(0,N.jsx)(N.Fragment,{children:e.children});return(0,N.jsx)(Ce.S,{className:"team-snapshot-card me-3",children:(0,N.jsx)(d,{children:(0,N.jsxs)(Ce.S,{className:"team-snapshot-inner-container",children:[(0,N.jsx)(Ce.S,{className:"mb-3 team-name-container",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:7,children:(0,N.jsx)("h5",{children:n&&n.length>=22?n.slice(0,22)+"...":n})}),(0,N.jsx)(Ve.A,{md:5,children:s&&null!=l&&(0,N.jsx)(bo.A,{pill:!0,bg:"light",style:{maxHeight:20},text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",description:"",id:"label.completed.22a970d2"})})})]})}),(0,N.jsx)(Ce.S,{className:"progress-container "+(s?"completed":""),children:(0,N.jsx)(Sa.A,{label:`${i}%`,now:i})}),(0,N.jsx)(Ce.S,{className:"members-score-points-container clearfix mt-3",children:(0,N.jsx)(tn,{users:o})})]})})})}OL.defaultProps={link:"",members:[],progress:100,score:null,team_name:"Team Awesome",users:[{id:85},{id:86},{id:87}]};var HL=(0,n.G0)(_T(OL));const UL=(0,N.jsxs)("svg",{height:"32",viewBox:"0 0 19.011 18.838",width:"32",xmlns:"http://www.w3.org/2000/svg",children:[(0,N.jsx)("defs",{children:(0,N.jsx)("style",{children:".cls-1,.cls-2,.cls-3{fill:none;stroke:#008087;stroke-miterlimit:10}.cls-1,.cls-2{stroke - linejoin:round}.cls-2{stroke - linecap:round}"})}),(0,N.jsxs)("g",{"data-name":"49-corner-flag",id:"_49-corner-flag",transform:"translate(-.326 -.5)",children:[(0,N.jsx)("path",{className:"cls-1",d:"M30 14.39V1h1.14v13.39","data-name":"Path 3463",id:"Path_3463",transform:"translate(-20.738)"}),(0,N.jsx)("path",{className:"cls-2",d:"M1 51.558L9.832 47l8.832 4.558","data-name":"Path 3464",id:"Path_3464",transform:"translate(0 -32.894)"}),(0,N.jsx)("path",{className:"cls-1",d:"M34 10.564h3.134l-1.425 1.425h5.128l-1.994-1.995L40.838 8h-2.849","data-name":"Path 3465",id:"Path_3465",transform:"translate(-23.598 -5.006)"}),(0,N.jsx)("path",{className:"cls-1",d:"M37.134 8.419V5H34","data-name":"Path 3466",id:"Path_3466",transform:"translate(-23.598 -2.86)"}),(0,N.jsx)("path",{className:"cls-1",d:"M0 1V0","data-name":"Line 1086",id:"Line_1086",transform:"translate(12 6.664)"}),(0,N.jsx)("path",{className:"cls-3",d:"M26.838 53c0 .787-1.531 1.425-3.419 1.425S20 53.787 20 53","data-name":"Path 3467",id:"Path_3467",transform:"translate(-13.587 -37.185)"})]})]}),QL=e=>{var s;return(0,N.jsx)(Qe.A,{as:Ge.A,className:"stats-strip-outer-container-alt p-3 g-0",children:(null===e||void 0===e||null===(s=e.stats)||void 0===s?void 0:s.length)&&e.stats.map((e,s)=>{let{icon:a,label:t,value:i}=e;return(0,N.jsxs)(Ve.A,{className:"stats-strip-col d-flex align-items-center",lg:3,md:6,sm:12,children:[a,(0,N.jsxs)(Ce.S,{className:"d-inline-flex flex-column ms-2",children:[(0,N.jsx)("h3",{className:"mb-0",children:i}),(0,N.jsx)("span",{children:t})]})]},s)})})};QL.defaultProps={stats:[{icon:UL,label:"Statistic 1",value:"36%"},{icon:UL,label:"Statistic 2",value:"2"},{icon:UL,label:"Statistic 3",value:"2/9"},{icon:UL,label:"Statistic 4",value:"1,000"}]};var VL=QL;class GL extends l.Component{constructor(e){super(e),this._isMounted=!1,this.refreshAnyDayTMAP=()=>{const{admin_assignment:e,app:s}=this.props,{api:a}=s,{assignment:t,assignment_id:i}=e;let{end_date:l,start_date:n}=this.state;n=ci()(n).toISOString(),l=ci()(l).toISOString(),a.get(`/api/facilitators/groups/assignment/teams/tmap/count-any-date/${i}/${n}/${l}`,{group_assignment_components_ids:t.group_assignment_components.map(e=>e.id)}).then(e=>{let{teams:s,total:a}=e;this.setState({team_tmaps:s,total_tmaps:a},this.formatAnyData)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.formatAnyData=()=>{var e;const{admin_assignment:s}=this.props,{teams:a}=s,{end_date:t,start_date:i,team_tmaps:l}=this.state,{convertSeconds:n}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},r=ci()(i),o=ci()(t).diff(r,"days"),d=[];for(let m=0;m<o;m++){const e={};for(const s in l){const t=l[s]||[],i=a.find(e=>e.id==s),n=t[m];null!==i&&void 0!==i&&i.name&&(e[i.name]=Math.round(n/3600*100)/100||0)}e.name=ci()(t).endOf("day").subtract(o,"days").add(m+1,"days").endOf("day").format("MMMM Do"),d.push(e)}let c=null,h=0,u=0;for(const m in l){const e=l[m]||[],s=a.find(e=>e.id==m),t=e.reduce((e,s)=>e+s,0);t>h&&(h=t,c=s),u+=t}this.setState({days_number:o,most_active_team:null===(e=c)||void 0===e?void 0:e.name,past_range_agg:n(u),selected_data:d})};const s=ci()(new Date),a=s.clone().subtract(30,"days");this.state={asset_count:0,end_date:s.toDate().getTime(),most_uploaded:"Messages",past_range_agg:{},selected_data:[],selected_teams:[],start_date:a.toDate().getTime(),team_id:null,team_tmaps:null,tmap_range:"month",total_tmaps:null}}componentDidMount(){const{admin_assignment:e}=this.props,{teams:s}=e;this._isMounted=!0,this.refreshAnyDayTMAP(),this.setState({selected_teams:s})}componentWillUnmount(){this._isMounted=!1}render(){const{days_number:e,end_date:s,most_active_team:a,past_range_agg:t,selected_data:i,selected_teams:l,start_date:n,tmap_range:r}=this.state,{app:o}=this.props;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"time-on-platform-outer-container",children:[(0,N.jsxs)(Ce.S,{className:"time-on-platform-inner-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)(Ce.S,{className:"filters-container",children:(0,N.jsxs)(Ce.S,{className:"filters-container",children:[(0,N.jsx)("p",{className:"me-auto mb-0",children:(0,N.jsx)("b",{children:"Time on Platform"})}),(0,N.jsxs)(ve.A,{className:"float-end",variant:"secondary",onClick:()=>{this.picker&&this.picker.show({end_date:s,selected_range:r,start_date:n})},children:[ci()(n).format("MMM DD, YYYY")," - ",ci()(s).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(Xw,{onRef:e=>this.picker=e,onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,start_date:t,tmap_range:a},this.refreshAnyDayTMAP)}})]})})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"statistics-body",children:(0,N.jsxs)(Ce.S,{className:"featured-statistics-outer-container",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsxs)("small",{children:[e," ",(0,N.jsx)(ke.A,{defaultMessage:"days",description:"",id:"label.days.ab51004e"})]})}),(0,N.jsxs)("strong",{children:[t&&t.value?t.value:"-"," ",t&&t.value?t.label:"-"]})]}),(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most active team",description:"",id:"label.most_active_team.f280ac89"})})}),(0,N.jsx)("strong",{children:a||"- -"})]})]})})]}),(0,N.jsx)(iL,{app:o,data:i,teams:l})]})})}}GL.defaultProps={teams:[{name:"Team Awesome"}]};var WL=(0,Ke.Ay)((0,P.G0)(_T(UP(GL))));class KL extends l.Component{render(){const{app:e,data:s}=this.props,{styles:a}=e,t=a&&a.primary,i=a&&a["gray-300"],l=a&&a["gray-400"],n=a&&a["gray-700"],r="rgba(0,0,0,.12)";return(0,N.jsx)(jt.u,{height:400,width:"100%",children:(0,N.jsxs)(_t.E,{data:s,margin:{bottom:5,left:0,right:30,top:0},children:[(0,N.jsx)(bt.d,{stroke:r,vertical:!1}),(0,N.jsx)(At.W,{dataKey:"name",stroke:r,tick:{fontSize:"13px",fontWeight:500},tickLine:!1,width:20}
2),(0,N.jsx)(yt.h,{axisLine:!1,stroke:r,tick:{fontSize:"13px",fontWeight:500},tickLine:!1,width:30}),(0,N.jsx)(wt.m,{}),(0,N.jsx)(Nt.s,{align:"right",height:40,iconSize:10,iconType:"circle",verticalAlign:"top",wrapperStyle:{textTransform:"capitalize"}}),(0,N.jsx)(St.y,{dataKey:"video",fill:i,maxBarSize:23,stackId:"a",stroke:i}),(0,N.jsx)(St.y,{dataKey:"document",fill:l,maxBarSize:23,stackId:"a",stroke:l}),(0,N.jsx)(St.y,{dataKey:"image",fill:n,maxBarSize:23,stackId:"a",stroke:n}),(0,N.jsx)(St.y,{dataKey:"messages",fill:t,maxBarSize:23,stackId:"a",stroke:t})]})})}}KL.defaultProps={data:[{amt:2400,name:"Page A",pv:2400,uv:4e3},{amt:2210,name:"Page B",pv:1398,uv:3e3},{amt:2290,name:"Page C",pv:9800,uv:2e3},{amt:2e3,name:"Page D",pv:3908,uv:2780},{amt:2181,name:"Page E",pv:4800,uv:1890},{amt:2500,name:"Page F",pv:3800,uv:2390},{amt:2100,name:"Page G",pv:4300,uv:3490}]};var YL=(0,n.G0)(KL);class qL extends l.Component{constructor(e){super(e),this.state={asset_count:0,end_date:ci()().toDate().getTime(),filter_team_id:null,most_engaged_team:null,most_engaged_user:null,most_uploaded:"Messages",start_date:ci()().subtract(30,"days").toDate().getTime()},this.picker=null}refreshMostEngagedLearner(){const{admin_assignment:e,app:s}=this.props,{assignment_id:a,group_id:t}=e,{api:i}=s,{filter_team_id:l}=this.state;i.get("/api/assignments/members/list/1/1",{group_assignment_id:a,group_id:t,scope:"team",sort_direction:"DESC",sort_token:"engagements",team_id:l}).then(async e=>{let{count:s,members:a}=e;const t=a&&a[0]&&a[0].group_member&&a[0].group_member.organization_member&&a[0].group_member.organization_member.user;this.setState({most_engaged_user:t})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}refreshMostEngagedTeam(){const{admin_assignment:e,app:s}=this.props,{assignment_id:a}=e;s.api.get(`/api/facilitators/group/assignment/teams/list/${a}/1/3`,{sort_direction:"DESC",sort_token:"engagements"}).then(e=>{let{teams:s}=e;const a=s&&s[0]&&s[0].name;this.setState({most_engaged_team:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}refreshEngagements(){const{admin_assignment:e,app:s}=this.props,{assignment_component_id:a}=e,{api:t}=s,{filter_team_id:i}=this.state;t.get(`/api/facilitators/groups/assignment/teams/engagements/count/${a}`,{filter_team_id:i}).then(e=>{let{docs_count:s,files_count:a,images_count:t,messages_count:i,videos_count:l}=e,{most_uploaded:n}=this.state;a>i&&(n="Files"),this.setState({asset_count:a+i,docs_count:s,files_count:a,images_count:t,messages_count:i,most_uploaded:n,videos_count:l})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}refreshAnyDayEngagements(){const{admin_assignment:e,app:s}=this.props,{assignment_component_id:a}=e,{api:t}=s;let{end_date:i,filter_team_id:l,start_date:n}=this.state;n=ci()(n).toISOString(),i=ci()(i).toISOString(),t.get(`/api/facilitators/groups/assignment/teams/engagements/count-any-date/${a}/${n}/${i}`,{filter_team_id:l}).then(e=>{let{any_days_report_docs:s,any_days_report_files:a,any_days_report_images:t,any_days_report_messages:i,any_days_report_videos:l}=e;this.setState({any_days_report_docs:s,any_days_report_files:a,any_days_report_images:t,any_days_report_messages:i,any_days_report_videos:l},()=>{this.formatAnyData()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}formatAnyData(){const{any_days_report_docs:e,any_days_report_images:s,any_days_report_messages:a,any_days_report_videos:t,end_date:i}=this.state,l=(null===s||void 0===s?void 0:s.length)||0,n={docs:0,images:0,messages:0,video:0},r=[];for(let u=0;u<l;u++){const o=s[u],d=t[u],c=e[u],h=a[u],m=ci()(i).endOf("day").subtract(l,"days").add(u+1,"days").endOf("day").format("MMMM Do");r.push({document:(null===c||void 0===c?void 0:c.length)||0,image:(null===o||void 0===o?void 0:o.length)||0,messages:(null===h||void 0===h?void 0:h.length)||0,name:m,video:(null===d||void 0===d?void 0:d.length)||0}),n.video+=(null===d||void 0===d?void 0:d.length)||0,n.messages+=(null===h||void 0===h?void 0:h.length)||0,n.docs+=(null===c||void 0===c?void 0:c.length)||0,n.images+=(null===o||void 0===o?void 0:o.length)||0}const o=Math.max(n.video,n.messages,n.docs,n.images);let d="-";n.video==o?d="Video":n.messages==o?d="Messages":n.docs==o?d="Document":n.images==o&&(d="Image");const c=n.video+n.messages+n.docs+n.images,h=l;this.setState({most_uploaded_asset:d,past_n_days:h,past_n_days_total:c,selected_data:r})}componentDidMount(){this.refreshAnyDayEngagements(),this.refreshEngagements(),this.refreshMostEngagedLearner(),this.refreshMostEngagedTeam()}filterByTeam(e){this.setState({filter_team_id:e},()=>{e?this.refreshMostEngagedLearner():this.refreshMostEngagedTeam(),this.refreshAnyDayEngagements()})}render(){const{admin_assignment:e,intl:s}=this.props,{teams:a}=e,{end_date:t,engagement_range:i,filter_team_id:l,most_engaged_team:n,most_engaged_user:r,most_uploaded_asset:o,past_n_days:d,past_n_days_total:c,selected_data:h,start_date:u}=this.state;return(0,N.jsxs)(Ce.S,{className:"engagement-tab-outer-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)(Ce.S,{className:"filters-container mt-2",children:(0,N.jsxs)(Ce.S,{className:"filters-container",children:[(0,N.jsx)("p",{className:"me-1 mb-0",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Engagement by",description:"",id:"label.engagement_by.53aae19e"})})}),(0,N.jsx)(os,{className:"mb-0",style:{marginRight:"auto",maxWidth:150}
2,children:(0,N.jsxs)(_e.A.Select,{label:"team",name:"team",value:l,onChange:e=>{const s=e.target.value||null;this.filterByTeam(s)},children:[(0,N.jsx)("option",{value:"",children:s.formatMessage({id:"label.teams.1e1a1c07",defaultMessage:"Teams"})}),a&&a.map(e=>{const{id:s,name:a}=e;return(0,N.jsx)("option",{value:s,children:a},s)})]})}),(0,N.jsxs)(Ce.S,{className:"filter-time",children:[(0,N.jsxs)(ve.A,{className:"float-end",variant:"primary",onClick:()=>{this.picker&&this.picker.show({end_date:t,selected_range:i,start_date:u})},children:[ci()(u).format("MMM DD, YYYY")," - ",ci()(t).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,engagement_range:a,start_date:t}),this.refreshAnyDayEngagements()}})]})]})})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{className:"statistics-body",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistics-outer-container",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"{past_n_days} days",description:"",id:"label.past_n_days_days.1332c289",values:{past_n_days:d}})})}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"{past_n_days_total} Assets",description:"",id:"label.past_n_days_total_assets.dcfe4325",values:{past_n_days_total:c}})})]}),(0,N.jsx)(Ce.S,{className:"featured-statistic mx-auto",children:l?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most engaged learner",description:"",id:"label.most_engaged_learner.c46e9bf0"})})}),(0,N.jsxs)("strong",{children:[(0,N.jsx)(Ya,{size:20,style:{height:20,marginRight:10,width:20},user:r}),r&&(0,N.jsx)(qA,{user:r})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most engaged team",description:"",id:"label.most_engaged_team.5bb50c59"})})}),(0,N.jsx)("strong",{children:n})]})}),(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most uploaded asset",description:"",id:"label.most_uploaded_asset.6282b4a2"})})}),(0,N.jsx)("strong",{children:o})]})]}),(0,N.jsx)(Ce.S,{className:"stacked-bar-outer-container",children:(0,N.jsx)(YL,{data:h})})]})]})}}var JL=(0,Ke.Ay)((0,n.G0)(_T(UP(qL))));var XL=e=>{const{handleSort:s,loading:a,sort_direction:t,sort_token:i,teams:l}=eO();return(0,N.jsxs)(ho,{defaultSortDirection:t,defaultSortToken:i,onSort:s,striped:!1,textResize:!0,children:[(0,N.jsx)(ho.Thead,{className:"text-start",children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Members",id:"label.members.1044a4c0"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"progress",children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"engagements",children:(0,N.jsx)(ke.A,{defaultMessage:"Engagements",id:"label.engagements.6777744d"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:a,children:null!==l&&void 0!==l&&l.length?(0,N.jsx)(N.Fragment,{children:l.map((e,s)=>(0,N.jsx)(sO,{challenge:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No teams found",id:"label.no_teams_found.c83a06f9"})})})})]})};const ZL=l.createContext({}),$L=ZL.Provider,eO=(ZL.Consumer,()=>(0,l.useContext)(ZL));var sO=e=>{var s,a,t,i,l;const{userHasRight:n}=(0,P.nm)(),{assignment:r,assignment_component:o,group:d,handleLaunchFacilitation:c}=QP(),{launchChangePasswordModal:h,launchDeletionConfirmation:u,launchRenameTeamModal:m}=eO(),{convertSeconds:g}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},{challenge:p}=e,{id:x,files_count:v,is_graded:f,members:j,messages_count:_,num_phases_complete:b,score:A,team:y,total_time_seconds:w}=p,S=null===j||void 0===j||null===(s=j[0])||void 0===s?void 0:s.group_member_assignment_component,C=null===j||void 0===j||null===(a=j.map)||void 0===a?void 0:a.call(j,e=>null===e||void 0===e?void 0:e.team_member),M=null===C||void 0===C||null===(t=C.map)||void 0===t||null===(i=t.call(C,e=>Kd(e)))||void 0===i||null===(l=i.filter)||void 0===l?void 0:l.call(i,Boolean),{name:k}=y;y.members=C;const z=(null===p||void 0===p?void 0:p.completion_pct)||0,T=g(w||0);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===d||void 0===d?void 0:d.id}/assignment/${null===r||void 0===r?void 0:r.id}/challenge/${null===o||void 0===o?void 0:o.id}/view/${x}`,children:(0,N.jsx)("strong",{children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===d||void 0===d?void 0:d.id}/assignment/${null===r||void 0===r?void 0:r.id}/challenge/${null===o||void 0===o?void 0:o.id}/view/${null===p||void 0===p?void 0:p.id}`,children:k})})})}),(0,N.jsx)(ro,{children:(0,N.jsx)(tn,{users:M})}),(0,N.jsxs)(ro,{hiddenBelow:"lg",children:[(0,N.jsx)(Ce.S,{className:"mb-1 progress-container "+(5===b?"completed":""),children:(0,N.jsx)(Sa.A,{label:`${z}%`,now:z,style:{height:16}})}),(0,N.jsxs)(Ce.S,{children:[f&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Scored {score}%",id:"label.scored_scorepercent.ee56ccca",values:{score:A}})}),!f&&(0,N.jsx)(N.Fragment,{children:p&&100===p.completion_pct?null!==r&&void 0!==r&&r.enable_grading?(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Not scored",id:"label.not_scored.8d57c61c"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"In progress",id:"label.in_progress.c1f88e9d"})})})]})]}),(0,N.jsxs)(ro,{className:"truncate__email",hiddenBelow:"lg",children:[(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.w_X,{size:14}),T&&T.value?`${T.value} ${T.label}`:"-"]}),(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.g5D,{size:14}),_]}),(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.M1W,{size:14}),v]})]}),(0,N.jsx)(ro,{className:"text-end",children:n("manage_team",null===d||void 0===d?void 0:d.organization_id)&&(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsxs)(ve.A,{onClick:()=>c(y,S),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.$hd,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Facilitate",id:"label.facilitate.b7fbd970"})]}),(0,N.jsxs)(ve.A,{onClick:()=>m(y),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})]}),(0,N.jsxs)(ve.A,{onClick:()=>h(y),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.pXu,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})]}),(0,N.jsxs)(ve.A,{onClick:()=>u(y),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},x)};class aO extends l.Component{constructor(s){super(s),this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.setSuccess=e=>this.setState({success:e}),this.fetchTeams=async()=>{const{admin_assignment:e,app:s}=this.props,{assignment_component_id:a,group_id:t}=e,{api:i}=s,{page:l,page_size:n,search_term:r,sort_direction:o,sort_token:d}=this.state;this.setState({loading:!0}),await i.get(`/api/challenges/teams/list/${l}/${n}`,{group_assignment_component_id:a,group_id:t,search_term:r,sort_direction:o,sort_token:d}).then(e=>{let{count:s,teams:a}=e;this.setState({count:s,loading:!1,teams:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})},this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},()=>{this.fetchTeams()})},1e3)},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.fetchTeams),this.launchTeamManager=async()=>{try{if(!(null===this||void 0===this?void 0:this.team_manager))return;const{admin_assignment:e}=this.props;await this.team_manager.show({group_assignment:null===e||void 0===e?void 0:e.assignment})}catch(e){w(e)}},this.launchDeletionConfirmation=(e,s)=>{var a;const t=null===(a=this.deletion_confirmation_modal)||void 0===a?void 0:a.current;t&&t.show({team:e,users:s})},this.launchChangePasswordModal=e=>{var s;const a=null===(s=this.change_password_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})},this.launchRenameTeamModal=e=>{var s;const a=null===(s=this.rename_team_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})}
2,this.handleDeletionSuccess=async()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.team_deleted_successfully.ee0db216",defaultMessage:"Team deleted successfully"})),await this.fetchTeams()},this.handleUpdateSuccess=async()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.team_updated_successfully.6557b7f1",defaultMessage:"Team updated successfully"})),await this.fetchTeams()},this.handleChangePage=e=>this.setState({page:e},this.fetchTeams),this.handleChangeSearchTerm=e=>this.setState({search_term:e.target.value},this.startSearch),this.state={count:0,error:null,loading:!1,page:1,page_size:8,search_term:null,sort_direction:"ASC",sort_token:"name",success:null,teams:[]},this.team_manager=null,this.deletion_confirmation_modal=(0,l.createRef)(),this.change_password_modal=(0,l.createRef)(),this.rename_team_modal=(0,l.createRef)()}componentDidMount(){this.fetchTeams()}render(){const{admin_assignment:e,app:s}=this.props,{group:a}=e,{count:t,error:i,loading:l,page:n,page_size:r,search_term:o,sort_direction:d,sort_token:c,success:h,teams:u}=this.state;return(0,N.jsxs)($L,{value:{handleSort:this.handleSort,launchChangePasswordModal:this.launchChangePasswordModal,launchDeletionConfirmation:this.launchDeletionConfirmation,launchRenameTeamModal:this.launchRenameTeamModal,loading:l,sort_direction:d,sort_token:c,teams:u},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:i,variant:"danger",children:i}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:h,variant:"success",children:h}),(0,N.jsx)(Ce.S,{className:"team-dashboard",children:(0,N.jsxs)(_I,{className:"mt-2",count:t,label:"Teams",showCount:!0,headerRight:(0,N.jsxs)(Ce.S,{className:"mb-2 ms-auto d-flex align-items-center justify-content-center",children:[(0,N.jsxs)(Ei.A,{className:"me-2",size:"sm",style:{maxWidth:375},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:this.handleChangeSearchTerm,placeholder:"Search teams",value:o||""})]}),s.userHasRight("manage_team",null===a||void 0===a?void 0:a.organization_id)&&(0,N.jsx)(ve.A,{onClick:this.launchTeamManager,style:{marginLeft:10,minWidth:160},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Manage teams",id:"label.manage_teams.9e1a8a9d"})})]}),children:[(0,N.jsx)(XL,{}),(0,N.jsx)(Lr,{count:t,onChange:this.handleChangePage,page:n,page_size:r})]})}),(0,N.jsx)(rc,{group:a,onSuccess:this.fetchTeams,ref:e=>this.team_manager=e}),(0,N.jsx)(GO,{onSuccess:this.handleDeletionSuccess,ref:this.deletion_confirmation_modal}),(0,N.jsx)(KO,{onSuccess:this.handleUpdateSuccess,ref:this.change_password_modal}),(0,N.jsx)(qO,{onSuccess:this.handleUpdateSuccess,ref:this.rename_team_modal})]})}}var tO=(0,n.G0)((0,Ke.Ay)(_T(UP(aO)))),iO=t(6825),lO=t(61705),nO=t(52683),rO=t(35894),oO=t(42497);class dO extends l.Component{constructor(e){super(e),this.state={formatted_data:[{a:3,fullMark:4,subject:this.props.intl.formatMessage({id:"label.collaboration.11a2b0f9",defaultMessage:"Collaboration"})},{a:3,fullMark:4,subject:this.props.intl.formatMessage({id:"label.communication.3981
2a2b9",defaultMessage:"Communication"})},{a:3,fullMark:4,subject:this.props.intl.formatMessage({id:"label.creativity.1c9fe98b",defaultMessage:"Creativity"})},{a:3,fullMark:4,subject:this.props.intl.formatMessage({id:"label.critical_thinking.e367ae89",defaultMessage:"Critical thinking"})}],hidden_user_series_ids:[],loading:!0,scores:[]},this.letter_lookup=[]}getLetterForUserId(e){e=Number.parseInt(e);let s=this.letter_lookup.indexOf(e);return-1===s&&(s=this.letter_lookup.push(e)-1),String.fromCharCode(65+s)}formatFourCScoresForTeam(){const{scores:e}=this.state,s=[{fullMark:4,subject:"Collaboration"},{fullMark:4,subject:"Communication"},{fullMark:4,subject:"Creativity"},{fullMark:4,subject:"Critical Thinking"}];e&&e.forEach(e=>{s[0][e.user_id]=e.c3,s[1][e.user_id]=e.c2,s[2][e.user_id]=e.c4,s[3][e.user_id]=e.c1}),this.setState({formatted_data:s})}async componentDidMount(){try{await this.getFourCScoresForTeam()}catch(e){console.error(e)}}async componentDidUpdate(s,a,t){var i,l,n;if(((null===s||void 0===s||null===(i=s.team)||void 0===i?void 0:i.id)||null)!==((null===(l=this.props)||void 0===l||null===(n=l.team)||void 0===n?void 0:n.id)||null))try{await this.getFourCScoresForTeam()}catch(e){console.error(e)}}async getFourCScoresForTeam(){const{app:s,challenge:a}=this.props,t=s.api;if(this.setState({loading:!0,members:null}),!a)throw"No challenge provided";try{const{four_c_scores:e}=await t.get("/api/teams/group-member-assignments/all-four-c/"+a.id);this.setState({loading:!1,scores:e},()=>{this.formatFourCScoresForTeam()})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;throw void this.setState({error:a,loading:null})}}render(){let{height:e,hideLabels:s,team:a,width:t}=this.props;const{formatted_data:i,hidden_user_series_ids:n}=this.state;if(!a)return(0,N.jsx)(Ce.S,{children:"N/A"});e=e||500,t=t||"100%",s=Boolean(s);const r=["orange","purple","green","red","pink","blue","brown","gold"];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{height:e,margin:"auto",width:t},children:(0,N.jsx)(jt.u,{height:e,width:"100%",children:(0,N.jsxs)(iO.V,{data:i,children:[(0,N.jsx)(lO.z,{}),(0,N.jsx)(nO.r,{dataKey:"subject"}),!s&&(0,N.jsx)(rO.E,{angle:0,domain:[0,4]}),a&&a.members&&a.members.map((e,s)=>{var a;const{user_id:t}=e;return-1!==n.indexOf(t)?(0,N.jsx)(l.Fragment,{},t):(0,N.jsx)(oO.V,{dataKey:t,fill:r[s],fillOpacity:0,name:null===(a=e.user)||void 0===a?void 0:a.fullname,stroke:r[s],strokeWidth:4},t)})]})})}),(0,N.jsx)(Ce.S,{className:"vertical-scroll",style:{padding:20},children:a&&a.members&&a.members.map((e,s)=>{const{user:a,user_id:t}=e,i=-1!==n.indexOf(t);return(0,N.jsxs)(ve.A,{variant:"link",onClick:e=>{e.preventDefault(),this.setState(e=>{const s=e.hidden_user_series_ids.indexOf(t);return-1===s?e.hidden_user_series_ids.push(t):e.hidden_user_series_ids.splice(s,1),e})},style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[i?(0,N.jsx)(ze.EaG,{style:{color:r[s],marginRight:7.5}}):(0,N.jsx)(ze.A7C,{style:{color:r[s],marginRight:7.5}}),(0,N.jsx)(Ya,{size:15,style:{marginRight:7.5},user:a}),(0,N.jsx)("b",{children:(null===a||void 0===a?void 0:a.fullname)||""})]},`${t}-${s}`)})})]})}}var cO=(0,Ke.Ay)((0,n.G0)(dO));var hO=e=>{const[s,a,t]=(0,ne.CQ)({challenge:null,team:null}),{getTeamChallenge:i,teams:n}=QP(),r=e=>{var s;const t=Number(e),l=(null===n||void 0===n||null===(s=n.find)||void 0===s?void 0:s.call(n,e=>(null===e||void 0===e?void 0:e.id)===t))||null,r=i(null===l||void 0===l?void 0:l.id);a({challenge:r,team:l})};(0,l.useEffect)(()=>{const e=(null===n||void 0===n?void 0:n[0])||null;e&&r(null===e||void 0===e?void 0:e.id)},[n]);const{challenge:o,team:d}=s;return(0,N.jsxs)(Ce.S,{className:"four-c-tab-outer-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsxs)(Ce.S,{className:"filters-container",children:[(0,N.jsxs)(Ce.S,{className:"filter-subject",children:[(0,N.jsx)("p",{className:"me-1 mt-3",style:{whiteSpace:"nowrap"},children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"4Cs by",id:"label.4cs_by.6d7f9fca"})})}),(0,N.jsx)("select",{className:"me-1",onChange:e=>{var s;return r(null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},style:{maxWidth:225},children:!(null===n||void 0===n||!n.length)&&n.map(e=>{let{id:s,name:a}=e;return(0,N.jsx)("option",{value:s,children:a},s)})})]}
2),(0,N.jsx)(Ce.S,{className:"ms-3 expandable-description",children:(0,N.jsxs)("p",{children:[(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"The four C\u2019s of 21st Century skills are some of the most popular learning strategies in today\u2019s environment:",id:"label.the_four_cs_of_21st_century_skills.8c01daa4"})}),(0,N.jsx)("br",{}),(0,N.jsx)("small",{className:"font-weight-bold",children:(0,N.jsx)(ke.A,{defaultMessage:"Critical Thinking, Communication, Creativity, Collaboration.",id:"label.critical_thinking_communication_cr.a8ce0ab3"})})]})})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"statistics-body",children:(0,N.jsx)(Ce.S,{className:"four-c-radar-outer-container",children:(0,N.jsx)(cO,{challenge:o,team:d})})})]})};var uO=e=>(0,N.jsx)(Ce.S,{className:"team-results-outer-container plain-tabs",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"time",id:"admin-tabs",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time on Platform",id:"label.time_on_platform.5b37e89a"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"engagement",children:(0,N.jsx)(ke.A,{defaultMessage:"Engagement",id:"label.engagement.ea68771a"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"4cs",children:(0,N.jsx)(ke.A,{defaultMessage:"4C's",id:"label.4cs.ca5dd165"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"time",children:(0,N.jsx)(WL,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"engagement",children:(0,N.jsx)(JL,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"4cs",children:(0,N.jsx)(hO,{})})]})]})});var mO=e=>{const[s,a,t]=(0,ne.CQ)({teams_page:1,teams_page_size:6}),{formatMessage:i}=(0,ja.A)(),{styles:n}=(0,P.nm)(),{primary:r,secondary:o,success:d}=n,{assignment_component_id:c,assignment_id:h,calculateAverageChallengeProgress:u,getTeamChallenge:m,group_id:g,tallyChallengeProgress:p,teams:x,teams_count:v}=QP(),f=u(),{completed:j,in_progress:_,not_started:b}=p();(0,l.useEffect)(()=>t,[]);const{teams_page:A,teams_page_size:y}=s,w=(0,N.jsx)(Dt,{barSize:5,fontSize:12,height:32,showLabel:!1,value:f,width:32}),S=(0,N.jsx)(ze.lhZ,{color:r,size:32}),C=(0,N.jsx)(ze.A7C,{color:d,size:32}),M=(0,N.jsx)(ze.BS8,{color:o,size:32}),k=[{icon:w,label:i({id:"label.average_progress.abea593d",defaultMessage:"average progress"}),value:(0,N.jsxs)(N.Fragment,{children:[f,"%"]})},{icon:C,label:i({id:"label.completed.4ddb3e96",defaultMessage:"completed"}),value:j},{icon:S,label:i({id:"label.in_progress.2b6b853c",defaultMessage:"in progress"}),value:_},{icon:M,label:i({id:"label.not_started.7a7400f4",defaultMessage:"not started"}),value:b}],z=v?(A-1)*y+1:0,T=A*y;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_I,{label:"Teams overview",children:(0,N.jsx)(VL,{stats:k})}),(0,N.jsxs)(_I,{label:"Team snapshot",children:[(0,N.jsx)(Ce.S,{className:"showing-sort-container",children:(0,N.jsx)("p",{className:"font-weight-bold",children:v>0?(0,N.jsx)(N.Fragment,{children:`Showing ${z}-${T>v?v:T} of ${v||"0"}`}):(0,N.jsx)(N.Fragment,{children:"Showing 0 of 0"})})}),(0,N.jsxs)(Ce.S,{className:"mb-4 team-snapshot-cards",children:[null!==x&&void 0!==x&&x.length?(0,N.jsx)(N.Fragment,{children:x.slice((A-1)*y,A*y).map(e=>{const{id:s,completed:a,members:t,name:i}=e,l=m(s);let n=(null===l||void 0===l?void 0:l.completion_pct)||0,r=(null===l||void 0===l?void 0:l.score)||null;return(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsx)(HL,{completed:a,link:`/admin/group/${g}/assignment/${h}/challenge/${c}/view/${null===l||void 0===l?void 0:l.id}`,members:t,progress:n,score:r,team_name:i})},s)})}):(0,N.jsx)(Ge.A,{className:"text-center text-muted",style:{width:"100%"},children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(ke.A,{defaultMessage:"No teams exist for this challenge",id:"label.no_teams_exist_for_this_challenge.041ccd07"})})}),(0,N.jsx)(Ce.S,{className:"center-pagination",children:(0,N.jsx)(Lr,{count:v,onChange:e=>a({teams_page:e}),page:A,page_size:y})})]})]}),(0,N.jsx)(_I,{label:"Team results",children:(0,N.jsx)(uO,{})})]})},gO={General:mO,Learners:xL,Settings:LL,Teams:tO};var pO=e=>{const{assignment:s,assignment_component:a}=QP();return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Module settings",id:"label.module_settings.f547b810"})}),(0,N.jsx)(Ge.A,{body:!0,className:"admin-challenge-settings",children:(0,N.jsx)(EL,{assignment:s,component:a})})]})};var xO=e=>
2{const[s,a,t]=(0,ne.CQ)({teams_page:1,teams_page_size:6}),{formatMessage:i}=(0,ja.A)(),{styles:l}=(0,n.nm)(),{primary:r,secondary:o,success:d}=l,{teams_page:c,teams_page_size:h}=s,{calculateAverageCartridgeProgress:u,getTeamCartridge:m,tallyCartridgeProgress:g,teams:p,teams_count:x}=QP(),v=u(),{completed:f,in_progress:j,not_started:_}=g();let b=(0,N.jsx)(Dt,{fontSize:12,height:32,showLabel:!1,value:v,width:32}),A=(0,N.jsx)(ze.lhZ,{color:r,size:32}),y=(0,N.jsx)(ze.A7C,{color:d,size:32}),w=(0,N.jsx)(ze.BS8,{color:o,size:32}),S=[{icon:b,label:i({id:"label.average_progress.abea593d",defaultMessage:"average progress"}),value:(0,N.jsxs)(N.Fragment,{children:[v,"%"]})},{icon:y,label:i({id:"label.completed.4ddb3e96",defaultMessage:"completed"}),value:f},{icon:A,label:i({id:"label.in_progress.2b6b853c",defaultMessage:"in progress"}),value:j},{icon:w,label:i({id:"label.not_started.7a7400f4",defaultMessage:"not started"}),value:_}],C=0;x&&(C=(c-1)*h+1);let M=c*h;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(_I,{label:"Learners overview",children:(0,N.jsx)(VL,{stats:S})}),(0,N.jsxs)(_I,{label:"Team snapshot",children:[(0,N.jsx)("div",{className:"showing-sort-container",children:(0,N.jsx)("div",{children:(0,N.jsx)("p",{className:"font-weight-bold",children:x>0?(0,N.jsx)(N.Fragment,{children:`Showing ${C}-${M>x?x:M} of ${x||"0"}`}):(0,N.jsx)(N.Fragment,{children:"Showing 0 of 0"})})})}),(0,N.jsxs)(Ce.S,{className:"mb-4 team-snapshot-cards",children:[p.length?p.slice((c-1)*h,c*h).map(e=>{const{id:s,completed:a,members:t,name:i}=e,l=m(s);let n=(null===l||void 0===l?void 0:l.completion_pct)||0;return(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsx)(HL,{completed:a,members:t,progress:n,team_name:i})},s)}):(0,N.jsx)(Ge.A,{className:"text-center text-muted",style:{width:"100%"},children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(ke.A,{defaultMessage:"No teams exist for this cartridge",description:"",id:"label.no_teams_exist_for_this_cartridge.6b7dd2f0"})})}),(0,N.jsx)(Ce.S,{className:"center-pagination",children:(0,N.jsx)(Lr,{count:x,onChange:e=>a({teams_page:e}),page:c,page_size:h})})]}),(0,N.jsx)(nL,{})]})]})};class vO extends l.Component{constructor(s){super(s),this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.setSuccess=e=>this.setState({success:e}),this.fetchTeams=async()=>{try{const{admin_assignment:e,app:s}=this.props,{assignment_component_id:a,group_id:t}=e,{api:i}=s,{page:l,page_size:n,search_term:r,sort_direction:o,sort_token:d}=this.state;this.setState({loading:!0});const{count:c,teams:h}=await i.get(`/api/organizations/group/assignment/cartridge/teams/list/${l}/${n}`,{group_assignment_component_id:a,group_id:t,search_term:r,sort_direction:o,sort_token:d});this.setState({count:c,loading:!1,teams:h})}catch({err:err}){this.setState({error:err})}},this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},this.fetchTeams)},1e3)},this.launchTeamManager=async()=>{try{if(!(null===this||void 0===this?void 0:this.team_manager))return;const{admin_assignment:e}=this.props;await this.team_manager.show({group_assignment:null===e||void 0===e?void 0:e.assignment})}catch(e){w(e)}},this.launchDeletionConfirmation=(e,s)=>{var a;const t=null===(a=this.deletion_confirmation_modal)||void 0===a?void 0:a.current;t&&t.show({team:e,users:s})},this.launchChangePasswordModal=e=>{var s;const a=null===(s=this.change_password_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})},this.launchRenameTeamModal=e=>{var s;const a=null===(s=this.rename_team_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})},this.handleDeletionSuccess=async()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.team_deleted_successfully.ee0db216",defaultMessage:"Team deleted successfully"})),await this.fetchTeams()},this.handleUpdateSuccess=async()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.team_updated_successfully.6557b7f1",defaultMessage:"Team updated successfully"})),await this.fetchTeams()},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.fetchTeams),this.handleChangePage=e=>this.setState({page:e},this.fetchTeams),this.state={count:0,error:null,loading:!1,page:1,page_size:8,search_term:null,sort_direction:"ASC",sort_token:"name",success:null,teams:[]},this.team_manager=null,this.deletion_confirmation_modal=(0,l.createRef)(),this.change_password_modal=(0,l.createRef)(),this.rename_team_modal=(0,l.createRef)()}componentDidMount(){this.fetchTeams()}render(){const{admin_assignment:e,app:s}=this.props,{group:a}=e,{count:t,error:i,loading:l,page:n,page_size:r,sort_direction:o,sort_token:d,success:c,teams:h}=this.state;
2return(0,N.jsxs)(bO,{value:{handleDeletionSuccess:this.handleDeletionSuccess,handleSort:this.handleSort,handleUpdateSuccess:this.handleUpdateSuccess,launchChangePasswordModal:this.launchChangePasswordModal,launchDeletionConfirmation:this.launchDeletionConfirmation,launchRenameTeamModal:this.launchRenameTeamModal,loading:l,sort_direction:o,sort_token:d,teams:h},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:i,variant:"danger",children:i}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:c,variant:"success",children:c}),(0,N.jsx)(Ce.S,{className:"team-dashboard",children:(0,N.jsxs)(_I,{className:"mt-2",count:t,label:"Teams",showCount:!0,headerRight:(0,N.jsxs)(Ce.S,{className:"mb-2 ms-auto d-flex align-items-center justify-content-center",children:[(0,N.jsxs)(Ei.A,{className:"me-2",size:"sm",style:{maxWidth:375},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search teams",value:this.state.search_term||"",onChange:e=>{this.setState({search_term:e.target.value}),this.startSearch()}})]}),s.userHasRight("manage_team",null===a||void 0===a?void 0:a.organization_id)&&(0,N.jsx)(ve.A,{onClick:this.launchTeamManager,style:{marginLeft:10,minWidth:160},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Manage teams",id:"label.manage_teams.9e1a8a9d"})})]}),children:[(0,N.jsx)(jO,{}),(0,N.jsx)(Lr,{count:t,onChange:this.handleChangePage,page:n,page_size:r})]})}),(0,N.jsx)(rc,{group:a,onSuccess:this.fetchTeams,ref:e=>this.team_manager=e}),(0,N.jsx)(GO,{onSuccess:this.handleDeletionSuccess,ref:this.deletion_confirmation_modal}),(0,N.jsx)(KO,{onSuccess:this.handleUpdateSuccess,ref:this.change_password_modal}),(0,N.jsx)(qO,{onSuccess:this.handleUpdateSuccess,ref:this.rename_team_modal})]})}}var fO=(0,n.G0)((0,Ke.Ay)(_T(UP(vO))));var jO=e=>{const{handleSort:s,loading:a,sort_direction:t,sort_token:i,teams:l}=AO();return(0,N.jsxs)(ho,{defaultSortDirection:t,defaultSortToken:i,onSort:s,striped:!1,children:[(0,N.jsx)(ho.Thead,{className:"text-start",children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Members",id:"label.members.1044a4c0"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"progress",children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Engagements",id:"label.engagements.6777744d"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:5,loading:a,children:null!==l&&void 0!==l&&l.length?(0,N.jsx)(N.Fragment,{children:l.map((e,s)=>(0,N.jsx)(yO,{team:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"No teams found",id:"label.no_teams_found.c83a06f9"})})})})]})};const _O=l.createContext({}),bO=_O.Provider,AO=(_O.Consumer,()=>(0,l.useContext)(_O));var yO=e=>{var s,a;const{userHasRight:t}=(0,P.nm)(),{group:i}=QP(),{launchChangePasswordModal:l,launchDeletionConfirmation:n,launchRenameTeamModal:r}=AO(),{team:o}=e,{convertSeconds:d}=null!==(s=null===Re._$||void 0===Re._$?void 0:Re._$.time)&&void 0!==s?s:{},{id:c,assignments:h,members:u,name:m}=o,g=null===u||void 0===u||null===(a=u.map)||void 0===a?void 0:a.call(u,e=>Kd(e)),p=h.map(e=>{var s;return null===e||void 0===e||null===(s=e.group_member_assignment_components[0])||void 0===s?void 0:s.cartridge}),x=p.reduce((e,s)=>e&&s.completed,!0),v=p.length>0?Math.min(Math.round(p.reduce((e,s)=>e+s.completion_pct/p.length,0)),100):0,f=p.length>0?p.reduce((e,s)=>e+s.total_time_seconds,0):0,j=d(f||0);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{style:{maxWidth:200},children:(0,N.jsx)(Ce.S,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,N.jsx)("b",{children:m})})}),(0,N.jsx)(ro,{children:(0,N.jsx)(tn,{users:g})}),(0,N.jsxs)(ro,{hiddenBelow:"lg",children:[(0,N.jsx)(Ce.S,{className:"mb-1 progress-container "+(x?"completed":""),children:(0,N.jsx)(Sa.A,{label:`${v}%`,now:v,style:{height:16}})}),(0,N.jsx)(Ce.S,{children:x&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Complete",id:"label.complete.143b270a"})})})]}),(0,N.jsx)(ro,{className:"truncate__email",hiddenBelow:"lg",children:(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2",text:"dark",children:[(0,N.jsx)(ze.w_X,{size:14}),j&&j.value?j.value+" "+j.label:"-"]})}),(0,N.jsx)(ro,{className:"text-end",children:t("manage_team",null===i||void 0===i?void 0:i.organization_id)&&(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsxs)(ve.A,{onClick:()=>r(o),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})]}),(0,N.jsxs)(ve.A,{onClick:()=>l(o),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.pXu,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})]}),(0,N.jsxs)(ve.A,{onClick:()=>n(o),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},c)},wO={General:xO,Learners:KP,Settings:pO,Teams:fO};class NO extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.clearSuccess=()=>this.setState({success:null}),this.setSuccess=e=>this.setState({success:e}),this.fetchLearners=async()=>{try{const{admin_assignment:e,app:s}=this.props,{assignment_id:a,group_id:t}=e,{api:i}=s,{page:l,page_size:n,search_term:r,sort_direction:o,sort_token:d}=this.state;this.setState({loading:!0});const{count:c,members:h}=await i.get(`/api/assignments/members/list/${l}/${n}`,{group_assignment_id:a,group_id:t,search_term:r,sort_direction:o,sort_token:d});this.setState({count:c,loading:!1,members:h})}catch({err:err}){this.setState({error:err,loading:!1})}},this.startSearch=()=>{this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},this.fetchLearners)},1e3)},this.removeUserFromAssignment=async e=>{try{const{admin_assignment:s,app:a}=this.props,{api:t}=a,{assignment_id:i,group_id:l}=s;this.setState({loading:!0}),await t.post("/api/assignments/member/remove",{group_assignment_id:i,group_id:l,group_member_assignment_id:e}),await this.fetchLearners(),this.setState({loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleRemoveUser=e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{formatMessage:i}=t;a.show({actions:[a.CancelAction(),a.Action({label:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"}),onClick:()=>this.removeUserFromAssignment(null===e||void 0===e?void 0:e.id),variant:"danger"})],body:i({id:"label.are_you_sure_you_want_to_remove_th.bd44bd23",defaultMessage:"Are you sure you want to remove this user from the assignment?"}),size:"sm",title:i({id:"label.remove_user.84a18f0e",defaultMessage:"Remove user"})})}
2,this.handleTransferMember=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.transfer_dialog)||void 0===a?void 0:a.current;t&&t.show({group_id:e,group_member_assignment_id:s})},this.muteTeamMember=async(e,s)=>{try{var a;const{admin_assignment:t,app:i}=this.props,{api:l}=i,n=null===t||void 0===t||null===(a=t.group)||void 0===a?void 0:a.organization_id,r=[e];this.setState({loading:!0}),await l.post("/api/teams/members/update_muted_status",{is_muted:s,organization_id:n,team_member_ids:r}),await this.fetchLearners(),this.setState({loading:!1})}catch({err:err}){this.setState({error:err,loading:!1})}},this.handleMuteMember=(e,s)=>{var a;const t=null===this||void 0===this||null===(a=this.dialog)||void 0===a?void 0:a.current;if(!t)return;const{intl:i}=this.props,{formatMessage:l}=i,n=s?"mute":"unmute";t.show({actions:[t.CancelAction(),t.Action({label:(0,T.capitalize)(n),onClick:()=>{var a;return this.muteTeamMember(null===e||void 0===e||null===(a=e.team_member)||void 0===a?void 0:a.id,s)},variant:"danger"})],body:l({id:"label.are_you_sure_you_want_to_mute_phra.01ebb2c8",defaultMessage:"Are you sure you want to {mute_phrase} this team member?"},{mute_phrase:n}),size:"sm",title:l({id:"label.mute_phrase_team_member.4546a7e5",defaultMessage:"{mute_phrase} Team Member"},{mute_phrase:(0,T.capitalize)(n)})})},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.fetchLearners),this.launchAddMemberModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.add_member_modal)||void 0===e?void 0:e.current;s&&s.show()},this.handleTransferSuccess=()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.learner_successfully_transferred_t.d26b9772",defaultMessage:"Learner successfully transferred to new team"}))},this.state={count:0,error:null,loading:!1,members:[],page:1,page_size:32,search_term:"",show_role_editor:null,sort_direction:"ASC",sort_token:"fullname",success:null,teams_members:null},this.dialog=(0,l.createRef)(),this.add_member_modal=(0,l.createRef)(),this.transfer_dialog=(0,l.createRef)(),this.search_timer=null}async componentDidMount(){await this.fetchLearners()}render(){const{count:e,error:s,loading:a,members:t,page:i,page_size:l,search_term:n,sort_direction:r,sort_token:o,success:d}=this.state,{admin_assignment:c,app:h}=this.props,{group:u}=c,{organization_id:m}=u||{};return(0,N.jsxs)(MO,{value:{handleMuteMember:this.handleMuteMember,handleRemoveUser:this.handleRemoveUser,handleSort:this.handleSort,handleTransferMember:this.handleTransferMember,sort_direction:r,sort_token:o},children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:s,variant:"danger",children:s}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:d,variant:"success",children:d}),(0,N.jsx)(Me.x_,{loading:a,children:(0,N.jsx)(_I,{count:e,label:"Learners",headerRight:(0,N.jsxs)(Ce.S,{className:"mb-2 ms-auto d-flex align-items-center justify-content-center",children:[(0,N.jsxs)(Ei.A,{className:"me-2 search-field",style:{maxWidth:342},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search learners",value:n||"",onChange:e=>{this.setState({search_term:e.target.value}),this.startSearch()}})]}),h.userHasRight("manage_group",m)&&(0,N.jsx)(ve.A,{onClick:this.launchAddMemberModal,style:{whiteSpace:"nowrap"},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add learner",id:"label.add_learner.efc76f3d"})})]}),children:(0,N.jsxs)(Ce.S,{className:"teams-container",children:[(0,N.jsx)(zO,{members:t}),(0,N.jsx)(GP,{onHide:this.fetchLearners,onSuccess:this.handleTransferSuccess,ref:this.transfer_dialog}
2),(0,N.jsx)(Lr,{count:e,onChange:e=>this.setState({page:e},this.fetchLearners),page:i,page_size:l})]})})}),(0,N.jsx)(dL,{onAdd:this.fetchLearners,ref:this.add_member_modal}),(0,N.jsx)(je,{ref:this.dialog})]})}}var SO=(0,P.G0)((0,Ke.Ay)(_T(UP(NO))));const CO=l.createContext({}),MO=CO.Provider,kO=(CO.Consumer,()=>(0,l.useContext)(CO));var zO=e=>{const{members:s}=e,{handleSort:a,loading:t,sort_direction:i,sort_token:l}=kO(),{assignment:n}=QP(),{allow_teams:r}=n;return(0,N.jsxs)(ho,{defaultSortDirection:i,defaultSortToken:l,onSort:a,striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),r&&(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"team_name",children:(0,N.jsx)(ke.A,{defaultMessage:"Team",id:"label.team.5985039f"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"progress",children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:r?7:6,loading:t,children:null!==s&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:s.map((e,s)=>(0,N.jsx)(TO,{member:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:r?7:6,children:(0,N.jsx)(ke.A,{defaultMessage:"No learners found",id:"label.no_learners_found.4b76b226"})})})})]})};var TO=e=>{var s,a,t;const{member:i}=e,{userHasRight:l}=(0,P.nm)(),{assignment:n,assignment_component:r,group:o,handleLaunchFacilitation:d,launchResponseHistory:c}=QP(),{allow_teams:h}=n,{parseBinary:u}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},{handleMuteMember:m,handleRemoveUser:g,handleTransferMember:p}=kO(),{id:x,completed:v,completion_pct:f,start:j,team:_,team_id:b,team_member:A}=i,y=((null===i||void 0===i?void 0:i.group_member_assignment_components)||[]).find(e=>e.group_assignment_component_id===(null===r||void 0===r?void 0:r.id)),w=null===i||void 0===i||null===(s=i.group_member)||void 0===s||null===(a=s.organization_member)||void 0===a?void 0:a.user,S=!!u(null===A||void 0===A?void 0:A.is_muted),C=!(null===i||void 0===i||null===(t=i.group_member)||void 0===t||!t.archived_at);return(0,N.jsxs)(io,{children:[(0,N.jsx)(ro,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ya,{className:"ms-2",size:40,user:w}),(0,N.jsxs)(Ce.S,{className:"ms-3 d-flex",children:[(0,N.jsx)("span",{children:(0,N.jsx)(qA,{user:w})}),C&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(bo.A,{bg:"secondary",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})})})]})]})}),h&&(0,N.jsx)(N.Fragment,{children:null==_?(0,N.jsx)(ro,{className:"no-team-column",hiddenBelow:"lg",children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"Unassigned",id:"label.unassigned.14d33bd0"})})}):(0,N.jsx)(ro,{className:"team-column",hiddenBelow:"lg",children:null===_||void 0===_?void 0:_.name})}),(0,N.jsxs)(ro,{className:"progress-column "+(v?"completed":""),hiddenBelow:"lg",children:[(0,N.jsx)(Sa.A,{label:`${f}%`,now:f,variant:"primary"}),(0,N.jsxs)(Ce.S,{className:"mt-2",children:[!j&&(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"small",text:"light",children:(0,N.jsx)(ke.A,{defaultMessage:"Not started",id:"label.not_started.ba35f0c4"})}),!!j&&!v&&(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"small",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"In progress",id:"label.in_progress.c1f88e9d"})}),!!v&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"small",text:"light",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})})]})]}),(0,N.jsx)(ro,{className:"text-end",children:l("manage_team",null===o||void 0===o?void 0:o.organization_id)&&(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[_&&["cartridge"].includes(null===n||void 0===n?void 0:n.type)&&(0,N.jsxs)(ve.A,{onClick:async()=>await d(_,y),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.$hd,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Facilitate",id:"label.facilitate.b7fbd970"})]}),"cartridge"===(null===n||void 0===n?void 0:n.type)&&(0,N.jsxs)(ve.A,{onClick:()=>c({gmac:y,team:_,user:w}),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.OKX,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"History",id:"label.history.0e769600"})]}),(0,N.jsxs)(ve.A,{onClick:()=>g(i),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.Dby,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",description:"",id:"label.remove.c3812fc4"})]}),h&&(0,N.jsxs)(ve.A,{onClick:()=>p(null===o||void 0===o?void 0:o.id,x),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.yk7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Transfer",id:"label.transfer.dde8bef7"})]}),(null===i||void 0===i?void 0:i.team_member)&&(0,N.jsx)(ve.A,{onClick:()=>m(i,!S),size:"sm",variant:"outline-warning",children:S?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.j1Q,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Unmute",id:"label.unmute.ce4ee4ef"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.gq7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Mute",id:"label.mute.8dd6857b"})]})})]})})]},null===i||void 0===i?void 0:i.id)};class IO extends l.Component{constructor(e){super(e),this.clearError=()=>this.setState({error:null}),this.refreshAssignment=async()=>{try{const{admin_assignment:e,app:s}=this.props,{assignment_id:a,group_id:t}=e||{},i=s.api;this.setState({assignment:null,error:null});const{assignment:l}=await i.get("/api/assignments/stats",{group_assignment_id:a,group_id:t});this.setState({assignment:l})}catch({err:err}){this.setState({error:err})}},this.refreshComponents=async()=>{try{const{admin_assignment:e,app:s}=this.props,{assignment_id:a,group_id:t}=e,{api:i}=s,{sort_direction:l,sort_token:n}=this.state;this.setState({error:null,group_assignment_components:null,loading_components:!0});const{group_assignment_components:r}=await i.get("/api/assignments/components/list",{group_assignment_id:a,group_id:t,sort_direction:l,sort_token:n});this.setState({group_assignment_components:r,loading_components:!1})}catch({err:err}){this.setState({error:err,loading_components:!1})}},this.navigateToAssignment=(e,s)=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const{history:a}=this.props;s&&a.push(s)},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.refreshComponents),this.state={assignment:null,error:null,group_assignment_components:[],loading:!1,loading_components:!1,sort_direction:"ASC",sort_token:"order",teams_page:1,teams_page_size:6}}componentDidMount(){this.setState({loading:!0}),Promise.all([this.refreshAssignment(),this.refreshComponents()]).then(()=>this.setState({loading:!1}))}render(){const{admin_assignment:e,app:s,intl:a}=this.props,{formatMessage:t}=a,{styles:i}=s,l=i&&i.primary,n=i&&i.success,r=i&&i.secondary,{assignment_id:o,group_id:d,teams:c,teams_count:h}=e,{assignment:u,error:m,group_assignment_components:g,loading:p,loading_components:x,sort_direction:v,sort_token:f,teams_page:j,teams_page_size:_}=this.state,b=(0,N.jsx)(Dt,{barSize:5,height:32,showLabel:!1,value:null===u||void 0===u?void 0:u.completion_pct,width:32}),A=(0,N.jsx)(ze.lhZ,{color:l,size:32}),y=(0,N.jsx)(ze.A7C,{color:n,size:32}),w=(0,N.jsx)(ze.BS8,{color:r,size:32});let S=[{icon:b,label:t({id:"label.average_progress.abea593d",defaultMessage:"average progress"}),value:(0,N.jsxs)(N.Fragment,{children:[null===u||void 0===u?void 0:u.completion_pct,"%"]})},{icon:y,label:t({id:"label.completed.4ddb3e96",defaultMessage:"completed"}),value:null===u||void 0===u?void 0:u.total_completed},{icon:A,label:t({id:"label.in_progress.2b6b853c",defaultMessage:"in progress"}),value:null===u||void 0===u?void 0:u.total_in_progress},{icon:w,label:t({id:"label.not_started.7a7400f4",defaultMessage:"not started"}),value:null===u||void 0===u?void 0:u.total_not_started}];const C=e=>{let{date:s}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:s}),",\xa0",(0,N.jsx)(Gh.ib,{dayPeriod:"short",hours:"numeric",minutes:"numeric",value:s})]})},M=g&&g.find(e=>0==(null===e||void 0===e?void 0:e.order));return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearError,show:m,variant:"danger",children:m}),(0,N.jsxs)(Me.x_,{loading:p,children:[(0,N.jsx)(_I,{label:"Learners overview",children:(0,N.jsx)(VL,{stats:S})}),(0,N.jsx)("h3",{className:"mt-4 mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",id:"label.learning_modules.6e1d2fad"})}),(0,N.jsxs)(ho,{defaultSortDirection:v,defaultSortToken:f,onSort:this.handleSort,striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"order",children:(0,N.jsx)(ke.A,{defaultMessage:"Order",id:"label.order.6be09082"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"start",children:(0,N.jsx)(ke.A,{defaultMessage:"Start",id:"label.start.e4bb9f1e"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"due",children:(0,N.jsx)(ke.A,{defaultMessage:"Due date",id:"label.due_date.e1cb6d30"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"progress",children:(0,N.jsx)(ke.A,{defaultMessage:"Average progress",id:"label.average_progress.00a4f26b"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:7,loading:x,children:(0,N.jsx)(N.Fragment,{children:null!==g&&void 0!==g&&g.length?(0,N.jsx)(N.Fragment,{children:g.map((e,s)=>{const{id:a,cartridge_template:t,challenge_template:i,completion_pct:l,due:n,start:r,type:c}=e,h=`/admin/group/${d}/assignment/${o}/${a}`;let u=null,m=null;switch(c){case"challenge":m=i,u=null===i||void 0===i?void 0:i.title;break;
2case"cartridge":m=t,u=null===t||void 0===t?void 0:t.title}const g=Math.round(l),p=100===g,x=M?s+1:Number.parseInt(null===e||void 0===e?void 0:e.order);return(0,N.jsxs)(ho.Tr,{className:"cursor-pointer",onClick:e=>this.navigateToAssignment(e,h),children:[(0,N.jsx)(ho.Td,{children:x}),(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Ad,{component:m,size:24,type:c}),(0,N.jsx)(Fl,{as:"strong",className:"mb-0 ms-2",maxWidth:300,placement:"bottom",children:u||(0,N.jsx)(ke.A,{defaultMessage:"Learning module",id:"label.learning_module.7f68ddb3"})})]})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:(0,N.jsx)("span",{className:"text-capitalize",children:c})}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:r?(0,N.jsx)(C,{date:r}):"-"}),(0,N.jsx)(ho.Td,{hiddenBelow:"lg",children:n?(0,N.jsx)(C,{date:n}):"-"}),(0,N.jsx)(ho.Td,{className:"progress-column "+(p?"completed":""),hiddenBelow:"lg",children:(0,N.jsx)(Sa.A,{label:`${g}%`,now:g})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)(Le.Link,{className:"btn btn-sm btn-secondary ",to:h,children:(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})})})]},a)})}):(0,N.jsx)("tr",{children:(0,N.jsx)(ho.Td,{colSpan:7,children:(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center text-secondary p-3",children:(0,N.jsx)(ke.A,{defaultMessage:"No modules found",id:"label.no_modules_found.c165f351"})})})})})})]}),(0,N.jsx)(_I,{label:"Team snapshot",children:(0,N.jsxs)(Ce.S,{className:"mb-3 team-snapshot-cards",children:[null!==c&&void 0!==c&&c.length?c.slice((j-1)*_,j*_).map(e=>{const{id:s,completion_pct:a,members:t,name:i}=e;return(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsx)(HL,{members:t,progress:a,team_name:i})},s)}):(0,N.jsx)(Ge.A,{className:"text-center text-muted",style:{width:"100%"},children:(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(ke.A,{defaultMessage:"No teams exist for this assignment",id:"label.no_teams_exist_for_this_assignment.b497c48c"})})}),(0,N.jsx)(Ce.S,{className:"center-pagination",children:(0,N.jsx)(Lr,{count:h,onChange:e=>this.setState({teams_page:e}),page:j,page_size:_})})]})}),(0,N.jsx)(nL,{})]})]})}}var EO=(0,Ke.Ay)((0,Pe.y)((0,P.G0)(_T(UP(IO)))));class FO extends l.Component{constructor(s){super(s),this.clearErrors=()=>this.setState({error:null,validation_errors:[]}),this.clearSuccess=()=>this.setState({success:null}),this.setSuccess=e=>this.setState({success:e}),this.fetchTeamlessUsers=async()=>{try{const{admin_assignment:e,app:s}=this.props,{assignment_id:a,group_id:t}=e,i=s.api,{page_size_teamless:l,page_teamless:n}=this.state;this.setState({loading_teamless:!0});const{count:r,members:o}=await i.get(`/api/assignments/members/team-less/list/${n}/${l}`,{group_assignment_id:a,group_id:t});this.setState({count_teamless:r,loading_teamless:!1,teamless:o})}catch({err:err}){this.setState({error:err,loading_teamless:!1})}},this.fetchTeams=async()=>{try{const{admin_assignment:e,app:s}=this.props,{assignment_id:a}=e,t=s.api,{page:i,page_size:l,search_term:n,sort_direction:r,sort_token:o}=this.state;this.setState({loading_teams:!0});const{count:d,members:c,teams:h}=await t.get(`/api/facilitators/group/assignment/teams/list/${a}/${i}/${l}`,{search_term:n,sort_direction:r,sort_token:o});this.setState({count:d,loading_teams:!1,members:c,teams:h})}catch({err:err}){this.setState({error:err,loading_teams:!1})}},this.startSearch=e=>{this.setState({search_term:e.target.value}),this.search_timer&&clearTimeout(this.search_timer),this.search_timer=setTimeout(()=>{this.setState({page:1},()=>{this.fetchTeams()})},1e3)},this.handleChangePage=e=>this.setState({page:e},this.fetchTeams),this.launchDeletionConfirmation=e=>{var s;const a=null===(s=this.deletion_confirmation_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})},this.launchChangePasswordModal=e=>{var s;const a=null===(s=this.change_password_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})},this.launchTeamManager=async()=>{try{if(!(null===this||void 0===this?void 0:this.team_manager))return;const{admin_assignment:e}=this.props;await this.team_manager.show({group_assignment:null===e||void 0===e?void 0:e.assignment})}catch(e){w(e)}},this.launchRenameTeamModal=e=>{var s;const a=null===(s=this.rename_team_modal)||void 0===s?void 0:s.current;a&&a.show({team:e})}
2,this.handleDeletionSuccess=async()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.team_deleted_successfully.ee0db216",defaultMessage:"Team deleted successfully"})),await this.fetchTeams()},this.handleSort=(e,s)=>this.setState({sort_direction:s,sort_token:e},this.fetchTeams),this.handleUpdateSuccess=async()=>{const{intl:e}=this.props,{formatMessage:s}=e;this.setSuccess(s({id:"label.team_updated_successfully.6557b7f1",defaultMessage:"Team updated successfully"})),await this.fetchTeams()},this.state={count:0,count_teamless:0,error:null,loading_teamless:!1,loading_teams:!1,page:1,page_size:8,page_size_teamless:10,page_teamless:1,search_term:null,sort_direction:"ASC",sort_token:"name",success:null,teamless:[],teams:[],top_engagements:[],validation_errors:[]},this.deletion_confirmation_modal=(0,l.createRef)(),this.change_password_modal=(0,l.createRef)(),this.rename_team_modal=(0,l.createRef)(),this.team_manager=null}async componentDidMount(){await this.fetchTeams(),await this.fetchTeamlessUsers()}render(){const{admin_assignment:e,app:s}=this.props,{group:a}=e,{count:t,count_teamless:i,error:l,loading_teamless:n,loading_teams:r,members:o,page:d,page_size:c,page_size_teamless:h,page_teamless:u,search_term:m,sort_direction:g,sort_token:p,success:x,teamless:v,teams:f,validation_errors:j}=this.state;return(0,N.jsxs)(BO,{value:{count:t,handleSort:this.handleSort,launchChangePasswordModal:this.launchChangePasswordModal,launchDeletionConfirmation:this.launchDeletionConfirmation,launchRenameTeamModal:this.launchRenameTeamModal,launchTeamManager:this.launchTeamManager,loading_teamless:n,loading_teams:r,members:o,sort_direction:g,sort_token:p,teamless:v,teams:f},children:[(0,N.jsxs)(We.A,{dismissible:!0,onClose:this.clearErrors,show:l,variant:"danger",children:[l,!(null===j||void 0===j||!j.length)&&(0,N.jsx)("ul",{style:{color:"#711624"},children:j.map((e,s)=>(0,N.jsx)("li",{children:e},s))})]}),(0,N.jsx)(We.A,{dismissible:!0,onClose:this.clearSuccess,show:x,variant:"success",children:x}),(0,N.jsx)(Ce.S,{className:"team-dashboard",children:(0,N.jsxs)(_I,{className:"mt-2",count:t,label:"Teams",headerRight:(0,N.jsxs)(Ce.S,{className:"mb-2 ms-auto d-flex align-items-center justify-content-center",children:[(0,N.jsxs)(Ei.A,{className:"me-2 search-field",style:{maxWidth:342},children:[(0,N.jsx)(Ei.A.Text,{children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{onChange:this.startSearch,placeholder:"Search teams",value:m||""})]}),s.userHasRight("manage_team",null===a||void 0===a?void 0:a.organization_id)&&(0,N.jsx)(ve.A,{onClick:this.launchTeamManager,style:{marginLeft:10,minWidth:160},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Manage teams",id:"label.manage_teams.9e1a8a9d"})})]}),children:[(0,N.jsx)(LO,{}),(0,N.jsx)(Lr,{count:t,onChange:this.handleChangePage,page:d,page_size:c})]})}),(0,N.jsxs)(Ce.S,{className:"mt-5",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Unassigned users",id:"label.unassigned_users.f0f3c7d9"})}),(0,N.jsx)(HO,{}),(0,N.jsx)(Lr,{count:i,onChange:e=>this.setState({page_teamless:e},this.fetchTeamlessUsers),page:u,page_size:h})]}),(0,N.jsx)(rc,{group:a,ref:e=>this.team_manager=e,onSuccess:()=>{this.fetchTeams(),this.fetchTeamlessUsers()}}),(0,N.jsx)(GO,{onSuccess:this.handleDeletionSuccess,ref:this.deletion_confirmation_modal}),(0,N.jsx)(KO,{onSuccess:this.handleUpdateSuccess,ref:this.change_password_modal}),(0,N.jsx)(qO,{onSuccess:this.handleUpdateSuccess,ref:this.rename_team_modal})]})}}var RO=(0,P.G0)((0,Ke.Ay)(_T(UP(FO))));const DO=l.createContext({}),BO=DO.Provider,PO=(DO.Consumer,()=>(0,l.useContext)(DO));var LO=e=>{const{handleSort:s,loading_teams:a,sort_direction:t,sort_token:i,teams:l}=PO();return(0,N.jsxs)(ho,{defaultSortDirection:t,defaultSortToken:i,onSort:s,striped:!1,textResize:!0,children:[(0,N.jsx)(ho.Thead,{className:"text-start",children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Members",id:"label.members.1044a4c0"})}),(0,N.jsx)(ho.Th,{sortable:!0,hiddenBelow:"lg",name:"progress",children:(0,N.jsx)(ke.A,{defaultMessage:"Progress",id:"label.progress.4664827f"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Actions",id:"label.actions.ff8059dc"})})]})}),(0,N.jsx)(ho.Tbody,{cols:4,loading:a,children:l.length?(0,N.jsx)(N.Fragment,{children:l.map((e,s)=>(0,N.jsx)(OO,{ind:s,team:e},s))}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No teams found.",id:"label.no_teams_found.8dc7751d"})})})})]})};var OO=e=>{var s,a,t;const{ind:i,team:l}=e,{id:n,completed:r,completion_pct:o,name:d}=l,{userHasRight:c}=(0,P.nm)(),{assignment:h,assignment_component:u,group:m,handleLaunchFacilitation:g}=QP(),{launchChangePasswordModal:p,launchDeletionConfirmation:x,launchRenameTeamModal:v,members:f}=PO(),j=f&&f[i]?f[i].map(e=>Kd(e)):[],_=null===l||void 0===l||null===(s=l.members)||void 0===s?void 0:s[0],b=((null===_||void 0===_||null===(a=_.group_member_assignment)||void 0===a?void 0:a.group_member_assignment_components)||[]).find(e=>(null===e||void 0===e?void 0:e.group_assignment_component_id)===(null===u||void 0===u?void 0:u.id)),A=(null===u||void 0===u?void 0:u.type)||null;return(0,N.jsxs)(io,{children:[(0,N.jsxs)(ro,{className:"team-column",style:{maxWidth:200},children:[(!b||"challenge"!=A)&&(0,N.jsx)("strong",{children:d}),b&&"challenge"==A&&(0,N.jsx)("strong",{children:(0,N.jsx)(Le.Link,{to:`/admin/group/${null===m||void 0===m?void 0:m.id}/assignment/${null===h||void 0===h?void 0:h.id}/challenge/${null===u||void 0===u?void 0:u.id}/view/${null===b||void 0===b?void 0:b.challenge_id}`,children:d})})]}),(0,N.jsx)(ro,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsx)(tn,{users:j})})}),(0,N.jsxs)(ro,{className:"progress-column "+(r?"completed":""),hiddenBelow:"lg",children:[(0,N.jsx)(Sa.A,{label:`${o}%`,now:o}),r&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Completed",id:"label.completed.22a970d2"})})]}),(0,N.jsx)(ro,{className:"text-end",children:c("manage_team",null===m||void 0===m?void 0:m.organization_id)&&(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:["challenge"===(null===h||void 0===h?void 0:h.type)&&!(null===l||void 0===l||null===(t=l.members)||void 0===t||!t.length)&&(0,N.jsxs)(ve.A,{onClick:()=>g(l,b),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.$hd,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Facilitate",id:"label.facilitate.b7fbd970"})]}),(0,N.jsxs)(ve.A,{onClick:()=>v(l),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})]}),(0,N.jsxs)(ve.A,{onClick:()=>p(l),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.pXu,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Password",id:"label.password.e7cf3ef4"})]}),(0,N.jsxs)(ve.A,{onClick:()=>x(l),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},n)};var HO=e=>{const{loading_teamless:s,teamless:a}=PO();return(0,N.jsxs)(ho,{striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner",id:"label.learner.0815286c"})})})}),(0,N.jsx)(ho.Tbody,{cols:3,loading:s,children:null!==a&&void 0!==a&&a.length?(0,N.jsx)(N.Fragment,{children:a.map((e,s)=>{var a,t;const i=null===e||void 0===e||null===(a=e.group_member)||void 0===a||null===(t=a.organization_member)||void 0===t?void 0:t.user,l=(null===i||void 0===i?void 0:i.fullname)||"--";return(0,N.jsx)(ho.Tr,{children:(0,N.jsxs)(ho.Td,{children:[(0,N.jsx)(Ya,{className:"me-2",size:25,user:i})," ",l]})},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:"1",children:(0,N.jsx)(ke.A,{defaultMessage:"All learners are assigned.",id:"label.all_learners_are_assigned.7865005d"})})})})]})},UO={General:EO,Learners:SO,Settings:zL,Teams:RO};var QO=e=>{const{active_key:s,assignment:a,assignment_component_type:t,current_dashboard:i,setActiveTab:l,updateRouteParam
2s:n}=QP(),{allow_teams:r}=a||{},o=["single_cartridge","single_challenge"].includes(i),d=t||"journey",c={home:{icon:(0,N.jsx)(ze.rQ8,{size:13}),label:(0,N.jsx)(ke.A,{defaultMessage:"Main",id:"label.main.eb814be3"}),title:"Main"},learners:{icon:(0,N.jsx)(ze.YXz,{size:13}),label:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"}),title:"Learners"},settings:{icon:(0,N.jsx)(ze.Pcn,{size:13}),label:(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"}),title:"Settings"},teams:{icon:(0,N.jsx)(ze.M5n,{size:13}),label:(0,N.jsx)(ke.A,{defaultMessage:"Teams",id:"label.teams.1e1a1c07"}),title:"Teams"}},h={cartridge:{home:(0,N.jsx)(wO.General,{}),learners:o?(0,N.jsx)(UO.Learners,{}):(0,N.jsx)(wO.Learners,{}),settings:o?(0,N.jsx)(UO.Settings,{}):(0,N.jsx)(wO.Settings,{}),teams:r?o?(0,N.jsx)(UO.Teams,{}):(0,N.jsx)(wO.Teams,{}):null},challenge:{home:(0,N.jsx)(gO.General,{}),learners:(0,N.jsx)(gO.Learners,{}),settings:o?(0,N.jsx)(UO.Settings,{}):(0,N.jsx)(gO.Settings,{}),teams:r?o?(0,N.jsx)(UO.Teams,{}):(0,N.jsx)(gO.Teams,{}):null},journey:{home:(0,N.jsx)(UO.General,{}),learners:(0,N.jsx)(UO.Learners,{}),settings:(0,N.jsx)(UO.Settings,{}),teams:r?(0,N.jsx)(UO.Teams,{}):null}},u=e=>{var s;return!(null===h||void 0===h||null===(s=h[d])||void 0===s||!s[e])},m=()=>(0,N.jsx)(N.Fragment,{children:Object.keys(c).map(e=>{if(!u(e))return(0,N.jsx)(N.Fragment,{});let{icon:s,label:a}=c[e];return(0,N.jsx)(aa.A.Item,{children:(0,N.jsxs)(aa.A.Link,{className:"d-flex align-items-center gap-1",eventKey:e,href:`#${e}`,children:[s,a]})},e)})}),g=()=>(0,N.jsx)(N.Fragment,{children:Object.keys(c).map((e,s)=>{var a;return u(e)?(0,N.jsx)(ld.A.Pane,{eventKey:e,children:null===h||void 0===h||null===(a=h[d])||void 0===a?void 0:a[e]},e):(0,N.jsx)(N.Fragment,{})})});return(0,N.jsxs)(ld.A.Container,{activeKey:s,defaultActiveKey:"home",id:"admin-tabs",mountOnEnter:!0,onSelect:e=>{l(e),n(!0)},unmountOnExit:!0,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsx)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:(0,N.jsx)(m,{})})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsx)(ld.A.Content,{children:(0,N.jsx)(g,{})})})})]})};const VO=(0,l.forwardRef)((e,s)=>{const{onHide:a,onSuccess:t}=e,[i,n,r]=(0,ne.CQ)({error:null,loading:!1,show:!1,team:null}),{deleteTeam:o}=QP(),d=e=>{n({show:!0,team:null===e||void 0===e?void 0:e.team})},c=()=>{r(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>r,[]);const{loading:h,show:u,team:m}=i;return(0,N.jsxs)(xe,{onHide:c,show:u,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Delete team",id:"label.delete_team.9ff59cd4"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this team and all associated records?",id:"label.are_you_sure_you_want_to_delete_th.71dc6c85"})}),(0,N.jsx)("p",{className:"font-weight-bold text-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"This action cannot be undone.",id:"label.this_action_cannot_be_undone.3d6a4526"})}),(0,N.jsxs)(Ge.A,{className:"px-3 py-2 mb-4",children:[(0,N.jsx)("strong",{children:null===m||void 0===m?void 0:m.name}),(0,N.jsx)(tn,{offset:0,users:(()=>{var e,s;return(null===m||void 0===m||null===(e=m.members)||void 0===e||null===(s=e.map)||void 0===s?void 0:s.call(e,e=>Kd(e)).filter(Boolean))||[]})()})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"me-3",onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{loading:h,onClick:async()=>{var e;n({loading:!0}),"function"===typeof o&&await o(null===i||void 0===i||null===(e=i.team)||void 0===e?void 0:e.id),n({loading:!1}),"function"===typeof t&&t(),c()},variant:"danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})]})});VO.displayName="DeletionConfirmationModal";var GO=VO;const WO=(0,l.forwardRef)((e,s)=>{const{onHide:a,onSuccess:t}=e,[i,n,r]=(0,ne.CQ)({error:null,loading:!1,show:!1,team:null}),{changeTeamPassword:o}=QP(),d=e=>{n({current_password:null===e||void 0===e?void 0:e.current_password,show:!0,team:null===e||void 0===e?void 0:e.team})},c=()=>{r(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>r,[]);const{show:h,team:u}=i;return(0,N.jsxs)(xe,{onHide:c,show:h,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Manage team password",id:"label.manage_team_password.d21a64ca"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{"function"===typeof o&&await o(null===u||void 0===u?void 0:u.id,null===e||void 0===e?void 0:e.password),"function"===typeof t&&t(),c()},initialValues:{password:""},children:e=>{let{handleChange:s,handleSubmit:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:a,style:{minWidth:"100%"},children:[(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Current password",id:"label.current_password.72ed2bd7"})}),null!==u&&void 0!==u&&u.password?(0,N.jsx)("p",{children:u.password}):(0,N.jsx)("p",{children:(0,N.jsx)("em",{children:(0,N.jsx)(ke.A,{defaultMessage:"No password",id:"label.no_password.56b9e00d"})})})]})}),(0,N.jsxs)(Ve.A,{className:"mt-4",sm:12,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"New password",id:"label.new_password.3dd9df44"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"password",className:"form-control",name:"password",onChange:s,placeholder:"Enter new password",type:"password",value:t.password})]}),(0,N.jsx)("p",{children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"An empty password will disable password protection for the team",id:"label.an_empty_password_will_disable_pas.ed684796"})})})]})]})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});
2WO.displayName="ChangePasswordModal";var KO=WO;const YO=(0,l.forwardRef)((e,s)=>{const{onHide:a,onSuccess:t}=e,{locale:i}=(0,P.nm)(),[n,r,o]=(0,ne.CQ)({error:null,loading:!1,show:!1,team:null}),{updateTeamName:d}=QP(),c=e=>{r({show:!0,team:null===e||void 0===e?void 0:e.team})},h=()=>{o(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:h,show:c})),(0,l.useEffect)(()=>o,[]);const{show:u,team:m}=n;return(0,N.jsxs)(xe,{onHide:h,show:u,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Rename team",description:"",id:"label.rename_team.df507267"})})}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,initialValues:{name:null===m||void 0===m?void 0:m.name},onSubmit:async e=>{"function"===typeof d&&await d(null===m||void 0===m?void 0:m.id,null===e||void 0===e?void 0:e.name),"function"===typeof t&&t(),h()},validationSchema:(0,Re.by)({locale:i,scope:"team.team_name"}),children:e=>{var s;let{errors:a,handleChange:t,handleSubmit:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,style:{minWidth:"100%"},children:[(0,N.jsx)(xe.Body,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Current name",id:"label.current_name.0619bd60"})}),(0,N.jsx)(_e.A.Control,{name:"name",onChange:t,placeholder:"Enter a team name...",value:l.name}),(0,N.jsx)(EB,{length:(null===l||void 0===l||null===(s=l.name)||void 0===s?void 0:s.length)||0,max:50,min:3}),a.name&&(0,N.jsx)(_e.A.Control.Feedback,{style:{display:"block"},type:"invalid",children:a.name})]})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:h,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});YO.displayName="RenameTeamModal";var qO=YO;const JO=(0,l.forwardRef)((s,a)=>{const[t,i,n]=(0,ne.CQ)({error:null,loading:!1,scorm_version:"scorm2004"}),{assignment_id:r,group_id:o}=QP(),d=(e,s)=>{if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(e,s);else{const a=URL.createObjectURL(e),t=document.createElement("a");t.href=a,t.download=s,document.body.appendChild(t),t.click(),setTimeout(()=>{document.body.removeChild(t),window.URL.revokeObjectURL(a)},0)}};(0,l.useEffect)(()=>n,[]);const c=[{name:"SCORM 1.2",value:"scorm12"},{name:"SCORM 2004",value:"scorm2004"}];let h=()=>(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"ms-2 me-5",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"Recommended",description:"",id:"label.recommended.d70604e8"})});const u=c.map((e,s)=>(0,N.jsx)(li.A.Item,{eventKey:e.value,onClick:s=>{i({scorm_version:e.value})},children:(0,N.jsxs)("div",{className:"scorm-option",children:[e.name,"scorm2004"==e.value&&(0,N.jsx)(h,{})]})},s));return(0,N.jsxs)(Ce.S,{className:"assignment-scorm-settings",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:9,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"About our SCORM packages",description:"",id:"label.about_our_scorm_packages.aa0da864"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"The following SCORM package is linked to this organization and this assignment in Solvably. Learners will be asked to log in or register an account with Solvably when they first open the SCORM assignment.",description:"",id:"label.the_following_scorm_package_is_lin.9a7451c0"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"If the assignment contains a team challenge, we recommend adding learners in Solvably and placing them into teams prior to allowing access to the assignment.",description:"",id:"label.if_the_assignment_contains_a_team.2680a5d6"})}),(0,N.jsx)("p",{className:"mb-1",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Download",description:"",id:"label.download.d6eafe82"})})})]})}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"pe-0",md:4,children:(0,N.jsxs)(li.A,{className:"scorm-options",children:[(0,N.jsx)(li.A.Toggle,{className:"text-start",variant:"secondary",children:(e=>{const s=c.filter((s,a)=>s.value===e);return s.length>0?(0,N.jsxs)("span",{children:[s[0].name,"scorm2004"==e&&(0,N.jsx)(h,{})]}):"Select version"})(t.scorm_version)}),(0,N.jsx)(li.A.Menu,{children:u})]})}),(0,N.jsx)(Ve.A,{className:"ps-2",md:5,children:(0,N.jsxs)(ve.A,{className:"align-self-center",onClick:async()=>{try{var s,a;const{scorm_version:e}=t;i({loading:!0});const l=await fetch("/api/scorm/generate-bundle",{body:JSON.stringify({group_assignment_id:r,group_id:o,scorm_version:e}),headers:{Accept:"application/x-zip, application/json","Content-Type":"application/json"},method:"POST"});switch(null===l||void 0===l||null===(s=l.headers)||void 0===s||null===(a=s.get)||void 0===a?void 0:a.call(s,"Content-Type")){case"application/x-zip":const e=l.headers.get("Content-Disposition"),s=e.split(";")[1].split("=")[1],a=await l.blob();d(a,s);break;case"application/json":case"application/json; charset=utf-8":const{message:t,success:i}=await l.json();if(!i)throw t}i({loading:!1})}catch(e){w(e),i({error:(null===e||void 0===e?void 0:e.message)||e,loading:!1})}},children:[(0,N.jsx)(ze.WCW,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Download SCORM",description:"",id:"label.download_scorm.950eace3"})]})})]}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:9,children:(0,N.jsxs)(We.A,{className:"d-flex p-3 mt-3",variant:"secondary",children:[(0,N.jsx)(ze.gZZ,{className:"text-primary mt-3 me-3"}),(0,N.jsxs)("p",{className:"mb-0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Having trouble? You may need to add",description:"",id:"label.having_trouble_you_may_need_to_add.8df56c76"})," ",(0,N.jsx)("strong",{children:"solvably.com"})," ",(0,N.jsx)(ke.A,{defaultMessage:"as an exception to your firewall. If you still need help, feel free to",de
2scription:"",id:"label.as_an_exception_to_your_firewall_i.6aba21ef"}),(0,N.jsx)(Le.Link,{to:"/support",children:(0,N.jsx)(ke.A,{defaultMessage:"contact support",description:"",id:"label.contact_support.d80b0824"})}),"."]})]})})})]})});var XO=JO;const ZO=(0,l.createContext)({}),$O=ZO.Provider,eH=ZO.Consumer,sH=e=>class extends e{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(eH,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin_team:s,ref:e=>{this.comp=e}}))})}};ZO.displayName="AdminTeamContext";const aH=()=>(0,l.useContext)(ZO),tH=["children","className","context","onClick"],{binary:{parseBinary:iH}}=Re._$,lH=s=>{const{children:a,className:t,context:i,onClick:l}=s,n=(0,he.A)(s,tH),[r,o]=(0,ne.CQ)({error:null,loading:!1,trigger_eval:iH(window.sessionStorage.getItem("trigger_eval"))}),{error:d,loading:c,trigger_eval:h}=r,{api:u}=(0,P.nm)(),m=aH(),g=(null===s||void 0===s?void 0:s.assignment_component)||(null===m||void 0===m?void 0:m.assignment_component),p=(null===s||void 0===s?void 0:s.team)||(null===m||void 0===m?void 0:m.team),x=null===m||void 0===m?void 0:m.challenge_id,v=async()=>{try{o({error:null,loading:!0});const e=null===g||void 0===g?void 0:g.id,s=null===p||void 0===p?void 0:p.id,{dump:a}=await u.get("/api/certifications/json-dump",{group_assignment_component_id:e,team_id:s}),t=new Blob([JSON.stringify(a)],{type:"application/json"}),i=URL.createObjectURL(t),l=`Solvably Solution Data - ${(null===p||void 0===p?void 0:p.name)||"Unknown Team"} - ${ci()().format()}`,n=document.createElement("a");n.href=i,n.download=l,document.body.appendChild(n),n.click(),setTimeout(()=>{document.body.removeChild(n),window.URL.revokeObjectURL(i)},0),o({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}},f=oa()("team-report-request-button d-flex gap-1 align-items-center align-self-start",t);return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:d,variant:"danger",children:d}),(0,N.jsx)(Me.p0,(0,F.A)((0,F.A)({className:f,loading:c,loading_label:"Downloading...",onClick:h?async()=>{try{o({error:null,loading:!0}),await u.post("/api/certifications/trigger-evaluation-request",{challenge_id:x}),o({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o({error:a,loading:!1})}}:v},n),{},{children:a?(0,N.jsx)(N.Fragment,{children:a}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.i3g,{}),h?(0,N.jsx)(ke.A,{defaultMessage:"Trigger evaluation",id:"label.trigger_evaluation.ddda4111"}):(0,N.jsx)(ke.A,{defaultMessage:"Download JSON",id:"label.download_json.49e0e6d5"})]})}))]})};class nH extends l.Component{constructor(e){super(e),this.state={hidden_user_series_ids:[]}}render(){const{app:e,data:s,height:a,members:t,show_users:i,width:n}=this.props,{hidden_user_series_ids:r}=this.state;if(!t)return(0,N.jsx)(Ce.S,{children:"N/A"});const{styles:o}=e,d=[o&&o["report-blue"],"#D6A4FF",o&&o["gray-400"],"#FFD400",o&&o.brand_orange,o&&o.brand_teal,o&&o.brand_lime];return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{height:a,margin:"auto",width:n},children:(0,N.jsx)(jt.u,{height:a,width:"100%",children:(0,N.jsxs)(Vw.b,{data:s,margin:{bottom:5,left:20,right:30,top:5},children:[(0,N.jsx)(bt.d,{strokeDasharray:"3 3"}),(0,N.jsx)(At.W,{dataKey:"name"}),(0,N.jsx)(yt.h,{}),(0,N.jsx)(wt.m,{}),t&&t.map((e,s)=>{const{id:a,user:t}=e;if(-1!==r.indexOf(a))return(0,N.jsx)(l.Fragment,{},a);const i=t&&t.fullname;return(0,N.jsx)(Gw.N,{dataKey:i,stroke:d[s],type:"monotone"},i)})]})})}),(0,N.jsx)(Ce.S,{className:"vertical-scroll",children:i&&(0,N.jsx)(Ce.S,{children:t&&t.map((e,s)=>{const{id:a,user:t}=e,i=-1!==r.indexOf(a);return(0,N.jsxs)(ve.A,{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variant:"link",onClick:e=>{e.preventDefault(),this.setState(e=>{const s=e.hidden_user_series_ids.indexOf(a);return-1===s?e.hidden_user_series_ids.push(a):e.hidden_user_series_ids.splice(s,1),e})},children:[i?(0,N.jsx)(ze.EaG,{style:{color:d[s%7],marginRight:7.5}}):(0,N.jsx)(ze.A7C,{style:{color:d[s%7],marginRight:7.5}}),(0,N.jsx)(Ya,{size:25,style:{marginRight:7.5},user:t}),t&&(0,N.jsx)("span",{children:t.fullname})]},a)})})})]})}}nH.defaultProps={height:350,show_users:!0,width:"100%"};var rH=(0,n.G0)(nH);class oH extends l.Component{constructor(e){super(e),this._isMounted=!1;const s=this.props.admin_team&&this.props.admin_team.team,a=ci()(new Date),t=a.clone().subtract(30,"days");this.state={asset_count:0,end_date:a.toDate().getTime(),most_active_member:null,most_active_member_time:null,most_uploaded:"Messages",start_date:t.toDate().getTime(),team_id:s&&s.id,tmap_range:"month"}}refreshAnyDayTMAP(){const{app:e}=this.props,{api:s}=e;let{end_date:a,start_date:t,team_id:i}=this.state;t=ci()(t).toISOString(),a=ci()(a).toISOString(),s.get(`/api/facilitators/groups/assignment/team/learners/tmap/count-any-date/${i}/${t}/${a}`).then(e=>{let{team_members_tmaps:s}=e;this._isMounted&&this.setState({team_members_tmaps:s},()=>{this.formatAnyData()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}formatAnyData(){var e,s;const{admin_team:a}=this.props,{team:t}=a,{members:i}=t,{end_date:l,start_date:n,team_members_tmaps:r}=this.state,o=null===Re._$||void 0===Re._$||null===(e=Re._$.time)||void 0===e?void 0:e.convertSeconds,d=ci()(n),c=ci()(l).diff(d,"days"),h=[];for(let x=0;x<c;x++){const e={};for(const s in r){var u;const a=r[s]||[],t=i.find(e=>e.id==s),l=(null===t||void 0===t||null===(u=t.user)||void 0===u?void 0:u.fullname)||"NA",n=a[x];e[l]=Math.round(n/3600*100)/100||0}e.name=ci()(l).endOf("day").subtract(c,"days").add(x+1,"days").endOf("day").format("MMMM Do"),h.push(e)}let m=null,g=0,p=0;for(const x in r){const e=r[x]||[],s=i.find(e=>e.id==x),a=e.reduce((e,s)=>e+s,0);a>g&&(g=a,m=s),p+=a}this.setState({days_number:c,most_active_member:null===(s=m)||void 0===s?void 0:s.user,past_range_agg:o(p),selected_data:h})}componentDidMount(){this._isMounted=!0,this.refreshAnyDayTMAP()}componentWillUnmount(){this._isMounted=!1}render(){const{days_number:e,end_date:s,most_active_member:a,past_range_agg:t,selected_data:i,start_date:l,tmap_range:n}=this.state,{admin_team:r,app:o}=this.props,{team:d}=r,c=d&&d.members;return(0,N.jsxs)(Ce.S,{className:"time-on-platform-outer-container",children:[(0,N.jsx)(Ce.S,{className:"time-on-platform-inner-container",children:(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)(Ce.S,{className:"filters-container",children:(0,N.jsxs)(Ce.S,{className:"filters-container",style:{width:"100%"},children:[(0,N.jsx)("p",{className:"me-auto mb-0",children:(0,N.jsxs)("b",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Time on platform by",description:"",id:"label.time_on_platform_by.f3bce4bb"})," ",d&&d.name]})}),(0,N.jsxs)(ve.A,{className:"float-end",variant:"primary",onClick:()=>{this.picker&&this.picker.show({end_date:s,selected_range:n,start_date:l})},children:[ci()(l).format("MMM DD, YYYY")," - ",ci()(s).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,start_date:t,tmap_range:a}),this.refreshAnyDayTMAP()}})]})})})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{className:"statistics-body",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistics-outer-container",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsx)(jr,{path:"calendar_icon/calendar_icon_black.svg",size:15}),(0,N.jsxs)("small",{children:[e," days"]})]}),(0,N.jsxs)("strong",{children:[t&&t.value?t.value:"-"," ",t&&t.value?t.label:"-"]})]}),(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsx)(jr,{path:"users_icon/users-mm.svg",size:15}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most active learner",description:"",id:"label.most_active_learner.91ebc907"})})]}),(0,N.jsx)("strong",{children:a?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ya,{size:25,style:{marginRight:10},user:a})," ",a&&(0,N.jsx)(qA,{user:a})]}):"-"})]})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(rH,{app:o,data:i,members:c})})]})]})}}oH.defaultProps={teams:[{name:"Team Awesome"}]};var dH=(0,n.G0)(_T(sH(oH)));class cH extends l.Component{constructor(e){super(e),this.state={asset_count:0,end_date:ci()().toDate().getTime(),most_engaged_team:null,most_engaged_user:null,most_uploaded:"Messages",start_date:ci()().subtract(30,"days").toDate().getTime()},this.picker=null}refreshMostEngagedLearner(){const{admin_team:e,app:s}=this.props,{assignment_id:a,group_id:t,team_id:i}=e,{api:l}=s;l.get("/api/assignments/members/list/1/1",{group_assignment_id:a,group_id:t,scope:"team",sort_direction:"DESC",sort_token:"engagements",team_id:i}).then(async e=>{let{count:s,members:a}=e;const t=a&&a[0]&&a[0].group_member&&a[0].group_member.organization_member&&a[0].group_member.organization_member.user;this.setState({most_engaged_user:t})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}refreshEngagements(){const{admin_team:e,app:s}=this.props,{assignment_component_id:a,team_id:t}=e,{api:i}=s;i.get(`/api/facilitators/groups/assignment/teams/engagements/count/${a}`,{filter_team_id:t}).then(e=>{let{docs_count:s,files_count:a,images_count:t,messages_count:i,videos_count:l}=e,{most_uploaded:n}=this.state;a>i&&(n="Files"),this.setState({asset_count:a+i,docs_count:s,files_count:a,images_count:t,messages_count:i,most_uploaded:n,videos_count:l})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}refreshAnyDayEngagements(){const{admin_team:e,app:s}=this.props,{assignment_component_id:a,team_id:t}=e,{api:i}=s;let{end_date:l,start_date:n}=this.state;n=ci()(n).toISOString(),l=ci()(l).toISOString(),i.get(`/api/facilitators/groups/assignment/teams/engagements/count-any-date/${a}/${n}/${l}`,{filter_team_id:t}).then(e=>{let{any_days_report_docs:s,any_days_report_files:a,any_days_report_images:t,any_days_report_messages:i,any_days_report_videos:l}=e;this.setState({any_days_report_docs:s,any_days_report_files:a,any_days_report_images:t,any_days_report_messages:i,any_days_report_videos:l},()=>{this.formatAnyData()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}formatAnyData(){const{any_days_report_docs:e,any_days_report_images:s,any_days_report_messages:a,any_days_report_videos:t,end_date:i}=this.state,l=(null===s||void 0===s?void 0:s.length)||0,n={docs:0,images:0,messages:0,video:0},r=[];for(let u=0;u<l;u++){const o=s[u],d=t[u],c=e[u],h=a[u],m=ci()(i).endOf("day").subtract(l,"days").add(u+1,"days").endOf("day").format("MMMM Do");r.push({document:(null===c||void 0===c?void 0:c.length)||0,image:(null===o||void 0===o?void 0:o.length)||0,messages:(null===h||void 0===h?void 0:h.length)||0,name:m,video:(null===d||void 0===d?void 0:d.length)||0}),n.video+=(null===d||void 0===d?void 0:d.length)||0,n.messages+=(null===h||void 0===h?void 0:h.length)||0,n.docs+=(null===c||void 0===c?void 0:c.length)||0,n.images+=(null===o||void 0===o?void 0:o.length)||0}const o=Math.max(n.video,n.messages,n.docs,n.images);let d="-";n.video==o?d="Video":n.messages==o?d="Messages":n.docs==o?d="Document":n.images==o&&(d="Image");const c=n.video+n.messages+n.docs+n.images,h=l;this.setState({most_uploaded_asset:d,past_n_days:h,past_n_days_total:c,selected_data:r})}componentDidMount(){this.refreshAnyDayEngagements(),this.refreshEngagements(),this.refreshMostEngagedLearner()}render(){const{admin_team:e}=this.props,{team:s}=e,{end_date:a,engagement_range:t,most_engaged_user:i,most_uploaded_asset:l,past_n_days:n,past_n_days_total:r,selected_data:o,start_date:d}=this.state;return(0,N.jsxs)(Ce.S,{className:"engagement-tab-outer-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsx)(Ce.S,{className:"filters-container mt-2",children:(0,N.jsxs)(Ce.S,{className:"filters-container",children:[(0,N.jsx)("p",{className:"me-1 mb-0 me-auto",children:(0,N.jsxs)("b",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Engagement by",description:"",id:"label.engagement_by.53aae19e"})," ",null===s||void 0===s?void 0:s.name]})}),(0,N.jsxs)(Ce.S,{className:"filter-time",children:[(0,N.jsxs)(ve.A,{className:"float-end",variant:"primary",onClick:()=>{this.picker&&this.picker.show({end_date:a,selected_range:t,start_date:d})},children:[ci()(d).format("MMM DD, YYYY")," - ",ci()(a).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,engagement_range:a,start_date:t}),this.refreshAnyDayEngagements()}})]})]})})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{className:"statistics-body",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistics-outer-container",children:[(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsx)(jr,{path:"calendar_icon/calendar_icon_black.svg",size:15}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"{past_n_days} days",description:"",id:"label.past_n_days_days.1332c289",values:{past_n_days:n}})})]}),(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"{past_n_days_total} Assets",description:"",id:"label.past_n_days_total_assets.dcfe4325",values:{past_n_days_total:r}})})]}),(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsx)(jr,{path:"users_icon/users-mm.svg",size:15}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most engaged learner",description:"",id:"label.most_engaged_learner.c46e9bf0"})})]}),(0,N.jsxs)("strong",{children:[(0,N.jsx)(Ya,{size:20,style:{height:20,marginRight:10,width:20},user:i}),i&&(0,N.jsx)(qA,{user:i})]})]}),(0,N.jsxs)(Ce.S,{className:"featured-statistic mx-auto",children:[(0,N.jsxs)(Ce.S,{className:"header",children:[(0,N.jsx)(jr,{path:"comment_icon/comment-black.svg",size:15}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Most uploaded asset",description:"",id:"label.most_uploaded_asset.6282b4a2"})})]}),(0,N.jsx)("strong",{children:l})]})]}),(0,N.jsx)(Ce.S,{className:"stacked-bar-outer-container",children:(0,N.jsx)(YL,{data:o})})]})]})}}var hH=(0,Ke.Ay)((0,n.G0)(_T(sH(cH))));class uH extends l.Component{render(){const{admin_team:e}=this.props,{assignment:s,challenge:a,team:t}=e;return null!==s&&void 0!==s&&s.enable_grading?(0,N.jsxs)(Ce.S,{className:"four-c-tab-outer-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsxs)(Ce.S,{className:"filters-container",children:[(0,N.jsx)(Ce.S,{className:"filter-subject",children:(0,N.jsx)("p",{className:"me-1 mt-3",style:{whiteSpace:"nowrap"},children:(0,N.jsxs)("b",{children:["4Cs by ",t&&t.name]})})}),(0,N.jsx)(Ce.S,{className:"expandable-description",children:(0,N.jsx)("p",{children:(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"The four C\u2019s of 21st Century skills are some of the most popular learning strategies in today\u2019s environment: Critical Thinking, Communication, Creativity, Collaboration.",description:"",id:"label.the_four_cs_of_21st_century_skills.745a7166"})})})})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"statistics-body",children:(0,N.jsx)(Ce.S,{className:"four-c-radar-outer-container",children:(0,N.jsx)(cO,{challenge:a,team:t})})})]}):null}}var mH=(0,n.G0)(_T(sH(uH)));class gH extends l.Component{render(){var e;const{admin_team:s}=this.props,a=!(null===s||void 0===s||null===(e=s.assignment)||void 0===e||!e.enable_grading);return(0,N.jsx)(Ce.S,{className:"team-results-outer-container plain-tabs",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"time",id:"admin-tabs",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,
2N.jsx)(aa.A.Link,{eventKey:"time",children:(0,N.jsx)(ke.A,{defaultMessage:"Time on Platform",description:"",id:"label.time_on_platform.5b37e89a"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"engagement",children:(0,N.jsx)(ke.A,{defaultMessage:"Engagement",description:"",id:"label.engagement.ea68771a"})})}),a&&(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"4cs",children:(0,N.jsx)(ke.A,{defaultMessage:"4C's",description:"",id:"label.4cs.ca5dd165"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"time",children:(0,N.jsx)(dH,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"engagement",children:(0,N.jsx)(hH,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"4cs",children:(0,N.jsx)(mH,{})})]})]})})}}var pH=(0,Ke.Ay)((0,n.G0)(_T(UP(sH(gH)))));class xH extends l.Component{constructor(e){super(e),this.state={error:null,loading:!1,saving:!1,selected_team:null,selected_team_challenge:null}}loadTeamTMAP(){const{admin_team:e,app:s}=this.props,{challenge:a,team_id:t}=e;this.setState({error:null,loading:!0}),s.api.get(`/api/teams/tmap_total/${t}`,{filter_challenge_id:null===a||void 0===a?void 0:a.id}).then(e=>{let{team:s}=e;this.setState({loading:!1,tmap_total:s&&s.tmap_total})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}loadTeamEngagements(){const{admin_team:e,app:s}=this.props,{assignment_component_id:a,team_id:t}=e;this.setState({error:null,loading:!0}),s.api.get(`/api/facilitators/groups/assignment/teams/engagements/count/${a}`,{filter_team_id:t}).then(e=>{let{files_count:s,messages_count:a}=e;this.setState({files_count:s,loading:!1,messages_count:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})})}handleFacilitation(e){const{app:s}=this.props;s.api.post("/api/teams/members/facilitator/add",{team_id:e&&e.id}).then(e=>{})}componentDidMount(){this.loadTeamTMAP(),this.loadTeamEngagements()}render(){var e;const{admin_team:s,intl:a}=this.props,{formatMessage:t}=a,{challenge:i,team:l}=s,{files_count:n,messages_count:r,tmap_total:o}=this.state,d=i?null===i||void 0===i?void 0:i.completion_pct:0,c=Array.isArray(null===l||void 0===l?void 0:l.members)?l.members:[],{convertSeconds:h}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{};let u=(0,N.jsx)(Dt,{fontSize:12,height:32,showLabel:!1,value:d,width:32});const m=null===i||void 0===i||null===(e=i.members)||void 0===e?void 0:e[0],g=null===m||void 0===m?void 0:m.group_member_assignment_component;let p=h(o),x=[{icon:u,label:t({id:"label.overall_progress.58be7c76",defaultMessage:"overall progress"}),value:(0,N.jsxs)(N.Fragment,{children:[d,"%"]})},{icon:(0,N.jsx)(ze.w_X,{color:"#808080",size:32}),label:t({id:"label.time_online.655f0753",defaultMessage:"time online"}),value:`${p&&p.value?p.value:"-"} ${p&&p.value?"Hours"===p.label?"hrs":p.label:"-"}`},{icon:(0,N.jsx)(ze.g5D,{color:"#808080",size:32}),label:t({id:"label.messages_sent.476ff7fc",defaultMessage:"messages sent"}),value:r},{icon:(0,N.jsx)(ze.M1W,{color:"#808080",size:32}),label:t({id:"label.files_uploaded.67ffafb2",defaultMessage:"files uploaded"}),value:n}];return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error}),this.state.loading&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!this.state.loading&&(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(_I,{label:t({id:"label.overview.d4b1ea57",defaultMessage:"Overview"}),children:(0,N.jsx)(VL,{stats:x})}),(0,N.jsx)(_I,{label:t({id:"label.team_challenge_snapshot.cb8d19ab",defaultMessage:"Team challenge snapshot"}),children:(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(Ge.A,{body:!0,className:"mb-4",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{sm:12,children:[(0,N.jsx)("p",{className:"mb-1",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team members",description:"",id:"label.team_members.74156382"})})}),c.map(e=>{const s=Kd(e);return(0,N.jsxs)("span",{className:"me-3 mb-3",style:{whiteSpace:"nowrap"},children:[(0,N.jsx)(Ya,{className:"me-1",size:20,user:s})," ",(0,N.jsx)("b",{children:null===s||void 0===s?void 0:s.fullname})]},null===e||void 0===e?void 0:e.id)})]})}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{sm:12,children:[(0,N.jsx)("p",{className:"mt-3",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Phases",description:"",id:"label.phases.b4b0b75a"})})}),(0,N.jsx)(jH,{challenge:i,team:l,onFacilitate:(e,s)=>{this.handleFacilitation(l),setTimeout(()=>{window.location="/assignment/"+(null===g||void 0===g?void 0:g.group_member_assignment_id)+"/"+(null===g||void 0===g?void 0:g.id)+"/content/"+e+"/"+s},250)}})]})})]},null===l||void 0===l?void 0:l.id)})}),(0,N.jsx)(_I,{label:t({id:"label.team_results.1650b66a",defaultMessage:"Team results"}),children:(0,N.jsx)(pH,{})})]})]})}}var vH=(0,P.G0)((0,Ke.Ay)(_T(UP(sH(xH)))));class fH extends l.Component{constructor(e){super(e);const{challenge:s}=this.props,a=null===s||void 0===s?void 0:s.num_phases_complete,t=Math.floor(Math.ceil(a+1,1),5);this.state={selected_phase:6===t?5:t}}render(){var e;const{challenge:s}=this.props,a=null===s||void 0===s?void 0:s.num_phases_complete,t=(null===s||void 0===s||null===(e=s.challenge_template)||void 0===e?void 0:e.challenge_type)||"classic",i=Za.Ay[t]||Za.Ay.classic,n=Object.values(i.phases).map(e=>e.title),r=Math.floor(Math.ceil(a+1,1),5),{selected_phase:o}=this.state,d=[(0,N.jsx)(jr,{path:"phase_discover_logo/binocular_white.svg",size:100},0),(0,N.jsx)(jr,{path:"phase_explore_logo/compass_white.svg",size:120},1),(0,N.jsx)(jr,{path:"phase_imagine_logo/bulb_white.svg",size:100},2),(0,N.jsx)(jr,{path:"phase_create_logo/pencil_white.svg",size:100},3),(0,N.jsx)(jr,{path:"phase_reflect_logo/checklist_white.svg",size:100},4)];return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Qe.A,{className:"team-phase-overview",children:n.map((e,a)=>{var n;const c=a+1,h=r===c,u=r>c,m=r<c,g=Object.values((null===(n=i.phases[c])||void 0===n?void 0:n.subphases)||{}),p=d[a],x=g&&g.length;let v=0;g.forEach((e,a)=>{const t=a+1,i=s&&s.challenge_data.reduce((e,s)=>{const a=s.is_complete,i=s.phase,l=s.subphase;return a&&i===c&&l===t?e+1:e},0);i&&(v+=1)});let f="";return h&&(f="phase-active"),u&&(f="phase-complete"),m&&(f="phase-locked"),(0,N.jsx)(Ve.A,{xs:o===c?4:2,children:(0,N.jsx)(Ge.A,{className:"phase "+f,onClick:()=>{!m&&this.setState({selected_phase:c})},style:{cursor:""+(o===c||m?"auto":"pointer"),height:141,minWidth:112},children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"center",display:"flex",flexDirection:"row"},children:[m&&(0,N.jsx)(ze.JhU,{color:"#575757",size:10}),(0,N.jsxs)("b",{className:`phase-title ${m&&"locked ms-1"}`,children:["0",c," ",e]}),o===c&&(0,N.jsxs)("b",{className:"ms-auto",children:[v,"/",x]})]}),o===c&&(0,N.jsxs)(Ce.S,{style:{color:"var(--gray-500)"},children:[(0,N.jsx)("span",{className:"me-2",children:(0,N.jsx)(ze.w_X,{})}),(0,N.jsxs)("b",{className:"me-3",style:{fontSize:12},children:[10,"m"]})]}),m&&(0,N.jsx)("i",{className:"phase-icon "+(1!==a?"rotate":""),children:p}),(0,N.jsxs)(Ce.S,{className:"text-center",children:[u&&o!==c&&(0,N.jsx)(Ce.S,{className:"subphase",style:{marginTop:44},children:(0,N.jsx)(Ce.S,{className:"subphase-icon complete",children:(0,N.jsx)(ze.CMH,{color:"white",size:25})})}),o===c&&(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"center",marginTop:18},children:g.map((e,a)=>{("string"===typeof e?e:(null===e||void 0===e?void 0:e.title)||"").split(" ")[0];const i=a+1,n=s&&(null===s||void 0===s?void 0:s.challenge_data.reduce((e,s)=>{const a=s.is_complete,t=s.phase,l=s.subphase;return a&&t===c&&l===i?e+1:e},0));return(0,N.jsxs)(l.Fragment,{children:[(0,N.jsx)("div",{className:"subphase",role:"button",style:{cursor:"pointer"},tabIndex:0,onClick:()=>{"function"==typeof this.props.onFacilitate&&this.props.onFacilitate(c,i)},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||"function"==typeof this.props.onFacilitate&&this.props.onFacilitate(c,i)},children:(0,N.jsx)(Ce.S,{className:`subphase-icon ${n&&"complete"}`,children:n?(0,N.jsx)(ze.CMH,{color:"white",size:25}):(0,N.jsx)(xr,{challenge_type:t,phase:c,size:20,subphase:i})})}),g.length>1&&i!==g.length&&(0,N.jsx)("div",{className:"subphase-divider"})]},a)})})]})]})})},a)})})})}}var jH=fH;class _H extends l.Component{constructor(e){super(e),this.state={error:null,loading:!1,saved:null},this.dialog=(0,l.createRef)()}updateTeam(e){const{admin_team:s,app:a}=this.props,t=a.api,{team:i}=s;i.id&&t.post("/api/teams/save/",{team_id:i.id,team_name:e}).then(()=>{window.location.reload()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}resetTeam(){const{admin_team:e,app:s}=this.props,a=s.api,{team:t}=e;if(!t.id)return;const i=t.group_assignment_id;a.post(`/api/teams/reset/${t.id}`,{group_assignment_id:i}).then(()=>{window.location.reload()}).catch(e=>{let{err:s}=e;this.setState({error:s})})}render(){const{admin_team:e,app:s}=this.props,{locale:a}=s,{team:t}=e,{error:i,loading:l,saved:n}=this.state;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team settings",id:"label.team_settings.92ff3594"})}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)(ds.l1,{enableReinitialize:!0,onSubmit:e=>this.updateTeam(e.name),validationSchema:(0,Re.by)({locale:a,scope:"team.team_name"}),initialValues:{name:t.name},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:r,values:o}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,show:i,variant:"danger",onClose:()=>{this.setState({error:null})},children:this.state.error}),(0,N.jsx)(We.A,{dismissible:!0,show:n,variant:"success",onClose:()=>{this.setState({saved:null})},children:(0,N.jsx)(ke.A,{defaultMessage:"Saved successfully",id:"label.saved_successfully.75de35db"})}),l&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!l&&(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Team name",id:"label.team_name.0952fcc6"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"name",isInvalid:r.name&&s.name,isValid:r.name&&!s.name,name:"name",onChange:a,placeholder:"Team Name",type:"text",value:o.name}),(0,N.jsx)(Ce.S,{className:"text-end",children:(0,N.jsx)(FB,{length:o.name&&o.name.length?o.name.length:0,max:50,min:3})}),s.name&&r.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]}),(0,N.jsx)(ve.A,{onClick:t,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}}),(0,N.jsx)(je,{ref:this.dialog})]})]})}}var bH=(0,n.G0)(_T(UP(sH(_H))));class AH extends l.Component{constructor(e){super(e),this.format4CData=e=>{let s=[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}];return e&&(e.critical||e.critical_score)&&(s[0].score=e.critical||e.critical_score||0),e&&(e.communication||e.communication_score)&&(s[1].score=e.communication||e.communication_score||0),e&&(e.collaboration||e.collaboration_score)&&(s[2].score=e.collaboration||0),e&&(e.creativity||e.creativity_score)&&(s[3].score=e.creativity||0),s},this.state={error:null,top_members_files:[],top_members_messages:[],top_members_online:[]}}render(){const{error:e,loading:s}=this.state,{admin_team:a}=this.props,{assignment:t,challenge:i}=a,l=(null===i||void 0===i?void 0:i.members)||null,n=!(null===t||void 0===t||!t.enable_grading),{convertSeconds:r}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{};return(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:e,variant:"danger",children:e}),s?(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(_I,{count:null===l||void 0===l?void 0:l.length,label:"Learners",showCount:!0,children:(0,N.jsx)(Ce.S,{className:"teams-container",children:(0,N.jsxs)(ho,{striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:n?(0,N.jsx)(ke.A,{defaultMessage:"Results",id:"label.results.219c4a6c"}):(0,N.jsx)(ke.A,{defaultMessage:"4C Avg",id:"label.4c_avg.7a552cdb"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"lg",style:{minWidth:145},children:(0,N.jsx)(ke.A,{defaultMessage:"Engagement",id:"label.engagement.ea68771a"})})]})}),(0,N.jsx)(ho.Tbody,{children:null!==l&&void 0!==l&&l.length?(0,N.jsx)(N.Fragment,{children:l.map(e=>{const{four_c_score_average:s,is_four_c_complete_1:a,is_four_c_complete_2:t,is_four_c_complete_3:l,is_four_c_complete_4:o,self_four_c_score:d,team_member:c}=e,h=Kd(c),u=!(null===h||void 0===h||!h.is_agent);let m=null===e||void 0===e?void 0:e.four_c_score,g=this.format4CData(m),p=null===e||void 0===e?void 0:e.score,x=null===e||void 0===e?void 0:e.message_count,v=null===e||void 0===e?void 0:e.files_count,f=Number(null===e||void 0===e?void 0:e.total_time_seconds),j=r(f);const _=a&&t&&l&&o||d,b=n?i.is_graded:_,A=n?p:s;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsxs)(Ce.S,{style:{alignItems:"center",display:"flex",flexDirection:"row"},children:[(0,N.jsx)(Ya,{user:h}),(0,N.jsxs)(Ce.S,{className:"ms-3",children:[(0,N.jsx)("span",{children:(0,N.jsx)(qA,{user:h})}),!u&&_&&(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"d-block",text:"dark",children:"4C's Complete"})]})]})}),(0,N.jsx)(ho.Td,{children:u?(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"N/A",id:"label.na.e2f79e5b"})}):(0,N.jsxs)(Ce.S,{className:"two__graphics",style:{display:"flex",flexDirection:"row"},children:[b?(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Ce.S,{className:"facilitator-dashboard-four-c-bar-chart",children:(0,N.jsx)(wL,{data:g})})}):(0,N.jsx)(Ce.S,{className:"text-center",style:{marginRight:"3em"},children:(0,N.jsx)(Ce.S,{className:"facilitator-dashboard-four-c-bar-chart empty",children:(0,N.jsx)(wL,{tooltip:!1,bars:[{background:{fill:"rgba(53,53,53,.38)"}
2,dataKey:"score",fill:"rgba(53,53,53,.38)"}]})})}),b?(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Ce.S,{className:"text-center",style:{marginTop:10},children:(0,N.jsx)(Dt,{barSize:5,fontSize:12,height:45,value:A,width:45})}),(0,N.jsx)("p",{className:"mb-0"+(n?"":" text-center small text-secondary"),children:n?(0,N.jsx)(ke.A,{defaultMessage:"Score",id:"label.score.38e5a46c"}):(0,N.jsx)(ke.A,{defaultMessage:"4C Avg",id:"label.4c_avg.7a552cdb"})})]}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ce.S,{style:{marginBottom:20,marginTop:10,opacity:.38},children:(0,N.jsx)(Dt,{barSize:5,bgColor:"rgba(53,53,53,.38)",color:"rgba(53,53,53,.38)",fontSize:12,height:45,width:45})})})]})}),(0,N.jsx)(ho.Td,{className:"truncate__email",hiddenBelow:"lg",children:u?(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"me-2 d-inline-flex align-items-center gap-1",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"N/A",id:"label.na.e2f79e5b"})}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2 d-inline-flex align-items-center gap-1",text:"dark",children:[(0,N.jsx)(ze.w_X,{size:14}),j&&j.value?j.value+" "+j.label:"-"]}),(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2 d-inline-flex align-items-center gap-1",text:"dark",children:[(0,N.jsx)(ze.g5D,{size:14}),x]}),(0,N.jsxs)(bo.A,{pill:!0,bg:"light",className:"me-2 d-inline-flex align-items-center gap-1",text:"dark",children:[(0,N.jsx)(ze.M1W,{size:14}),v]})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"4",children:(0,N.jsx)(ke.A,{defaultMessage:"No users found.",id:"label.no_users_found.ce0171e5"})})})})]})})})})]})}}var yH=(0,Ke.Ay)((0,P.G0)(_T(UP(sH(AH)))));const wH=(0,l.forwardRef)((s,a)=>{var t,i,n;const{api:r}=(0,P.nm)(),{group_id:o}=aH()||{},[d,c]=(0,l.useState)(!1),[h,u]=(0,l.useState)(!1),[m,g]=(0,l.useState)(null),[p,x]=(0,l.useState)(null),v=async function(){let{meeting_id:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(c(!0),g(null),x(null),s)try{u(!0);const{call:e}=await r.get("/api/meetings/team/call",{group_id:o,meeting_id:s});x(e)}catch(e){g((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e)}finally{u(!1)}},f=()=>{c(!1),x(null),g(null)};(0,l.useImperativeHandle)(a,()=>({hide:f,show:v}));const j=p&&((e,s)=>{if(!e||!s)return null;const a=Math.max(0,Math.round((new Date(s).getTime()-new Date(e).getTime())/1e3)),t=Math.floor(a/3600),i=Math.floor(a%3600/60),l=a%60;return t?`${t}h ${i}m`:i?`${i}m ${l}s`:`${l}s`})(p.start_date,p.end_date);return(0,N.jsxs)(xe,{onHide:f,show:d,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Call details",id:"label.call_details.caaf42b6"}),(null===p||void 0===p?void 0:p.start_date)&&(0,N.jsxs)("small",{className:"text-muted ms-2 fw-normal",children:[(0,N.jsx)(Gh.XU,{value:p.start_date})," ",(0,N.jsx)(Gh.ib,{value:p.start_date})]})]})}),(0,N.jsxs)(xe.Body,{children:[h&&(0,N.jsx)(Ce.S,{className:"text-center py-4",children:(0,N.jsx)(Me.y$,{})}),!h&&m&&(0,N.jsx)(We.A,{className:"mb-0",variant:"danger",children:m}),!h&&!m&&p&&(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-4",children:[(0,N.jsxs)("section",{className:"d-flex flex-wrap gap-4",children:[(0,N.jsxs)("div",{children:[(0,N.jsx)("small",{className:"text-muted d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Started",id:"label.started.ecbc89cd"})}),(0,N.jsx)("span",{children:p.start_date?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:p.start_date})," ",(0,N.jsx)(Gh.ib,{value:p.start_date})]}):"\u2014"})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("small",{className:"text-muted d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Ended",id:"label.ended.7cdc804e"})}),(0,N.jsx)("span",{children:p.end_date?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.XU,{value:p.end_date})," ",(0,N.jsx)(Gh.ib,{value:p.end_date})]}):"\u2014"})]}),(0,N.jsxs)("div",{children:[(0,N.jsx)("small",{className:"text-muted d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",id:"label.duration.4fc52a3c"})}),(0,N.jsx)("span",{children:j||"\u2014"})]}),p.recording_url&&(0,N.jsxs)("div",{children:[(0,N.jsx)("small",{className:"text-muted d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Recording",id:"label.recording.80e8dd1a"})}),(0,N.jsx)("a",{href:p.recording_url,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Open recording",id:"label.o
2pen_recording.6e00f5d8"})})]})]}),(0,N.jsxs)("section",{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Participants",id:"label.participants.0e27279b"})}),null!==(t=p.attendees)&&void 0!==t&&t.length?(0,N.jsx)(yl.A,{variant:"flush",children:p.attendees.map((e,s)=>(0,N.jsxs)(yl.A.Item,{className:"d-flex justify-content-between align-items-center bg-light px-2 py-1 rounded mb-1",children:[(0,N.jsxs)("span",{className:"fw-semibold",children:[e.name||(0,N.jsx)(ke.A,{defaultMessage:"Unknown participant",id:"label.unknown_participant.591c9e8b"}),!e.is_team_member&&e.name&&(0,N.jsx)("span",{className:"fw-normal text-muted ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(facilitator)",id:"label.facilitator.591ed353"})})]}),(0,N.jsxs)("small",{className:"text-muted",children:[e.join_date?(0,N.jsx)(Gh.ib,{value:e.join_date}):"\u2014"," \u2013 ",e.leave_date?(0,N.jsx)(Gh.ib,{value:e.leave_date}):(0,N.jsx)(ke.A,{defaultMessage:"still in call",id:"label.still_in_call.5f7050e6"})]})]},s))}):(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No participant records.",id:"label.no_participant_records.b5eecd0d"})})]}),(0,N.jsxs)("section",{children:[(0,N.jsxs)("h5",{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(ke.A,{defaultMessage:"Transcript",id:"label.transcript.721164f0"}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:(null===(i=p.transcripts)||void 0===i?void 0:i.length)||0})]}),null!==(n=p.transcripts)&&void 0!==n&&n.length?(0,N.jsx)(yl.A,{variant:"flush",children:p.transcripts.map((e,s)=>{let{content:a,is_team_member:t,speaker_name:i,start_time:l}=e;return(0,N.jsxs)(yl.A.Item,{className:"d-flex flex-column bg-light px-2 py-1 rounded mb-1",children:[(0,N.jsxs)("small",{className:"text-muted d-inline-flex justify-content-between align-items-center",children:[(0,N.jsxs)("span",{className:"fw-semibold",children:[i||(0,N.jsx)(ke.A,{defaultMessage:"Unknown speaker",id:"label.unknown_speaker.8cd85329"}),!t&&i&&(0,N.jsx)("span",{className:"fw-normal ms-1",children:(0,N.jsx)(ke.A,{defaultMessage:"(facilitator)",id:"label.facilitator.591ed353"})})]}),l&&(0,N.jsx)("span",{children:(0,N.jsx)(Gh.ib,{value:l})})]}),(0,N.jsx)("span",{children:a})]},s)})}):(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No transcript was captured for this call.",id:"label.no_transcript_was_captured_for_thi.f8fae372"})})]})]})]})]})});wH.displayName="CallDetailModal";var NH=wH;var SH=()=>{const s=(0,P.nm)(),{group_id:a,team_id:t}=aH()||{},i=(0,l.useRef)(),[n,r]=(0,l.useState)([]),[o,d]=(0,l.useState)(null),[c,h]=(0,l.useState)(!0),u=(0,l.useCallback)(async()=>{if(t)try{d(null),h(!0);const{calls:e=[]}=await s.api.get("/api/meetings/team/calls",{group_id:a,team_id:t});r(e)}catch(e){d((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e)}finally{h(!1)}},[s.api,a,t]);(0,l.useEffect)(()=>{u()},[u]);return c?(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}):(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d(null),show:!!o,variant:"danger",children:o}),o||n.length?(0,N.jsx)(_I,{count:n.length,label:"Calls",showCount:!0,children:(0,N.jsxs)(ho,{striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Date",id:"label.date.99c40ab4"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Time",id:"label.time.33b93476"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"md",children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",id:"label.duration.4fc52a3c"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"md",children:(0,N.jsx)(ke.A,{defaultMessage:"Participants",id:"label.participants.0e27279b"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Transcript",id:"label.transcript.721164f0"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{children:n.map(e=>{const s=((e,s)=>{if(!e||!s)return null;const a=Math.max(0,Math.round((new Date(s).getTime()-new Date(e).getTime())/1e3)),t=Math.floor(a/3600),i=Math.floor(a%3600/60),l=a%60;return t?`${t}h ${i}m`:i?`${i}m ${l}s`:`${l}s`})(e.start_date,e.end_date);return(0,N.jsxs)(ho.Tr,{className:"cursor-pointer",onClick:()=>(e=>{var s;return null===i||void 0===i||null===(s=i.current)||void 0===s?void 0:s.show({meeting_id:e})})(e.meeting_id),children:[(0,N.jsx)(ho.Td,{children:e.start_date?(0,N.jsx)(Gh.XU,{value:e.start_date}):"\u2014"}),(0,N.jsx)(ho.Td,{children:e.start_date?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Gh.ib,{value:e.start_date}),e.end_date&&(0,N.jsxs)(N.Fragment,{children:[" \u2013 ",(0,N.jsx)(Gh.ib,{value:e.end_date})]})]}):"\u2014"}),(0,N.jsx)(ho.Td,{hiddenBelow:"md",children:s||"\u2014"}),(0,N.jsx)(ho.Td,{hiddenBelow:"md",children:e.attendee_count||0}),(0,N.jsx)(ho.Td,{children:e.transcript_line_count>0?(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:(0,N.jsx)(ke.A,{defaultMessage:"{count} lines",id:"label.count_lines.69955e2c",values:{count:e.transcript_line_count}})}):(0,N.jsx)("span",{className:"text-muted",children:"\u2014"})}),(0,N.jsx)(ho.Td,{className:"text-end text-muted",children:(0,N.jsx)(ze.X6T,{size:12})})]},e.meeting_id)})})]})}):(0,N.jsx)(We.A,{className:"text-center mb-0",variant:"light",children:(0,N.jsx)(ke.A,{defaultMessage:"No voice calls have taken place for this team yet.",id:"label.no_voice_calls_have_taken_place_fo.c72a2ad4"})}),(0,N.jsx)(NH,{ref:i})]})};class CH extends l.Component{constructor(e){super(e),this.promptSubmitChallengeManually=()=>{var e;const{challenge:s}=this.state,{intl:a}=this.props,t=null===(e=this.dialog)||void 0===e?void 0:e.current;t&&null!==s&&void 0!==s&&s.id&&t.show({actions:[t.CancelAction(),t.Action({label:"Submit",onClick:this.submitChallengeManually,variant:"danger"})],body:a.formatMessage({id:"label.are_you_sure_you_want_to_manually.fa216f8a",defaultMessage:"Are you sure you want to manually submit this teams challenge? Doing so will prevent incomplete team members from completing their Reflect / 4C surveys."}),size:"sm",title:a.formatMessage({id:"label.manual_submission.0bc41bb4",defaultMessage:"Manual submission"})})},this.submitChallengeManually=()=>{const{app:e}=this.props,{api:s}=e,{challenge:a}=this.state;a&&a.id&&(this.setState({loading:!0}),s.get("/api/facilitators/challenge/submit",{challenge_id:a.id}).then(()=>
2{Promise.all([this.refreshAssignment(),this.refreshChallenge()]).then(()=>{this.setState({loading:!1})}).catch(e=>{this.setState({error:e,loading:!1})})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1})}))},this.handleFacilitation=async e=>{try{var s,a;const{app:t,intl:i}=this.props,l=t.api,{members:n,team:r}=e||{},{group:o}=this.state,d=t.userHasRight("manage_challenge",null===o||void 0===o?void 0:o.organization_id),c=null===n||void 0===n?void 0:n.find(e=>{var s;return null===e||void 0===e||null===(s=e.group_member_assignment_component)||void 0===s?void 0:s.id}),h=null===c||void 0===c||null===(s=c.group_member_assignment_component)||void 0===s?void 0:s.group_member_assignment_id,u=null===c||void 0===c||null===(a=c.group_member_assignment_component)||void 0===a?void 0:a.id;if(!h||!u)return void this.setState({error:i.formatMessage({id:"label.unable_to_launch_no_team_member_wi.76446623",defaultMessage:"Unable to launch \u2014 no team member with a launchable challenge was found."})});d&&(this.setState({loading_facilitation:!0}),await l.post("/api/teams/members/facilitator/add",{team_id:null===r||void 0===r?void 0:r.id}),this.setState({loading_facilitation:!1})),await window.open(`/assignment/${h}/${u}/content`)}catch({err:err}){this.setState({error:err,loading_facilitation:!1})}},this.handleCopyToClipboard=e=>{!!document.documentMode?window.clipboardData.setData("Text",e):navigator.clipboard.writeText(e)},this.state={active_key:"home",assignment:null,assignment_component:null,challenge:null,error:null,group:null,group_tree:null,loading:!0,loading_facilitation:!1},this.dialog=(0,l.createRef)()}refreshAssignment(){return new Promise((e,s)=>{const{app:a}=this.props,{assignment_id:t,group_id:i}=this.props.match.params,l=a.api;this.setState({assignment:null,error:null}),l.get("/api/assignments/get",{group_assignment_id:t,group_id:i}).then(s=>{let{assignment:a}=s;this.setState({assignment:a}),e()}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshAssignmentComponent(){return new Promise((e,s)=>{const{assignment_component_id:a,group_id:t}=this.props.match.params,{app:i}=this.props,l=i.api;this.setState({assignment_component:null,error:null}),l.get("/api/assignments/component/get",{group_assignment_component_id:a,group_id:t}).then(s=>{let{assignment_component:a}=s;this.setState({assignment_component:a}),e()}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshGroup(){return new Promise((e,s)=>{const{app:a}=this.props,{group_id:t}=this.props.match.params,i=a.api;this.setState({error:null,group:null,group_tree:null}),i.get("/api/groups/get",{group_id:t}).then(s=>{let{group:a,tree:t}=s;this.setState({group:a,group_tree:t}),e()}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshChallenge(){const{app:e}=this.props,{challenge_id:s,group_id:a}=this.props.match.params,t=e.api;return new Promise((e,i)=>{this.setState({error:null,team:null}),t.get("/api/challenges/get",{challenge_id:s,group_id:a}).then(s=>{let{challenge:a,team:t}=s;this.setState({challenge:a,team:t}),e()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),i(s)})})}componentDidMount(){this.setState({loading:!0}),window.addEventListener("hashchange",()=>{this.setDefaultActiveTabKey()},!1),this.setDefaultActiveTabKey(),Promise.all([this.refreshGroup(),this.refreshAssignment(),this.refreshChallenge(),this.refreshAssignmentComponent()]).then(()=>{this.setState({loading:!1})}).catch(e=>{this.setState({err:e,loading:!1})})}setDefaultActiveTabKey(){let e=window.location.hash.substr(1);e||(e="home"),this.setActiveTabKey(e)}setActiveTabKey(e){const{active_key:s}=this.state;e!==s&&this.setState({active_key:e})}render(){var e;const{app:s,history:a}=this.props,{userIsAdmin:t,userIsSiteAdmin:i,userIsSiteArbitrator:l}=s,{assignment_component_id:n,assignment_id:r,challenge_id:o,group_id:d}=this.props.match.params,{active_key:c,assignment:h,assignment_component:u,challenge:m,error:g,group:p,group_tree:x,loading:v,loading_facilitation:f,team:j}=this.state,_=null===m||void 0===m?void 0:m.is_complete,b=p&&p.organization_id,A=null===m||void 0===m?void 0:m.members,y=(t(),l()),w=y&&_;return(0,N.jsx)(yT,{children:(0,N.jsxs)(Ny,{offsetBottom:25,children:[(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Me.x_,{loading:v,spinner:(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"text-center",md:12,children:(0,N.jsx)(Me.y$,{})})}),children:(0,N.jsx)($O,{value:{assignment:h,assignment_component:u,assignment_component_id:n,assignment_id:r,challenge:m,challenge_id:o,group_id:d,refreshChallenge:async()=>{this.setState({loading:!0}
2),await this.refreshChallenge(),this.setState({loading:!1})},team:j,team_id:null===j||void 0===j?void 0:j.id},children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column gap-3",children:[!(!p||!j)&&(0,N.jsxs)(vF.A,{children:[s.userIsSiteAdmin()&&(0,N.jsx)(pa.mu,{to:"/admin",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Site",id:"label.site.fa795581"})})}),s.userIsSiteArbitrator()?(0,N.jsx)(vF.A.Item,{active:!0,children:null===j||void 0===j?void 0:j.name}):(0,N.jsxs)(N.Fragment,{children:[!s.userIsSiteAdmin()&&(s.userHasOrgRole("facilitator",b)||s.userHasOrgRole("moderator",b))&&(0,N.jsx)(pa.mu,{to:`/admin/groups/${b}`,children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"My dashboard",id:"label.my_dashboard.f4c56c94"})})}),s.userHasRight("manage_organization",b)&&(0,N.jsx)(N.Fragment,{children:x&&x.map(e=>(0,N.jsx)(pa.mu,{to:`/admin/organization/${null===e||void 0===e?void 0:e.id}`,children:(0,N.jsx)(vF.A.Item,{children:null===e||void 0===e?void 0:e.name},null===e||void 0===e?void 0:e.id)},e.id))}),(0,N.jsx)(pa.mu,{to:`/admin/group/${d}`,children:(0,N.jsx)(vF.A.Item,{children:null===p||void 0===p?void 0:p.name})}),(0,N.jsx)(pa.mu,{to:`/admin/group/${d}/assignment/${r}`,children:(0,N.jsx)(vF.A.Item,{children:null===h||void 0===h?void 0:h.title})}),"journey"===(null===h||void 0===h?void 0:h.type)&&(0,N.jsx)(pa.mu,{to:`/admin/group/${d}/assignment/${r}/${n}`,children:(0,N.jsx)(vF.A.Item,{children:null===u||void 0===u||null===(e=u.challenge_template)||void 0===e?void 0:e.title})}),(0,N.jsx)(vF.A.Item,{active:!0,children:null===j||void 0===j?void 0:j.name})]})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",md:6,children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h3",{children:(null===j||void 0===j?void 0:j.name)||"Unknown team"}),(0,N.jsx)("h5",{style:{lineHeight:"28.8px",opacity:.87},children:(null===h||void 0===h?void 0:h.title)||"Unknown assignment"})]}),i()&&(0,N.jsx)(lH,{})]}),(0,N.jsxs)(Ve.A,{md:6,children:[(0,N.jsxs)(Ce.S,{className:"mt-3 d-flex justify-content-end",children:[!y&&(0,N.jsxs)(N.Fragment,{children:[(null===m||void 0===m?void 0:m.num_phases_complete)>=4&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Yh.A,{className:"ms-2 mb-2",children:[(0,N.jsx)(ve.A,{onClick:()=>a.push(`/gallery/view/${null===m||void 0===m?void 0:m.token}`),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"View in Gallery",id:"label.view_in_gallery.70c02ac7"})}),(0,N.jsx)(Ua.A,{placement:"top",overlay:(0,N.jsx)(Qa.A,{children:"Copy to clipboard."}),children:(0,N.jsx)(ve.A,{className:"",onClick:()=>this.handleCopyToClipboard(window.location.origin+`/gallery/view/${null===m||void 0===m?void 0:m.token}`),variant:"secondary",children:(0,N.jsx)(ze.paH,{size:17.5})})})]})}),!(null!==m&&void 0!==m&&m.is_submitted)&&(null===m||void 0===m?void 0:m.num_phases_complete)>=4&&(0,N.jsx)(ve.A,{className:"mb-2 ms-2",onClick:this.promptSubmitChallengeManually,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Manual submission",id:"label.manual_submission.0bc41bb4"})}),(null===m||void 0===m?void 0:m.is_submitted)&&!(null!==m&&void 0!==m&&m.is_graded)&&(null===h||void 0===h?void 0:h.enable_grading)&&(0,N.jsx)(Le.Link,{className:"btn btn-secondary mb-2 ms-2",to:`/admin/group/${d}/assignment/${r}/challenge/${n}/grade/${o}`,children:(0,N.jsx)(ke.A,{defaultMessage:"Score now",id:"label.score_now.c3f9c7a5"})}),!(null===m||void 0===m||!m.is_graded)&&(0,N.jsx)(Le.Link,{className:"btn btn-secondary mb-2 ms-2",to:`/admin/group/${d}/assignment/${r}/challenge/${n}/grade/${o}`,children:(0,N.jsx)(ke.A,{defaultMessage:"Review scores",id:"label.review_scores.8ad76fe4"})})]}),(0,N.jsx)(Me.p0,{className:"mb-2 ms-2",disabled:!(null!==A&&void 0!==A&&A.length)||y&&!w,loading:f,onClick:()=>this.handleFacilitation(m),children:(0,N.jsx)(ke.A,{defaultMessage:"Launch",id:"label.launch.ccf56ef5"})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:[(null===m||void 0===m?void 0:m.num_phases_complete)>=1&&(null===m||void 0===m?void 0:m.num_phases_complete)<5&&(0,N.jsx)(bo.A,{pill:!0,bg:"light",className:"ms-2",text:"dark",children:"In Progress"}),(null===m||void 0===m?void 0:m.completed)>(null===h||void 0===h?void 0:h.due)?(0,N.jsx)(bo.A,{pill:!0,bg:"danger",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Late",id:"label.late.0f950da1"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"On time",id:"label.on_time.a6b48d9a"})}),(null===m||void 0===m?void 0:m.is_submitted)&&(0,N.jsx)(N.Fragment,{children:null!==m&&void 0!==m&&m.is_graded?(0,N.jsxs)(bo.A,{pill:!0,bg:"success",className:"ms-2",children:[(0,N.jsx)(ke.A,{defaultMessage:"Scored",id:"label.scored.079794b4"}),null===m||void 0===m?void 0:m.score,"%"]}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Not scored",id:"label.not_scored.8d57c61c"})})})]})]})]}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>this.setState({error:null}),show:g,variant:"danger",children:g}),(0,N.jsxs)(ld.A.Container,{activeKey:c,defaultActiveKey:"home",id:"admin-tabs",mountOnEnter:!0,children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"home",href:"#home",children:(0,N.jsx)(ke.A,{defaultMessage:"Main",id:"label.main.eb814be3"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"learners",href:"#learners",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners",id:"label.learners.b8b5ae57"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"calls",href:"#calls",children:(0,N.jsx)(ke.A,{defaultMessage:"Calls",id:"label.calls.b73a5e2c"})})}),!y&&(0,N.jsx)(aa.A.Item,{style:{marginLeft:"auto"},children:(0,N.jsx)(aa.A.Link,{eventKey:"settings",href:"#settings",children:(0,N.jsx)(ke.A,{defaultMessage:"Settings",id:"label.settings.74a883a0"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"home",children:(0,N.jsx)(vH,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"learners",children:(0,N.jsx)(yH,{})}),(0,N.jsx)(ld.A.Pane,{eventKey:"calls",children:(0,N.jsx)(SH,{})}),!y&&(0,N.jsx)(ld.A.Pane,{eventKey:"settings",children:(0,N.jsx)(bH,{})})]})})})]})]})})]})})})}),(0,N.jsx)(je,{ref:this.dialog})]})})}}var MH=(0,Ke.Ay)((0,Pe.y)((0,n.G0)(_T(UP(CH)))));const kH=l.createContext({}),zH=kH.Provider,TH=kH.Consumer,IH=e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(TH,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{admin_challenge_grader:s,ref:e=>{this.comp=e}}))})}}return s};var EH=(0,P.G0)(IH(function(e){let{admin_challenge_grader:s,app:a}=e,{all_challenges:t,assignment:i,assignment_component_id:l,group:n,team:r}=s,o=Array.isArray(t)?t.filter(e=>!e.is_graded&&5===e.num_phases_complete):[];return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{lg:9,children:[(0,N.jsxs)("h6",{className:"mt-3",children:[(0,N.jsx)(jr,{path:"circle_w_check/check_green.svg",size:22})," Success"]}),(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsxs)("b",{children:[(0,N.jsx)(ke.A,{defaultMessage:"You have successfully submitted scores for team",description:"",id:"label.you_have_successfully_submitted_sc.06749893"})," ",r.name,"."]})}),(0,N.jsxs)("h6",{className:"mt-5",children:[(0,N.jsx)(jr,{path:"pencil-edit/pencil-edit.svg",size:15})," ",(0,N.jsx)(ke.A,{defaultMessage:"Teams",description:"",id:"label.teams.1e1a1c07"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Awaiting scoring",description:"",id:"label.awaiting_scoring.ff236bdb"})]}),o.length>0&&(0,N.jsx)(N.Fragment,{children:o.map((e,s)=>{let a=null===e||void 0===e?void 0:e.members.map(e=>Kd(null===e||void 0===e?void 0:e.team_member)),t=null===e||void 0===e?void 0:e.team;return(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("small",{className:"float-end",children:(0,N.jsx)("b",{children:(0,N.jsx)("a",{href:`/admin/group/${n.id}/assignment/${i.id}/challenge/${l}/grade/${e.id}`,children:"Score"})})}),(0,N.jsx)(tn,{className:"float-start",users:a}),(0,N.jsx)("b",{children:t.name})]},s)})}),0===o.length&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ge.A,{body:!0,className:"text-center",children:(0,N.jsxs)("i",{children:[(0,N.jsx)(ke.A,{defaultMessage:"No challenges",description:"",id:"label.no_challenges.e1bd3d80"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Awaiting scoring",description:"",id:"label.awaiting_scoring.ff236bdb"})]})})})]})})})}));class FH extends l.Component{constructor(e){super(e),this.navigateToChallengeHub=async e=>{try{var s,a,t;const i=(null===e||void 0===e||null===(s=e.members)||void 0===s||null===(a=s[0])||void 0===a?void 0:a.group_member_assignment_component)||{},{id:l,group_member_assignment_id:n}=i;
2if(!l||!n)return;const{app:r}=this.props,{api:o}=r;this.setState({loading_facilitation:!0}),await o.post("/api/teams/members/facilitator/add",{team_id:null===e||void 0===e||null===(t=e.team)||void 0===t?void 0:t.id}),this.setState({loading_facilitation:!1}),await window.open(`/assignment/${n}/${l}/content`)}catch({err:err}){this.setState({error:err,loading_facilitation:!1})}},this.state={error:null,loading:!0,loading_facilitation:!1}}render(){var e;const{loading_facilitation:s}=this.state,{admin_challenge_grader:a,app:t,layout:i}=this.props,{locale:n}=t,{challenge:r,challenge_member_rubrics:o,challenge_rubric:d,getAverage4Cs:c,getAverageRawScore:h,getNumericAverage4Cs:u,handleFinalReviewSubmit:m,refreshChallenges:g,setLoading:p,setPhase:x,showLearnerSummary:v,tmap_total:f}=a||{},{refreshFacilitatorToDos:j}=i,_=(null===r||void 0===r?void 0:r.members)||null,b=c(),A=u(),y=h(),S=(null===Re._$||void 0===Re._$||null===(e=Re._$.time)||void 0===e?void 0:e.convertSeconds)(f,["Secs","Mins","Hrs"]);return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ds.l1,{enableReinitialize:!0,validateOnChange:!0,validationSchema:(0,Re.by)({locale:n,scope:"assignment.grading_final"}),initialValues:{grades:_?_.filter(e=>{var s,a;return!(null!==e&&void 0!==e&&null!==(s=e.team_member)&&void 0!==s&&s.is_agent)&&!(null===e||void 0===e||null===(a=e.team_member)||void 0===a||!a.user)}).map(e=>{const s=o.find(s=>s.is_facilitator&&s.challenge_member_id==e.id)||{};return{challenge_member_id:e.id,final_score:null!=e.score?e.score:e.score_raw,notes:s.notes?s.notes:""}}):[],notes:d?d.notes:""},onSubmit:(e,s)=>{m(e.notes,e.grades).then(async()=>{p(!0),await g(),j&&await j(),p(!1),x(3)}).catch(w)},children:e=>{let{errors:a,handleChange:t,handleSubmit:i,touched:n,values:o}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{lg:6,xl:8,children:[(0,N.jsx)(Me.p0,{className:"float-end mt-3",loading:s,onClick:()=>this.navigateToChallengeHub(r),variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center",children:[(0,N.jsx)(ke.A,{defaultMessage:"View team challenge",id:"label.view_team_challenge.c76c7047"}),(0,N.jsx)(ze.EQc,{className:"ms-2"})]})}),(0,N.jsxs)("h6",{className:"mt-3",children:[(0,N.jsx)(jr,{path:"pencil-edit/pencil-edit.svg",size:15})," ",(0,N.jsx)(ke.A,{defaultMessage:"Review & Submit",description:"",id:"label.review_and_submit.e877c563"})]}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team feedback",description:"",id:"label.team_feedback.bafb717a"})})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:this.state.saving,isInvalid:n.notes&&a.notes,isValid:n.notes&&!a.notes,name:"notes",onChange:t,placeholder:"(optional)",rows:"12",style:{fontSize:14,fontWeight:500,resize:"none"},value:o.notes}),a.notes&&n.notes&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:a.notes})]})]}),(0,N.jsxs)(Ve.A,{lg:6,xl:4,children:[(0,N.jsx)("p",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team summary overview",description:"",id:"label.team_summary_overview.fe1b2276"})})}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{style:{padding:10},children:[(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:6,children:(0,N.jsxs)(Ce.S,{className:"container-summary bordered-right bordered-bottom container-four-c",children:[(0,N.jsx)(Iu,{c1:b.c1,c2:b.c2,c3:b.c3,c4:b.c4}),(0,N.jsx)("div",{className:"text-center",children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Average Team 4Cs",description:"",id:"label.average_team_4cs.e9431396"})})})}),(0,N.jsx)("div",{className:"text-center",children:(0,N.jsxs)("b",{children:[A,"/100"]})})]})}),(0,N.jsx)(Ve.A,{className:"text-center",md:6,children:(0,N.jsxs)(Ce.S,{className:"container-summary bordered-bottom container-donut-team-deliverable",children:[(0,N.jsx)(Dt,{className:"m-auto",color:"#f4a800",value:null===r||void 0===r?void 0:r.score}),(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team deliverable score",description:"",id:"label.team_deliverable_score.eea91fbf"})})})})]})})]}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"text-center",md:6,children:(0,N.jsxs)(Ce.S,{className:"container-summary bordered-right",children:[(0,N.jsx)(Dt,{className:"m-auto",color:"#7b5ed8",value:y}),(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Average raw score",description:"",id:"label.average_raw_score.7e11c2c3"})})})})]})}),(0,N.jsx)(Ve.A,{className:"text-center",md:6,children:(0,N.jsxs)(Ce.S,{className:"container-summary ",children:[(0,N.jsxs)(Ce.S,{className:"clock",children:[(0,N.jsxs)(Ce.S,{className:"label",children:[S&&S.value," ",(0,N.jsx)("span",{children:S&&S.label})]}),(0,N.jsx)(jr,{path:"clock/clock.svg",size:76})]}),(0,N.jsx)("div",{className:"mt-1",children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Time on platform",description:"",id:"label.time_on_platform.283100f0"})})})})]})})]})]})})]})]}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[(0,N.jsxs)("h6",{className:"mt-3",children:[(0,N.jsx)(jr,{path:"star/star.svg",size:15})," ",(0,N.jsx)(ke.A,{defaultMessage:"Final score",description:"",id:"label.final_score.11c34366"})]}),(0,N.jsxs)(qa.A,{bordered:!0,className:"table-review",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",description:"",id:"label.name.dcd1d522"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team score",description:"",id:"label.team_score.b2f8a285"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"4C Score",description:"",id:"label.4c_score.b0b49720"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Raw score",description:"",id:"label.raw_score.176b88d9"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Final score",description:"",id:"label.final_score.11c34366"})}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Individual feedback",description:"",id:"label.individual_feedback.0c8b06a6"})})]})}),(0,N.jsx)("tbody",{children:_.map((e,s)=>{var i,r,d,c,h,u,m,g,p,x;const{team_member:f}=e,j=Kd(f),_=!(null===f||void 0===f||!f.is_agent)||!(null!==f&&void 0!==f&&f.user),b=s=>s.challenge_member_id==e.id,A=o.grades.findIndex(b),y=o.grades.find(b)||null;return(0,N.jsx)(l.Fragment,{children:(0,N.jsxs)("tr",{children:[(0,N.jsxs)("td",{children:[(0,N.jsx)(Ya,{className:"me-2",size:20,style:{verticalAlign:"top"},user:j}),(0,N.jsxs)(Ce.S,{style:{display:"inline-block"},children:[(0,N.jsx)("b",{children:(null===j||void 0===j?void 0:j.fullname)||""}),(0,N.jsx)("div",{children:(0,N.jsx)(ve.A,{className:"p-0",variant:"link",onClick:s=>{s.preventDefault(),v(e)},children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"View details",description:"",id:"label.view_details.d1bf045b"})})})})})]})]}),_&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("td",{className:"text-muted text-center",colspan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"AI teammate \u2014 not scored",description:"",id:"label.ai_teammate_not_scored.3e6fb992"})})}),!_&&y&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("td",{className:"text-end",children:(0,N.jsxs)("b",{className:"text-secondary",children:[e.team_score,(0,N.jsx)("sup",{children:"%"})]})}),(0,N.jsx)("td",{className:"text-end",children:(0,N.jsxs)("b",{className:"text-secondary",children:[e.four_c_score_average,(0,N.jsx)("sup",{children:"%"})]})}),(0,N.jsx)("td",{className:"text-end",children:(0,N.jsxs)("b",{className:"text-secondary",children:[e.score_raw,(0,N.jsx)("sup",{children:"%"})]})}),(0,N.jsxs)("td",{className:"text-end",style:{verticalAlign:"middle",width:125},children:[(0,N.jsxs)(Ei.A,{className:"input-group-grade input-group-grade-sm",children:[(0,N.jsx)(be.A,{className:"input-grade "+(null!==a&&void 0!==a&&null!==(i=a.grades)&&void 0!==i&&null!==(r=i[A])&&void 0!==r&&r.final_score?"text-danger":""),name:`grades.${A}.final_score`,onChange:t,type:"text",value:y.final_score}),(0,N.jsx)(Ei.A.Text,{className:"bg-white ps-1 "+(null!==a&&void 0!==a&&null!==(d=a.grades)&&void 0!==d&&null!==(c=d[A])&&void 0!==c&&c.final_score?"text-danger":""),children:(0,N.jsx)("b",{children:"/ 100"})})]}),(null===a||void 0===a||null===(h=a.grades)||void 0===h||null===(u=h[A])||void 0===u?void 0:u.final_score)&&(null===n||void 0===n||null===(m=n.grades)||void 0===m||null===(g=m[A])||void 0===g?void 0:g.final_score)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block text-start",type:"invalid",children:null===a||void 0===a||null===(p=a.grades)||void 0===p||null===(x=p[A])||void 0===x?void 0:x.final_score})]}),(0,N.jsx)("td",{style:{padding:0},children:(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:this.state.saving,isInvalid:n.grades&&n.grades[A]&&n.grades[A].notes&&a.grades&&a.grades[A]&&a.grades[A].notes,isValid:n.grades&&n.grades[A]&&n.grades[A].notes&&!(a.grades&&a.grades[A]&&a.grades[A].notes),name:`grades.${A}
2.notes`,onChange:t,placeholder:"(optional)",rows:1,style:{border:0,borderRadius:0,fontSize:14,fontWeight:500,height:50,minWidth:450,resize:"none"},value:y.notes})})]}),!_&&!y&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("td",{className:"text-warning text-center",colspan:"5",children:(0,N.jsx)(ke.A,{defaultMessage:"This user has not been scored yet",description:"",id:"label.this_user_has_not_been_scored_yet.88993152"})})})]})},s)})})]})]})}),(0,N.jsx)(Ce.S,{className:"mb-5 clearfix",children:(0,N.jsx)(ve.A,{className:"float-end",onClick:i,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",description:"",id:"label.submit.155f816c"})})})]})}})})}}var RH=(0,n.G0)(IH((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(fy,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{layout:s,ref:e=>this.comp=e}))})}}return s})(FH)));class DH extends l.Component{constructor(e){super(e);const s=ci()(new Date),a=s.clone().subtract(7,"days");this.state={end_date:s.toDate().getTime(),selected_range:"week",start_date:a.toDate().getTime(),tmap:null},this.picker=null}refreshAnyDayTMAP(){const{admin_challenge_grader:e,app:s,team_member_id:a}=this.props,{api:t}=s,{team:i}=e;let{end_date:l,start_date:n}=this.state;n=ci()(n).toISOString(),l=ci()(l).toISOString(),t.get(`/api/facilitators/groups/assignment/team/tmap/count-any-date/${i.id}/${n}/${l}`,{team_member_id:a}).then(e=>{let{tmap:s}=e;this.setState({tmap:s},()=>{this.formatAnyData()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}formatAnyData(){const{admin_challenge_grader:e,challenge_member_id:s}=this.props,{challenge:a}=e,{end_date:t,start_date:i,tmap:l}=this.state,{convertSeconds:n}=(null===Re._$||void 0===Re._$?void 0:Re._$.time)||{},r=(null===a||void 0===a?void 0:a.members.find(e=>e.id==s))||null,o=(null===r||void 0===r?void 0:r.team_member)||null,d=Kd(o);if(!d)return;const c=ci()(i),h=ci()(t).diff(c,"days"),u=[];let m=0;for(let g=0;g<h;g++){const e={},s=l[g]||0;m+=s,e[d.fullname]=Math.round(s/3600*100)/100||0,e.name=ci()(t).endOf("day").subtract(h,"days").add(g+1,"days").endOf("day").format("MMMM Do"),u.push(e)}this.setState({past_range_agg:n(m),selected_data:u})}componentDidMount(){this.refreshAnyDayTMAP()}componentDidUpdate(e,s,a){e.team_member_id!==this.props.team_member_id&&this.refreshAnyDayTMAP()}render(){const{admin_challenge_grader:e,app:s}=this.props,{team:a}=e,t=a&&a.members,{selected_data:i}=this.state;let{end_date:l,start_date:n}=this.state;return n=ci()(n).toISOString(),l=ci()(l).toISOString(),(0,N.jsxs)(Ce.S,{className:"time-on-platform-outer-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsxs)(Ce.S,{className:"filters-container mt-2",children:[(0,N.jsx)("h6",{className:"me-auto mb-0",children:"Time on Platform"}),(0,N.jsxs)(ve.A,{variant:"primary",onClick:()=>{const{end_date:e,selected_range:s,start_date:a}=this.state;this.picker&&this.picker.show({end_date:e,selected_range:s,start_date:a})},children:[ci()(n).format("MMM DD, YYYY")," - ",ci()(l).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"statistics-body",children:(0,N.jsx)(Ce.S,{className:"line-chart-outer-container",children:(0,N.jsx)(rH,{app:s,data:i,members:t,show_users:!1})})}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,selected_range:a,start_date:t}),this.refreshAnyDayTMAP()}})]})}}var BH=(0,n.G0)(_T(IH(DH)));class PH extends l.Component{constructor(e){super(e);const s=ci()(new Date),a=s.clone().subtract(7,"days");this.state={end_date:s.toDate().getTime(),selected_range:"week",start_date:a.toDate().getTime()},this.picker=null}formatAnyData(){const{any_days_report_docs:e,any_days_report_images:s,any_days_report_messages:a,any_days_report_videos:t,start_date:i}=this.state,l=(null===s||void 0===s?void 0:s.length)||0,n=[];for(let r=0;r<l;r++){const l=s[r],o=t[r],d=e[r],c=a[r],h=ci()(ci()(i).add(r,"days")).format("MMMM Do");n.push({document:(null===d||void 0===d?void 0:d.length)||0,image:(null===l||void 0===l?void 0:l.length)||0,messages:(null===c||void 0===c?void 0:c.length)||0,name:h,video:(null===o||void 0===o?void 0:o.length)||0})}this.setState({selected_data:n})}componentDidMount(){this.refreshAnyDayEngagements()}componentDidUpdate(e,s,a){e.challenge_member_id!==this.props.challenge_member_id&&this.refreshAnyDayEngagements()}refreshAnyDayEngagements(){const{admin_challenge_grader:e,app:s,challenge_member_id:a}=this.props,{assignment_component:t}=e,{api:i}=s;let{end_date:l,start_date:n}=this.state;n=ci()(n).toISOString(),l=ci()(l).toISOString(),i.get(`/api/facilitators/groups/assignment/teams/engagements/count-any-date/${t.id}/${n}/${l}`,{filter_challenge_member_id:a}).then(e=>{let{any_days_report_docs:s,any_days_report_files:a,any_days_report_images:t,any_days_report_messages:i,any_days_report_videos:l}=e;this.setState({any_days_report_docs:s,any_days_report_files:a,any_days_report_images:t,any_days_report_messages:i,any_days_report_videos:l},()=>{this.formatAnyData()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s})})}render(){const{selected_data:e}=this.state;let{end_date:s,start_date:a}=this.state;return a=ci()(a).toISOString(),s=ci()(s).toISOString(),(0,N.jsxs)(Ce.S,{className:"engagement-tab-outer-container",children:[(0,N.jsx)(Ce.S,{className:"header",children:(0,N.jsxs)(Ce.S,{className:"filters-container mt-2",children:[(0,N.jsx)("h6",{className:"me-auto mb-0",children:"Engagement"}),(0,N.jsxs)(ve.A,{variant:"primary",onClick:()=>{const{end_date:e,selected_range:s,start_date:a}=this.state;this.picker&&this.picker.show({end_date:e,selected_range:s,start_date:a})},children:[ci()(a).format("MMM DD, YYYY")," - ",ci()(s).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"statistics-body",children:(0,N.jsx)(Ce.S,{className:"stacked-bar-outer-container",children:(0,N.jsx)(YL,{data:e})})}),(0,N.jsx)(Xw,{onRef:e=>{this.picker=e},onSelect:e=>{let{end_date:s,selected_range:a,start_date:t}=e;this.setState({end_date:s,selected_range:a,start_date:t}),this.refreshAnyDayEngagements()}})]})}}var LH=(0,n.G0)(_T(IH(PH)));class OH extends l.Component{constructor(e){super(e),this.state={current_challenge_member_id:null}}componentDidMount(){const{challenge:e}=this.props.admin_challenge_grader,s=e&&e.members?e.members:[];if(!s||!s.length)return;let a=s[0];if(a){for(let e=0;e<s.length;e++){const t=s[e];if(t&&!this.isChallengeMemberGraded(t.id)){a=t;break}}this.setCurrentChallengeMember(a.id)}}isChallengeMemberGraded(e){const{challenge_member_rubrics:s}=this.props.admin_challenge_grader;return!!(s?s.filter(s=>s.challenge_member_id===e):[]).length}setCurrentChallengeMember(e){this.setState({current_challenge_member_id:e})}format4CData(e){const s=[{amt:4,name:"1C",score:1},{amt:4,name:"2C",score:2},{amt:4,name:"3C",score:4},{amt:4,name:"4C",score:3.5}];return e&&e.critical_score&&(s[0].score=e.critical_score),e&&e.communication_score&&(s[1].score=e.communication_score),e&&e.collaboration_score&&(s[2].score=e.collaboration_score),e&&e.creativity_score&&(s[3].score=e.creativity_score),s}async handleSubmit(e){let{notes:s,response_1:a,response_2:t,response_3:i,response_4:l}=e;const{current_challenge_member_id:n}=this.state,{challenge:r,handleChallengeMemberRubricSubmit:o,setLoa
2ding:d,setPhase:c}=this.props.admin_challenge_grader,h=(null===r||void 0===r?void 0:r.members)||[];d(!0),await o(n,a,t,i,l,s);let u=null;for(let m=0;m<h.length;m++){const e=h[m];if(!e)continue;if(e.id===n)continue;if(!this.isChallengeMemberGraded(e.id)){u=e;break}}u||c(2),d(!1)}render(){var e;const{current_challenge_member_id:s}=this.state,{admin_challenge_grader:a,app:t}=this.props,{locale:i}=t,{challenge:l,challenge_member_rubrics:n,num_four_c_graded:r}=a||{},o=(null===l||void 0===l?void 0:l.members)||[];let d=n&&s&&n?n.filter(e=>e.challenge_member_id===s):[];d=!!d&&d[0];const c=!!s&&o.find(e=>e.id===s),h=(null===c||void 0===c?void 0:c.team_member)||null,u=Kd(h)||!1,m=(null===c||void 0===c?void 0:c.four_c_score)||!1,g=(null===c||void 0===c?void 0:c.peer_four_c_score)||!1,p=(null===c||void 0===c?void 0:c.self_four_c_score)||!1,x=(null===c||void 0===c?void 0:c.facilitator_four_c_score)||!1,v=o&&o.length&&o.length>1,f=v?3:4;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{lg:8,children:[(0,N.jsxs)("h6",{className:"mt-3 mb-3",children:[(0,N.jsx)(jr,{path:"notepad/notepad.svg",size:14})," ",(0,N.jsx)(ke.A,{defaultMessage:"Learner overview",id:"label.learner_overview.f46c5fd7"})]}),(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Ue.A,{fluid:!0,className:"container-four-c",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"text-center",sm:f,children:[(0,N.jsx)(Iu,{disabled:!p,fourCs:p}),(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"4C's Self",id:"label.4cs_self.d01c81dd"})})})]}),v&&(0,N.jsxs)(Ve.A,{className:"text-center",sm:f,children:[(0,N.jsx)(Iu,{disabled:!g,fourCs:g}),(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"4C's Peer",id:"label.4cs_peer.a8da48fa"})})})]}),(0,N.jsxs)(Ve.A,{className:"text-center",sm:f,children:[(0,N.jsx)(Iu,{disabled:!x,fourCs:x}),(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"4C's Facilitator",id:"label.4cs_facilitator.78b8a948"})})})]}),(0,N.jsxs)(Ve.A,{className:"text-center",sm:f,children:[(0,N.jsx)(Iu,{disabled:!m,fourCs:m}),(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"4C's Final",id:"label.4cs_final.0df308a5"})})})]})]})})}),(0,N.jsxs)("h6",{className:"mt-4 mb-3",children:[(0,N.jsx)(jr,{path:"fav-list/fav-list.svg",size:20})," ",(0,N.jsx)(ke.A,{defaultMessage:"Learner summary",id:"label.learner_summary.87358328"})]}),(0,N.jsx)(Ce.S,{className:"plain-tabs learner-summary",children:(0,N.jsxs)($k.A,{defaultActiveKey:"time",children:[(0,N.jsx)(ld.A,{eventKey:"time",title:"Time on platform",children:s&&(0,N.jsx)(BH,{challenge_member_id:s})}),(0,N.jsx)(ld.A,{eventKey:"engagement",title:"Engagement",children:s&&(0,N.jsx)(LH,{challenge_member_id:s})}),(0,N.jsx)(ld.A,{eventKey:"assets",title:"Assets",children:s&&(0,N.jsx)(GH,{challenge_member_id:s})}),(0,N.jsx)(ld.A,{eventKey:"messages",title:"Messages",children:s&&(0,N.jsx)(QH,{challenge_member_id:s})})]})})]}),(0,N.jsxs)(Ve.A,{lg:4,children:[(0,N.jsxs)("div",{className:"clearfix",children:[(0,N.jsx)("div",{className:"float-end mb-2",style:{opacity:.75},children:(0,N.jsxs)("b",{children:[r,"/",o.length," ",(0,N.jsx)(ke.A,{defaultMessage:"Scored",id:"label.scored.079794b4"})]})}),(0,N.jsx)("h6",{className:"mt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Learner 4Cs",id:"label.learner_4cs.c158846f"})})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(li.A,{className:"team-member-selector",children:[(0,N.jsxs)(li.A.Toggle,{variant:"team-member-selector",children:[u&&(0,N.jsx)("div",{className:"float-start",children:(0,N.jsx)(Ya,{className:"me-2",size:25,user:u})}),u&&(0,N.jsx)("div",{className:"float-end mt-1",children:this.isChallengeMemberGraded(s)?(0,N.jsx)(bo.A,{pill:!0,bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Scored",id:"label.scored.079794b4"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Not scored",id:"label.not_scored.8d57c61c"})})}),(0,N.jsx)("p",{className:"mb-0",style:{overflow:"hidden",textOverflow:"ellipsis"},children:(0,N.jsxs)("b",{style:{whiteSpace:"nowrap"},children:[u&&(0,N.jsx)(N.Fragment,{children:null===u||void 0===u?void 0:u.fullname}),!u&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select",id:"label.select.2a78025d"})})]})})]}),(0,N.jsx)(li.A.Menu,{style:{width:"100%"},children:(null===l||void 0===l||null===(e=l.members)||void 0===e?void 0:e.length)&&l.members.map((e,s)=>{let{id:a,team_member:t}=e;const i=Kd(t);return(0,N.jsxs)(li.A.Item,{href:"#",onClick:()=>this.setCurrentChallengeMember(a),children:[(0,N.jsx)("div",{className:"float-start",children:(0,N.jsx)(Ya,{className:"me-2",size:25,user:i})}),(0,N.jsx)("div",{className:"float-end mt-1 ms-2",children:this.isChallengeMemberGraded(a)?(0,N.jsx)(bo.A,{pill:!0,bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Scored",id:"label.scored.079794b4"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Not scored",id:"label.not_scored.8d57c61c"})})}),(0,N.jsx)("p",{className:"mb-0",style:{overflow:"hidden",textOverflow:"ellipsis"},children:(0,N.jsx)("b",{style:{whiteSpace:"nowrap"},children:null===i||void 0===i?void 0:i.fullname})})]},s)})})]})}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,validateOnChange:!0,validationSchema:(0,Re.by)({locale:i,scope:"assignment.challenge_member_rubric"}),initialValues:{notes:d&&d.notes?d.notes:"",response_1:d?d.response_1:0,response_2:d?d.response_2:0,response_3:d?d.response_3:0,response_4:d?d.response_4:0},onSubmit:async(e,s)=>{this.handleSubmit(e)},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsx)(qa.A,{className:"table-team-member-rubric table-rubric mt-2",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{className:"learner-4c-title",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"C1. Critical thinking",id:"label.c1_critical_thinking.f76666b2"})}),(0,N.jsx)(ds.Kw,{name:"response_1",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{className:"learner-4c-selection",children:(0,N.jsx)(KH,{c:"critical",item:"response_1",updateScore:i,value:n.response_1})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{className:"learner-4c-title",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"C2. Communication",id:"label.c2_communication.48731913"})}),(0,N.jsx)(ds.Kw,{name:"response_2",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{className:"learner-4c-selection",children:(0,N.jsx)(KH,{c:"communication",item:"response_2",updateScore:i,value:n.response_2})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{className:"learner-4c-title",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"C3. Collaboration",id:"label.c3_collaboration.0a9bbd1b"})}),(0,N.jsx)(ds.Kw,{name:"response_3",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{className:"learner-4c-selection",children:(0,N.jsx)(KH,{c:"collaboration",item:"response_3",updateScore:i,value:n.response_3})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{className:"learner-4c-title",children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"C4. Creativity",id:"label.c4_creativity.ad7122ac"})}),(0,N.jsx)(ds.Kw,{name:"response_4",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{className:"learner-4c-selection",children:(0,N.jsx)(KH,{c:"creativity",item:"response_4",updateScore:i,value:n.response_4})})]})]})}),(0,N.jsxs)(os,{className:"mt-4",children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Add feedback",i
2d:"label.add_feedback.83b44fd9"}),(0,N.jsx)("small",{className:"text-muted ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})})]}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:l.notes&&s.notes,isValid:l.notes&&!s.notes,name:"notes",onChange:a,style:{fontSize:14,fontWeight:500,height:150,resize:"none"},type:"text",value:n.notes}),(0,N.jsx)(ds.Kw,{name:"notes",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(ve.A,{className:"float-end",type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})}})]})]})})}}var HH=(0,P.G0)(IH(OH));class UH extends l.Component{constructor(e){super(e),this.state={error:null,loading:!0,page:1,page_size:10,team_messages:[]}}componentDidMount(){this.refreshMessages()}componentDidUpdate(e,s,a){e.challenge_member_id!==this.props.challenge_member_id&&this.refreshMessages()}refreshMessages(){const{app:e,challenge_member_id:s}=this.props,{api:a}=e,{page:t,page_size:i}=this.state;s&&(this.setState({error:null,loading:!0}),a.get(`/api/facilitators/challenge/members/${s}/chat/${t}/${i}`).then(e=>{let{count:s,team_messages:a}=e;this.setState({count:s,loading:!1,team_messages:a})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})}))}render(){const{error:e,loading:s,team_messages:a}=this.state;return(0,N.jsxs)(Ce.S,{className:"team-member-messages-outer-container",children:[s&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:e,variant:"danger",children:e}),(0,N.jsxs)(Ce.S,{className:"team-member-messages",children:[!s&&a&&a.length>0&&(0,N.jsx)(Ce.S,{className:"mb-3",children:a.map((e,s)=>{const{message:a}=e;if(!a)return"";const t=Kd(a);return(0,N.jsxs)(Ge.A,{body:!0,className:"mb-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center mb-2",children:[t&&(0,N.jsx)(Ya,{className:"me-2",showOnline:!1,size:25,user:t}),t&&(0,N.jsx)("b",{className:"me-2",children:t.fullname}),(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:["Date: ",(0,N.jsx)(Gh.XU,{value:a.created_at})," | ",(0,N.jsx)(Gh.ib,{value:a.created_at})]})})]}),(0,N.jsx)("div",{className:"message",dangerouslySetInnerHTML:{__html:a.body}})]},s)})}),!s&&a&&0===a.length&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)("i",{children:"No messages sent"})})]}),(0,N.jsx)(Lr,{count:this.state.count,onChange:e=>{this.setState({page:e},()=>{this.refreshMessages()})},page:this.state.page,page_size:this.state.page_size})]})}}var QH=(0,n.G0)(IH(UH));class VH extends l.Component{constructor(e){super(e),this.state={challenge_files:[],error:null,loading:!0,page:1,page_size:10}}componentDidMount(){this.refreshAssets()}componentDidUpdate(e,s,a){e.challenge_member_id!==this.props.challenge_member_id&&this.refreshAssets()}refreshAssets(){const{app:e,challenge_member_id:s}=this.props,{page:a,page_size:t}=this.state,{api:i}=e;s&&(this.setState({error:null,loading:!0}),i.get(`/api/facilitators/challenge/members/${s}/assets/${a}/${t}`).then(e=>{let{challenge_files:s,count:a}=e;this.setState({challenge_files:s,count:a,loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:null})}))}render(){const{challenge_files:e,error:s,loading:a}=this.state;return(0,N.jsxs)(Ce.S,{className:"team-member-assets-outer-container",children:[a&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:s,variant:"danger",children:s}),(0,N.jsxs)(Ce.S,{className:"team-member-assets",children:[!a&&e&&e.length>0&&(0,N.jsx)(Ce.S,{className:"mb-3",children:e.map((e,s)=>{const{file:a}=e;return a?(0,N.jsxs)(Ge.A,{body:!0,className:"mb-3",children:[(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:["Date: ",(0,N.jsx)(Gh.XU,{value:a.created_at})," | ",(0,N.jsx)(Gh.ib,{value:a.created_at})]})}),(0,N.jsx)("div",{children:(0,N.jsx)("b",{children:(0,N.jsx)("a",{alt:"Opens in a New Window",href:e.file.location,rel:"noopener noreferrer",target:"_blank",children:e.file_name})})})]},s):""})}
2),!a&&e&&0===e.length&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)("i",{children:"No assets uploaded"})})]}),(0,N.jsx)(Lr,{count:this.state.count,onChange:e=>{this.setState({page:e},()=>{this.refreshAssets()})},page:this.state.page,page_size:this.state.page_size})]})}}var GH=(0,n.G0)(IH(VH));class WH extends l.Component{render(){const{item:e,updateScore:s,value:a}=this.props;function t(e){const{score:s}=e;if(0===s||s>4)return;let a="";for(let t=1;t<=s;t++)a+="\u2605";if(s<4)for(let t=1;t<=4-s;t++)a+="\u2606";return(0,N.jsx)("span",{className:"star",children:a})}return(0,N.jsxs)(li.A,{align:"end",className:"learner-4c-selector",drop:"down",children:[(0,N.jsx)(li.A.Toggle,{variant:"learner-4c-selector",children:0!==a?(0,N.jsx)(t,{score:a}):"Select"}),(0,N.jsx)(li.A.Menu,{children:(0,N.jsxs)(Ce.S,{className:"dropdown-menu-wrapper",children:["critical"===this.props.c&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,4),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Exemplary",description:"",id:"label.exemplary.f897ad1b"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:4})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Shows an in-depth understanding of the problem and thoroughly and accurately identifies many specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).",description:"",id:"label.shows_an_in_depth_understanding_of.3ffb1f00"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Independently gathers relevant information from multiple sources on the challenge topic; gathers very accurate, correct, credible, and trustworthy sources.",description:"",id:"label.independently_gathers_relevant_inf.606e061b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Actively contributes and encourages others to develop a clear, reasonable solution that is meaningful to the problem.",description:"",id:"label.actively_contributes_and_encourage.81138e8a"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,3),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Strong",description:"",id:"label.strong.30a04fdc"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:3})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Shows a clear understanding of the problem and its importance; identifies many specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).",description:"",id:"label.shows_a_clear_understanding_of_the.e1a1e022"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"With no assistance, gathers information from sources on the challenge topic; uses accurate, correct, credible, and trustworthy sources",description:"",id:"label.with_no_assistance_gathers_informa.498c624a"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Contributes to a clear, reasonable solution that is meaningful to the problem.",description:"",id:"label.contributes_to_a_clear_reasonable.2245481e"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,2),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Emerging",description:"",id:"label.emerging.96341c76"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:2})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Shows an adequate understanding of the problem and its importance; identifies some specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).",description:"",id:"label.shows_an_adequate_understanding_of.4487bd28"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"With little assistance, gathers information from sources on the challenge topic; uses accurate, correct, credible, and trustworthy sources most of the time.",description:"",id:"label.with_little_assistance_gathers_inf.56ac81f2"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Contributes to the development of a reasonable, acceptable solution.",description:"",id:"label.contributes_to_the_development_of.d83d81c3"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,1),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Basic",description:"",id:"label.basic.0e35f6e9"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:1})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Shows a partially-developed or limited understanding of the problem and its importance; identifies a few specific factors that influence the problem-solving approach (e.g. audience, constraints, prior knowledge).",description:"",id:"label.shows_a_partially_developed_or_lim.c9ca231f"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Rarely, or with assistance, gathers information from sources on the challenge topic; sources are at times inaccurate or not trustworthy.",description:"",id:"label.rarely_or_with_assistance_gathers.c35a2a04"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Contributes to the development of a partially-acceptable or unacceptable solution.",description:"",id:"label.contributes_to_the_development_of.fad59360"})})]})]})]}
2),"communication"===this.props.c&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,4),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Exemplary",description:"",id:"label.exemplary.f897ad1b"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:4})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Consistently develops a clear, focused, and specific message when communicating using 21st century tools; both the sender and the receiver understand the same information as a result of the communication.",description:"",id:"label.consistently_develops_a_clear_focu.738550b1"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Consistently communicates positively and indicates that collaborators\u2019 opinions and ideas are valued. Consistently delivers feedback in a manner that makes the recipients feel respected.",description:"",id:"label.consistently_communicates_positive.bba10dfb"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Listens actively and attentively, demonstrates an interest in the speaker\u2019s message, and provides verbal or nonverbal feedback to indicate that the message was received; shows understanding.",description:"",id:"label.listens_actively_and_attentively_d.0e6b298f"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,3),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Strong",description:"",id:"label.strong.30a04fdc"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:3})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Usually develops clear, focused, concise, and specific messages when communicating using digital media and environments.",description:"",id:"label.usually_develops_clear_focused_con.71e8ca16"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Is usually positive and is beginning to express that collaborators\u2019 opinions and ideas are valued. Delivers feedback in a manner that makes the recipients feel respected; shows care and respect.",description:"",id:"label.is_usually_positive_and_is_beginni.49571e61"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Listens actively and attentively, demonstrates an interest in the speaker\u2019s message, and provides verbal or nonverbal feedback to indicate that the message was received and to show understanding.",description:"",id:"label.listens_actively_and_attentively_d.31d0f9f0"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,2),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Emerging",description:"",id:"label.emerging.96341c76"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:2})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Develops clear, focused, concise, and specific messages when communicating using digital media and environments some of the time.",description:"",id:"label.develops_clear_focused_concise_and.3be02882"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Is usually positive, and lets collaborators know that their opinions and ideas are valued most of the time. Delivers feedback in a manner that makes the recipients feel respected; can be direct, but shows care and respect most of the time.",description:"",id:"label.is_usually_positive_and_lets_colla.c08a7601"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Listens actively and attentively most of the time, demonstrates an interest in the speaker\u2019s message, and usually provides verbal or nonverbal feedback to indicate that the message was received and to show understanding.",description:"",id:"label.listens_actively_and_attentively_m.83dce3c8"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,1),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Basic",description:"",id:"label.basic.0e35f6e9"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:1})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Develops messages to communicate using digital media and environments, but the messages lack clarity, focus, and specificity.",description:"",id:"label.develops_messages_to_communicate_u.52891955"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Is sometimes positive, and inconsistently lets collaborators know that their opinions and ideas are valued. Delivers feedback, but sometimes comes across as lacking respect when attempting to be direct.",description:"",id:"label.is_sometimes_positive_and_inconsis.c8249114"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Inconsistently listens actively and attentively; demonstrates interest in the speaker\u2019s message, but does not provide verbal or nonverbal feedback to indicate that the message was received and to show understanding.",description:"",id:"label.inconsistently_listens_actively_an.540c37b2"})})]})]})]}
2),"collaboration"===this.props.c&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,4),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Exemplary",description:"",id:"label.exemplary.f897ad1b"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:4})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Consistently stays focused on the task and what needs to be done; very self-directed. Follows through on assigned tasks and does not depend on others to do the work.",description:"",id:"label.consistently_stays_focused_on_the.1792ba9f"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Actively invites others to participate equitably, promoting divergent and creative perspectives. Helps direct the group in reaching consensus.",description:"",id:"label.actively_invites_others_to_partici.6ed03099"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Consistently makes necessary compromises to accomplish a common goal. Always helps keep the group working well together.",description:"",id:"label.consistently_makes_necessary_compr.c06c9abb"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,3),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Strong",description:"",id:"label.strong.30a04fdc"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:3})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focuses on the task and what needs to be done most of the time. Other group members can count on this person. Follows through on most assigned tasks.",description:"",id:"label.focuses_on_the_task_and_what_needs.c0adcf68"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Encourages equal participation by asking clarifying or probing questions, paraphrasing ideas, and synthesizing group thinking.",description:"",id:"label.encourages_equal_participation_by.eb4a8b73"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Usually makes necessary compromises to accomplish a common goal. Helps keep the group working well together.",description:"",id:"label.usually_makes_necessary_compromise.cf3afcf5"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,2),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Emerging",description:"",id:"label.emerging.96341c76"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:2})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focuses on the task and what needs to be done some of the time. Other group members must sometimes remind this person to keep on task. Does not follow through on some assigned tasks.",description:"",id:"label.focuses_on_the_task_and_what_needs.59683097"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Allows for equal participation by both sharing ideas and listening to the ideas of others.",description:"",id:"label.allows_for_equal_participation_by.26d901da"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Occasionally makes compromises to accomplish a common goal. Sometimes helps keep the group working well together.",description:"",id:"label.occasionally_makes_compromises_to.52c60b41"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,1),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Basic",description:"",id:"label.basic.0e35f6e9"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:1})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Rarely focuses on the task and what needs to be done. Lets others do the work. Seldom follows through on assigned tasks.",description:"",id:"label.rarely_focuses_on_the_task_and_wha.3cbd6271"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Shares ideas without listening or listens without sharing ideas. Tends to dominate discussions.",description:"",id:"label.shares_ideas_without_listening_or.536352ca"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Rarely makes compromises to accomplish a common goal. Has some difficulty getting along with other group members.",description:"",id:"label.rarely_makes_compromises_to_accomp.895c3549"})})]})]})]}
2),"creativity"===this.props.c&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,4),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Exemplary",description:"",id:"label.exemplary.f897ad1b"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:4})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Takes an original, unique, and imaginative approach to idea generation; offers ideas that are broad in their diversity.",description:"",id:"label.takes_an_original_unique_and_imagi.98a07be9"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Uses ideas to create a product that is directly related to the challenge or problem. Product is considered to be valuable, unique, and creative.",description:"",id:"label.uses_ideas_to_create_a_product_tha.16feadb2"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Models resilience when confronted with production challenges/setbacks. Is confident and able to take calculated risks and adapt plans.",description:"",id:"label.models_resilience_when_confronted.e6f66a8f"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,3),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Strong",description:"",id:"label.strong.30a04fdc"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:3})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Generates many clear ideas to meet the challenge; ideas closely address the challenge and are well-detailed to spark a creative process.",description:"",id:"label.generates_many_clear_ideas_to_meet.d2268ced"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Uses ideas to create a product that is related to the challenge or problem. Product is considered to be sufficiently valuable, unique, and creative.",description:"",id:"label.uses_ideas_to_create_a_product_tha.694efb05"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Consistently perseveres when presented with challenges, shows resilience in situations in which failure is part of the experience, and shows confidence and an ability to take risks.",description:"",id:"label.consistently_perseveres_when_prese.8cba9c23"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,2),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Emerging",description:"",id:"label.emerging.96341c76"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:2})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Generates a sufficient volume of clear ideas to meet the challenge; ideas address the challenge and are sufficiently detailed to spark a creative process.",description:"",id:"label.generates_a_sufficient_volume_of_c.d6ec98e6"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Uses ideas to create a product that is related to the challenge or problem. Product is considered to be somewhat valuable, unique, and creative.",description:"",id:"label.uses_ideas_to_create_a_product_tha.cbe278b8"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Usually perseveres when presented with challenges/setbacks.",description:"",id:"label.usually_perseveres_when_presented.d38947f3"})})]})]}),(0,N.jsxs)(li.A.Item,{onClick:()=>s(e,1),children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Basic",description:"",id:"label.basic.0e35f6e9"})})," ",(0,N.jsx)("p",{className:"pull-right",children:(0,N.jsx)(t,{score:1})}),(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Communicates ideas to meet the challenge, but the volume is not sufficient to spark a creative process; ideas are somewhat connected to the challenge at hand.",description:"",id:"label.communicates_ideas_to_meet_the_cha.456c4f32"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Creates a product that has a vague or incomplete connection to the challenge or problem. Product is not considered to be useful or unique and is not considered to be creative. (May simply replicate an existing product.)",description:"",id:"label.creates_a_product_that_has_a_vague.6539be3c"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Sometimes perseveres when presented with challenges/setbacks.",description:"",id:"label.sometimes_perseveres_when_presente.213279f4"})})]})]})]})]})})]})}}var KH=WH,YH=t(55904);var qH=e=>{const{api:s,locale:a}=(0,n.nm)(),{assignment:t,challenge:i,challenge_rubric:r,deliverable:o,deliverable_choice:d,handleChallengeRubricSubmit:c,is_challenge_graded:h,team:u,users_learners:m}=(0,l.useContext)(kH),{deliverable_challenges:g}=(null===i||void 0===i?void 0:i.challenge_template)||{},[p,x]=(0,l.useState)(!1);return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{lg:8,children:[(0,N.jsx)(ve.A,{className:"float-end mt-3",onClick:async()=>{try{var e,a;const t=(null===i||void 0===i||null===(e=i.members)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.group_member_assignment_component)||{},{id:l,group_member_assignment_id:n}=t;if(!l||!n)return;x(!0),await s.post("/api/teams/members/facilitator/add",{team_id:null===u||void 0===u?void 0:u.id}),x(!1),await window.open(`/assignment/${n}/${l}/content`)}catch({err:err}){w(err),x(!1)}},variant:"link",children:(0,N.jsxs)("strong",{className:"d-flex align-items-center",children:[(0,N.jsx)(ke.A,{defaultMessage:"View team challenge",id:"label.view_team_challenge.c76c7047"}),p?(0,N.jsx)(qt.A,{animation:"border",className:"ms-2",size:"sm"}):(0,N.jsx)(ze.EQc,{className:"ms-2"})]})}),(0,N.jsxs)("h6",{className:"mt-3",children:[(0,N.jsx)(jr,{path:"circle_w_check/check_green.svg",size:22})," Selected Deliverable"]}),!(null===g||void 0===g||!g.length)&&(0,N.jsx)(Ce.S,{className:"deliverable-challenge-list-container",style:{width:"100%"},children:g.filter(e=>d.id===e.id).map((e,s)=>(0,N.jsx)(l.Fragment,{children:(0,N.jsx)(Em,{deliverable_challenge:e,is_first:!0})},s))}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsxs)("h6",{className:"mt-3",children:[(0,N.jsx)(jr,{height:20,path:"migration/migration.svg",width:22})," Uploaded Deliverable"]})}),(0,N.jsx)(Ve.A,{className:"text-end",lg:6,children:(0,N.jsx)("div",{className:"mt-3",children:(0,N.jsxs)("small",{children:[(0,N.jsx)("b",{children:"Date Submitted:"})," ",(0,N.jsx)(Gh.XU,{value:i.completed})," at ",(0,N.jsx)(Gh.ib,{value:i.completed})," ",i.completed>t.due?(0,N.jsx)(bo.A,{pill:!0,bg:"danger",className:"ms-1",children:"Late"}):(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"ms-1",children:"On Time"})]})})})]}),(0,N.jsx)(Ge.A,{body:!0,children:o&&(0,N.jsx)(Ku,{deliverable:o,show_link:!0})})]}),(0,N.jsxs)(Ve.A,{lg:4,children:[(0,N.jsx)("h6",{className:"mt-3",children:"Team Deliverable"}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{style:{padding:10},children:[(0,N.jsx)("div",{className:"float-start",children:(0,N.jsx)(tn,{className:"me-2",users:m})}),(0,N.jsx)("div",{className:"float-end mt-1",children:h?(0,N.jsxs)(bo.A,{pill:!0,bg:"success",children:[`Scored ${u&&i.score?i.score:""}`,(0,N.jsx)("sup",{children:"%"})," "]}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Not scored",description:"",id:"label.not_scored.8d57c61c"})})}),(0,N.jsx)("p",{className:"mb-0",style:{overflow:"hidden",textOverflow:"ellipsis"},children:(0,N.jsx)("b",{style:{whiteSpace:"nowrap"},children:u.name})})]})}),(0,N.jsx)(ds.l1,{validateOnChange:!0,validationSchema:(0,Re.by)({locale:a,scope:"assignment.challenge_rubric"}),initialValues:{notes:(null===r||void 0===r?void 0:r.notes)||"",response_1:(null===r||void 0===r?void 0:r.response_1)||0,response_2:(null===r||void 0===r?void 0:r.response_2)||0,response_3:(null===r||void 0===r?void 0:r.response_3)||0,response_4:(null===r||void 0===r?void 0:r.response_4)||0,response_5:(null===r||void 0===r?void 0:r.response_5)||0},onSubmit:(e,s)=>{c(e.response_1,e.response_2,e.response_3,e.response_4,e.response_5,e.notes)},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e,n=!s.response_1&&!s.response_2&&!s.response_3&&!s.response_4&&!s.response_5?Number.parseInt(l.response_1)+Number.parseInt(l.response_2)+Number.parseInt(l.response_3)+Number.parseInt(l.response_4)+Number.parseInt(l.response_5):"-";return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsx)(qa.A,{className:"table-team-rubric table-rubric mt-2",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{verticalAlign:"middle"},children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Mastery of Knowledge",id:"label.mastery_of_knowledge.db584280"}),(0,N.jsx)(Ua.A,{placement:"auto",trigger:["hover","focus"],overlay:(0,N.jsx)(Hu.A,{id:"popover-response_1",children:(0,N.jsx)(Hu.A.Body,{children:(0,N.jsx)(JH,{category:"response_1"})})}),children:(0,N.jsx)(ve.A,{className:"p-0 overlay-trigger",onClick:e=>e.preventDefault(),variant:"link",children:(0,N.jsx)(YH.Gxj,{})})},"response_1")]}),(0,N.jsx)(ds.Kw,{name:"response_1",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{style:{verticalAlign:"middle",width:110},children:(0,N.jsxs)(Ei.A,{className:"input-group-grade",children:[(0,N.jsx)(be.A,{className:"input-grade "+(s.response_1?"text-danger":""),name:"response_1",onChange:a,type:"text",value:l.response_1}),(0,N.jsx)(Ei.A.Text,{className:"bg-white ps-1 "+(s.response_1?"text-danger":""),children:(0,N.jsx)("b",{children:"/ 20"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{verticalAlign:"middle"},children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Quality of Work",id:"label.quality_of_work.e02597d6"}),(0,N.jsx)(Ua.A,{placement:"auto",trigger:["hover","focus"],overlay:(0,N.jsx)(Hu.A,{id:"popover-response_2",children:(0,N.jsx)(Hu.A.Body,{children:(0,N.jsx)(JH,{category:"response_2"})})}),children:(0,N.jsx)(ve.A,{className:"p-0 overlay-trigger",onClick:e=>e.preventDefault(),variant:"link",children:(0,N.jsx)(YH.Gxj,{})})},"response_2")]}),(0,N.jsx)(ds.Kw,{name:"response_2",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{style:{verticalAlign:"middle",width:110},children:(0,N.jsxs)(Ei.A,{className:"input-group-grade",children:[(0,N.jsx)(be.A,{className:"input-grade "+(s.response_2?"text-danger":""),name:"response_2",onChange:a,type:"text",value:l.response_2}),(0,N.jsx)(Ei.A.Text,{className:"bg-white ps-1 "+(s.response_2?"text-danger":""),children:(0,N.jsx)("b",{children:"/ 20"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsxs)("th",{style:{verticalAlign:"middle"},children:[(0,N.jsx)(Ce.S,{className:"d-flex flex-column",children:(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Creativity & Originality",id:"label.creativity_and_originality.1c05414a"}),(0,N.jsx)(Ua.A,{placement:"auto",trigger:["hover","focus"],overlay:(0,N.jsx)(Hu.A,{id:"popover-response_3",children:(0,N.jsx)(Hu.A.Body,{children:(0,N.jsx)(JH,{category:"response_3"})})}),children:(0,N.jsx)(ve.A,{className:"p-0 overlay-trigger",onClick:e=>e.preventDefault(),variant:"link",children:(0,N.jsx)(YH.Gxj,{})})},"response_3")]})}),(0,N.jsx)(ds.Kw,{name:"response_3",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)("td",{style:{verticalAlign:"middle",width:110},children:(0,N.jsxs)(Ei.A,{className:"input-group-grade",children:[(0,N.jsx)(be.A,{className:"input-grade "+(s.response_3?"text-danger":""),name:"response_3",onCh
2ange:a,type:"text",value:l.response_3}),(0,N.jsx)(Ei.A.Text,{className:"bg-white ps-1 "+(s.response_3?"text-danger":""),children:(0,N.jsx)("b",{children:"/ 20"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{verticalAlign:"middle"},children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Sources and Citations",id:"label.sources_and_citations.a8da5789"}),(0,N.jsx)(Ua.A,{placement:"auto",trigger:["hover","focus"],overlay:(0,N.jsx)(Hu.A,{id:"popover-response_4",children:(0,N.jsx)(Hu.A.Body,{children:(0,N.jsx)(JH,{category:"response_4"})})}),children:(0,N.jsx)(ve.A,{className:"p-0 overlay-trigger",onClick:e=>e.preventDefault(),variant:"link",children:(0,N.jsx)(YH.Gxj,{})})},"response_4")]}),(0,N.jsx)(ds.Kw,{name:"response_4",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{style:{verticalAlign:"middle",width:110},children:(0,N.jsxs)(Ei.A,{className:"input-group-grade",children:[(0,N.jsx)(be.A,{className:"input-grade "+(s.response_4?"text-danger":""),name:"response_4",onChange:a,type:"text",value:l.response_4}),(0,N.jsx)(Ei.A.Text,{className:"bg-white ps-1 "+(s.response_4?"text-danger":""),children:(0,N.jsx)("b",{children:"/ 20"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{style:{verticalAlign:"middle"},children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsxs)("span",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Established requirements",id:"label.established_requirements.0e96fe22"}),(0,N.jsx)(Ua.A,{placement:"auto",trigger:["hover","focus"],overlay:(0,N.jsx)(Hu.A,{id:"popover-response_5",children:(0,N.jsx)(Hu.A.Body,{children:(0,N.jsx)(JH,{category:"response_5"})})}),children:(0,N.jsx)(ve.A,{className:"p-0 overlay-trigger",onClick:e=>e.preventDefault(),variant:"link",children:(0,N.jsx)(YH.Gxj,{})})},"response_5")]}),(0,N.jsx)(ds.Kw,{name:"response_5",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsx)("td",{style:{verticalAlign:"middle",width:110},children:(0,N.jsxs)(Ei.A,{className:"input-group-grade",children:[(0,N.jsx)(be.A,{className:"input-grade "+(s.response_5?"text-danger":""),name:"response_5",onChange:a,type:"text",value:l.response_5}),(0,N.jsx)(Ei.A.Text,{className:"bg-white ps-1 "+(s.response_5?"text-danger":""),children:(0,N.jsx)("b",{children:"/ 20"})})]})})]})]})}),(0,N.jsxs)(Ce.S,{className:"text-end",children:[(0,N.jsx)("small",{className:"me-2",children:(0,N.jsx)("b",{children:"Team Score"})})," ",(0,N.jsx)("b",{children:n}),(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:"/100"})})]}),(0,N.jsxs)(os,{className:"mt-4",children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Add feedback",id:"label.add_feedback.83b44fd9"}),(0,N.jsx)("small",{className:"text-muted ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})})]}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:i.notes&&s.notes,isValid:i.notes&&!s.notes,name:"notes",onChange:a,style:{fontSize:14,fontWeight:500,height:150,resize:"none"},type:"text",value:l.notes}),(0,N.jsx)(ds.Kw,{name:"notes",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(ve.A,{className:"float-end",onClick:t,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})}})]})]})})};const JH=e=>{const s=(0,ja.A)(),{category:a}=e,t={response_1:{categories:[{description:s.formatMessage({id:"label.deliverable_demonstrates_exception.79a8e7b0",defaultMessage:"Deliverable demonstrates exceptional mastery of key knowledge and/or skills."}),name:s.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),range:"18-20pts"},{description:s.formatMessage({id:"label.deliverable_demonstrates_strong_ma.5eeed334",defaultMessage:"Deliverable demonstrates strong mastery of key knowledge and/or skills."}),name:s.formatMessage({id:"label.accomplished.751013ba",defaultMessage:"Accomplished"}),range:"15-17pts"},{description:s.formatMessage({id:"label.deliverable_demonstrates_adequate.a30c349b",defaultMessage:"Deliverable demonstrates adequate mastery of key knowledge and/or skills."}),name:s.formatMessage({id:"label.developing.b30e2689",defaultMessage:"Developing"}),range:"12-14pts"},{description:s.formatMessage({id:"label.deliverable_demonstrates_limited_m.0d7d7a5e",defaultMessage:"Deliverable demonstrates limited mastery of key knowledge and/or skills."}),name:s.formatMessage({id:"label.beginning.9e6b4172",defaultMessage:"Beginning"}),range:"0-11pts"}],name:s.formatMessage({id:"label.mastery_of_knowledge_and_skills.db08da87",defaultMessage:"Mastery of Knowledge & Skills"})},response_2:{categories:[{description:s.formatMessage({id:"label.deliverable_exhibits_excellent_res.a57427bc",defaultMessage:"Deliverable exhibits excellent results of superior quality."}),name:s.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),range:"18-20pts"},{description:s.formatMessage({id:"label.deliverable_exhibits_strong_result.f7913043",defaultMessage:"Deliverable exhibits strong results of good quality."}),name:s.formatMessage({id:"label.accomplished.751013ba",defaultMessage:"Accomplished"}),range:"15-17pts"},{description:s.formatMessage({id:"label.deliverable_exhibits_somewhat_effe.4784fcdd",defaultMessage:"Deliverable exhibits somewhat effective results of satisfactory quality."}),name:s.formatMessage({id:"label.developing.b30e2689",defaultMessage:"Developing"}),range:"12-14pts"},{description:s.formatMessage({id:"label.deliverable_exhibits_ineffective_r.4b1ea4d9",defaultMessage:"Deliverable exhibits ineffective results of poor quality."}),name:s.formatMessage({id:"label.beginning.9e6b4172",defaultMessage:"Beginning"}),range:"0-11pts"}],name:"Quality of Work"},response_3:{categories:[{description:s.formatMessage({id:"label.finished_product_demonstrates_extr.87e28dfa",defaultMessage:"Finished product demonstrates extraordinary resourcefulness, originality, and personalization."}),name:s.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),range:"18-20pts"},{description:s.formatMessage({id:"label.finished_product_demonstrates_adeq.7feebf97",defaultMessage:"Finished product demonstrates adequate resourcefulness, originality, and personalization."}),name:s.formatMessage({id:"label.accomplished.751013ba",defaultMessage:"Accomplished"}),range:"15-17pts"},{description:s.formatMessage({id:"label.finished_product_demonstrates_some.063315c9",defaultMessage:"Finished product demonstrates some resourcefulness, originality, and personalization."}),name:s.formatMessage({id:"label.developing.b30e2689",defaultMessage:"Developing"}),range:"12-14pts"},{description:s.formatMessage({id:"label.finished_product_demonstrates_limi.f143bd7e",defaultMessage:"Finished product demonstrates limited resourcefulness, originality, and personalization."}),name:s.formatMessage({id:"label.beginning.9e6b4172",defaultMessage:"Beginning"}),range:"0-11pts"}],name:"Creativity & Originality"},response_4:{categories:[{description:s.formatMessage({id:"label.deliverable_provides_at_least_3_re.d830adc6",defaultMessage:"Deliverable provides at least 3 reliable, interesting, and timely information sources relevant to the challenge.<br/>All sources of information and graphics are properly cited using citations."}),name:s.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),range:"18-20pts"},{description:s.formatMessage({id:"label.deliverable_provides_at_least_3_in.20c1522f",defaultMessage:"Deliverable provides at least 3 information sources relevant to the challenge.<br/>All sources of information are identified and credited using mostly proper citations."}),name:s.formatMessage({id:"label.accomplished.751013ba",defaultMessage:"Accomplished"}),range:"15-17pts"},{description:s.formatMessage({id:"label.deliverable_provides_at_least_3_in.59a3393b",defaultMessage:"Deliverable provides at least 3 information sources relevant to the challenge.<br/>Most sources of information are identified using mostly proper citations."}),name:s.formatMessage({id:"label.developing.b30e2689",defaultMessage:"Developing"}),range:"12-14pts"},{description:s.formatMessage({id:"label.deliverable_provides_some_informat.30b44f15",defaultMessage:"Deliverable provides some information sources relevant to the challenge.<br/>Little to no sources of information are identified using proper citation."}),name:s.formatMessage({id:"label.beginning.9e6b4172",defaultMessage:"Beginning"}),range:"0-11pts"}],name:"Sources & Citations"},response_5:{categories:[{description:s.formatMessage({id:"label.deliverable_meets_or_exceeds_all_o.067fec96",defaultMessage:"Deliverable meets or exceeds all of the challenge requirements."}),name:s.formatMessage({id:"label.exemplary.f897ad1b",defaultMessage:"Exemplary"}),range:"18-20pts"},{description:s.formatMessage({id:"label.deliverable_meets_most_of_the_chal.7baaaa5a",defaultMessage:"Deliverable meets most of the challenge requirements."}),name:s.formatMessage({id:"label.accomplished.751013ba",defaultMessage:"Accomplished"}),range:"15-17pts"},{description:s.formatMessage({id:"label.deliverable_fulfills_some_of_the_c.8d366e19",defaultMessage:"Deliverable fulfills some of the challenge requirements."}),name:s.formatMessage({id:"label.developing.b30e2689",defaultMessage:"Developing"}),range:"12-14pts"},{description:s.formatMessage({id:"label.deliverable_does_not_adequately_me.69cae624",defaultMessage:"Deliverable does not adequately meet all the challenge requirements."}),name:s.formatMessage({id:"label.beginning.9e6b4172",defaultMessage:"Beginning"}),range:"0-11pts"}],name:"Established Requirements"}},i=t.hasOwnProperty(a)?t[a]:null;return(0,N.jsx)(Ce.S,{children:i&&i.categories&&(0,N.jsx)(N.Fragment,{children:i.categories.map((e,s)=>{let{description:a,name:t,range:i}=e;return(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)("p",{className:"mb-1",children:[(0,N.jsx)("small",{className:"float-end",children:(0,N.jsx)("strong",{children:i})}),(0,N.jsx)("strong",{children:t})]}),(0,N.jsx)("p",{children:(0,N.jsx)("strong",{children:(0,N.jsx)("small",{children:a})})})]},s)})})})},XH=e=>{var s;let{onStepChange:a,steps:t}=e;return t=Array.isArray(t)?t:new Array(3).fill({title:"A"},{title:"B"},{title:"C"}),(0,N.jsx)(Ce.S,{className:"scoring-progress-container",children:!(null===(s=t)||void 0===s||!s.length)&&t.map((e,s)=>{let{icon:i,is_complete:n,is_locked:r,title:o}=e,d=s+1===t.length;n=Boolean(n),r=Boolean(r),o="string"==typeof o?o:"",i=i||(0,N.jsx)(ze.x$1,{style:{opacity:.25}}),i=n?(0,N.jsx)(ze.CMH,{size:20}):i;const c=e=>{e.preventDefault(),r||"function"===typeof a&&a(s)};return(0,N.jsxs)(l.Fragment,{children:[(0,N.jsxs)("div",{className:`node ${n?" node-complete":""} ${r?" node-locked":""} `,onClick:c,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||c(e)},role:"button",tabIndex:0,children:[(0,N.jsx)("span",{className:"icon",children:i}),(0,N.jsx)("p",{className:"title",children:o})]}
2),!d&&(0,N.jsx)("span",{className:"divider"})]},s)})})};XH.defaultProps={onStepChange:Function()};class ZH extends l.Component{constructor(e){super(e),this.state={all_challenge_member_rubrics:null,all_challenges:null,assignment:null,assignment_component:null,challenge:null,challenge_member_rubrics:null,challenge_rubric:null,challenge_template:null,error:null,group:null,group_tree:null,loading:!0,phase:0,team:null,tmap_total:0},this.learner_summary_dialog=null}refreshAssignment(){return new Promise((e,s)=>{const{app:a}=this.props,{assignment_id:t,group_id:i}=this.props.match.params,l=a.api;this.setState({assignment:null,error:null}),l.get("/api/assignments/get",{group_assignment_id:t,group_id:i}).then(s=>{let{assignment:a}=s;this.setState({assignment:a},()=>{e()})}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshGroup(){return new Promise((e,s)=>{const{app:a}=this.props,{group_id:t}=this.props.match.params,i=a.api;this.setState({error:null,group:null,group_tree:null}),i.get("/api/groups/get",{group_id:t}).then(s=>{let{group:a,tree:t}=s;this.setState({group:a,group_tree:t},()=>{e()})}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshAssignmentComponent(){return new Promise((e,s)=>{const{assignment_component_id:a,group_id:t}=this.props.match.params,{app:i}=this.props,l=i.api;this.setState({assignment_component:null,error:null}),l.get("/api/assignments/component/get",{group_assignment_component_id:a,group_id:t}).then(s=>{let{assignment_component:a}=s;this.setState({assignment_component:a},e)}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshChallenge(){const{app:e}=this.props,{challenge_id:s,group_id:a}=this.props.match.params,t=e.api;return new Promise((e,i)=>{this.setState({error:null,team:null}),t.get("/api/challenges/get",{challenge_id:s,group_id:a}).then(s=>{let{challenge:a,team:t}=s;this.setState({challenge:a,team:t},e)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),i(s)})})}refreshChallenges(){return new Promise((e,s)=>{const{app:a}=this.props,{assignment_component_id:t,group_id:i}=this.props.match.params,l=a.api;this.setState({all_challenges:null,error:null}),l.get(`/api/facilitators/challenges/list/${t}`,{group_id:i}).then(s=>{let{challenges:a}=s;this.setState({all_challenges:a},()=>{e()})}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}refreshGrades(){return new Promise((e,s)=>{const{app:a}=this.props,{challenge_id:t,group_id:i}=this.props.match.params,l=a.api;this.setState({all_challenge_member_rubrics:null,challenge_member_rubrics:null,challenge_rubric:null,error:null}),l.get(`/api/facilitators/challenge/${t}/grades`,{group_id:i}).then(s=>{let{challenge_member_rubrics:a,challenge_rubric:t}=s;const i=a;a=a.filter(e=>e.is_facilitator&&!e.is_peer&&!e.is_self),this.setState({all_challenge_member_rubrics:i,challenge_member_rubrics:a,challenge_rubric:t},()=>{e()})}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:a}),s(a)})})}isChallengeGraded(){const{challenge_rubric:e}=this.state;if(!e)return!1;const{response_1:s,response_2:a,response_3:t,response_4:i,response_5:l}=e;return null!=s&&null!=a&&null!=t&&null!=i&&null!=l}isFourCGraded(){const{challenge:e}=this.state;if(!e)return!1;const{members:s}=e;return!!s&&s.length===this.numFourCGraded()}numFourCGraded(){const{challenge:e}=this.state;if(!e)return!1;const{members:s}=e;if(!s)return!1;let a=0;for(const t of s)t&&null!=t.facilitator_four_c_score&&a++;return a}getTMAPTotal(){const{app:e}=this.props,{team:s}=this.state,{api:a}=e;return new Promise((e,t)=>{this.setState({error:null,tmap_total:null}),a.get(`/api/teams/tmap_total/${null===s||void 0===s?void 0:s.id}`).then(s=>{let{team:a}=s;const{tmap_total:t}=a;this.setState({tmap_total:t},e)}
2).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),t(s)})})}handleChallengeRubricSubmit(e,s,a,t,i,l){return new Promise((n,r)=>{const{app:o}=this.props,{challenge_id:d,group_id:c}=this.props.match.params,h=o.api;this.setState({error:null,loading:!0}),h.get(`/api/facilitators/challenge/${d}/grade/set`,{challenge_id:d,group_id:c,notes:l,response_1:e,response_2:s,response_3:a,response_4:t,response_5:i}).then(e=>{let{challenge_rubric:s}=e;this.setState({challenge_rubric:s,loading:!1,phase:1}),n()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),r(s)})})}handleChallengeMemberRubricSubmit(e,s,a,t,i,l){const n=this;return new Promise((r,o)=>{const{app:d}=this.props,{challenge_id:c,group_id:h}=this.props.match.params,u=d.api;this.setState({error:null}),u.get(`/api/facilitators/challenge/${c}/member/${e}/grade/set`,{challenge_id:c,group_id:h,notes:l,response_1:s,response_2:a,response_3:t,response_4:i}).then(async e=>{let{challenge_member_rubric:s}=e;await n.refreshGrades(),await n.refreshChallenge(),r()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s}),o(s)})})}handleFinalReviewSubmit(e,s){return new Promise((a,t)=>{const{app:i}=this.props,{challenge_id:l}=this.props.match.params,n=i.api;this.setState({error:null,loading:!0}),n.post(`/api/facilitators/challenge/${l}/grade/final`,{grades:s,notes:e}).then(()=>{this.setState({loading:!1}),a()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;this.setState({error:s,loading:!1}),t(s)})})}setPhase(e){return new Promise(s=>{this.setState({phase:e},()=>{s()})})}setLoading(e){this.setState({loading:e})}getAverage4Cs(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{all_challenge_member_rubrics:s}=this.state,a={c1:0,c2:0,c3:0,c4:0};if(!s||!s.length)return a;const t=s.length;if(t>0){for(let e=0;e<t;e++){const t=s[e];t&&(a.c1+=t.response_1,a.c2+=t.response_2,a.c3+=t.response_3,a.c4+=t.response_4)}a.c1=a.c1/t,a.c2=a.c2/t,a.c3=a.c3/t,a.c4=a.c4/t,e||(a.c1=a.c1.toFixed(2),a.c2=a.c2.toFixed(2),a.c3=a.c3.toFixed(2),a.c4=a.c4.toFixed(2))}return a}getNumericAverage4Cs(){const e=this.getAverage4Cs(!0);return Math.round((e.c1+e.c2+e.c3+e.c4)/4*25)}getAverageRawScore(){const{challenge:e}=this.state;if(!e||!e.members||!e.members.length)return 0;const s=e.members;let a=0,t=0;for(let i=0;i<s.length;i++){const e=s[i];if(!e)continue;const l=e.team_member;if(null!==l&&void 0!==l&&l.is_agent||null===l||void 0===l||!l.user)continue;const n=Number.parseFloat(e.score_raw);isNaN(n)||(a+=n,t++)}return t>0?(a/t).toFixed(2):0}showLearnerSummary(e){if(!this.learner_summary_dialog)return!1;this.learner_summary_dialog.showDialog(e)}getFacilitatorRubricForTeamMember(e){if(!e)return!1;const{all_challenge_member_rubrics:s}=this.state;if(!s)return!1;let a=s&&s.filter(s=>s.challenge_member_id===e.id&&s.is_facilitator);return a=!(!a||!a.length)&&a[0],a}isGradingComplete(){const{challenge:e}=this.state;return e&&e.is_graded}componentDidMount(){this.setState({loading:!0}),Promise.all([this.refreshGroup(),this.refreshAssignment(),this.refreshAssignmentComponent(),this.refreshChallenge(),this.refreshGrades(),this.refreshChallenges()]).then(()=>{this.getTMAPTotal(),this.setState({loading:!1})}).catch(e=>{this.setState({err:e,loading:!1})})}render(){var e,s;const{app:a}=this.props,{assignment_component_id:t,assignment_id:i,challenge_id:l,group_id:n}=this.props.match.params,{all_challenge_member_rubrics:r,all_challenges:o,assignment:d,assignment_component:c,challenge:h,challenge_member_rubrics:u,challenge_rubric:m,group:g,group_tree:p,phase:x,team:v,tmap_total:f}=this.state,j=g&&g.organization_id;let _=h&&h.challenge_data&&Array.isArray(h.challenge_data)?h.challenge_data.filter(e=>4===e.phase&&2===e.subphase):[];_=_.length?_[0]:null,_=_&&_.data&&Object.keys(_.data).length?_.data:null;const b=_&&_.deliverable?_.deliverable:null,A=_&&_.deliverable_choice?_.deliverable_choice:null,y=v&&v.members?v.members.reduce((e,s)=>{const a=Kd(s);return a&&e.push(a),e},[]):[],w=v&&v.members?v.members:[],S=this.isChallengeGraded(),C=this.isFourCGraded(),M=this.numFourCGraded(),k=this.isGradingComplete();return(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsx)(Ue.A,{className:"container-team-grader",children:(0,N.jsxs)(zH,{value:{all_challenge_member_rubrics:r,all_challenges:o,assignment:d,assignment_component:c,assignment_component_id:t,challenge:h,challenge_id:l,challenge_member_rubrics:u,challenge_rubric:m,deliverable:b,deliverable_choice:A,getAverage4Cs:this.getAverage4Cs.bind(this),getAverageRawScore:this.getAverageRawScore.bind(this),getFacilitatorRubricForTeamMember:this.getFacilitatorRubricForTeamMember.bind(this),getNumericAverage4Cs:this.getNumericAverage4Cs.bind(this),group:g,handleChallengeMemberRubricSubmit:this.handleChallengeMemberRubricSubmit.bind(this),handleChallengeRubricSubmit:this.handleChallengeRubricSubmit.bind(this),handleFinalReviewSubmit:this.handleFinalReviewSubmit.bind(this),is_challenge_graded:S,is_four_c_graded:C,num_four_c_graded:M,refreshAssignment:this.refreshAssignment.bind(this),refreshChallenge:this.refreshChallenge.bind(this),refreshChallenges:this.refreshChallenges.bind(this),refreshGrades:this.refreshGrades.bind(this),set
2Loading:this.setLoading.bind(this),setPhase:this.setPhase.bind(this),showLearnerSummary:this.showLearnerSummary.bind(this),team:v,team_members:w,tmap_total:f,users_learners:y},children:[this.state.loading&&(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{className:"text-center",md:12,children:(0,N.jsx)(Me.y$,{})})}),!this.state.loading&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{md:12,children:[(0,N.jsx)(vF.A,{children:(0,N.jsxs)(N.Fragment,{children:[a.userIsSiteAdmin()&&(0,N.jsx)(pa.mu,{to:"/admin",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Site",id:"label.site.fa795581"})})}),!a.userIsSiteAdmin()&&(a.userHasOrgRole("facilitator",j)||a.userHasOrgRole("moderator",j))&&(0,N.jsx)(pa.mu,{to:`/admin/groups/${j}`,children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"My dashboard",id:"label.my_dashboard.f4c56c94"})})}),a.userHasRight("manage_organization",j)&&(0,N.jsx)(N.Fragment,{children:p&&p.map(e=>(0,N.jsx)(pa.mu,{to:`/admin/organization/${null===e||void 0===e?void 0:e.id}`,children:(0,N.jsx)(vF.A.Item,{children:null===e||void 0===e?void 0:e.name},null===e||void 0===e?void 0:e.id)},null===e||void 0===e?void 0:e.id))}),(0,N.jsx)(pa.mu,{to:`/admin/group/${n}`,children:(0,N.jsx)(vF.A.Item,{children:null===g||void 0===g?void 0:g.name})}),(0,N.jsx)(pa.mu,{to:`/admin/group/${n}/assignment/${i}`,children:(0,N.jsx)(vF.A.Item,{children:null===d||void 0===d?void 0:d.title})}),"journey"===(null===d||void 0===d?void 0:d.type)&&(0,N.jsx)(pa.mu,{to:`/admin/group/${n}/assignment/${i}/${t}`,children:(0,N.jsx)(vF.A.Item,{children:null===c||void 0===c||null===(e=c.challenge_template)||void 0===e?void 0:e.title})}),(0,N.jsx)(pa.mu,{to:`/admin/group/${n}/assignment/${i}/challenge/${t}/view/${l}`,children:(0,N.jsx)(vF.A.Item,{children:null===v||void 0===v?void 0:v.name})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Score",id:"label.score.38e5a46c"})})]})}),g&&v&&(0,N.jsx)(Ce.S,{style:{alignItems:"center",display:"flex",flexDirection:"row"},children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(li.A,{alignleft:"true",drop:"down",children:[(0,N.jsx)(li.A.Toggle,{as:"h2",style:{cursor:"pointer"},children:null===v||void 0===v?void 0:v.name}),(0,N.jsx)(li.A.Menu,{style:{minWidth:320},children:o&&o.map((e,s)=>{var a;const i=((null===e||void 0===e?void 0:e.members)||[]).map(e=>Kd(null===e||void 0===e?void 0:e.team_member)),l=e.is_graded,n=e&&5===e.num_phases_complete;return(0,N.jsx)(li.A.Item,{disabled:!n,href:`/admin/group/${g.id}/assignment/${d.id}/challenge/${t}/grade/${e.id}`,children:(0,N.jsxs)(Ce.S,{className:"clearfix mt-2 mb-2",children:[(0,N.jsx)(Ce.S,{className:"float-start",children:(0,N.jsx)(tn,{className:"me-2",users:i})}),(0,N.jsx)(Ce.S,{className:"float-end",children:n?(0,N.jsx)(N.Fragment,{children:l?(0,N.jsx)(bo.A,{pill:!0,bg:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Scored",id:"label.scored.079794b4"})}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Not scored",id:"label.not_scored.8d57c61c"})})}):(0,N.jsx)(bo.A,{pill:!0,bg:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Incomplete",id:"label.incomplete.75f33cdf"})})}),(0,N.jsx)("b",{children:null===e||void 0===e||null===(a=e.team)||void 0===a?void 0:a.name})]})},s)})})]}),(0,N.jsx)("h5",{style:{lineHeight:"28.8px",opacity:.87},children:null===c||void 0===c||null===(s=c.challenge_template)||void 0===s?void 0:s.title})]})})]})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{this.setState({error:null})},show:this.state.error,variant:"danger",children:this.state.error})})}),h&&5===h.num_phases_complete&&b&&A?(0,N.jsxs)(Ce.S,{children:[3!==x&&(0,N.jsx)(XH,{onStepChange:e=>{this.setState({phase:e})},steps:[{icon:(0,N.jsx)(ze.YXz,{size:25}),is_complete:S,title:"Team Deliverable"},{icon:(0,N.jsx)(ze.x$1,{size:25}),is_complete:C,is_locked:!S,title:"Learner 4Cs"},{icon:(0,N.jsx)(ze.Ny1,{size:25}),is_complete:k,is_locked:!S||!C,title:"Review & Submit"}]}),(0,N.jsx)("hr",{}),0===x&&(0,N.jsx)(qH,{}),1===x&&(0,N.jsx)(HH,{}),2===x&&(0,N.jsx)(RH,{}),3===x&&(0,N.jsx)(EH,{}),(0,N.jsx)(sU,{onRef:e=>this.learner_summary_dialog=e})]}):(0,N.jsx)(We.A,{variant:"danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge is not completed.",id:"label.challenge_is_not_completed.0d6618fc"})})]})]})})})})}}var $H=(0,n.G0)(_T(ZH));class eU extends l.Component{constructor(e){super(e),this.state={challenge_member:null,show:!1}}
2showDialog(e){this.setState({challenge_member:e,show:!0})}handleClose(){this.setState({show:!1,team_member:null})}render(){const{getAverage4Cs:e,getFacilitatorRubricForTeamMember:s,getNumericAverage4Cs:a,team:t}=this.props.admin_challenge_grader,{challenge_member:i}=this.state,l=(null===i||void 0===i?void 0:i.team_member)||null,n=Kd(l),r=s(l),o=e(),d=a(),c=(null===i||void 0===i?void 0:i.four_c_score)||!1,h=(null===i||void 0===i?void 0:i.peer_four_c_score)||!1,u=(null===i||void 0===i?void 0:i.self_four_c_score)||!1,m=(null===i||void 0===i?void 0:i.facilitator_four_c_score)||!1,g=t&&t.members?t.members:[],p=g&&g.length&&g.length>1,x=p?3:4;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(xe,{animation:!1,className:"modal-learner-summary",onHide:this.handleClose.bind(this),show:this.state.show,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learner summary",id:"label.learner_summary.87358328"})})}),(0,N.jsxs)(xe.Body,{children:[l&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"mb-3",children:[(0,N.jsx)(Ya,{className:"me-2",size:24,user:n})," ",(0,N.jsx)("b",{children:null===n||void 0===n?void 0:n.fullname})]}),(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"text-center container-learner-summary",md:3,children:[(0,N.jsx)(Dt,{barSize:5,color:"#f4a800",value:i.team_score}),(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team deliverable score",id:"label.team_deliverable_score.eea91fbf"})})})})]}),(0,N.jsxs)(Ve.A,{className:"text-center container-learner-summary",md:3,children:[(0,N.jsx)(Ce.S,{className:"mx-auto",style:{width:"90px"},children:(0,N.jsx)(Iu,{c1:o.c1,c2:o.c2,c3:o.c3,c4:o.c4})}),(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Average Team 4Cs",id:"label.average_team_4cs.e9431396"})})})}),(0,N.jsx)("div",{children:(0,N.jsxs)("b",{children:[d,"/100"]})})]}),(0,N.jsxs)(Ve.A,{className:"text-center container-learner-summary",md:3,children:[(0,N.jsx)(Dt,{barSize:5,color:"#7b5ed8",value:i.score_raw}),(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Raw score",id:"label.raw_score.176b88d9"})})})})]}),(0,N.jsxs)(Ve.A,{className:"text-center container-learner-summary",md:3,children:[(0,N.jsx)(Dt,{barSize:5,color:"#f4a800",value:i.score}),(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Final score",id:"label.final_score.11c34366"})})})})]})]})}),r&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"mt-5 mb-3",children:[(0,N.jsx)(jr,{path:"language/language.svg",size:15})," ",(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Facilitator feedback",id:"label.facilitator_feedback.d5db463d"})})]}),(0,N.jsx)(Ge.A,{body:!0,children:r.notes&&r.notes.length?(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)("b",{children:r.notes})}):(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)("i",{children:(0,N.jsx)(ke.A,{defaultMessage:"No facilitator feedback provided",id:"label.no_facilitator_feedback_provided.9770cd40"})})})})]}),(0,N.jsxs)(Ce.S,{className:"mt-5 mb-3",children:[(0,N.jsx)(jr,{path:"paper-diploma/paper-diploma.svg",size:15})," ",(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"4Cs Score",id:"label.4cs_score.83ad8e65"})})]}),(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Ue.A,{fluid:!0,className:"container-four-c",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{className:"text-center",sm:x,children:(0,N.jsxs)(Ce.S,{className:"mx-auto",style:{width:"90px"},children:[(0,N.jsx)(Iu,{disabled:!u,fourCs:u}),(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:["4C's ",(0,N.jsx)(ke.A,{defaultMessage:"Self",id:"label.self.85bc0f95"})]})})]})}),p&&(0,N.jsx)(Ve.A,{className:"text-center",sm:x,children:(0,N.jsxs)(Ce.S,{className:"mx-auto",style:{width:"90px"},children:[(0,N.jsx)(Iu,{disabled:!h,fourCs:h}),(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:["4C's ",(0,N.jsx)(ke.A,{defaultMessage:"Peer",id:"label.peer.f8e77246"})]})})]})}),(0,N.jsx)(Ve.A,{className:"text-center",sm:x,children:(0,N.jsxs)(Ce.S,{className:"mx-auto",style:{width:"90px"},children:[(0,N.jsx)(Iu,{disabled:!m,fourCs:m}),(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:["4C's ",(0,N.jsx)(ke.A,{defaultMessage:"Facilitator",id:"label.facilitator.49c5d7ad"})]})})]})}),(0,N.jsx)(Ve.A,{className:"text-center",sm:x,children:(0,N.jsxs)(Ce.S,{className:"mx-auto",style:{width:"90px"},children:[(0,N.jsx)(Iu,{disabled:!c,fourCs:c}),(0,N.jsx)("small",{children:(0,N.jsxs)("b",{children:["4C's ",(0,N.jsx)(ke.A,{defaultMessage:"Final",id:"label.final.f4ed8fa6"})]})})]})})]})})})]}),!l&&(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No team member provided",id:"label.no_team_member_provided.5184346c"})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:this.handleClose.bind(this),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})})]})})}}const sU=(0,n.G0)(IH(eU));var aU=s=>{var a,t;const i=(0,P.nm)(),{api:n,locale:r,userHasRight:o,userIsSiteAdmin:d}=i,c=(0,Pe.W6)(),{formatMessage:h}=(0,ja.A)(),{stub_id:u}=(0,Pe.g)(),[m,g]=(0,ne.CQ)({active_key:"active",deleted:!1,end_date:ci()().toDate().getTime(),error:null,loading:!0,resume_editing:!1,start_date:ci()().subtract(1,"month").toDate().getTime(),stub:null}),p=(0,l.useRef)(null),x=(0,l.useRef)(null),v=(0,l.useRef)(null),f=(0,l.useRef)(null),j=(0,l.useRef)(null),_=(0,l.useRef)(null),b=(0,l.useRef)(null),A=(0,l.useRef)(null),y=(0,l.useRef)(null),{deleted:w,error:S,loading:C,resume_editing:M,stub:k}=m,z=(null===k||void 0===k?void 0:k.current)||{},{author_avatar_image_path:T,author_name:I,is_primary:E,title:F,total_est_completion_time:R,total_learners_assigned:D,updated_at:B,version_title:L}=z,O=()=>new Promise((e,s)=>{n.get(`/api/cartridge-templates/stub/${u}`).then(s=>{let{stub:a}=s;g({resume_editing:0===a.current.published,stub:a},()=>{e()})}).catch(e=>{const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;s(a)})}),H=()=>{const e=m.stub&&m.stub.primary_key_id;if(!e)return;let{end_date:s,start_date:a}=m;return a=ci()(a).toISOString(),s=ci()(s).toISOString(),new Promise((t,i)=>{n.get("/api/cartridge-templates/stats/completion/"+e,{end_date:s,start_date:a}).then(e=>{g({completion:e},()=>{t()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i(s)})})},U=async e=>{var s,a;if(!G(e))return;let t=!1;e||(e=m.stub.current,t=!0);const i=await(null===(s=b.current)||void 0===s?void 0:s.show(e,{hide_make_primary:t}));if(!i)return;const{make_primary:l,version_description:r,version_title:o}=i;g({loading:!0}),n.post("/api/cartridge-templates/publish/"+(null===(a=e)||void 0===a?void 0:a.id),{make_primary:l,version_description:r,version_title:o}).then(async e=>{let{cartridge_template:s}=e;g({loading:!1}),await O()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})})},Q=async()=>{await O(),await H()},V=e=>{e&&z&&(g({loading:!0}),n.post(`/api/tags/association/delete/${e}`).then(()=>{g({loading:!1}),Q()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})}
2))},G=s=>{const a=(0,Re.by)({locale:r,scope:"content_authoring.cartridge_editor.full_template"});if(!a||!s)return!1;try{return a.validateSync(s),!0}catch(e){return!1}};(0,l.useEffect)(()=>{g({loading:!0});try{Q(),g({loading:!1})}catch(e){g({error:e,loading:!1})}},[]);const W=ci()(B).calendar(),K=k&&k.organization,Y=null===z||void 0===z||null===(a=z.stub)||void 0===a?void 0:a.tags,q=G(z);return(0,N.jsxs)(yT,{children:[(0,N.jsx)(Ce.S,{className:"admin-cartridge-stub-page",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>g({error:null}),show:S,variant:"danger",children:S}),(0,N.jsx)(Me.x_,{loading:C,children:w?(0,N.jsxs)(Ce.S,{className:"deleted-notice d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)("h4",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge deleted successfully.",id:"label.cartridge_deleted_successfully.d640ad90"})}),d()?(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/home#library",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Library",id:"label.return_to_library.554d8dd9"})]}):(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/admin/cartridge-templates",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Design Lab",id:"label.return_to_design_lab.fa853fe0"})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(vF.A,{className:"mt-4",children:[!d()&&(0,N.jsx)(pa.mu,{to:"/admin/cartridge-templates",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Design lab",description:"",id:"label.design_lab.9055ff21"})})}),d()&&(0,N.jsx)(pa.mu,{to:"/admin#library",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Site",description:"",id:"label.site.fa795581"})})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge editor",description:"",id:"label.cartridge_editor.d016de5c"})})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)("h1",{className:"m-0",children:F})}),(0,N.jsxs)(Ve.A,{className:"d-flex justify-content-end",lg:6,children:[(0,N.jsx)(ve.A,{className:"d-inline-block ms-auto align-self-center",disabled:0==z.published,onClick:async()=>{const{stub:e}=m,s=null===e||void 0===e?void 0:e.current,a=null===j||void 0===j?void 0:j.current;if(!a||!s)return;const{assignment:t}=await a.show({component:s,component_type:"cartridge"})||{};t&&c.push(`/admin/group/${null===t||void 0===t?void 0:t.group_id}/assignment/${null===t||void 0===t?void 0:t.id}`)},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Assign cartridge",description:"",id:"label.assign_cartridge.14cb7fb0"})}),(0,N.jsxs)(Le.Link,{className:"btn btn-primary d-inline-flex align-items-center align-self-center ms-2",to:`/admin/content-authoring/cartridge/${null===k||void 0===k?void 0:k.id}/${null===z||void 0===z?void 0:z.id}/0`,children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",description:"",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(ve.A,{className:"ms-2 d-inline-flex align-items-center align-self-center",variant:"primary",onClick:async()=>{const e=null===p||void 0===p?void 0:p.current;e&&e.show({actions:[e.Action({label:h({id:"label.cancel.19766ed6",defaultMessage:"Cancel"}),variant:"secondary"}),e.Action({label:h({id:"label.copy_cartridge.fd791005",defaultMessage:"Copy cartridge"}),onClick:()=>function(e){g({loading:!0}),n.get("/api/cartridge-templates/copy/"+e,{}).then(e=>{let{cartridge_template:s,stub:a}=e;g({loading:!1}),c.push("/admin/cartridge-template/"+a.id)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})})}(null===k||void 0===k?void 0:k.id),variant:"primary"})],body:h({id:"label.are_you_sure_you_want_to_copy_this.fe17e4b9",defaultMessage:"Are you sure you want to copy this cartridge?"}),size:"sm",title:h({id:"label.copy_cartridge.fd791005",defaultMessage:"Copy cartridge"})})},children:[(0,N.jsx)(ze.paH,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Copy",description:"",id:"label.copy.e21f935f"})]}),!D&&(0,N.jsxs)(ve.A,{className:"ms-2 d-inline-flex align-items-center align-self-center",onClick:async()=>{const e=null===p||void 0===p?void 0:p.current;e&&(D||await e.show({actions:[e.CancelAction(),e.Action({label:h({id:"label.delete_cartridge.071f2efd",defaultMessage:"Delete cartridge"}),onClick:async()=>await(async()=>{try{g({loading:!0}),await n.post(`/api/cartridge-templates/delete/stub/${u}`),g({deleted:!0,loading:!1,stub:null})}catch({err:err}){g({error:err,loading:!1})}})(),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this cartridge?",id:"label.are_you_sure_you_want_to_delete_th.745f5458"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can't be und
2one.",id:"label.this_action_cant_be_undone.b1b3fc4b"})})]}),title:h({id:"label.delete_cartridge.071f2efd",defaultMessage:"Delete cartridge"})}))},variant:"danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",description:"",id:"label.delete.e2d0a549"})]})]})]})}),(0,N.jsx)("hr",{}),M&&(0,N.jsxs)(Ce.S,{className:"cartridge-not-published",children:[(0,N.jsx)(Ce.S,{className:"dismiss-toggle",children:(0,N.jsx)(ve.A,{style:{padding:12},variant:"light",onClick:()=>g({resume_editing:!1}),children:(0,N.jsx)(ze.QCr,{})})}),(0,N.jsx)("h5",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge not published",description:"",id:"label.cartridge_not_published.563db3bb"})}),(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Publish this cartridge to make it available to facilitators via the catalog",description:"",id:"label.publish_this_cartridge_to_make_it.79f1dc60"})}),(0,N.jsxs)(ve.A,{className:"d-inline-block",disabled:!q,onClick:()=>{U(z)},children:[(0,N.jsx)(ze.uoG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish cartridge",description:"",id:"label.publish_cartridge.1cfe80a3"})]}),(0,N.jsxs)(Le.Link,{className:"btn btn-secondary btn-xl ms-2",to:`/admin/content-authoring/cartridge/${u}/${null===k||void 0===k||null===(t=k.current)||void 0===t?void 0:t.id}`,children:[(0,N.jsx)(ze.F7,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Keep editing",description:"",id:"label.keep_editing.e76fd2ad"})]})]}),(0,N.jsx)(Ce.S,{body:!0,style:{marginTop:47},children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-baseline",children:[(0,N.jsx)("h3",{className:"d-inline-block",style:{marginRight:24},children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge details",id:"label.cartridge_details.2b303c36"})}),(0,N.jsx)("div",{className:"d-flex",children:(0,N.jsx)(bo.A,{bg:"gray-alt",className:"d-inline-block",children:W})})]}),I&&(0,N.jsxs)(Ce.S,{style:{marginBottom:10,marginTop:10},children:[T&&(0,N.jsx)(Ce.S,{style:{display:"inline-block",verticalAlign:"middle"},children:(0,N.jsx)("img",{alt:"",className:"img-circle",src:T,style:{height:30,width:30}})}),(0,N.jsxs)(Ce.S,{style:{display:"inline-block",marginLeft:10,verticalAlign:"middle"},children:[(0,N.jsx)(Ce.S,{className:"heading",style:{fontSize:14,fontWeight:500,lineHeight:"20px"},children:I}),(0,N.jsx)("small",{className:"text-muted",style:{lineHeight:"16px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Author",description:"",id:"label.author.d95082a2"})})]})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(qa.A,{className:"table-borderless mb-0",size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top",width:125},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Version",description:"",id:"label.version.dd167905"})})})}),(0,N.jsx)("td",{children:(0,N.jsxs)("p",{className:"body d-inline-block",children:[L," ",E&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Primary",description:"",id:"label.primary.efe10c80"})})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",description:"",id:"label.assigned.8191888d"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{className:"d-inline-block body",children:z.total_learners_assigned})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",description:"",id:"label.duration.4fc52a3c"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:(0,N.jsx)(Vh,{duration:R,label_type:"long",unit:"minutes"})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",description:"",id:"label.organization.d764d425"})})})}),(0,N.jsx)("td",{children:(0,N.jsxs)("p",{children:[K?(0,N.jsxs)(N.Fragment,{children:[null===K||void 0===K?void 0:K.name," ",o("manage_organization",K.id)?(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===K||void 0===K?void 0:K.id}`,children:(0,N.jsx)(ve.A,{className:"ms-1",size:"sm",variant:"secondary",children:(0,N.jsx)(ze.EQc,{className:"align-baseline",size:12.5})})}):null===K||void 0===K?void 0:K.name]}):(0,N.jsx)(ze.Eh_,{className:"text-primary"}),o("manage_challenge")&&(0,N.jsx)(ve.A,{className:"ms-1",onClick:()=>{(()=>{const{stub:e}=m;f.current.show({body:"Select an organization to make the owner of this cartridge. Note: Existing users will not lose access.",preselected_organization_id:null===e||void 0===e?void 0:e.organization_id})})()},size:"sm",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]})})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center mb-3",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),o("manage_organization",null===K||void 0===K?void 0:K.id)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{ref:A,variant:"primary",onClick:()=>{y.current.show()},children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Apply tags",id:"label.apply_tags.68bc4cb4"})]}),(0,N.jsx)(To,{onRemove:e=>{},onSelect:async e=>{e&&z&&(g({loading:!0}),n.post(`/api/tags/association/add/${null===e||void 0===e?void 0:e.id}`,{selections:[{component_id:null===z||void 0===z?void 0:z.id,type:"cartridge"}]}).then(()=>{g({loading:!1}),Q()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})}
2))},organization_id:(null===k||void 0===k?void 0:k.organization_id)||null,ref:y,target:A})]})]}),Y&&Y.map(e=>{let{id:s,tag:a}=e;return(0,N.jsx)(Co,{onRemove:()=>(e=>{const s=null===p||void 0===p?void 0:p.current;s&&s.show({actions:[s.CancelAction(),s.OKAction({onClick:()=>V(e)})],body:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this tag?",id:"label.are_you_sure_you_want_to_delete_th.6e645b48"})})})(s),size:"lg",tag:a},s)}),(!Y||!Y.length)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})})]})]})}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",description:"",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how your cartridge will appear to facilitators via the catalog",description:"",id:"label.heres_how_your_cartridge_will_appe.3793bf9b"})}),(0,N.jsx)(Kh,{component:z,type:"cartridge"})]})})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Manage versions",description:"",id:"label.manage_versions.f461c6ca"})}),(0,N.jsx)(iU,{onNewVersion:async()=>{try{var e;const s=await(null===(e=_.current)||void 0===e?void 0:e.show());if(!s)return;const{template:a,values:t}=s;g({loading:!0});const{cartridge_template:i}=await n.post("/api/cartridge-templates/version/create/"+a.id,{title:t.title,version_description:t.version_description,version_title:t.version_title});c.push(`/admin/content-authoring/cartridge/${u}/${null===i||void 0===i?void 0:i.id}`),g({loading:!1})}catch(S){g({error:S,loading:!1})}},onPublishVersion:U,stub_id:null===k||void 0===k?void 0:k.id,validateTemplate:G}),!(null===k||void 0===k||!k.organization_id)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{marginTop:61},children:(0,N.jsxs)("h3",{children:[(0,N.jsxs)(ve.A,{className:"float-end",style:{textDecoration:"none"},variant:"link",onClick:()=>{(()=>{const{contributors:e,stub:s}=m;x.current.show(s.id,e)})()},children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}}),(0,N.jsx)(ke.A,{defaultMessage:"Add collaborators",description:"",id:"label.add_collaborators.9906a14d"})]}),(0,N.jsx)(ke.A,{defaultMessage:"Manage collaborators",description:"",id:"label.manage_collaborators.361afb60"})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(JF,{contributors:null===k||void 0===k?void 0:k.contributors,refreshStub:O,stub_id:null===k||void 0===k?void 0:k.id,type:"cartridge"})]})]})})]})}),(0,N.jsx)(Xw,{onRef:e=>{v.current=e},onSelect:e=>{let{end_date:s,start_date:a}=e;g({end_date:s,start_date:a}),H()}}),(0,N.jsx)(dU,{ref:_,stub_id:u}),(0,N.jsx)(eR,{ref:b,type:"journey"}),(0,N.jsx)(qF,{collaborators:null===k||void 0===k?void 0:k.contributors,onHide:O,organization_id:null===k||void 0===k?void 0:k.organization_id,ref:x,stub_id:null===k||void 0===k?void 0:k.id,type:"cartridge"}),(0,N.jsx)(hU,{ref:f,onSubmit:e=>{(e=>{const{stub:s}=m;g({loading:!0}),n.post(`/api/cartridge-templates/stub/set/organization/${null===s||void 0===s?void 0:s.id}`,{organization_id:e}).then(()=>{g({loading:!1}),O()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;g({error:s,loading:!1})})})(e||null)}}),(0,N.jsx)(cc,{ref:j}),(0,N.jsx)(je,{ref:p})]})};var tU=e=>{const{archiveVersion:s,deleteVersion:a,handleSort:t,makeVersionPrimary:i,primary:l,promptNewVersionName:n,publishVersion:r,sort_direction:o,sort_token:d,stub_id:c,validateTemplate:h,versions:u}=e,m=(0,Pe.W6)();return(0,N.jsxs)(ho,{defaultSortDirection:o,defaultSortToken:d,onSort:t,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"completed",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"md",children:(0,N.jsx)(ke.A,{defaultMessage:"Healthy links",id:"label.healthy_links.e15dca0f"})}),(0,N.jsx)(ho.Th,{hiddenBelow:"md",children:(0,N.jsx)(ke.A,{defaultMessage:"Unhealthy links",id:"label.unhealthy_links.b2af95dd"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{style:{width:50}})]})}),(0,N.jsx)(ho.Tbody,{children:null!==u&&void 0!==u&&u.length?(0,N.jsx)(N.Fragment,{children:u.map(e=>{let{id:t,num_healthy_links:o,num_unhealthy_links:d,published:u,stub:g,t
2itle:p,total_learners_assigned:x,total_learners_completed:v,total_learners_started:f,updated_at:j,version_description:_,version_title:b}=e,A=l.id==e.id;const y=h(e),w=!A&&0===u&&y,S=ci()(j).calendar();return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)("span",{children:p})}),(0,N.jsx)(ho.Td,{className:"text-center",children:_?(0,N.jsx)(Ua.A,{placement:"top",trigger:"hover",overlay:(0,N.jsx)(Qa.A,{children:_}),children:(0,N.jsx)("div",{children:b})}):(0,N.jsx)(N.Fragment,{children:b})}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(KF,{primary:t===(null===g||void 0===g?void 0:g.primary_key_id),published:1===u})}),(0,N.jsx)(ho.Td,{className:"text-center",children:x}),(0,N.jsx)(ho.Td,{className:"text-center",children:f}),(0,N.jsx)(ho.Td,{className:"text-center",children:v}),(0,N.jsx)(ho.Td,{hiddenBelow:"md",children:o||"-"}),(0,N.jsx)(ho.Td,{hiddenBelow:"md",children:d||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:S}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[w&&(0,N.jsxs)(ve.A,{onClick:()=>r(e),size:"sm",variant:"outline-success",children:[(0,N.jsx)(ze.uoG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish",id:"label.publish.859390eb"})]}),!A&&1===u&&(0,N.jsxs)(ve.A,{onClick:()=>i(t),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.CMH,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})]}),(0,N.jsxs)(ve.A,{onClick:()=>m.push(`/admin/content-authoring/cartridge/${c}/${t}/0`),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(ve.A,{onClick:()=>n(e),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.p2D,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})]}),!A&&1===u&&(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-danger",onClick:a=>{a.preventDefault(),s(e.id)},children:[(0,N.jsx)(ze.Wlj,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Archive",id:"label.archive.66f4804e"})]}),0===u&&!A&&(0,N.jsxs)(ve.A,{onClick:()=>a(t),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.qbC,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},t)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"10",children:(0,N.jsx)(ke.A,{defaultMessage:"No versions found.",id:"label.no_versions_found.2e724551"})})})})]})};var iU=e=>{const{onNewVersion:s=null,onPublishVersion:a=null,stub_id:t,validateTemplate:i}=e,n=(0,ja.A)(),r=(0,P.nm)(),{api:o}=r,[d,c]=(0,ne.CQ)({archived:[],error:null,loading:!1,primary:null,sort_direction:"DESC",sort_token:"title",stub:null,tab:"active",versions:[]}),h=(0,l.useRef)(null),u=()=>{if(!t)return;const{sort_direction:e,sort_token:s}=d;return new Promise((a,i)=>{o.get(`/api/cartridge-templates/stub/versions/${t}`,{sort_direction:e,sort_token:s}).then(e=>{let{primary:s,stub:t,versions:i}=e;c({primary:s,stub:t,versions:i},()=>{a()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1},()=>{i(s)})})})},m=(e,s)=>{c({loading:!0}),o.post("/api/cartridge-templates/version/rename/"+e,{title:s}).then(async e=>{let{cartridge_template:s}=e;await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})})};(0,l.useEffect)(()=>{u()},[t]);const{archived:g,error:p,loading:x,primary:v,sort_direction:f,sort_token:j,tab:_,versions:b}=d,A={archiveVersion:e=>{e&&window.confirm(n.formatMessage({id:"label.are_you_sure_you_want_to_archive_t.19e817d6",defaultMessage:"Are you sure you want to archive this version? After you archive a version, it may no longer be assigned."}))&&(c({loading:!0}),o.get("/api/cartridge-templates/archive/"+e).then(async e=>{let{cartridge_template:s}=e;await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})}
2))},deleteVersion:e=>{e&&window.confirm(n.formatMessage({id:"label.are_you_sure_you_want_to_delete_th.714a9e3a",defaultMessage:"Are you sure you want to delete this version? After you delete a version, you may no longer access it."}))&&(c({loading:!0}),o.post("/api/cartridge-templates/delete/"+e).then(async()=>{await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})}))},handleSort:async(e,s)=>{c({sort_direction:s,sort_token:e},async()=>await u())},makeVersionPrimary:e=>{e&&window.confirm(n.formatMessage({id:"label.are_you_sure_you_want_to_make_this.a8ccf029",defaultMessage:"Are you sure you want to make this version the primary?"}))&&(c({loading:!0}),o.get("/api/cartridge-templates/primary/"+e).then(async e=>{let{cartridge_template:s}=e;await u(),c({loading:!1})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:s,loading:!1})}))},primary:v,promptNewVersionName:e=>{const s=null===h||void 0===h?void 0:h.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:n.formatMessage({id:"label.rename.3064d79a",defaultMessage:"Rename"}),onClick:()=>{const a=s.getInputValue();if(!a||!a.length||a.length>64)return window.alert(n.formatMessage({id:"label.invalid_cartridge_title_provided.a8c39e03",defaultMessage:"Invalid cartridge title provided"})),!1;m(e.id,a)},variant:"danger"})],body:n.formatMessage({id:"label.provide_a_name_for_this_version.f2cafea2",defaultMessage:"Provide a name for this version"}),prompt:s.TextPrompt({initialValue:e?e.version_title:""}),size:"sm",title:n.formatMessage({id:"label.rename_version.c098ca09",defaultMessage:"Rename version"})})},publishVersion:async e=>{"function"==typeof a&&a(e)},sort_direction:f,sort_token:j,stub_id:t};return(0,N.jsxs)(Ce.S,{className:"admin-cartridge-stub-versions-table",children:[x&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})})}),(0,N.jsx)(We.A,{dismissible:!0,show:p,variant:"danger",onClose:()=>{c({error:null})},children:p}),!x&&(0,N.jsx)(Ce.S,{className:"position-relative",children:(0,N.jsxs)(ld.A.Container,{mountOnEnter:!0,defaultActiveKey:"active",id:"cartridge-stub-versions-table-tabs",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>{c({tab:"active"})}
2,children:(0,N.jsx)(aa.A.Link,{active:"active"==_,eventKey:"active",href:"#active",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",description:"",id:"label.active.92340695"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>{c({tab:"archived"})},children:(0,N.jsx)(aa.A.Link,{active:"archived"===_,eventKey:"archived",href:"#archived",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",description:"",id:"label.archived.bdb86505"})})})]}),(0,N.jsx)("div",{className:"position-absolute",style:{right:0,top:0},children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:async e=>{"function"===typeof s&&s()},style:{textDecoration:"none"},variant:"link",children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}})," NEW VERSION"]})}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"active",children:(0,N.jsx)(tU,(0,F.A)((0,F.A)({},A),{},{validateTemplate:i,versions:b}))}),(0,N.jsx)(ld.A.Pane,{eventKey:"archived",children:(0,N.jsx)(tU,(0,F.A)((0,F.A)({},A),{},{versions:g}))})]})]})}),(0,N.jsx)(je,{ref:h})]})};const lU=ul.Ik().shape({description_of_change:ul.Yj(),title:ul.Yj().min(5,"Title must be more than 4 characters long").max(100,"Title must be less than 100 characters long").required("Title required"),version_title:ul.Yj().min(1,"Version name must be at least 1 characters long").max(10,"Version name must be less than 10 characters long").required("Version name required")}),nU=(0,l.forwardRef)((e,s)=>{var a,t;const{handleCreateVersion:i=Function(),handlePrevious:n=Function(),onHide:r,showModal:o}=e,[d,c,h]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1});(0,l.useEffect)(()=>{null!=e.template&&c({template:e.template})},[e.template]);const{show:u}=d,m=(0,ds.Wx)({enableReinitialize:!0,initialValues:{title:null!==(a=null===e||void 0===e||null===(t=e.template)||void 0===t?void 0:t.title)&&void 0!==a?a:"",version_description:"",version_title:""},onSubmit:e=>{i(e)},validationSchema:lU}),{errors:g,handleChange:p,handleSubmit:x,touched:v,values:f}=m,j=e=>new Promise((s,a)=>{c({reject:a,resolve:s,show:!0,template:e})}),_=()=>{"function"===typeof(null===d||void 0===d?void 0:d.resolve)&&d.resolve(null),h(),"function"===typeof r&&r()};return(0,l.useImperativeHandle)(s,()=>({hide:_,show:j})),(0,N.jsxs)(xe,{onHide:_,show:u||o,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Version details",id:"label.version_details.c05702e1"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)("div",{className:"d-flex align-items-center mb-3",style:{backgroundColor:"var(--gray-200)",color:"var(--primary)",padding:"16px 8px 16px 21px"},children:[(0,N.jsx)(ze.ELu,{style:{marginRight:17}})," ",(0,N.jsx)("span",{style:{color:"var(--black)"},children:"This version will remain unpublished by default"})]}),(0,N.jsx)(ds.QI,{value:m,children:(0,N.jsxs)(_e.A,{noValidate:!0,onSubmit:x,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Journey title"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"title",className:"form-control",isInvalid:v.title&&g.title,isValid:v.title&&!g.title,name:"title",onChange:p,type:"text",value:f.title}),g.title&&v.title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:g.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Version name"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"version_title",className:"form-control",name:"version_title",onChange:p,placeholder:"E.g. 1.2",type:"text",value:f.version_title,isInvalid:v.version_title&&g.version_title,isValid:v.version_title&&!g.version_title}),g.version_title&&v.version_title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:g.version_title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Description of changes",description:"",id:"label.description_of_changes.b73fb4ce"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Description of changes",as:"textarea",className:"form-control",name:"version_description",onChange:p,placeholder:"Describe the changes made in this version",rows:4,value:f.version_description,isInvalid:v.version_description&&g.version_description,isValid:v.version_description&&!g.version_description})]}),(0,N.jsxs)(os,{className:"d-flex justify-content-between mb-0 align-items-center",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:n,variant:"secondary",children:[(0,N.jsx)(ze.QVr,{style:{marginRight:8}})," ",(0,N.jsx)(ke.A,{defaultMessage:"PREVIOUS",description:"",id:"label.previous.08d90c23"})]}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"CREATE VERSION",description:"",id:"label.create_version.64c203a1"})})]})]})})]})]})});
2nU.displayName="NewVersionDetailsModal";var rU=nU;const oU=(0,l.forwardRef)((e,s)=>{const{onHide:a,stub_id:t}=e,{api:i}=(0,P.nm)(),[n,r,o]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1,sort_direction:"ASC",sort_token:"title",step:0,template:null,versions:[]}),{loading:d,show:c,step:h,template:u,version_selected:m,versions:g}=n,p=e=>r({version_selected:e}),x=(0,l.useRef)(null),v=async()=>{try{r({loading:!0});const{versions:e}=await i.get("/api/cartridge-templates/stub/versions/"+t,{sort_direction:n.sort_direction,sort_token:n.sort_token});r({loading:!1,versions:e})}catch(e){}};(0,l.useEffect)(()=>{n.show&&v()},[n.show]),(0,l.useEffect)(()=>{v()},[n.sort_token,n.sort_direction]);const f=e=>new Promise((e,s)=>{r({reject:s,resolve:e,show:!0})}),j=()=>{n.resolve(null),o(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:j,show:f}));return(0,N.jsxs)(N.Fragment,{children:[0===h?(0,N.jsxs)(xe,{dialogClassName:"new-cartridge-version-modal",onHide:j,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select a version to start from",id:"label.select_a_version_to_start_from.241fd248"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(ho,{className:"module-version-selector-table",defaultSortDirection:n.sort_direction,defaultSortToken:n.sort_token,onSort:async(e,s)=>{r({sort_direction:s,sort_token:e}),await v()},children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"checkbox-col",style:{width:40}}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"completed",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{style:{width:40}})]})}),(0,N.jsx)(ho.Tbody,{cols:9,loading:d,children:g.map(e=>{const{id:s,published:a=null,stub:t=null,title:i,total_learners_assigned:l=0,total_learners_completed:n=0,total_learners_started:r=0,updated_at:o,version_title:d}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ho.Tr,{className:""+(m===s?"row-selected":""),onClick:()=>p(s),children:[(0,N.jsx)(ho.Td,{className:"checkbox-col",children:(0,N.jsx)(sy,{checked:m===s,id:s,type:"radio"})}),(0,N.jsx)(ho.Td,{className:"text-center",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,N.jsx)("span",{children:i})}),(0,N.jsx)(ho.Td,{className:"text-center",children:d}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(WF,{primary:s===(null===t||void 0===t?void 0:t.primary_key_id),published:1===a})}),(0,N.jsx)(ho.Td,{className:"text-center",children:l}),(0,N.jsx)(ho.Td,{className:"text-center",children:r}),(0,N.jsx)(ho.Td,{className:"text-center",children:n}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(Gh.XU,{value:o})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)("div",{className:"d-flex justify-content-end gap-2",children:(0,N.jsx)(ve.A,{onClick:e=>(async(e,s)=>{var a;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const{component:t}=await(null===(a=x.current)||void 0===a?void 0:a.show({component_id:s,selectable:!0,type:"cartridge"}))||{};t&&p(null===t||void 0===t?void 0:t.id)})(e,s),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})})})})]},s)})})})]}),(0,N.jsx)("div",{className:"w-100 d-flex justify-content-end",children:(0,N.jsx)(ve.A,{disabled:d||!m,onClick:()=>{const e=n.versions.find(e=>e.id===m);r({step:1,template:e})},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})})]})]}):(0,N.jsx)(rU,{handleCreateVersion:e=>(e=>{n.resolve(e),j()})({template:n.template,values:e}),handlePrevious:()=>r({step:0}),onHide:()=>{o()},showModal:0!==h,template:u}),(0,N.jsx)(Uh,{ref:x})]})});oU.displayName="NewVersionModal";var dU=oU;const cU=(0,l.forwardRef)((e,s)=>{const{excludedIds:a,onHide:t,onSubmit:i}=e,n=(0,l.useRef)(),[r,o,d]=(0,ne.CQ)({body:"",count:0,error:null,loading:!1,organization_ids:[],organizations:[],page:1,page_size:1e3,preselected_organization_id:void 0,reject:Function(),resolve:Function(),search_term:"",selected_organization_ids:[],show:!1,submitting:!1}),c=async e=>new Promise(async(s,a)=>{o({body:(null===e||void 0===e?void 0:e.body)||"",error:null,loading:!1,organization_ids:(null===e||void 0===e?void 0:e.organization_ids)||[],preselected_organization_id:null===e||void 0===e?void 0:e.preselected_organization_id,reject:a,resolve:s,show:!0}),u()}),h=()=>{r.resolve(),d(),"function"===typeof t&&t()},u=()=>{const e=null===n||void 0===n?void 0:n.current;e&&e.refresh()};(0,l.useImperativeHandle)(s,()=>({hide:h,show:c})),(0,l.useEffect)(()=>d,[]);const{body:m,error:g,loading:p,preselected_organization_id:x,show:v}=r;return(0,N.jsxs)(xe,{contentClassName:"px-0 pb-0",onHide:h,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select an organization",id:"label.select_an_organization.48326f52"})})}),(0,N.jsxs)(xe.Body,{className:"p-1",children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:g,variant:"danger",children:g}),!!m&&(0,N.jsx)(Ce.S,{className:"d-flex flex-column px-3 pb-3",children:m}),(0,N.jsx)(Dc,{allowMultiSelect:!1,disableAll:p,excludedIds:a,exploded:!1,onSubmit:async e=>{o({loading:!0}),"function"===typeof i&&await i(e),o({loading:!1}),h()},preselectedOrganizationId:x,ref:n,searchable:!0,selectorLabel:(0,N.jsx)(ze.Z0P,{}),selectorType:"button",submitOnSelect:!0})]})]})});cU.displayName="OrganizationPickerModal";var hU=cU;var uU=e=>{var s,a;const{api:t,userHasRight:i,userIsSiteAdmin:n}=(0,P.nm)(),{stub_id:r}=(0,Pe.g)(),o=(0,Pe.W6)(),{formatMessage:d}=(0,ja.A)(),[c,h]=(0,ne.CQ)({completion:null,copied:!1,deleted:!1,end_date:ci()().toDate().getTime(),error:null,loading:!0,resume_editing:!1,start_date:ci()().subtract(1,"month").toDate().getTime(),stub:null}),u=(0,l.useRef)(null),m=(0,l.useRef)(null),g=(0,l.useRef)(null),p=(0,l.useRef)(null),x=(0,l.useRef)(null),v=(0,l.useRef)(null),f=(0,l.useRef)(null),j=(0,l.useRef)(null),_=(0,l.useRef)(null),{completion:b,deleted:A,end_date:y,error:w,loading:S,resume_editing:C,start_date:M,stub:k}=c,z=(null===k||void 0===k?void 0:k.current)||null,{total_learners_assigned:T}=z||{},I=(null===k||void 0===k?void 0:k.organization)||null,E=null===k||void 0===k?void 0:k.tags,F=()=>t.get("/api/group-assignment-templates/stub/"+r).then(e=>{let{stub:s}=e;return new Promise(e=>{var a;h({resume_editing:0===(null===s||void 0===s||null===(a=s.current)||void 0===a?void 0:a.published),stub:s},()=>{e()})})}).catch(e=>{throw(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e}),R=()=>{const e=c.stub&&c.stub.primary_key_id;if(!e)return;let{end_date:s,start_date:a}=c;return a=ci()(a).toISOString(),s=ci()(s).toISOString(),new Promise((i,l)=>{t.get("/api/group-assignment-templates/stats/completion/"+e,{end_date:s,start_date:a}).then(e=>{h({completion:e},()=>{i()})}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;l(s)})})},D=async e=>{var s,a;let i=!1;e||(e=c.stub.current,i=!0);const l=await(null===(s=p.current)||void 0===s?void 0:s.show(e,{hide_make_primary:i}));if(!l)return;const{make_primary:n,version_description:r,version_title:o}=l;h({loading:!0}),t.post("/api/group-assignment-templates/publish/"+(null===(a=e)||void 0===a?void 0:a.id),{make_primary:n,version_description:r,version_title:o}).then(async e=>{let{group_assignment_template:s}=e;h({loading:!1}),await F()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:s,loading:!1})})},B=async()=>{h({loading:!0}),await F(),await R(),h({loading:!1})},L=e=>{e&&z&&(h({loading:!0}),t.post(`/api/tags/association/delete/${e}`).then(()=>{h({loading:!1}),B()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:s,loading:!1})}
2))},O=new URLSearchParams((0,Pe.zy)().search);return(0,l.useEffect)(()=>{O.get("copied")&&h({copied:!0})},O),(0,l.useEffect)(()=>{B()},[]),(0,N.jsxs)(yT,{children:[(0,N.jsx)(Ce.S,{className:"admin-journey-stub-page",children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Me.x_,{loading:S,children:A?(0,N.jsxs)(Ce.S,{className:"deleted-notice d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)("h4",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey deleted successfully.",id:"label.journey_deleted_successfully.77ba1cef"})}),n()?(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/home#library",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Library",id:"label.return_to_library.554d8dd9"})]}):(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/admin/challenge-templates",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Design Lab",id:"label.return_to_design_lab.fa853fe0"})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({error:null}),show:w,variant:"danger",children:w}),k&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(vF.A,{className:"mt-4",children:[!n()&&(0,N.jsx)(pa.mu,{to:"/admin/challenge-templates",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Design lab",description:"",id:"label.design_lab.9055ff21"})})}),n()&&(0,N.jsx)(pa.mu,{to:"/admin#library",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Site",description:"",id:"label.site.fa795581"})})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Journey editor",description:"",id:"label.journey_editor.61eed603"})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h1",{className:"m-0",children:c.stub.current.title}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{className:"d-inline-block align-self-center",disabled:0==(null===z||void 0===z?void 0:z.published),onClick:async()=>{const{stub:e}=c,s=null===e||void 0===e?void 0:e.current,a=null===f||void 0===f?void 0:f.current;if(!a||!s)return;const{assignment:t}=await a.show({component:s,component_type:"journey"})||{};t&&o.push(`/admin/group/${null===t||void 0===t?void 0:t.group_id}/assignment/${null===t||void 0===t?void 0:t.id}`)},variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Assign journey",description:"",id:"label.assign_journey.61ea3e58"})}),(0,N.jsxs)(Le.Link,{className:"btn btn-primary ms-2 d-flex align-self-center",to:`/admin/content-authoring/journey/${r}/${null===k||void 0===k||null===(s=k.current)||void 0===s?void 0:s.id}`,children:[(0,N.jsx)(ze.F7,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),!T&&(0,N.jsxs)(ve.A,{className:"ms-2 d-inline-flex align-items-center align-self-center",onClick:async()=>{const e=null===u||void 0===u?void 0:u.current;e&&(T||await e.show({actions:[e.CancelAction(),e.Action({label:d({id:"label.delete_journey.ee1407b7",defaultMessage:"Delete journey"}),onClick:async()=>await(async()=>{try{h({loading:!0}),await t.post(`/api/group-assignment-templates/delete/stub/${r}`),h({deleted:!0,loading:!1})}catch({err:err}){h({error:err,loading:!1})}})(),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this journey?",id:"label.are_you_sure_you_want_to_delete_th.2b2eec82"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can't be undone.",id:"label.this_action_cant_be_undone.b1b3fc4b"})})]}),title:d({id:"label.delete_journey.ee1407b7",defaultMessage:"Delete journey"})}))},variant:"danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{h({copied:!1})},show:c.copied,variant:"success",children:(0,N.jsx)("h6",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey copied successfully.",id:"label.journey_copied_successfully.5e1cbbeb"})})}),C&&(0,N.jsxs)(Ce.S,{className:"journey-not-published",children:[(0,N.jsx)(Ce.S,{className:"dismiss-toggle",children:(0,N.jsx)(ve.A,{style:{padding:12},variant:"light",onClick:()=>h({resume_editing:!1}),children:(0,N.jsx)(ze.QCr,{})})}),(0,N.jsx)("h5",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey not published",description:"",id:"label.journey_not_published.836dedf9"})}),(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Publish this journey to make it available to facilitators via the catalog",description:"",id:"label.publish_this_journey_to_make_it_av.6b4a11e9"})}),(0,N.jsxs)(ve.A,{className:"d-inline-block",onClick:()=>D(),children:[(0,N.jsx)(ze.uoG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish journey",description:"",id:"label.publish_journey.e3d6d205"})]}),(0,N.jsxs)(Le.Link,{className:"btn btn-secondary btn-xl ms-2",to:`/admin/content-authoring/journey/${r}/${null===k||void 0===k||null===(a=k.current)||void 0===a?void 0:a.id}`,children:[(0,N.jsx)(ze.F7,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Keep editing",description:"",id:"label.keep_editing.e76fd2ad"})]})]}),(0,N.jsx)(Ce.S,{style:{marginTop:47},children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{lg:8,children:(0,N.jsxs)(Ge.A,{body:!0,className:"journey-details-card",children:[(0,N.jsx)("h3",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey details",description:"",id:"label.journey_details.d7c359a2"})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)(Zs.A,{roundedCircle:!0,alt:"author avatar",src:`${c.stub.current.author_avatar_path||Ga}`,style:{maxHeight:32}}),(0,N.jsxs)(Ce.S,{className:"ms-2",children:[(0,N.jsx)(Ce.S,{style:{fontSize:14,fontWeight:500,lineHeight:"20px"},children:c.stub.current.author_name||"Solvably"}),(0,N.jsx)("small",{className:"text-muted",style:{lineHeight:"16px"},children:(0,N.jsx)(ke.A,{defaultMessage:"Author",description:"",id:"label.author.d95082a2"})})]})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{className:"details-meta",children:[(0,N.jsx)(qa.A,{className:"table-borderless mb-0",size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top",width:125},children:(0,N.jsx)("p",{className:"bold text-extra-dark",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Version",description:"",id:"label.ver
2sion.dd167905"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:k.current.version_title})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top",width:125},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",description:"",id:"label.last_edited.43c314d4"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:(0,N.jsx)(Gh.XU,{value:k.current.updated_at})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top",width:125},children:(0,N.jsx)("p",{className:"bold text-extra-dark",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",description:"",id:"label.assigned.8191888d"})})})}),(0,N.jsx)("td",{children:(0,N.jsxs)("p",{children:[k.current.total_learners_assigned||0," ",(0,N.jsx)(ke.A,{defaultMessage:"learners",description:"",id:"label.learners.dc2ae857"})]})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top",width:125},children:(0,N.jsx)("p",{className:"bold text-extra-dark",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",description:"",id:"label.duration.4fc52a3c"})})})}),(0,N.jsx)("td",{children:(0,N.jsx)("p",{children:z?(0,N.jsx)(Vh,{duration:null===z||void 0===z?void 0:z.total_est_completion_time,unit:"minutes"}):"N/A"})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{verticalAlign:"top"},children:(0,N.jsx)("p",{className:"text-extra-dark",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Organization",description:"",id:"label.organization.d764d425"})})})}),(0,N.jsx)("td",{children:(0,N.jsxs)("p",{children:[I?(0,N.jsxs)(N.Fragment,{children:[null===I||void 0===I?void 0:I.name," ",i("manage_organization",null===I||void 0===I?void 0:I.id)?(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===I||void 0===I?void 0:I.id}`,children:(0,N.jsx)(ve.A,{className:"ms-1",size:"sm",variant:"secondary",children:(0,N.jsx)(ze.EQc,{className:"align-baseline",size:12.5})})}):null===I||void 0===I?void 0:I.name]}):(0,N.jsx)(ze.Eh_,{className:"text-primary"}),i("manage_challenge")&&(0,N.jsx)(ve.A,{className:"ms-1",onClick:()=>{(()=>{const{stub:e}=c;v.current.show({body:(0,N.jsx)(ke.A,{defaultMessage:"Select an organization to make the owner of this journey. Note: Existing users will not lose access.",id:"label.select_an_organization_to_make_the.92177000"}),preselected_organization_id:null===e||void 0===e?void 0:e.organization_id})})()},size:"sm",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]})})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center mb-3",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),i("manage_organization",null===I||void 0===I?void 0:I.id)&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{ref:j,variant:"primary",onClick:()=>{_.current.show()},children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Apply tags",id:"label.apply_tags.68bc4cb4"})]}),(0,N.jsx)(To,{onSelect:async e=>{e&&z&&(h({loading:!0}),t.post(`/api/tags/association/add/${null===e||void 0===e?void 0:e.id}`,{selections:[{component_id:null===z||void 0===z?void 0:z.id,type:"journey"}]}).then(()=>{h({loading:!1}),B()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:s,loading:!1})}))},organization_id:(null===k||void 0===k?void 0:k.organization_id)||null,ref:_,target:j})]})]}),E&&E.map(e=>{let{id:s,tag:a}=e;return(0,N.jsx)(Co,{onRemove:()=>(e=>{const s=null===u||void 0===u?void 0:u.current;s&&s.show({actions:[s.CancelAction(),s.OKAction({onClick:()=>{L(e)}})],body:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this tag?",id:"label.are_you_sure_you_want_to_delete_th.6e645b48"})})})(s),size:"lg",tag:a},s)}),(!E||!E.length)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})})]})]})]})}),(0,N.jsx)(Ve.A,{lg:4,children:(0,N.jsxs)(Ge.A,{body:!0,className:"catalog-preview-card",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",description:"",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how y
2our journey will appear to facilitators via the catalog",description:"",id:"label.heres_how_your_journey_will_appear.12011d7c"})}),(0,N.jsx)(Kh,{component:z,type:"journey"})]})})]})}),(0,N.jsx)(Ce.S,{style:{marginTop:61},children:(0,N.jsxs)("h3",{children:[(0,N.jsx)(ke.A,{defaultMessage:"User metrics",id:"label.user_metrics.f9aba01e"}),(0,N.jsxs)(ve.A,{className:"float-end",variant:"primary",onClick:()=>{g.current&&g.current.show({end_date:y,start_date:M})},children:[ci()(M).format("MMM DD, YYYY")," - ",ci()(y).format("MMM DD, YYYY"),(0,N.jsx)(ze.Vr3,{className:"ms-2"})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{className:"user-metrics",children:[(0,N.jsx)(Ve.A,{lg:9,md:12,children:(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:61},children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Module use",id:"label.module_use.57bb0e4e"})}),(0,N.jsx)(_U,{end_date:y,group_assignment_template_id:null===z||void 0===z?void 0:z.id,start_date:M})]})}),(0,N.jsx)(Ve.A,{lg:3,md:12,children:(0,N.jsxs)(Ge.A,{body:!0,style:{marginBottom:61},children:[(0,N.jsx)("span",{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Completion rate",description:"",id:"label.completion_rate.85a9d6f4"})})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h1",{className:"d-inline-block",children:b&&null!==b.completion_rate?b.completion_rate+"%":"N/A"}),(0,N.jsx)(Sz.default,{className:"float-end",fontSize:40}),(0,N.jsx)(Sa.A,{now:b&&null!==b.completion_rate?b.completion_rate:0}),(0,N.jsxs)(Ce.S,{style:{fontSize:14,fontWeight:400,marginTop:16},children:[(0,N.jsx)("span",{className:"me-2",children:b?b.total_completed:"-"}),(0,N.jsx)("span",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners completed",description:"",id:"label.learners_completed.49ff3db9"})}),(0,N.jsx)("br",{}),(0,N.jsx)("span",{className:"me-2",children:b?b.total_in_progress:"-"}),(0,N.jsx)("span",{className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Learners in progress",description:"",id:"label.learners_in_progress.a2435e22"})})]})]})})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{style:{marginTop:46},children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Manage versions",description:"",id:"label.manage_versions.f461c6ca"})}),(0,N.jsx)(jU,{onNewVersion:async()=>{try{var e;const s=await(null===(e=x.current)||void 0===e?void 0:e.show());if(!s)return;const{template:a,values:i}=s;h({loading:!0});const{group_assignment_template:l}=await t.post("/api/group-assignment-templates/version/create/"+(null===a||void 0===a?void 0:a.id),{title:i.title,version_description:i.version_description,version_title:i.version_title});o.push("/admin/content-authoring/journey/"+r+"/"+(null===l||void 0===l?void 0:l.id)),h({loading:!1})}catch(w){h({error:w,loading:!1})}},onPublishVersion:D,stub_id:r})]}),k&&k.organization_id&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{style:{marginTop:61},children:(0,N.jsxs)("h3",{children:[(0,N.jsxs)(ve.A,{className:"float-end",style:{textDecoration:"none"},variant:"link",onClick:()=>{(()=>{const{contributors:e,stub:s}=c;m.current.show(null===s||void 0===s?void 0:s.id,e)})()},children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}}),(0,N.jsx)(ke.A,{defaultMessage:"Add collaborators",description:"",id:"label.add_collaborators.9906a14d"})]}),(0,N.jsx)(ke.A,{defaultMessage:"Manage collaborators",description:"",id:"label.manage_collaborators.361afb60"})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(JF,{contributors:k.contributors,refreshStub:F,stub_id:null===k||void 0===k?void 0:k.id,type:"journey"})]})]})]})})})}),(0,N.jsx)(je,{ref:u}),(0,N.jsx)(eR,{ref:p,type:"journey"}),(0,N.jsx)(Xw,{onRef:e=>{g.current=e},onSelect:e=>{let{end_date:s,start_date:a}=e;h({end_date:s,start_date:a}),R()}}),(0,N.jsx)(vU,{ref:x,stub_id:r}),(0,N.jsx)(qF,{collaborators:null===k||void 0===k?void 0:k.contributors,onHide:()=>{F()},organization_id:null===k||void 0===k?void 0:k.organization_id,ref:m,stub_id:null===k||void 0===k?void 0:k.id,type:"journey"}),(0,N.jsx)(cc,{ref:f}),(0,N.jsx)(NR,{ref:v,onSubmit:e=>{(e=>{const{stub:s}=c;h({loading:!0}),t.post(`/api/group-assignment-templates/stub/set/organization/${null===s||void 0===s?void 0:s.id}`,{organization_id:e}).then(()=>{h({loading:!1}),F()}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:s,loading:!1})})})(e||null)}})]})};const mU=ul.Ik().shape({description_of_change:ul.Yj(),title:ul.Yj().min(5,"Title must be more than 4 characters long").max(100,"Title must be less than 100 characters long").required("Title required"),version_title:ul.Yj().min(1,"Version name must be at least 1 characters long").max(10,"Version name must be less than 10 characters long").required("Version name required")}),gU=(0,l.forwardRef)((e,s)=>{var a,t;const{handleCreateVersion:i=Function(),handlePrevious:n=Function(),onHide:r,showModal:o}=e,[d,c,h]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1});(0,l.useEffect)(()=>{null!=e.template&&c({template:e.template})},[e.template]);const{show:u}=d,m=(0,ds.Wx)({enableReinitialize:!0,initialValues:{title:null!==(a=null===e||void 0===e||null===(t=e.template)||void 0===t?void 0:t.t
2itle)&&void 0!==a?a:"",version_description:"",version_title:""},onSubmit:e=>{i(e)},validationSchema:mU}),{errors:g,handleChange:p,handleSubmit:x,touched:v,values:f}=m,j=e=>new Promise((s,a)=>{c({reject:a,resolve:s,show:!0,template:e})}),_=()=>{"function"===typeof(null===d||void 0===d?void 0:d.resolve)&&d.resolve(null),h(),"function"===typeof r&&r()};return(0,l.useImperativeHandle)(s,()=>({hide:_,show:j})),(0,N.jsxs)(xe,{onHide:_,show:u||o,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Version details",id:"label.version_details.c05702e1"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)("div",{className:"d-flex align-items-center mb-3",style:{backgroundColor:"var(--gray-200)",color:"var(--primary)",padding:"16px 8px 16px 21px"},children:[(0,N.jsx)(ze.ELu,{style:{marginRight:17}})," ",(0,N.jsx)("span",{style:{color:"var(--black)"},children:"This version will remain unpublished by default"})]}),(0,N.jsx)(ds.QI,{value:m,children:(0,N.jsxs)(_e.A,{noValidate:!0,onSubmit:x,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Journey title"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"title",className:"form-control",isInvalid:v.title&&g.title,isValid:v.title&&!g.title,name:"title",onChange:p,type:"text",value:f.title}),g.title&&v.title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:g.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:"Version name"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"version_title",className:"form-control",name:"version_title",onChange:p,placeholder:"E.g. 1.2",type:"text",value:f.version_title,isInvalid:v.version_title&&g.version_title,isValid:v.version_title&&!g.version_title}),g.version_title&&v.version_title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:g.version_title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Description of changes",description:"",id:"label.description_of_changes.b73fb4ce"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Description of changes",as:"textarea",className:"form-control",name:"version_description",onChange:p,placeholder:"Describe the changes made in this version",rows:4,value:f.version_description,isInvalid:v.version_description&&g.version_description,isValid:v.version_description&&!g.version_description})]}),(0,N.jsxs)(os,{className:"d-flex justify-content-between mb-0 align-items-center",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:n,variant:"secondary",children:[(0,N.jsx)(ze.QVr,{style:{marginRight:8}})," ",(0,N.jsx)(ke.A,{defaultMessage:"PREVIOUS",description:"",id:"label.previous.08d90c23"})]}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"CREATE VERSION",description:"",id:"label.create_version.64c203a1"})})]})]})})]})]})});gU.displayName="NewVersionDetailsModal";var pU=gU;const xU=(0,l.forwardRef)((e,s)=>{const{onHide:a,stub_id:t}=e,[i,n,r]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1,sort_direction:"ASC",sort_token:"title",step:0,template:null,version_selected:null,versions:[]}),{loading:o,show:d,step:c,template:h,version_selected:u,versions:m}=i,{api:g}=(0,P.nm)(),p=(0,l.useRef)(null),x=e=>n({version_selected:e}),v=async()=>{try{n({loading:!0});const{versions:e}=await g.get("/api/group-assignment-templates/stub/versions/"+t,{sort_direction:i.sort_direction,sort_token:i.sort_token});n({loading:!1,versions:e})}catch(e){}},f=()=>new Promise(async(e,s)=>{n({reject:s,resolve:e,show:!0}),await v()}),j=()=>{i.resolve(null),r(),"function"===typeof a&&a()};(0,l.useEffect)(()=>{v()},[i.sort_token,i.sort_direction]),(0,l.useImperativeHandle)(s,()=>({hide:j,show:f}));return(0,N.jsxs)(N.Fragment,{children:[0===c?(0,N.jsxs)(xe,{dialogClassName:"new-journey-version-modal",onHide:j,show:d,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select a ver
2sion to start from",description:"",id:"label.select_a_version_to_start_from.241fd248"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(ho,{defaultSortDirection:i.sort_direction,defaultSortToken:i.sort_token,onSort:async(e,s)=>{n({sort_direction:s,sort_token:e}),await v()},children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"checkbox-col"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"completed",children:(0,N.jsx)("div",{className:"d-flex flex-nowrap",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:9,loading:o,children:null!==m&&void 0!==m&&m.length?(0,N.jsx)(N.Fragment,{children:m.map(e=>{const{id:s,published:a=null,stub:t=null,title:i,total_learners_assigned:l=0,total_learners_completed:n=0,total_learners_started:r=0,updated_at:o,version_title:d}=e;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ho.Tr,{className:""+(u===s?"row-selected":""),onClick:()=>x(s),children:[(0,N.jsx)(ho.Td,{className:"checkbox-col",children:(0,N.jsx)(sy,{checked:u===s,id:s,type:"radio"})}),(0,N.jsx)(ho.Td,{className:"text-center",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,N.jsx)("span",{children:i})}),(0,N.jsx)(ho.Td,{className:"text-center",children:d}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(WF,{primary:s===(null===t||void 0===t?void 0:t.primary_key_id),published:1===a})}),(0,N.jsx)(ho.Td,{className:"text-center",children:l}),(0,N.jsx)(ho.Td,{className:"text-center",children:r}),(0,N.jsx)(ho.Td,{className:"text-center",children:n}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(Gh.XU,{value:o})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)(ve.A,{onClick:e=>(async(e,s)=>{var a;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const{component:t}=await(null===(a=p.current)||void 0===a?void 0:a.show({component_id:s,selectable:!0,type:"journey"}))||{};t&&x(null===t||void 0===t?void 0:t.id)})(e,s),variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})})})]},s)})})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-muted",colSpan:9,children:(0,N.jsx)(ke.A,{defaultMessage:"No versions found",id:"label.no_versions_found.9f3bfc4a"})})})})]}),(0,N.jsx)("div",{className:"w-100 d-flex justify-content-end",children:(0,N.jsx)(ve.A,{disabled:o||!u,onClick:()=>{const e=i.versions.find(e=>e.id===u);n({step:1,template:e})},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})})]})]}):(0,N.jsx)(pU,{handleCreateVersion:e=>(e=>{i.resolve(e),j()})({template:i.template,values:e}),handlePrevious:()=>n({step:0}),onHide:()=>{r()},showModal:0!==c,template:h}),(0,N.jsx)(Uh,{ref:p})]})});xU.displayName="AdminJourneyStubVersionCreator";var vU=xU;var fU=e=>{const{archiveVersion:s,deleteVersion:a,handleSort:t,loading:i,makeVersionPrimary:l,primary:n,promptNewVersionName:r,publishVersion:o,sort_direction:d,sort_token:c,stub_id:h,versions:u}=e,m=(0,Pe.W6)();return(0,N.jsxs)(ho,{defaultSortDirection:d,defaultSortToken:c,onSort:t,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}
2),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"completed",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"text-center",name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:10,loading:i,children:null!==u&&void 0!==u&&u.length?(0,N.jsx)(N.Fragment,{children:u.map(e=>{const{id:t,published:i=null,stub:d,title:c,total_learners_assigned:u=0,total_learners_completed:g=0,total_learners_started:p=0,updated_at:x,version_description:v,version_title:f}=e;let j=n.id==e.id;const _=ci()(x).calendar();return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)("span",{children:c})}),(0,N.jsxs)(ho.Td,{className:"text-center",children:[!!v&&(0,N.jsx)(Ua.A,{placement:"top",trigger:"hover",overlay:(0,N.jsx)(Qa.A,{children:v}),children:(0,N.jsx)("div",{children:f})}),!v&&(0,N.jsx)(N.Fragment,{children:f})]}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(WF,{primary:t===(null===d||void 0===d?void 0:d.primary_key_id),published:1===i})}),(0,N.jsx)(ho.Td,{className:"text-center",children:u}),(0,N.jsx)(ho.Td,{className:"text-center",children:p}),(0,N.jsx)(ho.Td,{className:"text-center",children:g}),(0,N.jsx)(ho.Td,{className:"text-center",children:_}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[!j&&0===i&&(0,N.jsxs)(ve.A,{onClick:()=>o(e),size:"sm",variant:"outline-success",children:[(0,N.jsx)(ze.uoG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish",id:"label.publish.859390eb"})]}),!j&&1===i&&(0,N.jsxs)(ve.A,{onClick:()=>l(t),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.CMH,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})]}),(0,N.jsxs)(ve.A,{onClick:()=>m.push(`/admin/content-authoring/journey/${h}/${t}`),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(ve.A,{onClick:()=>r(e),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.p2D,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})]}),!j&&1===i&&(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-danger",onClick:a=>{a.preventDefault(),s(e.id)},children:[(0,N.jsx)(ze.Wlj,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Archive",id:"label.archive.66f4804e"})]}),0===i&&!j&&(0,N.jsxs)(ve.A,{onClick:()=>a(t),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.qbC,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},t)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:10,children:(0,N.jsx)(ke.A,{defaultMessage:"No versions found.",id:"label.no_versions_found.2e724551"})})})})]})};var jU=e=>{const{onNewVersion:s=null,onPublishVersion:a=null,stub_id:t}=e,{api:i}=(0,n.nm)(),r=(0,l.useRef)(null),[o,d]=(0,ne.CQ)({archived:[],error:null,loading:!0,primary:null,sort_direction:"ASC",sort_token:"title",stub:null,versions:[]}),c=async()=>{try{d({loading:!0});const{archived:e,primary:s,stub:a,versions:l}=await i.get("/api/group-assignment-templates/stub/versions/"+t,{sort_direction:o.sort_direction,sort_token:o.sort_token});d({archived:e,loading:!1,primary:s,stub:a,tab:"active",versions:l})}catch({err:err}){d({error:err,loading:!1})}};(0,l.useEffect)(()=>{c()},[]),(0,l.useEffect)(()=>{c()},[o.sort_direction,o.sort_token]);const{archived:h,loading:u,primary:m,sort_direction:g,sort_token:p,versions:x}=o,v={archiveVersion:async e=>{if(e&&window.confirm("Are you sure you want to archive this version? After you archive a ver
2sion, it may no longer be assigned.")){d({loading:!0});try{await i.post("/api/group-assignment-templates/archive/"+e),await c()}catch({err:err}){d({error:err,loading:!1})}}},deleteVersion:async e=>{if(e&&window.confirm("Are you sure you want to delete this version? After you delete a version, you may no longer access it.")){d({loading:!0});try{await i.post("/api/group-assignment-templates/delete/"+e),await c()}catch({err:err}){d({error:err,loading:!1})}}},handleSort:async(e,s)=>{d({sort_direction:s,sort_token:e},c)},loading:u,makeVersionPrimary:async e=>{if(e&&window.confirm("Are you sure you want to make this version the primary?")){d({loading:!0});try{await i.post("/api/group-assignment-templates/primary/"+e),await c()}catch({err:err}){d({error:err,loading:!1})}}},primary:m,promptNewVersionName:e=>{const s=null===r||void 0===r?void 0:r.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Rename",onClick:()=>{let a=s.getInputValue();if(!a||!a.length||a.length>64)return window.alert("Invalid journey title provided"),!1;(async(e,s)=>{d({loading:!0});try{await i.post("/api/group-assignment-templates/version/rename/"+e,{version_title:s}),await c()}catch({err:err}){d({error:err,loading:!1})}})(e.id,a)},variant:"danger"})],body:"Provide a name for this version",prompt:s.TextPrompt({initialValue:e?e.version_title:""}),title:"Rename Version"})},publishVersion:async e=>{"function"==typeof a&&a(e)},sort_direction:g,sort_token:p,stub_id:t};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"admin-journey-stub-versions-table",children:[o.loading&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("div",{className:"text-center",children:(0,N.jsx)(Me.y$,{})})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>d({error:null}),show:o.error,variant:"danger",children:o.error}),!o.loading&&(0,N.jsx)("div",{className:"position-relative",children:(0,N.jsxs)(ld.A.Container,{mountOnEnter:!0,defaultActiveKey:"active",id:"journey-stub-versions-table-tabs",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>{d({tab:"active"})},children:(0,N.jsx)(aa.A.Link,{active:"active"==o.tab,eventKey:"active",href:"#active",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",description:"",id:"label.active.92340695"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>{d({tab:"archived"})},children:(0,N.jsx)(aa.A.Link,{active:"archived"==o.tab,eventKey:"archived",href:"#archived",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",description:"",id:"label.archived.bdb86505"})})})]}),(0,N.jsx)("div",{className:"position-absolute",style:{right:0,top:0},children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:async e=>{"function"===typeof s&&s()},style:{textDecoration:"none"},variant:"link",children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}})," NEW VERSION"]})}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"active",children:(0,N.jsx)(fU,(0,F.A)((0,F.A)({},v),{},{versions:x}))}),(0,N.jsx)(ld.A.Pane,{eventKey:"archived",children:(0,N.jsx)(fU,(0,F.A)((0,F.A)({},v),{},{versions:h}))})]})]})})]}),(0,N.jsx)(je,{ref:r})]})};var _U=e=>{const s=(0,n.nm)(),{api:a}=s,[t,i]=(0,ne.CQ)({error:null,graph_data:null,loading:!1}),r=async()=>{try{let{end_date:s,group_assignment_template_id:t,start_date:l}=e;if(!t)return;l=ci()(l).toISOString(),s=ci()(s).toISOString(),i({loading:!0});let{results:n}=await a.get(`/api/group-assignment-templates/stats/usage/${t}`,{end_date:s,start_date:l});n=Array.isArray(n)?n:[];const r=[];for(let e=0;e<n.length;e++){const s=n[e];r.push({Hours:s,name:ci()(l).add(e,"days").format("MMM Do")})}i({graph_data:r,loading:!1})}catch({err:err}){i({error:err,loading:!1})}};(0,l.useEffect)(()=>{r()},[e.group_assignment_template_id,e.start_date,e.end_date]),(0,l.useEffect)(()=>{r()},[]);const{error:o,graph_data:d,loading:c}=t;return(0,N.jsxs)(Me.x_,{loading:c,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>i({error:null}),show:o,variant:"danger",children:t.error}),d?(0,N.jsx)(xR,{custom_tooltip_label_1:"Hours on module",data:d,dep_label:"Hours",height:160}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center text-muted h-100",children:(0,N.jsx)(ke.A,{defaultMessage:"No usage data found",id:"label.no_usage_data_found.fc502edf"})})]})};const bU=1056;var AU=e=>{const{preview_template:s}=e,a=(0,l.useRef)(),t=(0,l.useRef)();return(0,l.useEffect)(()=>{const e=a.current,i=t.current;if(!e||!i||!s)return;const l=()=>{const s=e.clientWidth/bU;i.style.transform=`scale(${s})`,e.style.height=816*s+"px"};l();const n=new ResizeObserver(l);return n.observe(e),()=>n.disconnect()},[s]),s?(0,N.jsx)(Ce.S,{className:"certificate-renderer",children:(0,N.jsx)("div",{className:"certificate-frame-container",ref:a,style:{aspectRatio:"1056 / 816",overflow:"hidden",position:"relative",width:"100%"},children:(0,N.jsx)("iframe",{className:"rounded box-shadow-200",ref:t,scrolling:"no",srcDoc:s,style:{border:0,height:"816px",pointerEvents:"none",transformOrigin:"top left",width:"1056px"},title:"Certificate preview"})})}):(0,N.jsx)(yu,{preview:!0,variant:"light"})};var yU=s=>
2{var a,t,i,n,r,o,d,c,h,u;const{api:m,locale:g}=(0,P.nm)(),{formatMessage:p}=(0,ja.A)(),{stub_id:x}=(0,Pe.g)(),v=(0,l.useRef)(),[f,j,_]=(0,ne.CQ)({copied:!1,deleted:!1,error:null,loading:!0,preview_template:"",resume_editing:!1,stub:null}),{deleted:b,error:A,loading:y,preview_template:w,stub:S}=f,C=(null===S||void 0===S?void 0:S.current)||{},{certification_requests:M,challenge_templates:k,published:z,title:T,updated_at:I}=C;(0,l.useEffect)(()=>{(async()=>{try{j({loading:!0});const{preview_template:e,stub:s}=await m.get("/api/certification-templates/stub",{stub_id:x});j({loading:!1,preview_template:e,resume_editing:0===s.current.published,stub:s})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;j({error:a,loading:!1})}})()},[x]);(s=>{const a=(0,Re.by)({locale:g,scope:"content_authoring.certification_editor.full_template"});if(!a||!s)return!1;try{return a.validateSync(s),!0}catch(e){return!1}})(C);const E=ci()(I).calendar(),F=(null===M||void 0===M||null===(a=M.filter)||void 0===a||null===(t=a.call(M,e=>"awaiting_evaluation"===e.status))||void 0===t?void 0:t.length)||0,R=(null===M||void 0===M||null===(i=M.filter)||void 0===i||null===(n=i.call(M,e=>"processing"===e.status))||void 0===n?void 0:n.length)||0,D=(null===M||void 0===M||null===(r=M.filter)||void 0===r||null===(o=r.call(M,e=>"pending"===e.status))||void 0===o?void 0:o.length)||0,B=(null===M||void 0===M||null===(d=M.filter)||void 0===d||null===(c=d.call(M,e=>"approved"===e.status))||void 0===c?void 0:c.length)||0,L=(null===M||void 0===M||null===(h=M.filter)||void 0===h||null===(u=h.call(M,e=>"denied"===e.status))||void 0===u?void 0:u.length)||0,O=(null===C||void 0===C?void 0:C.icon_path)||xo;return(0,N.jsxs)(yT,{children:[(0,N.jsx)(Ce.S,{className:"admin-certification-stub",children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>j({error:null}),show:A,variant:"danger",children:A}),(0,N.jsxs)(vF.A,{className:"mt-4",children:[(0,N.jsx)(pa.mu,{to:"/admin",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Site",id:"label.site.fa795581"})})}),(0,N.jsx)(pa.mu,{to:"/admin#certifications",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Certification details",id:"label.certification_details.7f7b9a0d"})})]}),(0,N.jsx)(Me.x_,{loading:y,spinner:(0,N.jsx)(wU,{}),children:b?(0,N.jsxs)(Ce.S,{className:"deleted-notice d-flex flex-column justify-content-center align-items-center",style:{height:"calc(100vh - 150px)"},children:[(0,N.jsx)("h4",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification deleted successfully.",id:"label.certification_deleted_successfully.4a645901"})}),(0,N.jsxs)(Le.Link,{className:"d-flex align-items-center font-weight-bold",to:"/home#certifications",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Return to Dashboard",id:"label.return_to_dashboard.16ec0c91"})]})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)("h1",{className:"m-0",children:T})}),(0,N.jsxs)(Ve.A,{className:"d-flex justify-content-end",lg:6,children:[(0,N.jsx)(Le.Link,{className:"btn btn-primary d-inline-flex align-items-center align-self-center ms-2",to:`/admin/content-authoring/certification/${null===S||void 0===S?void 0:S.id}/${null===C||void 0===C?void 0:C.id}/0`,children:z?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.Ny1,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"View",id:"label.view.dcc839a4"})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]})}),!(null!==k&&void 0!==k&&k.length)&&(0,N.jsxs)(ve.A,{className:"ms-2 d-inline-flex align-items-center align-self-center",onClick:async()=>{const e=null===v||void 0===v?void 0:v.current;e&&(null!==k&&void 0!==k&&k.length||await e.show({actions:[e.CancelAction(),e.Action({label:p({id:"label.delete_certification.04ebc617",defaultMessage:"Delete certification"}),onClick:async()=>await(async()=>{try{j({loading:!0}),await m.post("/api/certification-templates/stub/delete",{certification_template_stub_id:x}),j({deleted:!0,loading:!1,stub:null})}catch({err:err}){j({error:err,loading:!1})}})(),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to delete this certification?",id:"label.are_you_sure_you_want_to_delete_th.f76e4b01"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This action can't be und
2one.",id:"label.this_action_cant_be_undone.b1b3fc4b"})})]}),title:p({id:"label.delete_certification.04ebc617",defaultMessage:"Delete certification"})}))},variant:"danger",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",md:8,children:[(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-4",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsx)("h3",{className:"m-0",style:{marginRight:24},children:(0,N.jsx)(ke.A,{defaultMessage:"Certification details",id:"label.certification_details.7f7b9a0d"})}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"black",children:E})]}),(0,N.jsxs)(yl.A,{variant:"flush",children:[(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center gap-3 ps-0",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Attached challenges:",id:"label.attached_challenges.e38ce0f3"})}),(0,N.jsx)("span",{children:(null===k||void 0===k?void 0:k.length)||0})]}),(0,N.jsxs)(yl.A.Item,{className:"d-flex align-items-center gap-3 ps-0",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Times requested:",id:"label.times_requested.d94c1b11"})}),(0,N.jsx)("span",{children:(null===M||void 0===M?void 0:M.length)||0})]}),(0,N.jsxs)(yl.A.Item,{className:"d-flex flex-column ps-0 gap-2",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Request arbitration:",id:"label.request_arbitration.e34ab133"})}),(0,N.jsx)(NU,{data:{approved:B,awaiting_evaluation:F,denied:L,pending:D,processing:R}})]})]})]})}),(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h3",{style:{marginRight:24},children:(0,N.jsx)(ke.A,{defaultMessage:"Certificate preview",id:"label.certificate_preview.739a2dda"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This is how the final certificate will be rendered when granted to a learner",id:"label.this_is_how_the_final_certificate.3522a7c9"})})]}),(0,N.jsx)(Ce.S,{className:"w-100",style:{aspectRatio:1.4375},children:(0,N.jsx)(AU,{preview_template:w,template:C})})]})]}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",md:4,children:[(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how your certification will appear when presented for learners to request",id:"label.heres_how_your_certification_will.12c85ff5"})}),(0,N.jsxs)(Ge.A,{className:"mb-3",children:[(0,N.jsx)(Ge.A.Header,{className:"d-flex align-items-center",children:(0,N.jsxs)(Ge.A.Title,{className:"d-flex gap-3 align-items-center m-0",children:[(0,N.jsx)(Zs.A,{rounded:!0,alt:"",height:50,src:O,style:{objectFit:"cover"},width:50}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column flex-fill",children:(0,N.jsx)("h5",{className:"m-0",children:null===C||void 0===C?void 0:C.title})})]})}),(0,N.jsx)(Ge.A.Body,{className:!C.description&&"bg-light",children:C.description?(0,N.jsx)(Rl,{lines:2,children:(0,N.jsx)("small",{children:null===C||void 0===C?void 0:C.description})}):(0,N.jsx)("span",{className:"text-muted d-flex align-items-center justify-content-center p-3",children:"No description added"})})]})]}),(0,N.jsx)(Gd.A,{defaultActiveKey:"0",children:(0,N.jsxs)(Gd.A.Item,{eventKey:"0",children:[(0,N.jsx)(Gd.A.Header,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1 flex-grow-1",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Attached challenges",id:"label.attached_challenges.28ccefab"})}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:(0,N.jsx)("strong",{children:(null===k||void 0===k?void 0:k.length)||0})})]})}),(0,N.jsxs)(Gd.A.Body,{className:"bg-light d-flex flex-column gap-1",children:[(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end mb-1",children:(0,N.jsx)(pa.mu,{to:`/admin/content-authoring/certification/${null===S||void 0===S?void 0:S.id}/${null===C||void 0===C?void 0:C.id}/5`,children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-1",size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{size:10}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]})})}),null!==k&&void 0!==k&&k.length?(0,N.jsx)(N.Fragment,{children:null===k||void 0===k?void 0:k.map((e,s)=>(0,N.jsx)(Ge.A,{children:(0,N.jsx)(Ge.A.Body,{className:"d-flex justify-content-between",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(Zs.A,{rounded:!0,height:40,src:e.cover_path||xo,width:40,style:{objectFit:"cover"}}),(0,N.jsx)("h6",{className:"m-0",children:e.title})]})})},s))}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center text-muted p-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Not yet attached to a challenge",id:"label.not_yet_attached_to_a_challenge.f0c1d360"})})]})]})})]})]})]})})]})}),(0,N.jsx)(je,{ref:v})]})};const wU=()=>(0,N.jsxs)(Ce.S,{className:"admin-certification-stub-placeholder",children:[(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsx)(Ve.A,{lg:6,children:(0,N.jsx)(Rh.A,{animation:"wave",as:"h1",bg:"secondary",className:"placeholder rounded",size:"lg",xs:12})}),(0,N.jsx)(Ve.A,{className:"d-flex justify-content-end",lg:6,children:(0,N.jsx)(Rh.A.Button,{"aria-hidden":"true",xs:4})})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",md:8,children:[(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder card",size:"lg",style:{height:400},xs:12}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder card",size:"lg",style:{height:500},xs:12})]}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",md:4,children:[(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder card",size:"lg",style:{height:300},xs:12}),(0,N.jsx)(Rh.A,{animation:"wave",bg:"secondary",className:"placeholder card",size:"lg",style:{height:200},xs:12})]})]})]}),NU=e=>{const{data:s}=e,{approved:a,awaiting_evaluation:t,denied:i,pending:l,processing:n}=s,r=t+n+l+a+i,o=e=>{if(0===e)return 3;const s=e/r*100;return Math.max(s,3)},d=o(t),c=o(n),h=o(l),u=o(a),m=o(i),g=100/(d+c+h+u+m),p={approved:u*g,awaiting_evaluation:d*g,denied:m*g,pen
2ding:h*g,processing:c*g};return(0,N.jsxs)(Ue.A,{fluid:!0,className:"request-arbitration-bar-chart",children:[(0,N.jsxs)(Sa.A,{style:{height:"2rem"},children:[(0,N.jsx)(Sa.A,{className:"d-flex align-items-center justify-content-center",label:t,now:p.awaiting_evaluation,striped:!t,variant:"warning"}),(0,N.jsx)(Sa.A,{className:"d-flex align-items-center justify-content-center",label:n,now:p.processing,striped:!n,variant:"info"}),(0,N.jsx)(Sa.A,{className:"d-flex align-items-center justify-content-center",label:l,now:p.pending,striped:!l,variant:"secondary"}),(0,N.jsx)(Sa.A,{className:"d-flex align-items-center justify-content-center",label:a,now:p.approved,striped:!a,variant:"success"}),(0,N.jsx)(Sa.A,{className:"d-flex align-items-center justify-content-center",label:i,now:p.denied,striped:!i,variant:"danger"})]}),(0,N.jsxs)("div",{className:"d-flex justify-content-center gap-3 mt-3",children:[(0,N.jsxs)("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)(bo.A,{bg:"warning",className:"me-2",children:"\xa0"}),(0,N.jsxs)("small",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Awaiting evaluation",id:"label.awaiting_evaluation.e584d7cd"})}),(0,N.jsxs)("span",{children:["(",t,")"]})]})]}),(0,N.jsxs)("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)(bo.A,{bg:"info",className:"me-2",children:"\xa0"}),(0,N.jsxs)("small",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Processing",id:"label.processing.c8e3e92a"})}),(0,N.jsxs)("span",{children:["(",n,")"]})]})]}),(0,N.jsxs)("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)(bo.A,{bg:"secondary",className:"me-2",children:"\xa0"}),(0,N.jsxs)("small",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Pending arbitration",id:"label.pending_arbitration.fd219dfc"})}),(0,N.jsxs)("span",{children:["(",l,")"]})]})]}),(0,N.jsxs)("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)(bo.A,{bg:"success",className:"me-2",children:"\xa0"}),(0,N.jsxs)("small",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Approved",id:"label.approved.87b42e40"})}),(0,N.jsxs)("span",{children:["(",a,")"]})]})]}),(0,N.jsxs)("div",{className:"d-flex flex-column justify-content-center align-items-center",children:[(0,N.jsx)(bo.A,{bg:"danger",className:"me-2",children:"\xa0"}),(0,N.jsxs)("small",{className:"d-flex gap-1",children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Denied",id:"label.denied.da404deb"})}),(0,N.jsxs)("span",{children:["(",i,")"]})]})]})]})]})};NU.defaultProps={data:{approved:0,awaiting_evaluation:0,denied:0,pending:0}};var SU=()=>{var s,a,t,i;const{stub_id:n}=(0,Pe.g)(),r=(0,Pe.W6)(),{formatMessage:o}=(0,ja.A)(),{api:d,userHasRight:c,userIsSiteAdmin:h}=(0,P.nm)(),u=(0,l.useRef)(null),m=(0,l.useRef)(null),[g,p]=(0,l.useState)(!0),[x,v]=(0,l.useState)(null),[f,j]=(0,l.useState)(null),[_,b]=(0,l.useState)({active:[],archived:[]}),[A,y]=(0,l.useState)("active"),w=(0,l.useCallback)(async()=>{try{p(!0);const{stub:e}=await d.get(`/api/agent-templates/personas/stub/${n}`);j(e),p(!1)}catch(e){p(!1)}},[n,d]),S=(0,l.useCallback)(async()=>{try{const e=await d.get(`/api/agent-templates/personas/stub/versions/${n}`);b(e)}catch(e){}},[n,d]);(0,l.useEffect)(()=>{w(),S()},[w,S]);const C=(null===f||void 0===f?void 0:f.current)||{},M=async s=>{try{v(null);const e=await d.post(`/api/agent-templates/personas/publish/${s}`,{make_primary:!0});if(!1===(null===e||void 0===e?void 0:e.success))return void v(e.message);w(),S()}catch(e){v((null===e||void 0===e?void 0:e.message)||(null===e||void 0===e?void 0:e.err)||"An error occurred while publishing")}},k="active"===A?_.active:_.archived,[z,T]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{0===(null===C||void 0===C?void 0:C.published)&&T(!0)},[null===C||void 0===C?void 0:C.published]),(0,N.jsxs)(yT,{children:[(0,N.jsx)(Ce.S,{className:"admin-agent-stub-page",children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Me.x_,{loading:g,children:f&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(vF.A,{className:"mt-4",children:[h()?(0,N.jsx)(pa.mu,{to:"/admin#library",children:(0,N.jsx)(vF.A.Item,{children:o({id:"label.site.fa795581",defaultMessage:"Site"})})}):(0,N.jsx)(pa.mu,{to:"/admin/agents",children:(0,N.jsx)(vF.A.Item,{children:o({id:"label.agents.279b44d2",defaultMessage:"Agents"})})}),(0,N.jsx)(vF.A.Item,{active:!0,children:o({id:"label.agent_editor.8d28cdc7",defaultMessage:"Agent editor"})})]}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(Qe.A,{className:"mb-3",children:[(0,N.jsxs)(Ve.A,{lg:6,children:[(0,N.jsx)("h1",{children:C.name||o({id:"label.untitled_persona.cec8d127",defaultMessage:"Untitled persona"})}),(null===(s=C.category)||void 0===s?void 0:s.name)&&(0,N.jsx)(bo.A,{bg:"info",className:"me-1",children:C.category.name}),(e=>{switch(e){case 0:return(0,N.jsx)(bo.A,{bg:"secondary",children:o({id:"label.draft.ebf12ef4",defaultMessage:"Draft"})});case 1:return(0,N.jsx)(bo.A,{bg:"success",children:o({id:"label.published.2ef42ec2",defaultMessage:"Published"})});case 2:return(0,N.jsx)(bo.A,{bg:"warning",children:o({id:"label.archived.bdb86505",defaultMessage:"Archived"})});default:return null}})(C.published)]}),(0,N.jsxs)(Ve.A,{className:"d-flex justify-content-end align-items-start gap-2",lg:6,children:[(0,N.jsxs)(Le.Link,{className:"btn btn-primary",to:`/admin/content-authoring/agent/${n}/${C.id}/0`,children:[(0,N.jsx)(ze.F7,{className:"me-2"}),o({id:"label.edit.464c4ffd",defaultMessage:"Edit"})]}),(0,N.jsxs)(ve.A,{onClick:async()=>{try{const{stub:e}=await d.post(`/api/agent-templates/personas/copy/${n}`,{organization_id:null===f||void 0===f?void 0:f.organization_id});e&&r.push(`/admin/agent-template/${e.id}`)}catch(e){}},variant:"secondary",children:[(0,N.jsx)(ze.paH,{className:"me-2"}),o({id:"label.copy.e21f935f",defaultMessage:"Copy"})]}),(0,N.jsxs)(ve.A,{onClick:async()=>
2{if(window.confirm(o({id:"label.are_you_sure_you_want_to_delete_th.b4c6c1c1",defaultMessage:"Are you sure you want to delete this agent persona? This action cannot be undone."})))try{v(null),await d.post(`/api/agent-templates/personas/delete/${n}`),r.push("/admin/agents")}catch(e){v((null===e||void 0===e?void 0:e.message)||(null===e||void 0===e?void 0:e.err)||"An error occurred while deleting")}},variant:"secondary",children:[(0,N.jsx)(ze.qbC,{className:"me-2"}),o({id:"label.delete.e2d0a549",defaultMessage:"Delete"})]})]})]})}),(0,N.jsx)("hr",{}),x&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>v(null),variant:"danger",children:x}),z&&(0,N.jsxs)(Ce.S,{className:"agent-not-published",children:[(0,N.jsx)(Ce.S,{className:"dismiss-toggle",children:(0,N.jsx)(ve.A,{onClick:()=>T(!1),style:{padding:12},variant:"light",children:(0,N.jsx)(ze.QCr,{})})}),(0,N.jsx)("h5",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Agent not published",id:"label.agent_not_published.c7928464"})}),(0,N.jsx)("p",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Publish this agent persona to make it available for assignment",id:"label.publish_this_agent_persona_to_make.75efcc5b"})}),(0,N.jsxs)(ve.A,{className:"d-inline-block",onClick:()=>M(C.id),children:[(0,N.jsx)(ze.uoG,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish agent",id:"label.publish_agent.d7d406e1"})]}),(0,N.jsxs)(Le.Link,{className:"btn btn-secondary btn-xl ms-2",to:`/admin/content-authoring/agent/${n}/${C.id}/0`,children:[(0,N.jsx)(ze.F7,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Keep editing",id:"label.keep_editing.e76fd2ad"})]})]}),(0,N.jsx)(Ce.S,{style:{marginTop:47},children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsx)(Ve.A,{md:8,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h3",{children:o({id:"label.persona_details.00154fe4",defaultMessage:"Persona details"})}),(0,N.jsx)("hr",{}),(0,N.jsx)(qa.A,{borderless:!0,size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",style:{width:160},children:o({id:"label.version.dd167905",defaultMessage:"Version"})}),(0,N.jsx)("td",{children:C.version_title||"1"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.category.292c06f0",defaultMessage:"Category"})}),(0,N.jsx)("td",{children:(null===(a=C.category)||void 0===a?void 0:a.name)||"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.style.7e744141",defaultMessage:"Style"})}),(0,N.jsx)("td",{children:C.style||"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.personality.95a29562",defaultMessage:"Personality"})}),(0,N.jsx)("td",{children:Array.isArray(C.personality)&&C.personality.length>0?C.personality.join(", "):"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.strengths.b11d27f8",defaultMessage:"Strengths"})}),(0,N.jsx)("td",{children:Array.isArray(C.strengths)&&C.strengths.length>0?C.strengths.join(", "):"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.limitations.69b1b67d",defaultMessage:"Limitations"})}),(0,N.jsx)("td",{children:Array.isArray(C.limitations)&&C.limitations.length>0?C.limitations.join(", "):"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.organization.d764d425",defaultMessage:"Organization"})}),(0,N.jsxs)("td",{children:[null!==f&&void 0!==f&&f.organization?(0,N.jsxs)(N.Fragment,{children:[f.organization.name,c&&c("manage_organization",f.organization.id)&&(0,N.jsx)(Le.Link,{to:`/admin/organization/${f.organization.id}`,children:(0,N.jsx)(ve.A,{className:"ms-1",size:"sm",variant:"secondary",children:(0,N.jsx)(ze.EQc,{className:"align-baseline",size:12.5})})})]}):(0,N.jsx)(ze.Eh_,{className:"text-primary"}),h&&h()&&(0,N.jsx)(ve.A,{className:"ms-1",onClick:()=>{const e=null===m||void 0===m?void 0:m.current;e&&e.show({body:o({id:"label.select_an_organization_to_make_the.fc20547e",defaultMessage:"Select an organization to make the owner of this agent persona. Leave unselected for a global agent available to all organizations."}),preselected_organization_id:null===f||void 0===f?void 0:f.organization_id})},size:"sm",variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change",id:"label.change.c0bf75bd"})})]})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:o({id:"label.last_updated.382ac5f3",defaultMessage:"Last updated"})}),(0,N.jsx)("td",{children:ci()(C.updated_at).format("MMM D, YYYY h:mm A")})]})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)("h4",{children:o({id:"label.system_prompt_preview.8ca0fa21",defaultMessage:"System prompt preview"})}),C.base_prompt?(0,N.jsxs)(Ce.S,{className:"p-3 rounded",style:{background:"#f8f9fa",fontFamily:"monospace",fontSize:"0.85rem",maxHeight:200,overflow:"auto",whiteSpace:"pre-wrap"},children:[C.base_prompt.substring(0,500),C.base_prompt.length>500?"...":""]}):(0,N.jsx)("span",{className:"text-muted",children:o({id:"label.no_system_prompt_configured.05a1fa2d",defaultMessage:"No system prompt configured"})})]})}),(0,N.jsx)(Ve.A,{md:4,children:(0,N.jsxs)(Ge.A,{body:!0,children:[(0,N.jsx)("h4",{children:o({id:"label.summary.8e76a94a",defaultMessage:"Summary"})}),(0,N.jsxs)(Ce.S,{className:"text-center py-3",children:[C.avatar_path?(0,N.jsx)(Ce.S,{className:"mb-3",style:{margin:"0 auto",width:80},children:(0,N.jsx)(md,{name:C.name||"?",size:80,src:C.avatar_path})}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center mb-3",style:{background:(null===(t=C.category)||void 0===t?void 0:t.color)||"#6c757d",borderRadius:"50%",color:"#fff",fontSize:32,height:80,margin:"0 auto",width:80},children:(C.name||"?").charAt(0).toUpperCase()}),(0,N.jsx)("h5",{children:C.name||"-"}),(null===(i=C.category)||void 0===i?void 0:i.name)&&(0,N.jsx)(bo.A,{bg:"info",className:"mb-2",children:C.category.name}),(0,N.jsx)("p",{className:"text-muted small",children:C.style?C.style.substring(0,120)+(C.style.length>120?"...":""):o({id:"label.no_communication_style_defined.33c829e2",defaultMessage:"No communication style defined"})})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("span",{className:"text-muted",children:o({id:"label.examples.e68ee04d",defaultMessage:"Examples"})}),(0,N.jsx)("strong",{children:Array.isArray(C.example_responses)?C.example_responses.length:0})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mt-2",children:[(0,N.jsx)("span",{className:"text-muted",children:o({id:"label.total_versions.d4bb89db",defaultMessage:"Total versions"})}),(0,N.jsx)("strong",{children:_.active.length+_.archived.length})]})]})})]})}),(0,N.jsx)(Ce.S,{style:{marginTop:61},children:(0,N.jsx)("h3",{children:o({id:"label.manage_versions.f461c6ca",defaultMessage:"Manage versions"})})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"admin-agent-stub-versions-table",children:(0,N.jsxs)(Ce.S,{className:"position-relative",children:[(0,N.jsxs)(ld.A.Container,{mountOnEnter:!0,defaultActiveKey:"active",id:"agent-stub-versions-table-tabs",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>y("active"),children:(0,N.jsx)(aa.A.Link,{active:"active"===A,eventKe
2y:"active",href:"#active",children:(0,N.jsx)(ke.A,{defaultMessage:"Active",id:"label.active.92340695"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>y("archived"),children:(0,N.jsx)(aa.A.Link,{active:"archived"===A,eventKey:"archived",href:"#archived",children:(0,N.jsx)(ke.A,{defaultMessage:"Archived",id:"label.archived.bdb86505"})})})]}),(0,N.jsx)("div",{className:"position-absolute",style:{right:0,top:0},children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:async()=>{try{var s;const e=await(null===(s=u.current)||void 0===s?void 0:s.show());if(!e)return;const{template:a,values:t}=e;p(!0);const{persona:i}=await d.post(`/api/agent-templates/personas/version/create/${a.id}`,{version_description:t.version_description,version_title:t.version_title});i&&r.push(`/admin/content-authoring/agent/${n}/${i.id}/0`),p(!1)}catch(e){p(!1)}},style:{textDecoration:"none"},variant:"link",children:[(0,N.jsx)(ze.OiG,{style:{marginRight:8}})," NEW VERSION"]})})]}),(0,N.jsxs)(ho,{children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Category",id:"label.category.292c06f0"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{children:null!==k&&void 0!==k&&k.length?(0,N.jsx)(N.Fragment,{children:k.map(e=>{var s;const a=(null===f||void 0===f?void 0:f.primary_key_id)===e.id,t=!a&&0===e.published;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{className:"text-center",children:e.name||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:e.version_title||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(KF,{primary:a,published:1===e.published})}),(0,N.jsx)(ho.Td,{className:"text-center",children:(null===(s=e.category)||void 0===s?void 0:s.name)||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:ci()(e.updated_at).calendar()}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[t&&(0,N.jsxs)(ve.A,{onClick:()=>M(e.id),size:"sm",variant:"outline-success",children:[(0,N.jsx)(ze.uoG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Publish",id:"label.publish.859390eb"})]}),(0,N.jsxs)(ve.A,{onClick:()=>{return s=e.id,void r.push(`/admin/content-authoring/agent/${n}/${s}/0`);var s},size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),2===e.published&&(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-success",onClick:s=>{s.preventDefault(),(async e=>{if(window.confirm(o({id:"label.are_you_sure_you_want_to_restore_t.29c412e3",defaultMessage:"Are you sure you want to restore this version?"})))try{v(null);const s=await d.post("/api/agent-templates/personas/restore",{persona_id:e});if(!1===(null===s||void 0===s?void 0:s.success))return void v(s.message);S(),y("active")}catch(s){v((null===s||void 0===s?void 0:s.message)||(null===s||void 0===s?void 0:s.err)||"An error occurred while restoring")}})(e.id)},children:[(0,N.jsx)(ze.OKX,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Restore",id:"label.restore.a76e13b9"})]}),!a&&1===e.published&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-secondary",onClick:s=>{s.preventDefault(),(async e=>{if(window.confirm(o({id:"label.are_you_sure_you_want_to_make_this.a8ccf029",defaultMessage:"Are you sure you want to make this version the primary?"})))try{v(null),p(!0);const s=await d.post(`/api/agent-templates/personas/primary/${e}`);if(!1===(null===s||void 0===s?void 0:s.success))return v(s.message),void p(!1);await w(),await S(),p(!1)}catch(s){v((null===s||void 0===s?void 0:s.message)||(null===s||void 0===s?void 0:s.err)||"An error occurred"),p(!1)}})(e.id)},children:[(0,N.jsx)(ze.gt3,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Make primary",id:"label.make_primary.07d68ed8"})]}),(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-danger",onClick:s=>{s.preventDefault(),(async e=>{if(window.confirm(o({id:"label.are_you_sure_you_want_to_archive_t.846e3369",defaultMessage:"Are you sure you want to archive this version?"})))try{v(null);const s=await d.post("/api/agent-templates/personas/archive",{persona_id:e});if(!1===(null===s||void 0===s?void 0:s.success))return void v(s.message);w(),S(),y("archived")}catch(s){v((null===s||void 0===s?void 0:s.message)||(null===s||void 0===s?void 0:s.err)||"An error occurred while archiving")}})(e.id)},children:[(0,N.jsx)(ze.Wlj,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Archive",id:"label.archive.66f4804e"})]})]}),0===e.published&&!a&&(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-danger",onClick:s=>{s.preventDefault(),(async e=>{if(window.confirm(o({id:"label.are_you_sure_you_want_to_delete_th.220e59d6",defaultMessage:"Are you sure you want to delete this version? This action cannot be undone."})))try{v(null),p(!0);const s=await d.post(`/api/agent-templates/personas/version/delete/${e}`);if(!1===(null===s||void 0===s?void 0:s.success))return v(s.message),void p(!1);await S(),p(!1)}catch(s){v((null===s||void 0===s?void 0:s.message)||(null===s||void 0===s?void 0:s.err)||"An error occurred while deleting version"),p(!1)}})(e.id)},children:[(0,N.jsx)(ze.qbC,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})]})]})})]},e.id)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center",colSpan:"6",children:(0,N.jsx)(ke.A,{defaultMessage:"No versions foun
2d.",id:"label.no_versions_found.2e724551"})})})})]})]})})]})})})}),(0,N.jsx)(TU,{ref:u,stub_id:n}),(0,N.jsx)(NR,{onSubmit:s=>(async s=>{try{p(!0),await d.post(`/api/agent-templates/personas/stub/set/organization/${n}`,{organization_id:s||null}),await w()}catch(e){v((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||"An error occurred while updating the organization"),p(!1)}})(s||null),ref:m})]})};const CU=ul.Ik().shape({version_description:ul.Yj(),version_title:ul.Yj().min(1,"Version name must be at least 1 character long").max(10,"Version name must be less than 10 characters long").required("Version name required")}),MU=(0,l.forwardRef)((e,s)=>{const{handleCreateVersion:a=Function(),handlePrevious:t=Function(),onHide:i,showModal:n}=e,[r,o,d]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1}),c=(0,ds.Wx)({enableReinitialize:!0,initialValues:{version_description:"",version_title:""},onSubmit:e=>{a(e)},validationSchema:CU}),{errors:h,handleChange:u,handleSubmit:m,touched:g,values:p}=c,x=e=>new Promise((s,a)=>{o({reject:a,resolve:s,show:!0,template:e})}),v=()=>{"function"===typeof(null===r||void 0===r?void 0:r.resolve)&&r.resolve(null),d(),"function"===typeof i&&i()};return(0,l.useImperativeHandle)(s,()=>({hide:v,show:x})),(0,N.jsxs)(xe,{onHide:v,show:r.show||n,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Version details",id:"label.version_details.c05702e1"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)("div",{className:"d-flex align-items-center mb-3",style:{backgroundColor:"var(--gray-200)",color:"var(--primary)",padding:"16px 8px 16px 21px"},children:[(0,N.jsx)(ze.ELu,{style:{marginRight:17}}),(0,N.jsx)("span",{style:{color:"var(--black)"},children:(0,N.jsx)(ke.A,{defaultMessage:"This version will remain unpublished by default",id:"label.this_version_will_remain_unpublish.839ae241"})})]}),(0,N.jsx)(ds.QI,{value:c,children:(0,N.jsxs)(_e.A,{noValidate:!0,onSubmit:m,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Version name",id:"label.version_name.c5be1c55"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"version_title",className:"form-control",isInvalid:g.version_title&&h.version_title,isValid:g.version_title&&!h.version_title,name:"version_title",onChange:u,placeholder:"E.g. 1.2",type:"text",value:p.version_title}),h.version_title&&g.version_title&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:h.version_title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("div",{className:"body-medium",children:(0,N.jsx)(ke.A,{defaultMessage:"Description of changes",id:"label.description_of_changes.b73fb4ce"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"Description of changes",as:"textarea",className:"form-control",isInvalid:g.version_description&&h.version_description,isValid:g.version_description&&!h.version_description,name:"version_description",onChange:u,placeholder:"Describe the changes made in this version",rows:4,value:p.version_description})]}),(0,N.jsxs)(os,{className:"d-flex justify-content-between mb-0 align-items-center",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:t,variant:"secondary",children:[(0,N.jsx)(ze.QVr,{style:{marginRight:8}}),(0,N.jsx)(ke.A,{defaultMessage:"PREVIOUS",id:"label.previous.08d90c23"})]}),(0,N.jsx)(ve.A,{type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"CREATE VERSION",id:"label.create_version.64c203a1"})})]})]})})]})]})});MU.displayName="NewVersionDetailsModal";var kU=MU;const zU=(0,l.forwardRef)((s,a)=>{const{onHide:t,stub_id:i}=s,{api:n}=(0,P.nm)(),[r,o,d]=(0,ne.CQ)({loading:!0,reject:null,resolve:null,show:!1,step:0,stub:null,template:null,version_selected:null,versions:[]}),{loading:c,show:h,step:u,stub:m,template:g,version_selected:p,versions:x}=r;(0,l.useEffect)(()=>{r.show&&(async()=>{try{o({loading:!0});const{active:e,archived:s}=await n.get("/api/agent-templates/personas/stub/versions/"+i),a=await n.get("/api/agent-templates/personas/stub/"+i);o({loading:!1,stub:(null===a||void 0===a?void 0:a.stub)||null,versions:[...e||[],...s||[]]})}catch(e){o({loading:!1})}})()},[r.show]);const v=()=>new Promise((e,s)=>{o({reject:s,resolve:e,show:!0})}),f=()=>{"function"===typeof r.resolve&&r.resolve(null),d(),"function"===typeof t&&t()};(0,l.useImperativeHandle)(a,()=>({hide:f,show:v}));return(0,N.jsx)(N.Fragment,{children:0===u?(0,N.jsxs)(xe,{dialogClassName:"new-agent-version-modal",onHide:f,show:h,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select a ver
2sion to start from",id:"label.select_a_version_to_start_from.241fd248"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsxs)(ho,{children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"checkbox-col"}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Category",id:"label.category.292c06f0"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})})]})}),(0,N.jsx)(ho.Tbody,{cols:6,loading:c,children:x.map(e=>{const{id:s,category:a,name:t,published:i,updated_at:l,version_title:n}=e,r=s===(null===m||void 0===m?void 0:m.primary_key_id);return(0,N.jsxs)(ho.Tr,{className:p===s?"row-selected":"",onClick:()=>(e=>o({version_selected:e}))(s),children:[(0,N.jsx)(ho.Td,{className:"checkbox-col",children:(0,N.jsx)(sy,{checked:p===s,id:s,type:"radio"})}),(0,N.jsx)(ho.Td,{className:"text-center",children:t||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:n||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(WF,{primary:r,published:1===i})}),(0,N.jsx)(ho.Td,{className:"text-center",children:(null===a||void 0===a?void 0:a.name)||"-"}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(Gh.XU,{value:l})})]},s)})})]}),(0,N.jsx)("div",{className:"w-100 d-flex justify-content-end",children:(0,N.jsx)(ve.A,{disabled:c||!p,onClick:()=>{const e=x.find(e=>e.id===p);o({step:1,template:e})},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"})})})]})]}):(0,N.jsx)(kU,{handleCreateVersion:e=>(e=>{r.resolve(e),f()})({template:r.template,values:e}),handlePrevious:()=>o({step:0}),onHide:()=>d(),showModal:0!==u,template:g})})});zU.displayName="NewVersionModal";var TU=zU;var IU=t.p+"static/media/journey-icon.da1d8f087db5aaaa655eec8437fd719e.svg";var EU=e=>{const[s,a]=(0,ne.CQ)({challenge_templates:[],error:null,group_assignment_templates:[],loading:!0}),t=(0,Pe.W6)(),i=(0,n.nm)(),{api:r}=i;(0,l.useEffect)(()=>{!async function(){await(()=>{const{role:t}=e,{sort_direction:l,sort_token:n}=s;return a({error:null,loading:!0}),new Promise((e,s)=>{r.get("/api/templates/mine/list",{organization_id:i.getUserOrganizationId(),role:t,sort_direction:l,sort_token:n}).then(s=>{let{challenge_templates:t,count:i,group_assignment_templates:l}=s,n=[...t.map(e=>(e.type="challenge",e)),...l.map(e=>(e.type="journey",e))];n=n.sort((e,s)=>{var a,t,i,l;let n=null===e||void 0===e||null===(a=e.stub)||void 0===a||null===(t=a.current)||void 0===t?void 0:t.updated_at,r=null===s||void 0===s||null===(i=s.stub)||void 0===i||null===(l=i.current)||void 0===l?void 0:l.updated_at;return n<r?1:n>r?-1:0}),a({challenge_templates:t,count:i,group_assignment_templates:l,loading:!1,templates:n},()=>{e()})}).catch(e=>{const t=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;a({error:t,loading:!1}),s(t)})})})()}()},[]);const{title:o}=e,{error:d,loading:c,templates:h}=s;return(0,N.jsxs)(Ce.S,{className:"design-lab-results-container",children:[(0,N.jsx)("h2",{children:o}),(0,N.jsx)("hr",{}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{a({error:null})},show:d,variant:"danger",children:d}),c&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!c&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ue.A,{className:"p-0",children:[(0,N.jsx)(Qe.A,{className:"search-results-counter mt-2",children:(0,N.jsx)(Ve.A,{xs:12,children:(0,N.jsxs)(Ce.S,{className:"float-end text-muted",children:["Showing ",h.length," results"]})})}),(null===h||void 0===h?void 0:h.length)>0&&(0,N.jsx)(Qe.A,{children:null===h||void 0===h?void 0:h.map((e,s)=>{let{stub:a}=e,i=(null===e||void 0===e?void 0:e.type)||"challenge",l=a&&a.current?a.current:{},{id:n,updated_at:r}=l;return(0,N.jsx)(Ve.A,{lg:4,md:6,sm:6,style:{paddingBottom:30},xl:3,xs:12,children:(0,N.jsx)(Kh,{component:l,type:i,onClick:()=>{"challenge"==i&&t.push("/admin/challenge-template/"+a.id),"journey"==i&&t.push("/admin/journey-template/"+a.id)}})},n)})}),!h||0===h.length&&(0,N.jsx)("h6",{className:"text-center text-secondary",children:"No templates found."})]})})]})};var FU=s=>{const[a,t]=(0,ne.CQ)({active_key:"recent",error:null,loading:!0}),i=(0,n.nm)(),r=(0,Pe.W6)(),o=(0,ja.A)(),d=(0,l.useRef)(null),c=(0,l.useRef)(null),h=(0,l.useRef)(null),{api:u}=i,m=async(s,a)=>{var l=null;t({loading:!0}),(i.userIsFacilitator()||i.userIsOrgAdmin())&&(l=i.getUserOrganizationId());try{if("challenge"==s){let{stub:e}=await u.post("/api/challenge-templates/create",{contributor:1,organization_id:l,title:a});r.push("/admin/challenge-template/"+e.id)}else if("journey"==s){let{stub:e}=await u.post("/api/group-assignment-templates/create",{contributor:1,organization_id:l,title:a});r.push("/admin/journey-template/"+e.id)}}catch(e){t({error:e,loading:!1})}},{active_key:g}=a;var p=i.getUserOrganizationId();return(0,N.jsxs)(yT,{children:[(0,N.jsxs)(Ce.S,{className:"admin-challenge-templates",containerClass:"admin-challenge-templates",children:[(0,N.jsx)(Ce.S,{className:"header-bg",children:(0,N.jsx)(Ce.S,{className:"header-outer",children:(0,N.jsx)(Ce.S,{className:"header-inner",children:(0,N.jsx)(Ue.A,{className:"content-outer",children:(0,N.jsxs)(Ce.S,{className:"content-inner",children:[(0,N.jsx)("div",{className:"display-1",children:(0,N.jsx)(ke.A,{defaultMessage:"Design lab",description:"",id:"label.design_lab.9055ff21"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new or copy and edit existing development journeys and modules.",description:"",id:"label.create_new_or_copy_and_edit_existi.8e3039af"})}),i.userHasRight("manage_challenge",p)&&(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(Fi.A,{align:"end",className:"d-inline-block me-2",title:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Create my own",description:"",id:"label.create_my_own.89965949"})]}),variant:"secondary",children:[(0,N.jsxs)(li.A.Item,{eventKey:"1",onClick:async()=>{let e=await d.current.promptNewTemplateTitle("journey");e&&m("journey",e)},children:[(0,N.jsx)("img",{alt:"",className:"img-fluid me-2",src:IU}),(0,N.jsx)(ke.A,{defaultMessage:"Journey",id:"label.journey.fe50ed10"})]}),(0,N.jsxs)(li.A.Item,{eventKey:"2",onClick:async()=>{let e=await d.current.promptNewTemplateTitle("challenge");e&&m("challenge",e)},children:[(0,N.jsx)(ze.FhS,{className:"me-2"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})]})]}),(0,N.jsxs)(Fi.A,{align:"end",className:"d-inline-block me-2",title:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.wwX,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Copy from catalog",description:"",id:"label.copy_from_catalog.4e155a3e"})]}),variant:"secondary",children:[(0,N.jsxs)(li.A.Item,{eventKey:"1",onClick:async()=>{let e=await c.current.show({scope:["journey"]});if(e){(e=>{var s=null;t({loading:!0}),(i.userIsFacilitator()||i.userIsOrgAdmin())&&(s=i.getUserOrganizationId()),u.get("/api/group-assignment-templates/copy/"+e,{organization_id:s}).then(e=>{let{group_assignment_template:s,stub:a}=e;r.push(`/admin/journey-template/${a.id}/?copied=1`)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;t({error:s,loading:!1})})})((null===e||void 0===e?void 0:e.component).group_assignment_template_stub_id)}},children:[(0,N.jsx)("img",{alt:"",className:"img-fluid me-2",src:IU}),(0,N.jsx)(ke.A,{defaultMessage:"Journey",id:"label.journey.fe50ed10"})]}),(0,N.jsxs)(li.A.Item,{eventKey:"2",onClick:async()=>{let e=await c.current.show({scope:["challenge"]});if(e){(e=>{var s=null;t({loading:!0}),(i.userIsFacilitator()||i.userIsOrgAdmin())&&(s=i.getUserOrganizationId()),u.get("/api/challenge-templates/copy/"+e,{organization_id:s}).then(e=>{let{challenge_template:s,stub:a}=e;r.push(`/admin/challenge-template/${a.id}/?copied=1`)}).catch(e=>{const s=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;t({error:s,loading:!1})})})((null===e||void 0===e?void 0:e.component).challenge_template_stub_id)}},children:[(0,N.jsx)(ze.FhS,{className:"me-2"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Challenge",id:"label.challenge.27cf1792"})]})]}),(0,N.jsxs)(ve.A,{className:"d-inline-block",onClick:async()=>{var e;const s=await(null===(e=h.current)||void 0===e?void 0:e.show());null!==s&&void 0!==s&&s.stub&&r.push("/admin/challenge-template/"+s.stub.id)},variant:"primary",children:[(0,N.jsx)(ze.T_n,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"AI Challenge Builder",id:"label.ai_challenge_builder.0c2c3a0d"})]})]})]})})})})}),(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>t({error:null}),show:a.error,variant:"danger",children:a.error}),(0,N.jsxs)(ld.A.Container,{activeKey:g,id:"admin-tabs",role:"navigation",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{"aria-label":"Recent 
2Challenges",onClick:()=>{t({active_key:"recent"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"recent",href:"#recent",children:(0,N.jsx)(ke.A,{defaultMessage:"Recent",description:"",id:"label.recent.690dbe9d"})})}),(0,N.jsx)(aa.A.Item,{"aria-label":"Shared Challenges",onClick:()=>{t({active_key:"shared"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"shared",href:"#shared",children:(0,N.jsx)(ke.A,{defaultMessage:"Shared",description:"",id:"label.shared.e3c4b39d"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>{t({active_key:"created"})},children:(0,N.jsx)(aa.A.Link,{"aria-label":"Created Challenges",eventKey:"created",href:"#created",children:(0,N.jsx)(ke.A,{defaultMessage:"Created",description:"",id:"label.created.d70b9e24"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"recent",children:(0,N.jsx)(EU,{title:o.formatMessage({id:"label.recent.690dbe9d",defaultMessage:"Recent"})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"shared",children:(0,N.jsx)(EU,{role:1,title:o.formatMessage({id:"label.shared.e3c4b39d",defaultMessage:"Shared"})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"created",children:(0,N.jsx)(EU,{role:0,title:o.formatMessage({id:"label.created.d70b9e24",defaultMessage:"Created"})})})]})})})]})]})]}),(0,N.jsx)(RU,{ref:d}),(0,N.jsx)(rd,{ref:c}),(0,N.jsx)(tB,{ref:h})]})};const RU=(0,l.forwardRef)((e,s)=>{const[a,t]=(0,ne.CQ)({agreed:!1,reject:null,resolve:null,show:!1,title:"",type:"challenge"}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"challenge";return new Promise((s,a)=>{t({agreed:!1,reject:a,resolve:s,show:!0,title:"",type:e})})},n=()=>t({show:!1});(0,l.useImperativeHandle)(s,()=>({promptNewTemplateTitle:i}));const{agreed:r,resolve:o,show:d,title:c,type:h}=a;return(0,N.jsxs)(xe,{onHide:n,show:d,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new {type}",id:"label.create_new_type.3cb91c7f",values:{type:h||"challenge"}})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:`Provide a title for the new ${h}`,description:"",id:"client.src.pages.admin.AdminChallengeTemplates.1337158537"})}),(0,N.jsx)(_e.A.Control,{onChange:e=>{t({title:e.target.value})},value:c}),(0,N.jsx)(Ce.S,{className:"mt-2 mb-2",children:(0,N.jsx)(_e.A.Check,{checked:r,id:"new-challenge-template-disclaimer",onClick:()=>t({agreed:!r}),readOnly:!0,label:(0,N.jsx)("p",{className:"mb-0",style:{maxWidth:"80%"},children:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have, or have obtained permission to use all content provided for this module.",description:"",id:"label.i_agree_that_i_have_or_have_obtain.3f819a39"})})})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:n,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",description:"",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:!c||!r,variant:"primary",onClick:()=>{t({show:!1}),o(c)},children:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",description:"",id:"label.save_changes.dd0ae7a5"})})]})]})});var DU=t.p+"static/media/ClosedLock.01d50f5e504b07de8f3a06b4fe3656f7.svg";var BU=e=>{var s,a;const t=(0,l.useRef)(),{api:i,getUserOrganizationMembership:n,userIsFacilitator:r,userIsModerator:o,userIsOrgAdmin:d}=(0,P.nm)(),[c,h]=(0,ne.CQ)({count:0,error:null,loading:!1});let u=null;(r()||o()||d())&&(u=n());(0,l.useEffect)(()=>{(async()=>{if(u)try{var e;h({count:0,loading:!0});const{count:s}=await i.get("/api/organizations/content/list/1/20",{organization_id:null===(e=u)||void 0===e?void 0:e.organization_id});h({count:s,loading:!1})}catch({err:err}){h({error:err,loading:null})}})()},[]);const{count:m,loading:g}=c;return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsx)(Ue.A,{children:(0,N.jsx)(Me.x_,{loading:g,children:(0,N.jsx)(Ce.S,{children:m>0||null===(s=u)||void 0===s||null===(a=s.organization)||void 0===a||!a.enable_content_filter?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-between",children:(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Content",id:"label.content.47bd2907"})})}),(0,N.jsx)(cd,{is_modal:!1,ref:t,show_assignment_wizard:!0}
2)]}):(0,N.jsx)(Ge.A,{body:!0,className:"justify-content-center align-items-center text-center",style:{backgroundColor:"rgba(213, 217, 220, 0.32)",border:"0px"},children:(0,N.jsxs)(Ce.S,{style:{width:"320px"},children:[(0,N.jsx)(Zs.A,{alt:"",src:DU}),",",(0,N.jsx)("h5",{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"No content available",id:"label.no_content_available.a7c49ff5"})}),(0,N.jsxs)("p",{children:[(0,N.jsx)(ke.A,{defaultMessage:"You don't have access to any content. If you think this is a mistake,",id:"label.you_dont_have_access_to_any_conten.1a002397"}),(0,N.jsx)(Le.Link,{to:"/support",children:(0,N.jsx)(ke.A,{defaultMessage:"let us know",id:"label.let_us_know.aaf7c9df"})})]})]})})})})})})})})};var PU=()=>{const{formatMessage:e}=(0,ja.A)(),{template:s}=sQ(),{api:a}=(0,P.nm)(),[t,i]=(0,l.useState)([]),[n,r]=(0,l.useState)(""),[o,d]=(0,l.useState)(!1),[c,h]=(0,l.useState)(null),u=(0,l.useRef)(null),m=(0,l.useCallback)(()=>{setTimeout(()=>{const e=u.current;e&&e.scrollTo({behavior:"smooth",top:e.scrollHeight})},100)},[]),g=async e=>{e.preventDefault();const l=n.trim();if(!l||o)return;const c={content:l,role:"user"},u=[...t,c];i(u),r(""),d(!0),h(null),m();try{const e=t.map(e=>({content:e.content,role:e.role})),n=await a.post(`/api/agent-templates/personas/test-chat/${null===s||void 0===s?void 0:s.id}`,{history:e,message:l});if(!1===(null===n||void 0===n?void 0:n.success))return h(n.message),d(!1),void m();const r={content:(null===n||void 0===n?void 0:n.response)||"",role:"assistant"};i(e=>[...e,r]),m()}catch(err){h((null===err||void 0===err?void 0:err.message)||"Failed to get response")}d(!1)},{avatar_path:p,base_prompt:x,category:v,name:f}=s||{},j=x&&x.trim().length>=20;return(0,N.jsx)(LU,{children:j?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("div",{className:"border rounded mb-3",ref:u,style:{background:"#f8f9fa",height:420,overflowY:"auto",padding:16},children:[0===t.length&&!o&&(0,N.jsx)(Ce.S,{className:"text-center text-muted",style:{paddingTop:140},children:(0,N.jsx)(ke.A,{defaultMessage:"Send a message to see how {name} responds",id:"label.send_a_message_to_see_how_name_res.4c2539da",values:{name:f||"this agent"}})}),t.map((e,s)=>(0,N.jsxs)(Ce.S,{className:"d-flex mb-3 "+("user"===e.role?"justify-content-end":"justify-content-start"),children:["assistant"===e.role&&(0,N.jsx)(Ce.S,{className:"me-2 flex-shrink-0",style:{marginTop:4},children:p?(0,N.jsx)(md,{alt:f,size:32,src:p}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{background:(null===v||void 0===v?void 0:v.color)||"#6c757d",borderRadius:"50%",color:"#fff",fontSize:14,height:32,width:32},children:(f||"?").charAt(0).toUpperCase()})}),(0,N.jsx)(Ce.S,{className:"rounded px-3 py-2",style:{background:"user"===e.role?"var(--primary)":"#fff",border:"assistant"===e.role?"1px solid #dee2e6":"none",color:"user"===e.role?"#fff":"inherit",maxWidth:"75%",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:e.content})]},s)),o&&(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-start mb-3",children:[(0,N.jsx)(Ce.S,{className:"me-2 flex-shrink-0",style:{marginTop:4},children:p?(0,N.jsx)(md,{alt:f,size:32,src:p}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{background:(null===v||void 0===v?void 0:v.color)||"#6c757d",borderRadius:"50%",color:"#fff",fontSize:14,height:32,width:32},children:(f||"?").charAt(0).toUpperCase()})}),(0,N.jsxs)(Ce.S,{className:"rounded px-3 py-2",style:{background:"#fff",border:"1px solid #dee2e6"},children:[(0,N.jsx)(qt.A,{animation:"border",className:"me-2",size:"sm"}),(0,N.jsx)(ke.A,{defaultMessage:"Thinking...",id:"label.thinking.b4739a4f"})]})]}),c&&(0,N.jsx)(Ce.S,{className:"text-danger text-center mb-2",children:c})]}),(0,N.jsx)(_e.A,{onSubmit:g,children:(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:o,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),g(e))},rows:1,style:{resize:"none"},value:n,placeholder:e({id:"label.type_a_message_to_test_the_agent.7732e537",defaultMessage:"Type a message to test the agent..."})}),(0,N.jsx)(ve.A,{disabled:o||!n.trim(),type:"submit",children:(0,N.jsx)(ze.Cer,{})}),t.length>0&&(0,N.jsx)(ve.A,{disabled:o,onClick:()=>{i([]),h(null)},variant:"outline-secondary",children:(0,N.jsx)(ze.qbC,{})})]})})]}):(0,N.jsx)(Ge.A,{body:!0,className:"text-center my-3",children:(0,N.jsx)("p",{className:"text-muted mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"You need to configure the system prompt (Step 4) before testing the agent.",id:"label.you_need_to_configure_the_system_p.a2bc5a2a"})})})})};var LU=e=>{const{children:s,floating:a}=e,{getCurrentStepDetails:t,isLastStep:i,step:l}=sQ(),n=t(),{required:r,title:o}=n||{},d=a?Ue.A:Ge.A;return(0,N.jsxs)(Ce.S,{className:`content-authoring-step step-${l} d-flex flex-column`,children:[(0,N.jsx)(d,{className:"content-authoring-step-card mb-3",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(Ge.A.Title,{as:"h4",children:!i()&&(0,N.jsxs)(N.Fragment,{children:[o,!r&&(0,N.jsx)("small",{className:"ms-2",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.o
2ptional.0059798b"})})]})}),(0,N.jsx)(VV,{})]}),s]})}),(0,N.jsx)(HV,{})]})};const OU=(0,l.createContext)({}),HU=OU.Provider;const UU=ul.Ik().shape({color:ul.Yj().nullable(),description:ul.Yj().nullable(),icon:ul.Yj().nullable(),name:ul.Yj().required("Name is required").min(2,"Name must be at least 2 characters"),role_description:ul.Yj().nullable()}),QU=e=>{let{initialValues:s,loading:a,onCancel:t,onSubmit:i,submitLabel:l}=e;const{formatMessage:n}=(0,ja.A)();return(0,N.jsx)(ds.l1,{enableReinitialize:!0,initialValues:s,onSubmit:i,validateOnChange:!0,validationSchema:UU,children:e=>{let{errors:s,handleChange:i,handleSubmit:r,touched:o,values:d}=e;return(0,N.jsxs)(_e.A,{onSubmit:r,children:[(0,N.jsxs)(_e.A.Group,{className:"mb-2",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===o||void 0===o?void 0:o.name)&&!(null===s||void 0===s||!s.name),name:"name",onChange:i,placeholder:n({id:"label.eg_creative_thinker.e73f2d0e",defaultMessage:"e.g., Creative Thinker"}),value:d.name}),(null===o||void 0===o?void 0:o.name)&&(null===s||void 0===s?void 0:s.name)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-2",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",name:"description",onChange:i,placeholder:n({id:"label.brief_description_of_this_category.9a8eeb83",defaultMessage:"Brief description of this category..."}),rows:2,value:d.description||""})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-2",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Role description",id:"label.role_description.c74aafef"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",name:"role_description",onChange:i,placeholder:n({id:"label.how_agents_in_this_category_behave.461ed755",defaultMessage:"How agents in this category behave..."}),rows:2,value:d.role_description||""})]}),(0,N.jsxs)("div",{className:"d-flex gap-3",children:[(0,N.jsxs)(_e.A.Group,{className:"flex-1",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Icon",id:"label.icon.a35abcd6"})}),(0,N.jsx)(_e.A.Control,{name:"icon",onChange:i,placeholder:n({id:"label.eg_lightbulb.4850e889",defaultMessage:"e.g., lightbulb"}),value:d.icon||""})]}),(0,N.jsxs)(_e.A.Group,{className:"flex-1",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Color",id:"label.color.6b73191a"})}),(0,N.jsxs)("div",{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(_e.A.Control,{name:"color",onChange:i,placeholder:n({id:"label.3b82f6.d6ba234f",defaultMessage:"#3B82F6"}),value:d.color||""}),d.color&&(0,N.jsx)("span",{style:{backgroundColor:d.color,border:"1px solid #dee2e6",borderRadius:4,display:"inline-block",height:32,minWidth:32,width:32}})]})]})]}),(0,N.jsxs)("div",{className:"d-flex gap-2 mt-3",children:[(0,N.jsx)(Me.p0,{loading:a,size:"sm",type:"submit",children:l}),(0,N.jsx)(ve.A,{onClick:t,size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})})]})]})}})},VU=e=>{let{cat:s}=e;return(0,N.jsxs)("div",{className:"mb-3",children:[s.description&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Description:",id:"label.description.0cf28146"})}),s.description]}),s.role_description&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Role:",id:"message.role.64685"})}),s.role_description]}),s.icon&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Icon:",id:"label.icon.4fd953a2"})}),s.icon]}),s.color&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Color:",id:"label.color.fcaed915"})}),(0,N.jsxs)("span",{className:"d-inline-flex align-items-center gap-1",children:[(0,N.jsx)("span",{style:{backgroundColor:s.color,borderRadius:3,dis
2play:"inline-block",height:14,width:14}}),s.color]})]}),Array.isArray(s.contribution_lens)&&s.contribution_lens.length>0&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Contribution Lens:",id:"label.contribution_lens.ac80954e"})}),s.contribution_lens.join(", ")]}),Array.isArray(s.response_patterns)&&s.response_patterns.length>0&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Response Patterns:",id:"label.response_patterns.d8dded92"})}),s.response_patterns.join(", ")]}),Array.isArray(s.skills_developed)&&s.skills_developed.length>0&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Skills Developed:",id:"label.skills_developed.077a9970"})}),s.skills_developed.join(", ")]}),Array.isArray(s.collaboration_dynamics)&&s.collaboration_dynamics.length>0&&(0,N.jsxs)("div",{className:"mb-1",children:[(0,N.jsx)("span",{className:"fw-bold me-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Collaboration Dynamics:",id:"label.collaboration_dynamics.c931f5c9"})}),s.collaboration_dynamics.join(", ")]})]})},GU=(0,l.forwardRef)((s,a)=>{const{onUpdate:t}=s,{api:i}=(0,P.nm)(),[n,r,o]=(0,ne.CQ)({categories:[],creating:!1,deleting_id:null,editing_id:null,error:null,loading:!1,saving_id:null,show:!1,show_create:!1}),d=async()=>{try{r({loading:!0});const{categories:e}=await i.get("/api/agent-templates/categories/list");r({categories:e||[],loading:!1})}catch(e){r({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,loading:!1})}},c=async()=>{r({show:!0}),await d()},h=()=>{o()},u=()=>{r({editing_id:null})},m=async s=>{try{r({error:null,saving_id:n.editing_id});const e=s.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");await i.post(`/api/agent-templates/categories/save/${n.editing_id}`,{color:s.color||null,description:s.description||null,icon:s.icon||null,name:s.name,role_description:s.role_description||null,slug:e}),await d(),r({editing_id:null,saving_id:null}),"function"===typeof t&&t()}catch(e){r({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,saving_id:null})}},g=()=>r({editing_id:null,error:null,show_create:!n.show_create});(0,l.useImperativeHandle)(a,()=>({hide:h,show:c}));const{categories:p,creating:x,deleting_id:v,editing_id:f,error:j,loading:_,saving_id:b,show:A,show_create:y}=n;return(0,N.jsxs)(xe,{backdrop:"static",onHide:h,show:A,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Manage agent categories",id:"label.manage_agent_categories.309353e4"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:!!j,variant:"danger",children:j}),_?(0,N.jsx)("p",{className:"text-muted text-center py-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Loading categories...",id:"label.loading_categories.d3cf16ec"})}):0===p.length?(0,N.jsx)("p",{className:"text-muted text-center py-4",children:(0,N.jsx)(ke.A,{defaultMessage:"No categories found.",id:"label.no_categories_found.2ed9c371"})}):(0,N.jsx)(Gd.A,{children:p.map(s=>{var a,l,n;const o=null!==(a=null!==(l=s.persona_count)&&void 0!==l?l:null===(n=s.dataValues)||void 0===n?void 0:n.persona_count)&&void 0!==a?a:0,c=0===Number(o),h=f===s.id;return(0,N.jsxs)(Gd.A.Item,{eventKey:String(s.id),children:[(0,N.jsx)(Gd.A.Header,{children:(0,N.jsxs)("span",{className:"d-flex align-items-center gap-2 flex-1 me-2",children:[(0,N.jsx)("span",{children:s.name}),(0,N.jsxs)(bo.A,{pill:!0,bg:c?"secondary":"primary",children:[o," ",1===Number(o)?"agent":"agents"]})]})}),(0,N.jsx)(Gd.A.Body,{children:h?(0,N.jsx)(QU,{loading:b===s.id,onCancel:u,onSubmit:m,submitLabel:(0,N.jsx)(ke.A,{defaultMessage:"Save changes",id:"label.save_changes.dd0ae7a5"}),initialValues:{color:s.color||"",description:s.description||"",icon:s.icon||"",name:s.name||"",role_description:s.role_description||""}}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(VU,{cat:s}),(0,N.jsxs)("div",{className:"d-flex gap-2",children:[(0,N.jsxs)(ve.A,{onClick:()=>{return e=s.id,void r({editing_id:e,error:null,show_create:!1});var e},size:"sm",variant:"outline-primary",children:[(0,N.jsx)(ze.F7,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(Me.p0,{disabled:!c||null!==v,loading:v===s.id,onClick:()=>(async s=>{const a=p.find(e=>e.id===s);if(window.confirm(`Are you sure you want to delete "${(null===a||void 0===a?void 0:a.name)||"this category"}"? This action cannot be undone.`))try{r({deleting_id:s,error:null}),await i.post(`/api/agent-templates/categories/delete/${s}`),await d(),r({deleting_id:null,editing_id:null}),"function"===typeof t&&t()}catch(e){r({deleting_id:null,error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e})}})(s.id),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.qbC,{className:"me-1"}),c?(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"}):(0,N.jsx)(ke.A,{defaultMessage:"In use \u2014 cannot delete",id:"label.in_use_cannot_delete.ac5a2c98"})]})]})]})})]},s.id)})}),y&&(0,N.jsxs)("div",{className:"border rounded p-3 mt-3",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"New category",id:"label.new_category.1ab1e121"})}),(0,N.jsx)(QU,{initialValues:{color:"",description:"",icon:"",name:"",role_description:""},loading:x,onCancel:g,onSubmit:async s=>{try{r({creating:!0,error:null});const e=s.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");await i.post("/api/agent-templates/categories/create",{color:s.color||null,description:s.description||null,icon:s.icon||null,
2name:s.name,role_description:s.role_description||null,slug:e}),await d(),r({creating:!1,show_create:!1}),"function"===typeof t&&t()}catch(e){r({creating:!1,error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e})}},submitLabel:(0,N.jsx)(ke.A,{defaultMessage:"Create",id:"label.create.4759498a"})})]})]}),(0,N.jsxs)(xe.Footer,{children:[!y&&(0,N.jsxs)(ve.A,{className:"me-auto",onClick:g,variant:"outline-primary",children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"New category",id:"label.new_category.1ab1e121"})]}),(0,N.jsx)(ve.A,{onClick:h,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})})]})]})});GU.displayName="ManageCategoriesModal";var WU=GU;var KU=()=>{const{formatMessage:e}=(0,ja.A)(),{getStepValidator:s,handleChangeTemplateData:a,setError:t,setStatus:i,startEditingTimer:n,template:r,updateTemplate:o}=sQ(),{categories:d,fetchCategories:c}=(0,l.useContext)(OU),{api:h}=(0,P.nm)(),u=(0,l.useRef)(),{agent_category_id:m,avatar_path:g,name:p}=r||{},[x,v]=(0,ne.CQ)({formik_key:(0,me.A)()}),f=(0,l.useRef)(),j=(0,l.useRef)(),_=async()=>{const e=null===j||void 0===j?void 0:j.current;if(e)return(0,T.isEmpty)(await e.validateForm())},b=async e=>{const s=null===j||void 0===j?void 0:j.current;s&&(await s.handleChange(e),setTimeout(()=>n(_,s.handleSubmit)))},A=async()=>{const e=null===j||void 0===j?void 0:j.current,s=null===f||void 0===f?void 0:f.current;if(s&&e)try{const a=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;e.setFieldValue("avatar_path",null===a||void 0===a?void 0:a.location),e.setFieldTouched("avatar_path",!0),setTimeout(()=>n(_,e.handleSubmit,!0))}catch(a){i("error"),t((null===a||void 0===a?void 0:a.err)||(null===a||void 0===a?void 0:a.message)||a)}},y={agent_category_id:m||"",avatar_path:g||"",name:p||""},{formik_key:w}=x;return(0,N.jsxs)(LU,{description:e({id:"label.set_the_basic_identity_for_this_ag.bc8f454c",defaultMessage:"Set the basic identity for this agent persona."}),title:e({id:"label.identity.999f23fc",defaultMessage:"Identity"}),children:[(0,N.jsx)(ds.l1,{initialValues:y,onSubmit:async e=>{await a(e),await o(),v({formik_key:(0,me.A)()})},validateOnChange:!0,validationSchema:s(),children:s=>{j.current=s;const{errors:a,handleSubmit:t,touched:i,values:l}=s;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===i||void 0===i?void 0:i.name)&&!(null===a||void 0===a||!a.name),name:"name",onChange:b,placeholder:e({id:"label.eg_professor_oak.b4754564",defaultMessage:"e.g., Professor Oak"}),value:l.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("p",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Category",id:"label.category.292c06f0"})}),(0,N.jsxs)(_e.A.Select,{isInvalid:(null===i||void 0===i?void 0:i.agent_category_id)&&!(null===a||void 0===a||!a.agent_category_id),name:"agent_category_id",onChange:b,value:l.agent_category_id,children:[(0,N.jsx)("option",{value:"",children:e({id:"label.select_a_category.f51ae1a4",defaultMessage:"Select a category..."})}),d.map(e=>(0,N.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,N.jsx)(ds.Kw,{name:"agent_category_id",children:e=>(0,N.jsx)("p",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(ve.A,{className:"p-0 mt-1",onClick:()=>{var e;return null===(e=u.current)||void 0===e?void 0:e.show()},size:"sm",variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Manage categories",id:"label.manage_categories.49cf9ec6"})})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Avatar",id:"label.avatar.ca8e826d"})}),(0,N.jsx)(ds.D0,{name:"avatar_path",children:()=>(0,N.jsx)(N.Fragment,{children:null!==l&&void 0!==l&&l.avatar_path?(0,N.jsx)(Ce.S,{className:"my-3",children:(0,N.jsx)(md,{alt:"Agent persona avatar",size:90,src:null===l||void 0===l?void 0:l.avatar_path,suspenseful:!0})}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ya,{user:null})})})}),(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG, JPEG, or PNG file",id:"label.please_use_a_500_x_500_jpg_jpeg_or.8eb6e457"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:A,children:[(0,N.jsx)(ze.BzO,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})]}),(0,N.jsx)(ds.Kw,{name:"avatar_path",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]})]})}},w),(0,N.jsx)(TA,{aspectRatio:1,ref:f,uploadHandler:async(e,s)=>h.file("/api/agent-templates/personas/upload/avatar",{job_id:s,persona_id:null===r||void 0===r?void 0:r.id},e,"avatar.jpg")}),(0,N.jsx)(WU,{onUpdate:c,ref:u})]})};var YU={0:KU,1:()=>{var e,s,a,t,i,n,r,o;const{formatMessage:d}=(0,ja.A)(),{handleChangeTemplateData:c,startEditingTimer:h,template:u,updateTemplate:m}=sQ(),{personality:g,style:p}=u||{},x=(0,l.useMemo)(()=>Array.isArray(g)?g.join(", "):g||"",[g]),v=(0,ds.Wx)({enableReinitialize:!0,initialValues:{personality_text:x,style:p||""},onSubmit:async e=>{const s=e.personality_text.split(",").map(e=>e.trim()).filter(e=>e.length>0);await c({personality:s,style:e.style}),await m()},validate:e=>{const s={};e.style&&0!==e.style.trim().length?e.style.trim().length<10&&(s.style=d({id:"label.communication_style_must_be_at_lea.0e2c1d57",defaultMessage:"Communication style must be at least 10 characters"})):s.style=d({id:"label.communication_style_is_required.7af3ed26",defaultMessage:"Communication style is required"});return(e.personality_text||"").split(",").map(e=>e.trim()).filter(e=>e.length>0).length||(s.personality_text=d({id:"label.at_least_one_personality_trait_is.8a7d97d4",defaultMessage:"At least one personality trait is required"})),s},validateOnChange:!0}),f=async()=>(0,T.isEmpty)(await v.validateForm()),j=async e=>{await v.handleChange(e),await v.setFieldTouched(e.target.name,!0),h(f,v.handleSubmit)};return(0,N.jsxs)(LU,{description:d({id:"label.define_how_this_agent_persona_comm.afa89659",defaultMessage:"Define how this agent persona communicates and their personality traits."}),title:d({id:"label.communication_style.21479fe5",defaultMessage:"Communication style"}),children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Communication style",id:"label.communication_style.21479fe5"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:(null===(e=v.touched)||void 0===e?void 0:e.style)&&!(null===(s=v.errors)||void 0===s||!s.style),name:"style",onChange:j,placeholder:d({id:"label.describe_how_this_persona_communic.f606d097",defaultMessage:'Describe how this persona communicates. E.g., "Warm and encouraging, uses analogies frequently, asks reflective questions..."'}),rows:4,value:v.values.style}),(null===(a=v.touched)||void 0===a?void 0:a.style)&&(null===(t=v.errors)||void 0===t?void 0:t.style)&&(0,N.jsx)("p",{className:"text-danger mt-1",children:v.errors.style})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Personality traits",id:"label.personality_traits.1b9c5f83"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:(null===(i=v.touched)||void 0===i?void 0:i.personality_text)&&!(null===(n=v.errors)||void 0===n||!n.personality_text),name:"personality_text",onCh
2ange:j,placeholder:d({id:"label.enter_traits_separated_by_commas_e.8fdd803b",defaultMessage:"Enter traits separated by commas. E.g., empathetic, analytical, patient, curious"}),rows:2,value:v.values.personality_text}),null!==(r=v.touched)&&void 0!==r&&r.personality_text&&null!==(o=v.errors)&&void 0!==o&&o.personality_text?(0,N.jsx)("p",{className:"text-danger mt-1",children:v.errors.personality_text}):(0,N.jsx)(_e.A.Text,{className:"text-muted",children:d({id:"label.separate_traits_with_commas.1b52ea6a",defaultMessage:"Separate traits with commas"})})]})]})},2:()=>{const{formatMessage:e}=(0,ja.A)(),{getStepValidator:s,handleChangeTemplateData:a,startEditingTimer:t,template:i,updateTemplate:n}=sQ(),{limitations:r,strengths:o}=i||{},d=(0,l.useMemo)(()=>Array.isArray(o)?o.join(", "):o||"",[o]),c=(0,l.useMemo)(()=>Array.isArray(r)?r.join(", "):r||"",[r]),h=(0,ds.Wx)({enableReinitialize:!0,initialValues:{limitations_text:c,strengths_text:d},onSubmit:async e=>{await a({limitations:e.limitations_text.split(",").map(e=>e.trim()).filter(e=>e.length>0),strengths:e.strengths_text.split(",").map(e=>e.trim()).filter(e=>e.length>0)}),await n()},validateOnChange:!0,validationSchema:s()}),u=async()=>(0,T.isEmpty)(await h.validateForm()),m=async e=>{await h.handleChange(e),await h.setFieldTouched(e.target.name,!0),t(u,h.handleSubmit)};return(0,N.jsxs)(LU,{description:e({id:"label.define_what_this_persona_excels_at.a25a2da0",defaultMessage:"Define what this persona excels at and where it has boundaries."}),title:e({id:"label.strengths_and_limitations.3757b64f",defaultMessage:"Strengths & Limitations"}),children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:e({id:"label.strengths.b11d27f8",defaultMessage:"Strengths"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",name:"strengths_text",onChange:m,placeholder:e({id:"label.enter_strengths_separated_by_comma.13080299",defaultMessage:"Enter strengths separated by commas. E.g., critical thinking guidance, asking probing questions, providing structured feedback"}),rows:3,value:h.values.strengths_text}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:e({id:"label.separate_strengths_with_commas.f615d1d9",defaultMessage:"Separate strengths with commas"})})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:e({id:"label.limitations.69b1b67d",defaultMessage:"Limitations"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",name:"limitations_text",onChange:m,placeholder:e({id:"label.enter_limitations_separated_by_com.b6649bbe",defaultMessage:"Enter limitations separated by commas. E.g., avoids giving direct answers, does not provide code solutions"}),rows:3,value:h.values.limitations_text}),(0,N.jsx)(_e.A.Text,{className:"text-muted",children:e({id:"label.separate_limitations_with_commas.ac70fbd9",defaultMessage:"Separate limitations with commas"})})]})]})},3:()=>{const{formatMessage:e}=(0,ja.A)(),{handleChangeTemplateData:s,startEditingTimer:a,template:t,updateTemplate:i}=sQ(),l=null===t||void 0===t?void 0:t.example_responses,n=Array.isArray(l)?l:l&&"object"===typeof l?Object.entries(l).map(e=>{let[s,a]=e;return"string"===typeof a?{prompt:s,response:a}:a}):[],r=async e=>{await s({example_responses:e}),a(()=>!0,async()=>{await i()})},o=(e,s,a)=>{const t=n.map((t,i)=>i===e?(0,F.A)((0,F.A)({},t),{},{[s]:a}):t);r(t)};return(0,N.jsxs)(LU,{description:e({id:"label.provide_example_prompt_response_pa.092be497",defaultMessage:"Provide example prompt-response pairs that demonstrate this persona's communication style."}),title:e({id:"label.example_responses.58505286",defaultMessage:"Example responses"}),children:[n.map((s,a)=>(0,N.jsx)(Ge.A,{className:"mb-3",children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsxs)("div",{className:"d-flex justify-content-between align-items-center mb-2",children:[(0,N.jsx)("strong",{children:e({id:"label.example_number.c3b050c7",defaultMessage:"Example {number}"},{number:a+1})}),(0,N.jsx)(ve.A,{onClick:()=>(e=>{const s=n.filter((s,a)=>a!==e);r(s)})(a),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ze.qbC,{})})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-2",children:[(0,N.jsx)(_e.A.Label,{children:e({id:"label.learner_prompt.e256f68c",defaultMessage:"Learner prompt"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>o(a,"prompt",e.target.value),placeholder:e({id:"label.what_might_a_learner_say_or_ask.8db39af1",defaultMessage:"What might a learner say or ask?"}),rows:2,value:s.prompt||""})]}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:e({id:"label.agent_response.45dd9668",defaultMessage:"Agent response"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>o(a,"response",e.target.value),placeholder:e({id:"label.how_should_this_persona_respond.6fd70d2f",defaultMessage:"How should this persona respond?"}),rows:3,value:s.response||""})]})]})},a)),(0,N.jsxs)(ve.A,{onClick:()=>{const e=[...n,{prompt:"",response:""}];r(e)},variant:"outline-primary",children:[(0,N.jsx)(ze.OiG,{className:"me-2"}),e({id:"label.add_example.6556689e",defaultMessage:"Add example"})]})]})},4:()=>{var e,s,a,t;const{formatMessage:i}=(0,ja.A)(),{handleChangeTemplateData:l,startEditingTimer:n,template:r,updateTemplate:o}=sQ(),{base_prompt:d,response_guidelines:c}=r||{},h=(0,ds.Wx)({enableReinitialize:!0,initialValues:{base_prompt:d||"",format:(null===c||void 0===c?void 0:c.format)||"",length:(null===c||void 0===c?void 0:c.length)||"",tone:(null===c||void 0===c?void 0:c.tone)||""},onSubmit:async e=>{await l({base_prompt:e.base_prompt,response_guidelines:{format:e.format,length:e.length,tone:e.tone}}),await o()},validate:e=>{const s={};return e.base_prompt&&0!==e.base_prompt.trim().length?e.base_prompt.trim().length<20&&(s.base_prompt=i({id:"label.system_prompt_must_be_at_least_20.f824ef89",defaultMessage:"System prompt must be at least 20 characters"})):s.base_prompt=i({id:"label.system_prompt_is_required.fbdca597",defaultMessage:"System prompt is required"}),s},validateOnChange:!0}),u=async()=>(0,T.isEmpty)(await h.validateForm()),m=async e=>{await h.handleChange(e),await h.setFieldTouched(e.target.name,!0),n(u,h.handleSubmit)};return(0,N.jsxs)(LU,{description:i({id:"label.configure_the_base_system_prompt_a.ed163d09",defaultMessage:"Configure the base system prompt and response guidelines that define this persona's behavior."}),title:i({id:"label.system_prompt.561257c0",defaultMessage:"System prompt"}),children:[(0,N.jsxs)(_e.A.Group,{className:"mb-4",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Base system prompt",id:"label.base_system_prompt.93828fb7"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:(null===(e=h.touched)||void 0===e?void 0:e.base_prompt)&&!(null===(s=h.errors)||void 0===s||!s.base_prompt),name:"base_prompt",onCh
2ange:m,placeholder:i({id:"label.enter_the_system_prompt_that_defin.78035fd1",defaultMessage:"Enter the system prompt that defines this persona's core behavior and instructions..."}),rows:12,style:{fontFamily:"monospace",fontSize:"0.875rem"},value:h.values.base_prompt}),null!==(a=h.touched)&&void 0!==a&&a.base_prompt&&null!==(t=h.errors)&&void 0!==t&&t.base_prompt?(0,N.jsx)("p",{className:"text-danger mt-1",children:h.errors.base_prompt}):(0,N.jsx)(_e.A.Text,{className:"text-muted",children:i({id:"label.this_prompt_is_sent_as_the_system.d2c42643",defaultMessage:"This prompt is sent as the system message when the agent responds. It defines the persona's core identity and behavior."})})]}),(0,N.jsx)("h6",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Response guidelines",id:"label.response_guidelines.c5ee3994"})}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Tone",id:"label.tone.c2c8b72e"})}),(0,N.jsx)(_e.A.Control,{name:"tone",onChange:m,placeholder:i({id:"label.eg_supportive_and_encouraging_but.e61a699a",defaultMessage:"e.g., Supportive and encouraging, but direct"}),value:h.values.tone})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Response length",id:"label.response_length.df735ebe"})}),(0,N.jsx)(_e.A.Control,{name:"length",onChange:m,placeholder:i({id:"label.eg_2_4_sentences_concise_and_focus.4eeb13bd",defaultMessage:"e.g., 2-4 sentences, concise and focused"}),value:h.values.length})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Response format",id:"label.response_format.052b8391"})}),(0,N.jsx)(_e.A.Control,{name:"format",onChange:m,placeholder:i({id:"label.eg_use_questions_to_guide_thinking.ef0daf48",defaultMessage:"e.g., Use questions to guide thinking, avoid bullet points"}),value:h.values.format})]})]})},5:PU,6:()=>{const[e,s]=(0,l.useState)(!1),{publishTemplate:a,template:t,template_valid:i}=sQ(),{avatar_path:n,category:r,limitations:o,name:d,personality:c,published:h,strengths:u,style:m,updated_at:g,version_title:p}=t||{};return(0,N.jsxs)(LU,{floating:!0,children:[h?(0,N.jsxs)(Ge.A,{body:!0,className:"my-4",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your agent persona is published!",id:"label.your_agent_persona_is_published.887d202f"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This agent persona is now available for assignment to challenges and learning experiences.",id:"label.this_agent_persona_is_now_availabl.c101e88b"})})]}):(0,N.jsx)(N.Fragment,{children:i?(0,N.jsxs)(Ge.A,{body:!0,className:"my-3",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your agent persona is ready to publish!",id:"label.your_agent_persona_is_ready_to_pub.d22e07c8"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Review the details below and publish when you're ready.",id:"label.review_the_details_below_and_publi.63417498"})}),(0,N.jsxs)(Me.p0,{loading:e,onClick:async()=>{s(!0),await a(),s(!1)},children:[(0,N.jsx)("span",{style:{marginRight:10},children:(0,N.jsx)(ze.uoG,{})}),(0,N.jsx)(ke.A,{defaultMessage:"Publish agent persona",id:"label.publish_agent_persona.41cee36c"})]})]}):(0,N.jsx)(We.A,{className:"text-center mt-3",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"One or more steps are incomplete",id:"label.one_or_more_steps_are_incomplete.7c47aa76"})})}),(0,N.jsxs)(Qe.A,{className:"d-flex justify-content-space-between align-items-start gap-4 m-0",children:[(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Persona preview",id:"label.persona_preview.d1268646"})}),(0,N.jsxs)(Ce.S,{className:"text-center py-3",children:[n?(0,N.jsx)(md,{alt:"Agent persona avatar",size:90,src:n,suspenseful:!0}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center mb-3",style:{background:(null===r||void 0===r?void 0:r.color)||"#6c757d",borderRadius:"50%",color:"#fff",fontSize:36,height:90,margin:"0 auto",width:90},children:(d||"?").charAt(0).toUpperCase()}),(0,N.jsx)("h5",{className:"mt-3",children:d||"-"}),(null===r||void 0===r?void 0:r.name)&&(0,N.jsx)("p",{className:"text-muted",children:r.name}),m&&(0,N.jsxs)("p",{className:"text-muted small",children:[m.substring(0,150),m.length>150?"...":""]})]})]})}),(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Persona details",id:"label.persona_details.00154fe4"})}),(0,N.jsx)(qa.A,{borderless:!0,size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",style:{width:160}
2,children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)("td",{children:p||"1"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)("td",{children:(0,N.jsx)(Gh.XU,{value:g})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Category",id:"label.category.292c06f0"})}),(0,N.jsx)("td",{children:(null===r||void 0===r?void 0:r.name)||"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Personality",id:"label.personality.95a29562"})}),(0,N.jsx)("td",{children:Array.isArray(c)&&c.length>0?c.join(", "):"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Strengths",id:"label.strengths.b11d27f8"})}),(0,N.jsx)("td",{children:Array.isArray(u)&&u.length>0?u.join(", "):"-"})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Limitations",id:"label.limitations.69b1b67d"})}),(0,N.jsx)("td",{children:Array.isArray(o)&&o.length>0?o.join(", "):"-"})]})]})})]})})]})]})}};class qU{constructor(){this.registerCallback=e=>this.callback=e,this.start=e=>this.timerId=setTimeout(this.callback,e),this.cancel=()=>{clearTimeout(this.timerId),this.timerId=null,this.callback=null},this.forceTrigger=async()=>{"function"===typeof this.callback&&this.callback(),this.cancel()},this.timerId=null,this.callback=null}}class JU extends l.Component{constructor(s){var a,t,i,n,r,o,d,c;super(s),this.fetchTemplateDetails=async()=>{var e;const s=null===this||void 0===this||null===(e=this.editor)||void 0===e?void 0:e.current;if(!s)return this.setStatus("error");try{const e=await s.fetchTemplate();return this.setState({prev_template:e,template:e},this.checkTemplateValidity),e}catch({err:err}){return w(err),this.setState({error:err})}},this.updateTemplate=async()=>{var s;const{step:a}=this.state,t=null===this||void 0===this||null===(s=this.editor)||void 0===s?void 0:s.current;if(!t)return this.setStatus("error");try{const e=this.getTemplateValidationFields(a);await t.saveTemplate(e),this.setTimedStatus("saved",2500)}catch(e){return w((null===e||void 0===e?void 0:e.err)||e),this.setState({error:(null===e||void 0===e?void 0:e.err)||e,status:"error"})}},this.fetchStubDetails=async()=>{try{const{app:e}=this.props}catch({err:err}){this.setState({error:err})}},this.fetchDetails=()=>{this.setState({loading:!0}),Promise.all([this.fetchTemplateDetails(),this.fetchStubDetails()]).finally(()=>this.setState({loading:!1}))},this.startEditingTimer=async(e,s,a)=>{this.editing_timer.cancel(),this.setStatus("editing");const t=async()=>{await e()?await s():this.setStatus("incomplete")};if(a)return await t();this.editing_timer.registerCallback(t),this.editing_timer.start(this.THROTTLE_DURATION)},this.publishTemplate=async()=>{try{var s;const{intl:e}=this.props,{formatMessage:a}=e,t=null===this||void 0===this||null===(s=this.editor)||void 0===s?void 0:s.current;this.setStatus("saving");if(!await this.isTemplateValid())throw a({id:"label.unable_to_publish_template_one_or.fc5de42c",defaultMessage:"Unable to publish template, one or more steps are incomplete"});await t.publishTemplate(),this.setTimedStatus("saved",2500)}catch(e){return w((null===e||void 0===e?void 0:e.err)||e),this.setStatus("error"),this.setState({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,status:"error"})}},this.setError=e=>this.setState({error:e}),this.clearError=()=>{const{status:e}=this.state;"error"===e&&this.clearStatus(),this.setError(null)},this.getStepsCount=()=>{const e=this.getEditorSections(),s=(0,T.flatten)(null!==e&&void 0!==e&&e.length?e.map(e=>e.steps):[]);return(null===s||void 0===s?void 0:s.length)||0},this.getEditorSections=()=>{var e,s;return(null===this||void 0===this||null===(e=this.sections)||void 0===e||null===(s=e.current)||void 0===s?void 0:s.sections)||[]}
2,this.getCurrentSectionDetails=()=>{const{step:e}=this.state;return(this.getEditorSections()||[]).find(s=>!!s.steps.find(s=>(null===s||void 0===s?void 0:s.id)===e))},this.getCurrentStepDetails=()=>{const{step:e}=this.state,s=this.getEditorSections();return(0,T.flatten)(null!==s&&void 0!==s&&s.length?s.map(e=>e.steps):[]).find(s=>(null===s||void 0===s?void 0:s.id)===e)},this.getStepHints=()=>{var e;const{step:s,type:a}=this.state,t=this.hints.current;return(null===t||void 0===t||null===(e=t[a])||void 0===e?void 0:e[s])||{}},this.handleChangeTemplateData=e=>new Promise(s=>{var a;const t=(null===this||void 0===this||null===(a=this.state)||void 0===a?void 0:a.template)||{};this.setState({template:(0,F.A)((0,F.A)({},t),e)},s)}),this.setStatus=e=>this.setState({status:e}),this.setLoading=e=>this.setState({loading:e}),this.clearStatus=()=>this.setStatus(""),this.setTimedStatus=(e,s)=>{clearTimeout(this.timed_status),this.timed_status=null,this.setStatus(e),this.timed_status=setTimeout(this.clearStatus,s)},this.getStepComponents=()=>{const{type:e}=this.state;switch(e){case"agent":return YU;case"challenge":return GG;case"cartridge":return pW;case"journey":return[]}},this.hasPrevStep=()=>!this.isFirstStep(),this.hasNextStep=()=>{const{step:e}=this.state;return e+1<this.getStepsCount()},this.isFirstStep=()=>0===this.state.step,this.isLastStep=()=>{const{step:e}=this.state;return e===this.getStepsCount()-1},this.checkTemplateValidity=async()=>this.setState({template_valid:await this.isTemplateValid()}),this.isTemplateValid=async()=>{try{const{app:e}=this.props,{locale:s}=e,{template:a,type:t}=this.state,i=(0,Re.by)({locale:s,scope:`content_authoring.${t}_editor.full_template`});return await i.validate(a),!0}catch(e){return!1}},this.getStepValidator=e=>{const{step:s,type:a}=this.state,{app:t}=this.props,{locale:i}=t;return e=isNaN(Number.parseInt(e))?s:e,(0,Re.by)({locale:i,scope:`content_authoring.${a}_editor.step_${e}`})},this.getTemplateValidationFields=e=>{const{template:s}=this.state,a={};if(s){const t=this.getStepValidator(e),i=(null===t||void 0===t?void 0:t._nodes)||[];for(const e of i)a[e]=null===s||void 0===s?void 0:s[e]}return a},this.isStepValid=s=>{const a=this.getStepValidator(s),t=this.getTemplateValidationFields(s);if(!a)return!0;try{return a.validateSync(t),!0}catch(e){return!1}},this.getStepValidationError=s=>{const a=this.getStepValidator(s),t=this.getTemplateValidationFields(s);if(!a)return!1;try{return a.validateSync(t),null}catch(e){return(null===e||void 0===e?void 0:e.message)||e}},this.isSectionValid=e=>{var s;const a=this.getEditorSections(),t=null===a||void 0===a?void 0:a[e];if(!t||null===t||void 0===t||null===(s=t.steps)||void 0===s||!s.length)return!1;for(const i of t.steps)if(!this.isStepValid(null===i||void 0===i?void 0:i.id))return!1;return!0},this.launchIncompletionConfirmation=async e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{formatMessage:i}=t;await a.show({actions:[a.CancelAction(),a.Action({label:i({id:"label.continue.31fbef16",defaultMessage:"Continue"}),onClick:e,variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:i({id:"label.the_current_step_has_not_been_save.ff31c2f6",defaultMessage:"The current step has not been saved because one or more fields are incomplete. If you proceed, any unsaved changes made to this step will be lost."})}),(0,N.jsx)("p",{children:i({id:"label.are_you_sure_you_want_to_proceed.a87f8b96",defaultMessage:"Are you sure you want to proceed?"})})]}),title:i({id:"label.step_incomplete.8369d85e",defaultMessage:"Step incomplete"})})},this.launchErrorConfirmation=async e=>{var s;const a=null===this||void 0===this||null===(s=this.dialog)||void 0===s?void 0:s.current;if(!a)return;const{intl:t}=this.props,{formatMessage:i}=t;await a.show({actions:[a.CancelAction(),a.Action({label:i({id:"label.continue.31fbef16",defaultMessage:"Continue"}),onClick:()=>{e(),this.clearError()},variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:i({id:"label.an_error_occurred_while_saving_you.f3ddc2e7",defaultMessage:"An error occurred while saving your changes. If you proceed, any unsaved changes made to this step will be lost."})}),(0,N.jsx)("p",{children:i({id:"label.are_you_sure_you_want_to_proceed.a87f8b96",defaultMessage:"Are you sure you want to proceed?"})})]}),title:i({id:"label.unsaved_changes.a710c2b9",defaultMessage:"Unsaved changes"})})},this.triggerStatusOverlay=async()=>{const{sleep:e}=Re._$.time;this.setState({show_status_overlay:!0}),await this.editing_timer.forceTrigger();let s=this.getStatus();for(;["editing","saving"].includes(s);)await e(100),s=this.getStatus();return this.setState({show_status_overlay:!1}),s}
2,this.getRouteParams=()=>{var e,s;return(null===this||void 0===this||null===(e=this.props)||void 0===e||null===(s=e.match)||void 0===s?void 0:s.params)||{}},this.updateRouteParams=()=>{const e=this.getRouteParams(),s=(null===e||void 0===e?void 0:e.type)||null,a=Number.parseInt(null===e||void 0===e?void 0:e.stub_id)||null,t=Number.parseInt(null===e||void 0===e?void 0:e.template_id)||null,i=Number.parseInt(null===e||void 0===e?void 0:e.step)||0;this.setState({step:i,stub_id:a,template_id:t,type:s},this.fetchDetails)},this.goBack=()=>{const{history:e}=this.props,{stub_id:s,type:a}=this.state;e.push(`/admin/${a}-template/${s}`)},this.setStep=async e=>{if((0,T.isEqual)(e,this.state.step))return;const{status:s}=this.state,a=()=>{this.setState({status:"",step:e})};switch(s){case"incomplete":return this.launchIncompletionConfirmation(a);case"error":return this.launchErrorConfirmation(a);case"editing":case"saving":switch(await this.triggerStatusOverlay()){case"incomplete":return await this.launchIncompletionConfirmation(a);case"error":return await this.launchErrorConfirmation(a);default:return a()}default:this.editing_timer.cancel(),clearTimeout(this.timed_status),this.timed_status=null,a()}}
2,this.getStatus=()=>this.state.status,this.state={error:null,loading:!1,prev_template:null,show_status_overlay:!1,status:"",step:Number.parseInt(null===s||void 0===s||null===(a=s.match)||void 0===a||null===(t=a.params)||void 0===t?void 0:t.step)||0,stub:null,stub_id:Number.parseInt(null===s||void 0===s||null===(i=s.match)||void 0===i||null===(n=i.params)||void 0===n?void 0:n.stub_id)||null,template:null,template_id:Number.parseInt(null===s||void 0===s||null===(r=s.match)||void 0===r||null===(o=r.params)||void 0===o?void 0:o.template_id)||null,template_valid:!1,type:(null===s||void 0===s||null===(d=s.match)||void 0===d||null===(c=d.params)||void 0===c?void 0:c.type)||null},this.THROTTLE_DURATION=3e3,this.hints=(0,l.createRef)(),this.sections=(0,l.createRef)(),this.dialog=(0,l.createRef)(),this.editor=(0,l.createRef)(),this.editing_timer=new qU({repeat:!1}),this.timed_status=null}componentDidMount(){this._isMounted=!0;const e=this.getRouteParams();if(isNaN(Number.parseInt(null===e||void 0===e?void 0:e.step))){var s;const{history:e}=this.props;(null===e||void 0===e||null===(s=e.location)||void 0===s?void 0:s.pathname)&&e.push(`${e.location.pathname}/0`)}this.updateRouteParams(!0)}componentWillUnmount(){this._isMounted=!1}componentDidUpdate(e,s,a){var t;const i=e.match.params,l=this.getRouteParams(),n=!(0,T.isEqual)(null===i||void 0===i?void 0:i.stub_id,null===l||void 0===l?void 0:l.stub_id),r=!(0,T.isEqual)(null===i||void 0===i?void 0:i.template_id,null===l||void 0===l?void 0:l.template_id),o=!(0,T.isEqual)(null===i||void 0===i?void 0:i.step,null===l||void 0===l?void 0:l.step);(n||r)&&this.updateRouteParams(n||r),n||r||!o||this.setState({step:Number.parseInt(null===l||void 0===l?void 0:l.step)});const d=null===s||void 0===s?void 0:s.step,c=null===(t=this.state)||void 0===t?void 0:t.step,{history:h}=this.props,{stub_id:u,template_id:m,type:g}=this.state;(0,T.isEqual)(d,c)||h.push(`/admin/content-authoring/${g}/${u}/${m}/${c}`)}render(){var e,s,a;const{error:t,loading:i,prev_template:n,show_status_overlay:r,status:o,step:d,stub_id:c,template:h,template_id:u,template_valid:m,type:g}=this.state,p=(null===yV||void 0===yV?void 0:yV[g])||l.Fragment;return(0,N.jsx)(Ce.S,{className:"content-authoring-tool",children:(0,N.jsxs)($U,{value:{clearError:this.clearError,clearStatus:this.clearStatus,error:t,fetchTemplateDetails:this.fetchTemplateDetails,getCurrentSectionDetails:this.getCurrentSectionDetails,getCurrentStepDetails:this.getCurrentStepDetails,getEditorSections:this.getEditorSections,getStepComponents:this.getStepComponents,getStepHints:this.getStepHints,getStepValidationError:this.getStepValidationError,getStepValidator:this.getStepValidator,getTemplateValidationFields:this.getTemplateValidationFields,goBack:this.goBack,handleChangeTemplateData:this.handleChangeTemplateData,hasNextStep:this.hasNextStep,hasPrevStep:this.hasPrevStep,hints:(null===this||void 0===this||null===(e=this.hints)||void 0===e?void 0:e.current)||{},isFirstStep:this.isFirstStep,isLastStep:this.isLastStep,isSectionValid:this.isSectionValid,isStepValid:this.isStepValid,isTemplateValid:this.isTemplateValid,loading:i,prev_template:n,publishTemplate:this.publishTemplate,sections:(null===this||void 0===this||null===(s=this.sections)||void 0===s?void 0:s.current)||{},setError:this.setError,setLoading:this.setLoading,setStatus:this.setStatus,setStep:this.setStep,setTimedStatus:this.setTimedStatus,startEditingTimer:this.startEditingTimer,status:o,step:d,steps:null===(a=this.getStepComponents())||void 0===a?void 0:a.length,stub_id:c,template:h,template_id:u,template_valid:m,type:g,updateTemplate:this.updateTemplate},children:[(0,N.jsx)(_y,{defaultActiveKeyRight:"toggle",defaultRightOpen:!0,defualtLeftOpen:!0,hideRightButtonsWhenOpen:!0,leftContents:(0,N.jsx)(wV,{}),ref:this.sidebar_layout,rightContents:(0,N.jsx)(OV,{}),topnav:(0,N.jsx)(QV,{}),children:(0,N.jsxs)(Ce.S,{className:"content-authoring-tool-center d-flex flex-column",children:[(0,N.jsx)(UV,{}),(0,N.jsx)(We.A,{dismissible:!0,className:"m-2",onClose:this.clearError,show:t,variant:"danger",children:t}),(0,N.jsx)(p,{ref:this.editor}),(0,N.jsx)(pg,{})]})}),(0,N.jsx)(WV,{ref:this.hints}),(0,N.jsx)(KV,{ref:this.sections}),(0,N.jsx)(je,{ref:this.dialog}),(0,N.jsx)(YV,{show:r})]})})}}var XU=(0,Ke.Ay)((0,P.G0)(JU));const ZU=l.createContext({}),$U=ZU.Provider,eQ=ZU.Consumer,sQ=()=>(0,l.useContext)(ZU),aQ=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),{fetchTemplateDetails:i,step:n,stub_id:r,template:o,template_id:d}=sQ(),c=(null===LW||void 0===LW?void 0:LW[n])||l.Fragment,[h,u,m]=(0,ne.CQ)({custom_competencies:[],error:!1,global_competencies:[],loading:!1,organization_id:null,preview_template:""}),{custom_competencies:g,error:p,global_competencies:x,loading:v,organization_id:f,preview_template:j}=h,_=async()=>{try{var s;u({loading:!0});const{certification_template:e,preview_template:a}=await t.get(`/api/certification-templates/get/${d}`),i=(null===e||void 0===e||null===(s=e.stub)||void 0===s?void 0:s.organization_id)||null;return u({loading:!1,organization_id:i,preview_template:a}),i&&await b(i),e||{}}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}},b=async s=>{try{const{competencies:e}=await t.get("/api/certification-templates/custom-competencies",{organization_id:s});u({custom_competencies:e||[]})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a})}};(0,l.useEffect)(()=>{(async()=>{try{u({loading:!0});const{competencies:e}=await t.get("/api/certification-templates/global-competencies");u({global_competencies:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;u({error:a,loading:!1})}})()},[]);const A={custom_competencies:g,error:p,fetchTemplate:_,global_competencies:x,loading:v,organization_id:f,preview_template:j,publishTemplate:async()=>{await t.post(`/api/certification-templates/publish/${d}`),await i()},saveTemplate:async function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null===(e=Object.keys(s))||void 0===e||!e.length)return await _();await t.post(`/api/certification-templates/save/${r}/${d}`,s),await i()}};return(0,l.useImperativeHandle)(a,()=>A),(0,N.jsx)(lQ,{value:A,children:(0,N.jsx)(Ce.S,{className:"content-editor certification d-flex justify-content-center flex-1 py-5",children:(0,N.jsx)(Me.x_,{loading:(0,T.isEmpty)(o),children:(0,N.jsx)(c,{})})})})});aQ.displayName="CertificationEditor",aQ.defaultProps={};var tQ=aQ;const iQ=l.createContext({}),lQ=iQ.Provider,nQ=(iQ.Consumer,()=>(0,l.useContext)(iQ)),rQ=(0,l.forwardRef)((s,a)=>{var t;const[i,n,r]=(0,ne.CQ)({deliverable_challenges:[],error:!1,global_audience_categories:[],global_audiences:[],global_deliverable_categories:[],global_deliverable_configurations:[],global_standard_categories:[],global_standard_structures:[],global_subjects:[],global_subtopics:[],global_topics:[],loading:!1}),{api:o}=(0,P.nm)(),{fetchTemplateDetails:d,prev_template:c,step:h,stub_id:u,template:m,template_id:g}=sQ(),p=(0,l.useRef)(),x=async()=>{try{n({loading:!0});const{challenge_template:e}=await o.get(`/api/challenge-templates/challenge-template/${g}`);return n({loading:!1}),e||{}}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n({error:a,loading:!1})}},v=async()=>{try{const{audience_categories:e}=await o.get("/api/authoring/list/audience-categories");n({global_audience_categories:e})}catch({err:err}){n({error:err})}},f=async()=>{try{const{audiences:e}=await o.get("/api/authoring/list/audiences");n({global_audiences:e})}catch({err:err}){n({error:err})}},j=async()=>{try{const{deliverable_challenges:e}=await o.get(`/api/challenge-templates/deliverables/challenges/list/${g}`);n({deliverable_challenges:e})}catch({err:err}){n({error:err})}},_=async()=>{try{const{subjects:e}=await o.get("/api/authoring/list/subjects",{order_attr:"position",order_dir:"ASC"});n({global_subjects:e})}catch({err:err}){n({error:err})}},b=async()=>{try{const{deliverable_categories:e}=await o.get("/api/challenge-templates/deliverables/categories/list");n({global_deliverable_categories:e})}catch({err:err}){n({error:err})}},A=async()=>{try{const{deliverable_configurations:e}=await o.get("/api/challenge-templates/deliverables/configurations/list");n({global_deliverable_configurations:e})}catch({err:err}){n({error:err})}},y=async()=>
2{try{const{subtopics:e}=await o.get("/api/authoring/list/subtopics");n({global_subtopics:e})}catch({err:err}){n({error:err})}},w=async()=>{try{const{topics:e}=await o.get("/api/authoring/list/topics");n({global_topics:e})}catch({err:err}){n({error:err})}},S=async()=>{try{const{structures:e}=await o.get("/api/standards/list/structures");n({global_standard_structures:e})}catch({err:err}){n({error:err})}},C=async()=>{try{const{categories:e}=await o.get("/api/standards/list/all-categories");n({global_standard_categories:e})}catch({err:err}){n({error:err})}},M=async e=>await o.post(`/api/challenge-templates/audience-category/change/${g}`,{audience_category_id:e}),k=async()=>{var e,s,a,t;const i=(null===c||void 0===c||null===(e=c.audiences)||void 0===e||null===(s=e.map)||void 0===s?void 0:s.call(e,e=>null===e||void 0===e?void 0:e.audiences))||[],l=(null===m||void 0===m||null===(a=m.audiences)||void 0===a||null===(t=a.map)||void 0===t?void 0:t.call(a,e=>null===e||void 0===e?void 0:e.audiences))||[],{additions:n,deletions:r}=((e,s)=>{var a;if((0,T.isEqual)(e,s))return{additions:[],deletions:[]};const t=(null===e||void 0===e||null===(a=e.filter)||void 0===a?void 0:a.call(e,e=>!s.includes(e)).concat(s.filter(s=>!e.includes(s))))||[],i=t.filter(s=>!e.find(e=>e.id===s.id)).map(e=>null===e||void 0===e?void 0:e.id),l=t.filter(s=>e.find(e=>e.id===s.id)).map(e=>null===e||void 0===e?void 0:e.id);return{additions:i,deletions:l}})(i,l);null!==n&&void 0!==n&&n.length&&await(async e=>await o.post(`/api/challenge-templates/add/audiences/${g}`,{audiences:e}))(n),null!==r&&void 0!==r&&r.length&&await(async e=>await o.post(`/api/challenge-templates/remove/audiences/${g}`,{audiences:e}))(r)};(0,l.useEffect)(()=>{n({loading:!0}),Promise.all([v(),f(),_(),j(),b(),A(),y(),w(),S(),C()]).finally(()=>n({loading:!1}))},[]);const z=(null===GG||void 0===GG?void 0:GG[h])||l.Fragment,{deliverable_challenges:I,error:E,global_audience_categories:F,global_audiences:R,global_deliverable_categories:D,global_deliverable_configurations:B,global_standard_categories:L,global_standard_structures:O,global_subjects:H,global_subtopics:U,global_topics:Q,is_complete:V,loading:G}=i,W={challenge_template_types:null===p||void 0===p||null===(t=p.current)||void 0===t?void 0:t.types,deliverable_challenges:I,error:E,fetchGlobalSubjects:_,fetchGlobalSubtopics:y,fetchGlobalTopics:w,fetchTemplate:x,global_audience_categories:F,global_audiences:R,global_deliverable_categories:D,global_deliverable_configurations:B,global_standard_categories:L,global_standard_structures:O,global_subjects:H,global_subtopics:U,global_topics:Q,is_complete:V,loading:G,publishTemplate:async()=>{await o.post(`/api/challenge-templates/publish/${g}`),await d()},saveTemplate:async function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null===(e=Object.keys(s))||void 0===e||!e.length)return await x();null!==s&&void 0!==s&&s.audience_category_id?await M(null===s||void 0===s?void 0:s.audience_category_id):null!==s&&void 0!==s&&s.audiences?await k():await o.post(`/api/challenge-templates/save/${u}/${g}`,s),await d()}};return(0,l.useImperativeHandle)(a,()=>W),(0,N.jsxs)(cQ,{value:W,children:[(0,N.jsx)(Ce.S,{className:"content-editor challenge d-flex justify-content-center flex-1 py-5",children:(0,N.jsx)(Me.x_,{loading:(0,T.isEmpty)(m),children:(0,N.jsx)(z,{})})}),(0,N.jsx)(jQ,{ref:p})]})});rQ.displayName="ChallengeEditor";var oQ=rQ;const dQ=l.createContext({}),cQ=dQ.Provider,hQ=dQ.Consumer,uQ=()=>(0,l.useContext)(dQ),mQ=(0,l.forwardRef)((s,a)=>{const{onCreate:t,onHide:i}=s,{api:n}=(0,P.nm)(),{fetchGlobalSubjects:r,global_audience_categories:o}=uQ(),{fetchTemplateDetails:d,template:c,template_id:h}=sQ(),{audience_category_id:u}=c||{},m=(0,l.useRef)(),[g,p,x]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1}),v=()=>p({error:null}),f=e=>new Promise((e,s)=>{p({reject:s,resolve:e,show:!0})}),j=()=>{g.resolve(null),x(),"function"===typeof i&&i()},_=async s=>{try{var a,i,l;const{audience_category:e,name:o}=s,c=(null===o||void 0===o||null===(a=o.toLowerCase)||void 0===a||null===(i=a.call(o))||void 0===i||null===(l=i.replace)||void 0===l?void 0:l.call(i,/ /g,"-"))||"";p({loading:!0}),await n.post(`/api/challenge-templates/add/subject/${h}`,{audience_category_id:e,name:o,new_subject_slug:c}),Promise.all([r(),d()]).then(()=>{p({loading:!1}),"function"===typeof t&&t(),(e=>{g.resolve(e),j()})()}).catch(e=>{p({error:e,loading:!1})})}catch(e){p({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,loading:!1})}};(0,l.useImperativeHandle)(a,()=>({hide:j,show:f})),(0,l.useEffect)(()=>x,[]);const{error:b,loading:A}=g;return(0,N.jsx)(xe,{onHide:j,show:g.show,children:(0,N.jsx)(ds.l1,{onSubmit:async e=>await _(e),initialValues:{audience_category:Number.parseInt(u)||1,name:""},children:e=>{m.current=e;const{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new subject",id:"label.create_new_subject.ffabc0bb"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:v,show:b,variant:"danger",children:b}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Subject name",id:"label.subject_name.6323b517"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"New Subject",isInvalid:(null===i||void 0===i?void 0:i.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===i||void 0===i?void 0:i.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,placeholder:"e.g. Math",type:"text",value:l.name}),(null===s||void 0===s?void 0:s.name)&&(null===i||void 0===i?void 0:i.name)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.name})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(_e.A.Select,{"aria-label":"Subject Associated Audience Category",isInvalid:(null===i||void 0===i?void 0:i.audience_category)&&(null===s||void 0===s?void 0:s.audience_category),isValid:(null===i||void 0===i?void 0:i.audience_category)&&!(null!==s&&void 0!==s&&s.audience_category),name:"audience_category",onChange:a,value:l.audience_category,children:o&&o.map((e,s)=>{let{id:a,name:t}=e;return(0,N.jsx)("option",{value:a,children:t},`${s}-${a}
2`)})})]})]})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(Me.p0,{loading:A,onClick:t,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add subject",id:"label.add_subject.428012ea"})})})]})}})})});mQ.displayName="AddSubjectModal";var gQ=mQ;var pQ=s=>{const{challenge_template:a,image_placeholder:t,placeholder:i,vimeoThumb:n,ytThumb:r}=s,{trigger_content_type:o,trigger_content_url:d}=a||{},[c,h,u]=(0,ne.CQ)({error:null,generic_trigger:null,loading:!1,vimeo_thumb:null}),{vimeo_loaded:m}=c;(0,l.useEffect)(()=>{!m&&"Vimeo"===o&&d&&(async s=>{try{const e=await fetch(`https://vimeo.com/api/oembed.json?url=${s}`),a=await e.json();null!==a&&void 0!==a&&a.thumbnail_url_with_play_button&&h({vimeo_loaded:!0,vimeo_thumb:a.thumbnail_url_with_play_button})}catch(e){h({error:(null===e||void 0===e?void 0:e.message)||e})}})(d)},[a,m,o,d]);const{generic_trigger:g}=c;return(0,N.jsx)(N.Fragment,{children:o&&d?(()=>{const{vimeo_thumb:e}=c;switch(o){case"Image":return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Trigger Content Preview: Image",id:"label.trigger_content_preview_image.1ac67539"})}),(0,N.jsx)(Ce.S,{style:{paddingBottom:"5px"},children:d?(0,N.jsx)(Zs.A,{fluid:!0,src:d}):t})]});case"YouTube":return(0,N.jsx)(N.Fragment,{children:null!==d&&void 0!==d&&d.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Trigger Content Preview: YouTube",id:"label.trigger_content_preview_youtube.27669d9b"})}),(0,N.jsx)(Ce.S,{style:{paddingBottom:"5px"},children:r?(0,N.jsx)("a",{href:`${d}`,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(Zs.A,{fluid:!0,src:(s=d,`https://img.youtube.com/vi/${(e=>{var s;const a=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return 11===(null===a||void 0===a||null===(s=a[7])||void 0===s?void 0:s.length)?a[7]:null})(s)}/0.jpg`)})}):(0,N.jsx)(Wg(),{controls:!0,url:d,width:"100%"})})]}):i});case"Vimeo":return(0,N.jsx)(N.Fragment,{children:null!==d&&void 0!==d&&d.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Trigger Content Preview: Vimeo",id:"label.trigger_content_preview_vimeo.34e3f768"})}),(0,N.jsx)(Ce.S,{style:{paddingBottom:"10px"},children:n?(0,N.jsx)(Ge.A,{body:!0,className:"card-secondary",style:{marginTop:35},children:(0,N.jsx)(Ue.A,{fluid:!0,style:{padding:0},children:(0,N.jsx)(Qe.A,{className:"header-info-challenge",style:{marginTop:25},children:(0,N.jsx)(Ve.A,{md:12,children:(0,N.jsx)(N.Fragment,{children:!!e&&(0,N.jsx)("a",{href:d,rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(Zs.A,{fluid:!0,src:e})})})})})})}):(0,N.jsx)(Wg(),{controls:!0,url:d,width:"100%"})})]}):i});case"Video":return(0,N.jsx)(N.Fragment,{children:d.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Trigger Content Preview: Video",id:"label.trigger_content_preview_video.78cee603"})}),(0,N.jsx)(Ce.S,{style:{paddingBottom:"5px"},children:!!d&&(0,N.jsx)(Wg(),{controls:!0,url:d,width:"100%"})})]}):i});case"Other":return(0,N.jsx)(N.Fragment,{children:d.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Trigger Content Preview: Other",id:"label.trigger_content_preview_other.ddd002b4"})}),(0,N.jsx)(Ce.S,{style:{padding:"5px"},children:g?(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)("a",{href:null===g||void 0===g?void 0:g.link,rel:"noopener noreferrer",target:"_blank",children:null===g||void 0===g?void 0:g.title})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)("a",{className:"text-center",href:g.link,rel:"noopener noreferrer",target:"_blank",children:g.image&&(0,N.jsx)(Zs.A,{fluid:!0,src:null===g||void 0===g?void 0:g.image,alt:g.image.slice(g.image.lastIndexOf("/")+1,g.image.lastIndexOf("."))})})}),(0,N.jsx)(Ge.A.Footer,{children:(0,N.jsx)("small",{className:"text-muted",children:null===g||void 0===g?void 0:g.domain})})]}):(0,N.jsxs)(Ge.A,{children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload Trigger C
2ontent to see a preview",id:"label.upload_trigger_content_to_see_a_pr.86bf9ffe"})}),(0,N.jsx)(Ge.A.Body,{style:{backgroundColor:"grey"},children:(0,N.jsx)(ze.Vk6,{size:"md",style:{background:"grey"}})})]})})]}):i})}var s})():(0,N.jsx)(N.Fragment,{children:i})})};const xQ=(0,l.forwardRef)((s,a)=>{const{onHide:t}=s,{formatMessage:i}=(0,ja.A)(),{api:n,utils:r}=(0,P.nm)(),{template:o}=sQ(),d=(0,l.useRef)(),[c,h,u]=(0,ne.CQ)({active_key:"embed",add_resource:null,agreed_disclaimer:!1,error:null,loading:!1,reject:Function(),resolve:Function(),show:!1,uploading:!1}),m=e=>new Promise((e,s)=>{h({reject:s,resolve:e,show:!0})}),g=()=>{c.resolve(null),u(),"function"===typeof t&&t()},p=async()=>{const s=d.current;if(!s)return;const{setFieldError:a,values:t}=s,{trigger_content_type:l,trigger_content_url:r}=t;switch(l){case"":const s=i({id:"label.please_select_a_type.96dc8346",defaultMessage:"Please select a type"});return await a("trigger_content_type",s),void await a("trigger_content_url",s);case"Vimeo":const t=await(async s=>{try{const e=await fetch(`https://vimeo.com/api/oembed.json?url=${s}`),a=await e.json();return!(null===a||void 0===a||!a.thumbnail_url_with_play_button)&&(h({vimeo_loaded:!0,vimeo_thumb:a.thumbnail_url_with_play_button}),!0)}catch(e){return w(e),h({error:(null===e||void 0===e?void 0:e.message)||e}),!1}})(r);if(console.log(t),!t)return await a("trigger_content_url",i({id:"label.url_is_not_a_vimeo_url.7e14f622",defaultMessage:"URL is not a Vimeo URL"}));break;case"YouTube":if(!(e=>{var s;const a=e.match(/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&?]*).*/);return 11===(null===a||void 0===a||null===(s=a[7])||void 0===s?void 0:s.length)&&a[7]})(r))return await a("trigger_content_url",i({id:"label.url_is_not_a_youtube_url.1fc1b6ff",defaultMessage:"URL is not a YouTube URL"}));console.log("youtube detected");break;case"Other":if(!r)return await a("trigger_content_url",i({id:"label.please_enter_a_url.a58a94b9",defaultMessage:"Please enter a URL"}));await(async e=>{try{["http://","https://"].includes(e.indexOf("http://"))||(e=`http://${e}`);let s={domain:"",image:"",link:e,title:""};h({generic_trigger:s});const a=await n.post("/api/site/metadata",{url:e}),t=/^https?:\/\/([^/?#]+)(?:[/?#]|$)/i,i=e.match(t),l=null===i||void 0===i?void 0:i[1],{image:r,title:o}=a;s={domain:l,image:r,link:e,title:o},h({generic_trigger:s})}catch({err:err}){h({error:err})}})(r)}c.resolve({trigger_content_type:l,trigger_content_url:r}),g()},x=async(s,a)=>{try{const e=null===d||void 0===d?void 0:d.current;if(!e)return;const t=null===o||void 0===o?void 0:o.id,{type:l}=s||{},c=r.getFileType(l);if(!c||"video"!==c)return h({error:i({id:"label.invalid_file_type_detected_accepta.056a8b57",defaultMessage:"Invalid file type detected, acceptable file types are: mp4, mpg, mwv, mov"}),uploading:!1});h({uploading:!0});const{file:u}=await n.file("/api/challenge-templates/upload/trigger-content/video",{challenge_template_id:t,job_id:a},s);if(null===u||void 0===u||!u.location)return h({uploading:!1}),!1;await e.setFieldValue("trigger_content_type","Video"),await e.setFieldValue("trigger_content_url",null===u||void 0===u?void 0:u.location),h({uploading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;h({error:a,uploading:!1})}},v=async e=>{var s;const a=d.current;a&&(await a.setFieldValue("trigger_content_type",null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.current),await a.setFieldTouched("trigger_content_type",!0),await a.setFieldValue("trigger_content_url",""))};(0,l.useImperativeHandle)(a,()=>({hide:g,show:m}));const f=(0,N.jsx)(Ge.A,{className:"my-3 w-100 rounded p-2 d-flex align-items-center justify-content-center",style:{border:"1px dashed #808080",height:350},children:(0,N.jsx)("p",{className:"text-center w-50",children:"embed"===c.active_key?(0,N.jsx)(ke.A,{defaultMessage:"Please choose a type and paste a link to your content above",id:"label.please_choose_a_type_and_paste_a_l.f54c18ad"}):(0,N.jsx)(ke.A,{defaultMessage:"Please choose a type and upload your content above",id:"label.please_choose_a_type_and_upload_yo.95d624eb"})})}),{active_key:j,add_resource:_,agreed_disclaimer:b,error:A,show:y,uploading:S}=c;return(0,N.jsxs)(xe,{backdrop:"static",onHide:g,show:y,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Add a Video Trigger",id:"label.add_a_video_trigger.244fa10b"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({error:null}),show:A,variant:"danger",children:A}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,onSubmit:p,initialValues:{trigger_content_type:"",trigger_content_url:""},children:e=>{d.current=e;const{errors:s,handleChange:a,handleSubmit:t,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(ld.A.Container,{activeKey:j,id:"admin-tabs",role:"navigation",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>{"embed"!==j&&(l("trigger_content_type",null),l("trigger_content_url","")),h({active_key:"embed"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"embed",href:"#embed",children:(0,N.jsx)(ke.A,{defaultMessage:"Embed link",id:"label.embed_link.e0df6ca8"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>{"upload"!==j&&l("trigger_content_type",null),h({active_key:"upload"})},children:(0,N.jsx)(aa.A.Link,{eventKey:"upload",href:"#upload",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload file",description:"",id:"label.upload_file.d99bcd78"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{sm:12,children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Resource type",id:"label.resource_type.c9bf2e89"})}),(0,N.jsxs)(ds.D0,{className:"form-control select-css mb-4",component:"select",name:"trigger_content_type",onSelect:v,placeholder:"Trigger C
2ontent Type",value:r.trigger_content_type,children:[(0,N.jsx)("option",{value:"",children:i({id:"label.choose_a_type.a1a22774",defaultMessage:"Choose a Type"})}),"embed"===j&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("option",{value:"YouTube",children:i({id:"label.youtube.fb7accff",defaultMessage:"YouTube"})}),(0,N.jsx)("option",{value:"Vimeo",children:i({id:"label.vimeo.a7a93fd1",defaultMessage:"Vimeo"})})]}),"upload"===j&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)("option",{value:"Video",children:i({id:"label.video.d534be82",defaultMessage:"Video"})})})]}),(null===s||void 0===s?void 0:s.trigger_content_type)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.trigger_content_type}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsxs)(ld.A.Pane,{eventKey:"embed",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Paste a link to your content",id:"label.paste_a_link_to_your_content.7abb5b92"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{className:"form-control",disabled:!r.trigger_content_type,isInvalid:(null===n||void 0===n?void 0:n.trigger_content_url)&&(null===s||void 0===s?void 0:s.trigger_content_url),isValid:(null===n||void 0===n?void 0:n.trigger_content_url)&&!(null!==s&&void 0!==s&&s.trigger_content_url),name:"trigger_content_url",onChange:a,type:"text",value:r.trigger_content_url,"aria-label":i({id:"label.trigger_content_url.0ad012e8",defaultMessage:"trigger content url"}),placeholder:i({id:"label.enter_a_url.7cc8f7f6",defaultMessage:"enter a url..."})}),(null===s||void 0===s?void 0:s.trigger_content_url)&&(null===n||void 0===n?void 0:n.trigger_content_url)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.trigger_content_url})]})]}),(0,N.jsx)(ld.A.Pane,{eventKey:"upload",children:"Video"===r.trigger_content_type&&(0,N.jsxs)("div",{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload a Trigger Video",id:"label.upload_a_trigger_video.97041dbe"})}),(0,N.jsx)(fa,{onSubmit:x,submitting:S})]})})]})]})})]}),(0,N.jsx)(pQ,{placeholder:f,vimeoThumb:!1,ytThumb:!1,challenge_template:{trigger_content_type:r.trigger_content_type,trigger_content_url:r.trigger_content_url},video_placeholder:(0,N.jsxs)(Ge.A,{style:{background:"#F6F9F8",border:"1px dashed #808080",borderRadius:"10px",height:350,padding:10,position:"relative",width:"100%"},children:[(0,N.jsx)(fa,{onSubmit:(e,s)=>x(e,s),submitting:c.uploading}),(0,N.jsx)(ke.A,{defaultMessage:"Upload video",id:"label.upload_video.ea79e833"})]})}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"mt-2 mb-2",children:(0,N.jsx)(_e.A.Check,{checked:b,id:"step8-disclaimer",onClick:()=>h({agreed_disclaimer:!b}),label:(0,N.jsx)("p",{className:"mb-0",style:{maxWidth:300},children:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have, or have obtained permission to use this content.",id:"label.i_agree_that_i_have_or_have_obtain.41cae770"})})})}),(0,N.jsx)(ve.A,{className:"float-end",disabled:!b,onClick:p,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]})}})]})]})});xQ.displayName="TriggerContentModal";var vQ=xQ;const fQ=(0,l.forwardRef)((e,s)=>{const{formatMessage:a}=(0,ja.A)(),t=[{kind:"",name:"Choose a real-world question",value:"example",value_label:""},{badge_label:"Low Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How can I divide the water in the first jug and the second jug using only three jugs?",id:"label.how_can_i_divide_the_water_in_the.1b4d30b2"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Rubik's Cube",id:"label.rubiks_cube.2ad249da"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Draw four straight lines on 3 x 3 array of dots without removing pen from paper",id:"label.draw_four_straight_lines_on_3_x_3.fbd3e979"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Divide a triangular cake into four equal pieces.",id:"label.divide_a_triangular_cake_into_four.0b0b0e32"})})]}),icon:(0,N.jsx)(LQ,{rwq:"logical"}),kind:"tame",label:"Tame Problems",name:"How do I solve it?",value:"logical",value_label:"Logical"},{badge_label:"Low Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Factor a quadratic equation.",id:"label.factor_a_quadratic_equation.38a2e4f6"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Convert Fahrenheit to Celsius temperatures.",id:"label.convert_fahrenheit_to_celsius_temp.2d00a80b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Bisect any given angle.",id:"label.bisect_any_given_angle.b778f7b2"})})]}),icon:(0,N.jsx)(LQ,{rwq:"algorithmic"}),kind:"tame",label:"Tame Problems",name:"What\u2019s the correct answer?",value:"algorithmic",value_label:"Algorithmic"},{badge_label:"Low Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How long for car A to overtake car B traveling at different speeds?",id:"label.how_long_for_car_a_to_overtake_car.a686ba12"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Apply Boyle's law to the problem statement",id:"label.apply_boyles_law_to_the_problem_st.b95e2007"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Calculate reagents needed to form a specific precipitate in a chemical reaction.",id:"label.calculate_reagents_needed_to_form.407148e8"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:'Most "back-of-the-chapter" textbook problems.',id:"label.most_back_of_the_chapter_textbook.e0fc3429"})})]}),icon:(0,N.jsx)(LQ,{rwq:"story"}),kind:"tame",label:"Tame Problems",name:"What operation needs to be performed?",value:"story",value_label:"Story"},{badge_label:"Low Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Search an online catalog for best resources.",id:"label.search_an_online_catalog_for_best.7ce73858"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Expand a recipe for 10 guests",id:"label.expand_a_re
2cipe_for_10_guests.7e0eeb10"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How many flight hours are required to pay off a 777?",id:"label.how_many_flight_hours_are_required.04a727af"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Prove angles of an isosceles triangle are equal.",id:"label.prove_angles_of_an_isosceles_trian.0c335e07"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Change case to subjunctive.",id:"label.change_case_to_subjunctive.1337d10b"})})]}),icon:(0,N.jsx)(LQ,{rwq:"rule_using"}),kind:"tame",label:"Tame Problems",name:"What procedure / rule needs to be applied?",value:"rule_using",value_label:"Rule Using"},{badge_label:"Medium Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Should I move in order to take another job?",id:"label.should_i_move_in_order_to_take_ano.0800dec5"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Which school should my daughter attend?",id:"label.which_school_should_my_daughter_at.ade0d511"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Which strategy is appropriate for a chess board configuration?",id:"label.which_strategy_is_appropriate_for.627160fb"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Which benefits package should I select how am I going to pay this bill?",id:"label.which_benefits_package_should_i_se.e5300517"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"What's the best way to get to the interstate during rush hour?",id:"label.whats_the_best_way_to_get_to_the_i.aacc618b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How long should my article be?",id:"label.how_long_should_my_article_be.26a7faef"})})]}),icon:(0,N.jsx)(LQ,{rwq:"decision_making"}),kind:"complex",label:"Complex Problems",name:"What\u2019s the best choice and why?",value:"decision_making",value_label:"Decision Making"},{badge_label:"Medium Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Troubleshoot inoperative modem.",id:"label.troubleshoot_inoperative_modem.82b1d88b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Why won't a car start",id:"label.why_wont_a_car_start.9c369195"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Determine chemicals present in qualitative analysis",id:"label.determine_chemicals_present_in_qua.6e50c6a7"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Determine why newspaper article is poorly written",id:"label.determine_why_newspaper_article_is.e364ed10"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Identify communication breakdowns in a committee",id:"label.identify_communication_breakdowns.b9230789"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Determine why local economy is inflationary despite national trends",id:"label.determine_why_local_economy_is_inf.49635bba"})})]}),icon:(0,N.jsx)(LQ,{rwq:"troubleshooting"}),kind:"complex",label:"Complex Problems",name:"Why is it not working and how can it be fixed?",value:"troubleshooting",value_label:"Troubleshooting"},{badge_label:a({id:"label.medium_complexity.c37c4d25",defaultMessage:"Medium complexity"}),content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How should I study for the final exam?",id:"label.how_should_i_study_for_the_final_e.6a1d07e4"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Virtually any kind of medical diagnosis and treatment.",id:"label.virtually_any_kind_of_medical_diag.35ef1444"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Identifying and treating turfgrass problems on a golf course.",id:"label.identifying_and_treating_turfgrass.bd11a80b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Develop individual plan of instruction for special education learners.",id:"label.develop_individual_plan_of_instruc.e1780dbd"})})]}),icon:(0,N.jsx)(LQ,{rwq:"diagnosis_solution"}),kind:"complex",label:a({id:"label.complex_problems.c84b666a",defaultMessage:"Complex problems"}),name:a({id:"label.what_is_the_cause_and_how_can_it_b.24f03b59",defaultMessage:"What is the cause and how can it be treated or cured?"}),value:"diagnosis_solution",value_label:"Diagnosis Solution"},{badge_label:"Medium Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Flying an airplane.",id:"label.flying_an_airplane.af3a6998"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Driving a car in different c
2onditions.",id:"label.driving_a_car_in_different_conditi.466252b8"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Managing investment portfolio.",id:"label.managing_investment_portfolio.ebbf4c9b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How can I avoid interacting with person X.",id:"label.how_can_i_avoid_interacting_with_p.6b8fabb5"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Moving to the next level in Fortnight game.",id:"label.moving_to_the_next_level_in_fortni.0370af10"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Teaching in live class.",id:"label.teaching_in_live_class.957e209e"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Arguing points of law before court.",id:"label.arguing_points_of_law_before_court.d2304320"})})]}),icon:(0,N.jsx)(LQ,{rwq:"strategic_performance"}),kind:"complex",label:"Complex Problems",name:a({id:"label.how_can_i_achieve_my_targeted_goal.b0b36887",defaultMessage:"How can I achieve my targeted goal or objective?"}),value:"strategic_performance",value_label:"Strategic Performance"},{badge_label:"High Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Defend or refute genome editing public policy.",id:"label.defend_or_refute_genome_editing_pu.75e0f408"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Develop policy for condominium association.",id:"label.develop_policy_for_condominium_ass.352d0c84"})})]}),icon:(0,N.jsx)(LQ,{rwq:"policy_analysis"}),kind:"wicked",label:"Wicked Problems",name:a({id:"label.how_appropriate_or_effective_is_th.094284d1",defaultMessage:"How appropriate or effective is the policy?"}),value:"policy_analysis",value_label:"Policy Analysis"},{badge_label:"High Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Harvard business cases.",id:"label.harvard_business_cases.1e2114c3"})}),(0,N.jsxs)("li",{children:["P",(0,N.jsx)(ke.A,{defaultMessage:"lan a menu for foreign dignitaries.",id:"label.lan_a_menu_for_foreign_dignitaries.85446bed"})]}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Render judgment in any tort case.",id:"label.render_judgment_in_any_tort_case.880ff3ac"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Evaluate performance of a stock portfolio.",id:"label.evaluate_performance_of_a_stock_po.b5e07fb5"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"How should Microsoft be split up?",id:"label.how_should_microsoft_be_split_up.5f1cece8"})})]}),icon:(0,N.jsx)(LQ,{rwq:"case_analysis"}),kind:"wicked",label:"Wicked Problems",name:a({id:"label.how_was_the_situation_handled_and.13b04d43",defaultMessage:"How was the situation handled and could anything else have been done?"}),value:"case_analysis",value_label:"Case Analysis"},{badge_label:"High Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Design instructional intervention given situation.",id:"label.design_instructional_intervention.fd7afcfa"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Write a short story.",id:"label.write_a_short_story.b4fb81ab"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Compose a song.",id:"label.compose_a_song.39419669"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Design a bridge.",id:"label.design_a_bridge.6ccde0dd"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Make a paper airplane.",id:"label.make_a_paper_airplane.a4129179"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Design a dog house.",id:"label.design_a_dog_house.467a1a87"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Design a vehicle that flies.",id:"label.design_a_vehicle_that_flies.504e7abc"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Developing curriculum for school.",id:"label.developing_curriculum_for_school.711f7e44"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Plan marketing campaign for new software company.",id:"label.plan_marketing_campaign_for_new_so.91bca860"})})]}),icon:(0,N.jsx)(LQ,{rwq:"design"}),kind:"wicked",label:"Wicked Problems",name:a({id:"label.what_are_the_flaws_and_how_can_the.58b9c7d6",defaultMessage:"What are the flaws and how can they be repaired or redesigned?"}),value:"design",value_label:"Design"},{badge_label:"High Complexity",content:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Should abortions be banned?",id:"label.should_abortions_be_banned.abbf10a1"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Resolve Kosovo crisis.",id:"label.resolve_kosovo_crisis.56e90bd5"})}),(0,N.jsxs)("li",{children:["N",(0,N.jsx)(ke.A,{defaultMessage:"egotiate peace between Hutus and Tutsis in Rwanda.",id:"label.egotiate_peace_between_hutus_and_t.b2d2f1ab"})]}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Redistribute wealth through tax policies;",id:"label.redistribute_wealth_through_tax_po.ae4ea177"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Develop bipartisan bill for U.S. Congress that will pass with \xbd majority",id:"label.develop_bipartisan_bill_for_us_con.5b5773c8"})})]}),icon:(0,N.jsx)(LQ,{rwq:"dilemma"}),kind:"wicked",label:"Wicked Problems",name:a({id:"label.how_can_a_controversial_issue_be_a.fa6bd004",defaultMessage:"How can a controversial issue be addressed?"}),value:"dilemma",value_label:"Dilemma"}];return(0,l.useImperativeHandle)(s,()=>({types:t})),(0,N.jsx)(N.Fragment,{})});fQ.displayName="ChallengeTemplateTypes";var jQ=fQ;const _Q=(0,l.forwardRef)((e,s)=>{const{formats:a,modules:t,name:i,onChange:l,onKeyUp:n,style:r,theme:o,value:d}=e;return(0,N.jsx)(_p(),{formats:a,modules:t,name:i,onChange:l,onKeyUp:n,ref:s,style:r,theme:o,value:d})});_Q.displayName="SolvablyQuill",_Q.defaultProps={formats:["bold","code","italic","link","strike","script","underline","blockquote","indent","list","align","code-block","image","video","formula"],modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{align:[]}],["formula"],["link"],["clean"]]},name:"",onChange:Function(),onKeyUp:Function(),style:{},theme:"snow",value:""};var bQ=_Q;const AQ=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t,locale:i,styles:n,utils:r}=(0,P.nm)(),{arrayAttrRemoveDuplicates:o,arrayRemoveDuplicates:d,embed_type_links:c}=r,{primary:h}=n,{global_deliverable_categories:u,global_deliverable_configurations:m}=uQ(),{fetchTemplateDetails:g,template:p}=sQ(),x=null===p||void 0===p?void 0:p.id,[v,f,j]=(0,ne.CQ)({active_toggle:0,deliverable:null,deliverable_id:null,error:null,loading:!1,mode:"Create",reject:Function(),resolve:Function(),show:!1}),_=(0,l.useRef)(),b=(0,l.useRef)(),A=(0,l.useRef)(),y=e=>new Promise((s,a)=>{f({deliverable_id:(null===e||void 0===e?void 0:e.deliverable_id)||null,mode:e.deliverable_id?"Edit":"Create",reject:a,resolve:s,show:!0})}),w=()=>{v.resolve(null),j(),"function"===typeof a&&a()},S=async(e,s)=>{let{requirements:a,specifics:i,title:l}=s;try{f({loading:!0}),await t.post(`/api/challenge-templates/deliverables/challenges/challenge/${e}`,{challenge_template_id:x,requirements:a,specifics:i,title:l}),await g(),f({loading:!1}),(e=>{v.resolve(e),w()})(!0)}catch({err:err}){f({error:err,loading:!1})}},C=async(e,s)=>{e?await(async(e,s)=>{try{const{deliverable_challenge:a}=await t.post(`/api/challenge-templates/deliverables/challenges-configurations/delete/${e}/${s}`,{challenge_id:e,config_id:s});a&&f({deliverable:a})}catch({err:err}){f({error:err})}})(B,s):await(async(e,s)=>{try{const{deliverable_challenge:a}=await t.post("/api/challenge-templates/deliverables/challenges-configurations/create/",{challenge_id:e,config_id:s});a&&f({deliverable:a})}catch(err){f({error:err})}})(B,s)},M=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(const a of s){let{deliverable_configurations_id:s}=a||{};if(s===e)return!0}return!1},k=async e=>{var s,a;const t=null===_||void 0===_?void 0:_.current,i=null===b||void 0===b||null===(s=b.current)||void 0===s||null===(a=s.getEditor)||void 0===a?void 0:a.call(s);t&&i&&(await t.setFieldValue("specifics",e),await t.setFieldTouched("specifics",!0),await t.setFieldValue("specifics_text",i.getText().trim()),await t.setFieldTouched("specifics_text",!0))},z=async e=>{var s,a;const t=null===_||void 0===_?void 0:_.current,i=null===A||void 0===A||null===(s=A.current)||void 0===s||null===(a=s.getEditor)||void 0===a?void 0:a.call(s);t&&i&&(await t.setFieldValue("requirements",e),await t.setFieldTouched("requirements",!0),await t.setFieldValue("requirements_text",i.getText().trim()),await t.setFieldTouched("requirements_text",!0))};(0,l.useImperativeHandle)(s,()=>({hide:w,show:y})),(0,l.useEffect)(()=>{(async()=>{v.show&&(null!==v&&void 0!==v&&v.deliverable_id?await(async()=>{try{f({loading:!0});const{deliverable_id:e}=v,{deliverable_challenge:s}=await t.get(`/api/challenge-templates/deliverables/challenges/challenge/${e}`);f({deliverable:s,loading:!1})}catch({err:err}){f({error:err,loading:!1})}})():await(async()=>{try{f({loading:!0});const{deliverable_challenge:e}=await t.post("/api/challenge-templates/deliverables/challenges/create",{challenge_template_id:x,requirements:"",specifics:"",title:"New Deliverable"});f({deliverable:e,loading:!1}),await g()}catch({err:err}){f({error:err,loading:!1})}})())})()},[v.deliverable_id,v.show]);const{active_toggle:T,deliverable:I,error:E,loading:F,mode:R,show:D}=v,{id:B,configurations:L,requirements:O,specifics:H,title:U,type:Q}=I||{},V=d((e=>{let s=[];
2return null!==e&&void 0!==e&&e.length&&e.forEach(e=>{const{params:a,type:t}=(null===e||void 0===e?void 0:e.configurations)||{};var i;"file_upload"===t&&(null!==a&&void 0!==a&&null!==(i=a.acceptable_types)&&void 0!==i&&i.length&&a.acceptable_types.forEach(e=>{s.push(e)}))}),s})(L)),G=o((e=>{let s=[];return(null===e||void 0===e?void 0:e.length)&&e.forEach(e=>{const{params:a,title:t,type:i}=(null===e||void 0===e?void 0:e.configurations)||{};if("file_upload"!==i){const e=c.find(e=>(null===e||void 0===e?void 0:e.type)===i);let l={link:null===e||void 0===e?void 0:e.link,params:a,title:t,type:i};s.push(l)}}),s})(L),"type"),W={requirements:O||"",requirements_text:(0,ad.G9)(O,{preserveNewlines:!1}).trim()||"",specifics:H||"",specifics_text:(0,ad.G9)(H,{preserveNewlines:!1}).trim()||"",title:U||"",type:Q||""};return(0,N.jsxs)(xe,{className:"deliverable-builder",id:"deliverableBuilder",onHide:w,show:D,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:"Create"===R?(0,N.jsx)(ke.A,{defaultMessage:"Create deliverable",id:"label.create_deliverable.8961e29b"}):(0,N.jsx)(ke.A,{defaultMessage:"Edit deliverable",id:"label.edit_deliverable.80eb769b"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>f({error:null}),show:E,variant:"danger",children:E}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Me.x_,{loading:F,children:(0,N.jsx)(ds.l1,{enableReinitialize:!0,initialValues:W,onSubmit:e=>{var s;let{requirements:a,specifics:t,title:i}=e;return S(null===v||void 0===v||null===(s=v.deliverable)||void 0===s?void 0:s.id,{requirements:a,specifics:t,title:i})},validationSchema:(0,Re.by)({locale:i,scope:"content_authoring.challenge_editor.deliverable_challenge"}),children:e=>{var s,a;_.current=e;const{errors:t,handleChange:i,handleSubmit:l,touched:n,values:r}=e;return(0,N.jsx)(_e.A,{onSubmit:l,children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"deliverable-categories",md:3,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select deliverables",id:"label.select_deliverables.bb9de52f"})}),!(null===u||void 0===u||!u.length)&&u.map((e,s)=>{let a=Number(T)===Number(s),t=a?"white":h,i=null!==m&&void 0!==m&&m.length?m.reduce((s,a)=>{const{deliverable_category_id:t}=a;if(t!==(null===e||void 0===e?void 0:e.id))return s;return M(null===a||void 0===a?void 0:a.id,null===I||void 0===I?void 0:I.configurations)?s+1:s},0):0;return(0,N.jsxs)(Ge.A,{className:"mb-0 "+(a?"active":""),style:{borderRadius:0},children:[(0,N.jsxs)(Ge.A.Header,{className:"d-flex align-items-center",onClick:()=>f({active_toggle:s}),role:"button",style:{borderRadius:0,cursor:"pointer"},tabindex:0,children:[(0,N.jsx)(km,{category:e.title,color:t,size:20}),(0,N.jsxs)("h5",{className:"d-inline-block mx-2 m-0 "+(a?"":" text-primary"),children:[null===e||void 0===e?void 0:e.title," (",i,")"]}),a?(0,N.jsx)(ze.z44,{className:"float-end"}):(0,N.jsx)(ze.ZPM,{className:"float-end "})]}),a&&(0,N.jsx)(Ce.S,{className:"p-3",children:!(null===m||void 0===m||!m.length)&&m.map((s,a)=>{const{id:t,deliverable_category_id:i,title:l}=s,n=M(null===s||void 0===s?void 0:s.id,null===I||void 0===I?void 0:I.configurations);return i!==(null===e||void 0===e?void 0:e.id)?(0,N.jsx)(N.Fragment,{}):(0,N.jsx)(Ce.S,{className:"d-flex",children:(0,N.jsx)(Ce.S,{onClick:()=>C(n,t),children:(0,N.jsx)(_e.A.Check,{checked:n,id:`form-check-${t}`,label:l,type:"checkbox"})})},a)})})]},s)})]}),(0,N.jsxs)(Ve.A,{md:9,children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deliverable settings",id:"label.deliverable_settings.26d17d99"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{name:"title",onChange:e=>i(e),type:"text",value:r.title}),(null===t||void 0===t?void 0:t.title)&&(null===n||void 0===n?void 0:n.title)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"w-100 d-block",type:"invalid",children:t.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"specifics",children:(0,N.jsx)(ke.A,{defaultMessage:"Add a Description",id:"label.add_a_description.8e64a80e"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Describe the specifics of your deliverable to expand on the title (e.g. \u201cWrite an industry-style creative brief of a technology that provides affordable access to solar energy.\u201d)",id:"label.describe_the_specifics_of_your_del.58ae34d4"})}),(0,N.jsx)(ds.D0,{name:"specifics",children:e=>{let{field:s}=e;return(0,N.jsx)(bQ,{default:s.value,id:"id-deliverable-creator-given-description",onChange:k,readOnly:!1,ref:b,value:s.value,style:{border:0,boxShadow:0,height:"100%",outline:0,padding:0,width:"100%"}})}}),(null===t||void 0===t?void 0:t.specifics)&&(null===n||void 0===n?void 0:n.specifics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"w-100 d-block",type:"invalid",children:t.specifics})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:(null===r||void 0===r||null===(s=r.specifics_text)||void 0===s?void 0:s.length)||0,max:800,min:1})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"requirements",children:(0,N.jsx)(ke.A,{defaultMessage:"Add requirements",id:"label.add_requirements.408dcc09"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Outline any specific requirements for the completion of your deliverable (e.g. formatting, word limit, etc.). These requirements will help to make your expectations explicit.",id:"label.outline_any_specific_requirements.5f1c88dd"})}),(0,N.jsx)(ds.D0,{name:"requirements",children:e=>{let{field:s}=e;return(0,N.jsx)(bQ,{default:s.value,id:"id-deliverable-creator-given-description",onChange:z,readOnly:!1,ref:A,value:s.value,style:{border:0,boxShadow:0,height:"100%",outline:0,padding:0,width:"100%"}})}}),(null===t||void 0===t?void 0:t.requirements)&&(null===n||void 0===n?void 0:n.requirements)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"w-100 d-block",type:"invalid",children:t.requirements})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:(null===(a=(0,ad.G9)(r.requirements).trim())||void 0===a?void 0:a.length)||0,max:800,min:1})}),(0,N.jsxs)(Ge.A,{body:!0,className:"deliverable-preview-card mt-4",children:[(0,N.jsx)("h5",{className:"text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"You've Selected:",id:"label.youve_selected.7e914215"})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ke.A,{defaultMessage:"Deliverable types",id:"label.deliverable_types.07e987ef"})}),!(null===G||void 0===G||!G.length)&&G.map((e,s)=>{const{title:a}=e;return(0,N.jsx)(Ce.S,{className:"d-inline-block me-2 mt-2",children:(0,N.jsx)(Uu,{className:"embed",embed:e,children:(0,N.jsx)(bo.A,{bg:"secondary",style:{cursor:"help",fontSize:16,padding:8},children:a})})},s)}
2),(0,N.jsxs)(Ce.S,{className:"expanded-details-container mt-2",children:[(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ke.A,{defaultMessage:"Acceptable file types",id:"label.acceptable_file_types.cd68f88c"})}),(0,N.jsxs)(Ce.S,{className:"acceptable-file-types",children:[!(null===V||void 0===V||!V.length)&&V.map((e,s)=>{let a=(0,N.jsx)("span",{children:",\xa0"});return(0,N.jsxs)("strong",{className:"float-start",children:[e,s===V.length-1&&G&&!G.length?"":a]},s)}),!(null===G||void 0===G||!G.length)&&G.map((e,s)=>{const{link:a,title:t}=e;let i=(0,N.jsx)("span",{children:",\xa0"});return(0,N.jsxs)(Ce.S,{className:"d-inline-block ms-1 float-start",children:[(0,N.jsx)(Uu,{embed:e,style:{display:"inline"},children:(0,N.jsx)("strong",{className:"embed",style:{cursor:"help"},children:t})}),(0,N.jsx)("a",{"aria-label":`Open ${t} in new window`,className:"p-0",href:a,rel:"noopener noreferrer",target:"_blank",style:{cursor:"pointer",display:"inline",fontSize:"12px"},children:(0,N.jsx)(ze.EQc,{className:"ms-1"})}),s===G.length-1?"":i]},s)})]})]})]}),(0,N.jsxs)(Ce.S,{className:"mt-3 d-flex justify-content-end",children:[(0,N.jsx)(ve.A,{onClick:w,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{className:"ms-3",type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]})]})]})})}})})})]})]})});AQ.displayName="DeliverableBuilder";var yQ=AQ;const wQ=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t,utils:i}=(0,P.nm)(),{formatMessage:n}=(0,ja.A)(),r=(0,l.useRef)(),{template:o}=sQ(),[d,c,h]=(0,ne.CQ)({active_key:"embed",agreed_disclaimer:null,error:null,loading:!1,reject:Function(),resolve:Function(),resource:null,show:!1}),u=e=>new Promise((s,a)=>{c({reject:a,resolve:s,resource:(null===e||void 0===e?void 0:e.resource)||null,show:!0})}),m=()=>{d.resolve(null),h(),"function"===typeof a&&a()},g=async(e,s)=>{try{const a=null===r||void 0===r?void 0:r.current;if(!a)return;const{type:l}=e,d=null===o||void 0===o?void 0:o.id,h=i.getFileType(l);if(!h)return c({error:n({id:"label.invalid_file_type_detected_accepta.d5456150",defaultMessage:"Invalid file type detected, acceptable file types are: JPG, JPEG, WEBM, MPEG, MP4, PDF, WORD, PSD"}),uploading:!1});c({uploading:!0});const u=["image","video"].includes(h)?h:"file",{file:m}=await t.file(`/api/challenge-templates/upload/guiding-resource/${u}`,{challenge_template_id:d,job_id:s},e);if(null===m||void 0===m||!m.location)throw{err:n({id:"label.unable_to_retrieve_file_path_from.43e1fec7",defaultMessage:"Unable to retrieve file path from response"})};await a.setFieldValue("value",null===m||void 0===m?void 0:m.location),c({uploading:!1})}catch({err:err}){c({error:err,uploading:!1})}},p=async e=>{const s=null===r||void 0===r?void 0:r.current;s&&(c({active_key:e,agreed_disclaimer:!1}),await s.setFieldValue("title",""),await s.setFieldValue("type",""),await s.setFieldValue("value",""),await s.setTouched({title:!1,type:!1,value:!1}))},x=async()=>{const e=null===r||void 0===r?void 0:r.current;e&&(c({agreed_disclaimer:!f}),await e.setTouched({title:!0,type:!0,value:!0}),await e.validateForm())};(0,l.useImperativeHandle)(s,()=>({hide:m,show:u})),(0,l.useEffect)(()=>h,[]);const{active_key:v,agreed_disclaimer:f,error:j,loading:_,resource:b,show:A,uploading:y}=d,w={title:(null===b||void 0===b?void 0:b.title)||"",type:(null===b||void 0===b?void 0:b.type)||"",value:(null===b||void 0===b?void 0:b.value)||""},S=ul.Ik().shape({title:ul.Yj().required(n({id:"label.guiding_resource_title_is_required.5b64b2b7",defaultMessage:"Guiding resource title is required"})).min(4,n({id:"label.guiding_resource_title_must_be_at.8caae618",defaultMessage:"Guiding resource title must be at least 4 characters"})).max(100,n({id:"label.guiding_resource_title_must_be_les.4794b645",defaultMessage:"Guiding resource title must be less than 100 characters long"})),type:ul.Yj().required(n({id:"label.guiding_resource_type_is_required.55ef012e",defaultMessage:"Guiding resource type is required"})),value:ul.Yj().matches(/^((https?|ftp):\/\/)?(www.)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,n({id:"label.guiding_resource_must_be_a_valid_u.91215d94",defaultMessage:"Guiding resource must be a valid URL"})).required(n({id:"label.guiding_resource_url_is_required.c4f881e3",defaultMessage:"Guiding resource URL is required"})).max(1024,n({id:"label.guiding_resource_url_is_too_long.52da86ba",defaultMessage:"Guiding resource URL is too long"}))}),C="embed"===v?["Website","Document","Video","Audio","Image"]:["Document","Video","Audio","Image"];return(0,N.jsxs)(xe,{backdrop:"static",onHide:m,show:A,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:b?(0,N.jsx)(ke.A,{defaultMessage:"Edit resource",id:"label.edit_resource.ea9d0afb"}):(0,N.jsx)(ke.A,{defaultMessage:"Create resource",id:"label.create_resource.65695f3a"})})}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,initialValues:w,onSubmit:e=>{return s=e,d.resolve(s),void m();var s},validationSchema:S,children:e=>{r.current=e;const{errors:s,handleChange:a,handleSubmit:t,isValid:i,setFieldValue:l,touched:o,values:d}=e;return(0,N.jsx)(_e.A,{onSubmit:t,children:(0,N.jsxs)(Me.x_,{loading:_,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Resource settings",id:"label.resource_settings.b7cf646a"})}),(0,N.jsxs)(ld.A.Container,{activeKey:v,id:"admin-tabs",mountOnEnter:!0,role:"navigation",children:[(0,N.jsx)(Qe.A,{children:(0,N.jsx)(Ve.A,{sm:12,children:(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{onClick:()=>p("embed"),children:(0,N.jsx)(aa.A.Link,{eventKey:"embed",href:"#embed",children:(0,N.jsx)(ke.A,{defaultMessage:"Embed link",id:"label.embed_link.e0df6ca8"})})}),(0,N.jsx)(aa.A.Item,{onClick:()=>p("upload"),children:(0,N.jsx)(aa.A.Link,{eventKey:"upload",href:"#upload",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload file",id:"label.upload_file.d99bcd78"})})})]})})}),(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{sm:12,children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:!1}),show:j,variant:"danger",children:j}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsxs)(ld.A.Pane,{eventKey:"embed",children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"type",children:(0,N.jsx)(ke.A,{defaultMessage:"Resource type",id:"label.resource_type.c9bf2e89"})}),(0,N.jsxs)(_e.A.Select,{className:"form-control",isInvalid:(null===o||void 0===o?void 0:o.type)&&(null===s||void 0===s?void 0:s.type),isValid:(null===o||void 0===o?void 0:o.type)&&!(null!==s&&void 0!==s&&s.type),name:"type",onChange:a,placeholder:"Types",value:d.type,children:[(0,N.jsx)("option",{value:"",children:n({id:"label.choose_a_type.a1a22774",defaultMessage:"Choose a Type"})}),C.map((e,s)=>(0,N.jsx)("option",{value:e,children:e},s))]}),(null===s||void 0===s?void 0:s.type)&&(null===o||void 0===o?void 0:o.type)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.type})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(be.A,{isInvalid:(null===o||void 0===o?void 0:o.title)&&(null===s||void 0===s?void 0:s.title),isValid:(null===o||void 0===o?void 0:o.title)&&!(null!==s&&void 0!==s&&s.title),name:"title",onCh
2ange:a,placeholder:"Enter a title",type:"text",value:d.title}),(null===s||void 0===s?void 0:s.title)&&(null===o||void 0===o?void 0:o.title)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"value",children:(0,N.jsx)(ke.A,{defaultMessage:"Paste a link to your content",id:"label.paste_a_link_to_your_content.7abb5b92"})}),(0,N.jsx)(be.A,{isInvalid:(null===o||void 0===o?void 0:o.value)&&(null===s||void 0===s?void 0:s.value),isValid:(null===o||void 0===o?void 0:o.value)&&!(null!==s&&void 0!==s&&s.value),name:"value",onChange:a,placeholder:"Enter resource...",value:d.value}),(null===s||void 0===s?void 0:s.value)&&(null===o||void 0===o?void 0:o.value)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.value})]})]}),(0,N.jsx)(ld.A.Pane,{eventKey:"upload",children:(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"type",children:(0,N.jsx)(ke.A,{defaultMessage:"Resource type",id:"label.resource_type.c9bf2e89"})}),(0,N.jsxs)(_e.A.Select,{isInvalid:(null===o||void 0===o?void 0:o.type)&&(null===s||void 0===s?void 0:s.type),isValid:(null===o||void 0===o?void 0:o.type)&&!(null!==s&&void 0!==s&&s.type),name:"type",onChange:a,value:null===d||void 0===d?void 0:d.type,placeholder:n({id:"label.types.a5fc9186",defaultMessage:"Types"}),children:[(0,N.jsx)("option",{value:"",children:n({id:"label.choose_a_type.a1a22774",defaultMessage:"Choose a Type"})}),C.map((e,s)=>(0,N.jsx)("option",{value:e,children:e},s))]}),(null===s||void 0===s?void 0:s.type)&&(null===o||void 0===o?void 0:o.type)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.type})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(be.A,{isInvalid:(null===o||void 0===o?void 0:o.title)&&(null===s||void 0===s?void 0:s.title),isValid:(null===o||void 0===o?void 0:o.title)&&!(null!==s&&void 0!==s&&s.title),name:"title",onChange:a,type:"text",value:null===d||void 0===d?void 0:d.title,placeholder:n({id:"label.enter_a_title.8831f73d",defaultMessage:"Enter a title"})}),(null===s||void 0===s?void 0:s.title)&&(null===o||void 0===o?void 0:o.title)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.title})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"value",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload a File",id:"label.upload_a_file.f09bbe52"})}),!(null!==d&&void 0!==d&&d.value)&&(0,N.jsx)(fa,{disabled:!(null!==d&&void 0!==d&&d.type),onSubmit:g,submitting:y}),(null===s||void 0===s?void 0:s.value)&&(null===o||void 0===o?void 0:o.value)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block mt-n1 mb-1",type:"invalid",children:s.value}),!(null===d||void 0===d||!d.value)&&(0,N.jsx)(os,{children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(be.A,{disabled:!0,isInvalid:(null===o||void 0===o?void 0:o.value)&&(null===s||void 0===s?void 0:s.value),isValid:(null===o||void 0===o?void 0:o.value)&&!(null!==s&&void 0!==s&&s.value),value:null===d||void 0===d?void 0:d.value}),(0,N.jsx)(ve.A,{variant:"outline-secondary",onClick:e=>{window.confirm(n({id:"label.are_you_sure_you_want_to_delete_th.05c37dab",defaultMessage:"Are you sure you want to delete this link?"}))&&l("value","")},children:(0,N.jsx)(ze.qbC,{})})]})})]})]})})]})]})})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-center my-2",children:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",onClick:x,children:(0,N.jsx)(_e.A.Check,{alignItems:"center",checked:f,id:"step13-disclaimer",label:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have obtained permission to use this content.",id:"label.i_agree_that_i_have_obtained_permi.ddc62dc1"})})})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsxs)(Ce.S,{className:"float-end mt-4",children:[(0,N.jsx)(ve.A,{className:"me-3",onClick:m,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!f||!i,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})})]})})}})]})});wQ.displayName="GuidingResourceBuilder";var NQ=wQ,SQ=t(49875),CQ=t(2367),MQ=t(51719),kQ=t(28602),zQ=t(93694),TQ=t(13731),IQ=t(24630),EQ=t(74851),FQ=t(14146),RQ=t(39542),DQ=t(457),B
2Q=t(35375);const PQ=e=>{const{color:s,rwq:a,size:t}=e,i={algorithmic:zQ.default,case_analysis:FQ.default,decision_making:kQ.default,design:DQ.default,diagnosis_solution:SQ.default,dilemma:RQ.default,logical:BQ.default,policy_analysis:MQ.default,rule_using:TQ.default,story:IQ.default,strategic:EQ.default,strategic_performance:EQ.default,troubleshooting:CQ.default},n=(null===i||void 0===i?void 0:i[a])||l.Fragment;return(0,N.jsx)(n,{color:s,fontSize:t})};PQ.defaultProps={size:30};var LQ=PQ;const OQ=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t}=(0,P.nm)(),{fetchTemplateDetails:i,template:n}=sQ(),{fetchGlobalTopics:r}=uQ(),o=(0,l.useRef)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1}),u=()=>c({error:null}),m=e=>new Promise((e,s)=>{c({reject:s,resolve:e,show:!0})}),g=()=>{d.resolve(null),h(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m}));const{error:p,loading:x,show:v}=d;return(0,N.jsxs)(xe,{backdrop:"static",onHide:g,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create topic",id:"label.create_topic.488184ed"})})}),(0,N.jsx)(ds.l1,{initialValues:{name:""},onSubmit:async e=>{const s=await(async e=>{try{c({loading:!0});const{topic:s}=await t.post("/api/challenge-templates/add/topic",{challenge_template_id:null===n||void 0===n?void 0:n.id,new_topic_name:e});return await r(),c({loading:!1}),s}catch(p){c({error:null===p||void 0===p?void 0:p.err,loading:!1})}})(null===e||void 0===e?void 0:e.name);s&&(await i(),(e=>{d.resolve(e),g()})(s))},validateOnChange:!0,children:e=>{o.current=e;const{errors:s,handleChange:a,handleSubmit:t,isValid:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:u,show:p,variant:"danger",children:p}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Topic name",id:"label.topic_name.c05cbe5c"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===l||void 0===l?void 0:l.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===l||void 0===l?void 0:l.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,value:null===n||void 0===n?void 0:n.name})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disbled:!i,loading:x,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});OQ.displayName="AddTopicModal";var HQ=OQ;const UQ=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t}=(0,P.nm)(),{fetchTemplateDetails:i,template:n}=sQ(),{fetchGlobalSubtopics:r}=uQ(),o=(0,l.useRef)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1}),u=()=>c({error:null}),m=e=>new Promise((e,s)=>{c({reject:s,resolve:e,show:!0})}),g=()=>{d.resolve(null),h(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m}));const{error:p,loading:x,show:v}=d;return(0,N.jsxs)(xe,{backdrop:"static",onHide:g,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create subtopic",id:"label.create_subtopic.325280c2"})})}),(0,N.jsx)(ds.l1,{initialValues:{name:""},onSubmit:async e=>{const s=await(async e=>{try{c({loading:!0});const{subtopic:s}=await t.post("/api/challenge-templates/add/subtopic",{challenge_template_id:null===n||void 0===n?void 0:n.id,new_subtopic_name:e});return await r(),c({loading:!1}),s}catch(p){c({error:null===p||void 0===p?void 0:p.err,loading:!1})}})(null===e||void 0===e?void 0:e.name);s&&(await i(),(e=>{d.resolve(e),g()})(s))},validateOnChange:!0,children:e=>{o.current=e;const{errors:s,handleChange:a,handleSubmit:t,isValid:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:u,show:p,variant:"danger",children:p}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Subtopic name",id:"label.subtopic_name.6403005e"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===l||void 0===l?void 0:l.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===l||void 0===l?void 0:l.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,value:null===n||void 0===n?void 0:n.name})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disbled:!i,loading:x,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});UQ.displayName="AddSubTopicModal";var QQ=UQ;class VQ extends l.Component{constructor(s){super(s),this.show=()=>{this.setState({results:[],searched:!1,show:!0})},this.hide=()=>{this.setState({show:!1})},this.refreshStandards=()=>{const{app:e}=this.props,{filter_standard_root_category_id:s,filter_standard_structure_id:a,search:t}=this.state;this.setState({loading:!0}),e.api.get("/api/standards/categorized/entry/list/"+this.state.page+"/"+this.state.page_size,{filter_standard_root_category_id:s,filter_standard_structure_id:a,search:t}).then(e=>{let{count:s,results:a}=e;this.setState({count:s,loading:!1,results:a})}).catch(e=>{let{err:s}=e;this.setState({error:s,loading:!1})})},this.addEntry=s=>{const{app:a,content_authoring_tool:t}=this.props,{api:i}=a,{fetchTemplateDetails:l,template:n}=t;this.setState({error:null,loading:!0,success:null}),i.post(`/api/challenge-templates/add/standard-entry/${null===n||void 0===n?void 0:n.id}/${s}`).then(async()=>{try{await l()}catch(e){this.setState({error:e})}this.setState({loading:!1,success:!0});const s=this;setTimeout(function(){s.setState({success:!1})},3e3)}).catch(e=>{let{err:s}=e;this.setState({error:s,loading:!1})})},this.hasEntry=e=>{const{content_authoring_tool:s}=this.props,{template:a}=s||{},{entries:t}=a||{};if(null===t||void 0===t||!t.length)return!1;for(let i=0;i<t.length;i++){const s=t[i];if(!s)continue;const{entries:a}=s;if(a&&a.id==e)return!0}return!1},this.doSearch=()=>{const e=this;this.setState({page:1,searched:!0},()=>{e.refreshStandards(this.state.search)})},this.handleSubmit=e=>{this.setState({filter_standard_root_category_id:null===e||void 0===e?void 0:e.filter_standard_root_category_id,filter_standard_structure_id:null===e||void 0===e?void 0:e.filter_standard_structure_id},this.doSearch)},this.state={count:0,error:null,filter_standard_root_category_id:null,filter_standard_structure_id:null,loading:!1,page:1,page_size:10,results:[],search:"",searched:!1,show:!1,success:!1}}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this)}render(){const{challenge_editor:e,intl:s}=this.props,{global_standard_categories:a,global_standard_structures:t}=e,{filter_standard_root_category_id:i,filter_standard_structure_id:l,loading:n,results:r,searched:o}=this.state;let d=null;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ue.A,{backdrop:"static",show:this.state.show,size:"xl",onHide:()=>{this.setState({show:!1})},children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,children:(0,N.jsx)(ue.A.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select standards",id:"label.select_standards.1d1d8bdd"})})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,show:this.state.error,variant:"danger",onClose:()=>{this.setState({error:null})},children:this.state.error}),(0,N.jsx)(We.A,{dismissible:!0,show:this.state.success,variant:"success",onClose:()=>{this.setState({success:!1})},children:(0,N.jsx)(ke.A,{defaultMessage:"Standard added successfully",id:"label.standard_added_successfully.52d1b0cf"})}),(0,N.jsx)(Me.x_,{loading:n,children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{md:3,children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Filters",id:"label.filters.546ebb8e"})}),(0,N.jsx)(ds.l1,{enableReinitialize:!0,onSubmit:this.handleSubmit,initialValues:{filter_audience_id:null,filter_standard_root_category_id:i,filter_standard_structure_id:l,filter_subject_id:null,filter_topic_id:null},children:e=>{let{errors:i,handleChange:l,handleSubmit:n,setFieldValue:r,touched:o,values:d}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Standards",id:"label.standards.b9a13629"})})}),(0,N.jsxs)(_e.A.Control,{as:"select",disabled:this.state.loading,isInvalid:o.filter_standard_structure_id&&i.filter_standard_structure_id,isValid:o.filter_standard_structure_id&&!i.filter_standard_structure_id,name:"filter_standard_structure_id",onChange:l,value:d.filter_standard_structure_id,children:[(0,N.jsx)("option",{value:"",children:s.formatMessage({id:"label.all.a52ace42",defaultMessage:"All"})}),t&&t.map(e=>(0,N.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Subject",id:"label.subject.68971283"})})}),(0,N.jsxs)(_e.A.Control,{as:"select",disabled:this.state.loading||!d.filter_standard_structure_id,isInvalid:o.filter_standard_root_category_id&&i.filter_standard_root_category_id,isValid:o.filter_standard_root_category_id&&!i.filter_standard_root_category_id,name:"filter_standard_root_category_id",onChange:l,value:d.filter_standard_root_category_id,children:[d.filter_standard_structure_id&&a&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("option",{value:"",children:s.formatMessage({id:"label.all_subjects.23971def",defaultMessage:"All subjects"})}),a.filter(e=>e.structure_id==d.filter_standard_structure_id&&!e.parent_id).map(e=>{const{id:s,name:a,token:t}=e,i=a?a+" ("+t+")":t;return(0,N.jsx)("option",{value:s,children:i},s)})]}),!d.filter_standard_structure_id&&(0,N.jsx)("option",{value:null,children:s.formatMessage({id:"label.select_standard.a1877c4e",defaultMessage:"Select standard"})})]})]}),(0,N.jsxs)(Ce.S,{className:"d-grid gap-2 mt-2",children:[(0,N.jsx)(ve.A,{block:!0,onClick:n,variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Apply filters",id:"label.apply_filters.d80ab19b"})}),(0,N.jsx)(ve.A,{variant:"outline-primary",onClick:()=>{r("filter_standard_structure_id",""),r("filter_standard_root_category_id","")},children:(0,N.jsx)(ke.A,{defaultMessage:"Clear filters",id:"label.clear_filters.7179ea00"})})]})]})}})]}),(0,N.jsxs)(Ve.A,{md:9,children:[(0,N.jsxs)(Ei.A,{size:"sm",style:{maxWidth:375},children:[(0,N.jsx)(ve.A,{variant:"primary",onClick:()=>{this.doSearch()},children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{placeholder:"Search",value:this.state.search,onChange:e=>{this.setState({search:e.target.value})},onKeyDown:e=>{"Enter"==e.key&&this.doSearch()}})]}),(0,N.jsxs)(Ce.S,{className:"mt-3",children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Results",id:"label.results.219c4a6c"})}),!o&&(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Ce.S,{className:"p-3 text-center text-secondary",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"Search for standard entries above",id:"label.search_for_standard_entries_above.7871f991"})})})}),o&&0==r.length&&(0,N.jsx)(Ge.A,{body:!0,children:(0,N.jsx)(Ce.S,{className:"p-3 text-center text-secondary",children:(0,N.jsx)("b",{children:(0,N.jsx)(ke.A,{defaultMessage:"No entries found",id:"label.no_entries_found.e26243d9"})})})}),o&&r.length>0&&(0,N.jsxs)(N.Fragment,{children:[r&&r.map(e=>{const{parent:s,structure:a}=e,{root:t}=s,i=t||s;if(i.id==d)return"";d=i.id;const{token:l}=i;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ge.A,{className:"mt-2 card-standard-category",children:[(0,N.jsxs)(Ge.A.Header,{children:[(0,N.jsx)("b",{children:l}),"\xa0",(0,N.jsx)("small",{className:"float-right ms-2",children:a.name})]}),(0,N.jsxs)(qa.A,{bordered:!0,className:"mb-0",children:[(0,N.jsx)("thead",{children:(0,N.jsxs)("tr",{children:[(0,N.jsx)("th",{children:"ID"}),(0,N.jsx)("th",{children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)("th",{})]})}),(0,N.jsx)("tbody",{children:r&&r.filter(e=>{const{parent:s}=e,{root:a}=s;return(a||s).id==d}).map(e=>{const{id:s,description:a,token:t}=e;return(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{width:150},children:(0,N.jsx)("b",{className:"text-primary",children:t})}),(0,N.jsx)("td",{children:a}),(0,N.jsx)("td",{style:{verticalAlign:"middle",width:75},children:(0,N.jsx)(ve.A,{disabled:this.hasEntry(s),size:"sm",variant:"primary",onClick:()=>{this.addEntry(s)},children:(0,N.jsx)(ke.A,{defaultMessage:"Add",id:"label.add.9fd728c6"})})})]},s)})})]})]})})}),(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Pr,{className:"mt-3",count:this.state.count,page:this.state.page,page_size:this.state.page_size,onChange:e=>{this.setState({page:e},()=>{this.refreshStandards()})}})})]})]})]})]})})})]})]})})}}var GQ=(0,Ke.Ay)((0,P.G0)((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(eQ,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{content_authoring_tool:s,ref:e=>this.comp=e}))})}}return s})((e=>{class s extends l.Component{constructor(e){super(e),this.comp=null}componentDidMount(){"function"==typeof this.props.onRef&&this.props.onRef(this.getChildComponent())}getChildComponent(){return this.comp&&"function"==typeof this.comp.getChildComponent?this.comp.getChildComponent():this.comp}render(){return(0,N.jsx)(hQ,{children:s=>(0,N.jsx)(e,(0,F.A)((0,F.A)({},this.props),{},{challenge_editor:s,ref:e=>this.comp=e}))})}}return s})(VQ))));const WQ=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({error:!1,global_audience_categories:[],global_audiences:[],global_subjects:[],global_subtopics:[],global_topics:[],loading:!1}),{api:n}=(0,P.nm)(),{fetchTemplateDetails:r,prev_template:o,step:d,stub_id:c,template:h,template_id:u}=sQ(),m=async()=>{const{cartridge_template:e}=await n.get(`/api/cartridge-templates/cartridge-template/${u}`);return e||{}},g=async()=>
2{try{const{subtopics:e}=await n.get("/api/authoring/list/subtopics");t({global_subtopics:e})}catch({err:err}){t({error:err})}},p=async()=>{try{const{topics:e}=await n.get("/api/authoring/list/topics");t({global_topics:e})}catch({err:err}){t({error:err})}},x=async()=>{try{const{subjects:e}=await n.get("/api/authoring/list/subjects",{order_attr:"position",order_dir:"ASC"});t({global_subjects:e})}catch({err:err}){t({error:err})}},v=async()=>{try{const{audiences:e}=await n.get("/api/authoring/list/audiences");t({global_audiences:e})}catch({err:err}){t({error:err})}},f=async()=>{try{const{audience_categories:e}=await n.get("/api/authoring/list/audience-categories");t({global_audience_categories:e})}catch({err:err}){t({error:err})}},j=async e=>await n.post(`/api/cartridge-templates/audience-category/change/${u}`,{audience_category_id:e}),_=async()=>{var e,s,a,t;console.log("### UPDATE AUDIENCES",o,h);const i=(null===o||void 0===o||null===(e=o.audiences)||void 0===e||null===(s=e.map)||void 0===s?void 0:s.call(e,e=>null===e||void 0===e?void 0:e.audiences))||[],l=(null===h||void 0===h||null===(a=h.audiences)||void 0===a||null===(t=a.map)||void 0===t?void 0:t.call(a,e=>null===e||void 0===e?void 0:e.audiences))||[];console.log("### UPDATE AUDIENCES 0");const{additions:r,deletions:d}=((e,s)=>{var a;if((0,T.isEqual)(e,s))return{additions:[],deletions:[]};const t=(null===e||void 0===e||null===(a=e.filter)||void 0===a?void 0:a.call(e,e=>!s.includes(e)).concat(s.filter(s=>!e.includes(s))))||[],i=t.filter(s=>!e.find(e=>e.id===s.id)).map(e=>null===e||void 0===e?void 0:e.id),l=t.filter(s=>e.find(e=>e.id===s.id)).map(e=>null===e||void 0===e?void 0:e.id);return{additions:i,deletions:l}})(i,l);console.log("### UPDATE AUDIENCES 1"),null!==r&&void 0!==r&&r.length&&await(async e=>await n.post(`/api/cartridge-templates/add/audiences/${u}`,{audiences:e}))(r),console.log("### UPDATE AUDIENCES 2"),null!==d&&void 0!==d&&d.length&&await(async e=>await n.post(`/api/cartridge-templates/remove/audiences/${u}`,{audiences:e}))(d)};(0,l.useEffect)(()=>{t({loading:!0}),Promise.all([f(),v(),x(),g(),p()]).finally(()=>t({loading:!1}))},[]);const b=(null===pW||void 0===pW?void 0:pW[d])||l.Fragment,{error:A,global_audience_categories:y,global_audiences:w,global_subjects:S,global_subtopics:C,global_topics:M,is_complete:k,loading:z}=a,I={error:A,fetchGlobalSubjects:x,fetchGlobalSubtopics:g,fetchGlobalTopics:p,fetchTemplate:m,global_audience_categories:y,global_audiences:w,global_subjects:S,global_subtopics:C,global_topics:M,is_complete:k,loading:z,publishTemplate:async()=>{await n.post(`/api/cartridge-templates/publish/${u}`),await r()},saveTemplate:async function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null===(e=Object.keys(s))||void 0===e||!e.length)return await m();null!==s&&void 0!==s&&s.audience_category_id?await j(null===s||void 0===s?void 0:s.audience_category_id):null!==s&&void 0!==s&&s.audiences?await _():await n.post(`/api/cartridge-templates/save/${c}/${u}`,s),await r()},uploadPackage:(e,s)=>n.file("/api/cartridge-templates/upload/package",{cartridge_template_id:u,job_id:s},e)};return(0,l.useImperativeHandle)(s,()=>I),(0,N.jsx)(JQ,{value:I,children:(0,N.jsx)(Ce.S,{className:"content-editor cartridge d-flex justify-content-center flex-1 py-5",children:(0,N.jsx)(Me.x_,{loading:(0,T.isEmpty)(h),children:(0,N.jsx)(b,{})})})})});WQ.displayName="CartridgeEditor";var KQ=WQ;const YQ=(0,l.forwardRef)((s,a)=>{const{onHide:t}=s,i=(0,l.useRef)(),{locale:n}=(0,P.nm)(),{formatMessage:r}=(0,ja.A)(),{uploadPackage:o}=XQ(),[d,c,h]=(0,ne.CQ)({agreed_disclaimer:null,cartridge_url:"",error:null,loading:!1,reject:Function(),resolve:Function(),show:!1,type:""}),{cartridge_url:u,type:m}=d,g={cartridge_url:u||"",type:m||""},p=(0,ds.Wx)({enableReinitialize:!0,initialValues:g,onSubmit:Function(),validateOnChange:!0,validationSchema:(0,Re.by)({locale:n,scope:"content_authoring.cartridge_editor.step_7"})}),x=e=>new Promise((s,a)=>{c({cartridge_url:(null===e||void 0===e?void 0:e.cartridge_url)||"",reject:a,resolve:s,show:!0,type:(null===e||void 0===e?void 0:e.type)||""})}),v=()=>{d.resolve(null),h(),p.resetForm(),"function"===typeof t&&t()},f=async(s,a)=>{try{const{type:e}=s;if(!e||!["application/zip","application/x-zip-compressed"].includes(e))return c({error:r({id:"label.invali
2d_file_type_detected_accepta.cbf04969",defaultMessage:"Invalid file type detected, acceptable file types are: ZIP"}),uploading:!1});c({uploading:!0});const{path:t,version:i}=await o(s,a);if(!t)throw r({id:"label.unable_to_retrieve_file_path_from.43e1fec7",defaultMessage:"Unable to retrieve file path from response"});await p.setFieldValue("cartridge_url",t),await p.setFieldValue("type",i),await p.setTouched({cartridge_url:!0,type:!0}),setTimeout(p.validateForm,0),c({uploading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,uploading:!1})}},j=async()=>{await p.setFieldValue("cartridge_url",""),await p.setFieldValue("type",""),await p.setTouched({cartridge_url:!0,type:!0})},_=()=>{const e=null===i||void 0===i?void 0:i.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:r({id:"label.delete.e2d0a549",defaultMessage:"Delete"}),onClick:j,variant:"danger"})],body:r({id:"label.are_you_sure_you_want_to_delete_th.34212680",defaultMessage:"Are you sure you want to delete the current package?"}),size:"sm",title:r({id:"label.delete_package.89462b49",defaultMessage:"Delete package"})})};(0,l.useImperativeHandle)(a,()=>({hide:v,show:x})),(0,l.useEffect)(()=>h,[]);const{agreed_disclaimer:b,error:A,formik_key:y,loading:w,show:S,uploading:C}=d,{errors:M,isValid:k,touched:z,values:T}=p;return(0,N.jsxs)(xe,{backdrop:"static",onHide:v,show:S,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Upload package",id:"label.upload_package.5bbc805b"})})}),(0,N.jsx)(ds.QI,{value:p,children:(0,N.jsx)(_e.A,{onSubmit:e=>{var s;(e.preventDefault(),null!==p&&void 0!==p&&p.isValid)&&(s=p.values,d.resolve(s),v())},children:(0,N.jsxs)(Me.x_,{loading:w,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:!1}),show:A,variant:"danger",children:A}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"value",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload a cartridge",id:"label.upload_a_cartridge.747d9868"})}),(0,N.jsx)(ds.D0,{name:"cartridge_url",children:()=>(0,N.jsx)(N.Fragment,{children:null!==T&&void 0!==T&&T.cartridge_url?(0,N.jsx)(os,{children:(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(be.A,{disabled:!0,isInvalid:(null===z||void 0===z?void 0:z.cartridge_url)&&(null===M||void 0===M?void 0:M.cartridge_url),isValid:(null===z||void 0===z?void 0:z.cartridge_url)&&!(null!==M&&void 0!==M&&M.cartridge_url),readOnly:!0,value:null===T||void 0===T?void 0:T.cartridge_url}),(0,N.jsx)(ve.A,{onClick:_,variant:"outline-secondary",children:(0,N.jsx)(ze.qbC,{})})]})}):(0,N.jsx)(fa,{onSubmit:f,submitting:C})})}),(0,N.jsx)(ds.Kw,{name:"cartridge_url",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"type",children:(0,N.jsx)(ke.A,{defaultMessage:"Detected version",id:"label.detected_version.841ea3e9"})}),(0,N.jsx)("p",{className:!(null!==T&&void 0!==T&&T.type)&&"text-muted",children:(e=>{switch(e){case"scorm2004":return"SCORM 2004";case"scorm12":return"SCORM 1.2";default:return"No version detected"}})(null===T||void 0===T?void 0:T.type)}),(0,N.jsx)(ds.Kw,{name:"type",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]}),(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-center my-2",children:(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",onClick:async()=>{c({agreed_disclaimer:!b}),await p.setTouched({cartridge_url:!0,type:!0})},children:(0,N.jsx)(_e.A.Check,{alignItems:"center",checked:b,id:"step13-disclaimer",label:(0,N.jsx)(ke.A,{defaultMessage:"I agree that I have obtained permission to use this content.",id:"label.i_agree_that_i_have_obtained_permi.ddc62dc1"})})})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsxs)(Ce.S,{className:"float-end mt-4",children:[(0,N.jsx)(ve.A,{className:"me-3",onClick:v,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!b||!k,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})})]})})},y),(0,N.jsx)(je,{ref:i})]})});
2YQ.displayName="CartridgePackageUploader";const qQ=l.createContext({}),JQ=qQ.Provider,XQ=(qQ.Consumer,()=>(0,l.useContext)(qQ)),ZQ=(0,l.forwardRef)((s,a)=>{const{onCreate:t,onHide:i}=s,{api:n}=(0,P.nm)(),{fetchGlobalSubjects:r,global_audience_categories:o}=XQ(),{fetchTemplateDetails:d,template:c,template_id:h}=sQ(),{audience_category_id:u}=c||{},m=(0,l.useRef)(),[g,p,x]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1}),v=()=>p({error:null}),f=e=>new Promise((e,s)=>{p({reject:s,resolve:e,show:!0})}),j=()=>{g.resolve(null),x(),"function"===typeof i&&i()},_=async s=>{try{var a,i,l;const{audience_category:e,name:o}=s,c=(null===o||void 0===o||null===(a=o.toLowerCase)||void 0===a||null===(i=a.call(o))||void 0===i||null===(l=i.replace)||void 0===l?void 0:l.call(i,/ /g,"-"))||"";p({loading:!0}),await n.post(`/api/cartridge-templates/add/subject/${h}`,{audience_category_id:e,name:o,new_subject_slug:c}),Promise.all([r(),d()]).then(()=>{p({loading:!1}),"function"===typeof t&&t(),(e=>{g.resolve(e),j()})()}).catch(e=>{p({error:e,loading:!1})})}catch(e){p({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e,loading:!1})}};(0,l.useImperativeHandle)(a,()=>({hide:j,show:f})),(0,l.useEffect)(()=>x,[]);const{error:b,loading:A}=g;return(0,N.jsx)(xe,{onHide:j,show:g.show,children:(0,N.jsx)(ds.l1,{onSubmit:async e=>await _(e),initialValues:{audience_category:Number.parseInt(u)||1,name:""},children:e=>{m.current=e;const{errors:s,handleChange:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create new subject",id:"label.create_new_subject.ffabc0bb"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:v,show:b,variant:"danger",children:b}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Subject name",id:"label.subject_name.6323b517"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"New Subject",isInvalid:(null===i||void 0===i?void 0:i.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===i||void 0===i?void 0:i.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,placeholder:"e.g. Math",type:"text",value:l.name}),(null===s||void 0===s?void 0:s.name)&&(null===i||void 0===i?void 0:i.name)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.name})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(_e.A.Select,{"aria-label":"Subject Associated Audience Category",isInvalid:(null===i||void 0===i?void 0:i.audience_category)&&(null===s||void 0===s?void 0:s.audience_category),isValid:(null===i||void 0===i?void 0:i.audience_category)&&!(null!==s&&void 0!==s&&s.audience_category),name:"audience_category",onChange:a,value:l.audience_category,children:o&&o.map((e,s)=>{let{id:a,name:t}=e;return(0,N.jsx)("option",{value:a,children:t},`${s}-${a}`)})})]})]})})]}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(Me.p0,{loading:A,onClick:t,type:"submit",variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add subject",id:"label.add_subject.428012ea"})})})]})}})})});ZQ.displayName="AddSubjectModal";var $Q=ZQ;const eV=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t}=(0,P.nm)(),{fetchTemplateDetails:i,template:n}=sQ(),{fetchGlobalTopics:r}=XQ(),o=(0,l.useRef)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1}),u=()=>c({error:null}),m=e=>new Promise((e,s)=>{c({reject:s,resolve:e,show:!0})}),g=()=>{d.resolve(null),h(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m}));const{error:p,loading:x,show:v}=d;return(0,N.jsxs)(xe,{backdrop:"static",onHide:g,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create topic",id:"label.create_topic.488184ed"})})}),(0,N.jsx)(ds.l1,{initialValues:{name:""},onSubmit:async e=>{const s=await(async e=>{try{c({loading:!0});const{topic:s}=await t.post("/api/cartridge-templates/add/topic",{cartridge_template_id:null===n||void 0===n?void 0:n.id,new_topic_name:e});return await r(),c({loading:!1}),s}catch(p){c({error:null===p||void 0===p?void 0:p.err,loading:!1})}})(null===e||void 0===e?void 0:e.name);s&&(await i(),(e=>{d.resolve(e),g()})(s))},validateOnChange:!0,children:e=>{o.current=e;const{errors:s,handleChange:a,handleSubmit:t,isValid:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:u,show:p,variant:"danger",children:p}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Topic name",id:"label.topic_name.c05cbe5c"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===l||void 0===l?void 0:l.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===l||void 0===l?void 0:l.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,value:null===n||void 0===n?void 0:n.name})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disbled:!i,loading:x,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});eV.displayName="AddTopicModal";var sV=eV;const aV=(0,l.forwardRef)((e,s)=>{const{onHide:a}=e,{api:t}=(0,P.nm)(),{fetchTemplateDetails:i,template:n}=sQ(),{fetchGlobalSubtopics:r}=XQ(),o=(0,l.useRef)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!1,reject:Function(),resolve:Function(),show:!1}),u=()=>c({error:null}),m=e=>new Promise((e,s)=>{c({reject:s,resolve:e,show:!0})}),g=()=>{d.resolve(null),h(),"function"===typeof a&&a()};(0,l.useImperativeHandle)(s,()=>({hide:g,show:m}));const{error:p,loading:x,show:v}=d;return(0,N.jsxs)(xe,{backdrop:"static",onHide:g,show:v,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Create subtopic",id:"label.create_subtopic.325280c2"})})}),(0,N.jsx)(ds.l1,{initialValues:{name:""},onSubmit:async e=>{const s=await(async e=>{try{c({loading:!0});
2const{subtopic:s}=await t.post("/api/cartridge-templates/add/subtopic",{cartridge_template_id:null===n||void 0===n?void 0:n.id,new_subtopic_name:e});return await r(),c({loading:!1}),s}catch(p){c({error:null===p||void 0===p?void 0:p.err,loading:!1})}})(null===e||void 0===e?void 0:e.name);s&&(await i(),(e=>{d.resolve(e),g()})(s))},validateOnChange:!0,children:e=>{o.current=e;const{errors:s,handleChange:a,handleSubmit:t,isValid:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:u,show:p,variant:"danger",children:p}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"name",children:(0,N.jsx)(ke.A,{defaultMessage:"Subtopic name",id:"label.subtopic_name.6403005e"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===l||void 0===l?void 0:l.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===l||void 0===l?void 0:l.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,value:null===n||void 0===n?void 0:n.name})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disbled:!i,loading:x,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});aV.displayName="AddSubTopicModal";var tV=aV;const iV=(0,l.forwardRef)((s,a)=>{const{fetchTemplateDetails:t,step:i,stub_id:n,template:r,template_id:o}=sQ(),{api:d}=(0,P.nm)(),[c,h]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),[g,p]=(0,l.useState)([]);(0,l.useEffect)(()=>{x()},[]);const x=async()=>{try{const{categories:e}=await d.get("/api/agent-templates/categories/list");p(e||[])}catch(e){}},v=async()=>{try{h(!0);const{persona:e}=await d.get(`/api/agent-templates/personas/persona/${o}`);return h(!1),e||{}}catch(e){return m((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e),h(!1),null}},f={categories:g,error:u,fetchCategories:x,fetchTemplate:v,loading:c,publishTemplate:async()=>{try{await d.post(`/api/agent-templates/personas/publish/${o}`,{make_primary:!0}),await t()}catch(e){m((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e)}},saveTemplate:async function(){let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var a;if(null===(a=Object.keys(s))||void 0===a||!a.length)return await v();await d.post(`/api/agent-templates/personas/save/${n}/${o}`,s),await t()}catch(e){m((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e)}}};(0,l.useImperativeHandle)(a,()=>f);const j=(null===YU||void 0===YU?void 0:YU[i])||l.Fragment;return(0,N.jsx)(HU,{value:f,children:(0,N.jsx)(Ce.S,{className:"content-editor agent d-flex justify-content-center flex-1 py-5",children:(0,N.jsx)(Me.x_,{loading:(0,T.isEmpty)(r),children:(0,N.jsx)(j,{})})})})});iV.displayName="AgentEditor";var lV,nV=iV;const{parseBinary:rV}=null!==(lV=null===Re._$||void 0===Re._$?void 0:Re._$.binary)&&void 0!==lV?lV:{},oV=(0,l.forwardRef)((s,a)=>{const{api:t}=(0,P.nm)(),{fetchTemplateDetails:i,handleChangeTemplateData:n,prev_template:r,setError:o,setStatus:d,setTimedStatus:c,step:h,stub_id:u,template:m,template_id:g}=sQ(),[p,x,v]=(0,ne.CQ)({components:[],global_audience_categories:[],global_audiences:[],global_subjects:[],global_subtopics:[],global_topics:[],loading:!0,prev_components:[]}),{components:f,global_audience_categories:j,global_audiences:_,global_subjects:b,global_subtopics:A,global_topics:y,loading:w}=p,S=async()=>{const{group_assignment_template:e}=await t.get(`/api/group-assignment-templates/get/${g}`);return e||{}},C=async()=>{const{components:e=[]}=await t.get(`/api/group-assignment-templates/get-components/${g}`);x({components:e,prev_components:e})},M=async()=>{try{const{subtopics:e}=await t.get("/api/authoring/list/subtopics");x({global_subtopics:e})}catch({err:err}){x({error:err})}},k=async()=>{try{const{topics:e}=await t.get("/api/authoring/list/topics");x({global_topics:e})}catch({err:err}){x({error:err})}},z=async()=>{try{const{subjects:e}=await t.get("/api/authoring/list/subjects",{order_attr:"position",order_dir:"ASC"});x({global_subjects:e})}catch({err:err}){x({error:err})}},I=async()=>{try{const{audiences:e}=await t.get("/api/authoring/list/audiences");x({global_audiences:e})}catch({err:err}){x({error:err})}},E=async()=>{try{const{audience_categories:e}=await t.get("/api/authoring/list/audience-categories");x({global_audience_categories:e})}catch({err:err}){x({error:err})}},R=async e=>await t.post(`/api/group-assignment-templates/audience-category/c
2hange/${g}`,{audience_category_id:e}),D=async()=>{var e,s,a,i;const l=(null===r||void 0===r||null===(e=r.audiences)||void 0===e||null===(s=e.map)||void 0===s?void 0:s.call(e,e=>null===e||void 0===e?void 0:e.audiences))||[],n=(null===m||void 0===m||null===(a=m.audiences)||void 0===a||null===(i=a.map)||void 0===i?void 0:i.call(a,e=>null===e||void 0===e?void 0:e.audiences))||[],{additions:o,deletions:d}=((e,s)=>{var a;if((0,T.isEqual)(e,s))return{additions:[],deletions:[]};const t=(null===e||void 0===e||null===(a=e.filter)||void 0===a?void 0:a.call(e,e=>!s.includes(e)).concat(s.filter(s=>!e.includes(s))))||[],i=t.filter(s=>!e.find(e=>e.id===s.id)).map(e=>null===e||void 0===e?void 0:e.id),l=t.filter(s=>e.find(e=>e.id===s.id)).map(e=>null===e||void 0===e?void 0:e.id);return{additions:i,deletions:l}})(l,n);null!==o&&void 0!==o&&o.length&&await(async e=>await t.post(`/api/group-assignment-templates/add/audiences/${g}`,{audiences:e}))(o),null!==d&&void 0!==d&&d.length&&await(async e=>await t.post(`/api/group-assignment-templates/remove/audiences/${g}`,{audiences:e}))(d)},B=()=>Promise.all([i(),C()]).catch(e=>{throw e}),L=()=>x({components:p.prev_components});(0,l.useEffect)(()=>{x({loading:!0}),Promise.all([C(),E(),I(),z(),M(),k()]).finally(()=>x({loading:!1}))},[]);const O={addModule:async s=>{try{if("object"!==typeof s)throw new Error("Invalid module");d("saving"),await t.post(`/api/group-assignment-templates/add/module/${g}`,(0,F.A)({},s)),await B(),c("saved",2500)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o(a),d("error")}},canEditModules:()=>{if((0,T.isEmpty)(m))return!1;const{published:e,total_learners_started:s}=m;return!rV(e)||!s},components:f,fetchGlobalSubjects:z,fetchGlobalSubtopics:M,fetchGlobalTopics:k,fetchTemplate:S,global_audience_categories:j,global_audiences:_,global_subjects:b,global_subtopics:A,global_topics:y,handleToggleForceOrder:async s=>{try{d("saving"),await n({force_order:s}),await t.post("/api/group-assignment-templates/toggle-force-order",{force_order:s,group_assignment_template_id:g}),await B(),c("saved",2500)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o(a),d(a)}},loading:w,publishTemplate:async()=>{await t.post(`/api/group-assignment-templates/publish/${g}`),await i()},refreshTemplateAndComponents:B,removeModule:async s=>{try{d("saving"),await t.post(`/api/group-assignment-templates/remove/module/${g}/${s}`),await B(),c("saved",2500)}catch(e){L();const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o(a),d(a)}},saveTemplate:async function(){var e;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null===(e=Object.keys(s))||void 0===e||!e.length)return await S();null!==s&&void 0!==s&&s.audience_category_id?await R(null===s||void 0===s?void 0:s.audience_category_id):null!==s&&void 0!==s&&s.audiences?await D():await t.post(`/api/group-assignment-templates/save/${u}/${g}`,s),await i()},softSetComponents:e=>x({components:e,prev_components:p.components}),swapModules:async(s,a)=>{try{d("saving"),await t.post("/api/group-assignment-templates/swap-component-order",{component_a:s,component_b:a}),await B(),c("saved",2500)}catch(e){L();const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;o(a),d("error")}}};(0,l.useImperativeHandle)(a,()=>O);const H=(null===iW||void 0===iW?void 0:iW[h])||l.Fragment;return(0,N.jsx)(hV,{value:O,children:(0,N.jsx)(Ce.S,{className:"content-editor journey d-flex justify-content-center flex-1 py-5",children:(0,N.jsx)(Me.x_,{loading:(0,T.isEmpty)(m),children:(0,N.jsx)(H,{})})})})});oV.displayName="JourneyEditor";var dV=oV;const cV=l.createContext({}),hV=cV.Provider,uV=(cV.Consumer,()=>(0,l.useContext)(cV));var mV=t(44797);var gV=s=>{const{setError:a,setStatus:t,setTimedStatus:i}=sQ(),{addModule:n,canEditModules:r,components:o,refreshTemplateAndComponents:d,removeModule:c,softSetComponents:h,swapModules:u}=uV(),m=r(),[g,p,x]=(0,ne.CQ)({lock_cards:!1}),{lock_cards:v}=g,f=(0,l.useRef)(),j=(0,l.useRef)(),_=(0,ui.FR)((0,ui.MS)(ui.AN,{activationConstraint:{distance:2}}),(0,ui.MS)(ui.uN,{activationConstraint:{distance:2},coordinateGetter:mV.JR})),b=async()=>{const e=null===f||void 0===f?void 0:f.current;if(!e)return;const s=await e.show({scope:["challenge","cartridge"]});if(!s)return;let a=null===s||void 0===s?void 0:s.component,t=null,i=null,l={cartridge_template:null,challenge_template:null};a.hasOwnProperty("challenge_template_stub_id")?(t=null===a||void 0===a?void 0:a.id,l.challenge_template=a):a.hasOwnProperty("cartridge_template_stub_id")&&(i=null===a||void 0===a?void 0:a.id,l.cartridge_template=a);const r={cartridge_template_id:i,challenge_template_id:t,order:(null===o||void 0===o?void 0:o.length)+1};p({lock_cards:!0}),await n(r),p({lock_cards:!1})},A=async e=>{const{active:s,over:a}=e;if((null===s||void 0===s?void 0:s.id)===(null===a||void 0===a?void 0:a.id))return;const t=o.findIndex(e=>(null===e||void 0===e?void 0:e.id)===(null===s||void 0===s?void 0:s.id)),i=o.findIndex(e=>(null===e||void 0===e?void 0:e.id)===(null===a||void 0===a?void 0:a.id)),l=(0,mV.be)(o,t,i);h(l),await(async(e,s)=>{p({lock_cards:!0}),await u(e,s),p({lock_cards:!1})})(null===s||void 0===s?void 0:s.id,null===a||void 0===a?void 0:a.id)};return(0,N.jsx)(bV,{value:{handleAddModule:b,handleDragEnd:A,handleRemoveModule:async e=>{const s=(0,T.clone)(o).filter(s=>s.id!==e);h(s),p({lock_cards:!0}),await c(e),p({lock_cards:!1})},handleSelectVersion:async s=>{try{const e=null===j||void 0===j?void 0:j.current;if(!e)return;await e.show(s)&&(p({lock_cards:!0}),await d(),p({lock_cards:!1}),i("saved",2500))}catch(e){const i=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;p({lock_cards:!1}),t("error"),a(i)}},lock_cards:v},children:(0,N.jsxs)(Ce.S,{className:"learning-module-arranger mt-3 "+(v?"locked":""),children:[(null===o||void 0===o?void 0:o.length)<1?(0,N.jsxs)(ph,{className:"d-flex align-self-start position-relative align-items-center",condition:!m,disabled:!m,onClick:b,tooltipContent:(0,N.jsx)(ke.A,{defaultMessage:"You may not modify learning modules after 1 or more learners have started",id:"label.you_may_not_modify_learning_module.a01b040d"}),children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Add module",id:"label.add_module.588fb674"})]}):(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(ui.Mp,{collisionDetection:ui.fp,onDragEnd:A,sensors:_,children:(0,N.jsx)(mV.gB,{items:o,strategy:mV._G,children:!(null===o||void 0===o||!o.length)&&o.map(e=>(0,N.jsx)(vV,{component:e,disabled:!m||v,id:null===e||void 0===e?void 0:e.id},null===e||void 0===e?void 0:e.id))})}),m&&(0,N.jsx)(vV,{is_placeholder:!0,disabled:v})]}),(0,N.jsx)(cd,{ref:f}),(0,N.jsx)(jV,{ref:j})]})})},pV=t(47453);const xV=e=>{const{component:s,disabled:a,is_placeholder:t}=e,{type:i}=s||{},l=(()=>{switch(i){case"journey":return null===s||void 0===s?void 0:s.group_assignment_template;
2case"challenge":case"cartridge":return null===s||void 0===s?void 0:s[`${i}_template`];default:return{}}})(),{id:n,name:r,stub:o,title:d,total_est_completion_time:c,version_title:h=""}=l||{},u=n===(null===o||void 0===o?void 0:o.primary_key_id),{attributes:m,listeners:g,setNodeRef:p,transform:x,transition:v}=(0,mV.gl)({id:null===e||void 0===e?void 0:e.id}),{handleAddModule:f,handleRemoveModule:j,handleSelectVersion:_}=AV(),{width:b}=(0,ne.vh)(),{styles:A}=(0,P.nm)(),{primary:y}=A,w={transform:pV.Ks.Translate.toString(x),transition:v},S=oa()("journey-component-template-card d-flex w-100 mb-2",{disabled:a,"p-0 card-placeholder":!!t});return(0,N.jsx)(Ge.A,(0,F.A)((0,F.A)((0,F.A)({className:S,ref:p,style:w},g),m),{},{children:t?(0,N.jsxs)(ve.A,{className:"contents-placeholder d-flex align-items-center text-decoration-none p-4 flex-1",disabled:a,onClick:f,variant:"link",children:[(0,N.jsx)(Ce.S,{className:"add-icon me-4 d-flex justify-content-center align-items-center",children:(0,N.jsx)(ze.OiG,{color:y})}),(0,N.jsx)("h5",{className:"m-0 text-dark text-capitalize",children:(0,N.jsx)(ke.A,{defaultMessage:"Add module",id:"label.add_module.588fb674"})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"dragger",children:(0,N.jsx)("span",{children:(0,N.jsx)(ze.OXb,{className:"text-secondary",size:24})})}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-center",children:(0,N.jsx)(Ad,{component:l,size:b<992?40:48,type:i})}),(0,N.jsxs)(Ce.S,{className:"component-details d-flex",children:[(0,N.jsx)(Ce.S,{className:"w-100",style:{flex:1},children:(0,N.jsx)(Fl,{as:"h6",className:"mb-0 me-2",inline:!0,maxWidth:b<992?200:250,children:d||r})}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-end",children:[u?(0,N.jsx)("small",{children:(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"me-3 d-none d-lg-block d-flex align-items-center",style:{fontSize:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Primary",id:"label.primary.efe10c80"})})}):(0,N.jsxs)("small",{className:"text-muted me-3 d-none d-lg-block d-flex align-items-center",children:[(0,N.jsx)(ze.dMP,{className:"me-2"}),h]}),(0,N.jsxs)("small",{className:"text-muted me-3 d-none d-lg-block",children:[(0,N.jsx)(ze.w_X,{className:"me-2"}),(0,N.jsx)(Vh,{duration:c,unit:"minutes"})]}),(0,N.jsx)(bo.A,{pill:!0,bg:"secondary",className:"d-flex justify-content-center align-items-center text-capitalize align-self-center",style:{fontWeight:400},children:(0,N.jsx)("small",{children:i})})]})]}),(0,N.jsx)(Ce.S,{className:"component-options d-flex justify-content-center align-items-center",children:(0,N.jsxs)(Fi.A,{disabled:a,id:`${null===s||void 0===s?void 0:s.id}-module-options`,title:(0,N.jsx)(ze.H_v,{color:"var(--secondary)"}),variant:"link",children:[(0,N.jsx)(li.A.Item,{className:"btn btn-link d-flex",onClick:async()=>await _(s),children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center dropdown-btn",children:[(0,N.jsx)(ze.dMP,{className:"me-2"}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Change version...",id:"label.change_version.baa6667c"})})]})}),(0,N.jsx)(Ce.S,{className:"dropdown-separator"}),(0,N.jsx)(li.A.Item,{className:"btn btn-link d-flex",onClick:()=>j(null===s||void 0===s?void 0:s.id),children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center dropdown-btn",children:[(0,N.jsx)(ze.qbC,{className:"me-2"}),(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Remove {component_type}",id:"label.remove_component_type.c66c05c8",values:{component_type:i}})})]})})]})})]})}))};xV.defaultProps={component:{},disabled:!1,is_placeholder:!1};var vV=xV;const fV=(0,l.forwardRef)((e,s)=>{var a,t;const{onHide:i}=e,[n,r,o]=(0,ne.CQ)({component:null,component_template:null,component_type:null,error:null,isPrimary:!0,loading:!1,reject:Function(),resolve:Function(),saving:!1,show:!1,sort_direction:"ASC",sort_token:"title",stub_id:null,version_selected:null,versions:[]}),{error:d,loading:c,saving:h,show:u,version_selected:m}=n,{api:g}=(0,P.nm)(),{template:p}=sQ(),x=(0,l.useRef)(null),v=()=>{"function"===typeof i&&i(),n.resolve(null),f()},f=()=>o(),j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return new Promise((s,a)=>{const{challenge_template:t}=e||{};let i,l;var n;t&&(i="challenge",l=null===e||void 0===e||null===(n=e.challenge_template)||void 0===n?void 0:n.challenge_template_stub_id);let o={component:e,component_template:null===e||void 0===e?void 0:e.challenge_template,component_type:i,reject:a,resolve:s,show:!0,stub_id:l};r(o)})},_=async()=>{try{r({loading:!0});const{primary:e,stub:s,versions:a}=await g.get(`/api/group-assignment-templates/modules/stub/versions/${n.component_type}/${n.stub_id}`,{sort_direction:n.sort_direction,sort_token:n.sort_token});r({loading:!1,primary:e,stub:s,versions:a})}catch(d){r({error:d,loading:!1,primary:[],stub:[],versions:[]})}};return(0,l.useEffect)(()=>{n.isPrimary&&r({version_selected:null})},[n.isPrimary]),(0,l.useImperativeHandle)(s,()=>({hide:v,show:j})),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{backdrop:!c&&!h||"static",dialogClassName:"module-version-selector-modal",onHide:v,onShow:_,show:u,size:"xl",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{children:[(0,N.jsx)("h4",{children:null===n||void 0===n||null===(a=n.component_template)||void 0===a?void 0:a.title}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select the version of this module you'd like to use for {title}",id:"message.select_the_version_of_this_module.85659",values:{title:(0,N.jsx)("strong",{children:null===p||void 0===p?void 0:p.title})}})})]})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>r({error:null}),show:d,variant:"danger",children:d}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center list-item",children:[(0,N.jsx)(Ce.S,{className:"text-center mx-2",children:(0,N.jsx)(_e.A.Check,{checked:null===n||void 0===n?void 0:n.isPrimary,disabled:c||h,onClick:()=>r({isPrimary:!0}),type:"radio"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("strong",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Use current primary version",i
2d:"label.use_current_primary_version.045775a8"})}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"I want to use the current primary version of this module.",id:"label.i_want_to_use_the_current_primary.e82aa6a3"})})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center list-item mt-4",children:[(0,N.jsx)(Ce.S,{className:"text-center mx-2",children:(0,N.jsx)(_e.A.Check,{checked:!(null!==n&&void 0!==n&&n.isPrimary),disabled:c||h,onClick:()=>r({isPrimary:!1}),type:"radio"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("strong",{className:"d-block",children:(0,N.jsx)(ke.A,{defaultMessage:"Select specific version...",id:"label.select_specific_version.e4e12e93"})}),(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"I want to choose a specific version that won't change when the primary version changes.",id:"label.i_want_to_choose_a_specific_versio.f4898c82"})})]})]}),!(null!==n&&void 0!==n&&n.isPrimary)&&(0,N.jsxs)(ho,{defaultSortDirection:null===n||void 0===n?void 0:n.sort_direction,defaultSortToken:null===n||void 0===n?void 0:n.sort_token,onSort:async(e,s)=>r({sort_direction:s,sort_token:e},_),children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{className:"checkbox-col"}),(0,N.jsx)(ho.Th,{sortable:!0,name:"title",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"version",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Status",id:"label.status.920e413c"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"assigned",children:(0,N.jsx)(ke.A,{defaultMessage:"Assigned",id:"label.assigned.8191888d"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"started",children:(0,N.jsx)(ke.A,{defaultMessage:"started",id:"label.started.03494afd"})}),(0,N.jsx)(ho.Th,{sortable:!0,name:"completed",children:(0,N.jsx)(ke.A,{defaultMessage:"completed",id:"label.completed.4ddb3e96"})}),(0,N.jsx)(ho.Th,{sortable:!0,className:"date-col",name:"last-edited",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:9,loading:c,children:null!==n&&void 0!==n&&null!==(t=n.versions)&&void 0!==t&&t.length?(0,N.jsx)(N.Fragment,{children:n.versions.map(e=>{const{id:s,published:a=null,stub:t=null,title:i,total_learners_assigned:l=0,total_learners_completed:o=0,total_learners_started:d=0,updated_at:u,version_title:g}=e;return(0,N.jsxs)(ho.Tr,{className:""+(m===s?"row-selected":""),style:{maxWidth:200},children:[(0,N.jsx)(ho.Td,{className:"checkbox-col",children:(0,N.jsx)(_e.A.Check,{checked:m===s,disabled:c||h,id:s,onClick:()=>r({version_selected:s}),type:"radio"})}),(0,N.jsx)(ho.Td,{className:"text-center",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:(0,N.jsx)("span",{children:i})}),(0,N.jsx)(ho.Td,{className:"text-center",children:g}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(KF,{primary:s===(null===t||void 0===t?void 0:t.primary_key_id),published:1===a})}),(0,N.jsx)(ho.Td,{className:"text-center",children:l}),(0,N.jsx)(ho.Td,{className:"text-center",children:d}),(0,N.jsx)(ho.Td,{className:"text-center",children:o}),(0,N.jsx)(ho.Td,{className:"text-center",children:(0,N.jsx)(Gh.XU,{value:u})}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsx)(ve.A,{onClick:e=>(async(e,s)=>{const a=null===x||void 0===x?void 0:x.current;if(!a)return;e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const{component:t}=await a.show({component_id:s,selectable:!0,type:null===n||void 0===n?void 0:n.component_type})||{};t&&r({isPrimary:!1,version_selected:null===t||void 0===t?void 0:t.id})})(e,s),variant:"secondary",children:"View"})})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-muted",colSpan:9,children:(0,N.jsx)(ke.A,{defaultMessage:"No versions found",id:"label.no_versions_found.9f3bfc4a"})})})})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-nowrap mt-3 w-100 justify-content-end",children:[(0,N.jsx)(ve.A,{className:"me-2",disabled:c||h,onClick:f,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(Me.p0,{disabled:c||h,loading:h,onClick:async()=>{var e;const s=m||(null===n||void 0===n||null===(e=n.stub)||void 0===e?void 0:e.primary_key_id)||null;var a;
2s&&(r({saving:!0}),await g.post("/api/group-assignment-templates/modules/versions/swap",{current_component_id:null===n||void 0===n||null===(a=n.component)||void 0===a?void 0:a.id,preferred_template_id:s,template_type:null===n||void 0===n?void 0:n.component_type}),r({saving:!1}),n.resolve(),v())},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Done",id:"label.done.11a6767d"})})]})]})]}),(0,N.jsx)(Uh,{ref:x})]})});fV.displayName="ModuleVersionSelectorModal";var jV=fV;const _V=l.createContext({}),bV=_V.Provider,AV=(_V.Consumer,()=>(0,l.useContext)(_V));var yV={agent:nV,cartridge:KQ,certification:tQ,challenge:oQ,journey:dV};var wV=e=>{const{loading:s}=sQ();return(0,N.jsx)(Ce.S,{className:"content-authoring-tool-sidebar content-sidebar",children:(0,N.jsx)(Me.x_,{loading:s,children:(0,N.jsx)(NV,{})})})};var NV=e=>{const{getCurrentSectionDetails:s,getEditorSections:a}=sQ(),t=a()||[],i=s(),[n,r,o]=(0,ne.CQ)({active_section:(null===i||void 0===i?void 0:i.id)||0}),d=e=>r({active_section:e});return(0,l.useEffect)(()=>{d(null===i||void 0===i?void 0:i.id)},[i]),(0,N.jsx)(Ce.S,{className:"content-authoring-sections-list",children:!(null===t||void 0===t||!t.length)&&t.map((e,s)=>(0,N.jsx)(RV,{active:n.active_section===s,ind:s,onSelect:d,section:e},s))})};var SV=e=>{const{step:s}=e,{title:a,valid:t}=s,{setStep:i,step:l}=sQ(),{styles:n}=(0,P.nm)(),{success:r}=n;return(0,N.jsxs)(Ce.S,{className:"content-authoring-section-step d-flex justify-content-between align-items-center p-3 mb-1 "+(s.id===l?"active":""),onClick:()=>i(null===s||void 0===s?void 0:s.id),role:"button",children:[a,t?(0,N.jsx)(ze.A7C,{color:r}):(0,N.jsx)(ze.EaG,{color:"var(--gray-400)"})]})};
2var CV,MV,kV,zV,TV,IV,EV,FV,RV=e=>{const{active:s,ind:a,onSelect:t,section:i}=e,{steps:l}=i||{},{styles:n}=(0,P.nm)(),{success:r,warning:o}=n,{isSectionValid:d}=sQ(),c=d(a);return(0,N.jsxs)(Ce.S,{className:"content-authoring-section d-flex flex-column "+(s?"active":""),children:[(0,N.jsxs)(Ce.S,{className:"content-authoring-section-details d-flex align-items-center justify-content-between px-3",onClick:()=>"function"===typeof t&&t(a),role:"button",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[null===i||void 0===i?void 0:i.icon,(0,N.jsx)("strong",{className:"ms-2",children:null===i||void 0===i?void 0:i.title})]}),(0,N.jsx)(Ce.S,{children:c?(0,N.jsx)(ze.CMH,{color:r}):(0,N.jsx)(ze.hUO,{color:o})})]}),(0,N.jsx)(Ce.S,{className:"content-authoring-section-steps p-1 collapse "+(s?"show":""),children:!(null===l||void 0===l||!l.length)&&i.steps.map((e,s)=>(0,N.jsx)(SV,{step:e},s))})]})};const DV=["title","titleId"];function BV(){return BV=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var t in a)({}).hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},BV.apply(null,arguments)}function PV(e,s){let{title:a,titleId:t}=e,i=function(e,s){if(null==e)return{};var a,t,i=function(e,s){if(null==e)return{};var a={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==s.indexOf(t))continue;a[t]=e[t]}return a}(e,s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(t=0;t<l.length;t++)a=l[t],-1===s.indexOf(a)&&{}.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}(e,DV);return l.createElement("svg",BV({width:40,height:40,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:s,"aria-labelledby":t},i),a?l.createElement("title",{id:t},a):null,CV||(CV=l.createElement("path",{d:"M15.5 32.5H24.5625C24.8125 32.5 25.0625 32.6875 25.0625 33V34.5625C25.0625 34.8125 24.875 35.0625 24.5625 35.0625H15.5C15.25 35.0625 15 34.875 15 34.5625V33C15 32.6875 15.1875 32.5 15.5 32.5Z",fill:"#008087"})),MV||(MV=l.createElement("path",{d:"M17.375 36.25H22.6875C22.9375 36.25 23.1875 36.4375 23.1875 36.75V38.3125C23.1875 38.5625 23 38.8125 22.6875 38.8125H17.375C17.125 38.8125 16.875 38.625 16.875 38.3125V36.75C16.875 36.4375 17.0625 36.25 17.375 36.25Z",fill:"#008087"})),kV||(kV=l.createElement("path",{d:"M19.9997 8.75C24.1247 8.75 27.4997 12.125 27.4997 16.25C27.4997 18 26.8747 19.6875 25.7497 21.0625C23.9372 23.25 22.8122 25.9375 22.5622 28.75H17.4372C17.1872 25.875 15.9997 23.1875 14.1872 21C12.9997 19.5625 12.3747 17.6875 12.4997 15.875C12.7497 12.0625 15.8122 9 19.6247 8.8125H19.9997V8.75ZM19.9997 6.25C19.6247 6.25 19.2497 6.25 18.8122 6.3125C13.3122 6.9375 9.43719 11.9375 10.0622 17.4375C10.3122 19.3125 11.0622 21.125 12.2497 22.5625C13.9997 24.625 14.9372 27.1875 14.9997 29.875V30.8125C14.9997 31.0625 15.1872 31.25 15.4997 31.3125H24.5622C24.8122 31.3125 24.9997 31.125 25.0622 30.8125V30C25.0622 27.3125 25.9997 24.75 27.6872 22.6875C31.2497 18.4375 30.6872 12.125 26.4372 8.625C24.6247 7.0625 22.3747 6.25 19.9997 6.25Z",fill:"#008087"})),zV||(zV=l.createElement("path",{d:"M19.25 0.625H20.8125C21.0625 0.625 21.25 0.8125 21.25 1.125V5.1875C21.25 5.4375 21.0625 5.625 20.75 5.625H19.1875C18.9375 5.625 18.75 5.4375 18.75 5.125V1.125C18.75 0.8125 18.9375 0.625 19.25 0.625Z",fill:"#D5D9DC"})),TV||(TV=l.createElement("path",{d:"M4.375 17V15.4375C4.375 15.1875 4.5625 15 4.875 15H8.9375C9.1875 15 9.4375 15.1875 9.4375 15.5V17.0625C9.4375 17.3125 9.25 17.5625 8.9375 17.5625H4.875C4.5625 17.5 4.375 17.3125 4.375 17Z",fill:"#D5D9DC"})),IV||(IV=l.createElement("path",{d:"M30.625 17V15.4375C30.625 15.1875 30.8125 14.9375 31.125 14.9375H35.1875C35.4375 14.9375 35.6875 15.125 35.6875 15.4375V17C35.6875 17.25 35.5 17.5 35.1875 17.5H31.125C30.8125 17.5 30.625 17.3125 30.625 17Z",fill:"#D5D9DC"})),EV||(EV=l.createElement("path",{d:"M28.1875 9.1875L27.0625 8.0625C26.875 7.875 26.875 7.5625 27.0625 7.375L29.9375 4.5C30.125 4.3125 30.4375 4.3125 30.625 4.5L31.75 5.625C31.9375 5.8125 31.9375 6.125 31.75 6.3125L28.875 9.1875C28.625 9.375 28.375 9.375 28.1875 9.1875Z",fill:"#D5D9DC"})),FV||(FV=l.createElement("path",{d:"M8.3125 5.6875L9.4375 4.5625C9.625 4.375 9.9375 4.375 10.
2125 4.5625L13 7.4375C13.1875 7.625 13.1875 7.9375 13 8.125L11.875 9.25C11.6875 9.4375 11.375 9.4375 11.1875 9.25L8.3125 6.375C8.125 6.125 8.125 5.8125 8.3125 5.6875Z",fill:"#D5D9DC"})))}const LV=l.forwardRef(PV);t.p;var OV=e=>{const{formatMessage:s}=(0,ja.A)(),{hideRight:a,right_open:t}=yy(),{getStepHints:i,loading:n}=sQ(),r=i(),o=[{ariaLabel:s({id:"label.hints.13f47db8",defaultMessage:"hints"}),eventKey:"toggle",icon:(0,N.jsx)(ze.ZPX,{color:t?"white":"black",size:24}),label:s({id:"label.hints.13f47db8",defaultMessage:"hints"})}];return(0,N.jsxs)(Me.x_,{loading:n,children:[(0,N.jsxs)(Ce.S,{className:"content-authoring-tool-sidebar hints-sidebar d-flex flex-column p-3",children:[(0,N.jsxs)(Ce.S,{className:"hints-header d-flex justify-content-between align-items-center mb-3",children:[(0,N.jsx)(LV,{}),(0,N.jsx)(ve.A,{className:"text-decoration-none text-muted p-0",onClick:a,size:"lg",variant:"link",children:(0,N.jsx)(ze.QCr,{})})]}),(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tips and hints",id:"label.tips_and_hints.ab063d30"})}),(0,N.jsx)(Ce.S,{className:"hints mt-3",children:!(null===r||void 0===r||!r.length)&&r.map((e,s)=>(0,N.jsxs)(l.Fragment,{children:[(0,N.jsx)("h6",{children:null===e||void 0===e?void 0:e.title}),"string"===typeof(null===e||void 0===e?void 0:e.body)?(0,N.jsx)("p",{className:"text-muted",children:e.body}):(0,N.jsx)(N.Fragment,{children:e.body})]},s))})]}),(0,N.jsx)(Eg,{buttons:o})]})};var HV=e=>{const{hasNextStep:s,hasPrevStep:a,isFirstStep:t,isLastStep:i,isStepValid:l,setStep:n,step:r}=sQ(),o=a(),d=s(),c=l(r),h=t(),u=i();return(0,N.jsxs)(Ce.S,{className:"content-authoring-next-prev d-flex justify-content-between",children:[(0,N.jsx)(Ce.S,{children:!h&&(0,N.jsxs)(ve.A,{disabled:!o,onClick:()=>o&&n(r-1),variant:"secondary",children:[(0,N.jsx)(ze.QVr,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Previous",id:"label.previous.a57b08a4"})]})}),(0,N.jsx)(Ce.S,{children:!u&&(0,N.jsxs)(ve.A,{disabled:!d,onClick:()=>d&&n(r+1),variant:d&&c?"primary":"secondary",children:[(0,N.jsx)(ke.A,{defaultMessage:"Next",id:"label.next.1ff57a29"}),(0,N.jsx)(ze.Z0P,{className:"ms-1"})]})})]})};var UV=e=>{const{getCurrentSectionDetails:s,getCurrentStepDetails:a}=sQ(),t=a()||{},{steps:i=[],title:l}=s()||{},n=i.indexOf(t);return(0,N.jsxs)(Ce.S,{className:"content-authoring-tool-header d-flex flex-column justify-content-center px-3",children:[(0,N.jsx)("small",{className:"text-black-50",children:l}),(0,N.jsx)("h5",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Step {step} of {steps}",id:"label.step_step_of_steps.f84f866f",values:{step:n+1,steps:(null===i||void 0===i?void 0:i.length)||0}})})]})};var QV=e=>{var s,a;const{left_open:t,toggleLeft:i}=yy(),{goBack:l,template:n,type:r}=sQ();return(0,N.jsxs)(sa.A,{className:"content-authoring-topnav d-flex justify-content-between align-items-center p-2",children:[(0,N.jsx)(sa.A.Brand,{className:"d-none d-md-block",children:(0,N.jsx)(Le.Link,{"aria-label":"Go to Solvably Home",to:"/home",children:(0,N.jsx)(Zs.A,{alt:"Solvably logo",src:Ye})})}),(0,N.jsxs)(sa.A.Collapse,{className:"d-flex justify-content-between ps-1",children:[(0,N.jsxs)(Ce.S,{className:"title-container d-flex align-items-center",children:[(0,N.jsx)(ve.A,{className:"content-close-btn btn-icon me-2 text-decoration-none text-muted",onClick:l,variant:"quaternary",children:(0,N.jsx)(ze.QVr,{size:16})}),(0,N.jsx)(ve.A,{className:"menu btn-icon me-3 d-none d-lg-block ",onClick:i,variant:t?"light":"secondary",children:(0,N.jsx)(ze.v5n,{})}),(0,N.jsxs)(Ce.S,{className:"editor-info d-flex flex-column",children:[(0,N.jsx)("small",{children:(0,N.jsx)(ke.A,{defaultMessage:"Edit {type}",id:"label.edit_type.f6ab11cd",values:{type:r}})}),(0,N.jsx)("h4",{className:"mb-0",children:null!==(s=null===n||void 0===n?void 0:n.title)&&void 0!==s?s:""})]})]}),(0,N.jsxs)(Ce.S,{className:"publish-container d-flex align-items-center",children:["certification"!==r&&(0,N.jsx)("span",{className:"me-3 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Version {version}",id:"label.version_version.a1874512",values:{version:null===n||void 0===n?void 0:n.version_title}}
2)}),(0,N.jsx)(KF,{primary:(null===n||void 0===n?void 0:n.id)===(null===n||void 0===n||null===(a=n.stub)||void 0===a?void 0:a.primary_key_id),published:1===(null===n||void 0===n?void 0:n.published)}),!["cartridge","certification"].includes(r)&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center ms-3",onClick:async()=>{switch(r){case"challenge":case"journey":return window.open(`/admin/${r}-template/preview/${null===n||void 0===n?void 0:n.id}`);default:return}},variant:"secondary",children:[(0,N.jsx)(ze.Ny1,{className:"me-2"}),(0,N.jsx)("span",{className:"text-uppercase",children:(0,N.jsx)(ke.A,{defaultMessage:"Preview",id:"label.preview.324b134f"})})]})]})]})]})};var VV=e=>{const{status:s}=sQ();return(0,N.jsx)(N.Fragment,{children:s&&(0,N.jsx)("small",{className:"text-capitalize d-flex align-items-center",children:(()=>{switch(s){case"editing":case"saving":return(0,N.jsxs)("span",{className:"text-primary",children:[s,"... ",(0,N.jsx)(qt.A,{animation:"border",className:"ms-2",size:"sm",style:{borderStyle:"dotted"}})]});case"saved":return(0,N.jsxs)("span",{className:"text-success",children:[s," ",(0,N.jsx)(ze.A7C,{className:"ms-2",color:"var(--success)",size:18})]});case"incomplete":return(0,N.jsxs)("span",{className:"text-warning",children:[s," ",(0,N.jsx)(ze.TNq,{className:"ms-2",color:"var(--warning)",size:18})]});case"error":return(0,N.jsxs)("span",{className:"text-danger",children:[s," ",(0,N.jsx)(ze._Hm,{className:"ms-2",color:"var(--danger)",size:18})]});default:return}})()})})};const GV=(0,l.forwardRef)((e,s)=>{const{formatMessage:a}=(0,ja.A)(),t={0:[{body:a({id:"label.craft_a_brief_title_of_four_words.4e222f5d",defaultMessage:"Craft a brief title of four words or less that highlights the real-world relevance of the challenge and that captivates your audience."}),title:a({id:"label.challenge_title.f741a3ee",defaultMessage:"Challenge title"})}],1:[{body:a({id:"label.identify_the_name_of_the_author_as.6aaf1f25",defaultMessage:"Identify the name of the author as you want it to appear on the syllabus page. Include any credentials that add credibility (e.g. Sally Faciliatator, Ph.D.)"}),title:a({id:"label.authors_name.d601b1e8",defaultMessage:"Author's name"})},{body:a({id:"label.provide_a_brief_biography_about_th.a5e58520",defaultMessage:"Provide a brief biography about the author that highlights his/her experience, background, and/or qualifications. Make sure to keep the biography under 500 characters."}),title:a({id:"label.authors_biography.957f0b27",defaultMessage:"Author\u2019s biography"})}],2:[{body:a({id:"label.communicate_to_your_learners_how_m.dd8c17ed",defaultMessage:"Communicate to your learners how much time is required to complete your challenge."}),title:a({id:"label.time_settings.dbb8b304",defaultMessage:"Time settings"})}],3:[{body:a({id:"label.select_the_audience_category_for_y.5378731b",defaultMessage:"Select the audience category for your challenge. Options include K-12, Higher Education, and Corporate Learning and development."}),title:a({id:"label.audience_category.2166dc58",defaultMessage:"Audience category"})}],4:[{body:a({id:"label.identify_the_grade_levels_applicab.8f4cd835",defaultMessage:"Identify the grade level(s) applicable to your challenge. The grade level(s) indicated should align to the content standards for the challenge. Similarly, the Lexile level of the Guiding Resources should match the {link}."},{link:(0,N.jsx)("a",{href:"https://lexile.com/wp-content/uploads/2018/09/Lexile-Educator-Guide-MM0066W.pdf",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Typical Lexile Reader Measures by Grade",id:"label.typical_lexile_reader_measures_by.b09509b6"})})}),title:a({id:"label.audiences.16776",defaultMessage:"Audiences"})}],5:[{body:a({id:"label.indicate_the_subject_areas_select.f85cec9a",defaultMessage:"Indicate the subject area(s); select from Math, ELA, Social Studies, and STEAM, as well as occupational (CTE and PD)."}),title:a({id:"label.featured_subject.11f09581",defaultMessage:"Featured subject"})}],6:[{body:a({id:"label.write_an_overview_1_2_paragraphs_t.5e2aa089",defaultMessage:"Write an overview (1-2 paragraphs) that describes a real-world problem. The overview should establish a need for a solution that addresses the real-world problem."}),title:a({id:"label.overview.d4b1ea57",defaultMessage:"Overview"})},{body:a({id:"label.upload_or_provide_a_link_to_a_vide.9c7f1c5d",defaultMessage:"Upload or provide a link to a video (YouTube, Vimeo, mp4, mpg, wmv, mov) that depicts the real-world problem or introduces the challenge."}),title:a({id:"label.video_trigger.bdec616b",defaultMessage:"Video trigger"})}],7:[{body:a({id:"label.select_the_type_of_question_your_r.704789a9",defaultMessage:"Select the type of question your real-world problem seeks to address."}),title:a({id:"label.question_type.efe8656f",defaultMessage:"Question type"})}],8:[{body:a({id:"label.compose_a_challenge_statement_1_2.29c0746c",defaultMessage:"Compose a challenge statement (1-2 sentences) that makes the real-world problem actionable for learners. Ensure that it is broad enough to support diverse solutions, yet focused enough to address the concepts and principles relevant to the content domain. Write this in simple and concise language. For example, in a challenge titled, \u201cLiving in Harmony with our Environment,\u201d one challenge statement may be \u201cPresent a plan to fix one major environmental problem in y
2our neighborhood to a group of local government officials.\u201d"}),title:a({id:"label.challenge_statement.85ddafbd",defaultMessage:"Challenge statement"})},{body:a({id:"label.outline_any_specific_requirements.7783b8e1",defaultMessage:"Outline any specific requirements or considerations for the completion of your challenge. These requirements will help to make expectations of acceptable challenge solutions explicit."}),title:a({id:"label.challenge_requirements.a59ed790",defaultMessage:"Challenge requirements"})}],9:[{body:a({id:"label.describe_the_specifics_of_your_del.390e6ee1",defaultMessage:"Describe the specifics of your deliverable challenge to expand on the deliverable challenge title (e.g. \u201cWrite an industry-style creative brief of a technology that provides affordable access to solar energy.\u201d"}),title:a({id:"label.deliverables.c7ec4b92",defaultMessage:"Deliverables"})},{body:a({id:"label.optional_outline_any_requirements.9fcd309e",defaultMessage:"(Optional) Outline any requirements for the completion of your identified deliverable formats (e.g. formatting, word limit, etc.). These requirements will help to make expectations of acceptable challenge deliverables explicit."}),title:a({id:"label.deliverable_requirements.143bfc38",defaultMessage:"Deliverable requirements"})}],10:[{body:a({id:"label.write_three_questions_to_highlight.170648b9",defaultMessage:"Write three questions to highlight what learners will need to know or research in order to complete the deliverable that satisfies the challenge statement."}),title:a({id:"label.guiding_questions.53a932b3",defaultMessage:"Guiding questions"})}],11:[{body:a({id:"label.provide_links_to_3_5_guiding_resou.d241cb95",defaultMessage:"Provide links to 3-5 guiding resources (documents, audio, video, etc.). These resources might illustrate the problem, provide information, facts, and statistics about the problem, or show examples of how the learner might pursue a solution to the problem. Ensure these are appropriate, open resources and not behind a paywall or subscription."}),title:a({id:"label.guiding_resources.27a607fa",defaultMessage:"Guiding resources"})}],12:[{body:a({id:"label.write_three_generative_questions_i.52ced0ae",defaultMessage:"Write three generative questions in the form of \u201cWhat if...\u201d or \u201cHow might we...\u201d as an invitation for learners to input brainstorming ideas for potential solutions. Write these questions in plain language, simple and concise."}),title:a({id:"label.what_if_questions.7d559009",defaultMessage:"What-if questions"})}],13:[{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"When writing a learning objective, it is important to:",id:"label.when_writing_a_learning_objective.87079054"})}),(0,N.jsxs)("ul",{className:"text-muted",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focus on learner behavior.",id:"label.focus_on_learner_behavior.021e0436"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Use simple, specific action verbs.",id:"label.use_simple_specific_action_verbs.56c99776"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Articulate desired performance criteria.",id:"label.articulate_desired_performance_cri.89b43c53"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focus on learner behavior.",id:"label.focus_on_learner_behavior.021e0436"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"For example, \u201cRecall the formula for area and circumference of a circle\u201d or \u201cDesign a method for minimizing human impact on the environment.\u201d",id:"label.for_example_recall_the_formula_for.4eabfd46"})})]})]}),title:a({id:"label.learning_objectives.d38eb0fc",defaultMessage:"Learning objectives"})}],14:[{body:a({id:"label.if_possible_use_a_2000x500_image_i.78a343f5",defaultMessage:"If possible, use a (2000x500) image in JPG or PNG format. This will be used as the banner image on the Syllabus page."}),title:a({id:"label.banner_image.bceaa001",defaultMessage:"Banner image"})},{body:a({id:"label.if_possible_use_a_750x500_image_in.5f372826",defaultMessage:"If possible, use a (750x500) image in JPG or PNG format. This image will be used for challenge marketplace listings."}),title:a({id:"label.cover_image.b62cee93",defaultMessage:"Cover image"})}
2,{body:a({id:"label.if_possible_use_a_500x500_image_in.f5c422f4",defaultMessage:"If possible, use a (500x500) image in JPG or PNG format. This image will be used for challenge assignment listings."}),title:a({id:"label.icon_image.9356b6da",defaultMessage:"Icon image"})}],15:[{body:a({id:"label.select_the_subject_area_topics_and.13dd63dc",defaultMessage:"Select the subject area topics and subtopics for your challenge. Or, customize your own."}),title:a({id:"label.topics_and_subtopics.a89020fc",defaultMessage:"Topics & subtopics"})}],16:[{body:a({id:"label.if_possible_use_a_2000x500_image_i.c199b089",defaultMessage:"If possible, use a (2000x500) image in JPG, GIF, or PNG format. This will be used as the banner image on the Syllabus page."}),title:a({id:"label.banner_image.bceaa001",defaultMessage:"Banner image"})},{body:a({id:"label.if_possible_use_a_250x250_image_in.88ea98c2",defaultMessage:"If possible, use a (250x250) image in JPG, GIF, or PNG format. This image will be used for challenge marketplace listings."}),title:a({id:"label.cover_image.b62cee93",defaultMessage:"Cover image"})}],17:[{body:a({id:"label.add_a_link_to_a_survey_that_will_b.31394e7c",defaultMessage:"Add a link to a survey that will be presented to learners after challenge completion."}),title:a({id:"label.survey_path.adf2d856",defaultMessage:"Survey path"})},{body:a({id:"label.add_a_message_that_will_be_present.f863ed9f",defaultMessage:"Add a message that will be presented to learners after challenge completion."}),title:a({id:"label.completion_message.9e597534",defaultMessage:"Completion message"})},{body:a({id:"label.select_from_a_list_of_available_ce.1fbea499",defaultMessage:"Select from a list of available certifications to attach to this challenge. Once the challenge has been assigned, you will not be able to detach the certification."}),title:a({id:"label.certification.86846f67",defaultMessage:"Certification"})}],18:[{body:a({id:"label.we_are_committed_to_your_success_i.6f956fd9",defaultMessage:'We are committed to your success in building effective learning experiences. Should you need additional assistance, consult the {link} page to view a list of FAQs as well as resources and training."'},{link:(0,N.jsx)("a",{href:"/support",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Support",id:"label.support.be91940b"})})}),title:a({id:"label.congratulations.6a9fac33",defaultMessage:"Congratulations!"})}],19:[{body:a({id:"label.assign_ai_agent_personas_that_will.5d97a3cf",defaultMessage:"Assign AI agent personas that will be available to assist learners as they work through this challenge. Each agent brings a unique personality, communication style, and expertise."}),title:a({id:"label.ai_agent_personas.0dd658ea",defaultMessage:"AI Agent Personas"})},{body:a({id:"label.you_can_assign_up_to_5_agents_per.a912e097",defaultMessage:"You can assign up to 5 agents per challenge. After adding an agent, click the gear icon to configure challenge-specific directions, innovative ideas to explore, and topics to avoid."}),title:a({id:"label.configuration.b332c349",defaultMessage:"Configuration"})},{body:a({id:"label.only_published_agent_personas_with.a0413cfc",defaultMessage:"Only published agent personas with an active version can be assigned to a challenge. If you don't see the agent you're looking for, check that it has been published in the Agent Personas section."}),title:a({id:"label.availability.12f67f85",defaultMessage:"Availability"})}],20:[{body:a({id:"label.attach_one_or_more_certifications.ce5bd7bb",defaultMessage:"Attach one or more certifications that learners can earn upon completing this challenge. When an administrator creates an assignment, they will choose which certification to offer from the ones you attach here."}),title:a({id:"label.certifications.471502f8",defaultMessage:"Certifications"})},{body:a({id:"label.certifications_must_be_published_b.71a2edaf",defaultMessage:"Certifications must be published before they can be attached. If you don't see the certification you're looking for, navigate to the Certifications section under Site Admin and ensure it has been published."}),title:a({id:"label.availability.12f67f85",defaultMessage:"Availability"})},{body:a({id:"label.you_can_attach_multiple_certificat.1a9e03a2",defaultMessage:"You can attach multiple certifications to a single challenge. Each certification may evaluate different c
2ompetencies or be offered by different certifying bodies. The assignment administrator will select the appropriate one when creating the assignment."}),title:a({id:"label.multiple_certifications.dcfa12b2",defaultMessage:"Multiple certifications"})},{body:a({id:"label.learners_will_only_see_the_certifi.5cc83b39",defaultMessage:"Learners will only see the certification option after their team has completed the challenge. The certification request triggers AI-powered competency evaluations that assess both individual and team performance."}),title:a({id:"label.learner_experience.98ecce0a",defaultMessage:"Learner experience"})}]},i={0:[{body:a({id:"label.craft_a_brief_title_of_four_words.903d6c65",defaultMessage:"Craft a brief title of four words or less that highlights the topic of the module and that captivates your audience."}),title:a({id:"label.title.7e8cd205",defaultMessage:"Title"})}],1:[{body:a({id:"label.write_a_brief_description_1_2_sent.1e82d28a",defaultMessage:"Write a brief description (1-2 sentences) that describes the topic in more detail. You may wish to include the purpose of the module and its contents."}),title:a({id:"label.description.526e0087",defaultMessage:"Description"})}],2:[{body:a({id:"label.if_possible_use_a_2000x500_image_i.2443fab8",defaultMessage:"If possible, use a (2000x500) image in JPG or PNG format. This will be used as the banner image on the overview page."}),title:a({id:"label.banner_image.bceaa001",defaultMessage:"Banner image"})},{body:a({id:"label.if_possible_use_a_750x500_image_in.d25165f6",defaultMessage:"If possible, use a (750x500) image in JPG or PNG format. This image will be used for module catalog listings."}),title:a({id:"label.cover_image.b62cee93",defaultMessage:"Cover image"})},{body:a({id:"label.if_possible_use_a_500x500_image_in.f0eb29b8",defaultMessage:"If possible, use a (500x500) image in JPG or PNG format. This image will be used for module assignment listings."}),title:a({id:"label.icon_image.9356b6da",defaultMessage:"Icon image"})}],3:[{body:a({id:"label.select_the_audience_category_for_y.5378731b",defaultMessage:"Select the audience category for your challenge. Options include K-12, Higher Education, and Corporate Learning and development."}),title:a({id:"label.audience_category.2166dc58",defaultMessage:"Audience category"})}],4:[{body:a({id:"label.identify_the_grade_levels_applicab.8f4cd835",defaultMessage:"Identify the grade level(s) applicable to your challenge. The grade level(s) indicated should align to the content standards for the challenge. Similarly, the Lexile level of the Guiding Resources should match the {link}."},{link:(0,N.jsx)("a",{href:"https://lexile.com/wp-content/uploads/2018/09/Lexile-Educator-Guide-MM0066W.pdf",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Typical Lexile Reader Measures by Grade",id:"label.typical_lexile_reader_measures_by.b09509b6"})})}),title:a({id:"label.audiences.16776",defaultMessage:"Audiences"})}],5:[{body:a({id:"label.indicate_the_subject_areas_select.f85cec9a",defaultMessage:"Indicate the subject area(s); select from Math, ELA, Social Studies, and STEAM, as well as occupational (CTE and PD)."}),title:a({id:"label.featured_subject.11f09581",defaultMessage:"Featured subject"})}],6:[{body:a({id:"label.select_a_combination_of_learning_m.d92b3f41",defaultMessage:"Select a combination of learning modules for your learners to complete as a single assignment. You may also require learners to complete the modules in order to ensure a specific learning path."}),title:a({id:"label.add_learning_modules.2c0d48f5",defaultMessage:"Add learning modules"})}],7:[{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"When writing a learning objective, it is important to:",id:"label.when_writing_a_learning_objective.87079054"})}),(0,N.jsxs)("ul",{className:"text-muted",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focus on learner behavior.",id:"label.focus_on_learner_behavior.021e0436"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Use simple, specific action verbs.",id:"label.use_simple_specific_action_verbs.56c99776"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Articulate desired performance criteria.",id:"label.articulate_desired_performance_cri.89b43c53"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focus on learner behavior.",id:"label.focus_on_learner_behavior.021e0436"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"For example, \u201cRecall the formula for area and circumference of a circle\u201d or \u201cDesign a method for minimizing human impact on the environment.\u201d",id:"label.for_example_recall_the_formula_for.4eabfd46"})})]})]}),title:a({id:"label.learning_objective.bc5b0195",defaultMessage:"Learning objective"})}],8:[{body:a({id:"label.select_the_subject_area_topics_and.13dd63dc",defaultMessage:"Select the subject area topics and subtopics for your challenge. Or, customize your own."}),title:a({id:"label.topics_and_subtopics.a89020fc",defaultMessage:"Topics & subtopics"})}],9:[{body:a({id:"label.identify_the_name_of_the_author_as.3c31c18d",defaultMessage:"Identify the name of the author as you want it to appear on the overview page. Include any credentials that add credibility (e.g. Jane Doe, Ph.D.)"}),title:a({id:"label.name.dcd1d522",defaultMessage:"Name"})},{body:a({id:"label.provide_a_brief_biography_about_th.5dc15311",defaultMessage:"Provide a brief biography about the author that highlights their experience, background, and/or qualifications. Make sure to keep the biography under 500 characters."}),title:a({id:"label.biography.942dbeda",defaultMessage:"Biography"})}],10:[{body:a({id:"label.when_you_are_ready_publish_this_mo.ce68b6d0",defaultMessage:"When you are ready, publish this module so it will appear in the catalog."}),title:a({id:"label.looking_good.bfa2656d",defaultMessage:"Looking good!"})}]},n={0:[{body:a({id:"label.craft_a_brief_title_of_four_words.903d6c65",defaultMessage:"Craft a brief title of four words or less that highlights the topic of the module and that captivates your audience."}),title:a({id:"label.title.7e8cd205",defaultMessage:"Title"})}],1:[{body:a({id:"label.write_a_brief_description_1_2_sent.1e82d28a",defaultMessage:"Write a brief description (1-2 sentences) that describes the topic in more detail. You may wish to include the purpose of the module and its contents."}),title:a({id:"label.description.526e0087",defaultMessage:"Description"})}],2:[{body:a({id:"label.if_possible_use_a_2000x500_image_i.2443fab8",defaultMessage:"If possible, use a (2000x500) image in JPG or PNG format. This will be used as the banner image on the overview page."}),title:a({id:"label.banner_image.bceaa001",defaultMessage:"Banner image"})},{body:a({id:"label.if_possible_use_a_750x500_image_in.d25165f6",defaultMessage:"If possible, use a (750x500) image in JPG or PNG format. This image will be used for module catalog listings."}),title:a({id:"label.cover_image.b62cee93",defaultMessage:"Cover image"})}
2,{body:a({id:"label.if_possible_use_a_500x500_image_in.f0eb29b8",defaultMessage:"If possible, use a (500x500) image in JPG or PNG format. This image will be used for module assignment listings."}),title:a({id:"label.icon_image.9356b6da",defaultMessage:"Icon image"})}],3:[{body:a({id:"label.communicate_to_your_learners_how_m.63e04cb0",defaultMessage:"Communicate to your learners how much time is required to complete the module."}),title:a({id:"label.time_to_complete.7e73fe58",defaultMessage:"Time to complete"})}],4:[{body:a({id:"label.select_the_audience_category_for_y.5378731b",defaultMessage:"Select the audience category for your challenge. Options include K-12, Higher Education, and Corporate Learning and development."}),title:a({id:"label.audience_category.2166dc58",defaultMessage:"Audience category"})}],5:[{body:a({id:"label.identify_the_grade_levels_applicab.8f4cd835",defaultMessage:"Identify the grade level(s) applicable to your challenge. The grade level(s) indicated should align to the content standards for the challenge. Similarly, the Lexile level of the Guiding Resources should match the {link}."},{link:(0,N.jsx)("a",{href:"https://lexile.com/wp-content/uploads/2018/09/Lexile-Educator-Guide-MM0066W.pdf",rel:"noopener noreferrer",target:"_blank",children:(0,N.jsx)(ke.A,{defaultMessage:"Typical Lexile Reader Measures by Grade",id:"label.typical_lexile_reader_measures_by.b09509b6"})})}),title:a({id:"label.audiences.16776",defaultMessage:"Audiences"})}],6:[{body:a({id:"label.indicate_the_subject_areas_select.f85cec9a",defaultMessage:"Indicate the subject area(s); select from Math, ELA, Social Studies, and STEAM, as well as occupational (CTE and PD)."}),title:a({id:"label.featured_subject.11f09581",defaultMessage:"Featured subject"})}],7:[{body:a({id:"label.upload_the_scorm_2004_or_scorm_12.66cc9786",defaultMessage:"Upload the SCORM 2004 or SCORM 1.2 package provided by your content authoring tool (e.g. Elucidat, Articulate Rise 360, etc.)"}),title:a({id:"label.upload_scorm_package.e3c0d6ac",defaultMessage:"Upload SCORM package"})}],8:[{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"When writing a learning objective, it is important to:",id:"label.when_writing_a_learning_objective.87079054"})}),(0,N.jsxs)("ul",{className:"text-muted",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focus on learner behavior.",id:"label.focus_on_learner_behavior.021e0436"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Use simple, specific action verbs.",id:"label.use_simple_specific_action_verbs.56c99776"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Articulate desired performance criteria.",id:"label.articulate_desired_performance_cri.89b43c53"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Focus on learner behavior.",id:"label.focus_on_learner_behavior.021e0436"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"For example, \u201cRecall the formula for area and circumference of a circle\u201d or \u201cDesign a method for minimizing human impact on the environment.\u201d",id:"label.for_example_recall_the_formula_for.4eabfd46"})})]})]}),title:a({id:"label.learning_objective.bc5b0195",defaultMessage:"Learning objective"})}],9:[{body:a({id:"label.select_the_subject_area_topics_and.13dd63dc",defaultMessage:"Select the subject area topics and subtopics for your challenge. Or, customize your own."}),title:a({id:"label.topics_and_subtopics.a89020fc",defaultMessage:"Topics & subtopics"})}],10:[{body:a({id:"label.identify_the_name_of_the_author_as.3c31c18d",defaultMessage:"Identify the name of the author as you want it to appear on the overview page. Include any credentials that add credibility (e.g. Jane Doe, Ph.D.)"}),title:a({id:"label.name.dcd1d522",defaultMessage:"Name"})},{body:a({id:"label.provide_a_brief_biography_about_th.5dc15311",defaultMessage:"Provide a brief biography about the author that highlights their experience, background, and/or qualifications. Make sure to keep the biography under 500 characters."}),title:a({id:"label.biography.942dbeda",defaultMessage:"Biography"})}],11:[{body:a({id:"label.when_you_are_ready_publish_this_mo.f7c35edf",defaultMessage:"When you are ready, publish this module so it will appear in the catalog. You may then begin to assign it to learners."}),title:a({id:"label.looking_good.bfa2656d",defaultMessage:"Looking good!"})}]},r={0:[{body:a({id:"label.craft_a_brief_title_which_highligh.eb1f3498",defaultMessage:"Craft a brief title which highlights the significance of the certification."}),title:a({id:"label.title.7e8cd205",defaultMessage:"Title"})}],1:[{body:a({id:"label.write_a_clear_description_that_wil.e9f29d76",defaultMessage:"Write a clear description that will appear on the final certificate. This text should explain the certification's value and achievements in a formal, professional tone."}),title:a({id:"label.description.526e0087",defaultMessage:"Description"})}],2:[{body:a({id:"label.choose_the_organization_that_will.6fb09c02",defaultMessage:"Choose the organization that will officially issue this certification. This selection determines which authorized signatories will appear on the final certificate."}),title:a({id:"label.certifying_body.c7dccd78",defaultMessage:"Certifying body"})}],3:[{body:a({id:"label.choose_up_to_6_competencies_that_b.91d4d7dc",defaultMessage:"Choose up to 6 competencies that best represent the skills and knowledge this certification validates."}),title:a({id:"label.competencies.ec64b47c",defaultMessage:"Competencies"})}],4:[{body:a({id:"label.choose_a_professional_visually_app.a1b478f5",defaultMessage:"Choose a professional, visually appealing image that represents the certification's subject matter. This image will be displayed to candidates during the certification request process. Images should be 500 x 500 pixels in JPG or PNG format."}),title:a({id:"label.icon_image.9356b6da",defaultMessage:"Icon image"})}],5:[{body:a({id:"label.review_your_certificate_design_bef.a9a74107",defaultMessage:"Review your certificate design before publishing. Once published, you can attach this certification to challenges for learners to earn. The final certificate will be delivered as a PDF."}),title:a({id:"label.review_and_publish.b152563c",defaultMessage:"Review and publish"})}]},o={0:[{body:a({id:"label.choose_a_memorable_descriptive_nam.8ee3aa47",defaultMessage:'Choose a memorable, descriptive name that reflects the persona\'s role and personality. Names like "Professor Oak" or "Coach Rivera" immediately signal the agent\'s purpose to learners.'}),title:a({id:"label.agent_name.1cfb2187",defaultMessage:"Agent name"})},{body:a({id:"label.the_category_determines_how_this_a.141bc4b3",defaultMessage:"The category determines how this agent is classified and presented to learners. It also influences the agent's default behavior patterns and collaboration dynamics within a team."}),title:a({id:"label.category.292c06f0",defaultMessage:"Category"})},{body:a({id:"label.upload_a_square_image_500_x_500_pi.797fc3d9",defaultMessage:"Upload a square image (500 x 500 pixels, JPG or PNG) that visually represents this persona. A distinctive avatar helps learners identify and connect with the agent during collaboration."}),title:a({id:"label.avatar.ca8e826d",defaultMessage:"Avatar"})}],1:[{body:a({id:"label.describe_how_this_agent_communicat.f48b4ba1",defaultMessage:'Describe how this agent communicates in natural language. Focus on tone, approach, and distinctive patterns. For example: "Uses the Socratic method \u2014 responds to questions with thought-provoking questions rather than direct answers. Warm but intellectually challenging."'}),title:a({id:"label.communication_style.21479fe5",defaultMessage:"Communication style"})},{body:a({id:"label.enter_comma_separated_traits_that.1339ce2b",defaultMessage:'Enter comma-separated traits that define the persona\'s character. The
2se traits shape how the agent interacts with learners. Aim for 3-6 complementary traits, e.g., "empathetic, analytical, patient, curious". Avoid contradictory traits like "impulsive" and "methodical".'}),title:a({id:"label.personality_traits.1b9c5f83",defaultMessage:"Personality traits"})}],2:[{body:a({id:"label.define_what_this_agent_excels_at_s.d0cd49f7",defaultMessage:'Define what this agent excels at. Strengths help the system match agents to appropriate tasks and set learner expectations. Focus on pedagogical capabilities, e.g., "breaking down complex topics, providing structured feedback, asking probing questions".'}),title:a({id:"label.strengths.b11d27f8",defaultMessage:"Strengths"})},{body:a({id:"label.set_clear_boundaries_for_this_agen.d7225929",defaultMessage:'Set clear boundaries for this agent\'s behavior. Well-defined limitations prevent the agent from overstepping its role and keep interactions focused. For example: "avoids giving direct answers, does not write code for learners, defers to human instructors on grading decisions".'}),title:a({id:"label.limitations.69b1b67d",defaultMessage:"Limitations"})}],3:[{body:a({id:"label.provide_2_5_prompt_response_pairs.5f873dcd",defaultMessage:"Provide 2-5 prompt-response pairs that demonstrate this persona's communication style in action. These examples serve as few-shot learning examples that guide the agent's behavior. Include a mix of scenarios: a greeting, a content question, a request for feedback, and an edge case where the agent should redirect."}),title:a({id:"label.example_responses.58505286",defaultMessage:"Example responses"})},{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Strong example responses should:",id:"label.strong_example_responses_should.b5986127"})}),(0,N.jsxs)("ul",{className:"text-muted",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Match the communication style and personality traits you defined",id:"label.match_the_communication_style_and.4db87f9b"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Demonstrate the agent's strengths in action",id:"label.demonstrate_the_agents_strengths_i.2d719dcf"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Show how the agent handles its limitations gracefully",id:"label.show_how_the_agent_handles_its_lim.d696c611"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Vary in length and complexity to cover different interaction types",id:"label.vary_in_length_and_complexity_to_c.e5a3b1b1"})})]})]}),title:a({id:"label.writing_effective_examples.05ae7ba3",defaultMessage:"Writing effective examples"})}],4:[{body:a({id:"label.the_system_prompt_is_the_core_inst.c413772d",defaultMessage:'The system prompt is the core instruction set sent to the AI model before every interaction. It should establish the persona\'s identity, role, and behavioral rules. Write in second person ("You are...") and be specific about what the agent should and should not do. A strong system prompt is typically 200-1000 words.'}),title:a({id:"label.system_prompt.561257c0",defaultMessage:"System prompt"})},{body:a({id:"label.use_the_tone_length_and_format_fie.2ed8dc18",defaultMessage:'Use the tone, length, and format fields to fine-tune the agent\'s output style. These guidelines supplement the system prompt and help maintain consistency. For example \u2014 Tone: "Encouraging but challenging"; Length: "2-4 sentences per response"; Format: "Use questions to guide thinking, avoid bullet points".'}),title:a({id:"label.response_guidelines.c5ee3994",defaultMessage:"Response guidelines"})}],5:[{body:a({id:"label.use_this_live_chat_to_interact_wit.9b5ca7ed",defaultMessage:"Use this live chat to interact with your agent persona before publishing. Messages are sent to the AI model using the system prompt, personality traits, and response guidelines you configured. The conversation is not saved \u2014 it resets when you leave or clear the chat."}),title:a({id:"label.test_your_agent.bcf9391c",defaultMessage:"Test your agent"})},{body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Try these scenarios to evaluate the persona:",i
2d:"label.try_these_scenarios_to_evaluate_th.6d2c1e8b"})}),(0,N.jsxs)("ul",{className:"text-muted",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Ask a content question to verify tone and style",id:"label.ask_a_content_question_to_verify_t.7bfe65e7"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Request a direct answer to check if limitations are respected",id:"label.request_a_direct_answer_to_check_i.f79c9a24"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Test edge cases like off-topic questions",id:"label.test_edge_cases_like_off_topic_que.b3eff300"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Check that response length matches your guidelines",id:"label.check_that_response_length_matches.073bbec3"})})]})]}),title:a({id:"label.what_to_test.72e11fad",defaultMessage:"What to test"})}],6:[{body:a({id:"label.before_publishing_verify_that_all.b190d4fc",defaultMessage:"Before publishing, verify that all required fields are complete and that the persona details are accurate. Once published, this version can be set as the primary version and assigned to challenges. You can always create a new version later if changes are needed."}),title:a({id:"label.review_and_publish.b152563c",defaultMessage:"Review and publish"})}]};return(0,l.useImperativeHandle)(s,()=>({agent:o,cartridge:n,certification:r,challenge:t,journey:i})),(0,N.jsx)(N.Fragment,{})});var WV=GV;var KV=(0,l.forwardRef)((e,s)=>{const{isStepValid:a,type:t}=sQ(),{formatMessage:i}=(0,ja.A)(),{styles:n}=(0,P.nm)(),{primary:r}=n;let o=[];switch(t){case"challenge":o=[{id:0,icon:(0,N.jsx)(ze.Pcn,{color:r,size:16}),steps:[{id:0,required:!0,title:i({id:"label.challenge_title.f741a3ee",defaultMessage:"Challenge title"}),valid:a(0)},{id:1,required:!0,title:i({id:"label.author_details.37df1019",defaultMessage:"Author details"}),valid:a(1)},{id:2,required:!0,title:i({id:"label.time_settings.dbb8b304",defaultMessage:"Time settings"}),valid:a(2)}],title:i({id:"label.general_settings.2a1660d9",defaultMessage:"General settings"})},{id:1,icon:(0,N.jsx)(ze.aBc,{color:r,size:16}),steps:[{id:3,required:!0,title:i({id:"label.audience_category.2166dc58",defaultMessage:"Audience category"}),valid:a(3)},{id:4,required:!0,title:i({id:"label.select_audiences.71726",defaultMessage:"Select audiences"}),valid:a(4)},{id:5,required:!0,title:i({id:"label.featured_subject.11f09581",defaultMessage:"Featured subject"}),valid:a(5)}],title:i({id:"label.audience_settings.68327950",defaultMessage:"Audience settings"})},{id:2,icon:(0,N.jsx)(ze.v5n,{color:r,size:16}),steps:[{id:6,required:!0,title:i({id:"label.real_world_problem.173e1544",defaultMessage:"Real world problem"}),valid:a(6)},{id:7,required:!1,title:(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"Real world question",id:"label.real_world_question.dacf6360"})}),valid:a(7)},{id:8,required:!0,title:i({id:"label.challenge_statement.85ddafbd",defaultMessage:"Challenge statement"}),valid:a(8)}],title:i({id:"label.challenge_details.be6df044",defaultMessage:"Challenge details"})},{id:3,icon:(0,N.jsx)(ze.aw1,{color:r,size:16}),steps:[{id:9,required:!0,title:i({id:"label.add_deliverables.a5e0f4f6",defaultMessage:"Add deliverables"}),valid:a(9)}],title:i({id:"label.deliverables.c7ec4b92",defaultMessage:"Deliverables"})},{id:4,icon:(0,N.jsx)(ze.vd0,{color:r,size:16}),steps:[{id:10,required:!0,title:i({id:"label.guiding_questions.53a932b3",defaultMessage:"Guiding questions"}),valid:a(10)},{id:11,required:!0,title:i({id:"label.guiding_resources.27a607fa",defaultMessage:"Guiding resources"}),valid:a(11)},{id:12,required:!0,title:i({id:"label.what_if_questions.7d559009",defaultMessage:"What-if questions"}),valid:a(12)},{id:13,required:!1,title:i({id:"label.learning_objectives.d38eb0fc",defaultMessage:"Learning objectives"}),valid:a(13)},{id:14,required:!1,title:i({id:"label.standards.b9a13629",defaultMessage:"Standards"}),valid:a(14)},{id:15,required:!1,title:i({id:"label.topics.e22820fc",defaultMessage:"Topics"}),valid:a(15)}],title:i({id:"label.learning_content.ace9d757",defaultMessage:"Learning content"})},{id:5,icon:(0,N.jsx)(ze.y8Q,{color:r,size:16}),steps:[{id:19,required:!1,title:i({id:"label.ai_agent_personas.7aa4c547",defaultMessage:"AI agent personas"}),valid:a(19)}],title:i({id:"label.ai_agents.d591a7cb",defaultMessage:"AI Agents"})},{id:6,icon:(0,N.jsx)(ze.veT,{color:r,size:16}),steps:[{id:20,required:!1,title:i({id:"label.certification.86846f67",defaultMessage:"Certification"}),valid:a(20)}],title:i({id:"label.certification.86846f67",defaultMessage:"Certification"})},{id:7,icon:(0,N.jsx)(ze.T_n,{color:r,size:16}),steps:[{id:16,required:!0,title:i({id:"label.upload_media.3ea5f2ab",defaultMessage:"Upload media"}),valid:a(16)},{id:17,required:!1,title:i({id:"label.additional_settings.1e99b90f",defaultMessage:"Additional settings"}),valid:a(17)},{id:18,required:!0,title:i({id:"label.challenge_complete.c8478dee",defaultMessage:"Challenge complete"}),valid:a(18)}],title:i({id:"label.finishing_touches.93a32b46",defaultMessage:"Finishing touches"})}];break;case"journey":o=[{id:0,icon:(0,N.jsx)(ze.Mbp,{color:r,size:16}),steps:[{id:0,required:!0,title:i({id:"label.journey_title.2a0380dc",defaultMessage:"Journey title"}),valid:a(0)},{id:1,required:!0,title:i({id:"label.journey_description.9ea5f1b8",defaultMessage:"Journey description"}),valid:a(1)},{id:2,title:i({id:"label.upload_imagery.d35ccc98",defaultMessage:"Upload imagery"}),valid:a(2)}],title:i({id:"label.basic_details.8bf8e3ab",defaultMessage:"Basic details"})},{id:1,icon:(0,N.jsx)(ze.aBc,{color:r,size:16}),steps:[{id:3,required:!0,title:i({id:"label.audience_category.2166dc58",defaultMessage:"Audience category"}),valid:a(3)},{id:4,required:!0,title:i({id:"label.select_audiences.71726",defaultMessage:"Select audiences"}),valid:a(4)},{id:5,required:!0,title:i({id:"label.featured_subject.11f09581",defaultMessage:"Featured subject"}),valid:a(5)}],title:i({id:"label.audience_settings.68327950",defaultMessage:"Audience settings"})},{id:2,icon:(0,N.jsx)(ze.aQJ,{color:r,size:16}),steps:[{id:6,required:!0,title:i({id:"label.add_learning_modules.2c0d48f5",defaultMessage:"Add learning modules"}),valid:a(6)},{id:7,required:!1,title:i({id:"label.learning_objective.bc5b0195",defaultMessage:"Learning objective"}),valid:a(7)},{id:8,required:!1,title:i({id:"label.topics.e22820fc",defaultMessage:"Topics"}),valid:a(8)}],title:i({id:"label.learning_content.ace9d757",defaultMessage:"Learning content"})},{id:3,icon:(0,N.jsx)(ze.uoG,{color:r,size:16}),steps:[{id:9,required:!0,title:i({id:"label.author_details.37df1019",defaultMessage:"Author details"}),valid:a(9)},{id:10,required:!0,title:i({id:"label.publish_journey.e3d6d205",defaultMessage:"Publish journey"}),valid:a(10)}],title:i({id:"label.prepare_and_publish.405af166",defaultMessage:"Prepare and publish"})}];break;case"cartridge":o=[{id:0,icon:(0,N.jsx)(ze.F7,{color:r,size:16}),steps:[{id:0,required:!0,title:i({id:"label.cartridge_title.d4f6cf7a",defaultMessage:"Cartridge title"}),valid:a(0)},{id:1,required:!0,title:i({id:"label.cartridge_description.cf3da146",defaultMessage:"Cartridge description"}),valid:a(1)},{id:2,required:!0,title:i({id:"label.upload_imagery.d35ccc98",defaultMessage:"Upload imagery"}),valid:a(2)},{id:3,required:!0,title:i({id:"label.time_to_complete.7e73fe58",defaultMessage:"Time to complete"}),valid:a(3)}],title:i({id:"label.basic_details.8bf8e3ab",defaultMessage:"Basic details"})},{id:1,icon:(0,N.jsx)(ze.aBc,{color:r,size:16}),steps:[{id:4,required:!0,title:i({id:"label.audience_category.2166dc58",defaultMessage:"Audience category"}),valid:a(4)},{id:5,required:!0,title:i({id:"label.select_audiences.71726",defaultMessage:"Select audiences"}),valid:a(5)},{id:6,required:!0,title:i({id:"label.featured_subject.11f09581",defaultMessage:"Featured subject"}),valid:a(6)}],title:i({id:"label.audience_settings.68327950",defaultMessage:"Audience settings"})},{id:2,icon:(0,N.jsx)(ze.aQJ,{color:r,size:16}),steps:[{id:7,required:!0,title:i({id:"label.scorm_content.fab38674",defaultMessage:"SCORM content"}),valid:a(7)},{id:8,required:!0,title:i({id:"label.learning_objectives.d38eb0fc",defaultMessage:"Learning objectives"}),valid:a(8)},{id:9,required:!1,title:i({id:"label.topics.e22820fc",defaultMessage:"Topics"}),valid:a(9)}],title:i({id:"label.learning_content.ace9d757",defaultMessage:"Learning content"})},{id:3,icon:(0,N.jsx)(ze.uoG,{color:r,size:16}),steps:[{id:10,required:!0,title:i({id:"label.author_details.37df1019",defaultMessage:"Author details"}),valid:a(10)},{id:11,required:!0,title:i({id:"label.publish_cartridge.1cfe80a3",defaultMessage:"Publish cartridge"}),valid:a(11)}],title:i({id:"label.prepare_and_publish.405af166",defaultMessage:"Prepare and publish"})}];break;case"certification":o=[{id:0,icon:(0,N.jsx)(ze.F7,{color:r,size:16}),steps:[{id:0,required:!0,title:i({id:"label.certification_title.eaae3c3c",defaultMessage:"Certification title"}),valid:a(0)},{id:1,required:!0,title:i({id:"label.certification_description.96dc242c",defaultMessage:"Certification description"}),valid:a(1)},{id:2,required:!0,title:i({id:"label.certifying_body.c7dccd78",defaultMessage:"Certifying body"}),valid:a(2)},{id:3,required:!0,title:i({id:"label.competencies.ec64b47c",defaultMessage:"Competencies"}),valid:a(3)}],title:i({id:"label.certification_details.7f7b9a0d",defaultMessage:"Certification details"})},{id:1,icon:(0,N.jsx)(ze.vd0,{color:r,size:16}),steps:[{id:4,required:!0,title:i({id:"label.upload_imagery.d35ccc98",defaultMessage:"Upload imagery"}),valid:a(4)}],title:i({id:"label.library_settings.b66029ac",defaultMessage:"Library settings"})},{id:2,icon:(0,N.jsx)(ze.AnD,{color:r,size:16}),steps:[{id:5,required:!1,title:i({id:"label.attached_challenges.28ccefab",defaultMessage:"Attached challenges"}),valid:a(5)}],title:i({id:"label.challenges.40b9c8f4",defaultMessage:"Challenges"})},{id:3,icon:(0,N.jsx)(ze.uoG,{color:r,size:16}),steps:[{id:6,required:!0,title:i({id:"label.review_and_publish.b152563c",defaultMessage:"Review and publish"}),valid:a(6)}],title:i({id:"label.finishing_touches.93a32b46",defaultMessage:"Finishing touches"})}];break;case"agent":o=[{id:0,icon:(0,N.jsx)(ze.Pcn,{color:r,size:16}),steps:[{id:0,required:!0,title:i({id:"label.identity.999f23fc",defaultMessage:"Identity"}),valid:a(0)},{id:1,required:!0,title:i({id:"label.communication_style.21479fe5",defaultMessage:"Communication style"}),valid:a(1)}],title:i({id:"label.identity_and_style.1814ed82",defaultMessage:"Identity & Style"})},{id:1,icon:(0,N.jsx)(ze.x$1,{color:r,size:16}),steps:[{id:2,required:!1,title:i({id:"label.strengths_and_limitations.3757b64f",defaultMessage:"Strengths & Limitations"}),valid:a(2)},{id:3,required:!1,title:i({id:"label.example_responses.58505286",defaultMessage:"Example responses"}),valid:a(3)}],title:i({id:"label.capabilities.9460f16a",defaultMessage:"Capabilities"})},{id:2,icon:(0,N.jsx)(ze.FSj,{color:r,size:16}),steps:[{id:4,required:!0,title:i({id:"label.system_prompt.561257c0",defaultMessage:"System prompt"}),valid:a(4)}],title:i({id:"label.prompt_configuration.d97eb617",defaultMessage:"Prompt configuration"})},{id:3,icon:(0,N.jsx)(ze.uN,{color:r,size:16}),steps:[{id:5,required:!1,title:i({id:"label.test_agent.44b088ce",defaultMessage:"Test agent"}),valid:a(5)}],title:i({id:"label.test_and_preview.f74e6de1",defaultMessage:"Test & Preview"})},{id:4,icon:(0,N.jsx)(ze.uoG,{color:r,size:16}),steps:[{id:6,required:!0,title:i({id:"label.publish_agent.d7d406e1",defaultMessage:"Publish agent"}),valid:a(6)}],title:i({id:"label.review_and_publish.c21bf39a",defaultMessage:"Review & Publish"})}]}return(0,l.useImperativeHandle)(s,()=>({sections:o})),(0,N.jsx)(N.Fragment,{})});var YV=e=>{const{show:s}=e;return(0,N.jsx)(N.Fragment,{children:!!s&&(0,N.jsxs)(Ce.S,{className:"content-authoring-status-overlay d-flex flex-column align-items-center justify-content-center",children:[(0,N.jsx)(qt.A,{animation:"border",className:"mb-3",size:"lg",variant:"primary"}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Saving...",id:"label.saving.dc85af8f"})})]})})};var qV=e=>{const{id:s,checked:a,className:t,disabled:i,icon:l,inputId:n,label:r,name:o,onSelect:d,value:c}=e;return(0,N.jsxs)(ve.A,{className:`icon-radio-button d-flex align-items-center p-3 ${a?"selected":""} ${t||""}`,disabled:i,id:s,onClick:e=>{e.preventDefault(),"function"===typeof d&&d(c)},variant:a?"primary":"secondary",children:[(0,N.jsx)("label",{className:a?"":"text-primary",htmlFor:n,children:r}),l,(0,N.jsx)("input",{checked:a,className:"d-none",id:n,name:o,type:"radio",value:c})]})};var JV=e=>{const{formatMessage:s}=(0,ja.A)(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,step:n,template:r,type:o,updateTemplate:d}=sQ(),{guiding_questions:c}=r||{},h=(0,l.useRef)(),u=(0,l.useRef)(),[m,g,p]=(0,ne.CQ)({formik_key:(0,me.A)()}),x=async()=>{const e=null===h||void 0===h?void 0:h.current;if(h)return(0,T.isEmpty)(await e.validateForm())},v=async()=>{var e;const s=null===h||void 0===h?void 0:h.current;h&&(await s.setFieldValue("guiding_questions",[...(null===s||void 0===s||null===(e=s.values)||void 0===e?void 0:e.guiding_questions)||[],""]),await s.setFieldTouched("guiding_questions"),i(x,s.handleSubmit,!0))},f=e=>{const a=null===u||void 0===u?void 0:u.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s({id:"label.remove_question.9d22dcac",defaultMessage:"Remove question"}),onClick:()=>(async e=>{var s,a;const t=null===h||void 0===h?void 0:h.current;if(!h)return;const l=null===t||void 0===t||null===(s=t.values)||void 0===s||null===(a=s.guiding_questions)||void 0===a?void 0:a.filter((s,a)=>a!==e);await t.setFieldValue("guiding_questions",l),await t.setFieldTouched("guiding_questions"),i(x,t.handleSubmit,!0)})(e),variant:"danger"})],body:s({id:"label.are_you_sure_you_want_to_remove_th.103d2263",defaultMessage:"Are you sure you want to remove this guiding question?"}),title:s({id:"label.remove_question.9d22dcac",defaultMessage:"Remove question"})})},j=async(e,s)=>{var a,t;const l=null===h||void 0===h?void 0:h.current;if(!h)return;const n=(null===l||void 0===l||null===(a=l.values)||void 0===a?void 0:a.guiding_questions)||[];n[s]=null===e||void 0===e||null===(t=e.target)||void 0===t?void 0:t.value,await l.setFieldValue("guiding_questions",n),await l.setFieldTouched("guiding_questions"),i(x,l.handleSubmit)},_={guiding_questions:c||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Write 3 questions to highlight what learners will need to know or research in order to complete the deliverable that satisfies the challenge statement.",id:"label.write_3_questions_to_highlight_wha.403ec771"})}),(0,N.jsx)(ds.l1,{initialValues:_,onSubmit:async e=>{await t(e),await d(e),g({formik_key:(0,me.A)()})},validateOnChange:!0,validateOnMount:!0,validationSchema:a(),children:e=>{var s;h.current=e;const{errors:a,handleSubmit:t,values:i}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(ds.D0,{name:"guiding_questions",children:()=>{var e;return(0,N.jsx)(N.Fragment,{children:null!==i&&void 0!==i&&null!==(e=i.guiding_questions)&&void 0!==e&&e.length?(0,N.jsx)(N.Fragment,{children:i.guiding_questions.map((e,s)=>(0,N.jsx)(XV,{guiding_question:e,idx:s,onChange:j,onDelete:f},s))}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You haven't added any guiding questions yet",id:"label.you_havent_added_any_guiding_quest.3b35ada8"})})})}}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",disabled:(null===i||void 0===i||null===(s=i.guiding_questions)||void 0===s?void 0:s.length)>=6,onClick:v,type:"button",variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2",color:"white"}),(0,N.jsx)(ke.A,{defaultMessage:"Add guiding question",id:"label.add_guiding_question.cd9932aa"})]}),!(null===a||void 0===a||!a.guiding_questions)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block mt-3",type:"invalid",children:a.guiding_questions})]}),(0,N.jsx)(je,{ref:u})]})}},m.formik_key)]})};var XV=e=>{const{guiding_question:s,idx:a,onChange:t,onDelete:i}=e;return(0,N.jsxs)(Ge.A,{className:"guiding-question-card",style:{align:"center",marginBottom:"15px"},children:[(0,N.jsxs)(Ge.A.Header,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h5",{className:"m-0",c
2hildren:(0,N.jsx)(ke.A,{defaultMessage:"Question {number}",id:"label.question_number.450e37a8",values:{number:a+1}})}),(0,N.jsx)(ve.A,{className:"float-end array-trash",onClick:()=>i(a),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{})})]}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(Ei.A,{children:(0,N.jsx)(ds.D0,{className:"form-control",component:"textarea",name:`guiding_questions.${a}`,onKeyUp:e=>t(e,a),placeholder:"Enter questions...",style:{width:"80%"}})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(FB,{length:(null===s||void 0===s?void 0:s.length)||0,max:2e3,min:30})})]})]})};var ZV=e=>{const{formatMessage:s}=(0,ja.A)(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,step:n,template:r,type:o,updateTemplate:d}=sQ(),{guiding_resources:c}=r||{},h=(0,l.useRef)(),u=(0,l.useRef)(),m=(0,l.useRef)(),g=async()=>{const e=null===h||void 0===h?void 0:h.current;if(h)return(0,T.isEmpty)(await e.validateForm())},p=async()=>{const e=await _();e&&await v(e)},x=async(e,s)=>{const a=await _(s);a&&!(0,T.isEqual)(a,s)&&await f(e,a)},v=async e=>{var s;const a=null===h||void 0===h?void 0:h.current;if(!a||!Array.isArray(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.guiding_resources))return;const t=[...a.values.guiding_resources,e];await a.setFieldValue("guiding_resources",t),await a.setFieldTouched("guiding_resources",!0),i(g,a.handleSubmit,!0)},f=async(e,s)=>{var a;const t=null===h||void 0===h?void 0:h.current;if(!t||!Array.isArray(null===t||void 0===t||null===(a=t.values)||void 0===a?void 0:a.guiding_resources))return;const l=[...t.values.guiding_resources];l[e]&&(l[e]=s),await t.setFieldValue("guiding_resources",l),await t.setFieldTouched("guiding_resources",!0),i(g,t.handleSubmit,!0)},j=e=>{const a=null===u||void 0===u?void 0:u.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s({id:"label.remove_resource.7274cee0",defaultMessage:"Remove resource"}),onClick:()=>(async e=>{var s;const a=null===h||void 0===h?void 0:h.current;if(!a||!Array.isArray(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.guiding_resources))return;const t=[...a.values.guiding_resources].filter((s,a)=>a!==e);await a.setFieldValue("guiding_resources",t),await a.setFieldTouched("guiding_resources",!0),i(g,a.handleSubmit,!0)})(e),variant:"danger"})],body:s({id:"label.are_you_sure_you_want_to_remove_th.f7781ef1",defaultMessage:"Are you sure you want to remove this resource?"}),title:s({id:"label.remove_resource.7274cee0",defaultMessage:"Remove resource"})})},_=async e=>{const s=null===m||void 0===m?void 0:m.current;if(s)return await s.show({resource:e})},b={guiding_resources:c||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Provide at least one guiding resource to support research and exploration.",id:"label.provide_at_least_one_guiding_resou.12dd2590"})}),(0,N.jsx)(ds.l1,{initialValues:b,onSubmit:async e=>(await t(e),await d(e)),validateOnChange:!0,validationSchema:a(),children:e=>{h.current=e;const{errors:s,handleSubmit:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:a,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(ds.D0,{name:"guiding_resources",children:()=>{var e;return(0,N.jsx)(N.Fragment,{children:null!==t&&void 0!==t&&null!==(e=t.guiding_resources)&&void 0!==e&&e.length?(0,N.jsx)(N.Fragment,{children:null===t||void 0===t?void 0:t.guiding_resources.map((e,s)=>(0,N.jsx)($V,{guiding_resource:e,idx:s,onChange:x,onRemove:j},s))}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You haven't added any guiding resources yet",id:"label.you_havent_added_any_guiding_resou.325cdf17"})})})}}),(0,N.jsxs)(ve.A,{disabled:(null===t||void 0===t?void 0:t.guiding_resources.length)>=5,onClick:p,variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Add guiding resource",id:"label.add_guiding_resource.2c9e887a"})]}),(null===s||void 0===s?void 0:s.guiding_resources)&&(0,N.jsx)(ds.Kw,{name:"guiding_resources",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}),(0,N.jsx)(je,{ref:u}),(0,N.jsx)(NQ,{ref:m})]})}})]})};var $V=e=>{const{guiding_resource:s,idx:a,onChange:t,onRemove:i}=e,{title:l,type:n,value:r}=s,{styles:o}=(0,P.nm)(),{primary:d}=o;return(0,N.jsxs)(Ge.A,{className:"guiding-resource-card mb-3",style:{align:"center"},children:[(0,N.jsxs)(Ge.A.Header,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Resource {number}",id:"label.resource_number.faef8990",values:{number:a+1}})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)(ve.A,{className:"me-1",onClick:()=>t(a,s),size:"sm",type:"button",children:(0,N.jsx)(ze.Ph,{})}),(0,N.jsx)(ve.A,{onClick:()=>i(a),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{})})]})]}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(qa.A,{className:"table-borderless",size:"sm",children:(0,N.jsxs)("tbody",{children:[(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{style:{width:125},children:(0,N.jsx)("h6",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Resource title",id:"label.resource_title.666b41db"})})}),(0,N.jsx)("td",{style:{wordBreak:"break-all"},children:l||(0,N.jsx)("i",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Not provided",id:"label.not_provided.d83b9ff3"})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)("h6",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Resource type",id:"label.resource_type.c9bf2e89"})})}),(0,N.jsx)("td",{children:n?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(sG,{size:15,type:n}),(0,N.jsx)("span",{className:"d-inline-block align-middle ms-1",children:n})]}):(0,N.jsx)("i",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Not provided",id:"label.not_provided.d83b9ff3"})})})]}),(0,N.jsxs)("tr",{children:[(0,N.jsx)("td",{children:(0,N.jsx)("h6",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"View resource",id:"label.view_resource.9eff7736"})})}),(0,N.jsx)("td",{style:{wordBreak:"break-all"},children:(0,N.jsxs)("a",{href:(c=r,c.startsWith("http://")||c.startsWith("https://")?c:`https://${c}`),rel:"noopener noreferrer",target:"_blank",children:[(0,N.jsx)(ze.uO9,{className:"me-1",color:d})," ",r]})})]})]})})})]});var c};const eG=e=>{const{color:s,size:a,type:t}=e,i={Audio:ze.i0t,Document:ze.chT,Image:ze.dkL,Video:ze.HiP,Website:ze.AnD},l=(null===i||void 0===i?void 0:i[t])||ze.AnD;
2return(0,N.jsx)(l,{color:s,size:a})};eG.defaultProps={color:"var(--primary",size:25};var sG=eG;var aG=e=>{const{formatMessage:s}=(0,ja.A)(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,step:n,template:r,type:o,updateTemplate:d}=sQ(),{what_ifs:c}=r||{},h=(0,l.useRef)(),u=(0,l.useRef)(),m=async()=>{const e=null===h||void 0===h?void 0:h.current;if(h)return(0,T.isEmpty)(await e.validateForm())},g=async()=>{var e;const s=null===h||void 0===h?void 0:h.current;h&&(await s.setFieldValue("what_ifs",[...(null===s||void 0===s||null===(e=s.values)||void 0===e?void 0:e.what_ifs)||[],""]),await s.setFieldTouched("what_ifs"),i(m,s.handleSubmit,!0))},p=e=>{const a=null===u||void 0===u?void 0:u.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s({id:"label.remove_question.9d22dcac",defaultMessage:"Remove question"}),onClick:()=>(async e=>{var s,a;const t=null===h||void 0===h?void 0:h.current;if(!h)return;const l=null===t||void 0===t||null===(s=t.values)||void 0===s||null===(a=s.what_ifs)||void 0===a?void 0:a.filter((s,a)=>a!==e);await t.setFieldValue("what_ifs",l),await t.setFieldTouched("what_ifs"),i(m,t.handleSubmit,!0)})(e),variant:"danger"})],body:s({id:"label.are_you_sure_you_want_to_remove_th.f9ef6d5e",defaultMessage:"Are you sure you want to remove this what-if question?"}),title:s({id:"label.remove_question.9d22dcac",defaultMessage:"Remove question"})})},x=async(e,s)=>{var a;const t=null===h||void 0===h?void 0:h.current;if(!h)return;const l=(null===t||void 0===t||null===(a=t.values)||void 0===a?void 0:a.what_ifs)||[];l[e]=(0,F.A)((0,F.A)({},l[e]),{},{value:s}),await t.setFieldValue("what_ifs",l),await t.setFieldTouched("what_ifs"),i(m,t.handleSubmit)},v=async(e,s)=>{var a;const t=null===h||void 0===h?void 0:h.current;if(!h)return;const l=(null===t||void 0===t||null===(a=t.values)||void 0===a?void 0:a.what_ifs)||[];l[e]=(0,F.A)((0,F.A)({},l[e]),{},{type:s}),await t.setFieldValue("what_ifs",l),await t.setFieldTouched("what_ifs"),i(m,t.handleSubmit,!0)},f={what_ifs:c||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Compose 3 \u201cWhat if...\u201d or \u201cHow might we...\u201d questions to help brainstorming for potential solutions.",id:"label.compose_3_what_if_or_how_might_we.8a26f6cc"})}),(0,N.jsx)(ds.l1,{initialValues:f,onSubmit:async e=>(await t(e),await d(e)),validateOnChange:!0,validationSchema:a(),children:e=>{var s;h.current=e;const{errors:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(ds.D0,{name:"what_ifs",children:()=>{var s;return(0,N.jsx)(N.Fragment,{children:null!==l&&void 0!==l&&null!==(s=l.what_ifs)&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:l.what_ifs.map((s,a)=>(0,N.jsx)(tG,{idx:a,onChangeType:v,onChangeValue:x,onDelete:p,options:e,what_if:s},a))}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You haven't added any what-if questions yet",id:"label.you_havent_added_any_what_if_quest.3fee7ec6"})})})}}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",disabled:(null===l||void 0===l||null===(s=l.what_ifs)||void 0===s?void 0:s.length)>=3,onClick:g,type:"button",variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2",color:"white"}),(0,N.jsx)(ke.A,{defaultMessage:"Add What-if Question",id:"label.add_what_if_question.fbaec037"})]}),(null===a||void 0===a?void 0:a.what_ifs)&&(null===i||void 0===i?void 0:i.what_ifs)&&(0,N.jsx)(ds.Kw,{name:"what_ifs",children:e=>(0,N.jsx)("span",{style:{color:"red"},children:e})})]}),(0,N.jsx)(je,{ref:u})]})}})]})};var tG=e=>{var s;const{idx:a,onChangeType:t,onChangeValue:i,onDelete:l,options:n,what_if:r}=e,{errors:o,touched:d}=n,{formatMessage:c}=(0,ja.A)();return(0,N.jsxs)(Ge.A,{className:"what-if-question-card",style:{align:"center",marginBottom:"15px"},children:[(0,N.jsxs)(Ge.A.Header,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Question {number}",id:"label.question_number.450e37a8",values:{number:a+1}})}),(0,N.jsx)(ve.A,{className:"float-end array-trash",onClick:()=>l(a),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{})})]}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(os,{children:(0,N.jsxs)(_e.A.Select,{defaultValue:(null===r||void 0===r?void 0:r.type)||"",isInvalid:d.role&&o.role,isValid:d.role&&!o.role,name:`what_ifs.${a}.type`,onChange:e=>{var s;return t(a,null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},value:null===r||void 0===r?void 0:r.type,children:[(0,N.jsx)("option",{value:"",children:c({id:"label.choose_a_type.251f71e3",defaultMessage:"Choose a type"})}),(0,N.jsx)("option",{value:"What if...",children:c({id:"label.what_if.b3718e46",defaultMessage:"What if..."})}),(0,N.jsx)("option",{value:"How might we...",children:c({id:"label.how_might_we.a36d17a4",defaultMessage:"How might we..."})})]})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(ds.D0,{className:"form-control",component:"textarea",
2name:`what_ifs.${a}.value`,onKeyUp:e=>{var s;return i(a,null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},placeholder:"Enter questions..."}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(FB,{length:(null===r||void 0===r||null===(s=r.value)||void 0===s?void 0:s.length)||0,max:2e3,min:30})})]})]})]},a)};var iG=e=>{const{formatMessage:s}=(0,ja.A)(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,template:n,updateTemplate:r}=sQ(),{learning_goals:o}=n||{},d=(0,l.useRef)(),c=(0,l.useRef)(),h=async()=>{const e=null===d||void 0===d?void 0:d.current;if(d)return(0,T.isEmpty)(await e.validateForm())},u=async()=>{var e;const s=null===d||void 0===d?void 0:d.current;d&&(await s.setFieldValue("learning_goals",[...(null===s||void 0===s||null===(e=s.values)||void 0===e?void 0:e.learning_goals)||[],""]),await s.setFieldTouched("learning_goals"),i(h,s.handleSubmit,!0))},m=e=>{const a=null===c||void 0===c?void 0:c.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:s({id:"label.remove_objective.f9801969",defaultMessage:"Remove objective"}),onClick:()=>(async e=>{var s,a;const t=null===d||void 0===d?void 0:d.current;if(!d)return;const l=null===t||void 0===t||null===(s=t.values)||void 0===s||null===(a=s.learning_goals)||void 0===a?void 0:a.filter((s,a)=>a!==e);await t.setFieldValue("learning_goals",l),await t.setFieldTouched("learning_goals"),i(h,t.handleSubmit,!0)})(e),variant:"danger"})],body:s({id:"label.are_you_sure_you_want_to_remove_th.4913c79f",defaultMessage:"Are you sure you want to remove this learning objective?"}),title:s({id:"label.remove_objective.f9801969",defaultMessage:"Remove objective"})})},g=async(e,s)=>{var a;const t=null===d||void 0===d?void 0:d.current;if(!d)return;const l=(null===t||void 0===t||null===(a=t.values)||void 0===a?void 0:a.learning_goals)||[];l[e]=(0,F.A)((0,F.A)({},l[e]),{},{dok:s}),await t.setFieldValue("learning_goals",l),await t.setFieldTouched("learning_goals"),i(h,t.handleSubmit,!0)},p=async(e,s)=>{var a;const t=null===d||void 0===d?void 0:d.current;if(!d)return;const l=(null===t||void 0===t||null===(a=t.values)||void 0===a?void 0:a.learning_goals)||[];l[e]=(0,F.A)((0,F.A)({},l[e]),{},{value:s}),await t.setFieldValue("learning_goals",l),await t.setFieldTouched("learning_goals"),i(h,t.handleSubmit)},x=[{action_verbs:"Locate, calculate, define, identify, list, label, match, measure, copy, memorize, repeat, report, recall, recite, recognize, state, tell, tabulate, use rules, answer who, what, when, where, why, how",description:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Curricular elements that fall into this category involve basic tasks that require learners to recall or reproduce knowledge and/or skills.",id:"label.curricular_elements_that_fall_into.dd51b31e"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"The subject matter content at this level usually involves working with facts, terms, details, calculations, principles, and/or properties. It may also involve use of simple procedures or formulas.",id:"label.the_subject_matter_content_at_this.b522f4b1"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"There is little or no transformation of the target knowledge or skill required by the tasks that fall into this category.",id:"label.there_is_little_or_no_transformati.eadcc10f"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"A learner answering a Level l item either knows the answer or does not; that is, the answer does not need to be figured out\u201d or \u201csolved.",id:"label.a_learner_answering_a_level_l_item.ac98a805"})})]}),learner_role:s({id:"label.recognizes_responds_remembers_memo.d9badd6e",defaultMessage:"Recognizes, responds, remembers, memorizes, restates, absorbs, describes, demonstrates, follows directions, applies routine processes, definitions, and procedures"}),level:1,title:s({id:"label.recall_and_reproduction.b81e478f",defaultMessage:"Recall & Reproduction"}),value:"recall"},{action_verbs:"Infer, categorize, organize and display, compare-contrast, modify, predict, interpret, distinguish, estimate, extend patterns, use context clues, make observations, summarize, translate from table to graph, classify, show cause/effect, relate, edit for clarity",description:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"At this level, learners are asked to transform/process target knowledge before responding, e.g. summarize, estimate, organize, classify, extend, and make basic 
2inferences.",id:"label.at_this_level_learners_are_asked_t.923489ee"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"This level generally requires learners to compare or differentiate among people, places, events, objects, text types, etc.; apply multiple concepts when responding; classify or sort items into meaningful categories; describe or explain relationships, such as cause and effect, character relationships; and provide and explain examples and non-examples.",id:"label.this_level_generally_requires_lear.010c99c6"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"A Level 2 \u201cdescribe or explain\u201d task requires learners to go beyond a basic description or definition to predict a possible result or explain \u201cwhy\u201d something might happen.",id:"label.a_level_2_describe_or_explain_task.8f61b1ae"})})]}),learner_role:s({id:"label.solves_routine_problemstasks_invol.e066aaa5",defaultMessage:"Solves routine problems/tasks involving multiple decision points and concepts, constructs models to show relationships, demonstrates use of conceptual knowledge, compiles and organizes, illustrates/explains with examples or models, examines"}),level:2,title:s({id:"label.skills_and_concepts.a2f9b72a",defaultMessage:"Skills & Concepts"}),value:"skills"},{action_verbs:"Critique, appraise, revise for meaning, assess, investigate, cite evidence, test hypothesis, develop a logical argument, use concepts to solve non-routine problems, explain phenomena in terms of concepts, draw conclusions based on data",description:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tasks and classroom discourse falling into this category demand theuse of planning, reasoning, and higher order thinking processes, such as analysis and evaluation, to solve real-world problems or explore questions with multiple possible outcomes.",id:"label.tasks_and_classroom_discourse_fall.10243fa9"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Stating one\u2019s reasoning and providing relevant supporting evidence are key markers of DOK 3 tasks. The expectation established for tasks at this level require an in-depth integration of conceptual knowledge and multiple skills to reach a solution or produce a final product.",id:"label.stating_ones_reasoning_and_providi.be3a0919"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"DOK 3 tasks and classroom discourse focus on in-depth understanding of one text, one data set, one investigation, or one key source, whereas DOK 4 tasks expandthe breadth of the task using multiple texts or sources, or multipleconcepts/disciplines to reach a solution or create a final product.",id:"label.dok_3_tasks_and_classroom_discours.6ed02c9d"})})]}),learner_role:s({id:"label.uncovers_and_selects_relevant_and.7970e98b",defaultMessage:"Uncovers and selects relevant and credible supporting evidence for analyses, critiques, debates, claims and judgments; plans, initiates questions, disputes, argues, tests ideas/solutions, sustains inquiry into topics or deeper problems, applies to the real world"}),level:3,title:s({id:"label.strategic_thinking_and_reasoning.3c36c1cb",defaultMessage:"Strategic Thinking & Reasoning"}),value:"strategic"},{action_verbs:"Initiate, design and conduct, collaborate, research, synthesize, self-monitor, critique, produce/present",description:(0,N.jsxs)("ul",{children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Curricular elements assigned to this level demand extended and integrated use of higher order thinking processes such as critical and creative-productive thinking, reflection, and adjustment of plans over time.",id:"label.curricular_elements_assigned_to_th.f41fd6cd"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Learners are engaged in conducting multi-faceted investigations to solve real-world problems with unpredictable solutions.",id:"label.learners_are_engaged_in_conducting.72cfc620"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Employing and sustaining strategic thinking processes over a longer period of time to solve the problem or produce an authentic product is a key feature of curricular objectives assigned to DOK 4.",id:"label.employing_and_sustaining_strategic.c20c18f6"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"Key aspects that denote this particular level typically include authentic problems and audiences, and collaboration within a project-based setting.",id:"label.key_aspects_that_denote_this_parti.16a4e6a5"})})]}),learner_role:"Designs, takes risks, researches synthesizing multiple resources, collaborates, plans, organizes, and modifies, creates concrete tangible products",level:4,title:s({id:"label.extended_thinking.d007a3cb",defaultMessage:"Extended thinking"}),value:"extended"}],v={learning_goals:o||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"List the desired outcomes learners are expected to be able to demonstrate in terms of knowledge, skills, and values upon completion of a challenge. Ensure these align with the challenge statement and tie into the standards / benchmarks.",id:"label.list_the_desired_outcomes_learners.c35d6f05"})}),(0,N.jsx)(ds.l1,{initialValues:v,onSubmit:async e=>(await t(e),await r(e)),validateOnChange:!0,validateOnMount:!0,validationSchema:a(),children:e=>{var s;d.current=e;const{errors:a,handleSubmit:t,touched:i,values:l}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(ds.D0,{name:"learning_goals",children:()=>{var s;return(0,N.jsx)(N.Fragment,{children:null!==l&&void 0!==l&&null!==(s=l.learning_goals)&&void 0!==s&&s.length?(0,N.jsx)(N.Fragment,{children:l.learning_goals.map((s,a)=>(0,N.jsx)(lG,{depths_of_knowledge:x,idx:a,learning_goal:s,onChangeDOK:g,onChangeValue:p,onDelete:m,options:e},a))}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You haven't added any learning objectives yet",id:"label.you_havent_added_any_learning_obje.ca31e6f6"})})})}}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",disabled:(null===l||void 0===l||null===(s=l.learning_goals)||void 0===s?void 0:s.length)>=10,onClick:u,type:"button",variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2",color:"white"}),(0,N.jsx)(ke.A,{defaultMessage:"Add learning objective",id:"label.add_learning_objective.cb7f94de"})]}),(null===a||void 0===a?void 0:a.learning_goals)&&(null===i||void 0===i?void 0:i.learning_goals)&&(0,N.jsx)(ds.Kw,{name:"learning_goals",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}),(0,N.jsx)(je,{ref:c})]})}})]})};var lG=e=>{var s;const{depths_of_knowledge:a,idx:t,learning_goal:i,onChangeDOK:l,onChangeValue:n,onDelete:r,options:o}=e,{errors:d,touched:c}=o,{formatMessage:h}=(0,ja.A)();return(0,N.jsxs)(Ge.A,{className:"learning-objective-card mb-3",style:{align:"center"},children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)("h5",{className:"m-0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Objective {number}",id:"label.objective_number.a78481f4",values:{number:t+1}}),(0,N.jsx)(ve.A,{className:"float-end array-trash",onClick:()=>r(t),size:"sm",variant:"link",children:(0,N.jsx)(ze.qbC,{})})]})}),(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)(os,{children:(0,N.jsxs)(_e.A.Select,{defaultValue:(null===i||void 0===i?void 0:i.dok)||"",isInvalid:c.dok&&d.dok,isValid:c.dok&&!
2d.dok,name:`learning_goals.${t}.type`,onChange:e=>{var s;return l(t,null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},value:null===i||void 0===i?void 0:i.dok,children:[(0,N.jsx)("option",{value:"",children:h({id:"label.none_selected.55783235",defaultMessage:"None selected"})}),a.map((e,s)=>{let{title:a,value:t}=e;return(0,N.jsx)("option",{value:t,children:a},s)})]})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(ds.D0,{className:"form-control",component:"textarea",name:`learning_goals.${t}.value`,onKeyUp:e=>{var s;return n(t,null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value)},placeholder:"Enter questions..."}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)(FB,{length:(null===i||void 0===i||null===(s=i.value)||void 0===s?void 0:s.length)||0,max:2e3,min:30})})]})]})]})};var nG=e=>{const{api:s}=(0,P.nm)(),{formatMessage:a}=(0,ja.A)(),{fetchTemplateDetails:t,setTimedStatus:i,template:n}=sQ(),{entries:r}=n||{},o=(0,l.useRef)(),d=(0,l.useRef)(),[c,h,u]=(0,ne.CQ)({error:null,loading:!1}),m=e=>{const l=null===d||void 0===d?void 0:d.current;l&&l.show({actions:[l.CancelAction(),l.Action({label:a({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:async()=>await(async e=>{try{h({loading:!0}),await s.post(`/api/challenge-templates/delete/challenge-template-standard-entry/${null===n||void 0===n?void 0:n.id}/${e}`),await t(),h({loading:!1}),i("saved",2500)}catch({err:err}){h({error:err,loading:!1})}})(e),variant:"danger"})],body:a({id:"label.are_you_sure_you_want_to_remove_th.346b11ac",defaultMessage:"Are you sure you want to remove this standard entry?"}),title:a({id:"label.remove_entry.d653a1c5",defaultMessage:"Remove entry"})})},{error:g,loading:p}=c;return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Select the content standards, or benchmarks, to which your challenge aligns.",id:"label.select_the_content_standards_or_be.534cdf7b"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>h({error:null}),show:g,variant:"danger",children:g}),(0,N.jsxs)(Me.x_,{loading:p,children:[null!==r&&void 0!==r&&r.length?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h6",{children:(0,N.jsx)(ke.A,{defaultMessage:"Standards currently selected",id:"label.standards_currently_selected.20df3311"})}),(0,N.jsx)(Ce.S,{style:{maxHeight:700,overflowY:"auto"},children:r.map((e,s)=>{let{entries:a}=e;return(0,N.jsx)(rG,{entries:a,idx:s,onDelete:m},s)})})]}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You haven't added any standards yet",id:"label.you_havent_added_any_standards_yet.797d57c6"})}),(0,N.jsx)(Ce.S,{className:"mt-3",children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:()=>{const e=null===o||void 0===o?void 0:o.current;e&&e.show()},variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Add standards",id:"label.add_standards.1e92fa55"})]})})]}),(0,N.jsx)(GQ,{onRef:e=>o.current=e}),(0,N.jsx)(je,{ref:d})]})};var rG=e=>{const{entries:s,idx:a,onDelete:t}=e,{description:i,name:l,structure:n,token:r}=s||{},o=null===n||void 0===n?void 0:n.name;return(0,N.jsxs)(Ge.A,{className:"mb-3 card-list-entry",children:[(0,N.jsx)(Ge.A.Header,{children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsxs)(Ge.A.Title,{className:"m-0 text-primary",children:[r," ",o?(0,N.jsxs)("small",{children:["(",o,")"]}):""]}),(0,N.jsx)(ve.A,{onClick:()=>t(null===s||void 0===s?void 0:s.id),size:"sm",variant:"outline-primary",children:(0,N.jsx)(ze.qbC,{})})]})}),(0,N.jsxs)(Ge.A.Body,{children:[!!l&&(0,N.jsx)("p",{className:"font-weight-bold",children:l}),(0,N.jsx)("p",{className:"mb-0",children:i})]})]},`${a}-${r}`)};var oG=e=>{var s,a;const{api:t,styles:i}=(0,P.nm)(),{fetchTemplateDetails:n,getStepValidator:r,handleChangeTemplateData:o,setStatus:d,setTimedStatus:c,step:h,template:u,type:m,updateTemplate:g}=sQ(),{global_subtopics:p,global_topics:x}=uQ(),{subtopics:v,topics:f}=u||{},[j,_,b]=(0,ne.CQ)({error:null,loading:!1,refresh:!1}),A=(0,l.useRef)(),y=(0,l.useRef)(),w=(0,l.useRef)(),S=async()=>{const e=null===A||void 0===A?void 0:A.current;if(!e)return;_({refresh:!0}),await n();const s=await n();await e.setFieldValue("topics",null===s||void 0===s?void 0:s.topics),await e.setFieldTouched("topics",!0),await e.setFieldValue("subtopics",null===s||void 0===s?void 0:s.subto
2pics),await e.setFieldTouched("subtopics",!0),setTimeout(()=>_({refresh:!1}),50)},C=async()=>{const e=null===y||void 0===y?void 0:y.current;e&&(await e.show(),S())},M=async()=>{const e=null===w||void 0===w?void 0:w.current;e&&(await e.show(),S())},k=(e,s)=>{let{action:a,option:i,removedValue:l}=s;switch(a){case"select-option":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post("/api/challenge-templates/add/topic",{challenge_template_id:null===u||void 0===u?void 0:u.id,topic_id:e});const a=await n();await s.setFieldValue("topics",null===a||void 0===a?void 0:a.topics),await s.setFieldTouched("topics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===i||void 0===i?void 0:i.id);case"remove-value":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post(`/api/challenge-templates/remove/topic/${null===u||void 0===u?void 0:u.id}/${e}`);const a=await n();await s.setFieldValue("topics",null===a||void 0===a?void 0:a.topics),await s.setFieldTouched("topics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===l||void 0===l?void 0:l.id);default:return}},z=(e,s)=>{let{action:a,option:i,removedValue:l}=s;switch(a){case"select-option":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post("/api/challenge-templates/add/subtopic",{challenge_template_id:null===u||void 0===u?void 0:u.id,subtopic_id:e});const a=await n();await s.setFieldValue("subtopics",null===a||void 0===a?void 0:a.subtopics),await s.setFieldTouched("subtopics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===i||void 0===i?void 0:i.id);case"remove-value":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post(`/api/challenge-templates/remove/subtopic/${null===u||void 0===u?void 0:u.id}/${e}`),await n();const a=await n();await s.setFieldValue("subtopics",null===a||void 0===a?void 0:a.subtopics),await s.setFieldTouched("subtopics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===l||void 0===l?void 0:l.id);default:return}},T=(null===x||void 0===x||null===(s=x.sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}))||void 0===s?void 0:s.map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,value:s})))||[],I=(null===p||void 0===p||null===(a=p.sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}))||void 0===a?void 0:a.map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,value:s})))||[],{error:E,refresh:F}=j,R={subtopics:v||[],topics:f||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Indicate the subject area topics and subtopics for your challenge.",id:"label.indicate_the_subject_area_topics_a.551a1f91"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>_({error:null}),show:E,variant:"danger",children:E}),(0,N.jsx)(ds.l1,{initialValues:R,onSubmit:async e=>(o(e),await g(e)),validateOnChange:!0,validateOnMount:!0,validationSchema:r(),children:e=>{var s,a;A.current=e;const{errors:t,values:l}=e,n=(null===T||void 0===T||null===(s=T.filter)||void 0===s?void 0:s.call(T,e=>{for(const s of l.topics)if((null===s||void 0===s?void 0:s.topic_id)===(null===e||void 0===e?void 0:e.id))return!0;return!1}))||[],r=(null===I||void 0===I||null===(a=I.filter)||void 0===a?void 0:a.call(I,e=>{for(const s of l.subtopics)if((null===s||void 0===s?void 0:s.subtopic_id)===(null===e||void 0===e?void 0:e.id))return!0;return!1}))||[];return(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(ds.D0,{name:"topics",children:()=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select topics",id:"label.select_topics.a108d300"})}),(0,N.jsx)(ve.A,{className:"float-right",onClick:C,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add topic",id:"label.add_topic.dd88f6bd"})})]}),!F&&(0,N.jsx)(WC.Ay,{isMulti:!0,defaultValue:n,onChange:k,options:T,styles:i})]})}),(null===t||void 0===t?void 0:t.topics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:t.topics})]}
2),(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(ds.D0,{name:"subtopics",children:()=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select subtopics",id:"label.select_subtopics.8bca0962"})}),(0,N.jsx)(ve.A,{className:"float-right",onClick:M,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add subtopic",id:"label.add_subtopic.c8002a1d"})})]}),!F&&(0,N.jsx)(WC.Ay,{isMulti:!0,defaultValue:r,onChange:z,options:I,styles:i}),(null===t||void 0===t?void 0:t.subtopics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:t.subtopics})]})})}),(0,N.jsx)(HQ,{ref:y}),(0,N.jsx)(QQ,{ref:w})]})}})]})};var dG=e=>{const{formatMessage:s}=(0,ja.A)(),{api:a}=(0,P.nm)(),{default_banner:t}=(0,P.hc)(),{Err:i}=(null===Re._$||void 0===Re._$?void 0:Re._$.log)||{},{fetchTemplateDetails:n,getStepValidator:r,setStatus:o,setTimedStatus:d,template:c}=sQ(),{banner_path:h,cover_path:u,icon_path:m}=c||{},g=(0,l.useRef)(),p=(0,l.useRef)(),x=(0,l.useRef)(),v=(0,l.useRef)(),f=(0,l.useRef)(),[j,_,b]=(0,ne.CQ)({error:null,formik_key:(0,me.A)(),loading:!1}),A=()=>_({formik_key:(0,me.A)()}),y=(e,s)=>{const t=null===c||void 0===c?void 0:c.id,i=`challenge-template-${t}-cover-image.jpg`;return a.file("/api/challenge-templates/upload/image",{challenge_template_id:t,cover:!0,job_id:s},e,i)},w=async()=>{try{const e=null===g||void 0===g?void 0:g.current,s=null===p||void 0===p?void 0:p.current;if(!e||!s)return;const{file:a}=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await e.setFieldValue("cover_path",null===a||void 0===a?void 0:a.location),await e.setFieldTouched("cover_path",!0),await n(),A(),d("saved",2500)}catch(e){i(e),o("error"),_({error:(null===e||void 0===e?void 0:e.err)||e})}},S=(e,s)=>{const t=null===c||void 0===c?void 0:c.id,i=`challenge-template-${t}-banner-image.jpg`;return a.file("/api/challenge-templates/upload/banner",{challenge_template_id:t,job_id:s},e,i)},C=async()=>{try{const e=null===g||void 0===g?void 0:g.current,s=null===x||void 0===x?void 0:x.current;if(!e||!s)return;const a=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await e.setFieldValue("banner_path",null===a||void 0===a?void 0:a.location),await e.setFieldTouched("banner_path",!0),await n(),A(),d("saved",2500)}catch(e){i(e),o("error"),_({error:(null===e||void 0===e?void 0:e.err)||e})}},M=(e,s)=>{const t=null===c||void 0===c?void 0:c.id,i=`challenge-template-${t}-icon-image.jpg`;return a.file("/api/challenge-templates/upload/icon",{challenge_template_id:t,job_id:s},e,i)},k=async()=>{try{const e=null===g||void 0===g?void 0:g.current,s=null===v||void 0===v?void 0:v.current;if(!e||!s)return;const{file:a}=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await e.setFieldValue("icon_path",null===a||void 0===a?void 0:a.location),await e.setFieldTouched("icon_path",!0),await n(),A(),d("saved",2500)}catch(e){i(e),o("error"),_({error:(null===e||void 0===e?void 0:e.err)||e})}},z=e=>{const a=null===f||void 0===f?void 0:f.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:"Submit",onClick:()=>T(e),variant:"danger"})],body:s({id:"label.are_you_sure_you_want_to_remove_th.cca1f789",defaultMessage:"Are you sure you want to remove the {field} image?"},{field:e}),title:s({id:"label.remove_image.da7acac1",defaultMessage:"Remove image"})})},T=async e=>{const s=null===g||void 0===g?void 0:g.current;if(!s)return;const t=null===c||void 0===c?void 0:c.id;await a.post("/api/challenge-templates/media/remove",{challenge_template_id:t,field:e}),await s.setFieldValue(`${e}_path`,""),await s.setFieldTouched(`${e}_path`,!0),await n(),A(),d("saved",2500)},I={banner_path:h||"",cover_path:u||"",icon_path:m||""};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:I,onSubmit:Function(),validateOnChange:!0,validateOnMount:!0,validationSchema:r(),children:e=>{g.current=e;const{errors:s,handleSubmit:a,values:i}=e;return(0,N.jsxs)(_e.A,{onSubmit:a,children:[(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Capture your learners\u2019 interest by uploading an engaging banner cover, and icon image. Ensure images are appropriate in content and appropriate for your audience.",id:"label.capture_your_learners_interest_by.5a953e1d"})}),(0,N.jsxs)(os,{className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"banner_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Banner image",id:"label.banner_image.bceaa001"})}),(0,N.jsx)(ds.D0,{name:"banner_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview",children:[null!==i&&void 0!==i&&i.banner_path?(0,N.jsx)(Me.R_,{fluid:!0,rounded:!0,height:190,imageClassname:"banner-image",src:null===i||void 0===i?void 0:i.banner_path,width:758}):(0,N.jsxs)(Ce.S,{className:"banner-image-overlay",children:[(0,N.jsx)(Zs.A,{rounded:!0,alt:"",className:"banner-image",height:190,src:t,width:758}),(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(hG,{handleRemove:()=>z("banner"),handleUpload:C})]})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 2000 x 500 JPG or PNG file.",id:"label.please_use_a_2000_x_500_jpg_or_png.16f75540"})}),(null===s||void 0===s?void 0:s.banner_path)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.banner_path})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{as:os,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"cover_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Cover image",id:"label.cover_image.b62cee93"})}),(0,N.jsx)(ds.D0,{name:"cover_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview",children:[null!==i&&void 0!==i&&i.cover_path?(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:null===i||void 0===i?void 0:i.cover_path,width:300}):(0,N.jsxs)(Ce.S,{className:"cover-image-overlay",children:[(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:pc,width:300}),(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(hG,{handleRemove:()=>z("cover"),handleUpload:w})]})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 750 x 500 JPG or PNG file.",id:"label.please_use_a_750_x_500_jpg_or_png.5ed9acd7"})}),(null===s||void 0===s?void 0:s.cover_path)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.cover_path})]}),(0,N.jsxs)(Ve.A,{as:os,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"icon_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Icon image",id:"label.icon_image.9356b6da"})}),(0,N.jsx)(ds.D0,{name:"icon_path",children:()=>(0,N.jsx)(Ce.S,{className:"flex-1 d-flex align-items-center",children:null!==i&&void 0!==i&&i.icon_path?(0,N.jsxs)(Ce.S,{className:"media-preview icon-preview ",children:[(0,N.jsx)(Ad,{component:c,size:200,suspenseful:!0,type:"challenge"}),(0,N.jsx)(hG,{handleRemove:()=>z("icon"),handleUpload:k})]}):(0,N.jsxs)(Ce.S,{className:"media-preview icon-preview ",children:[(0,N.jsxs)(Ce.S,{className:"icon-image-overlay",children:[(0,N.jsx)(Zs.A,{alt:"",className:"avatar assignment-component-avatar",height:200,src:pc,width:200}),(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(hG,{handleRemove:()=>z("icon"),handleUpload:k})]})})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG or PNG file.",id:"label.please_use_a_500_x_500_jpg_or_png.2d736c7b"})}),(null===s||void 0===s?void 0:s.icon_path)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.icon_path})]})]}),(0,N.jsx)(TA,{aspectRatio:4,maxHeight:2e3,maxWidth:2e3,ref:x,uploadHandler:S}),(0,N.jsx)(TA,{aspectRatio:1.5,ref:p,uploadHandler:y}),(0,N.jsx)(TA,{aspectRatio:1,ref:v,uploadHandler:M}),(0,N.jsx)(je,{ref:f})]})}},j.formik_key)})};const cG=e=>{const{handleRemove:s,handleUpload:a}=e;return(0,N.jsxs)(li.A,{className:"options-dropdown",children:[(0,N.jsxs)(li.A.Toggle,{className:"d-flex align-items-center",children:[(0,N.jsx)(ze.Mbp,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:a,children:(0,N.jsx)(ke.A,{defaultMessage:"Upload an image...",id:"label.upload_an_image.dfdd8500"})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{onClick:s,children:(0,N.jsx)(ke.A,{defaultMessage:"Remove image",id:"label.remove_image.da7acac1"})})]})]})};cG.defaultProps={handleRemove:Function(),handleUpload:Function()};var hG=cG;const uG=l.createContext({}),mG=uG.Provider,gG=(uG.Consumer,()=>(0,l.useContext)(uG)),pG=(0,l.forwardRef)((s,a)=>{const{allowMultiSelect:t,excludedIds:i,onSelectionChange:n,onSubmit:r,organization_id:o,organization_memberships:d,scopeToUser:c,searchable:h,selectorType:u,submitOnSelect:m}=s,g=(0,l.useRef)(),{api:p}=(0,P.nm)(),[x,v,f]=(0,ne.CQ)({certification_templates:[],error:null,loading:!1,organizations:[],search_term:"",selected_certification_template_ids:[],show:!1,submitting:!1}),j=async()=>{try{const{loading:e,search_term:s}=x;if(e)return;v({certification_templates:[],loading:!0});const{certification_templates:a,count:t}=await p.post("/api/certification-templates/search/1/1000",{organization_id:o,search_term:s,sort_direction:"ASC",sort_token:"name",user_id:c});v({certification_templates:a,count:t,loading:!1})}catch(e){v({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message),loading:null})}},_=e=>{var s;return!(null===i||void 0===i||null===(s=i.includes)||void 0===s||!s.call(i,e))},b=e=>x.selected_certification_template_ids.includes(e),A=e=>{const{selected_certification_template_ids:s}=x;return b(e)?s.filter(s=>s!==e):[...s,e]},y=()=>{var e;return t?null===x||void 0===x?void 0:x.selected_certification_template_ids:null===x||void 0===x||null===(e=x.selected_certification_template_ids)||void 0===e?void 0:e[0]},w=()=>{var e;const{certification_templates:s}=x,a=y();return t?s.filter(e=>{var s;return null===a||void 0===a||null===(s=a.includes)||void 0===s?void 0:s.call(a,null===e||void 0===e?void 0:e.id)}):null===s||void 0===s||null===(e=s.find)||void 0===e?void 0:e.call(s,e=>(null===e||void 0===e?void 0:e.id)===a)};(0,l.useImperativeHandle)(a,()=>({getFullSelection:w,getSelection:y,refresh:j})),(0,l.useEffect)(()=>(j(),f),[]),(0,l.useEffect)(()=>{"function"===typeof n&&n(y())},[x.selected_certification_template_ids]);const{certification_templates:S,error:C,loading:M,organizations:k,search_term:z,selected_certification_template_ids:T,submitting:I}=x,E={certification_templates:S,clearSelections:()=>v({selected_certification_template_ids:[]}),excludedIds:i,fetchCertifications:j,getSelectedCertifications:A,handleSelectCertification:async e=>{if(_(null===e||void 0===e?void 0:e.id))return;const s=t?A(null===e||void 0===e?void 0:e.id):b(null===e||void 0===e?void 0:e.id)?[]:[null===e||void 0===e?void 0:e.id];v({selected_certification_template_ids:s}),m&&"function"===typeof r&&await r(y())},isDisabled:_,isOrgAdmin:e=>{var s,a;return 2===(null===d||void 0===d||null===(s=d.find)||void 0===s||null===(a=s.call(d,s=>(null===s||void 0===s?void 0:s.organization_id)===e))||void 0===a?void 0:a.role_id)},isSelected:b,loading:M,organization_memberships:d,organizations:k,selected_certification_template_ids:T,selectorType:u,submitting:I};return(0,N.jsxs)(mG,{value:(0,F.A)({},E),children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>v({error:null}),show:C,variant:"danger",children:C}),!!h&&(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{className:"border bg-white",children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{className:"border-start-0",onChange:e=>{var s;v({search_term:null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value}),(()=>{const{search_term:e}=x;g.current&&clearTimeout(g.current),g.current=setTimeout(()=>v({page:1,search_term:e},j),1e3)})()},placeholder:"Search",value:z})]}),(0,N.jsx)(vG,{})]})});pG.displayName="CertificationPicker",pG.defaultProps={allowMultiSelect:!0,body:"",excludedIds:[],hideOnSubmit:!1,searchable:!1,submitOnSelect:!1};var xG=pG;var vG=e=>{const{certification_templates:s,excludedIds:a,loading:t}=gG(),i=(e=>e.filter(e=>!a.includes(null===e||void 0===e?void 0:e.id)))(s);return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(_e.A,{className:"certification-picker-list d-flex pt-2 flex-column",children:(0,N.jsx)(Me.x_,{loading:t,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map((e,s)=>(0,N.jsx)(fG,{certification_template:e},s))}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center p-5 border rounded",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No certifications foun
2d",id:"label.no_certifications_found.5c62e166"})})})})})})};var fG=e=>{const{certification_template:s}=e,{handleSelectCertification:a,isDisabled:t,isSelected:i,selectorType:l}=gG();return(0,N.jsxs)(Ce.S,{className:`bg-light certification-picker-list-item d-flex align-items-center justify-content-between p-2 gap-3 mb-1 rounded ${i(null===s||void 0===s?void 0:s.id)?"selected":""} ${t(null===s||void 0===s?void 0:s.id)?"disabled":""}`,children:[(0,N.jsx)(Ce.S,{className:"d-flex flex-1 align-items-center gap-2",children:(0,N.jsx)(Zs.A,{rounded:!0,alt:"",src:(null===s||void 0===s?void 0:s.icon_path)||xo,style:{aspectRatio:1,height:"auto",objectFit:"cover",width:"100%"}})}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column justify-content-center flex-fill",children:[(0,N.jsx)(Fl,{as:"h5",maxWidth:500,placement:"bottom",children:(null===s||void 0===s?void 0:s.title)||"Unknown certification"}),(0,N.jsx)(Rl,{as:"small",lines:2,maxWidth:500,children:(null===s||void 0===s?void 0:s.description)||""})]}),(0,N.jsx)(Ce.S,{children:(()=>{switch(l){case"radio":return(0,N.jsx)(Zl.A,{checked:i(null===s||void 0===s?void 0:s.id),onChange:()=>a(s),type:"radio"});case"checkbox":return(0,N.jsx)(Zl.A,{checked:i(null===s||void 0===s?void 0:s.id),onChange:()=>a(s),type:"checkbox"});case"button":return(0,N.jsx)(ve.A,{className:"text-decoration-none",onClick:()=>a(s),size:"sm",variant:"link",children:(0,N.jsx)(ze.Z0P,{})})}})()})]})};const jG=(0,l.forwardRef)((e,s)=>{const{size:a,title:t}=e,{getAllUserOrganizations:i,userId:n}=(0,P.nm)(),[r,o]=(0,ne.CQ)({organization_id:null,reject:Function(),resolve:Function(),visible:!1}),{organization_id:d,resolve:c,visible:h}=r,u=(0,l.useRef)(),m=e=>new Promise((s,a)=>{o({organization_id:e,reject:a,resolve:s,visible:!0})}),g=()=>{c(null),o({organization_id:null,reject:Function(),resolve:Function(),visible:!1})};return(0,l.useImperativeHandle)(s,()=>({hide:g,show:m,visible:h})),(0,N.jsxs)(xe,{className:"certification-picker-modal",onHide:g,show:h,size:a,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:t||(0,N.jsx)(ke.A,{defaultMessage:"Select certification",id:"label.select_certification.fca43c30"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(xG,{allowMultiSelect:!1,include_sub_orgs:!1,organization_id:d,organization_memberships:i(),ref:u,scopeToUser:n,searchable:!1,selectorType:"radio",submitOnSelect:!1})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:()=>{const e=null===u||void 0===u?void 0:u.current;e&&(c(e.getFullSelection()),g())},children:"Select"})})]})});jG.displayName="CertificationPickerModal",jG.defaultProps={onSelect:Function(),size:"lg"};var _G=jG;var bG=e=>{const{userIsSiteAdmin:s}=(0,P.nm)(),{formatMessage:a}=(0,ja.A)(),{getStepValidator:t,handleChangeTemplateData:i,startEditingTimer:n,template:r,updateTemplate:o}=sQ(),{certification_template:d,completion_message:c,survey_path:h,total_learners_assigned:u}=r||{},{loading:m}=uQ(),g=(0,l.useRef)(),p=(0,l.useRef)(),x=(0,l.useRef)(),v=async()=>{const e=null===g||void 0===g?void 0:g.current;if(e)return(0,T.isEmpty)(await e.validateForm())},f=async e=>{const s=null===g||void 0===g?void 0:g.current;s&&(await s.handleChange(e),await s.setFieldTouched(e.target.name,!0),n(v,s.handleSubmit))},j=async e=>(await i(e),await o(e)),_=async()=>{const e=null===p||void 0===p?void 0:p.current,s=null===g||void 0===g?void 0:g.current;if(!e||!s)return;const a=await e.show();await s.setFieldTouched("certification_template_id",!0),await s.setFieldValue("certification_template_id",null===a||void 0===a?void 0:a.id),await j({certification_template_id:a.id})},b=()=>{const e=null===x||void 0===x?void 0:x.current;e&&!u&&e.show({actions:[e.CancelAction(),e.Action({label:a({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:()=>(async()=>{const e=null===g||void 0===g?void 0:g.current;e&&(await e.setFieldTouched("certification_template_id",!0),await e.setFieldValue("certification_template_id",null),await j({certification_template_id:null}))})(),variant:"danger"})],body:a({id:"label.are_you_sure_you_want_to_remove_th.c3a3e6c2",defaultMessage:"Are you sure you want to remove the certification {title} from this challenge?"},{title:(0,N.jsx)("strong",{children:d.title})}),size:"sm",title:a({id:"label.remove_certification.cfc63ffe",defaultMessage:"Remove certification"})})},A=s(),y={certification_template_id:(null===d||void 0===d?void 0:d.id)||null,completion_message:c||"",survey_path:h||""};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:y,onSubmit:j,validateOnChange:!0,validationSchema:t(),children:e=>{var s,t,i,l,n;g.current=e;const{errors:r,touched:o,values:c}=e;return(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"survey_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Survey path",id:"label.survey_path.adf2d856"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===o||void 0===o?void 0:o.survey_path)&&(null===r||void 0===r?void 0:r.survey_path),isValid:(null===o||void 0===o?void 0:o.survey_path)&&!(null!==r&&void 0!==r&&r.survey_path),name:"survey_path",onChange:f,value:null===c||void 0===c?void 0:c.survey_path,"aria-label":a({id:"label.challenge_template_survey_path.0ca31a91",defaultMessage:"challenge template survey path"})}),(null===r||void 0===r?void 0:r.survey_path)&&(null===o||void 0===o?void 0:o.survey_path)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:null===r||void 0===r?void 0:r.survey_path})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"completion_message",children:(0,N.jsx)(ke.A,{defaultMessage:"Completion message",id:"label.completion_message.9e597534"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===o||void 0===o?void 0:o.completion_message)&&(null===r||void 0===r?void 0:r.completion_message),isValid:(null===o||void 0===o?void 0:o.completion_message)&&!(null!==r&&void 0!==r&&r.completion_message),name:"completion_message",onCh
2ange:f,value:null===c||void 0===c?void 0:c.completion_message,"aria-label":a({id:"label.challenge_template_completion_mess.33ece2e4",defaultMessage:"challenge template completion message"})}),(null===r||void 0===r?void 0:r.completion_message)&&(null===o||void 0===o?void 0:o.completion_message)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:null===r||void 0===r?void 0:r.completion_message})]}),(0,N.jsxs)(os,{className:"d-flex flex-column gap-1",children:[(d||!!A)&&(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"certification_template",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})}),(0,N.jsx)(Me.p0,{className:"text-danger",disabled:!A||!d||!!u,loading:m,onClick:b,variant:"quaternary",children:(0,N.jsx)(ze.RCe,{})})]}),d?(0,N.jsxs)(Ge.A,{className:"mb-3",children:[(0,N.jsx)(Ge.A.Header,{className:"d-flex align-items-center justify-content-between",children:(0,N.jsxs)(Ce.S,{className:"d-flex w-100 align-items-center m-0",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-fill gap-3",children:[(0,N.jsx)(Zs.A,{rounded:!0,alt:"",height:50,src:null===d||void 0===d?void 0:d.icon_path,style:{objectFit:"cover"},width:50}),(0,N.jsx)("h5",{className:"m-0",children:null===d||void 0===d?void 0:d.title})]}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-1",children:[(0,N.jsx)("span",{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:`Accredited by: ${(null===d||void 0===d||null===(s=d.certification_accreditor)||void 0===s?void 0:s.name)||"credably.ai"}`,id:"client.src.pages.admin.ChallengeStep17.417651094423"})}),(0,N.jsx)(Zs.A,{rounded:!0,alt:`${(null===d||void 0===d||null===(t=d.certification_accreditor)||void 0===t?void 0:t.name)||"credably.ai"} logo`,className:"border",height:50,src:(null===d||void 0===d||null===(i=d.certification_accreditor)||void 0===i?void 0:i.logo_path)||xo,style:{objectFit:"cover"},title:`Accredited by: ${(null===d||void 0===d||null===(l=d.certification_accreditor)||void 0===l?void 0:l.name)||"credably.ai"}`,width:50})]})]})}),(0,N.jsx)(Ge.A.Body,{children:(0,N.jsx)(Rl,{lines:2,children:null===d||void 0===d?void 0:d.description})})]}):(0,N.jsx)(N.Fragment,{children:A?(0,N.jsx)(Ce.S,{className:"p-5 rounded bg-light d-flex align-items-center justify-content-center",children:(0,N.jsx)(ve.A,{disabled:!A||!!u,onClick:_,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Select certification",id:"label.select_certification.fca43c30"})})}):(0,N.jsx)(N.Fragment,{})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===c||void 0===c||null===(n=c.completion_message)||void 0===n?void 0:n.length,max:255})}),(0,N.jsx)(_G,{ref:p}),(0,N.jsx)(je,{ref:x})]})}})})};var AG=e=>{const[s,a]=(0,l.useState)(!1),t=(0,Pe.W6)(),{publishTemplate:i,template:n,template_valid:r}=sQ(),{published:o,total_est_completion_time:d,updated_at:c,version_title:h}=n||{},u=(0,l.useRef)();return(0,N.jsxs)(LU,{floating:!0,children:[o?(0,N.jsxs)(Ge.A,{body:!0,className:"my-4",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your challenge is published!",id:"label.your_challenge_is_published.65d7aa09"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations! You are now ready to inspire learners and help them develop the skills necessary to thrive in the future.",id:"label.congratulations_you_are_now_ready.4d82daec"})}),(0,N.jsx)(ve.A,{disabled:!r||!o,onClick:async()=>{const e=null===u||void 0===u?void 0:u.current;if(!e||!r)return;const{assignment:s}=await e.show({component:n,component_type:"challenge"})||{};s&&t.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`)},children:(0,N.jsx)(ke.A,{defaultMessage:"Assign to learners...",id:"label.assign_to_learners.34354e93"})})]}):(0,N.jsx)(N.Fragment,{children:r?(0,N.jsxs)(Ge.A,{body:!0,className:"my-3",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your challenge is ready to publish!",id:"label.your_challenge_is_ready_to_publish.ebe7272a"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations! You are now ready to inspire learners and help them develop the skills necessary to thrive in the future.",id:"label.congratulations_you_are_now_ready.4d82daec"})}),(0,N.jsxs)(Me.p0,{loading:s,onClick:async()=>{a(!0),await i(),a(!1)},children:[(0,N.jsx)("span",{style:{marginRight:10},children:(0,N.jsx)(ze.uoG,{})}),(0,N.jsx)(ke.A,{defaultMessage:"Publish challenge",id:"label.publish_challenge.d58a7aef"})]})]}):(0,N.jsx)(We.A,{className:"text-center mt-3",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"One or more steps are incomplete",id:"label.one_or_more_steps_are_incomplete.7c47aa76"})})}),(0,N.jsxs)(Qe.A,{className:"d-flex justify-content-space-between align-items-start gap-4 m-0",children:[(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how y
2our challenge will appear in the catalog",id:"label.heres_how_your_challenge_will_appe.84df7c97"})}),(0,N.jsx)(Kh,{className:"align-self-center",component:n,type:"challenge"})]})}),(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge details",id:"label.challenge_details.be6df044"})}),(0,N.jsxs)(Ce.S,{className:"details-meta",children:[(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:h})})]}),(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:(0,N.jsx)(Gh.XU,{value:c})})})]}),(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",id:"label.duration.4fc52a3c"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:(0,N.jsx)(Vh,{duration:d,unit:"minutes"})})})]})]})]})})]}),(0,N.jsx)(cc,{ref:u})]})};const yG=e=>{var s;let{agent:a,onConfigure:t,onRemove:i}=e;const l=null===a||void 0===a||null===(s=a.agent_persona_stub)||void 0===s?void 0:s.current,n=null===l||void 0===l?void 0:l.category;if(!l)return null;const r=a.directions||a.innovative_ideas||a.ideas_to_avoid||a.additional_context;return(0,N.jsx)(Ge.A,{className:"mb-2",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex align-items-center gap-3 py-2",children:[l.avatar_path?(0,N.jsx)(md,{name:l.name||"?",size:40,src:l.avatar_path}):(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center align-items-center",style:{background:(null===n||void 0===n?void 0:n.color)||"#6c757d",borderRadius:"50%",color:"#fff",flexShrink:0,fontSize:16,height:40,width:40},children:(l.name||"?").charAt(0).toUpperCase()}),(0,N.jsxs)(Ce.S,{className:"flex-1",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)("strong",{children:l.name}),(null===n||void 0===n?void 0:n.name)&&(0,N.jsx)(bo.A,{pill:!0,bg:"info",className:"small",children:n.name}),r&&(0,N.jsx)(bo.A,{pill:!0,bg:"success",className:"small",children:(0,N.jsx)(ke.A,{defaultMessage:"Configured",id:"label.configured.84aebc69"})})]}),l.style&&(0,N.jsx)("span",{className:"text-muted small",children:l.style.length>80?l.style.substring(0,80)+"...":l.style})]}),(0,N.jsx)(ve.A,{onClick:()=>t(a),size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ze.Pcn,{})}),(0,N.jsx)(ve.A,{onClick:()=>i(a),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ze.qbC,{})})]})})};const wG=(0,l.forwardRef)((s,a)=>{var t;const[i,n]=(0,l.useState)(!1),[r,o]=(0,l.useState)(null),[d,c]=(0,l.useState)({}),[h,u]=(0,l.useState)(!1),{api:m}=(0,P.nm)(),{formatMessage:g}=(0,ja.A)(),p=(0,l.useRef)(null);(0,l.useImperativeHandle)(a,()=>({show:async e=>(o(e),c({additional_context:e.additional_context||"",directions:e.directions||"",ideas_to_avoid:e.ideas_to_avoid||"",innovative_ideas:e.innovative_ideas||""}),n(!0),new Promise(e=>{p.current=e}))}));const x=(e,s)=>{c(a=>(0,F.A)((0,F.A)({},a),{},{[e]:s}))},v=()=>{n(!1),p.current&&p.current(!1)},f=null===r||void 0===r||null===(t=r.agent_persona_stub)||void 0===t?void 0:t.current;return(0,N.jsxs)(ue.A,{centered:!0,onHide:v,show:i,size:"lg",children:[(0,N.jsx)(ue.A.Header,{closeButton:!0,children:(0,N.jsxs)(ue.A.Title,{className:"d-flex align-items-center gap-2",children:[(null===f||void 0===f?void 0:f.avatar_path)&&(0,N.jsx)(md,{name:null===f||void 0===f?void 0:f.name,size:32,src:f.avatar_path}),(0,N.jsx)(ke.A,{defaultMessage:"Configure {name}",id:"label.configure_name.3c5ef540",values:{name:(null===f||void 0===f?void 0:f.name)||"Agent"}})]})}),(0,N.jsxs)(ue.A.Body,{children:[(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Directions",id:"label.directions.c9535678"})})}),(0,N.jsx)(_e.A.Text,{className:"d-block mb-2 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Specific instructions for how this agent should behave in the context of this challenge.",id:"label.specific_instructions_for_how_this.8a006acf"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>x("directions",e.target.value),placeholder:g({id:"label.eg_focus_on_guiding_learners_throu.22fff940",defaultMessage:"e.g. Focus on guiding learners through the research phase..."}),rows:3,value:d.directions})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Innovative ideas",id:"label.innovative_ideas.cb329aa2"})})}),(0,N.jsx)(_e.A.Text,{className:"d-block mb-2 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Creative approaches or novel perspectives this agent should explore or encourage.",id:"label.creative_approaches_or_novel_persp.8c94fd02"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>x("innovative_ideas",e.target.value),placeholder:g({id:"label.eg_encourage_cross_disciplinary_th.cc237d77",defaultMessage:"e.g. Encourage cross-disciplinary thinking, suggest real-world analogies..."}),rows:3,value:d.innovative_ideas})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Ideas to Avoid",id:"label.ideas_to_avoid.9c9bd7f4"})})}),(0,N.jsx)(_e.A.Text,{className:"d-block mb-2 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Topics, approaches, or behaviors this agent should steer away from in this challenge.",id:"label.topics_approaches_or_behaviors_thi.601f8245"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>x("ideas_to_avoid",e.target.value),placeholder:g({id:"label.eg_dont_give_direct_answers_avoid.2071ab24",defaultMessage:"e.g. Don't give direct answers, avoid overly technical jargon..."}),rows:3,value:d.ideas_to_avoid})]}),(0,N.jsxs)(_e.A.Group,{className:"mb-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Additional context",id:"label.additional_context.a748cb74"})})}),(0,N.jsx)(_e.A.Text,{className:"d-block mb-2 text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Any other relevant information that will help this agent assist learners effectively.",id:"label.any_other_relevant_information_tha.079647ce"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",onChange:e=>x("additional_context",e.target.value),placeholder:g({id:"label.eg_learners_will_have_completed_th.39ecde2b",defaultMessage:"e.g. Learners will have completed the introductory module before this challenge..."}),rows:3,value:d.additional_context})]})]}),(0,N.jsxs)(ue.A.Footer,{children:[(0,N.jsx)(ve.A,{onClick:v,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:h,onClick:async()=>
2{if(r)try{u(!0),await m.post(`/api/challenge-templates/agent-personas/update/${r.id}`,d),u(!1),n(!1),p.current&&p.current(!0)}catch(e){u(!1)}},variant:"primary",children:h?(0,N.jsx)(ke.A,{defaultMessage:"Saving...",id:"label.saving.dc85af8f"}):(0,N.jsx)(ke.A,{defaultMessage:"Save configuration",id:"label.save_configuration.b2b158f2"})})]})]})});wG.displayName="AgentConfigModal";var NG=()=>{const[s,a]=(0,ne.CQ)({available_agents:[],error:null,loading_agents:!1,selected_stub_id:""}),{fetchTemplateDetails:t,setTimedStatus:i,template:n}=sQ(),{api:r}=(0,P.nm)(),{formatMessage:o}=(0,ja.A)(),d=(null===n||void 0===n?void 0:n.agent_personas)||[],c=(0,l.useRef)(),h=(0,l.useRef)();(0,l.useEffect)(()=>{(async()=>{try{var s;a({loading_agents:!0});const e=await r.get("/api/agent-templates/personas/list"),t=(null===e||void 0===e||null===(s=e.data)||void 0===s?void 0:s.stubs)||(null===e||void 0===e?void 0:e.stubs)||[],i=d.map(e=>e.agent_persona_stub_id),l=t.filter(e=>{var s;return 1===(null===e||void 0===e||null===(s=e.current)||void 0===s?void 0:s.published)&&!i.includes(e.id)});a({available_agents:l,loading_agents:!1})}catch(e){a({error:(null===e||void 0===e?void 0:e.message)||e,loading_agents:!1})}})()},[null===d||void 0===d?void 0:d.length]);const u=s=>{var l,n;const d=c.current;if(!d)return;const h=(null===s||void 0===s||null===(l=s.agent_persona_stub)||void 0===l||null===(n=l.current)||void 0===n?void 0:n.name)||"this agent";d.show({actions:[d.CancelAction(),d.Action({label:o({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:async()=>{try{await r.post(`/api/challenge-templates/agent-personas/remove/${s.id}`),await t(),i("saved",2500)}catch(e){a({error:(null===e||void 0===e?void 0:e.message)||"An error occurred"})}},variant:"danger"})],body:o({id:"label.are_you_sure_you_want_to_remove_na.d928f34c",defaultMessage:"Are you sure you want to remove {name} from this challenge?"},{name:h}),title:o({id:"label.remove_agent.88eaed84",defaultMessage:"Remove agent"})})},m=async e=>{const s=h.current;if(!s)return;await s.show(e)&&(await t(),i("saved",2500))},{available_agents:g,error:p,selected_stub_id:x}=s;return(0,N.jsxs)(LU,{children:[p&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>a({error:null}),variant:"danger",children:p}),(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Assign up to 5 AI agent personas to assist learners in this challenge. Each agent can be configured with specific directions and context for this challenge.",id:"label.assign_up_to_5_ai_agent_personas_t.8f9fb488"})}),d.length?(0,N.jsx)(Ce.S,{className:"mb-3",children:d.map(e=>(0,N.jsx)(yG,{agent:e,onConfigure:m,onRemove:u},e.id))}):(0,N.jsx)(We.A,{className:"text-center",variant:"info",children:(0,N.jsx)(ke.A,{defaultMessage:"No agent personas have been assigned to this challenge yet.",id:"label.no_agent_personas_have_been_assign.907c9e61"})}),d.length<5&&(0,N.jsxs)(Ce.S,{className:"d-flex align-items-end gap-2 mb-3",children:[(0,N.jsxs)(_e.A.Group,{className:"flex-1",children:[(0,N.jsx)(_e.A.Label,{className:"small text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Select an agent to add",id:"label.select_an_agent_to_add.1a21e2b6"})}),(0,N.jsxs)(_e.A.Select,{onChange:e=>a({selected_stub_id:e.target.value}),value:x,children:[(0,N.jsx)("option",{value:"",children:o({id:"label.choose_an_agent_persona.af867517",defaultMessage:"-- Choose an agent persona --"})}),g.map(e=>{var s,a,t;return(0,N.jsxs)("option",{value:e.id,children:[null===(s=e.current)||void 0===s?void 0:s.name,null!==(a=e.current)&&void 0!==a&&null!==(t=a.category)&&void 0!==t&&t.name?` (${e.current.category.name})`:""]},e.id)})]})]}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",disabled:!x,onClick:async()=>{const{selected_stub_id:l}=s;if(l)try{var o,d;a({error:null});const e=await r.post(`/api/challenge-templates/agent-personas/add/${n.id}`,{agent_persona_stub_id:Number.parseInt(l)});if((null===e||void 0===e||null===(o=e.data)||void 0===o||!o.success)&&null!==e&&void 0!==e&&null!==(d=e.data)&&void 0!==d&&d.message)return void a({error:e.data.message});a({selected_stub_id:""}),await t(),i("saved",2500)}catch(e){var c;a({error:(null===e||void 0===e||null===(c=e.data)||void 0===c?void 0:c.message)||(null===e||void 0===e?void 0:e.message)||"An error occurred"})}},variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Add agent",id:"label.add_agent.d3e039d4"})]})]}),d.length>=5&&(0,N.jsx)("p",{className:"text-muted small",children:(0,N.jsx)(ke.A,{defaultMessage:"Maximum of 5 agents reached.",id:"label.maximum_of_5_agents_reached.
2c4e69627"})}),(0,N.jsx)(wG,{ref:h}),(0,N.jsx)(je,{ref:c})]})};var SG=()=>{const{api:s,getUserOrganizationId:a}=(0,P.nm)(),{formatMessage:t}=(0,ja.A)(),{fetchTemplateDetails:i,loading:n,setTimedStatus:r,template:o}=sQ(),d=(null===o||void 0===o?void 0:o.certification_templates)||[],c=(0,l.useRef)(),h=(0,l.useRef)(),u=async a=>{try{await s.post("/api/challenge-templates/attach-certification",{certification_template_id:a,challenge_template_id:null===o||void 0===o?void 0:o.id}),await i(),r("saved",2500)}catch(e){}},m=a=>{const l=null===h||void 0===h?void 0:h.current;l&&l.show({actions:[l.CancelAction(),l.Action({label:t({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:()=>(async a=>{try{await s.post("/api/challenge-templates/detach-certification",{certification_template_id:a,challenge_template_id:null===o||void 0===o?void 0:o.id}),await i(),r("saved",2500)}catch(e){}})(a.id),variant:"danger"})],body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to remove the certification {title} from this challenge?",id:"label.are_you_sure_you_want_to_remove_th.c3a3e6c2",values:{title:(0,N.jsx)("strong",{children:null===a||void 0===a?void 0:a.title})}})}),size:"sm",title:t({id:"label.remove_certification.cfc63ffe",defaultMessage:"Remove certification"})})};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Associate certifications that learners can earn upon completing this challenge. Administrators will select a certification during assignment creation.",id:"label.associate_certifications_that_lear.a86b7da9"})}),d.length>0&&(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-2 mb-3",children:d.map(e=>{var s;return(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex align-items-center justify-content-between py-2 px-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[e.icon_path?(0,N.jsx)(Zs.A,{rounded:!0,alt:"",height:36,src:e.icon_path,style:{objectFit:"cover"},width:36}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center rounded",style:{backgroundColor:"var(--gray-200, #e9ecef)",flexShrink:0,height:36,width:36},children:(0,N.jsx)(ze.veT,{className:"text-muted",size:16})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("strong",{className:"d-block",children:e.title}),e.certification_accreditor&&(0,N.jsx)("small",{className:"text-muted",children:null===(s=e.certification_accreditor)||void 0===s?void 0:s.name})]})]}),(0,N.jsx)(Me.p0,{className:"text-danger",disabled:n,loading:n,onClick:()=>m(e),size:"sm",variant:"quaternary",children:(0,N.jsx)(ze.RCe,{})})]})},e.id)})}),(0,N.jsxs)(ve.A,{onClick:async()=>{const e=null===c||void 0===c?void 0:c.current;if(!e)return;const s=await e.show(a());s&&await u(s.id)},variant:d.length?"outline-secondary":"primary",children:[(0,N.jsx)(ze.OiG,{className:"me-2",size:12}),(0,N.jsx)(ke.A,{defaultMessage:"Add certification",id:"label.add_certification.5fec0dc7"})]}),!d.length&&(0,N.jsx)(Ce.S,{className:"text-center p-4 mt-3 rounded",style:{backgroundColor:"rgba(213, 217, 220, 0.32)"},children:(0,N.jsx)("p",{className:"text-muted mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No certifications attached to this challenge yet.",id:"label.no_certifications_attached_to_this.6b744cf1"})})}),(0,N.jsx)(_G,{ref:c}),(0,N.jsx)(je,{ref:h})]})};var CG=s=>{const{formatMessage:a}=(0,ja.A)(),{getStepValidator:t,handleChangeTemplateData:i,setError:n,setStatus:r,setTimedStatus:o,startEditingTimer:d,template:c,updateTemplate:h}=sQ(),{saveTemplate:u}=uQ(),{challenge_type:m,title:g}=c||{},p=(0,l.useRef)(),x=async()=>{const e=null===p||void 0===p?void 0:p.current;if(p)return(0,T.isEmpty)(await e.validateForm())},v=async e=>{const s=null===p||void 0===p?void 0:p.current;p&&(await s.handleChange(e),await s.setFieldTouched(e.target.name,!0),d(x,s.handleSubmit))},f=async(s,a)=>{await a("challenge_type",s),await i({challenge_type:s}),r("editing");try{await u({challenge_type:s}),o("saved",2500)}catch(e){n((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e),r("error")}},j=async e=>(await i(e),await h(e)),_={challenge_type:m||"classic",title:g||""},b=Object.entries(Za.Ay).filter(e=>{let[s]=e;return"latest"!==s});return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:_,onSubmit:j,validateOnChange:!0,validationSchema:t(),children:e=>{var s;p.current=e;const{errors:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:j,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===l||void 0===l?void 0:l.title)&&(null===t||void 0===t?void 0:t.t
2itle),isValid:(null===l||void 0===l?void 0:l.title)&&!(null!==t&&void 0!==t&&t.title),name:"title",onChange:v,value:null===n||void 0===n?void 0:n.title,"aria-label":a({id:"label.challenge_template_title.2aa0baf8",defaultMessage:"challenge_template title"}),placeholder:a({id:"label.describe_your_challenge.9913ee28",defaultMessage:"Describe your challenge..."})}),(null===t||void 0===t?void 0:t.title)&&(null===l||void 0===l?void 0:l.title)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===t||void 0===t?void 0:t.title})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===n||void 0===n||null===(s=n.title)||void 0===s?void 0:s.length,max:100,min:4})}),(0,N.jsxs)(os,{className:"mt-4",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge type",id:"label.challenge_type.0f7ea265"})}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-2 mt-1",children:b.map(e=>{let[s,a]=e;const t=(null===n||void 0===n?void 0:n.challenge_type)===s;return(0,N.jsx)(Ge.A,{className:"cursor-pointer border-2 "+(t?"border-primary":"border"),onClick:()=>f(s,i),style:{cursor:"pointer"},children:(0,N.jsx)(Ge.A.Body,{className:"py-2 px-3",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(_e.A.Check,{checked:t,id:`challenge_type_${s}`,name:"challenge_type",onChange:()=>f(s,i),onClick:e=>e.stopPropagation(),type:"radio",value:s}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("strong",{children:a.label}),(0,N.jsx)("p",{className:"mb-0 text-muted small",children:a.description})]})]})})},s)})})]})]})}})})};var MG=e=>{const{getStepValidator:s,handleChangeTemplateData:a,setError:t,setStatus:i,startEditingTimer:n,template:r,updateTemplate:o}=sQ(),{author_avatar_image_path:d,author_bio:c,author_name:h}=r||{},[u,m,g]=(0,ne.CQ)({formik_key:(0,me.A)()}),p=(0,l.useRef)(),x=(0,l.useRef)(),{api:v}=(0,P.nm)(),f=async()=>{const e=null===x||void 0===x?void 0:x.current;if(x)return(0,T.isEmpty)(await e.validateForm())},j=async e=>{const s=null===x||void 0===x?void 0:x.current;s&&(await s.handleChange(e),setTimeout(()=>n(f,s.handleSubmit)))},_=async()=>{const e=null===x||void 0===x?void 0:x.current,s=null===p||void 0===p?void 0:p.current;if(s&&e)try{const a=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;e.setFieldValue("author_avatar_image_path",null===a||void 0===a?void 0:a.location),e.setFieldTouched("author_avatar_image_path",!0),setTimeout(()=>n(f,e.handleSubmit,!0))}catch(a){i("error"),t((null===a||void 0===a?void 0:a.err)||(null===a||void 0===a?void 0:a.message)||a)}},b={author_avatar_image_path:d||"",author_bio:c||"",author_name:h||""},{formik_key:A}=u;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(ds.l1,{initialValues:b,onSubmit:async e=>{await a(e),await o(e),m({formik_key:(0,me.A)()})},validateOnChange:!0,validateOnMount:!0,validationSchema:s(),initialTouched:{author_avatar_image_path:!0},children:e=>{var s,a;x.current=e;const{errors:t,handleSubmit:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,children:[(0,N.jsxs)(os,{className:"mb-2",children:[(0,N.jsx)(_e.A.Label,{style:{marginBottom:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"author's name",isInvalid:(null===l||void 0===l?void 0:l.author_name)&&(null===t||void 0===t?void 0:t.author_name),isValid:(null===l||void 0===l?void 0:l.author_name)&&!(null!==t&&void 0!==t&&t.author_name),min:"0",name:"author_name",onChange:j,value:n.author_name}),(0,N.jsx)(ds.Kw,{name:"author_name",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===(s=n.author_name)||void 0===s?void 0:s.length,max:100,min:2})}),(0,N.jsxs)(os,{className:"mb-2",children:[(0,N.jsx)(_e.A.Label,{style:{marginBottom:12},children:(0,N.jsx)(ke.A,{defaultMessage:"Biography",id:"label.biography.942dbeda"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"author's biography",as:"textarea",isInvalid:(null===l||void 0===l?void 0:l.author_bio)&&(null===t||void 0===t?void 0:t.author_bio),isValid:(null===l||void 0===l?void 0:l.author_bio)&&!(null!==t&&void 0!==t&&t.author_bio),name:"author_bio",onChange:j,placeholder:"Tell learners a little bit about yourself...",rows:3,type:"textarea",value:n.author_bio}),(0,N.jsx)(ds.Kw,{name:"author_bio",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:n.author_bio.length,max:500,min:(null===n||void 0===n||null===(a=n.author_bio)||void 0===a?void 0:a.length)&&30})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Avatar",id:"label.avatar.ca8e826d"})}),(0,N.jsx)(ds.D0,{name:"author_avatar_image_path",children:()=>(0,N.jsx)(N.Fragment,{children:null!==n&&void 0!==n&&n.author_avatar_image_path?(0,N.jsx)(Ce.S,{className:"my-3",children:(0,N.jsx)(md,{alt:"Challenge author avatar",size:90,src:null===n||void 0===n?void 0:n.author_avatar_image_path,suspenseful:!0})}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ya,{user:null})})})}),(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG, JPEG, or PNG file",id:"label.please_use_a_500_x_500_jpg_jpeg_or.8eb6e457"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:_,children:[(0,N.jsx)(ze.BzO,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})]}),(0,N.jsx)(ds.Kw,{name:"author_avatar_image_path",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]})]})}},A),(0,N.jsx)(TA,{aspectRatio:1,ref:p,uploadHandler:async(e,s)=>v.file("/api/challenge-templates/upload/author_avatar",{challenge_template_id:null===r||void 0===r?void 0:r.id,job_id:s},e,"author_avatar.jpg")})]})};var kG=e=>{const{getStepValidator:s,handleChangeTemplateData:a,startEditingTimer:t,template:i,updateTemplate:n}=sQ(),r=(0,l.useRef)(),o=(0,l.useRef)(),d=async()=>{const e=null===o||void 0===o?void 0:o.current;if(o)return(0,T.isEmpty)(await e.validateForm())},c=async e=>(await a(e),await n(e)),h=async e=>{var s;const a=null===o||void 0===o?void 0:o.current,i=null===r||void 0===r?void 0:r.current;if(!a||!i)return;const l=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value;await a.setFieldValue("total_est_completion_time",l),t(d,a.handleSubmit)},u={total_est_completion_time:(null===i||void 0===i?void 0:i.total_est_completion_time)||120};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:u,onSubmit:c,validateOnChange:!0,validationSchema:s(),children:e=>{o.current=e;const{errors:s,touched:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:c,children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated time to complete challenge",id:"label.estimated_time_to_complete_challen.679125a0"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)("label",{htmlFor:"challenge_template-time-to-complete-input",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Time to complete",id:"label.time_to_complete.7e73fe58"})})}),(0,N.jsxs)(Ce.S,{id:"time-to-complete-range-label",style:{maxWidth:600},children:[(0,N.jsx)("section",{className:"range-slider",onChange:h,ref:r,children:(0,N.jsx)("input",{className:"custom-range",id:"estimatedCompletionTime",max:600,min:30,step:15,type:"range",value:null===t||void 0===t?void 0:t.total_est_completion_time})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("span",{className:"me-2 text-muted",children:"30m"}),(0,N.jsx)("strong",{className:"text-primary",children:(0,N.jsx)(Vh,{duration:t.total_est_completion_time,label_type:"long",units:"minutes"})}),(0,N.jsx)("span",{className:"ms-2 text-muted",children:"10h"})]})]}),(0,N.jsx)(Ce.S,{className:"d-block w-100",style:{height:35}}),(null===s||void 0===s?void 0:s.total_est_completion_time)&&(null===a||void 0===a?void 0:a.total_est_completion_time)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.total_est_completion_time})]}),(0,N.jsx)(os,{style:{display:"none"},children:(0,N.jsx)(_e.A.Control,{name:"total_est_completion_time",style:{display:"block",height:100,width:"100%"},type:"number"})})]})}})})};var zG=e=>{const{styles:s}=(0,P.nm)(),{primary:a,white:t}=s,{global_audience_categories:i}=uQ(),{getStepValidator:n,handleChangeTemplateData:r,startEditingTimer:o,status:d,template:c,updateTemplate:h}=sQ(),{audience_category_id:u}=c||{},m=(0,l.useRef)(),g=()=>{var e;return!(null===m||void 0===m||null===(e=m.current)||void 0===e||!e.isValid)},p=async e=>(await r(e),await h(e)),x=async e=>{const s=m.current;s&&"saving"!==d&&!v(e)&&s.values.audience_category!==e&&(await s.setFieldTouched("audience_category_id",!0),await s.setFieldValue("audience_category_id",e),o(g,s.handleSubmit,!0))},v=e=>{var s;const a=m.current;return!!a&&(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.audience_category_id)===e}
2,f={audience_category_id:u};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:f,onSubmit:p,validateOnChange:!0,validationSchema:n(),children:e=>{m.current=e;const{errors:s,touched:l,values:n}=e;return(0,N.jsx)(_e.A,{onSubmit:p,children:(0,N.jsxs)(os,{style:{margin:0},children:[(0,N.jsx)(_e.A.Label,{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column flex-lg-row align-items-center justify-content-between",children:!(null===i||void 0===i||!i.length)&&i.map((e,s)=>(0,N.jsx)(qV,{checked:n.audience_category_id===(null===e||void 0===e?void 0:e.id),disabled:"saving"===d,icon:(0,N.jsx)(FG,{category:null===e||void 0===e?void 0:e.value,color:v(null===e||void 0===e?void 0:e.id)?t:a,size:112}),id:`audienceChoiceTrigger-${null===e||void 0===e?void 0:e.id}`,inputId:`audienceChoiceInput-${null===e||void 0===e?void 0:e.id}`,label:null===e||void 0===e?void 0:e.name,name:"audience_category_id",onSelect:x,value:null===e||void 0===e?void 0:e.id},s))}),(null===s||void 0===s?void 0:s.audience_category)&&(null===l||void 0===l?void 0:l.audience_category)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.audience_category})]})})}})})},TG=t(27293),IG=t(15839),EG=t(89636);var FG=e=>{const{category:s,color:a,size:t}=e;let i={cl_d:TG.default,hied:IG.default,"k-12":EG.default};const n=(null===i||void 0===i?void 0:i[s])||l.Fragment;return(0,N.jsx)(n,{color:a,fontSize:t})};var RG=e=>{const{global_audiences:s}=uQ(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,status:n,step:r,template:o,type:d,updateTemplate:c}=sQ(),{audience_category:h,audiences:u}=o||{},{audience_category_id:m}=h||{},g=(0,l.useRef)(),p=async()=>{const e=null===g||void 0===g?void 0:g.current;if(g)return(0,T.isEmpty)(await e.validateForm())},x=async()=>{const e=null===g||void 0===g?void 0:g.current;if(!e)return;const s=(null===e||void 0===e?void 0:e.values)||{};await t(s),await c(s)},v=()=>s.filter(e=>(null===e||void 0===e?void 0:e.audience_category_id)===m),f=e=>{var s,a,t;const i=null===g||void 0===g?void 0:g.current;return!!i&&!(null===i||void 0===i||null===(s=i.values)||void 0===s||null===(a=s.audiences)||void 0===a||null===(t=a.find)||void 0===t||!t.call(a,s=>{var a;return(null===s||void 0===s||null===(a=s.audiences)||void 0===a?void 0:a.id)===e}))},j=(0,T.orderBy)(v(),["short-name"],["asc"]),_={audiences:u||[]};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:_,onSubmit:x,validateOnChange:!0,validationSchema:a(),children:e=>(g.current=e,(0,N.jsxs)(_e.A,{className:"mt-3",onSubmit:x,children:[null!==j&&void 0!==j&&j.length?(0,N.jsx)(N.Fragment,{children:j.map((e,s)=>{let{id:a,name:t,short_name:l}=e,r=f(a);const o="saving"===n;return(0,N.jsxs)(Ce.S,{className:"mb-3",children:["6"===l&&(0,N.jsx)("h5",{className:"text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Middle school",id:"label.middle_school.e39f6cf0"})}),"9"===l&&(0,N.jsx)("h5",{className:"text-primary mt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"High school",id:"label.high_school.8ed82c87"})}),(0,N.jsx)(_e.A.Check,{checked:r,className:"ps-0",disabled:o,label:t,onClick:()=>(async e=>{var s;const a=null===g||void 0===g?void 0:g.current;if(!a)return;let t=[...(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.audiences)||[]];const l=v();if(f(e))t=t.filter(s=>{var a;return(null===s||void 0===s||null===(a=s.audiences)||void 0===a?void 0:a.id)!==e});else{const s={audiences:l.find(s=>(null===s||void 0===s?void 0:s.id)===e)};t=[...t,s]}await a.setFieldValue("audiences",t),await a.setFieldTouched("audiences",!0),i(p,a.handleSubmit)})(a),readOnly:o,type:"checkbox"})]},s)})}):(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No audiences available for this category",id:"label.no_audiences_available_for_this_ca.2022cb14"})}),(0,N.jsx)(ds.Kw,{name:"audiences",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}))})})};var DG=e=>{var s,a;const[t,i,n]=(0,ne.CQ)({loading:!1,refresh:!1}),{formatMessage:r}=(0,ja.A)(),{api:o,styles:d,userHasRight:c}=(0,P.nm)(),{primary:h,white:u}=d,{global_subjects:m}=uQ(),{fetchTemplateDetails:g,getStepValidator:p,setError:x,setStatus:v,setTimedStatus:f,status:j,template:_,template_id:b}=sQ(),{audience_category:A,audience_category_id:y,subjects:w}=_||{},S=null===Re._$||void 0===Re._$||null===(s=Re._$.binary)||void 0===s?void 0:s.parseBinary,C=(0,l.useRef)(),M=(0,l.useRef)(),k=()=>{i({refresh:!0}),setTimeout(()=>i({refresh:!1}),50)},z=async e=>{if(t.loading)return;const s=null===C||void 0===C?void 0:C.current;if(!C)return;await s.setFieldValue("featured_subject",e),await s.setFieldTouched("featured_subject",!0);const a=[...s.values.subjects],i=a.find(s=>s.subject_id===e);i?i.is_featured=!0:a.push({is_featured:!0,subject_id:e}),await s.setFieldValue("subjects",a),s.handleSubmit()},T=async(e,s)=>{const a=S(E()!==(null===e||void 0===e?void 0:e.featured_subject));await I(null===e||void 0===e?void 0:e.featured_subject,a),!a&&s.setFieldValue("featured_subject",null)},I=async(e,s)=>{try{i({loading:!0}),v("saving"),await o.post("/api/challenge-templates/set/featured-subject",{challenge_template_id:b,is_featured:s,subject_id:e}),await g(),i({loading:!1}),f("saved",2500)}catch({err:err}){i({loading:!1}),x(err),v("error")}},E=()=>{var e,s;return null===w||void 0===w||null===(e=w.find)||void 0===e||null===(s=e.call(w,e=>!(null===e||void 0===e||!e.is_featured)))||void 0===s?void 0:s.subject_id},F=async(e,s)=>{var a,t;let{action:l}=s;switch(l){case"select-option":return await(async(e,s)=>{try{i({loading:!0}),v("saving"),await o.post(`/api/challenge-templates/add/subject/${b}`,{audience_category_id:null===A||void 0===A?void 0:A.audience_category_id,is_featured:s,subject_id:e}),i({loading:!1}),k(),f("saved",2500)}catch({err:err}){i({loading:!1}),x(err),v("error")}})(null===s||void 0===s||null===(a=s.option)||void 0===a?void 0:a.id,!1),f("saved",2500),await g();case"remove-value":return(async e=>{try{i({loading:!0}),v("saving"),await o.post(`/api/challenge-templates/remove/subject/${b}/${e}`),await g(),i({loading:!1}),k(),f("saved",2500)}catch({err:err}){i({loading:!1}),x(err),v("error")}})(null===s||void 0===s||null===(t=s.removedValue)||void 0===t?void 0:t.id)}},R=async()=>{const e=null===M||void 0===M?void 0:M.current;e&&await e.show()}
2,D=E(),B=m.filter(e=>{const{audience_categories:s}=e;for(let a of s)if(a&&Number.parseInt(a.audience_category_id)===Number.parseInt(y))return!0;return!1}),L=(()=>{let e=[];for(const s of m){const{audience_categories:a=[]}=s||{};for(const t of a)(null===t||void 0===t?void 0:t.audience_category_id)===y&&e.push(s)}return e})(),O=null===_||void 0===_||null===(a=_.subjects)||void 0===a?void 0:a.map(e=>{let{is_featured:s,subjects:a}=e;return{id:null===a||void 0===a?void 0:a.id,is_featured:s,name:null===a||void 0===a?void 0:a.name}}),H=((e,s)=>e.filter(e=>!s.find(s=>s.id===e.id)).sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}).map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,slug:null===e||void 0===e?void 0:e.slug,value:s})))(B,O),U=((e,s)=>e.filter(e=>s.find(s=>s.id===e.id&&!s.is_featured)).sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}).map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,slug:null===e||void 0===e?void 0:e.slug,value:s})))(B,O),{loading:Q,refresh:V}=t;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(ds.l1,{onSubmit:T,validateOnChange:!0,validateOnMount:!0,validationSchema:p(),initialValues:{featured_subject:D||null,subjects:w||[]},children:e=>{C.current=e;const{errors:s,touched:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:T,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(ds.D0,{name:"featured_subject",children:()=>(0,N.jsx)(N.Fragment,{children:null!==L&&void 0!==L&&L.length?(0,N.jsx)(Ce.S,{className:"d-flex flex-wrap",children:L.map((e,s)=>{const{id:a,name:i}=e,l=a===(null===t||void 0===t?void 0:t.featured_subject),n=l?u:h;return(0,N.jsx)(qV,{checked:l,className:"me-2 mb-2",disabled:"saving"===j||Q,icon:(0,N.jsx)($n,{color:n,size:48,subject:i}),id:`audienceChoiceTrigger-${a}`,inputId:`audienceChoiceInput-${a}`,label:i,name:"featured_subject",onSelect:z,value:a},s)})}):(0,N.jsx)(We.A,{className:"text-center mt-3 mb-0",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects found, please make sure you have selected an Audience Category",id:"label.no_subjects_found_please_make_sure.9fccc6bc"})})})}),!(null!==t&&void 0!==t&&t.featured_subject)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:(0,N.jsx)(ke.A,{defaultMessage:"You must select a featured subject",id:"label.you_must_select_a_featured_subject.c05eeedb"})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"clearfix",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-3",children:[(0,N.jsxs)("h4",{className:"card-title m-0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Select additional subjects",id:"label.select_additional_subjects.eda01ad5"}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})})]}),c("manage_challenge")&&(0,N.jsx)(ve.A,{onClick:R,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add new subject",id:"label.add_new_subject.0a22b4b1"})})]})}),!V&&(0,N.jsx)(WC.Ay,{isMulti:!0,isDisabled:"saving"===j||Q,onChange:F,options:H,styles:d,value:U,placeholder:r({id:"label.select_a_subject.b136475b",defaultMessage:"Select a subject..."})}
2,"react-select-subjects-cme-step-7"),(null===s||void 0===s?void 0:s.subjects)&&(null===a||void 0===a?void 0:a.subjects)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.subjects})]})]})}}),(0,N.jsx)(gQ,{ref:M})]})};var BG=e=>{var s,a,t,i,n;const{getStepValidator:r,handleChangeTemplateData:o,startEditingTimer:d,step:c,template:h,type:u,updateTemplate:m}=sQ(),{overview:g,trigger_content_type:p,trigger_content_url:x}=h||{},{formatMessage:v}=(0,ja.A)(),f=(0,l.useRef)(),j=(0,l.useRef)(),_=(0,l.useRef)(),[b,A,y]=(0,ne.CQ)({formik_key:(0,me.A)()}),w=(0,ds.Wx)({enableReinitialize:!0,initialValues:{overview:g||"",trigger_content_type:p||"",trigger_content_url:x||""},onSubmit:async function(e){await o(e),await m(e),S()},validateOnChange:!0,validationSchema:r()}),S=()=>{A({formik_key:(0,me.A)()}),w.resetForm({values:initial_values})},C=async()=>(0,T.isEmpty)(await w.validateForm());const M=async()=>{await w.setFieldValue("trigger_content_url",""),await w.setFieldValue("trigger_content_type",""),await w.setFieldTouched("trigger_content_url",!0),await w.setFieldTouched("trigger_content_type",!0),setTimeout(async()=>{await w.validateForm(),d(C,w.handleSubmit,!0)},0)},k=e=>(0,N.jsx)("small",(0,F.A)({className:"text-danger"},e)),z=e=>w.touched[e]&&w.errors[e]?w.errors[e]:null;return(0,N.jsx)(LU,{children:(0,N.jsxs)(_e.A,{onSubmit:w.handleSubmit,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Overview",id:"label.overview.d4b1ea57"})}),(0,N.jsx)(_Q,{onChange:async e=>{var s,a;(null===f||void 0===f||null===(s=f.current)||void 0===s||null===(a=s.getEditor)||void 0===a?void 0:a.call(s))&&(await w.setFieldValue("overview",e),await w.setFieldTouched("overview",!0),d(C,w.handleSubmit))},ref:f,value:w.values.overview}),(0,N.jsx)("input",{name:"overview",onBlur:w.handleBlur,onChange:w.handleChange,type:"hidden",value:w.values.overview}),z("overview")&&(0,N.jsx)(k,{children:z("overview")})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:(e=>{var s,a,t;return(null===(s=(0,ad.G9)(e,{preserveNewlines:!1}))||void 0===s||null===(a=s.trim)||void 0===a||null===(t=a.call(s))||void 0===t?void 0:t.length)||0})(w.values.overview),max:2e3,min:4})}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Video trigger",id:"label.video_trigger.bdec616b"})}),(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload or paste a link to your video file.",id:"label.upload_or_paste_a_link_to_your_vid.a56fe5be"})}),(0,N.jsx)(pQ,{placeholder:"",vimeoThumb:!1,ytThumb:!1,challenge_template:{trigger_content_type:null===(s=w.values)||void 0===s?void 0:s.trigger_content_type,trigger_content_url:null===(a=w.values)||void 0===a?void 0:a.trigger_content_url}}),(0,N.jsxs)(Ce.S,{className:"d-flex mt-3 mb-2",children:[(0,N.jsxs)(ve.A,{className:"d-flex align-items-center me-3",onClick:async()=>{const e=null===j||void 0===j?void 0:j.current;if(!e)return;const{trigger_content_type:s,trigger_content_url:a}=await e.show()||{};s&&a&&(await w.setFieldValue("trigger_content_type",s),await w.setFieldValue("trigger_content_url",a),await w.setFieldTouched("trigger_content_type",!0),await w.setFieldTouched("trigger_content_url",!0),setTimeout(async()=>{await w.validateForm(),d(C,w.handleSubmit,!0)},0))},variant:"primary",children:[(0,N.jsx)(ze.BzO,{className:"me-1",color:"white"}),null!==(t=w.values)&&void 0!==t&&t.trigger_content_url?"Replace Content":"Upload Content"]}),!(null===(i=w.values)||void 0===i||!i.trigger_content_url)&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center text-danger",onClick:()=>{const e=null===_||void 0===_?void 0:_.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:v({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:async()=>await M(),variant:"danger"})],body:v({id:"label.are_you_sure_you_want_to_remove_th.d40fba75",defaultMessage:"Are you sure you want to remove the current trigger content?"}),title:v({id:"label.remove_trigger_content.669a4ef7",defaultMessage:"Remove trigger content"})})},variant:"link",children:[(0,N.jsx)(ze.RCe,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[z("trigger_content_url")&&(0,N.jsx)(k,{children:z("trigger_content_url")}),z("trigger_content_type")&&(0,N.jsx)(k,{children:z("trigger_content_type")})]}),(0,N.jsx)(vQ,{defaultActiveKey:(e=>"Video"===e?"upload":"embed")(null===(n=w.values)||void 0===n?void 0:n.trigger_content_type),ref:j}),(0,N.jsx)(je,{ref:_})]},b.formik_key)})};var PG=e=>{const{formatMessage:s}=(0,ja.A)(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,template:n,updateTemplate:r}=sQ(),{type:o}=n||{},{challenge_template_types:d}=uQ(),c=(0,l.useRef)(),[h,u,m]=(0,ne.CQ)({active_kind:(e=>{var s,a;return(null===d||void 0===d||null===(s=d.find)||void 0===s||null===(a=s.call(d,s=>(null===s||void 0===s?void 0:s.value)===e))||void 0===a?void 0:a.kind)||null})(o)}),g=async()=>{const e=null===c||void 0===c?void 0:c.current;if(c)return(0,T.isEmpty)(await e.validateForm())},p=async e=>(await t(e),await r(e)),x=async e=>{var s;const a=c.current;a&&((null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.type)!==e?await a.setFieldValue("type",e):await a.setFieldValue("type",""),await a.setFieldTouched("type",!0),i(g,a.handleSubmit,!0))},v=[{badge_variant:"success",label:s({id:"label.low_complexity.bb73fc51",defaultMessage:"Low complexity"}),name:"tame",title:s({id:"label.tame_problems.0d30dfff",defaultMessage:"Tame problems"})},{badge_variant:"warning",label:s({id:"label.medium_complexity.c37c4d25",defaultMessage:"Medium complexity"}),name:"complex",title:s({id:"label.complex_problems.c84b666a",defaultMessage:"Complex problems"})},{badge_variant:"danger",label:s({id:"label.high_complexity.5916101f",defaultMessage:"High complexity"}),name:"wicked",title:s({id:"label.wicked_problems.b9a7415f",defaultMessage:"Wicked problems"})}],{active_kind:f}=h,j={type:o||""};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"The
2se questions can be used as a reference to help you create a challenge statement.",id:"label.these_questions_can_be_used_as_a_r.6941355d"})}),(0,N.jsx)(ds.l1,{initialValues:j,onSubmit:p,validateOnChange:!0,validationSchema:a(),children:e=>(c.current=e,(0,N.jsx)(_e.A,{onSubmit:p,children:(0,N.jsx)(os,{children:v.map((s,a)=>{const t=f===(null===s||void 0===s?void 0:s.name),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"tame";return!(null===d||void 0===d||!d.length)&&d.filter(s=>{let{kind:a}=s;return a===e})}(null===s||void 0===s?void 0:s.name)||[];return(0,N.jsx)(LG,{is_active:t,item:s,onOptionSelect:x,onSelect:()=>(e=>u({active_kind:h.active_kind===e?null:e}))(null===s||void 0===s?void 0:s.name),options:e,types:i},a)})})}))})]})};var LG=e=>{const{is_active:s,item:a,onOptionSelect:t,onSelect:i,options:l,types:n}=e,{badge_variant:r,label:o,title:d}=a||{};return(0,N.jsxs)(Ge.A,{className:"mt-3",children:[(0,N.jsxs)(Ge.A.Header,{className:"d-flex align-items-center justify-content-between",onClick:i,style:{cursor:"pointer"},tabIndex:0,children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[s?(0,N.jsx)(ze.z44,{}):(0,N.jsx)(ze.ZPM,{}),(0,N.jsx)("h5",{className:"d-inline-block mx-2 mb-0",children:d})]}),(0,N.jsx)(bo.A,{bg:r,style:{verticalAlign:"middle"},children:(0,N.jsx)("strong",{children:o})})]}),s&&(0,N.jsx)(OG,{onSelect:t,options:l,types:n})]})};var OG=e=>{const{onSelect:s,options:a,types:t}=e;return(0,N.jsx)(Ce.S,{className:"p-3 challenge_template-type-list-container",children:!(null===t||void 0===t||!t.length)&&t.map((e,t)=>(0,N.jsx)(HG,{item:e,onSelect:s,options:a},t))})};var HG=e=>{const{item:s,onSelect:a,options:t}=e,{content:i,name:l,value:n,value_label:r}=s,{values:o}=t||{},{styles:d}=(0,P.nm)(),{primary:c,white:h}=d,u=n===(null===o||void 0===o?void 0:o.type);return(0,N.jsxs)(Ce.S,{className:"challenge_template-type-list-item-container "+(u?"selected":""),children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"d-flex flex-1",children:(0,N.jsxs)(os,{className:"d-flex align-items-center",onClick:()=>a(n),children:[(0,N.jsx)(sy,{checked:u,id:`option-${n}`,name:"visibility",type:"radio"}),(0,N.jsxs)(Ce.S,{className:"d-flex flex-column ms-2",children:[(0,N.jsx)("small",{className:"caption text-uppercase text-primary",children:(0,N.jsx)("strong",{children:r})}),(0,N.jsx)(_e.A.Label,{htmlFor:`option-${n}`,children:l})]})]})}),(0,N.jsx)(ve.A,{"aria-controls":`challenge_templateType${n}`,"aria-expanded":"false",className:"align-self-center","data-target":`#challenge_templateType${n}`,"data-toggle":"collapse",variant:"link",children:(0,N.jsx)(ze.Ucs,{})})]}),(0,N.jsx)(Ce.S,{className:"body",children:(0,N.jsx)(Ce.S,{className:"collapse",id:`challenge_templateType${n}`,children:(0,N.jsxs)(Ce.S,{className:"expanded-details-container",children:[(0,N.jsx)("strong",{className:"d-block text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Context and Examples:",id:"label.context_and_examples.2c80b20b"})}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"w-75 align-top",children:i}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-end",style:{minWidth:120},children:(0,N.jsx)(Ce.S,{className:"bot-right-container position-relative",children:(0,N.jsxs)(Ce.S,{className:"bot-right",children:[(0,N.jsx)("svg",{className:"corner-curve",height:"118.002",viewBox:"0 0 161.289 118.002",width:"161.289",xmlns:"http://www.w3.org/2000/svg",children:(0,N.jsx)("path",{d:"M14205-13238h-156.745a19.4,19.4,0,0,0,5.439-1.406,42.819,42.819,0,0,0,6.246-3.2,117.478,117.478,0,0,0,14.583-10.909c10.548-8.979,22.542-20.915,35.241-33.553l.013-.012c16.516-16.436,33.593-33.432,50.08-46.607,8.939-7.144,16.752-12.411,23.888-16.1a64.939,64.939,0,0,1,11.045-4.58A35.878,35.878,0,0,1,14205-13356v118Zm-158.795,0h-2.494a8.188,8.188,0,0,1,1.133-.073c.41,0,.87.025,1.361.071Z","data-name":"Subtraction 10",fill:c,id:"Subtraction_10",transform:"translate(-14043.71 13356)"})}),(0,N.jsxs)(Ce.S,{className:"icon p-2 d-flex flex-column align-items-end position-absolute text-end",style:{bottom:0,maxWidth:100,right:0}
2,children:[(0,N.jsx)(LQ,{color:h,rwq:n,size:30}),(0,N.jsx)("small",{className:"mt-2 font-weight-bold text-uppercase text-white",children:r})]})]})})})]})]})})})]})};var UG=e=>{const[s,a,t]=(0,ne.CQ)({error:null}),{fetchTemplateDetails:i,getStepValidationError:n,isStepValid:r,setTimedStatus:o,step:d,template:c}=sQ(),{deliverable_challenges:h}=c||{},{api:u}=(0,P.nm)(),{formatMessage:m}=(0,ja.A)(),g=(0,l.useRef)(),p=(0,l.useRef)(),x=(e,s)=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const t=g.current;t&&t.show({actions:[t.CancelAction(),t.Action({label:m({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"}),onClick:()=>(async e=>{try{await u.post(`/api/challenge-templates/deliverables/challenges/delete/${e}`),await i(),o("saved",2500)}catch({err:err}){a({error:err})}})(s),variant:"danger"})],body:m({id:"label.are_you_sure_you_want_to_trash_thi.d72eae8e",defaultMessage:"Are you sure you want to trash this entire Deliverable Challenge?"}),title:m({id:"label.delete_deliverable_challenge.44eb0f1e",defaultMessage:"Delete deliverable challenge"})})},v=async(e,s)=>{e.stopPropagation(),e.nativeEvent.stopImmediatePropagation();const a=null===p||void 0===p?void 0:p.current;if(!a)return;await a.show({deliverable_id:null===s||void 0===s?void 0:s.id})&&o("saved",2500)},{error:f}=s;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>a({error:null}),show:f,variant:"danger",children:f}),(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Add up to 5 deliverable options for learners to showcase their solutions.",id:"label.add_up_to_5_deliverable_options_fo.284e4077"})}),null!==h&&void 0!==h&&h.length?(0,N.jsx)(Gd.A,{alwaysOpen:!0,className:"deliverable-card-container d-flex flex-column mb-3",children:h.map((e,s)=>(0,N.jsx)(VG,{deliverable:e,eventKey:s,onLaunch:v,onRemove:x},s))}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You have not added any deliverables yet",id:"label.you_have_not_added_any_deliverable.1edd78a6"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",disabled:(null===h||void 0===h?void 0:h.length)>=5,onClick:v,variant:"primary",children:[(0,N.jsx)(ze.E5P,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Add deliverables",id:"label.add_deliverables.a5e0f4f6"})]}),!r(d)&&(0,N.jsx)("p",{className:"text-danger mt-3",children:n(d)}),(0,N.jsx)(yQ,{ref:p}),(0,N.jsx)(je,{ref:g})]})};var QG=e=>{const{caption:s,className:a,collapsed_content:t,corner_icon:i,corner_label:l,eventKey:r,expanded_content:o,title:d}=e,{styles:c}=(0,n.nm)(),h=null===c||void 0===c?void 0:c.primary;return(0,N.jsxs)(Gd.A.Item,{className:`expand-card-list-item-container ${a||""}
2`,eventKey:r,children:[(0,N.jsxs)(Gd.A.Header,{className:"d-flex flex-column",children:[t(d),(0,N.jsx)("span",{children:s})]}),(0,N.jsx)(Gd.A.Body,{children:(0,N.jsxs)(Ce.S,{className:"expanded-details-container p-0",children:[(0,N.jsx)(Ce.S,{className:"d-inline-block w-75",children:o}),(0,N.jsx)(Ce.S,{className:"d-inline-block",style:{minWidth:120},children:(0,N.jsx)(Ce.S,{className:"bot-right-container",children:(0,N.jsxs)(Ce.S,{className:"bot-right",children:[(0,N.jsx)("svg",{className:"corner-curve",height:"118.002",viewBox:"0 0 161.289 118.002",width:"161.289",xmlns:"http://www.w3.org/2000/svg",children:(0,N.jsx)("path",{d:"M14205-13238h-156.745a19.4,19.4,0,0,0,5.439-1.406,42.819,42.819,0,0,0,6.246-3.2,117.478,117.478,0,0,0,14.583-10.909c10.548-8.979,22.542-20.915,35.241-33.553l.013-.012c16.516-16.436,33.593-33.432,50.08-46.607,8.939-7.144,16.752-12.411,23.888-16.1a64.939,64.939,0,0,1,11.045-4.58A35.878,35.878,0,0,1,14205-13356v118Zm-158.795,0h-2.494a8.188,8.188,0,0,1,1.133-.073c.41,0,.87.025,1.361.071Z","data-name":"Subtraction 10",fill:h,id:"Subtraction_10",transform:"translate(-14043.71 13356)"})}),(0,N.jsxs)(Ce.S,{className:"icon",children:[i,(0,N.jsx)("span",{style:{color:"white",display:"block",lineHeight:"16px",textTransform:"uppercase"},children:(0,N.jsx)("small",{children:l})})]})]})})})]})})]})};var VG=e=>{const{deliverable:s,eventKey:a,onLaunch:t,onRemove:i}=e,{id:l,caption:n,configurations:r,requirements:o,specifics:d,title:c}=s,{arrayAttrRemoveDuplicates:h,arrayRemoveDuplicates:u,embed_type_links:m}=(0,P.hc)(),{styles:g}=(0,P.nm)(),{charcoal:p,primary:x,white:v}=g,f=null===g||void 0===g?void 0:g["gray-100"];let j,_=(e=>{const s=[];return e&&e.forEach(e=>{const{params:a,type:t}=e&&e.configurations;"file_upload"==t&&a&&a.acceptable_types&&a.acceptable_types.forEach(e=>{s.push(e)})}),s})(r),b=(e=>{const s=[];return e&&e.forEach(e=>{const{params:a,title:t,type:i}=e&&e.configurations;if("file_upload"!=i){const e=m.find(e=>(null===e||void 0===e?void 0:e.type)==i),l={link:null===e||void 0===e?void 0:e.link,params:a,title:t,type:i};s.push(l)}}),s})(r);_=u(_),b=h(b,"type");const A=(e=>{if(!e||!e.length)return 0;const s=[];for(let a=0;a<e.length;a++){const t=e[a];if(!t)continue;const i=t&&t.configurations&&t.configurations.deliverable_categories&&t.configurations.deliverable_categories.title;i&&(-1===s.indexOf(i)&&s.push(i))}return s.length})(r),y=A<=1?(e=>e&&e[0]&&e[0].configurations&&e[0].configurations.deliverable_categories&&e[0].configurations.deliverable_categories.title)(r):"Multiple";j=A>1?(0,N.jsx)(km,{category:"Multiple",color:v,size:40}):(0,N.jsx)(km,{category:y,color:v,size:40});const w=(0,N.jsxs)(Ce.S,{className:"expanded-details-container",children:[d&&(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:d}}),!d&&(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No specifics have been added",id:"label.no_specifics_have_been_added.b9e27b67"})}),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("strong",{style:{color:p,fontSize:14},children:(0,N.jsx)(ke.A,{defaultMessage:"Requirements",id:"label.requirements.e0cdd07f"})}),o&&(0,N.jsx)("p",{dangerouslySetInnerHTML:{__html:o}}),!o&&(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No requirements have been added",id:"label.no_requirements_have_been_added.d66c5976"})})]}),(0,N.jsx)("strong",{style:{color:p,fontSize:14},children:(0,N.jsx)(ke.A,{defaultMessage:"Acceptable file types",id:"label.acceptable_file_types.cd68f88c"})}),(0,N.jsxs)(Ce.S,{className:"acceptable-file-types",children:[(!_||0==_.length)&&(!b||0==b.length)&&(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"No file types have been added",id:"label.no_file_types_have_been_added.48d7a795"})}),_&&_.length&&0!=_.length?_.map((e,s)=>{const a=(0,N.jsx)("span",{children:",\xa0"});return(0,N.jsxs)("span",{children:[e,s==_.length-1&&b&&!b.length?"":a]},`${s}-${e}`)}):"",b&&b.length&&0!=b.length?b.map((e,s)=>{const{link:a,type:t}=e,i=(0,N.jsx)("span",{children:",\xa0"});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Uu,{embed:e,children:(0,N.jsx)("span",{className:"embed",style:{cursor:"help"},children:t})},s),(0,N.jsx)("a",{"aria-label":`Open ${t} in new window`,className:"p-0",href:a,rel:"noopener noreferrer",style:{cursor:"pointer",fontSize:"12px"},target:"_blank",children:(0,N.jsx)(ze.EQc,{className:"ms-1"})}),s===b.length-1?"":i]})}):""]})]});return(0,N.jsx)(QG,{caption:n,className:"deliverable",collapsed_content:e=>(0,N.jsx)(Ce.S,{className:"d-inline-block flex-1",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center",children:[(0,N.jsx)("strong",{style:{fontSize:20},children:e}),(0,N.jsx)(ve.A,{className:"ms-auto me-2",onClick:e=>t(e,s),size:"sm",variant:"outline-primary",style:{backgroundColor:f,border:"0 solid black"},children:(0,N.jsx)(ze.uO9,{color:x})}),(0,N.jsx)(ve.A,{className:"me-4",onClick:e=>i(e,l),size:"sm",variant:"outline-primary",style:{backgroundColor:f,border:"0 solid black"},children:(0,N.jsx)(ze.qbC,{color:x})})]})}),corner_icon:j,corner_label:y,eventKey:a,expanded_content:w,is_first:!1,selected:!1,target_id:`deliverableChallenge${l}`,title:c,toggle_class:"float-start me-3"})},GG=[CG,MG,kG,zG,RG,DG,BG,PG,e=>{const{styles:s}=(0,P.nm)(),{primary:a,white:t}=s,{challenge_template_types:i}=uQ(),{getStepValidator:n,handleChangeTemplateData:r,setStep:o,startEditingTimer:d,template:c,updateTemplate:h}=sQ(),{challenge_requirements:u,challenge_statement:m,type:g}=c||{},p=(0,l.useRef)(),x=(0,l.useRef)(),v=(0,l.useRef)(),f=async()=>{const e=null===p||void 0===p?void 0:p.current;if(p)return(0,T.isEmpty)(await e.validateForm())},j=async e=>(await r(e),await h(e)),_=async e=>{var s,a;const t=null===p||void 0===p?void 0:p.current,i=null===x||void 0===x||null===(s=x.current)||void 0===s||null===(a=s.getEditor)||void 0===a?void 0:a.call(s);t&&i&&(await t.setFieldValue("challenge_statement",e),await t.setFieldTouched("challenge_statement",!0),d(f,t.handleSubmit))},b=async e=>{var s,a;const t=null===p||void 0===p?void 0:p.current,i=null===v||void 0===v||null===(s=v.current)||void 0===s||null===(a=s.getEditor)||void 0===a?void 0:a.call(s);t&&i&&(await t.setFieldValue("challenge_requirements",e),await t.setFieldTouched("challenge_requirements",!0),d(f,t.handleSubmit))},A=e=>(0,ad.G9)(e,{preserveNewlines:!1}).trim().length||0,y={challenge_requirements:u||"",challenge_statement:m||""},w=(()=>{var e;return null===i||void 0===i||null===(e=i.find)||void 0===e?void 0:e.call(i,e=>(null===e||void 0===e?void 0:e.value)===g)})(),S=(null===w||void 0===w?void 0:w.value)||"",C=(null===w||void 0===w?void 0:w.value_label)||"",M=(null===w||void 0===w?void 0:w.name)||"",k=(null===w||void 0===w?void 0:w.content)||"";return(0,N.jsxs)(LU,{children:[w&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"challenge_template-type-list-item-container selected mb-0",children:(0,N.jsx)(Gd.A,{children:(0,N.jsxs)(Gd.A.Item,{eventKey:"0",children:[(0,N.jsx)(Gd.A.Header,{children:(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)("small",{className:"caption text-uppercase text-primary",children:(0,N.jsx)("strong",{children:C})}),(0,N.jsxs)("strong",{className:"d-block text-black",children:["Question: ",M]})]})}),(0,N.jsx)(Gd.A.Body,{children:(0,N.jsx)(Ce.S,{className:"collapse show",id:"challenge_templateTypeExpand",children:(0,N.jsxs)(Ce.S,{className:"expanded-detail
2s-container",children:[(0,N.jsx)("strong",{className:"d-block pt-3 text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Context and Examples:",id:"label.context_and_examples.2c80b20b"})}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"w-75 align-top",children:k}),(0,N.jsx)(Ce.S,{className:"d-flex align-items-end",style:{minWidth:120},children:(0,N.jsx)(Ce.S,{className:"bot-right-container position-relative",children:(0,N.jsxs)(Ce.S,{className:"bot-right",children:[(0,N.jsx)("svg",{className:"corner-curve",height:"118.002",viewBox:"0 0 161.289 118.002",width:"161.289",xmlns:"http://www.w3.org/2000/svg",children:(0,N.jsx)("path",{d:"M14205-13238h-156.745a19.4,19.4,0,0,0,5.439-1.406,42.819,42.819,0,0,0,6.246-3.2,117.478,117.478,0,0,0,14.583-10.909c10.548-8.979,22.542-20.915,35.241-33.553l.013-.012c16.516-16.436,33.593-33.432,50.08-46.607,8.939-7.144,16.752-12.411,23.888-16.1a64.939,64.939,0,0,1,11.045-4.58A35.878,35.878,0,0,1,14205-13356v118Zm-158.795,0h-2.494a8.188,8.188,0,0,1,1.133-.073c.41,0,.87.025,1.361.071Z","data-name":"Subtraction 10",fill:a,id:"Subtraction_10",transform:"translate(-14043.71 13356)"})}),(0,N.jsxs)(Ce.S,{className:"icon p-2 d-flex flex-column align-items-center position-absolute",style:{bottom:0,right:0}
2,children:[(0,N.jsx)(LQ,{color:t,rwq:S,size:30}),(0,N.jsx)("small",{className:"mt-2 font-weight-bold text-uppercase text-white",children:C})]})]})})})]})]})})})]})})}),(0,N.jsx)(Ce.S,{className:"pt-3",children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:()=>o(8),variant:"link",children:[(0,N.jsx)(ze.uO9,{className:"me-1",color:a})," ",(0,N.jsx)(ke.A,{defaultMessage:"Select a different question",id:"label.select_a_different_question.f6b27bf4"})]})}),(0,N.jsx)("hr",{})]}),(0,N.jsx)(ds.l1,{initialValues:y,onSubmit:j,validateOnChange:!0,validationSchema:n(),children:e=>{p.current=e;const{errors:s,touched:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:j,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Statement",id:"label.statement.6171b2a4"})}),(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Write a challenge statement",id:"label.write_a_challenge_statement.d4d751d1"})}),(0,N.jsx)(ds.D0,{name:"challenge_statement",children:e=>{let{field:s}=e;return(0,N.jsx)(bQ,{onChange:_,ref:x,value:s.value})}}),(null===s||void 0===s?void 0:s.challenge_statement)&&(null===a||void 0===a?void 0:a.challenge_statement)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.challenge_statement}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:A(null===t||void 0===t?void 0:t.challenge_statement),max:2e3,min:100})})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)("h5",{children:[(0,N.jsx)(ke.A,{defaultMessage:"Requirements",id:"label.requirements.e0cdd07f"}),"\xa0",(0,N.jsx)("small",{className:"ml-2",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.optional.0059798b"})})]}),(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Outline any specific requirements for your challenge",id:"label.outline_any_specific_requirements.b664dc07"})}),(0,N.jsx)(ds.D0,{name:"challenge_requirements",children:e=>{let{field:s}=e;return(0,N.jsx)(bQ,{onChange:b,ref:v,value:s.value})}}),(null===s||void 0===s?void 0:s.challenge_requirements)&&(null===a||void 0===a?void 0:a.challenge_requirements)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s.challenge_requirements}),(0,N.jsx)(Ce.S,{className:"text-right text-secondary",children:(0,N.jsx)(FB,{length:A(null===t||void 0===t?void 0:t.challenge_requirements),max:2e3,min:100})})]})]})}})]})},UG,JV,ZV,aG,iG,nG,oG,dG,bG,AG,NG,SG];var WG=()=>{const[e,s]=(0,l.useState)(!1),{publishTemplate:a,template:t,template_valid:i}=sQ(),{published:n,total_est_completion_time:r,updated_at:o,version_title:d}=t||{},c=(0,l.useRef)();return(0,N.jsxs)(LU,{floating:!0,children:[n?(0,N.jsxs)(Ge.A,{body:!0,className:"my-4",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your journey is published!",id:"label.your_journey_is_published.3edbd55c"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations! You are now ready to inspire learners and help them develop the skills necessary to thrive in the future.",id:"label.congratulations_you_are_now_ready.4d82daec"})}),(0,N.jsx)(ve.A,{disabled:!i||!n,onClick:async()=>{const e=null===c||void 0===c?void 0:c.current;if(!e||!i)return;const{assignment:s}=await e.show({component:t,component_type:"journey"})||{};s&&history.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`)},children:(0,N.jsx)(ke.A,{defaultMessage:"Assign to learners...",id:"label.assign_to_learners.34354e93"})})]}):(0,N.jsx)(N.Fragment,{children:i?(0,N.jsxs)(Ge.A,{body:!0,className:"my-3",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your journey is ready to publish!",id:"label.your_journey_is_ready_to_publish.8be9e3d5"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations! You are now ready to inspire learners and help them develop the skills necessary to thrive in the future.",id:"label.congratulations_you_are_now_ready.4d82daec"})}),(0,N.jsxs)(Me.p0,{loading:e,onClick:async()=>{s(!0),await a(),s(!1)},children:[(0,N.jsx)("span",{style:{marginRight:10},children:(0,N.jsx)(ze.uoG,{})}),(0,N.jsx)(ke.A,{defaultMessage:"Publish journey",id:"label.publish_journey.e3d6d205"})]})]}):(0,N.jsx)(We.A,{className:"text-center mt-3",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"One or more steps are incomplete",id:"label.one_or_more_steps_are_incomplete.7c47aa76"})})}),(0,N.jsxs)(Qe.A,{className:"d-flex justify-content-space-between align-items-start gap-4 m-0",children:[(0,N.jsx)(Ge.A,{as:Ve.A,children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column pb-4",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how y
2our journey will appear in the catalog",id:"label.heres_how_your_journey_will_appear.195d839f"})}),(0,N.jsx)(Kh,{className:"align-self-center",component:t,type:"journey"})]})}),(0,N.jsxs)(Ge.A,{body:!0,as:Ve.A,children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Journey details",id:"label.journey_details.d7c359a2"})}),(0,N.jsxs)(Ce.S,{className:"details-meta",children:[(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:d})})]}),(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:(0,N.jsx)(Gh.XU,{value:o})})})]}),(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",id:"label.duration.4fc52a3c"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:(0,N.jsx)(Vh,{duration:r,unit:"minutes"})})})]})]})]})]}),(0,N.jsx)(cc,{ref:c})]})};var KG=()=>{var e;const{getStepValidator:s,handleChangeTemplateData:a,startEditingTimer:t,template:i,updateTemplate:l}=sQ(),{title:n}=i||{},{formatMessage:r}=(0,ja.A)(),o=async()=>(0,T.isEmpty)(await c.validateForm()),d={title:n||""},c=(0,ds.Wx)({initialValues:d,onSubmit:async e=>(await a(e),await l(e)),validateOnChange:!0,validationSchema:s()}),{errors:h,handleSubmit:u,touched:m,values:g}=c;return(0,N.jsx)(LU,{title:r({id:"label.journey_title.2a0380dc",defaultMessage:"Journey title"}),children:(0,N.jsx)(ds.QI,{value:c,children:(0,N.jsxs)(_e.A,{onSubmit:u,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("span",{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"journey_template title",isInvalid:(null===m||void 0===m?void 0:m.title)&&(null===h||void 0===h?void 0:h.title),isValid:(null===m||void 0===m?void 0:m.title)&&!(null!==h&&void 0!==h&&h.title),name:"title",onChange:async e=>{await c.handleChange(e),await c.setFieldTouched(e.target.name,!0),t(o,c.handleSubmit)},placeholder:"Describe your Journey with a title",type:"text",value:g.title}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===g||void 0===g||null===(e=g.title)||void 0===e?void 0:e.length,max:50,min:3})})]})})})};var YG=()=>{var e;const{getStepValidator:s,handleChangeTemplateData:a,startEditingTimer:t,template:i,updateTemplate:l}=sQ(),{description:n}=i||{},{formatMessage:r}=(0,ja.A)(),o={description:n||""},d=(0,ds.Wx)({initialValues:o,onSubmit:async e=>(await a(e),await l(e)),validateOnChange:!0,validationSchema:s()}),c=async()=>(0,T.isEmpty)(await d.validateForm()),{errors:h,handleSubmit:u,touched:m,values:g}=d;return(0,N.jsx)(LU,{title:r({id:"label.journey_description.9ea5f1b8",defaultMessage:"Journey description"}),children:(0,N.jsx)(ds.QI,{value:d,children:(0,N.jsxs)(_e.A,{onSubmit:u,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("span",{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"journey_template description",as:"textarea",isInvalid:(null===m||void 0===m?void 0:m.description)&&(null===h||void 0===h?void 0:h.description),isValid:(null===m||void 0===m?void 0:m.description)&&!(null!==h&&void 0!==h&&h.description),name:"description",onChange:async e=>{await d.handleChange(e),await d.setFieldTouched(e.target.name,!0),t(c,d.handleSubmit)},placeholder:"Describe the purpose of this learning journey...",rows:5,type:"text",value:g.de
2scription}),(0,N.jsx)(ds.Kw,{name:"description",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===g||void 0===g||null===(e=g.description)||void 0===e?void 0:e.length,max:500,min:4})})]})})})};const{Err:qG}=(null===Re._$||void 0===Re._$?void 0:Re._$.log)||{};var JG=()=>{const[e,s,a]=(0,ne.CQ)({error:null,formik_key:(0,me.A)(),loading:!1}),{fetchTemplateDetails:t,getStepValidator:i,setStatus:n,setTimedStatus:r,template:o}=sQ(),{banner_path:d,cover_path:c,icon_path:h}=o||{},{api:u}=(0,P.nm)(),{default_banner:m}=(0,P.hc)(),{formatMessage:g}=(0,ja.A)(),p=(0,l.useRef)(),x=(0,l.useRef)(),v=(0,l.useRef)(),f=(0,l.useRef)(),j={banner_path:d||"",cover_path:c||"",icon_path:h||""},_=(0,ds.Wx)({initialValues:j,onSubmit:Function(),validateOnChange:!0,validationSchema:i()}),b=()=>s({formik_key:(0,me.A)()}),A=async()=>{try{const e=null===p||void 0===p?void 0:p.current;if(!e)return;const{file:s}=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;await _.setFieldValue("cover_path",null===s||void 0===s?void 0:s.location),await _.setFieldTouched("cover_path",!0),await t(),b(),r("saved",2500)}catch(e){qG(e),n("error"),s({error:(null===e||void 0===e?void 0:e.err)||e})}},y=async()=>{try{const e=null===x||void 0===x?void 0:x.current;if(!e)return;const s=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;await _.setFieldValue("banner_path",null===s||void 0===s?void 0:s.location),await _.setFieldTouched("banner_path",!0),await t(),b(),r("saved",2500)}catch(e){qG(e),n("error"),s({error:(null===e||void 0===e?void 0:e.err)||e})}},w=async()=>{try{const e=null===v||void 0===v?void 0:v.current;if(!e)return;const{file:s}=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;await _.setFieldValue("icon_path",null===s||void 0===s?void 0:s.location),await _.setFieldTouched("icon_path",!0),await t(),b(),r("saved",2500)}catch(e){qG(e),n("error"),s({error:(null===e||void 0===e?void 0:e.err)||e})}},S=e=>{const s=null===f||void 0===f?void 0:f.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:g({id:"label.submit.155f816c",defaultMessage:"Submit"}),onClick:()=>C(e),variant:"danger"})],body:g({id:"label.are_you_sure_you_want_to_remove_th.cca1f789",defaultMessage:"Are you sure you want to remove the {field} image?"},{field:e}),title:g({id:"label.remove_image.da7acac1",defaultMessage:"Remove image"})})},C=async e=>{const s=null===o||void 0===o?void 0:o.id;await u.post("/api/group-assignment-templates/media/remove",{field:e,group_assignment_template_id:s}),await _.setFieldValue(`${e}_path`,""),await _.setFieldTouched(`${e}_path`,!0),await t(),b(),r("saved",2500)},{handleSubmit:M,values:k}=_;return(0,N.jsx)(LU,{title:g({id:"label.journey_description.9ea5f1b8",defaultMessage:"Journey description"}),children:(0,N.jsx)(ds.QI,{value:_,children:(0,N.jsxs)(_e.A,{onSubmit:M,children:[(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Capture your learners\u2019 interest by uploading an engaging banner cover, and icon image. Ensure images are appropriate in content and appropriate for your audience.",id:"label.capture_your_learners_interest_by.5a953e1d"})}),(0,N.jsxs)(os,{className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"banner_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Banner image",id:"label.banner_image.bceaa001"})}),(0,N.jsx)(ds.D0,{name:"banner_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview",children:[null!==k&&void 0!==k&&k.banner_path?(0,N.jsx)(Me.R_,{fluid:!0,rounded:!0,height:190,imageClassname:"banner-image",imageHeight:190,imageWidth:758,src:null===k||void 0===k?void 0:k.banner_path,width:758}):(0,N.jsxs)(Ce.S,{className:"banner-image-overlay",children:[(0,N.jsx)(Zs.A,{rounded:!0,alt:"",className:"banner-image",height:190,src:m,width:758}),(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(HW,{handleRemove:()=>S("banner"),handleUpload:y})]})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 2000 x 500 JPG or PNG file.",id:"label.please_use_a_2000_x_500_jpg_or_png.16f75540"})}),(0,N.jsx)(ds.Kw,{name:"banner_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{as:os,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"cover_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Cover image",id:"label.cover_image.b62cee93"})}),(0,N.jsx)(ds.D0,{name:"cover_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview",children:[null!==k&&void 0!==k&&k.cover_path?(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:null===k||void 0===k?void 0:k.cover_path,width:300}):(0,N.jsxs)(Ce.S,{className:"cover-image-overlay",children:[(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:pc,width:300}),(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(HW,{handleRemove:()=>S("cover"),handleUpload:A})]})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 750 x 500 JPG or PNG file.",id:"label.please_use_a_750_x_500_jpg_or_png.5ed9acd7"})}),(0,N.jsx)(ds.Kw,{name:"cover_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsxs)(Ve.A,{as:os,className:"d-flex flex-column align-items-start",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"icon_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Icon image",id:"label.icon_image.9356b6da"})}),(0,N.jsx)(ds.D0,{name:"icon_path",children:()=>(0,N.jsx)(Ce.S,{className:"flex-1 d-flex align-items-center",children:null!==k&&void 0!==k&&k.icon_path?(0,N.jsxs)(Ce.S,{className:"media-preview icon-preview ",children:[(0,N.jsx)(Ad,{component:o,size:200,suspenseful:!0,type:"challenge"}),(0,N.jsx)(HW,{handleRemove:()=>S("icon"),handleUpload:w})]}):(0,N.jsxs)(Ce.S,{className:"media-preview icon-preview ",children:[(0,N.jsxs)(Ce.S,{className:"icon-image-overlay",children:[(0,N.jsx)(Zs.A,{alt:"",className:"avatar assignment-component-avatar",height:200,src:pc,width:200}),(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(HW,{handleRemove:()=>S("icon"),handleUpload:w})]})})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG or PNG file.",id:"label.please_use_a_500_x_500_jpg_or_png.2d736c7b"})}),(0,N.jsx)(ds.Kw,{name:"icon_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]}),(0,N.jsx)(TA,{aspectRatio:4,maxHeight:2e3,maxWidth:2e3,ref:x,uploadHandler:(e,s
2)=>{const a=null===o||void 0===o?void 0:o.id,t=`group-assignment-template-${a}-banner-image.jpg`;return u.file("/api/group-assignment-templates/upload/image",{field:"banner",group_assignment_template_id:a,job_id:s},e,t)}}),(0,N.jsx)(TA,{aspectRatio:1.5,ref:p,uploadHandler:(e,s)=>{const a=null===o||void 0===o?void 0:o.id,t=`group-assignment-template-${a}-cover-image.jpg`;return u.file("/api/group-assignment-templates/upload/image",{field:"cover",group_assignment_template_id:a,job_id:s},e,t)}}),(0,N.jsx)(TA,{aspectRatio:1,ref:v,uploadHandler:(e,s)=>{const a=null===o||void 0===o?void 0:o.id,t=`group-assignment-template-${a}-icon-image.jpg`;return u.file("/api/group-assignment-templates/upload/image",{field:"icon",group_assignment_template_id:a,job_id:s},e,t)}}),(0,N.jsx)(je,{ref:f})]})},e.formik_key)})};var XG=e=>{const{styles:s}=(0,P.nm)(),{primary:a,white:t}=s,{global_audience_categories:i}=uV(),{getStepValidator:n,handleChangeTemplateData:r,startEditingTimer:o,status:d,template:c,updateTemplate:h}=sQ(),{audience_category_id:u}=c||{},m=(0,l.useRef)(),g=()=>{var e;return!(null===m||void 0===m||null===(e=m.current)||void 0===e||!e.isValid)},p=async e=>(await r(e),await h(e)),x=async e=>{const s=m.current;s&&"saving"!==d&&!v(e)&&s.values.audience_category!==e&&(await s.setFieldTouched("audience_category_id",!0),await s.setFieldValue("audience_category_id",e),o(g,s.handleSubmit,!0))},v=e=>{var s;const a=m.current;return!!a&&(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.audience_category_id)===e},f={audience_category_id:u};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:f,onSubmit:p,validateOnChange:!0,validationSchema:n(),children:e=>{m.current=e;const{errors:s,touched:l,values:n}=e;return(0,N.jsx)(_e.A,{onSubmit:p,children:(0,N.jsxs)(os,{style:{margin:0},children:[(0,N.jsx)(_e.A.Label,{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column flex-lg-row align-items-center justify-content-between",children:!(null===i||void 0===i||!i.length)&&i.map((e,s)=>(0,N.jsx)(qV,{checked:n.audience_category_id===(null===e||void 0===e?void 0:e.id),disabled:"saving"===d,icon:(0,N.jsx)(ZG,{category:null===e||void 0===e?void 0:e.value,color:v(null===e||void 0===e?void 0:e.id)?t:a,size:112}),id:`audienceChoiceTrigger-${null===e||void 0===e?void 0:e.id}`,inputId:`audienceChoiceInput-${null===e||void 0===e?void 0:e.id}`,label:null===e||void 0===e?void 0:e.name,name:"audience_category_id",onSelect:x,value:null===e||void 0===e?void 0:e.id},s))}),(null===s||void 0===s?void 0:s.audience_category)&&(null===l||void 0===l?void 0:l.audience_category)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.audience_category})]})})}})})};var ZG=e=>{const{category:s,color:a,size:t}=e;let i={cl_d:TG.default,hied:IG.default,"k-12":EG.default};const n=(null===i||void 0===i?void 0:i[s])||l.Fragment;return(0,N.jsx)(n,{color:a,fontSize:t})};var $G=e=>{const{global_audiences:s}=uV(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,status:n,step:r,template:o,type:d,updateTemplate:c}=sQ(),{audience_category:h,audiences:u}=o||{},{audience_category_id:m}=h||{},g=(0,l.useRef)(),p=async()=>{const e=null===g||void 0===g?void 0:g.current;if(g)return(0,T.isEmpty)(await e.validateForm())},x=async()=>{const e=null===g||void 0===g?void 0:g.current;if(!e)return;const s=(null===e||void 0===e?void 0:e.values)||{};await t(s),await c(s)},v=()=>s.filter(e=>(null===e||void 0===e?void 0:e.audience_category_id)===m),f=e=>{var s,a,t;const i=null===g||void 0===g?void 0:g.current;return!!i&&!(null===i||void 0===i||null===(s=i.values)||void 0===s||null===(a=s.audiences)||void 0===a||null===(t=a.find)||void 0===t||!t.call(a,s=>{var a;return(null===s||void 0===s||null===(a=s.audiences)||void 0===a?void 0:a.id)===e}))},j=(0,T.orderBy)(v(),["short-name"],["asc"]),_={audiences:u||[]};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:_,onSubmit:x,validateOnChange:!0,validationSchema:a(),children:e=>(g.current=e,(0,N.jsxs)(_e.A,{className:"mt-3",onSubmit:x,children:[null!==j&&void 0!==j&&j.length?(0,N.jsx)(N.Fragment,{children:j.map((e,s)=>{let{id:a,name:t,short_name:l}=e,r=f(a);const o="saving"===n;return(0,N.jsxs)(Ce.S,{className:"mb-3",children:["6"===l&&(0,N.jsx)("h5",{className:"text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Middle school",id:"label.middle_school.e39f6cf0"})}),"9"===l&&(0,N.jsx)("h5",{className:"text-primary mt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"High school",id:"label.high_
2school.8ed82c87"})}),(0,N.jsx)(_e.A.Check,{checked:r,className:"ps-0",disabled:o,label:t,onClick:()=>(async e=>{var s;const a=null===g||void 0===g?void 0:g.current;if(!a)return;let t=[...(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.audiences)||[]];const l=v();if(f(e))t=t.filter(s=>{var a;return(null===s||void 0===s||null===(a=s.audiences)||void 0===a?void 0:a.id)!==e});else{const s={audiences:l.find(s=>(null===s||void 0===s?void 0:s.id)===e)};t=[...t,s]}await a.setFieldValue("audiences",t),await a.setFieldTouched("audiences",!0),i(p,a.handleSubmit)})(a),readOnly:o,type:"checkbox"})]},s)})}):(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No audiences available for this category",id:"label.no_audiences_available_for_this_ca.2022cb14"})}),(0,N.jsx)(ds.Kw,{name:"audiences",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}))})})};var eW=e=>{var s;const[a,t,i]=(0,ne.CQ)({loading:!1,refresh:!1}),{formatMessage:n}=(0,ja.A)(),{api:r,styles:o,userHasRight:d}=(0,P.nm)(),{primary:c,white:h}=o,{global_subjects:u}=uV(),{fetchTemplateDetails:m,getStepValidator:g,setError:p,setStatus:x,setTimedStatus:v,status:f,template:j,template_id:_}=sQ(),{audience_category:b,audience_category_id:A,subjects:y}=j||{},{parseBinary:w}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},S=(0,l.useRef)(),C=(0,l.useRef)(),M=()=>{t({refresh:!0}),setTimeout(()=>t({refresh:!1}),50)},k=async e=>{if(a.loading)return;const s=null===S||void 0===S?void 0:S.current;if(!S)return;await s.setFieldValue("featured_subject",e),await s.setFieldTouched("featured_subject",!0);const t=[...s.values.subjects],i=t.find(s=>s.subject_id===e);i?i.is_featured=!0:t.push({is_featured:!0,subject_id:e}),await s.setFieldValue("subjects",t),s.handleSubmit()},z=async(e,s)=>{const a=w(I()!==(null===e||void 0===e?void 0:e.featured_subject));await T(null===e||void 0===e?void 0:e.featured_subject,a),!a&&s.setFieldValue("featured_subject",null)},T=async(e,s)=>{try{t({loading:!0}),x("saving"),await r.post("/api/group-assignment-templates/set/featured-subject",{group_assignment_template_id:_,is_featured:s,subject_id:e}),await m(),t({loading:!1}),v("saved",2500)}catch({err:err}){t({loading:!1}),p(err),x("error")}},I=()=>{var e,s;return null===y||void 0===y||null===(e=y.find)||void 0===e||null===(s=e.call(y,e=>!(null===e||void 0===e||!e.is_featured)))||void 0===s?void 0:s.subject_id},E=async(e,s)=>{var a,i;let{action:l}=s;switch(l){case"select-option":return await(async(e,s)=>{try{t({loading:!0}),x("saving"),await r.post(`/api/group-assignment-templates/add/subject/${_}`,{audience_category_id:null===b||void 0===b?void 0:b.audience_category_id,is_featured:s,subject_id:e}),t({loading:!1}),M(),v("saved",2500)}catch({err:err}){t({loading:!1}),p(err),x("error")}})(null===s||void 0===s||null===(a=s.option)||void 0===a?void 0:a.id,!1),v("saved",2500),await m();case"remove-value":return(async e=>{try{t({loading:!0}),x("saving"),await r.post(`/api/group-assignment-templates/remove/subject/${_}/${e}`),await m(),t({loading:!1}),M(),v("saved",2500)}catch({err:err}){t({loading:!1}),p(err),x("error")}})(null===s||void 0===s||null===(i=s.removedValue)||void 0===i?void 0:i.id)}},F=async()=>{const e=null===C||void 0===C?void 0:C.current;e&&await e.show()},R=I(),D=u.filter(e=>{const{audience_categories:s}=e;for(let a of s){if(!a)continue;const{audience_category_id:e}=a;if(Number.parseInt(e)===Number.parseInt(A))return!0}return!1}),B=(()=>{let e=[];for(const s of u){const{audience_categories:a=[]}=s||{};for(const t of a)(null===t||void 0===t?void 0:t.audience_category_id)===A&&e.push(s)}return e})(),L=null===j||void 0===j||null===(s=j.subjects)||void 0===s?void 0:s.map(e=>{let{is_featured:s,subjects:a}=e;return{id:null===a||void 0===a?void 0:a.id,is_featured:s,name:null===a||void 0===a?void 0:a.name}}),O=((e,s)=>e.filter(e=>!s.find(s=>s.id===e.id)).sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}).map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,slug:null===e||void 0===e?void 0:e.slug,value:s})))(D,L),H=((e,s)=>e.filter(e=>s.find(s=>s.id===e.id&&!s.is_featured)).sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}).map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,slug:null===e||void 0===e?void 0:e.slug,value:s})))(D,L),{loading:U,refresh:Q}=a;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(ds.l1,{onSubmit:z,validateOnChange:!0,validateOnMount:!0,validationSchema:g(),initialValues:{featured_subject:R||null,subjects:y||[]},children:e=>{S.current=e;const{errors:s,touched:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:z,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(ds.D0,{name:"featured_subject",children:()=>(0,N.jsx)(N.Fragment,{children:null!==B&&void 0!==B&&B.length?(0,N.jsx)(Ce.S,{className:"d-flex flex-wrap",children:B.map((e,s)=>{const{id:a,name:i}=e,l=a===(null===t||void 0===t?void 0:t.featured_subject),n=l?h:c;return(0,N.jsx)(qV,{checked:l,className:"me-2 mb-2",disabled:"saving"===f||U,icon:(0,N.jsx)($n,{color:n,size:48,subject:i}),id:`audienceChoiceTrigger-${a}`,inputId:`audienceChoiceInput-${a}`,label:i,name:"featured_subject",onSelect:k,value:a},s)})}):(0,N.jsx)(We.A,{className:"text-center mt-3 mb-0",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects found, please make sure you have selected an Audience Category",id:"label.no_subjects_found_please_make_sure.9fccc6bc"})})})}),!(null!==t&&void 0!==t&&t.featured_subject)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:(0,N.jsx)(ke.A,{defaultMessage:"You must select a featured subject",id:"label.you_must_select_a_featured_subject.c05eeedb"})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"clearfix",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-3",children:[(0,N.jsxs)("h4",{className:"card-title m-0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Select additional subjects",id:"label.select_additional_subjects.eda01ad5"}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.o
2ptional.0059798b"})})]}),d("manage_challenge")&&(0,N.jsx)(ve.A,{onClick:F,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add new subject",id:"label.add_new_subject.0a22b4b1"})})]})}),!Q&&(0,N.jsx)(WC.Ay,{isMulti:!0,isDisabled:"saving"===f||U,onChange:E,options:O,styles:o,value:H,placeholder:n({id:"label.select_a_subject.b136475b",defaultMessage:"Select a subject..."})},"react-select-subjects-cme-step-7"),(null===s||void 0===s?void 0:s.subjects)&&(null===a||void 0===a?void 0:a.subjects)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.subjects})]})]})}}),(0,N.jsx)(gQ,{ref:C})]})};var sW=e=>{const{parseBinary:s}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},{getStepValidator:a,handleChangeTemplateData:t,template:i,updateTemplate:n}=sQ(),{force_order:r,group_assignment_template_components:o}=i||{},{canEditModules:d,handleToggleForceOrder:c}=uV(),h={force_order:s(r)||0,group_assignment_template_components:o||[]},u=async e=>(await t(e),await n(e)),m=(0,ds.Wx)({initialValues:h,onSubmit:u,validationSchema:a()}),g=async e=>{var a;const t=s(null===e||void 0===e||null===(a=e.target)||void 0===a?void 0:a.checked);await c(t)};return(0,l.useEffect)(()=>{(async()=>{await m.setFieldValue("group_assignment_template_components",o),await m.setTouched({force_order:!0,group_assignment_template_components:!0}),await m.validateForm()})()},[m.values,o]),(0,N.jsx)(LU,{children:(0,N.jsxs)(Ce.S,{className:"inner-container",children:[(0,N.jsx)("p",{className:"mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Journeys are composed of multiple learning modules.",id:"label.journeys_are_composed_of_multiple.d7fbad99"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Add at least two learning modules. You can click and drag to reorder.",id:"label.add_at_least_two_learning_modules.d63a8508"})}),!d()&&(0,N.jsx)(We.A,{className:"font-weight-bold text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You may not modify learning modules after 1 or more learners have started",id:"label.you_may_not_modify_learning_module.a01b040d"})}),(0,N.jsx)(ds.QI,{value:m,children:(0,N.jsxs)(_e.A,{onSubmit:u,children:[(0,N.jsx)(ds.D0,{name:"force_order",children:()=>(0,N.jsx)(Ua.A,{placement:"right",trigger:["hover","focus"],overlay:(0,N.jsx)(Qa.A,{children:(0,N.jsx)(ke.A,{defaultMessage:"Require learners to complete modules in order",id:"label.require_learners_to_complete_modul.65ac6b4f"})}),children:(0,N.jsx)(_e.A.Switch,{checked:r,className:"mb-2",onChange:g,label:(0,N.jsx)(ke.A,{defaultMessage:"Require learners to complete modules in order",id:"label.require_learners_to_complete_modul.65ac6b4f"})})})}),(0,N.jsx)(ds.Kw,{name:"force_order",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})}),(0,N.jsx)(ds.D0,{name:"group_assignment_template_components",children:()=>(0,N.jsx)(gV,{})}),(0,N.jsx)(ds.Kw,{name:"group_assignment_template_components",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})]})})};var aW=e=>{var s,a;const{api:t,styles:i}=(0,P.nm)(),{fetchTemplateDetails:n,getStepValidator:r,handleChangeTemplateData:o,setStatus:d,setTimedStatus:c,step:h,template:u,type:m,updateTemplate:g}=sQ(),{global_subtopics:p,global_topics:x}=uV(),{subtopics:v,topics:f}=u||{},[j,_,b]=(0,ne.CQ)({error:null,loading:!1,refresh:!1}),A=(0,l.useRef)(),y=(0,l.useRef)(),w=(0,l.useRef)(),S=async()=>{const e=null===A||void 0===A?void 0:A.current;if(!e)return;_({refresh:!0}),await n();const s=await n();await e.setFieldValue("topics",null===s||void 0===s?void 0:s.topics),await e.setFieldTouched("topics",!0),await e.setFieldValue("subtopics",null===s||void 0===s?void 0:s.subtopics),await e.setFieldTouched("subtopics",!0),setTimeout(()=>_({refresh:!1}),50)},C=async()=>{const e=null===y||void 0===y?void 0:y.current;e&&(await e.show(),S())},M=async()=>{const e=null===w||void 0===w?void 0:w.current;e&&(await e.show(),S())},k=(e,s)=>{let{action:a,option:i,removedValue:l}=s;switch(a){case"select-option":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post("/api/group-assignment-templates/add/topic",{group_assignment_template_id:null===u||void 0===u?void 0:u.id,topic_id:e});const a=await n();await s.setFieldValue("topics",null===a||void 0===a?void 0:a.topics),await s.setFieldTouched("topics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===i||void 0===i?void 0:i.id);case"remove-value":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post(`/api/group-assignment-templates/remove/topic/${null===u||void 0===u?void 0:u.id}/${e}`);const a=await n();await s.setFieldValue("topics",null===a||void 0===a?void 0:a.topics),await s.setFieldTouched("topics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===l||void 0===l?void 0:l.id);default:return}},z=(e,s)=>{let{action:a,option:i,removedValue:l}=s;switch(a){case"select-option":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post("/api/group-assignment-templates/add/subtopic",{group_assignment_template_id:null===u||void 0===u?void 0:u.id,subtopic_id:e});const a=await n();await s.setFieldValue("subtopics",null===a||void 0===a?void 0:a.subtopics),await s.setFieldTouched("subtopics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===i||void 0===i?void 0:i.id);case"remove-value":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post(`/api/group-assignment-templates/remove/subtopic/${null===u||void 0===u?void 0:u.id}/${e}`),await n();const a=await n();await s.setFieldValue("subtopics",null===a||void 0===a?void 0:a.subtopics),await s.setFieldTouched("subtopics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===l||void 0===l?void 0:l.id);default:return}},T=(null===x||void 0===x||null===(s=x.sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}))||void 0===s?void 0:s.map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,value:s})))||[],I=(null===p||void 0===p||null===(a=p.sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}))||void 0===a?void 0:a.map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,value:s})))||[],{error:E,refresh:F}=j,R={subtopics:v||[],topics:f||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Indicate the subject area topics and subtopics for your challenge.",id:"label.indicate_the_subject_area_topics_a.551a1f91"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>_({error:null}),show:E,variant:"danger",children:E}),(0,N.jsx)(ds.l1,{initialValues:R,onSubmit:async e=>(o(e),await g(e)),validateOnChange:!0,validateOnMount:!0,validationSchema:r(),children:e=>{var s,a;A.current=e;const{errors:t,values:l}=e,n=(null===T||void 0===T||null===(s=T.filter)||void 0===s?void 0:s.call(T,e=>{for(const s of l.topics)if((null===s||void 0===s?void 0:s.topic_id)===(null===e||void 0===e?void 0:e.id))return!0;return!1}))||[],r=(null===I||void 0===I||null===(a=I.filter)||void 0===a?void 0:a.call(I,e=>{for(const s of l.subtopics)if((null===s||void 0===s?void 0:s.subto
2pic_id)===(null===e||void 0===e?void 0:e.id))return!0;return!1}))||[];return(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(ds.D0,{name:"topics",children:()=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select topics",id:"label.select_topics.a108d300"})}),(0,N.jsx)(ve.A,{className:"float-right",onClick:C,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add topic",id:"label.add_topic.dd88f6bd"})})]}),!F&&(0,N.jsx)(WC.Ay,{isMulti:!0,defaultValue:n,onChange:k,options:T,styles:i})]})}),(null===t||void 0===t?void 0:t.topics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:t.topics})]}),(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(ds.D0,{name:"subtopics",children:()=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select subtopics",id:"label.select_subtopics.8bca0962"})}),(0,N.jsx)(ve.A,{className:"float-right",onClick:M,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add subtopic",id:"label.add_subtopic.c8002a1d"})})]}),!F&&(0,N.jsx)(WC.Ay,{isMulti:!0,defaultValue:r,onChange:z,options:I,styles:i}),(null===t||void 0===t?void 0:t.subtopics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:t.subtopics})]})})}),(0,N.jsx)(HQ,{ref:y}),(0,N.jsx)(QQ,{ref:w})]})}})]})};var tW=()=>{var e,s;const{fetchTemplateDetails:a,getStepValidator:t,handleChangeTemplateData:i,setError:n,setStatus:r,startEditingTimer:o,template:d,template_id:c,updateTemplate:h}=sQ(),{author_avatar_path:u,author_biography:m,author_name:g}=d||{},{api:p}=(0,P.nm)(),{formatMessage:x}=(0,ja.A)(),v=(0,l.useRef)(),f={author_avatar_path:u||"",author_biography:m||"",author_name:g||""},j=(0,ds.Wx)({initialValues:f,onSubmit:async e=>(await i(e),await h(e)),validateOnChange:!0,validationSchema:t()}),_=async()=>(await j.setTouched({author_avatar_path:!0,author_biography:!0,author_name:!0}),(0,T.isEmpty)(await j.validateForm())),b=async e=>{await j.handleChange(e),await j.setFieldTouched(e.target.name,!0),o(_,j.handleSubmit)},{errors:A,handleSubmit:y,touched:w,values:S}=j;return(0,N.jsxs)(LU,{title:x({id:"label.journey_learning_objectives.48ff9589",defaultMessage:"Journey learning objectives"}),children:[(0,N.jsx)(ds.QI,{value:j,children:(0,N.jsxs)(_e.A,{onSubmit:y,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"author_name",children:(0,N.jsx)("span",{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"journey_template author name",isInvalid:(null===w||void 0===w?void 0:w.author_name)&&(null===A||void 0===A?void 0:A.author_name),isValid:(null===w||void 0===w?void 0:w.author_name)&&!(null!==A&&void 0!==A&&A.author_name),name:"author_name",onChange:b,type:"text",value:S.author_name}),(0,N.jsx)(ds.Kw,{name:"author_name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===S||void 0===S||null===(e=S.author_name)||void 0===e?void 0:e.length,max:100,min:4})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"author_biography",children:(0,N.jsx)("span",{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Biography",id:"label.biography.942dbeda"})})}),(0,N.jsx)(_e.A.Control,{"aria-label":"journey_template author biography",as:"textarea",isInvalid:(null===w||void 0===w?void 0:w.author_biography)&&(null===A||void 0===A?void 0:A.author_biography),isValid:(null===w||void 0===w?void 0:w.author_biography)&&!(null!==A&&void 0!==A&&A.author_biography),name:"author_biography",onChange:b,placeholder:"Tell learners a little bit about yourself...",rows:5,type:"text",value:S.author_biography}),(0,N.jsx)(ds.Kw,{name:"author_biography",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:null===S||void 0===S||null===(s=S.author_biography)||void 0===s?void 0:s.length,max:500})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"author_avatar_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Avatar",id:"label.avatar.ca8e826d"})}),(0,N.jsx)(ds.D0,{name:"author_avatar_path",children:()=>(0,N.jsx)(Ce.S,{className:"flex-1 d-flex align-items-center",children:null!==S&&void 0!==S&&S.author_avatar_path?(0,N.jsx)(Ce.S,{className:"my-2",children:(0,N.jsx)(md,{alt:"Journey author avatar",size:120,src:null===S||void 0===S?void 0:S.author_avatar_path,suspenseful:!0})}):(0,N.jsx)(Ce.S,{children:(0,N.jsx)(Ya,{size:90,user:null})})})}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG or PNG file.",id:"label.please_use_a_500_x_500_jpg_or_png.2d736c7b"})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center mt-2",onClick:async()=>{const e=null===v||void 0===v?void 0:v.current;if(e)try{const{location:s}=await e.promptImageUpload()||{};await a(),s&&(await j.setFieldValue("author_avatar_path",s),setTimeout(()=>
2o(_,j.handleSubmit,!0)))}catch(s){r("error"),n((null===s||void 0===s?void 0:s.err)||(null===s||void 0===s?void 0:s.message)||s)}},children:[(0,N.jsx)(ze.BzO,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})]}),(0,N.jsx)(ds.Kw,{name:"author_avatar_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]})}),(0,N.jsx)(TA,{aspectRatio:1,ref:v,uploadHandler:async(e,s)=>p.file("/api/group-assignment-templates/upload/author_avatar",{group_assignment_template_id:c,job_id:s},e,"author_avatar.jpg")})]})},iW=[KG,YG,JG,XG,$G,eW,sW,()=>{const{getStepValidator:e,handleChangeTemplateData:s,startEditingTimer:a,template:t,updateTemplate:i}=sQ(),{learning_objective:n}=t||{},{formatMessage:r}=(0,ja.A)(),o=(0,l.useRef)(),d={learning_objective:n||""},c=(0,ds.Wx)({initialValues:d,onSubmit:async e=>(await s(e),await i(e)),validateOnChange:!0,validationSchema:e()}),h=async()=>(0,T.isEmpty)(await c.validateForm()),u=async e=>{var s,t;(null===o||void 0===o||null===(s=o.current)||void 0===s||null===(t=s.getEditor)||void 0===t?void 0:t.call(s))&&(await c.setFieldValue("learning_objective",e),await c.setFieldTouched("learning_objective",!0),a(h,c.handleSubmit))},{handleSubmit:m,values:g}=c;return(0,N.jsx)(LU,{title:r({id:"label.journey_learning_objective.0b204e5c",defaultMessage:"Journey learning objective"}),children:(0,N.jsx)(ds.QI,{value:c,children:(0,N.jsxs)(_e.A,{onSubmit:m,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("span",{className:"label",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objective",id:"label.learning_objective.bc5b0195"})})}),(0,N.jsx)(ds.D0,{name:"learning_objective",children:e=>{let{field:s}=e;return(0,N.jsx)(bQ,{"aria-label":"Journey learning objective",formats:["bold","italic","underline","list","align"],id:"journey-editor-objective-quill",onChange:u,placeholder:"Describe the purpose of this learning journey...",ref:o,value:null===s||void 0===s?void 0:s.value,modules:{toolbar:[["bold","italic","underline"],[{list:"ordered"},{list:"bullet"}]]}})}}),(0,N.jsx)(ds.Kw,{name:"learning_objective",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(Ce.S,{className:"text-end text-secondary",children:(0,N.jsx)(FB,{length:(e=>{var s,a,t;return(null===(s=(0,ad.G9)(e,{preserveNewlines:!1}))||void 0===s||null===(a=s.trim)||void 0===a||null===(t=a.call(s))||void 0===t?void 0:t.length)||0})(null===g||void 0===g?void 0:g.learning_objective),max:500})})]})})})},aW,tW,WG];var lW=e=>{var s,a;const{getStepValidator:t,handleChangeTemplateData:i,setError:n,setStatus:r,startEditingTimer:o,template:d,updateTemplate:c}=sQ(),{author_avatar_image_path:h,author_bio:u,author_name:m}=d||{},g=(0,l.useRef)(),{api:p}=(0,P.nm)(),x=async()=>(0,T.isEmpty)(await _.validateForm()),v=async e=>{await _.handleChange(e),setTimeout(()=>o(x,_.handleSubmit))},f=async()=>{const e=null===g||void 0===g?void 0:g.current;if(e)try{const s=await e.promptImageUpload()||{};if(null===s||void 0===s||!s.location)return;await _.setFieldValue("author_avatar_image_path",null===s||void 0===s?void 0:s.location),await _.setFieldTouched("author_avatar_image_path",!0),setTimeout(()=>o(x,_.handleSubmit,!0))}catch(s){r("error"),n((null===s||void 0===s?void 0:s.err)||(null===s||void 0===s?void 0:s.message)||s)}},j={author_avatar_image_path:h||"",author_bio:u||"",author_name:m||""},_=(0,ds.Wx)({initialValues:j,onSubmit:async e=>{await i(e),await c(e)},validateOnChange:!0,validationSchema:t()}),{errors:b,touched:A,values:y}=_;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(ds.QI,{value:_,children:(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(EB,{className:"text-secondary",length:null===(s=y.author_name)||void 0===s?void 0:s.length,max:100,min:2})]}),(0,N.jsx)(_e.A.Control,{"aria-label":"author's name",isInvalid:(null===A||void 0===A?void 0:A.author_name)&&(null===b||void 0===b?void 0:b.author_name),isValid:(null===A||void 0===A?void 0:A.author_name)&&!(null!==b&&void 0!==b&&b.author_name),min:"0",name:"author_name",onChange:v,value:y.author_name}),(0,N.jsx)(ds.Kw,{name:"author_name",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Biography",id:"label.biography.942dbeda"})}),(0,N.jsx)(EB,{className:"text-secondary",length:y.author_bio.length,max:500,min:(null===y||void 0===y||null===(a=y.author_bio)||void 0===a?void 0:a.length)&&30})]}),(0,N.jsx)(_e.A.Control,{"aria-label":"author's biography",as:"textarea",isInvalid:(null===A||void 0===A?void 0:A.author_bio)&&(null===b||void 0===b?void 0:b.author_bio),isValid:(null===A||void 0===A?void 0:A.author_bio)&&!(null!==b&&void 0!==b&&b.author_bio),name:"author_bio",onChange:v,placeholder:"Tell learners a little bit about yourself...",rows:3,type:"textarea",value:y.author_bio}),(0,N.jsx)(ds.Kw,{name:"author_bio",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column",children:[(0,N.jsx)(_e.A.Label,{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Avatar",id:"label.avatar.ca8e826d"})}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG, JPEG, or PNG file",id:"label.please_use_a_500_x_500_jpg_jpeg_or.8eb6e457"})})]}),(0,N.jsx)(ds.D0,{name:"author_avatar_image_path",children:e=>{let{field:s}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"my-3",children:(0,N.jsx)(md,{alt:"Cartridge author avatar",size:90,src:null===s||void 0===s?void 0:s.value,suspenseful:!0})}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center",onClick:f,children:[(0,N.jsx)(ze.BzO,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"Upload image",id:"label.upload_image.ffe4df6c"})]})]})}}),(0,N.jsx)(ds.Kw,{name:"author_avatar_image_path",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]})]})}),(0,N.jsx)(TA,{aspectRatio:1,ref:g,uploadHandler:async(e,s)=>p.file("/api/cartridge-templates/upload/author_avatar",{cartridge_template_id:null===d||void 0===d?void 0:d.id,job_id:s},e,"author_avatar.jpg")})]})};var nW=e=>{const[s,a]=(0,l.useState)(!1),t=(0,Pe.W6)(),{publishTemplate:i,template:n,template_valid:r}=sQ(),{published:o,total_est_completion_time:d,updated_at:c,version_title:h}=n||{},u=(0,l.useRef)();return(0,N.jsxs)(LU,{floating:!0,children:[o?(0,N.jsxs)(Ge.A,{body:!0,className:"my-4",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your cartridge is published!",i
2d:"label.your_cartridge_is_published.92b1f68e"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations! You are now ready to inspire learners and help them develop the skills necessary to thrive in the future.",id:"label.congratulations_you_are_now_ready.4d82daec"})}),(0,N.jsx)(ve.A,{disabled:!r||!o,onClick:async()=>{const e=null===u||void 0===u?void 0:u.current;if(!e||!r)return;const{assignment:s}=await e.show({component:n,component_type:"cartridge",template:n})||{};s&&t.push(`/admin/group/${null===s||void 0===s?void 0:s.group_id}/assignment/${null===s||void 0===s?void 0:s.id}`)},children:(0,N.jsx)(ke.A,{defaultMessage:"Assign to learners...",id:"label.assign_to_learners.34354e93"})})]}):(0,N.jsx)(N.Fragment,{children:r?(0,N.jsxs)(Ge.A,{body:!0,className:"my-3",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Your cartridge is ready to publish!",id:"label.your_cartridge_is_ready_to_publish.a0a7e32f"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Congratulations! You are now ready to inspire learners and help them develop the skills necessary to thrive in the future.",id:"label.congratulations_you_are_now_ready.4d82daec"})}),(0,N.jsxs)(Me.p0,{loading:s,onClick:async()=>{a(!0),await i(),a(!1)},children:[(0,N.jsx)("span",{style:{marginRight:10},children:(0,N.jsx)(ze.uoG,{})}),(0,N.jsx)(ke.A,{defaultMessage:"Publish cartridge",id:"label.publish_cartridge.1cfe80a3"})]})]}):(0,N.jsx)(We.A,{className:"text-center mt-3",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"One or more steps are incomplete",id:"label.one_or_more_steps_are_incomplete.7c47aa76"})})}),(0,N.jsxs)(Qe.A,{className:"d-flex justify-content-space-between align-items-start gap-4 m-0",children:[(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Catalog preview",id:"label.catalog_preview.343420f4"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Here's how your cartridge will appear in the catalog",id:"label.heres_how_your_cartridge_will_appe.8dc1ed7a"})}),(0,N.jsx)(Kh,{className:"align-self-center",component:n,type:"cartridge"})]})}),(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Cartridge details",id:"label.cartridge_details.2b303c36"})}),(0,N.jsxs)(Ce.S,{className:"details-meta",children:[(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Version",id:"label.version.dd167905"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:h})})]}),(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Last edited",id:"label.last_edited.43c314d4"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:(0,N.jsx)(Gh.XU,{value:c})})})]}),(0,N.jsxs)(Qe.A,{className:"mb-4",children:[(0,N.jsx)(Ve.A,{xs:4,children:(0,N.jsx)(Ce.S,{className:"meta__label",children:(0,N.jsx)(ke.A,{defaultMessage:"Duration",id:"label.duration.4fc52a3c"})})}),(0,N.jsx)(Ve.A,{xs:8,children:(0,N.jsx)(Ce.S,{className:"value",children:(0,N.jsx)(Vh,{duration:d,label_type:"long",unit:"minutes"})})})]})]})]})})]}),(0,N.jsx)(cc,{ref:u})]})};var rW=s=>{const{formatMessage:a}=(0,ja.A)(),{api:t}=(0,P.nm)(),{default_banner:i}=(0,P.hc)(),{Err:n}=(null===Re._$||void 0===Re._$?void 0:Re._$.log)||{},{fetchTemplateDetails:r,getStepValidator:o,setError:d,setStatus:c,setTimedStatus:h,template:u}=sQ(),{banner_path:m,cover_path:g,icon_path:p}=u||{},x={banner_path:m||"",cover_path:g||"",icon_path:p||""},v=(0,ds.Wx)({initialValues:x,onSubmit:Function(),validationSchema:o()}),f=(0,l.useRef)(),j=(0,l.useRef)(),_=(0,l.useRef)(),b=(0,l.useRef)(),A=async s=>{try{const e=(e=>{switch(e){case"banner":return null===j||void 0===j?void 0:j.current;case"cover":return null===f||void 0===f?void 0:f.current;case"icon":return null===_||void 0===_?void 0:_.current;default:return null}})(s);if(!e)return;const a=await e.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await v.setFieldValue(`${s}_path`,null===a||void 0===a?void 0:a.location),await v.setFieldTouched(`${s}_path`,!0),await r(),h("saved",2500)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;n(a),c("error"),d(a)}},y=e=>{const s=null===b||void 0===b?void 0:b.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Submit",onClick:()=>w(e),variant:"danger"})],body:a({id:"label.are_you_sure_you_want_to_remove_th.cca1f789",defaultMessage:"Are you sure you want to remove the {field} image?"},{field:e}),title:a({id:"label.remove_image.da7acac1",defaultMessage:"Remove image"})})},w=async e=>{const s=null===u||void 0===u?void 0:u.id;await t.post("/api/cartridge-templates/media/remove",{cartridge_template_id:s,field:e}),await v.setFieldValue(`${e}_path`,""),await v.setFieldTouched(`${e}_path`,!0),await r(),h("saved",2500)},{values:S}=v;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:v,children:(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Capture your learners\u2019 interest by uploading an engaging banner cover, and icon image. Ensure images are appropriate in content and appropriate for your audience.",id:"label.capture_your_learners_interest_by.5a953e1d"})}),(0,N.jsxs)(os,{className:"d-flex flex-column align-items-start",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"m-0",htmlFor:"banner_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Banner image",id:"label.banner_image.bceaa001"})}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 2000 x 500 JPG or PNG file.",id:"label.please_use_a_2000_x_500_jpg_or_png.16f75540"})})]}),(0,N.jsx)(ds.D0,{name:"banner_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview",children:[(0,N.jsxs)(Ce.S,{className:"banner-image-overlay",children:[(0,N.jsx)(Me.R_,{fluid:!0,rounded:!0,height:190,imageClassname:"banner-image",imageHeight:190,imageWidth:758,src:(null===S||void 0===S?void 0:S.banner_path)||i,width:758},(null===S||void 0===S?void 0:S.banner_path)||(0,me.A)()),!(null!==S&&void 0!==S&&S.banner_path)&&(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(HW,{handleRemove:()=>y("banner"),handleUpload:()=>A("banner")})]})}),(0,N.jsx)(ds.Kw,{name:"banner_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"m-0",htmlFor:"cover_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Cover image",id:"label.cover_image.b62cee93"})}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 750 x 500 JPG or PNG file.",id:"label.please_use_a_750_x_500_jpg_or_png.5ed9acd7"})})]}),(0,N.jsx)(ds.D0,{name:"cover_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview",children:[(0,N.jsxs)(Ce.S,{className:"cover-image-overlay",children:[(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:(null===S||void 0===S?void 0:S.cover_path)||pc,width:300},(null===S||void 0===S?void 0:S.cover_path)||(0,me.A)()),!(null!==S&&void 0!==S&&S.cover_path)&&(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]}),(0,N.jsx)(HW,{handleRemove:()=>y("cover"),handleUpload:()=>A("cover")})]})}),(0,N.jsx)(ds.Kw,{name:"cover_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)("hr",{}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"m-0",htmlFor:"icon_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Icon image",id:"label.icon_image.9356b6da"})}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG or PNG file.",id:"label.please_use_a_500_x_500_jpg_or_png.2d736c7b"})})]}),(0,N.jsx)(ds.D0,{name:"icon_path",children:()=>(0,N.jsx)(Ce.S,{className:"flex-1 d-flex align-items-center",children:(0,N.jsx)(Ce.S,{className:"media-preview icon-preview ",children:(0,N.jsxs)(Ce.S,{className:"icon-image-overlay",children:[(0,N.jsx)(Ad,{component:u,size:200,suspenseful:!0,type:"cartridge"},(null===S||void 0===S?void 0:S.icon_path)||(0,me.A)()),(0,N.jsx)(HW,{handleRemove:()=>y("icon"),handleUpload:()=>A("icon")}),!(null!==S&&void 0!==S&&S.icon_path)&&(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]})})})}),(0,N.jsx)(ds.Kw,{name:"icon_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(TA,{aspectRatio:4,maxHeight:2e3,maxWidth:2e3,ref:j,uploadHandler:(e,s
2)=>{const a=null===u||void 0===u?void 0:u.id,i=`cartridge-template-${a}-banner-image.jpg`;return t.file("/api/cartridge-templates/upload/banner",{cartridge_template_id:a,job_id:s},e,i)}}),(0,N.jsx)(TA,{aspectRatio:1.5,ref:f,uploadHandler:(e,s)=>{const a=null===u||void 0===u?void 0:u.id,i=`cartridge-template-${a}-cover-image.jpg`;return t.file("/api/cartridge-templates/upload/image",{cartridge_template_id:a,cover:!0,job_id:s},e,i)}}),(0,N.jsx)(TA,{aspectRatio:1,ref:_,uploadHandler:(e,s)=>{const a=null===u||void 0===u?void 0:u.id,i=`cartridge-template-${a}-icon-image.jpg`;return t.file("/api/cartridge-templates/upload/icon",{cartridge_template_id:a,job_id:s},e,i)}}),(0,N.jsx)(je,{ref:b})]})})})};var oW=e=>{const{styles:s}=(0,P.nm)(),{primary:a,white:t}=s,{global_audience_categories:i}=XQ(),{getStepValidator:n,handleChangeTemplateData:r,startEditingTimer:o,status:d,template:c,updateTemplate:h}=sQ(),{audience_category_id:u}=c||{};console.log("### TEMPLATE",c);const m=(0,l.useRef)(),g=()=>{var e;return!(null===m||void 0===m||null===(e=m.current)||void 0===e||!e.isValid)},p=async e=>(await r(e),await h(e)),x=async e=>{const s=m.current;s&&"saving"!==d&&!v(e)&&s.values.audience_category!==e&&(await s.setFieldTouched("audience_category_id",!0),await s.setFieldValue("audience_category_id",e),o(g,s.handleSubmit,!0))},v=e=>{var s;const a=m.current;return!!a&&(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.audience_category_id)===e},f={audience_category_id:u};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:f,onSubmit:p,validateOnChange:!0,validationSchema:n(),children:e=>{m.current=e;const{errors:s,touched:l,values:n}=e;return(0,N.jsx)(_e.A,{onSubmit:p,children:(0,N.jsxs)(os,{style:{margin:0},children:[(0,N.jsx)(_e.A.Label,{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(Ce.S,{className:"d-flex flex-column flex-lg-row align-items-center justify-content-between",children:!(null===i||void 0===i||!i.length)&&i.map((e,s)=>(0,N.jsx)(qV,{checked:n.audience_category_id===(null===e||void 0===e?void 0:e.id),disabled:"saving"===d,icon:(0,N.jsx)(dW,{category:null===e||void 0===e?void 0:e.value,color:v(null===e||void 0===e?void 0:e.id)?t:a,size:112}),id:`audienceChoiceTrigger-${null===e||void 0===e?void 0:e.id}`,inputId:`audienceChoiceInput-${null===e||void 0===e?void 0:e.id}`,label:null===e||void 0===e?void 0:e.name,name:"audience_category_id",onSelect:x,value:null===e||void 0===e?void 0:e.id},s))}),(null===s||void 0===s?void 0:s.audience_category)&&(null===l||void 0===l?void 0:l.audience_category)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.audience_category})]})})}})})};var dW=e=>{const{category:s,color:a,size:t}=e;let i={cl_d:TG.default,hied:IG.default,"k-12":EG.default};const n=(null===i||void 0===i?void 0:i[s])||l.Fragment;return(0,N.jsx)(n,{color:a,fontSize:t})};var cW=e=>{const{global_audiences:s}=XQ(),{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,status:n,step:r,template:o,type:d,updateTemplate:c}=sQ(),{audience_category:h,audiences:u}=o||{},{audience_category_id:m}=h||{},g=(0,l.useRef)(),p=async()=>{const e=null===g||void 0===g?void 0:g.current;if(g)return(0,T.isEmpty)(await e.validateForm())},x=async()=>{const e=null===g||void 0===g?void 0:g.current;if(!e)return;const s=(null===e||void 0===e?void 0:e.values)||{};await t(s),await c(s)},v=()=>s.filter(e=>(null===e||void 0===e?void 0:e.audience_category_id)===m),f=e=>{var s,a,t;const i=null===g||void 0===g?void 0:g.current;return!!i&&!(null===i||void 0===i||null===(s=i.values)||void 0===s||null===(a=s.audiences)||void 0===a||null===(t=a.find)||void 0===t||!t.call(a,s=>{var a;return(null===s||void 0===s||null===(a=s.audiences)||void 0===a?void 0:a.id)===e}))},j=(0,T.orderBy)(v(),["short-name"],["asc"]),_={audiences:u||[]};return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.l1,{initialValues:_,onSubmit:x,validateOnChange:!0,validationSchema:a(),children:e=>(g.current=e,(0,N.jsxs)(_e.A,{className:"mt-3",onSubmit:x,children:[null!==j&&void 0!==j&&j.length?(0,N.jsx)(N.Fragment,{children:j.map((e,s)=>{let{id:a,name:t,short_name:l}=e,r=f(a);const o="saving"===n;return(0,N.jsxs)(Ce.S,{className:"mb-3",children:["6"===l&&(0,N.jsx)("h5",{className:"text-primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Middle school",id:"label.middle_school.e39f6cf0"})}),"9"===l&&(0,N.jsx)("h5",{className:"text-primary mt-3",children:(0,N.jsx)(ke.A,{defaultMessage:"High school",id:"label.high_
2school.8ed82c87"})}),(0,N.jsx)(_e.A.Check,{checked:r,className:"ps-0",disabled:o,label:t,onClick:()=>(async e=>{var s;const a=null===g||void 0===g?void 0:g.current;if(!a)return;let t=[...(null===a||void 0===a||null===(s=a.values)||void 0===s?void 0:s.audiences)||[]];const l=v();if(f(e))t=t.filter(s=>{var a;return(null===s||void 0===s||null===(a=s.audiences)||void 0===a?void 0:a.id)!==e});else{const s={audiences:l.find(s=>(null===s||void 0===s?void 0:s.id)===e)};t=[...t,s]}await a.setFieldValue("audiences",t),await a.setFieldTouched("audiences",!0),i(p,a.handleSubmit)})(a),readOnly:o,type:"checkbox"})]},s)})}):(0,N.jsx)(We.A,{variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No audiences available for this category",id:"label.no_audiences_available_for_this_ca.2022cb14"})}),(0,N.jsx)(ds.Kw,{name:"audiences",children:e=>(0,N.jsx)("p",{className:"text-danger mt-3",children:e})})]}))})})};var hW=e=>{var s;const[a,t,i]=(0,ne.CQ)({loading:!1,refresh:!1}),{formatMessage:n}=(0,ja.A)(),{api:r,styles:o,userHasRight:d}=(0,P.nm)(),{primary:c,white:h}=o,{global_subjects:u}=XQ(),{fetchTemplateDetails:m,getStepValidator:g,setError:p,setStatus:x,setTimedStatus:v,status:f,template:j,template_id:_}=sQ(),{audience_category:b,audience_category_id:A,subjects:y}=j||{},{parseBinary:w}=(null===Re._$||void 0===Re._$?void 0:Re._$.binary)||{},S=(0,l.useRef)(),C=(0,l.useRef)(),M=()=>{t({refresh:!0}),setTimeout(()=>t({refresh:!1}),50)},k=async e=>{if(a.loading)return;const s=null===S||void 0===S?void 0:S.current;if(!S)return;await s.setFieldValue("featured_subject",e),await s.setFieldTouched("featured_subject",!0);const t=[...s.values.subjects],i=t.find(s=>s.subject_id===e);i?i.is_featured=!0:t.push({is_featured:!0,subject_id:e}),await s.setFieldValue("subjects",t),s.handleSubmit()},z=async(e,s)=>{const a=w(I()!==(null===e||void 0===e?void 0:e.featured_subject));await T(null===e||void 0===e?void 0:e.featured_subject,a),!a&&s.setFieldValue("featured_subject",null)},T=async(e,s)=>{try{t({loading:!0}),x("saving"),await r.post("/api/cartridge-templates/set/featured-subject",{cartridge_template_id:_,is_featured:s,subject_id:e}),await m(),t({loading:!1}),v("saved",2500)}catch({err:err}){t({loading:!1}),p(err),x("error")}},I=()=>{var e,s;return null===y||void 0===y||null===(e=y.find)||void 0===e||null===(s=e.call(y,e=>!(null===e||void 0===e||!e.is_featured)))||void 0===s?void 0:s.subject_id},E=async(e,s)=>{var a,i;let{action:l}=s;switch(l){case"select-option":return await(async(e,s)=>{try{t({loading:!0}),x("saving"),await r.post(`/api/cartridge-templates/add/subject/${_}`,{audience_category_id:null===b||void 0===b?void 0:b.audience_category_id,is_featured:s,subject_id:e}),t({loading:!1}),M(),v("saved",2500)}catch({err:err}){t({loading:!1}),p(err),x("error")}})(null===s||void 0===s||null===(a=s.option)||void 0===a?void 0:a.id,!1),v("saved",2500),await m();case"remove-value":return(async e=>{try{t({loading:!0}),x("saving"),await r.post(`/api/cartridge-templates/remove/subject/${_}/${e}`),await m(),t({loading:!1}),M(),v("saved",2500)}catch({err:err}){t({loading:!1}),p(err),x("error")}})(null===s||void 0===s||null===(i=s.removedValue)||void 0===i?void 0:i.id)}},F=async()=>{const e=null===C||void 0===C?void 0:C.current;e&&await e.show()},R=I(),D=u.filter(e=>{const{audience_categories:s}=e;for(let a of s){if(!a)continue;const{audience_category_id:e}=a;if(Number.parseInt(e)===Number.parseInt(A))return!0}return!1}),B=(()=>{let e=[];for(const s of u){const{audience_categories:a=[]}=s||{};for(const t of a)(null===t||void 0===t?void 0:t.audience_category_id)===A&&e.push(s)}return e})(),L=null===j||void 0===j||null===(s=j.subjects)||void 0===s?void 0:s.map(e=>{let{is_featured:s,subjects:a}=e;return{id:null===a||void 0===a?void 0:a.id,is_featured:s,name:null===a||void 0===a?void 0:a.name}}),O=((e,s)=>e.filter(e=>!s.find(s=>s.id===e.id)).sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}).map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,slug:null===e||void 0===e?void 0:e.slug,value:s})))(D,L),H=((e,s)=>e.filter(e=>s.find(s=>s.id===e.id&&!s.is_featured)).sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}).map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,slug:null===e||void 0===e?void 0:e.slug,value:s})))(D,L),{loading:U,refresh:Q}=a;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(ds.l1,{onSubmit:z,validateOnChange:!0,validateOnMount:!0,validationSchema:g(),initialValues:{featured_subject:R||null,subjects:y||[]},children:e=>{S.current=e;const{errors:s,touched:a,values:t}=e;return(0,N.jsxs)(_e.A,{onSubmit:z,children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{className:"visually-hidden",children:(0,N.jsx)(ke.A,{defaultMessage:"Audience category",id:"label.audience_category.2166dc58"})}),(0,N.jsx)(ds.D0,{name:"featured_subject",children:()=>(0,N.jsx)(N.Fragment,{children:null!==B&&void 0!==B&&B.length?(0,N.jsx)(Ce.S,{className:"d-flex flex-wrap",children:B.map((e,s)=>{const{id:a,name:i}=e,l=a===(null===t||void 0===t?void 0:t.featured_subject),n=l?h:c;return(0,N.jsx)(qV,{checked:l,className:"me-2 mb-2",disabled:"saving"===f||U,icon:(0,N.jsx)($n,{color:n,size:48,subject:i}),id:`audienceChoiceTrigger-${a}`,inputId:`audienceChoiceInput-${a}`,label:i,name:"featured_subject",onSelect:k,value:a},s)})}):(0,N.jsx)(We.A,{className:"text-center mt-3 mb-0",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects found, please make sure you have selected an Audience Category",id:"label.no_subjects_found_please_make_sure.9fccc6bc"})})})}),!(null!==t&&void 0!==t&&t.featured_subject)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:(0,N.jsx)(ke.A,{defaultMessage:"You must select a featured subject",id:"label.you_must_select_a_featured_subject.c05eeedb"})})]}),(0,N.jsxs)(os,{children:[(0,N.jsx)("hr",{}),(0,N.jsx)(Ce.S,{className:"clearfix",children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center justify-content-between mb-3",children:[(0,N.jsxs)("h4",{className:"card-title m-0",children:[(0,N.jsx)(ke.A,{defaultMessage:"Select additional subjects",id:"label.select_additional_subjects.eda01ad5"}),(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"(optional)",id:"label.o
2ptional.0059798b"})})]}),d("manage_challenge")&&(0,N.jsx)(ve.A,{onClick:F,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add new subject",id:"label.add_new_subject.0a22b4b1"})})]})}),!Q&&(0,N.jsx)(WC.Ay,{isMulti:!0,isDisabled:"saving"===f||U,onChange:E,options:O,styles:o,value:H,placeholder:n({id:"label.select_a_subject.b136475b",defaultMessage:"Select a subject..."})},"react-select-subjects-cme-step-7"),(null===s||void 0===s?void 0:s.subjects)&&(null===a||void 0===a?void 0:a.subjects)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:null===s||void 0===s?void 0:s.subjects})]})]})}}),(0,N.jsx)($Q,{ref:C})]})};var uW=e=>{var s;const a=(0,l.useRef)(),{formatMessage:t}=(0,ja.A)(),{getStepValidator:i,handleChangeTemplateData:n,startEditingTimer:r,template:o,updateTemplate:d}=sQ(),{learning_objectives:c}=o||{},h=(0,ds.Wx)({initialValues:{learning_objectives:c||[]},onSubmit:async e=>(await n(e),await d(e)),validateOnChange:!0,validationSchema:i()}),u=async()=>(0,T.isEmpty)(await h.validateForm()),m=e=>{const s=null===a||void 0===a?void 0:a.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:t({id:"label.remove_objective.f9801969",defaultMessage:"Remove objective"}),onClick:()=>(async e=>{var s,a;const t=null===h||void 0===h||null===(s=h.values)||void 0===s||null===(a=s.learning_objectives)||void 0===a?void 0:a.filter((s,a)=>a!==e);await h.setFieldValue("learning_objectives",t),await h.setFieldTouched("learning_objectives"),r(u,h.handleSubmit,!0)})(e),variant:"danger"})],body:t({id:"label.are_you_sure_you_want_to_remove_th.4913c79f",defaultMessage:"Are you sure you want to remove this learning objective?"}),title:t({id:"label.remove_objective.f9801969",defaultMessage:"Remove objective"})})},g=async(e,s)=>{var a;const t=(null===h||void 0===h||null===(a=h.values)||void 0===a?void 0:a.learning_objectives)||[];t[e]=s,await h.setFieldValue("learning_objectives",t),await h.setFieldTouched("learning_objectives"),r(u,h.handleSubmit)},{errors:p,values:x}=h;return(0,N.jsxs)(LU,{children:[(0,N.jsx)(ds.QI,{value:h,children:(0,N.jsx)(_e.A,{onSubmit:e=>e.preventDefault(),children:(0,N.jsxs)(os,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"List the desired outcomes learners are expected to be able to demonstrate in terms of knowledge, skills, and values upon completion of the module. Ensure these align with the module description.",id:"label.list_the_desired_outcomes_learners.20b8c2a7"})}),!(null===x||void 0===x||null===(s=x.learning_objectives)||void 0===s||!s.length)&&x.learning_objectives.map((e,s)=>{var a;return(0,N.jsx)(mW,{error:Array.isArray(p)&&(null===p||void 0===p||null===(a=p.learning_objectives)||void 0===a?void 0:a[s]),idx:s,objective:e,onChange:g,onDelete:m},s)}),(0,N.jsxs)(ve.A,{className:"d-flex align-items-center text-decoration-none gap-1",onClick:async()=>{var e;await h.setFieldValue("learning_objectives",[...(null===h||void 0===h||null===(e=h.values)||void 0===e?void 0:e.learning_objectives)||[],""]),await h.setFieldTouched("learning_objectives"),r(u,h.handleSubmit,!0)},variant:"link",children:[(0,N.jsx)(ze.OiG,{}),(0,N.jsx)(ke.A,{defaultMessage:"Add objective",id:"label.add_objective.32578015"})]}),(0,N.jsx)(ds.Kw,{name:"learning_objectives",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})}),(0,N.jsx)(je,{ref:a})]})};var mW=e=>{const{error:s,idx:a,objective:t,onChange:i,onDelete:l}=e;return(0,N.jsxs)(os,{className:"learning-objective",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Objective {index}",id:"label.objective_index.d4949098",values:{index:a+1}})}),(0,N.jsx)(FB,{className:"text-secondary",length:(null===t||void 0===t?void 0:t.length)||0,max:100,min:4})]}),(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(_e.A.Control,{onChange:e=>i(a,e.target.value),placeholder:"Enter a one-sentence learning objective",value:t}),(0,N.jsx)(ve.A,{className:"text-danger",onClick:()=>l(a),variant:"link",children:(0,N.jsx)(ze.RCe,{})})]}),!!s&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:s})]})};var gW=e=>{var s,a;const{api:t,styles:i}=(0,P.nm)(),{fetchTemplateDetails:n,getStepValidator:r,handleChangeTemplateData:o,setStatus:d,setTimedStatus:c,step:h,template:u,type:m,updateTemplate:g}=sQ(),{global_subtopics:p,global_topics:x}
2=XQ(),{subtopics:v,topics:f}=u||{},[j,_,b]=(0,ne.CQ)({error:null,loading:!1,refresh:!1}),A=(0,l.useRef)(),y=(0,l.useRef)(),w=(0,l.useRef)(),S=async()=>{const e=null===A||void 0===A?void 0:A.current;if(!e)return;_({refresh:!0}),await n();const s=await n();await e.setFieldValue("topics",null===s||void 0===s?void 0:s.topics),await e.setFieldTouched("topics",!0),await e.setFieldValue("subtopics",null===s||void 0===s?void 0:s.subtopics),await e.setFieldTouched("subtopics",!0),setTimeout(()=>_({refresh:!1}),50)},C=async()=>{const e=null===y||void 0===y?void 0:y.current;e&&(await e.show(),S())},M=async()=>{const e=null===w||void 0===w?void 0:w.current;e&&(await e.show(),S())},k=(e,s)=>{let{action:a,option:i,removedValue:l}=s;switch(a){case"select-option":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post("/api/cartridge-templates/add/topic",{cartridge_template_id:null===u||void 0===u?void 0:u.id,topic_id:e});const a=await n();await s.setFieldValue("topics",null===a||void 0===a?void 0:a.topics),await s.setFieldTouched("topics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===i||void 0===i?void 0:i.id);case"remove-value":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post(`/api/cartridge-templates/remove/topic/${null===u||void 0===u?void 0:u.id}/${e}`);const a=await n();await s.setFieldValue("topics",null===a||void 0===a?void 0:a.topics),await s.setFieldTouched("topics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===l||void 0===l?void 0:l.id);default:return}},z=(e,s)=>{let{action:a,option:i,removedValue:l}=s;switch(a){case"select-option":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post("/api/cartridge-templates/add/subtopic",{cartridge_template_id:null===u||void 0===u?void 0:u.id,subtopic_id:e});const a=await n();await s.setFieldValue("subtopics",null===a||void 0===a?void 0:a.subtopics),await s.setFieldTouched("subtopics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===i||void 0===i?void 0:i.id);case"remove-value":return(async e=>{try{const s=null===A||void 0===A?void 0:A.current;if(!s)return;d("saving"),await t.post(`/api/cartridge-templates/remove/subtopic/${null===u||void 0===u?void 0:u.id}/${e}`),await n();const a=await n();await s.setFieldValue("subtopics",null===a||void 0===a?void 0:a.subtopics),await s.setFieldTouched("subtopics",!0),c("saved",2500)}catch({err:err}){_({error:err}),d("error")}})(null===l||void 0===l?void 0:l.id);default:return}},T=(null===x||void 0===x||null===(s=x.sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}))||void 0===s?void 0:s.map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,value:s})))||[],I=(null===p||void 0===p||null===(a=p.sort((e,s)=>{var a,t,i,l;return(null===e||void 0===e||null===(a=e.name)||void 0===a||null===(t=a.trim)||void 0===t?void 0:t.call(a))>(null===s||void 0===s||null===(i=s.name)||void 0===i||null===(l=i.trim)||void 0===l?void 0:l.call(i))?1:-1}))||void 0===a?void 0:a.map((e,s)=>({id:null===e||void 0===e?void 0:e.id,label:null===e||void 0===e?void 0:e.name,value:s})))||[],{error:E,refresh:F}=j,R={subtopics:v||[],topics:f||[]};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Indicate the subject area topics and subtopics for your cartridge.",id:"label.indicate_the_subject_area_topics_a.47f7e8f4"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>_({error:null}),show:E,variant:"danger",children:E}),(0,N.jsx)(ds.l1,{initialValues:R,onSubmit:async e=>(o(e),await g(e)),validateOnChange:!0,validateOnMount:!0,validationSchema:r(),children:e=>{var s,a;A.current=e;const{errors:t,values:l}=e,n=(null===T||void 0===T||null===(s=T.filter)||void 0===s?void 0:s.call(T,e=>{for(const s of l.topics)if((null===s||void 0===s?void 0:s.topic_id)===(null===e||void 0===e?void 0:e.id))return!0;return!1}))||[],r=(null===I||void 0===I||null===(a=I.filter)||void 0===a?void 0:a.call(I,e=>{for(const s of l.subtopics)if((null===s||void 0===s?void 0:s.subto
2pic_id)===(null===e||void 0===e?void 0:e.id))return!0;return!1}))||[];return(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(ds.D0,{name:"topics",children:()=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select topics",id:"label.select_topics.a108d300"})}),(0,N.jsx)(ve.A,{className:"float-right",onClick:C,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add topic",id:"label.add_topic.dd88f6bd"})})]}),!F&&(0,N.jsx)(WC.Ay,{isMulti:!0,defaultValue:n,onChange:k,options:T,styles:i})]})}),(null===t||void 0===t?void 0:t.topics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:t.topics})]}),(0,N.jsx)(_e.A.Group,{children:(0,N.jsx)(ds.D0,{name:"subtopics",children:()=>(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Select subtopics",id:"label.select_subtopics.8bca0962"})}),(0,N.jsx)(ve.A,{className:"float-right",onClick:M,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"Add subtopic",id:"label.add_subtopic.c8002a1d"})})]}),!F&&(0,N.jsx)(WC.Ay,{isMulti:!0,defaultValue:r,onChange:z,options:I,styles:i}),(null===t||void 0===t?void 0:t.subtopics)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:t.subtopics})]})})}),(0,N.jsx)(sV,{ref:y}),(0,N.jsx)(tV,{ref:w})]})}})]})},pW=[e=>{var s;const{formatMessage:a}=(0,ja.A)(),{getStepValidator:t,handleChangeTemplateData:i,startEditingTimer:l,template:n,updateTemplate:r}=sQ(),{title:o}=n||{},d=async e=>(await i(e),await r(e)),c=(0,ds.Wx)({initialValues:{title:o||""},onSubmit:d,validateOnChange:!0,validationSchema:t()}),h=async()=>(0,T.isEmpty)(await c.validateForm()),{errors:u,touched:m,values:g}=c;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:c,children:(0,N.jsx)(_e.A,{onSubmit:d,children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(FB,{className:"text-secondary",length:(null===g||void 0===g||null===(s=g.title)||void 0===s?void 0:s.length)||0,max:100,min:4})]}),(0,N.jsx)(_e.A.Control,{isInvalid:(null===m||void 0===m?void 0:m.title)&&(null===u||void 0===u?void 0:u.title),isValid:(null===m||void 0===m?void 0:m.title)&&!(null!==u&&void 0!==u&&u.title),name:"title",onChange:async e=>{await c.handleChange(e),await c.setFieldTouched(e.target.name,!0),l(h,c.handleSubmit)},value:null===g||void 0===g?void 0:g.title,"aria-label":a({id:"label.content_title.9e3a9a34",defaultMessage:"Content title"}),placeholder:a({id:"label.describe_your_content.a9245730",defaultMessage:"Describe your content..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})})})},e=>{var s;const{getStepValidator:a,handleChangeTemplateData:t,startEditingTimer:i,template:l,updateTemplate:n}=sQ(),{description:r}=l||{},o={description:r||""},d=(0,ds.Wx)({initialValues:o,onSubmit:async e=>(await t(e),await n(e)),validateOnChange:!0,validationSchema:a()}),c=async()=>(0,T.isEmpty)(await d.validateForm()),{errors:h,touched:u,values:m}=d;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:d,children:(0,N.jsx)(_e.A,{onSubmit:e=>e.preventDefault(),children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{htmlFor:"description",children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)(FB,{className:"text-secondary",length:(null===m||void 0===m||null===(s=m.description)||void 0===s?void 0:s.length)||0,max:500,min:100})]}),(0,N.jsx)(_e.A.Control,{as:"textarea",isInvalid:u.description&&h.description,isValid:u.description&&!h.description,name:"description",onChange:async e=>{await d.handleChange(e),await d.setFieldTouched(e.target.name,!0),i(c,d.handleSubmit)},rows:5,value:null===m||void 0===m?void 0:m.description}),(0,N.jsx)(ds.Kw,{name:"description",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})})})},rW,e=>{const{getStepValidator:s,handleChangeTemplateData:a,startEditingTimer:t,template:i,updateTemplate:n}=sQ(),r=(0,l.useRef)(),o={total_est_completion_time:(null===i||void 0===i?void 0:i.total_est_completion_time)||120},d=(0,ds.Wx)({initialValues:o,onSubmit:async e=>(await a(e),await n(e)),validateOnChange:!0,validationSchema:s()}),c=async()=>(0,T.isEmpty)(await d.validateForm()),{values:h}=d;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:d,children:(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Estimated time to complete cartridge",id:"label.estimated_time_to_complete_cartrid.6377f58f"})}),(0,N.jsxs)(os,{children:[(0,N.jsx)("label",{htmlFor:"Cartridge_template-time-to-complete-input",children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Time to complete",id:"label.time_to_complete.7e73fe58"})})}),(0,N.jsxs)(Ce.S,{id:"time-to-complete-range-label",style:{maxWidth:600},children:[(0,N.jsx)("section",{className:"range-slider",ref:r,children:(0,N.jsx)("input",{className:"custom-range",id:"estimatedCompletionTime",max:240,min:30,onChange:async e=>{var s;if(!(null===r||void 0===r?void 0:r.current))return;const a=null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value;await d.setFieldValue("total_est_completion_time",a),t(c,d.handleSubmit)},step:15,type:"range",value:null===h||void 0===h?void 0:h.total_est_completion_time})}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("span",{className:"me-2 text-muted",children:"30m"}),(0,N.jsx)("strong",{className:"text-primary",children:(0,N.jsx)(Vh,{duration:h.total_est_completion_time,label_type:"long",units:"minutes"})}),(0,N.jsx)("span",{className:"ms-2 text-muted",children:"4h"})]})]}),(0,N.jsx)(Ce.S,{className:"d-block w-100",style:{height:35}}),(0,N.jsx)(ds.Kw,{name:"total_est_completion_time",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(os,{style:{display:"none"},children:(0,N.jsx)(_e.A.Control,{name:"total_est_completion_time",style:{display:"block",height:100,width:"100%"},type:"number"})})]})})})},oW,cW,hW,s=>{const{formatMessage:a}=(0,ja.A)(),{styles:t}=(0,P.nm)(),{primary:i}=t,n=(0,l.useRef)(),r=(0,l.useRef)(),{getStepValidator:o,handleChangeTemplateData:d,startEditingTimer:c,template:h,updateTemplate:u}=sQ(),{cartridge_url:m,type:g}=h||{},p={cartridge_url:m||"",type:g||""},x=(0,ds.Wx)({initialValues:p,onSubmit:async e=>(await d(e),await u(e)),validateOnChange:!0,validationSchema:o()}),v=async()=>(0,T.isEmpty)(await x.validateForm()),f=async()=>{await x.setFieldValue("cartridge_url",""),await x.setFieldTouched("cartridge_url",!0),await x.setFieldValue("type",""),await x.setFieldTouched("type",!0),c(v,x.handleSubmit,!0)},j=()=>{const e=null===n||void 0===n?void 0:n.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:a({id:"label.remove.c3812fc4",defaultMessage:"Remove"}),onClick:f,variant:"danger"})],body:a({id:"label.are_you_sure_you_want_to_remove_th.5626b37c",defaultMessage:"Are you sure you want to remove the current SCORM package?"}),title:a({id:"label.confirm_removal.bb0f9ad6",defaultMessage:"Confirm removal"})})},_=()=>{switch(g){case"scorm2004":return(0,N.jsx)(ke.A,{defaultMessage:"SCORM 2004 package",id:"label.scorm_2004_package.7f4ac66e"});case"scorm12":return(0,N.jsx)(ke.A,{defaultMessage:"SCORM 1.2 package",id:"label.scorm_12_package.7d38ff84"});default:return(0,N.jsx)(ke.A,{defaultMessage:"Invalid package",id:"label.invali
2d_package.ba00fcfe"})}},{values:b}=x;return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload the SCORM package provided by your content authoring tool",id:"label.upload_the_scorm_package_provided.8d45d1b1"})}),(0,N.jsx)(ds.QI,{value:x,children:(0,N.jsx)(_e.A,{onSubmit:e=>e.preventDefault(),children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"cartridge_url",children:(0,N.jsx)(ke.A,{defaultMessage:"Upload SCORM package",id:"label.upload_scorm_package.e3c0d6ac"})}),(0,N.jsx)(ds.D0,{name:"cartridge_url",children:()=>(0,N.jsx)(N.Fragment,{children:null!==b&&void 0!==b&&b.cartridge_url?(0,N.jsx)(Ge.A,{className:"mb-3",children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex align-items-center justify-content-between",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(ze.aw1,{color:i,size:24}),(0,N.jsx)("strong",{className:"flex-fill",children:_()})]}),(0,N.jsxs)("button",{className:"btn btn-quaternary d-flex align-items-center gap-2",onClick:j,children:[(0,N.jsx)(ze.RCe,{}),(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})]})]})}):(0,N.jsx)(We.A,{className:"text-center",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"You haven't uploaded a content package yet",id:"label.you_havent_uploaded_a_content_pack.dc92723c"})})})}),!b.cartridge_url&&(0,N.jsxs)(ve.A,{className:"d-flex align-items-center gap-2",onClick:async()=>{try{const{cartridge_url:e,type:s}=await r.current.show((0,F.A)({},x.values));if(!e)return;await x.setFieldValue("cartridge_url",e),await x.setFieldTouched("cartridge_url",!0),await x.setFieldValue("type",s),await x.setFieldTouched("type",!0),c(v,x.handleSubmit,!0)}catch(e){}},children:[(0,N.jsx)(ze.E5P,{}),(0,N.jsx)(ke.A,{defaultMessage:"Upload package",id:"label.upload_package.5bbc805b"})]}),(0,N.jsx)(ds.Kw,{name:"cartridge_url",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})}),(0,N.jsx)(je,{ref:n}),(0,N.jsx)(YQ,{ref:r})]})},uW,gW,lW,nW];var xW=e=>{var s;const{formatMessage:a}=(0,ja.A)(),{getStepValidator:t,handleChangeTemplateData:i,startEditingTimer:l,template:n,updateTemplate:r}=sQ(),{published:o,title:d}=n||{},c=async e=>(await i(e),await r(e)),h=(0,ds.Wx)({initialValues:{title:d||""},onSubmit:c,validateOnChange:!0,validationSchema:t()}),u=async()=>(0,T.isEmpty)(await h.validateForm()),{errors:m,touched:g,values:p}=h;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:h,children:(0,N.jsx)(_e.A,{onSubmit:c,children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(FB,{className:"text-secondary",length:(null===p||void 0===p||null===(s=p.title)||void 0===s?void 0:s.length)||0,max:100,min:4})]}),(0,N.jsx)(_e.A.Control,{disabled:!!o,isInvalid:(null===g||void 0===g?void 0:g.title)&&(null===m||void 0===m?void 0:m.title),isValid:(null===g||void 0===g?void 0:g.title)&&!(null!==m&&void 0!==m&&m.title),name:"title",onChange:async e=>{await h.handleChange(e),await h.setFieldTouched(e.target.name,!0),l(u,h.handleSubmit)},readOnly:!!o,value:null===p||void 0===p?void 0:p.title,"aria-label":a({id:"label.content_title.9e3a9a34",defaultMessage:"Content title"}),placeholder:a({id:"label.title_your_certification.64bd2dfb",defaultMessage:"Title your certification..."})}),(0,N.jsx)(ds.Kw,{name:"title",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})})})};var vW=e=>{var s;const{formatMessage:a}=(0,ja.A)(),{getStepValidator:t,handleChangeTemplateData:i,startEditingTimer:l,template:n,updateTemplate:r}=sQ(),{description:o,published:d}=n||{},c=async e=>(await i(e),await r(e)),h=(0,ds.Wx)({initialValues:{description:o||""},onSubmit:c,validateOnChange:!0,validationSchema:t()}),u=async()=>(0,T.isEmpty)(await h.validateForm()),{errors:m,touched:g,values:p}=h;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:h,children:(0,N.jsx)(_e.A,{onSubmit:c,children:(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Description",id:"label.description.526e0087"})}),(0,N.jsx)(FB,{className:"text-secondary",length:(null===p||void 0===p||null===(s=p.description)||void 0===s?void 0:s.length)||0,max:1e3,min:100})]}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:!!d,isInvalid:(null===g||void 0===g?void 0:g.description)&&(null===m||void 0===m?void 0:m.description),isValid:(null===g||void 0===g?void 0:g.description)&&!(null!==m&&void 0!==m&&m.description),name:"description",onChange:async e=>{await h.handleChange(e),await h.setFieldTouched(e.target.name,!0),l(u,h.handleSubmit)},readOnly:!!d,rows:13,value:null===p||void 0===p?void 0:p.description,"aria-label":a({id:"label.content_description.c1ef5fa5",defaultMessage:"Content description"}),placeholder:a({id:"label.describe_your_certification.93e366c1",defaultMessage:"Describe your certification..."})}),(0,N.jsx)(ds.Kw,{name:"description",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})})})};const fW=l.createContext({}),jW=fW.Provider,_W=(fW.Consumer,()=>(0,l.useContext)(fW)),bW=(0,l.forwardRef)((s,a)=>{const{allowMultiSelect:t,defaultSelection:i,excludedIds:n,onSelectionChange:r,onSubmit:o,organization_id:d,organization_memberships:c,scopeToUser:h,searchable:u,selectorType:m,submitOnSelect:g}=s,p=(0,l.useRef)(),{api:x}=(0,P.nm)(),[v,f,j]=(0,ne.CQ)({certification_accreditors:[],error:null,loading:!1,organizations:[],search_term:"",selected_certification_accreditor_ids:i?[
2i]:[],show:!1,submitting:!1}),_=async()=>{try{const{loading:e,search_term:s}=v;if(e)return;f({certification_accreditors:[],loading:!0});const{certification_accreditors:a,count:t}=await x.post("/api/certification-accreditors/search/1/1000",{organization_id:d,search_term:s,sort_direction:"ASC",sort_token:"name",user_id:h});f({certification_accreditors:a,count:t,loading:!1})}catch(e){f({error:(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message),loading:null})}},b=e=>{var s;return!(null===n||void 0===n||null===(s=n.includes)||void 0===s||!s.call(n,e))},A=e=>v.selected_certification_accreditor_ids.includes(e),y=e=>{const{selected_certification_accreditor_ids:s}=v;return A(e)?s.filter(s=>s!==e):[...s,e]},w=()=>{var e;return t?null===v||void 0===v?void 0:v.selected_certification_accreditor_ids:null===v||void 0===v||null===(e=v.selected_certification_accreditor_ids)||void 0===e?void 0:e[0]},S=()=>{var e;const{certification_accreditors:s}=v,a=w();return t?s.filter(e=>{var s;return null===a||void 0===a||null===(s=a.includes)||void 0===s?void 0:s.call(a,null===e||void 0===e?void 0:e.id)}):null===s||void 0===s||null===(e=s.find)||void 0===e?void 0:e.call(s,e=>(null===e||void 0===e?void 0:e.id)===a)};(0,l.useImperativeHandle)(a,()=>({getFullSelection:S,getSelection:w,refresh:_})),(0,l.useEffect)(()=>(_(),j),[]),(0,l.useEffect)(()=>{"function"===typeof r&&r(w())},[v.selected_certification_accreditor_ids]);const{certification_accreditors:C,error:M,loading:k,organizations:z,search_term:T,selected_certification_accreditor_ids:I,submitting:E}=v,R={certification_accreditors:C,clearSelections:()=>f({selected_certification_accreditor_ids:[]}),excludedIds:n,fetchAccreditors:_,getSelectedAccreditors:y,handleSelectAccreditor:async e=>{if(b(null===e||void 0===e?void 0:e.id))return;const s=t?y(null===e||void 0===e?void 0:e.id):A(null===e||void 0===e?void 0:e.id)?[]:[null===e||void 0===e?void 0:e.id];f({selected_certification_accreditor_ids:s}),g&&"function"===typeof o&&await o(w())},isDisabled:b,isOrgAdmin:e=>{var s,a;return 2===(null===c||void 0===c||null===(s=c.find)||void 0===s||null===(a=s.call(c,s=>(null===s||void 0===s?void 0:s.organization_id)===e))||void 0===a?void 0:a.role_id)},isSelected:A,loading:k,organization_memberships:c,organizations:z,selected_certification_accreditor_ids:I,selectorType:m,submitting:E};return(0,N.jsxs)(jW,{value:(0,F.A)({},R),children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>f({error:null}),show:M,variant:"danger",children:M}),!!u&&(0,N.jsxs)(Ei.A,{children:[(0,N.jsx)(Ei.A.Text,{className:"border bg-white",children:(0,N.jsx)(ze.KSO,{})}),(0,N.jsx)(be.A,{className:"border-start-0",onChange:e=>{var s;f({search_term:null===e||void 0===e||null===(s=e.target)||void 0===s?void 0:s.value}),(()=>{const{search_term:e}=v;p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f({page:1,search_term:e},_),1e3)})()},placeholder:"Search",value:T})]}),(0,N.jsx)(yW,{})]})});bW.displayName="AccreditorPicker",bW.defaultProps={allowMultiSelect:!0,body:"",excludedIds:[],hideOnSubmit:!1,searchable:!1,submitOnSelect:!1};var AW=bW;var yW=e=>{const{certification_accreditors:s=[],excludedIds:a,loading:t}=_W(),i=(e=>e.filter(e=>!a.includes(null===e||void 0===e?void 0:e.id)))(s);return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(_e.A,{className:"certification-picker-list d-flex pt-2 flex-column",children:(0,N.jsx)(Me.x_,{loading:t,children:null!==i&&void 0!==i&&i.length?(0,N.jsx)(N.Fragment,{children:i.map((e,s)=>(0,N.jsx)(wW,{certification_accreditor:e},s))}):(0,N.jsx)(Ce.S,{className:"d-flex align-items-center justify-content-center p-5 border rounded",children:(0,N.jsx)("span",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"No certifying bodies found",id:"label.no_certifying_bodies_found.dba1a670"})})})})})})};var wW=e=>{const{certification_accreditor:s}=e,{handleSelectAccreditor:a,isDisabled:t,isSelected:i,selectorType:l}=_W(),n=(null===s||void 0===s?void 0:s.logo_path)||xo;return(0,N.jsxs)(Ce.S,{className:`bg-light certification-picker-list-item d-flex align-items-center justify-content-between p-2 gap-3 mb-1 rounded ${i(null===s||void 0===s?void 0:s.id)?"selected":""} ${t(null===s||void 0===s?void 0:s.id)?"disabled":""}`,children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-fill align-items-center gap-2",children:[(0,N.jsx)(Zs.A,{rounded:!0,alt:"",className:"border",height:50,src:n,width:50}),(0,N.jsxs)(Fl,{as:"h5",className:"d-inline-flex align-items-baseline gap-1 m-0",maxWidth:500,placement:"bottom",children:[(0,N.jsx)("span",{children:(null===s||void 0===s?void 0:s.name)||"Unknown certifying body"}),1===(null===s||void 0===s?void 0:s.id)&&(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"(default)",id:"label.default.b3ffbbff"})})]})]}),(0,N.jsx)(Ce.S,{children:(()=>{switch(l){case"radio":return(0,N.jsx)(Zl.A,{checked:i(null===s||void 0===s?void 0:s.id),onChange:()=>a(s),type:"radio"});case"checkbox":return(0,N.jsx)(Zl.A,{checked:i(null===s||void 0===s?void 0:s.id),onChange:()=>a(s),type:"checkbox"});case"button":return(0,N.jsx)(ve.A,{className:"text-decoration-none",onClick:()=>a(s),size:"sm",variant:"link",children:(0,N.jsx)(ze.Z0P,{})})}})()})]})};const NW=(0,l.forwardRef)((e,s)=>{const{defaultSelection:a,size:t,title:i}=e,{getAllUserOrganizations:n,userId:r}=(0,P.nm)(),[o,d]=(0,ne.CQ)({organization_id:null,reject:Function(),resolve:Function(),visible:!1}),{organization_id:c,resolve:h,visible:u}=o,m=(0,l.useRef)(),g=e=>new Promise((s,a)=>{d({organization_id:e,reject:a,resolve:s,visible:!0})}),p=()=>{h(null),d({organization_id:null,reject:Function(),resolve:Function(),visible:!1})};return(0,l.useImperativeHandle)(s,()=>({hide:p,show:g,visible:u})),(0,N.jsxs)(xe,{className:"certification-picker-modal",onHide:p,show:u,size:t,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:i||(0,N.jsx)(ke.A,{defaultMessage:"Select certifying body",id:"label.select_certifying_body.324ded79"})})}),(0,N.jsx)(xe.Body,{children:(0,N.jsx)(AW,{allowMultiSelect:!1,defaultSelection:a,organization_id:c,organization_memberships:n(),ref:m,scopeToUser:r,searchable:!1,selectorType:"radio",submitOnSelect:!1})}),(0,N.jsx)(xe.Footer,{children:(0,N.jsx)(ve.A,{onClick:()=>{const e=null===m||void 0===m?void 0:m.current;e&&(h(e.getFullSelection()),p())},children:"Select"})})]})});NW.displayName="AccreditorPickerModal",NW.defaultProps={onSelect:Function(),size:"normal"};var SW=NW;var CW=e=>{var s;const{getStepValidator:a,handleChangeTemplateData:t,template:i,updateTemplate:n}=sQ(),{certification_accreditor:r,published:o}=i||{},d=(0,l.useRef)(),c=(0,l.useRef)(),h=(0,ds.Wx)({initialValues:{certification_accreditor_id:null!==(s=null===r||void 0===r?void 0:r.id)&&void 0!==s?s:1},onSubmit:Function(),validationSchema:a()}),{setFieldTouched:u,setFieldValue:m}=h,g=async()=>{const e=null===c||void 0===c?void 0:c.current;if(!e)return;const s=await e.show();await u("certification_accreditor_id",!0),await m("certification_accreditor_id",null===s||void 0===s?void 0:s.id),await(async e=>(await t(e),await n(e)))({certification_accreditor_id:s.id})},p=(null===r||void 0===r?void 0:r.logo_path)||xo;return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select the certifying body you wish to be listed as an accreditor to this certification.",id:"label.select_the_certifying_body_you_wis.c056474a"})}),(0,N.jsx)(ds.QI,{value:h,children:(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{htmlFor:"certification_template",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification",id:"label.certification.86846f67"})}),(0,N.jsx)(ds.D0,{name:"certification_accreditor_id",children:()=>(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex",children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-fill align-items-center gap-3",children:[(0,N.jsx)(Zs.A,{rounded:!0,alt:"",className:"border",height:50,src:p,width:50}),(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-2",children:[(0,N.jsx)(Fl,{as:"h5",className:"m-0",maxWidth:500,placement:"bottom",children:(null===r||void 0===r?void 0:r.name)||"Unknown certifying body"}
2),1===(null===r||void 0===r?void 0:r.id)&&(0,N.jsx)("small",{className:"text-muted h5 m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"(default)",id:"label.default.b3ffbbff"})})]})]}),(0,N.jsx)(ve.A,{className:"d-flex align-self-center",disabled:1===o,onClick:g,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Change certifying body",id:"label.change_certifying_body.f653029e"})})]})})}),(0,N.jsx)(ds.Kw,{name:"icon_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(je,{ref:d}),(0,N.jsx)(SW,{defaultSelection:null===r||void 0===r?void 0:r.id,ref:c,size:"normal"})]})})]})};var MW=s=>{const a=(0,ja.A)(),{clearError:t,handleChangeTemplateData:i,setError:l,setStatus:n,setTimedStatus:r,template:o}=sQ(),{saveTemplate:d}=nQ(),c=(null===o||void 0===o?void 0:o.competencies)||[],h=(null===o||void 0===o?void 0:o.certification_type)||"solution",u=async s=>{const a=(0,F.A)({certification_type:h,competencies:c},s);await i(s),n("editing");try{await d(a),r("saved",2500)}catch(e){l((null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e),n("error")}},m=(g="competencies",async e=>{const s=(null===o||void 0===o?void 0:o[g])||[],i=!!s.find(s=>{let{id:a}=s;return a===(null===e||void 0===e?void 0:e.id)});if(!i&&s.length>=6)return void l(a.formatMessage({id:"label.you_can_select_up_to_max_competenc.08b2d3b0",defaultMessage:"You can select up to {max} competencies in this section. Remove one to add another."},{max:6}));t();const n=i?s.filter(s=>(null===s||void 0===s?void 0:s.id)!==(null===e||void 0===e?void 0:e.id)):[...s,e];await u({[g]:n})});var g;const p=async e=>{t(),await u({certification_type:e})};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certification type",id:"label.certification_type.17523c79"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Choose how this certification is framed. Solution certifications assess a creative problem-solving deliverable; Decision Making certifications assess a governed decision against a fixed set of decision subheads.",id:"label.choose_how_this_certification_is_f.62d0789b"})}),(0,N.jsx)(_e.A.Check,{checked:"solution"===h,id:"certification_type_solution",label:(0,N.jsx)(ke.A,{defaultMessage:"Solution certification",id:"label.solution_certification.d888a69b"}),name:"certification_type",onChange:()=>p("solution"),type:"radio"}),(0,N.jsx)(_e.A.Check,{checked:"decision_making"===h,id:"certification_type_decision_making",label:(0,N.jsx)(ke.A,{defaultMessage:"Decision making certification",id:"label.decision_making_certification.1ced809a"}),name:"certification_type",onChange:()=>p("decision_making"),type:"radio"}),(0,N.jsx)("hr",{className:"my-4"}),(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Individual / participant competencies",id:"label.individual_participant_competencie.52d8fce2"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Select up to 6 competencies evaluated for each participant (at least 1 required).",id:"label.select_up_to_6_competencies_evalua.a0b3e6e5"})}),(e=>{const s=((null===o||void 0===o?void 0:o[e])||[]).length,a=s>6;return(0,N.jsxs)("p",{className:"small mb-2 "+(a?"text-danger":"text-muted"),children:[(0,N.jsx)(ke.A,{defaultMessage:"{count} of {max} selected",id:"label.count_of_max_selected.f93b77db",values:{count:s,max:6}}),a&&(0,N.jsxs)(N.Fragment,{children:[" ",(0,N.jsx)(ke.A,{defaultMessage:"\u2014 remove {n} to meet the limit",id:"label.remove_n_to_meet_the_limit.c372b70b",values:{n:s-6}})]})]})})("competencies"),(0,N.jsx)(zW,{field:"competencies",onToggle:m})]})};const kW=["Creativity","Collaboration","Communication","Critical Thinking"];var zW=e=>{const{field:s="competencies",onToggle:a}=e,{custom_competencies:t=[],global_competencies:i=[]}=nQ(),n=(0,l.useRef)(),r=i.filter(e=>kW.includes(e.name)),o=i.filter(e=>!kW.includes(e.name)),d=e=>{var s;return null===n||void 0===n||null===(s=n.current)||void 0===s?void 0:s.show(e)},c=e=>(0,N.jsx)(Ce.S,{className:"competency-picker-grid",children:e.map((e,t)=>(0,N.jsx)(TW,{competency:e,field:s,onClick:a,onViewRubric:d},t))});return(0,N.jsxs)(Ce.S,{className:"competency-picker d-flex flex-column gap-3",children:[(null===r||void 0===r?void 0:r.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Foundational",id:"label.foundational.03bd0dd9"})}),c(r)]}),(null===o||void 0===o?void 0:o.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Specialized",i
2d:"label.specialized.aeebbb03"})}),c(o)]}),(null===t||void 0===t?void 0:t.length)>0&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("h5",{children:(0,N.jsx)(ke.A,{defaultMessage:"Custom",id:"label.custom.494ca78f"})}),c(t)]}),(0,N.jsx)(RW,{ref:n})]})};var TW=e=>{const{competency:s,field:a="competencies",onClick:t,onViewRubric:i}=e,{template:l}=sQ(),{published:n}=l,r=(null===l||void 0===l?void 0:l[a])||[],{formatMessage:o}=(0,ja.A)(),d=()=>{var e;return null===r||void 0===r||null===(e=r.find)||void 0===e?void 0:e.call(r,e=>(null===e||void 0===e?void 0:e.id)===(null===s||void 0===s?void 0:s.id))},c=oa()("competency-picker-card text-center position-relative",{[`${null===s||void 0===s?void 0:s.slug}`]:!0,"box-shadow-100":!d(),"box-shadow-hover-200":!0,core:["critical-thinking","communication","collaboration","creativity"].includes(null===s||void 0===s?void 0:s.slug),disabled:!!n,selected:!!d()}),h=o({id:"label.view_rubric.0fbc554b",defaultMessage:"View rubric"});return(0,N.jsxs)(Ge.A,{className:c,onClick:()=>{const e="competencies"===a&&(null===r||void 0===r?void 0:r.length)<=1&&!!d();n||e||"function"===typeof t&&t(s)},role:"button",children:["function"===typeof i&&!(null===s||void 0===s||!s.rubric)&&(0,N.jsx)("button",{"aria-label":h,className:"position-absolute top-0 end-0 m-2 p-1 border-0 bg-transparent text-secondary",onClick:e=>{e.stopPropagation(),"function"===typeof i&&i(s)},style:{zIndex:2},title:h,type:"button",children:(0,N.jsx)(ze.__w,{size:18})}),(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column gap-3 align-items-center justify-content-center",children:[(0,N.jsx)(dh,{competency:null===s||void 0===s?void 0:s.slug,size:40}),(0,N.jsx)("h6",{children:s.name}),d()&&(0,N.jsx)("div",{className:"overlay",children:(0,N.jsx)(ze.A7C,{size:48})})]})]})};const IW=[{id:"pages.admin.content_authoring.CompetencyRubricViewer.basic",defaultMessage:"Basic"},{id:"pages.admin.content_authoring.CompetencyRubricViewer.emerging",defaultMessage:"Emerging"},{id:"pages.admin.content_authoring.CompetencyRubricViewer.strong",defaultMessage:"Strong"},{id:"pages.admin.content_authoring.CompetencyRubricViewer.exemplary",defaultMessage:"Exemplary"}],EW=(e,s)=>{const a=IW[s]||{id:`score_${s}`,defaultMessage:`Level ${s+1}`};return(0,N.jsxs)(yl.A.Item,{className:"d-flex flex-column gap-2 py-3",children:[(0,N.jsx)("h6",{className:"m-0",children:(0,N.jsx)(ke.A,(0,F.A)({},a))}),(0,N.jsx)("ul",{className:"m-0 ps-3 d-flex flex-column gap-1",children:(e||[]).map((e,s)=>(0,N.jsx)("li",{children:e},s))})]},s)},FW=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({competency:null,visible:!1}),{competency:n,visible:r}=a,o=e=>t({competency:e,visible:!0}),d=()=>i();(0,l.useImperativeHandle)(s,()=>({hide:d,show:o}));const c=null===n||void 0===n?void 0:n.rubric,h=Array.isArray(c);return(0,N.jsxs)(xe,{onHide:d,show:r,size:"lg",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsxs)(xe.Title,{className:"d-flex gap-1",children:[(0,N.jsx)("span",{className:"fw-normal flex-shrink-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Rubric |",id:"label.rubric_or.7152bdf2"})}),(0,N.jsx)("strong",{children:null===n||void 0===n?void 0:n.name})]})}),(0,N.jsxs)(xe.Body,{children:[!c&&(0,N.jsx)("p",{className:"text-muted m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No rubric has been defined for this competency.",id:"label.no_rubric_has_been_defined_for_thi.b22364dc"})}),h&&(0,N.jsx)(yl.A,{className:"bg-light",children:c.map((e,s)=>EW(e,s))}),!!c&&!h&&(0,N.jsx)(Ce.S,{className:"d-flex flex-column gap-3",children:Object.entries(c).map((e,s)=>{let[a,t]=e;return(0,N.jsxs)(l.Fragment,{children:[(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("h5",{children:a}),(0,N.jsx)(yl.A,{className:"bg-light",children:t.map(EW)})]}),s<Object.keys(c).length-1&&(0,N.jsx)("hr",{})]},s)})})]})]})});FW.displayName="CompetencyRubricViewer";var RW=FW;var DW=s=>{const{formatMessage:a}=(0,ja.A)(),{api:t}=(0,P.nm)(),{Err:i}=(null===Re._$||void 0===Re._$?void 0:Re._$.log)||{},{fetchTemplateDetails:n,getStepValidator:r,setError:o,setStatus:d,setTimedStatus:c,template:h}=sQ(),{banner_path:u,cover_path:m,icon_path:g,published:p}=h||{},x={banner_path:u||"",cover_path:m||"",icon_path:g||""},v=(0,ds.Wx)({initialValues:x,onSubmit:Function(),validationSchema:r()}),f=(0,l.useRef)(),j=(0,l.useRef)(),_=(0,l.useRef)(),b=(0,l.useRef)(),A=async s=>{try{const e=(e=>{switch(e){case"banner":return null===j||void 0===j?void 0:j.current;case"cover":return null===f||void 0===f?void 0:f.current;case"icon":return null===_||void 0===_?void 0:_.current;default:return null}})(s);if(!e)return;const a=await e.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await v.setFieldValue(`${s}_path`,null===a||void 0===a?void 0:a.location),await v.setFieldTouched(`${s}_path`,!0),await n(),c("saved",2500)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;i(a),d("error"),o(a)}},y=async e=>{const s=null===h||void 0===h?void 0:h.id;await t.post("/api/certification-templates/media/remove",{certification_template_id:s,field:e}),await v.setFieldValue(`${e}_path`,""),await v.setFieldTouched(`${e}_path`,!0),await n(),c("saved",2500)},{values:w}=v;return(0,N.jsx)(LU,{children:(0,N.jsx)(ds.QI,{value:v,children:(0,N.jsxs)(_e.A,{onSubmit:e=>e.preventDefault(),children:[(0,N.jsx)("p",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Entice learners to get certified with an eye-catching icon. Ensure images are relevant and appropriate in content.",id:"label.entice_learners_to_get_certified_w.edd999e8"})}),(0,N.jsxs)(os,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex flex-column mb-3",children:[(0,N.jsx)(_e.A.Label,{className:"m-0",htmlFor:"icon_path",children:(0,N.jsx)(ke.A,{defaultMessage:"Icon image",id:"label.icon_image.9356b6da"})}),(0,N.jsx)("small",{className:"text-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Please use a 500 x 500 JPG or PNG file.",id:"label.please_use_a_500_x_500_jpg_or_png.2d736c7b"})})]}),(0,N.jsx)(ds.D0,{name:"icon_path",children:()=>(0,N.jsxs)(Ce.S,{className:"flex-1 d-flex align-items-center gap-2",children:[(0,N.jsx)(Ce.S,{className:"media-preview icon-preview",children:(0,N.jsxs)(Ce.S,{className:"icon-image-overlay",children:[(0,N.jsx)(Me.R_,{roun
2ded:!0,height:200,imageHeight:200,imageWidth:200,src:(null===w||void 0===w?void 0:w.icon_path)||xo,width:200},(null===w||void 0===w?void 0:w.icon_path)||(0,me.A)()),!(null!==w&&void 0!==w&&w.icon_path)&&(0,N.jsx)("strong",{className:"overlay-text",children:(0,N.jsx)(ke.A,{defaultMessage:"Solvably default",id:"label.solvably_default.70b9f178"})})]})}),(0,N.jsx)(Ce.S,{className:"align-self-end",children:(0,N.jsx)(HW,{disabled:!!p,handleRemove:()=>(e=>{const s=null===b||void 0===b?void 0:b.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Submit",onClick:()=>y(e),variant:"danger"})],body:a({id:"label.are_you_sure_you_want_to_remove_th.cca1f789",defaultMessage:"Are you sure you want to remove the {field} image?"},{field:e}),title:a({id:"label.remove_image.da7acac1",defaultMessage:"Remove image"})})})("icon"),handleUpload:()=>A("icon")})})]})}),(0,N.jsx)(ds.Kw,{name:"icon_path",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]}),(0,N.jsx)(TA,{aspectRatio:1,ref:_,uploadHandler:(e,s)=>{const a=null===h||void 0===h?void 0:h.id,i=`certification-template-${a}-icon-image.jpg`;return t.file("/api/certification-templates/upload/icon",{certification_template_id:a,job_id:s},e,i)}}),(0,N.jsx)(je,{ref:b})]})})})};var BW=()=>{const[s,a]=(0,ne.CQ)({attaching:!1}),{attaching:t}=s,{api:i}=(0,P.nm)(),{formatMessage:n}=(0,ja.A)(),{fetchTemplateDetails:r,loading:o,setError:d,setStatus:c,setTimedStatus:h,template:u}=sQ(),{challenge_templates:m}=u||{},g=(0,l.useRef)(),p=(0,l.useRef)(),x=async s=>{try{a({attaching:!0}),await i.post("/api/challenge-templates/attach-certification",{certification_template_id:null===u||void 0===u?void 0:u.id,challenge_template_id:s}),a({attaching:!1}),await r(),h("saved",2500)}catch(e){const t=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(t),c("error"),d(t),a({attaching:!1})}},v=s=>{const a=null===g||void 0===g?void 0:g.current;a&&a.show({actions:[a.CancelAction(),a.Action({label:n({id:"label.detach.74bc1174",defaultMessage:"Detach"}),onClick:()=>(async s=>{try{await i.post("/api/challenge-templates/detach-certification",{certification_template_id:null===u||void 0===u?void 0:u.id,challenge_template_id:s}),await r(),h("saved",2500)}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;(0,xa.Err)(a),c("error"),d(a)}})(s.id),variant:"danger"})],body:(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Are you sure you want to detach this certification from {template}?",id:"label.are_you_sure_you_want_to_detach_th.d83d44a7",values:{template:(0,N.jsx)("strong",{children:s.title})}})}),size:"sm",title:n({id:"label.confirm_detachment.169c3843",defaultMessage:"Confirm detachment"})})};return(0,N.jsxs)(LU,{children:[(0,N.jsx)("p",{className:"text-muted mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Select which challenges this certification can be associated with. Administrators will choose the certification during the assignment creation process.",id:"label.select_which_challenges_this_certi.cef17996"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end mb-3",children:(0,N.jsxs)(Me.p0,{className:"d-flex gap-2 align-items-center",loading:t,onClick:async()=>{const e=null===p||void 0===p?void 0:p.current;if(!e)return;const{component:s}=await e.show({disabled_ids:(m||[]).map(e=>{let{id:s}=e;return s}),scope:["challenge"]})||{};s&&await x(null===s||void 0===s?void 0:s.id)},loading_label:n({id:"label.attaching.3c2db312",defaultMessage:"Attaching..."}),children:[(0,N.jsx)(ze.AnD,{}),(0,N.jsx)(ke.A,{defaultMessage:"Attach challenge",id:"label.attach_challenge.3f7f4c80"})]})}),null!==m&&void 0!==m&&m.length?(0,N.jsx)(Gd.A,{defaultActiveKey:"0",children:(0,N.jsxs)(Gd.A.Item,{eventKey:"0",children:[(0,N.jsx)(Gd.A.Header,{children:(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-1",children:[(0,N.jsx)("h5",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Challenges",id:"label.challenges.40b9c8f4"})}),(0,N.jsx)(bo.A,{pill:!0,bg:"light",text:"dark",children:(0,N.jsx)("strong",{children:(null===m||void 0===m?void 0:m.length)||0})})]})}),(0,N.jsx)(Gd.A.Body,{className:"bg-light d-flex flex-column gap-1",children:(0,T.orderBy)(m,"title").map((e,s)=>(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsxs)(Ce.S,{className:"d-flex align-items-center gap-3",children:[(0,N.jsx)(Zs.A,{rounded:!0,height:40,src:(null===e||void 0===e?void 0:e.cover_path)||xo,style:{objectFit:"cover"},width:40}),(0,N.jsx)("h5",{className:"m-0",children:e.title})]}),(0,N.jsx)(ve.A,{className:"d-flex align-items-center",disabled:o,onClick:()=>v(e),size:"sm",variant:"quaternary",children:(0,N.jsx)(ze.RCe,{})})]})},s))})]})}):(0,N.jsx)(Ge.A,{body:!0,className:"text-center",style:{backgroundColor:"rgba(213, 217, 220, 0.32)",border:"0px"},children:(0,N.jsx)("p",{className:"text-muted mb-0",children:(0,N.jsx)(ke.A,{defaultMessage:"No challenges attached yet. Attach a challenge to make this certification available during assignment creation.",id:"label.no_challenges_attached_yet_attach.2cf54479"})})}),(0,N.jsx)(cd,{ref:p}),(0,N.jsx)(je,{ref:g,size:"lg"})]})};const PW=()=>{const[e,s]=(0,ne.CQ)({publishing:!1}),{formatMessage:a}=(0,ja.A)(),{publishTemplate:t,template:i,template_valid:n}=sQ(),{published:r}=i||{},{preview_template:o}=nQ(),d=(0,l.useRef)(),c=async()=>{s({publishing:!0}),await t(),s({publishing:!1})};return(0,N.jsxs)(LU,{floating:!0,children:[r?(0,N.jsxs)(Ge.A,{body:!0,className:"my-4",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Certification published!",i
2d:"label.certification_published.affc41b7"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Your certification is now live and ready to be used.",id:"label.your_certification_is_now_live_and.fbf1cf28"})})]}):(0,N.jsx)(N.Fragment,{children:n?(0,N.jsxs)(Ge.A,{body:!0,className:"my-3",children:[(0,N.jsx)("h4",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Ready to publish!",id:"label.ready_to_publish.adabc9e1"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Review your certificate design below before publishing.",id:"label.review_your_certificate_design_bel.414678d3"})}),(0,N.jsx)(Ce.S,{className:"d-flex justify-content-center p-3",children:(0,N.jsxs)(ve.A,{className:"d-flex align-items-center justify-content-center gap-2",onClick:()=>{const e=null===d||void 0===d?void 0:d.current;e&&e.show({actions:[e.CancelAction(),e.Action({label:a({id:"label.publish.859390eb",defaultMessage:"Publish"}),onClick:c})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Please review your certification details before publishing.",id:"label.please_review_your_certification_d.ad8b0634"})}),(0,N.jsx)("h5",{className:"text-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"This certification cannot be edited after publication.",id:"label.this_certification_cannot_be_edite.b5046e3e"})})]}),size:"sm",title:a({id:"label.confirm_publication.c3fb144d",defaultMessage:"Confirm publication"})})},children:[(0,N.jsx)("span",{children:(0,N.jsx)(ze.uoG,{})}),(0,N.jsx)(ke.A,{defaultMessage:"Publish certificate",id:"label.publish_certificate.517ccf01"})]})})]}):(0,N.jsx)(We.A,{className:"text-center mt-3",variant:"warning",children:(0,N.jsx)(ke.A,{defaultMessage:"One or more steps are incomplete",id:"label.one_or_more_steps_are_incomplete.7c47aa76"})})}),(0,N.jsx)(Qe.A,{className:"d-flex justify-content-space-between align-items-start gap-4 m-0",children:(0,N.jsx)(Ve.A,{as:Ge.A,children:(0,N.jsxs)(Ge.A.Body,{className:"d-flex flex-column",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Preview",id:"label.preview.324b134f"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certificate layout as it will appear to recipients.",id:"label.certificate_layout_as_it_will_appe.c818c2c5"})}),(0,N.jsx)(AU,{preview_template:o,template:i}),(0,N.jsx)("small",{className:"text-muted mt-2",children:(0,N.jsx)(ke.A,{defaultMessage:"*Final PDF design subject to change.",id:"label.final_pdf_design_subject_to_change.3c6b0326"})})]})})}),(0,N.jsx)(je,{ref:d,size:"lg"})]})};var LW=[xW,vW,CW,MW,DW,BW,PW];const OW=e=>{const{disabled:s,handleRemove:a,handleUpload:t}=e;return(0,N.jsxs)(li.A,{className:"options-dropdown",children:[(0,N.jsxs)(li.A.Toggle,{className:"d-flex align-items-center",disabled:s,children:[(0,N.jsx)(ze.Mbp,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})]}),(0,N.jsxs)(li.A.Menu,{children:[(0,N.jsx)(li.A.Item,{onClick:t,children:(0,N.jsx)(ke.A,{defaultMessage:"Upload an image...",id:"label.upload_an_image.dfdd8500"})}),(0,N.jsx)(li.A.Divider,{}),(0,N.jsx)(li.A.Item,{onClick:a,children:(0,N.jsx)(ke.A,{defaultMessage:"Remove image",id:"label.remove_image.da7acac1"})})]})]})};OW.defaultProps={handleRemove:Function(),handleUpload:Function()};var HW=OW;const UW=l.createContext({}),QW=UW.Provider;UW.Consumer;var VW=s=>{const[a,t]=(0,ne.CQ)({error:null,loading:!0,organization_id:null,selected_tag:null,selected_tag_id:null,selected_tag_set_id:null,tag_sets:[]}),{error:i,loading:n,selected_tag:r,selected_tag_id:o,selected_tag_set_id:d,tag_sets:c}=a,{api:h}=(0,P.nm)(),u=(0,Pe.W6)(),m=(0,Pe.g)(),g=Number.parseInt(null===m||void 0===m?void 0:m.organization_id)||null,p=(0,l.useRef)(null),x=(0,l.useRef)(null),v=(0,l.useRef)(null),f=(0,l.useRef)(null),j=(0,l.useRef)(null),_=(0,l.useRef)(null),b=(0,l.useRef)(null),A=async()=>{t({error:null,loading:!0});try{let{tag_sets:e}=await h.get("/api/tags/sets/all",{organization_id:Number.parseInt(g)||null});t({loading:!1,tag_sets:e})}catch({err:err}){t({error:err,loading:!1})}},y=async e=>{const s=null===b||void 0===b?void 0:b.current;if(!s)return;const a=null===e||void 0===e?void 0:e.id;let i=await s.show({multi_select:!0,scope:["challenge","cartridge"]});if(!i)return;const{selections:l}=i;t({error:null,loading:!0});try{await h.post(`/api/tags/association/add/${a}`,{selections:l}),t({loading:!1,selected_tag:e,selected_tag_id:null===e||void 0===e?void 0:e.id}),u.push(`/admin/tags/${g||"-"}/${null===e||void 0===e?void 0:e.tag_set_id}/${null===e||void 0===e?void 0:e.id}`),await A()}catch({err:err}){t({error:err,loading:!1})}};(0,l.useEffect)(()=>{A()},[]),(0,l.useEffect)(()=>{t({selected_tag_id:m.tag_id,selected_tag_set_id:m.tag_set_id})},[m.organization_id,m.tag_set_id,m.tag_id]);const w=c&&c.find(e=>e.id==d);
2return(0,N.jsx)(QW,{value:{organization_id:g,selected_tag_id:o,selected_tag_set_id:d},children:(0,N.jsxs)(Ce.S,{className:"admin-tag-manager",children:[(0,N.jsx)(GW,{title:"Manage Tags",onBack:()=>{Number.parseInt(g)?u.push(`/admin/organization/${g}#settings`):u.push("/admin#library")},children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{t({error:null})},show:i,variant:"danger",children:i}),n&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!n&&!i&&(0,N.jsxs)(N.Fragment,{children:[!(null!==c&&void 0!==c&&c.length)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"text-center mt-5",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"No tag sets",id:"label.no_tag_sets.a9997a2b"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"There are no tag sets",id:"label.there_are_no_tag_sets.45d04c35"})}),(0,N.jsxs)(ve.A,{onClick:()=>f.current.show(),children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"New tag set",id:"label.new_tag_set.2ca22b66"})]})]})}),!!c.length&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[!d&&!o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Tag sets",id:"label.tag_sets.ba9e9f90"})}),(0,N.jsxs)(ve.A,{onClick:()=>f.current.show(),children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"New tag set",id:"label.new_tag_set.2ca22b66"})]})]}),(0,N.jsxs)(ho,{striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Tag set",id:"label.tag_set.3eb41e43"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",id:"label.modules.76c86c4c"})})]})}),(0,N.jsx)(ho.Tbody,{cols:3,loading:n,children:null!==c&&void 0!==c&&c.length?(0,N.jsx)(N.Fragment,{children:c.map((e,s)=>{const{module_count:a,name:t,tag_count:i}=e;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{className:"text-dark",to:`/admin/tags/${g||"-"}/${null===e||void 0===e?void 0:e.id}`,children:(0,N.jsx)("b",{children:t})})}),(0,N.jsx)(ho.Td,{children:i||0}),(0,N.jsx)(ho.Td,{children:a||0})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-muted",colSpan:3,children:(0,N.jsx)(ke.A,{defaultMessage:"No tag sets found",id:"label.no_tag_sets_found.0112788d"})})})})]})]}),d&&!o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsxs)(Le.Link,{className:"text-secondary",to:`/admin/tags/${g||"-"}`,children:[(0,N.jsx)(ze.QVr,{className:"me-2"}),(0,N.jsx)(ke.A,{defaultMessage:"All tag sets",id:"label.all_tag_sets.60b4c993"})]})}),(0,N.jsx)(sK,{onCreateTag:()=>p.current.show(d),onCreateTagAssociation:e=>y(e),onDeleteTagSet:()=>j.current.show(w),onRenameTagSet:()=>_.current.show(w),onSelectTag:e=>t({selected_tag_id:e}),tag_set_id:d})]}),o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Ce.S,{className:"mb-2",children:(0,N.jsxs)(Le.Link,{className:"text-secondary",to:`/admin/tags/${g||"-"}/${d}`,children:[(0,N.jsx)(ze.QVr,{className:"me-2"}),null===w||void 0===w?void 0:w.name]})}),(0,N.jsx)(WW,{onCreateTagAssociation:()=>y(r),onDeleteTag:()=>x.current.show(r),onDeleteTagAssociation:e=>(async e=>{t({error:null,loading:!0});try{await h.post(`/api/tags/association/delete/${e}`),t({loading:!1}),await A()}catch({err:err}){t({error:err,loading:!1})}})(e),onLoad:e=>t({selected_tag:e}),onRenameTag:()=>v.current.show(r),tag_id:o})]})]})})})]})]})}),(0,N.jsx)(tK,{onCreate:async(e,s)=>{t({error:null,loading:!0});try{let{tag_set:a}=await h.post("/api/tags/sets/add",{name:e,organization_id:g,tags:s});t({loading:!1,selected_tag_set_id:null===a||void 0===a?void 0:a.id}),(null===a||void 0===a?void 0:a.id)&&u.push(`/admin/tags/${g}/${null===a||void 0===a?void 0:a.id}`),await A()}catch({err:err}){t({error:err,loading:!1})}},ref:f}),(0,N.jsx)(lK,{onDelete:e=>(async e=>
2{t({error:null,loading:!0,selected_tag_id:null,selected_tag_set_id:null});try{await h.post(`/api/tags/sets/delete/${e}`),t({loading:!1}),u.push(`/admin/tags/${g}`),await A()}catch({err:err}){t({error:err,loading:!1})}})(e),ref:j}),(0,N.jsx)(rK,{onRename:(s,a)=>(async(s,a)=>{t({error:null,loading:!0});try{await h.post(`/api/tags/sets/rename/${a}`,{name:s}),t({loading:!1}),await A()}catch(e){t({error:e,loading:!1})}})(s,a),ref:_}),(0,N.jsx)(YW,{onCreate:(e,s)=>(async(e,s)=>{t({error:null,loading:!0,tag_set_id:null});try{let{tag:a}=await h.post("/api/tags/add",{name:e,tag_set_id:s});t({loading:!1,tag_set_id:s})}catch({err:err}){t({error:err,loading:!1})}})(e,s),ref:p}),(0,N.jsx)(JW,{onDelete:e=>(async e=>{t({error:null,loading:!0,selected_tag:null,selected_tag_id:null});try{await h.post(`/api/tags/delete/${e}`),t({loading:!1}),await A()}catch({err:err}){t({error:err,loading:!1})}})(e),ref:x}),(0,N.jsx)(ZW,{onRename:(s,a)=>(async(s,a)=>{t({error:null,loading:!0});try{await h.post(`/api/tags/rename/${a}`,{name:s}),t({loading:!1}),await A()}catch(e){t({error:e,loading:!1})}})(s,a),ref:v}),(0,N.jsx)(cd,{ref:b})]})})};const GW=e=>{const{onBack:s,title:a}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"center",background:"white",display:"flex",height:64,left:0,padding:25,position:"fixed",top:0,width:"100%",zIndex:3},children:[!!s&&(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)("a",{className:" text-secondary",href:"pages/admin/components/site/components/tabs/library/tags/AdminTags#",onClick:e=>{e.preventDefault(),"function"===typeof s&&s()},children:(0,N.jsx)(ze.QVr,{})})}),(0,N.jsx)(Ce.S,{className:"h4 m-0",children:a||""})]}),(0,N.jsxs)(Ce.S,{style:{backgroundColor:"var(--gray-100)",minHeight:"100vh"},children:[(0,N.jsx)(Ce.S,{style:{height:89}}),e.children]})]})};var WW=e=>{const{onCreateTagAssociation:s,onDeleteTag:a,onDeleteTagAssociation:t,onLoad:i,onRenameTag:n,tag_id:r}=e,{api:o}=(0,P.nm)(),[d,c,h]=(0,ne.CQ)({error:null,loading:!0,tag:null});(0,l.useEffect)(()=>{(async()=>{await(async()=>{try{let{tag:e}=await o.get(`/api/tags/get/${r}`);"function"===typeof i&&i(e),c({loading:!1,tag:e})}catch({err:err}){c({error:err,loading:!1})}})()})()},[r]);const{error:u,loading:m,tag:g}=d,p=(null===g||void 0===g?void 0:g.components)||null;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:u,variant:"danger",children:u}),(0,N.jsxs)(Me.x_,{loading:m,children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between",children:[(0,N.jsx)("h2",{children:null===g||void 0===g?void 0:g.name}),(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[(0,N.jsxs)(ve.A,{onClick:()=>"function"==typeof n&&n(),size:"sm",variant:"outline-secondary",children:[(0,N.jsx)(ze.p2D,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Rename tag",id:"label.rename_tag.40ab1c37"})]}),(0,N.jsxs)(ve.A,{onClick:()=>"function"==typeof a&&a(),size:"sm",variant:"outline-danger",children:[(0,N.jsx)(ze.qbC,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Delete tag",id:"label.delete_tag.365635aa"})]})]})]}),(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between py-3",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Applied to",id:"label.applied_to.8b6f62b0"})}),(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(ve.A,{onClick:s,variant:"link",children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Apply",id:"label.apply.31e392d1"})]})})]}),null!==p&&void 0!==p&&p.length?(0,N.jsxs)(ho,{children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Title",id:"label.title.7e8cd205"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Type",id:"label.type.baaddf70"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Other tags",id:"label.other_tags.8f55af06"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:5,loading:m,children:p.map((e,s)=>(0,N.jsx)(eK,{component_tag:e,onRemove:t,tag_id:r},s))})]}):(0,N.jsxs)(Ce.S,{className:"d-flex flex-column align-items-center justify-content-center",children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"No content",id:"label.no_content.8154c75a"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"This tag is not applied to any content",id:"label.this_tag_is_not_applied_to_any_con.209f3ba2"})}),(0,N.jsxs)(ve.A,{onClick:()=>"function"===typeof s&&s(),variant:"primary",children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"Apply tag",id:"label.apply_tag.3dc99a2f"})]})]})]})]})};const KW=(0,l.forwardRef)((e,s)=>{const{onCreate:a}=e,{locale:t}=(0,P.nm)(),[i,n,r]=(0,ne.CQ)({loading:!1,name:null,show:!1,tag_set_id:null}),o=e=>{n({show:!0,tag_set_id:e})},d=()=>{r()};(0,l.useImperativeHandle)(s,()=>({hide:d,show:o})),(0,l.useEffect)(()=>r,[]);const{show:c}=i;return(0,N.jsxs)(xe,{onHide:d,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"New tag",id:"label.new_tag.609117d5"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{const{tag_set_id:s}=i,{name:t}=e;"function"===typeof a&&a(t,s),d()},validationSchema:(0,Re.by)({locale:t,scope:"tag.tag"}),initialValues:{name:""},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:l.name&&s.name,isValid:l.name&&!s.name,name:"name",onChange:a,placeholder:"Tag name",type:"text",value:n.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:d,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Create tag",id:"label.create_tag.7af189a2"})})]})]})}})]})});KW.displayName="TagCreator";var YW=KW;const qW=(0,l.forwardRef)((e,s)=>{const{onDelete:a}=e,[t,i,n]=(0,ne.CQ)({show:!1,tag:null}),{show:r,tag:o}
2=t,d=e=>{i({show:!0,tag:e})},c=()=>{n()};return(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>n,[]),(0,N.jsxs)(xe,{onHide:c,show:r,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:`Delete ${(null===o||void 0===o?void 0:o.name)||"tag"}`,id:"client.src.pages.admin.components.tags.AdminTags.16543677"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{"function"===typeof a&&a(null===o||void 0===o?void 0:o.id),c()},initialValues:{name:""},validationSchema:ul.Ik().shape({name:ul.Yj().oneOf([null===o||void 0===o?void 0:o.name],"Please type the tag name to confirm").required("A name must be provided")}),children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deleting this tag will remove it from all pieces of content",id:"label.deleting_this_tag_will_remove_it_f.bb62335f"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Please type {name} to confirm",id:"label.please_type_name_to_confirm.e74e246b",values:{name:(0,N.jsx)("b",{children:null===o||void 0===o?void 0:o.name})}})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:l.name&&s.name,isValid:l.name&&!s.name,name:"name",onChange:a,placeholder:null===o||void 0===o?void 0:o.name,type:"text",value:n.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!(null!==n&&void 0!==n&&n.name)||Object.keys(s).length,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});qW.TagDeleter="TagDeleter";var JW=qW;const XW=(0,l.forwardRef)((e,s)=>{const{onRename:a}=e,{locale:t}=(0,P.nm)(),[i,n,r]=(0,ne.CQ)({show:!1,tag:null}),{show:o,tag:d}=i,c=e=>{n({show:!0,tag:e})},h=()=>{r()};return(0,l.useImperativeHandle)(s,()=>({hide:h,show:c})),(0,l.useEffect)(()=>r,[]),(0,N.jsxs)(xe,{onHide:h,show:o,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Rename tag",id:"label.rename_tag.40ab1c37"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{"function"===typeof a&&a(null===e||void 0===e?void 0:e.name,null===d||void 0===d?void 0:d.id),h()},validationSchema:(0,Re.by)({locale:t,scope:"tag.tag"}),initialValues:{name:(null===d||void 0===d?void 0:d.name)||""},children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:l.name&&s.name,isValid:l.name&&!s.name,name:"name",onChange:a,placeholder:null===d||void 0===d?void 0:d.name,type:"text",value:n.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:h,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!(null!==n&&void 0!==n&&n.name)||Object.keys(s).length,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})})]})]})}})]})});XW.displayName="TagRenamer";var ZW=XW;const $W=e=>{const{component_tag:s,onRemove:a,tag_id:t}=e,{id:i}=s,l="journey"===(null===s||void 0===s?void 0:s.type)?"group_assignment":(null===s||void 0===s?void 0:s.type)||"",n=(null===s||void 0===s?void 0:s[`${l}_template_stub`])||{},r=(null===n||void 0===n?void 0:n.current)||{},o=(null===n||void 0===n?void 0:n.tags)||[],{formatMessage:d}=(0,ja.A)();return(0,N.jsxs)(io,{onClick:e=>{e.preventDefault()},children:[(0,N.jsx)(ro,{style:{width:75},children:(0,N.jsx)(Ad,{component:r,type:s.type})}),(0,N.jsx)(ro,{children:(0,N.jsx)(Fl,{as:"strong",maxWidth:250,children:null===r||void 0===r?void 0:r.title})}),(0,N.jsx)(ro,{children:(()=>{switch(l){case"challenge":return d({id:"label.challenge.27cf1792",defaultMessage:"Challenge"});case"cartridge":return d({id:"label.cartridge.af853653",defaultMessage:"Cartridge"});case"journey":return d({id:"label.journey.fe50ed10",defaultMessage:"Journey"})}})()}),(0,N.jsx)(ro,{style:{maxWidth:400},children:o.filter(e=>{let{tag:s}=e;return(null===s||void 0===s?void 0:s.id)!==t}).map((e,s)=>{let{tag:a}=e;return(0,N.jsx)(bo.A,{pill:!0,bg:"secondary",className:"me-2 align-middle",children:null===a||void 0===a?void 0:a.name},s)})}),(0,N.jsx)(ro,{className:"text-end",children:(0,N.jsx)(ve.A,{onClick:()=>a(i),size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Remove",id:"label.remove.c3812fc4"})})})]})};$W.defaultProps={onRemove:Function()};var eK=$W;var sK=e=>{const{onCreateTag:s,onCreateTagAssociation:a,onDeleteTagSet:t,onRenameTagSet:i,tag_set_id:n}=e,[r,o,d]=(0,ne.CQ)({error:null,loading:!0,tag_set:null}),{organization_id:c}=(0,l.useContext)(UW),h=(0,P.nm)(),{api:u}=h;(0,l.useEffect)(()=>{!async function(){await(async()=>{try{let{tag_set:e}=await u.get(`/api/tags/sets/get/${n}`);o({loading:!1,tag_set:e})}catch({err:err}){o({error:err,loading:!1})}})()}()},[n]);const{error:m,loading:g,tag_set:p}=r,x=(null===p||void 0===p?void 0:p.tags)||null,v=(null===p||void 0===p?void 0:p.applied_organizations)||[];return(0,N.jsxs)(N.Fragment,{children:[g&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:m,variant:"danger",children:m}),!g&&!m&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Ue.A,{children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{sm:c?12:9,children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between mb-4",children:[(0,N.jsx)("h2",{children:null===p||void 0===p?void 0:p.name}),(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-1 flex-wrap",children:[(0,N.jsxs)(ve.A,{size:"sm",variant:"link",onClick:()=>{"function"==typeof s&&s()},children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"New tag",id:"label.new_tag.609117d5"})]}),(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-secondary",onClick:()=>{"function"==typeof i&&i()},children:[(0,N.jsx)(ze.p2D,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Rename set",id:"label.rename_set.f16dffda"})]}),(0,N.jsxs)(ve.A,{size:"sm",variant:"outline-danger",onClick:()=>{"function"==typeof t&&t()},children:[(0,N.jsx)(ze.qbC,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"Delete set",id:"label.delete_set.5b9e0fcf"})]})]})]}),(0,N.jsxs)(ho,{children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Tag name",id:"label.tag_name.1ace926b"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",id:"label.modules.76c86c4c"})}),(0,N.jsx)(ho.Th,{})]})}),(0,N.jsx)(ho.Tbody,{cols:3,loading:g,children:null!==x&&void 0!==x&&x.length?(0,N.jsx)(N.Fragment,{children:x.map(e=>{var s;return(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)(Le.Link,{className:"text-dark",to:`/admin/tags/${c||"-"}/${null===p||void 0===p?void 0:p.id}/${null===e||void 0===e?void 0:e.id}`,children:(0,N.jsx)("b",{children:null===e||void 0===e?void 0:e.name})})}),(0,N.jsx)(ho.Td,{children:(null===e||void 0===e||null===(s=e.components)||void 0===s?void 0:s.length)||0}),(0,N.jsx)(ho.Td,{className:"text-end",children:"function"==typeof a&&(0,N.jsxs)(ve.A,{variant:"link",onClick:s=>{s.preventDefault(),s.stopPropagation(),a(e)},children:[(0,N.jsx)(ze.OiG,{className:"me-1"}),(0,N.jsx)(ke.A,{defaultMessage:"Apply",id:"label.apply.31e392d1"})]})})]})})})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-muted",colSpan:3,children:(0,N.jsx)(ke.A,{defaultMessage:"No tags found",id:"label.no_tags_found.8a6dd503"})})})})]}),!(null!==x&&void 0!==x&&x.length)&&(0,N.jsxs)(Ce.S,{className:"p-5 text-center",style:{backgroundColor:"var(--gray-200)"},children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"No tags",id:"label.no_tags.147e6bba"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"There are no tags in this tag set",id:"label.there_are_no_tags_in_this_tag_set.d8f99cc3"})}),(0,N.jsxs)(ve.A,{variant:"primary",onClick:()=>{"function"==typeof s&&s()},children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"New tag",id:"label.new_tag.609117d5"})]})]})]}),!c&&(0,N.jsxs)(Ve.A,{sm:3,children:[(0,N.jsx)("h4",{children:(0,N.jsx)(ke.A,{defaultMessage:"Used by",id:"label.used_by.681bf81a"})}),(0,N.jsx)(Ge.A,{children:(0,N.jsxs)(yl.A,{className:"list-group-borderless tag-set-organizations",children:[v.map((e,s)=>{const{organization:a}=e;return(0,N.jsx)(Le.Link,{to:`/admin/organization/${null===a||void 0===a?void 0:a.id}`,children:(0,N.jsx)(yl.A.Item,{action:!0,className:"font-weight-bold",children:(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("span",{children:a.name}),(0,N.jsx)("span",{className:"text-secondary",children:(0,N.jsx)(ze.EQc,{size:15})})]})})},s)}),(!v||!v.length)&&(0,N.jsx)(yl.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"No organizations using this set.",id:"label.no_organizations_using_this_set.ce758b7d"})})]})})]})]})})})]})};const aK=(0,l.forwardRef)((e,s)=>{const{onCreate:a}=e,{locale:t}=(0,P.nm)(),[i,n,r]=(0,ne.CQ)({loading:!1,name:null,show:!1,tags:[]}),o=e=>{n({show:!0})},d=()=>{r()};(0,l.useImperativeHandle)(s,()=>({hide:d,show:o})),(0,l.useEffect)(()=>r,[]);const{show:c}=i;return(0,N.jsxs)(xe,{onHide:d,show:c,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"New tag set",id:"label.new_tag_set.2ca22b66"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{const{name:s,tags:t}=e;"function"===typeof a&&a(s,t),d()},validationSchema:(0,Re.by)({locale:t,scope:"tag.tag_set"}),initialValues:{name:"",tags:[{name:""}]},children:e=>{var s;let{errors:a,handleChange:t,handleSubmit:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:i,style:{minWidth:"100%"},children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:n.name&&a.name,isValid:n.name&&!a.name,name:"name",onChange:t,placeholder:"Short name for this tag set",type:"text",value:r.name}),(0,N.jsx)(ds.Kw,{name:"name",children:e=>(0,N.jsx)("small",{className:"text-danger mt-1",children:e})})]})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsxs)(os,{children:[(0,N.jsxs)(_e.A.Label,{children:[(0,N.jsx)(ke.A,{defaultMessage:"Tags",id:"label.tags.1331275b"}),(0,N.jsx)(bo.A,{pill:!0,bg:"secondary",className:"ms-2 align-middle",children:(null===(s=r.tags)||void 0===s?void 0:s.length)||0})]}),r.tags.length>0&&(0,N.jsx)(N.Fragment,{children:r.tags.map((e,s)=>{var i,o,d,c,h,u,m,g,p,x,v,f,j,_,b,A,y;return(0,N.jsxs)(Ce.S,{className:"mb-2",children:[(0,N.jsxs)(Ce.S,{className:"d-flex",children:[(0,N.jsx)(Ce.S,{className:"w-100",children:(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:(null===n||void 0===n||null===(i=n.tags)||void 0===i||null===(o=i[s])||void 0===o?void 0:o.name)&&(null===a||void 0===a||null===(d=a.tags)||void 0===d||null===(c=d[s])||void 0===c?void 0:c.name),isValid:(null===n||void 0===n||null===(h=n.tags)||void 0===h||null===(u=h[s])||void 0===u?void 0:u.name)&&!(null!==a&&void 0!==a&&null!==(m=a.tags)&&void 0!==m&&null!==(g=m[s])&&void 0!==g&&g.n
2ame),name:`tags.${s}.name`,onChange:t,placeholder:"Tag name",type:"text",value:null===(p=r.tags)||void 0===p||null===(x=p[s])||void 0===x?void 0:x.name})}),(0,N.jsx)(Ce.S,{children:(0,N.jsx)(ve.A,{disabled:!r.tags||(null===(v=r.tags)||void 0===v?void 0:v.length)<=1,variant:"link",onClick:()=>{let e=(0,T.clone)(r.tags);e.splice(s,1),l("tags",e)},children:(0,N.jsx)(ze.qbC,{})})})]}),(null===a||void 0===a||null===(f=a.tags)||void 0===f||null===(j=f[s])||void 0===j?void 0:j.name)&&(null===n||void 0===n||null===(_=n.tags)||void 0===_||null===(b=_[s])||void 0===b?void 0:b.name)&&(0,N.jsx)(_e.A.Control.Feedback,{className:"d-block",type:"invalid",children:null===a||void 0===a||null===(A=a.tags)||void 0===A||null===(y=A[s])||void 0===y?void 0:y.name})]},s)})})]}),(0,N.jsxs)(ve.A,{variant:"link",onClick:()=>{l("tags",r.tags.concat([{name:""}]))},children:[(0,N.jsx)(ze.OiG,{})," Add tag"]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:d,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});aK.displayName="TagSetCreator";var tK=aK;const iK=(0,l.forwardRef)((e,s)=>{const{onDelete:a}=e,[t,i,n]=(0,ne.CQ)({show:!1,tag_set:null}),{show:r,tag_set:o}=t,d=e=>{i({show:!0,tag_set:e})},c=()=>{n()};return(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>n,[]),(0,N.jsxs)(xe,{onHide:c,show:r,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:`Delete ${(null===o||void 0===o?void 0:o.name)||"tag set"}`,id:"client.src.pages.admin.components.tags.AdminTags.16543677"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{"function"===typeof a&&a(null===o||void 0===o?void 0:o.id),c()},initialValues:{name:""},validationSchema:ul.Ik().shape({name:ul.Yj().oneOf([null===o||void 0===o?void 0:o.name],"Please type the tag set name to confirm").required("A name must be provided")}),children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Deleting this tag set will remove all tags and pieces of content",id:"label.deleting_this_tag_set_will_remove.5843f2ac"})}),(0,N.jsxs)(Ce.S,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Please type {name} to confirm",id:"label.please_type_name_to_confirm.e74e246b",values:{name:(0,N.jsx)("b",{children:null===o||void 0===o?void 0:o.name})}})}),(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:l.name&&s.name,isValid:l.name&&!s.name,name:"name",onChange:a,placeholder:null===o||void 0===o?void 0:o.name,type:"text",value:n.name}),s.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!(null!==n&&void 0!==n&&n.name)||Object.keys(s).length,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Submit",id:"label.submit.155f816c"})})]})]})}})]})});iK.displayName="TagSetDeleter";var lK=iK;const nK=(0,l.forwardRef)((e,s)=>{const{onRename:a}=e,[t,i,n]=(0,ne.CQ)({show:!1,tag_set:null}),{show:r,tag_set:o}=t,d=e=>{i({show:!0,tag_set:e})},c=()=>{n()};return(0,l.useImperativeHandle)(s,()=>({hide:c,show:d})),(0,l.useEffect)(()=>n,[]),(0,N.jsxs)(xe,{onHide:c,show:r,children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Rename tag set",id:"label.rename_tag_set.dd8740d4"})})}),(0,N.jsx)(ds.l1,{onSubmit:async e=>{"function"===typeof a&&a(null===e||void 0===e?void 0:e.name,null===o||void 0===o?void 0:o.id),c()},initialValues:{name:(null===o||void 0===o?void 0:o.name)||""},validationSchema:ul.Ik().shape({name:ul.Yj().required("A name must be provided")}),children:e=>{let{errors:s,handleChange:a,handleSubmit:t,setFieldValue:i,touched:l,values:n}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,style:{minWidth:"100%"},children:[(0,N.jsx)(xe.Body,{children:(0,N.jsx)(Ce.S,{children:(0,N.jsxs)(os,{children:[(0,N.jsx)(_e.A.Control,{"aria-label":"text",className:"form-control",isInvalid:l.name&&s.name,isValid:l.name&&!s.name,name:"name",onChange:a,placeholder:null===o||void 0===o?void 0:o.name,type:"text",value:n.name}),s.name&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]})})}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{className:"ms-2 me-3",onClick:c,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Cancel",id:"label.cancel.19766ed6"})}),(0,N.jsx)(ve.A,{disabled:!(null!==n&&void 0!==n&&n.name)||Object.keys(s).length,type:"submit",children:(0,N.jsx)(ke.A,{defaultMessage:"Rename",id:"label.rename.3064d79a"})})]})]})}})]})});nK.displayName="TagSetRenamer";var rK=nK;const oK=l.createContext({}),dK=oK.Provider;oK.Consumer;var cK=e=>{const[s,a]=(0,ne.CQ)({error:null,loading:!0,subjects:[]}),t=(0,l.useRef)(),i=(0,l.useRef)(),{api:n}=(0,P.nm)(),r=(0,Pe.W6)(),{error:o,loading:d,subjects:c}=s,h=async()=>{a({error:null,loading:!0});try{let{subjects:e}=await n.get("/api/subjects/list");a({loading:!1,subjects:e})}catch({err:err}){a({error:err,loading:!1})}},u=async()=>{try{let e=window.prompt("Provide a name for the new subject");
2if(!e)return;let{subject:s}=await n.post("/api/subjects/create",{name:e});a({loading:!1}),await h(),await m(null===s||void 0===s?void 0:s.id)}catch({err:err}){a({error:err,loading:!1})}},m=async e=>{var s;null===t||void 0===t||null===(s=t.current)||void 0===s||s.show({subject_id:e})};return(0,l.useEffect)(()=>{h()},[]),(0,N.jsx)(dK,{value:{},children:(0,N.jsxs)(Ce.S,{className:"admin-subject-manager",children:[(0,N.jsx)(hK,{title:"Manage Subjects",onBack:()=>{r.push("/admin#library")},children:(0,N.jsxs)(Ue.A,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>{a({error:null})},show:o,variant:"danger",children:o}),d&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!d&&!o&&(0,N.jsxs)(N.Fragment,{children:[!(null!==c&&void 0!==c&&c.length)&&(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(Ce.S,{className:"text-center mt-5",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects",id:"label.no_subjects.e5fd0c5e"})}),(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"There are no subjects",id:"label.there_are_no_subjects.6b0322d9"})}),(0,N.jsxs)(ve.A,{onClick:u,children:[(0,N.jsx)(ze.OiG,{})," ",(0,N.jsx)(ke.A,{defaultMessage:"New subject",id:"label.new_subject.9c69910b"})]})]})}),!!c.length&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Qe.A,{children:(0,N.jsxs)(Ve.A,{xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center mb-2",children:[(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Subjects",id:"label.subjects.1a7529ab"})}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-2",children:[(0,N.jsx)(ve.A,{onClick:()=>{var e;null===i||void 0===i||null===(e=i.current)||void 0===e||e.show()},variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Sort",id:"label.sort.bec69036"})}),(0,N.jsxs)(ve.A,{onClick:u,children:[(0,N.jsx)(ze.OiG,{className:"me-1"})," ",(0,N.jsx)(ke.A,{defaultMessage:"New subject",id:"label.new_subject.9c69910b"})]})]})]}),(0,N.jsxs)(ho,{striped:!1,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})}),(0,N.jsx)(ho.Th,{children:(0,N.jsx)(ke.A,{defaultMessage:"Audience(s)",id:"label.audiences.eb86234e"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Topics",id:"label.topics.e22820fc"})}),(0,N.jsx)(ho.Th,{className:"text-center",children:(0,N.jsx)(ke.A,{defaultMessage:"Components",id:"label.components.a150ce22"})}),(0,N.jsx)(ho.Th,{className:"text-end",children:(0,N.jsx)(ke.A,{defaultMessage:"Action",id:"label.action.64cff131"})})]})}),(0,N.jsx)(ho.Tbody,{cols:3,loading:d,children:null!==c&&void 0!==c&&c.length?(0,N.jsx)(N.Fragment,{children:c.map((e,s)=>{const{id:t,audience_categories:i,component_count:l,name:r,topic_count:o}=e;return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Td,{children:(0,N.jsx)("b",{children:r})}),(0,N.jsx)(ho.Td,{children:!!i&&(0,N.jsxs)(N.Fragment,{children:[i.length>0&&(0,N.jsx)(N.Fragment,{children:i.map(e=>{let{categories:s}=e;return(0,N.jsx)("div",{children:(0,N.jsx)("small",{children:null===s||void 0===s?void 0:s.name})})})}),0==i.length&&(0,N.jsx)(N.Fragment,{children:"-"})]})}),(0,N.jsx)(ho.Td,{className:"text-center",children:o}),(0,N.jsx)(ho.Td,{className:"text-center",children:l}),(0,N.jsx)(ho.Td,{className:"text-end",children:(0,N.jsxs)("div",{className:"d-flex justify-content-end gap-2",children:[(0,N.jsx)(ve.A,{onClick:()=>{m(t)},size:"sm",variant:"outline-secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Edit",id:"label.edit.464c4ffd"})}),(0,N.jsx)(ve.A,{onClick:()=>{(async e=>{if(window.confirm("Are you sure you want to delete this subject? You cannot undo this action.")){a({error:null,loading:!0});try{await n.post(`/api/subjects/delete/${e}`),a({loading:!1}),await h()}catch({err:err}){a({error:err,loading:!1})}}})(t)},size:"sm",variant:"outline-danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Delete",id:"label.delete.e2d0a549"})})]})})]},s)})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-muted",colSpan:5,children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects found",id:"label.no_subjects_found.5a053ecb"})})})})]})]})})})]})]})}),(0,N.jsx)(mK,{onHide:h,ref:t}),(0,N.jsx)(pK,{onHide:h,ref:i})]})})};const hK=e=>{const{onBack:s,title:a}=e;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(Ce.S,{style:{alignItems:"center",background:"white",display:"flex",height:64,left:0,padding:25,position:"fixed",top:0,width:"100%",zIndex:3},children:[!!s&&(0,N.jsx)(Ce.S,{className:"me-3",children:(0,N.jsx)("a",{className:" text-secondary",href:"pages/admin/components/site/components/tabs/library/subjects/AdminSubjects#",onClick:e=>{e.preventDefault(),"function"===typeof s&&s()},children:(0,N.jsx)(ze.QVr,{})})}),(0,N.jsx)(Ce.S,{className:"h4 m-0",children:a||""})]}),(0,N.jsxs)(Ce.S,{style:{backgroundColor:"var(--gray-100)",minHeight:"100vh"},children:[(0,N.jsx)(Ce.S,{style:{height:89}}
2),e.children]})]})},uK=(0,l.forwardRef)((s,a)=>{var t;const[i,n,r]=(0,ne.CQ)({audience_categories:[],error:null,loading:!1,reject:Function(),resolve:Function(),show:!1,subject_id:null}),{audience_categories:o,error:d,loading:c,show:h,subject:u,subject_id:m}=i,{formatMessage:g}=(0,ja.A)(),{api:p,locale:x}=(0,P.nm)(),v=(0,l.useRef)(),f=(0,l.useRef)(),j=(0,l.useRef)(),_=(0,l.useRef)(),b=e=>new Promise(async(s,a)=>{n({loading:!0,show:!0});const t=(null===e||void 0===e?void 0:e.subject_id)||null,{subject:i}=await p.get(`/api/subjects/get/${t}`);if(!i)return n({error:"Unable to load subject"});await y(),n({error:null,loading:!1,reject:a,resolve:s,subject:i,subject_id:t})}),A=()=>{const{resolve:e}=i,{onHide:a}=s;"function"===typeof e&&e(null),r(),"function"===typeof a&&a()},y=async()=>{let{audience_categories:e}=await p.get("/api/subjects/audience-categories/list");n({audience_categories:e})},w=async()=>{try{const e=null===v||void 0===v?void 0:v.current,s=null===f||void 0===f?void 0:f.current;if(!e||!s)return;const{file:a}=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await e.setFieldValue("cover_path",null===a||void 0===a?void 0:a.location),await e.setFieldTouched("cover_path",!0)}catch(d){n({error:(null===d||void 0===d?void 0:d.err)||d})}},S=async()=>{try{const e=null===v||void 0===v?void 0:v.current,s=null===j||void 0===j?void 0:j.current;if(!e||!s)return;const{file:a}=await s.promptImageUpload()||{};if(null===a||void 0===a||!a.location)return;await e.setFieldValue("icon_path",null===a||void 0===a?void 0:a.location),await e.setFieldTouched("icon_path",!0)}catch(d){n({error:(null===d||void 0===d?void 0:d.err)||d})}},C=e=>{const s=null===_||void 0===_?void 0:_.current;s&&s.show({actions:[s.CancelAction(),s.Action({label:"Submit",onClick:()=>M(e),variant:"danger"})],body:g({id:"label.are_you_sure_you_want_to_remove_th.cca1f789",defaultMessage:"Are you sure you want to remove the {field} image?"},{field:e}),title:g({id:"label.remove_image.da7acac1",defaultMessage:"Remove image"})})},M=async e=>{const s=null===v||void 0===v?void 0:v.current;await s.setFieldValue(`${e}_path`,""),await s.setFieldTouched(`${e}_path`,!0)};(0,l.useImperativeHandle)(a,()=>({show:b})),(0,l.useEffect)(()=>r,[]);const k=!m;return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(xe,{dialogClassName:"subject-editor-modal",onHide:A,show:h,size:"md",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:k?"Create subject":"Edit subject"})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>n({error:null}),show:d,variant:"danger",children:d}),c&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!c&&(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(ds.l1,{enableReinitialize:!0,onSubmit:async s=>{n({loading:!0});try{await p.post(`/api/subjects/update/${i.subject_id}`,s),A()}catch(e){n({error:e,loading:!1})}},role:"search",validationSchema:(0,Re.by)({locale:x,scope:"subjects.edit"}),initialValues:{audience_category_ids:(null===u||void 0===u||null===(t=u.audience_categories)||void 0===t?void 0:t.map(e=>e.audience_category_id))||[],cover_path:(null===u||void 0===u?void 0:u.cover_path)||"",icon_path:(null===u||void 0===u?void 0:u.icon_path)||"",name:(null===u||void 0===u?void 0:u.name)||"",slug:(null===u||void 0===u?void 0:u.slug)||""},children:e=>{v.current=e;const{errors:s,handleChange:a,handleSubmit:t,setFieldTouched:i,setFieldValue:l,touched:n,values:r}=e;return(0,N.jsxs)(_e.A,{onSubmit:t,children:[(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})})}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,"aria-label":"name",className:"form-control",isInvalid:(null===n||void 0===n?void 0:n.name)&&(null===s||void 0===s?void 0:s.name),isValid:(null===n||void 0===n?void 0:n.name)&&!(null!==s&&void 0!==s&&s.name),name:"name",onChange:a,placeholder:"Earth science",type:"text",value:r.name}),(null===s||void 0===s?void 0:s.name)&&(null===n||void 0===n?void 0:n.name)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.name})]}),(0,N.jsxs)(_e.A.Group,{children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Slug",id:"label.slug.d15387ec"})})}),(0,N.jsx)(_e.A.Control,{autoFocus:!0,"aria-label":"slug",className:"form-control",isInvalid:(null===n||void 0===n?void 0:n.slug)&&(null===s||void 0===s?void 0:s.slug),isValid:(null===n||void 0===n?void 0:n.slug)&&!(null!==s&&void 0!==s&&s.slug),name:"slug",onChange:a,placeholder:"earth-science",type:"text",value:r.slug}),(null===s||void 0===s?void 0:s.slug)&&(null===n||void 0===n?void 0:n.slug)&&(0,N.jsx)(_e.A.Control.Feedback,{type:"invalid",children:s.slug})]}),(0,N.jsx)(ds.D0,{name:"icon_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview mt-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Icon",i
2d:"label.icon.a35abcd6"})})}),null!==r&&void 0!==r&&r.icon_path?(0,N.jsx)(Me.R_,{alt:"",height:50,rounded:!0,src:null===r||void 0===r?void 0:r.icon_path,width:50}):(0,N.jsx)(Ce.S,{className:"cover-image-overlay",children:(0,N.jsx)(Me.R_,{alt:"",height:50,rounded:!0,src:pc,width:50})}),(0,N.jsx)(Ce.S,{className:"mt-2",children:(0,N.jsx)(hG,{handleRemove:()=>C("icon"),handleUpload:S})})]})}),(0,N.jsx)(ds.D0,{name:"cover_path",children:()=>(0,N.jsxs)(Ce.S,{className:"media-preview mt-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Cover image",id:"label.cover_image.b62cee93"})})}),null!==r&&void 0!==r&&r.cover_path?(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:null===r||void 0===r?void 0:r.cover_path,width:300}):(0,N.jsx)(Ce.S,{className:"cover-image-overlay",children:(0,N.jsx)(Me.R_,{alt:"",height:200,rounded:!0,src:pc,width:300})}),(0,N.jsx)(Ce.S,{className:"mt-2",children:(0,N.jsx)(hG,{handleRemove:()=>C("cover"),handleUpload:w})})]})}),(0,N.jsx)(ds.D0,{name:"audience_category_ids",children:()=>(0,N.jsxs)(Ce.S,{className:"mt-3",children:[(0,N.jsx)(_e.A.Label,{children:(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Audience categories",id:"label.audience_categories.42627"})})}),o.map(e=>{let{id:s,name:a}=e;const t=-1!==(null===r||void 0===r?void 0:r.audience_category_ids.indexOf(s));return(0,N.jsx)(Ce.S,{className:"d-flex",children:(0,N.jsx)(_e.A.Check,{checked:t,className:"me-2",id:`audience_categories-${s}`,label:a,name:"audience_categories",type:"checkbox",onChange:()=>{l("audience_category_ids",t?null===r||void 0===r?void 0:r.audience_category_ids.filter(e=>e!=s):[...r.audience_category_ids,s]),i("audience_category_ids")}})},s)})]})})]})}})})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:c,onClick:A,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:c,onClick:(e,s)=>{var a;return null===v||void 0===v||null===(a=v.current)||void 0===a?void 0:a.handleSubmit(e,s)},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]})]}),(0,N.jsx)(je,{ref:_}),(0,N.jsx)(TA,{aspectRatio:1.5,ref:f,uploadHandler:(e,s)=>{const a=`subject-${m}-cover-image.jpg`;return p.file("/api/subjects/upload",{job_id:s,subject_id:m},e,a)}}),(0,N.jsx)(TA,{aspectRatio:1,croppable:!1,ref:j,uploadHandler:(e,s)=>{const a=`subject-${m}-icon-image.jpg`;return p.file("/api/subjects/upload",{job_id:s,subject_id:m},e,a)}})]})});uK.displayName="SubjectEditor";var mK=uK;const gK=(0,l.forwardRef)((e,s)=>{const[a,t,i]=(0,ne.CQ)({error:null,loading:!0,show:!1,subjects:[]}),{api:n}=(0,P.nm)(),{error:r,loading:o,show:d,subjects:c}=a,h=async e=>{t({show:!0}),await(async()=>{t({error:null,loading:!0});try{let{subjects:e}=await n.get("/api/subjects/list",{filter_audience_category_slug:"k-12"});e=e.sort((e,s)=>(null===e||void 0===e?void 0:e.position)>(null===s||void 0===s?void 0:s.position)?1:-1),t({loading:!1,subjects:e})}catch({err:err}){t({error:err,loading:!1})}})()},u=()=>{const{resolve:s}=a,{onHide:t}=e;"function"===typeof s&&s(null),i(),"function"===typeof t&&t()};return(0,l.useImperativeHandle)(s,()=>({show:h})),(0,N.jsx)(N.Fragment,{children:(0,N.jsxs)(xe,{dialogClassName:"subject-sorter-modal",onHide:u,show:d,size:"md",children:[(0,N.jsx)(xe.Header,{closeButton:!0,children:(0,N.jsx)(xe.Title,{children:(0,N.jsx)(ke.A,{defaultMessage:"Sort subjects",id:"label.sort_subjects.2cfc011f"})})}),(0,N.jsxs)(xe.Body,{children:[(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>t({error:null}),show:r,variant:"danger",children:r}),o&&(0,N.jsx)(Ce.S,{className:"text-center",children:(0,N.jsx)(Me.y$,{})}),!o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{children:(0,N.jsx)(ke.A,{defaultMessage:"Sort the subjects order on the K-12 marketplace",id:"label.sort_the_subjects_order_on_the_k_1.3fc46d4c"})}),(0,N.jsxs)(ho,{striped:!0,children:[(0,N.jsx)(ho.Thead,{children:(0,N.jsxs)(ho.Tr,{children:[(0,N.jsx)(ho.Th,{}),(0,N.jsx)(ho.Th,{name:"fullname",children:(0,N.jsx)(ke.A,{defaultMessage:"Name",id:"label.name.dcd1d522"})})]})}),(0,N.jsx)(ho.Tbody,{cols:2,loading:o,children:null!==c&&void 0!==c&&c.length?(0,N.jsx)(N.Fragment,{children:c.map((e,s)=>{const a=0==s,i=s+1==(null===c||void 0===c?void 0:c.length);return(0,N.jsxs)(ho.Tr,{children:[(0,N.jsxs)(ho.Td,{children:[a?(0,N.jsx)(ze.UCm,{className:"text-muted me-1"}):(0,N.jsx)("a",{className:"me-1",href:"#",onClick:()=>{return e=s,void t(s=>{let a=null===s||void 0===s?void 0:s.subjects[e];return s.subjects[e]=null===s||void 0===s?void 0:s.subjects[e-1],s.subjects[e-1]=a,s});var e},children:(0,N.jsx)(ze.UCm,{})}),i?(0,N.jsx)(ze.z44,{className:"text-muted"}):(0,N.jsx)("a",{href:"#",onClick:()=>{return e=s,void t(s=>{let a=null===s||void 0===s?void 0:s.subjects[e];return s.subjects[e]=null===s||void 0===s?void 0:s.subjects[e+1],s.subjects[e+1]=a,s});var e},children:(0,N.jsx)(ze.z44,{})})]}),(0,N.jsxs)(ho.Td,{children:[s+1,") ",null===e||void 0===e?void 0:e.name]})]})})}):(0,N.jsx)(ho.Tr,{children:(0,N.jsx)(ho.Td,{className:"text-center text-muted",colSpan:2,children:(0,N.jsx)(ke.A,{defaultMessage:"No subjects found",id:"label.no_subjects_found.5a053ecb"})})})})]})]})]}),(0,N.jsxs)(xe.Footer,{children:[(0,N.jsx)(ve.A,{disabled:o,onClick:u,variant:"secondary",children:(0,N.jsx)(ke.A,{defaultMessage:"Close",id:"label.close.7d9eb7ac"})}),(0,N.jsx)(ve.A,{disabled:o||!(null!==c&&void 0!==c&&c.length),onClick:async()=>{t({error:null,loading:!0});try{await n.post("/api/subjects/order",{subject_ids:c.map((e,s)=>null===e||void 0===e?void 0:e.id)}),u()}catch({err:err}){t({error:err,loading:!1})}},variant:"primary",children:(0,N.jsx)(ke.A,{defaultMessage:"Save",id:"label.save.1509f561"})})]})]})})});gK.displayName="SubjectSorter";var pK=gK;var xK=s=>{var a;const{api:t,userCanArbitrate:i}=(0,P.nm)(),{formatMessage:n}=(0,ja.A)(),r=(0,l.useRef)(),o=null!==(a=null===i||void 0===i?void 0:i())&&void 0!==a&&a,[d,c,h]=(0,ne.CQ)({certification_request:null,certification_request_id:s.match.params.certification_request_id||null,error:null,loading:!1,member_engagement:null,supporting_data:null}),{certification_request:u,certification_request_id:m,error:g,loading:p,supporting_data:x,team_evaluation:v}=d,{certification_template:f,challenge_member:j,status:_,user:b}=u||{},{member_evaluation:A}=j||{},{challenge:y,challenge_id:w}=j||{},{group_assignment_component:S}=y||{},{id:C,assignment:M,group_assignment_id:k}=S||{},{group_id:z}=M||{},T=(0,ds.Wx)({initialValues:{notes:""}}),I=async()=>{await(async()=>{try{c({loading:!0});const{certification_request:e}=await t.get(`/api/certifications/request/${m}`);c({certification_request:e,loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}})(),await(async()=>{try{const{certification_request:{challenge_member_id:e}}=d;c({loading:!0});const{data:s,member_evaluation:a,team_evaluation:i}=await t.get("/api/certifications/get/report-data",{challenge_member_id:e});c({loading:!1,member_evaluation:a,supporting_data:s,team_evaluation:i})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}})()},E=async s=>{let{notes:a,status:i}=s;try{c({loading:!0}),await t.post("/api/certifications/request/set-status",{certification_request_id:m,notes:a,status:i}),await I(),c({loading:!1})}catch(e){const a=(null===e||void 0===e?void 0:e.err)||(null===e||void 0===e?void 0:e.message)||e;c({error:a,loading:!1})}},R=()=>{var e;const s=null===r||void 0===r?void 0:r.current;if(!s)return;const a=null===T||void 0===T||null===(e=T.values)||void 0===e?void 0:e.notes;s.show({actions:[s.CancelAction(),s.Action({label:"Approve",onClick:()=>E({notes:a,status:"approved"}),variant:"primary"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"You are about to approve the requested certification ({title}) for {fullname}.",id:"label.you_are_about_to_approve_the_reque.847de91e",values:{fullname:(0,N.jsx)("strong",{children:null===b||void 0===b?void 0:b.fullname}),title:(0,N.jsx)("strong",{children:null===f||void 0===f?void 0:f.title})}})}),(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Please ensure the following are true:",id:"label.please_ensure_the_following_are_tr.65e18484"})})]}),(0,N.jsxs)("ul",{className:"text-warning fw-semibold",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"You have fully reviewed all reports",id:"label.you_have_fully_reviewed_all_report.253fbdd0"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"You have compared report against challenge data for accuracy",id:"label.you_have_compared_report_against_c.aee4398f"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"You agree that a certification IS deserved.",id:"label.you_agree_that_a_certification_is.330a2f49"})})]})]}),size:"sm",title:n({id:"label.approve_certification.dfa817f1",defaultMessage:"Approve certification"})})},D=()=>{var e;const s=null===r||void 0===r?void 0:r.current;if(!s)return;const a=null===T||void 0===T||null===(e=T.values)||void 0===e?void 0:e.notes;s.show({actions:[s.CancelAction(),s.Action({label:"Deny",onClick:()=>E({notes:a,status:"denied"}),variant:"danger"})],body:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)("p",{children:[(0,N.jsx)("span",{children:(0,N.jsx)(ke.A,{defaultMessage:"You are about to deny the requested certification ({title}) for {fullname}.",id:"label.you_are_about_to_deny_the_requeste.356a05f9",values:{fullname:(0,N.jsx)("strong",{children:null===b||void 0===b?void 0:b.fullname}),title:(0,N.jsx)("strong",{children:null===f||void 0===f?void 0:f.title})}})}),(0,N.jsx)("br",{}),(0,N.jsx)("br",{}),(0,N.jsx)("strong",{className:"text-warning",children:(0,N.jsx)(ke.A,{defaultMessage:"Please ensure the following are true:",id:"label.please_ensure_the_following_are_tr.65e18484"})})]}),(0,N.jsxs)("ul",{className:"text-warning fw-semibold",children:[(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"You have fully reviewed all reports",id:"label.you_have_fully_reviewed_all_report.253fbdd0"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"You have compared report against challenge data for accuracy",id:"label.you_have_compared_report_against_c.aee4398f"})}),(0,N.jsx)("li",{children:(0,N.jsx)(ke.A,{defaultMessage:"You agree that a certification IS NOT deserved.",id:"label.you_agree_that_a_certification_is.a89aaf8e"})})]})]}),size:"sm",title:n({id:"label.deny_certification.8ff60287",defaultMessage:"Deny certification"})})};(0,l.useEffect)(()=>{I()},[m]),(0,l.useEffect)(()=>{null!==u&&void 0!==u&&u.notes&&T.setFieldValue("notes",u.notes)},[u]);const B={certification_request:u,error:g,formik:T,handleApproveCertification:R,handleDenyCertification:D,loading:p,member_evaluation:A,supporting_data:x,team_evaluation:v};return(0,N.jsxs)(fK,{value:(0,F.A)({},B),children:[(0,N.jsx)(yT,{children:(0,N.jsx)(Ny,{offsetBottom:25,children:(0,N.jsx)(Ue.A,{className:"d-flex flex-column gap-3 pb-5",children:(0,N.jsxs)(Me.x_,{loading:p,children:[(0,N.jsxs)(vF.A,{children:[(0,N.jsx)(pa.mu,{to:"/home",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Home",id:"label.home.3a786953"})})}),(0,N.jsx)(pa.mu,{to:"/admin#certifications",children:(0,N.jsx)(vF.A.Item,{children:(0,N.jsx)(ke.A,{defaultMessage:"Certifications",id:"label.certifications.471502f8"})})}),(0,N.jsx)(vF.A.Item,{active:!0,children:(0,N.jsx)(ke.A,{defaultMessage:"Arbitrate request",id:"label.arbitrate_request.cb23825e"})})]}),(0,N.jsx)("h3",{children:(0,N.jsx)(ke.A,{defaultMessage:"Certification arbitration",id:"label.certification_arbitration.e704bfea"})}),(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>c({error:null}),show:g,variant:"danger",children:g}),(0,N.jsxs)(Qe.A,{className:"m-0 gy-3",children:[(0,N.jsx)(Ve.A,{className:"top-column",xs:12,children:(0,N.jsx)(_K,{})}),(0,N.jsx)(Ve.A,{className:"left-column",xl:8,xs:12,children:(0,N.jsxs)(Ce.S,{className:"ai-assessment d-flex flex-column gap-3",children:[(0,N.jsxs)("h4",{className:"m-0 d-flex align-items-center gap-1",children:[(0,N.jsx)(ke.A,{defaultMessage:"AI Assessment",id:"label.ai_assessment.2955a028"}),(0,N.jsx)("small",{children:(0,N.jsx)(Od,{tooltipRender:(0,N.jsx)("span",{className:"text-start",children:(0,N.jsx)(ke.A,{defaultMessage:"The following report was generated by a Large Language Model, based on a comprehensive snapshot of the learner's interactions thorughout the challenge.",id:"label.the_following_report_was_generated.8353c3eb"})})})})]}),(0,N.jsx)(eu,{certification_request:u,member_evaluation:A,team_evaluation:v})]})}),(0,N.jsx)(Ve.A,{className:"right-column d-flex flex-column gap-3",xl:4,xs:12,children:(0,N.jsxs)(Qe.A,{className:"gy-3 gy-md-0 gy-xl-3 justify-content-between d-flex flex-column flex-fill",children:[(0,N.jsx)(Ve.A,{md:6,xl:12,xs:12,children:(0,N.jsxs)(Ce.S,{className:"statistics d-flex flex-column gap-3",children:[(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-between align-items-center",children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Supporting data",id:"label.supporting_data.239e5e82"})}),(0,N.jsx)(ve.A,{as:Le.Link,className:"p-0",target:"_blank",to:`/admin/group/${z}/assignment/${k}/challenge/${C}/view/${w}`,variant:"link",children:(0,N.jsx)(ke.A,{defaultMessage:"View assignment",id:"label.view_assignment.44574a1d"})})]}),(0,N.jsx)(tu,{supporting_data:x})]})}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column gap-3",md:6,xl:12,xs:12,children:[(0,N.jsx)(bK,{}),"pending"===_&&o&&(0,N.jsxs)(Ce.S,{className:"d-flex justify-content-end gap-1",children:[(0,N.jsx)(ve.A,{onClick:D,variant:"danger",children:(0,N.jsx)(ke.A,{defaultMessage:"Deny",i
2d:"label.deny.05a2d733"})}),(0,N.jsx)(ve.A,{className:"text-white",onClick:R,variant:"success",children:(0,N.jsx)(ke.A,{defaultMessage:"Approve",id:"label.approve.6007acbe"})})]}),"pending"===_&&!o&&(0,N.jsx)(Ce.S,{className:"d-flex justify-content-end",children:(0,N.jsx)("small",{className:"text-muted",children:(0,N.jsx)(ke.A,{defaultMessage:"View only \u2014 a Solvably administrator will approve or deny this request.",id:"label.view_only_a_solvably_administrator.c97c2d32"})})})]})]})})]})]})})})}),(0,N.jsx)(je,{ref:r,size:"lg"})]})};const vK=l.createContext({}),fK=vK.Provider;vK.Consumer;vK.displayName="CertificateArbitrationContext";const jK=()=>(0,l.useContext)(vK);var _K=e=>{const{certification_request:s}=jK(),{challenge_member:a,created_at:t,status:i,user:l}=s||{},{challenge:n,team_member:r}=a||{},{challenge_template:o}=n||{},{team:d}=r||{},c="approved"===i?"success":"denied"===i?"danger":"secondary";return(0,N.jsx)(Ge.A,{className:"request-metadata",children:(0,N.jsxs)(Ge.A.Body,{as:Qe.A,children:[(0,N.jsxs)(Ve.A,{className:"d-flex flex-column",md:7,xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-2 align-items-center learner mb-3",children:[(0,N.jsx)(Ya,{showOnline:!1,showTooltip:!1,size:32,user:l}),(0,N.jsx)("h4",{className:"m-0",children:null===l||void 0===l?void 0:l.fullname})]}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-1",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Challenge:",id:"label.challenge.0766f570"})}),(0,N.jsx)("span",{children:null===o||void 0===o?void 0:o.title})]}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-1",children:[(0,N.jsx)("strong",{children:(0,N.jsx)(ke.A,{defaultMessage:"Team:",id:"label.team.47355f46"})}),(0,N.jsx)("span",{children:null===d||void 0===d?void 0:d.name})]})]}),(0,N.jsxs)(Ve.A,{className:"d-flex flex-column align-items-md-end justify-content-md-end",md:5,xs:12,children:[(0,N.jsxs)(Ce.S,{className:"d-flex gap-1 date",children:[(0,N.jsx)("strong",{children:"Date requested:"}),(0,N.jsx)("span",{children:ci()(t).format("MMM DD, YYYY")})]}),(0,N.jsxs)(Ce.S,{className:"d-flex gap-1 status",children:[(0,N.jsx)("strong",{children:"Request status:"}),(0,N.jsx)("span",{className:`text-uppercase fw-bold text-${c}`,children:i})]})]})]})})};var bK=e=>{const{certification_request:s,formik:a}=jK(),{status:t}=s||{},i="pending"!==t,{handleChange:l}=a;return(0,N.jsxs)(_e.A,{className:"d-flex flex-column gap-2",onSubmit:e=>e.preventDefault(),children:[(0,N.jsx)("h4",{className:"m-0",children:(0,N.jsx)(ke.A,{defaultMessage:"Arbitrator notes",id:"label.arbitrator_notes.38e917bb"})}),(0,N.jsx)(_e.A.Control,{as:"textarea",disabled:i,name:"notes",onChange:l,readOnly:i,rows:10,style:{resize:"none"},value:a.values.notes})]})};var AK=t(80916);var yK=e=>(0,N.jsx)(Ue.A,{className:"error-fallback mt-5 mt-md-0 vh-100",role:"alert",children:(0,N.jsxs)(Qe.A,{children:[(0,N.jsxs)(Ve.A,{className:"error-details-container",xs:{order:0,span:8},children:[(0,N.jsx)("p",{className:"h2 error-heading",children:"404 Not Found"}),(0,N.jsx)("p",{className:"error-message lead",children:"Oops! We Couldn't Locate that Page"}),(0,N.jsx)("a",{href:"/",children:(0,N.jsxs)(ve.A,{className:"my-2",children:[(0,N.jsx)(ze.rQ8,{})," Home"]})})]}),(0,N.jsx)(Ve.A,{className:"justify-content-center d-flex flex-column",xs:{order:1,span:4},children:(0,N.jsx)(Zs.A,{alt:"error icon",className:"error-icon",src:AK.A})})]})});var wK=e=>{var s,a;const{journey_template_id:t}=(0,Pe.g)(),i=(0,Pe.W6)(),{api:n}=(0,P.nm)(),[r,o]=(0,ne.CQ)({error:null,group_assignment_components:null,group_assignment_template:null,loading:!0});(0,l.useEffect)(()=>{(async()=>{o({loading:!0});try{const{group_assignment_template:e}=await n.get("/api/group-assignment-templates/get/"+t);o({group_assignment_components:e.group_assignment_template_components,group_assignment_template:e,loading:!1})}catch({err:err}){o({error:err,loading:!1})}})()},[]);const d=e=>{if(null!=(null===e||void 0===e?void 0:e.challenge_template))return"challenge"},{error:c,group_assignment_components:h,group_assignment_template:u,loading:m}=r,{author_avatar_path:g="",author_biography:p=null,author_name:x,banner_path:v="",description:f="",learning_objective:j="",title:_="",total_est_completion_time:b=null}=u||{},A=!(j&&(0,ad.G9)(j).length>0);return(0,N.jsxs)("div",{className:"admin-journey-template-preview",children:[c&&(0,N.jsx)(We.A,{dismissible:!0,onClose:()=>o({error:null}),show:c,variant:"danger",children:c}),m&&(0,N.jsx)(Me.y$,{}),!m&&(0,N.jsxs)("div",{className:"admin-journey-template-container",children:[(0,N.jsx)("div",{className:"previewing-journey",children:"Previewing Journey"}),(0,N.jsx)("div",{className:"banner-image",style:{backgroundImage:`url(${v||og})`},children:(0,N.jsx)(ve.A,{className:"back-btn hide-ultrawide",onClick:()=>i.push(`/admin/content-authoring/journey/${u.group_assignment_template_stub_id}/${u.id}`),variant:"secondary",children:(0,N.jsx)(ze.QVr,{})})}),(0,N.jsxs)("div",{className:"journey-container",children:[(0,N.jsxs)(Ge.A,{className:"d-flex align-items-center justify-content-center banner-container",children:[(0,N.jsx)("div",{className:"banner-top-badge text-capitalize",children:(0,N.jsx)(bo.A,{pill:!0,bg:"gray-no-border",children:"Journey"})}),(0,N.jsx)("h1",{children:_}),(0,N.jsx)("div",{className:"d-flex flex-column",children:(0,N.jsx)(Rl,{lg:2,maxWidth:680,triggerPosition:"right",xs:3,children:f||(0,N.jsx)("span",{className:"body-small",children:"Journey description missing"})})}),(0,N.jsx)("div",{className:"journey-call-to-action",children:(0,N.jsx)(ve.A,{disabled:!0,onClick:()=>{},children:(0,N.jsx)(ug,{completion_pct:0})})}),(0,N.jsx)("div",{className:"journey-duration small d-flex align-items-center",children:(0,N.jsxs)(N.Fragment,{children:[" ",0!=b&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ze.w_X,{className:"me-1"}),(0,N.jsx)(Vh,{duration:b,unit:"minutes"})]})]})})]}),(0,N.jsx)(ve.A,{className:"back-btn d-none display-ultrawide",onClick:()=>i.push(`/admin/content-authoring/journey/${u.group_assignment_template_stub_id}/${u.id}`),variant:"secondary",children:(0,N.jsx)(ze.QVr,{})})]}),(0,N.jsx)("div",{className:"d-xl-none",children:(0,N.jsxs)(ld.A.Container,{defaultActiveKey:"module",id:"journey-overview-tabs",mountOnEnter:!0,role:"navigation",children:[(0,N.jsxs)(aa.A,{className:"flex-row tabs-primary overview-tabs-wrapper",variant:"pills",children:[(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"module",href:"#module",children:(0,N.jsx)(ke.A,{defaultMessage:"Modules",description:"",id:"label.modules.76c86c4c"})})}),(0,N.jsx)(aa.A.Item,{children:(0,N.jsx)(aa.A.Link,{eventKey:"about",href:"#about",children:(0,N.jsx)(ke.A,{defaultMessage:"About",description:"",id:"label.about.4efca0d1"})})})]}),(0,N.jsxs)(ld.A.Content,{children:[(0,N.jsx)(ld.A.Pane,{eventKey:"module",title:"Modules",children:(0,N.jsx)(Ge.A,{className:"learning-module-container gray-bg border-start-0 border-end-0",children:(0,N.jsxs)("section",{children:[(0,N.jsx)("h5",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",description:"",id:"label.learning_modules.6e1d2fad"})}),(0,N.jsxs)("div",{className:"module-list",children:[h.map(e=>(0,N.jsx)(hg,{group_assignment_component:e,type:d(e)},e.id)),0===h.length&&(0,N.jsx)("div",{className:"d-flex justify-content-center align-items-center body-small p-4",style:{background:"var(--white)",border:"1px solid rgba(0,0,0,0.12)"},children:"No modules have been added to this journey yet"})]})]})})}),(0,N.jsx)(ld.A.Pane,{eventKey:"about",title:"About",children:(0,N.jsxs)(Ge.A,{className:"about-container border-start-0 border-end-0",children:[!A&&(0,N.jsxs)("section",{className:"objective-section mb-4",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objectives",id:"label.learning_objectives.d38eb0fc"})}),(0,N.jsx)("div",{className:"objective-list body-medium",dangerouslySetInnerHTML:{__html:j}})]}),(0,N.jsxs)("section",{className:"author-section",children:[(0,N.jsx)("h6",{className:"mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"About the author",description:"",id:"label.about_the_author.708041b4"})}),(0,N.jsxs)("div",{className:"author-about",children:[(0,N.jsx)("div",{children:(0,N.jsx)(Zs.A,{roundedCircle:!0,src:g||Ga}
2)}),(0,N.jsx)("h6",{className:"mb-0",children:x||"Solvably"})]}),(0,N.jsx)("div",{className:"description",children:u.author_biography})]})]})})]})]})}),(0,N.jsx)("div",{className:"left-content-container d-none d-xl-block",children:(0,N.jsx)(Ge.A,{className:"learning-module-container",children:(0,N.jsxs)("section",{children:[(0,N.jsx)("h5",{className:"ms-3 mb-4",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning modules",description:"",id:"label.learning_modules.6e1d2fad"})}),(0,N.jsxs)("div",{className:"module-list",children:[h.map(e=>(0,N.jsx)(hg,{group_assignment_component:e,type:d(e)},e.id)),0===h.length&&(0,N.jsx)("div",{className:"d-flex justify-content-center align-items-center body-small p-4",style:{border:"1px solid rgba(0,0,0,0.12)"},children:"No modules have been added to this journey yet"})]})]})})}),(0,N.jsx)("div",{className:"right-content-container d-none d-xl-block",children:(0,N.jsxs)(Ge.A,{className:"about-container",children:[!A&&(0,N.jsxs)("section",{className:"objective-section mb-4",children:[(0,N.jsx)("h6",{className:"mb-2",children:(0,N.jsx)(ke.A,{defaultMessage:"Learning objectives",id:"label.learning_objectives.d38eb0fc"})}),(null!==(s=null===u||void 0===u||null===(a=u.learning_objective)||void 0===a?void 0:a.length)&&void 0!==s?s:0)<=0?(0,N.jsx)("div",{className:"mb-3 body-small",children:(0,N.jsx)(ke.A,{defaultMessage:"No learning objectives available",id:"label.no_learning_objectives_available.d27916eb"})}):(0,N.jsx)("div",{className:"objective-list body-medium mb-2",dangerouslySetInnerHTML:{__html:j}})]}),(0,N.jsxs)("section",{className:"author-section",children:[(0,N.jsx)("h6",{className:"mb-3",children:(0,N.jsx)(ke.A,{defaultMessage:"About the author",description:"",id:"label.about_the_author.708041b4"})}),(0,N.jsxs)("div",{className:"author-about",children:[(0,N.jsx)("div",{children:(0,N.jsx)(Zs.A,{roundedCircle:!0,src:g||Ga})}),(0,N.jsx)("h6",{className:"mb-0",children:x||"Solvably"})]}),(0,N.jsx)("div",{className:"description",children:u.author_biography})]})]})})]})]})};const NK=()=>(0,N.jsx)(Pe.rd,{to:"/home"}),SK=()=>(0,N.jsx)(Pe.rd,{to:"/reset/"});class CK extends l.Component{constructor(){super(...arguments),this.getPortalSlug=()=>{const{app:e}=this.props,s=document.location.host,a=null===e||void 0===e?void 0:e.siteUrl;if(!s||!a||-1!==s.indexOf("localhost")||-1===s.indexOf(a)||s===a)return null;return s.split(".")[0]||null},this.getHomeComponent=()=>{const{app:e}=this.props,{getUserOrganizationId:s,getUserOrganizationMembership:a,isLoggedIn:t,user:i,userHasSiteRole:l}=e,n=this.getPortalSlug();if(!t&&n&&kw[n])return e=>(0,N.jsx)(Tw,(0,F.A)({slug:n},e));if(!t)return Mw;if(t&&!(null===i||void 0===i||!i.force_password_change))return SK;if(l()&&!s())return nP;if(s()){let e=a();return null!==e&&void 0!==e&&e.role?nP:Iw}return Cy}}render(){var e;const{app:s,routerRef:a}=this.props,t=(null===s||void 0===s?void 0:s.isLoggedIn)&&!(null!==s&&void 0!==s&&null!==(e=s.user)&&void 0!==e&&e.force_password_change),i=this.getHomeComponent(),l=s.userIsAdmin();s.userIsSiteAdmin();return(0,N.jsx)(Le.BrowserRouter,{ref:a,children:(0,N.jsxs)(Ce.S,{id:"root_router",children:[(0,N.jsx)(He,{}),(0,N.jsxs)(Pe.dO,{children:[(0,N.jsx)(Ze,{exact:!0,component:this.getPortalSlug()&&kw[this.getPortalSlug()]?i:NK,path:"/"}),(0,N.jsx)(Ze,{exact:!0,component:i,path:"/home"}),(0,N.jsx)(Ze,{exact:!0,component:Ss,path:"/authenticate"}),(0,N.jsx)(Ze,{exact:!0,component:Ms,path:"/authenticate/callback"}),(0,N.jsx)(Ze,{exact:!0,component:Cs,path:"/authenticate/redirect"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?nP:NK,path:"/admin"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?jF:NK,path:"/admin/organization/:organization_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?PP:NK,path:"/admin/group/:group_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?aT:NK,path:"/admin/groups/:organization_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?aL:NK,path:"/admin/group/:group_id/assignment/:group_assignment_id/:group_assignment_component_id?"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?MH:NK,path:"/admin/group/:group_id/assignment/:assignment_id/challenge/:assignment_component_id/view/:challenge_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?$H:NK,path:"/admin/group/:group_id/assignment/:assignment_id/challenge/:assignment_component_id/grade/:challenge_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?XU:NK,path:"/admin/content-authoring/:type/:stub_id/:template_id/:step?"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?aU:NK,path:"/admin/cartridge-template/:stub_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?nR:NK,path:"/admin/challenge-template/:stub_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?yU:NK,path:"/admin/certification-template/:stub_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?xK:NK,path:"/admin/certification-request/:certification_request_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?SU:NK,path:"/admin/agent-template/:stub_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?uU:NK,path:"/admin/journey-template/:stub_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?wK:NK,path:"/admin/journey-template/preview/:journey_template_id"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn?Ty:NK,path:"/admin/challenge-template/preview/:ch
2allenge_template/:phase?/:subphase?"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?FU:NK,path:"/admin/challenge-templates"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?VW:NK,path:"/admin/tags/:organization_id?/:tag_set_id?/:tag_id?"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?cK:NK,path:"/admin/subjects"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn&&l?BU:NK,path:"/admin/content"}),(0,N.jsx)(Ze,{exact:!0,component:Us,path:"/scorm"}),(0,N.jsx)(Ze,{exact:!0,component:Rs,path:"/scorm-player/:cartridge_id"}),(0,N.jsx)(Ze,{exact:!0,component:Vs,path:"/ltilaunch/:token"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn?Iw:NK,path:"/class/:group"}),(0,N.jsx)(Ze,{exact:!0,component:t?Qy:NK,path:"/profile/"}),(0,N.jsx)(Ze,{component:s.isLoggedIn?NK:Sy,path:"/register/"}),(0,N.jsx)(Ze,{component:Gs,path:"/logout/"}),(0,N.jsx)(Ze,{component:Vy,path:"/forgot/"}),(0,N.jsx)(Ze,{component:Gy,path:"/reset/"}),(0,N.jsx)(Ze,{component:Wy,path:"/verify/:token"}),(0,N.jsx)(Ze,{exact:!0,component:Xy,path:"/code/"}),(0,N.jsx)(Ze,{exact:!0,component:$y,path:"/privacy/"}),(0,N.jsx)(Ze,{exact:!0,component:Zy,path:"/terms/"}),(0,N.jsx)(Ze,{exact:!0,component:lw,path:"/support"}),(0,N.jsx)(Ze,{exact:!0,component:nw,path:"/howitworks/"}),(0,N.jsx)(Ze,{exact:!0,component:Ii,path:"/auth/google/"}),(0,N.jsx)(Ze,{exact:!0,component:rl,path:"/auth/zoom/"}),(0,N.jsx)(Ze,{exact:!0,component:Tw,path:"/portal/:organization_slug"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn?LM:NK,path:"/portfolio"}),(0,N.jsx)(Ze,{exact:!0,component:LM,path:"/portfolio/:portfolio_token?"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn?Qz:NK,path:"/gallery"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn?Qz:NK,path:"/gallery/:category"}),(0,N.jsx)(Ze,{exact:!0,component:sz,path:"/gallery/view/:challenge_token"}),(0,N.jsx)(Ze,{exact:!0,component:xC,path:"/marketplace/:storefront/:coe_slug?"}),(0,N.jsx)(Ze,{exact:!0,component:s.isLoggedIn?gx:NK,path:"/assignment/:group_member_assignment_id/:group_member_assignment_component_id?/:view?/:section?/:subsection?"}),(0,N.jsx)(Ze,{exact:!0,component:Vz,path:"/error/"}),(0,N.jsx)(Ze,{component:yK})]}),(0,N.jsx)(Oe,{})]})})}}var MK=(0,n.G0)(CK);t(5920),t(76038),t(55097),t(31829);const kK=null===Re.Ay||void 0===Re.Ay?void 0:Re.Ay.lang,zK=new De.A;class TK extends l.Component{constructor(s){var a;super(s),a=this,this.setLocale=async e=>{try{const{api:s}=this,{isLoggedIn:a}=this.state;if(!e||null===e||void 0===e||!e.length)return;this.setState({locale:e,localeMessages:(null===kK||void 0===kK?void 0:kK[e])||kK.en}),a&&await s.post("/api/users/locale",{locale:e})}catch({err:err}){w(err)}},this.doLogin=async function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{id:t,locale:i}=e||{};await a.setLocale(i),await new Promise(i=>{a.setState({isLoggedIn:!0,logoutMessage:null,user:e,userId:t},async()=>{(null===a||void 0===a?void 0:a.user_status)&&a.user_status.init(),a.notifications&&a.notifications.listen(t),s&&a.organizations.setUserOrganizationId(s,!0),i()})})},this.tryInitialLogin=async()=>{const e=await this.getUserBasics();return e?await this.doLogin(e):this.deleteAuthenticationCookies(),e||null},this.tryCookieLogin=async()=>{const e=await this.getUserBasics();return e&&await this.doLogin(e),e||null},this.verifyLogin=async()=>{try{const{api:e}=this;return await e.post("/api/auth/check")}catch({err:err}){w(err)}},this.tryLogin=async(e,s)=>{const{api:a}=this,{locale:t,user_id:i}=await a.post("/api/auth/new",{email_address:e,password:s}),l=await this.getUserBasics();return await this.doLogin(l),(null===this||void 0===this?void 0:this.organizations)&&await this.organizations.sync(),{locale:t,user_id:i}},this.tryMSLogin=async()=>{window.open("/api/auth/new/microsoft","Sign in with Microsoft","width=600,height=600,scrollbars=yes");const e=this.verifyLogin;window.addEventListener("storage",async function(s){if("msAuth"!=s.key)return;await e()&&(window.location="/authenticate/redirect")})},this.tryRegister=async e=>{const{business:s,email_address:a,fullname:t,locale:i,password:l}=e,{api:n}=this,{locale:r,user_id:o}=await n.post("/api/users/register",{business:s,email_address:a,fullname:t,locale:i,password:l}),d=await this.getUserBasics();return await this.doLogin(d),(null===this||void 0===this?void 0:this.organizations)&&this.organizations.sync(),{locale:r,user_id:o}},this.tryServerLogout=async()=>{try{const{api:e}=this;await e.post("/api/auth/logout")}catch({err:err}){w(err)}},this.clearLoginState=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.deleteAuthenticationCookies(),a.organizations.reset(),a.setState({isLoggedIn:!1,loading:!0,logoutMessage:e,user:null,userId:null},async()=>{a.organizations&&await a.organizations.fetchURIOrganization(),a.setState({loading:!1})}),a.notifications&&await a.notifications.unsubscribe(),(null===a||void 0===a?void 0:a.user_status)&&await a.user_status.stop()},this.doLocalLogout=function(){if(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null){const{isLoggedIn:e}=a.state;e&&a.saveCurrentPathToStorage(),a.clearLoginState("You were logged out due to inactivity")}else a.clearLoginState()},this.deleteAuthenticationCookies=()=>{const{env:e}=this.props;["googleAccessToken",`integration_configuration.${e}`,`user_organization.${e}
2.id`].forEach(e=>this.deleteCookie(e))},this.getUserAvatar=()=>{var e,s,a;return(null===this||void 0===this||null===(e=this.state)||void 0===e||null===(s=e.user)||void 0===s||null===(a=s.avatar)||void 0===a?void 0:a.location)||Wa},this.getUserBanner=()=>{var e,s,a;return null===this||void 0===this||null===(e=this.state)||void 0===e||null===(s=e.user)||void 0===s||null===(a=s.banner)||void 0===a?void 0:a.location},this.userIsAdmin=()=>{const{user:e}=this.state;if(!e)return!1;if((null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId()){if(this.organizations.getUserOrganizationMembership().role_id)return!0}else if(null!==e&&void 0!==e&&e.role)return!0;return!1},this.userIsOrgAdmin=()=>{if(!this.userIsAdmin())return;const e=this.organizations.getUserOrganizationMembership();return 2===(null===e||void 0===e?void 0:e.role_id)},this.userIsLearner=()=>{if(!((null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId()))return!1;const e=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationMembership();return!(!e||null!==e&&void 0!==e&&e.role)},this.userIsFacilitator=()=>{var e;if(!((null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId()))return!1;const s=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationMembership();return!(!s||null===s||void 0===s||!s.role||"facilitator"!==(null===s||void 0===s||null===(e=s.role)||void 0===e?void 0:e.slug))},this.userIsModerator=()=>{if(!((null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId()))return!1;const e=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationMembership();return!(!e||!e.role||"moderator"!==e.role.slug)},this.userIsSiteAdmin=()=>{const e=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId(),{user:s}=this.state;return!(e||!s)&&!(null===s||void 0===s||!s.role)},this.userIsFullSiteAdmin=()=>{var e;const s=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId(),{user:a}=this.state;return!(s||!a)&&"site_admin"===(null===a||void 0===a||null===(e=a.role)||void 0===e?void 0:e.slug)},this.isImpersonating=()=>{var e;return!(null===(e=this.state.user)||void 0===e||!e.impersonating)},this.getImpersonator=()=>{var e;return(null===(e=this.state.user)||void 0===e?void 0:e.impersonator)||null},this.userIsSiteArbitrator=()=>{var e;const s=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId(),{user:a}=this.state;return!(s||!a)&&"arbitrator"===(null===a||void 0===a||null===(e=a.role)||void 0===e?void 0:e.slug)},this.userIsTenantArbitrator=()=>{var e;if(!((null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationId()))return!1;const s=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationMembership();return!(!s||null===s||void 0===s||!s.role||"organization_arbitrator"!==(null===s||void 0===s||null===(e=s.role)||void 0===e?void 0:e.slug))},this.userCanArbitrate=()=>this.userIsSiteArbitrator()||this.userIsFullSiteAdmin()||this.userIsTenantArbitrator(),this.userCanManageEvaluations=()=>this.userIsSiteArbitrator()||this.userIsFullSiteAdmin(),this.userIsEcommerce=()=>{const e=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganization();return!(null===e||void 0===e||!e.purchaser_user_id)},this.userHasRight=(e,s)=>{const{user:a}=this.state;if(!a)return!1;const t=(null===this||void 0===this?void 0:this.organizations)&&this.organizations.getUserOrganizationMembership();if(!t){const s=null===a||void 0===a?void 0:a.role,t=Array.isArray(null===s||void 0===s?void 0:s.rights)?s.rights:[];for(const a of t)if((null===a||void 0===a?void 0:a.slug)===e)return!0}if(!t)return!1;if(s){const a=Array.isArray(null===t||void 0===t?void 0:t.sub_organization_ids)?t.sub_organization_ids:[],i=(null===t||void 0===t?void 0:t.organization_id)===s||a.includes(s),l=null===t||void 0===t?void 0:t.role;if(i&&l){const s=Array.isArray(null===l||void 0===l?void 0:l.rights)?l.rights:[];for(const a of s)if((null===a||void 0===a?void 0:a.slug)===e)return!0}}return!1},this.userHasOrgRole=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{user:t}=a.state;if(!t)return!1;const i=(null===a||void 0===a?void 0:a.organizations)&&a.organizations.getUserOrganizationMembership();if(!i)return!1;const l=Array.isArray(null===i||void 0===i?void 0:i.sub_organization_ids)?i.sub_organization_ids:[];if(!(!s||((null===i||void 0===i?void 0:i.organization_id)===s||l.includes(s))))return!1;const n=null===i||void 0===i?void 0:i.role;return!!n&&((null===n||void 0===n?void 0:n.slug)===e&&i.organization_id)},this.userHasSiteRole=()=>!!this.getUserSiteRole(),this.getUserSiteRole=()=>{var e,s;return(null===this||void 0===this||null===(e=this.state)||void 0===e||null===(s=e.user)||void 0===s?void 0:s.role)||null},this.isLTIUser=e=>{let{user:s}=this.state;if(!s)return!1;const a=(null===s||void 0===s?void 0:s.integrations)||[];for(const t of a){const s=(null===t||void 0===t?void 0:t.type)||null,a=(null===t||void 0===t?void 0:t.group_integration)||{};if(!a)return!1;if(4===s&&a.group_id===e)return!0}return!1},this.orgHasNotification=async(e,s)=>{try{if(!e)return;const{api:a}=this,{notification:t}=await a.get("/api/organizations/notifications/get",{event_token:s,organization_id:e});return t&&(null===t||void 0===t?void 0:t.is_enabled)}catch({err:err}){w(err)}},this.userPerformedAchievementEvent=async e=>{try{const{api:s}=this,{userId:a}=this.state;await s.post("/api/site/achievements/progress",{event_token:e,user_id:a})}catch({err:err}){w(err)}},this.getUserBasics=async()=>{try{const{api:e}=this,{user:s}=await e.get("/api/users/profile/basics/get");return s}catch({err:err}){w(err)}},this.refreshUserBasics=async()=>
2{if(!this.state.isLoggedIn)throw"You must be logged in to perform this action";const e=await this.getUserBasics();await new Promise(s=>this.setState({user:e},s))},this.isServerOnline=async()=>{try{return await this.api.get("/api/heartbeat")}catch({err:err}){w(err)}},this.reloadWindow=()=>{var e,s,a;return null===(e=window)||void 0===e||null===(s=e.location)||void 0===s||null===(a=s.reload)||void 0===a?void 0:a.call(s)},this.getGroupAvatar=e=>{var s;return(null===e||void 0===e||null===(s=e.avatar)||void 0===s?void 0:s.location)||fd},this.getGroupMemberships=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const s=[];let t=(null===a||void 0===a?void 0:a.organizations)&&a.organizations.getUserOrganizationMembership();if(!t)return s;let i=Array.isArray(null===t||void 0===t?void 0:t.group_memberships)?t.group_memberships:[];for(const a of i){if(!a)continue;const t=null===a||void 0===a?void 0:a.role;e&&t||s.push(a)}return s},this.resetLogoutMessage=()=>this.setState({logoutMessage:null}),this.cookiesEnabled=()=>!!navigator.cookieEnabled,this.getCookie=e=>zK.get(e),this.storageEnabled=()=>{try{const e="__test_storage__";return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}},this.setCookie=function(e,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"!==typeof a&&(a={});const t=ci()().add(1,"week").toDate();a.path="/",a.expires=t,a.secure="true",a.sameSite="none",a.domain=window.location.hostname,zK.set(e,s,a)},this.deleteCookie=e=>zK.remove(e,{domain:window.location.hostname,path:"/",sameSite:"none",secure:"true"}),this.initAuthProviders=()=>{const{authProviders:e}=this.props,{microsoft:s}=e||{};s&&(async e=>{let{client_id:s}=e;const a={auth:{authority:"https://login.microsoftonline.com/common",clientId:s,navigateToLoginRequestUrl:!1,postLogoutRedirectUri:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),redirectUri:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},telemetry:{application:{appName:"Solvably",appVersion:"1.0.0"}}};ae=new X.vq(a),await ae.initialize()})(s)},this.saveCurrentPathToStorage=()=>{const e=new Date;e.setHours(e.getHours()+1);const s=JSON.stringify({expiration:e.getTime(),path:window.location.href,userId:this.state.userId});localStorage.setItem(Ee.iE,s)},this.showReconnectModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.reconnect_modal)||void 0===e?void 0:e.current;s&&s.show()},this.hideReconnectModal=()=>{var e;const s=null===this||void 0===this||null===(e=this.reconnect_modal)||void 0===e?void 0:e.current;s&&s.hide()},this.forceRerender=()=>this.setState({rerender_guid:(0,me.A)()}),this.setIsolatedMode=function(){let s=arguments.length>0&&void 0!==arguments[0]&&arguments[0];a.setState({isolatedMode:s});try{sessionStorage.setItem("isolatedMode",s?"1":"0")}catch(e){console.error(e)}},this.isIsolatedMode=()=>{try{return 1==sessionStorage.getItem("isolatedMode")}catch(e){console.error(e)}},this.state={error:!1,isLoggedIn:!1,isolatedMode:this.isIsolatedMode(),loading:!0,locale:"en",localeMessages:null===kK||void 0===kK?void 0:kK.en,logoutMessage:null,rerender_guid:(0,me.A)(),siteUrl:"",user:null,userId:""},this.router=(0,l.createRef)(),this.reconnect_modal=(0,l.createRef)(),this.modal_manager=(0,l.createRef)(),this.api=new Ee.Ay({doLocalLogout:this.doLocalLogout}),this.utils=(0,l.createRef)(),this.user_status=null,this.all_users_status=null,this.organizations=null,this.notifications=null,this.assignment_status=null,this.scorm={callbacks:{},getBasics:()=>new Promise((e,s)=>{this.scorm.sendMessage(this.scorm.messages.get_basics(),function(s){let{id:a,data:t,type:i}=s;e(t)})}),getLearner:()=>new Promise((e,s)=>{this.scorm.sendMessage(this.scorm.messages.get_learner(),function(s){let{id:a,data:t,type:i}=s;e(t)})}),getStatus:()=>new Promise((e,s)=>{this.scorm.sendMessage(this.scorm.messages.get_status(),function(s){let{id:a,data:t,type:i}=s;e(t)})}),getUrl:()=>new Promise((e,s)=>{this.scorm.sendMessage(this.scorm.messages.get_url(),function(s){let{id:a,data:t,type:i}=s;e(t)})}),init:async()=>{window.addEventListener("message",e=>{let s=(null===e||void 0===e?void 0:e.data)||{};try{s=JSON.parse(s)}catch(e){}const{id:a,type:t}=s;if(!a||!t)return;let i=this.scorm.callbacks[a];"function"==typeof i&&(i(s),delete this.scorm.callbacks[a]);let l=this.scorm.messageHandlers[t];"function"==typeof l&&l(s)})},messageHandlers:{"sample:handler":e=>{}},messages:{get_basics:()=>({data:{}
2,type:"scorm:basics:get"}),get_learner:()=>({data:{},type:"scorm:learner:get"}),get_status:()=>({data:{},type:"scorm:status:get"}),get_url:()=>({data:{},type:"scorm:url:get"}),set_status:(e,s)=>({data:{completed:e,completion_pct:s},type:"scorm:status:set"})},sendMessage:async function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.id){let s=Math.round(1e6*Math.random());e.id=s}s&&(a.scorm.callbacks[e.id]=s),window.parent.postMessage(e,"*")},setStatus:e=>new Promise((s,a)=>{let{completed:t,completion_pct:i}=e;this.scorm.sendMessage(this.scorm.messages.set_status(t,i),function(e){let{id:a,data:t,type:i}=e;s(t)})})}}async componentDidMount(){_(this.showReconnectModal),b(this.hideReconnectModal),this.notifications&&await this.notifications.init(),this.all_users_status&&await this.all_users_status.init(),this.assignment_status&&await this.assignment_status.init(),this.scorm&&this.scorm.init(),Promise.all([this.tryInitialLogin(),this.initAuthProviders()]).then(async()=>{const{env:s,siteUrl:a}=this.props;try{"local"!==s&&"https:"!==window.location.protocol&&window.location.replace(`https:${window.location.href.substring(window.location.protocol.length)}`),(null===this||void 0===this?void 0:this.organizations)&&await this.organizations.sync(),this.setState({loading:!1})}catch(e){w(e),window.location=`${window.location.protocol}//${a}`}}).catch(e=>{w(e),this.setState({loading:!1})})}render(){const{all_users_status:e,api:s,assignment_status:a,notifications:t,organizations:i,scorm:l,user_status:n,utils:r}=this,{authProviders:o,chatbot:d,env:c,events:h,forceRemount:u,galleryIsPublic:m,shopping:g,siteUrl:p,systemUser:x,teamSizeLimit:v,variables:f,videoMeetingProviders:j}=this.props,{isLoggedIn:_,isolatedMode:b,loading:A,locale:y,localeMessages:w,logoutMessage:S,user:M,userId:k}=this.state,{getAllUserOrganizations:z,getOrganization:T,getUserOrganization:I,getUserOrganizationId:F,getUserOrganizationMembership:R,setOrganization:D,setUserOrganization:B,setUserOrganizationId:L,sync:H}=i||{},{subscribe:U,unsubscribe:Q}=e||{},{subscribe:G,unsubscribe:W}=t||{},{init:K,stop:q}=n||{},{getAssignmentStatus:J,subscribe:X,unsubscribe:Z}=a||{};return(0,N.jsx)(Fe.A,{locale:y,messages:w,children:(0,N.jsx)(P.Dv,{value:{api:s,assignment_status:a,authProviders:o,chatbot:d,common:Re.Ay,cookiesEnabled:this.cookiesEnabled,deleteCookie:this.deleteCookie,doLocalLogout:this.doLocalLogout,doLogin:this.doLogin,env:c,events:h,forceRemount:u,forceRerender:this.forceRerender,galleryIsPublic:m,getAllUserOrganizations:z||Function(),getAssignmentStatus:J||Function(),getCookie:this.getCookie,getGroupAvatar:this.getGroupAvatar,getGroupMemberships:this.getGroupMemberships,getImpersonator:this.getImpersonator,getOrganization:T||Function(),getUserAvatar:this.getUserAvatar,getUserBanner:this.getUserBanner,getUserBasics:this.getUserBasics,getUserOrganization:I||Function(),getUserOrganizationId:F||Function(),getUserOrganizationMembership:R||Function(),getUserSiteRole:this.getUserSiteRole,initUserStatus:K||Function(),isImpersonating:this.isImpersonating,isIsolatedMode:this.isIsolatedMode,isLoggedIn:_,isLTIUser:this.isLTIUser,isolatedMode:b,isServerOnline:this.isServerOnline,locale:y,logoutMessage:S,modal_manager:this.modal_manager,organization:(null===T||void 0===T?void 0:T())||null,orgHasNotification:this.orgHasNotification,refreshUserBasics:this.refreshUserBasics,reloadWindow:this.reloadWindow,resetLogoutMessage:this.resetLogoutMessage,scorm:l,setCookie:this.setCookie,setIsolatedMode:this.setIsolatedMode,setLocale:this.setLocale,setOrganization:D||Function(),setUserOrganization:B||Function(),setUserOrganizationId:L||Function(),shopping:g,siteUrl:p,stopUserStatus:q||Function(),storageEnabled:this.storageEnabled,styles:f,subscribeAllUsersStatus:U||Function(),subscribeAssignmentStatus:X||Function(),subscribeNotifications:G||Function(),syncOrganizations:H||Function(),systemUser:x,teamSizeLimit:v,tryCookieLogin:this.tryCookieLogin,tryLogin:this.tryLogin,tryMSLogin:this.tryMSLogin,tryRegister:this.tryRegister,tryServerLogout:this.tryServerLogout,unsubscribeAllUsersStatus:Q||Function(),unsubscribeAssignmentStatus:Z||Function(),unsubscribeNotifications:W||Function(),user:M,userCanArbitrate:this.userCanArbitrate,userCanManageEvaluations:this.userCanManageEvaluations,userHasOrgRole:this.userHasOrgRole,userHasRight:this.userHasRight,userHasSiteRole:this.userHasSiteRole,userId:k,userIsAdmin:this.userIsAdmin,userIsEcommerce:this.userIsEcommerce,userIsFacilitator:this.userIsFacilitator,userIsFullSiteAdmin:this.userIsFullSiteAdmin,userIsLearner:this.userIsLearner,userIsModerator:this.userIsModerator,userIsOrgAdmin:this.userIsOrgAdmin,userIsSiteAdmin:this.userIsSiteAdmin,userIsSiteArbitrator:this.userIsSiteArbitrator,userIsTenantArbitrator:this.userIsTenantArbitrator,userOrganization:(null===I||void 0===I?void 0:I())||null,userOrganizationId:(null===F||void 0===F?void 0:F())||null,userPerformedAchievementEvent:this.userPerformedAchievementEvent,utils:r.current||{},verifyLogin:this.verifyLogin,videoMeetingProviders:j},children:(0,N.jsx)(Be.Aq,{ref:this.utils,children:(0,N.jsx)(oe,{ref:this.modal_manager,children:(0,N.jsx)(C,{onRef:e=>this.user_status=e,children:(0,N.jsx)(V,{onRef:e=>this.all_users_status=e,children:(0,N.jsx)(Y,{onRef:e=>this.assignment_status=e,children:(0,N.jsx)(E,{onRef:e=>this.organizations=e,children:(0,N.jsxs)(O,{onRef:e=>this.notifications=e,children:[(0,N.jsx)(Me.x_,{defaultSpinnerClassName:"vh-100",loading:A,children:(0,N.jsx)(MK,{routerRef:this.router})}),(0,N.jsx)(Ie,{ref:this.reconnect_modal})]})})})})})})})})})}}var IK=TK},93694:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M30.178 12.089h-4.89v-1.956a.489.489 0 00-.488-.489h-8.203L9.644 6.4V4.267H11.6a1.467 1.467 0 100-2.934H6.711a1.467 1.467 0 000 2.934h1.956V6.4L1.615 9.69a.489.489 0 000 .886l7.052 3.291V16h-4.89a.489.489 0 00-.488.489v2.933a.489.489 0 00.489.49h4.889v2.024a1.946 1.946 0 000 3.772v2.025H6.71a1.466 1.466 0 100 2.934H11.6a1.467 1.467 0 100-2.934H9.644v-2.025a1.956 1.956 0 001.398-1.397
2H24.8a.489.489 0 00.489-.489V16h4.889a.489.489 0 00.489-.489v-2.933a.489.489 0 00-.49-.49zM6.71 3.289a.489.489 0 010-.978H11.6a.489.489 0 110 .978H6.711zm-3.733 6.844L9.156 7.25l6.177 2.884-6.177 2.885-6.178-2.885zm1.289 8.8v-1.955h9.777v1.955H4.268zm7.333 9.778a.489.489 0 110 .978H6.711a.489.489 0 110-.978H11.6zM9.156 24.8a.978.978 0 110-1.956.978.978 0 010 1.956zm15.155-1.467h-13.27a1.956 1.956 0 00-1.397-1.397v-2.025h4.89a.489.489 0 00.488-.489V16.49a.49.49 0 00-.489-.489H9.644v-2.133l6.953-3.245h7.714v1.467h-4.889a.489.489 0 00-.489.489v2.933a.489.489 0 00.49.489h4.888v7.333zm5.378-8.31H19.91v-1.956h9.778v1.955z",fill:"currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},993:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 32 26",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".binocular_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"binocular_svg__binocular",transform:"translate(.5 -.5)",children:[(0,i.jsx)("path",{className:"binocular_svg__cls-1",d:"M28.363 14.38l-7.2-10.833a3.924 3.924 0 00-6.422-.68 3.924 3.924 0 00-6.422.68L1.128 14.38","data-name":"Path 3833",id:"binocular_svg__Path_3833",transform:"translate(.616)"}),(0,i.jsx)("circle",{className:"binocular_svg__cls-1",cx:7,cy:7,"data-name":"Ellipse 1274",id:"binocular_svg__Ellipse_1274",r:7,transform:"translate(.5 11.5)"}),(0,i.jsx)("circle",{className:"binocular_svg__cls-1",cx:7,cy:7,"data-name":"Ellipse 1275",id:"binocular_svg__Ellipse_1275",r:7,transform:"translate(16.5 11.5)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},28229:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 19.618 26.225",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".bulb_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:square;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"bulb_svg__bulb-61",transform:"translate(-3)",children:[(0,i.jsx)("path",{className:"bulb_svg__cls-1",d:"M21.618 9.809a8.809 8.809 0 10-12.112 8.163v2.848h6.607v-2.848a8.806 8.806 0 005.505-8.163z","data-name":"Path 3836",id:"bulb_svg__Path_3836"}),(0,i.jsx)("path",{className:"bulb_svg__cls-1",d:"M15.607 19v4.4H9V19","data-name":"Path 3837",id:"bulb_svg__Path_3837",transform:"translate(.506 1.82)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},14146:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M5.344 15.541h2.19c.018-.31.053-.616.103-.916H5.344a.458.458 0 100 .916zM5.344 17.375h2.293c-.05-.3-.086-.606-.103-.917h-2.19a.458.458 0 100 .917zM5.344 18.291a.458.458 0 100 .917h2.825a8.217 8.217 0 01-.323-.916H5.344zM5.344 20.125a.458.458 0 000 .916h3.9a8.277 8.277 0 01-.616-.916H5.344zM4.886 22.416c0 .253.205.459.458.459h5.867a8.274 8.274 0 01-1.142-.917H5.344a.458.458 0 00-.458.459zM18.177 5.458H5.344a.458.458 0 000 .917h12.833a.458.458 0 000-.917zM15.756 7.75a8.232 8.232 0 012.607.418.458.458 0 00-.186-.876H5.344a.458.458 0 000 .916h7.716a8.233 8.233 0 012.696-.458zM11.212 9.125H5.344a.458.458 0 000 .917h4.725a8.283 8.283 0 011.143-.917zM9.244 10.958h-3.9a.458.458 0 000 .917h3.284c.185-.32.39-.626.616-.917zM5.344 13.708h2.502c.09-.313.197-.62.323-.916H5.344a.458.458 0 100 .916zM18.292 12.792h-6.99a5.45 5.45 0 00-.519.881.46.46 0 00.175.035h7.334a.458.458 0 000-.916zM18.292 14.625h-7.85a5.499 5.499 0 00-.152.916h8.002a.458.458 0 000-.916zM18.292 16.458H10.29c.026.314.078.62.154.917h7.848a.459.459 0 000-.917zM18.292 18.291h-7.52c.15.324.33.63.536.917h6.984a.459.459 0 000-.916zM18.292 20.125H12.14c.426.375.91.686 1.436.916h4.716a.458.458 0 000-.916zM18.292 10.958h-4.723a5.463 5.463 0 00-1.43.917h6.153a.458.458 0 000-.917z",fill:"
2currentColor"}),(0,i.jsx)("path",{d:"M29.971 26.682l-6.378-6.313-.366.376-1.096-1.096a7.333 7.333 0 00-6.36-10.983h-.013a7.334 7.334 0 00.012 14.667h.014a7.298 7.298 0 003.922-1.146l1.071 1.072-.411.422 6.379 6.313c.45.445 1.02.673 1.563.673.85 0 1.34-.61 1.882-1.166.713-.73.615-1.993-.219-2.819zm-14.19-4.265h-.01c-3.532 0-6.41-2.874-6.417-6.406a6.374 6.374 0 011.872-4.54 6.374 6.374 0 014.534-1.888h.011a6.426 6.426 0 016.416 6.406 6.425 6.425 0 01-6.405 6.427zm4.675-.776c.43-.358.82-.765 1.158-1.212l.973.973-1.17 1.2-.961-.961zm9.078 7.22c-.338.345-.693.889-1.226.889-.322 0-.657-.148-.918-.407l-5.733-5.674 1.948-1.999 5.72 5.663c.469.464.564 1.163.209 1.528z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M22.185 21.186h.003v-.003l-.003.003zM20.354 27H3.167a.926.926 0 01-.917-.933V3.182c0-.514.411-.932.917-.932h17.187c.506 0 .917.418.917.932v6.67c.33.297.637.62.916.966V3.182c0-1.02-.82-1.849-1.833-1.849H3.167a1.841 1.841 0 00-1.833 1.85v22.884c0 1.021.82 1.85 1.833 1.85h17.187c.83 0 1.53-.556 1.756-1.318h-1.004a.911.911 0 01-.752.4z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},42111:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 19.011 18.838",width:"1em"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".challenge_flag_svg__cls-1{fill:none;stroke:currentColor;stroke-miterlimit:10;stroke-linejoin:round}"})}),(0,i.jsxs)("g",{"data-name":"49-corner-flag",id:"challenge_flag_svg___49-corner-flag",transform:"translate(-.326 -.5)",children:[(0,i.jsx)("path",{className:"challenge_flag_svg__cls-1",d:"M30 14.39V1h1.14v13.39","data-name":"Path 3463",id:"challenge_flag_svg__Path_3463",transform:"translate(-20.738)"}),(0,i.jsx)("path",{d:"M1 51.558L9.832 47l8.832 4.558","data-name":"Path 3464",fill:"none",id:"challenge_flag_svg__Path_3464",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,transform:"translate(0 -32.894)"}),(0,i.jsx)("path",{className:"challenge_flag_svg__cls-1",d:"M34 10.564h3.134l-1.425 1.425h5.128l-1.994-1.995L40.838 8h-2.849","data-name":"Path 3465",id:"challenge_flag_svg__Path_3465",transform:"translate(-23.598 -5.006)"}),(0,i.jsx)("path",{className:"challenge_flag_svg__cls-1",d:"M37.134 8.419V5H34","data-name":"Path 3466",id:"challenge_flag_svg__Path_3466",transform:"translate(-23.598 -2.86)"}),(0,i.jsx)("path",{className:"challenge_flag_svg__cls-1",d:"M0 1V0","data-name":"Line 1086",id:"challenge_flag_svg__Line_1086",transform:"translate(12 6.664)"}),(0,i.jsx)("path",{d:"M26.838 53c0 .787-1.531 1.425-3.419 1.425S20 53.787 20 53","data-name":"Path 3467",fill:"none",id:"challenge_flag_svg__Path_3467",stroke:"currentColor",strokeMiterlimit:10,transform:"translate(-13.587 -37.185)"})]})]}));l.defaultProps={color:"#008087"},s.default=l},48268:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 16.096 25.753",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M10.776 17.707l.656 4.073a3.428 3.428 0 11-6.769 0l.656-4.073A9.134 9.134 0 010 9.121C0 4.115 3.566 0 8.048 0S16.1 4.115 16.1 9.121a9.134 9.134 0 01-5.319 8.586zm-3.365.507l-.629 3.907a1.282 1.282 0 102.531 0l-.629-3.907q-.315.028-.637.028t-.637-.028zm.637-2.118c3.223 0 5.9-3.091 5.9-6.975s-2.679-6.975-5.9-6.975-5.9 3.091-5.9 6.975 2.677 6.979 5.9 6.979z",fill:"currentColor"})}));l.defaultProps={color:"#207DE9"},s.default=l},36495:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 17 17",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".clock_icon_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round}"})}),(0,i.jsxs)("g",{id:"clock_icon_svg__clock",transform:"translate(.5 .515)",children:[(0,i.jsx)("circle",{className:"clock_icon_svg__cls-1",cx:8,cy:8,"data-name":"Ellipse 795",id:"clock_icon_svg__Ellipse_795",r:8,transform:"translate(0 -.015)"}),(0,i.jsx)("path",{className:"clock_icon_svg__cls-1",d:"M12 6v4.719l3.146 1.573","data-name":"Path 3444",id:"clock_icon_svg__Path_3444",transform:"translate(-4.135 -2.462)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},56740:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 39.491 39.491",
2width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".compass_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"compass_svg__compass",transform:"rotate(-60 22.048 11.152)",children:[(0,i.jsx)("circle",{className:"compass_svg__cls-1",cx:13.455,cy:13.455,"data-name":"Ellipse 986",id:"compass_svg__Ellipse_986",r:13.455}),(0,i.jsx)("path",{className:"compass_svg__cls-1",d:"M11.332 0L8.5 8.5 0 11.332l2.833-8.5z","data-name":"Path 3553",id:"compass_svg__Path_3553",transform:"translate(7.697 7.697)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},74640:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 20 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{clipRule:"evenodd",d:"M2.324 1.25h15.352a1.473 1.473 0 01.3.03c.68.143 1.19.756 1.19 1.492v11.095c0 .84-.666 1.522-1.49 1.522H8.733a1.08 1.08 0 00-.934.55l-1.463 2.573a.464.464 0 01-.81 0l-1.463-2.574c-.194-.34-.55-.549-.935-.549h-.804c-.823 0-1.49-.681-1.49-1.522V2.772c0-.84.667-1.522 1.49-1.522zm10.128 5.438l1.763-1.27c.3-.215.714.004.714.379v4.838a.452.452 0 01-.714.378l-1.763-1.27a.192.192 0 00-.304.162v.718c0 .5-.396.904-.886.904H6.226a.895.895 0 01-.886-.904V5.809c0-.5.396-.904.886-.904h4.844a1.09 1.09 0 011.078 1.1v.522c0 .16.176.253.304.161z",fill:"
2currentColor",fillRule:"evenodd"})}));l.defaultProps={color:"#207DE9"},s.default=l},86398:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 20 22",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M14.125 19.25v1.719c0 .57-.462 1.031-1.031 1.031H1.406c-.57 0-1.031-.462-1.031-1.031V5.156c0-.57.462-1.031 1.031-1.031H4.5v12.719a2.409 2.409 0 002.406 2.406h7.219zm0-14.781V0H6.906c-.57 0-1.031.462-1.031 1.031v15.813c0 .57.462 1.031 1.031 1.031h11.688c.57 0 1.031-.462 1.031-1.031V5.5h-4.469a1.034 1.034 0 01-1.031-1.031zm5.198-1.334L16.489.302A1.031 1.031 0 0015.76 0h-.26v4.125h4.125v-.26c0-.274-.109-.536-.302-.73z",fill:"currentColor"})}));l.defaultProps={color:"#207DE9"},s.default=l},13836:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 19.096 25.465",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".cursor-select_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"cursor-select_svg__cursorandselection-icons-04",transform:"translate(-14.706 -8.635)",children:[(0,i.jsx)("path",{className:"cursor-select_svg__cls-1",d:"M28.252 20l10.393 10.235-4.619.42 2.625 6.245-2.414 1-2.624-6.246-3.413 2.99z","data-name":"Path 3685",id:"cursor-select_svg__Path_3685",transform:"translate(-5.844 -4.799)"}),(0,i.jsxs)("g",{"data-name":"Group 1437",id:"cursor-select_svg__Group_1437",transform:"translate(15.9 9.9)",children:[(0,i.jsx)("path",{className:"cursor-select_svg__cls-1",d:"M0 2.992L.997 0","data-name":"Line 1188",id:"cursor-select_svg__Line_1188",transform:"translate(7.978)"}),(0,i.jsx)("path",{className:"cursor-select_svg__cls-1",d:"M0 1.68L2.677 0","data-name":"Line 1189",id:"cursor-select_svg__Line_1189",transform:"translate(10.078 2.939)"}),(0,i.jsx)("path",{className:"cursor-select_svg__cls-1",d:"M3.044 0L0 .682","data-name":"Line 1190",id:"cursor-select_svg__Line_1190",transform:"translate(0 7.506)"}),(0,i.jsx)("path",{className:"cursor-select_svg__cls-1",d:"M2.834 1.417L0 0","data-name":"Line 1191",id:"cursor-select_svg__Line_1191",transform:"translate(.577 3.464)"}),(0,i.jsx)("path",{className:"cursor-select_svg__cls-1",d:"M1.26 2.887L0 0","data-name":"Line 1192",id:"cursor-select_svg__Line_1192",transform:"translate(4.094 .21)"})]})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},28602:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M23.097 14.108h-.755a6.608 6.608 0 00-.561-1.327l.704-.705a.473.473 0 000-.668l-1.892-1.893a.473.473 0 00-.67 0l-.704.705a6.58 6.58 0 00-1.327-.562v-.755a.473.473 0 00-.473-.473h-2.838a.473.473 0 00-.473.473v.755a6.574 6.574 0 00-1.329.56l-.703-.703a.473.473 0 00-.668 0l-1.893 1.893a.473.473 0 000 .668l.703.703a6.547 6.547 0 00-.56 1.329h-.755a.473.473 0 00-.473.473v2.838c0 .262.212.473.473.473h.755c.138.46.325.904.562 1.327l-.705.705a.473.473 0 000 .669l1.893 1.892a.473.473 0 00.668 0l.705-.704c.423.236.867.424 1.326.561v.755c0 .26.213.473.474.473h2.838a.473.473 0 00.473-.473v-.754a6.547 6.547 0 001.329-.56l.703.702a.473.473 0 00.669 0l1.892-1.892a.473.473 0 000-.67l-.703-.702c.235-.421.423-.865.56-1.329h.755a.473.473 0 00.473-.473v-2.838a.473.473 0 00-.473-.473zm-.473 2.838h-.645c-.219 0-.41.15-.46.365a5.63 5.63 0 01-.73 1.73.473.473 0 00.064.589l.628.628-1.223 1.224-.629-.63a.472.472 0 00-.588-.064 5.626 5.626 0 01-1.73.73.474.474 0 00-.365.461v.645h-1.893v-.645c0-.219-.15-.41-.364-.46a5.635 5.635 0 01-1.729-.732.474.474 0 00-.588.064l-.63.63-1.224-1.223.631-.63a.473.473 0 00.065-.59 5.642 5.642 0 01-.732-1.728.474.474 0 00-.46-.364h-.646v-1.893h.645c.219 0 .41-.15.46-.364a5.631 5.631 0 01.73-1.73.473.473 0 00-.064-.59l-.629-.627 1.224-1.223.629.628a.471.471 0 00.588.065 5.624 5.624 0 011.731-.73.474.474 0 00.364-.461v-.645h1.893v.645c0 .219.15.41.364.46.61.145 1.191.391 1.729.733.187.119.432.091.588-.065l.63-.63 1.224 1.223-.631.63a.473.473 0 00-.065.59 5.64 5.64 0 01.732 1.728c.051.213.242.364.46.364h.646v1.892z",fill:"
2currentColor"}),(0,i.jsx)("path",{d:"M16 11.269A4.737 4.737 0 0011.27 16 4.737 4.737 0 0016 20.731a4.737 4.737 0 004.731-4.73 4.737 4.737 0 00-4.73-4.732zm0 8.516A3.79 3.79 0 0112.215 16 3.79 3.79 0 0116 12.215 3.79 3.79 0 0119.785 16 3.79 3.79 0 0116 19.785z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M16 13.161a1.894 1.894 0 00-1.893 1.893h.947a.947.947 0 011.892 0A.947.947 0 0116 16a.473.473 0 00-.473.473v.947h.946v-.533a1.896 1.896 0 001.42-1.833A1.894 1.894 0 0016 13.16zM16.473 18.366h-.946v.946h.946v-.946zM11.742 6.538h2.366v.946h.946v-1.42a.473.473 0 00-.473-.472h-1.697L16 2.476l3.116 3.116H17.42a.473.473 0 00-.474.473v1.419h.947v-.946h2.365a.474.474 0 00.335-.808l-4.258-4.258a.473.473 0 00-.67 0L11.409 5.73a.473.473 0 00.334.808zM20.258 25.462h-2.365v-.946h-.947v1.42c0 .26.212.473.474.473h1.696L16 29.525l-3.116-3.116h1.697a.473.473 0 00.473-.473v-1.42h-.946v.946h-2.366a.474.474 0 00-.334.808l4.258 4.258a.472.472 0 00.669 0l4.258-4.258a.473.473 0 00-.335-.808zM30.528 15.666l-4.258-4.258a.472.472 0 00-.808.334v2.366h-.946v.946h1.42a.473.473 0 00.473-.473v-1.697L29.525 16l-3.116 3.116v-1.697a.473.473 0 00-.473-.473h-1.42v.946h.946v2.366a.474.474 0 00.808.335l4.258-4.258a.473.473 0 000-.67zM6.538 11.742a.474.474 0 00-.808-.334l-4.258 4.258a.473.473 0 000 .669l4.258 4.258a.473.473 0 00.808-.335v-2.366h.946v-.946h-1.42a.473.473 0 00-.472.473v1.697L2.476 16l3.116-3.116v1.697c0 .26.212.473.473.473h1.42v-.946h-.947v-2.366z",f
2ill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},457:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M2.168 16.143a.489.489 0 00-.835.346v13.689a.489.489 0 00.49.489H15.51a.489.489 0 00.346-.835L2.168 16.143zm.143 13.546v-12.02l12.02 12.02H2.311z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M4.756 27.733h3.91a.49.49 0 00.347-.834L5.1 22.988a.49.49 0 00-.834.345v3.912a.489.489 0 00.489.488zm.489-3.22l2.242 2.243H5.245v-2.242zM7.689 3.289h-.978v.978h.978v-.978zM9.645 3.289h-.978v.978h.978v-.978zM11.6 3.289h-.978v.978h.978v-.978zM11.402 10.176a.482.482 0 00-.29.446V16a.49.49 0 00.29.447l4.4 1.955a.487.487 0 00.397 0l4.4-1.955a.489.489 0 00.29-.447v-5.378a.481.481 0 00-.29-.446l-4.4-1.956a.49.49 0 00-.398 0l-4.4 1.955v.001zm4.11 7.027l-3.423-1.52v-4.309l3.422 1.522v4.307zm4.4-1.52l-3.423 1.52v-4.307l3.422-1.521v4.307zM16 9.201l3.196 1.42L16 12.042l-3.196-1.42L16 9.202zM16.489 19.911h-.978v2.445h.978V19.91zM16.489 4.756h-.978V7.2h.978V4.756zM7.9 8.714l-.422.883 2.048.978.421-.883L7.9 8.714zM24.1 8.714l-2.047.978.422.882 2.047-.977-.421-.883zM9.526 16.537l-2.048.977.422.883 2.047-.978-.421-.883z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M30.178 23.822h-2.933v-7.62l2.874-2.874a1.872 1.872 0 10-2.647-2.646l-.227.227V6.71a.488.488 0 00-.144-.346l-4.889-4.888a.489.489 0 00-.345-.144H6.71A1.958 1.958 0 004.756 3.29v14.178h.977V3.289a.979.979 0 01.978-.978h14.667v2.933A1.958 1.958 0 0023.334 7.2h2.933v4.686l-7.68 7.68a.489.489 0 00-.133.25l-.489 2.444a.488.488 0 00.576.575l2.444-.489a.488.488 0 00.25-.134l5.032-5.032v6.642h-9.778a.49.49 0 00-.489.49v1.466h-2.444v.978H16v1.466a.489.489 0 00.489.49h13.689a.489.489 0 00.489-.49v-3.91a.489.489 0 00-.49-.49zM22.356 5.244V3.003l3.22 3.22h-2.242a.98.98 0 01-.978-.979zm-2.731 14.667l7.62-7.62 1.264 1.265-7.62 7.62-1.264-1.265zm9.17-8.8a.895.895 0 01.632 1.526l-.227.227-1.264-1.264.227-.227a.89.89 0 01.632-.262zm-9.561 9.792l.663.664-.83.165.167-.83zm10.455 6.83H16.978V24.8h.978v.978h.977V24.8h.978v.978h.978V24.8h.978v.978h.978V24.8h.977v.978h.978V24.8h.978v.978h.978V24.8h.977v.978h.978V24.8h.978v2.933z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},49875:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M5.733 6.711v1.956c0 .27.22.489.49.489h1.466v1.466c0 .27.219.49.489.49h1.955c.27 0 .49-.22.49-.49V9.156h1.466c.27 0 .489-.219.489-.49V6.712a.489.489 0 00-.489-.489h-1.467V4.756a.489.489 0 00-.489-.49H8.178a.489.489 0 00-.49.49v1.466H6.223a.489.489 0 00-.489.49zm.978.489h1.467c.27 0 .489-.219.489-.489V5.244h.978v1.467c0 .27.219.489.488.489H11.6v.978h-1.467a.489.489 0 00-.488.489v1.466h-.978V8.667a.489.489 0 00-.49-.49H6.712V7.2zM23.823 14.533c-.809 0-1.467.658-1.467 1.467s.658 1.467 1.467 1.467c.808 0 1.466-.658 1.466-1.467s-.658-1.467-1.466-1.467zm0 1.956a.49.49 0 110-.979.49.49 0 010 .979z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M27.245 16a3.426 3.426 0 00-3.423-3.422A3.426 3.426 0 0020.4 16a3.425 3.425 0 002.933 3.383V29.2a.49.49 0 01-.488.489H10.133a.49.49 0 01-.488-.489v-1.956c0-.808-.658-1.466-1.467-1.466H7.2a.49.49 0 010-.978h3.911c.809 0 1.467-.658 1.467-1.467 0-.808-.658-1.466-1.467-1.466h-.978a.49.49 0 01-.488-.49v-1.466h.488c.27 0 .49-.218.49-.489v-2.598a7.258 7.258 0 005.431-4.819l.899-2.695a.488.488 0 00-.464-.643h-.443l.745-4.657a1.466 1.466 0 00-1.448-1.699h-.81v-.489a.489.489 0 00-.488-.489h-.978c-.809 0-1.467.658-1.467 1.467s.658 1.467 1.467 1.467h.978c.27 0 .488-.219.488-.49V3.29h.81c.145 0 .277.061.371.171a.483.483 0 01.111.395l-.77 4.812h-.522a.49.49 0 00-.46.321l-.537 1.479a4.417 4.417 0 01-3.403 1.622H8.178a4.418 4.418 0 01-3.403-1.622L4.237 8.99a.49.49 0 00-.46-.322h-.52l-.77-4.812a.482.482 0 01.11-.395.482.482 0 01.372-.171h.809v.489c0 .27.219.489.489.489h.978c.808 0 1.466-.658 1.466-1.467s-.658-1.467-1.466-1.467h-.978a.489.489 0 00-.49.49v.488H2.97A1.465 1.465 0 001.52 4.01l.745 4.657h-.444a.488.488 0 00-.464.643l.899 2.695a7.258 7.258 0 005.432 4.819v2.598c0 .27.219.49.489.49h.489v1.466c0 .808.658 1.466 1.466 1.466h.978a.49.49 0 010 .978h-3.91c-.81 0-1.468.658-1.468 1.467 0 .808.658 1.466 1.467 1.466h.978c.27 0 .489.22.489.49V29.2c0 .809.658 1.467 1.466 1.467h12.712c.808 0 1.466-.658 1.466-1.467v-9.817A3.425 3.425 0 0027.245 16zM13.555 3.289h-.488a.49.49 0 010-.978h.489v.978zm-8.8-.978h.49a.49.49 0 010 .978h-.49V2.31zm5.378 10.756c.813 0 1.606-.191 2.324-.536a4.399 4.399 0 01-3.301 1.513 4.4 4.4 0 01-3.301-1.513 5.375 5.375 0 002.323.536h1.955zm-6.948-1.371L2.5 9.644h.935l.457 1.259-.017.013c.012.016.026.03.038.045l.19.524a5.391 5.391 0 005.052 3.537 5.391 5.391 0 005.05-3.537l.191-.524.039-.045-.017-.013.457-1.259h.934l-.684 2.052A6.286 6.286 0 019.157 16a6.286 6.286 0 01-5.971-4.304zm6.46 5.282v1.955h-.978v-1.955h.978zm14.177 1.466A2.447 2.447 0 0121.378 16a2.447 2.447 0 012.444-2.444A2.447 2.447 0 0126.267 16a2.447 2.447 0 01-2.445 2.444zM27.752 15.038c.216.764.216 1.16 0 1.924l.941.265c.265-.94.265-1.514 0-2.454l-.941.265zM30.01 13.357l-.894.397c.763 1.721.763 2.771 0 4.492l.893.397c.87
27-1.976.877-3.31 0-5.286z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M19.893 16.962c-.216-.765-.216-1.16 0-1.924l-.942-.265c-.265.94-.265 1.513 0 2.454l.942-.265zM18.53 18.246c-.764-1.721-.764-2.771 0-4.492l-.894-.396c-.877 1.975-.877 3.309 0 5.285l.893-.397zM22.596 11.13l.266.94c.763-.214 1.159-.214 1.923 0l.265-.94c-.941-.266-1.514-.266-2.454 0zM26.069 10.707l.396-.894c-1.975-.876-3.309-.876-5.285 0l.396.894c1.722-.764 2.771-.763 4.493 0zM28.222 11.6h-.977v.978h.977V11.6zM20.4 11.6h-.978v.978h.978V11.6zM28.222 19.422h-.977v.978h.977v-.978zM20.4 19.422h-.978v.978h.978v-.978z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},39542:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M14.778 12.31h-1.222V3.755c0-.672.244-1.283.733-1.711.917-.917 2.506-.917 3.483 0 .428.428.673 1.039.673 1.71h-1.223c0-.305-.122-.61-.366-.855-.49-.489-1.284-.489-1.711 0-.245.245-.367.55-.367.856v8.555zm7.944 15.89c0-.49-.183-.979-.55-1.284-.366-.306-.794-.55-1.283-.55h-2.444V12.31H27a.555.555 0 00.428-.183l3.055-3.055a.59.59 0 000-.856L27.428 5.16A.555.555 0 0027 4.977H16V6.2h10.756L29.2 8.644l-2.444 2.444H16v1.222h1.222v14.056h-2.444v-4.278h-1.222v4.278H11.11c-.489 0-.978.183-1.283.55-.306.367-.55.794-.55 1.283v1.223H1.333v1.222h17.723v-1.222H10.5v-1.223c0-.183.061-.305.184-.428a.555.555 0 01.427-.183h9.778c.183 0 .306.061.428.183a.555.555 0 01.183.428v1.223h-1.222v1.222h10.389v-1.222h-7.945v-1.223zm-18.15-7.517a.555.555 0 00.428.183h11v-1.222H5.245L2.8 17.199l2.445-2.444H16v-1.222H5a.555.555 0 00-.428.183l-3.055 3.056a.59.59 0 000 .855l3.055 3.056zm15.095-12.65v1.222h1.222V8.033h-1.222zm2.444 0v1.222h1.223V8.033H22.11zm2.445 0v1.222h1.222V8.033h-1.222z",fill:"currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},34569:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 18 18",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M8 4h6v2H8V4zm0 4h6v2H8V8zm0 4h6v2H8v-2zM4 4h2v2H4V4zm0 4h2v2H4V8zm0 4h2v2H4v-2zM17.1 0H.9C.4 0 0 .4 0 .9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V.9c0-.5-.5-.9-.9-.9zM16 16H2V2h14v14z",fill:"currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},28862:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 29.887 27.994",width:"1em"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".double_comment_svg__prefix__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:1.5px}"})}),(0,i.jsxs)("g",{id:"double_comment_svg__prefix__b-comment",transform:"translate(-1.25 -2.25)",children:[(0,i.jsx)("path",{className:"double_comment_svg__prefix__cls-1",d:"M27 41.473a11.763 11.763 0 006.623 1.935 12.726 12.726 0 003.242-.421l3.856 2.313v-4.17a6.76 6.76 0 002.839-5.293A6 6 0 0042.835 33","data-name":"Path 5463",id:"double_comment_svg__prefix__Path_5463",transform:"translate(-13.173 -15.806)"}),(0,i.jsx)("path",{className:"double_comment_svg__prefix__cls-1",d:"M14.774 3C7.719 3 2 7.448 2 12.935a8.654 8.654 0 002.839 6.238v6.536l6.447-3.223a16.17 16.17 0 003.489.385c7.055 0 12.774-4.448 12.774-9.935S21.829 3 14.774 3z","data-name":"Path 5464",id:"double_comment_svg__prefix__Path_5464"})]})]}));l.defaultProps={color:"#008087"},s.default=l},6335:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",fill:"#575757"})}))}},15253:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 20 24",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M7.865 10.576a.356.356 0 100-.712.356.356 0 000 .712zM10 4.36a.39.39 0 00.39-.391V1.39a.39.39 0 10-.78 0v2.578c0 .216.
2174.39.39.39zM9.61 20.06v2.578a.39.39 0 00.78 0v-2.579a.39.39 0 10-.78 0zM3.97 6.304a.39.39 0 00.553-.552L2.866 4.094a.39.39 0 10-.553.553l1.658 1.657zM15.477 18.114a.39.39 0 000 .553l1.657 1.657a.39.39 0 00.552-.552l-1.657-1.658a.39.39 0 00-.552 0zM16.03 6.304l1.656-1.657a.39.39 0 10-.552-.553l-1.657 1.658a.39.39 0 00.552.552zM3.97 18.114l-1.657 1.658a.39.39 0 10.553.552l1.657-1.657a.39.39 0 00-.552-.553z",fill:"currentColor",stroke:"currentColor",strokeWidth:.5}),(0,i.jsxs)("mask",{fill:"currentColor",height:13,id:"eye_svg__a",maskUnits:"userSpaceOnUse",width:20,x:.016,y:5.531,children:[(0,i.jsx)("path",{d:"M.016 5.531h20v13h-20z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M3.51 14.837C5.544 16.56 7.79 17.47 10 17.47s4.455-.91 6.49-2.632c1.526-1.29 2.392-2.565 2.428-2.619a.39.39 0 000-.436c-.036-.054-.902-1.33-2.427-2.62-2.036-1.72-4.28-2.63-6.491-2.63-2.21 0-4.455.91-6.49 2.63-1.526 1.29-2.392 2.566-2.428 2.62a.39.39 0 000 .436c.036.054.902 1.33 2.427 2.62zm.504-5.078C5.334 8.643 7.444 7.312 10 7.312c2.549 0 4.653 1.323 5.97 2.433A14.239 14.239 0 0118.112 12a14.197 14.197 0 01-2.126 2.24c-1.32 1.117-3.43 2.447-5.986 2.447-2.549 0-4.653-1.322-5.97-2.432A14.228 14.228 0 011.888 12a14.18 14.18 0 012.126-2.24z"})]}),(0,i.jsx)("path",{d:"M3.51 14.837C5.544 16.56 7.79 17.47 10 17.47s4.455-.91 6.49-2.632c1.526-1.29 2.392-2.565 2.428-2.619a.39.39 0 000-.436c-.036-.054-.902-1.33-2.427-2.62-2.036-1.72-4.28-2.63-6.491-2.63-2.21 0-4.455.91-6.49 2.63-1.526 1.29-2.392 2.566-2.428 2.62a.39.39 0 000 .436c.036.054.902 1.33 2.427 2.62zm.504-5.078C5.334 8.643 7.444 7.312 10 7.312c2.549 0 4.653 1.323 5.97 2.433A14.239 14.239 0 0118.112 12a14.197 14.197 0 01-2.126 2.24c-1.32 1.117-3.43 2.447-5.986 2.447-2.549 0-4.653-1.322-5.97-2.432A14.228 14.228 0 011.888 12a14.18 14.18 0 012.126-2.24z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M3.51 14.837C5.544 16.56 7.79 17.47 10 17.47s4.455-.91 6.49-2.632c1.526-1.29 2.392-2.565 2.428-2.619a.39.39 0 000-.436c-.036-.054-.902-1.33-2.427-2.62-2.036-1.72-4.28-2.63-6.491-2.63-2.21 0-4.455.91-6.49 2.63-1.526 1.29-2.392 2.566-2.428 2.62a.39.39 0 000 .436c.036.054.902 1.33 2.427 2.62zm.504-5.078C5.334 8.643 7.444 7.312 10 7.312c2.549 0 4.653 1.323 5.97 2.433A14.239 14.239 0 0118.112 12a14.197 14.197 0 01-2.126 2.24c-1.32 1.117-3.43 2.447-5.986 2.447-2.549 0-4.653-1.322-5.97-2.432A14.228 14.228 0 011.888 12a14.18 14.18 0 012.126-2.24z",mask:"url(#eye_svg__a)",stroke:"currentColor"}),(0,i.jsx)("path",{d:"M10 15.203a3.203 3.203 0 10-1.146-6.195.356.356 0 00-.203.46c.067.173.254.283.495.191A2.491 2.491 0 1110 14.491a2.494 2.494 0 01-2.45-2.945.355.355 0 10-.7-.131A3.207 3.207 0 0010 15.203z",fill:"currentColor",stroke:"currentColor",strokeWidth:.5}),(0,i.jsx)("path",{d:"M11.423 12c0-.785-.638-1.424-1.423-1.424s-1.424.64-1.424 1.424c0 .785.639 1.424 1.424 1.424.785 0 1.423-.639 1.423-1.424zm-2.135 0a.713.713 0 111.425.002A.713.713 0 019.288 12z",fill:"currentColor",stroke:"currentColor",strokeWidth:.5})]}));l.defaultProps={color:"#008087"},s.default=l},18620:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 21.6 26.5",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".flag_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"flag_svg__flag",transform:"translate(-3 -1)",children:[(0,i.jsx)("path",{className:"flag_svg__cls-1",d:"M4 17.925S5.225 16.7 8.9 16.7s6.125 2.45 9.8 2.45 4.9-1.225 4.9-1.225v-14.7S22.375 4.45 18.7 4.45 12.575 2 8.9 2 4 3.225 4 3.225z","data-name":"Path 3652",id:"flag_svg__Path_3652"}),(0,i.jsx)("path",{className:"flag_svg__cls-1",d:"M0 8.575V0","data-name":"Line 1182",id:"flag_svg__Line_1182",transform:"translate(4 17.925)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},23489:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 20 18",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M19.006 8.125c-2.485 2.807-5.722 3.463-5.859 3.488-4.29.83-4.88.239-7.546 1.194a.51.51 0 01-.694-.472V4.433c0-.287.232-.522.519-.51 1.375.064 3.033.42 4.94 1.35 4.474 2.18 7.12 2.002 8.049 1.82.572-.12.996.577.591 1.032zM2.616.852c-.984 0-1.783.799-1.783 1.783 0 .71.42 1.317 1.018 1.604v12.654c0 .14.115.255.255.255h1.019c.14 0 .254-.115.254-.255V4.24a1.781 1.781 0 001.019-1.604c0-.984-.8-1.783-1.783-1.783z",fill:"
2currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},15282:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{clipRule:"evenodd",d:"M11.215 3.654v11.243a.996.996 0 01.498 0V3.653h-.498zM9.72 3.155v12.498l-8.187 4.31a.997.997 0 10.928 1.764l5.144-2.708a2.808 2.808 0 00.844.624c.69.349 1.684.59 3.015.59 1.33 0 2.325-.241 3.015-.59.344-.174.629-.382.837-.616.044-.05.089-.105.13-.165l6.054 2.882a.997.997 0 10.857-1.8l-9.149-4.356V9.135h1.744l-.478.638a.847.847 0 00.677 1.355h7c.793 0 1.151-.99.543-1.498l-2.09-1.741 2.09-1.741c.608-.507.25-1.498-.543-1.498h-3.71a.747.747 0 100 1.495h1.921L19.05 7.238a.847.847 0 000 1.302l1.312 1.093h-3.915l.478-.638a.903.903 0 00.058-.087.745.745 0 00.211-.52V3.902a.747.747 0 00-.747-.748h-3.239a.997.997 0 00-.997-.996h-1.494a.997.997 0 00-.997.996zm4.301 15.028l-2.534-1.207-2.448 1.288.084.045c.43.217 1.18.43 2.341.43 1.16 0 1.91-.213 2.341-.43.087-.044.158-.087.216-.126zM13.208 4.65v2.99H15.7V4.65h-2.492z",fill:"currentColor",fillRule:"evenodd"})}));l.defaultProps={color:"#207DE9"},s.default=l},51578:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 24 25",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("g",{"data-name":"Group 1436",children:(0,i.jsx)("path",{d:"M7.5 24l3-11h-4l3-12h8l-5 8h5z","data-name":"Path 3684",fill:"none",stroke:"currentColor",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2})}),(0,i.jsx)("path",{d:"M0 .5h24v24H0z","data-name":"Rectangle 2867",fill:"none"})]}));l.defaultProps={color:"#207DE9"},s.default=l},46038:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 22.88 23.749",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".grade_icon_svg__cls-1{fill:none;stroke:currentColor;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:.9px}"})}),(0,i.jsx)("g",{"data-name":"27-internet-school",id:"grade_icon_svg___27-internet-school",transform:"translate(-6.55 -.55)",children:(0,i.jsx)("g",{"data-name":"Group 1358",id:"grade_icon_svg__Group_1358",transform:"translate(7 1)",children:(0,i.jsx)("g",{"data-name":"Group 1357",id:"grade_icon_svg__Group_1357",children:(0,i.jsxs)("g",{"data-name":"Group 1356",id:"grade_icon_svg__Group_1356",children:[(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M25.836 10.2l4.836 3.077v-2.2L25.836 8 21 11.077v2.2z","data-name":"Path 3486",id:"grade_icon_svg__Path_3486",transform:"translate(-14.845 -4.923)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M32 4.077V1h4.4v1.758h-3.081","data-name":"Path 3488",id:"grade_icon_svg__Path_3488",transform:"translate(-21.01 -1)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M29 40.715v-4.4a1.319 1.319 0 012.638 0v4.4","data-name":"Path 3489",id:"grade_icon_svg__Path_3489",transform:"translate(-19.329 -20.053)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 11V0","data-name":"Line 1106",id:"grade_icon_svg__Line_1106",transform:"translate(7 9.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 11V0","data-name":"Line 1107",id:"grade_icon_svg__Line_1107",transform:"translate(15 9.299)"}),(0,i.jsx)("ellipse",{className:"grade_icon_svg__cls-1",cx:1,cy:1.5,"data-name":"Ellipse 812",id:"grade_icon_svg__Ellipse_812",rx:1,ry:1.5,transform:"translate(10 8.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M7 36.628V23h5.715","data-name":"Path 3490",id:"grade_icon_svg__Path_3490",transform:"translate(-7 -13.329)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M44 23h5.715v13.628","data-name":"Path 3491",id:"grade_icon_svg__Path_3491",transform:"translate(-27.734 -13.329)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M20.758 27H19v1.758h1.758","data-name":"Path 3492",id:"grade_icon_svg__Path_3492",transform:"translate(-13.725 -15.57)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M20.758 35H19v1.758h1.758","data-name":"Path 3493",id:"grade_icon_svg__Path_3493",transform:"translate(-13.725 -20.053)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h2v2H0z","data-name":"Rectangle 2400",id:"grade_icon_svg__Rectangle_2400",transform:"translate(2 11.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h2v1H0z","data-name":"Rectangle 2401",id:"grade_icon_svg__Rectangle_2401",transform:"translate(2 15.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M20.758 43H19v1.758h1.758","data-name":"Path 3494",id:"grade_icon_svg__Path_3494",transform:"translate(-13.725 -24.536)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h2v2H0z","data-name":"Rectangle 2402",id:"grade_icon_svg__Rectangle_2402",transform:"translate(2 18.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M41 27h1.758v1.758H41","data-name":"Path 3495",id:"grade_icon_svg__Path_3495",transform:"translate(-26.053 -15.57)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M41 35h1.758v1.758H41","data-name":"Path 3496",id:"grade_icon_svg__Path_3496",transform:"translate(-26.053 -20.053)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h2v2H0z","data-name":"Rectangle 2403",id:"grade_icon_svg__Rectangle_2403",transform:"translate(18 11.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h2v1H0z","data-name":"Rectangle 2404",id:"grade_icon_svg__Rectangle_2404",transform:"translate(18 15.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M41 43h1.758v1.758H41","data-name":"Path 3497",id:"grade_icon_svg__Path_3497",transform:"translate(-26.053 -24.536)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h2v2H0z","data-name":"Rectangle 2405",id:"grade_icon_svg__Rectangle_2405",transform:"translate(18 18.299)"}),(0,i.jsx)("path",{className:"grade_icon_svg__cls-1",d:"M0 0h4","data-name":"Line 1108",id:"grade_icon_svg__Line_1108",transform:"translate(9 13.299)"})]})})})})]}));l.defaultProps={color:"#207DE9"},s.default=l},933:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 40 40",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M31.753 30.37a.54.54 0 00-.539.54v4.29a.44.44 0 01-.439.438H9.224a.44.44 0 01-.44-.439V18.31a.54.54 0 10-1.078 0v16.89c0 .837.68 1.518 1.518 1.518h21.55a1.52 1.52 0 001.519-1.518V30.91a.539.539 0 00-.54-.54zM25.154 4.362H9.226a.44.44 0 00-.44.44v11.55a.54.54 0 11-1.078 0V4.8
202c0-.838.68-1.518 1.518-1.518h16.467c.142 0 .28.057.381.157h0l6.063 6.063h0a.54.54 0 01.157.363h0l-7.14-5.505zm0 0v4.545c0 .837.68 1.517 1.517 1.517h4.545v18.529a.54.54 0 101.079 0V9.885v-.011l-.001-.006-7.14-5.506zm1.517 4.984a.44.44 0 01-.439-.44V5.126l4.222 4.22H26.67z",fill:"#7A55D8",stroke:"#7A55D8",strokeWidth:.1}),(0,i.jsx)("path",{d:"M19.54 6.322h0l-.666.293-.046-.02s0 0 0 0a.54.54 0 00.273.712h0a4.453 4.453 0 012.634 4.06 4.45 4.45 0 01-4.445 4.445 4.45 4.45 0 01-4.445-4.445 4.45 4.45 0 014.445-4.445.54.54 0 100-1.078 5.53 5.53 0 00-5.524 5.523 5.53 5.53 0 005.524 5.524 5.53 5.53 0 005.523-5.524 5.533 5.533 0 00-3.272-5.045zM15.575 18.856h0a.54.54 0 00-.763-.009l-1.569 1.534-.624-.726h0a.54.54 0 00-.76-.057h0a.54.54 0 00-.058.76s0 0 0 0l.999 1.161c.193.234.573.25.786.034l1.98-1.934a.54.54 0 00.008-.763zM28.249 18.486H17.942a.54.54 0 100 1.078H28.25a.54.54 0 000-1.078zM17.403 21.376v0c0 .298.242.54.54.54h5.863a.54.54 0 100-1.08h-5.864a.54.54 0 00-.539.54zM13.243 25.73l-.624-.726h0a.54.54 0 00-.76-.057h0a.54.54 0 00-.058.76l.999 1.161c.193.234.573.25.786.034l1.98-1.934a.54.54 0 00.008-.763h0a.54.54 0 00-.762-.008l-1.569 1.533zM28.249 23.835H17.942a.54.54 0 100 1.078H28.25a.54.54 0 000-1.078zM17.403 26.725v0c0 .298.242.54.54.54h5.863a.54.54 0 000-1.08h-5.864a.54.54 0 00-.539.54zM15.575 29.555h0a.54.54 0 00-.763-.009l-1.569 1.533-.624-.725h0a.54.54 0 00-.76-.057h0a.54.54 0 00-.058.76l.999 1.16c.193.235.573.251.786.035l1.98-1.935a.54.54 0 00.008-.762zM28.788 29.723a.54.54 0 00-.54-.539H17.943a.54.54 0 100 1.079H28.25a.54.54 0 00.539-.54zM17.942 31.535a.54.54 0 100 1.079h5.864a.54.54 0 000-1.079h-5.864z",fill:"#7A55D8",stroke:"#7A55D8",strokeWidth:.1}),(0,i.jsx)("path",{d:"M15 8.85c0-.331.28-.6.625-.6h2.016c.726 0 1.287.157 1.684.471.376.29.564.663.564 1.12 0 .338-.104.628-.312.868-.202.24-.488.41-.857.509a1.7 1.7 0 01.917.462c.242.234.363.536.363.906 0 .74-.4 1.245-1.2 1.516-.302.099-.685.148-1.149.148h-2.026a.613.613 0 01-.625-.6v-4.8zm2.621 4.448c.383 0 .659-.071.827-.213a.69.69 0 00.262-.564.68.68 0 00-.273-.564c-.174-.148-.446-.222-.816-.222h-1.119a.306.306 0 00-.313.3v.963c0 .166.14.3.313.3h1.119zm-1.431-2.815c0 .166.14.3.312.3h1.089c.356 0 .625-.07.806-.213a.69.69 0 00.272-.573c0-.246-.09-.44-.272-.582-.175-.148-.44-.222-.796-.222h-1.099a.306.306 0 00-.313.3v.99z",fill:"#7A55D8"})]}));l.defaultProps={color:"#008087"},s.default=l},55293:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 25 25",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("path",{d:"M2.49854 9.87C2.49854 10.4941 3.00445 11 3.62854 11H10.3685C10.9926 11 11.4985 10.4941 11.4985 9.87V3.13C11.4985 2.50592 10.9926 2 10.3685 2H3.62854C3.00445 2 2.49854 2.50592 2.49854 3.13V9.87ZM15.6285 2C15.0045 2 14.4985 2.50592 14.4985 3.13V9.87C14.4985 10.4941 15.0045 11 15.6285 11H22.3685C22.9926 11 23.4985 10.4941 23.4985 9.87V3.13C23.4985 2.50592 22.9926 2 22.3685 2H15.6285ZM2.49854 21.87C2.49854 22.4941 3.00445 23 3.62854 23H10.3685C10.9926 23 11.4985 22.4941 11.4985 21.87V15.13C11.4985 14.5059 10.9926 14 10.3685 14H3.62854C3.00445 14 2.49854 14.5059 2.49854 15.13V21.87Z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M15.6285 23C15.0045 23 14.4985 22.4941 14.4985 21.87V15.13C14.4985 14.5059 15.0045 14 15.6285 14H22.3685C22.9926 14 23.4985 14.5059 23.4985 15.13V21.87C23.4985 22.4941 22.9926 23 22.3685 23H15.6285Z",fill:"currentColor"})]}));l.defaultProps={color:"#207DE9"},s.default=l},84648:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 18 18",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M16.2 0H1.8C.81 0 0 .81 0 1.8v14.4c0 .99.81 1.8 1.8 1.8h14.4c.99 0 1.8-.81 1.8-1.8V1.8c0-.99-.81-1.8-1.8-1.8zM5.4 16.2H1.8v-3.6h3.6v3.6zm0-5.4H1.8V7.2h3.6v3.6zm0-5.4H1.8V1.8h3.6v3.6zm5.4 10.8H7.2v-3.6h3.6v3.6zm0-5.4H7.2V7.2h3.6v3.6zm0-5.4H7.2V1.8h3.6v3.6zm5.4 10.8h-3.6v-3.6h3.6v3.6zm0-5.4h-3.6V7.2h3.6v3.6zm0-5.4h-3.6V1.8h3.6v3.6z",fill:"
2currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},27293:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 120 120",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M109.801 42.246L80.898 59.474a5.055 5.055 0 00-2.128 6.136 5.404 5.404 0 01-4.052.055l-3.739-1.469a7.573 7.573 0 00-4.656-.295l-5.728 1.45c-.223.056-.44.122-.653.197-3.5-1.999-5.585-2.596-9.278-1.168l-3.316 1.282a5.418 5.418 0 01-4.743-.396l-1.107-.653a5.054 5.054 0 00-2.396-5.139L10.2 42.246C7.908 40.881 5 42.53 5 45.2v32.264a6.387 6.387 0 003.102 5.46l12.62 7.523a5.04 5.04 0 006.826-1.608l.54.319-1.637 2.279a5.667 5.667 0 001.3 7.912 5.63 5.63 0 004.294.977 5.635 5.635 0 002.3 3.757 5.651 5.651 0 004.296.974 5.667 5.667 0 007.945 4.32 5.627 5.627 0 002.024 2.67 5.676 5.676 0 007.717-1.042l4.239 2.511a5.674 5.674 0 008.54-4.379l.164.098a5.633 5.633 0 004.297.615 5.635 5.635 0 003.473-2.603 5.647 5.647 0 00.787-2.606 5.64 5.64 0 002.922.027 5.636 5.636 0 003.473-2.604 5.64 5.64 0 00.777-2.445 5.68 5.68 0 007.086-2.333 5.68 5.68 0 00-.627-6.644l1.66-.97a5.043 5.043 0 006.16.775l3.051-1.819a1.612 1.612 0 00-1.649-2.768l-3.051 1.818a1.821 1.821 0 01-2.16-.218c-.01-.09-13.555-22.726-13.555-22.726a1.824 1.824 0 01.634-2.492l28.903-17.228a.215.215 0 01.327.186v32.263a3.15 3.15 0 01-1.53 2.693l-3.046 1.816a1.612 1.612 0 101.649 2.768l3.047-1.816a6.388 6.388 0 003.102-5.46V45.2c0-2.668-2.905-4.322-5.199-2.954zm-42.687 24.78a4.375 4.375 0 012.687.17l3.747 1.472c2.236.864 4.68.77 6.81-.237l10.987 18.545-1.78 1.04a8.633 8.633 0 00-.93.636L65.138 74.737a1.611 1.611 0 00-2.433 1.386v.324a4.26 4.26 0 01-1.257 3.034 4.261 4.261 0 01-3.032 1.256.36.36 0 01-.35-.35v-7.648c0-1.666.933-3.153 2.36-3.898.07-.029.14-.063.207-.101.238-.11.49-.198.752-.265l5.729-1.45zm-43.36 20.853a1.81 1.81 0 01-1.382-.2l-12.62-7.523a3.15 3.15 0 01-1.53-2.692V45.2c0-.034 0-.126.11-.188a.219.219 0 01.109-.031c.052 0 .09.022.108.033l28.903 17.228c.86.513 1.145 1.63.634 2.492L24.87 87.043a1.808 1.808 0 01-1.117.836zm7.7 9.28a2.431 2.431 0 01-1.825-.428 2.431 2.431 0 01-.987-1.59 2.43 2.43 0 01.427-1.825l2.299-3.202c.056-.078.116-.152.179-.221.048-.043.093-.089.136-.138a2.452 2.452 0 013.1-.201 2.45 2.45 0 01.56 3.415l-.003.005-2.296 3.197a2.43 2.43 0 01-1.59.987zm4.77 4.306a2.43 2.43 0 01-.988-1.591 2.43 2.43 0 01.427-1.824l2.298-3.202 2.538-3.534a2.431 2.431 0 011.993-1.02 2.45 2.45 0 011.983 3.875l-4.837 6.736a2.45 2.45 0 01-3.415.56zm8.417 5.16a2.431 2.431 0 01-1.824-.426 2.45 2.45 0 01-.56-3.415l.003-.006 4.833-6.73a2.45 2.45 0 013.415-.562c.53.382.881.947.987 1.592a2.431 2.431 0 01-.427 1.823l-4.836 6.737a2.427 2.427 0 01-1.591.987zm5.849 2.804a2.43 2.43 0 01-.988-1.591 2.43 2.43 0 01.432-1.83l1.605-2.236a2.45 2.45 0 013.413-.558 2.45 2.45 0 01.56 3.415l-.919 1.281c-.01.012-.019.026-.028.039l-.66.92a2.45 2.45 0 01-3.415.56zm38.822-13.786a2.451 2.451 0 01-3.354.859l-3.725-2.207c-.002 0-.003-.002-.005-.003l-11.537-6.835a1.611 1.611 0 10-1.642 2.772l11.542 6.838.002.002a2.452 2.452 0 01.856 3.353 2.43 2.43 0 01-1.499 1.124 2.43 2.43 0 01-1.855-.266l-3.037-1.799-.007-.004-.005-.003-8.499-5.035a1.611 1.611 0 10-1.643 2.772l8.5 5.036.005.003a2.43 2.43 0 011.124 1.499 2.433 2.433 0 01-.266 1.855 2.43 2.43 0 01-1.5 1.124 2.434 2.434 0 01-1.854-.265l-4.557-2.7-.009-.005-3.332-1.975a1.612 1.612 0 00-1.643 2.773l3.333 1.974.004.003a2.451 2.451 0 01.855 3.352 2.452 2.452 0 01-3.355.858l-3.989-2.363a5.677 5.677 0 00-1.388-7.785 5.645 5.645 0 00-2.489-1.003 5.632 5.632 0 00.333-3.036 5.633 5.633 0 00-2.288-3.687 5.655 5.655 0 00-4.297-.974 5.653 5.653 0 00-2.297-3.76 5.634 5.634 0 00-4.226-.989 5.625 5.625 0 00-3.216 1.715 5.64 5.64 0 00-1.69-1.926 5.68 5.68 0 00-6.326-.192l-1.142-.675 10.963-18.505.81.477a8.635 8.635 0 004.41 1.216 8.684 8.684 0 003.134-.588l3.316-1.282c1.982-.766 3.046-.802 5.047.172a7.61 7.61 0 00-2.03 5.181v7.647c0 1.969 1.6 3.572 3.568 3.573h.005c2.005 0 3.891-.78 5.31-2.198a7.478 7.478 0 001.847-3.02l22.444 13.29c.074.044.15.081.228.112.065.053.134.103.209.147a2.451 2.451 0 01.857 3.353z",fill:"
2currentColor"}),(0,i.jsx)("path",{d:"M41.529 47.679H78.47a6.072 6.072 0 006.066-6.066V19.634a6.072 6.072 0 00-6.066-6.065h-8.892v-2.554a5.328 5.328 0 00-5.322-5.322h-8.514a5.328 5.328 0 00-5.32 5.322v2.554h-8.893a6.072 6.072 0 00-6.066 6.065v12.108a1.611 1.611 0 103.223 0v-2.995a9.644 9.644 0 006.46 2.476h1.26v1.773a1.611 1.611 0 103.224 0v-1.773h20.74v1.773a1.611 1.611 0 103.222 0v-1.773h1.26c2.48 0 4.746-.937 6.461-2.476v12.866a2.846 2.846 0 01-2.843 2.843H41.529a2.846 2.846 0 01-2.843-2.843v-2.338a1.611 1.611 0 10-3.223 0v2.338a6.073 6.073 0 006.066 6.066zm12.115-36.664c0-1.157.942-2.099 2.099-2.099h8.514c1.157 0 2.098.942 2.098 2.1v2.553h-12.71v-2.554zm21.21 16.986h-1.262v-1.773a1.611 1.611 0 10-3.222 0v1.773H49.63v-1.773a1.611 1.611 0 10-3.223 0v1.773h-1.26a6.467 6.467 0 01-6.46-6.46v-1.907a2.846 2.846 0 012.842-2.843h36.942a2.846 2.846 0 012.843 2.843v1.907a6.467 6.467 0 01-6.46 6.46z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},55132:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{clipRule:"evenodd",d:"M8.72 1c-1.098 0-2.082.547-2.76 1.395-.674.843-1.023 1.94-1.023 3.044v11.076l-3.683 4.604A1.158 1.158 0 002.158 23h17.06c1.097 0 2.08-.547 2.76-1.395.673-.843 1.022-1.94 1.022-3.044V5.44c0-1.104-.349-2.201-1.022-3.044C21.298 1.547 20.315 1 19.218 1H8.719zm-.952 2.842c.305-.381.656-.526.951-.526h10.499c.294 0 .646.145.951.526.31.388.515.96.515 1.597V18.56c0 .637-.204 1.209-.515 1.597-.305.381-.657.526-.951.526H4.568l2.43-3.04c.165-.205.255-.46.255-.723V5.439c0-.637.204-1.209.515-1.597zm2.206 1.21a.868.868 0 100 1.737H17.5a.868.868 0 000-1.736H9.974zm-.869 5.5c0-.479.39-.868.869-.868H17.5a.868.868 0 110 1.737H9.974a.868.868 0 01-.869-.868zm.869 3.764a.868.868 0 100 1.737h5.21a.868.868 0 000-1.737h-5.21z",fill:"currentColor",fillRule:"evenodd"})}));l.defaultProps={color:"#207DE9"},s.default=l},85550:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 39.44 36.485",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".img_icon_plus_svg__prefix__cls-3{fill:none;stroke:currentColor;stroke-linecap:round;stroke-width:1.5px;stroke-linejoin:round}"})}),(0,i.jsx)("g",{"data-name":"Group 1659",id:"img_icon_plus_svg__prefix__Group_1659",transform:"translate(-396.999 -736.265)",children:(0,i.jsx)("g",{"data-name":"Group 1669",id:"img_icon_plus_svg__prefix__Group_1669",children:(0,i.jsx)("g",{"data-name":"Group 1668",id:"img_icon_plus_svg__prefix__Group_1668",children:(0,i.jsx)("g",{"data-name":"Group 1667",id:"img_icon_plus_svg__prefix__Group_1667",children:(0,i.jsx)("g",{"data-name":"Group 1666",id:"img_icon_plus_svg__prefix__Group_1666",children:(0,i.jsx)("g",{"data-name":"Group 1665",id:"img_icon_plus_svg__prefix__Group_1665",children:(0,i.jsx)("g",{"data-name":"Group 1664",id:"img_icon_plus_svg__prefix__Group_1664",children:(0,i.jsx)("g",{"data-name":"Group 1663",id:"img_icon_plus_svg__prefix__Group_1663",children:(0,i.jsx)("g",{"data-name":"Group 1662",id:"img_icon_plus_svg__prefix__Group_1662",children:(0,i.jsxs)("g",{"data-name":"Group 1661",id:"img_icon_plus_svg__prefix__Group_1661",children:[(0,i.jsx)("path",{d:"M24.861 32.682H4.358A4.363 4.363 0 010 28.325V4.358A4.363 4.363 0 014.358 0H30.5a4.363 4.363 0 014.358 4.358v17.2a7.943 7.943 0 00-2.179-.518V4.358A2.181 2.181 0 0030.5 2.179H4.358a2.181 2.181 0 00-2.179 2.179v23.967a2.19 2.19 0 00.074.565l11.14-11.14a1.09 1.09 0 011.541 0l7.945 7.95 3.587-3.587a1.089 1.089 0 011.493-.045 7.965 7.965 0 00-3.88 5.513l-.43.43a1.09 1.09 0 01-1.541 0l-7.945-7.951L3.794 30.43a2.179 2.179 0 00.564.073H24.1a7.925 7.925 0 00.761 2.178zM20.7 16.342a4.358 4.358 0 114.358-4.358 4.363 4.363 0 01-4.358 4.358zm0-6.537a2.179 2.179 0 102.179 2.179A2.181 2.181 0 0020.7 9.8z","data-name":"Subtraction 9",fill:"
2currentColor",id:"img_icon_plus_svg__prefix__Subtraction_9",transform:"translate(396.999 736.265)"}),(0,i.jsxs)("g",{id:"img_icon_plus_svg__prefix__c-add",transform:"translate(422.176 758.487)",children:[(0,i.jsx)("path",{d:"M6.756 0A6.756 6.756 0 110 6.756 6.756 6.756 0 016.756 0z","data-name":"Path 4054",fill:"none",id:"img_icon_plus_svg__prefix__Path_4054",stroke:"currentColor",strokeLinecap:"round",strokeWidth:1.5}),(0,i.jsx)("path",{className:"img_icon_plus_svg__prefix__cls-3",d:"M0 0v6","data-name":"Line 1436",id:"img_icon_plus_svg__prefix__Line_1436",transform:"translate(6.824 4.012)"}),(0,i.jsx)("path",{className:"img_icon_plus_svg__prefix__cls-3",d:"M0 0h6","data-name":"Line 1437",id:"img_icon_plus_svg__prefix__Line_1437",transform:"translate(3.824 7.013)"})]})]})})})})})})})})})})]}));l.defaultProps={color:"#207DE9"},s.default=l},72551:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",id:"info_icon_svg__interface-information",viewBox:"0 0 11.611 11.611",width:"1em"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".info_icon_svg__cls-2{fill:currentColor}"})}),(0,i.jsx)("g",{id:"info_icon_svg__Frame_-_24px",children:(0,i.jsx)("path",{d:"M0 0h11.611v11.611H0z","data-name":"Rectangle 744",fill:"none",id:"info_icon_svg__Rectangle_744"})}),(0,i.jsx)("g",{id:"info_icon_svg__Line_Icons",transform:"translate(.968 .968)",children:(0,i.jsxs)("g",{"data-name":"Group 579",id:"info_icon_svg__Group_579",children:[(0,i.jsx)("g",{"data-name":"Group 577",id:"info_icon_svg__Group_577",children:(0,i.jsx)("path",{className:"info_icon_svg__cls-2",d:"M6.838 11.676a4.838 4.838 0 114.838-4.838 4.843 4.843 0 01-4.838 4.838zm0-8.708a3.87 3.87 0 103.87 3.87 3.875 3.875 0 00-3.87-3.87z","data-name":"Path 2224",id:"info_icon_svg__Path_2224",transform:"translate(-2 -2)"})}),(0,i.jsx)("path",{className:"info_icon_svg__cls-2",d:"M10.935 12.419v-1.935a.484.484 0 00-.484-.484h-.967v.968h.484v1.451H9v.968h2.9v-.968z","data-name":"Path 2225",id:"info_icon_svg__Path_2225",transform:"translate(-5.613 -6.13)"}),(0,i.jsx)("g",{"data-name":"Group 578",id:"info_icon_svg__Group_578",transform:"translate(4.233 2.298)",children:(0,i.jsx)("circle",{className:"info_icon_svg__cls-2",cx:.605,cy:.605,"data-name":"Ellipse 98",id:"info_icon_svg__Ellipse_98",r:.605})})]})})]}));l.defaultProps={color:"#008087"},s.default=l},69748:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 21 20",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsxs)("g",{clipPath:"url(#magnifier_svg__clip0)",stroke:"currentColor",children:[(0,i.jsx)("path",{d:"M15.984 8.837c-.844 3.148-3.674 4.882-6.135 4.223-2.462-.66-4.046-3.577-3.202-6.725.843-3.148 3.674-4.882 6.135-4.223 2.461.66 4.046 3.577 3.202 6.725zM8.138 13.278c-.583 1.004-1.057 2.066-1.189 2.558a2.084 2.084 0 004.025 1.078c.132-.492.252-1.648.249-2.81",strokeWidth:2}),(0,i.jsx)("path",{d:"M9.384 8.12l3.804-2.196M9.626 5.597l1.253-.724",strokeLinecap:"round",strokeWidth:1.5})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"magnifier_svg__clip0",children:(0,i.jsx)("path",{d:"M0 0h20v20H0z",fill:"#fff",transform:"translate(.668)"})})})]}))}},6707:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M13.67 5.351L1.325 7.833a.896.896 0 00-.705 1.06l3.43 17.051a.9.9 0 001.06.705l12.348-2.481a.9.9 0 00.704-1.061L14.728 6.056a.894.894 0 00-1.057-.705zM8.687 18.586a.451.451 0 01-.69.465l-1.574-1.08-1.031.207a.449.449 0 01-.529-.352l-.412-2.058a.449.449 0 01.352-.529l1.031-.206 1.035-1.604a.45.45 0 01.817.16l1 4.997zm.87-1.994a.89.89 0 00-.248-1.225c-.982-.675.034-2.156 1.016-1.485a2.697 2.697 0 01.742 3.689c-.637.978-2.167.037-1.51-.979zm3.778 2.44c-.638.986-2.17.042-1.511-.978a3.593 3.593 0 00-.99-4.918c-.982-.674.038-2.159 1.016-1.484a5.4 5.4 0 011.485 7.38zM23.742 10.052l-.004-.23a.905.905 0 00-.277-.629l-3.763-3.58a.89.89 0 00-.641-.247l-.225.004.116 4.798 4.794-.116z",fill:"
2currentColor"}),(0,i.jsx)("path",{d:"M31.39 8.646l-2.61 17.197a.898.898 0 01-1.023.753l-7.429-1.128 2.886-.067a1.834 1.834 0 001.792-1.882l-.109-4.55 2.324.352a.452.452 0 00.514-.379l.045-.296a.452.452 0 00-.379-.513l-2.534-.386-.03-1.218 2.744.416a.452.452 0 00.514-.38l.045-.291a.452.452 0 00-.379-.514l-2.95-.45-.03-1.218 3.16.48a.452.452 0 00.513-.379l.045-.292a.452.452 0 00-.378-.514l-3.37-.51-.075-3.08a1.817 1.817 0 00-.57-1.286l-2.354-2.242 8.884 1.35a.904.904 0 01.753 1.027z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M24.065 23.541l-.292-12.29-5.098.12a.903.903 0 01-.922-.877l-.12-5.098-2.121.053c.063.13.108.273.138.42l2.294 11.42 1.987-2.08c.547-.577 1.533-.206 1.552.6l.1 4.194c.02.802-.944 1.222-1.52.671l-1.778-1.69.791 3.94a1.827 1.827 0 01-.49 1.648l4.599-.108a.9.9 0 00.88-.922z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},8739:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 11.233 27.221",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".pencil_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{"data-name":"19-Pencil",id:"pencil_svg___19-Pencil",transform:"translate(-8.587)",children:[(0,i.jsx)("path",{className:"pencil_svg__cls-1",d:"M18.407 6.044v16.814a3.363 3.363 0 01-3.363 3.363h-1.681A3.363 3.363 0 0110 22.858V6.044L14.2 1z","data-name":"Path 3558",id:"pencil_svg__Path_3558"}),(0,i.jsx)("path",{className:"pencil_svg__cls-1",d:"M10 23a6.432 6.432 0 004.2 1.681A6.432 6.432 0 0018.407 23","data-name":"Path 3559",id:"pencil_svg__Path_3559",transform:"translate(0 -3.504)"}),(0,i.jsx)("path",{className:"pencil_svg__cls-1",d:"M10 7l4.2.841L18.407 7","data-name":"Path 3560",id:"pencil_svg__Path_3560",transform:"translate(0 -.956)"}),(0,i.jsx)("path",{className:"pencil_svg__cls-1",d:"M0 0v14","data-name":"Line 1139",id:"pencil_svg__Line_1139",transform:"translate(14 7)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},51719:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M13.776 12.31c.915.82 1.861.914 2.177.914h.063c.22 0 1.23 0 2.208-.883 1.135-1.072 1.734-2.902 1.734-5.456a.474.474 0 00-.315-.442c-1.262-.473-2.05-.852-3.312-1.86-.158-.127-.41-.127-.6-.001-1.292 1.01-2.08 1.388-3.343 1.861a.474.474 0 00-.315.442c-.032 2.523.536 4.384 1.703 5.425zm2.208-6.782c1.104.852 1.893 1.262 2.997 1.672-.032 2.082-.537 3.596-1.388 4.416-.757.694-1.514.662-1.546.662h-.063c-.031 0-.82.032-1.577-.662-.883-.82-1.356-2.334-1.388-4.416 1.073-.41 1.861-.82 2.965-1.672z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M27.024 1.333H10.118C8.54 1.46 7.31 2.816 7.31 4.393v20.155h-4.7a.485.485 0 00-.472.473v2.839c.126 1.576 1.482 2.807 3.06 2.807h16.4c.852 0 1.64-.347 2.24-.978a3.093 3.093 0 00.852-2.113V7.452h4.7c.252 0 .472-.22.472-.473V4.393c-.031-1.577-1.261-2.934-2.838-3.06zM5.197 29.72a2.128 2.128 0 01-2.113-1.955v-.19-2.081h15.455v2.113c0 .379.063.789.22 1.136l.19.378c0 .032.032.063.032.063.063.126.157.221.22.316l.032.031c.032.063.095.095.126.158H5.197v.031zm18.515-2.113c0 .536-.22 1.041-.568 1.451-.41.442-.946.662-1.545.662-.221 0-.442-.031-.631-.094-.6-.19-1.104-.631-1.325-1.23a2.338 2.338 0 01-.158-.789v-2.586a.485.485 0 00-.473-.473H8.257V4.393c0-1.104.851-2.019 1.955-2.113h14.352l-.032.031c-.032.063-.095.095-.126.158 0 0 0 .031-.032.031-.031.063-.094.127-.126.19-.284.41-.442.883-.505 1.387v23.53h-.031zm5.173-21.1h-4.227V4.203a2.73 2.73 0 01.19-.726 2.042 2.042 0 011.356-1.135c.126-.032.252-.063.378-.063h.347a2.128 2.128 0 011.956 2.113v2.113z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M15.543 11.237a.45.45 0 00.378-.189l1.735-2.429a.49.49 0 00-.095-.662.49.49 0 00-.662.095l-1.357 1.892-.473-.662c-.157-.221-.441-.253-.662-.095-.22.158-.252.442-.095.662l.884 1.23c.063.095.189.158.347.158zM20.652 20.447h-9.367a.485.485 0 00-.473.474c0 .252.22.473.473.473h9.367c.253 0 .473-.221.473-.473a.485.485 0 00-.473-.474zM20.652 17.956h-9.367a.485.485 0 00-.473.473c0 .252.22.473.473.473h9.367c.253 0 .473-.221.473-.473a.485.485 0 00-.473-.473zM20.652 15.495h-9.367a.485.485 0 00-.473.473c0 .253.22.474.473.474h9.367c.253 0 .473-.221.473-.474a.485.485 0 00-.473-.473z",fill:"
2currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},19894:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M20 11a2.962 2.962 0 00-1 .184V5h-6.184A2.962 2.962 0 0013 4a3 3 0 00-6 0 2.962 2.962 0 00.184 1H1v6a3 3 0 010 6v6h6a3 3 0 016 0h6v-6.184A2.962 2.962 0 0020 17a3 3 0 000-6z","data-name":"Path 3846",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2})}));l.defaultProps={color:"#207DE9"},s.default=l},35375:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M30.234 22.299h-2.44v-.03c.217-.279.31-.618.31-.958 0-.895-.71-1.606-1.606-1.606-.896 0-1.637.71-1.637 1.606 0 .37.124.68.31.957l-2.378.031a.422.422 0 00-.433.432v2.81c0 .062 0 .154.031.216.062.185.216.278.402.278h.617c.124 0 .216-.03.309-.123a.729.729 0 01.494-.216c.401 0 .741.34.741.771 0 .402-.34.742-.741.742a.615.615 0 01-.494-.217.396.396 0 00-.309-.123h-.617a.426.426 0 00-.402.309c-.03.061-.03.123-.03.154v2.872c0 .247.185.432.432.432h7.441a.422.422 0 00.432-.432V22.73a.422.422 0 00-.432-.432zm-.432 7.472h-6.577v-2.007h.03c.279.216.618.309.958.309.895 0 1.606-.71 1.606-1.606 0-.895-.71-1.636-1.606-1.636-.37 0-.68.123-.957.309l-.031-2.007h2.408c.093 0 .186-.031.278-.093a.498.498 0 00.185-.401v-.556a.397.397 0 00-.123-.309.701.701 0 01-.185-.494c0-.401.34-.741.772-.741.401 0 .74.34.74.741 0 .185-.061.37-.
2185.494a.397.397 0 00-.123.309v.617c0 .093.03.155.062.247.092.155.247.217.432.217h2.377v6.607h-.061zM22.299 17.142v.68c0 .092.03.185.092.278a.496.496 0 00.34.154h3.088c.123 0 .216-.03.308-.123a.397.397 0 00.124-.31V1.798a.422.422 0 00-.432-.433H1.765a.422.422 0 00-.432.433v24.022c0 .247.185.432.432.432h16.026c.123 0 .216-.03.308-.123a.396.396 0 00.124-.309v-2.655h.093c.277.216.648.34 1.018.34.927 0 1.699-.773 1.699-1.699 0-.957-.772-1.698-1.699-1.698-.37 0-.74.123-1.018.34h-.093v-2.224h2.624c.093 0 .155-.03.247-.061.124-.093.216-.217.216-.371v-.68a.396.396 0 00-.123-.308.745.745 0 01-.216-.556.83.83 0 01.834-.834.83.83 0 01.617 1.39.514.514 0 00-.123.34zm3.056-7.75h-2.624a.498.498 0 00-.278.093.427.427 0 00-.185.34v.679c0 .123.03.216.123.309.155.154.216.34.216.555a.83.83 0 01-.833.834.83.83 0 01-.618-1.39.397.397 0 00.124-.308v-.68a.581.581 0 00-.062-.246.44.44 0 00-.37-.186h-2.625V7.2h.093c.277.216.648.34 1.018.34.927 0 1.699-.772 1.699-1.699 0-.957-.772-1.698-1.699-1.698-.37 0-.74.124-1.018.34h-.093V2.229h7.133v7.163zm-9.108 6.145c.37 0 .74-.124 1.019-.34h.092v2.193h-2.624a.498.498 0 00-.278.092.426.426 0 00-.185.34v.68c0 .123.03.215.123.308.154.154.216.34.216.556a.83.83 0 01-.833.833.83.83 0 01-.618-1.39.397.397 0 00.123-.308v-.68a.581.581 0 00-.061-.246.44.44 0 00-.37-.185h-2.625v-2.193h.092c.278.216.649.34 1.02.34.926 0 1.698-.772 1.698-1.698 0-.957-.772-1.699-1.699-1.699-.37 0-.74.124-1.019.34h-.092v-2.223h2.593c.093 0 .216-.031.31-.093.123-.092.154-.247.154-.401v-.618a.397.397 0 00-.124-.308.744.744 0 01-.216-.556.83.83 0 01.834-.834.83.83 0 01.617 1.39.396.396 0 00-.123.308v.649c0 .061 0 .154.03.216.062.154.217.247.402.247h2.655v2.223h-.092a1.685 1.685 0 00-1.02-.34c-.926 0-1.698.772-1.698 1.699-.03.926.742 1.698 1.699 1.698zM5.779 14.58c-.957 0-1.698.772-1.698 1.698 0 .37.124.741.34 1.019v.093H2.198v-7.133H4.42v.093c-.216.277-.34.648-.34 1.018 0 .927.772 1.699 1.698 1.699.958 0 1.699-.772 1.699-1.699 0-.37-.
2124-.74-.34-1.018v-.093H9.36v2.594c0 .061 0 .154.03.216.063.185.217.278.402.278h.649c.123 0 .216-.031.309-.124a.744.744 0 01.555-.216.83.83 0 01.834.834.83.83 0 01-1.39.617.397.397 0 00-.308-.123h-.68a.44.44 0 00-.4.278c-.032.061-.032.123-.032.185v2.594H7.107v-.093c.216-.278.34-.649.34-1.02.03-.925-.741-1.697-1.668-1.697zm4.2-9.294a.401.401 0 00.247-.37V2.228h7.132v2.593c0 .062 0 .155.031.217.062.185.216.278.402.278h.679c.123 0 .216-.031.309-.124a.744.744 0 01.555-.216.83.83 0 01.834.834.83.83 0 01-1.39.617.396.396 0 00-.308-.123h-.68a.44.44 0 00-.4.277c-.032.062-.032.124-.032.186V9.36h-2.223V9.27c.216-.278.34-.649.34-1.02 0-.925-.772-1.697-1.698-1.697-.958 0-1.699.772-1.699 1.698 0 .37.124.74.34 1.019v.092h-2.192V6.737a.401.401 0 00-.247-.37.573.573 0 00-.217-.062h-.648a.396.396 0 00-.309.123.744.744 0 01-.556.216.83.83 0 01-.833-.833.83.83 0 011.39-.618.396.396 0 00.308.124h.618c.092 0 .185 0 .247-.031zM9.36 2.229v2.223h-.093a1.685 1.685 0 00-1.019-.34c-.926 0-1.698.772-1.698 1.699 0 .957.772 1.698 1.698 1.698.371 0 .742-.124 1.02-.34h.092v2.192H6.706a.498.498 0 00-.278.093.427.427 0 00-.186.34v.679c0 .123.031.216.124.309.154.154.216.34.216.556a.83.83 0 01-.834.833.83.83 0 01-.617-1.39.396.396 0 00.123-.308v-.648a.582.582 0 00-.061-.247.44.44 0 00-.37-.186H2.197V2.23H9.36zM2.198 18.254h2.655c.093 0 .154-.03.247-.062.124-.092.216-.216.216-.37v-.68a.397.397 0 00-.123-.308.744.744 0 01-.216-.556.83.83 0 01.833-.834.83.83 0 01.618 1.39.397.397 0 00-.124.308v.68c0 .123.062.216.124.309a.397.397 0 00.309.123h2.655v2.223h-.093a1.685 1.685 0 00-1.019-.34c-.926 0-1.698.773-1.698 1.699 0 .957.772 1.698 1.698 1.698.37 0 .741-.123 1.02-.34h.092v2.193H2.259v-7.133h-.061zm16.272 3.088c.123 0 .216-.031.309-.124a.744.744 0 01.555-.216.83.83 0 01.834.834.83.83 0 01-1.39.617.396.396 0 00-.308-.123h-.68a.44.44 0 00-.4.278c-.032.061-.032.123-.032.185v2.594h-7.132V22.73a.401.401 0 00-.247-.37.572.572 0 00-.217-.062h-.648a.397.397 0 00-.309.123.744.744 0 01-.556.217.83.83 0 01-.833-.834.83.83 0 011.39-.618.397.397 0 00.308.124h.618c.092 0 .154 0 .247-.031a.401.401 0 00.247-.37v-2.656h2.192v.093c-.216.278-.34.648-.34 1.019 0 .926.772 1.698 1.699 1.698.957 0 1.698-.772 1.698-1.698 0-.37-.124-.741-.34-1.02v-.092h2.223v2.594c0 .062 0 .154.031.216.062.185.216.278.402.278h.679zm3.335-6.762c-.958 0-1.699.772-1.699 1.698 0 .37.124.741.34 1.019v.093h-2.223v-2.656a.428.428 0 00-.216-.37.582.582 0 00-.247-.062h-.649a.396.396 0 00-.309.123.744.744 0 01-.555.216.83.83 0 01-.834-.833.83.83 0 011.39-.618.396.396 0 00.308.124h.618c.092 0 .185 0 .247-.062a.429.429 0 00.216-.37v-2.656h2.223v.093c-.216.277-.34.648-.34 1.019 0 .926.772 1.698 1.699 1.698.957 0 1.698-.772 1.698-1.698 0-.37-.124-.741-.34-1.02v-.092h2.223v7.133h-2.223v-.093c.216-.278.34-.648.34-1.019.03-.895-.741-1.667-1.667-1.667z",fill:"currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},13731:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M6.711 24.8a2.447 2.447 0 002.445-2.445 2.447 2.447 0 00-2.445-2.444 2.447 2.447 0 00-2.444 2.444A2.447 2.447 0 006.71 24.8zm0-3.911c.809 0 1.467.658 1.467 1.466 0 .81-.658 1.467-1.467 1.467a1.468 1.468 0 01-1.466-1.466c0-.81.658-1.467 1.466-1.467z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M1.822 23.822h.744c.052.145.111.288.177.427l-.526.527a.488.488 0 000 .69L3.6 26.85c.191.191.5.191.691 0l.527-.526c.139.066.28.125.427.176v.744c0 .27.218.49.489.49h1.955c.27 0 .489-.22.489-.49V26.5c.146-.051.288-.11.427-.176l.526.526c.191.191.5.191.692 0l1.382-1.383a.488.488 0 000-.691l-.526-.527c.066-.139.125-.282.177-.427h.744c.27 0 .49-.219.49-.489v-1.955a.489.489 0 00-.49-.49h-.744a4.597 4.597 0 00-.176-.426l.526-.526a.489.489 0 000-.692l-1.383-1.383a.488.488 0 00-.691 0l-.527.526a4.418 4.418 0 00-.427-.176v-.744a.489.489 0 00-.488-.49H5.734a.489.489 0 00-.489.49v.744c-.146.051-.288.11-.427.176l-.527-.525a.488.488 0 00-.691 0l-1.383 1.383a.488.488 0 000 .691l.526.527a4.517 4.517 0 00-.177.426h-.744a.489.489 0 00-.489.489v1.955c0 .27.219.49.49.49zm.49-1.955h.616c.223 0 .418-.15.474-.367.08-.31.202-.606.364-.88a.49.49 0 00-.075-.594l-.437-.436.692-.692.436.43
26a.488.488 0 00.595.076 3.4 3.4 0 01.88-.364.49.49 0 00.366-.473v-.617H7.2v.617a.49.49 0 00.366.473c.31.08.607.202.88.364a.49.49 0 00.594-.076l.437-.436.691.692-.436.436a.489.489 0 00-.076.594c.162.274.285.57.365.88.056.216.25.367.473.367h.616v.977h-.617a.488.488 0 00-.473.367c-.08.31-.203.606-.365.88a.49.49 0 00.076.594l.436.436-.691.692-.437-.436a.489.489 0 00-.594-.075c-.273.16-.57.283-.88.363a.489.489 0 00-.366.474v.617h-.978v-.617a.489.489 0 00-.366-.474 3.404 3.404 0 01-.88-.363.489.489 0 00-.594.075l-.437.436-.691-.692.436-.436a.489.489 0 00.076-.594 3.406 3.406 0 01-.365-.88.488.488 0 00-.473-.367h-.617v-.977zM18.933 26.756a2.447 2.447 0 002.445-2.445 2.447 2.447 0 00-2.445-2.444 2.447 2.447 0 00-2.444 2.444 2.447 2.447 0 002.444 2.445zm0-3.912c.81 0 1.467.659 1.467 1.467 0 .809-.658 1.467-1.466 1.467a1.469 1.469 0 01-1.467-1.467c0-.808.658-1.467 1.466-1.467zM18.933 17.956a2.447 2.447 0 002.445-2.445 2.447 2.447 0 00-2.445-2.444 2.447 2.447 0 00-2.444 2.444 2.447 2.447 0 002.444 2.445zm0-3.912c.81 0 1.467.659 1.467 1.467 0 .809-.658 1.467-1.466 1.467a1.469 1.469 0 01-1.467-1.467c0-.808.658-1.467 1.466-1.467zM18.933 9.156a2.447 2.447 0 002.445-2.445 2.447 2.447 0 00-2.445-2.444A2.447 2.447 0 0016.49 6.71a2.447 2.447 0 002.444 2.445zm0-3.912c.81 0 1.467.658 1.467 1.467s-.658 1.467-1.466 1.467a1.469 1.469 0 01-1.467-1.467c0-.809.658-1.467 1.466-1.467zM22.356 16h3.91c.27 0 .49.22.49.489v1.955h.977V16.49c0-.809-.657-1.467-1.466-1.467h-3.911V16zM27.733 19.422h-.977v.978h.977v-.978zM22.356 24.8h3.91c.81 0 1.468-.658 1.468-1.467v-1.955h-.978v1.955a.49.49 0 01-.49.49h-3.91v.977zM10.133 14.533c0 .809.659 1.467 1.467 1.467h3.911v-.978h-3.91a.49.49 0 01-.49-.489v-1.955h-.978v1.955zM11.111 10.622h-.978v.978h.978v-.978zM11.111 7.689a.49.49 0 01.49-.489h3.91v-.978h-3.91c-.81 0-1.468.658-1.468 1.467v1.955h.978V7.69zM26.048 8.615a.492.492 0 00.512-.046l1.956-1.467a.488.488 0 000-.782L26.56 4.853a.489.489 0 00-.782.391v.978h-3.422V7.2h3.422v.978a.49.49 0 00.27.437zm.708-2.393l.651.49-.651.488v-.978zM15.511 23.822h-2.444v.978h2.444v-.978z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M30.178 1.333H6.71a.489.489 0 00-.489.49V16H7.2V2.311h22.49V29.69H7.2v-.978h-.978v1.467c0 .27.219.489.49.489h23.466c.27 0 .489-.22.489-.49V1.823a.489.489 0 00-.49-.489z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},89636:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 108 110",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M106.043 35.484h-.591V30.16c0-.98-.795-1.774-1.775-1.774H82.806L55.774 14.871v-4.226h12.42c.98 0 1.773-.794 1.773-1.774V1.774c0-.98-.794-1.774-1.774-1.774H54c-.98 0-1.774.794-1.774 1.774v13.097L25.194 28.387H4.322c-.98 0-1.774.794-1.774 1.774v5.323h-.591a1.774 1.774 0 100 3.548h.591v69.194c0 .98.795 1.774 1.774 1.774h99.355c.98 0 1.775-.794 1.775-1.774V39.032h.591a1.774 1.774 0 100-3.548zM55.774 3.548H66.42v3.549H55.774V3.548zm46.129 31.936H84.161v-3.549h17.742v3.549zm-74.516 0v-3.549h53.226v3.549H27.387zm46.13 35.484H46.902a1.774 1.774 0 100 3.548h26.613v31.936h-3.548V79.839c0-.98-.794-1.774-1.774-1.774H39.806c-.98 0-1.774.794-1.774 1.774v26.613h-3.548V74.516h5.322a1.774 1.774 0 100-3.548h-5.322V39.032h39.032v31.936zm-7.098 10.645v17.742H55.774V81.613H66.42zM52.226 99.355H41.58V81.613h10.645v17.742zm-10.645 3.548h24.838v3.549H41.581v-3.549zM54 17.951L74.87 28.387H33.13l20.87-10.436zM6.097 31.935h17.742v3.549H6.097v-3.549zm0 7.097h24.838v67.419H6.097V39.032zm95.806 67.42H77.064v-67.42h24.839v67.42z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M25.613 42.58H11.42c-.98 0-1.774.795-1.774 1.775v21.29c0 .98.794 1.774 1.774 1.774h14.193c.98 0 1.774-.794 1.774-1.774v-21.29c0-.98-.794-1.774-1.774-1.774zM23.84 63.87H13.194V46.13H23.84v17.742zM39.806 67.42h28.387c.98 0 1.774-.795 1.774-1.775v-21.29c0-.98-.794-1.774-1.774-1.774H39.806c-.98 0-1.774.794-1.774 1.774v21.29c0 .98.794 1.774 1.774 1.774zm1.774-14.194h10.645V63.87H41.58V53.226zM55.774 63.87V53.226h10.645V63.87H55.774zm10.645-17.742v3.549H41.58v-3.549H66.42zM80.612 44.355v21.29c0 .98.795 1.774 1.775 1.774H96.58c.98 0 1.774-.794 
21.774-1.774v-21.29c0-.98-.794-1.774-1.774-1.774H82.386c-.98 0-1.774.794-1.774 1.774zm3.549 1.774h10.645v17.742H84.16V46.13zM25.613 70.968H11.42c-.98 0-1.774.794-1.774 1.774v21.29c0 .98.794 1.775 1.774 1.775h14.193c.98 0 1.774-.795 1.774-1.775v-21.29c0-.98-.794-1.774-1.774-1.774zm-1.774 21.29H13.194V74.516H23.84v17.742zM96.58 70.968H82.386c-.98 0-1.774.794-1.774 1.774v21.29c0 .98.795 1.775 1.775 1.775H96.58c.98 0 1.774-.795 1.774-1.775v-21.29c0-.98-.794-1.774-1.774-1.774zm-1.774 21.29H84.16V74.516h10.645v17.742z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},84465:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 21.535 21.535",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".schoolhouse_icon_svg__prefix__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}"})}),(0,i.jsxs)("g",{id:"schoolhouse_icon_svg__prefix__school",transform:"translate(-.5 -.5)",children:[(0,i.jsx)("path",{className:"schoolhouse_icon_svg__prefix__cls-1",d:"M16 6.476V1h4.107v2.738H16","data-name":"Path 4616",id:"schoolhouse_icon_svg__prefix__Path_4616",transform:"translate(-4.732)"}),(0,i.jsx)("path",{className:"schoolhouse_icon_svg__prefix__cls-1",d:"M16.738 28.792V24H14v4.792","data-name":"Path 4617",id:"schoolhouse_icon_svg__prefix__Path_4617",transform:"translate(-4.101 -7.256)"}),(0,i.jsx)("path",{className:"schoolhouse_icon_svg__prefix__cls-1",d:"M0 0h3v2H0z","data-name":"Rectangle 3296",id:"schoolhouse_icon_svg__prefix__Rectangle_3296",transform:"translate(10 11.535)"}),(0,i.jsx)("path",{className:"schoolhouse_icon_svg__prefix__cls-1",d:"M0 0h3v3H0z","data-name":"Rectangle 3297",id:"schoolhouse_icon_svg__prefix__Rectangle_3297",transform:"translate(4 15.535)"}),(0,i.jsx)("path",{className:"schoolhouse_icon_svg__prefix__cls-1",d:"M0 0h3v3H0z","data-name":"Rectangle 3298",id:"schoolhouse_icon_svg__prefix__Rectangle_3298",transform:"translate(16 15.535)"}),(0,i.jsx)("path",{className:"schoolhouse_icon_svg__prefix__cls-1",d:"M16.059 15.161v-2.738L11.268 9l-4.792 3.423v2.738H1v8.9h20.535v-8.9z","data-name":"Path 4618",id:"schoolhouse_icon_svg__prefix__Path_4618",transform:"translate(0 -2.524)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},30148:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 24 26.053",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".science-beaker_svg__cls-1,.science-beaker_svg__cls-2{fill:none;stroke:currentColor;stroke-linejoin:round;stroke-miterlimit:10}.science-beaker_svg__cls-2{stroke-linecap:round}"})}),(0,i.jsxs)("g",{id:"science-beaker_svg__science-beaker",transform:"translate(0 2.053)",children:[(0,i.jsx)("g",{id:"science-beaker_svg__Outline_Icons",transform:"translate(-1 -3.053)",children:(0,i.jsxs)("g",{"data-name":"Group 1434",id:"science-beaker_svg__Group_1434",transform:"translate(4.341 1.5)",children:[(0,i.jsx)("path",{className:"science-beaker_svg__cls-1",d:"M4.756 21.659a2.29 2.29 0 001.877 3.6h12.961a2.29 2.29 0 001.876-3.6l-5.493-9V3.5H10.25v9.163z","data-name":"Path 3677",id:"science-beaker_svg__Path_3677",transform:"translate(-4.341 -1.209)"}),(0,i.jsx)("path",{className:"science-beaker_svg__cls-1",d:"M17.808 2.645a1.144 1.144 0 01-1.145 1.145H8.645a1.145 1.145 0 110-2.291h8.018a1.144 1.144 0 011.145 1.146z","data-name":"Path 3678",id:"science-beaker_svg__Path_3678",transform:"translate(-3.882 -1.5)"}),(0,i.jsx)("path",{className:"science-beaker_svg__cls-2",d:"M2.291 0H0","data-name":"Line 1184",id:"science-beaker_svg__Line_1184",transform:"translate(9.345 4.581)"}),(0,i.jsx)("path",{className:"science-beaker_svg__cls-2",d:"M2.291 0H0","data-name":"Line 1185",id:"science-beaker_svg__Line_1185",transform:"translate(9.345 9.163)"}),(0,i.jsx)("path",{className:"science-beaker_svg__cls-2",d:"M3.436 0H0","data-name":"Line 1186",id:"science-beaker_svg__Line_1186",transform:"translate(8.199 6.872)"}),(0,i.jsx)("path",{className:"science-beaker_svg__cls-1",d:"M0 0h11.454","data-name":"Line 1187",id:"science-beaker_svg__Line_1187",transform:"translate(3.045 16.035)"}),(0,i.jsx)("circle",{className:"science-beaker_svg__cls-2",cx:.5,cy:.5,"data-name":"Ellipse 1148",id:"science-beaker_svg__Ellipse_1148",r:.5,transform:"translate(12.659 21.553)"}),(0,i.jsx)("circle",{className:"science-beaker_svg__cls-2",cx:.286,cy:.28
26,"data-name":"Ellipse 1149",id:"science-beaker_svg__Ellipse_1149",r:.286,transform:"translate(9.918 18.326)"}),(0,i.jsx)("circle",{className:"science-beaker_svg__cls-2",cx:1.718,cy:1.718,"data-name":"Ellipse 1150",id:"science-beaker_svg__Ellipse_1150",r:1.718,transform:"translate(4.191 18.326)"})]})}),(0,i.jsx)("g",{id:"science-beaker_svg__invisible_shape",children:(0,i.jsx)("path",{d:"M0 0h24v24H0z","data-name":"Rectangle 2857",fill:"none",id:"science-beaker_svg__Rectangle_2857"})})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},72512:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 26.944 26",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".science-brain_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"science-brain_svg__science-brain",transform:"translate(.458)",children:[(0,i.jsx)("g",{id:"science-brain_svg__Outline_Icons",transform:"translate(.542 1.625)",children:(0,i.jsxs)("g",{"data-name":"Group 1454",id:"science-brain_svg__Group_1454",children:[(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M12.417 17.75h-3.25c-1.719 0-3.111-.8-3.227-2.487C4.637 16.458.5 13.957.5 10.167s3.488-6.321 4.884-5.5a3.233 3.233 0 015.679-2.047 3.225 3.225 0 015.477 1.011 3.241 3.241 0 015.627 2.2 3.237 3.237 0 012.133 5.69 3.236 3.236 0 01-3.813 5.2 3.242 3.242 0 01-2.648 2.6v4.93h-3.25v-4.914a3.755 3.755 0 013.754-3.754h.037","data-name":"Path 3743",id:"science-brain_svg__Path_3743",transform:"translate(-.5 -1.5)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M13.982 18.759a3.225 3.225 0 01-1.649.45C9.625 19.208 8.452 17.752 8 16.5","data-name":"Path 3744",id:"science-brain_svg__Path_3744",transform:"translate(.125 -.25)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M23.042 11.083S18.708 12.708 16 10","data-name":"Path 3745",id:"science-brain_svg__Path_3745",transform:"translate(.792 -.792)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M1 7.544S5.875 7 6.958 9.711","data-name":"Path 3746",id:"science-brain_svg__Path_3746",transform:"translate(-.458 -1)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M10.5 2.5v2.708a1.625 1.625 0 003.25 0","data-name":"Path 3747",id:"science-brain_svg__Path_3747",transform:"translate(.333 -1.417)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M10.75 2.5v2.708a1.625 1.625 0 01-3.25 0","data-name":"Path 3748",id:"science-brain_svg__Path_3748",transform:"translate(.083 -1.417)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M9 16.958S8.461 12.083 11.711 11","data-name":"Path 3749",id:"science-brain_svg__Path_3749",transform:"translate(.206 -.708)"}),(0,i.jsx)("path",{className:"science-brain_svg__cls-1",d:"M19.5 11.292s1.083-2.167 0-3.792","data-name":"Path 3750",id:"science-brain_svg__Path_3750",transform:"translate(1.083 -1)"})]})}),(0,i.jsx)("g",{id:"science-brain_svg__invisible_shape",children:(0,i.jsx)("path",{d:"M0 0h26v26H0z","data-name":"Rectangle 2953",fill:"none",id:"science-brain_svg__Rectangle_2953"})})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},85591:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 24.367 24.367",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("path",{d:"M0 .367h24v24H0z","data-name":"Rectangle 2822",fill:"none"}),(0,i.jsx)("path",{d:"M19.494 14.62a4.842 4.842 0 00-3.655 1.68l-6.2-3.1a4.689 4.689 0 000-2.038l6.2-3.1a4.849 4.849 0 10-1.218-3.19 4.761 4.761 0 00.112 1.019l-6.2 3.1a4.875 4.875 0 100 6.379l6.2 3.1a4.781 4.781 0 00-.112 1.02 4.873 4.873 0 104.873-4.873zm0-12.184a2.437 2.437 0 11-2.437 2.437 2.437 2.437 0 012.437-2.436zM4.873 14.62a2.437 2.437 0 112.437-2.436 2.438 2.438 0 01-2.437 2.436zm14.62 7.31a2.437 2.437 0 112.437-2.437 2.438 2.438 0 01-2.436 2.437z","data-name":"Path 3654",fill:"
2currentColor"})]}));l.defaultProps={color:"#207DE9"},s.default=l},24630:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M10.73 20.207H4.582a.473.473 0 010-.946h6.147a.473.473 0 010 .946zM10.73 17.813H4.582a.473.473 0 010-.946h6.147a.473.473 0 010 .946zM12.393 22.5h-2.34a.473.473 0 010-.947h2.34a.473.473 0 010 .947zM9.068 15.504H4.582a.473.473 0 010-.946h4.486a.473.473 0 010 .946zM7.07 13.176H4.666a.473.473 0 01-.473-.473v-2.37c0-.262.212-.474.473-.474h2.406c.26 0 .473.212.473.473v2.37a.473.473 0 01-.473.474zm-1.932-.946h1.46v-1.425h-1.46v1.425zM11.997 16.943a.473.473 0 01-.473-.46l-.043-1.501a.473.473 0 01.104-.31l3.735-4.646a.473.473 0 01.66-.076l1.588 1.241a.472.472 0 01.076.67l-3.763 4.643a.474.474 0 01-.286.168l-1.517.264a.471.471 0 01-.081.007zm1.516-.737h.003-.003zm-1.082-1.077l.023.781.803-.14 3.348-4.13-.84-.657-3.334 4.146zM22.397 27.636h-2.713a.473.473 0 01-.473-.473V5.28c0-.261.212-.473.473-.473h2.713a.473.473 0 010 .946h-2.24V26.69h2.24a.473.473 0 010 .946z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M22.397 16.473h-5.021a.473.473 0 010-.946h5.021a.473.473 0 010 .946zM30.194 7.4h-5.356a.473.473 0 01-.473-.472V3.226c0-.261.212-.473.473-.473h5.356c.26 0 .473.212.473.473v3.702a.473.473 0 01-.473.473zm-4.883-.946h4.41V3.7h-4.41v2.755zM30.194 18.553h-5.356a.473.473 0 01-.473-.473v-3.702c0-.261.212-.473.473-.473h5.356c.261 0 .473.212.473.473v3.702a.473.473 0 01-.473.473zm-4.883-.946h4.41V14.85h-4.41v2.756zM30.194 29.247h-5.356a.473.473 0 01-.473-.473v-3.701c0-.262.212-.474.473-.474h5.356c.261 0 .473.212.473.474v3.701a.473.473 0 01-.473.473zm-4.883-.946h4.41v-2.755h-4.41V28.3zM14.457 24.893H1.807a.473.473 0 01-.474-.473V8.055c0-.126.05-.247.14-.335a.427.427 0 01.335-.138l6.32.02c2.307.006 4.614.013 6.32.02.26 0 .471.212.472.472l.003 3.768a.474.474 0 01-.104.297l-2.388 2.97.023.781.803-.14.827-1.02a.472.472 0 01.841.298l.005 9.372a.473.473 0 01-.473.473zm-12.178-.946h11.704l-.004-7.565-.098.122a.475.475 0 01-.287.168l-1.516.264a.472.472 0 01-.554-.453l-.044-1.501a.473.473 0 01.104-.31l2.393-2.976-.003-3.13-5.85-.018L2.28 8.53v15.417zm11.234-7.741h.003-.003z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},74851:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M20.125 9.492h-1.1a6.605 6.605 0 00-6.141-6.142v-1.1c0-.275-.184-.458-.459-.458s-.458.183-.458.458v1.1a6.605 6.605 0 00-6.142 6.142H4.771c-.275 0-.458.183-.458.458s.183.458.458.458h1.1c.092 1.467.688 2.75 1.558 3.805l-1.97 1.97H3.395c-.275 0-.458.184-.458.459s.183.458.458.458h1.1l-.688.688H1.792c-.275 0-.459.183-.459.458s.184.458.459.458h1.742v1.742c0 .275.183.458.458.458s.458-.183.458-.458v-2.017l.688-.687v1.1c0 .275.183.458.458.458s.458-.183.458-.458v-2.017l1.971-1.97c.596.503 1.284.962 2.017 1.237l-1.054 7.654h-.275c-.963 0-1.696.779-1.696 1.696 0 .412.137.779.366 1.054C6.1 27 5.23 28.283 5.23 29.704c0 .275.184.459.459.459h13.429c.275 0 .458-.184.458-.459v-.091a3.468 3.468 0 00-2.154-3.117c.23-.275.367-.642.367-1.054 0-.963-.78-1.696-1.696-1.696h-.275l-1.054-7.654c2.337-.917 4.033-3.117 4.216-5.684h1.146c.275 0 .459-.183.459-.458s-.184-.458-.459-.458zm-2.017 0h-2.704a3.015 3.015 0 00-2.52-2.521V4.267c2.795.229 5.041 2.429 5.224 5.225zm-5.637 2.566c-.458 0-.87-.137-1.192-.366l1.238-1.238a.443.443 0 000-.641.443.443 0 00-.642 0l-1.191 1.191a2.13 2.13 0 01-.275-1.054c0-1.146.962-2.108 2.108-2.108 1.146 0 2.108.962 2.108 2.108 0 1.146-1.008 2.108-2.154 2.108zm-.458-7.791V6.97a3.015 3.015 0 00-2.521 2.52H6.788a5.695 5.695 0 015.225-5.224zm-5.225 6.141h2.704c.091.459.229.871.504 1.284l-1.925 1.925a5.834 5.834 0 01-1.283-3.209zm3.804 1.925c.412.321.87.505 1.375.596v2.704a5.763 5.763 0 01-3.3-1.375l1.925-1.925zm8.066 16.959H6.239c.229-1.192 1.283-2.109 2.52-2.109h7.38c1.283 0 2.337.917 2.52 2.109zm-3.62-4.996c.046.229.229.412.458.412h.687c.413 
20 .78.367.78.78 0 .458-.367.779-.78.779H8.758a.773.773 0 01-.779-.78c0-.458.367-.779.78-.779H9.4c.23 0 .413-.183.458-.412l1.1-7.93c.321.092.688.138 1.055.138v1.1c0 .275.183.459.458.459s.458-.184.458-.459v-1.1c.367-.046.688-.091 1.054-.137l1.055 7.929zm-2.109-8.708v-2.705a3.015 3.015 0 002.521-2.52h2.704c-.229 2.795-2.475 4.995-5.225 5.225zM29.888 27.275v-.962a.92.92 0 00-.917-.917h-.229c.412-2.475.825-2.704.962-4.034.23-2.887-.962-4.858-3.3-5.362-.274-.092-1.42-.55-2.108-.55-.32 0-.55.32-.412.642l.32.825c-.55.229-.916.183-1.008.55l-.183.641-1.513 1.146c-.091.046-.137.138-.183.275l-.275 1.192a.46.46 0 00.23.504l1.237.642a.492.492 0 00.504-.046l1.237-1.009c.184.092.413.184.688.23-.825.87-1.925 2.429-1.88 4.354h-.32a.92.92 0 00-.917.916v.963c-.458.046-.779.458-.779.917v1.558c0 .275.183.458.458.458h8.709c.275 0 .458-.183.458-.458v-1.558c0-.459-.32-.871-.78-.917zm-3.621-6.188c.367-.274.137-.825-.275-.825h-.137c-.963 0-1.33-.32-1.33-.32-.183-.138-.412-.184-.595 0l-1.238 1.008-.688-.367.138-.687 1.467-1.1c.091-.046.137-.138.183-.23l.183-.55c.825-.32 1.1-.274 1.192-.595.046-.092.046-.23 0-.367l-.183-.55c.366.092.825.23 1.1.367h.091c2.43.504 2.75 2.704 2.613 4.4-.092 1.146-.55 1.466-.963 4.079h-3.804c-.137-2.383 2.246-4.263 2.246-4.263zm-3.53 5.226h6.234v.962h-6.233v-.962zm7.013 2.979H21.96v-1.1h7.791v1.1z",fill:"currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},15839:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 120 120",width:"1em"},e),{},{children:(0,i.jsx)("path",{d:"M91.754 76.865l-6.456-1.895-14.045-9.175v-2.102c4.066-3.067 6.859-7.755 7.378-13.13a4.292 4.292 0 003.602-4.23v-5.781c0-.022-.002-.044-.004-.067v-7.322a3.177 3.177 0 001.329-2.592V23.87l9.693-1.652a3.386 3.386 0 002.851-3.148c.112-1.612-.847-3.024-2.386-3.514L61.038 5.163a3.42 3.42 0 00-2.083 0L26.277 15.555a3.385 3.385 0 00-2.386 3.514 3.394 3.394 0 001.316 2.485v8.763h-.08a3.34 3.34 0 00-3.337 3.337v4.35l-2.154 12.644a3.587 3.587 0 003.535 4.188h7.294a3.587 3.587 0 003.536-4.188l-2.154-12.644v-4.35a3.34 3.34 0 00-3.338-3.337h-.08v-7.812l8.013 1.364v6.7a3.18 3.18 0 001.322 2.588l.003 7.395v5.78a4.292 4.292 0 003.602 4.23c.519 5.371 3.308 10.058 7.371 13.125V65.8l-14.043 9.173-6.45 1.893c-6.903 2.026-11.777 8.363-11.777 15.73v4.802a1.611 1.611 0 103.223 0v-4.802c0-5.806 3.89-11.003 9.461-12.638l6.011-1.764 24.012 14.268a1.63 1.63 0 001.646 0l24.014-14.269 6.01 1.764c5.57 1.636 9.461 6.832 9.461 12.638v15.563a3.624 3.624 0 01-3.62 3.62h-7.103v-6.946a1.61 1.61 0 10-3.222 0v6.946H33.63v-6.946a1.61 1.61 0 10-3.223 0v6.946h-7.095a3.624 3.624 0 01-3.62-3.62v-3.228a1.61 1.61 0 10-3.222 0v3.227A6.85 6.85 0 0023.312 115h73.375a6.85 6.85 0 006.843-6.843V92.595c0-7.193-4.708-13.655-11.776-15.73zm-61.29-25.25h-7.293a.363.363 0 01-.359-.425l1.949-11.438h4.114l1.949 11.438a.363.363 0 01-.36.425zm-1.84-17.96v2.875h-3.612v-2.875c0-.063.052-.114.115-.114h3.382c.064 0 .115.05.115.114zm25.613 51.519l.641.985-16.45-9.775 10.442-6.82a33.846 33.846 0 005.367 15.61zm-.011-6.956c3.793.539 7.753.54 11.548 0a30.777 30.777 0 01-2.712 5.198L60 88.122l-3.062-4.706a30.777 30.777 0 01-2.712-5.198zm11.537 6.956a33.843 33.843 0 005.367-15.61l10.441 6.82-16.45 9.775.642-.986zm9.425-51.41h3.82v5.176h-1.896a1.926 1.926 0 01-1.924-1.923v-3.254zM27.254 18.626L59.932 8.233a.212.212 0 01.13 0l32.677 10.394c.068.022.16.051.148.219-.011.167-.107.184-.177.196l-10.804 1.84-4.056-.502a1.612 1.612 0 00-.396 3.198l2.882.357v6.606l-40.672-.002v-6.605l16.674-2.063c2.428-.3 4.89-.3 7.317 0l6.311.78a1.611 1.611 0 00.396-3.197l-6.31-.78a33.055 33.055 0 00-8.11 0L38.09 20.881l-10.807-1.84c-.07-.012-.166-.029-.178-.196-.011-.168.081-.197.149-.219zM40.989 38.94l-.003-5.177h3.826v3.254c0 1.06-.863 1.924-1.924 1.924h-1.9zm3.546 10.795a2.497 2.497 0 00-2.482-2.34 1.064 1.064 0 01-1.064-1.063v-4.169h1.899a5.152 5.152 0 005.146-5.146v-3.254h23.931v3.254a5.152 5.152 0 005.147 5.146h1.898v4.17c0 .585-.477 1.062-1.063 1.062a2.497 2.497 0 00-2.483 2.34c-.513 8.136-7.306 14.51-15.464 14.51-8.16 0-14.952-6.374-15.465-14.51zM60 67.467c2.866 0 5.59-.655 8.03-1.82v1.02c0 2.756-.371 5.473-1.087 8.094-4.379.835-9.33.869-13.886 0a30.708 30.708 0 01-1.088-8.093c0-.035-.004-.068-.007-.102v-.923A18.601 18.601 0 0060 67.467z",fill:"
2currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},77217:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 23.978 25.24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M18.842 17.667a10.092 10.092 0 01-8.742 5.049q-.334 0-.663-.021a5.049 5.049 0 11-8.387-5.586 10.118 10.118 0 010-8.978 5.049 5.049 0 118.383-5.586q.329-.021.663-.021a10.092 10.092 0 018.746 5.049h.088a5.05 5.05 0 110 10.1zM3.1 15.532a5.051 5.051 0 016.992 4.66 7.563 7.563 0 006.22-3.253 5.05 5.05 0 010-8.639A7.563 7.563 0 0010.1 5.048a5.051 5.051 0 01-7 4.66 7.6 7.6 0 000 5.824zm15.826-.388a2.524 2.524 0 10-2.524-2.524 2.524 2.524 0 002.528 2.524zM5.048 7.572a2.524 2.524 0 10-2.524-2.524 2.524 2.524 0 002.524 2.524zm0 15.144a2.524 2.524 0 10-2.524-2.524 2.524 2.524 0 002.524 2.524z",fill:"currentColor"})}));l.defaultProps={color:"#207DE9"},s.default=l},56071:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 27 27",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".target_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"target_svg__target",transform:"translate(-1 -1.047)",children:[(0,i.jsx)("circle",{className:"target_svg__cls-1",cx:12.5,cy:12.5,"data-name":"Ellipse 1108",id:"target_svg__Ellipse_1108",r:12.5,transform:"translate(2 2.047)"}),(0,i.jsx)("circle",{className:"target_svg__cls-1",cx:7.5,cy:7.5,"data-name":"Ellipse 1109",id:"target_svg__Ellipse_1109",r:7.5,transform:"translate(7 7.047)"}),(0,i.jsx)("circle",{className:"target_svg__cls-1",cx:2.5,cy:2.5,"data-name":"Ellipse 1110",id:"target_svg__Ellipse_1110",r:2.5,transform:"translate(12 12.047)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},47598:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 34.583 34",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".teams_svg__prefix__cls-1{fill:none;stroke:currentColor;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"teams_svg__prefix__account-group-circle",transform:"translate(.292)",children:[(0,i.jsx)("g",{id:"teams_svg__prefix__Outline_Icons_1_",transform:"translate(.708 2.125)",children:(0,i.jsx)("g",{id:"teams_svg__prefix__Outline_Icons",children:(0,i.jsxs)("g",{"data-name":"Group 1332",id:"teams_svg__prefix__Group_1332",children:[(0,i.jsx)("circle",{className:"teams_svg__prefix__cls-1",cx:3.542,cy:3.542,"data-name":"Ellipse 1368",id:"teams_svg__prefix__Ellipse_1368",r:3.542,transform:"translate(12.75)"}),(0,i.jsx)("circle",{className:"teams_svg__prefix__cls-1",cx:2.125,cy:2.125,"data-name":"Ellipse 1369",id:"teams_svg__prefix__Ellipse_1369",r:2.125,transform:"translate(24.083 2.833)"}),(0,i.jsx)("circle",{className:"teams_svg__prefix__cls-1",cx:2.125,cy:2.125,"data-name":"Ellipse 1370",id:"teams_svg__prefix__Ellipse_1370",r:2.125,transform:"translate(4.25 2.833)"}),(0,i.jsx)("path",{d:"M23.375 24.366c5.451.459 9.208 1.431 9.208 2.553 0 1.564-7.293 2.833-16.292 2.833S0 28.481 0 26.917c0-1.119 3.733-2.087 9.149-2.547","data-name":"Path 4619",fill:"none",id:"teams_svg__prefix__Path_4619",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,strokeWidth:2}),(0,i.jsx)("path",{className:"teams_svg__prefix__cls-1",d:"M16.583 21.25H9.5v-9.208a3.542 3.542 0 117.083 0z","data-name":"Path 4620",id:"teams_svg__prefix__Path_4620",transform:"translate(3.25 1.417)"}),(0,i.jsx)("path",{className:"teams_svg__prefix__cls-1",d:"M21.75 18.417H17.5v-7.792a2.125 2.125 0 014.25 0z","data-name":"Path 4621",id:"teams_svg__prefix__Path_4621",transform:"translate(6.583 1.417)"}),(0,i.jsx)("path",{className:"teams_svg__prefix__cls-1",d:"M7.75 18.417H3.5v-7.792a2.125 2.125 0 014.25 0z","data-name":"Path 4622",id:"teams_svg__prefix__Path_4622",transform:"translate(.75 1.417)"})]})})}),(0,i.jsx)("g",{id:"teams_svg__prefix__Invisible_Shape",children:(0,i.jsx)("path",{d:"M0 0h34v34H0z","data-name":"Rectangle 3301",fill:"none",id:"teams_svg__prefix__Rectangle_3301"})})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},91753:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 32 32.414",width:"1em"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".three_bars_w_growth_arrow_svg__prefix__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"three_bars_w_growth_arrow_svg__prefix__chart-bar-33",transform:"translate(0 .414)",children:[(0,i.jsx)("path",{className:"three_bars_w_growth_arrow_svg__prefix__cls-1",d:"M0 0h6v13H0z","data-name":"Rectangle 3931",id:"three_bars_w_growth_arrow_svg__prefix__Rectangle_3931",transform:"translate(13 18)"}),(0,i.jsx)("path",{className:"three_bars_w_growth_arrow_svg__prefix__cls-1",d:"M0 0h6v7H0z","data-name":"Rectangle 3932",id:"three_bars_w_growth_arrow_svg__prefix__Rectangle_3932",transform:"translate(1 24)"}),(0,i.jsx)("path",{className:"three_bars_w_growth_arrow_svg__prefix__cls-1",d:"M0 0h6v19H0z","data-name":"Rectangle 3933",id:"three_bars_w_growth_arrow_svg__prefix__Rectangle_3933",transform:"translate(25 12)"}),(0,i.jsx)("path",{className:"three_bars_w_growth_arrow_svg__prefix__cls-1",d:"M6 11l5-5 5 5L26 1","data-name":"Path 4890",id:"three_bars_w_growth_arrow_svg__prefix__Path_4890"}),(0,i.jsx)("path",{className:"three_bars_w_growth_arrow_svg__prefix__cls-1",d:"M20 1h6v6","data-name":"Path 4891",id:"three_bars_w_growth_arrow_svg__prefix__Path_4891"})]})]}));l.defaultProps={color:"#008087"},s.default=l},98117:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",id:"three-crayons_svg__crayons",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".three-crayons_svg__cls-1{fill:none;stroke:currentColor;stroke-linejoin:round;stroke-miterlimit:10}"})}),(0,i.jsx)("g",{id:"three-crayons_svg__Outline_Icons",children:(0,i.jsxs)("g",{"data-name":"Group 1455",id:"three-crayons_svg__Group_1455",children:[(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6v18H0z","data-name":"Rectangle 2954",id:"three-crayons_svg__Rectangle_2954",transform:"translate(.5 5.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6v18H0z","data-name":"Rectangle 2955",id:"three-crayons_svg__Rectangle_2955",transform:"translate(8.5 5.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6v18H0z","data-name":"Rectangle 2956",i
2d:"three-crayons_svg__Rectangle_2956",transform:"translate(16.5 5.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M4.5.5h-2l-1 5h4z","data-name":"Path 3751",id:"three-crayons_svg__Path_3751"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6","data-name":"Line 1226",id:"three-crayons_svg__Line_1226",transform:"translate(.5 8.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6","data-name":"Line 1227",id:"three-crayons_svg__Line_1227",transform:"translate(.5 20.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M12.5.5h-2l-1 5h4z","data-name":"Path 3752",id:"three-crayons_svg__Path_3752"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6","data-name":"Line 1228",id:"three-crayons_svg__Line_1228",transform:"translate(8.5 8.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6","data-name":"Line 1229",id:"three-crayons_svg__Line_1229",transform:"translate(8.5 20.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M20.5.5h-2l-1 5h4z","data-name":"Path 3753",id:"three-crayons_svg__Path_3753"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6","data-name":"Line 1230",id:"three-crayons_svg__Line_1230",transform:"translate(16.5 8.5)"}),(0,i.jsx)("path",{className:"three-crayons_svg__cls-1",d:"M0 0h6","data-name":"Line 1231",id:"three-crayons_svg__Line_1231",transform:"translate(16.5 20.5)"})]})}),(0,i.jsx)("g",{id:"three-crayons_svg__Invisible_Shape",children:(0,i.jsx)("path",{d:"M0 0h24v24H0z","data-name":"Rectangle 2957",fill:"none",id:"three-crayons_svg__Rectangle_2957"})})]}));l.defaultProps={color:"#207DE9"},s.default=l},71338:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 36.596 17.162",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M4.129 10.889a.314.314 0 00.027-.364v-.011a.631.631 0 01-.119-.161 10.563 10.563 0 01-.827-2.535 2.979 2.979 0 01-.678-2.025 1.243 1.243 0 01.249-.737 1.19 1.19 0 01-.258-.489c-.3-1.242-.142-2.955 2.32-4.061a1.232 1.232 0 01.966-.081 1.721 1.721 0 01.319-.2A4.026 4.026 0 019.166.4a3.6 3.6 0 012.5 3.874 2.683 2.683 0 01-.261.929 1.185 1.185 0 01.157.59 2.987 2.987 0 01-.677 2.018 10.624 10.624 0 01-.822 2.543.648.648 0 01-.122.176.425.425 0 00.04.36 9.433 9.433 0 011.388.327.66.66 0 01-.2 1.289.647.647 0 01-.2-.032 8.314 8.314 0 00-1.3-.3 1.232 1.232 0 01-.852-.671c-.015-.028-.022-.059-.036-.088a3.465 3.465 0 01-1.26.526.814.814 0 01-.267-.054.525.525 0 00-.279-.007.793.793 0 01-.281.061 2.87 2.87 0 01-1.349-.514 1.334 1.334 0 01-.9.743 6.574 6.574 0 00-3.107 1.281.984.984 0 00.05.548 28.946 28.946 0 005.661.519c.619 0 1.226-.018 1.858-.056l.481-.032a.66.66 0 11.1 1.316l-.5.034c-.659.04-1.293.059-1.938.059a30.123 30.123 0 01-6.04-.564 1.316 1.316 0 01-.942-1.064 1.764 1.764 0 01.381-1.735 7.746 7.746 0 013.68-1.587zm.37-3.459a8 8 0 00.677 2.244 4.424 4.424 0 001.445.933 2.1 2.1 0 01.9-.017 5.367 5.367 0 001.4-.9 8.077 8.077 0 00.683-2.26.66.66 0 01.345-.549 1.592 1.592 0 00.3-1.089c0 .011-.082-.055-.127-.1l-.076-.073a.661.661 0 01-.181-.586.751.751 0 01.422-.56 1.6 1.6 0 00.073-.352 2.267 2.267 0 00-1.63-2.482c-1.3-.464-1.842-.318-2.013-.234a.411.411 0 00-.221.266.661.661 0 01-1.22.088c-1.28.6-1.724 1.343-1.474 2.447a2.363 2.363 0 01.41.715.661.661 0 01-.15.7l-.076.073a.946.946 0 00-.136.147 1.655 1.655 0 00.291 1.03.661.661 0 01.358.559zm10.857 4.779a.315.315 0 00.028-.364v-.009a.634.634 0 01-.121-.163 10.563 10.563 0 01-.823-2.536 2.979 2.979 0 01-.678-2.025 1.243 1.243 0 01.249-.737 1.19 1.19 0 01-.258-.489c-.3-1.242-.142-2.955 2.32-4.061a1.232 1.232 0 01.966-.081 1.72 1.72 0 01.319-.2 4.023 4.023 0 013.038.175 3.6 3.6 0 012.5 3.874 2.668 2.668 0 01-.261.929 1.185 1.185 0 01.157.59 2.987 2.987 0 01-.677 2.018 10.625 10.625 0 01-.822 2.543.649.649 0 01-.122.176.422.422 0 00.04.36 7.4 7.4 0 013.716 1.583 1.771 1.771 0 01.366 1.74 1.314 1.314 0 01-.944 1.052 30.928 30.928 0 01-6.072.578 30.128 30.128 0 01-6.037-.563 1.317 1.317 0 01-.942-1.064 1.764 1.764 0 01.381-1.735 7.747 7.747 0 013.677-1.59zm5.814-4.01a1.592 1.592 0 00.3-1.089c-.007.012-.082-.055-.127-.1l-.075-.073a.661.661 0 01-.182-.586.751.751 0 01.422-.56 1.6 1.6 0 00.073-.352 2.267 2.267 0 00-1.63-2.482c-1.3-.463-1.842-.317-2.013-.234a.411.411 0 00-.221.266.66.66 0 01-1.219.088c-1.281.6-1.724 1.343-1.475 2.447a2.363 2.363 0 01.41.715.661.661 0 01-.15.7l-.076.073a.946.946 0 00-.136.147 1.655 1.655 0 00.291 1.03.661.661 0 01.363.559 8 8 0 00.678 2.251 4.423 4.423 0 001.445.933 2.1 2.1 0 01.9-.017 5.356 5.356 0 001.4-.9 8.077 8.077 0 00.683-2.26.66.66 0 01.339-.556zm-8.554 7.122a28.947 28.947 0 005.661.519 29.627 29.627 0 005.7-.53.981.981 0 00.051-.549 6.226 6.226 0 00-3.137-1.262 1.232 1.232 0 01-.851-.671c-.015-.028-.022-.059-.036-.088a3.465 3.465 0 01-1.26.526.814.814 0 01-.267-.054.525.525 0 00-.279-.007.792.792 0 01-.281.061 2.873 2.873 0 01-1.348-.513 1.337 1.337 0 01-.9.743 6.568 6.568 0 00-3.107 1.281.977.977 0 00.053.546zm12.22-3.274a.661.661 0 01.424-.832 10.233 10.233 0 011.324-.328.314.314 0 00.027-.364v-.011a.647.647 0 01-.119-.161 10.594 10.594 0 01-.823-2.536 2.979 2.979 0 01-.678-2.025 1.243 1.243 0 01.249-.737 1.19 1.19 0 01-.258-.489c-.3-1.242-.142-2.955 2.32-4.061a1.232 1.232 0 01.966-.081 1.721 1.721 0 01.319-.2 4.026 4.026 0 013.038.175 3.6 3.6 0 012.5 3.874 2.668 2.668 0 01-.261.929 1.185 1.185 0 01.157.59 2.987 2.987 0 01-.677 2.018 10.624 10.624 0 01-.822 2.543.648.648 0 01-.122.176.425.425 0 00.04.36 7.4 7.4 0 013.716 1.583 1.771 1.771 0 01.366 1.74 1.314 1.314 0 01-.944 1.052 30.928 30.928 0 01-6.072.578c-.791 0-1.572-.028-2.385-.086a.66.66 0 11.093-1.316 32.35 32.35 0 002.292.082 29.627 29.627 0 005.7-.53.981.981 0 00.051-.549 6.226 6.226 0 00-3.137-1.266 1.232 1.232 0 01-.851-.671c-.015-.028-.022-.059-.036-.088a3.467 3.467 0 01-1.261.526.817.817 0 01-.267-.054.525.525 0 00-.279-.007.793.793 0 01-.281.061 2.872 2.872 0 01-1.349-.514 1.334 1.334 0 01-.9.743 8.964 8.964 0 00-1.233.3.645.645 0 01-.2.032.661.661 0 01-.628-.454zm2.118-4.619a8 8 0 00.677 2.244 4.424 4.424 0 001.445.933 2.1 2.1 0 01.9-.017 5.356 5.356 0 001.4-.9 8.077 8.077 0 00.683-2.26.66.66 0 01.345-.549 1.591 1.591 0 00.3-1.089c-.007.011-.083-.055-.127-.1l-.075-.073a.661.661 0 01-.182-.586.751.751 0 01.422-.56 1.6 1.6 0 00.073-.352 2.267 2.267 0 00-1.63-2.482c-1.3-.464-1.842-.318-2.013-.234a.411.411 0 00-.221.266.66.66 0 01-1.219.088c-1.281.6-1.724 1.343-1.475 2.447a2.363 2.363 0 01.41.715.661.661 0 01-.15.7l-.076.073a.946.946 0 00-.136.147 1.655 1.655 0 00.291 1.03.661.661 0 01.358.561z","data-name":"011-team-employee-workers-video-chat-presentation-communication",fill:"currentColor"})}));l.defaultProps={color:"#207DE9"},s.default=l},2367:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 32 32",width:"1em"},e),{},{children:[(0,i.jsx)("path",{d:"M30.194 9.376h-1.648a7.932 7.932 0 00-.95-2.296l1.165-1.164a.473.473 0 000-.67l-2.008-2.006a.487.487 0 00-.669 0l-1.163 1.163a7.925 7.925 0 00-2.297-.949V1.806a.473.473 0 00-.473-.473h-2.839a.473.473 0 00-.473.473v1.648a7.925 7.925 0 00-2.297.949L15.378 3.24a.487.487 0 00-.668 0l-2.008 2.007a.473.473 0 000 .67l1.164 1.163a7.929 7.929 0 00-.95 2.296H11.27a.473.473 0 00-.473.473v2.366h-.473a.946.946 0 00-.946.946v2.366H2.753a1.42 1.42 0 00-1.42 1.42v5.677a.473.473 0 00.474.473h.473v7.096a.473.473 0 00.473.474h21.763a.473.473 0 00.473-.474v-7.096h.473a.473.473 0 00.474-.473V19.15l.148.148a.487.487 0 00.67 0l2.007-2.007a.473.473 0 000-.67l-1.164-1.163c.435-.711.755-1.486.949-2.297h1.648a.473.473 0 00.473-.473V9.85a.473.473 0 00-.473-.473zm-19.871 3.785h2.594a7.93 7.93 0 00.949 2.297l-.07.069h-3.473V13.16zm13.72 16.56H3.226v-6.624h1.892v3.312a.473.473 0 00.474.473H8.43a.473.473 0 00.473-.473v-3.312h1.893v1.42a.473.473 0 00.473.472H16a.473.473 0 00.473-.473v-1.42h1.893v3.313a.473.473 0 00.473.473h2.839a.473.473 0 00.473-.473v-3.312h1.892v6.623zM6.065 24.988h1.892v.947H6.065v-.947zm1.892-.946H6.065v-.946h1.892v.946zm3.785-.946h3.785v.946h-3.785v-.946zm7.5
27 1.892h1.892v.947h-1.892v-.947zm1.892-.946h-1.892v-.946h1.892v.946zm3.785-1.892H2.28v-5.205a.473.473 0 01.474-.473H12.85l-.149.148a.473.473 0 000 .67l2.008 2.007a.487.487 0 00.668 0l1.164-1.163a7.927 7.927 0 002.297.948v1.648a.473.473 0 00.473.473h2.839a.473.473 0 00.473-.473v-1.648a7.927 7.927 0 002.297-.948l.068.068v3.948zm4.732-9.936h-1.557a.474.474 0 00-.465.385 7.028 7.028 0 01-1.098 2.657.474.474 0 00.057.6l1.1 1.1-1.34 1.338-1.097-1.1a.473.473 0 00-.601-.056c-.8.545-1.705.919-2.657 1.097a.473.473 0 00-.384.465v1.557h-1.894v-1.557a.473.473 0 00-.384-.465 7.014 7.014 0 01-2.657-1.097.473.473 0 00-.601.056l-1.099 1.1-1.338-1.339.483-.483h.067v-.067l.55-.548a.473.473 0 00.055-.6 7.028 7.028 0 01-1.097-2.657.473.473 0 00-.465-.386h-1.557v-1.892H13.3a.474.474 0 00.465-.385A7.028 7.028 0 0114.86 7.28a.474.474 0 00-.056-.6l-1.1-1.1 1.339-1.338 1.098 1.1a.473.473 0 00.601.056c.8-.546 1.705-.92 2.657-1.098a.473.473 0 00.385-.464V2.28h1.893v1.557a.473.473 0 00.384.464A7.014 7.014 0 0124.72 5.4a.473.473 0 00.6-.056l1.1-1.1 1.338 1.338-1.1 1.099a.474.474 0 00-.056.6c.545.8.92 1.705 1.098 2.657a.473.473 0 00.465.385h1.557v1.893z",fill:"currentColor"}),(0,i.jsx)("path",{d:"M20.731 5.118a6.15 6.15 0 106.15 6.15 6.157 6.157 0 00-6.15-6.15zm-.473 11.33v-2.446a.473.473 0 00-.31-.443 2.48 2.48 0 01-1.582-2.34 2.534 2.534 0 01.946-1.988v1.987c0 .122.047.24.132.328l.946.985a.487.487 0 00.682 0l.947-.986a.473.473 0 00.132-.327V9.231a2.533 2.533 0 01.946 1.987 2.48 2.48 0 01-1.583 2.34.473.473 0 00-.31.444v2.447a5.206 5.206 0 01-.473.024c-.16 0-.317-.01-.473-.024zm1.893-.177v-1.957a3.475 3.475 0 00-.31-6.328.473.473 0 00-.637.444v2.598l-.473.492-.473-.492V8.43a.474.474 0 00-.636-.444 3.476 3.476 0 00-.31 6.328v1.957a5.204 5.204 0 112.838 0z",fill:"currentColor"})]}));l.defaultProps={color:"#008087"},s.default=l},31274:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 22 21",width:"1em"},e),{},{children:(0,i.jsx)("path",{clipRule:"evenodd",d:"M10.55.453a.45.45 0 01.45-.45h2.608a.45.45 0 01.45.45v1.39a.45.45 0 01-.45.45h-1.304a.45.45 0 110-.9h.854v-.49H11.45v1.441c.05.016.099.034.147.055l4.348 1.888c.548.238.902.778.902 1.375v1.35a1.499 1.499 0 01-1.184 1.465v.832H21a1 1 0 011 1v8.68a1 1 0 01-2 0v-7.681h-4.337v7.946a.75.75 0 01-1.5 0V8.13L11 6.758 7.836 8.132v11.106a.75.75 0 01-1.5 0v-7.93H2v7.68a1 1 0 01-2 0v-8.68a1 1 0 011-.999h5.336v-.832A1.5 1.5 0 015.152 7.01v-1.35c0-.596.354-1.136.902-1.374l4.348-1.888c.049-.021.098-.04.148-.055V.453zm4.797 6.558v-1.35L11 3.775 6.652 5.662v1.35L11 5.123l4.348 1.887zm-4.765 2.822a.45.45 0 11.9 0 .45.45 0 01-.9 0zm.45-1.949a1.95 1.95 0 10-.002 3.899 1.95 1.95 0 00.002-3.899zm5.554 4.216a.5.5 0 01.5-.5h1.45a.5.5 0 01.5.5v1.418a.5.5 0 01-.5.5h-1.45a.5.5 0 01-.5-.5V12.1zm1 .5v.418h.45v-.419h-.45zm-12.673-1a.5.5 0 01.5.5v1.418a.5.5 0 01-.5.5h-1.45a.5.5 0 01-.5-.5V12.1a.5.5 0 01.5-.5h1.45zm-.5 1.418v-.419h-.45v.419h.45zm12.173 1.917a.5.5 0 01.5-.5h1.45a.5.5 0 01.5.5v1.418a.5.5 0 01-.5.5h-1.45a.5.5 0 01-.5-.5v-1.418zm1 .5v.419h.45v-.419h-.45zm-12.673-1a.5.5 0 01.5.5v1.418a.5.5 0 01-.5.5h-1.45a.5.5 0 01-.5-.5v-1.418a.5.5 0 01.5-.5h1.45zm-.5 1.419v-.419h-.45v.419h.45zm12.173 1.917a.5.5 0 01.5-.5h1.45a.5.5 0 01.5.5v1.418a.5.5 0 01-.5.5h-1.45a.5.5 0 01-.5-.5v-1.418zm1 .5v.419h.45v-.419h-.45zm-12.673-1a.5.5 0 01.5.5v1.418a.5.5 0 01-.5.5h-1.45a.5.5 0 01-.5-.5v-1.418a.5.5 0 01.5-.5h1.45zm-.5 1.419v-.419h-.45v.419h.45zm4.369-5.694a.75.75 0 01.75-.75h3a.75.75 0 110 1.5h-3a.75.75 0 01-.75-.75zm2.25 1.448a2.25 2.25 0 00-2.25 2.249v2.545a.75.75 0 001.5 0v-2.545a.75.75 0 011.5 0v2.545a.75.75 0 001.5 0v-2.545a2.25 2.25 0 00-2.25-2.249z",fill:"currentColor",fillRule:"evenodd"})}));l.defaultProps={color:"#008087"},s.default=l},80610:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 24.589 27",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".user-alt_svg__cls-2{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"user-alt_svg__user",transform:"translate(-3 -2.412)",style:{isolation:"isolate"},children:[(0,i.jsx)("path",{className:"user-alt_svg__cls-2",d:"M26.589 23.471v-2.824A5.647 5.647 0 0020.941 15H9.647A5.
2647 5.647 0 004 20.647v2.824","data-name":"Path 3653",id:"user-alt_svg__Path_3653",transform:"translate(0 4.941)"}),(0,i.jsx)("circle",{className:"user-alt_svg__cls-2",cx:5.5,cy:5.5,"data-name":"Ellipse 1107",id:"user-alt_svg__Ellipse_1107",r:5.5,transform:"translate(10 3.412)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},39564:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 18 20",width:"1em"},e),{},{children:(0,i.jsx)("path",{clipRule:"evenodd",d:"M9 1.988c-1.564 0-2.831 1.242-2.831 2.774s1.267 2.773 2.83 2.773c1.564 0 2.832-1.241 2.832-2.773S10.563 1.988 9 1.988zM4.139 4.762C4.139 2.132 6.315 0 8.999 0c2.685 0 4.862 2.132 4.862 4.762 0 2.63-2.177 4.762-4.861 4.762-2.685 0-4.861-2.132-4.861-4.762zM2.364 18.012h13.272c-.491-3.14-3.275-5.547-6.636-5.547-3.36 0-6.145 2.406-6.636 5.547zm-2.113.712c.152-4.58 4.01-8.248 8.749-8.248 4.738 0 8.597 3.668 8.75 8.248.023.718-.573 1.276-1.271 1.276H1.521C.823 20 .227 19.442.25 18.724z",fill:"currentColor",fillRule:"evenodd"})}));l.defaultProps={color:"#008087"},s.default=l},59462:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 24 24",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M20.407 19.048a9.75 9.75 0 00-1.167-.483c-.257-.088-.474-.157-.573-.207a2.082 2.082 0 00-.366-.167v-.65c.393-.498.725-1.04.989-1.616a1.295 1.295 0 000-.789v-.187a.54.54 0 010-.276 3.299 3.299 0 00-.238-2.256 3.32 3.32 0 00-1.216-1.034 1.371 1.371 0 00-1.068-.592 3.502 3.502 0 00-2.533.66 3.055 3.055 0 00-.989 2.513c.029.148.079.29.149.424l.118.276v.236a2.63 2.63 0 00.11 1.39c.135.245.305.47.504.67.058.06.111.126.158.196.068.105.144.204.227.296v.758a.237.237 0 01-.089.08 4.295 4.295 0 01-.544.196c-.575.14-1.12.387-1.602.73-.123.11-.238.229-.346.354a5.48 5.48 0 00-.801-.512 9.123 9.123 0 00-1.118-.493c-.247-.088-.475-.157-.574-.207a1.577 1.577 0 00-.415-.167v-.65a7.987 7.987 0 00.989-1.607 1.296 1.296 0 000-.788 1.271 1.271 0 000-.197.559.559 0 010-.276 3.25 3.25 0 00-.247-2.256 3.32 3.32 0 00-1.217-1.034 1.382 1.382 0 00-1.068-.592 3.512 3.512 0 00-2.532.66 3.084 3.084 0 00-.99 2.503c.037.149.086.294.149.434l.119.276v.236c-.095.464-.057.945.108 1.39.136.245.302.474.495.68.06.055.113.118.158.186l.228.296v.758l-.08.08c-.18.075-.365.141-.553.196a4.629 4.629 0 00-1.593.73A2.825 2.825 0 002 21.127v.443a.924.924 0 00.92.927h8.902c.06.004.119.004.178 0 .06.004.119.004.178 0h8.902a.932.932 0 00.92-.927v-.788c-.01-.71-.87-1.34-1.593-1.734zm-16.419 1.28c.336-.2.7-.352 1.078-.452.35-.082.683-.218.99-.404a2.15 2.15 0 00.593-.69 1.06 1.06 0 00.099-.424v-1.123a.874.874 0 00-.248-.63 3.226 3.226 0 01-.227-.286 6.47 6.47 0 00-.287-.355l-.257-.286a3.926 3.926 0 010-.67v-.354c-.019-.3-.1-.591-.237-.858v-.069c-.01-.425.146-.838.435-1.152.43-.286.952-.401 1.464-.325.127.188.31.332.524.413.238.13.447.308.613.523.095.32.116.656.06.985a2.15 2.15 0 00-.08.887c.002.103.019.206.05.305-.275.488-.576.962-.9 1.419a.914.914 0 00-.158.502v1.045a1.298 1.298 0 00.989 1.162h.128c.27.14.55.256.841.345.321.103.635.229.94.375.302.159.582.357.83.59v.08H3.504c.122-.216.287-.404.485-.552zm16.518.68h-7.735c.102-.26.264-.494.475-.68.34-.197.707-.346 1.088-.442.35-.082.683-.218.99-.404.246-.183.45-.42.593-.69a1.07 1.07 0 00.109-.424v-1.133a.915.915 0 00-.248-.63 1.521 1.521 0 01-.227-.286 3.986 3.986 0 00-.297-.355l-.296-.286a5.274 5.274 0 010-.67 2.956 2.956 0 000-.354 2.21 2.21 0 00-.248-.867v-.06c-.006-.427.153-.84.445-1.152.428-.285.946-.4 1.454-.325.132.188.319.332.534.413.237.133.445.31.614.523.096.32.113.657.05.985a2.11 2.11 0 00-.07.887 1.148 1.148 0 000 .305c-.27.49-.567.963-.89 1.419a.905.905 0 00-.149.502v1.045a1.288 1.288 0 00.99 1.162h.138c.266.139.544.254.83.345.338.104.669.229.99.375.3.158.576.357.82.59l.04.208zM8.578 9.827h1.978l.623 1.182a.908.908 0 00.811.483.912.912 0 00.811-.483l.633-1.192h1.979a2.24 2.24 0 001.58-.652c.42-.418.655-.984.655-1.575V3.727c0-.59-.236-1.157-.655-1.575a2.24 2.24 0 00-1.58-.652H8.578a2.24 2.24 0 00-1.581.652c-.42.418-.655.984-.655 1.575v3.872a2.22 2.22 0 00.655 1.575 2.236 2.236 0 001.58.652zm-.752-6.1a.746.746 0 01.464-.691.754.754 0 01.288-.057h6.825a.753.753 0 01.751.749v3.872a.747.747 0 01-.751.749h-2.315a.933.933 0 00-.811.483l-.287.541-.287-.541a.908.908 0 00-.81-.483H8.577a.753.753 0 01-.752-.75V3.728z",fill:"
2currentColor"})}));l.defaultProps={color:"#008087"},s.default=l},75872:function(e,s,a){"use strict";a.r(s),a.d(s,{AlgorithmicProblem:function(){return t.default},Binocular:function(){return i.default},Bulb:function(){return l.default},CaseStudyProblem:function(){return n.default},ChallengeFlag:function(){return r.default},Compass:function(){return o.default},Cte:function(){return d.default},DecisionMakingProblem:function(){return c.default},DesignProblem:function(){return h.default},DiagnosisSolutionProblem:function(){return u.default},DilemmaProblem:function(){return m.default},DocSquare:function(){return g.default},DoubleComment:function(){return p.default},DragIndicator:function(){return x.default},Ela:function(){return v.default},Eye:function(){return f.default},FlagTop:function(){return j.default},GradedPaper:function(){return _.default},Grid3X3:function(){return b.default},HandshakeBriefcase:function(){return A.default},InfoIcon:function(){return y.default},Magnifier:function(){return N.default},Math:function(){return w.default},MultipleFiles:function(){return S.default},Pd:function(){return C.default},Pencil:function(){return M.default},PolicyAnalysisProblem:function(){return k.default},PuzzleWPiece:function(){return z.default},RuleUsingProblem:function(){return T.default},Schoolhouse:function(){return I.default},Science:function(){return E.default},SocialStudies:function(){return F.default},Steam:function(){return R.default},StoryWordProblem:function(){return D.default},StrategicProblem:function(){return B.default},StudentGradCap:function(){return P.default},ThreeBarsWGrowthArrow:function(){return L.default},TroubleshootingProblem:function(){return O.default},University:function(){return H.default},UserIcon:function(){return U.default}});var t=a(93694),i=a(993),l=a(28229),n=a(14146),r=a(42111),o=a(56740),d=a(90926),c=a(28602),h=a(457),u=a(49875),m=a(39542),g=a(34569),p=a(28862),x=a(6335),v=a(50260),f=a(15253),j=a(23489),_=a(933),b=a(84648),A=a(27293),y=a(72551),w=a(57628),N=a(69748),S=a(6707),C=a(85746),M=a(8739),k=a(51719),z=a(35375),T=a(13731),I=a(89636),E=a(91294),F=a(92460),R=a(29448),D=a(24630),B=a(74851),P=a(15839),L=a(91753),O=a(2367),H=a(31274),U=a(39564)},13527:function(e,s,a){"use strict";a.r(s),a.d(s,{bronze_bricks:function(){return t},bronze_cards:function(){return i},bronze_collaboration:function(){return l},bronze_creativity:function(){return n},bronze_hello_world:function(){return r},collaborator_white:function(){return y},communicator_white:function(){return A},creativity_white:function(){return w},critical_white:function(){return N},gold_bricks:function(){return o},gold_cards:function(){return d},gold_creativity:function(){return c},gold_hello_world:function(){return h},platinum_hellow_world:function(){return u},red_casette:function(){return m},red_movie:function(){return g},red_profile:function(){return p},silver_bricks:function(){return x},silver_cards:function(){return v},silver_hellow_world:function(){return f},turq_cheese:function(){return j},turq_fly:function(){return _},turq_strength:function(){return b}});a(58878);var t=a.p+"static/media/bronze_bricks.22019f0cb949fb728ba09589f0f4ba59.svg";var i=a.p+"static/media/bronze_cards.1993ca8757d72d02d4c08533d602d1c4.svg";var l=a.p+"static/media/bronze_collaboration.7980ac7377b1017ddb2932a7f0bb5bb7.svg";var n=a.p+"static/media/bronze_creativity.5ca42e677d4c03dee3f784b129dc919d.svg";var r=a.p+"static/media/bronze_hello_world.d0cb8368cdff4c6d3ab5fe7995823593.svg";var o=a.p+"static/media/gold_bricks.3ff4df40ae55972248502d63a1fb757e.svg";var d=a.p+"static/media/gold_cards.45cdbbb52901eb1bd1c1be5780aa9510.svg";var c=a.p+"static/media/gold_creativity.9883ff98f19137be858a97dd1eadaf13.svg";var h=a.p+"static/media/gold_hello_world.8f2a327f8a7ff0f4c00d74ceb053adc0.svg";var u=a.p+"static/media/platinum_hello_world.10a0cb51500948e830e64cb2cb796294.svg";var m=a.p+"static/media/red_casette.724e8cf9b45566dd012305ee68b6bb9e.svg";var g=a.p+"static/media/red_movie.804426c16b3f41183dad30134e9fd2b9.svg";var p=a.p+"static/media/red_profile.752986a06ee8f2c2ff0d8bce4ac37fae.svg";var x=a.p+"static/media/silver_bricks.6ab1da2e5781595e9b1f166b302daeaa.svg";var v=a.p+"static/media/silver_cards.ef86372315a5a036d5f6731b3b8d128c.svg";var f=a.p+"static/media/silver_hello_world.844698c7fad0154b64bd85544ccb5d8c.svg";var j=a.p+"static/media/turq_cheese.5621e8f4ea8742ea971bd88f387379f8.svg";var _=a.p+"static/media/turq_fly.7b61ec63544a05c06c182fa3d57421f3.svg";var b=a.p+"static/media/turq_strength.f3f0d0e2438431dd92fad3e0c7c19c45.svg";var A=a.p+"static/media/communicator-white.e64842f0dcd0dec61afb162b3a531e95.svg";var y=a.p+"static/media/collaborator-white.10b4aef565e96707b7f9b63c0816ad39.svg";
2var w=a.p+"static/media/creator-white.73381a7aad5459ebbebc735d2fad3808.svg";var N=a.p+"static/media/critical-thinker-white.126b00d2563f8712451f0b83ead45861.svg"},40121:function(e,s,a){"use strict";a.r(s),a.d(s,{SvgrBricks:function(){return t.default},SvgrGroupTwoUsers:function(){return i.default}});var t=a(82106),i=a(2379)},82106:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsxs)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 18 18",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("path",{d:"M0 0h18v18H0z"}),(0,i.jsx)("mask",{fill:"#fff",id:"challenge-hub_svg__a",children:(0,i.jsx)("rect",{height:5.25,rx:1,width:9.375,y:3})}),(0,i.jsx)("rect",{height:5.25,mask:"url(#challenge-hub_svg__a)",rx:1,stroke:(null===e||void 0===e?void 0:e.color)||"#008087",strokeWidth:4,width:9.375,y:3}),(0,i.jsx)("mask",{fill:"#fff",id:"challenge-hub_svg__b",children:(0,i.jsx)("rect",{height:5.25,rx:1,width:7.5,x:10.5,y:3})}),(0,i.jsx)("rect",{height:5.25,mask:"url(#challenge-hub_svg__b)",rx:1,stroke:(null===e||void 0===e?void 0:e.color)||"#008087",strokeWidth:4,width:7.5,x:10.5,y:3}),(0,i.jsx)("mask",{fill:"#fff",id:"challenge-hub_svg__c",children:(0,i.jsx)("rect",{height:5.25,rx:1,width:5.25,x:12.75,y:9.75})}),(0,i.jsx)("rect",{height:5.25,mask:"url(#challenge-hub_svg__c)",rx:1,stroke:(null===e||void 0===e?void 0:e.color)||"#008087",strokeWidth:4,width:5.25,x:12.75,y:9.75}),(0,i.jsx)("mask",{fill:"#fff",id:"challenge-hub_svg__d",children:(0,i.jsx)("rect",{height:5.25,rx:1,width:5.25,y:9.75})}),(0,i.jsx)("rect",{height:5.25,mask:"url(#challenge-hub_svg__d)",rx:1,stroke:(null===e||void 0===e?void 0:e.color)||"#008087",strokeWidth:4,width:5.25,y:9.75}),(0,i.jsx)("mask",{fill:"#fff",id:"challenge-hub_svg__e",children:(0,i.jsx)("rect",{height:5.25,rx:1,width:5.25,x:6.375,y:9.75})}),(0,i.jsx)("rect",{height:5.25,mask:"url(#challenge-hub_svg__e)",rx:1,stroke:(null===e||void 0===e?void 0:e.color)||"#008087",strokeWidth:4,width:5.25,x:6.375,y:9.75})]}))}},2379:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsx)("svg",(0,t.A)((0,t.A)({fill:"none",height:"1em",viewBox:"0 0 20 17",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M12.642 16.647H1.646a.815.815 0 01-.814-.814v-1.816c.004-.406.138-.8.383-1.124.245-.321.588-.553.977-.66l2.444-.684.114-.774a3.926 3.926 0 01-1.784-3.258V5.953a3.869 3.869 0 01.318-1.547c.21-.488.518-.928.904-1.295.385-.36.84-.637 1.335-.814a6.076 6.076 0 011.776-.27 4.569 4.569 0 011.507.27c.496.177.95.454 1.335.814.386.367.693.807.904 1.295.212.488.32 1.015.318 1.547v1.564a3.877 3.877 0 01-.643 2.126c-.292.461-.681.853-1.14 1.148l.113.774 2.444.684c.389.107.732.34.977.66.243.324.374.719.375 1.124v1.816a.815.815 0 01-.847.798zM2.46 15.018h9.366v-1.002a.211.211 0 00-.04-.138.277.277 0 00-.13-.081l-2.607-.733a1.408 1.408 0 01-.635-.4 1.303 1.303 0 01-.326-.692l-.22-1.515a.815.815 0 01.472-.863c.403-.174.75-.456 1.002-.814.244-.37.374-.803.375-1.246V5.978c0-.311-.064-.619-.188-.904a2.313 2.313 0 00-.529-.758 2.362 2.362 0 00-.814-.496 2.826 2.826 0 00-.929-.163 4.675 4.675 0 00-1.197.163c-.303.108-.58.277-.815.496a2.313 2.313 0 00-.529.758 2.273 2.273 0 00-.187.904v1.564c.001.44.131.87.374 1.238.25.36.598.642 1.002.814a.814.814 0 01.472.863l-.22 1.515c-.04.257-.153.498-.325.693a1.27 1.27 0 01-.644.399l-2.606.733a.253.253 0 00-.122.081.22.22 0 00-.049.139l.049 1.001zm15.89 1.63h-3.144a.815.815 0 010-1.63h2.33v-2.134a.28
26.286 0 00-.066-.179.268.268 0 00-.122-.09l-3.054-.814a1.311 1.311 0 01-.668-.415 1.385 1.385 0 01-.326-.709l-.22-1.563a.815.815 0 01.465-.815c.41-.198.754-.509.993-.896.247-.402.376-.864.375-1.336v-1.49a2.59 2.59 0 00-.652-1.784 2.444 2.444 0 00-1.629-.814 2.215 2.215 0 00-1.197.326.815.815 0 01-.814-1.401 3.828 3.828 0 012.117-.546 3.967 3.967 0 012.753 1.328 4.219 4.219 0 011.05 2.94v1.482a4.113 4.113 0 01-.618 2.183 4.163 4.163 0 01-1.149 1.205l.114.815 2.867.75c.408.103.768.345 1.018.683.254.332.391.739.391 1.157v2.948a.815.815 0 01-.814.798z",fill:(null===e||void 0===e?void 0:e.fill)||"#008087"})}))}},64221:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 24 26",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".file_svg__cls-1{fill:none;stroke:currentColor;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{"data-name":"5- File",id:"file_svg___5-_File",transform:"translate(-8.652 -8.348)",children:[(0,i.jsx)("path",{className:"file_svg__cls-1",d:"M17 23a2 2 0 002-2v-4l-6 6","data-name":"Path 3506",id:"file_svg__Path_3506",transform:"translate(-3.348 -7.652)"}),(0,i.jsx)("path",{className:"file_svg__cls-1",d:"M33 17H19l-6 6v16a2 2 0 002 2h18a2 2 0 002-2V19a2 2 0 00-2-2z","data-name":"Path 3507",id:"file_svg__Path_3507",transform:"translate(-3.348 -7.652)"}),(0,i.jsx)("path",{className:"file_svg__cls-1",d:"M0 0h12.267","data-name":"Line 1114",id:"file_svg__Line_1114",transform:"translate(14.785 22.614)"}),(0,i.jsx)("path",{className:"file_svg__cls-1",d:"M0 0h12.267","data-name":"Line 1115",id:"file_svg__Line_1115",transform:"translate(14.785 27.214)"}),(0,i.jsx)("path",{className:"file_svg__cls-1",d:"M0 0h4.6","data-name":"Line 1116",id:"file_svg__Line_1116",transform:"translate(22.452 18.014)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},57247:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 25.654 25.654",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".video_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"video_svg__player",transform:"translate(.5 .5)",children:[(0,i.jsx)("path",{className:"video_svg__cls-1",d:"M6.5 2.5v7.885l6.308-3.942z","data-name":"Path 3771",id:"video_svg__Path_3771",transform:"translate(3.462 1.154)"}),(0,i.jsx)("circle",{className:"video_svg__cls-1",cx:3,cy:3,"data-name":"Ellipse 1220",id:"video_svg__Ellipse_1220",r:3,transform:"translate(10.5 14.5)"}),(0,i.jsx)("path",{className:"video_svg__cls-1",d:"M0 0h7","data-name":"Line 1242",id:"video_svg__Line_1242",transform:"translate(3.5 17.5)"}),(0,i.jsx)("path",{className:"video_svg__cls-1",d:"M0 0h1","data-name":"Line 1243",id:"video_svg__Line_1243",transform:"translate(19.5 17.5)"}),(0,i.jsx)("path",{className:"video_svg__cls-1",d:"M22.577 24.154h-20.5A1.578 1.578 0 01.5 22.577v-20.5A1.578 1.578 0 012.077.5h20.5a1.578 1.578 0 011.577 1.577v20.5a1.578 1.578 0 01-1.577 1.577z","data-name":"Path 3772",id:"video_svg__Path_3772"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},16065:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 32 30",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".visual_svg__cls-1{fill:currentColor}"})}),(0,i.jsxs)("g",{"data-name":"15-Image",id:"visual_svg___15-Image",transform:"translate(0 -1)",children:[(0,i.jsx)("path",{className:"visual_svg__cls-1",d:"M28 31H4a4 4 0 01-4-4V5a4 4 0 014-4h24a4 4 0 014 4v22a4 4 0 01-4 4zM4 3a2 2 0 00-2 2v22a2 2 0 002 2h24a2 2 0 002-2V5a2 2 0 00-2-2z","data-name":"Path 3501",id:"visual_svg__Path_3501"}),(0,i.jsx)("path",{className:"visual_svg__cls-1",d:"M2 30a1 1 0 01-.707-1.707l11-11a1 1 0 011.414 0L21 24.586l3.293-3.293a1 1 0 011.414 0l6 6a1 1 0 11-1.414 1.414L25 23.414l-3.293 3.293a1 1 0 01-1.414 0L13 19.414 2.707 29.707A1 1 0 012 30z","data-name":"Path 3502",id:"visual_svg__Path_3502"}),(0,i.jsx)("path",{className:"visual_svg__cls-1",d:"M19 16a4 4 0 114-4 4 4 0 01-4 4zm0-6a2 2 0 102 2 2 2 0 00-2-2z","data-name":"Path 3503",id:"visual_svg__Path_3503"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},53851:function(e,s,a){"use strict";a.r(s);a(58878);var t=a(90782);s.default=e=>{let{className:s,style:a}=e;return(0,t.jsx)("svg",{className:s,height:"17.078",style:a,viewBox:"0 0 17.078 17.078",width:"17.078",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsxs)("g",{id:"download-file",transform:"translate(-1)",children:[(0,t.jsx)("path",{class:"cls-1",d:"M12.391 7.5l-3.446 3.445L5.5 7.5","data-name":"Path 3780",id:"Path_3780",transform:"translate(.594 1.039)"}),(0,t.jsx)("path",{class:"cls-1",d:"M0 11V0","data-name":"Line 1248",id:"Line_1248",transform:"translate(9.5 .5)"}),(0,t.jsx)("path",{class:"cls-1",d:"M12.984 5.5h3.446l1.148 10.336H1.5L2.648 5.5h3.446","data-name":"Path 3781",id:"Path_3781",transform:"translate(0 .742)"})]})})}},4613:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return n},video_player_icons:function(){return l}});a(58878);var t=a.p+"static/media/icon-download-green.bf22d7ea12d13522fce825d761fea1cf.svg";
2var i=a.p+"static/media/play-button.044dfd7892b8d727d9630516ad525318.svg";const l={download:t,play:a.p+"static/media/icon-play.952e7b94262bc75225360dbd4fd302d6.svg",play2:i};var n=l},20449:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 32 26",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".binocular_svg__cls-1{fill:none;stroke:#008087;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"binocular_svg__binocular",transform:"translate(.5 -.5)",children:[(0,i.jsx)("path",{className:"binocular_svg__cls-1",d:"M28.363 14.38l-7.2-10.833a3.924 3.924 0 00-6.422-.68 3.924 3.924 0 00-6.422.68L1.128 14.38","data-name":"Path 3833",id:"binocular_svg__Path_3833",transform:"translate(.616)"}),(0,i.jsx)("circle",{className:"binocular_svg__cls-1",cx:7,cy:7,"data-name":"Ellipse 1274",id:"binocular_svg__Ellipse_1274",r:7,transform:"translate(.5 11.5)"}),(0,i.jsx)("circle",{className:"binocular_svg__cls-1",cx:7,cy:7,"data-name":"Ellipse 1275",id:"binocular_svg__Ellipse_1275",r:7,transform:"translate(16.5 11.5)"})]})]}))}},96625:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 39.491 39.491",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".compass_svg__cls-1{fill:none;stroke:#008087;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"compass_svg__compass",transform:"rotate(-60 22.048 11.152)",children:[(0,i.jsx)("circle",{className:"compass_svg__cls-1",cx:13.455,cy:13.455,"data-name":"Ellipse 986",id:"compass_svg__Ellipse_986",r:13.455}),(0,i.jsx)("path",{className:"compass_svg__cls-1",d:"M11.332 0L8.5 8.5 0 11.332l2.833-8.5z","data-name":"Path 3553",id:"compass_svg__Path_3553",transform:"translate(7.697 7.697)"})]})]}))}},59820:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 19.618 26.225",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".bulb_svg__cls-1{fill:none;stroke:#008087;stroke-linecap:square;stroke-miterlimit:10;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"bulb_svg__bulb-61",transform:"translate(-3)",children:[(0,i.jsx)("path",{className:"bulb_svg__cls-1",d:"M21.618 9.809a8.809 8.809 0 10-12.112 8.163v2.848h6.607v-2.848a8.806 8.806 0 005.505-8.163z","data-name":"Path 3836",id:"bulb_svg__Path_3836"}),(0,i.jsx)("path",{className:"bulb_svg__cls-1",d:"M15.607 19v4.4H9V19","data-name":"Path 3837",id:"bulb_svg__Path_3837",transform:"translate(.506 1.82)"})]})]}))}},26187:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));s.default=function(e){return(0,i.jsx)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 16.096 25.753",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:(0,i.jsx)("path",{d:"M10.776 17.707l.656 4.073a3.428 3.428 0 11-6.769 0l.656-4.073A9.134 9.134 0 010 9.121C0 4.115 3.566 0 8.048 0S16.1 4.115 16.1 9.121a9.134 9.134 0 01-5.319 8.586zm-3.365.507l-.629 3.907a1.282 1.282 0 102.531 0l-.629-3.907q-.315.028-.637.028t-.637-.028zm.637-2.118c3.223 0 5.9-3.091 5.9-6.975s-2.679-6.975-5.9-6.975-5.9 3.091-5.9 6.975 2.677 6.979 5.9 6.979z",fill:"#008087"})}))}},42407:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return u},reactions:function(){return h}});a(58878);var t=a.p+"static/media/icon-thumb-inactive.6370c33012222d813ce8a1a007f98a06.svg";var i=a.p+"static/media/icon-heart-inactive.62e3473ed64a2e13ecb745bfb4935903.svg";var l=a.p+"static/media/icon-fire-inactive.c8fdad5a09237077d17dc2c56fbeae6b.svg";var n=a.p+"static/media/icon-thumb-white.1ffe953e0e23f88fcdaa17f8084b5ecd.svg";var r=a.p+"static/media/icon-heart-white.19ae5357b0bcb571ffc48cee24b11b98.svg";var o=a.p+"static/media/icon-fire-white.73ef67a0a1b8dddef763cbf46cd34a09.svg";var d=a.p+"static/media/icon-thumb.0f68ea4f9326a6de9bd6ce1dfdd12188.svg";var c=a.p+"static/media/icon-heart.f4f84a065c071203a8c760149d405c36.svg";const h={fire:{active:a.p+"static/media/icon-fire.a80adfbfa6a5d872c373c01f6dc1c14a.svg",inactive:l,white:o},like:{active:d,inactive:t,white:n},love:{active:c,inactive:i,white:r}};var u=h},47245:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 30 30.001",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".link_svg__cls-1{fill:currentColor}"})}),(0,i.jsxs)("g",{id:"link_svg__link",transform:"translate(-1 -.999)",children:[(0,i.jsx)("path",{className:"link_svg__cls-1",d:"M17.619 10.138l-2.241 2.24c-.06.061-.1.13-.158.193a4.958 4.958 0 012.816 1.393 5.008 5.008 0 010 7.072l-5.5 5.5a5 5 0 11-7.072-7.072l2.385-2.385a10.054 10.054 0 01-.23-4.011l-4.276 4.275a8 8 0 0011.314 11.314l5.5-5.5a7.99 7.99 0 00-2.538-13.019z","data-name":"Path 3894",id:"link_svg__Path_3894"}),(0,i.jsx)("path",{className:"link_svg__cls-1",d:"M17.343 3.343l-5.5 5.5a7.99 7.99 0 002.538 13.019l2.241-2.24c.06-.061.107-.129.162-.193a4.953 4.953 0 01-2.82-1.393 5.008 5.008 0 010-7.072l5.5-5.5a5 5 0 017.072 7.072l-2.383 2.382a10.086 10.086 0 01.241 4l4.263-4.263A8 8 0 1017.343 3.343z","data-name":"Path 3895",id:"link_svg__Path_3895"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},39060:function(e,s,a){"use strict";a.r(s);var t=a(27405),i=(a(58878),a(90782));const l=e=>(0,i.jsxs)("svg",(0,t.A)((0,t.A)({height:"1em",viewBox:"0 0 33.287 27",width:"1em",xmlns:"http://www.w3.org/2000/svg"},e),{},{children:[(0,i.jsx)("defs",{children:(0,i.jsx)("style",{children:".text_icon_svg__cls-1{fill:none;stroke:currentColor;stroke-linecap:round;stroke-linejoin:round;stroke-width:2px}"})}),(0,i.jsxs)("g",{id:"text_icon_svg__capitalize",transform:"translate(.787 -1.5)",children:[(0,i.jsx)("path",{className:"text_icon_svg__cls-1",d:"M0 0h16","data-name":"Line 1332",id:"text_icon_svg__Line_1332",transform:"translate(15.5 2.5)"}),(0,i.jsx)("path",{className:"text_icon_svg__cls-1",d:"M0 0h12","data-name":"Line 1333",id:"text_icon_svg__Line_1333",transform:"translate(19.5 11.5)"}),(0,i.jsx)("path",{className:"text_icon_svg__cls-1",d:"M0 0h12","data-name":"Line 1334",id:"text_icon_svg__Line_1334",transform:"translate(19.5 18.5)"}),(0,i.jsx)("path",{className:"text_icon_svg__cls-1",d:"M0 0h31","data-name":"Line 1335",id:"text_icon_svg__Line_1335",transform:"translate(.5 27.5)"}),(0,i.jsx)("path",{className:"text_icon_svg__cls-1",d:"M12.951 19.1L6.726 2.5.5 19.1","data-name":"Path 3896",id:"text_icon_svg__Path_3896"}),(0,i.jsx)("path",{className:"text_icon_svg__cls-1",d:"M0 0h7.782","data-name":"Line 1336",id:"text_icon_svg__Line_1336",transform:"translate(2.835 12.876)"})]})]}));l.defaultProps={color:"#207DE9"},s.default=l},44054:function(e,s,a){var t={"./FaArrowCircleLeft.svg":34165,"./FaArrowCircleRight.svg":34104,"./SvgrIcons":75872,"./SvgrIcons/":75872,"./SvgrIcons/AlgorithmicProblem":93694,"./SvgrIcons/AlgorithmicProblem.js":93694,"./SvgrIcons/Binocular":993,"./SvgrIcons/Binocular.js":993,"./SvgrIcons/Bulb":28229,"./SvgrIcons/Bulb.js":28229,"./SvgrIcons/CaseStudyProblem":14146,"./SvgrIcons/CaseStudyProblem.js":14146,"./SvgrIcons/ChallengeFlag":42111,"./SvgrIcons/ChallengeFlag.js":42111,"./SvgrIcons/Checklist":48268,"./SvgrIcons/Checklist.js":48268,"./SvgrIcons/ClockIcon":36495,"./SvgrIcons/ClockIcon.js":36495,"./SvgrIcons/Compass":56740,"./SvgrIcons/Compass.js":56740,"./SvgrIcons/Conference":74640,"./SvgrIcons/Conference.js":74640,"./SvgrIcons/CopyIcon":86398,"./SvgrIcons/CopyIcon.js":86398,"./SvgrIcons/Cte":90926,"./SvgrIcons/Cte.js":90926,"./SvgrIcons/CursorSelect":13836,"./SvgrIcons/CursorSelect.js":13836,"./SvgrIcons/DataLiteracy":44103,"./SvgrIcons/DataLiteracy.js":44103,"./SvgrIcons/DecisionMakingProblem":28602,"./SvgrIcons/DecisionMakingProblem.js":28602,"./SvgrIcons/DesignProblem":457,"./SvgrIcons/DesignProblem.js":457,"./SvgrIcons/DiagnosisSolutionProblem":49875,"./SvgrIcons/DiagnosisSolutionProblem.js":49875,"./SvgrIcons/DilemmaProblem":39542,"./SvgrIcons/DilemmaProblem.js":39542,"./SvgrIcons/DiversityInclusion":5989,"./SvgrIcons/DiversityInclusion.js":5989,"./SvgrIcons/DocSquare":34569,"./SvgrIcons/DocSquare.js":34569,"./SvgrIcons/DoubleComment":28862,"./SvgrIcons/DoubleComment.
2js":28862,"./SvgrIcons/DragIndicator":6335,"./SvgrIcons/DragIndicator.js":6335,"./SvgrIcons/Ela":50260,"./SvgrIcons/Ela.js":50260,"./SvgrIcons/Eye":15253,"./SvgrIcons/Eye.js":15253,"./SvgrIcons/Flag":18620,"./SvgrIcons/Flag.js":18620,"./SvgrIcons/FlagTop":23489,"./SvgrIcons/FlagTop.js":23489,"./SvgrIcons/Flagpole":15282,"./SvgrIcons/Flagpole.js":15282,"./SvgrIcons/Flash":51578,"./SvgrIcons/Flash.js":51578,"./SvgrIcons/GradeIcon":46038,"./SvgrIcons/GradeIcon.js":46038,"./SvgrIcons/GradedPaper":933,"./SvgrIcons/GradedPaper.js":933,"./SvgrIcons/Grid":55293,"./SvgrIcons/Grid.js":55293,"./SvgrIcons/Grid3X3":84648,"./SvgrIcons/Grid3X3.js":84648,"./SvgrIcons/HandshakeBriefcase":27293,"./SvgrIcons/HandshakeBriefcase.js":27293,"./SvgrIcons/IconSolution":55132,"./SvgrIcons/IconSolution.js":55132,"./SvgrIcons/ImgIconPlus":85550,"./SvgrIcons/ImgIconPlus.js":85550,"./SvgrIcons/InfoIcon":72551,"./SvgrIcons/InfoIcon.js":72551,"./SvgrIcons/Innovation":741,"./SvgrIcons/Innovation.js":741,"./SvgrIcons/Leadership":44393,"./SvgrIcons/Leadership.js":44393,"./SvgrIcons/Magnifier":69748,"./SvgrIcons/Magnifier.js":69748,"./SvgrIcons/Math":57628,"./SvgrIcons/Math.js":57628,"./SvgrIcons/MultipleFiles":6707,"./SvgrIcons/MultipleFiles.js":6707,"./SvgrIcons/Pd":85746,"./SvgrIcons/Pd.js":85746,"./SvgrIcons/Pencil":8739,"./SvgrIcons/Pencil.js":8739,"./SvgrIcons/PolicyAnalysisProblem":51719,"./SvgrIcons/PolicyAnalysisProblem.js":51719,"./SvgrIcons/Puzzle":19894,"./SvgrIcons/Puzzle.js":19894,"./SvgrIcons/PuzzleWPiece":35375,"./SvgrIcons/PuzzleWPiece.js":35375,"./SvgrIcons/RuleUsingProblem":13731,"./SvgrIcons/RuleUsingProblem.js":13731,"./SvgrIcons/Schoolhouse":89636,"./SvgrIcons/Schoolhouse.js":89636,"./SvgrIcons/SchoolhouseIcon":84465,"./SvgrIcons/SchoolhouseIcon.js":84465,"./SvgrIcons/Science":91294,"./SvgrIcons/Science.js":91294,"./SvgrIcons/ScienceBeaker":30148,"./SvgrIcons/ScienceBeaker.js":30148,"./SvgrIcons/ScienceBrain":72512,"./SvgrIcons/ScienceBrain.js":72512,"./SvgrIcons/Share":85591,"./SvgrIcons/Share.js":85591,"./SvgrIcons/SocialStudies":92460,"./SvgrIcons/SocialStudies.js":92460,"./SvgrIcons/Steam":29448,"./SvgrIcons/Steam.js":29448,"./SvgrIcons/StoryWordProblem":24630,"./SvgrIcons/StoryWordProblem.js":24630,"./SvgrIcons/StrategicProblem":74851,"./SvgrIcons/StrategicProblem.js":74851,"./SvgrIcons/StudentGradCap":15839,"./SvgrIcons/StudentGradCap.js":15839,"./SvgrIcons/Symbols":77217,"./SvgrIcons/Symbols.js":77217,"./SvgrIcons/Target":56071,"./SvgrIcons/Target.js":56071,"./SvgrIcons/Teams":47598,"./SvgrIcons/Teams.js":47598,"./SvgrIcons/ThreeBarsWGrowthArrow":91753,"./SvgrIcons/ThreeBarsWGrowthArrow.js":91753,"./SvgrIcons/ThreeCrayons":98117,"./SvgrIcons/ThreeCrayons.js":98117,"./SvgrIcons/ThreeUsers":71338,"./SvgrIcons/ThreeUsers.js":71338,"./SvgrIcons/TroubleshootingProblem":2367,"./SvgrIcons/TroubleshootingProblem.js":2367,"./SvgrIcons/University":31274,"./SvgrIcons/University.js":31274,"./SvgrIcons/UserAlt":80610,"./SvgrIcons/UserAlt.js":80610,"./SvgrIcons/UserIcon":39564,"./SvgrIcons/UserIcon.js":39564,"./SvgrIcons/UsersSpeech":59462,"./SvgrIcons/UsersSpeech.js":59462,"./SvgrIcons/Wellbeing":30147,"./SvgrIcons/Wellbeing.js":30147,"./SvgrIcons/index":75872,"./SvgrIcons/index.js":75872,"./achievement_badges":13527,"./achievement_badges/":13527,"./achievement_badges/bronze/bronze_bricks.svg":41799,"./achievement_badges/bronze/bronze_cards.svg":326,"./achievement_badges/bronze/bronze_collaboration.svg":18892,"./achievement_badges/bronze/bronze_creativity.svg":23559,"./achievement_badges/bronze/bronze_hello_world.svg":27850,"./achievement_badges/collaborator-white.svg":14167,"./achievement_badges/collaborator.svg":60439,"./achievement_badges/communicator-white.svg":47545,"./achievement_badges/communicator.svg":77418,"./achievement_badges/creator-white.svg":84809,"./achievement_badges/creator.svg":71605,"./achievement_badges/critical-thinker-white.svg":42858,"./achievement_badges/critical-thinker-white.zip":73165,"./achievement_badges/critical-thinker.svg":16350,"./achievement_badges/gold/gold_bricks.svg":77243,"./achievement_badges/gold/gold_cards.svg":91466,"./achievement_badges/gold/gold_creativity.svg":94395,"./achievement_badges/gold/gold_hello_world.svg":72814,"./achievement_badges/hello-world.svg":8602,"./achievement_badges/incoming.svg":60595,"./achievement_badges/index":13527,"./achievement_badges/index.js":13527,"./achievement_badges/mission-accompl
2ished.svg":9338,"./achievement_badges/platinum/platinum_hello_world.svg":55302,"./achievement_badges/red/red_casette.svg":30572,"./achievement_badges/red/red_movie.svg":14285,"./achievement_badges/red/red_profile.svg":99802,"./achievement_badges/silver/silver_bricks.svg":83961,"./achievement_badges/silver/silver_cards.svg":94164,"./achievement_badges/silver/silver_hello_world.svg":58104,"./achievement_badges/turq/turq_cheese.svg":53734,"./achievement_badges/turq/turq_fly.svg":80908,"./achievement_badges/turq/turq_strength.svg":59102,"./achievements/discovery-challenge-accepted.png":27217,"./achievements/discovery-fly-on-the-wall.png":76070,"./achievements/discovery-mission-briefing.png":76481,"./achievements/discovery-nostalgia.png":41856,"./achievements/discovery-phase-shifter.png":82491,"./achievements/discovery-phone-a-friend.png":48221,"./achievements/discovery-ring-ring.png":29301,"./achievements/discovery-say-cheese.png":99423,"./achievements/discovery-show-off.png":15145,"./achievements/discovery-team-up.png":13563,"./achievements/discovery-time-traveler.png":29525,"./achievements/milestones-chit-chat.png":2582,"./achievements/milestones-collaborator-2.png":69402,"./achievements/milestones-collaborator-3.png":59235,"./achievements/milestones-collaborator-4.png":9836,"./achievements/milestones-collaborator-5.png":21461,"./achievements/milestones-collaborator.png":27767,"./achievements/milestones-communicator-2.png":27991,"./achievements/milestones-communicator-3.png":28494,"./achievements/milestones-communicator-4.png":26977,"./achievements/milestones-communicator-5.png":5848,"./achievements/milestones-communicator.png":20262,"./achievements/milestones-creator-2.png":56982,"./achievements/milestones-creator-3.png":18719,"./achievements/milestones-creator-4.png":60064,"./achievements/milestones-creator-5.png":31241,"./achievements/milestones-creator.png":5723,"./achievements/milestones-critical-thinker-2.png":79339,"./achievements/milestones-critical-thinker-3.png":88834,"./achievements/milestones-critical-thinker-4.png":50557,"./achievements/milestones-critical-thinker-5.png":29428,"./achievements/milestones-critical-thinker.png":38178,"./achievements/milestones-curator.png":2945,"./achievements/milestones-file-storm.png":21661,"./achievements/milestones-hello-world.png":43412,"./achievements/milestones-incoming.png":31703,"./achievements/milestones-librarian.png":60643,"./achievements/milestones-master-solver.png":71933,"./achievements/milestones-mission-accomplished-4.png":95201,"./achievements/milestones-mission-accomplished-5.png":74072,"./achievements/milestones-mission-accomplished.png":46662,"./achievements/milestones-motor-mouth.png":53334,"./achievements/milestones-novelist.png":87801,"./achievements/milestones-small-talk.png":97107,"./achievements/milestones-upload-god.png":89429,"./achievements/milestones-veteran-solver.png":30368,"./alerts/warning/warning_info.svg":97848,"./ban_icon/ban.svg":99651,"./banner.jpg":14690,"./banner_dark.jpg":47831,"./bg-texture-right.png":32210,"./bin/bin.svg":19965,"./broken_pencil_icon/broken_pencil_icon.svg":35241,"./browser_logos/chrome-logo.png":67232,"./browser_logos/edge-logo.png":43483,"./browser_logos/firefox-logo.png":24009,"./calendar_icon/calendar_icon.svg":41329,"./calendar_icon/calendar_icon_black.svg":54565,"./call/call.svg":43387,"./cart_minus_icon/cart-minus-icon.svg":32293,"./challenge-hub":40121,"./challenge-hub/":40121,"./challenge-hub/index":40121,"./challenge-hub/index.js":40121,"./challenge-hub/welcome/SvgrBricks":82106,"./challenge-hub/welcome/SvgrBricks.js":82106,"./challenge-hub/welcome/SvgrGroupTwoUsers":2379,"./challenge-hub/welcome/SvgrGroupTwoUsers.js":2379,"./challenge_flag/challenge_flag.svg":91099,"./chart_growth/chart_growth.svg":9567,"./chat_call/chat_call.svg":85997,"./check_single_icon/check-single-green.svg":41155,"./check_single_icon/check-single.svg":17813,"./checked_circle/checked-circle.svg":55861,"./circle_w_check/check_green.svg":10858,"./circled_checkmark/circled-checkmark.svg":72231,"./class_link_icon/class_link_icon.png":1811,"./class_link_icon/[email protected]":16317,"./class_link_icon/[email protected]":25906,"./clever_icon/clever_icon.png":9351,"./clever_icon/[email protected]":45177,"./clever_icon/[email protected]":10350,"./clipboard_icon/clipboard_icon.svg":32939,"./clock/clock.svg":7661,"./clock_icon/black/clock_
2icon.svg":64251,"./clock_icon/mu_green/clock_icon.svg":66616,"./clock_icon/white/clock_white.svg":50961,"./comment_icon/comment-black.svg":83677,"./comment_icon/double_comment_icon/double_comment.svg":2415,"./courses/icons/Glossary.svg":47584,"./courses/icons/Learning Orientation.svg":22288,"./courses/icons/Microvideo.svg":77461,"./courses/icons/Notebook.svg":15707,"./crane_icon/crane_icon.svg":33693,"./curvy_banner/curvy-banner-blue.png":17518,"./curvy_banner/curvy-banner-blue.svg":53454,"./curvy_banner/curvy-banner-orange.png":18e3,"./curvy_banner/curvy-banner-orange.svg":93164,"./curvy_banner/curvy-banner-purple.png":32928,"./curvy_banner/curvy-banner-purple.svg":91928,"./curvy_banner/curvy-banner-turq.png":86556,"./curvy_banner/curvy-banner-turq.svg":85244,"./defaults/default-cover-image.jpeg":29455,"./defaults/default-icon-image.jpeg":59013,"./deliverables/audio/podcast.svg":16287,"./deliverables/audio/podcast_white.svg":30518,"./deliverables/file/File":64221,"./deliverables/file/File.js":64221,"./deliverables/file/file.svg":90280,"./deliverables/file/file_white.svg":50386,"./deliverables/slideshow/slider.svg":35121,"./deliverables/slideshow/slider_white.svg":68075,"./deliverables/upload_placeholder.png":56938,"./deliverables/video/Video":57247,"./deliverables/video/Video.js":57247,"./deliverables/video/video.svg":7986,"./deliverables/video/video_white.svg":96420,"./deliverables/visual/Visual":16065,"./deliverables/visual/Visual.js":16065,"./deliverables/visual/visual.svg":80580,"./deliverables/visual/visual_white.svg":90462,"./design-lab-hero2.png":36177,"./diploma/diploma.svg":84145,"./document_icon/document_icon.svg":1213,"./download_file_icon":53851,"./download_file_icon/":53851,"./download_file_icon/index":53851,"./download_file_icon/index.js":53851,"./drag_drop_image_placeholder_icon/drag_drop_image_placeholder_icon.svg":6159,"./drag_drop_image_placeholder_icon/drag_drop_square.svg":23901,"./drag_drop_image_placeholder_icon/upload_cloud/upload_cloud.svg":65150,"./embed_badge_icons/bandcamp-button-square-black/bandcamp-button-square-black-64.png":35855,"./embed_badge_icons/bandcamp-button-square-black/bandcamp-button-square-black.eps":70012,"./embed_badge_icons/canva_icon/canva_icon.jpg":83698,"./embed_badge_icons/creative_cloud_express_icon/creative_cloud_express_logo.png":70200,"./embed_badge_icons/google_sheets_icon/google_sheets_logo.png":67070,"./embed_badge_icons/gslides_icon/gslides_icon.png":44838,"./embed_badge_icons/office_online_icon/office_online_icon.svg":57130,"./embed_badge_icons/powtoon_icon/powtoon_icon.png":19608,"./embed_badge_icons/powtoon_icon/[email protected]":44864,"./embed_badge_icons/powtoon_icon/[email protected]":72120,"./embed_badge_icons/prezi_icon/prezi_icon.png":8096,"./embed_badge_icons/soundcloud_icon/soundcloud_icon.png":43326,"./embed_badge_icons/vimeo_icon/vimeo_icon.png":42976,"./embed_badge_icons/yt_icon/yt_icon.png":2078,"./fancy_modal/fancy_modal_header_bg.png":70969,"./fav-list/fav-list.svg":9035,"./folder_open_icon/folder_open_icon.svg":3909,"./framework_icon/framework_icon_mu_green.svg":39056,"./gamification/medals/award.png":13738,"./generic_group_pic.jpg":60300,"./generic_profile_pic.jpg":25558,"./google_meet/meet_logo_lg.png":15911,"./grade_icon/grade_icon.svg":79606,"./hourglass_icon/hourglass_purple.svg":41450,"./how-it-works-masthead.png":72273,"./icon-challenge-hub.svg":67813,"./icon-classlink.png":81140,"./icon-clever.png":49219,"./icon-google-classroom.png":98921,"./icon-google-meet.png":71435,"./icon-google.png":98931,"./icon-ms-teams.png":47
2759,"./icon-ms.png":95326,"./icon-slack.png":29912,"./icon-zoom.png":31275,"./icons/certified.svg":64336,"./icons/lightbulb-on.svg":24328,"./icons/uncertified.svg":10827,"./img_icon/img_icon.svg":71829,"./img_icon/mu_green/img_icon.svg":39424,"./img_icon/mu_purple/img_icon.svg":63891,"./info_icon/info_icon.svg":21325,"./info_icon/info_icon_blue.svg":23388,"./journey_icons/adaptibility-icon.png":63308,"./journey_icons/adaptibility-icon.svg":73402,"./journey_icons/agility-icon.png":14235,"./journey_icons/agility-icon.svg":54459,"./journey_icons/checkmark-circle-icon.png":71878,"./journey_icons/journey-icon.svg":38100,"./journey_icons/resilience-icon.png":46743,"./journey_icons/resilience-icon.svg":78925,"./landing/talogy-patterns-rgb-left-white.png":98617,"./language/language.svg":80187,"./logo.jpg":40045,"./logo_full.png":2621,"./logo_solvably.svg":15024,"./logo_solvably/logo_solvably.png":983,"./logo_solvably/[email protected]":75113,"./logo_solvably/[email protected]":64862,"./logos/credably-logo-bg.svg":17487,"./logos/credably-logo-initial-bg.svg":56318,"./logos/credably-logo-initial.svg":71706,"./logos/credably-logo.svg":78185,"./marketplace-flipcard-bg.svg":26983,"./medal.jpg":92895,"./media_controls":4613,"./media_controls/":4613,"./media_controls/icon-download-green.svg":34266,"./media_controls/icon-play.svg":8862,"./media_controls/index":4613,"./media_controls/index.js":4613,"./media_controls/play-button-hover.svg":8342,"./media_controls/play-button-pressed.svg":44026,"./media_controls/play-button.svg":28735,"./message/message.svg":57037,"./migration/migration.svg":45349,"./notepad/notepad.svg":67269,"./notification_icon/notification-icon.svg":68807,"./notifications/achievement.svg":35815,"./notifications/assigned.svg":42083,"./notifications/chat.svg":95549,"./notifications/generic.svg":29341,"./notifications/graded.svg":57484,"./paper-diploma/paper-diploma.svg":63357,"./paperclip/paperclip.svg":76745,"./pattern-phase-icons.png":43063,"./patterns/card-header-bg-shapes.svg":65667,"./patterns/phase-icon-pattern.svg":97548,"./pen_2/pen-2.svg":88047,"./pen_3/pen-3-white.svg":70487,"./pencil-edit/pencil-edit-2.svg":26800,"./pencil-edit/pencil-edit.svg":1977,"./pencil_wide/pencil_wide.svg":99749,"./phase_create_logo/pencil.svg":65902,"./phase_create_logo/pencil_white.svg":38384,"./phase_discover_logo":20449,"./phase_discover_logo/":20449,"./phase_discover_logo/binocular.svg":26931,"./phase_discover_logo/binocular_white.svg":29197,"./phase_discover_logo/index":20449,"./phase_discover_logo/index.js":20449,"./phase_explore_logo":96625,"./phase_explore_logo/":96625,"./phase_explore_logo/compass.svg":67536,"./phase_explore_logo/compass_white.svg":86698,"./phase_explore_logo/index":96625,"./phase_explore_logo/index.js":96625,"./phase_imagine_logo":59820,"./phase_imagine_logo/":59820,"./phase_imagine_logo/bulb.svg":5012,"./phase_imagine_logo/bulb_white.svg":68046,"./phase_imagine_logo/index":59820,"./phase_imagine_logo/index.js":59820,"./phase_reflect_logo":26187,"./phase_reflect_logo/":26187,"./phase_reflect_logo/checklist.svg":46506,"./phase_reflect_logo/checklist_white.svg":66444,"./phase_reflect_logo/index":26187,"./phase_reflect_logo/index.js":26187,"./picture/picture.svg":31869,"./pills-sideways-various.svg":79540,"./preview_icon/preview_icon.svg":3775,"./promo_code_icon/icon-promo-code.png":54427,"./promo_code_icon/promo-code-icon.png":41947,"./reaction_icons":42407,"./reaction_icons/":42407,"./reaction_icons/icon-fire-inactive.svg":94059,"./reaction_icons/icon-fire-white.svg":42647,"./reaction_icons/icon-fire.svg":78071,"./reaction_icons/icon-heart-inactive.svg":44985,"./reaction_icons/icon-heart-white.svg":73841,"./reaction_icons/icon-heart.svg":52237,"./reaction_icons/icon-thumb-inactive.svg":32161,"./reaction_icons/icon-thumb-white.svg":57145,"./reaction_icons/icon-thumb.svg":50277,"./reaction_icons/index":42407,"./reaction_icons/index.js":42407,"./schoolhouse_icon/schoolhouse_icon.svg":41675,"./skeleton/images/img-stack.svg":66633,"./social_media/facebook.svg":97963,"./social_media/linked-in.svg":18716,"./social_media/twitter.svg":92068,"./social_media/x.svg":78293,"./solvably-ai-sticky.png":64365,"./solvably_icons/assessment.svg":92968,"./solvably_icons/assignments.svg":8884,"./solvably_icons/blog.svg":63998,"./solvably_icons/candidate_journey.png":70332,"./solvably_icons/candidate_journey.svg":70184,"./solvably_icons/cartridge.svg":32665,"./solvably_icons/challenge.svg":24689,"./solvably_icons/clock.png":78192,"./solvably_icons/clock.svg":8252,"./solvably_icons/collaborators.svg":39633,"./solvably_icons/completed-assignments.svg":11160,"./solvably_icons/course.svg":24781,"./solvably_icons/engagement.png":43210,"./solvably_icons/engagement.svg":53711,"./solvably_icons/general/ClosedLock.svg":98236,"./solvably_icons/general/Select.png":63259,"./solvably_icons/general/Select.svg":26653,"./solvably_icons/individual.svg":51820,"./solvably_icons/ingenuity.png":82640,"./solvably_icons/ingenuity.svg":45604,"./solvably_icons/journey-default.png":47778,"./solvably_icons/journey.svg":26822,"./solvably_icons/lightbulb-on.svg":21547,"./solvably_icons/logos/brand_primary.png":15715,"./solvably_icons/papers.png":97853,"./solvably_icons/papers.svg":86719,"./solvably_icons/pencil.png":66267,"./solvably_icons/pencil.svg":48709,"./solvably_icons/recruiting.png":13706,"./solvably_icons/recruiting.svg":53160,"./speech_bubble_square/speech_bubble_sqr_icon.svg":11590,"./star/star.svg":43939,"./subjects/cte/[email protected]":82168,"./subjects/cte/cte_icon.svg":48937,"./subjects/ela/ela-icon.svg":64535,"./subjects/ela/[email protected]":62028,"./subjects/math/[email protected]":59434,"./subjects/math/math_icon.svg":29139,"./subjects/pd/[email protected]":85882,"./subjects/pd/pd_icon.svg":72611,"./subjects/science/[email protected]":18976,"./subjects/science/science_icon.svg":87753,"./subjects/social_studies/[email protected]":98764,"./subjects/social_studies/social_studies_icon.svg":26913,"./subjects/steam/[email protected]":13632,"./subjects/steam/steam_icon.svg":56545,"./subphase_examples/Create_4_1.png":88359,"./subphase_examples/Create_4_2.png":85708,"./subphase_examples/Discover_1_1.png":90819,"./subphase_examples/Discover_1_2.png":53960,"./subphase_examples/Discover_1_3.png":47825,"./subphase_examples/Discover_1_4_1.png":90970,"./subphase_examples/Discover_1_4_2.png":67217,"./subphase_examples/Explore_2_1.png":86846,"./subphase_examples/Imagine_3_1.png":67726,"./subphase_examples/Imagine_3_2.png":21733,"./subphase_examples/brainstorm_new_lxp_3_1_eg.png":38606,"./subphase_examples/need_to_know_new_lxp_2_1_eg.png":90946,"./subphase_examples/phase_1_4_new_lxp_eg.png":38743,"./subphase_examples/research_new_lxp_2_2_eg.png":53732,"./subphase_examples/screenshot-1-1.png":5578,"./subphase_examples/screenshot-1-2.png":54561,"./subphase_examples/screenshot-1-3.png":81848,"./subphase_examples/screenshot-1-4.png":61463,"./subphase_examples/screenshot-2-1.png":91833,"./subphase_examples/screenshot-2-2.png":35746,"./subphase_examples/screenshot-3-1.png":97500,"./subphase_examples/screenshot-3-2.png":21431,"./subphase_examples/screenshot-4-1.png":58659,"./subphase_examples/screenshot-4-2.png":5448,"./subphases/1-1/flag.svg":31117,"./subphases/1-1/wordcloud_placeholder.png":84334,"./subphases/1-2/user.svg":86367,"./subphases/1-3/target.svg":61194,"./subphases/1-4/share.svg":9465,"./subphases/2-1/science-beaker.svg":6799,"./subphases/3-1/flash.svg":84821,"./subphases/3-2/cursor-select.svg":48127,"./subphases/4-2/puzzle.svg":37953,"./subphases/5-1/science-brain.svg":2376,"./subphases/5-2/symbol
2s.svg":18693,"./subphases/5-3/three-users.svg":75088,"./subphases/5-4/three-crayons.svg":65070,"./svgr/challenge_flag.svg":62259,"./svgr/double_comment.svg":88662,"./svgr/grid_icon.svg":44321,"./talogy patterns/binary-pattern-primary.svg":66201,"./teams_icon/teams_black.svg":32030,"./teams_icon/teams_mu_green.svg":89846,"./three_bars_w_growth_arrow/three_bars_w_growth_arrow_orange.svg":5142,"./three_bars_w_growth_arrow/three_bars_w_growth_arrow_white.svg":80951,"./three_cocentric_circles/three_co_circles.svg":69859,"./topics/topic_bookmark/topic_bookmark.svg":44834,"./tri_textures.svg":97950,"./trophy_icon/black/trophy_icon.svg":23301,"./trophy_icon/mu_blue/trophy_icon.svg":85529,"./trophy_icon/mu_green/trophy_icon.png":68700,"./trophy_icon/mu_green/trophy_icon.svg":66052,"./trophy_icon/mu_green/[email protected]":98892,"./trophy_icon/mu_green/[email protected]":11863,"./trophy_icon/orange/trophy_icon.svg":1724,"./trophy_icon/white/trophy_icon.png":83233,"./trophy_icon/white/trophy_icon.svg":61687,"./trophy_icon/white/[email protected]":84547,"./trophy_icon/white/[email protected]":54443,"./type_icon/link_icon/Link":47245,"./type_icon/link_icon/Link.js":47245,"./type_icon/link_icon/link.svg":35928,"./type_icon/link_icon/link_white.svg":34722,"./type_icon/text_icon/TextIcon":39060,"./type_icon/text_icon/TextIcon.js":39060,"./type_icon/text_icon/text_icon_white.svg":21978,"./users_icon/users-mm-green.svg":73762,"./users_icon/users-mm.svg":24472,"./wavy-cutout.png":57502,"./zoom/icon-zoom-camera.png":50829,"./zoom/icon-zoom-text.png":99133};function i(e){var s=l(e);return a(s)}function l(e){if(!a.o(t,e)){var s=new Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}return t[e]}i.keys=function(){return Object.keys(t)},i.resolve=l,e.exports=i,i.id=44054},52919:function(e,s,a){var t={"./challenge-hub-tab-blue.png":79359,"./challenge-hub-tab-green.png":81722,"./challenge-hub-tab-purple.png":60853,"./challenge-hub-tab-white-selected.png":97312,"./challenge-hub-tab-white-selected.svg":38596,"./challenge-hub-tab-white.png":788,"./icon-add-image.png":16422,"./icon-add-video.png":67480,"./icon-project.png":11388};function i(e){var s=l(e);return a(s)}function l(e){if(!a.o(t,e)){var s=new Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}return t[e]}i.keys=function(){return Object.keys(t)},i.resolve=l,e.exports=i,i.id=52919},34165:function(e,s,a){"use strict";e.exports=a.p+"static/media/FaArrowCircleLeft.89b9d2075a1e01cd01c9.svg"},34104:function(e,s,a){"use strict";e.exports=a.p+"static/media/FaArrowCircleRight.74097bc2cfc9ce78a73f.svg"},41799:function(e,s,a){"use strict";e.exports=a.p+"static/media/bronze_bricks.22019f0cb949fb728ba0.svg"},326:function(e,s,a){"use strict";e.exports=a.p+"static/media/bronze_cards.1993ca8757d72d02d4c0.svg"},18892:function(e,s,a){"use strict";e.exports=a.p+"static/media/bronze_collaboration.7980ac7377b1017ddb29.svg"},23559:function(e,s,a){"use strict";e.exports=a.p+"static/media/bronze_creativity.5ca42e677d4c03dee3f7.svg"},27850:function(e,s,a){"use strict";e.exports=a.p+"static/media/bronze_hello_world.d0cb8368cdff4c6d3ab5.svg"},14167:function(e,s,a){"use strict";e.exports=a.p+"static/media/collaborator-white.10b4aef565e96707b7f9.svg"},60439:function(e,s,a){"use strict";e.exports=a.p+"static/media/collaborator.bf698f3ee38047dd1021.svg"},47545:function(e,s,a){"use strict";e.exports=a.p+"static/media/communicator-white.e64842f0dcd0dec61afb.svg"},77418:function(e,s,a){"use strict";e.exports=a.p+"static/media/communicator.1729f6549ec11447b42d.svg"},84809:function(e,s,a){"use strict";e.exports=a.p+"static/media/creator-white.73381a7aad5459ebbebc.svg"},71605:function(e,s,a){"use strict";e.exports=a.p+"static/media/creator.8ebd47c427e50a7ee468.svg"},42858:function(e,s,a){"use strict";e.exports=a.p+"static/media/critical-thinker-white.126b00d2563f8712451f.svg"},73165:function(e,s,a){"use strict";e.exports=a.p+"static/media/critical-thinker-white.1b9b9e32dd1c53899e29.zip"},16350:function(e,s,a){"use strict";e.exports=a.p+"static/media/critical-thinker.3ad43511c0687b05a886.svg"},77243:function(e,s,a){"use strict";e.exports=a.p+"static/media/gold_bricks.3ff4df40ae5597224850.svg"},91466:function(e,s,a){"use strict";e.exports=a.p+"static/media/gold_cards.45cdbbb52901eb1bd1c1.svg"},94395:function(e,s,a){"use strict";e.exports=a.p+"static/media/gold_creativity.9883ff98f19137be858a.svg"},72814:function(e,s,a){"use strict";e.exports=a.p+"static/media/gold_hello_world.8f2a327f8a7ff0f4c00d.svg"},8602:function(e,s,a){"use strict";e.exports=a.p+"static/media/hello-world.2acc6c01199ffc831ab4.svg"},60595:function(e,s,a){"use strict";e.exports=a.p+"static/media/incoming.16ca3c761e6b5c220c4b.svg"},9338:function(e,s,a){"use strict";
2e.exports=a.p+"static/media/mission-accomplished.2eb75de5681c01103ba9.svg"},55302:function(e,s,a){"use strict";e.exports=a.p+"static/media/platinum_hello_world.10a0cb51500948e830e6.svg"},30572:function(e,s,a){"use strict";e.exports=a.p+"static/media/red_casette.724e8cf9b45566dd0123.svg"},14285:function(e,s,a){"use strict";e.exports=a.p+"static/media/red_movie.804426c16b3f41183dad.svg"},99802:function(e,s,a){"use strict";e.exports=a.p+"static/media/red_profile.752986a06ee8f2c2ff0d.svg"},83961:function(e,s,a){"use strict";e.exports=a.p+"static/media/silver_bricks.6ab1da2e5781595e9b1f.svg"},94164:function(e,s,a){"use strict";e.exports=a.p+"static/media/silver_cards.ef86372315a5a036d5f6.svg"},58104:function(e,s,a){"use strict";e.exports=a.p+"static/media/silver_hello_world.844698c7fad0154b64bd.svg"},53734:function(e,s,a){"use strict";e.exports=a.p+"static/media/turq_cheese.5621e8f4ea8742ea971b.svg"},80908:function(e,s,a){"use strict";e.exports=a.p+"static/media/turq_fly.7b61ec63544a05c06c18.svg"},59102:function(e,s,a){"use strict";e.exports=a.p+"static/media/turq_strength.f3f0d0e2438431dd92fa.svg"},97848:function(e,s,a){"use strict";e.exports=a.p+"static/media/warning_info.50a3814c70bc63e68e2a.svg"},99651:function(e,s,a){"use strict";e.exports=a.p+"static/media/ban.7561b9ccd1ebc50916f3.svg"},19965:function(e,s,a){"use strict";e.exports=a.p+"static/media/bin.9641b7483e34141fb0c2.svg"},35241:function(e,s,a){"use strict";e.exports=a.p+"static/media/broken_pencil_icon.d1e63eeb070895ab53f5.svg"},41329:function(e,s,a){"use strict";e.exports=a.p+"static/media/calendar_icon.a02a4c824b7b9fa6b544.svg"},54565:function(e,s,a){"use strict";e.exports=a.p+"static/media/calendar_icon_black.327ac49d164ae8f5fe33.svg"},43387:function(e,s,a){"use strict";e.exports=a.p+"static/media/call.63855f98e7ac221b7f40.svg"},32293:function(e,s,a){"use strict";e.exports=a.p+"static/media/cart-minus-icon.96ef41a5b3ee3248bb0f.svg"},91099:function(e,s,a){"use strict";e.exports=a.p+"static/media/challenge_flag.b76691411846271e1402.svg"},9567:function(e,s,a){"use strict";e.exports=a.p+"static/media/chart_growth.daeb2fc638726885d466.svg"},85997:function(e,s,a){"use strict";e.exports=a.p+"static/media/chat_call.4547c3a5c697b03ed08e.svg"},41155:function(e,s,a){"use strict";e.exports=a.p+"static/media/check-single-green.797a83d5f21b68664f23.svg"},17813:function(e,s,a){"use strict";e.exports=a.p+"static/media/check-single.5abe3b720d2c0da81160.svg"},55861:function(e,s,a){"use strict";e.exports=a.p+"static/media/checked-circle.b427a614406ede7aafc0.svg"},10858:function(e,s,a){"use strict";e.exports=a.p+"static/media/check_green.503fa6831b5238d4bc16.svg"},72231:function(e,s,a){"use strict";e.exports=a.p+"static/media/circled-checkmark.c4b8b8967b7c81758d60.svg"},32939:function(e,s,a){"use strict";e.exports=a.p+"static/media/clipboard_icon.8de1efdbae7436185cf4.svg"},7661:function(e,s,a){"use strict";e.exports=a.p+"static/media/clock.1d438294fdef74c48b75.svg"},64251:function(e,s,a){"use strict";e.exports=a.p+"static/media/clock_icon.db0e952c77e9bb49debc.svg"},66616:function(e,s,a){"use strict";e.exports=a.p+"static/media/clock_icon.db0e952c77e9bb49debc.svg"},50961:function(e,s,a){"use strict";e.exports=a.p+"static/media/clock_white.da5e1d10648f7813ebc8.svg"},83677:function(e,s,a){"use strict";e.exports=a.p+"static/media/comment-black.32f694dc3f907a8bba06.svg"},2415:function(e,s,a){"use strict";e.exports=a.p+"static/media/double_comment.e4e296706e2ff5fa5b61.svg"},47584:function(e,s,a){"use strict";e.exports=a.p+"static/media/Glossary.2513e695dcd8db8aee7e.svg"},22288:function(e,s,a){"use strict";e.exports=a.p+"static/media/Learning Orientation.43f56295af67e706b729.svg"},77461:function(e,s,a){"use strict";e.exports=a.p+"static/media/Microvideo.1051981819114041a1d9.svg"},15707:function(e,s,a){"use strict";e.exports=a.p+"static/media/Notebook.f16dc06fc2d0d6d4a89e.svg"},33693:function(e,s,a){"use strict";e.exports=a.p+"static/media/crane_icon.07d3e339b9b9e33154d8.svg"},53454:function(e,s,a){"use strict";e.exports=a.p+"static/media/curvy-banner-blue.ed50945add75843e1495.svg"},93164:function(e,s,a){"use strict";e.exports=a.p+"static/media/curvy-banner-orange.2035aa718ac38e282a28.svg"},91928:function(e,s,a){"use strict";e.exports=a.p+"static/media/curvy-banner-purple.cf2c06c68dc1cf5c2593.svg"},85244:function(e,s,a){"use strict";e.exports=a.p+"static/media/curvy-banner-turq.03020f9b7b614f3b2a4c.svg"},16287:function(e,s,a){"use strict";e.exports=a.p+"static/media/podcast.0be7bdc1c83ba763716d.svg"},30518:function(e,s,a){"use strict";e.exports=a.p+"static/media/podcast_white.5f362f00bfc4eb286441.svg"},90280:function(e,s,a){"use strict";e.exports=a.p+"static/media/file.6662b0aba8cfa6eed9f9.svg"},50386:function(e,s,a){"use strict";e.exports=a.p+"static/media/file_white.8fa83f8e7ad11453a1b6.svg"},35121:function(e,s,a){"use strict";e.exports=a.p+"static/media/slider.e1444a003a5e43c1e288.svg"},68075:function(e,s,a){"use strict";e.exports=a.p+"static/media/slider_white.c92a537eabeb0a679376.svg"},7986:function(e,s,a){"use strict";e.exports=a.p+"static/media/video.b16541fa7302d38f45f6.svg"},96420:function(e,s,a){"use strict";e.exports=a.p+"static/media/video_white.7ebe513c5f8f4f5eb0fa.svg"},80580:function(e,s,a){"use strict";e.exports=a.p+"static/media/visual.66e8c56ba7a16c790228.svg"},90462:function(e,s,a){"use strict";e.exports=a.p+"static/media/visual_white.001f675b22ff3b3187fb.svg"},84145:function(e,s,a){"use strict";
2e.exports=a.p+"static/media/diploma.2402679741d9b7204d86.svg"},1213:function(e,s,a){"use strict";e.exports=a.p+"static/media/document_icon.a2c352cf3820dd17e61c.svg"},6159:function(e,s,a){"use strict";e.exports=a.p+"static/media/drag_drop_image_placeholder_icon.843aaaf925ba7c33e9eb.svg"},23901:function(e,s,a){"use strict";e.exports=a.p+"static/media/drag_drop_square.d3324fafc3c370c4f4ba.svg"},65150:function(e,s,a){"use strict";e.exports=a.p+"static/media/upload_cloud.35a21819cbc0363338d6.svg"},70012:function(e,s,a){"use strict";e.exports=a.p+"static/media/bandcamp-button-square-black.c6bc3f762b95f4267c7f.eps"},57130:function(e,s,a){"use strict";e.exports=a.p+"static/media/office_online_icon.a01b7df1e8e661ab0c79.svg"},9035:function(e,s,a){"use strict";e.exports=a.p+"static/media/fav-list.78d832b4b23b2d544e54.svg"},3909:function(e,s,a){"use strict";e.exports=a.p+"static/media/folder_open_icon.b9be6a3fa0f5bd1a074c.svg"},39056:function(e,s,a){"use strict";e.exports=a.p+"static/media/framework_icon_mu_green.8d67dcb1cdee82fba0a0.svg"},79606:function(e,s,a){"use strict";e.exports=a.p+"static/media/grade_icon.d5b02dfca8a887fb6597.svg"},41450:function(e,s,a){"use strict";e.exports=a.p+"static/media/hourglass_purple.af6dd63dfac1689bc652.svg"},67813:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-challenge-hub.253ea7f434640bcd13a2.svg"},64336:function(e,s,a){"use strict";e.exports=a.p+"static/media/certified.27523a141f2b6386a6cf.svg"},24328:function(e,s,a){"use strict";e.exports=a.p+"static/media/lightbulb-on.a92a4c3cf852e2663f65.svg"},10827:function(e,s,a){"use strict";e.exports=a.p+"static/media/uncertified.a0254b793079bae705ac.svg"},71829:function(e,s,a){"use strict";e.exports=a.p+"static/media/img_icon.3a739d728a470a9d737b.svg"},39424:function(e,s,a){"use strict";e.exports=a.p+"static/media/img_icon.6342b9ac4878d14d27d0.svg"},63891:function(e,s,a){"use strict";e.exports=a.p+"static/media/img_icon.3a739d728a470a9d737b.svg"},21325:function(e,s,a){"use strict";e.exports=a.p+"static/media/info_icon.9a40804f896533d10d9f.svg"},23388:function(e,s,a){"use strict";e.exports=a.p+"static/media/info_icon_blue.4828761473c8720d0177.svg"},73402:function(e,s,a){"use strict";e.exports=a.p+"static/media/adaptibility-icon.814012a0e2edcfb373cf.svg"},54459:function(e,s,a){"use strict";e.exports=a.p+"static/media/agility-icon.7bc641b9704b6f394401.svg"},38100:function(e,s,a){"use strict";e.exports=a.p+"static/media/journey-icon.da1d8f087db5aaaa655e.svg"},78925:function(e,s,a){"use strict";e.exports=a.p+"static/media/resilience-icon.61f3d6ec4082b94b26e7.svg"},80187:function(e,s,a){"use strict";e.exports=a.p+"static/media/language.dc1d1c2dff0d33219f61.svg"},15024:function(e,s,a){"use strict";e.exports=a.p+"static/media/logo_solvably.d45036cd1e0c1ebeb5eb.svg"},17487:function(e,s,a){"use strict";e.exports=a.p+"static/media/credably-logo-bg.de0b52cc6ea85987dfa5.svg"},56318:function(e,s,a){"use strict";e.exports=a.p+"static/media/credably-logo-initial-bg.a4eb9e0b69aea8b13247.svg"},71706:function(e,s,a){"use strict";e.exports=a.p+"static/media/credably-logo-initial.de452cff7d8139ebe2b9.svg"},78185:function(e,s,a){"use strict";e.exports=a.p+"static/media/credably-logo.f15a9be3e526369f1d2d.svg"},26983:function(e,s,a){"use strict";e.exports=a.p+"static/media/marketplace-flipcard-bg.c70f2746f739da676f7c.svg"},34266:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-download-green.bf22d7ea12d13522fce8.svg"},8862:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-play.952e7b94262bc7522536.svg"},8342:function(e,s,a){"use strict";e.exports=a.p+"static/media/play-button-hover.60c8d5ad7fd4ca4d2ea0.svg"},44026:function(e,s,a){"use strict";e.exports=a.p+"static/media/play-button-pressed.fd82cab8ef9ce72ef668.svg"},28735:function(e,s,a){"use strict";
2e.exports=a.p+"static/media/play-button.044dfd7892b8d727d963.svg"},57037:function(e,s,a){"use strict";e.exports=a.p+"static/media/message.30375a3a7d74cbc0e111.svg"},45349:function(e,s,a){"use strict";e.exports=a.p+"static/media/migration.81fdd7886842c7cb7904.svg"},67269:function(e,s,a){"use strict";e.exports=a.p+"static/media/notepad.7c29d9cef6cc7a4641d0.svg"},68807:function(e,s,a){"use strict";e.exports=a.p+"static/media/notification-icon.091eaa120383c7e1ffa1.svg"},35815:function(e,s,a){"use strict";e.exports=a.p+"static/media/achievement.b69a724fcb525dae4f5c.svg"},42083:function(e,s,a){"use strict";e.exports=a.p+"static/media/assigned.dd98f4823b7bc9588a7d.svg"},95549:function(e,s,a){"use strict";e.exports=a.p+"static/media/chat.1336bbd1424881470667.svg"},29341:function(e,s,a){"use strict";e.exports=a.p+"static/media/generic.a405a2b838ab5ce57b8b.svg"},57484:function(e,s,a){"use strict";e.exports=a.p+"static/media/graded.37411c02824dfda5d236.svg"},63357:function(e,s,a){"use strict";e.exports=a.p+"static/media/paper-diploma.149477b0eb9550153028.svg"},76745:function(e,s,a){"use strict";e.exports=a.p+"static/media/paperclip.328e0bc9f1ac7f5aa098.svg"},65667:function(e,s,a){"use strict";e.exports=a.p+"static/media/card-header-bg-shapes.99c89b13fd29287ccac8.svg"},97548:function(e,s,a){"use strict";e.exports=a.p+"static/media/phase-icon-pattern.23bde51bb8c176be346f.svg"},88047:function(e,s,a){"use strict";e.exports=a.p+"static/media/pen-2.de18d8cf39c287d0d1ea.svg"},70487:function(e,s,a){"use strict";e.exports=a.p+"static/media/pen-3-white.dc9d0473ae41613c3b63.svg"},26800:function(e,s,a){"use strict";e.exports=a.p+"static/media/pencil-edit-2.848727d2f2b336cb6e9d.svg"},1977:function(e,s,a){"use strict";e.exports=a.p+"static/media/pencil-edit.f641110395bb064fc710.svg"},99749:function(e,s,a){"use strict";e.exports=a.p+"static/media/pencil_wide.0a16a97f9749c5ddc3bb.svg"},65902:function(e,s,a){"use strict";e.exports=a.p+"static/media/pencil.70a7c6448a771c8f65ad.svg"},38384:function(e,s,a){"use strict";e.exports=a.p+"static/media/pencil_white.6fd6cca6dca24e4dc3e8.svg"},26931:function(e,s,a){"use strict";e.exports=a.p+"static/media/binocular.64b7d6f214e04b1944c5.svg"},29197:function(e,s,a){"use strict";e.exports=a.p+"static/media/binocular_white.865c750c5c264b641651.svg"},67536:function(e,s,a){"use strict";e.exports=a.p+"static/media/compass.8463ee9c9325f63b4c25.svg"},86698:function(e,s,a){"use strict";e.exports=a.p+"static/media/compass_white.61834670d37d7f808243.svg"},5012:function(e,s,a){"use strict";e.exports=a.p+"static/media/bulb.427db69728e3da39c717.svg"},68046:function(e,s,a){"use strict";e.exports=a.p+"static/media/bulb_white.bd467b0add702ec0cab6.svg"},46506:function(e,s,a){"use strict";e.exports=a.p+"static/media/checklist.f4820b4262360512b248.svg"},66444:function(e,s,a){"use strict";e.exports=a.p+"static/media/checklist_white.1f44d9ea227921bfb393.svg"},31869:function(e,s,a){"use strict";e.exports=a.p+"static/media/picture.8ca0f9c1a599c0456122.svg"},79540:function(e,s,a){"use strict";e.exports=a.p+"static/media/pills-sideways-various.4c42710fb1ed54a4c7e3.svg"},3775:function(e,s,a){"use strict";e.exports=a.p+"static/media/preview_icon.bae65d95bea118cb244e.svg"},94059:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-fire-inactive.c8fdad5a09237077d17d.svg"},42647:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-fire-white.73ef67a0a1b8dddef763.svg"},78071:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-fire.a80adfbfa6a5d872c373.svg"},44985:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-heart-inactive.62e3473ed64a2e13ecb7.svg"},73841:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-heart-white.19ae5357b0bcb571ffc4.svg"},52237:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-heart.f4f84a065c071203a8c7.svg"},32161:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-thumb-inactive.6370c33012222d813ce8.svg"},57145:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-thumb-white.1ffe953e0e23f88fcdaa.svg"},50277:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-thumb.0f68ea4f9326a6de9bd6.svg"},41675:function(e,s,a){"use strict";e.exports=a.p+"static/media/schoolhouse_icon.5b0f9a8d63639cd27d05.svg"},66633:function(e,s,a){"use strict";e.exports=a.p+"static/media/img-stack.192429ba59c7eec42d62.svg"},97963:function(e,s,a){"use strict";e.exports=a.p+"static/media/facebook.bc5d9e800c3692db13bf.svg"},18716:function(e,s,a){"use strict";e.exports=a.p+"static/media/linked-in.f1517a6b65fcaaebe227.svg"},92068:function(e,s,a){"use strict";e.exports=a.p+"static/media/twitter.edf576c9996b3b55ab96.svg"},78293:function(e,s,a){"use strict";e.exports=a.p+"static/media/x.5ad7666d04b3c92604fa.svg"},92968:function(e,s,a){"use strict";e.exports=a.p+"static/media/assessment.2925168f612d59ee9c75.svg"},8884:function(e,s,a){"use strict";e.exports=a.p+"static/media/assignments.81868864488c2e7c0a79.svg"},63998:function(e,s,a){"use strict";e.exports=a.p+"static/media/blog.78422d6da1694a7d8280.svg"},70184:function(e,s,a){"use strict";e.exports=a.p+"static/media/candidate_journey.676834c90617757d6f01.svg"},32665:function(e,s,a){"use strict";e.exports=a.p+"static/media/cartridge.804b114459d2dc338801.svg"},24689:function(e,s,a){"use strict";e.exports=a.p+"static/media/challenge.d5fb4c9b9a5a5ea07da2.svg"},8252:function(e,s,a){"use strict";
2e.exports=a.p+"static/media/clock.efb5d60301cb8e046b68.svg"},39633:function(e,s,a){"use strict";e.exports=a.p+"static/media/collaborators.2084360080feb217e5c9.svg"},11160:function(e,s,a){"use strict";e.exports=a.p+"static/media/completed-assignments.672d99540424a43cd856.svg"},24781:function(e,s,a){"use strict";e.exports=a.p+"static/media/course.46b913493b17b3c4f196.svg"},53711:function(e,s,a){"use strict";e.exports=a.p+"static/media/engagement.7898e4dd77b0168755cc.svg"},98236:function(e,s,a){"use strict";e.exports=a.p+"static/media/ClosedLock.01d50f5e504b07de8f3a.svg"},26653:function(e,s,a){"use strict";e.exports=a.p+"static/media/Select.e84a8a8e66913336043f.svg"},51820:function(e,s,a){"use strict";e.exports=a.p+"static/media/individual.521ca83efe91e1eb9045.svg"},45604:function(e,s,a){"use strict";e.exports=a.p+"static/media/ingenuity.bdfd9f0475efe8392ba3.svg"},26822:function(e,s,a){"use strict";e.exports=a.p+"static/media/journey.132a14d77cd2f7bdd378.svg"},21547:function(e,s,a){"use strict";e.exports=a.p+"static/media/lightbulb-on.bfe6d982ddfdfc57432a.svg"},86719:function(e,s,a){"use strict";e.exports=a.p+"static/media/papers.db046222e4f81d23f4e2.svg"},48709:function(e,s,a){"use strict";e.exports=a.p+"static/media/pencil.4fec6d8fe020d37f9055.svg"},53160:function(e,s,a){"use strict";e.exports=a.p+"static/media/recruiting.5a1ee09a0725e525290b.svg"},11590:function(e,s,a){"use strict";e.exports=a.p+"static/media/speech_bubble_sqr_icon.5dc90b7888bb73cd2ae3.svg"},43939:function(e,s,a){"use strict";e.exports=a.p+"static/media/star.41600be1b491042a7590.svg"},48937:function(e,s,a){"use strict";e.exports=a.p+"static/media/cte_icon.34f02e36a10f0959f0f2.svg"},64535:function(e,s,a){"use strict";e.exports=a.p+"static/media/ela-icon.53f0c37b61b9eef42041.svg"},29139:function(e,s,a){"use strict";e.exports=a.p+"static/media/math_icon.94328b45b56728c8234b.svg"},72611:function(e,s,a){"use strict";e.exports=a.p+"static/media/pd_icon.fb24baa9e31c55e02bee.svg"},87753:function(e,s,a){"use strict";e.exports=a.p+"static/media/science_icon.d8661113907e49a0aac2.svg"},26913:function(e,s,a){"use strict";e.exports=a.p+"static/media/social_studies_icon.b836a77a21be9c803cff.svg"},56545:function(e,s,a){"use strict";e.exports=a.p+"static/media/steam_icon.b5059a755e55ebc99c60.svg"},31117:function(e,s,a){"use strict";e.exports=a.p+"static/media/flag.691c96defe7eceef0ed6.svg"},86367:function(e,s,a){"use strict";e.exports=a.p+"static/media/user.57c4abd6a83a7c720d89.svg"},61194:function(e,s,a){"use strict";e.exports=a.p+"static/media/target.5648fe9cbda980b85cf8.svg"},9465:function(e,s,a){"use strict";e.exports=a.p+"static/media/share.5cf7c96f8b324dcc22c4.svg"},6799:function(e,s,a){"use strict";e.exports=a.p+"static/media/science-beaker.d3a09e4d965a62cdd7bd.svg"},84821:function(e,s,a){"use strict";e.exports=a.p+"static/media/flash.199ec68c853c54cc46dc.svg"},48127:function(e,s,a){"use strict";e.exports=a.p+"static/media/cursor-select.5e54ca1730caefa8dbea.svg"},37953:function(e,s,a){"use strict";e.exports=a.p+"static/media/puzzle.107105d8e9fb6fe1c299.svg"},2376:function(e,s,a){"use strict";e.exports=a.p+"static/media/science-brain.a4d79b205fdae9e9bc15.svg"},18693:function(e,s,a){"use strict";e.exports=a.p+"static/media/symbols.89404e8e48d38bea697d.svg"},75088:function(e,s,a){"use strict";e.exports=a.p+"static/media/three-users.1066e4dcf310f8cf7434.svg"},65070:function(e,s,a){"use strict";e.exports=a.p+"static/media/three-crayons.b858abb0808956fa2893.svg"},62259:function(e,s,a){"use strict";e.exports=a.p+"static/media/challenge_flag.b76691411846271e1402.svg"},88662:function(e,s,a){"use strict";e.exports=a.p+"static/media/double_comment.e4e296706e2ff5fa5b61.svg"},44321:function(e,s,a){"use strict";e.exports=a.p+"static/media/grid_icon.9a8df1ecd0564f4fae88.svg"},66201:function(e,s,a){"use strict";e.exports=a.p+"static/media/binary-pattern-primary.6ce8db2a5da97621f5b4.svg"},32030:function(e,s,a){"use strict";e.exports=a.p+"static/media/teams_black.d49a6e95b55e476096b8.svg"},89846:function(e,s,a){"use strict";e.exports=a.p+"static/media/teams_mu_green.c89059a31e3a8bc09e73.svg"},5142:function(e,s,a){"use strict";e.exports=a.p+"static/media/three_bars_w_growth_arrow_orange.2b40a1d7adbf5126a193.svg"},80951:function(e,s,a){"use strict";e.exports=a.p+"static/media/three_bars_w_growth_arrow_white.4083eaf302e9a378a8ee.svg"},69859:function(e,s,a){"use strict";
2e.exports=a.p+"static/media/three_co_circles.1e2600d902dff0dbd5de.svg"},44834:function(e,s,a){"use strict";e.exports=a.p+"static/media/topic_bookmark.2ef68d799c490abd7adb.svg"},97950:function(e,s,a){"use strict";e.exports=a.p+"static/media/tri_textures.169d21ffbdf4a7a38e19.svg"},23301:function(e,s,a){"use strict";e.exports=a.p+"static/media/trophy_icon.dde8e6967946484877b9.svg"},85529:function(e,s,a){"use strict";e.exports=a.p+"static/media/trophy_icon.7c22582c1a66c15f82a9.svg"},66052:function(e,s,a){"use strict";e.exports=a.p+"static/media/trophy_icon.7c22582c1a66c15f82a9.svg"},1724:function(e,s,a){"use strict";e.exports=a.p+"static/media/trophy_icon.7c22582c1a66c15f82a9.svg"},61687:function(e,s,a){"use strict";e.exports=a.p+"static/media/trophy_icon.c9223cfbc12334987597.svg"},35928:function(e,s,a){"use strict";e.exports=a.p+"static/media/link.65c676d9c740240003c4.svg"},34722:function(e,s,a){"use strict";e.exports=a.p+"static/media/link_white.3ca3a1a0ff8a4cdce3f2.svg"},21978:function(e,s,a){"use strict";e.exports=a.p+"static/media/text_icon_white.a8119af91b39fd15581c.svg"},73762:function(e,s,a){"use strict";e.exports=a.p+"static/media/users-mm-green.8a04fa7b4c29845c3ad1.svg"},24472:function(e,s,a){"use strict";e.exports=a.p+"static/media/users-mm.2facbf1c74de9ff789d7.svg"},22251:function(e,s,a){"use strict";e.exports=a.p+"static/media/users.07a02da2c70ab7f2b527.csv"},38596:function(e,s,a){"use strict";e.exports=a.p+"static/media/challenge-hub-tab-white-selected.bcaf503df0a3f589a5dd.svg"},14690:function(e,s,a){"use strict";e.exports=a.p+"static/media/banner.8a018bc9ac9b83b21c00.jpg"},47831:function(e,s,a){"use strict";e.exports=a.p+"static/media/banner_dark.3b2ea206011ee8e31c7c.jpg"},32210:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAk0AAAEkCAIAAAC9i5IAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGl2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1w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ZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZToHQJnOAVCmcwCU6RwAZS/wrwQ/ypMdogAAAABJRU5ErkJggg=="},67232:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABCmSURBVHgB1VsLeBXVtV57z3mfhJy8Ca9AIBoQoVVURCICgp8aELVJoYhysT6uypUrn/a71vZa8bZXabX2o1bw0c9WsBpAqvKp+CkJJWgpSIkWIpCEd0JOkpPHeZ+Zvbv3zJk5c/LOyRyQP2zmtWdm73/WWnuttfdBcB5xdOXSYbaIrQjEwO
2VSMDSJkMg1iNA8IDSNUpIClFoAKADCEUDIz0oTEkwNgKAanM79GJuOuUnLgWkbPvTDeQKCJOPUA8sLJSouIp7W64BIJSQcEmggAIMGQoCtVkBWewibzTvBkfIpstq25f/hj3WQRCSFoMZly5whq7SU+Lw/Ir7OYhoMYkoIGArMCLM7ePkChqWt93nCb08uLw+DwTCUoPpVy1243fufUqfv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uZ5sEfaalBAUuznD/zc6iI783kMSZ1rYORAW4e4ZOTNVX3+jrXfyXP3qi1bTF7xfiQlkSNVeqLqRUXF9vBz49nU3f0FQ56ZigMTTtHTEVmZPW93RX91BRgA/J8c/so5t6iFmvF8ZSGg0YhKj1r4VC1XL0bUhissMN5unPRITHJa26VHc+btXjeQ+gMiiCPw8eG9zrmFHub+3kKNnDaloI1U8tK1KEFceu7ItsHqQm90EdLQEREp7eik92XP+9v6gd4zKGloWbVtneAjs3GYNIJRUJ1Cog7ryhaHWXKMr1wixgzroSBta2oiZZk37np9MPcNWl2a/3tzhcMfnmUKRGqHHApphBDF9hDFQPPjVRPsMMZqjFPY6SOHTnsixaMW/G3zYO9NyJ6cWb3tiGmYY6rZG/4tlhIXf71hVkYwZXjPZMP6feP472SHtjxEIpS2eMT1Z1ul6RNK9iQUPg3ZmGT/+vaZok34E7EK4wa1pINLjxT1ediWRiN1FCbw8mVOWDrCDYlG65xnb0D6l6cDPZlfsut9GAIMsbajXii1h5G0MmwTVlOzkNP/Uzk5VAmCJBpH0AR2df+NrGFSAnlmyj1j0uYP0hdz5u1agxAasm9i6CqerOcWjmD50qVMmp6QTCirV4kiqvQoBGn7IQofXWOH69KaYTDgEuMLkDaWKl3r8wkvj7u9wjDvPynLnCY9PcnSnFq4WLSYH2S+07XEpFs4qQagUlR6eEjB9rlE3Zxqhnev8vGfJPX7Dk5KKExIMER3M2I24uaOjcPvrjY8D5L0dWBpa0vHmZG4CCzCfEmA2cyHshIUzfXIkiTJ+2YWvR+YZYMxltZenxVmQ384wqik9MNOL6kiRNg2esGuo5BEnNeFcqNeuNbuC2ZfYcZkfASjaYygy5kE5TGScpfkWB3PT/KZKZceikJM0HyMiDbGYSMbjb6UIvRwgKBvUtLooeyZVUlcfR2PfwNqCNFdZJ8tiwAAAABJRU5ErkJggg=="},43483:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAYAAABV7bNHAAAACXBIWXMAAA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jnqU1/LqE+6qHdiAaZuL+1c9L3mnZ0+NK914bR7UKAvFnnKoYJU3usA4H5Gf8GqQLIfbX5SRWoJ8SYV5nUsuu62oVwydLf+J4fcgVr4cpH9joxNOkiy2/cxg3yEnJD6UFy9AlaAfRL6SDAnFO8aLupeNH9I4IhSXdyzcNr/4V2Ow9amGEgJq2y6WcMeUJ50iANMGAH2cTJJPbVOEpKvdj5x9W+rubT6wHDhtGXgl4/H1lqeMGlpIIVj94FgwhQNjP6WR24/JiYph7WFBuTYzkVXPgJVluFFzj+esRZyxcPxzj+ryCTH9wv22h+CiVMjJlmQDFCwG4oEBtUBu933gmPyi64Y1r8GM3Lv7Xurj4YwvBezkfvaISt43V5XG/itbwENyvqFogeEOH/W4Hqiw/a4dR9nb6ADeU3H4999EkZQdo17u6A5B/3j/hMHm497ew0GEsEXi5nWN8ErdEDy/Zn8Rwmom+ivAiCTXmEsjyD9vPPxeTfCMN7gJssu9f/h2vfGA9txPgKBQJHxqSDpHw/jtUzbOqD9xegvhkxQS6J/l8NcRWI5X73lTgXWyTi5ySvwX3cumVf1R6KVyq4FyJSzuQf7rf4arupiFL25lUASxevYBP72VmSU+IycJl4XOUx0sgnqjyxkDZAjyxjj94zqgPs/XHFFH+zisnsAcst3X9sHarJfxhudjOsWb01y9sYOUrTUC7R7O9DePNC+HqDFArjTNBNlNTUBplMeR2yWeZT8sfPP8zbAbiy7HyC3zHuhFuoaZ6AynoJCNItQPh21y0Scxjh8n9VA5Pd6suD74rCXloudEAZtpFR8kQR9byEbW3IN/uqOhSd2wcdU/gEPPfMc+z1mDgAAAABJRU5ErkJggg=="},24009:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABLCAYAAADTecHpAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABnvSURBVHgB1VwLkB1Vmf7P6b6vuXdemZkkQzLJTF68E0lgQcCAD6I8FlOKtWqJK+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bVSnzOxsHPxJFeB6VP95HRmWR/cR+OxrDrLOs+CS4wY8FhmrVsrrzOzLvzwrB7++q3rAejmA74gBl2yaKo/KeN5+803z68hNo3SdSTjmFktxWOiY/J18GViWuMZreEAG1nuQFQmxr5LEXoTV6o2vbTQf39/iH0P4fL5QljYlWqO0AAAAASUVORK5CYII="},1811:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAYAAAAMJL+VAAAAAXNSR0IArs4c6QAAA09JREFUOBG1VDtsVEcUPfPZv+2w688aGzvxs4QTkAkmECQaBBICjEAiTRqQTIKgoY1EkQJqJCQ+BSlTheCCLogiRZQ0QXwkBEJCBuPFfEyAXYG9u2/37ZucmdUuD0ORJqOnN3fm3nvOvWfmPeB/HuI/4NsYY+O8S7fHpQyOC2MmAZHiXA6BW3Ser6TM1ad7N5aX432c4MQJOTA2OZiUYlxCqrqpzQipilroCwJmN0FiTHS5BLfPkwbE8YevzSUc3ViPkujowtnGCG/6xhYF8aMR+JIoMmZijwXEHIF2cR2P5nAtDMSANPjey+LPh0Ah6v+AYPDytZyE/oH17ZAEt8FCiD5OX0UTo7YtQgh8HhoMc/89AgcQDVZV0U8Zxm1Sa9/qsX5FEvsGu7Aq1azJ7mWUbOrEQOqk2eV73dn8NogDozxSo4cltwPjjNiW78Cx1T3o1BKVBqE4JrIpfOflMJSOuTX5AoRhglQ03w3VNs/+lvAelQ5qqU6ygxEK48g35VKY8rrxa6FE8BAB8fMJ7U55gr7AGNx/WyOMSbGwDblvnvqvv91xF9PTDYvd7IDgo335KSXlGdKvI7jTIaN4EP1duFOq4Pfni/iiK4k9Kzuxc2WX68QKX1hqXRqhuV4rlDw3KkYO4afrrjVH8OlA7xqlxGFW0NHuiMZENg2vI46//llCmvIU6w1szXciR932D63A3VKV1fvRFEKA34c8MvqJGbMOR6BD+RntUVbf1o/FY3N3GnVejZe1BgLOPiXKkOjr7gxeVOu48uwNfO4vHyTxQgnP7jspJPVjWKqN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hvTBDEnJ9AdYojUap3+DW/9xrgnrtTXLaL6rJbp7zZoZtjtoLWk7A3SrpaZx2Edmqm0o1Z3bpf7Bc48A1O6V/q4+RJdkeychGoHqHZ0PUM1zveSArdre87nvVv4d2D1ua5HMdPXeiZuTMimFI3INkFmBPfvEk5fVJ8/6kCzz7fw81vbeHWn0/xU1ekvHA1sBNZd4m9oVnPBJPH6NWEwFUBjr9W4BD5Hng4w+HneHPNHE+JUUu/7tbqOoKkj8ax2TnOmrt4OfKp5+ivMA6GqCCxU2iEC+trxwTcGiDvC98DfGYDNMtL820c+HaGR75dcuU94Iq4i7fdyv/cciU/HabkZHVzktvDCmRFKA3WKrvPQ8hjr1Z4+skK33y0jxdeamGZZ/0JN+wS7nknFRs6OMfrZtp6PUYsWffVVtRpH5deyaXEVx/uf/RP7+eCg8L1H0m4+lAURyl4zoNYXSctVOq0Gi9AaqwhvoLyo5J3FmdmeNdwLsM2XoaY5BGRFuJSRSpxJwVLK1xAnung1Kk+lhaAlSUj9Q8i1QKCxFopt5iKXi+kqP9jok2Be3+1g/8BmEo3cciTz9oAAAAASUVORK5CYII="},17518:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAABKCAMAAABKOtJEAAAAV1BMVEWAgICAgICBgYGAgICBgYEAAACAgICAgICAgICAgICBgYGAgICAgICCgoKAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDhg0kSAAAAHXRSTlP//n/uXwDdIK4Qb76eP96PQN/Pv6+fkIBgMO9QziY6AGEAAAE+SURBVHgB7M+BAAAAAAKg95ce5DIov+ru7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7uvnLpM7FhEAbDcBWiilUsvMCx73/OinTvPfX+TTyeD/+fYKeWbvaolX5KqNQO1qFSu/GIOu0QCI/pPHSddogOddohnOFNauWSXrkaO1zK9dnB7Bw+TAM8tiPXZwcT9g5RnR0gddzgyuzijp5Qepc9534Yp2kupUrMvNBFV1PSZdySv/hSyjRNwzDkfPhJtgldvXS/2n7Igi2+rnwDfH9EC/Nxkcs94LovQkspFmG/sgaeZvEuhF+ea3OstZbSxRhCSCnBrd4rltIWu7q+kXCCPx4R8eUkbRMro2yyioHnMiltwcau+Mrv/UjF/ptzdBm36DL8nM4ByA8fbuvjQSgAAAAASUVORK5CYII="},18e3:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAABKCAMAAABKOtJEAAAAV1BMVEWAgICAgICBgYGAgICBgYEAAACAgICAgICAgICAgICBgYGAgICAgICCgoKAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDhg0kSAAAAHXRSTlP//n/uXwDdIK4Qb76eP96PQN/Pv6+fkIBgMO9QziY6AGEAAAE+SURBVHgB7M+BAAAAAAKg95ce5DIov+ru7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7uvnLpM7FhEAbDcBWiilUsvMCx73/OinTvPfX+TTyeD/+fYKeWbvaolX5KqNQO1qFSu/GIOu0QCI/pPHSddogOddohnOFNauWSXrkaO1zK9dnB7Bw+TAM8tiPXZwcT9g5RnR0gddzgyuzijp5Qepc9534Yp2kupUrMvNBFV1PSZdySv/hSyjRNwzDkfPhJtgldvXS/2n7Igi2+rnwDfH9EC/Nxkcs94LovQkspFmG/sgaeZvEuhF+ea3OstZbSxRhCSCnBrd4rltIWu7q+kXCCPx4R8eUkbRMro2yyioHnMiltwcau+Mrv/UjF/ptzdBm36DL8nM4ByA8fbuvjQSgAAAAASUVORK5CYII="},32928:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAABKCAMAAABKOtJEAAAAV1BMVEWAgICAgICBgYGAgICBgYEAAACAgICAgICAgICAgICBgYGAgICAgICCgoKAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDhg0kSAAAAHXRSTlP//n/uXwDdIK4Qb76eP96PQN/Pv6+fkIBgMO9QziY6AGEAAAE+SUR
2BVHgB7M+BAAAAAAKg95ce5DIov+ru7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7uvnLpM7FhEAbDcBWiilUsvMCx73/OinTvPfX+TTyeD/+fYKeWbvaolX5KqNQO1qFSu/GIOu0QCI/pPHSddogOddohnOFNauWSXrkaO1zK9dnB7Bw+TAM8tiPXZwcT9g5RnR0gddzgyuzijp5Qepc9534Yp2kupUrMvNBFV1PSZdySv/hSyjRNwzDkfPhJtgldvXS/2n7Igi2+rnwDfH9EC/Nxkcs94LovQkspFmG/sgaeZvEuhF+ea3OstZbSxRhCSCnBrd4rltIWu7q+kXCCPx4R8eUkbRMro2yyioHnMiltwcau+Mrv/UjF/ptzdBm36DL8nM4ByA8fbuvjQSgAAAAASUVORK5CYII="},86556:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPsAAABKCAMAAABKOtJEAAAAV1BMVEWAgICAgICBgYGAgICBgYEAAACAgICAgICAgICAgICBgYGAgICAgICCgoKAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDhg0kSAAAAHXRSTlP//n/uXwDdIK4Qb76eP96PQN/Pv6+fkIBgMO9QziY6AGEAAAE+SURBVHgB7M+BAAAAAAKg95ce5DIov+ru7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7uvnLpM7FhEAbDcBWiilUsvMCx73/OinTvPfX+TTyeD/+fYKeWbvaolX5KqNQO1qFSu/GIOu0QCI/pPHSddogOddohnOFNauWSXrkaO1zK9dnB7Bw+TAM8tiPXZwcT9g5RnR0gddzgyuzijp5Qepc9534Yp2kupUrMvNBFV1PSZdySv/hSyjRNwzDkfPhJtgldvXS/2n7Igi2+rnwDfH9EC/Nxkcs94LovQkspFmG/sgaeZvEuhF+ea3OstZbSxRhCSCnBrd4rltIWu7q+kXCCPx4R8eUkbRMro2yyioHnMiltwcau+Mrv/UjF/ptzdBm36DL8nM4ByA8fbuvjQSgAAAAASUVORK5CYII="},29455:function(e,s,a){"use strict";e.exports=a.p+"static/media/default-cover-image.feb3c9b48bd683a3d3e5.jpeg"},59013:function(e,s,a){"use strict";e.exports=a.p+"static/media/default-icon-image.a7d035cde45c181111d4.jpeg"},56938:function(e,s,a){"use strict";e.exports=a.p+"static/media/upload_placeholder.0470d8948448e4df055c.png"},36177:function(e,s,a){"use strict";e.exports=a.p+"static/media/design-lab-hero2.53b2138f7bf520954eeb.png"},35855:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAABL1JREFUeAHtWUsodV8U3x7pQ8gAeWUij1BMKAMMmCgkJBRSykSkJMVECCVDj4mpMlFISSGSR3lHRkJeEUXej/WtdfrO7pzvnnMvn3P6n39377rdvc/a67fW/u211t7nXhfGGODHaZur0678z8IFASICnJwBkQJOHgBMRICIACdnQKSAkweAKIIiBUQKODkDIgWcPADEKSBSQKSAkzPg9Cng/i8B0NHRwXJycv5FVVNnf3+fRUdHM1dXV7ayssKqq6s155n1kP4X+PInMjISXl9fwciWl5cH7+/vEuTMzMyXffmO33bmfn3xBDI6Omrk2mFxcVFa8P+CgOTkZEMXT2Cpqan/KQHfqgHd3d0YBMa1sbExtrS0pAsYFRXFIiIi2NXVFdvd3WUYJbpzSeDp6cni4+OZn58fOzk5YYeHhwzT1a4OCb+Uc9nZ2YbuPoV8TEwMt61Mgbi4OFheXlbZQxKgvLycz1f67e7uDrg58PDwoNK5u7sDLNiAhGjq/cFwTABWZ9je3laB/3QwNDSkckomAE8EoMVS+/z8hLe3N5Wpnp4elZ6/vz8sLCyo5jw+PqrG8/Pz4OHhodJTEOiYgMrKShXgTwe0UyEhISqHZAII++npCaqqqqSd8/b2huLiYri/v+dmU1JSuC4RIreRkREICwuTZJg6MDExIYugpaWF6ygWT8/sE/Dr1y84Pj7mQEZ02tvbbZz5+Pjg0BUVFTZyZQpOTk5K8uDgYJB3myLUzc1Npefl5QW3t7cS7urqqkqmWLd9AhobG7ljRnQovH19fW2ckSPg8vISKKcVDvL+1taW5MLz8zNQWpaUlHCXysrK+DylblpaGhQUFEB+fr6mHOfqE0D5dXNzw40Y0amrq9N0RCZgbm5OU05+Dg4OchfCw8OhtbWVj2NjY3X17K3R7rtAc3MzQxKIJEMaHUv9/f12sa6vr3XlFxcXXIY1hCEJfIwVn/e/09ElgMBra2u/g+VwLhYih+dyaGioLk5gYCCXERlnZ2d8HBAQwPvf7WiGzvDwMA8vIzrr6+vg4uKiaQsd5u8CVO21agTN2dnZkVyho5EKXmlpKXetpqZGE3tjY0M6VQ4ODjTlRJaNICEhAZRVmVv5QScrK8vGjtK2XAPIRFtbm83c3Nxcbn18fFySY7TwUwBvioA3QZUeXbPlhqmnkils2xJAx4yRbXp6Ws84f64kgGz39vZCYmIi4HUYMBWlXZR9osouL6Czs1N+DLOzs5CZmSndMQoLC+H09FSSvby8SFiyzl/fagLS09M5oBEdus0lJSVxh/8yzp/LBBD5WAh1TXd1dXEdwvLx8YGpqSnd+SSor69X6Sh9sHkZKioqYmtrazjHmIavuwzz0CHY3t4e/0GkqamJ9fX1sYyMDIZ3Akn3/PycYWqwgYEBFRbWDIaXJNbQ0MBwoQxvgpIc6wTb3NxkhIWRodJRDlxwQOxYsuE1mOFtj+HFR6r4GE12/cQiy4KCghjpHR0dOXx7JDBLE2B3tQYJde8BBuFbHkYQYPktMtlBEQEmE2x5eBEBlt8ikx0UEWAywZaHFxFg+S0y2UERASYTbHl4EQGW3yKTHRQRYDLBlocXEWD5LTLZQREBJhNsefjfhil1+9fDxdYAAAAASUVORK5CYII="},83698:function(e,s,a){"use strict";e.exports=a.p+"static/media/canva_icon.34ed32362bbcffcce8de.jpg"},70200:function(e,s,a){"use strict";e.exports=a.p+"static/media/creative_cloud_express_logo.5736768edebcdbb40799.png"},67070:function(e,s,a){"use strict";e.exports=a.p+"static/media/google_sheets_logo.37f4f982f9a315eec870.png"},44838:function(e,s,a){"use strict";e.exports=a.p+"static/media/gslides_icon.978b058632ce27bff694.png"},19608:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAWCAYAAADafVyIAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAGKADAAQAAAABAAAAFgAAAAB+zen2AAAEuklEQVRIDa2VW2xURRjHf2fO6e52d3uh3ZZeoGBUkEu1JAqxIUBBjRRiwPpiGi8vJiY++OiTr76bmPhkSDQmBGO42ERMEVpjSiA0MVIukYpUBLaF0mW3u+3unjPjN7u9YoiXONnvzDmzZ/7/b/7ff+aANGPMAW3MGYkpCfM/xBmB2WWxHQtu4Kh9kHvbSV/qcJxyj/SOvfzLJjO6HMl2QObttOA2pu4GnP2uSHLMsOFZxdPPe8RrvBK0I4zzSdgB42t0QaNCCsdTpXeWXiTPQUtQTliuuUzAkU/ynPjMo+gb4vV5OnYW2NcbZn17lIqQW5pvtKb4R5b0kZtkz6WI97RSs78FNzKLnhyWdzycxFaUG0qVU5Mhq8pMznCuX4hyPoHKM3N3llPf5BgZmWXPwQh7uhtorqrA7/+d2c9/pTCUppj1mK7QRDfcAP0F6mY/5AVvTx/UbapdILAKa22Yzs3iuwHayRHY8DOMXk+T/DTN+EmHXieg8cIUoYmAIAihG
26eJrP0eNzmIq4WkmMfomERBEO1apFnwUl3lpqgy+JJ94EzjOxkhSlGvM7yYzNI9mqXJL+IGIlXMJ9z5G9EDZwmtu4FSOclcoes2Q9t7qNqnBFWVCSxJqRmN8dIUVFoI0kQi03S0GHqiUTouaWKTeSmmrGrLGM6rP1O54yqq6oFkZQ3SjGnthZWvo2LrBTtSglyQyD6FK2Hj1oBkaoI1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cr/Md1WSaNNKkEvwibejL/WeaVAacIabRPEcsYlUipEx2QA/Rf53veFQZQhUXyRYeMZgYPQVIFMaDKhnwmwo6tw+jaLo8cYcq0GGbMrSNQCtmuSwOmeuFunei/eYp+Cv0i1ycqG0G6mUp/rXp9tEclktXNHHP14h14JCg3EZxvSvSRpIM3vk6APnvs+gjr6n7srbzdNYVBFRzJIo3GbWSS/juc1bx51P9/B+vZdlCjlfsn+EH/ucm1BOehsXKOMKh6kwXWseBCXo8rWH1+uKOAeYeC85B0PhAc6XpYfcimJSxzAZlxDo+zuU/lrm/k3skb/4EHurm/Qr1+TYb8lMA8diiF/h/Ad5fwjsVV+QAAAABJRU5ErkJggg=="},8096:function(e,s,a){"use strict";e.exports=a.p+"static/media/prezi_icon.130794776e8d67adc198.png"},43326:function(e,s,a){"use strict";e.exports=a.p+"static/media/soundcloud_icon.ac6c7fbd25b2ada01a35.png"},42976:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAYCAYAAADkgu3FAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAGqADAAQAAAABAAAAGAAAAAAVwcdQAAAC70lEQVRIDa1Vz08TQRT+Zre/lwqtQGPAgAfxorGEG170oB6NR/8EQ0y4c/LiybPh5tW7iVGiCcbYYEwkkYh6qBJMKiDQH7Sl2+7u+N62a7ewgxz6ku68ffvm++a9+WYqQHZ7cfWOkJinXxYCQxzrh0lgGRYevnwwvSxuLa7e1CWW+gGswpBCzmqaxJwqoW9xRyxo1K5rfQNUAEnhXAkpvrlhKSWEAGJhDUY4hGrTgmlR530maKUjAxFMjSRQPLSwvlUDTesxATEYSMQE89fPY/JsHEPxEBIRnch0PH6zgXf5sgsykY7i3kwGF4cNpI0wwrrAt+0aFp7nYdpHmGhGIBEjZZJRTI0aLqj3yCQjnguz5SA7dgbJWBdiIhWHEdVh1q1/eZ6jeY5/FNSvzWL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JiZrpkZQUYGADW14G7u5hTOqZTtzKwtrpMICnJZOarEpDnhLRhCUpNTwfq6tRfY2PMApfMktVVkdpakUDAdvP5R/oqLRVZXrYphCUv8vQk0t0tkpr6+RCxuKovQnV2KoNBMTE1srury/T4GAvdV50xDdbWNG+NTwXa2dHE/SqIeD8slq0t664CHRxoBcUPfO+aFcRqSoSwcvf2LEsKdHqq5ezHOCukpweoqtJK8jM3fixT5fjYuquPyD7jN39KSoD+fqClBRgfByIRx2i8v39es61cXrqAbm4A3vQj7C+hENDVBTQ3A3NzwOgosLCg/cuPLSY2GYxohLiGvPkRYZOrrAQYsdZWYGICGB52csKTSfomgxHNIXf792QhbhCjxc5LsL4+YH4e6O31nvQEek0ZBWKLSoQQLC0NKC4GamoU0qvdVwZdMpYvjf2PMAfPz4FwGBgaAlZXtSd7sUnfXHojCsSn4gvwI8Jws2SXlzWpp6f9N1m+eMlgRIG4PfALxBCzXSwuApOTwNSU0/59Pxd9c3viAGVlOSHzbOzoCBgZAcbGgKUl/23D7YhA3CsZ0Qjl5johc49795x7psFB3bi9O9DDj8yf/HxroAIVFgJcNj/C5UqU8L1YVGRZ07IvLQWysxNl3r8d9rDychcQL7jH9ZvY/l2/ncGSp282VYq1Y+SfaFSkoEB3cfG7us+8zsoSmZ11MGJAvDUzI9LQoGC5uSLZ2SKZmSLp6SJpaSIpKSLJybrvTjIfLLbawPY1j9yacizncG4wqLZok7ZDIZH6epHpaQeGJ28/g/jWZW/Z2AD29/Uz6OJCq4m/8WuEL0J2Ziobo/3qYfjdXxf2ZxB7DHOUpc1qYgJXVwNNTU6563qZFwap7AvPR06xQexF5mQC2Wp/Ank2ag08Z9lHjbb5mkenn1MAfxihH/XPBiswhDIaMXpm9DuEvtsJ8xe7hmdqKGS5kAAAAABJRU5ErkJggg=="},70969:function(e,s,a){"use strict";e.exports=a.p+"static/media/fancy_modal_header_bg.6ba17acff2833971d26d.png"},13738:function(e){"use strict";e.exports="data:image/png;
2base64,iVBORw0KGgoAA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p4gRb5soTF6xaupI3KZk/bO92zQCyRzFCCsOGevjcJwr9dVHk7p1v9SI8XHjX/OTrFBzTsXKNJ8s73ml9RjeIxPvykHBKChaBVfF5PHIsyNTkAJSJwbhmjbTupzkl5smKIGSySSnsRQjxk0hxgfmL4ZhnIvle1IA+hJUiTdji69NJQaBviez2pg0DXKqgwhK7T42Ydh0YnygebPBLG7mDMIZglXHzSSkZSydh3/c+uCE4Tgn4kZwkqhSQmao7VxRcbMEVehIYnxgvmEO7CoiSWwmHVU4kyos8GBhN52Jc1O6NNDRxLQDifK2MCwSE9d74m3j3VvGF9hr7SFxBf+j7tJEFko7zrsO3ldgebG0nTci6qGHHnrooYceeuihhx566KGHHnrooYceeuihhx566KGJ/wPKCm9cn1Q2HAAAAABJRU5ErkJggg=="},60300:function(e,s,a){"use strict";e.exports=a.p+"static/media/generic_group_pic.97a4027aa24f7a981e91.jpg"},25558:function(e){"use strict";e.exports="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAHEA8SEBASFBQVEA8QEBQTDRAPERAQFBUWGBYSFBMkHSogGholGxQUITEhJSkrNi46F
2x8zODMsNygtLi4BCgoKDQ0NDgwMDisZHxkrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrK//AABEIAK4ArgMBIgACEQEDEQH/xAAbAAEAAgMBAQAAAAAAAAAAAAAABQYBAwQCB//EADUQAQACAAMECAQDCQAAAAAAAAABAgMEEQUhMXESEyJBUWGRoTJCcoFisdEGFDNDU4LB4fD/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/APuIAAAAAAHAARWd2vGHuw98+Pyxy8UPjY1sedbWmeYLaKhS804TMcpmG2M7ix/Mt6gtQq377i/1Leroyu1sTCmOlPSjv8Y5SCwjxhYkYsRNZ1iXsAAAAAAAAAAACZ0Brx8auBWbWnSIV/P7Rtmt0bq+HjzY2nnP3q274Y+Hz83GoACAAAANmBj2wJ1raY/KecLDsvNzm6TNtNYnTd38N+itN+RxOqxKT+KInlO4FqARQAAAAAAABG7bzHVUiscba6/THFJIL9oJ7dPpn8wRYCoAAAAAAHAAW3L36ylZ8axPs2OTZVulg05THpMutFAAAAAAAAEDt/8AiV+j/Mp5BftBHbpP4Zj3BFgKgAAAAAAACxbEnXBj6rR7u9HbC/hf3WSKKAAAAAAAAIvb2DN61tHyzOvKUo83pF4mJ4TExPIFQGzMYU4FrVnunT7dzWqAAAAAAANuVw+uvSvjaInl3gsGyMPq8GmvfrPrLsYiNGUUAAAAAAAAABCbfwejat4746M844f95IlbcxgVzFejaNYVTE0iZ04azpyUeQBAAAABJbDwJvidLTdWJ392suHAr071ie+1Y91srEV3QKyAgAAAAAAAAAAK/tnK9TfpRHZt7WWBqzWHGLS0THGJ9QVMBUAAAZiOlMRHfugEnsTKdbPTnhWez9Xj9k605TBjL0rWO6N/PvbkUAAAAAAAAAAAAeMWdK2nyn8ntzbRxOrwsSfwzEc53Aq4CoAAOnZteni4f1a+m9zNuVxepvS3hMTPLvBbBitovETG+J3wyigAAAAAAAAAANGZzdMtHatyjjM/YG9B7ZzsYvYrOsROtp8Z8GnO7UvmN1ezX3nnLgAAVAAAAHfs/aU5Xszvr7xyTmXzVMxHZtE+XCY+yqMxOnAFwFawNp4uD83SjwtGvvxd2HtuPmpP2nVFS44MPa+FfjM15xu9XdW0WjWJ1gGQABi1orGszpCLzW2a03YcdLzndX/YJXg48xtLCwPm1nwrv90DmM5iZj4rTyjdHo0Akszti+Jup2Y9bI60zadZnWfNgVAAAAAAAAAAAABvy+bxMv8ADbTy4x6NACUwtt3j4qxPLWEjlNo4eZ79J8J/VWgHVns9bNzv3V7q/r4uUAAAAAAAAAAAAAAAAAAAAAf/2Q=="},15911:function(e,s,a){"use strict";e.exports=a.p+"static/media/meet_logo_lg.2940f5f3a8fbc1f6f3ea.png"},72273:function(e,s,a){"use strict";e.exports=a.p+"static/media/how-it-works-masthead.6ff72b88e0fb21b467d7.png"},81140:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE8AAABPCAYAAACqNJiGAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACLNJREFUeNrsnH1ME3cYxx9eJiIU24C8FFYRRBwqIGxOhQw0RhfiMjN18w+nJHuL7kW2RLf4h0EzzaLb1C1Zsk0Tdf6h21Qyl82ZZYIvTLeprTqUlfdJBYRRKMiLovs9P67tHb22d+1deek9yS+F9q7tffq8fZ9rL+DRo0egmGcWqCDw3ILFbJz6/RU1uVlGVj5ZmWRljAEG9WTpySolq6RyRVad0B0DhIQtgZZIbooZcBPHuEMdxGMVAtEtPAKuiAE30c+ici8BWOQRPCZE95C11o/TmgFTFIFoFgyPAVc6RnKabACdVdsDCjibIYdSxqFcw2Ny3PMKMweAxS7Dlqmqej8sDkJtAQnfUmeeV6yAc2nFvJ7HxHSdAs+tzSbepx/qecsUcIKskC9s8xUugiyfD16mwkVw5XWAp/R1Ao3UB+powaPxzS9Vh9FbU08/XOm7PxxvQT1q4GWFPAaF0+MgPVYFcaoQh8f1Jgtcu2uBnxvafApzRMPTBgXBBzPjYUlKlMvtMrUqutZkaCnIbypM8KO523/h5YWHwtacJF5Pcw8yFRYbW+GjG41gGhiQ7T0GjlRwny6YJhoc29Bbv3omhXqv38DDg0WPCw/x/qBTIifAh1m60R22mPBXJkfDrBgVPSC0O5Y+qPnvHpQ3mmGfqd22LR6sNx431HIma6CoxQJ76ltHFzxXCR8B4cKDW23RwseX6mwHK7W9nB4P395ulzz/yQZPTMLHbT5ZlApdffIkd0wBLyZoJPe+QLnC1JOEL0Wec2aLkqJGR8F4PztRVhCeFo8Rn/NQOmGv5YldJQ3uCWMz/Ts5IhSSNRMgbFwwzPbw+fjem5TNs+TwcrRqj/b74o8G2NvAykl3O+lNATng7v5oyE3UwEgzyeEl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ld/cRptKxDQtSYLXDCZqYw719wBm7ITac7acr4aqnrv0wGDJ6cBxE7AZZ/nbZo7BWINjdwpMbFDzWbiQvz7YA/YT0Bf7OmjheNrBpz1A8GFhWsTaVuOVTTBBiLbQsmHg/tgsfHV+RPZ4eGBYGjl6jSwkkgsti1UhcL4oECboMdzFsnEg1SkOmefNND72UMDvudenhYLZ5s6wEg8bh8B503Iih1biYJXbfZ8JoajKmwt2BLNTKQX26vYTbUQ1YA95M7LdRAeHOQ1OLSWrj5R24uqttiBe3NiGsdWGJLswvHa6Qra0rDtVH0bDVf0KmcqA2d+qHlTIkLpLFCKInGtxSJv2F5oaBfdKLPDbFtuMk3sVnmFAJ8ru0W9cvUs+6DgzVkJDh6JxeLEzWaqQND2PzlF0hM/+JUMMcb+HYag38vT8wweVjO25+y8WMvbkqBn5sZym9UW/PosqcoIGl+/MDGKeqWUheGQwQTbjU1CN6e/BBINDw1F9FZGj3pj1pPcRwUIcoS6Ymo05Og0kldTLBRLz9wSswuF51G1xdwXXl7rtTzC8RIubDn0dzqhut2xIOFwFHs4udoPBPf6WaNvWxWsmsZTvbDxqclefw8EwWDu8vWJa2/PZXjV5+H8v+yMPdlL+aVEOU2qL31L0iSjF+LCXDhfq3b6lf/hMixQVSQ8fydVGhtqqX5uIKnCwFxIp7GGwYmzNlTayYflwUOvznaNGnmGn+4w/TrHZ6Zc0UeBp8BT4CnwFHNn5qHw6hUmwozvAg16BYsgM/CFbanCRZCV8sErUbgIshIHeMzF9g4qbFxavbvLISnm3IqctiqM9+1VGPFaGeFT4rLPYy71aFBYcawDBi8XJahJzlcAcsAJv3Ijs6EC0A5OL0qesQD6aw4sIyvRGTg0oddJzmcqcZ4/tCNYVYcWB4/hsSDiBagKGY8cSxfuMo
2D9Ct2ClVaANxfWZ2CqRzE0s6uwlBWev9v/AgwAKUieDj0RGo8AAAAASUVORK5CYII="},49219:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-clever.396003fab338c809e61b.png"},98921:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAn9JREFUaAVj/H9Q6D/DEAZMQ9jtYKePemCgY5AF3QFKj4PRhQYV/57sWhT3jCYhlOAYAM5oDAxAoKNYORoDKMExAJzRGBiAQEexcjQGUIJjADhDPgYw2kLUCERWJmaGXC1vBj85UwZGRgaGjQ9PM0y+tpXh97+/1DAexQyaeADk+BR1F7hFMHbflU1wMWoxaJKE/OVNMdyHTQxDERkCNPEAGe4gWwvJHuBn52YwEFUEYxAbGwCleXSATQykhhjz0M1C5pPsAUU+MQY2JhYwBrGxAVCGnXNzD8PrHx/BGMQGiWEDxJiHTR9MjCaZGFTagDIsLTItzOEwmmQP3P/0igEW8iA2MgAVny7S+gwuknoMsjwiDDLcwgyswNh68vUtw1MgPvzyGsPWR2cZvvz5AdeGzzy4IjwMRvRxIXL6xCyMzAypGq4MsSr2DAJs2PMFzA0//v5iWP/wJEP/5c0oHoHJE6LR+8RExgAjAx8bJ4MIJy8DFwsHAzszRNvPv3+AldMfhmq9EAYTEWVCdoPlOZjZGCKVbBmsxTUYqs8tYwCZgWzeN2DsvPn+meHTr+9A9YTH3Ah6AJRhlfklGHiBHkAHXCxsDAFytkQ7Hlm/HLcoQ56mN8PUG9vhwiDzQFiEg4/hM9ADdz++YPgFDCB8gGAppCIoidXxMEP1BOVhTJJpPSHcekEBBrKbECDoAR5gksEH2JlZ8UnjlWNnwq+XkN0gwwl6AK8LBoEkVUohevoDvRQa8jEw6gF6Jh9sdo3GALZQoafYaAzQM7Sx2TUaA9hChZ5iQz4GCDanqR2aF3x7SDLSYHMJXvVDPgaGvAcwWqN442sQSg75GBj1wECnKgDONZSeSBM7VAAAAABJRU5ErkJggg=="},71435:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAA6CAYAAADybArcAAAACXBIWXMAAC4jAAAuIwF4pT92AAAGX2lUWHRYTUw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AGSOGCOVddy/AAAAAElFTkSuQmCC"},29912:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-slack.c959ad3c75f09b58d793.png"},31275:function(e,s,a){"use strict";e.exports=a.p+"static/media/icon-zoom.74bbc55d5611dec8cb38.png"},63308:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABBCAYAAABhNaJ7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAIQSURBVHgB7ZvPbcIwFId/BnrvCHSCcihVrwzCvwkoExA2oBMArToH7Q0VDowAG3AvxLVRQFGKgp0QAn7vuyQ4WOR9sp+tlyBgwXtVtqRAGTkgJJaNmRjhzJRsviyAobqRPBnhzBRAHPICrKZAFF+gjwwpSPSQMakENH+Ehwz5qMrMBXAOAHFYAIjDAkCcVMvgNTF8keXSFq+bX3jthVib9nNiBATBT9Rpp3SHybAi70373rwAHWwQfDloqthIcCUHRIe8sYSbF6Dnu5r3NXW6iFwykuDECEgjwZllcC9BVayWkUuxEi6yDCYupUWqT+Nn6Z3qoipW38C/39pLqEWXyIsIOFcpLWV94KgEajtBLcELNzizEzRB54dtAYNwW14C3lQ57eR2VQ35jjockpeaSqOtwMqgXxORPBAEX2tPxTLcnouATRGD6I0cQ5XEdCAHAbKIcXMqvuL6fD7Jni/Mgtc4lQOC4L1wW1zwGmcEJAle44SApMFrnBCggn8IfzYNXuOEgPpMtNRhrM9tgtc4kwN2EiT6NsFrnNoI1ef2T6q4KgzisAAQhwWAOCwAxGEBIA4LAHFYAIjDAkAcFgDi8GtySIHJ8/od+f7LJJZUAi7xPn/WcA4AcaymgJToFop4RArkFiubBxdZYyWgMRcDOAbnABCHBYA4LADE4Y0QrhkfXb+Iij4VPtaNE+8IJuEP0uXBmjG13EsAAAAASUVORK5CYII="},14235:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABBCAYAAABhNaJ7A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ClCMgDcQSkVrEs0W1i5uPxEaBQsUYeL50b9XCiBFJCpQGW7+rD6mgBZaWCY7EgJcLLIKW5vNe6E5v9LQxUQDG91yIPAmhtPQ/0+A4qAtr5+cYiAV5DSqhMoO+9IEJSbzezAC/RGKhFOHr6bXqIgFGG17v8NY4eugFSqVCY4nkWWWL1Moj+0BMcKO0Mzxhk774xkDYcQAZQEmDbsB9oMt1aYEkIJmc5RM9C/RlKAkappp6vkQqhZewJ2PYpRO+AbyjQy6pIErkTpEpMB/y+wKjX3WpwYXALsbd1iQl49vk8wbT7Li4vzYuLgQEJEEkAM4yBVBgx3yryTF/9WlF+x+k1yIt3gx0pxYnUnJMkJMSWxl6s4Ulw+aG7OlunItc8Ib23y4QHmqeW49789W4TwVc9sjSpb6yurlhR90TWBcagqm9bk6GBCLbNPIqVo5R8N0i66/g+ml4LkIiGEL45NUaaEElCKSdFo+CuNJLy/+EqtOVoyarDf1xcdjRNhAqrUZpQCQJGB6x40Gbwt1mEH2MWEkojwD0LYMMmaSzn901VHw7MSPjNeUwtKQmCy04oMj/opIQu4BPkkFaSwCI2zFY6vD/fDpoaDBMlQyXou4AY7OsjQRyt0ZAqBFZ5CsDaqlMnvL47UhyL9JmqCQmxq0CBOOf9/fapugr15u3fu1LifkY2664O9HelbAIs+ryizc3LqHNGg8Gg8d9QPkPM9mAEkelu9Wtc9i7KB4xeaElJ5e16snD2+n+7JTStAWL2+qQAyiFg2MGS8Htfr37Wue2zoOBt8EjNDd8PFOp/+cWnE21aSAKihEcpe1+tft7yti0cAbMIz1goAmYVnlHav83lASkctm3D2zZNeMZCEXBzT+/QajFJ68cJz1g4H/Ab7RvuDZ1j6ch/4oRfYokllngPuzONrtjPn1oAAAAASUVORK5CYII="},71878:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAYAAABHomvIAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAS5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QJ6kEawVFjraVUtGw7bhp/Z8ClkhVUPMorCxLOLYVln5SKQ6QTVg/BLZnl3jZ2nSgCRv8wiihuQwa4urq4udyELQUqxHquXzfDuJiY+cNzu3UoUAn6E6cseJyXA7xH0P8sd622+9INEX6fByqYQtp1VFBphguBxWSIk+0nr4BeDBjUpH0crurVoFh3HjXyTYv63ha8Ss2qrmyl9vd4gFz892Tui3Z+h6HnBZkNnlDMIV08E7sysOvFmwQmc7XCr1dd+CJLqsE9mQ+FNHfRpd1KT4ZmHpn/oXOJClBiMnAVS//B0d2aSI9NppI1LPXYySVrmdnSLQFk2J7JZiU6vSOQenQj39RxZyU1flwHqGEDbjGYIZKICOyu5XC/uIvS9jQxEldxPzbgiGVPkaH73zXomRz59zRz4tz9ouI6oYSxW88mPfkaIIk9ZSR5tsXzOlTfmng+8OpdXflW4fIFkvacxJ+fDfufzlVwr602EZY7bg8m+uZqUHc7lHOGphxIpojjjLzJcvd3hDoR3RotrtFcG48MAAAAASUVORK5CYII="},46743:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABBCAYAAABhNaJ7AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAW+SURBVHgB7ZtBbttGFIb/IWXUu/oGpdHYqesGcYEYyC7yCerum9o6Qd0TRLmBewIp9QHaniDyrqgD2EHhGHFiSL2BugmCmJzJG0ayySGlGZJvkADxt4g5zIgif73/zfBxCNxww2eNADO9tlrqDMTY1u/3TbWrBKL0JBRGPx+JPj4CbAL07qt2K8Ej2mzHIZY7f4vRnL4R9R1m9z08EsJy/KgV45jO+EQBT7gEC8DAwT3VpQt6Sptt3abtPTBDx+zSxS/p7yClegebah8MsAhADIz2Tm9DLYGXB9kGRcEJGGAR4OEzMaA/Wd8vhV9gF0zofEF/ommbcsfok7JAisJv2aaQ+AFM0Enu5NqqEHFNjs1DHMP0ZJvDBjr5qUlumXKJvNhNYBOgcy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rXEqZoS7j081YSo7L2V9k25Q/nqo4ZLRQBTjWIOngToFDWTtyTIEdZ3RUvAkxK4NnENa5S1m5aVq+CFwFKSuCVi5rmcFbn+aILXgSQYfPnegmaP190wYsAoWq+qFEUP3MXHvDzdNhc11NDgCQsPAxte1h9yi/AwT3Vzrb1qs46z/VKEiFai/w2YBdAiny1psmqTon8sjsKJbZK0BR2AUJjLYBssLBJFBdhsy2/ncIqwGRdXy5MS7zsTHJZWBQVHdzPW6wprAKEcSFEB03W9ZWtO5SSdz7AKkAgjGWtaL6s1Vx+SzllB4ywCcAd/lfHKC6/ZbUBmwDpKy15BhzLWstswDkacFrAnP2x1e5NG4DxlRwWAXy+0qKZ2MDLKzksApje53ylRaNtII2IUgqfTgTsHIk9EqEz9epliFol6nnQHeb+ZHNAim/t/CO6YEDgI6HfNRThpGyW4PlPz8S+7TOub6XecMMNzrwHC7RYLJh3TEQAAAAASUVORK5CYII="},98617:function(e,s,a){"use strict";e.exports=a.p+"static/media/talogy-patterns-rgb-left-white.fc9e932a85f148d59d3a.png"},40045:function(e,s,a){"use strict";e.exports=a.p+"static/media/logo.2001e4f0e99e74be9576.jpg"},2621:function(e,s,a){"use strict";e.exports=a.p+"static/media/logo_full.c9253cba8e70bd75d061.png"},983:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHIAAAAkCAYAAABVCm6XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGlWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNi4wLWMwMDIgNzkuMTY0MzYwLCAyMDIwLzAyLzEzLTAxOjA3OjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3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E3w9YqRR/h2u8LMg3Ce+Li4uxD1rz94l8CK5dSih0Tn6/fl1TrSFtlPAYPF9hf+7Ash5BAJ4/aFDfvNLS9gDEDZxqTpCoyTwgEXQVCBg+qJHl/D0M9OkJQQ5f+7HDNrOzs+G22wfI/uKszMvdA88GcuFMB6RSdkACS5yPVJezl22Q6iKbxQVLf4PfuQguKOf6FIDciGBFSg6/JyC7bPlfyH6rkG72mQSkrVlbNAJkJIJS1OMA1l/BGu9qYEUfZ2xrUdEgAM8NHGiPwPUqzvK+yqWyz7F34fBEKCPKvzUhGSCx/VBCy/NfZgckSnOBTS6Etu5t0zuuSqwjLfGT5qgW+6rpIT93eDcLwFCH7CsKYawDCwU+8O5Gft8S7o9YB3+XLl06cZBi3v29evW6AgEJaT62TQgRfM/TfQgDoy9//iOIJ7jQCKnvdpsq5EqI/4VUGvPC+/UlwALawH6MqPawA/JdCyAv9RGQWQlAos6RU66GNVl+YeEIDkIN2dX8xmqPOnjG3HjkANXkrG5CknuYU9ImgOQAPsKew/o6CeWst6hH7FTy/QYwlpXV9i8rK5GIOfOhRYLqpZHfa7osheZkq0USCj8QAPmeB0C2sDmcvtgLIDm73ypJvbIRbGzSKirqZEuThc+QS0gsHbAcls5mNKAUF7fF5/w7ra3l29Mih2JdfrAAaTB/IjZ5z+sDk1x28ZAhHZXSUikxlcF9QPYXBiVS9k+t+lEXgMR4Dz9V60WIHZIAcp80LpdBBhogUTc6zGq84AGQig2IiZg43eqABKQMMqQZXAIyWbwTIrqjHCoBKYMM/gPS6gX8XBcblqXHABlkCACQ27gjZzQs7yEB+eUN/w9QNReihRbQJAAAAABJRU5ErkJggg=="},64862:function(e,s,a){"use strict";e.exports=a.p+"static/media/[email protected]"},92895:function(e,s,a){"use strict";e.exports=a.p+"static/media/medal.447b96ab68ab3f7da41b.jpg"},43063:function(e,s,a){"use strict";e.exports=a.p+"static/media/pattern-phase-icons.aad313c194021b4619ca.png"},54427:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0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TK73REo7Zoy7vJ5ylvOZ9N8+ZpPxzLGDHt7fNcj8Sf/bbPc16SBd4QKlYz1s4vudvn/wfJwUnMnKwTwgAAAABJRU5ErkJggg=="},64365:function(e,s,a){"use strict";e.exports=a.p+"static/media/solvably-ai-sticky.e7bf3fd7875e181c419e.png"},70332:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAmtSURBVHgB7Vvdchu3FT7AkoqmdhvmtjclO44aZZQpObXSTm8svYF03diWnkDSE5h6AilPQNqOr+0+gdibTiunQ2YiR7aijOgnKCfOjyOSi3xnyaUBLPaHFE1HSb4ZSlpwASwOzvnOD1ZEv3CItBuOjk7K5FFZkSgOOqg29am1tLTQop8BnAJoNpuF+au/2+r7tI0FF2K6tj1B+99/+/XdSqXSoUuKiACOTk7KQnkPiVSRMkG0Vbe/flk1QuoXx6dnt0l5B9kXz1BFkZfN42foewkx0oDm8XExL+eaDpVn9W74vvqML6QUf8avNddgqutXLpsmjATw5NlXZ/bOK0Ufd79/UbVt/BjC6on8thS0ZQ3XPv/u68pl4oTABI6OTzbsxWPHd5feu7btWszi4mL7A3zH95jfqGJu/uo2XSLkgp/Sw04qvb3+weK71fCCvUJ+/sqalKrzg++3KhAAt/M9nz89Leia4HniBl0iCLb9OZk/0xul3y0tDhf5+fGXK0LKh6+4wWT95tlZYe68/39j0Pxviu//8ffP6RIg58l8WW9Qghrh4nlx8tyvkUGMAesfQCtKbB6VUqnzxclpA3yxMrrl5YsKfk5NALWyKngSxOvRDdhsGXMVwV6DZ1LUEYLa+KvlE/2r36XGZku0s46dk75fALWPGoR61Tn3slcmKYqOfgXYOguuwRd+338utDF8IQo0BdSuq5WcoDv4cyVsCwxVj14gCLTxs5TRvJHLE32yrOrdLu1mEYRM+rLnqUxsjsW/TVME7zgWUcPiEZNompURaiCIM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ckDpAh4GJETnA87uHSedK6QAx1xyKughhO8kJ2vUBmep+FB7Dcc6Hln6dALdRvRhc164PyFL35XCXR9E/LXNUJJQ2B2R1gnZ9QJ66n+aEB9/fl8f69QE56750ghB8wGI5AdypyA+lCY5OE6Fbr9NyHHYij6UMKJUweUwaAUWiJ/2BsRVxfNZbN8YBklHSn/03CMMx3gFTrQL6wQLDI4BXbA6AAmXQFb8BGr4z1Z4R/5YAAAAASUVORK5CYII="},63259:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALxSURBVHgB7ZpNbtNAFMffJFVUYOMjOBISCzZUIqjL5AScANrcgBuQ3oAbpLQcoJygWSKK1GxYICHZN6iXFdievnHr1nX88TIZ17H9fos2GT97PE9v/vPmTQAYhmEYhmEYhmGY7iFAg0vHsQb/gkv8aJeYuq9fvRwmG37/+esU3Oc+H/T3hsOhR7TPvY9KDzTYvQaL8FKQY2MX2Xu3z6baF91HQssBbaJSB+D8ctNtEqAoTD1r9/H1rGeYZAcMgXOdpCcvBv1hXriqwafn8TOc21n2g17ggAGMOYDK3QDJYpVnj+IIJmANgI6j5YBrnKtJMataqLJI9bkinlS0NAAzDs9xnHsx0+18E5LimCWeDMOQ0NoMKVKbFO3NSN39b7IM2snPupuRuvvnPAA6DjsAOg47ADqOtgNSlR3vqfcDpvrXLogkKzt1bEbq7p9hnoD5SL45GclDqBBTJ0MrJ0AmOHknz4SE9+r5+KKL/304mv4QLhjE1MmQDRUgAjiOn4+qf7gTgHM6kucmo2Kr8wA/gAWslsTHGA3z07fy6ttIztU0gQ3YagdMl8ILAb5mXhRgRVGBMxKjwlFRMd+XNqzJ1meCPQlnBDNbRYWaIlFU7MsxENl6B3z4JRZKAKn2d1pxHkdFmb2xozEsUcmM5o1/H6AIJXwXAsawHlFUoEYspxdimWdUdQTYxLb7a1mlrcCPVoO1U91Q4LJZMHhFI3aDhWKYgxr8wU8xK7MzcjSWh4nfB8QQxTCCOniFdlkcj8asskps1i6t6L6yXR0Km8o+y9Z9z+/DHjVj1HZAHWDyM8M3/kwwddEJE4oTGlUR8n34QjS11VJISYwa5QAlhlk5AerKFP8cpZpJTmhcTVCmBqoG//FCHGPCNNNxQqM0IAbF8Ar/WfHgH13L1olcTWhmVTiMQn6SHrxi3UhoZARQoEZCax2goDih1QcjedOhHz4sp60/GUo7QQpwgx58ir+3egokUdNB9uAABz8xXVhlmswNV0NRpooTrcAAAAAASUVORK5CYII="},82640:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAkVSURBVHgB7VtdchvHEe6ZBUAW47Jxg4AVmjQUJCYqUiWVFwMnEPicKCROIOoEJE9g8gSErPhZ0AkIvaRSUlJAElo0KaqInCBIRaXQAHbG3YNdcHaxg51dAbZYxldFcn9mdrd7evrnmyHAAgsssMACC/xkwZI0Pt6UeYdDjTvwOZ5WpIQCPiGvbkro4XEHH9iVAp4NXWjVO6wHHzisFICC
2F7JZeIgC74wFjgMqhDFoDgZwgIrowgeKqQqgEc/k4CEI2LUWPPot+w9esAP4AGFUgDfqTyXAJszmRR20hq0PzRoiFeAJf4LCF8L38FqPSTjCw9YwA936X0cCHVfQWt6ishjUJIP7TE72Jf+ASqjaKOFfZ68rjsPvSykq/Xdvq+VyecKftM/OCllwKqXiegNSYkIBJuFRqC4TUH/wN9YCC3x1T5K/2AsrwlNC2eQgSagcz53gG8f9pJSPSp99ehhu+83F5TGQXwLW5Rwa18P+43Kx2IUE4OELhpE/clegbCs84U8vWcPlUMUPbOrX6dkZnFrGjsvLPV149ZGc3Q83I0WNhFdPLQgh93MscwgJkdFPvr4r90RIeMHgYPsF24cU8KbH1pPfyENU9UN1ER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8zfREUnRvl+N+JwaPwJkllHZx/qS++0sjrfuNWhUEChTU3ggqn7JCDbAkp1Tonba6MYo3lQJRLpfVxbWJlATpsIsIsPL8RmAgxOen8SCGU83vbYcBUrThLDjFVYwUkdoI2EWFenr+NJa2QQaYpKWhL7enpxdgn3KpaoLy+3qFo4J32sMzeitsfpFadsC7wCyjqr0+BNBbQs2kzy/xfB6W9JDhmgOVfb6w174xIUlq0CTPOqjiiXSKKGmNulRQRTpsTO0H6v4DYiDBjz28D8vi0nuifGwqkCSR2gp5gP6hwNkCmuJPti44fHTB56sICCywQh+8By9FQViuF4oUAAAAASUVORK5CYII="},47778:function(e,s,a){"use strict";e.exports=a.p+"static/media/journey-default.6f9b5b8a85f4cdb73db9.png"},15715:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALYAAAC2CAYAAAB08HcEAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE9WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDEgNzkuMTQ2Mjg5OTc3NywgMjAyMy8wNi8yNS0yMzo1NzoxNCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wL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wxZr27gAAAABJRU5ErkJggg=="},66267:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAASESURBVHgB7ZvLbttGFIb/oaigDYxC6QO0WhRpA/SioEnQXeUnsB+gdqQXaN1FV11EeYKkqyxl1+22lTfdWtm1dgErcADnBkSrZJULkFVii5NzhDDhdUiKI3IY6ANsWJRmwO/XmeFoRAMLFiyoCv2WbGx/K1ehEQsVgeXrdezSGf+9fUlegSYEKoArL4HW24MCvbU9cRU5MT6ASHkXDSEYHYBS3iVnCMYGkEreJUcIRk6CsfICI0gs0/HnvuMSvVknRuMCUMmfnMby2v9iOIG+EIwaAkny3aF4K92/KFs2cBDqJONwMKYCssgz3X0xotd2Qx1lrAQjKiCrvJffL8oOSfSDx6WFn9f/E9eRQOkVECf/4acv8fWNcaN1405D1X59X2xGVYJwcO2PS/IyEii1AlTyZ399hNpphx6J8Svn1fL5c+fGqr7iKkEIdH7YE1tx7UqrAJJvkvxBUL625IzfyTOyeco6tXtwdNRU9RdXCVJiU1UJpQTwRp7f+abvCRrzL6V1XnwwCczi8wuh8CGgkvdOeIdH93uWJQKzuf7hUGgAaeVdDu88uG4J/OTvJV0I2xdkj/oNXQ5PaCXZpcWU+7iwIZBVnvnqi882JJzABJZuOFi8IggwXT3aGAdeN39mkXf58vOznawh/HlBXnFoRehrQfK8hO7+K8b+U5gzsfLA1tq+6KTsBrfv3tsUsAITWXg4KOVp9Rjsd64B6JJ3SQohq/y0NeaEbnmXuBAOf/xkcPzU3vAeTZKftsQcmJe8SzCEx3+doZ+Pfa9JI89oD2De8i5uCHnkGa0BFCXv8s8vLw6eDJd8S+ks8oy2AIqWn2XCi0JLAFWVZ3IHUGV5JlcAVZdnZl4KGyEvMM4jz8xUAcbIW+G1fVYyB/A+yTOZhoBC/rcqyjOZArBtXAvK0wleJfkNaKYIeSb1EOAdXLuOZ95jLH95T/SgmaLkmdQVYNfQRuCEqi7PpA5AWFjxNZQYQjNFyzOpA6Bdet/NSccSW9BIGfJMqgBoh7VNk0XDe2LendW8lCXPpAqA9tN9OzA6y79MeSbtEGh7H+gq/7LlmcTLIJc/vWrXc+g5XffPICcmyDOJFeBI/+RHiQ2QE1PkmcQAaoHLH10NbiIHJskzygD4Ppzg0ndyPHsFmCbPKAOwAuVPDLuj+K+xVJgoz9iqJykdX/lTNWSa/fs0gdoWvqeGbQfhpXTZ8kxsAPzRl2Y835bzpKa+/vMHJuqxVRdYkRIdat8If0drjjwTG0Ct7n/HwOUfccIsTRPlqqjRYklSYCQ9dY65wJokz8QGICQJeSS85d//TjZrJyQtpkOk/a4R1NAKkqqoa4o8E3nKXP702f+h9xjfe0Nzwjf052rEjlAkvGNLQY6kg63JRxio7gMoi8gKiCh/TqovkcxUmqtFYjBZwshEaS+RAQTLPxF6l+n3Dv0M1zV+SiyCkGbU1lckNJ7p3d6Z2FTaBo3prIQqgMo/8r+y3tyePsAEN00dz7MQCoDKf8Wti6qN51kIBUDX6R0K4RYqOJ4XLFiwICuvAfBeHEPHWzVqAAAAAElFTkSuQmCC"},13706:function(e){"use strict";e.exports="data:image/png;
2base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAcESURBVHgB7ZvRctNGFIbPriyTgQxjnqD2tCGYpkN8wTX2E5Det5A8QZwnSPIESZ4A0z5A0idIetcpFzElxJBArave4hkoDba123NkO5bWkqNdy04wfDMwklaWdn+dPXv27AbgK182DBLmsFbP2tAqcsu6J6UoMmAZgf8YyIzvpQ7+5+BRVbju8xa4B4V83oFLIBEBDg8PMzOzN1elkMsSIAtGMIcx2PvkNncmKcZIAryonRYti61LCUVIEgaVptvanIQQRgIc1mrZNLe38HAJxskEhNAW4Pikviqk2PD36R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c8c2edf40778a47a.png"},85708:function(e,s,a){"use strict";e.exports=a.p+"static/media/Create_4_2.99f84a4aff9e9bb3ca14.png"},90819:function(e,s,a){"use strict";e.exports=a.p+"static/media/Discover_1_1.4716f9fc56fd9e2cf0ae.png"},53960:function(e,s,a){"use strict";e.exports=a.p+"static/media/Discover_1_2.4477dfa7b95997c4aa82.png"},47825:function(e,s,a){"use strict";e.exports=a.p+"static/media/Discover_1_3.5f440bb3e06bacf5b6d4.png"},90970:function(e,s,a){"use strict";e.exports=a.p+"static/media/Discover_1_4_1.4eb8dec83697d6f586c8.png"},67217:function(e,s,a){"use strict";e.exports=a.p+"static/media/Discover_1_4_2.0ce12173d3b3ce7a488d.png"},86846:function(e,s,a){"use strict";e.exports=a.p+"static/media/Explore_2_1.ff5ea61e99c40c7d915a.png"},67726:function(e,s,a){"use strict";e.exports=a.p+"static/media/Imagine_3_1.62a616913d06567fb46b.png"},21733:function(e,s,a){"use strict";e.exports=a.p+"static/media/Imagine_3_2.404aa781bd817be75de1.png"},38606:function(e,s,a){"use strict";e.exports=a.p+"static/media/brainstorm_new_lxp_3_1_eg.a88eb76fe3c68cf716b1.png"},90946:function(e,s,a){"use strict";e.exports=a.p+"static/media/need_to_know_new_lxp_2_1_eg.057aa6264c07195fc1d8.png"},38743:function(e,s,a){"use strict";e.exports=a.p+"static/media/phase_1_4_new_lxp_eg.ee38420aa18825b4cb87.png"},53732:function(e,s,a){"use strict";e.exports=a.p+"static/media/research_new_lxp_2_2_eg.d81f21afdbcd16adafcf.png"},84334:function(e,s,a){"use strict";e.exports=a.p+"static/media/wordcloud_placeholder.3057892f01dcf9a974fb.png"},68700:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAEqADAAQAAAABAAAAEgAAAA
2C5YZBvAAABZ0lEQVQ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uY0zryXPrxaQ1i6/COCXv/DS2LvrtKxVVKEfDpC3xg6cJ5Fvryq0lM6ALL8PBc3rx7wAqp9PQotePBSOR/24Fw/VzyehRWvnodVsrN/7i89wU/VqY/ACaqaTcExT7lv3dK68pHDxu1wZRdroZe2cOyK3cAwXFixTmS9bu5BbO0CrCbn031Ly7n8K/j9f9y8CCnZqTAAAAABJRU5ErkJggg=="},83233:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAEaADAAQAAAABAAAAEQAAAACtW7E7AAAA+klEQVQ4Ea2SjQ2CMBCFhQnYQDaQERiBDWQDGEE30Al0A+IE1glkAxnBDfB7pMp/GiKXfPSu996lbdhsOlHXtQFXmI6lTXElcLfuuO30M/qx1TxZs1+XIocKNKgE1xBpvtq8GWSNiQpyXcc1xFitTlUp92EHpYqFIc9WHg25QQpLI8XwaEwcKdSxQI/1grhpTHzUsxpp3xBJ5nueV7GqOIIHIcxFQEOaM4R4daV+MDmHor/bVvSucGp3JjIEAeiY6bDNXmJ74bA3qhFGVlywZrCHC2h4PDLMbSAOIAc9uFCu91geGA/C5dR/8nesMmTyFFzBwDDMpHitzQ992SEg5R8cxgAAAABJRU5ErkJggg=="},84547:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAhCAYAAABX5MJvAAAAAXNSR0IArs4c6QAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAIaADAAQAAAABAAAAIQAAAAA1iKI6AAACKElEQVRYCe2V63XaQBCFwQ2EDkIJ6iCkAuMKQgfGFWRdQegAXAGmgsgV2O7AHZhUgL+7zMgLREICycc/POdc7ew87oxm9ej1SmSz2QTQluQlZaL5osr5Ub5+WojbHrK/BhmQLtyBBThFJiT9Am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89hs7GBRCsoR+sFyoXzQJkiQnIAdUIvbdo2WOMgKczPAn2LnKWErLaQY+f4XTgjrvCXY4eYPxxlXGVtpEMuHFK8Ak4f7LrK/4Gbkox4hcuRJGYQVSmu+IP1iNXOnhOERf7tkB0lNNAvqOSfAZ4SR2yojLRLnxnDCJXBqbr3UxvpA6k7i/qDMJPSi8VBZiNCoV3LhTdKIN93t7UExGlvEzjGejYg8yNgF9bryDe0qe7mAvoOsl8opBL0BEo0sKOPCmfgIHJjAVLuR8KDCcATugKls0/JbG/HBkuBpi6LOiqMQVCuaVUR8YVjwTpVrX6EMlURPaTPK8nr20YiSXbwmcSmYr5kFVxNSVQPVTuEMyQLeTX2wM4sok1gGKD/Eb3d4K3nXbrlCfA0l7TzUj4IiroxLXmHVqgvNqjMTXofs7/deetyIM3sUoET2UeuDT/vpD+f7wg5lKZSmKsN7NPbAW/6vQ/o0/BIglCNV5qEDwxXOnEsz3EUdEySUS74/oyKhlA3zwLOiBLlu6aGdO0oAKg7f/7UlYjH9Vh9AT6e5HRZBFJSgTidpGwxiuwBpQydr6OdseUTONDH0LPPo6hO0DUAAqG9/xwewQvZoICRXAMxBXA7ENeAS4clXhWeu0LavxvOsIXN1aVXI+9dQ7YF+GYMnDzplsKxyT9MXrLL8gxGRSYAOckhIdGXC03c4K2vcgS9Ylw8R62/Neb6czEy5l3M6+v6QpnNpnEuFYNni6JdEwQYN131ZisKluCHRbiYYJGqz7KlZi0nW6eCV38YFLsDOHq1iJq0jiW5etYMf+COCjk4t/uHJtXHs36IsAAAAASUVORK5CYII="},57502:function(e,s,a){"use strict";e.exports=a.p+"static/media/wavy-cutout.8f839b8c8a308641154c.png"},50829:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAMAAABOo35HAAAAgVBMVEX///8+hftTnv48gvtQnP5Uof5BifxPmv5CivxFjvxNmP5Llv1Ah/xEjPxWov5Jk/1HkP1KlP1Ikf1Wov9Vmf3D2/6VwP6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YPu86FDHAh25HxzoksqunFHmX7e7JwhSON35AG5TqTffEsJ0bZvpTBQkZr+ooXZDM/3QdZOi7HflnZBcO6Lg7LYVUcloDDEnBYnyQd2zeTjeVtcP7XpPH+21Z75bP+MIhuTDlOPctnKYsh3ddkbJCNF5sp4OFbviRLcenm3u7UssAnvXq21vEOes2DrM453ASqLPbV2ctiHHWbt2vj5e9T96wbj4Spk3GxFAeiC11Y0CIAWMj6+AEZrXHwXHacKmMHaWyN0UzbAILsbPSL6bLUTc2CtBmHdcdhCTgsAYcl4LAEHJaAwxJwWAIOS8BhCTgsAYcl4LAEHJaAwxJwWAIOS8BhCTgsgWuFddtO5LbwXuSS6Xa7Fd9tfdt5rzzbqra8IWO4kLEBRcaklIIswornCl/6WtUyqLHElId5ZAsLy58yRrRr8xvZNpGhoOIVIYypIqs7DvOLrP+WKUreThkVNCsVBSuxzGVUdGgiYR3PLIiXCrLR1yvi4USPpsJrgVLriLJNkImn0s2scFgOa8RhCTgsAYcl4LAEHJaAwxJwWAIOS8BhCTgsAYcl4LAEHJaAwxJwWJ/kN6FYuyFla0AoAAAAAElFTkSuQmCC"},99133:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAS4AAABECAMAAAAIhij5AAAAk1BMVEUAAAAsi/8sjP8si/8sjP8riv8si/8siv8sjP8sjP8sjP8si/8si/8sjP8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8si/8tjP9Ud4mpAAAAMHRSTlMA+/AklwThDRyRsaZNUvj1ERbrzTbSfOaOCth0wlmrH2wHvbgrxz+hid1lMIJJYEN4tON9AAAJH0lEQVR42tWc2ZqiMBCFAwguKPsiCMqioKLC+z/dTC/TdlIhATPDfH1uOymSn6pKJcFGYfeSZHfrqYilefPYrvzQ7DpJ1tz9LT1G6AVFyua2dzVZ6joz9Mvt1bMYrW23+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jfTEOHPid7US4xGmhvAadi3UEZ/nwQTvsqCaTyL/HmQWfdi9Bu300FS4+Lb6OMegv7zc28dvXwgCtChvjCfOnkVwPKtbmTvl4WfPQdLjsfQdVWypP6KmrCS2Y7nl9tKLfDSO7SWexBJuELVGTaJT3Fs/Sxn43Yynr24nyJCNDE+LKOopcnac62HyVktGso8kI3VLX96XvSNQ/f4QiwA6IOX6x/23GDQ3Grz+mwCX0C1DJ39l/Qq18of8sgqW6NN5MckA/AtdbSvf+pC93dOeVTf/YePyPm34Krq7zvVd/clYe6BcFY2m1aFpcy0
25Epz+zrnwBWuAz6/G0IK4zo1Q0BuI6A1y7lzDBQTXJmN+NH1CP7Foa8bI81I8r41658XFlAFdrCuHSjuBXNFyZZ4uxqbrJQ6HvFQRwDTqStX2Aa8jpJzw6Ga/s25bQGRZBjxwxpKbD4tq5WQjgGviTpy3ANeSEG24+xqtWnxOtCr4ts+beiykzme9ayV1FANfQ6yQv5OOCcD48sxSARVwuWlnMm2UaIa7yNY97vLPZF5gri+nBgcTFBXdmn0laKBxdCx9y4PfP1DhlNhok65EY/czjQOHc97pHjn19GC7U+CQu5J3EcOFaXEuHOslQ31hosKxNrVHBy0V24F2PJx7PvD0zBuFCXgKPB8+aCC7+/ymTZF+/HnM0SvnxWvsyhsy8rHbenPM1gaTdFnzr0dWV2LiecCQcF1KbW6LJL6mmQsiVe1AnsebIjuYXs6xdqOgFqYsqm5X+m5kwTupgrUTMWyZZlrUkaIY965CtYkeWLx5vEE1QvMHxfwFp7FTnSoG3GQAAAABJRU5ErkJggg=="},24589:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAHcCAMAAACXsuIBAAADAFBMVEUAAABPWclPWsppb95ueNdWXsFYYMN7hO1zfOVXX8NFTLZQWcdNVr57g+tUXMJPWchAR7J7hOxQWclRWchQWcB7g+xQWcl8hOx6g+p7g+tLUrtQWsh7g+x7gup7hOx7g+x7hO17g+xQWslCSrRuduJQWclQW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dz5VHpvOFEeQJ86Nq4GrkXyqWYybOuY+CquU81iTGRyy751ymKonzmdatdklmkwI9JFORNDcrIXYyhxjDmwJ9tDay5w7iUt2SPUpo7G0WKeThA48mtNNeezPqzbDq52bQwHAc4evfMlSMFb0w1BjLzw/hgmoGLjVoVOMDBnTMXG7WqOIheFztSUIVDbQaSjVy13Bk52MhVi0Plqs0Fvj+dFiNZyhFY+6QQSy8cxJRamxY08RPYyNXF0g9jz0auPp7byNXH3JqrBwfwrLkaseZqxJqrhwLIXcQrnhb17Ky5+tjZtKCHXRIFNi1ooACuQJzQspNKMZPPIMz978RCTGNTvixo04JaCuDv8hebFtSSVUsO2MhVRwFE1RUusDuJFPPIkih4X11h04IaDqIW9pOfb7GP2IeQJlHwQ31leYWWjavFKI5GLezN/TKeFuPY1XNtSWnubjwtRlEAL5v+aM0dxlVb6RZrbn9SGnJtiQsgX/fJ9OsxhgJRmyxva1S9n/tJqxyzeNulsl7V3I/apJhFmkTBqkvDb+bKI5Hr0WMMKfCia+P6Y54rtVqMoixokXXdoG7uRqUaw3ibRMHHh2xwx1x5VI5ebUycqGuerdJUQCgfKMYk1n2MhSPmyuhtHRxPiE0SBW/6btxYKNMP4xumXbhtk0TBqyEdtE0KecV0r9qiocbCPSVeJ1gdr1f9sCZapzPJ/Psz0zjBpcALlVWg750rJov1PsPsFHGDMHarstOp1yy/RVwcrHV03qfa/iXi9XdPg54x2XAu1farPPLvRGwRpm5170jFF05WiBqQMyWK9LFlJFNLVH+b54L9x47OgRxxp29931MDHYzxVak5e8M95Ts7ZItpX5XqQsV0D1GK4IlczmST+rJOzn7MnSOGh18RD1h3iPlaeX2jU/E/bPNx8G2Xk6AAAAAASUVORK5CYII="},81722:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAABRCAYAAACnkTpxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE9WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJ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Ba/7bHgscldYY6tc9M3BdyJXRm2qSJRJFMAfD73YqEfuSpUaw3CAd/LOX2fq5j5XJsc8HOCD/O/uxDdz5VHpvOFEeQJ86Nq4GrkXyqWYybOuY+CquU81iTGRyy751ymKonzmdatdklmkwI9JFORNDcrIXYyhxjDmwJ9tDay5w7iUt2SPUpo7G0WKeThA48mtNNeezPqzbDq52bQwHAc4evfMlSMFb0w1BjLzw/hgmoGLjVoVOMDBnTMXG7WqOIheFztSUIVDbQaSjVy13Bk52MhVi0Plqs0Fvj+dFiNZyhFY+6QQSy8cxJRamxY08RPYyNXF0g9jz0auPp7byNXH3JqrBwfwrLkaseZqxJqrhwLIXcQrnhb17Ky5+tjZtKCHXRIFNi1ooACuQJzQspNKMZPPIMz978RCTGNTvixo04JaCuDv8hebFtSSVUsO2MhVRwFE1RUusDuJFPPIkih4X11h04IaDqIW9pOfb7GP2IeQJlHwQ31leYWWjavFKI5GLezN/TKeFuPY1XNtSWnubjwtRlEAL5v+aM0dxlVb6RZrbn9SGnJtiQsgX/fJ9OsxhgJRmyxva1S9n/tJqxyzeNulsl7V3I/apJhFmkTBqkvDb+bKI5Hr0WMMKfCia+P6Y54rtVqMoixokXXdoG7uRqUaw3ibRMHHh2xwx1x5VI5ebUycqGuerdJUQCgfKMYk1n2MhSPmyuhtHRxPiE0SBW/6btxYKNMP4xumXbhtk0TBqyEdtE0KecV0r9qiocbCPSVeJ1gdr1f9sCZapzPJ/Psz0zjBpcALlVWg750rJov1PsPsFHGDMHarstOp1yy/RVwcrHV03qfa/iXi9XdPg54x2XAu1farPPLvRGwRpm5170jFF05WiBqQMyWK9LFlJFNLVH+b54L9x47OgRxxp29931MDHYzxVak5e8M95Ts7ZItpX5XqQsV0D1GK4IlczmST+rJOzn7MnSOGh18RD1h3iPlaeX2jU/E/bPNx8G2Xk6AAAAAASUVORK5CYII="},60853:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFcAAABRCAYAAACnkTpxAAAAC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="},97312:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAAABwCAYAAADPC1QxAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABfdSURBVHgB7V1LjJ1Fdj7/3y93ux9u/AoKM0GKEyk4YTTAIooSQaQsshmFRYhgM5tEK
2FEyLLJIUMICJlEUzQp5FJRFWBBm4gQQyCIIISHEMINYAZoxGJB4eGgjnsaNjbGN4dacU31O3a/OX39339vddnffe6TS/773/+urc+q8qopoSEMa0pCGNKQhDWlIW46qEEJjy6XSEs/p+co9VxX20/3+WH9rSGugWKlQkRXllZ0BBvcjgI39ludiufvuu2v3GwTnE/DunXC76WgzvVjxXYLUKhNyDB+2/ojdb4fkGgo+K+dajtNzeB5+e9Oyb02Xl5LILFyzSovXpB6tkONcAhHJ12s4X9t999xzT6VgNDifOTL7f3ifYP+tWxT19u5Em5hjN5oaopJy0YjHtTtfO1FYW5HzVvTcyC233DIiWziH17FUhXN12/sVxDR+D37nQFDGVdTsz9KWCpUMRcCKAClw6Rzsj9x0002jtg/3NUoL0L6RlBpeUsjcu+O3bh9CzRKOS1xae07yHEddwEawCGjGjbK1fQIuxWN3Lv5+4VzibGs0xp1SWiQGUVPKbCsqaakNzqRluEYrrA0MK6OF40bRZ+NWOXfUOBg5GRsItXAxgLpct7GtqAFioQLaRN9IqS80QLSMIDAE4FAO5Bi1AGy/48D1DSD1w3BcURnoNumzpUFua7VyrdhXFfrABAqAZufGtIw6IOL566+/Pm11fxzPyRbu98+N2nXfeKgpBWrfJ0NfWrvvLgG9YbRuZkubZ0VMgsoZjnwu7T/88MPR5uMKItjaterMmTOxMrjS42/wNt5n55999tn0DefOnYvnXnzxxVj43iBbPlfrNj1HwDH2nOzL9bfffrtmYO2y117Tvfyu6Zp9YsgrwoMXLR/azNwKLjcCLa9VvLqWnfotJ/KMEyPHCAc999xzexcXF2/gyv/Lixcvfv/LL7/876+++urI119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O1Ju4BjnzWpJUs07/x69cFZzubr7bs7rDgpufEH5GIfC1Kztbdv+qgQxE7JN7Amaoa3q1cGp8Voqo/YKiJ2f3nE9CbFrIct6ipacYHWKko5ev6y2TtpwyjUyplUXXqm41yDb52kwRrYpV9ta6wnVG6Z2Idedw8CIbt9oMvUM5eRXTy4H7ufE69JyQM6JrcuFSwjGfhsMyJMtYW+BpuDy0ti9zQ9Q+rOk3qE4H3O55KalFUe976r463deutI3lSo36bSh59cy4E9aeSstp8DZpFGZHzpgL6xNXi7WYyGn3YLL9TLtNd6PmCyn3/44SMDoPMeo4ACDbUhlDXJxqAAAAAElFTkSuQmCC"},11388:function(e){"use strict";e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAuCAIAAADlSd0GAAADOUlEQVR4Ae2Zg5MjXRTFv79o0u7PaxbWtsq1trewtjodZ23btm3b9vbZPvUynglWPXp1hklufn317uv8gRK5KrCA9/dxpDteni5JWBfHIv4XggpW1S0ZWO/vYWtTBBREDczwOVualACsy5Mx62/4JTK532f6nI0NPcX6+Bi72iCoIqwxdpYEW6K3NjbwDuuyjdl/w5YR0egkynOsR7tga86sv4STSgzWi9OI/JXIpKDCIAbkBNZ0b4P46QUuT8KG+oj/Cb+M6VlOzPTaW3nX22s4PQJuUwjrdNiMLMdlLUHt9NlRbGrokbeSr1ODYEklD+vCKMxMG6sCa3QFVgZYY4hVohoE1/HerMQtjUsS1odHWPA/O+q8fwGnxGAtrsadMapzHjzao2RgHelOmogOy+fETUQMvDjrNdbtpQhpLhMHCr/k8vGX/V28xOIoMfdfhFT4fbmDV8xA1MSb695hbWvGGTXoYuWbB/l9XxePsM6NIZA4XBRQUEHsT7y5+gNYry5yJllZG9fsTCat65wBi2KiQipb67Fe34v19hbm/MuLo1Qc75Mu1tLqfAkhipEoybc3vwtrdV32m5DKCoqZ/H5qYGqmM0P5zLCWDEs47ESfzLHODIct5wbCkhDR6bPTQ5BkPd2PsCFelUIxkyX54WEmWM8OI+K+TC9oS5CdHYHi1sLK4siaGst2JYMZlj7WosrFRkGQXRhVVEPvxvDxhMhGlVoBmQfdD4/SwuIV2DLCarHmIhp798VxyLtuzkNYFxeTrsIqx4qT/dPAur0cQY2VktQiyYJqLtnHp2BDTxxW05aPdmb9RYclw/r8mtYDCl+QjkX6bALTdnsLAoWYUhnIynbYqUFJsXgvSoadtt2gQrj5/7HgwwrfICMsoahBh31+VQzWeW4XCImUyoTM5nf+/n2yZYrVXRjrzXUiRzQRvsyUnCnNkpzzD768L4S1rDpsSSSsB4podNjpofmxrk5n7ET2eYEltl1W29vrebA2N0ncR7S8YLIkjqxRA5bi3FicB2t3e7EleyZOYAZCOh5szYP18SkPJy4vn/HbJcjif/HOdBEN4sFG3F+P+xs80N2V7Mkl+jOfb+/iZ67IKd6cAAAAAElFTkSuQmCC"},57122:function(){},85066:function(){},80564:function(){},97209:function(){},46093:function(){},7564:function(){},23092:function(){},18657:function(){},98408:function(){},14098:function(){},9658:function(e){"use strict";e.exports=JSON.parse('[{"is_online":false,"id":106,"fullname":"Preview Facilitator","locale":"en","dob":null,"is_facilitating":true,"force_password_change":false,"last_online":"2020-11-06T17:42:23.000Z","lock_user_information":false,"total_time":20257391,"total_time_updated_at":"2020-11-06T17:42:23.000Z","createdAt":"2020-02-28T12:31:20.000Z","updatedAt":"2020-11-06T17:42:23.000Z","deletedAt":null,"banner_id":null,"avatar":null}]')},19588:function(e){"use strict";e.exports=JSON.parse('{"id":1,"name":"Sample Class","slug":"sample-class","organization_id":1,"section":"Sample Class","archived_at":null}')},13084:function(e){"use strict";e.exports=JSON.parse('{"id":1,"start":"2019-11-18T19:08:30.000Z","expires":"2022-11-05T18:08:30.000Z","due":"2022-07-08T18:08:30.000Z","assign_to_new":true,"name":"","is_started":true,"group_id":1,"can_learners_create_teams":true}')},93050:function(e){"use strict";e.exports=JSON.parse('{"is_submitted":false,"id":1,"name":"Sample Teams Project","published":false,"num_phases_complete":3,"num_subphases_complete":8,"completion_pct":61,"is_complete":false,"completed":null,"points":75,"challenge_data":[{"data":null,"is_complete":true,"phase":1,"subphase":1},{"data":null,"is_complete":true,"phase":1,"subphase":2},{"data":{"constraints":null},"is_complete":true,"phase":1,"subphase":3},{"data":null,"is_complete":true,"phase":1,"subphase":4},{"data":null,"is_complete":true,"phase":2,"subphase":1},{"data":null,"is_complete":true,"phase":2,"subphase":2}
2,{"data":null,"is_complete":true,"phase":3,"subphase":1},{"data":null,"is_complete":true,"phase":3,"subphase":2},{"data":{"we_will":null,"so_that":null,"resulting_in":null},"is_complete":true,"phase":4,"subphase":1},{"data":null,"is_complete":false,"phase":4,"subphase":2},{"data":{"reviews":{}},"is_complete":false,"phase":5,"subphase":1},{"data":{"reviews":{}},"is_complete":false,"phase":5,"subphase":2},{"data":{},"is_complete":false,"phase":5,"subphase":3},{"data":{"reviews":{}},"is_complete":false,"phase":5,"subphase":4}],"course":{}}')},97836:function(e){"use strict";e.exports=JSON.parse('{"id":1,"name":"Sample Team","slug":"sample-team","challenge_id":1,"group_assignment_id":1,"score":0,"is_graded":false,"members":[{"id":1,"is_captain":false,"total_time_seconds":233772,"has_seen_current_phase_compulsion":true,"has_seen_final_compulsion":false,"created_at":"2019-11-18T19:43:40.000Z","updated_at":"2021-04-20T13:59:56.000Z","deleted_at":null,"team_id":1,"user_id":1,"group_member_assignment_id":1,"user":{"is_online":false,"id":1,"fullname":"Preview Learner","locale":"en","dob":null,"is_facilitating":false,"force_password_change":false,"last_online":"2021-04-23T19:09:43.000Z","lock_user_information":false,"total_time":292436970,"total_time_updated_at":"2021-04-23T19:09:43.000Z","createdAt":"2019-02-23T16:15:18.000Z","updatedAt":"2021-04-23T19:09:43.000Z","deletedAt":null,"banner_id":1717,"avatar":null}}],"facilitators":[]}')}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.