PageSourceSearch

https://www.all-voiced.com/static/js/4195.142258e0.chunk.js

js all-voiced.com collected 2026-10-07 20:15:12 UTC 32,870 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkall_voiced=self.webpackChunkall_voiced||[]).push([[4195],{4195:(e,t,s)=>{s.r(t),s.d(t,{default:()=>D});var a=s(2791),l=s(9230),n=s(2903),r=s(8106),i=s(6744),o=s(9755),c=s(1157),d=s(184);const u=function(e){let{apiUrl:t,onSubmit:s,sample:u}=e;const{t:p}=(0,l.$G)(),{user:h}=(0,c.aC)(),{sociodemographicData:v}=(0,r.v)(t,h),{id:m,age:b,pronoun:f,countryOfResidence:x,communicationLanguage:j,profession:y,voiceCompetenceLevel:g,acceptResearchUsage:S}=v||{},[w,_]=(0,a.useState)(0),[k,C]=(0,a.useState)(0),[N,V]=(0,a.useState)(0),[$,I]=(0,a.useState)("");return(0,d.jsxs)("form",{className:"app-module",onSubmit:async e=>{e.preventDefault();const a={overallSeverity:{attributeName:"overallSeverity",VASValue:w},roughness:{attributeName:"roughness",VASValue:k},breathiness:{attributeName:"breathiness",VASValue:N},overallImpression:$};if(S)try{var l,r,i,o;await n.Z.post(`${t}/voice-assessments`,{userId:m||null,raterSource:"allvoicedUser",voiceDatabaseId:(null===(l=u.identificationData)||void 0===l||null===(r=l.voiceDatabaseId)||void 0===r?void 0:r._id)||(null===(i=u.identificationData)||void 0===i?void 0:i.voiceDatabaseId),subjectId:(null===(o=u.subjectId)||void 0===o?void 0:o._id)||u.subjectId,voiceSampleId:u._id,isSharedForFeedback:!1,evaluationTool:"68340d1abfa12b73b1b5d25b",raterData:{age:b,pronoun:f,countryOfResidence:x,communicationLanguage:j,profession:y,voiceCompetenceLevel:g},ratingConditions:{voiceSource:"recordedVoice",ratingDate:new Date},perceptualData:a,context:"quebec_innovation"})}catch(c){console.error("\u274c Error saving assessment to voiceAssessments:",c)}try{await n.Z.post(`${t}/quebec-innovation-assessments`,{userEmail:(null===h||void 0===h?void 0:h.email)||null,sampleId:u._id,overallSeverity:w,roughness:k,breathiness:N,overallImpression:$,timestamp:new Date})}catch(c){console.error("\u274c Error saving to quebec_innovation_asse
1ssments:",c)}s({overallSeverity:w,roughness:k,breathiness:N,overallImpressionComment:$})},children:[(0,d.jsxs)("div",{className:"capevr-scale-container",children:[(0,d.jsx)("span",{className:"capevr-scale-label capevr-scale-left",children:p("normal")}),(0,d.jsx)("span",{className:"capevr-scale-label capevr-scale-right",children:p("extreme")})]}),(0,d.jsx)("br",{}),(0,d.jsx)(i.Z,{label:p("overall_severity"),VASValue:w,setVASValue:_,index:0}),(0,d.jsx)(i.Z,{label:p("roughness"),VASValue:k,setVASValue:C,index:1}),(0,d.jsx)(i.Z,{label:p("breathiness"),VASValue:N,setVASValue:V,index:2}),(0,d.jsx)("br",{}),(0,d.jsx)(o.Z,{overallImpressionComment:$,setOverallImpressionComment:I}),(0,d.jsx)("div",{style:{textAlign:"center",marginTop:"1em"},children:(0,d.jsx)("button",{type:"submit",className:"app-btn app-btn-primary",children:p("view_feedback")})})]})};var p=s(5161),h=s(5534);const v=e=>{let{attributeName:t,userValues:s=[],sharedValues:n=[]}=e;const{t:r}=(0,l.$G)(),i=(0,a.useRef)(null),[o,c]=(0,a.useState)(800);(0,a.useEffect)((()=>{var e;const t=new ResizeObserver((e=>{var t,s;null!==(t=e[0])&&void 0!==t&&null!==(s=t.contentRect)&&void 0!==s&&s.width&&c(e[0].contentRect.width)}));return null!==(e=i.current)&&void 0!==e&&e.parentElement&&t.observe(i.current.parentElement),()=>t.disconnect()}),[]);const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(Math.random()-.5)*e};return(0,a.useEffect)((()=>{if(!i.current)return;const e=40,a=40,l=40,c=o-e-120,d=p.Ys(i.current);d.selectAll("*").remove(),d.attr("viewBox",`0 0 ${o} ${70+a+l}`).attr("preserveAspectRatio","xMidYMid meet").style("overflow","visible");const v=d.append("g").attr("transform",`translate(${e},${a})`),m=p.BYU().domain([0,100]).range([0,c]),b=h.z[t]?r(h.z[t]):t;d.append("text").attr("x",e).attr("y",a/2).text(b).style("font-size","14px").style("font-weight","bold").style("fill","#333"),v.append("g").attr("transform","translate(0,70)").call(p.LLu(m).ticks(5).tickFormat((e=>`${e}`))).selectAll("text").style("font-size","12px").style("fill","#333"),s.forEach((e=>{let{value:t}=e;"number"===typeof t&&v.append("circle").attr("cx",m(t)).attr("cy",60+u(10)).attr("r",5).style("fill","red").style("stroke","#fff").style("stroke-width",1.5)})),n.forEach((e=>{let{value:t}=e;"number"===typeof t&&v.append("circle").attr("cx",m(t)).attr("cy",60+u(10)).attr("r",5).style("fill","#209385").style("stroke","#fff").style("stroke-width",1)}));const f=d.append("g").attr("transform",`translate(${o-250}, 10)`),x=[{color:"red",fill:"red",label:r("your_evaluation")},{color:"#209385",fill:"#209385",label:r("reference_ratings")}];f.selectAll("circle").data(x).enter().append("circle").attr("cx",6).attr("cy",((e,t)=>20*t+6)).attr("r",5).style("fill",(e=>e.fill)).style("stroke",(e=>e.color)).style("stroke-width",2),f.selectAll("text").data(x).enter().append("text").attr("x",20).attr("y",((e,t)=>20*t+10)).text((e=>e.label)).style("font-size","12px")}),[t,s,n,o,r]),(0,d.jsx)("div",{style:{width:"100%",overflowX:"auto"},children:(0,d.jsx)("svg",{ref:i,width:"100%",height:"150px"})})};var m=s(4446);const b=e=>{var t,s,a,n,r,i,o,c;let{attributeData:u,onNext:p,isLastSample:h,phase:b}=e;const{t:f}=(0,l.$G)(),x=(null===u||void 0===u||null===(t=u.overallImpression)||void 0===t?void 0:t.user)||"-",j=(null===u||void 0===u||null===(s=u.overallImpression)||void 0===s?void 0:s.shared)||[],y=[{source:f("your_evaluation"),comment:x},...j.map(((e,t)=>({source:`${f("reference_rater")} ${t+1}`,comment:e})))];return(0,d.jsxs)("div",{className:"feedback-section",children:[(0,d.jsx)(v,{attributeName:"overallSeverity",userValues:(null===u||void 0===u||null===(a=u.overallSeverity)||void 0===a?void 0:a.userValues)||[],sharedValues:(null===u||void 0===u||null===(n=u.overallSeverity)||void 0===n?void 0:n.sharedValues)||[]}),(0,d.jsx)(v,{attributeName:"roughness",userValues:(null===u||void 0===u||null===(r=u.roughness)||void 0===r?void 0:r.userValues)||[],sharedValues:(null===u||void 0===u||null===(i=u.roughness)||void 0===i?void 0:i.sharedValues)||[]}),(0,d.jsx)(v,{attributeName:"breathiness",userValues:(null===u||void 0===u||null===(o=u.breathiness)||void 0===o?void 0:o.userValues)||[],sharedValues:(null===u||void 0===u||null===(c=u.breathiness)||void 0===c?void 0:c.sharedValues)||[]}),(0,d.jsx)(m.Z,{title:f("overall_impression"),data:y,columns:[{key:"source",label:f("source")},{key:"comment",label:f("comment")}]}),(0,d.jsx)("br",{}),(0,d.jsx)("div",{className:"app-btn-container",children:!(h&&"sentences"===b)&&(0,d.jsx)("button",{className:"app-btn app-btn-primary",onClick:p,children:f("next_sample")})})]})};var f=s(6042);const x=e=>[...e].sort((()=>Math.random()-.5)),j=e=>{let{apiUrl:t,sampleIds:s,mode:r="course",onStepComplete:i}=e;const{t:o}=(0,l.$G)(),[c,p]=(0,a.useState)([]),[h,v]=(0,a.useState)([]),[m,j]=(0,a.useState)(0),[y,g]=(0,a.useState)("vowels"),[S,w]=(0,a.useState)(!1),[_,k]=(0,a.useState)(null),[C,N]=(0,a.useState)(null),V="vowels"===y?c:h,$=V[m],{sharedAssessments:I}=(0,f.u)(t,null===$||void 0===$?void 0:$._id);(0,a.useEffect)((()=>{var e;const t=((null===(e=s.vowels)||void 0===e?void 0:e.length)||0)>0;g(t?"vowels":"sentences"),j(0),w(!1),k(null),N(null)}),[s]),(0,a.useEffect)((()=>{var e,a;((null===(e=s.vowels)||void 0===e?void 0:e.length)||0)+((null===(a=s.sentences)||void 0===a?void 0:a.length)||0)>0?(async()=>{try{const e=[...s.vowels||[],...s.sentences||[]],a=(await n.Z.get(`${t}/voice-samples`,{params:{ids:e.join(",")}})).data.data||[],l=x(a.filter((e=>s.vowels.includes(e._id)))),r=x(a.filter((e=>s.sentences.includes(e._id))));p(l),v(r)}catch(e){console.error("\u274c Error loading samples:",e),p([]),v([])}})():(p([]),v([]))}),[t,s]),(0,a.useEffect)((()=>
1{if(!I||!S)return;const e=I.filter((e=>"quebecRater"===e.raterSource)),t={};["overallSeverity","roughness","breathiness"].forEach((s=>{t[s]={sharedValues:e.map((e=>{var t,a;return null===(t=e.perceptualData)||void 0===t||null===(a=t[s])||void 0===a?void 0:a.VASValue})).filter((e=>"number"===typeof e)).map((e=>({value:e,raterSource:"quebecRater"}))),userValues:_?[{value:_[s]}]:[]}})),t.overallImpression={user:(null===_||void 0===_?void 0:_.overallImpressionComment)||"",shared:e.map((e=>{var t;return null===(t=e.perceptualData)||void 0===t?void 0:t.overallImpression})).filter(Boolean)},N(t)}),[I,S,_]);const A="vowels"===y&&m+1>=c.length,E="sentences"===y&&m+1>=h.length,Z=c.length>0?0===c.length?0:Math.min(c.length,"vowels"===y?m+1:c.length)/c.length*100:0,D=h.length>0?0===h.length?0:Math.min(h.length,"sentences"===y?m+1:0)/h.length*100:0;return(0,d.jsxs)("div",{children:[$?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("audio",{controls:!0,src:`/${$.sampleLink}`}),(0,d.jsx)("br",{}),S?(0,d.jsx)(b,{attributeData:C,onNext:()=>{const e=m+1>=V.length;e&&"sentences"===y?"function"===typeof i&&i():(w(!1),k(null),N(null),e?(g("sentences"),j(0)):j(m+1))},isLastSample:"sentences"===y?E:A,phase:y}):(0,d.jsx)(u,{onSubmit:async e=>{k(e),w(!0)},sample:$,apiUrl:t})]}):(0,d.jsx)("p",{children:o("loading")}),(0,d.jsx)("br",{}),"training"!==r&&(0,d.jsxs)("div",{className:"progress-wrapper",children:[(0,d.jsxs)("div",{style:{marginBottom:"0.5em"},children:[(0,d.jsx)("progress",{value:Z,max:"100",style:{width:"100%"}}),(0,d.jsxs)("p",{children:[o("vowel_progress"),": ",Math.min(c.length,"vowels"===y?m+1:c.length),"/",c.length]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("progress",{value:D,max:"100",style:{width:"100%"}}),(0,d.jsxs)("p",{children:[o("sentence_progress"),": ",Math.min(h.length,"sentences"===y?m+1:0),"/",h.length]})]})]})]})};var y=s(1675);const g=()=>{const{t:e}=(0,l.$G)(),t="https://api.all-voiced.com/api",[s,r]=(0,a.useState)(null);(0,a.useEffect)((()=>{(async()=>{try{const e=await n.Z.get(`${t}/voice-collections/6821a9acf459819632e09ed0`);r(e.data.data)}catch(e){console.error("\u274c Error loading PVQD30 collection:",e)}})()}),[t]);const[i,o]=(0,a.useState)(null),[c,u]=(0,a.useState)("step1"),[p,h]=(0,a.useState)("vowels"),v=new Date>=new Date("2025-06-08T00:00:00-04:00"),m={vowels:["682221300dc7f96926b10826","682221300dc7f96926b10828","682221300dc7f96926b1082a","682221300dc7f96926b10830","682221300dc7f96926b10836","682226db3de8984eeaf95101","682226db3de8984eeaf95103","682226db3de8984eeaf9510d","682226db3de8984eeaf9510f","682226db3de8984eeaf95111"],sentences:["682221300dc7f96926b10825","682221300dc7f96926b10827","682221300dc7f96926b10829","682221300dc7f96926b1082f","682221300dc7f96926b10835","682226db3de8984eeaf95100","682226db3de8984eeaf95102","682226db3de8984eeaf9510c","682226db3de8984eeaf9510e","682226db3de8984eeaf95110"]},b=m,f={vowels:["682221300dc7f96926b10826","682221300dc7f96926b10828","682221300dc7f96926b1082a","682221300dc7f96926b10830","682221300dc7f96926b10836","682226db3de8984eeaf95101","682226db3de8984eeaf95103","682226db3de8984eeaf9510d","682226db3de8984eeaf9510f","682226db3de8984eeaf95111","682221300dc7f96926b1082c","682221300dc7f96926b1082e","682221300dc7f96926b10832","682221300dc7f96926b10834","682221300dc7f96926b10838","682226db3de8984eeaf95105","682226db3de8984eeaf95107","682226db3de8984eeaf95109","682226db3de8984eeaf9510b","682226db3de8984eeaf95113"],sentences:["682221300dc7f96926b10825","682221300dc7f96926b10827","682221300dc7f96926b10829","682221300dc7f96926b1082f","682221300dc7f96926b10835","682226db3de8984eeaf95100","682226db3de8984eeaf95102","682226db3de8984eeaf9510c","682226db3de8984eeaf9510e","682226db3de8984eeaf95110","682221300dc7f96926b1082b","682221300dc7f96926b1082d","682221300dc7f96926b10831","682221300dc7f96926b10833","682221300dc7f96926b10837","682226db3de8984eeaf95104","682226db3de8984eeaf95106","682226db3de8984eeaf95108","682226db3de8984eeaf9510a","682226db3de8984eeaf95112"]},[x,g]=(0,a.useState)(!1);return(0,d.jsxs)("div",{className:"app-module",children:[(0,d.jsx)("h1",{children:e("quebec_innovation_title","Auditory-Perceptual Evaluation Course")}),!i&&(0,d.jsx)("p",{className:"centered-text",children:e("select_current_phase","To begin, please select the phase that c
1orresponds to your current progress in the course.")}),(0,d.jsx)("br",{}),(0,d.jsxs)("div",{className:"tabs-container",children:[(0,d.jsxs)("button",{className:`tab-button ${"day1"===i?"selected":""} `,disabled:!1,onClick:()=>o("day1"),children:[e("day_1","Day 1")," (2025/05/28)"]}),(0,d.jsxs)("button",{className:"tab-button "+("training"===i?"selected":""),onClick:()=>o("training"),children:[e("autonomous_training","Autonomous Training")," (2025/05/28 \u2192 2025/06/11)"]}),(0,d.jsxs)("button",{className:`tab-button ${"day2"===i?"selected":""} ${v?"":"disabled"}`,disabled:!v,onClick:()=>o("day2"),children:[e("day_2","Day 2")," (2025/06/11)"]})]}),(0,d.jsxs)("div",{className:"tab-content",children:["day1"===i&&(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{children:e("day_1","Day 1")}),(0,d.jsxs)("div",{className:"tabs-container",children:[(0,d.jsx)("button",{className:"tab-button "+("step1"===c?"selected":""),onClick:()=>u("step1"),children:e("step_1","Step 1")}),(0,d.jsx)("button",{className:"tab-button "+("step2"===c?"selected":""),onClick:()=>u("step2"),children:e("step_2","Step 2")}),(0,d.jsx)("button",{className:"tab-button "+("step3"===c?"selected":""),onClick:()=>u("step3"),children:e("step_3","Step 3")})]}),"step1"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"centered-text",children:e("step_1_instruction","First, you will rate 10 sustained vowel samples...")}),x&&(0,d.jsxs)("div",{className:"step-complete-message",children:["\ud83c\udf89 ",e("step_1_complete","Completed Step 1")]}),(0,d.jsx)(j,{apiUrl:t,sampleIds:m,onEvaluationComplete:()=>{g(!0),setTimeout((()=>{g(!1),u("step2")}),3e3)}}),s&&(0,d.jsx)(y.Z,{voiceCollection:s})]}),"step2"===c&&(0,d.jsx)("p",{className:"centered-text",children:e("step_2_instruction","Some voice samples will be discussed in class.")}
1),"step3"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("p",{className:"centered-text",children:e("step_3_instruction","You will rate again...")}),(0,d.jsx)(j,{apiUrl:t,sampleIds:b}),s&&(0,d.jsx)(y.Z,{voiceCollection:s})]})]},`tab-day1-${c}`),"training"===i&&(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{children:e("autonomous_training","Autonomous Training")}),(0,d.jsx)("p",{className:"centered-text",children:e("training_instruction","Practice...")}),(0,d.jsx)("br",{}),(0,d.jsxs)("div",{className:"tabs-container",children:[(0,d.jsx)("button",{className:"tab-button "+("vowels"===p?"selected":""),onClick:()=>h("vowels"),children:e("vowel_training","Vowel Training")}),(0,d.jsx)("button",{className:"tab-button "+("sentences"===p?"selected":""),onClick:()=>h("sentences"),children:e("sentence_training","Sentence Training")})]}),(0,d.jsx)(j,{apiUrl:t,sampleIds:"vowels"===p?{vowels:f.vowels,sentences:[]}:{vowels:[],sentences:f.sentences},mode:"training"}),s&&(0,d.jsx)(y.Z,{voiceCollection:s})]}),"day2"===i&&(0,d.jsxs)("section",{children:[(0,d.jsx)("h2",{children:e("day_2","Day 2")}),(0,d.jsx)("p",{className:"centered-text",children:e("day_2_instruction","You will rate 20 sustained vowel...")}),(0,d.jsx)("br",{}),(0,d.jsx)(j,{apiUrl:t,sampleIds:{vowels:["682221300dc7f96926b10826","682221300dc7f96926b10828","682221300dc7f96926b1082a","682221300dc7f96926b10830","682221300dc7f96926b10836","682226db3de8984eeaf95101","682226db3de8984eeaf95103","682226db3de8984eeaf9510d","682226db3de8984eeaf9510f","682226db3de8984eeaf95111","682221300dc7f96926b10832","682221300dc7f96926b10834","682226db3de8984eeaf95109","682226db3de8984eeaf9510b","682226db3de8984eeaf95113","6829a44000ae7e1909868db6","6829a44000ae7e1909868dbc","6829a44000ae7e1909868dc0","6829a44000ae7e1909868dc2","6829a44000ae7e1909868dc6"],sentences:["682221300dc7f96926b10825","682221300dc7f96926b10827","682221300dc7f96926b10829","682221300dc7f96926b1082f","682221300dc7f96926b10835","682226db3de8984eeaf95100","682226db3de8984eeaf95102","682226db3de8984eeaf9510c","682226db3de8984eeaf9510e","682226db3de8984eeaf95110","682221300dc7f96926b10831","682221300dc7f96926b10833","682226db3de8984eeaf95108","682226db3de8984eeaf9510a","682226db3de8984eeaf95112","6829a44000ae7e1909868db5","6829a44000ae7e1909868dbb","6829a44000ae7e1909868dbf","6829a44000ae7e1909868dc1","6829a44000ae7e1909868dc5"]}}),s&&(0,d.jsx)(y.Z,{voiceCollection:s})]},"tab-day2")]})]})};function S(e){let{items:t,CardComponent:s,getKey:a}=e;return(0,d.jsx)("div",{className:"cards-grid",children:t.map(((e,t)=>(0,d.jsx)(s,{...e},a?a(e,t):t)))})}var w=s(4846);function _(e){let{icon:t,title:s,description:a,footer:l,onClick:n,isSelected:r,disabled:i,children:o}=e;return(0,d.jsxs)("div",{className:`card-container ${r?"card-selected":""} ${i?"card-unavailable":""}`,onClick:i?void 0:n,style:{cursor:i?"not-allowed":n?"pointer":"default"},children:[t&&(0,d.jsx)("div",{className:"card-icon-label",children:(0,d.jsx)(w.Z,{icon:t,size:18})}),(0,d.jsx)("h4",{children:s}),a&&(0,d.jsx)("div",{className:"card-description",children:a}),o,l&&(0,d.jsx)("div",{className:"card-footer",children:l})]})}const k=e=>{let{apiUrl:t,certificationTrackId:s,onSelectPhase:r}=e;const{t:i}=(0,l.$G)(),[o,c]=(0,a.useState)(null);if((0,a.useEffect)((()=>{(async()=>{try{const e=localStorage.getItem("token"),a=await n.Z.get(`${t}/certifications/track/${s}/user-progress`,{headers:{Authorization:`Bearer ${e}`}});c(a.data)}catch(e){console.error("Dashboard error:",e)}})()}),[t,s]),!o)return(0,d.jsx)("p",{children:"Loading dashboard..."});const u={};o.steps.forEach((e=>{u[e.phaseKey]||(u[e.phaseKey]=[]),u[e.phaseKey].push(e)}));const p=o.phases.sort(((e,t)=>e.order-t.order)).map((e=>{const t=u[e.phaseKey]||[],s=t.length>0&&t.every((e=>e.isCompleted)),a=!t.some((e=>e.canEnter));let l,n;return s?(l=(0,d.jsx)(w.Z,{icon:"check",size:20,color:"#209385"}),n=i("completed")):a?(l=(0,d.jsx)(w.Z,{icon:"lock",size:20,color:"#209385"}),n=i("locked")):(l=(0,d.jsx)(w.Z,{icon:"lockOpen",size:20,color:"#209385"}),n=i("available")),{title:e.label,description:(0,d.jsxs)("div",{children:[e.descriptionKey&&(0,d.jsx)("p",{style:{marginBottom:8},children:i(e.descriptionKey)}),(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[l,(0,d.jsx)("span",{children:n})]})]}),disabled:a,onClick:a?void 0:()=>r(e.phaseKey)}}));return o.certificateAvailable&&p.push({title:i("certification_report"),description:(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,d.jsx)(w.Z,{icon:"trophy",size:20,color:"#209385"}),(0,d.jsx)("span",{children:i("view_certificate")})]}),disabled:!1,onClick:()=>r("certificate")}),(0,d.jsxs)("div",{className:"app-module",children:[(0,d.jsx)("h2",{children:i("certification_dashboard")}),(0,d.jsx)(S,{items:p,CardComponent:_})]})};const C=function(e){let{apiUrl:t,onSubmit:s}=e;const{t:r}=(0,l.$G)(),[c,u]=(0,a.useState)(null);(0,a.useEffect)((()=>{(async()=>{try{const e=await n.Z.get(`${t}/voice-collections/6821a9acf459819632e09ed0`);u(e.data.data)}catch(e){console.error(e)}})()}),[t]);const[p,h]=(0,a.useState)(null),[v,m]=(0,a.useState)(null),[b,f]=(0,a.useState)(null),[x,j]=(0,a.useState)(""),g=null!==p&&null!==v&&null!==b;return(0,d.jsxs)("form",{className:"app-module",onSubmit:e=>{e.preventDefault(),s({overallSeverity:p,roughness:v,breathiness:b,overallImpressionComment:x})},children:[(0,d.jsxs)("div",{className:"capevr-scale-container",children:[(0,d.jsx)("span",{className:"capevr-scale-label capevr-scale-left",children:r("normal")}),(0,d.jsx)("span",{className:"capevr-scale-label capevr-scale-right",children:r("extreme")})]}),(0,d.jsx)("br",{}),(0,d.jsx)(i.Z,{label:r("overall_severity"),VASValue:p,setVASValue:h,index:0}),(0,d.jsx)(i.Z,{label:r("roughness"),VASValue:v,setVASValue:m,index:1}),(0,d.jsx)(i.Z,{label:r("breathiness"),VASValue:b,setVASValue:f,index:2}),(0,d.jsx)("br",{}),(0,d.jsx)(o.Z,{overallImpressionComment:x,setOverallImpressionComment:j}),!g&&(0,d.jsxs)("div",{className:"warning-message",children:[(0,d.jsx)(w.Z,{icon:"alert",size:16,color:"#209385"}),(0,d.jsx)("span",{children:r("please_complete_all_scales")})]}),(0,d.jsx)("div",{style:{textAlign:"center",marginTop:"1em"},children:(0,d.jsx)("button",{type:"submit",className:"app-btn app-btn-primary",disabled:!g,children:r("view_feedback")})}),c&&(0,d.jsx)(y.Z,{voiceCollection:c})]})},N=e=>{let{attributeName:t,userValues:s=[],sharedValues:n=[]}=e;const{t:r}=(0,l.$G)(),i=(0,a.useRef)(null),[o,c]=(0,a.useState)(800);(0,a.useEffect)((()=>{var e;const t=new ResizeObserver((e=>{var t,s;null!==(t=e[0])&&void 0!==t&&null!==(s=t.contentRect)&&void 0!==s&&s.width&&c(e[0].contentRect.width)}));return null!==(e=i.current)&&void 0!==e&&e.parentElement&&t.observe(i.current.parentElement),()=>t.disconnect()}),[]);const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return(Math.random()-.5)*e};return(0,a.useEffect)((()=>
1{if(!i.current)return;const e=40,a=40,l=40,c=o-e-120,d=p.Ys(i.current);d.selectAll("*").remove(),d.attr("viewBox",`0 0 ${o} ${70+a+l}`).attr("preserveAspectRatio","xMidYMid meet").style("overflow","visible");const v=d.append("g").attr("transform",`translate(${e},${a})`),m=p.BYU().domain([0,100]).range([0,c]),b=h.z[t]?r(h.z[t]):t;d.append("text").attr("x",e).attr("y",a/2).text(b).style("font-size","14px").style("font-weight","bold").style("fill","#333"),v.append("g").attr("transform","translate(0,70)").call(p.LLu(m).ticks(5).tickFormat((e=>`${e}`))).selectAll("text").style("font-size","12px").style("fill","#333"),s.forEach((e=>{let{value:t}=e;"number"===typeof t&&v.append("circle").attr("cx",m(t)).attr("cy",60+u(10)).attr("r",5).style("fill","red").style("stroke","#fff").style("stroke-width",1.5)})),n.forEach((e=>{let{value:t}=e;"number"===typeof t&&v.append("circle").attr("cx",m(t)).attr("cy",60+u(10)).attr("r",5).style("fill","#209385").style("stroke","#fff").style("stroke-width",1)}));const f=d.append("g").attr("transform",`translate(${o-250}, 10)`),x=[{color:"red",fill:"red",label:r("your_evaluation")},{color:"#209385",fill:"#209385",label:r("reference_ratings")}];f.selectAll("circle").data(x).enter().append("circle").attr("cx",6).attr("cy",((e,t)=>20*t+6)).attr("r",5).style("fill",(e=>e.fill)).style("stroke",(e=>e.color)).style("stroke-width",2),f.selectAll("text").data(x).enter().append("text").attr("x",20).attr("y",((e,t)=>20*t+10)).text((e=>e.label)).style("font-size","12px")}),[t,s,n,o,r]),(0,d.jsx)("div",{style:{width:"100%",overflowX:"auto"},children:(0,d.jsx)("svg",{ref:i,width:"100%",height:"150px"})})},V=e=>{var t,s,a,n,r,i,o,c;let{attributeData:u,onNext:p,isLastSample:h}=e;const{t:v}=(0,l.$G)(),b=(null===u||void 0===u||null===(t=u.overallImpression)||void 0===t?void 0:t.user)||"-",f=(null===u||void 0===u||null===(s=u.overallImpression)||void 0===s?void 0:s.shared)||[],x=[{source:v("your_evaluation"),comment:b},...f.map(((e,t)=>({source:`${v("reference_rater")} ${t+1}`,comment:e})))];return(0,d.jsxs)("div",{className:"feedback-section",children:[(0,d.jsx)(N,{attributeName:"overallSeverity",userValues:(null===u||void 0===u||null===(a=u.overallSeverity)||void 0===a?void 0:a.userValues)||[],sharedValues:(null===u||void 0===u||null===(n=u.overallSeverity)||void 0===n?void 0:n.sharedValues)||[]}),(0,d.jsx)(N,{attributeName:"roughness",userValues:(null===u||void 0===u||null===(r=u.roughness)||void 0===r?void 0:r.userValues)||[],sharedValues:(null===u||void 0===u||null===(i=u.roughness)||void 0===i?void 0:i.sharedValues)||[]}),(0,d.jsx)(N,{attributeName:"breathiness",userValues:(null===u||void 0===u||null===(o=u.breathiness)||void 0===o?void 0:o.userValues)||[],sharedValues:(null===u||void 0===u||null===(c=u.breathiness)||void 0===c?void 0:c.sharedValues)||[]}),(0,d.jsx)(m.Z,{title:v("overall_impression"),data:x,columns:[{key:"source",label:v("source")},{key:"comment",label:v("comment")}]}),(0,d.jsx)("br",{}),(0,d.jsx)("div",{className:"app-btn-container",children:(0,d.jsx)("button",{className:"app-btn app-btn-primary",onClick:p,children:v(h?"finish_step":"next_sample")})})]})},$=e=>{let{apiUrl:t,certificationTrackId:s,phaseKey:r,onCompleted:i,onBack:o}=e;const{t:c}=(0,l.$G)(),[u,p]=(0,a.useState)([]),[h,v]=(0,a.useState)(0),[m,b]=(0,a.useState)(null),[x,j]=(0,a.useState)([]),[y,g]=(0,a.useState)([]),[S,_]=(0,a.useState)(0),[k,N]=(0,a.useState)([]),[$,I]=(0,a.useState)(!1),[A,E]=(0,a.useState)(null),[Z,D]=(0,a.useState)(null),[T,U]=(0,a.useState)(!0),[z,K]=(0,a.useState)(!1),L="training"===r,B=y[S],{sharedAssessments:R}=(0,f.u)(t,null===B||void 0===B?void 0:B._id);(0,a.useEffect)((()=>{(async()=>{try{const e=localStorage.getItem("token"),a=(await n.Z.get(`${t}/certifications/track/${s}/user-progress`,{headers:{Authorization:`Bearer ${e}`}})).data.steps.filter((e=>e.phaseKey===r)).sort(((e,t)=>e.order-t.order));p(a),v(0)}catch(e){console.error("Phase init error:",e)}})()}),[t,s,r]),(0,a.useEffect)((()=>{if(!u.length)return;const e=u[h];if(!e)return;(async()=>{try{U(!0);const a=localStorage.getItem("token"),l=await n.Z.get(`${t}/certifications/track/${s}/step/${e.stepKey}`,{headers:{Authorization:`Bearer ${a}`}});b(l.data.sessionId),j(l.data.voiceSampleIds),N([]),_(0),I(!1),E(null),D(null)}catch(a){console.error("Session init error:",a)}})()}),[u,h,t,s]),(0,a.useEffect)((()=>
1{if(!x.length)return;(async()=>{try{const e=(await n.Z.get(`${t}/voice-samples`,{params:{ids:x.join(",")}})).data.data||[],s=x.map((t=>e.find((e=>String(e._id)===String(t))))).filter(Boolean);g(s),U(!1)}catch(e){console.error("Error loading samples:",e),U(!1)}})()}),[t,x]),(0,a.useEffect)((()=>{if(!R||!$)return;const e=R.filter((e=>"quebecRater"===e.raterSource)),t={};["overallSeverity","roughness","breathiness"].forEach((s=>{t[s]={sharedValues:e.map((e=>{var t,a;return null===(t=e.perceptualData)||void 0===t||null===(a=t[s])||void 0===a?void 0:a.VASValue})).filter((e=>"number"===typeof e)).map((e=>({value:e}))),userValues:A?[{value:A[s]}]:[]}})),D(t)}),[R,$,A]);const M=async e=>{try{K(!0);const a=localStorage.getItem("token"),l=u[h];await n.Z.post(`${t}/certifications/submit`,{sessionId:m,certificationTrackId:s,stepKey:l.stepKey,ratings:e},{headers:{Authorization:`Bearer ${a}`}}),K(!1),h+1<u.length?v((e=>e+1)):null===i||void 0===i||i()}catch(a){console.error("Submit error:",a),K(!1)}};if(T)return(0,d.jsx)("p",{children:"Loading..."});if(!B)return(0,d.jsx)("p",{children:"No samples available."});const F=y.length,P=S+1,q=F>0?P/F*100:0,G=u[h],O=(null===G||void 0===G?void 0:G.label)||"",Y=null!==G&&void 0!==G&&G.instructionsKey?c(G.instructionsKey):"";return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{style:{marginBottom:25,textAlign:"center"},children:[(0,d.jsx)("h3",{style:{marginBottom:8},children:O}),Y&&(0,d.jsx)("p",{style:{fontSize:14,opacity:.8},children:Y})]}),(0,d.jsx)("div",{style:{marginBottom:20},children:(0,d.jsxs)("button",{className:"app-btn app-btn-secondary",onClick:()=>{const e=k.length>0||S>0||$;if(!L&&e){if(!window.confirm(c("confirm_leave_activity","Are you sure you want to leave? Your progress in this activity will be lost.")))return}null===o||void 0===o||o()},style:{display:"flex",alignItems:"center",gap:8},children:[(0,d.jsx)(w.Z,{icon:"arrow",size:18}),c("back_to_dashboard","Back to Dashboard")]})}),(0,d.jsxs)("div",{style:{marginBottom:20},children:[(0,d.jsxs)("p",{style:{marginBottom:5},children:[c("sample")," ",P," / ",F]}),(0,d.jsx)("progress",{value:q,max:"100",style:{width:"100%"}})]}),(0,d.jsx)("div",{style:{textAlign:"center"},children:(0,d.jsx)("audio",{controls:!0,src:`/${B.sampleLink}`})}),(0,d.jsx)("br",{}),$?(0,d.jsx)(V,{attributeData:Z,onNext:()=>{I(!1),E(null),D(null);S+1>=y.length?M(k):_((e=>e+1))},isLastSample:S+1>=y.length}):(0,d.jsx)(C,{onSubmit:e=>{const t=[{voiceSampleId:B._id,attribute:"overallSeverity",value:e.overallSeverity},{voiceSampleId:B._id,attribute:"roughness",value:e.roughness},{voiceSampleId:B._id,attribute:"breathiness",value:e.breathiness}];N((e=>[...e,...t])),E(e),I(!0)},sample:B,apiUrl:t}),z&&(0,d.jsx)("p",{style:{textAlign:"center"},children:c("submitting_results","Submitting results...")})]})},I=e=>{var t;let{apiUrl:s,certificationTrackId:l,onClose:n}=e;const[r,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(!0),[u,p]=(0,a.useState)(!1);(0,a.useEffect)((()=>{(async()=>{try{const e=localStorage.getItem("token"),t=await fetch(`${s}/certifications/track/${l}/progress-data`,{headers:{Authorization:`Bearer ${e}`}}),a=await t.json();i(a),c(!1)}catch(e){c(!1)}})()}),[s,l]);return o?(0,d.jsx)("p",{children:"Loading report..."}):r&&r.progression?(0,d.jsxs)("div",{className:"certification-preview",children:[(0,d.jsx)("h2",{children:"Certification Report Preview"}),(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Track:"})," ",r.trackName]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Threshold:"})," \xb1",r.thresholdSD," SD"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Minimum Required:"})," ",r.minimumPercentageToPass,"%"]}),(0,d.jsxs)("table",{children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{children:"Step"}),(0,d.jsx)("th",{children:"Score (%)"}),(0,d.jsx)("th",{children:"Outcome"})]})}),(0,d.jsx)("tbody",{children:r.progression.map((e=>{var t;return(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:e.label}),(0,d.jsx)("td",{children:null!==(t=e.scorePercentage)&&void 0!==t?t:"-"}),(0,d.jsx)("td",{children:null===e.passed?"-":e.passed?"PASS":"FAIL"})]},e.stepKey)}))})]}),(0,d.jsxs)("div",{style:{marginTop:20},children:[(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Final Score:"})," ",null!==(t=r.finalScore)&&void 0!==t?t:"-","%"]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Final Outcome:"})," ",r.finalPassed?"PASS":null===r.finalPassed?"-":"FAIL"]})]}),(0,d.jsxs)("div",{style:{marginTop:30},children:[(0,d.jsx)("button",{onClick:async()=>{try{p(!0);const e=localStorage.getItem("token"),t=await fetch(`${s}/certifications/track/${l}/progress-report`,{headers:{Authorization:`Bearer ${e}`}}),a=await t.blob(),n=window.URL.createObjectURL(a),r=document.createElement("a");r.href=n,r.download="All-Voiced-Certification.pdf",r.click(),p(!1)}catch(e){p(!1)}},disabled:u,children:u?"Generating...":"Download Official Certificate"}),(0,d.jsx)("button",{onClick:n,style:{marginLeft:10},children:"Close"})]})]}):(0,d.jsxs)("div",{style:{padding:20},children:[(0,d.jsx)("p",{children:"No certification data available yet."}),(0,d.jsx)("button",{onClick:n,children:"Close"})]})},A=()=>{const e="https://api.all-voiced.com/api",t="69a2e38fa1aecd8cb0b9f0bb",[s,l]=(0,a.useState)(null);return(0,d.jsxs)("div",{className:"app-module",children:[(0,d.jsx)("h1",{children:"StudiumFC \u2013 Universit\xe9 de Montr\xe9al"}),!s&&(0,d.jsx)(k,{apiUrl:e,certificationTrackId:t,onSelectPhase:l}),s&&"certificate"!==s&&(0,d.jsx)($,{apiUrl:e,certificationTrackId:t,phaseKey:s,onCompleted:()=>l(null),onBack:()=>l(null)}),"certificate"===s&&(0,d.jsx)(I,{apiUrl:e,certificationTrackId:t,onClose:()=>l(null)})]})};var E=s(7167);const Z=[{id:"quebec2025",name:"Quebec Innovation",accessComponent:"QuebecInnovation",requiresEthicsConsent:!0,ethicsTitleKey:"quebec_ethics_title",ethicsTextKey:"quebec_ethics_text"},{id:"studiumFCUMontreal",name:"StudiumFC \u2013 Universit\xe9 de Montr\xe9al",accessComponent:"StudiumFCUMontreal",requiresEthicsConsent:!0,ethicsTitleKey:"studiumfc_umontreal_ethics_title",ethicsTextKey:"studiumfc_umontreal_ethics_text"}];const D=function(){const{t:e}=(0,l.$G)(),[t,s]=(0,a.useState)(""),[n,r]=(0,a.useState)(null),[i,o]=(0,a.useState)(""),[c,u]=(0,a.useState)(!1),[p,h]=(0,a.useState)(!1),v={umontreal2025:"quebec2025",studium2026:"studiumFCUMontreal"};if(n&&p){const e={QuebecInnovation:g,StudiumFCUMontreal:A}[n.accessComponent];return(0,d.jsx)(e,{})}return(0,d.jsxs)("div",{className:"app-module",children:[(0,d.jsx)("h1",{children:e("academy_portal")||"Academy Portal"}),(0,d.jsx)("p",{className:"centered-text",children:e("enter_access_code")||"Please enter your access code to begin."}),(0,d.jsxs)("div",{className:"app-btn-container",children:[(0,d.jsx)("input",{type:"text",className:"app-input",placeholder:e("access_code")||"Access code",value:t,onChange:e=>s(e.target.value)}),(0,d.jsx)("button",{className:"app-btn app-btn-primary",onClick:()=>{const s=t.trim().toLowerCase(),a=v[s];if(!a)return void o(e("invalid_code_error")||"Codi incorrecte.");const l=Z.find((e=>e.id===a));l?(r(l),l.requiresEthicsConsent?u(!0):h(!0),o("")):o("Project not found.")},children:e("accept")||"Accept"})]}),i&&(0,d.jsx)("p",{style:{color:"red",textAlign:"center"},children:i}),(0,d.jsxs)(E.Z,{isOpen:c,onRequestClose:()=>u(!1),contentLabel:"Ethics Modal",className:"ReactModal__Content modal--app modal--500px",children:[(0,d.jsx)("h2",{children:null!==n&&void 0!==n&&n.ethicsTitleKey?e(n.ethicsTitleKey):e("ethics_title")}),(0,d.jsx)("p",{children:null!==n&&void 0!==n&&n.ethicsTextKey?e(n.ethicsTextKey):e("ethics_text")}),(0,d.jsx)("div",{className:"app-btn-container",children:(0,d.jsx)("button",{className:"app-btn app-btn-primary",onClick:()=>{u(!1),h(!0)},children:e("accept")||"I accept"})})]})]})}}}]);
2//# sourceMappingURL=4195.142258e0.chunk.js.map

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.