PageSourceSearch

https://takeitup.ai/chunk-PVR4KDJO.js

js takeitup.ai collected 2026-10-05 16:24:57 UTC 102,199 bytes, 1 lines download raw bytes

1import{a as me}from"./chunk-QOCM374V.js";import{a as Ft,b as je,c as Ht}from"./chunk-WDGCV4V6.js";import{a as Gt}from"./chunk-UXDI6WBC.js";import{a as ue}from"./chunk-MHCWVV4S.js";import{a as Me}from"./chunk-SBO6JOVN.js";import{a as Ae}from"./chunk-5UJ4VCAP.js";import{b as Bt}from"./chunk-KE5UNX33.js";import{a as Ut}from"./chunk-CFB6Y2TF.js";import{a as Lt}from"./chunk-D7IIYPSI.js";import{a as pt,c as ht,d as We,g as ve,h as ft}from"./chunk-JDYHCKCL.js";import{b as Ce}from"./chunk-6F7DL7DD.js";import"./chunk-I34N6U7W.js";import{a as mt,d as ge}from"./chunk-OA5647SH.js";import{a as we}from"./chunk-DVZO5V34.js";import{b as ce,d as ct,h as _e,i as Be,k as le,m as lt,o as Fe,p as He,q as be,r as ye,s as gt,t as ut}from"./chunk-IPHOQUAT.js";import"./chunk-NWU7FECX.js";import{a as _t,b as bt,e as yt,i as vt}from"./chunk-XUM5TRKM.js";import{a as wt}from"./chunk-C7AX4SKR.js";import{H as Pt,Hb as Vt,Ja as ee,Jb as Nt,Ob as ne,Pa as Et,Pb as oe,R as Rt,Ra as It,Wa as te,ab as Ot,b as Ct,db as Pe,ja as Se,la as Mt,oa as At,pb as Dt,sb as ie,u as St,v as kt,wa as ke,ya as Tt,zb as Re}from"./chunk-HFUAMYUL.js";import{b as xe,c as Z}from"./chunk-O6FHKKX6.js";import{a as xt}from"./chunk-JLRCENAR.js";import"./chunk-U6MR7ILR.js";import"./chunk-AL6BAHEL.js";import{F as dt}from"./chunk-MOSFGYNE.js";import{a as rt}from"./chunk-RNDEH3LZ.js";import{d as at,f as st}from"./chunk-KZ7O3UVX.js";import"./chunk-5KBJRCJV.js";import{Ab as P,Bb as R,Db as X,Dc as I,Eb as N,Fb as L,Gb as f,Gc as $,Hb as d,Hc as H,Ib as a,Jb as u,L as Ke,Ob as T,Qb as w,Sb as c,Wb as tt,Xb as Ue,Yb as Ge,_ as fe,_a as r,ac as J,bc as B,cc as U,da as S,dc as l,ec as E,fc as x,ga as Qe,gc as de,ha as Je,hb as Ze,hc as it,ia as y,ja as v,mb as Q,oa as j,qc as nt,rb as et,ua as h,vc as m,wa as z,wc as p,yb as se,zc as ot}from"./chunk-3SJGPUSV.js";import"./chunk-FL5ZKMHP.js";import"./chunk-DQ2W24MV.js";import"./chunk-LSIHGRHO.js";var Te=class{constructor(t,e,i){this.modelAudioUrl=t;this.snackbar=i;z(()=>{let o=this.modelAudioUrl();if(!o){this.disposeModelAudio();return}this.modelAudio?.src!==o&&(this.disposeModelAudio(),this.modelAudio=new Audio(o),this.modelAudio.onended=()=>{this.isPlaying.set(!1),this.modelProgress.set(0),this.isShadowing()&&this.stopShadowing()},this.modelAudio.ontimeupdate=()=>{if(this.modelAudio&&this.modelAudio.duration>0){let s=this.modelAudio.currentTime/this.modelAudio.duration*100;this.modelProgress.set(s)}})}),e.onDestroy(()=>{this.disposeModelAudio(),this.stopRecordingPlayback(),this.revokeRecordingUrl(),this.clearRecordingProgress(),this.isShadowing()&&this.stopShadowing()})}modelAudioUrl;snackbar;isPlaying=h(!1);modelProgress=h(0);isRecording=h(!1);hasRecording=h(!1);isPlayingRecording=h(!1);recordingProgress=h(0);isShadowing=h(!1);recordingCurrentTime=h("0:00");recordingVersion=h(0);mediaRecorder=null;audioChunks=[];audioUrl=null;savedAudio=null;modelAudio=null;recordingBlob=null;progressInterval=null;cancelled=!1;getRecordingBlob(){return this.recordingBlob}togglePlay(){if(this.modelAudio){if(this.isPlaying()){this.pauseModelAudio();return}this.isPlaying.set(!0),this.modelAudio.currentTime=0,this.modelAudio.play().catch(()=>{this.isPlaying.set(!1)})}}stopPlayer(){this.pauseModelAudio()}async toggleRecording(){this.isRecording()?await this.stopRecording():await this.startRecording()}async toggleShadowing(){this.isShadowing()?this.stopShadowingRecording():await this.startShadowingRecording()}async startShadowingRecording(){try{let t=await navigator.mediaDevices.getUserMedia({audio:!0});this.mediaRecorder=new MediaRecorder(t),this.audioChunks=[],this.mediaRecorder.ondataavailable=e=>{this.audioChunks.push(e.data)},this.mediaRecorder.onstop=()=>{if(this.cancelled){this.cancelled=!1,this.audioChunks=[];return}let e=new Blob(this.audioChunks,{type:"audio/webm"});this.recordingBlob=e,this.audioUrl&&URL.revokeObjectURL(this.audioUrl),this.audioUrl=URL.createObjectURL(e),this.savedAudio=new Audio(this.audioUrl),this.savedAudio.onended=()=>{this.isPlayingRecording.set(!1),this.recordingProgress.set(0),this.clearRecordingProgress()},this.hasRecording.set(!0),this.recordingVersion.update(i=>i+1)},this.mediaRecorder.start(),this.isRecording.set(!0),this.isShadowing.set(!0)}catch(t){throw this.isShadowing.set(!1),this.snackbar?.open(Ae(t),{variant:"error"}),t}}stopShadowingRecording(){this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEac
1h(t=>t.stop())),this.isRecording.set(!1),this.isShadowing.set(!1)}cancelRecording(){this.isRecording()&&(this.cancelled=!0,this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(t=>t.stop())),this.modelAudio&&(this.modelAudio.pause(),this.modelAudio.currentTime=0),this.isPlaying.set(!1),this.modelProgress.set(0),this.isRecording.set(!1),this.isShadowing.set(!1),this.audioChunks=[])}togglePlayRecording(){this.savedAudio&&(this.isPlayingRecording()?(this.savedAudio.pause(),this.isPlayingRecording.set(!1),this.clearRecordingProgress()):(this.savedAudio.currentTime=0,this.savedAudio.play().catch(()=>{}),this.isPlayingRecording.set(!0),this.startRecordingProgress()))}resetAfterResult(){this.pauseModelAudio(),this.isRecording.set(!1),this.stopRecordingPlayback()}async startRecording(){try{let t=await navigator.mediaDevices.getUserMedia({audio:!0});this.mediaRecorder=new MediaRecorder(t),this.audioChunks=[],this.mediaRecorder.ondataavailable=e=>{this.audioChunks.push(e.data)},this.mediaRecorder.onstop=()=>{if(this.cancelled){this.cancelled=!1,this.audioChunks=[];return}let e=new Blob(this.audioChunks,{type:"audio/webm"});this.recordingBlob=e,this.audioUrl&&URL.revokeObjectURL(this.audioUrl),this.audioUrl=URL.createObjectURL(e),this.savedAudio=new Audio(this.audioUrl),this.savedAudio.onended=()=>{this.isPlayingRecording.set(!1)},this.hasRecording.set(!0),this.recordingVersion.update(i=>i+1)},this.mediaRecorder.start(),this.isRecording.set(!0)}catch(t){this.snackbar?.open(Ae(t),{variant:"error"})}}async stopRecording(){this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(t=>t.stop()),this.isRecording.set(!1))}async startShadowing(){if(this.modelAudio){this.modelAudio.currentTime=0;try{await this.modelAudio.play()}catch{return}this.isPlaying.set(!0),this.isShadowing.set(!0);try{let t=await navigator.mediaDevices.getUserMedia({audio:!0});this.mediaRecorder=new MediaRecorder(t),this.audioChunks=[],this.mediaRecorder.ondataavailable=e=>{this.audioChunks.push(e.data)},this.mediaRecorder.onstop=()=>{if(this.cancelled){this.cancelled=!1,this.audioChunks=[];return}let e=new Blob(this.audioChunks,{type:"audio/webm"});this.recordingBlob=e,this.audioUrl&&URL.revokeObjectURL(this.audioUrl),this.audioUrl=URL.createObjectURL(e),this.savedAudio=new Audio(this.audioUrl),this.savedAudio.onended=()=>{this.isPlayingRecording.set(!1),this.recordingProgress.set(0),this.clearRecordingProgress()},this.hasRecording.set(!0),this.recordingVersion.update(i=>i+1)},this.mediaRecorder.start(),this.isRecording.set(!0)}catch(t){this.stopShadowing(),this.snackbar?.open(Ae(t),{variant:"error"})}}}stopShadowing(){this.modelAudio&&(this.modelAudio.pause(),this.modelAudio.currentTime=0),this.isPlaying.set(!1),this.modelProgress.set(0),this.mediaRecorder&&this.mediaRecorder.state!=="inactive"&&(this.mediaRecorder.stop(),this.mediaRecorder.stream.getTracks().forEach(t=>t.stop())),this.isRecording.set(!1),this.isShadowing.set(!1)}startRecordingProgress(){this.clearRecordingProgress(),this.progressInterval=setInterval(()=>{if(this.savedAudio&&this.savedAudio.duration>0){let t=this.savedAudio.currentTime/this.savedAudio.duration*100;this.recordingProgress.set(t),this.recordingCurrentTime.set(this.formatTime(this.savedAudio.currentTime))}},50)}formatTime(t){if(!t||isNaN(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60);return`${e}:${i.toString().padStart(2,"0")}`}clearRecordingProgress(){this.progressInterval&&(clearInterval(this.progressInterval),this.progressInterval=null)}pauseModelAudio(){this.modelAudio&&(this.modelAudio.pause(),this.modelAudio.currentTime=0),this.isPlaying.set(!1)}disposeModelAudio(){this.modelAudio&&(this.modelAudio.pause(),this.modelAudio.src="",this.modelAudio=null),this.isPlaying.set(!1)}stopRecordingPlayback(){this.savedAudio&&(this.savedAudio.pause(),this.savedAudio.currentTime=0),this.isPlayingRecording.set(!1)}revokeRecordingUrl(){this.audioUrl&&(URL.revokeObjectURL(this.audioUrl),this.audioUrl=null),this.savedAudio=null,this.recordingBlob=null}};var ni=(n,t)=>t.id;function oi(n,t){n&1&&(d(0,"span",9),u(1,"span",31),l(2),m(3,"translate"),a()),n&2&&(r(2),x(" ",p(3,1,"REC")," "))}function ri(n,t){n&1&&(u(0,"span",32),d(1,"span"),l(2),m(3,"translate"),a()),n&2&&(r(2),E(p(3,1,"STOP")))}function ai(n,t){if(n&1&&(u(0,"lucide-icon",33),d(1,"span"),l(2),m(3,"translate"),a()),n&2){let e=c();f("img",e.icons.Play),r(2),E(p(3,2,"SHADOWING_START_SHADOWING"))}}function si(n,t){n&1&&(d(0,"span",9),u(1,"span",31),l(2),m(3,"translate"),a()),n&2&&(r(2),x(" ",p(3,1,"REC")," "))}function di(n,t){n&1&&(u(0,"span",32),d(1,"span"),l(2),m(3,"translate"),a()),n&2&&(r(2),E(p(3,1,"STOP")))}function ci(n,t){if(n&1&&(u(0,"lucide-icon",34),d(1,"span"),l(2),m(3,"translate"),a()),n&2){let e=c();f("img",e.icons.Mic),r(2),E(p(3,2,"SHADOWING_START_SOLO"))}}function li(n,t){if(n&1){let e=T();d(0,"button",35),m(1,"translate"),w("click",function(){y(e);let o=c();return v(o.cancelRecording())}),l(2),m(3,"translate"),a()}n&2&&(se("aria-label",p(1,2,"DISCARD_RECORDING")),r(2),x(" ",p(3,4,"DISCARD")," "))}function gi(n,t){if(n&1&&u(0,"lucide-icon",52),n&2){let e=c(3);f("img",e.icons.RotateCcw)}}function ui(n,t){if(n&1&&u(0,"lucide-icon",53),n&2){let e=c(3);f("img",e.icons.Trash2)}}function mi(n,t){if(n&1&&(d(0,"span",55),u(1,"lucide-icon",59),l(2),m(3,"translate"),a()),n&2){let e=c(3);r(),f("img",e.icons.Loader2),r(),x(" ",p(3,2,"ANALYZING")," ")}}function pi(n,t){if(n&1&&(d(0,"span",64),l(1),m(2,"translate"),a()),n&2){let e=c(2).$implicit,i=c(2);r(),de(" ",i.scoreLabel(e.metrics==null?null:e.metrics.estimatedWpm)," ",p(2,2,"WPM")," ")}}function hi(n,t){if(n&1){let e=T();d(0,"button",60),w("click",function(){y(e);let o=c().$implicit,s=c(2);return v(s.toggleSavedRecordingDetails(o.id))}
1),d(1,"span",61)(2,"span",62),l(3),m(4,"translate"),a(),d(5,"span",63),l(6),a()(),P(7,pi,3,4,"span",64),d(8,"span",65),l(9),m(10,"translate"),u(11,"lucide-icon",66),a()()}if(n&2){let e=c().$implicit,i=c(2);se("aria-expanded",i.expandedSavedRecordingId()===e.id),r(3),x(" ",p(4,10,"OVERALL")," "),r(2),U(i.scoreToneClass(e.deepVoiceAnalysis.scores.pronScore)),r(),x(" ",i.scoreLabel(e.deepVoiceAnalysis.scores.pronScore)," "),r(),R(e.metrics!=null&&e.metrics.estimatedWpm?7:-1),r(2),x(" ",p(10,12,"VIEW_DETAILS")," "),r(2),B("rotate-180",i.expandedSavedRecordingId()===e.id),f("img",i.icons.ChevronDown)}}function fi(n,t){if(n&1){let e=T();d(0,"button",67),w("click",function(){y(e);let o=c().$implicit,s=c(2);return v(s.requestAnalysis(o))}),u(1,"lucide-icon",53),l(2),m(3,"translate"),d(4,"span",68),l(5),m(6,"translate"),a()()}if(n&2){let e=c(3);f("disabled",e.analyzingRecordingId()!==null),r(),f("img",e.icons.Sparkles),r(),x(" ",p(3,4,"VOICE_ANALYSIS")," "),r(3),E(p(6,6,"BETA"))}}function xi(n,t){if(n&1&&(d(0,"li",74)(1,"span",77),l(2,"\u2022"),a(),l(3),a()),n&2){let e=t.$implicit;r(3),x("",e," ")}}function _i(n,t){if(n&1&&(d(0,"li",74)(1,"span",78),l(2,"\u2022"),a(),l(3),a()),n&2){let e=t.$implicit;r(3),x("",e," ")}}function bi(n,t){if(n&1&&(d(0,"div",69)(1,"div",71)(2,"p",72),l(3),m(4,"translate"),a(),d(5,"ul",73),N(6,xi,4,1,"li",74,X),a()(),d(8,"div",75)(9,"p",76),l(10),m(11,"translate"),a(),d(12,"ul",73),N(13,_i,4,1,"li",74,X),a()()()),n&2){let e=c(2).$implicit;r(3),x(" ",p(4,2,"WHAT_WENT_WELL")," "),r(3),L(e.feedback.strengths),r(4),x(" ",p(11,4,"TO_IMPROVE")," "),r(3),L(e.feedback.improvements)}}function yi(n,t){if(n&1&&(d(0,"div",58),P(1,bi,15,6,"div",69),u(2,"deep-voice-result",70),a()),n&2){let e=c().$implicit;r(),R(e.feedback?1:-1),r(),f("analysis",e.deepVoiceAnalysis)}}function vi(n,t){if(n&1){let e=T();d(0,"div",41)(1,"div",42)(2,"button",43),w("click",function(o){let s=y(e).$implicit;return c(2).toggleSavedRecording(s),v(o.stopPropagation())}),u(3,"lucide-icon",34),a(),d(4,"div",44)(5,"button",45),w("click",function(o){let s=y(e).$implicit,g=c(2);return v(g.seekSavedRecording(o,s))}),d(6,"span",46),u(7,"span",47)(8,"span",48),a()()(),d(9,"span",49),l(10),a(),d(11,"span",50),l(12),a(),d(13,"button",51),w("click",function(o){let s=y(e).$implicit,g=c(2);return v(g.deleteRecording.emit({id:s.id,event:o}))}),P(14,gi,1,1,"lucide-icon",52)(15,ui,1,1,"lucide-icon",53),a()(),d(16,"div",54),P(17,mi,4,4,"span",55)(18,hi,12,14,"button",56)(19,fi,7,8,"button",57),a(),P(20,yi,3,2,"div",58),a()}if(n&2){let e=t.$implicit,i=c(2);r(3),f("img",i.playingSavedRecordingId()===e.id?i.icons.Square:i.icons.Play),r(4),J("width",i.savedRecordingProgressWidth(e),"%"),r(),J("left",i.savedRecordingProgressWidth(e),"%"),r(2),de(" ",i.savedRecordingCurrentTime(e)," / ",i.formatRecordingDuration(e.durationSec)," "),r(2),x(" ",i.formatRecordingDate(e.createdAt)," "),r(),f("disabled",i.deletingRecordingId()===e.id),r(),R(i.deletingRecordingId()===e.id?14:15),r(3),R(i.analyzingRecordingId()===e.id?17:e.deepVoiceAnalysis?18:19),r(3),R(i.expandedSavedRecordingId()===e.id&&e.deepVoiceAnalysis?20:-1)}}function wi(n,t){if(n&1&&(d(0,"div",29)(1,"div",36)(2,"div")(3,"p",37),l(4),m(5,"translate"),a(),d(6,"p",38),l(7),m(8,"translate"),a()(),d(9,"span",39),l(10),a()(),d(11,"div",40),N(12,vi,21,12,"div",41,ni),a()()),n&2){let e=c();r(4),x(" ",p(5,3,"SAVED_RECORDINGS")," "),r(3),x(" ",p(8,5,"SAVED_RECORDINGS_DESC")," "),r(3),x(" ",e.savedRecordings().length,"/5 "),r(2),L(e.savedRecordings())}}function Ci(n,t){if(n&1&&(d(0,"div",30)(1,"div",79),u(2,"lucide-icon",80),a(),d(3,"p",81),l(4),m(5,"translate"),a(),d(6,"p",82),l(7),m(8,"translate"),a()()),n&2){let e=c();r(2),f("img",e.icons.Info),r(2),x(" ",p(5,3,"SHADOWING_NO_RECORDINGS_YET")," "),r(3),x(" ",p(8,5,"SHADOWING_NO_RECORDINGS_DESC")," ")}}var Ee=class n{icons={Mic:ee,Play:te,Square:ie,RotateCcw:Pe,Headphones:Se,Info:At,Trash2:Re,Sparkles:Dt,Loader2:ke,ChevronDown:St};destroyRef=S(j);snackbar=S(we);text=H.required();modelAudioUrl=H(null);isModelPlaying=H(!1);savedRecordings=H([]);analyzingRecordingId=H(null);deletingRecordingId=H(null);audio=new Te(this.modelAudioUrl,this.destroyRef,this.snackbar);edit=$();requestVoiceAnalysis=$();recordingCompleted=$();deleteRecording=$();shadowToggled=$();isRecording=this.audio.isRecording;isShadowing=this.audio.isShadowing;recordingVersion=this.audio.recordingVersion;expandedSavedRecordingId=h(null);savedRecordingAudio=null;playingSavedRecordingId=h(null);loadedSavedRecordingId=h(null);savedRecordingCurrentTimeSec=h(0);savedRecordingProgress=h(0);previousAnalyzingId=null;constructor(){this.destroyRef.onDestroy(()=>this.stopSavedRecording()),z(()=>{!this.isModelPlaying()&&this.isShadowing()&&this.audio.stopShadowingRecording()}),z(()=>{if(this.recordingVersion()===0)return;let e=this.audio.getRecordingBlob();e&&this.recordingCompleted.emit(e)}),z(()=>{let t=this.analyzingRecordingId();this.previousAnalyzingId&&!t&&this.expandedSavedRecordingId.set(this.previousAnalyzingId),this.previousAnalyzingId=t})}async toggleRecording(){await this.audio.toggleRecording()}cancelRecording(){this.audio.cancelRecording()}async toggleShadowing(){this.isShadowing()?(this.audio.stopShadowingRecording(),this.shadowToggled.emit()):(this.shadowToggled.emit(),await this.audio.startShadowingRecording())}
1requestAnalysis(t){this.requestVoiceAnalysis.emit(t)}toggleSavedRecording(t){if(t.audioUrl){if(this.playingSavedRecordingId()===t.id){this.pauseSavedRecording();return}this.loadSavedRecording(t),this.savedRecordingAudio?.play().then(()=>this.playingSavedRecordingId.set(t.id)).catch(()=>this.playingSavedRecordingId.set(null))}}stopSavedRecording(){this.savedRecordingAudio?.pause(),this.savedRecordingAudio=null,this.playingSavedRecordingId.set(null),this.loadedSavedRecordingId.set(null),this.savedRecordingCurrentTimeSec.set(0),this.savedRecordingProgress.set(0)}pauseSavedRecording(){this.savedRecordingAudio?.pause(),this.playingSavedRecordingId.set(null)}seekSavedRecording(t,e){if(t.stopPropagation(),!e.audioUrl)return;this.loadSavedRecording(e);let i=t.currentTarget.getBoundingClientRect(),o=Math.min(1,Math.max(0,(t.clientX-i.left)/i.width)),g=(this.savedRecordingAudio?.duration||e.durationSec||0)*o;this.savedRecordingAudio&&(this.savedRecordingAudio.currentTime=g),this.savedRecordingCurrentTimeSec.set(g),this.savedRecordingProgress.set(o*100)}loadSavedRecording(t){let e=t.audioUrl;if(!e||this.loadedSavedRecordingId()===t.id&&this.savedRecordingAudio)return;this.stopSavedRecording();let i=new Audio(e);this.savedRecordingAudio=i,this.loadedSavedRecordingId.set(t.id),i.ontimeupdate=()=>{let o=i.duration||t.durationSec||0;this.savedRecordingCurrentTimeSec.set(i.currentTime),this.savedRecordingProgress.set(o>0?i.currentTime/o*100:0)},i.onloadedmetadata=()=>{let o=i.duration||t.durationSec||0;this.savedRecordingProgress.set(o>0?i.currentTime/o*100:0)},i.onended=()=>{this.playingSavedRecordingId.set(null),this.savedRecordingCurrentTimeSec.set(0),this.savedRecordingProgress.set(0),i.currentTime=0}}toggleSavedRecordingDetails(t){this.expandedSavedRecordingId.update(e=>e===t?null:t)}formatRecordingDuration(t){let e=Math.max(0,Math.round(t)),i=Math.floor(e/60),o=e%60;return`${i}:${o.toString().padStart(2,"0")}`}savedRecordingCurrentTime(t){return this.loadedSavedRecordingId()!==t.id?"0:00":this.formatRecordingDuration(this.savedRecordingCurrentTimeSec())}savedRecordingProgressWidth(t){return this.loadedSavedRecordingId()===t.id?this.savedRecordingProgress():0}formatRecordingDate(t){return t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}scoreLabel(t){return typeof t=="number"&&Number.isFinite(t)?Math.round(t).toString():"\u2014"}scoreToneClass(t){return typeof t!="number"||!Number.isFinite(t)?"text-text-secondary":t>=85?"text-emerald-600 dark:text-emerald-400":t>=70?"text-amber-600 dark:text-amber-400":"text-red-600 dark:text-red-400"}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Q({type:n,selectors:[["practice-card"]],hostAttrs:[1,"block","w-full"],inputs:{text:[1,"text"],modelAudioUrl:[1,"modelAudioUrl"],isModelPlaying:[1,"isModelPlaying"],savedRecordings:[1,"savedRecordings"],analyzingRecordingId:[1,"analyzingRecordingId"],deletingRecordingId:[1,"deletingRecordingId"]},outputs:{edit:"edit",requestVoiceAnalysis:"requestVoiceAnalysis",recordingCompleted:"recordingCompleted",deleteRecording:"deleteRecording",shadowToggled:"shadowToggled"},decls:57,vars:46,consts:[[1,"w-full"],[1,"flex","flex-col","gap-3"],[1,"grid","grid-cols-1","gap-5","md:grid-cols-2"],[1,"group","relative","flex","flex-col","justify-between","overflow-hidden","rounded-[24px]","border-2","border-primary/20","bg-gradient-to-br","from-card","via-card","to-primary/[0.03]","p-5","transition-all","duration-300","hover:shadow-lg","hover:shadow-primary/[0.02]","dark:border-primary/30"],[1,"pointer-events-none","absolute","-bottom-6","-right-6","h-36","w-36","rotate-12","text-primary/[0.03]","transition-transform","duration-500","group-hover:rotate-6","group-hover:scale-105","dark:text-primary/[0.02]",3,"img"],[1,"relative","z-10","flex","flex-1","flex-col"],[1,"mb-3","flex","items-center","justify-between","gap-3"],[1,"dark:text-primary-light","inline-flex","items-center","gap-1","rounded-full","bg-primary/10","px-2.5","py-1","text-[11px]","font-bold","text-primary","shadow-sm","shadow-primary/5","dark:bg-primary/20"],[1,"h-3","w-3","animate-pulse","text-primary",3,"img"],[1,"inline-flex","items-center","gap-1.5","rounded-full","bg-red-50","px-2.5","py-1","text-[11px]","font-bold","text-red-600","dark:bg-red-500/10","dark:text-red-300"],[1,"flex","items-center","gap-2","text-base","font-bold","tracking-tight","text-text-primary"],[1,"h-4.5","w-4.5","text-primary",3,"img"],[1,"mt-2","flex-grow","text-[13px]","leading-relaxed","text-text-muted"],[1,"group/btn","relative","mt-5","flex","justify-center"],[1,"pointer-events-none","absolute","bottom-full","left-1/2","z-30","mb-3","flex","w-72","origin-bottom","-translate-x-1/2","scale-95","flex-col","items-center","opacity-0","transition-all","duration-200","group-hover/btn:scale-100","group-hover/btn:opacity-100"],[1,"rounded-2xl","border","border-amber-500/20","bg-amber-50/95","p-3.5","text-xs","text-amber-800","shadow-xl","shadow-amber-500/10","backdrop-blur-sm","dar
1k:bg-amber-950/95","dark:text-amber-200"],[1,"flex","items-start","gap-2.5"],[1,"mt-0.5","h-4","w-4","flex-shrink-0","text-amber-600","dark:text-amber-400",3,"img"],[1,"space-y-0.5","text-left"],[1,"block","font-bold","text-amber-900","dark:text-amber-100"],[1,"block","text-[11px]","font-medium","leading-normal","text-amber-800/90","opacity-90","dark:text-amber-300/90"],[1,"-mt-1","h-2","w-2","rotate-45","border-b","border-r","border-amber-500/20","bg-amber-50","shadow-sm","dark:bg-amber-950/95"],[1,"inline-flex","h-11","items-center","justify-center","gap-2","rounded-full","px-6","text-sm","font-bold","transition-all","duration-200","active:scale-[0.98]","disabled:pointer-events-none","disabled:opacity-40",3,"click","disabled"],[1,"group","relative","flex","flex-col","justify-between","overflow-hidden","rounded-[24px]","border","border-border/80","bg-card/95","p-5","transition-all","duration-300","hover:shadow-lg","hover:shadow-black/[0.01]"],[1,"pointer-events-none","absolute","-bottom-6","-right-6","h-36","w-36","rotate-12","text-rose-500/[0.02]","transition-transform","duration-500","group-hover:-rotate-6","group-hover:scale-105","dark:text-rose-400/[0.01]",3,"img"],[1,"inline-flex","items-center","gap-1","rounded-full","bg-gray-100","px-2.5","py-1","text-[11px]","font-bold","text-text-secondary","dark:bg-white/5"],[1,"h-4.5","w-4.5","text-rose-500","dark:text-rose-400",3,"img"],[1,"mt-5","flex","items-center","justify-center","gap-2"],["type","button",1,"hover:border-border-strong","inline-flex","h-11","items-center","justify-center","gap-2","rounded-full","border","border-border","bg-card","px-4","text-sm","font-semibold","text-text-secondary","transition-all","duration-200","hover:text-text-primary","active:scale-[0.98]"],[1,"rounded-[24px]","border","border-border/80","bg-card/95","p-4","sm:p-5"],[1,"rounded-[24px]","border","border-dashed","border-border","bg-card/50","p-6","text-center"],[1,"h-1.5","w-1.5","animate-pulse","rounded-full","bg-red-500"],[1,"h-3.5","w-3.5","animate-pulse","rounded-sm","bg-white"],[1,"h-4","w-4","fill-current",3,"img"],[1,"h-4","w-4",3,"img"],["type","button",1,"hover:border-border-strong","inline-flex","h-11","items-center","justify-center","gap-2","rounded-full","border","border-border","bg-card","px-4","text-sm","font-semibold","text-text-secondary","transition-all","duration-200","hover:text-text-primary","active:scale-[0.98]",3,"click"],[1,"flex","items-start","justify-between","gap-4"],[1,"text-base","font-bold","tracking-[-0.01em]","text-text-primary"],[1,"mt-1","text-sm","font-medium","leading-relaxed","text-text-muted"],[1,"inline-flex","flex-shrink-0","rounded-full","bg-gray-100","px-2.5","py-1","text-xs","font-bold","text-text-secondary","dark:bg-white/5"],[1,"mt-4","divide-y","divide-border/60","border-t","border-border/60"],[1,"py-4","first:pt-4","last:pb-0"],[1,"flex","items-center","gap-3"],["aria-label","Play recording",1,"flex","h-10","w-10","flex-shrink-0","items-center","justify-center","rounded-full","bg-primary/10","text-primary","transition-colors","hover:bg-primary","hover:text-white",3,"click"],[1,"min-w-0","flex-1"],["type","button","aria-label","Seek recording",1,"group/seek","flex","h-6","w-full","items-center",3,"click"],[1,"relative","block","h-1","w-full","overflow-visible","rounded-full","bg-gray-100","transition-all","group-hover/seek:h-2","dark:bg-white/10"],[1,"absolute","left-0","top-0","h-full","rounded-full","bg-primary","transition-[width]"],[1,"absolute","top-1/2","h-3.5","w-3.5","-translate-x-1/2","-translate-y-1/2","rounded-full","border-2","border-white","bg-primary","opacity-0","shadow-sm","transition-opacity","group-hover/seek:opacity-100"],[1,"flex-shrink-0","text-xs","tabular-nums","text-text-secondary"],[1,"hidden","flex-shrink-0","text-xs","text-text-muted","sm:inline"],["aria-label","Delete recording",1,"flex","h-8","w-8","flex-shrink-0","items-center","justify-center","rounded-full","text-text-secondary","transition-colors","hover:bg-red-50","hover:text-red-600","disabled:opacity-50","dark:hover:bg-red-500/10",3,"click","disabled"],[1,"h-3.5","w-3.5","animate-spin",3,"img"],[1,"h-3.5","w-3.5",3,"img"],[1,"mt-3","pl-[52px]"],[1,"inline-flex","items-center","gap-2","text-sm","font-medium","text-text-secondary"],["type","button",1,"group/sum","
1inline-flex","items-center","gap-2.5","rounded-full","py-1","pl-1","pr-3","text-sm","transition-colors","hover:bg-gray-50","dark:hover:bg-white/5"],["type","button",1,"inline-flex","items-center","gap-2","rounded-full","bg-primary/10","px-3.5","py-2","text-xs","font-semibold","text-primary","transition-all","hover:bg-primary/20","active:scale-[0.98]","disabled:pointer-events-none","disabled:opacity-40","dark:bg-primary/20","dark:hover:bg-primary/30",3,"disabled"],[1,"mt-4","space-y-3"],[1,"h-4","w-4","animate-spin","text-primary",3,"img"],["type","button",1,"group/sum","inline-flex","items-center","gap-2.5","rounded-full","py-1","pl-1","pr-3","text-sm","transition-colors","hover:bg-gray-50","dark:hover:bg-white/5",3,"click"],[1,"inline-flex","h-7","items-center","gap-1.5","rounded-full","bg-gray-100","px-2.5","dark:bg-white/[0.06]"],[1,"text-[10px]","font-bold","uppercase","tracking-wide","text-text-secondary/60"],[1,"text-sm","font-black"],[1,"text-xs","font-medium","text-text-secondary/70"],[1,"flex","items-center","gap-1","text-xs","font-semibold","text-primary"],[1,"h-3.5","w-3.5","transition-transform",3,"img"],["type","button",1,"inline-flex","items-center","gap-2","rounded-full","bg-primary/10","px-3.5","py-2","text-xs","font-semibold","text-primary","transition-all","hover:bg-primary/20","active:scale-[0.98]","disabled:pointer-events-none","disabled:opacity-40","dark:bg-primary/20","dark:hover:bg-primary/30",3,"click","disabled"],[1,"rounded-full","bg-amber-100","px-1.5","py-0.5","text-[8px]","font-bold","uppercase","leading-none","text-amber-700","dark:bg-amber-500/20","dark:text-amber-300"],[1,"grid","gap-2","sm:grid-cols-2"],[3,"analysis"],[1,"rounded-xl","bg-emerald-50/70","p-3.5","dark:bg-emerald-500/10"],[1,"mb-1.5","text-xs","font-semibold","text-emerald-700","dark:text-emerald-400"],[1,"space-y-1","text-sm","text-text-primary"],[1,"flex","gap-1.5"],[1,"rounded-xl","bg-amber-50/70","p-3.5","dark:bg-amber-500/10"],[1,"mb-1.5","text-xs","font-semibold","text-amber-700","dark:text-amber-400"],[1,"text-emerald-500"],[1,"text-amber-500"],[1,"mx-auto","flex","h-10","w-10","items-center","justify-center","rounded-full","bg-primary/10","text-primary"],[1,"h-5","w-5",3,"img"],[1,"mt-3","text-sm","font-bold","text-text-primary"],[1,"mx-auto","mt-1.5","max-w-md","text-xs","leading-relaxed","text-text-muted"]],template:function(e,i){e&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),u(4,"lucide-icon",4),d(5,"div",5)(6,"div",6)(7,"span",7),u(8,"lucide-icon",8),l(9),m(10,"translate"),a(),P(11,oi,4,3,"span",9),a(),d(12,"h3",10),u(13,"lucide-icon",11),l(14),m(15,"translate"),a(),d(16,"p",12),l(17),m(18,"translate"),a()(),d(19,"div",13)(20,"div",14)(21,"div",15)(22,"div",16),u(23,"lucide-icon",17),d(24,"div",18)(25,"span",19),l(26),m(27,"translate"),a(),d(28,"span",20),l(29),m(30,"translate"),a()()()(),u(31,"div",21),a(),d(32,"button",22),w("click",function(){return i.toggleShadowing()}),P(33,ri,4,3)(34,ai,4,4),a()()(),d(35,"div",23),u(36,"lucide-icon",24),d(37,"div",5)(38,"div",6)(39,"span",25),l(40),m(41,"translate"),a(),P(42,si,4,3,"span",9),a(),d(43,"h3",10),u(44,"lucide-icon",26),l(45),m(46,"translate"),a(),d(47,"p",12),l(48),m(49,"translate"),a()(),d(50,"div",27)(51,"button",22),w("click",function(){return i.toggleRecording()}),P(52,di,4,3)(53,ci,4,4),a(),P(54,li,4,6,"button",28),a()()(),P(55,wi,14,7,"div",29)(56,Ci,9,7,"div",30),a()()),e&2&&(r(3),B("opacity-50",i.isRecording()&&!i.isShadowing()),r(),f("img",i.icons.Headphones),r(4),f("img",i.icons.Sparkles),r(),x(" ",p(10,30,"RECOMMENDED")," "),r(2),R(i.isShadowing()?11:-1),r(2),f("img",i.icons.Headphones),r(),x(" ",p(15,32,"SHADOWING_PRACTICE")," "),r(3),x(" ",p(18,34,"SHADOWING_SHADOW_SUBTITLE")," "),r(6),f("img",i.icons.Info),r(3),E(p(27,36,"SHADOWING_HEADPHONES_REQUIRED")),r(3),x(" ",p(30,38,"SHADOWING_HEADPHONES_REQUIRED_DESC")," "),r(3),U(i.isShadowing()?"border border-transparent bg-rose-600 text-white shadow-md shadow-rose-600/20 hover:bg-rose-700":"border border-transparent bg-primary text-white shadow-md shadow-primary/25 hover:bg-primary-hover"),f("disabled",!i.modelAudioUrl()||i.isRecording()&&!i.isShadowing()),r(),R(i.isShadowing()?33:34),r(2),B("opacity-50",i.isShadowing()),r(),f("img",i.icons.Mic),r(4),x(" ",p(41,40,"PRACTICE_MODE")," "),r(2),R(i.isRecording()&&!i.isShadowing()?42
1:-1),r(2),f("img",i.icons.Mic),r(),x(" ",p(46,42,"SHADOWING_SOLO_TITLE")," "),r(3),x(" ",p(49,44,"SHADOWING_SOLO_SUBTITLE")," "),r(3),U(i.isRecording()&&!i.isShadowing()?"border border-transparent bg-rose-600 text-white shadow-md shadow-rose-600/20 hover:bg-rose-700":"border border-border bg-card text-text-primary hover:border-rose-500/25 hover:bg-rose-500/5 hover:text-rose-600 dark:hover:border-rose-500/30 dark:hover:bg-rose-500/10 dark:hover:text-rose-400"),f("disabled",i.isShadowing()),r(),R(i.isRecording()&&!i.isShadowing()?52:53),r(2),R(i.isRecording()&&!i.isShadowing()?54:-1),r(),R(i.savedRecordings().length>0?55:56))},dependencies:[oe,ne,Ft,Z],encapsulation:2,changeDetection:0})};var Si=(n,t)=>t.id;function ki(n,t){if(n&1&&u(0,"lucide-icon",4),n&2){let e=c(2);f("img",e.icons.Loader2)}}function Pi(n,t){if(n&1&&u(0,"lucide-icon",5),n&2){let e=c(2);f("img",e.icons.Square)}}function Ri(n,t){if(n&1&&u(0,"lucide-icon",6),n&2){let e=c(2);f("img",e.icons.Play)}}function Mi(n,t){if(n&1&&u(0,"lucide-icon",10),n&2){let e=c(2);f("img",e.icons.Lock)}}function Ai(n,t){if(n&1&&(d(0,"span",13),l(1),m(2,"translate"),a()),n&2){let e=c().$implicit;r(),x(" ",p(2,1,e.tierKey)," ")}}function Ti(n,t){if(n&1){let e=T();d(0,"button",2),w("click",function(){let o=y(e).$implicit,s=c();return v(s.selectVoice(o.id))}),d(1,"button",3),w("click",function(o){let s=y(e).$implicit,g=c();return o.stopPropagation(),v(g.playSample(s.id))}),P(2,ki,1,1,"lucide-icon",4)(3,Pi,1,1,"lucide-icon",5)(4,Ri,1,1,"lucide-icon",6),a(),d(5,"div",7)(6,"div",8)(7,"span",9),l(8),a(),P(9,Mi,1,1,"lucide-icon",10),a(),d(10,"p",11)(11,"span"),l(12),a(),d(13,"span",12),l(14),m(15,"translate"),a()()(),P(16,Ai,3,3,"span",13),a()}if(n&2){let e=t.$implicit,i=c();U(i.activeVoiceId()===e.id?"bg-primary/10 shadow-[0_12px_28px_-24px_rgb(var(--color-primary)/0.22)]":"bg-text-primary/[0.03] hover:bg-text-primary/[0.06]"),B("group-locked",i.isVoiceLocked(e)),r(),U(i.sampleButtonClass(e.id)),f("disabled",i.loadingVoiceId()!==null&&i.loadingVoiceId()!==e.id),r(),R(i.loadingVoiceId()===e.id?2:i.playingVoiceId()===e.id?3:4),r(5),B("text-primary",i.activeVoiceId()===e.id),r(),x(" ",e.name," "),r(),R(i.isVoiceLocked(e)?9:-1),r(3),E(e.flag),r(2),E(p(15,15,e.accentKey)),r(2),R(e.tier==="max"?16:-1)}}var Ei="bg-primary text-white",Ii="bg-primary/[0.16] text-primary shadow-[0_12px_24px_-18px_rgb(var(--color-primary)/0.34)]",Oi="bg-text-primary/[0.04] text-text-secondary hover:text-primary hover:bg-primary/5",Oe=class n{subscriptionService=S(Lt);upgradeModal=S(Me);destroyRef=S(j);activeVoiceId=H("alloy");voiceSelected=$();icons={Mic:ee,Play:te,Square:ie,Loader2:ke,Lock:Tt};playingVoiceId=h(null);loadingVoiceId=h(null);allowPremiumVoices=I(()=>this.subscriptionService.allowPremiumVoices());audioPlayer=null;constructor(){this.destroyRef.onDestroy(()=>this.stopPlayback())}voices=me.map(t=>({id:t.id,name:t.name,gender:t.gender,accentKey:this.getAccentKey(t.name,t.accent),flag:t.accent.includes("British")?"\u{1F1EC}\u{1F1E7}":"\u{1F1FA}\u{1F1F8}",tier:t.isPremium?"max":"pro",tierKey:t.isPremium?"MAX":"PRO",sampleUrl:t.sampleUrl}));getAccentKey(t,e){return e==="British"?t==="George"?"BRITISH_FORMAL":"BRITISH_SOFT":e==="US Conversational"?"US_CONVERSATIONAL":e==="US Natural"?"US_NATURAL":e==="US (Expressive)"?"AMERICAN_EXPRESSIVE":"US_NEUTRAL"}isVoiceLocked(t){return t.tier==="max"&&!this.allowPremiumVoices()}selectVoice(t){let e=this.voices.find(i=>i.id===t);if(e&&this.isVoiceLocked(e)){this.upgradeModal.show({feature:"premiumVoice",trigger:"premium_locked",recommendedPlan:"max"});return}this.voiceSelected.emit(t)}playSample(t){if(this.playingVoiceId()===t){this.stopPlayback();return}this.stopPlayback();let e=this.voices.find(i=>i.id===t);e?.sampleUrl&&(this.loadingVoiceId.set(t),this.audioPlayer=new Audio(e.sampleUrl),this.audioPlayer.oncanplaythrough=()=>{this.loadingVoiceId.set(null),this.playingVoiceId.set(t),this.audioPlayer?.play().catch(()=>{this.stopPlayback()})},this.audioPlayer.onended=()=>{this.playingVoiceId.set(null)},this.audioPlayer.onerror=()=>{this.loadingVoiceId.set(null),this.playingVoiceId.set(null)},this.audioPlayer.load())}sampleButtonClass(t){return this.playingVoiceId()===t?Ei:this.activeVoiceId()===t?Ii:Oi}stopPlayback(){this.audioPlayer&&(this.audioPlayer.pause(),this.audioPlayer.src="",this.audioPlayer=null),this.playingVoiceId.set(null),this.loadingVoiceId.set(null)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Q({type:n,selectors:[["voice-selector"]],inputs:{activeVoiceId:[1,"activeVoiceId"]},outputs:{voiceSelected:"voiceSelected"},decls:3,vars:0,consts:[[1,"grid","grid-cols-1","gap-3","sm:grid-cols-2"],["type","button",1,"group","relative","flex","min-h-[96px]","items-center","gap-4","rounded-2xl","p-4","pr-20","text-left","transition-all","duration-200","active:scale-[0.98]",3,"class","group-locked"],["type","button",1,"group","relative","flex","min-h-[96px]","items-center","gap-4","rounded-2xl","p-4","pr-20","text-left","transition-all","duration-200","active:scale-[0.98]",3,"click"],["type","button",1,"flex","h-11","w-11","flex-shrink-0","items-center","justify-center","rounded-full","shadow-sm","transition-all","duration-200",3,"click","disabled"],[1,"h-5","w-5","animate-spin",3,"img"],[1,"h-4","w-4","fill-current",3,"img"],[1,"ml-0.5","h-5","w-5",3,"img"],[1,"min-w-0","flex-1"],[1,"flex","items-center","gap-2"],[1,"truncate","text-base","font-bold","text-text-primary","transition-colors"],[1,"h-3.5","w-3.5","text-amber-500",3,"img"],[1,"mt-0.5","flex","items-center","gap-1","text-[11px]","font-bold","uppercase","tracking-tight","text-text-muted"],[1,"truncate","opacity-70"],[1,"absolute","right-4","top-4","inline-flex","items-center","rounded-xl","border","border-amber-500/15","bg-amber-500/5","px-2.5","py-1","text-[11px]","font-black","uppercase","tracking-[0.08em]","text-amber-600"]],template:function(e,i){e&1&&(d(0,"div",0),N(1,Ti,17,17,"button",1,Si),a()),e&2&&(r(),L(i.voices))},dependencies:[oe,ne,Z],styles:["[_nghost-%COMP%]{display:block}.group[_ngcontent-%COMP%]{transition:background-color .2s ease,box-shadow .2s ease,opacity .2s ease}.group-locked[_ngcontent-%COMP%]{opacity:.7}.group-locked[_ngcontent-%COMP%]:hover{opacity:.9}"],changeDetection:0})};var re=class n{functions=S(mt);auth=S(dt);firestore=S(ct);storage=S(pt);injector=S(Qe);audioUrlCache=new Map;audioUrlInflight=new Map;async generateAudio(t){let i=await ge(this.functions,"shadowingGenerateAudio")(t),o=i.data.audioPath,s=await this.getOrFetchAudioUrl(o);return{generationId:i.data.generationId,audioPath:o,audioUrl:s}}watchGenerations(t,e,i){let o=_e(this.firestore,"users",t,"shadowingGenerations"),s=ye(o,be("createdAt","desc"),Fe(30)),g=!0,_=He(s,b=>{let A=b.docs.map(C=>zt(C.id,C.data(),this.audioUrlCache));e(A);let M=A.map(C=>C.audioPath).filter(C=>!!C&&!this.audioUrlCache.has(C));M.length!==0&&Promise.all(M.map(C=>this.getOrFetchAudioUrl(C))).then(()=>
1{if(!g)return;let C=b.docs.map(k=>zt(k.id,k.data(),this.audioUrlCache));e(C)})},b=>i(b));return()=>{g=!1,_()}}async deleteGeneration(t){await ge(this.functions,"shadowingDeleteGeneration")({generationId:t})}watchPracticeRecordings(t,e,i,o){let s=_e(this.firestore,"users",t,"shadowingPracticeScripts",e,"recordings"),g=ye(s,be("createdAt","desc"),Fe(5)),_=!0,b=He(g,A=>{let M=A.docs.map(k=>ze(k.id,k.data(),this.audioUrlCache));i(M);let C=M.map(k=>k.audioPath).filter(k=>!!k&&!this.audioUrlCache.has(k));C.length!==0&&Promise.all(C.map(k=>this.getOrFetchAudioUrl(k))).then(()=>{if(!_)return;let k=A.docs.map(O=>ze(O.id,O.data(),this.audioUrlCache));i(k)})},A=>o(A));return()=>{_=!1,b()}}async savePracticeRecording(t){let e=crypto.randomUUID().replace(/-/g,""),i=`users/${t.uid}/shadowing/practice/${t.scriptHash}/${e}.webm`,o=await this.runInFirebase(async()=>{let g=ve(this.storage,i);return await ft(g,t.audio,{contentType:t.audio.type||"audio/webm"}),We(g)});this.audioUrlCache.set(i,o);let s={id:e,scriptHash:t.scriptHash,scriptText:t.scriptText,generationId:t.generationId,audioPath:i,audioUrl:o,createdAt:new Date,durationSec:t.durationSec};return await this.runInFirebase(()=>gt(le(this.firestore,"users",t.uid,"shadowingPracticeScripts",t.scriptHash,"recordings",e),{id:e,scriptHash:t.scriptHash,scriptText:t.scriptText,generationId:t.generationId,audioPath:i,durationSec:t.durationSec,createdAt:ce(),updatedAt:ce()},{merge:!0})),await this.enforcePracticeRecordingLimit(t.uid,t.scriptHash),s}async updatePracticeRecordingAnalysis(t){let e={updatedAt:ce(),analyzedAt:ce()};t.metrics!==void 0&&(e.metrics=t.metrics),t.feedback!==void 0&&(e.feedback=t.feedback),t.asrInsights!==void 0&&(e.asrInsights=t.asrInsights),t.deepVoiceAnalysis!==void 0&&(e.deepVoiceAnalysis=t.deepVoiceAnalysis),await this.runInFirebase(()=>ut(le(this.firestore,"users",t.uid,"shadowingPracticeScripts",t.scriptHash,"recordings",t.recordingId),e))}async deletePracticeRecording(t){await this.runInFirebase(async()=>{try{await ht(ve(this.storage,t.recording.audioPath))}catch(i){if(!Li(i))throw i}await Be(le(this.firestore,"users",t.uid,"shadowingPracticeScripts",t.scriptHash,"recordings",t.recording.id));let e=t.recording.deepVoiceAnalysis?.id;e&&await Be(le(this.firestore,"users",t.uid,"pronunciationAssessments",e)).catch(()=>{})})}async getFeedback(t){return(await ge(this.functions,"shadowingGetFeedback")(t)).data}async deepVoiceCheck(t){return(await ge(this.functions,"deepVoiceCheck")(t)).data}getCurrentUid(){let t=this.auth.currentUser;if(!t)throw new Error("User is not authenticated.");return t.uid}async getOrFetchAudioUrl(t){let e=this.audioUrlCache.get(t);if(e)return e;let i=this.audioUrlInflight.get(t);if(i)return i;let o=We(ve(this.storage,t)).then(s=>(this.audioUrlCache.set(t,s),s)).finally(()=>{this.audioUrlInflight.delete(t)});return this.audioUrlInflight.set(t,o),o}async enforcePracticeRecordingLimit(t,e){let i=_e(this.firestore,"users",t,"shadowingPracticeScripts",e,"recordings"),o=ye(i,be("createdAt","desc")),g=(await this.runInFirebase(()=>lt(o))).docs.slice(5);await Promise.all(g.map(async _=>{let b=ze(_.id,_.data(),this.audioUrlCache);await this.deletePracticeRecording({uid:t,scriptHash:e,recording:b})}))}runInFirebase(t){return Je(this.injector,t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=fe({token:n,factory:n.\u0275fac})};function zt(n,t,e){let i=typeof t.audioPath=="string"?t.audioPath:"",o=i?e.get(i)??null:null,s=typeof t.createdAt=="object"&&t.createdAt!==null&&"toDate"in t.createdAt&&typeof t.createdAt.toDate=="function"?t.createdAt.toDate():new Date,g=t.voice==="female"?"female":"male";return{id:n,text:typeof t.text=="string"?t.text:"",voice:g,audioPath:i,audioUrl:o,createdAt:s}}function ze(n,t,e){let i=typeof t.audioPath=="string"?t.audioPath:"",o=i?e.get(i)??null:null;return{id:n,scriptHash:typeof t.scriptHash=="string"?t.scriptHash:"",scriptText:typeof t.scriptText=="string"?t.scriptText:"",generationId:typeof t.generationId=="string"?t.generationId:null,audioPath:i,audioUrl:o,createdAt:$t(t.createdAt),durationSec:typeof t.durationSec=="number"?t.durationSec:0,metrics:Di(t.metrics)?t.metrics:void 0,feedback:Vi(t.feedback)?t.feedback:void 0,asrInsights:De(t.asrInsights)?t.asrInsights:null,deepVoiceAnalysis:Ni(t.deepVoiceAnalysis)?t.deepVoiceAnalysis:void 0,analyzedAt:t.analyzedAt?$t(t.analyzedAt):void 0}}function $t(n){return typeof n=="object"&&n!==null&&"toDate"in n&&typeof n.toDate=="function"?n.toDate():new Date}function Di(n){return De(n)?typeof n.durationSec=="number"&&(typeof n.estimatedWpm=="number"||n.estimatedWpm===null)&&typeof n.pauseCount=="number":!1}function Vi(n){return De(n)?Array.isArray(n.strengths)&&Array.isArray(n.improvements):!1}function Ni(n){return De(n)?typeof n.id=="string"&&n.provider==="azure"&&(n.mode==="shadowing"||n.mode==="scenario"):!1}function De(n){return!!n&&typeof n=="object"}function Li(n){return typeof n=="object"&&n!==null&&"code"in n&&n.code==="storage/object-not-found"}async function Ve(n){let t=Ui(n.scriptText),e=await Gi(n.audio),i=await Bi(n.audio),{rms:o,peak:s,silenceRatio:g,pauseCount:_,activeDurationSec:b}=Fi(i.samples,i.sampleRate),A=Math.max(0,Math.min(e,b)),M=A>.5?t/A*60:null,C=o>0?qt(o):null,k=s>0?qt(s):null;return{durationSec:e,activeDurationSec:A,wordCount:t,estimatedWpm:Number.isFinite(M)?M:null,pauseCount:_,silenceRatio:g,rmsDb:C,peakDb:k,voice:n.voice}}function Ui(n){return n.trim().split(/\s+/g).map(e=>
1e.trim()).filter(Boolean).length}function qt(n){let t=Math.max(1e-8,Math.min(1,n));return 20*Math.log10(t)}async function Gi(n){let t=URL.createObjectURL(n);try{let e=new Audio;e.src=t,e.preload="metadata";let i=await new Promise((o,s)=>{e.onloadedmetadata=()=>o(e.duration),e.onerror=()=>s(new Error("Failed to read audio metadata."))});return Number.isFinite(i)?i:0}finally{URL.revokeObjectURL(t)}}async function Bi(n){let t=await n.arrayBuffer(),e=window.AudioContext||window.webkitAudioContext,i=new e;try{let o=await i.decodeAudioData(t.slice(0));return{samples:o.numberOfChannels>0?o.getChannelData(0):new Float32Array,sampleRate:o.sampleRate}}finally{await i.close().catch(()=>{})}}function Fi(n,t){if(n.length===0||t<=0)return{rms:0,peak:0,silenceRatio:0,pauseCount:0,activeDurationSec:0};let e=0,i=0;for(let V=0;V<n.length;V++){let W=Math.abs(n[V]??0);e+=W*W,W>i&&(i=W)}let o=Math.sqrt(e/n.length),s=.05,g=Math.max(1,Math.floor(t*s)),_=Math.max(.008,o*.15),A=Math.max(1,Math.floor(.25/s)),C=Math.max(1,Math.floor(.15/s)),k=[];for(let V=0;V<n.length;V+=g){let W=Math.min(n.length,V+g),Ye=0;for(let Le=V;Le<W;Le++){let Xe=n[Le]??0;Ye+=Xe*Xe}let ii=Math.sqrt(Ye/(W-V));k.push(ii<_)}let O=k.length,D=Hi(k,C),G=Wi(k,C),q=D===-1||G===-1?0:Math.min(D,G),F=D===-1||G===-1?O-1:Math.max(D,G),K=0,Y=0,ae=0;for(let V=q;V<=F;V++){if(k[V]??!0){K+=1,Y+=1;continue}Y>=A&&(ae+=1),Y=0}Y>=A&&(ae+=1);let Ne=Math.max(1,F-q+1),ei=Ne>0?K/Ne:0,ti=Math.max(0,Ne*s);return{rms:o,peak:i,silenceRatio:ei,pauseCount:ae,activeDurationSec:ti}}function Hi(n,t){for(let e=0;e<n.length;e++)if(!n[e]&&Yt(n,e,t))return e;return-1}function Wi(n,t){for(let e=n.length-1;e>=0;e--){if(n[e])continue;let i=Math.max(0,e-t+1);if(Yt(n,i,t))return e}return-1}function Yt(n,t,e){for(let i=t;i<t+e;i++)if(i>=n.length||n[i])return!1;return!0}var Kt=new Set(["um","uh","erm","ah","hmm","like"]),Qt=new Set(["a","an","the","and","or","to","of","in","on","at","for","with","is","are","was","were","be","been","being","i","you","we","they","it","this","that","these","those","my","your","our","their"]);function $e(n,t){let e=Xt(n),i=Xt(t);if(!e.length||!i.length)return null;let{scriptStatus:o,spokenStatus:s,matchedCount:g}=zi(e,i),_=e.map((F,K)=>({text:F.text,status:o[K]??"missing"})),b=i.map((F,K)=>{let Y=s[K]??"extra",ae=Y==="extra"&&Kt.has(F.norm);return{text:F.text,status:Y,isFiller:ae}}),A=$i(e,o),{extraWords:M,extraWordCount:C,fillerWordCount:k}=Yi(i,s),O=e.length,D=i.length,G=O>0?g/O:0,q=o.filter(F=>F==="missing").length;return{transcript:t.trim(),accuracy:Number.isFinite(G)?G:0,scriptWordCount:O,spokenWordCount:D,matchedWordCount:g,missingWordCount:q,extraWordCount:C,missingPhraseCount:A.length,missingPhrases:A,extraWords:M,fillerWordCount:k,scriptTokens:_,spokenTokens:b}}function Xt(n){return n.trim()?n.replace(/\s+/g," ").trim().split(" ").map(t=>({text:t,norm:ji(t)})).filter(t=>t.norm.length>0):[]}function ji(n){return n.toLowerCase().replace(/^[^a-z0-9']+|[^a-z0-9']+$/g,"")}function zi(n,t){let e=n.length,i=t.length,o=Array.from({length:e+1},()=>Array(i+1).fill(0));for(let M=e-1;M>=0;M-=1)for(let C=i-1;C>=0;C-=1)n[M]?.norm===t[C]?.norm?o[M][C]=1+o[M+1][C+1]:o[M][C]=Math.max(o[M+1][C],o[M][C+1]);let s=Array(e).fill("missing"),g=Array(i).fill("extra"),_=0,b=0,A=0;for(;_<e&&b<i;){let M=n[_],C=t[b];if(M?.norm===C?.norm){s[_]="match",g[b]="match",A+=1,_+=1,b+=1;continue}let k=o[_+1][b],O=o[_][b+1];k>=O?(s[_]="missing",_+=1):(g[b]="extra",b+=1)}return{scriptStatus:s,spokenStatus:g,matchedCount:A}}function $i(n,t){let e=[],i=[],o=()=>{if(!i.length)return;if(!qi(i)){i=[];return}let _=i.map(b=>b.text).join(" ").trim();_&&e.push(_),i=[]};n.forEach((_,b)=>{(t[b]??"missing")==="missing"?i.push(_):o()}),o();let s=new Set;return e.filter(_=>{let b=_.toLowerCase();return s.has(b)?!1:(s.add(b),!0)}).slice(0,3)}function qi(n){if(n.length>1)return!0;let t=n[0];return!t||!t.norm?!1:!Qt.has(t.norm)}function Yi(n,t){let e=[],i=0,o=0;n.forEach((_,b)=>{if((t[b]??"extra")==="extra"){if(Kt.has(_.norm)){i+=1;return}Qt.has(_.norm)||(o+=1,e.push(_))}});let s=new Set;return{extraWords:e.filter(_=>s.has(_.norm)?!1:(s.add(_.norm),!0)).slice(0,8).map(_=>_.text),extraWordCount:o,fillerWordCount:i}}function Xi(n){if(typeof n!="object"||n===null||!("code"in n))return"";let t=n.code;return typeof t=="string"?t:""}function Ki(n){if(typeof n!="object"||n===null||!("message"in n))return"";let t=n.message;return typeof t=="string"?t:""}function pe(n){let t=Xi(n),e=Ki(n);if(t==="functions/unauthenticated")return"SHADOWING_ALERTS_SIGN_IN_REQUIRED";if(t==="functions/resource-exhausted"){if(e.includes("History limit"))return"SHADOWING_ALERTS_HISTORY_LIMIT";if(e.includes("Monthly limit"))return"SHADOWING_ALERTS_MONTHLY_LIMIT";if(e.includes("Daily limit"))return"SHADOWING_ALERTS_DAILY_LIMIT";if(e.includes("Too many requests"))return"SHADOWING_ALERTS_RATE_LIMIT"}if(t==="functions/failed-precondition"&&e.toLowerCase().includes("app check"))return"SHADOWING_ALERTS_APP_CHECK";if(t==="functions/invalid-argument"){if(e.includes("Audio payload is too large"))return"SHADOWING_ALERTS_AUDIO_TOO_LARGE";if(e.includes("Audio format not supported"))return"SHADOWING_ALERTS_AUDIO_UNSUPPORTED";if(e.includes("Audio payload is empty"))return"SHADOWING_ALERTS_AUDIO_EMPTY";if(e.includes("Deep voice checks currently support recordings up to")||e.includes("Audio is too long"))return"SHADOWING_ALERTS_AUDIO_TOO_LONG";if(e.includes("Payload is too large"))return"SHADOWING_ALERTS_TEXT_TOO_LONG"}return"AN_ERROR_OCCURRED"}function qe(n){return new Promise((t,e)=>{let i=new FileReader;i.onload=()=>{let o=typeof i.result=="string"?i.result:"",s=o.indexOf(",");t(s>=0?o.slice(s+1):o)},i.onerror=()=>
1e(new Error("Failed to read audio data.")),i.readAsDataURL(n)})}var he=class n{destroyRef=S(j);repo=S(re);authService=S(xt);snackbar=S(we);confirmation=S(Ut);translate=S(xe);prefs=S(Ce);usageService=S(Bt);upgradeModal=S(Me);pendingPracticeRecordingSave=null;maxTextChars=800;softLimitRatio=.9;mainText=h("");selectedVoice=h("Male");charCount=I(()=>this.mainText().length);softLimitChars=I(()=>Math.floor(this.maxTextChars*this.softLimitRatio));isOverLimit=I(()=>this.charCount()>this.maxTextChars);isNearLimit=I(()=>!this.isOverLimit()&&this.charCount()>=this.softLimitChars());remainingChars=I(()=>Math.max(0,this.maxTextChars-this.charCount()));overLimitBy=I(()=>Math.max(0,this.charCount()-this.maxTextChars));isGenerating=h(!1);modelAudioUrl=h(null);generations=h([]);isGenerationsLoading=h(!0);isDeleting=h(!1);deletingId=h(null);activeGenerationId=h(null);activeScriptHash=I(()=>Qi(this.mainText().trim()));isFeedbackLoading=h(!1);feedback=h(null);isDeepVoiceLoading=h(!1);deepVoiceAnalysis=h(null);practiceRecordings=h([]);analyzingRecordingId=h(null);isPracticeRecordingsLoading=h(!1);deletingPracticeRecordingId=h(null);currentPracticeRecordingId=h(null);asrInsights=h(null);lastMetrics=h(null);hasAudio=I(()=>!!this.modelAudioUrl());hasFeedback=I(()=>!!this.feedback());constructor(){let t=null;this.authService.user$.pipe(rt(this.destroyRef),Ke((e,i)=>(e?.uid??null)===(i?.uid??null))).subscribe(e=>{if(t?.(),t=null,!e){this.generations.set([]),this.isGenerationsLoading.set(!1);return}this.isGenerationsLoading.set(!0),t=this.repo.watchGenerations(e.uid,i=>{this.generations.set(i),this.isGenerationsLoading.set(!1)},()=>{this.isGenerationsLoading.set(!1)})}),this.destroyRef.onDestroy(()=>{t?.()}),z(e=>{let i=this.authService.user()?.uid,o=this.activeScriptHash();if(!i||!o){this.practiceRecordings.set([]),this.isPracticeRecordingsLoading.set(!1);return}this.isPracticeRecordingsLoading.set(!0);let s=this.repo.watchPracticeRecordings(i,o,g=>{this.practiceRecordings.set(g),this.isPracticeRecordingsLoading.set(!1)},()=>{this.isPracticeRecordingsLoading.set(!1)});e(()=>s())})}async generateAudio(){let t=this.mainText().trim();if(!t||this.isGenerating()){t||this.snackbar.open("SHADOWING_ALERTS_TEXT_REQUIRED",{variant:"error"});return}if(!this.usageService.canShadowing()){this.upgradeModal.show({feature:"shadowing",trigger:"limit_reached",recommendedPlan:"pro"});return}if(t.length>this.maxTextChars){this.snackbar.open("SHADOWING_ALERTS_TEXT_TOO_LONG",{variant:"error"});return}this.isGenerating.set(!0);try{let e=this.prefs.getVoiceId(),i=await this.repo.generateAudio({text:t,voice:e});this.modelAudioUrl.set(i.audioUrl),this.activeGenerationId.set(i.generationId),this.currentPracticeRecordingId.set(null)}catch(e){if(ue(e,this.upgradeModal,"shadowing"))return;this.snackbar.open(pe(e),{variant:"error"})}finally{this.isGenerating.set(!1)}}setVoice(t){this.prefs.setVoiceId(t)}editScript(){this.modelAudioUrl.set(null),this.activeGenerationId.set(null),this.currentPracticeRecordingId.set(null),this.feedback.set(null),this.deepVoiceAnalysis.set(null),this.asrInsights.set(null),this.lastMetrics.set(null)}async loadGeneration(t){if(this.mainText.set(t.text),this.selectedVoice.set(t.voice==="female"?"Female":"Male"),this.activeGenerationId.set(t.id),this.currentPracticeRecordingId.set(null),this.feedback.set(null),this.deepVoiceAnalysis.set(null),this.asrInsights.set(null),this.lastMetrics.set(null),t.audioUrl){this.modelAudioUrl.set(t.audioUrl);return}try{let e=await this.repo.getOrFetchAudioUrl(t.audioPath);this.modelAudioUrl.set(e)}catch{this.snackbar.open("AN_ERROR_OCCURRED",{variant:"error"})}}async deleteGeneration(t,e){if(e?.stopPropagation(),this.isDeleting())return;let i=this.generations();if(await this.confirmation.confirm({title:this.translate.instant("DELETE_RECORDING"),message:this.translate.instant("SHADOWING_DELETE_CONFIRM_MESSAGE"),confirmText:this.translate.instant("DELETE"),cancelText:this.translate.instant("CANCEL"),confirmColor:"red"})){this.generations.set(i.filter(s=>s.id!==t)),this.isDeleting.set(!0),this.deletingId.set(t);try{await this.repo.deleteGeneration(t)}catch{this.snackbar.open("AN_ERROR_OCCURRED",{variant:"error"}),this.generations.set(i)}finally{this.isDeleting.set(!1),this.deletingId.set(null)}}}async savePracticeRecording(t){if(this.pendingPracticeRecordingSave)return this.pendingPracticeRecordingSave;let e=this.mainText().trim(),i=this.activeScriptHash();if(!e||!i)return null;this.pendingPracticeRecordingSave=this.savePracticeRecordingInternal(t,e,i);try{return await this.pendingPracticeRecordingSave}finally{this.pendingPracticeRecordingSave=null}}async savePracticeRecordingInternal(t,e,i){try{let o=this.repo.getCurrentUid(),s=await Ht(t).catch(()=>0),g=await this.repo.savePracticeRecording({uid:o,scriptHash:i,scriptText:e,generationId:this.activeGenerationId(),audio:t,durationSec:s});return this.currentPracticeRecordingId.set(g.id),g}catch{return this.snackbar.open("AN_ERROR_OCCURRED",{variant:"error"}),null}}async analyzeSavedRecording(t){if(this.isFeedbackLoading()||this.isDeepVoiceLoading())return;let e=t.scriptText.trim(),i=t.scriptHash;if(!e||!i||!t.audioUrl){this.snackbar.open("AN_ERROR_OCCURRED",{variant:"error"});return}if(!this.usageService.canShadowing()||!this.usageService.canDeepVoiceCheck()){this.upgradeModal.show({feature:"shadowing",trigger:"limit_reached",recommendedPlan:"pro"});return}let o;try{o=await fetch(t.audioUrl).then(_=>_.blob())}catch{this.snackbar.open("AN_ERROR_OCCURRED",{variant:"error"});return}let s=this.repo.getCurrentUid(),g=t.id;this.analyzingRecordingId.set(g),this.isFeedbackLoading.set(!0),this.isDeepVoiceLoading.set(!0),this.feedback.set(null),this.deepVoiceAnalysis.set(null),this.asrInsights.set(null),this.lastMetrics.set(null);try{let _=this.selectedVoice()==="Female"?"female":"male",[b,A,M]=await Promise.all([Ve({audio:o,scriptText:e,voice:_}),qe(o),je(o)]),C={durationSec:b.activeDurationSec,estimatedWpm:b.estimatedWpm,pauseCount:b.pauseCount};this.lastMetrics.set(C),g&&await this.repo.updatePracticeRecordingAnalysis({uid:s,scriptHash:i,recordingId:g,metrics:C});let[k,O]=await Promise.allSettled([this.repo.getFeedback({scriptText:e,durationSec:b.activeDurationSec,estimatedWpm:b.estimatedWpm,pauseCount:b.pauseCount,silenceRatio:b.silenceRatio,rmsDb:b.rmsDb,peakDb:b.peakDb,audioBase64:A,audioMimeType:o.type||"audio/webm"}),this.repo.deepVoiceCheck({mode:"shadowing",referenceText:e,audioBase64:M.base64,audioMimeType:M.mimeType,audioSampleRate:
1M.sampleRate,durationSec:M.durationSec})]);if(k.status==="fulfilled"){let D=k.value;this.feedback.set(D);let G=(D.transcript??"").trim(),q=G?$e(e,G):null;this.asrInsights.set(q),g&&await this.repo.updatePracticeRecordingAnalysis({uid:s,scriptHash:i,recordingId:g,feedback:D,asrInsights:q})}else this.handleAnalysisError(k.reason);if(O.status==="fulfilled"){let D=O.value;this.deepVoiceAnalysis.set(D),g&&await this.repo.updatePracticeRecordingAnalysis({uid:s,scriptHash:i,recordingId:g,deepVoiceAnalysis:D})}else this.handleAnalysisError(O.reason)}finally{this.isFeedbackLoading.set(!1),this.isDeepVoiceLoading.set(!1),this.analyzingRecordingId.set(null)}}async deletePracticeRecording(t,e){e?.stopPropagation();let i=this.activeScriptHash(),o=this.authService.user()?.uid,s=this.practiceRecordings().find(b=>b.id===t);if(!o||!i||!s||this.deletingPracticeRecordingId()||!await this.confirmation.confirm({title:this.translate.instant("DELETE_RECORDING"),message:this.translate.instant("SHADOWING_DELETE_CONFIRM_MESSAGE"),confirmText:this.translate.instant("DELETE"),cancelText:this.translate.instant("CANCEL"),confirmColor:"red"}))return;let _=this.practiceRecordings();this.practiceRecordings.set(_.filter(b=>b.id!==t)),this.deletingPracticeRecordingId.set(t);try{await this.repo.deletePracticeRecording({uid:o,scriptHash:i,recording:s}),this.currentPracticeRecordingId()===t&&(this.currentPracticeRecordingId.set(null),this.feedback.set(null),this.deepVoiceAnalysis.set(null),this.asrInsights.set(null),this.lastMetrics.set(null))}catch{this.practiceRecordings.set(_),this.snackbar.open("AN_ERROR_OCCURRED",{variant:"error"})}finally{this.deletingPracticeRecordingId.set(null)}}async getFeedbackForRecording(t){if(this.isFeedbackLoading())return;let e=this.mainText().trim();if(!e){this.snackbar.open("SHADOWING_ALERTS_TEXT_REQUIRED",{variant:"error"});return}if(!this.usageService.canShadowing()){this.upgradeModal.show({feature:"shadowing",trigger:"limit_reached",recommendedPlan:"pro"});return}this.isFeedbackLoading.set(!0),this.feedback.set(null),this.deepVoiceAnalysis.set(null),this.asrInsights.set(null),this.lastMetrics.set(null);try{let i=this.selectedVoice()==="Female"?"female":"male",[o,s]=await Promise.all([Ve({audio:t,scriptText:e,voice:i}),qe(t)]);this.lastMetrics.set({durationSec:o.activeDurationSec,estimatedWpm:o.estimatedWpm,pauseCount:o.pauseCount});let g=await this.repo.getFeedback({scriptText:e,durationSec:o.activeDurationSec,estimatedWpm:o.estimatedWpm,pauseCount:o.pauseCount,silenceRatio:o.silenceRatio,rmsDb:o.rmsDb,peakDb:o.peakDb,audioBase64:s,audioMimeType:t.type||"audio/webm"});this.feedback.set(g);let _=(g.transcript??"").trim();_&&this.asrInsights.set($e(e,_))}catch(i){if(ue(i,this.upgradeModal,"shadowing"))return;this.snackbar.open(pe(i),{variant:"error"})}finally{this.isFeedbackLoading.set(!1)}}async getDeepVoiceCheckForRecording(t){if(this.isDeepVoiceLoading())return;let e=this.mainText().trim();if(!e){this.snackbar.open("SHADOWING_ALERTS_TEXT_REQUIRED",{variant:"error"});return}if(!this.usageService.canDeepVoiceCheck()){this.upgradeModal.show({feature:"shadowing",trigger:"limit_reached",recommendedPlan:"pro"});return}this.isDeepVoiceLoading.set(!0),this.deepVoiceAnalysis.set(null);try{let i=this.selectedVoice()==="Female"?"female":"male",[o,s]=await Promise.all([Ve({audio:t,scriptText:e,voice:i}),je(t)]);this.lastMetrics.set({durationSec:o.activeDurationSec,estimatedWpm:o.estimatedWpm,pauseCount:o.pauseCount});let g=await this.repo.deepVoiceCheck({mode:"shadowing",referenceText:e,audioBase64:s.base64,audioMimeType:s.mimeType,audioSampleRate:s.sampleRate,durationSec:s.durationSec});this.deepVoiceAnalysis.set(g)}catch(i){if(ue(i,this.upgradeModal,"shadowing"))return;this.snackbar.open(pe(i),{variant:"error"})}finally{this.isDeepVoiceLoading.set(!1)}}handleAnalysisError(t){ue(t,this.upgradeModal,"shadowing")||this.snackbar.open(pe(t),{variant:"error"})}static \u0275fac=function(e){return new(e||n)};static \u0275prov=fe({token:n,factory:n.\u0275fac})};function Qi(n){let t=n.toLowerCase().replace(/\s+/g," ").trim();if(!t)return"";let e=2166136261;for(let i=0;i<t.length;i+=1)e^=t.charCodeAt(i),e=Math.imul(e,16777619);return(e>>>0).toString(36)}var Ji=["voiceSelectorModal"],Zi=["editorTextarea"],Zt=(n,t)=>t.id;function en(n,t){if(n&1){let e=T();d(0,"div",25)(1,"div",7)(2,"h3",26),l(3),m(4,"translate"),a(),d(5,"p",27),l(6),m(7,"translate"),a()(),d(8,"button",28),w("click",function(){y(e);let o=c();return v(o.closeVoiceSelector())}),u(9,"lucide-icon",12),a()(),d(10,"voice-selector",29),w("voiceSelected",function(o){y(e);let s=c();return v(s.setVoice(o))}),a()}if(n&2){let e=c();r(3),x(" ",p(4,4,"VOICE_STUDIO")," "),r(3),x(" ",p(7,6,"SHADOWING_VOICE_STUDIO_SUBTITLE")," "),r(3),f("img",e.icons.X),r(),f("activeVoiceId",e.currentVoiceId())}}function tn(n,t){if(n&1){let e=T();d(0,"div",34)(1,"div",49)(2,"p",50),u(3,"span",51),l(4),m(5,"translate"),a(),d(6,"div",52)(7,"div",53),l(8),a(),d(9,"button",54),w("click",function(){y(e);let o=c(2);return v(o.truncateText())}),l(10),m(11,"translate"),a()()()()}if(n&2){let e=c(2);r(4),x(" ",p(5,3,"SHADOWING_TEXT_TOO_LONG_WARNING")," "),r(4),x(" ",e.mainText().slice(0,e.maxTextChars)," "),r(2),x(" ",p(11,5,"TRUNCATE_TO_LIMIT")," ")}}function nn(n,t){n&1&&(d(0,"span",41),l(1),m(2,"translate"),a()),n&2&&(r(),E(p(2,1,"MAX")))}function on(n,t){if(n&1&&(d(0,"span",48),u(1,"lucide-icon",55),l(2),m(3,"translate"),a()),n&2){let e=c(2);r(),f("img",e.icons.RotateCcw),r(),x(" ",p(3,2,"GENERATING")," ")}}function rn(n,t){n&1&&(l(0),m(1,"translate")),n&2&&x(" ",p(1,1,"GENERATE_AUDIO")," ")}function an(n,t){if(n&1){let e=T();d(0,"section",14)(1,"div",30)(2,"textarea",31,1),m(4,"translate"),w("ngModelChange",function(o){y(e);let s=c();return v(s.mainText.set(o))}),a(),d(5,"div",32)(6,"span",33),l(7),a()()(),P(8,tn,12,7,"div",34),d(9,"div",35)(10,"button",36),w("click",function(){y(e);let o=c();return v(o.openVoiceSelector())}),u(11,"lucide-icon",37),d(12,"div",38)(13,"div",39)(14,"span",40),l(15),a(),P(16,nn,3,3,"span",41),a(),d(17,"span",42)(18,"span",43),l(19),a(),d(20,"span",44),l(21),m(22,"translate"),a()()(),u(23,"lucide-icon",45),a(),d(24,"div",46)(25,"button",47),w("click",function(){y(e);let o=c();return v(o.generateAudio())}),P(26,on,4,4,"span",48)(27,rn,2,3),a()()()()}if(n&2){let e=c();r(2),f("ngModel",e.mainText())("placeholder",p(4,15,"SHADOWING_PLACEHOLDER_INPUT")),r(4),U(e.charCountBadgeClass()),r(),de(" ",e.charCount(),"/",e.maxTextChars," "),r(),R(e.isOverLimit()?8:-1),r(3),f("img",e.icons.Headphones),r(4),E(e.currentVoice().name),r(),R(e.currentVoice().isPremium?16:-1),r(3),E(e.currentVoiceFlag()),r(2),E(p(22,17,e.currentVoiceAccentKey())),r(2),f("img",e.icons.ChevronRight),r(2),f("disabled",!e.mainText().trim()||e.isGenerating(
1)||e.isOverLimit()),r(),R(e.isGenerating()?26:27)}}function sn(n,t){if(n&1&&u(0,"lucide-icon",57),n&2){let e=c(2);f("img",e.icons.Pause)}}function dn(n,t){if(n&1&&u(0,"lucide-icon",12),n&2){let e=c(2);f("img",e.icons.Play)}}function cn(n,t){if(n&1){let e=T();d(0,"button",78),w("click",function(){y(e);let o=c(2);return v(o.stopModelAudio())}),u(1,"lucide-icon",79),a()}if(n&2){let e=c(2);r(),f("img",e.icons.Square)}}function ln(n,t){if(n&1){let e=T();d(0,"button",81),w("click",function(){let o=y(e).$implicit,s=c(3);return v(s.setPlaybackSpeed(o))}),l(1),a()}if(n&2){let e=t.$implicit,i=c(3);U(i.speedButtonClass(e)),r(),x(" ",e,"x ")}}function gn(n,t){if(n&1&&(d(0,"div",74),N(1,ln,2,3,"button",80,X),a()),n&2){let e=c(2);r(),L(e.playbackSpeeds)}}function un(n,t){if(n&1&&(d(0,"p",75),l(1),m(2,"translate"),a()),n&2){let e=c(2);r(),it(" ",p(2,3,"LOOP")," ",e.loopCount()+1,"/",e.maxLoops()," ")}}function mn(n,t){if(n&1){let e=T();d(0,"div",15)(1,"button",56),w("click",function(){y(e);let o=c();return v(o.newScript())}),u(2,"lucide-icon",57),l(3),m(4,"translate"),a(),d(5,"div",58)(6,"div",59)(7,"p",60),l(8),a()(),d(9,"div",61)(10,"div",62),w("click",function(o){y(e);let s=c();return v(s.seekAudio(o))})("touchstart",function(o){y(e);let s=c();return v(s.seekAudio(o))}),d(11,"div",63),u(12,"div",64),a(),u(13,"div",65),a(),d(14,"div",66)(15,"span"),l(16),a(),d(17,"span"),l(18),a()(),d(19,"div",67)(20,"div",48)(21,"button",68),w("click",function(){y(e);let o=c();return v(o.toggleModelAudio())}),P(22,sn,1,1,"lucide-icon",57)(23,dn,1,1,"lucide-icon",12),a(),P(24,cn,2,1,"button",69),a(),d(25,"div",70)(26,"button",71),w("click",function(){y(e);let o=c();return v(o.toggleLoop())}),u(27,"lucide-icon",57),a(),d(28,"button",72),w("click",function(){y(e);let o=c();return v(o.toggleSpeedControls())}),l(29),a(),d(30,"button",73),w("click",function(){y(e);let o=c();return v(o.downloadAudio())}),u(31,"lucide-icon",57),a()()(),P(32,gn,3,0,"div",74),P(33,un,3,5,"p",75),a()(),d(34,"div",76)(35,"practice-card",77),w("requestVoiceAnalysis",function(o){y(e);let s=c();return v(s.requestVoiceAnalysis(o))})("recordingCompleted",function(o){y(e);let s=c();return v(s.savePracticeRecording(o))})("deleteRecording",function(o){y(e);let s=c();return v(s.deletePracticeRecording(o))})("shadowToggled",function(){y(e);let o=c();return v(o.toggleModelAudio())})("edit",function(){y(e);let o=c();return v(o.newScript())}),a()()()}if(n&2){let e=c();r(2),f("img",e.icons.ArrowLeft),r(),x(" ",p(4,26,"BACK")," "),r(5),x(" ",e.mainText()," "),r(4),J("width",e.modelProgress(),"%"),r(),J("left",e.modelProgress(),"%"),r(3),E(e.modelCurrentTime()),r(2),E(e.modelDuration()),r(4),R(e.isModelPlaying()?22:23),r(2),R(e.isModelPlaying()?24:-1),r(2),U(e.isLoopEnabled()?"text-primary":"text-text-secondary/40 hover:text-text-secondary"),r(),f("img",e.icons.Repeat),r(),U(e.showSpeedControls()?"text-primary":"text-text-secondary/40 hover:text-text-secondary"),r(),x(" ",e.playbackSpeed(),"x "),r(2),f("img",e.icons.Download),r(),R(e.showSpeedControls()?32:-1),r(),R(e.isLoopEnabled()?33:-1),r(2),f("text",e.mainText())("modelAudioUrl",e.modelAudioUrl())("isModelPlaying",e.isModelPlaying())("savedRecordings",e.practiceRecordings())("analyzingRecordingId",e.analyzingRecordingId())("deletingRecordingId",e.deletingPracticeRecordingId())}}function pn(n,t){n&1&&(d(0,"div",82),u(1,"div",83)(2,"div",84)(3,"div",85),a())}function hn(n,t){if(n&1&&(d(0,"div",21),N(1,pn,4,0,"div",82,X),a()),n&2){let e=c();r(),L(e.historySkeleton)}}function fn(n,t){if(n&1){let e=T();d(0,"div",22)(1,"div",86),u(2,"lucide-icon",12),a(),d(3,"p",87),l(4),m(5,"translate"),a(),d(6,"p",88),l(7),m(8,"translate"),a(),d(9,"button",89),w("click",function(){y(e);let o=c();return v(o.focusEditor())}),l(10),m(11,"translate"),a()()}if(n&2){let e=c();r(2),f("img",e.icons.Volume2),r(2),x(" ",p(5,4,"NO_GENERATIONS_YET")," "),r(3),x(" ",p(8,6,"NO_GENERATIONS_HINT")," "),r(3),x(" ",p(11,8,"TRY_GENERATING_ONE")," ")}}function xn(n,t){if(n&1&&u(0,"lucide-icon",55),n&2){let e=c(3);f("img",e.icons.RotateCcw)}}function _n(n,t){if(n&1&&u(0,"lucide-icon",97),n&2){let e=c(3);f("img",e.icons.Trash2)}}function bn(n,t){if(n&1){let e=T();d(0,"div",91),w("click",function(){let o=y(e).$implicit,s=c(2);return v(s.loadGeneration(o))})("keydown.enter",function(){let o=y(e).$implicit,s=c(2);return v(s.loadGeneration(o))})("keydown.space",function(o){let s=y(e).$implicit,g=c(2);return o.preventDefault(),v(g.loadGeneration(s))}),d(1,"div",92)(2,"p",93),l(3),a(),d(4,"span",94),l(5),a()(),d(6,"div",95)(7,"button",96),w("click",function(o){let s=y(e).$implicit,g=c(2);return o.stopPropagation(),v(g.deleteGeneration(s.id,o))}),P(8,xn,1,1,"lucide-icon",55)(9,_n,1,1,"lucide-icon",97),a()()()}if(n&2){let e=t.$implicit,i=c(2);B("shadowing-history-item-active",i.isGenerationActive(e)),r(3),x(" ",i.generationPreview(e)," "),r(2),x(" ",i.formatRelativeDate(e.createdAt)," "),r(2),f("disabled",i.isDeleting()),r(),R(i.deletingId()===e.id?8:9)}}function yn(n,t){if(n&1&&(d(0,"div",23),N(1,bn,10,6,"div",90,Zt),a()),n&2){let e=c();r(),L(e.generations())}}function vn(n,t){n&1&&(d(0,"div",82),u(1,"div",83)(2,"div",84)(3,"div",85),a())}function wn(n,t){if(n&1&&(d(0,"div",21),N(1,vn,4,0,"div",82,X),a()),n&2){let e=c(2);r(),L(e.historySkeleton)}}function Cn(n,t){if(n&1){let e=T();d(0,"div",22)(1,"div",86),u(2,"lucide-icon",12),a(),d(3,"p",87),l(4),m(5,"translate"),a(),d(6,"button",106),w("click",function(){y(e);let o=c(2);return o.focusEditor(),v(o.toggleMobileHistory())}),l(7),m(8,"translate"),a()()}if(n&2){let e=c(2);r(2),f("img",e.icons.Volume2),r(2),x(" ",p(5,3,"NO_GENERATIONS_YET")," "),r(3),x(" ",p(8,5,"TRY_GENERATING_ONE")," ")}}function Sn(n,t){if(n&1&&u(0,"lucide-icon",55),n&2){let e=c(4);f("img",e.icons.RotateCcw)}}function kn(n,t){if(n&1&&u(0,"lucide-icon",97),n&2){let e=c(4);f("img",e.icons.Trash2)}}function Pn(n,t){if(n&1){let e=T();d(0,"div",91),w("click",function(){let o=y(e).$implicit,s=c(3);return s.loadGeneration(o),v(s.toggleMobileHistory())})("keydown.enter",function(){let o=y(e).$implicit,s=c(3);return s.loadGeneration(o),v(s.toggleMobileHistory())})("keydown.space",function(o){let s=y(e).$implicit,g=c(3);return o.preventDefault(),g.loadGeneration(s),v(g.toggleMobileHistory())}),d(1,"div",92)(2,"p",93),l(3),a(),d(4,"span",94),l(5),a()(),d(6,"div",95)(7,"button",96),w("click",function(o){let s=y(e).$implicit,g=c(3);return o.stopPropagation(),v(g.deleteGeneration(s.id,o))}),P(8,Sn,1,1,"lucide-icon",55)(9,kn,1,1,"lucide-icon",97),a()()()}if(n&2){let e=t.$implicit,i=c(3);B("shadowing-history-item-active",i.isGenerationActive(e)),r(3),x(" ",i.generationPreview(e)," "),r(2),x(" ",i.formatRelativeDate(e.createdAt)," "),r(2),f("disabled",i.isDeleting()),r(),R(i.deletingId()===e.id?8:9)}}function Rn(n,t){if(n&1&&(d(0,"div",23),N(1,Pn,10,6,"div",90,Zt),a()),n&2){let e=c(2);r(),L(e.generations())}}function Mn(n,t){if(n&1){let e=T();d(0,"div",24)(1,"div",98),w("click",function(){y(e);let o=c();return v(o.toggleMobileHistory())}),a(),d(2,"div",99)(3,"div",100),u(4,"div",101),a(),d(5,"div",102)(6,"h3",103),u(7,"lucide-icon",104),l(8),m(9,"translate"),a(),d(10,"button",28),w("click",function(){y(e);let o=c();return v(o.toggleMobileHistory())}),u(11,"lucide-icon",12),a()(),d(12,"div",105),P(13,wn,3,0,"div",21)(14,Cn,9,7,"div",22)(15,Rn,3,0,"div",23),a()()()}if(n&2){let e=c();r(7),f("img",e.icons.History),r(),x(" ",p(9,4,"RECENT_GENERATIONS")," "),r(3),f("img",e.icons.X),r(2),R(e.isGenerationsLoading()?13:e.generations().length===0?14:15)}}var An="bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300",Tn="bg-red-100 text-red-700 dark:bg-red-500/20 dark:text-red-300",En="bg-primary text-white",In="bg-gray-100 text-text-secondary dark:bg-white/5",Jt=class n{constructor(t){this.themeService=t;this.destroyRef.onDestroy(()=>{this.cleanupAudio()});
1let e=this.route.snapshot.queryParamMap.get("text")?.trim()??"";e&&(this.state.mainText.set(e),this.state.editScript(),this.router.navigate([],{relativeTo:this.route,queryParams:{},replaceUrl:!0}))}themeService;state=S(he);destroyRef=S(j);route=S(at);router=S(st);modal=S(Gt);translate=S(xe);historySkeleton=[0,1,2];icons={Mic:ee,Play:te,Pause:Et,RotateCcw:Pe,Edit2:It,Clock:Pt,Trash2:Re,ChevronRight:kt,Download:Rt,Repeat:Ot,Volume2:Vt,History:Mt,X:Nt,ArrowLeft:Ct,Square:ie,Headphones:Se};activeTab=h("generate");get isDarkMode(){return this.themeService.isDarkMode()}mainText=this.state.mainText;selectedVoice=this.state.selectedVoice;isGenerating=this.state.isGenerating;hasAudio=this.state.hasAudio;modelAudioUrl=this.state.modelAudioUrl;maxTextChars=this.state.maxTextChars;charCount=this.state.charCount;isOverLimit=this.state.isOverLimit;isNearLimit=this.state.isNearLimit;remainingChars=this.state.remainingChars;overLimitBy=this.state.overLimitBy;generations=this.state.generations;isGenerationsLoading=this.state.isGenerationsLoading;isDeleting=this.state.isDeleting;deletingId=this.state.deletingId;practiceRecordings=this.state.practiceRecordings;analyzingRecordingId=this.state.analyzingRecordingId;deletingPracticeRecordingId=this.state.deletingPracticeRecordingId;prefs=S(Ce);voiceSelectorModal;editorTextarea;modelAudioElement=null;currentVoiceId=I(()=>this.prefs.preferences()?.voiceId||"alloy");currentVoice=I(()=>{let t=this.currentVoiceId();return me.find(e=>e.id===t)||me[0]});currentVoiceName=I(()=>this.currentVoice().name);currentVoiceAccentKey=I(()=>{let t=this.currentVoice();return t.accent==="British"?t.name==="George"?"BRITISH_FORMAL":"BRITISH_SOFT":t.accent==="US Conversational"?"US_CONVERSATIONAL":t.accent==="US Natural"?"US_NATURAL":t.accent==="US (Expressive)"?"AMERICAN_EXPRESSIVE":"US_NEUTRAL"});currentVoiceFlag=I(()=>this.currentVoice().accent.includes("British")?"\u{1F1EC}\u{1F1E7}":"\u{1F1FA}\u{1F1F8}");showMobileHistory=h(!1);showPracticeMode=h(!1);isModelPlaying=h(!1);modelProgress=h(0);modelCurrentTime=h("0:00");modelDuration=h("0:00");playbackSpeeds=[.8,.9,1,1.1,1.2];playbackSpeed=h(1);isLoopEnabled=h(!1);loopCount=h(0);maxLoops=h(3);showSpeedControls=h(!1);toggleSpeedControls(){this.showSpeedControls.update(t=>!t)}toggleMobileHistory(){this.showMobileHistory.update(t=>!t)}openVoiceSelector(){this.voiceSelectorModal&&this.modal.open(this.voiceSelectorModal,{ariaLabelledBy:"voice-studio-title"})}closeVoiceSelector(){this.modal.close()}setVoice(t){this.state.setVoice(t),this.modal.close()}generateAudio(){this.state.generateAudio()}editScript(){this.state.editScript()}newScript(){this.cleanupAudio(),this.state.editScript(),this.state.mainText.set(""),this.activeTab.set("generate")}focusEditor(){this.newScript(),queueMicrotask(()=>{this.editorTextarea?.nativeElement.focus()})}truncateText(){let t=this.mainText();this.mainText.set(t.slice(0,this.maxTextChars))}requestVoiceAnalysis(t){this.state.analyzeSavedRecording(t)}savePracticeRecording(t){this.state.savePracticeRecording(t)}deletePracticeRecording(t){this.state.deletePracticeRecording(t.id,t.event)}loadGeneration(t){this.state.loadGeneration(t)}deleteGeneration(t,e){this.state.deleteGeneration(t,e)}toggleModelAudio(){let t=this.modelAudioUrl();t&&(this.modelAudioElement||(this.modelAudioElement=new Audio(t),this.setupAudioListeners()),this.isModelPlaying()?this.modelAudioElement.pause():this.modelAudioElement.play())}stopModelAudio(){this.modelAudioElement&&(this.modelAudioElement.pause(),this.modelAudioElement.currentTime=0,this.isModelPlaying.set(!1),this.modelProgress.set(0),this.modelCurrentTime.set("0:00"),this.loopCount.set(0))}seekAudio(t){if(!this.modelAudioElement||!this.modelAudioElement.duration)return;let i=t.currentTarget.getBoundingClientRect(),o=t instanceof TouchEvent?t.touches[0].clientX:t.clientX,s=Math.max(0,Math.min(1,(o-i.left)/i.width));this.modelAudioElement.currentTime=s*this.modelAudioElement.duration}setupAudioListeners(){this.modelAudioElement&&(this.modelAudioElement.playbackRate=this.playbackSpeed(),this.modelAudioElement.onplay=()=>this.isModelPlaying.set(!0),this.modelAudioElement.onpause=()=>this.isModelPlaying.set(!1),this.modelAudioElement.onended=()=>
1{if(this.isLoopEnabled()){let t=this.maxLoops(),e=this.loopCount();if(t===0||e<t-1){this.loopCount.update(i=>i+1),this.modelAudioElement?.play();return}}this.isModelPlaying.set(!1),this.modelProgress.set(0),this.modelCurrentTime.set("0:00"),this.loopCount.set(0)},this.modelAudioElement.onloadedmetadata=()=>{this.modelAudioElement&&this.modelDuration.set(this.formatTime(this.modelAudioElement.duration))},this.modelAudioElement.ontimeupdate=()=>{if(this.modelAudioElement){let t=this.modelAudioElement.currentTime,e=this.modelAudioElement.duration;this.modelProgress.set(e>0?t/e*100:0),this.modelCurrentTime.set(this.formatTime(t))}})}formatTime(t){if(!t||isNaN(t))return"0:00";let e=Math.floor(t/60),i=Math.floor(t%60);return`${e}:${i.toString().padStart(2,"0")}`}async downloadAudio(){let t=this.modelAudioUrl();if(!t)return;let i=await(await fetch(t,{mode:"cors"})).blob(),o=URL.createObjectURL(i),s=document.createElement("a");s.href=o,s.download=`shadowing-${Date.now()}.mp3`,s.style.display="none",document.body.appendChild(s),s.click(),setTimeout(()=>{document.body.removeChild(s),URL.revokeObjectURL(o)},1e3)}setPlaybackSpeed(t){this.playbackSpeed.set(t),this.modelAudioElement&&(this.modelAudioElement.playbackRate=t)}speedButtonClass(t){return this.playbackSpeed()===t?En:In}toggleLoop(){this.isLoopEnabled.update(t=>!t),this.loopCount.set(0)}togglePracticeMode(){this.showPracticeMode.update(t=>!t)}charCountBadgeClass(){return this.isOverLimit()?Tn:this.isNearLimit()?An:""}formatRelativeDate(t){let i=Date.now()-t.getTime(),o=Math.floor(i/6e4),s=Math.floor(i/36e5),g=Math.floor(i/864e5);return o<1?this.translate.instant("TIME_JUST_NOW"):o<60?this.translate.instant("TIME_MINUTES_AGO",{count:o}):s<24?this.translate.instant("TIME_HOURS_AGO",{count:s}):g===1?this.translate.instant("TIME_YESTERDAY"):g<30?this.translate.instant("TIME_DAYS_AGO",{count:g}):t.toLocaleDateString()}generationPreview(t){return t.text.trim().replace(/\s+/g," ").slice(0,140)}isGenerationActive(t){return this.hasAudio()&&this.mainText().trim()===t.text.trim()}cleanupAudio(){this.modelAudioElement&&(this.modelAudioElement.pause(),this.modelAudioElement.src="",this.modelAudioElement=null),this.isModelPlaying.set(!1),this.modelProgress.set(0),this.modelCurrentTime.set("0:00"),this.modelDuration.set("0:00")}static \u0275fac=function(e){return new(e||n)(Ze(wt))};static \u0275cmp=Q({type:n,selectors:[["shadowing"]],viewQuery:function(e,i){if(e&1&&tt(Ji,5)(Zi,5),e&2){let o;Ue(o=Ge())&&(i.voiceSelectorModal=o.first),Ue(o=Ge())&&(i.editorTextarea=o.first)}},features:[nt([re,he])],decls:32,vars:16,consts:[["voiceSelectorModal",""],["editorTextarea",""],[1,"shadowing-page"],[1,"shadowing-page-inner"],[1,"shadowing-layout"],[1,"shadowing-main-column"],[1,"shadowing-page-header"],[1,"space-y-0.5"],[1,"shadowing-page-title"],[1,"shadowing-page-subtitle"],[1,"lg:hidden"],[1,"shadowing-header-action",3,"click"],[1,"h-5","w-5",3,"img"],[1,"shadowing-main","custom-scrollbar"],[1,"shadowing-compose-card"],[1,"mx-auto","w-full","max-w-3xl","pb-[var(--mobile-standalone-bottom-offset)]","lg:pb-0"],[1,"shadowing-history-panel","hidden","lg:flex"],[1,"shadowing-history-header"],[1,"shadowing-history-heading"],[1,"shadowing-history-title"],[1,"shadowing-history-body","custom-scrollbar"],[1,"space-y-2"],[1,"shadowing-history-empty"],[1,"space-y-2.5"],[1,"fixed","inset-0","z-50","lg:hidden"],[1,"mb-6","flex","items-center","justify-between","border-b","border-text-primary/5","pb-4"],["id","voice-studio-title",1,"text-xl","font-black","tracking-tight","text-text-primary"],[1,"text-sm","font-medium","leading-snug","text-text-muted","opacity-60"],[1,"rounded-full","p-2","text-text-secondary","hover:bg-gray-100","dark:hover:bg-white/5",3,"click"],[3,"voiceSelected","activeVoiceId"],[1,"shadowing-compose-shell"],["rows","5",1,"shadowing-editor-input",3,"ngModelChange","ngModel","placeholder"],[1,"shadowing-editor-overlay"],[1,"shadowing-counter"],[1,"mb-4","rounded-2xl","border","border-red-200","bg-red-50/50","p-4","text-xs","text-red-800","dark:border-red-900/30","dark:bg-red-950/20","dark:text-red-200"],[1,"shadowing-compose-toolbar"],["type","button",1,"shadowing-voice-chip","group",3,"click"],[1,"shadowing-voice-chip-icon","h-3.5","w-3.5","flex-shrink-0","text-text-secondary","transition-colors","group-hover:text-text-primary",3,"img"],[1,"shadowing-voice-chip-content"],[1,"shadowing-voice-chip-name-row"],[1,"shadowing-voice-chip-label"],[1,"shadowing-voice-chip-badge"],[1,"shadowing-voice-chip-sublabel"],[1,"mr-1","select-none","leading-none"],[1,"truncate"],[1,"shadowing-voice-chip-chevron","h-3.5","w-3.5",3,"img"],[1,"shadowing-compose-actions"],[1,"shadowing-generate-btn",3,"click","disabled"],[1,"flex","items-center","gap-2"],[1,"flex","flex-col","gap-3"],[1,"flex","items-center","gap-1.5","font-bold","text-red-900","dark:text-red-100"],[1,"inline-block","h-1.5","w-1.5","rounded-full","bg-red-600"],[1,"flex","flex-col","gap-2","sm:flex-row","sm:items-center","sm:justify-between"],[1,"line-clamp-3","flex-1","rounded-xl","bg-red-100/50","p-2.5","font-mono","text-[11px]","leading-relaxed","text-red-950","dark:bg-red-950/50","dark:text-red-300"],["type","button",1,"inline-flex","h-9","shrink-0","items-center","justify-center","rounded-full","bg-red-600","px-4","text-xs","font-bold","text-white","transition-all","hover:bg-red-700","active:scale-95",3,"click"],[1,"h-3.5","w-3.5","animate-spin",3,"img"],[1,"shadowing-back-btn",3,"click"],[1,"h-4","w-4",3,"img"],[1,"shadowing-practice-card"],[1,"p-5","sm:p-6"],[1,"text-lg","leading-[1.9]","text-text-primary"],[1,"border-t","border-border/40","p-5","sm:p-6"],[1,"group","relative","mb-2","h-6","w-full","cursor-pointer",3,"click","touchstart"],[1,"absolute","top-1/2","h-1","w-full","-translate-y-1/2","rounded-full","bg-gray-100","transition-[height]","group-hover:h-1.5","dark:bg-white/10"],[1,"absolute","
1inset-y-0","left-0","rounded-full","bg-primary"],[1,"absolute","top-1/2","h-3","w-3","-translate-x-1/2","-translate-y-1/2","rounded-full","bg-primary","opacity-0","shadow-sm","transition-opacity","group-hover:opacity-100"],[1,"flex","items-center","justify-between","text-[11px]","tabular-nums","text-text-secondary/50"],[1,"mt-4","flex","items-center","justify-between"],[1,"flex","h-11","w-11","items-center","justify-center","rounded-full","bg-primary","text-white","transition-all","hover:bg-primary-hover","active:scale-95",3,"click"],[1,"flex","h-9","w-9","items-center","justify-center","rounded-full","text-text-secondary/60","transition-all","hover:text-text-primary"],[1,"flex","items-center","gap-1"],[1,"flex","h-8","w-8","items-center","justify-center","rounded-full","transition-all",3,"click"],[1,"flex","h-8","min-w-8","items-center","justify-center","rounded-full","px-1","text-[12px]","font-bold","tabular-nums","transition-all",3,"click"],[1,"flex","h-8","w-8","items-center","justify-center","rounded-full","text-text-secondary/40","transition-all","hover:text-text-secondary",3,"click"],[1,"mx-auto","mt-4","flex","max-w-xs","items-center","gap-1","rounded-full","bg-gray-100","p-1","dark:bg-white/5"],[1,"mt-3","text-center","text-xs","font-medium","text-primary"],[1,"mt-4"],[3,"requestVoiceAnalysis","recordingCompleted","deleteRecording","shadowToggled","edit","text","modelAudioUrl","isModelPlaying","savedRecordings","analyzingRecordingId","deletingRecordingId"],[1,"flex","h-9","w-9","items-center","justify-center","rounded-full","text-text-secondary/60","transition-all","hover:text-text-primary",3,"click"],[1,"h-3.5","w-3.5","fill-current",3,"img"],[1,"h-8","flex-1","rounded-full","text-[13px]","font-semibold","transition-all",3,"class"],[1,"h-8","flex-1","rounded-full","text-[13px]","font-semibold","transition-all",3,"click"],[1,"shadowing-history-skeleton"],[1,"mb-3","h-3.5","w-3/4","rounded","bg-gray-100","dark:bg-white/10"],[1,"mb-2","h-3.5","w-full","rounded","bg-gray-100","dark:bg-white/10"],[1,"h-3","w-1/3","rounded","bg-gray-100","dark:bg-white/10"],[1,"shadowing-history-empty-icon"],[1,"text-sm","font-semibold","text-text-muted"],[1,"mb-2","mt-1.5","text-xs","leading-relaxed","text-text-muted/80"],["type","button",1,"mt-2","inline-flex","h-9","items-center","justify-center","gap-1.5","rounded-full","bg-primary/10","px-4","text-xs","font-bold","text-primary","transition-all","hover:bg-primary/20","active:scale-95","dark:bg-primary/20","dark:hover:bg-primary/30",3,"click"],["role","button","tabindex","0",1,"shadowing-history-item","group","flex","items-start","gap-3",3,"shadowing-history-item-active"],["role","button","tabindex","0",1,"shadowing-history-item","group","flex","items-start","gap-3",3,"click","keydown.enter","keydown.space"],[1,"min-w-0","flex-1"],[1,"shadowing-history-preview"],[1,"shadowing-history-date","mt-1.5","block"],[1,"shadowing-history-delete-slot"],["type","button",1,"shadowing-history-delete",3,"click","disabled"],[1,"h-3.5","w-3.5",3,"img"],[1,"absolute","inset-0","bg-black/50","backdrop-blur-sm",3,"click"],[1,"animate-slideUp","absolute","inset-x-0","bottom-0","max-h-[70vh]","overflow-hidden","rounded-t-2xl","bg-background"],[1,"flex","justify-center","py-3"],[1,"h-1","w-10","rounded-full","bg-gray-300","dark:bg-gray-600"],[1,"flex","items-center","justify-between","border-b","border-border","px-4","pb-3"],[1,"flex","items-center","gap-2","text-sm","font-semibold","text-text-primary"],[1,"h-4","w-4","text-text-secondary",3,"img"],[1,"custom-scrollbar","max-h-[calc(70vh-80px)]","overflow-y-auto","p-4"],["type","button",1,"mt-4","inline-flex","h-9","items-center","justify-center","gap-1.5","rounded-full","bg-primary/10","px-4","text-xs","font-bold","text-primary","transition-all","hover:bg-primary/20","active:scale-95","dark:bg-primary/20","dark:hover:bg-primary/30",3,"click"]],template:function(e,i){e&1&&(d(0,"div",2),et(1,en,11,8,"ng-template",null,0,ot),d(3,"div",3)(4,"div",4)(5,"div",5)(6,"header",6)(7,"div",7)(8,"h1",8),l(9),m(10,"translate"),a(),d(11,"p",9),l(12),m(13,"translate"),a()(),d(14,"div",10)(15,"button",11),m(16,"translate"),w("click",function(){return i.toggleMobileHistory()}
1),u(17,"lucide-icon",12),a()()(),d(18,"div",13),P(19,an,28,19,"section",14)(20,mn,36,28,"div",15),a()(),d(21,"aside",16)(22,"div",17)(23,"div",18)(24,"h2",19),l(25),m(26,"translate"),a()()(),d(27,"div",20),P(28,hn,3,0,"div",21)(29,fn,12,10,"div",22)(30,yn,3,0,"div",23),a()()()()(),P(31,Mn,16,6,"div",24)),e&2&&(r(9),E(p(10,8,"GENERATE_PRACTICE_AUDIO")),r(3),E(p(13,10,"SHADOWING_SUBTITLE")),r(3),se("title",p(16,12,"RECENT_GENERATIONS")),r(2),f("img",i.icons.History),r(2),R(i.hasAudio()?20:19),r(6),x(" ",p(26,14,"RECENT_GENERATIONS")," "),r(3),R(i.isGenerationsLoading()?28:i.generations().length===0?29:30),r(3),R(i.showMobileHistory()?31:-1))},dependencies:[vt,_t,bt,yt,oe,ne,Ee,Oe,Z],styles:["[_nghost-%COMP%]{display:block;height:100%}@keyframes _ngcontent-%COMP%_slideUp{0%{transform:translateY(100%);opacity:0}to{transform:translateY(0);opacity:1}}.animate-slideUp[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_slideUp .3s ease-out}.shadowing-page[_ngcontent-%COMP%]{display:flex;height:100%;min-height:0px;flex-direction:column;--tw-bg-opacity: 1;background-color:rgb(var(--color-background) / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}.shadowing-page-inner[_ngcontent-%COMP%]{margin-left:auto;margin-right:auto;display:flex;min-height:0px;width:100%;max-width:1380px;flex:1 1 0%;flex-direction:column;padding:2rem 1rem}@media(min-width:768px){.shadowing-page-inner[_ngcontent-%COMP%]{padding-left:2rem;padding-right:2rem}}.shadowing-page-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding-bottom:.5rem}.shadowing-page-title[_ngcontent-%COMP%]{font-size:30px;font-weight:900;letter-spacing:-.025em;--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}@media(min-width:640px){.shadowing-page-title[_ngcontent-%COMP%]{font-size:36px}}.shadowing-page-subtitle[_ngcontent-%COMP%]{max-width:42rem;font-size:1rem;line-height:1.5rem;font-weight:500;line-height:1.625;--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1))}@media(min-width:640px){.shadowing-page-subtitle[_ngcontent-%COMP%]{font-size:17px}}.shadowing-header-action[_ngcontent-%COMP%]{display:flex;height:2.5rem;width:2.5rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:9999px;--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.shadowing-header-action[_ngcontent-%COMP%]:hover{background:#0f172a0a}.shadowing-layout[_ngcontent-%COMP%]{min-height:0px;flex:1 1 0%}@media(min-width:1024px){.shadowing-layout[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) 384px;gap:1.25rem}}.shadowing-main-column[_ngcontent-%COMP%]{display:flex;min-height:0px;flex:1 1 0%;flex-direction:column}.shadowing-main[_ngcontent-%COMP%]{min-height:0px;flex:1 1 0%;overflow-y:auto;padding-top:1.25rem}.shadowing-compose-card[_ngcontent-%COMP%]{margin-left:auto;margin-right:auto;width:100%;max-width:1120px;overflow:hidden;border-radius:34px;padding:1rem;--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@media(min-width:640px){.shadowing-compose-card[_ngcontent-%COMP%]{padding:1.25rem}}.shadowing-compose-card[_ngcontent-%COMP%]{background:#ffffffe0;box-shadow:0 26px 70px -56px #0f172a38}.shadowing-compose-shell[_ngcontent-%COMP%]{position:relative;border-radius:28px;padding:1.75rem;background:#0f172a06;min-height:clamp(420px,58vh,620px)}.shadowing-editor-input[_ngcontent-%COMP%]{height:100%;width:100%;resize:none;border-style:none;background-color:transparent;padding:0 0 56px;--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px;min-height:100%;font-size:21px;line-height:1.62}.shadowing-editor-input[_ngcontent-%COMP%]::placeholder{color:#64748b80}.shadowing-editor-overlay[_ngcontent-%COMP%]{pointer-events:none;position:absolute;bottom:1.5rem;right:1.75rem;display:flex;align-items:center;gap:.75rem}.shadowing-counter[_ngcontent-%COMP%]{display:inline-flex;align-items:center;border-radius:9999px;padding:.25rem .625rem;font-size:.75rem;line-height:1rem;font-weight:600;--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1))}.shadowing-compose-toolbar[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem;border-top-width:1px;padding-top:1rem}@media(min-width:640px){.shadowing-compose-toolbar[_ngcontent-%COMP%]{flex-direction:row;align-items:center;justify-content:space-between}}.shadowing-compose-toolbar[_ngcontent-%COMP%]{border-color:#0f172a0f}.shadowing-voice-chip[_ngcontent-%COMP%]{display:inline-flex;height:2.75rem;
1align-items:center;gap:.625rem;border-radius:9999px;background-color:rgb(var(--color-text-primary) / .03);padding-left:1rem;padding-right:1rem;text-align:left;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.shadowing-voice-chip[_ngcontent-%COMP%]:hover{background-color:rgb(var(--color-text-primary) / .06)}.shadowing-voice-chip[_ngcontent-%COMP%]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.shadowing-voice-chip-content[_ngcontent-%COMP%]{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;justify-content:center}.shadowing-voice-chip-name-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.375rem;line-height:1}.shadowing-voice-chip-label[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:700;--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}.shadowing-voice-chip-sublabel[_ngcontent-%COMP%]{margin-top:.125rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:600;text-transform:uppercase;line-height:1;letter-spacing:.05em;--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1))}.shadowing-voice-chip-badge[_ngcontent-%COMP%]{display:inline-flex;align-items:center;border-radius:.375rem;border-width:1px;border-color:#f59e0b26;background-color:#f59e0b0d;padding:.125rem .25rem;font-size:9px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1));line-height:1}.dark[_nghost-%COMP%]   .shadowing-voice-chip-badge[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-voice-chip-badge[_ngcontent-%COMP%]{border-color:#f59e0b40;background-color:#f59e0b1a;--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.shadowing-voice-chip-chevron[_ngcontent-%COMP%]{flex-shrink:0;--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.2s}.shadowing-voice-chip[_ngcontent-%COMP%]:hover   .shadowing-voice-chip-chevron[_ngcontent-%COMP%]{--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}.shadowing-compose-actions[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:.5rem}.shadowing-generate-btn[_ngcontent-%COMP%]{display:inline-flex;height:2.75rem;min-width:172px;align-items:center;justify-content:center;gap:.5rem;border-radius:9999px;padding-left:1.5rem;padding-right:1.5rem;font-size:14px;font-weight:700;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;background:rgb(var(--color-primary) / 1);box-shadow:0 14px 28px -24px rgb(var(--color-primary) / .8)}.shadowing-generate-btn[_ngcontent-%COMP%]:hover{background:rgb(var(--color-primary) / .92)}.shadowing-generate-btn[_ngcontent-%COMP%]:disabled{cursor:not-allowed;background:#e2e8f0f5;box-shadow:none;color:#94a3b8f2}.shadowing-back-btn[_ngcontent-%COMP%]{margin-bottom:1rem;display:inline-flex;align-items:center;gap:.375rem;font-size:.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.shadowing-back-btn[_ngcontent-%COMP%]:hover{--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}.shadowing-practice-card[_ngcontent-%COMP%]{border-radius:28px;border-width:1px;--tw-shadow: 0 16px 40px -32px rgba(15,23,42,.45);
1--tw-shadow-colored: 0 16px 40px -32px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);border-color:#0f172a14;background:#fffffff2;box-shadow:0 0 0 1px rgb(var(--color-primary) / .1),0 16px 40px -32px #0f172a73}.shadowing-history-panel[_ngcontent-%COMP%]{min-height:0px;flex-direction:column}@media(min-width:1024px){.shadowing-history-panel[_ngcontent-%COMP%]{border-left-width:1px;padding-left:1.25rem}}.shadowing-history-panel[_ngcontent-%COMP%]{border-color:#0f172a0f}.shadowing-history-header[_ngcontent-%COMP%]{display:flex;align-items:flex-start;justify-content:space-between;padding-bottom:1rem}.shadowing-history-heading[_ngcontent-%COMP%]{display:flex;align-items:center}.shadowing-history-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;letter-spacing:-.01em;--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}.shadowing-history-body[_ngcontent-%COMP%]{min-height:0px;flex:1 1 0%;overflow-y:auto;padding-right:.75rem;margin-right:-12px;scrollbar-gutter:stable;scrollbar-width:thin}.shadowing-history-skeleton[_ngcontent-%COMP%]{border-radius:1rem;padding:1rem;background:#0f172a08}.shadowing-history-empty[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:5rem;padding-bottom:5rem;text-align:center}.shadowing-history-empty-icon[_ngcontent-%COMP%]{margin-bottom:1rem;display:flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:1rem;--tw-text-opacity: 1;color:rgb(var(--color-text-muted) / var(--tw-text-opacity, 1));background:#0f172a08}.shadowing-history-item[_ngcontent-%COMP%]{position:relative;display:flex;width:100%;gap:.75rem;border-radius:1rem;border-width:1px;border-color:transparent;padding:.75rem .875rem;text-align:left;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;background:transparent}.shadowing-history-item[_ngcontent-%COMP%]:hover{background:#0f172a08}.shadowing-history-item-active[_ngcontent-%COMP%]{border-color:rgb(var(--color-primary) / .15);background:rgb(var(--color-primary) / .04)}.shadowing-history-icon[_ngcontent-%COMP%]{display:flex;height:2rem;width:2rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(var(--color-border-subtle) / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(var(--color-text-secondary) / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;background:rgb(var(--color-card))}.shadowing-history-item[_ngcontent-%COMP%]:hover   .shadowing-history-icon[_ngcontent-%COMP%]{border-color:rgb(var(--color-primary) / .2);--tw-text-opacity: 1;color:rgb(var(--color-primary) / var(--tw-text-opacity, 1))}.shadowing-history-item-active[_ngcontent-%COMP%]   .shadowing-history-icon[_ngcontent-%COMP%]{border-color:rgb(var(--color-primary) / .3);--tw-text-opacity: 1;color:rgb(var(--color-primary) / var(--tw-text-opacity, 1));background:rgb(var(--color-background))}.shadowing-history-date[_ngcontent-%COMP%]{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#64748b8c}.shadowing-history-preview[_ngcontent-%COMP%]{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:14px;font-weight:600;line-height:1.625;--tw-text-opacity: 1;color:rgb(var(--color-text-primary) / var(--tw-text-opacity, 1))}.shadowing-history-delete-slot[_ngcontent-%COMP%]{pointer-events:none;position:absolute;right:.75rem;top:.75rem;z-index:10;display:flex;align-items:center}.shadowing-history-delete[_ngcontent-%COMP%]{pointer-events:auto;display:flex;height:1.75rem;width:1.75rem;align-items:center;justify-content:center;border-radius:.75rem;color:rgb(var(--color-text-muted) / .6);opacity:1;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}
1.shadowing-history-delete[_ngcontent-%COMP%]:hover{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity, 1))!important}@media(min-width:1024px){.shadowing-history-delete[_ngcontent-%COMP%]{color:rgb(var(--color-text-muted) / .5);opacity:0}.group[_ngcontent-%COMP%]:hover   .shadowing-history-delete[_ngcontent-%COMP%]{opacity:1}}.shadowing-history-delete[_ngcontent-%COMP%]{background:#f8fafce6;box-shadow:0 6px 16px -14px #0f172a59}.shadowing-history-delete[_ngcontent-%COMP%]:focus-visible{opacity:1;outline:2px solid transparent;outline-offset:2px;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000);--tw-ring-color: rgb(var(--color-primary) / .25)}@media(max-width:1023px){.shadowing-page-inner[_ngcontent-%COMP%]{padding-top:1.5rem;padding-bottom:1.5rem}.shadowing-layout[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.shadowing-compose-card[_ngcontent-%COMP%]{max-width:none}.shadowing-history-panel[_ngcontent-%COMP%]{border-left-width:0px;padding-left:0}.shadowing-history-body[_ngcontent-%COMP%]{margin-right:0}}@media(max-width:639px){.shadowing-page-title[_ngcontent-%COMP%]{font-size:28px}.shadowing-compose-card[_ngcontent-%COMP%]{border-radius:28px;padding:.75rem}.shadowing-compose-shell[_ngcontent-%COMP%]{border-radius:24px;padding:1.25rem;min-height:360px}.shadowing-editor-input[_ngcontent-%COMP%]{font-size:19px}.shadowing-editor-overlay[_ngcontent-%COMP%]{bottom:1.25rem;right:1.25rem}.shadowing-compose-actions[_ngcontent-%COMP%], .shadowing-generate-btn[_ngcontent-%COMP%]{width:100%}}.dark[_nghost-%COMP%]   .shadowing-compose-card[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-compose-card[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-history-panel[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-panel[_ngcontent-%COMP%]{box-shadow:none}.dark[_nghost-%COMP%]   .shadowing-compose-card[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-compose-card[_ngcontent-%COMP%]{background:#ffffff08;box-shadow:none}.dark[_nghost-%COMP%]   .shadowing-compose-shell[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-compose-shell[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-counter[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-counter[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-history-skeleton[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-skeleton[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-history-empty-icon[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-empty-icon[_ngcontent-%COMP%]{background:#ffffff0a}.dark[_nghost-%COMP%]   .shadowing-history-item[_ngcontent-%COMP%]:hover, .dark   [_nghost-%COMP%]   .shadowing-history-item[_ngcontent-%COMP%]:hover{background:#ffffff09}.dark[_nghost-%COMP%]   .shadowing-history-item-active[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-item-active[_ngcontent-%COMP%]{border-color:rgb(var(--color-primary) / .3);background:rgb(var(--color-primary) / .08)}.dark[_nghost-%COMP%]   .shadowing-history-icon[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-icon[_ngcontent-%COMP%]{border-color:#ffffff14;background:#ffffff05}.dark[_nghost-%COMP%]   .shadowing-history-item-active[_ngcontent-%COMP%]   .shadowing-history-icon[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-item-active[_ngcontent-%COMP%]   .shadowing-history-icon[_ngcontent-%COMP%]{border-color:rgb(var(--color-primary) / .3);background:#ffffff0d}.dark[_nghost-%COMP%]   .shadowing-history-date[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-date[_ngcontent-%COMP%]{color:#ffffff73}.dark[_nghost-%COMP%]   .shadowing-history-panel[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-panel[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-compose-toolbar[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-compose-toolbar[_ngcontent-%COMP%]{border-color:#ffffff14}.dark[_nghost-%COMP%]   .shadowing-header-action[_ngcontent-%COMP%]:hover, .dark   [_nghost-%COMP%]   .shadowing-header-action[_ngcontent-%COMP%]:hover{background:#ffffff0f}.dark[_nghost-%COMP%]   .shadowing-editor-input[_ngcontent-%COMP%]::placeholder, .dark   [_nghost-%COMP%]   .shadowing-editor-input[_ngcontent-%COMP%]::placeholder, .dark[_nghost-%COMP%]   .shadowing-counter[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-counter[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-page-subtitle[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-page-subtitle[_ngcontent-%COMP%], .dark[_nghost-%COMP%]   .shadowing-history-empty-icon[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-empty-icon[_ngcontent-%COMP%]{color:#ffffff9e}.dark[_nghost-%COMP%]   .shadowing-history-empty-icon[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-empty-icon[_ngcontent-%COMP%]{background:#ffffff0d}.dark[_nghost-%COMP%]   .shadowing-history-title[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-title[_ngcontent-%COMP%]{color:#ffffffeb}
1.dark[_nghost-%COMP%]   .shadowing-history-delete[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-history-delete[_ngcontent-%COMP%]{background:#0f172ab8}.dark[_nghost-%COMP%]   .shadowing-practice-card[_ngcontent-%COMP%], .dark   [_nghost-%COMP%]   .shadowing-practice-card[_ngcontent-%COMP%]{border-color:#ffffff14;background:#ffffff08;box-shadow:none}"],changeDetection:0})};export{Jt as Shadowing};

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.