PageSourceSearch

https://agent.indigenius.ai/assets/ViewSpeechRecognition.-IOfSbAc.js

js indigenius.ai collected 2026-10-05 12:03:42 UTC 9,597 bytes, 1 lines download raw bytes

1import{j as e}from"./mui.B9HW9m_e.js";import{r as x}from"./vendor.CCuztsy9.js";import{R as y}from"./ResponsivePanel.Bp7RrT3h.js";import{j as P,u as L,a as R,a0 as I,fb as D,B as E,f5 as M,h as N,J as V}from"./index.DzLTFuWV.js";import{E as $}from"./ExitIcon.FCVOZ1aF.js";import{g as U}from"./dateUtils.x9P36hI1.js";import{h as _,R as z}from"./react-audio-visualize.es.CTUhGz_5.js";import{P as Z}from"./PlayIcon.C8KJwlD3.js";import{P as W}from"./PauseIcon.BBLecDz0.js";import{f as J}from"./formatters.7inWRbqg.js";import{L as q}from"./Loader.C1hX8gue.js";import"./useFillViewportHeight.Bi7AatoR.js";function G({size:a=20,color:n,className:l,isActive:o=!1}){const s=o?"#1BB6E9":n||"#090302";return e.jsxs("svg",{width:a,height:a,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:l,children:[e.jsx("path",{d:"M12.5003 18.4583H7.50033C5.29522 18.4583 3.84067 17.9853 2.92784 17.0724C2.01501 16.1596 1.54199 14.7051 1.54199 12.5V7.49996C1.54199 5.29486 2.01501 3.8403 2.92784 2.92747C3.84067 2.01464 5.29522 1.54163 7.50033 1.54163H11.667C11.6971 1.54163 11.7284 1.55391 11.7541 1.57955C11.7797 1.6052 11.792 1.63648 11.792 1.66663C11.792 1.69677 11.7797 1.72805 11.7541 1.7537C11.7284 1.77934 11.6971 1.79163 11.667 1.79163H7.50033C5.54422 1.79163 4.06923 2.13436 3.10198 3.10161C2.13473 4.06887 1.79199 5.54385 1.79199 7.49996V12.5C1.79199 14.4561 2.13473 15.9311 3.10198 16.8983C4.06923 17.8656 5.54422 18.2083 7.50033 18.2083H12.5003C14.4564 18.2083 15.9314 17.8656 16.8987 16.8983C17.8659 15.9311 18.2087 14.4561 18.2087 12.5V8.33329C18.2087 8.30315 18.2209 8.27186 18.2466 8.24622C18.2722 8.22058 18.3035 8.20829 18.3337 8.20829C18.3638 8.20829 18.3951 8.22058 18.4207 8.24622C18.4464 8.27186 18.4587 8.30315 18.4587 8.33329V12.5C18.4587 14.7051 17.9856 16.1596 17.0728 17.0724C16.16 17.9853 14.7054 18.4583 12.5003 18.4583Z",fill:s,stroke:s}),e.jsx("path",{d:"M11.6082 1.55699L11.6153 1.5542L11.6223 1.55119C11.6561 1.53668 11.7108 1.53835 11.7605 1.58388L18.4218 8.24517C18.4563 8.27969 18.4663 8.33783 18.4491 8.37799C18.4263 8.4312 18.3796 8.45828 18.3337 8.45828H15.0003C13.6212 8.45828 12.7982 8.18656 12.306 7.69431C11.8137 7.20206 11.542 6.37905 11.542 4.99995V1.66662C11.542 1.64125 11.5498 1.61589 11.5635 1.5951C11.5769 1.57481 11.593 1.56293 11.6082 1.55699ZM12.6455 2.8214L11.792 1.96784V3.17495V4.99995C11.792 6.07528 11.9203 6.94782 12.4864 7.51392C13.0525 8.08002 13.925 8.20828 15.0003 8.20828H16.8253H18.0324L17.1789 7.35473L12.6455 2.8214Z",fill:s,stroke:s}),e.jsx("path",{d:"M10.833 10.9584H5.83301C5.80286 10.9584 5.77158 10.9461 5.74594 10.9204C5.72029 10.8948 5.70801 10.8635 5.70801 10.8334C5.70801 10.8032 5.72029 10.7719 5.74594 10.7463C5.77158 10.7207 5.80286 10.7084 5.83301 10.7084H10.833C10.8632 10.7084 10.8944 10.7207 10.9201 10.7463C10.9457 10.7719 10.958 10.8032 10.958 10.8334C10.958 10.8635 10.9457 10.8948 10.9201 10.9204C10.8944 10.9461 10.8632 10.9584 10.833 10.9584Z",fill:s,stroke:s}),e.jsx("path",{d:"M9.16634 14.7916H5.83301C5.49134 14.7916 5.20801 14.5083 5.20801 14.1666C5.20801 13.825 5.49134 13.5416 5.83301 13.5416H9.16634C9.50801 13.5416 9.79134 13.825 9.79134 14.1666C9.79134 14.5083 9.50801 14.7916 9.16634 14.7916Z",fill:s})]})}const f=({label:a,children:n,className:l=""})=>e.jsxs("div",{className:P("text-cdial-black-500",l),children:[e.jsx("div",{className:"text-sm mb-1 font-semibold",children:a}),e.jsx("div",{className:"text-xs font-light",children:n})]}),K=({speaker:a,timeRange:n,text:l,className:o=""})=>e.jsxs("div",{className:`pb-4 ${o}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsx("div",{className:"text-sm text-cdial-black-500 font-semibold text-cdial-black-900",children:a}),e.jsx("div",{className:"text-xs font-normal font-sans text-[#858585]",children:n})]}),e.jsx("div",{className:"text-sm font-light text-cdial-black-600 leading-relaxed",children:l})]});var k=(a,n,l)=>new Promise((o,s)=>{var c=i=>{try{d(l.next(i))}catch(m){s(m)}},h=i=>{try{d(l.throw(i))}catch(m){s(m)}},d=i=>i.done?o(i.value):Promise.resolve(i.value).then(c,h);d((l=l.apply(a,n)).next())});const oe=()=>{var a;const n=L(),{srId:l}=R(),[o,s]=x.useState(null),[c,h]=x.useState(null),[d,i]=x.useState(!1),[m,v]=x.useState(0),u=x.useRef(null),{data:t,isLoading:F}=I(l?["/creative/speech-to-text-detail",l]:null,()=>D(l||"")),H=()=>k(void 0,null,function*(){if(l)try{yield M(l,"speechToText"),N("Transcript downloaded","success-download",{type:"success"})}catch(r){V.error("Error downloading speech-to-text file:",r),N("Failed to download transcript","error",{type:"error"})}});x.useEffect(()=>{if(!(t!=null&&t.fileUrl))return;const r=t.fileUrl;(A=>k(void 0,null,function*(){try{const p=yield fetch(A);if(!p.ok)return;const B=yield p.blob();s(B)}catch(p){}}))(r);const b=new _.Howl({src:[r],html5:!0,volume:1,onplay:()=>i(!0),onpause:()=>i(!1),onend:()=>{i(!1),v(0)}});return h(b),()=>{b&&b.unload(),u.current&&clearInterval(u.current)}},[t==null?void 0:t.fileUrl]);const S=x.useCallback(()=>{c&&(d?(c.pause(),u.current&&clearInterval(u.current)):(c.play(),u.current=window.setInterval(()=>v(c.seek()),200)))},[c,d]),g=(t==null?void 0:t.transcript)||[],j=Array.isArray(t==null?void 0:t.billingHistories)?t==null?void 0:t.billingHistories[0]:t==null?void 0:t.billingHistories,w=(a=j==null?void 0:j.duration)!=null?a:0,T=`${Math.floor(w/60)}:${String(Math.floor(w%60)).padStart(2,"0")}`;return F?e.jsx(y,{className:"bg-none w-full rounded-lg",children:e.jsx("div",{className:"bg-white rounded-lg mt-6",children:e.jsx(q,{className:"h-[60dvh]",color:"#3B82F6"})})}):e.jsxs(y,{className:"bg-none w-full rounded-lg",children:[e.jsxs("div",{className:"px-2 tablet:px-10 py-3 tablet:py-5 rounded-lg flex-shrink-0 flex items-center bg-white h-auto tablet:h-[60px]",children:[e.jsx("div",{className:"flex items-center gap-2 tablet:gap-3",children:e.jsxs("button",{onClick:()=>n(-1),className:"flex w-fit items-center space-x-1 tablet:space-x-2 px-2 tablet:px-3 h-[35px] tablet:h-[40px] py-2 border rounded-lg transition-colors border-[#F3F3F3] hover:bg-gray-50",children:[e.jsx($,{className:"w-4 tablet:w-5 h-4 tablet:h-5"}),e.jsx("span",{className:"text-xs tablet:text-sm font-medium",children:"Exit"})]})}),e.jsx("h2",{className:"text-sm tablet:text-base sm:text-lg text-center flex-1 capitalize font-nunito font-semibold text-foreground px-2","data-testid":"speech-recognition-title",children:"Transcript"})]}),e.jsx("div",{className:"bg-white mt-4 tablet:mt-6 rounded-lg overflow-hidden",children:e.jsxs("div",{className:"flex flex-col lg:flex-row",children:[e.jsx("aside",{id:"sr-view-details",className:"bg-white border-b lg:border-b-0 lg:border-r font-sans border-line-gray p-4 tablet:p-6 lg:max-w-[200px] w-full",children:e.jsxs("div",{className:"text-xs text-cdial-black-500 space-y-3",children:[e.jsx(f,{label:"File ID",children:(t==null?void 0:t.id)||"-"}),e.jsx(f,{label:"Upload Date",children:t!=null&&t.createdAt?U(new Date(t.createdAt)):"-"}),e.jsx(f,{label:"Uploaded File",children:e.jsx("span",{className:"text-cdial-black-600 text-xs truncate block max-w-[160px] mt-1",title:(t==null?void 0:t.fileName)||"-",children:(t==null?void 0:t.fileName)||"-"})}),e.jsx(f,{label:"Transcript",children:e.jsxs(E,{onClick:H,className:"px-2 flex h-[30px] w-fit items-center gap-2 mt-1 border border-line-gray",flat:!0,outlined:!0,children:[e.jsx(G,{color:"#292D32"}),e.jsx("span",{className:"text-cdial-black-600 text-xs",children:"Download"})]})}),e.jsx(f,{label:"File Size",children:typeof(t==null?void 0:t.fileSize)=="number"?J(t.fileSize):"-"}),e.jsx(f,{label:"File Type",children:(t==null?void 0:t.fileType)||"-"}),e.jsx(f,{label:"Audio Language",children:(t==null?void 0:t.language)||"
1-"})]})}),e.jsxs("section",{className:"bg-white w-full",children:[e.jsx("h4",{className:"text-xs tablet:text-sm px-3 tablet:px-4 py-2.5 font-normal text-cdial-black-500 h-10 text-left border-b border-b-line-gray font-sans",children:"Audio"}),e.jsxs("div",{id:"sr-view-audio-player",className:"flex justify-center items-center gap-2 tablet:gap-4 min-h-[120px] border-b border-b-line-gray px-4 tablet:px-10",children:[e.jsx("button",{onClick:S,className:"w-8 h-8 tablet:w-10 tablet:h-10 rounded-full bg-cdial-blue-500 flex items-center justify-center text-white hover:bg-cdial-blue-600 transition-colors scale-90",children:d?e.jsx(W,{color:"#ffffff",fill:"#ffffff",size:16}):e.jsx(Z,{color:"#ffffff",fill:"#ffffff",size:16})}),e.jsx("div",{className:"flex-1 overflow-x-auto overflow-y-hidden",children:c&&o?e.jsx(z,{blob:o,width:typeof window!="undefined"&&window.innerWidth<1024?Math.min(window.innerWidth-150,600):680,height:60,barWidth:6,gap:4,barColor:"#C1C1C1",barPlayedColor:"#3B82F6",currentTime:m}):e.jsx("div",{className:"h-12 bg-[#F3F3F3] rounded"})}),e.jsx("div",{className:"text-xs tablet:text-sm text-cdial-black-500 font-normal font-sans",children:T})]}),e.jsxs("div",{id:"sr-view-transcript",className:"w-full",children:[e.jsx("h4",{className:"text-xs tablet:text-sm px-3 tablet:px-4 py-2.5 font-normal text-cdial-black-500 h-10 text-left border-b border-b-line-gray font-sans",children:"Transcription"}),e.jsx("div",{className:"p-3 tablet:p-4 min-h-[220px]",children:e.jsx("div",{className:"bg-white border border-line-gray rounded-lg p-4 min-h-[220px]",children:e.jsx("div",{className:"space-y-4",children:g.length===0?e.jsx("p",{className:"text-sm text-cdial-black-500",children:"No transcript available."}):g.map((r,C)=>e.jsx(K,{speaker:r.speaker,timeRange:`${r.start_time} to ${r.end_time}`,text:r.text},`${r.speaker}-${r.start_time}-${C}`))})})})]})]})]})})]})};export{oe as default};

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.