pcm-agents 0.6.96 → 0.6.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/dist/cjs/components-position-selector.cjs.entry.js +1 -1
  2. package/dist/cjs/{conversation-utils-BTAEg4xl.js → conversation-utils-C2L56p0X.js} +4 -4
  3. package/dist/cjs/{conversation-utils-BTAEg4xl.js.map → conversation-utils-C2L56p0X.js.map} +1 -1
  4. package/dist/cjs/{index-77favCKO.js → index-6ScSQMo5.js} +3 -3
  5. package/dist/cjs/{index-77favCKO.js.map → index-6ScSQMo5.js.map} +1 -1
  6. package/dist/cjs/index.cjs.js +1 -1
  7. package/dist/cjs/oem-htws-modal.cjs.entry.js +1 -1
  8. package/dist/cjs/oem-jd-modal.cjs.entry.js +2 -2
  9. package/dist/cjs/oem-jlpp-modal.cjs.entry.js +1 -1
  10. package/dist/cjs/oem-jlsx-modal.cjs.entry.js +2 -2
  11. package/dist/cjs/oem-jlzz-modal.cjs.entry.js +1 -1
  12. package/dist/cjs/oem-mnct-modal.cjs.entry.js +1 -1
  13. package/dist/cjs/oem-mnms-modal.cjs.entry.js +2 -2
  14. package/dist/cjs/oem-mnms-modal.cjs.entry.js.map +1 -1
  15. package/dist/cjs/oem-mnms-modal.entry.cjs.js.map +1 -1
  16. package/dist/cjs/oem-qgqjl-modal.cjs.entry.js +3 -3
  17. package/dist/cjs/oem-zygh-modal_31.cjs.entry.js +11 -7
  18. package/dist/cjs/oem-zygh-modal_31.cjs.entry.js.map +1 -1
  19. package/dist/cjs/pcm-hr-chat-modal.cjs.entry.js +2 -2
  20. package/dist/cjs/{sentry-reporter-Bk4sUyeD.js → sentry-reporter-Wf6gLq1s.js} +3 -3
  21. package/dist/cjs/{sentry-reporter-Bk4sUyeD.js.map → sentry-reporter-Wf6gLq1s.js.map} +1 -1
  22. package/dist/collection/components/oem-mnms-modal/oem-mnms-modal.js +1 -1
  23. package/dist/collection/components/oem-mnms-modal/oem-mnms-modal.js.map +1 -1
  24. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.css +18 -2
  25. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js +1 -1
  26. package/dist/collection/components/pcm-app-chat-modal/pcm-app-chat-modal.js.map +1 -1
  27. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js +1 -1
  28. package/dist/collection/components/pcm-mnms-modal/pcm-mnms-modal.js.map +1 -1
  29. package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js +1 -1
  30. package/dist/collection/components/pcm-mnms-zp-modal/pcm-mnms-zp-modal.js.map +1 -1
  31. package/dist/collection/i18n/pcm-app-chat-modal.i18n.en.json +1 -0
  32. package/dist/collection/i18n/pcm-app-chat-modal.i18n.zh.json +1 -0
  33. package/dist/components/components-position-selector.js +1 -1
  34. package/dist/components/index.js +1 -1
  35. package/dist/components/oem-htws-modal.js +6 -6
  36. package/dist/components/oem-jd-modal.js +4 -4
  37. package/dist/components/oem-jlpp-modal.js +8 -8
  38. package/dist/components/oem-jlsx-modal.js +6 -6
  39. package/dist/components/oem-jlzz-modal.js +6 -6
  40. package/dist/components/oem-mnct-modal.js +8 -8
  41. package/dist/components/oem-mnms-modal.js +10 -10
  42. package/dist/components/oem-mnms-modal.js.map +1 -1
  43. package/dist/components/oem-qgqjl-modal.js +10 -10
  44. package/dist/components/oem-zygh-modal.js +6 -6
  45. package/dist/components/{p-BxadQZxO.js → p--b8iXa1k.js} +3 -3
  46. package/dist/components/{p-BxadQZxO.js.map → p--b8iXa1k.js.map} +1 -1
  47. package/dist/components/{p-C0H4jZIi.js → p-72SR4lcU.js} +3 -3
  48. package/dist/components/{p-C0H4jZIi.js.map → p-72SR4lcU.js.map} +1 -1
  49. package/dist/components/{p-DzsyVC1t.js → p-BHgYS8ia.js} +3 -3
  50. package/dist/components/{p-DzsyVC1t.js.map → p-BHgYS8ia.js.map} +1 -1
  51. package/dist/components/{p-BG6_220L.js → p-BWgGPwna.js} +3 -3
  52. package/dist/components/{p-BG6_220L.js.map → p-BWgGPwna.js.map} +1 -1
  53. package/dist/components/{p-Cwl8lxbK.js → p-CNgI7G9g.js} +3 -3
  54. package/dist/components/{p-Cwl8lxbK.js.map → p-CNgI7G9g.js.map} +1 -1
  55. package/dist/components/{p-BMU_3YY-.js → p-CsCmaYhd.js} +11 -7
  56. package/dist/components/p-CsCmaYhd.js.map +1 -0
  57. package/dist/components/{p-BrYBIrKw.js → p-D1xultOn.js} +3 -3
  58. package/dist/components/{p-BrYBIrKw.js.map → p-D1xultOn.js.map} +1 -1
  59. package/dist/components/{p-CdOggYcY.js → p-DM8HJ3S-.js} +3 -3
  60. package/dist/components/{p-CdOggYcY.js.map → p-DM8HJ3S-.js.map} +1 -1
  61. package/dist/components/{p-CD5KK3wz.js → p-EbgYrut6.js} +3 -3
  62. package/dist/components/{p-CD5KK3wz.js.map → p-EbgYrut6.js.map} +1 -1
  63. package/dist/components/{p-CAgn6yl5.js → p-qDtv62HM.js} +3 -3
  64. package/dist/components/{p-CAgn6yl5.js.map → p-qDtv62HM.js.map} +1 -1
  65. package/dist/components/{p-DjHvQ3lN.js → p-rE1cm-2A.js} +3 -3
  66. package/dist/components/{p-DjHvQ3lN.js.map → p-rE1cm-2A.js.map} +1 -1
  67. package/dist/components/{p-D464Cbwq.js → p-xec1MDLu.js} +4 -4
  68. package/dist/components/{p-D464Cbwq.js.map → p-xec1MDLu.js.map} +1 -1
  69. package/dist/components/pcm-1zhanshi-mnms-modal.js +5 -5
  70. package/dist/components/pcm-app-chat-modal.js +1 -1
  71. package/dist/components/pcm-ats-mnms-modal.js +5 -5
  72. package/dist/components/pcm-card.js +1 -1
  73. package/dist/components/pcm-chat-message.js +1 -1
  74. package/dist/components/pcm-digital-human.js +1 -1
  75. package/dist/components/pcm-export-records-modal.js +1 -1
  76. package/dist/components/pcm-hr-chat-modal.js +2 -2
  77. package/dist/components/pcm-htws-modal.js +8 -8
  78. package/dist/components/pcm-hyzj-modal.js +5 -5
  79. package/dist/components/pcm-jd-modal.js +5 -5
  80. package/dist/components/pcm-jlpp-modal.js +8 -8
  81. package/dist/components/pcm-jlsx-modal.js +5 -5
  82. package/dist/components/pcm-jlzz-modal.js +6 -6
  83. package/dist/components/pcm-mnct-modal.js +7 -7
  84. package/dist/components/pcm-mnms-modal.js +9 -9
  85. package/dist/components/pcm-mnms-modal.js.map +1 -1
  86. package/dist/components/pcm-mnms-zp-modal.js +9 -9
  87. package/dist/components/pcm-mnms-zp-modal.js.map +1 -1
  88. package/dist/components/pcm-mobile-input-btn.js +1 -1
  89. package/dist/components/pcm-mobile-upload-btn.js +1 -1
  90. package/dist/components/pcm-msbg-modal.js +5 -5
  91. package/dist/components/pcm-qgqjl-modal.js +9 -9
  92. package/dist/components/pcm-thousand-resume-wrapper.js +1 -1
  93. package/dist/components/pcm-upload.js +1 -1
  94. package/dist/components/pcm-virtual-chat-modal.js +1 -1
  95. package/dist/components/pcm-zsk-chat-modal.js +2 -2
  96. package/dist/components/pcm-zygh-modal.js +7 -7
  97. package/dist/components/pcm-zygh-v2-modal.js +7 -7
  98. package/dist/esm/components-position-selector.entry.js +1 -1
  99. package/dist/esm/{conversation-utils-BIr_PfAh.js → conversation-utils-BO3752fo.js} +4 -4
  100. package/dist/esm/{conversation-utils-BIr_PfAh.js.map → conversation-utils-BO3752fo.js.map} +1 -1
  101. package/dist/esm/{index-Comif8Mg.js → index-ChiwOP63.js} +3 -3
  102. package/dist/esm/{index-Comif8Mg.js.map → index-ChiwOP63.js.map} +1 -1
  103. package/dist/esm/index.js +1 -1
  104. package/dist/esm/oem-htws-modal.entry.js +1 -1
  105. package/dist/esm/oem-jd-modal.entry.js +2 -2
  106. package/dist/esm/oem-jlpp-modal.entry.js +1 -1
  107. package/dist/esm/oem-jlsx-modal.entry.js +2 -2
  108. package/dist/esm/oem-jlzz-modal.entry.js +1 -1
  109. package/dist/esm/oem-mnct-modal.entry.js +1 -1
  110. package/dist/esm/oem-mnms-modal.entry.js +2 -2
  111. package/dist/esm/oem-mnms-modal.entry.js.map +1 -1
  112. package/dist/esm/oem-qgqjl-modal.entry.js +3 -3
  113. package/dist/esm/oem-zygh-modal_31.entry.js +11 -7
  114. package/dist/esm/oem-zygh-modal_31.entry.js.map +1 -1
  115. package/dist/esm/pcm-hr-chat-modal.entry.js +2 -2
  116. package/dist/esm/{sentry-reporter-nfF0-Uk2.js → sentry-reporter-CbxGWjKB.js} +3 -3
  117. package/dist/esm/{sentry-reporter-nfF0-Uk2.js.map → sentry-reporter-CbxGWjKB.js.map} +1 -1
  118. package/dist/pcm-agents/i18n/pcm-app-chat-modal.i18n.en.json +1 -0
  119. package/dist/pcm-agents/i18n/pcm-app-chat-modal.i18n.zh.json +1 -0
  120. package/dist/pcm-agents/index.esm.js +1 -1
  121. package/dist/pcm-agents/oem-mnms-modal.entry.esm.js.map +1 -1
  122. package/dist/pcm-agents/{p-25fa617a.entry.js → p-083ed4c8.entry.js} +2 -2
  123. package/dist/pcm-agents/{p-5db93e8b.entry.js → p-0c24aaa6.entry.js} +3 -3
  124. package/dist/pcm-agents/p-0c24aaa6.entry.js.map +1 -0
  125. package/dist/pcm-agents/{p-6a5bc73b.entry.js → p-0f7ecd6e.entry.js} +2 -2
  126. package/dist/pcm-agents/{p-6da308b6.entry.js → p-510a4e7d.entry.js} +2 -2
  127. package/dist/pcm-agents/{p-d9b6a309.entry.js → p-83eb56c2.entry.js} +2 -2
  128. package/dist/pcm-agents/{p-fa0907cf.entry.js → p-8f048708.entry.js} +2 -2
  129. package/dist/pcm-agents/{p-6c2ad070.entry.js → p-9192a541.entry.js} +2 -2
  130. package/dist/pcm-agents/{p-De3vyGBR.js → p-BcP-XCgZ.js} +2 -2
  131. package/dist/pcm-agents/{p-De3vyGBR.js.map → p-BcP-XCgZ.js.map} +1 -1
  132. package/dist/pcm-agents/{p-DdVhVtJm.js → p-ZaVCcNkc.js} +2 -2
  133. package/dist/pcm-agents/{p-DdVhVtJm.js.map → p-ZaVCcNkc.js.map} +1 -1
  134. package/dist/pcm-agents/{p-0aa9f384.entry.js → p-cd4b6377.entry.js} +2 -2
  135. package/dist/pcm-agents/{p-e71df1c6.entry.js → p-d0a26bca.entry.js} +2 -2
  136. package/dist/pcm-agents/{p-e71df1c6.entry.js.map → p-d0a26bca.entry.js.map} +1 -1
  137. package/dist/pcm-agents/{p-cc8d9aec.entry.js → p-ec87f4ff.entry.js} +2 -2
  138. package/dist/pcm-agents/{p-53fb22c2.entry.js → p-fbeb3b8d.entry.js} +2 -2
  139. package/dist/pcm-agents/{p-BEWKdGwe.js → p-pt92A5Nu.js} +2 -2
  140. package/dist/pcm-agents/{p-BEWKdGwe.js.map → p-pt92A5Nu.js.map} +1 -1
  141. package/dist/pcm-agents/pcm-agents.esm.js +1 -1
  142. package/package.json +1 -1
  143. package/dist/components/p-BMU_3YY-.js.map +0 -1
  144. package/dist/pcm-agents/p-5db93e8b.entry.js.map +0 -1
  145. /package/dist/pcm-agents/{p-25fa617a.entry.js.map → p-083ed4c8.entry.js.map} +0 -0
  146. /package/dist/pcm-agents/{p-6a5bc73b.entry.js.map → p-0f7ecd6e.entry.js.map} +0 -0
  147. /package/dist/pcm-agents/{p-6da308b6.entry.js.map → p-510a4e7d.entry.js.map} +0 -0
  148. /package/dist/pcm-agents/{p-d9b6a309.entry.js.map → p-83eb56c2.entry.js.map} +0 -0
  149. /package/dist/pcm-agents/{p-fa0907cf.entry.js.map → p-8f048708.entry.js.map} +0 -0
  150. /package/dist/pcm-agents/{p-6c2ad070.entry.js.map → p-9192a541.entry.js.map} +0 -0
  151. /package/dist/pcm-agents/{p-0aa9f384.entry.js.map → p-cd4b6377.entry.js.map} +0 -0
  152. /package/dist/pcm-agents/{p-cc8d9aec.entry.js.map → p-ec87f4ff.entry.js.map} +0 -0
  153. /package/dist/pcm-agents/{p-53fb22c2.entry.js.map → p-fbeb3b8d.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as e,f as t}from"./p-Bq0K-WqZ.js";const o="https://api.pincaimao.com/agents/platform";const n="https://www.pincaimao.com";const r=(e,t,o)=>{const n=e.get(t);if(!n){e.set(t,[o])}else if(!n.includes(o)){n.push(o)}};const s=(e,t)=>{let o;return(...n)=>{if(o){clearTimeout(o)}o=setTimeout((()=>{o=0;e(...n)}),t)}};const c=e=>!("isConnected"in e)||e.isConnected;const a=s((e=>{for(let t of e.keys()){e.set(t,e.get(t).filter(c))}}),2e3);const i=()=>{if(typeof e!=="function"){return{}}const o=new Map;return{dispose:()=>o.clear(),get:t=>{const n=e();if(n){r(o,t,n)}},set:e=>{const n=o.get(e);if(n){o.set(e,n.filter(t))}a(o)},reset:()=>{o.forEach((e=>e.forEach(t)));a(o)}}};const u=e=>typeof e==="function"?e():e;const l=(e,t=(e,t)=>e!==t)=>{const o=u(e);let n=new Map(Object.entries(o??{}));const r={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(u(e)??{}));r.reset.forEach((e=>e()))};const c=()=>{r.dispose.forEach((e=>e()));s()};const a=e=>{r.get.forEach((t=>t(e)));return n.get(e)};const i=(e,o)=>{const s=n.get(e);if(t(o,s,e)){n.set(e,o);r.set.forEach((t=>t(e,o,s)))}};const l=typeof Proxy==="undefined"?{}:new Proxy(o,{get(e,t){return a(t)},ownKeys(e){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(e,t){return n.has(t)},set(e,t,o){i(t,o);return true}});const f=(e,t)=>{r[e].push(t);return()=>{d(r[e],t)}};const h=(t,o)=>{const n=f("set",((e,n)=>{if(e===t){o(n)}}));const r=f("reset",(()=>o(u(e)[t])));return()=>{n();r()}};const w=(...e)=>{const t=e.reduce(((e,t)=>{if(t.set){e.push(f("set",t.set))}if(t.get){e.push(f("get",t.get))}if(t.reset){e.push(f("reset",t.reset))}if(t.dispose){e.push(f("dispose",t.dispose))}return e}),[]);return()=>t.forEach((e=>e()))};const m=e=>{const t=n.get(e);r.set.forEach((o=>o(e,t,t)))};return{state:l,get:a,set:i,on:f,onChange:h,use:w,dispose:c,reset:s,forceUpdate:m}};const d=(e,t)=>{const o=e.indexOf(t);if(o>=0){e[o]=e[e.length-1];e.length--}};const f=(e,t)=>{const o=l(e,t);o.use(i());return o};const{state:h,onChange:w}=f({token:localStorage.getItem("pcm-sdk-auth-token")||null});const m={getToken:()=>h.token,setToken:e=>{h.token=e;localStorage.setItem("pcm-sdk-auth-token",e)},clearToken:()=>{h.token=null;localStorage.removeItem("pcm-sdk-auth-token")}};w("token",(e=>{if(e){localStorage.setItem("pcm-sdk-auth-token",e)}else{localStorage.removeItem("pcm-sdk-auth-token")}}));const p=()=>{try{const e=localStorage.getItem("pcm-sdk-config-data");return e?JSON.parse(e):{}}catch(e){console.error("Error parsing stored config:",e);return{}}};const{state:y,onChange:g}=f({data:p()});const k={getConfig:()=>y.data,getItem:(e,t)=>y.data[e]!==undefined?y.data[e]:t,setItem:(e,t)=>{y.data={...y.data,[e]:t}},removeItem:e=>{const t={...y.data};delete t[e];y.data=t},clear:()=>{y.data={}},updateConfig:e=>{y.data={...y.data,...e}}};g("data",(e=>{try{if(Object.keys(e).length>0){localStorage.setItem("pcm-sdk-config-data",JSON.stringify(e))}else{localStorage.removeItem("pcm-sdk-config-data")}}catch(e){console.error("Error saving config to localStorage:",e)}}));const T="0.6.96";function E(e,t,o){return(e||"")+(t?` ${t}`:"")+(o?` ${o}`:"")}const S=()=>m.getToken()||"";const $=3*60*1e3;const v=async(e,t,o=$)=>{const n=new AbortController;const r=setTimeout((()=>n.abort()),o);try{const o=await fetch(e,{...t,signal:n.signal});clearTimeout(r);return o}catch(e){clearTimeout(r);if(e instanceof Error&&e.name==="AbortError"){throw new Error("请求超时,请检查网络连接后重试")}throw e}};const b=async(e,t=false)=>{const{url:n,method:r,headers:s={},data:c,onMessage:a,onError:i,onComplete:u}=e;try{const i=`${o}${n}`;if(!s["authorization"]&&!s["Authorization"]){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const l=await v(i,{method:r,headers:{Accept:"text/event-stream","Content-Type":"application/json",...s},body:c?JSON.stringify(c):undefined});if(l.status===401){P();if(!t){return b(e,true)}}if(!l.ok){console.error(`HTTP error! status: ${l.status}`)}const d=l.body?.getReader();if(!d)throw new Error("No reader available");const f=new TextDecoder;let h="";while(true){const{value:e,done:t}=await d.read();if(t)break;h+=f.decode(e,{stream:true});const o=h.split("\n");h=o.pop()||"";for(const e of o){if(e.startsWith("data:")){try{const t=e.substring(5).trim();if(!t)continue;const o=JSON.parse(t);a?.(o)}catch(t){console.error("解析 SSE 数据错误:",t,"原始数据:",e)}}}}u?.()}catch(o){console.error("SSE 请求错误:",o);if(!t){return b(e,true)}i?.(o)}};const P=()=>{const e=new CustomEvent("pcm-token-invalid",{bubbles:true,composed:true,detail:{timestamp:(new Date).getTime()}});document.dispatchEvent(e)};const M=async(e,t=true)=>{const{url:n,method:r="GET",headers:s={},params:c={},data:a,formData:i,onMessage:u}=e;try{const l=new URLSearchParams;Object.entries(c).forEach((([e,t])=>{if(t!==undefined&&t!==null){l.append(e,String(t))}}));let d=`${o}${n}${l.toString()?`?${l.toString()}`:""}`;if(s["authorization"]==undefined&&s["Authorization"]==undefined){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const f={method:r,headers:i?{...s}:{"Content-Type":"application/json",...s}};if(i){f.body=i}else if(r!=="GET"&&r!=="HEAD"&&a){f.body=JSON.stringify(a)}if(r==="GET"&&a){const e=new URLSearchParams;Object.entries(a).forEach((([t,o])=>{if(o!==undefined&&o!==null){e.append(t,String(o))}}));d+=(l.toString()?"&":"?")+e.toString()}const h=await v(d,f);if(h.status===401){P();if(t){return M(e,false)}}const w=await h.json();if(u){u(w)}if(!h.ok){console.error(`HTTP错误: ${h.status} ${h.statusText}`);return{success:false,message:w.message||`HTTP错误: ${h.status}`,error:w}}if(w.code!==0){console.error(`API错误: ${w.message}`);return{success:false,message:w.message,error:w}}return{success:true,data:w.data}}catch(o){console.error("HTTP请求错误:",o);if(t){return M(e,false)}if(e.onError){e.onError(o)}return{success:false,error:o,message:o instanceof Error?o.message:"未知错误"}}finally{if(e.onComplete){e.onComplete()}}};const O=async e=>{const t=await M({url:"/sdk/v1/user",method:"GET",headers:{Authorization:`Bearer ${e}`},data:{sdk_version:T}},false);if(!t.success&&t.error&&t.error.code===401){return false}else{k.setItem("pcm-sdk-CUser",`${t.data.user}(${t.data.chat_user})`);return t.success}};const C=async e=>{if(!e){throw new Error("智能体ID不能为空")}try{const t=await M({url:`/sdk/v1/agent/${e}/info`,method:"GET"});if(!t.success){throw new Error(t.message||"获取智能体信息失败")}return t.data}catch(e){console.error("获取智能体信息失败:",e);throw e}};var _;(function(e){e["Init"]="init";e["Uploading"]="uploading";e["Success"]="success";e["Failed"]="failed"})(_||(_={}));const A=async e=>new Promise(((t,o)=>{const n=new FileReader;n.onload=async e=>{try{const o=e.target?.result;const n=await crypto.subtle.digest("SHA-256",o);const r=Array.from(new Uint8Array(n));const s=r.map((e=>e.toString(16).padStart(2,"0"))).join("");t(s)}catch(e){o(e)}};n.onerror=()=>o(new Error("读取文件失败"));n.readAsArrayBuffer(e)}));const I=async(e,t,o="application/octet-stream",n=2)=>{let r=0;while(true){try{const n=await v(e,{method:"PUT",body:t,headers:{"Content-Type":o}});if(!n.ok){throw new Error(`文件上传失败: ${n.status} ${n.statusText}`)}return n}catch(e){r++;console.error(`文件上传错误(尝试 ${r}/${n}):`,e);if(r>=n){throw e}}}};const R=async(e,t,o)=>{try{const n=await A(e);const r=await M({url:"/sdk/v1/files/generate-upload-url",method:"POST",data:{...o,filename:e.name,filesize:e.size,sha256:n},headers:t});if(!r.success||!r.data){throw new Error(r.message||"获取上传URL失败")}const s=r.data;if(s.is_deleted!=1){const o=await I(s.upload_url,e,s.content_type||"application/octet-stream");if(!o.ok){throw new Error(`文件上传到腾讯云失败: ${o.status} ${o.statusText}`)}M({url:"/sdk/v1/files/mark-as-upload",method:"POST",data:{cos_key:s.cos.cos_key},headers:t})}return{cos_key:s.cos.cos_key,file_name:s.filename,file_size:s.filesize,ext:s.filetype}}catch(e){console.error("文件上传错误:",e);throw e}};const U=async(e,t,n=false)=>{const r=S();if(!r){throw new Error("API密钥不能为空")}try{const s=await v(`${o}/sdk/v1/tts/synthesize_audio`,{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+r},body:JSON.stringify({text:e})});if(s.status===401){P();if(!n){return U(e,t,true)}}if(!s.ok){throw new Error("语音合成失败")}const c=await s.blob();return URL.createObjectURL(c)}catch(o){console.error("语音合成错误:",o);if(!n){return U(e,t,true)}throw o}};const j=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/presigned-url",method:"GET",params:{cos_key:e},headers:t});if(o.success&&o.data?.file_url){return o.data.file_url}return null}catch(e){console.error("获取预签名URL失败:",e);return null}};const N=async(e,t)=>{try{const o=await j(e,t);if(o){return`${o}${o.includes("?")?"&":"?"}ci-process=doc-preview&copyable=1&dstType=html`}return null}catch(e){console.error("获取预览URL失败:",e);return null}};const x=e=>{if(!e&&e!==0){return null}const t=Number(e);if(isNaN(t))return null;if(e<1024){return e+"B"}if(e<1024*1024){return(e/1024).toFixed(1)+"KB"}return(e/1024/1024).toFixed(1)+"MB"};const B=()=>{const e=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""};const L=()=>{const e=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查音频MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的音频MIME类型,将使用浏览器默认值");return""};const z=async e=>{try{const t=await M({url:"/sdk/v1/tts/audio_to_text",method:"POST",data:{cos_key:e}});if(t.success&&t.data&&t.data.text){return t.data.text}else{console.warn("音频转文字返回结果格式不正确");return null}}catch(e){console.error("音频转文字错误:",e);throw new Error("音频转文字失败")}};const G=async(e,t,o=0)=>{try{const n=await M({url:"/sdk/v1/verify_sms_code",method:"POST",params:{mobile:e,code:t,code_type:o}});return n}catch(e){console.error("校验短信验证码错误:",e);throw e}};const D=async e=>{const{oemId:t,page:o=1,pageSize:n=10,keyword:r}=e;try{const e=new URLSearchParams;e.append("page",o.toString());e.append("page_size",n.toString());if(r){e.append("keyword",r)}const s=await M({url:`/sdk/v1/oem/${t}/positions?${e.toString()}`,method:"GET"});return s}catch(e){console.error("获取OEM职位列表错误:",e);throw e}};const H=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/upload-by-url",method:"POST",data:e,headers:t});return o}catch(e){console.error("通过URL上传文件错误:",e);throw e}};export{_ as F,n as P,m as a,b,k as c,U as d,G as e,N as f,D as g,H as h,C as i,B as j,z as k,L as l,j as m,x as n,E as o,M as s,R as u,O as v};
2
- //# sourceMappingURL=p-De3vyGBR.js.map
1
+ import{a as e,f as t}from"./p-Bq0K-WqZ.js";const o="https://api.pincaimao.com/agents/platform";const n="https://www.pincaimao.com";const r=(e,t,o)=>{const n=e.get(t);if(!n){e.set(t,[o])}else if(!n.includes(o)){n.push(o)}};const s=(e,t)=>{let o;return(...n)=>{if(o){clearTimeout(o)}o=setTimeout((()=>{o=0;e(...n)}),t)}};const c=e=>!("isConnected"in e)||e.isConnected;const a=s((e=>{for(let t of e.keys()){e.set(t,e.get(t).filter(c))}}),2e3);const i=()=>{if(typeof e!=="function"){return{}}const o=new Map;return{dispose:()=>o.clear(),get:t=>{const n=e();if(n){r(o,t,n)}},set:e=>{const n=o.get(e);if(n){o.set(e,n.filter(t))}a(o)},reset:()=>{o.forEach((e=>e.forEach(t)));a(o)}}};const u=e=>typeof e==="function"?e():e;const l=(e,t=(e,t)=>e!==t)=>{const o=u(e);let n=new Map(Object.entries(o??{}));const r={dispose:[],get:[],set:[],reset:[]};const s=()=>{n=new Map(Object.entries(u(e)??{}));r.reset.forEach((e=>e()))};const c=()=>{r.dispose.forEach((e=>e()));s()};const a=e=>{r.get.forEach((t=>t(e)));return n.get(e)};const i=(e,o)=>{const s=n.get(e);if(t(o,s,e)){n.set(e,o);r.set.forEach((t=>t(e,o,s)))}};const l=typeof Proxy==="undefined"?{}:new Proxy(o,{get(e,t){return a(t)},ownKeys(e){return Array.from(n.keys())},getOwnPropertyDescriptor(){return{enumerable:true,configurable:true}},has(e,t){return n.has(t)},set(e,t,o){i(t,o);return true}});const f=(e,t)=>{r[e].push(t);return()=>{d(r[e],t)}};const h=(t,o)=>{const n=f("set",((e,n)=>{if(e===t){o(n)}}));const r=f("reset",(()=>o(u(e)[t])));return()=>{n();r()}};const w=(...e)=>{const t=e.reduce(((e,t)=>{if(t.set){e.push(f("set",t.set))}if(t.get){e.push(f("get",t.get))}if(t.reset){e.push(f("reset",t.reset))}if(t.dispose){e.push(f("dispose",t.dispose))}return e}),[]);return()=>t.forEach((e=>e()))};const m=e=>{const t=n.get(e);r.set.forEach((o=>o(e,t,t)))};return{state:l,get:a,set:i,on:f,onChange:h,use:w,dispose:c,reset:s,forceUpdate:m}};const d=(e,t)=>{const o=e.indexOf(t);if(o>=0){e[o]=e[e.length-1];e.length--}};const f=(e,t)=>{const o=l(e,t);o.use(i());return o};const{state:h,onChange:w}=f({token:localStorage.getItem("pcm-sdk-auth-token")||null});const m={getToken:()=>h.token,setToken:e=>{h.token=e;localStorage.setItem("pcm-sdk-auth-token",e)},clearToken:()=>{h.token=null;localStorage.removeItem("pcm-sdk-auth-token")}};w("token",(e=>{if(e){localStorage.setItem("pcm-sdk-auth-token",e)}else{localStorage.removeItem("pcm-sdk-auth-token")}}));const p=()=>{try{const e=localStorage.getItem("pcm-sdk-config-data");return e?JSON.parse(e):{}}catch(e){console.error("Error parsing stored config:",e);return{}}};const{state:y,onChange:g}=f({data:p()});const k={getConfig:()=>y.data,getItem:(e,t)=>y.data[e]!==undefined?y.data[e]:t,setItem:(e,t)=>{y.data={...y.data,[e]:t}},removeItem:e=>{const t={...y.data};delete t[e];y.data=t},clear:()=>{y.data={}},updateConfig:e=>{y.data={...y.data,...e}}};g("data",(e=>{try{if(Object.keys(e).length>0){localStorage.setItem("pcm-sdk-config-data",JSON.stringify(e))}else{localStorage.removeItem("pcm-sdk-config-data")}}catch(e){console.error("Error saving config to localStorage:",e)}}));const T="0.6.98";function E(e,t,o){return(e||"")+(t?` ${t}`:"")+(o?` ${o}`:"")}const S=()=>m.getToken()||"";const $=3*60*1e3;const v=async(e,t,o=$)=>{const n=new AbortController;const r=setTimeout((()=>n.abort()),o);try{const o=await fetch(e,{...t,signal:n.signal});clearTimeout(r);return o}catch(e){clearTimeout(r);if(e instanceof Error&&e.name==="AbortError"){throw new Error("请求超时,请检查网络连接后重试")}throw e}};const b=async(e,t=false)=>{const{url:n,method:r,headers:s={},data:c,onMessage:a,onError:i,onComplete:u}=e;try{const i=`${o}${n}`;if(!s["authorization"]&&!s["Authorization"]){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const l=await v(i,{method:r,headers:{Accept:"text/event-stream","Content-Type":"application/json",...s},body:c?JSON.stringify(c):undefined});if(l.status===401){P();if(!t){return b(e,true)}}if(!l.ok){console.error(`HTTP error! status: ${l.status}`)}const d=l.body?.getReader();if(!d)throw new Error("No reader available");const f=new TextDecoder;let h="";while(true){const{value:e,done:t}=await d.read();if(t)break;h+=f.decode(e,{stream:true});const o=h.split("\n");h=o.pop()||"";for(const e of o){if(e.startsWith("data:")){try{const t=e.substring(5).trim();if(!t)continue;const o=JSON.parse(t);a?.(o)}catch(t){console.error("解析 SSE 数据错误:",t,"原始数据:",e)}}}}u?.()}catch(o){console.error("SSE 请求错误:",o);if(!t){return b(e,true)}i?.(o)}};const P=()=>{const e=new CustomEvent("pcm-token-invalid",{bubbles:true,composed:true,detail:{timestamp:(new Date).getTime()}});document.dispatchEvent(e)};const M=async(e,t=true)=>{const{url:n,method:r="GET",headers:s={},params:c={},data:a,formData:i,onMessage:u}=e;try{const l=new URLSearchParams;Object.entries(c).forEach((([e,t])=>{if(t!==undefined&&t!==null){l.append(e,String(t))}}));let d=`${o}${n}${l.toString()?`?${l.toString()}`:""}`;if(s["authorization"]==undefined&&s["Authorization"]==undefined){const e=S();if(e){s["authorization"]=`Bearer ${e}`}}const f={method:r,headers:i?{...s}:{"Content-Type":"application/json",...s}};if(i){f.body=i}else if(r!=="GET"&&r!=="HEAD"&&a){f.body=JSON.stringify(a)}if(r==="GET"&&a){const e=new URLSearchParams;Object.entries(a).forEach((([t,o])=>{if(o!==undefined&&o!==null){e.append(t,String(o))}}));d+=(l.toString()?"&":"?")+e.toString()}const h=await v(d,f);if(h.status===401){P();if(t){return M(e,false)}}const w=await h.json();if(u){u(w)}if(!h.ok){console.error(`HTTP错误: ${h.status} ${h.statusText}`);return{success:false,message:w.message||`HTTP错误: ${h.status}`,error:w}}if(w.code!==0){console.error(`API错误: ${w.message}`);return{success:false,message:w.message,error:w}}return{success:true,data:w.data}}catch(o){console.error("HTTP请求错误:",o);if(t){return M(e,false)}if(e.onError){e.onError(o)}return{success:false,error:o,message:o instanceof Error?o.message:"未知错误"}}finally{if(e.onComplete){e.onComplete()}}};const O=async e=>{const t=await M({url:"/sdk/v1/user",method:"GET",headers:{Authorization:`Bearer ${e}`},data:{sdk_version:T}},false);if(!t.success&&t.error&&t.error.code===401){return false}else{k.setItem("pcm-sdk-CUser",`${t.data.user}(${t.data.chat_user})`);return t.success}};const C=async e=>{if(!e){throw new Error("智能体ID不能为空")}try{const t=await M({url:`/sdk/v1/agent/${e}/info`,method:"GET"});if(!t.success){throw new Error(t.message||"获取智能体信息失败")}return t.data}catch(e){console.error("获取智能体信息失败:",e);throw e}};var _;(function(e){e["Init"]="init";e["Uploading"]="uploading";e["Success"]="success";e["Failed"]="failed"})(_||(_={}));const A=async e=>new Promise(((t,o)=>{const n=new FileReader;n.onload=async e=>{try{const o=e.target?.result;const n=await crypto.subtle.digest("SHA-256",o);const r=Array.from(new Uint8Array(n));const s=r.map((e=>e.toString(16).padStart(2,"0"))).join("");t(s)}catch(e){o(e)}};n.onerror=()=>o(new Error("读取文件失败"));n.readAsArrayBuffer(e)}));const I=async(e,t,o="application/octet-stream",n=2)=>{let r=0;while(true){try{const n=await v(e,{method:"PUT",body:t,headers:{"Content-Type":o}});if(!n.ok){throw new Error(`文件上传失败: ${n.status} ${n.statusText}`)}return n}catch(e){r++;console.error(`文件上传错误(尝试 ${r}/${n}):`,e);if(r>=n){throw e}}}};const R=async(e,t,o)=>{try{const n=await A(e);const r=await M({url:"/sdk/v1/files/generate-upload-url",method:"POST",data:{...o,filename:e.name,filesize:e.size,sha256:n},headers:t});if(!r.success||!r.data){throw new Error(r.message||"获取上传URL失败")}const s=r.data;if(s.is_deleted!=1){const o=await I(s.upload_url,e,s.content_type||"application/octet-stream");if(!o.ok){throw new Error(`文件上传到腾讯云失败: ${o.status} ${o.statusText}`)}M({url:"/sdk/v1/files/mark-as-upload",method:"POST",data:{cos_key:s.cos.cos_key},headers:t})}return{cos_key:s.cos.cos_key,file_name:s.filename,file_size:s.filesize,ext:s.filetype}}catch(e){console.error("文件上传错误:",e);throw e}};const U=async(e,t,n=false)=>{const r=S();if(!r){throw new Error("API密钥不能为空")}try{const s=await v(`${o}/sdk/v1/tts/synthesize_audio`,{method:"POST",headers:{"Content-Type":"application/json",authorization:"Bearer "+r},body:JSON.stringify({text:e})});if(s.status===401){P();if(!n){return U(e,t,true)}}if(!s.ok){throw new Error("语音合成失败")}const c=await s.blob();return URL.createObjectURL(c)}catch(o){console.error("语音合成错误:",o);if(!n){return U(e,t,true)}throw o}};const j=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/presigned-url",method:"GET",params:{cos_key:e},headers:t});if(o.success&&o.data?.file_url){return o.data.file_url}return null}catch(e){console.error("获取预签名URL失败:",e);return null}};const N=async(e,t)=>{try{const o=await j(e,t);if(o){return`${o}${o.includes("?")?"&":"?"}ci-process=doc-preview&copyable=1&dstType=html`}return null}catch(e){console.error("获取预览URL失败:",e);return null}};const x=e=>{if(!e&&e!==0){return null}const t=Number(e);if(isNaN(t))return null;if(e<1024){return e+"B"}if(e<1024*1024){return(e/1024).toFixed(1)+"KB"}return(e/1024/1024).toFixed(1)+"MB"};const B=()=>{const e=["video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus","video/webm","video/mp4","video/mp4;codecs=h264,aac",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的MIME类型,将使用浏览器默认值");return""};const L=()=>{const e=["audio/webm;codecs=opus","audio/webm","audio/mp4","audio/ogg;codecs=opus","audio/ogg",""];if(!window.MediaRecorder){console.warn("MediaRecorder API不可用");return""}for(const t of e){if(!t)return"";try{if(MediaRecorder.isTypeSupported(t)){return t}}catch(e){console.warn(`检查音频MIME类型支持时出错 ${t}:`,e)}}console.warn("没有找到支持的音频MIME类型,将使用浏览器默认值");return""};const z=async e=>{try{const t=await M({url:"/sdk/v1/tts/audio_to_text",method:"POST",data:{cos_key:e}});if(t.success&&t.data&&t.data.text){return t.data.text}else{console.warn("音频转文字返回结果格式不正确");return null}}catch(e){console.error("音频转文字错误:",e);throw new Error("音频转文字失败")}};const G=async(e,t,o=0)=>{try{const n=await M({url:"/sdk/v1/verify_sms_code",method:"POST",params:{mobile:e,code:t,code_type:o}});return n}catch(e){console.error("校验短信验证码错误:",e);throw e}};const D=async e=>{const{oemId:t,page:o=1,pageSize:n=10,keyword:r}=e;try{const e=new URLSearchParams;e.append("page",o.toString());e.append("page_size",n.toString());if(r){e.append("keyword",r)}const s=await M({url:`/sdk/v1/oem/${t}/positions?${e.toString()}`,method:"GET"});return s}catch(e){console.error("获取OEM职位列表错误:",e);throw e}};const H=async(e,t)=>{try{const o=await M({url:"/sdk/v1/files/upload-by-url",method:"POST",data:e,headers:t});return o}catch(e){console.error("通过URL上传文件错误:",e);throw e}};export{_ as F,n as P,m as a,b,k as c,U as d,G as e,N as f,D as g,H as h,C as i,B as j,z as k,L as l,j as m,x as n,E as o,M as s,R as u,O as v};
2
+ //# sourceMappingURL=p-BcP-XCgZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-De3vyGBR.js","sources":["src/utils/env.ts","node_modules/.pnpm/@stencil+store@2.1.3_@stencil+core@4.31.0/node_modules/@stencil/store/dist/index.js","store/auth.store.ts","store/config.store.ts"],"sourcesContent":["// 默认 API 域名\r\nconst DEFAULT_API_DOMAIN = 'https://api.pincaimao.com/agents/platform';\r\nconst DEFAULT_PCM_DOMAIN = 'https://www.pincaimao.com';\r\n\r\n\r\n// 从环境变量获取 API 域名,如果未设置则使用默认值\r\nexport const API_DOMAIN = process.env.API_DOMAIN || DEFAULT_API_DOMAIN;\r\nexport const PCM_DOMAIN = process.env.PCM_DOMAIN || DEFAULT_PCM_DOMAIN;\r\n\r\n// 导出其他环境变量\r\nexport const ENV = {\r\n API_DOMAIN,\r\n PCM_DOMAIN,\r\n // 可以添加其他环境变量\r\n}; ","import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2_000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState ?? {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(unwrap(defaultState) ?? {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","// src/store/auth.store.ts\r\nimport { createStore } from '@stencil/store';\r\n\r\nexport const { state: authState, onChange } = createStore({\r\n token: localStorage.getItem('pcm-sdk-auth-token') || null\r\n});\r\n\r\n// 添加一些辅助方法\r\nexport const authStore = {\r\n getToken: () => authState.token,\r\n setToken: (token: string) => {\r\n authState.token = token;\r\n localStorage.setItem('pcm-sdk-auth-token', token);\r\n },\r\n clearToken: () => {\r\n authState.token = null;\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('token', value => {\r\n if (value) {\r\n localStorage.setItem('pcm-sdk-auth-token', value);\r\n } else {\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n});","import { createStore } from '@stencil/store';\r\n\r\n// 定义配置数据的类型\r\nexport interface ConfigData {\r\n [key: string]: any;\r\n}\r\n\r\n// 从localStorage获取初始配置\r\nconst getInitialConfig = (): ConfigData => {\r\n try {\r\n const storedConfig = localStorage.getItem('pcm-sdk-config-data');\r\n return storedConfig ? JSON.parse(storedConfig) : {};\r\n } catch (error) {\r\n console.error('Error parsing stored config:', error);\r\n return {};\r\n }\r\n};\r\n\r\n// 创建配置存储\r\nexport const { state: configState, onChange } = createStore<{\r\n data: ConfigData;\r\n}>({\r\n data: getInitialConfig()\r\n});\r\n\r\n// 配置存储的辅助方法\r\nexport const configStore = {\r\n // 获取整个配置对象\r\n getConfig: (): ConfigData => configState.data,\r\n \r\n // 获取特定配置项\r\n getItem: <T>(key: string, defaultValue?: T): T => {\r\n return configState.data[key] !== undefined ? configState.data[key] : defaultValue;\r\n },\r\n \r\n // 设置特定配置项\r\n setItem: <T>(key: string, value: T): void => {\r\n configState.data = {\r\n ...configState.data,\r\n [key]: value\r\n };\r\n },\r\n \r\n // 移除特定配置项\r\n removeItem: (key: string): void => {\r\n const newConfig = { ...configState.data };\r\n delete newConfig[key];\r\n configState.data = newConfig;\r\n },\r\n \r\n // 清除所有配置\r\n clear: (): void => {\r\n configState.data = {};\r\n },\r\n \r\n // 批量更新配置\r\n updateConfig: (newConfig: Partial<ConfigData>): void => {\r\n configState.data = {\r\n ...configState.data,\r\n ...newConfig\r\n };\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('data', value => {\r\n try {\r\n if (Object.keys(value).length > 0) {\r\n localStorage.setItem('pcm-sdk-config-data', JSON.stringify(value));\r\n } else {\r\n localStorage.removeItem('pcm-sdk-config-data');\r\n }\r\n } catch (error) {\r\n console.error('Error saving config to localStorage:', error);\r\n }\r\n}); "],"names":["onChange"],"mappings":";;AAAA;AAKA;AACO,MAAM,UAAU,GAAG,2CAA4C;AACzD,MAAA,UAAU,GAAG;;ACL1B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,KAAK;AAC9C,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;AACnC,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;AAClC;AACA,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrC,QAAQ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACzB;AACA,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK;AAC7B,IAAI,IAAI,SAAS;AACjB,IAAI,OAAO,CAAC,GAAG,IAAI,KAAK;AACxB,QAAQ,IAAI,SAAS,EAAE;AACvB,YAAY,YAAY,CAAC,SAAS,CAAC;AACnC;AACA,QAAQ,SAAS,GAAG,UAAU,CAAC,MAAM;AACrC,YAAY,SAAS,GAAG,CAAC;AACzB,YAAY,EAAE,CAAC,GAAG,IAAI,CAAC;AACvB,SAAS,EAAE,EAAE,CAAC;AACd,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAAW,GAAG,CAAC,YAAY,KAAK,EAAE,aAAa,IAAI,YAAY,CAAC,IAAI,YAAY,CAAC,WAAW;AAClG,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,GAAG,KAAK;AAC1C,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,EAAE;AAChC,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"p-BcP-XCgZ.js","sources":["src/utils/env.ts","node_modules/.pnpm/@stencil+store@2.1.3_@stencil+core@4.31.0/node_modules/@stencil/store/dist/index.js","store/auth.store.ts","store/config.store.ts"],"sourcesContent":["// 默认 API 域名\r\nconst DEFAULT_API_DOMAIN = 'https://api.pincaimao.com/agents/platform';\r\nconst DEFAULT_PCM_DOMAIN = 'https://www.pincaimao.com';\r\n\r\n\r\n// 从环境变量获取 API 域名,如果未设置则使用默认值\r\nexport const API_DOMAIN = process.env.API_DOMAIN || DEFAULT_API_DOMAIN;\r\nexport const PCM_DOMAIN = process.env.PCM_DOMAIN || DEFAULT_PCM_DOMAIN;\r\n\r\n// 导出其他环境变量\r\nexport const ENV = {\r\n API_DOMAIN,\r\n PCM_DOMAIN,\r\n // 可以添加其他环境变量\r\n}; ","import { getRenderingRef, forceUpdate } from '@stencil/core';\n\nconst appendToMap = (map, propName, value) => {\n const items = map.get(propName);\n if (!items) {\n map.set(propName, [value]);\n }\n else if (!items.includes(value)) {\n items.push(value);\n }\n};\nconst debounce = (fn, ms) => {\n let timeoutId;\n return (...args) => {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n timeoutId = 0;\n fn(...args);\n }, ms);\n };\n};\n\n/**\n * Check if a possible element isConnected.\n * The property might not be there, so we check for it.\n *\n * We want it to return true if isConnected is not a property,\n * otherwise we would remove these elements and would not update.\n *\n * Better leak in Edge than to be useless.\n */\nconst isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;\nconst cleanupElements = debounce((map) => {\n for (let key of map.keys()) {\n map.set(key, map.get(key).filter(isConnected));\n }\n}, 2_000);\nconst stencilSubscription = () => {\n if (typeof getRenderingRef !== 'function') {\n // If we are not in a stencil project, we do nothing.\n // This function is not really exported by @stencil/core.\n return {};\n }\n const elmsToUpdate = new Map();\n return {\n dispose: () => elmsToUpdate.clear(),\n get: (propName) => {\n const elm = getRenderingRef();\n if (elm) {\n appendToMap(elmsToUpdate, propName, elm);\n }\n },\n set: (propName) => {\n const elements = elmsToUpdate.get(propName);\n if (elements) {\n elmsToUpdate.set(propName, elements.filter(forceUpdate));\n }\n cleanupElements(elmsToUpdate);\n },\n reset: () => {\n elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));\n cleanupElements(elmsToUpdate);\n },\n };\n};\n\nconst unwrap = (val) => (typeof val === 'function' ? val() : val);\nconst createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {\n const unwrappedState = unwrap(defaultState);\n let states = new Map(Object.entries(unwrappedState ?? {}));\n const handlers = {\n dispose: [],\n get: [],\n set: [],\n reset: [],\n };\n const reset = () => {\n // When resetting the state, the default state may be a function - unwrap it to invoke it.\n // otherwise, the state won't be properly reset\n states = new Map(Object.entries(unwrap(defaultState) ?? {}));\n handlers.reset.forEach((cb) => cb());\n };\n const dispose = () => {\n // Call first dispose as resetting the state would\n // cause less updates ;)\n handlers.dispose.forEach((cb) => cb());\n reset();\n };\n const get = (propName) => {\n handlers.get.forEach((cb) => cb(propName));\n return states.get(propName);\n };\n const set = (propName, value) => {\n const oldValue = states.get(propName);\n if (shouldUpdate(value, oldValue, propName)) {\n states.set(propName, value);\n handlers.set.forEach((cb) => cb(propName, value, oldValue));\n }\n };\n const state = (typeof Proxy === 'undefined'\n ? {}\n : new Proxy(unwrappedState, {\n get(_, propName) {\n return get(propName);\n },\n ownKeys(_) {\n return Array.from(states.keys());\n },\n getOwnPropertyDescriptor() {\n return {\n enumerable: true,\n configurable: true,\n };\n },\n has(_, propName) {\n return states.has(propName);\n },\n set(_, propName, value) {\n set(propName, value);\n return true;\n },\n }));\n const on = (eventName, callback) => {\n handlers[eventName].push(callback);\n return () => {\n removeFromArray(handlers[eventName], callback);\n };\n };\n const onChange = (propName, cb) => {\n const unSet = on('set', (key, newValue) => {\n if (key === propName) {\n cb(newValue);\n }\n });\n // We need to unwrap the defaultState because it might be a function.\n // Otherwise we might not be sending the right reset value.\n const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));\n return () => {\n unSet();\n unReset();\n };\n };\n const use = (...subscriptions) => {\n const unsubs = subscriptions.reduce((unsubs, subscription) => {\n if (subscription.set) {\n unsubs.push(on('set', subscription.set));\n }\n if (subscription.get) {\n unsubs.push(on('get', subscription.get));\n }\n if (subscription.reset) {\n unsubs.push(on('reset', subscription.reset));\n }\n if (subscription.dispose) {\n unsubs.push(on('dispose', subscription.dispose));\n }\n return unsubs;\n }, []);\n return () => unsubs.forEach((unsub) => unsub());\n };\n const forceUpdate = (key) => {\n const oldValue = states.get(key);\n handlers.set.forEach((cb) => cb(key, oldValue, oldValue));\n };\n return {\n state,\n get,\n set,\n on,\n onChange,\n use,\n dispose,\n reset,\n forceUpdate,\n };\n};\nconst removeFromArray = (array, item) => {\n const index = array.indexOf(item);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.length--;\n }\n};\n\nconst createStore = (defaultState, shouldUpdate) => {\n const map = createObservableMap(defaultState, shouldUpdate);\n map.use(stencilSubscription());\n return map;\n};\n\nexport { createObservableMap, createStore };\n","// src/store/auth.store.ts\r\nimport { createStore } from '@stencil/store';\r\n\r\nexport const { state: authState, onChange } = createStore({\r\n token: localStorage.getItem('pcm-sdk-auth-token') || null\r\n});\r\n\r\n// 添加一些辅助方法\r\nexport const authStore = {\r\n getToken: () => authState.token,\r\n setToken: (token: string) => {\r\n authState.token = token;\r\n localStorage.setItem('pcm-sdk-auth-token', token);\r\n },\r\n clearToken: () => {\r\n authState.token = null;\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('token', value => {\r\n if (value) {\r\n localStorage.setItem('pcm-sdk-auth-token', value);\r\n } else {\r\n localStorage.removeItem('pcm-sdk-auth-token');\r\n }\r\n});","import { createStore } from '@stencil/store';\r\n\r\n// 定义配置数据的类型\r\nexport interface ConfigData {\r\n [key: string]: any;\r\n}\r\n\r\n// 从localStorage获取初始配置\r\nconst getInitialConfig = (): ConfigData => {\r\n try {\r\n const storedConfig = localStorage.getItem('pcm-sdk-config-data');\r\n return storedConfig ? JSON.parse(storedConfig) : {};\r\n } catch (error) {\r\n console.error('Error parsing stored config:', error);\r\n return {};\r\n }\r\n};\r\n\r\n// 创建配置存储\r\nexport const { state: configState, onChange } = createStore<{\r\n data: ConfigData;\r\n}>({\r\n data: getInitialConfig()\r\n});\r\n\r\n// 配置存储的辅助方法\r\nexport const configStore = {\r\n // 获取整个配置对象\r\n getConfig: (): ConfigData => configState.data,\r\n \r\n // 获取特定配置项\r\n getItem: <T>(key: string, defaultValue?: T): T => {\r\n return configState.data[key] !== undefined ? configState.data[key] : defaultValue;\r\n },\r\n \r\n // 设置特定配置项\r\n setItem: <T>(key: string, value: T): void => {\r\n configState.data = {\r\n ...configState.data,\r\n [key]: value\r\n };\r\n },\r\n \r\n // 移除特定配置项\r\n removeItem: (key: string): void => {\r\n const newConfig = { ...configState.data };\r\n delete newConfig[key];\r\n configState.data = newConfig;\r\n },\r\n \r\n // 清除所有配置\r\n clear: (): void => {\r\n configState.data = {};\r\n },\r\n \r\n // 批量更新配置\r\n updateConfig: (newConfig: Partial<ConfigData>): void => {\r\n configState.data = {\r\n ...configState.data,\r\n ...newConfig\r\n };\r\n }\r\n};\r\n\r\n// 自动保存到localStorage\r\nonChange('data', value => {\r\n try {\r\n if (Object.keys(value).length > 0) {\r\n localStorage.setItem('pcm-sdk-config-data', JSON.stringify(value));\r\n } else {\r\n localStorage.removeItem('pcm-sdk-config-data');\r\n }\r\n } catch (error) {\r\n console.error('Error saving config to localStorage:', error);\r\n }\r\n}); "],"names":["onChange"],"mappings":";;AAAA;AAKA;AACO,MAAM,UAAU,GAAG,2CAA4C;AACzD,MAAA,UAAU,GAAG;;ACL1B,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,KAAK;AAC9C,IAAI,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC;AACnC,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;AAClC;AACA,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACrC,QAAQ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;AACzB;AACA,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK;AAC7B,IAAI,IAAI,SAAS;AACjB,IAAI,OAAO,CAAC,GAAG,IAAI,KAAK;AACxB,QAAQ,IAAI,SAAS,EAAE;AACvB,YAAY,YAAY,CAAC,SAAS,CAAC;AACnC;AACA,QAAQ,SAAS,GAAG,UAAU,CAAC,MAAM;AACrC,YAAY,SAAS,GAAG,CAAC;AACzB,YAAY,EAAE,CAAC,GAAG,IAAI,CAAC;AACvB,SAAS,EAAE,EAAE,CAAC;AACd,KAAK;AACL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,WAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[1]}
@@ -1,2 +1,2 @@
1
- import{c as s}from"./p-De3vyGBR.js";import{s as t,a as r,c,b as e}from"./p-Bs-zO1WZ.js";class o{static captureError(e,o){try{const a=s.getItem("pcm-sdk-CUser");if(a){t({id:String(a)})}let i=e;if(o?.title){i=new Error(o.title);if(e?.stack){i.stack=e.stack}i.cause=e}if(o){const{title:s,...t}=o;r("error_context",t)}c(i)}catch(s){console.error("Sentry 上报错误失败:",s)}}static captureMessage(c,o){try{const a=s.getItem("pcm-sdk-CUser");if(a){t({id:String(a)})}if(o){r("message_context",o)}e(c)}catch(s){console.error("Sentry 上报消息失败:",s)}}}export{o as S};
2
- //# sourceMappingURL=p-DdVhVtJm.js.map
1
+ import{c as s}from"./p-BcP-XCgZ.js";import{s as t,a as r,c,b as e}from"./p-Bs-zO1WZ.js";class o{static captureError(e,o){try{const a=s.getItem("pcm-sdk-CUser");if(a){t({id:String(a)})}let i=e;if(o?.title){i=new Error(o.title);if(e?.stack){i.stack=e.stack}i.cause=e}if(o){const{title:s,...t}=o;r("error_context",t)}c(i)}catch(s){console.error("Sentry 上报错误失败:",s)}}static captureMessage(c,o){try{const a=s.getItem("pcm-sdk-CUser");if(a){t({id:String(a)})}if(o){r("message_context",o)}e(c)}catch(s){console.error("Sentry 上报消息失败:",s)}}}export{o as S};
2
+ //# sourceMappingURL=p-ZaVCcNkc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"p-DdVhVtJm.js","sources":["src/utils/sentry-reporter.ts"],"sourcesContent":["import * as Sentry from \"@sentry/browser\";\r\nimport { configStore } from \"../../store/config.store\";\r\n\r\n/**\r\n * Sentry事件上报工具类\r\n * 提供统一的错误上报接口,自动添加用户认证信息\r\n */\r\nexport class SentryReporter {\r\n\r\n /**\r\n * 捕获并上报错误\r\n * @param error 错误对象\r\n * @param context 错误上下文\r\n */\r\n static captureError(error: any, context?: Record<string, any> & { title?: string }): void {\r\n try {\r\n // 添加认证信息\r\n const CUser = configStore.getItem('pcm-sdk-CUser');\r\n if (CUser) {\r\n Sentry.setUser({ id: String(CUser) });\r\n }\r\n \r\n let finalError = error;\r\n \r\n // 如果提供了自定义标题,创建新的错误对象\r\n if (context?.title) {\r\n finalError = new Error(context.title);\r\n if (error?.stack) {\r\n finalError.stack = error.stack;\r\n }\r\n finalError.cause = error;\r\n }\r\n \r\n // 添加上下文\r\n if (context) {\r\n const { title, ...otherContext } = context;\r\n Sentry.setContext('error_context', otherContext);\r\n }\r\n \r\n // 上报错误\r\n Sentry.captureException(finalError);\r\n } catch (e) {\r\n console.error('Sentry 上报错误失败:', e);\r\n }\r\n }\r\n\r\n /**\r\n * 捕获并上报消息\r\n * @param message 消息内容\r\n * @param context 消息上下文\r\n */\r\n static captureMessage(message: string, context?: Record<string, any>): void {\r\n try {\r\n // 添加认证信息\r\n const CUser = configStore.getItem('pcm-sdk-CUser');\r\n if (CUser) {\r\n Sentry.setUser({ id: String(CUser) });\r\n }\r\n \r\n // 添加上下文\r\n if (context) {\r\n Sentry.setContext('message_context', context);\r\n }\r\n \r\n // 上报消息\r\n Sentry.captureMessage(message);\r\n } catch (e) {\r\n console.error('Sentry 上报消息失败:', e);\r\n }\r\n }\r\n\r\n}"],"names":["Sentry.setUser","Sentry.setContext","Sentry.captureException","Sentry.captureMessage"],"mappings":";;;AAGA;;;AAGG;MACU,cAAc,CAAA;AAEzB;;;;AAIG;AACH,IAAA,OAAO,YAAY,CAAC,KAAU,EAAE,OAAkD,EAAA;AAChF,QAAA,IAAI;;YAEF,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC;YAClD,IAAI,KAAK,EAAE;AACT,gBAAAA,OAAc,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;;YAGvC,IAAI,UAAU,GAAG,KAAK;;AAGtB,YAAA,IAAI,OAAO,EAAE,KAAK,EAAE;gBAClB,UAAU,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACrC,gBAAA,IAAI,KAAK,EAAE,KAAK,EAAE;AAChB,oBAAA,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;;AAEhC,gBAAA,UAAU,CAAC,KAAK,GAAG,KAAK;;;YAI1B,IAAI,OAAO,EAAE;gBACX,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO;AAC1C,gBAAAC,UAAiB,CAAC,eAAe,EAAE,YAAY,CAAC;;;AAIlD,YAAAC,gBAAuB,CAAC,UAAU,CAAC;;QACnC,OAAO,CAAC,EAAE;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;;;AAItC;;;;AAIG;AACH,IAAA,OAAO,cAAc,CAAC,OAAe,EAAE,OAA6B,EAAA;AAClE,QAAA,IAAI;;YAEF,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC;YAClD,IAAI,KAAK,EAAE;AACT,gBAAAF,OAAc,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;;;YAIvC,IAAI,OAAO,EAAE;AACX,gBAAAC,UAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC;;;AAI/C,YAAAE,cAAqB,CAAC,OAAO,CAAC;;QAC9B,OAAO,CAAC,EAAE;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;;;AAIvC;;;;"}
1
+ {"version":3,"file":"p-ZaVCcNkc.js","sources":["src/utils/sentry-reporter.ts"],"sourcesContent":["import * as Sentry from \"@sentry/browser\";\r\nimport { configStore } from \"../../store/config.store\";\r\n\r\n/**\r\n * Sentry事件上报工具类\r\n * 提供统一的错误上报接口,自动添加用户认证信息\r\n */\r\nexport class SentryReporter {\r\n\r\n /**\r\n * 捕获并上报错误\r\n * @param error 错误对象\r\n * @param context 错误上下文\r\n */\r\n static captureError(error: any, context?: Record<string, any> & { title?: string }): void {\r\n try {\r\n // 添加认证信息\r\n const CUser = configStore.getItem('pcm-sdk-CUser');\r\n if (CUser) {\r\n Sentry.setUser({ id: String(CUser) });\r\n }\r\n \r\n let finalError = error;\r\n \r\n // 如果提供了自定义标题,创建新的错误对象\r\n if (context?.title) {\r\n finalError = new Error(context.title);\r\n if (error?.stack) {\r\n finalError.stack = error.stack;\r\n }\r\n finalError.cause = error;\r\n }\r\n \r\n // 添加上下文\r\n if (context) {\r\n const { title, ...otherContext } = context;\r\n Sentry.setContext('error_context', otherContext);\r\n }\r\n \r\n // 上报错误\r\n Sentry.captureException(finalError);\r\n } catch (e) {\r\n console.error('Sentry 上报错误失败:', e);\r\n }\r\n }\r\n\r\n /**\r\n * 捕获并上报消息\r\n * @param message 消息内容\r\n * @param context 消息上下文\r\n */\r\n static captureMessage(message: string, context?: Record<string, any>): void {\r\n try {\r\n // 添加认证信息\r\n const CUser = configStore.getItem('pcm-sdk-CUser');\r\n if (CUser) {\r\n Sentry.setUser({ id: String(CUser) });\r\n }\r\n \r\n // 添加上下文\r\n if (context) {\r\n Sentry.setContext('message_context', context);\r\n }\r\n \r\n // 上报消息\r\n Sentry.captureMessage(message);\r\n } catch (e) {\r\n console.error('Sentry 上报消息失败:', e);\r\n }\r\n }\r\n\r\n}"],"names":["Sentry.setUser","Sentry.setContext","Sentry.captureException","Sentry.captureMessage"],"mappings":";;;AAGA;;;AAGG;MACU,cAAc,CAAA;AAEzB;;;;AAIG;AACH,IAAA,OAAO,YAAY,CAAC,KAAU,EAAE,OAAkD,EAAA;AAChF,QAAA,IAAI;;YAEF,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC;YAClD,IAAI,KAAK,EAAE;AACT,gBAAAA,OAAc,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;;YAGvC,IAAI,UAAU,GAAG,KAAK;;AAGtB,YAAA,IAAI,OAAO,EAAE,KAAK,EAAE;gBAClB,UAAU,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AACrC,gBAAA,IAAI,KAAK,EAAE,KAAK,EAAE;AAChB,oBAAA,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;;AAEhC,gBAAA,UAAU,CAAC,KAAK,GAAG,KAAK;;;YAI1B,IAAI,OAAO,EAAE;gBACX,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO;AAC1C,gBAAAC,UAAiB,CAAC,eAAe,EAAE,YAAY,CAAC;;;AAIlD,YAAAC,gBAAuB,CAAC,UAAU,CAAC;;QACnC,OAAO,CAAC,EAAE;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;;;AAItC;;;;AAIG;AACH,IAAA,OAAO,cAAc,CAAC,OAAe,EAAE,OAA6B,EAAA;AAClE,QAAA,IAAI;;YAEF,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,eAAe,CAAC;YAClD,IAAI,KAAK,EAAE;AACT,gBAAAF,OAAc,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;;;YAIvC,IAAI,OAAO,EAAE;AACX,gBAAAC,UAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC;;;AAI/C,YAAAE,cAAqB,CAAC,OAAO,CAAC;;QAC9B,OAAO,CAAC,EAAE;AACV,YAAA,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC;;;AAIvC;;;;"}
@@ -1,2 +1,2 @@
1
- import{r as t,c as e,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as s,v as n,c as a,P as r}from"./p-De3vyGBR.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-DXVhHj6-.js";import{f as p}from"./p-BEWKdGwe.js";import"./p-DdVhVtJm.js";import"./p-Bs-zO1WZ.js";const c=".iframe-container{width:100%;height:85vh}.iframe-container iframe{width:100%;height:100%}.step-section{margin-bottom:20px}.step-title{font-size:14px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e8e8e8}.mode-options{display:grid;grid-template-columns:repeat(2, 1fr);gap:8px}.mode-option{padding:16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.mode-option:hover{border-color:#94a3b8}.mode-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.option-title{font-weight:600;color:#333}.check-icon{color:#0D75FB;font-size:16px}.option-desc{font-size:14px;color:#666}.option-suitable{font-size:12px;color:#999}.output-options{display:flex;flex-direction:column;gap:12px}.output-option{padding:12px 16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.output-option:hover{border-color:#94a3b8}.output-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-time{font-size:12px;color:#999}.jd-hint{padding:12px;background-color:#f6f8fa;border-radius:8px;text-align:center}.jd-hint p{font-size:14px;color:#666;margin:0}.form-hint{font-size:12px;color:#fa8c16;text-align:center;margin-top:8px}.form-hint.warning{color:#fa8c16}@media screen and (max-width: 768px){.mode-options{grid-template-columns:1fr}}.label-with-button{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.button-group{margin-bottom:8px;display:flex;gap:8px;align-items:center}.position-selector-button{padding:4px 12px;background:#1890ff;color:white;border:none;border-radius:4px;font-size:13px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;height:28px;line-height:20px}.position-selector-button:hover{background:#40a9ff}.position-selector-button:active{background:#096dd9}.position-selector-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:3000;padding:20px}.position-selector-modal{background:white;border-radius:8px;width:90%;max-width:900px;height:80vh;max-height:600px;display:flex;flex-direction:column;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.position-selector-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.position-selector-modal-header h3{margin:0;font-size:16px;font-weight:500;color:rgba(0, 0, 0, 0.85)}.position-selector-close-btn{background:none;border:none;font-size:24px;line-height:1;cursor:pointer;color:rgba(0, 0, 0, 0.45);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.3s}.position-selector-close-btn:hover{background-color:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.85)}.position-selector-modal-body{flex:1;overflow:hidden;display:flex;flex-direction:column}@media screen and (max-width: 768px){.position-selector-modal{width:100%;height:90vh;max-height:none;border-radius:8px 8px 0 0;margin-top:auto}.position-selector-modal-overlay{padding:0;align-items:flex-end}}";const h='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-drawer-content{height:100%;display:flex;flex-direction:column}.conversation-list{flex:1;overflow-y:auto;padding:8px 0}.loading-conversations,.empty-conversations{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#999}.loading-conversations .loading-spinner-small{margin-bottom:12px}.conversation-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 8px 4px 8px;border-radius:8px;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.conversation-item:hover{background:#f5f5f5}.conversation-info{flex:1;min-width:0}.conversation-title{font-size:14px;font-weight:500;color:#262626;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}.message-count{flex-shrink:0}.conversation-status{padding:2px 6px;border-radius:4px;font-size:11px;font-weight:500}.conversation-status.completed{background:#f6ffed;color:#52c41a}.conversation-status.running{background:#fff7e6;color:#fa8c16}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const f=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){t(this,i);this.modalClosed=e(this,"modalClosed");this.getResumeData=e(this,"getResumeData");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="千岗千简历";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请帮我优化简历";getResumeData;hideExportButton=false;exportButtonText="导出简历json数据";fullscreen=false;customInputs={};showWorkspaceHistory=false;oemId;showInputHistory=false;mobileUploadAble=false;mobileJdInputAble=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="drawer";autoStart;isUploading=false;uploadedFileInfo=null;showChatModal=false;showIframe=false;isHistoryDrawerOpen=false;historyConversations=[];isLoadingConversations=false;historyConversationCursorStack=[""];historyConversationPageIndex=0;hasMoreHistoryConversations=false;showPositionSelector=false;_internalConversationId;selectedOptimizationMode="";selectedOutputType=null;get hostElement(){return i(this)}jobDescription="";isSubmitting=false;_iframeEl;tokenInvalidListener;removeErrorListener;_historyConversationPageSize=10;pcmUploadRef;optimizationModes=[{id:"targeted",title:"针对性优化",desc:"基于具体职位描述进行优化",suitable:"有明确目标职位"},{id:"general",title:"通用优化",desc:"提升简历整体质量和专业度",suitable:"广撒网投递"}];outputTypes=[{id:0,title:"直接改写",desc:"给我优化后的完整简历",time:"2-3分钟"},{id:1,title:"改进建议",desc:"告诉我哪里需要改,怎么改",time:"1-2分钟"},{id:2,title:"深度分析",desc:"全面诊断+建议+改写",time:"3-5分钟"}];handleTokenChange(t){if(t&&t!==s.getToken()){s.setToken(t)}}async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.showIframe=false;this.jobDescription="";this.uploadedFileInfo=null;this.isUploading=false;this.isSubmitting=false;this._internalConversationId=undefined;this.selectedOptimizationMode="";this.conversationId=undefined;this.selectedOutputType=null;this.showPositionSelector=false}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}if(this.customInputs){if(this.customInputs.optimization_type!==undefined&&this.customInputs.optimization_type!==""){this.selectedOutputType=Number(this.customInputs.optimization_type)}if(!!this.customInputs.job_info){this.selectedOptimizationMode="targeted"}}await n(this.token);if(this.currentConversationId||this.getShouldAutoStart()){this.showChatModal=true;this.showIframe=false}}}get currentConversationId(){return this.conversationId||this._internalConversationId}componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){s.setToken(this.token)}n(this.token);this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}handleStreamComplete=t=>{this._internalConversationId=t.detail.conversation_id};componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}window.removeEventListener("message",this.handleIframeMessage)}handleClose=()=>{this.modalClosed.emit()};loadHistoryConversations=async(t,e)=>{this.isLoadingConversations=true;const i=await p("45444431062634496","pcm-qgqjl-modal",t,this._historyConversationPageSize);const o=this.historyConversationCursorStack.slice(0,e+1);if(i.hasMore&&i.nextCursor){o[e+1]=i.nextCursor}this.historyConversationCursorStack=o;this.historyConversationPageIndex=e;this.historyConversations=i.items;this.hasMoreHistoryConversations=i.hasMore;this.isLoadingConversations=false};handleInputHistoryClick=async()=>{this.isHistoryDrawerOpen=true;this.historyConversationCursorStack=[""];await this.loadHistoryConversations("",0)};handleHistoryConversationPageChange=async t=>{if(t==="prev"){if(this.historyConversationPageIndex===0){return}const t=this.historyConversationPageIndex-1;const e=this.historyConversationCursorStack[t]||"";await this.loadHistoryConversations(e,t);return}if(!this.hasMoreHistoryConversations){return}const e=this.historyConversationPageIndex+1;const i=this.historyConversationCursorStack[e];if(!i){return}await this.loadHistoryConversations(i,e)};handleSelectConversation=t=>{this.conversationId=t.id;this.selectedOutputType=t.inputs?.optimization_type??0;this.isHistoryDrawerOpen=false;this.showChatModal=true;this.showIframe=false};closeResumeChat=()=>{this.showIframe=true;this.showChatModal=false};handleIframeLoad=()=>{};handleIframeMessage=t=>{const e=["http://localhost:3000",r];if(!e.includes(t.origin))return;const{type:i,value:o}=t.data||{};if(i==="callParentMethod"){this.exampleMethodFromIframe(o)}if(i==="iframeReady"&&this._iframeEl?.contentWindow){const t=new URL(this._iframeEl.src).origin;this._iframeEl.contentWindow.postMessage({type:"parentReady",origin:window.location.origin},t);this._iframeEl.contentWindow.postMessage({type:"setToken",token:this.token},t);this._iframeEl.contentWindow.postMessage({type:"buttonConfig",config:{hideExportButton:true,exportButtonText:this.exportButtonText}},t)}};exampleMethodFromIframe(t){this.getResumeData.emit(JSON.parse(t))}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleOpenPositionSelector=()=>{if(!this.oemId){d.info("未配置OEM ID,无法选择职位");return}this.showPositionSelector=true};handleClosePositionSelector=()=>{this.showPositionSelector=false};handlePositionSelected=t=>{const e=t.detail;this.jobDescription=e.formatted_text||"";this.showPositionSelector=false;d.success("职位信息已填充")};handleOptimizationModeChange=t=>{this.selectedOptimizationMode=t};handleOutputTypeChange=t=>{this.selectedOutputType=t};getShouldAutoStart=()=>{const t=Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const e=Boolean(this.customInputs?.job_info);const i=this.customInputs?.optimization_type!==undefined;if(this.autoStart!==undefined){if(this.autoStart===true){return t}else{return t&&e&&i}}return t&&e};isFormValid=()=>{if(this.customInputs?.optimization_type!==undefined){const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;return Boolean(t)}const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;const e=t&&this.selectedOptimizationMode&&this.selectedOutputType!==null;if(this.selectedOptimizationMode==="targeted"){return e&&Boolean(this.customInputs?.job_info||this.jobDescription.trim())}return e};handleStartInterview=async()=>{if(!this.customInputs?.file_url&&!this.customInputs?.resume_content&&!this.uploadedFileInfo){d.info("请上传简历");return}if(!this.customInputs?.optimization_type){if(!this.selectedOptimizationMode){d.info("请选择优化模式");return}if(this.selectedOutputType===null){d.info("请选择输出方式");return}}if(this.selectedOptimizationMode==="targeted"&&!this.customInputs?.job_info&&!this.jobDescription.trim()){d.info("针对性优化需要提供职位描述");return}if(await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};getEffectiveOptimizationType=()=>{const t=this.customInputs?.optimization_type??(this.selectedOutputType??0);return typeof t==="string"?Number(t):t};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.showIframe};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const s=this.currentConversationId&&!this.showChatModal;const n=Boolean(this.customInputs?.job_info);const a=Boolean(this.customInputs?.optimization_type);const l=Boolean(this.selectedOptimizationMode);const d=!l||this.selectedOptimizationMode==="general"&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content)||this.selectedOptimizationMode==="targeted"&&Boolean(this.customInputs?.job_info)&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const p=Boolean(this.customInputs&&this.customInputs.job_info);const c=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));const h=this.getShouldAutoStart();return o("div",{class:i,style:t},o("div",{class:e},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle),this.showInputHistory&&o("button",{type:"button",class:"header-history-entry",onClick:this.handleInputHistoryClick,title:"历史会话"},"历史会话")),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),this.showInputHistory&&o("pcm-drawer",{isOpen:this.isHistoryDrawerOpen,drawerTitle:"历史会话",width:"400px",onClosed:()=>{this.isHistoryDrawerOpen=false}},o("div",{class:"history-drawer-content"},o("div",{class:"conversation-list"},this.isLoadingConversations?o("div",{class:"loading-conversations"},o("div",{class:"loading-spinner-small"}),o("p",null,"加载中...")):this.historyConversations.length===0?o("div",{class:"empty-conversations"},o("p",null,"暂无历史会话")):this.historyConversations.map((t=>o("div",{key:t.id,class:"conversation-item",onClick:()=>this.handleSelectConversation(t)},o("div",{class:"conversation-info"},o("div",{class:"conversation-title"},t.name),o("div",{class:"conversation-meta"},o("span",{class:"conversation-time"},t.timeDisplay),t.message_count>0&&o("span",{class:"message-count"},t.message_count,"条消息"),t.status&&o("span",{class:{"conversation-status":true,completed:t.status==="结束",running:t.status==="进行中"}},t.status))))))),!this.isLoadingConversations&&(this.historyConversationPageIndex>0||this.hasMoreHistoryConversations)&&o("div",{class:"history-pagination"},o("button",{type:"button",class:"history-pagination-button",disabled:this.historyConversationPageIndex===0,onClick:()=>this.handleHistoryConversationPageChange("prev")},"上一页"),o("span",{class:"history-pagination-info"},"第 ",this.historyConversationPageIndex+1," 页"),o("button",{type:"button",class:"history-pagination-button",disabled:!this.hasMoreHistoryConversations,onClick:()=>this.handleHistoryConversationPageChange("next")},"下一页")))),!this.showChatModal&&!this.currentConversationId&&!h&&o("div",{class:"input-container"},!n&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第一步:选择优化模式"),o("div",{class:"mode-options"},this.optimizationModes.map((t=>o("div",{class:{"mode-option":true,selected:this.selectedOptimizationMode===t.id},onClick:()=>this.handleOptimizationModeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOptimizationMode===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-suitable"},"适合:",t.suitable)))))),!a&&this.selectedOptimizationMode&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第二步:你希望得到什么?"),o("div",{class:"output-options"},this.outputTypes.map((t=>o("div",{class:{"output-option":true,selected:this.selectedOutputType===t.id},onClick:()=>this.handleOutputTypeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOutputType===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-time"},"预计 ",t.time)))))),!d&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第三步:提供材料"),o("div",{class:"resume-upload-section"},o("label",null,"上传简历"),o("pcm-upload",{ref:t=>this.pcmUploadRef=t,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:c,onUploadChange:t=>{const e=t.detail??[];this.uploadedFileInfo=e[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),this.selectedOptimizationMode==="targeted"&&o("div",{class:"jd-input-section"},o("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!p&&o("div",{class:"button-group"},!!this.oemId&&o("button",{class:"position-selector-button",onClick:this.handleOpenPositionSelector,type:"button"},"选择职位"),o("pcm-mobile-input-btn",{name:"职位描述",onOk:t=>{this.jobDescription=t.detail}})),o("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange,disabled:p}))),o("button",{class:"submit-button",disabled:!this.isFormValid()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),!a&&!this.selectedOptimizationMode&&o("div",{class:"form-hint"},"请先选择优化模式和输出方式"),!a&&this.selectedOptimizationMode&&this.selectedOutputType===null&&o("div",{class:"form-hint"},"请选择输出方式"),l&&!c&&!this.uploadedFileInfo&&o("div",{class:"form-hint warning"},"请上传简历文件"),this.selectedOptimizationMode==="targeted"&&!p&&!this.jobDescription.trim()&&l&&o("div",{class:"form-hint warning"},"针对性优化需要提供职位描述"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),s&&!this.showIframe&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,this.getEffectiveOptimizationType()===1||this.getEffectiveOptimizationType()===2?o("pcm-thousand-resume-wrapper",{isOpen:true,token:this.token,conversationId:this.currentConversationId,botId:"45444431062634496",optimizationType:this.getEffectiveOptimizationType(),customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||(this.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},defaultQuery:this.defaultQuery,modalTitle:this.modalTitle,icon:this.icon,fullscreen:this.fullscreen,zIndex:this.zIndex,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,onModalClosed:this.handleClose,onConversationStart:t=>this.handleStreamComplete(t),onStreamComplete:t=>this.handleStreamComplete(t),onInterviewComplete:t=>this.handleStreamComplete(t)}):o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"45444431062634496",conversationId:this.currentConversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,closeResume:this.closeResumeChat,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||(this.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},interviewMode:"text",onStreamComplete:this.handleStreamComplete,onHistoryConversationSelect:t=>{if(t.detail?.inputs?.optimization_type==1||t.detail?.inputs?.optimization_type==2){t.preventDefault();this.handleSelectConversation(t.detail)}}})),this.showIframe&&o(o.Fragment,null,o("div",{class:"iframe-container"},o("iframe",{ref:t=>this._iframeEl=t,src:`${r}/myresume?conversation_id=${this.currentConversationId}&isSdk=true`,frameborder:"0",onLoad:this.handleIframeLoad})))),this.showPositionSelector&&o("div",{class:"position-selector-modal-overlay"},o("div",{class:"position-selector-modal"},o("div",{class:"position-selector-modal-header"},o("h3",null,"选择职位"),o("button",{class:"position-selector-close-btn",onClick:this.handleClosePositionSelector},"×")),o("div",{class:"position-selector-modal-body"},o("components-position-selector",{oemId:this.oemId,multiple:false,onPositionSelected:this.handlePositionSelected})))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(h+f);export{u as oem_qgqjl_modal};
2
- //# sourceMappingURL=p-0aa9f384.entry.js.map
1
+ import{r as t,c as e,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as s,v as n,c as a,P as r}from"./p-BcP-XCgZ.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-DXVhHj6-.js";import{f as p}from"./p-pt92A5Nu.js";import"./p-ZaVCcNkc.js";import"./p-Bs-zO1WZ.js";const c=".iframe-container{width:100%;height:85vh}.iframe-container iframe{width:100%;height:100%}.step-section{margin-bottom:20px}.step-title{font-size:14px;font-weight:600;color:#333;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid #e8e8e8}.mode-options{display:grid;grid-template-columns:repeat(2, 1fr);gap:8px}.mode-option{padding:16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.mode-option:hover{border-color:#94a3b8}.mode-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:4px}.option-title{font-weight:600;color:#333}.check-icon{color:#0D75FB;font-size:16px}.option-desc{font-size:14px;color:#666}.option-suitable{font-size:12px;color:#999}.output-options{display:flex;flex-direction:column;gap:12px}.output-option{padding:12px 16px;border:2px solid #e2e8f0;border-radius:8px;cursor:pointer;transition:all 0.2s ease}.output-option:hover{border-color:#94a3b8}.output-option.selected{border-color:#0D75FB;background-color:#f0f7ff}.option-time{font-size:12px;color:#999}.jd-hint{padding:12px;background-color:#f6f8fa;border-radius:8px;text-align:center}.jd-hint p{font-size:14px;color:#666;margin:0}.form-hint{font-size:12px;color:#fa8c16;text-align:center;margin-top:8px}.form-hint.warning{color:#fa8c16}@media screen and (max-width: 768px){.mode-options{grid-template-columns:1fr}}.label-with-button{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.button-group{margin-bottom:8px;display:flex;gap:8px;align-items:center}.position-selector-button{padding:4px 12px;background:#1890ff;color:white;border:none;border-radius:4px;font-size:13px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;height:28px;line-height:20px}.position-selector-button:hover{background:#40a9ff}.position-selector-button:active{background:#096dd9}.position-selector-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:3000;padding:20px}.position-selector-modal{background:white;border-radius:8px;width:90%;max-width:900px;height:80vh;max-height:600px;display:flex;flex-direction:column;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.position-selector-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.position-selector-modal-header h3{margin:0;font-size:16px;font-weight:500;color:rgba(0, 0, 0, 0.85)}.position-selector-close-btn{background:none;border:none;font-size:24px;line-height:1;cursor:pointer;color:rgba(0, 0, 0, 0.45);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.3s}.position-selector-close-btn:hover{background-color:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.85)}.position-selector-modal-body{flex:1;overflow:hidden;display:flex;flex-direction:column}@media screen and (max-width: 768px){.position-selector-modal{width:100%;height:90vh;max-height:none;border-radius:8px 8px 0 0;margin-top:auto}.position-selector-modal-overlay{padding:0;align-items:flex-end}}";const h='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-drawer-content{height:100%;display:flex;flex-direction:column}.conversation-list{flex:1;overflow-y:auto;padding:8px 0}.loading-conversations,.empty-conversations{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#999}.loading-conversations .loading-spinner-small{margin-bottom:12px}.conversation-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 8px 4px 8px;border-radius:8px;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.conversation-item:hover{background:#f5f5f5}.conversation-info{flex:1;min-width:0}.conversation-title{font-size:14px;font-weight:500;color:#262626;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}.message-count{flex-shrink:0}.conversation-status{padding:2px 6px;border-radius:4px;font-size:11px;font-weight:500}.conversation-status.completed{background:#f6ffed;color:#52c41a}.conversation-status.running{background:#fff7e6;color:#fa8c16}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const f=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){t(this,i);this.modalClosed=e(this,"modalClosed");this.getResumeData=e(this,"getResumeData");this.uploadSuccess=e(this,"uploadSuccess");this.streamComplete=e(this,"streamComplete");this.conversationStart=e(this,"conversationStart");this.interviewComplete=e(this,"interviewComplete");this.tokenInvalid=e(this,"tokenInvalid");this.someErrorEvent=e(this,"someErrorEvent")}modalTitle="千岗千简历";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请帮我优化简历";getResumeData;hideExportButton=false;exportButtonText="导出简历json数据";fullscreen=false;customInputs={};showWorkspaceHistory=false;oemId;showInputHistory=false;mobileUploadAble=false;mobileJdInputAble=false;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;filePreviewMode="drawer";autoStart;isUploading=false;uploadedFileInfo=null;showChatModal=false;showIframe=false;isHistoryDrawerOpen=false;historyConversations=[];isLoadingConversations=false;historyConversationCursorStack=[""];historyConversationPageIndex=0;hasMoreHistoryConversations=false;showPositionSelector=false;_internalConversationId;selectedOptimizationMode="";selectedOutputType=null;get hostElement(){return i(this)}jobDescription="";isSubmitting=false;_iframeEl;tokenInvalidListener;removeErrorListener;_historyConversationPageSize=10;pcmUploadRef;optimizationModes=[{id:"targeted",title:"针对性优化",desc:"基于具体职位描述进行优化",suitable:"有明确目标职位"},{id:"general",title:"通用优化",desc:"提升简历整体质量和专业度",suitable:"广撒网投递"}];outputTypes=[{id:0,title:"直接改写",desc:"给我优化后的完整简历",time:"2-3分钟"},{id:1,title:"改进建议",desc:"告诉我哪里需要改,怎么改",time:"1-2分钟"},{id:2,title:"深度分析",desc:"全面诊断+建议+改写",time:"3-5分钟"}];handleTokenChange(t){if(t&&t!==s.getToken()){s.setToken(t)}}async handleIsOpenChange(t){if(!t){this.showChatModal=false;this.showIframe=false;this.jobDescription="";this.uploadedFileInfo=null;this.isUploading=false;this.isSubmitting=false;this._internalConversationId=undefined;this.selectedOptimizationMode="";this.conversationId=undefined;this.selectedOutputType=null;this.showPositionSelector=false}else{if(this.customInputs&&this.customInputs.job_info){this.jobDescription=this.customInputs.job_info}if(this.customInputs){if(this.customInputs.optimization_type!==undefined&&this.customInputs.optimization_type!==""){this.selectedOutputType=Number(this.customInputs.optimization_type)}if(!!this.customInputs.job_info){this.selectedOptimizationMode="targeted"}}await n(this.token);if(this.currentConversationId||this.getShouldAutoStart()){this.showChatModal=true;this.showIframe=false}}}get currentConversationId(){return this.conversationId||this._internalConversationId}componentWillLoad(){if(this.zIndex){a.setItem("modal-zIndex",this.zIndex)}if(this.token){s.setToken(this.token)}n(this.token);this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((t=>{this.someErrorEvent.emit(t)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}handleStreamComplete=t=>{this._internalConversationId=t.detail.conversation_id};componentDidLoad(){window.addEventListener("message",this.handleIframeMessage)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}window.removeEventListener("message",this.handleIframeMessage)}handleClose=()=>{this.modalClosed.emit()};loadHistoryConversations=async(t,e)=>{this.isLoadingConversations=true;const i=await p("45444431062634496","pcm-qgqjl-modal",t,this._historyConversationPageSize);const o=this.historyConversationCursorStack.slice(0,e+1);if(i.hasMore&&i.nextCursor){o[e+1]=i.nextCursor}this.historyConversationCursorStack=o;this.historyConversationPageIndex=e;this.historyConversations=i.items;this.hasMoreHistoryConversations=i.hasMore;this.isLoadingConversations=false};handleInputHistoryClick=async()=>{this.isHistoryDrawerOpen=true;this.historyConversationCursorStack=[""];await this.loadHistoryConversations("",0)};handleHistoryConversationPageChange=async t=>{if(t==="prev"){if(this.historyConversationPageIndex===0){return}const t=this.historyConversationPageIndex-1;const e=this.historyConversationCursorStack[t]||"";await this.loadHistoryConversations(e,t);return}if(!this.hasMoreHistoryConversations){return}const e=this.historyConversationPageIndex+1;const i=this.historyConversationCursorStack[e];if(!i){return}await this.loadHistoryConversations(i,e)};handleSelectConversation=t=>{this.conversationId=t.id;this.selectedOutputType=t.inputs?.optimization_type??0;this.isHistoryDrawerOpen=false;this.showChatModal=true;this.showIframe=false};closeResumeChat=()=>{this.showIframe=true;this.showChatModal=false};handleIframeLoad=()=>{};handleIframeMessage=t=>{const e=["http://localhost:3000",r];if(!e.includes(t.origin))return;const{type:i,value:o}=t.data||{};if(i==="callParentMethod"){this.exampleMethodFromIframe(o)}if(i==="iframeReady"&&this._iframeEl?.contentWindow){const t=new URL(this._iframeEl.src).origin;this._iframeEl.contentWindow.postMessage({type:"parentReady",origin:window.location.origin},t);this._iframeEl.contentWindow.postMessage({type:"setToken",token:this.token},t);this._iframeEl.contentWindow.postMessage({type:"buttonConfig",config:{hideExportButton:true,exportButtonText:this.exportButtonText}},t)}};exampleMethodFromIframe(t){this.getResumeData.emit(JSON.parse(t))}handleJobDescriptionChange=t=>{const e=t.target;this.jobDescription=e.value};handleOpenPositionSelector=()=>{if(!this.oemId){d.info("未配置OEM ID,无法选择职位");return}this.showPositionSelector=true};handleClosePositionSelector=()=>{this.showPositionSelector=false};handlePositionSelected=t=>{const e=t.detail;this.jobDescription=e.formatted_text||"";this.showPositionSelector=false;d.success("职位信息已填充")};handleOptimizationModeChange=t=>{this.selectedOptimizationMode=t};handleOutputTypeChange=t=>{this.selectedOutputType=t};getShouldAutoStart=()=>{const t=Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const e=Boolean(this.customInputs?.job_info);const i=this.customInputs?.optimization_type!==undefined;if(this.autoStart!==undefined){if(this.autoStart===true){return t}else{return t&&e&&i}}return t&&e};isFormValid=()=>{if(this.customInputs?.optimization_type!==undefined){const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;return Boolean(t)}const t=this.customInputs?.file_url||this.customInputs?.resume_content||this.uploadedFileInfo;const e=t&&this.selectedOptimizationMode&&this.selectedOutputType!==null;if(this.selectedOptimizationMode==="targeted"){return e&&Boolean(this.customInputs?.job_info||this.jobDescription.trim())}return e};handleStartInterview=async()=>{if(!this.customInputs?.file_url&&!this.customInputs?.resume_content&&!this.uploadedFileInfo){d.info("请上传简历");return}if(!this.customInputs?.optimization_type){if(!this.selectedOptimizationMode){d.info("请选择优化模式");return}if(this.selectedOutputType===null){d.info("请选择输出方式");return}}if(this.selectedOptimizationMode==="targeted"&&!this.customInputs?.job_info&&!this.jobDescription.trim()){d.info("针对性优化需要提供职位描述");return}if(await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true;this.isSubmitting=false};getEffectiveOptimizationType=()=>{const t=this.customInputs?.optimization_type??(this.selectedOutputType??0);return typeof t==="string"?Number(t):t};render(){if(!this.isOpen)return null;const t={zIndex:String(this.zIndex)};const e={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":!this.showIframe};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const s=this.currentConversationId&&!this.showChatModal;const n=Boolean(this.customInputs?.job_info);const a=Boolean(this.customInputs?.optimization_type);const l=Boolean(this.selectedOptimizationMode);const d=!l||this.selectedOptimizationMode==="general"&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content)||this.selectedOptimizationMode==="targeted"&&Boolean(this.customInputs?.job_info)&&Boolean(this.customInputs?.file_url||this.customInputs?.resume_content);const p=Boolean(this.customInputs&&this.customInputs.job_info);const c=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));const h=this.getShouldAutoStart();return o("div",{class:i,style:t},o("div",{class:e},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle),this.showInputHistory&&o("button",{type:"button",class:"header-history-entry",onClick:this.handleInputHistoryClick,title:"历史会话"},"历史会话")),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),this.showInputHistory&&o("pcm-drawer",{isOpen:this.isHistoryDrawerOpen,drawerTitle:"历史会话",width:"400px",onClosed:()=>{this.isHistoryDrawerOpen=false}},o("div",{class:"history-drawer-content"},o("div",{class:"conversation-list"},this.isLoadingConversations?o("div",{class:"loading-conversations"},o("div",{class:"loading-spinner-small"}),o("p",null,"加载中...")):this.historyConversations.length===0?o("div",{class:"empty-conversations"},o("p",null,"暂无历史会话")):this.historyConversations.map((t=>o("div",{key:t.id,class:"conversation-item",onClick:()=>this.handleSelectConversation(t)},o("div",{class:"conversation-info"},o("div",{class:"conversation-title"},t.name),o("div",{class:"conversation-meta"},o("span",{class:"conversation-time"},t.timeDisplay),t.message_count>0&&o("span",{class:"message-count"},t.message_count,"条消息"),t.status&&o("span",{class:{"conversation-status":true,completed:t.status==="结束",running:t.status==="进行中"}},t.status))))))),!this.isLoadingConversations&&(this.historyConversationPageIndex>0||this.hasMoreHistoryConversations)&&o("div",{class:"history-pagination"},o("button",{type:"button",class:"history-pagination-button",disabled:this.historyConversationPageIndex===0,onClick:()=>this.handleHistoryConversationPageChange("prev")},"上一页"),o("span",{class:"history-pagination-info"},"第 ",this.historyConversationPageIndex+1," 页"),o("button",{type:"button",class:"history-pagination-button",disabled:!this.hasMoreHistoryConversations,onClick:()=>this.handleHistoryConversationPageChange("next")},"下一页")))),!this.showChatModal&&!this.currentConversationId&&!h&&o("div",{class:"input-container"},!n&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第一步:选择优化模式"),o("div",{class:"mode-options"},this.optimizationModes.map((t=>o("div",{class:{"mode-option":true,selected:this.selectedOptimizationMode===t.id},onClick:()=>this.handleOptimizationModeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOptimizationMode===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-suitable"},"适合:",t.suitable)))))),!a&&this.selectedOptimizationMode&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第二步:你希望得到什么?"),o("div",{class:"output-options"},this.outputTypes.map((t=>o("div",{class:{"output-option":true,selected:this.selectedOutputType===t.id},onClick:()=>this.handleOutputTypeChange(t.id)},o("div",{class:"option-header"},o("span",{class:"option-title"},t.title),this.selectedOutputType===t.id&&o("span",{class:"check-icon"},"✓")),o("div",{class:"option-desc"},t.desc),o("span",{class:"option-time"},"预计 ",t.time)))))),!d&&o("div",{class:"step-section"},o("div",{class:"step-title"},"第三步:提供材料"),o("div",{class:"resume-upload-section"},o("label",null,"上传简历"),o("pcm-upload",{ref:t=>this.pcmUploadRef=t,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:c,onUploadChange:t=>{const e=t.detail??[];this.uploadedFileInfo=e[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),this.selectedOptimizationMode==="targeted"&&o("div",{class:"jd-input-section"},o("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!p&&o("div",{class:"button-group"},!!this.oemId&&o("button",{class:"position-selector-button",onClick:this.handleOpenPositionSelector,type:"button"},"选择职位"),o("pcm-mobile-input-btn",{name:"职位描述",onOk:t=>{this.jobDescription=t.detail}})),o("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.jobDescription,onInput:this.handleJobDescriptionChange,disabled:p}))),o("button",{class:"submit-button",disabled:!this.isFormValid()||this.isUploading||this.isSubmitting,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isSubmitting?"处理中...":"开始分析"),!a&&!this.selectedOptimizationMode&&o("div",{class:"form-hint"},"请先选择优化模式和输出方式"),!a&&this.selectedOptimizationMode&&this.selectedOutputType===null&&o("div",{class:"form-hint"},"请选择输出方式"),l&&!c&&!this.uploadedFileInfo&&o("div",{class:"form-hint warning"},"请上传简历文件"),this.selectedOptimizationMode==="targeted"&&!p&&!this.jobDescription.trim()&&l&&o("div",{class:"form-hint warning"},"针对性优化需要提供职位描述"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),s&&!this.showIframe&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,this.getEffectiveOptimizationType()===1||this.getEffectiveOptimizationType()===2?o("pcm-thousand-resume-wrapper",{isOpen:true,token:this.token,conversationId:this.currentConversationId,botId:"45444431062634496",optimizationType:this.getEffectiveOptimizationType(),customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||(this.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},defaultQuery:this.defaultQuery,modalTitle:this.modalTitle,icon:this.icon,fullscreen:this.fullscreen,zIndex:this.zIndex,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,onModalClosed:this.handleClose,onConversationStart:t=>this.handleStreamComplete(t),onStreamComplete:t=>this.handleStreamComplete(t),onInterviewComplete:t=>this.handleStreamComplete(t)}):o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isNeedClose,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"45444431062634496",conversationId:this.currentConversationId,defaultQuery:this.defaultQuery,filePreviewMode:this.filePreviewMode,closeResume:this.closeResumeChat,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||(this.selectedOptimizationMode==="targeted"?this.jobDescription:""),job_title:this.customInputs?.job_title||"",optimization_type:this.getEffectiveOptimizationType()},interviewMode:"text",onStreamComplete:this.handleStreamComplete,onHistoryConversationSelect:t=>{if(t.detail?.inputs?.optimization_type==1||t.detail?.inputs?.optimization_type==2){t.preventDefault();this.handleSelectConversation(t.detail)}}})),this.showIframe&&o(o.Fragment,null,o("div",{class:"iframe-container"},o("iframe",{ref:t=>this._iframeEl=t,src:`${r}/myresume?conversation_id=${this.currentConversationId}&isSdk=true`,frameborder:"0",onLoad:this.handleIframeLoad})))),this.showPositionSelector&&o("div",{class:"position-selector-modal-overlay"},o("div",{class:"position-selector-modal"},o("div",{class:"position-selector-modal-header"},o("h3",null,"选择职位"),o("button",{class:"position-selector-close-btn",onClick:this.handleClosePositionSelector},"×")),o("div",{class:"position-selector-modal-body"},o("components-position-selector",{oemId:this.oemId,multiple:false,onPositionSelected:this.handlePositionSelected})))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=c+(h+f);export{u as oem_qgqjl_modal};
2
+ //# sourceMappingURL=p-cd4b6377.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,c as t,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as s,c as r,e as a}from"./p-De3vyGBR.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-DXVhHj6-.js";const p=".label-with-button{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.button-group{display:flex;gap:8px;align-items:center}.position-selector-button{padding:4px 12px;background:#1890ff;color:white;border:none;border-radius:4px;font-size:13px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;height:28px;line-height:20px}.position-selector-button:hover{background:#40a9ff}.position-selector-button:active{background:#096dd9}.phone-input{width:calc(100% - 16px);padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.phone-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.verification-code-container{display:flex;gap:8px;align-items:center}.verification-code-input{flex:1;padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.verification-code-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.send-code-button{padding:8px 16px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:14px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;min-width:100px}.send-code-button:hover:not(:disabled){background-color:#40a9ff}.send-code-button:disabled{background-color:rgba(0, 0, 0, 0.04);color:rgba(0, 0, 0, 0.25);cursor:not-allowed}.position-selector-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:3000;padding:20px}.position-selector-modal{background:white;border-radius:8px;width:90%;max-width:900px;height:80vh;max-height:600px;display:flex;flex-direction:column;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.position-selector-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.position-selector-modal-header h3{margin:0;font-size:16px;font-weight:500;color:rgba(0, 0, 0, 0.85)}.position-selector-close-btn{background:none;border:none;font-size:24px;line-height:1;cursor:pointer;color:rgba(0, 0, 0, 0.45);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.3s}.position-selector-close-btn:hover{background-color:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.85)}.position-selector-modal-body{flex:1;overflow:hidden;display:flex;flex-direction:column}@media screen and (max-width: 768px){.position-selector-modal{width:100%;height:90vh;max-height:none;border-radius:8px 8px 0 0;margin-top:auto}.position-selector-modal-overlay{padding:0;align-items:flex-end}}";const c='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-drawer-content{height:100%;display:flex;flex-direction:column}.conversation-list{flex:1;overflow-y:auto;padding:8px 0}.loading-conversations,.empty-conversations{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#999}.loading-conversations .loading-spinner-small{margin-bottom:12px}.conversation-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 8px 4px 8px;border-radius:8px;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.conversation-item:hover{background:#f5f5f5}.conversation-info{flex:1;min-width:0}.conversation-title{font-size:14px;font-weight:500;color:#262626;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}.message-count{flex-shrink:0}.conversation-status{padding:2px 6px;border-radius:4px;font-size:11px;font-weight:500}.conversation-status.completed{background:#f6ffed;color:#52c41a}.conversation-status.running{background:#fff7e6;color:#fa8c16}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const h=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent");this.sendSmsCodeRequest=t(this,"sendSmsCodeRequest");this.recordingError=t(this,"recordingError")}modalTitle="模拟面试";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始模拟面试";maxRecordingTime=120;waitingTime=10;fullscreen=false;customInputs={};showWorkspaceHistory=false;oemId;digitalId;openingIndex=0;enableVirtualHuman=false;showEndInterviewButton=false;playbackRate=1;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;sendSmsCodeRequest;interviewMode="text";recordingError;showCopyButton=true;showFeedbackButtons=true;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;phoneNumber="";verificationCode="";isSendingCode=false;countdown=0;isVerifyingCode=false;showPositionSelector=false;get hostElement(){return i(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;virtualChatModalRef=null;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){if(this.virtualChatModalRef){await this.virtualChatModalRef.setComponentActive(false)}this.resetState()}else{await s(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}resetState(){this.showChatModal=false;this.jobDescription="";this.isSubmitting=false;this.selectedFile=null;this.isUploading=false;this.uploadedFileInfo=null;this.phoneNumber="";this.verificationCode="";this.isSendingCode=false;this.isVerifyingCode=false;this.countdown=0;if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}handleClose=()=>{this.modalClosed.emit()};handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};handlePhoneNumberChange=e=>{const t=e.target;this.phoneNumber=t.value};handleVerificationCodeChange=e=>{const t=e.target;this.verificationCode=t.value};countdownTimer=null;startCountdown=()=>{this.countdown=60;if(this.countdownTimer){clearInterval(this.countdownTimer)}this.countdownTimer=setInterval((()=>{this.countdown--;if(this.countdown<=0){if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}}),1e3)};handleSendCode=()=>{if(!this.phoneNumber.trim()){d.error("请输入手机号");return}const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){d.error("请输入正确的手机号");return}this.isSendingCode=true;this.sendSmsCodeRequest.emit({mobile:this.phoneNumber.trim(),codeType:8});this.startCountdown();this.isSendingCode=false};handleOpenPositionSelector=()=>{if(!this.oemId){d.info("未配置OEM ID,无法选择职位");return}this.showPositionSelector=true};handleClosePositionSelector=()=>{this.showPositionSelector=false};handlePositionSelected=e=>{const t=e.detail;this.jobDescription=t.formatted_text||"";this.showPositionSelector=false;d.success("职位信息已填充")};handleStartInterview=async()=>{if(!this.customInputs?.job_info&&!this.jobDescription.trim()){d.error("请输入职位描述");return}if(this.phoneNumber.trim()){const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){d.error("请输入正确的手机号");return}if(!this.verificationCode.trim()){d.error("请输入验证码");return}this.isVerifyingCode=true;try{const e=await a(this.phoneNumber.trim(),this.verificationCode.trim(),0);if(!e.success){d.error(e.error.detail||"验证码错误");this.isVerifyingCode=false;return}}catch(e){d.error("验证码校验失败");this.isVerifyingCode=false;return}this.isVerifyingCode=false}if(await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true};pcmUploadRef;render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const s=Boolean(this.customInputs&&this.customInputs.job_info);const r=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));return o("div",{class:i,style:e},o("div",{class:t},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&o("div",{class:"input-container"},o("div",{class:"jd-input-section"},o("div",{class:"label-with-button"},o("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!s&&o("div",{class:"button-group"},this.oemId&&o("button",{class:"position-selector-button",onClick:this.handleOpenPositionSelector,type:"button"},"选择职位"),o("pcm-mobile-input-btn",{name:"职位描述",onOk:e=>{this.jobDescription=e.detail}}))),o("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.customInputs?.job_info||this.jobDescription,onInput:this.handleJobDescriptionChange,disabled:s})),o("div",{class:"jd-input-section"},o("label",null,"上传简历(选填)"),o("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:r,onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),o("div",{class:"jd-input-section"},o("label",null,"手机号(选填,填写后报告结果将通过短信发送)"),o("input",{type:"tel",class:"phone-input",placeholder:"请输入手机号",maxLength:11,value:this.phoneNumber,onInput:this.handlePhoneNumberChange})),this.phoneNumber.trim().length===11&&o("div",{class:"jd-input-section"},o("label",null,"验证码"),o("div",{class:"verification-code-container"},o("input",{type:"text",class:"verification-code-input",placeholder:"请输入验证码",maxLength:6,value:this.verificationCode,onInput:this.handleVerificationCodeChange}),o("button",{class:"send-code-button",disabled:this.isSendingCode||this.countdown>0||!this.phoneNumber.trim(),onClick:this.handleSendCode},this.isSendingCode?"发送中...":this.countdown>0?`${this.countdown}秒`:"发送验证码"))),o("button",{class:"submit-button",disabled:!(this.customInputs?.job_info||this.jobDescription.trim())||this.isUploading||this.isSubmitting||this.isVerifyingCode,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isVerifyingCode?"验证中...":this.isSubmitting?"处理中...":"开始面试"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,this.enableVirtualHuman&&this.digitalId?o("pcm-virtual-chat-modal",{ref:e=>this.virtualChatModalRef=e,isOpen:true,fullscreen:this.fullscreen,botId:"3022316191018884",digitalId:this.digitalId,openingIndex:this.openingIndex,conversationId:this.conversationId,defaultQuery:this.defaultQuery,waitingTime:this.waitingTime,playbackRate:this.playbackRate,showEndInterviewButton:this.showEndInterviewButton,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription,question_number:this.customInputs?.question_number||5,ai_interview_type:this.digitalId,phone:this.phoneNumber.trim()||undefined}}):o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018884",digitalId:this.digitalId,conversationId:this.conversationId,defaultQuery:this.defaultQuery,maxRecordingTime:this.maxRecordingTime,waitingTime:this.waitingTime,playbackRate:this.playbackRate,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,showEndInterviewButton:this.showEndInterviewButton,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription,question_number:this.customInputs?.question_number||5,ai_interview_type:this.digitalId||(this.interviewMode==="video"?2:1),phone:this.phoneNumber.trim()||undefined},interviewMode:this.interviewMode}))),this.showPositionSelector&&o("div",{class:"position-selector-modal-overlay"},o("div",{class:"position-selector-modal"},o("div",{class:"position-selector-modal-header"},o("h3",null,"选择职位"),o("button",{class:"position-selector-close-btn",onClick:this.handleClosePositionSelector},"×")),o("div",{class:"position-selector-modal-body"},o("components-position-selector",{oemId:this.oemId,multiple:false,onPositionSelected:this.handlePositionSelected})))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=p+(c+h);export{u as oem_mnms_modal};
2
- //# sourceMappingURL=p-e71df1c6.entry.js.map
1
+ import{r as e,c as t,g as i,h as o}from"./p-Bq0K-WqZ.js";import{a as n,v as s,c as r,e as a}from"./p-BcP-XCgZ.js";import{E as l}from"./p-C0FYX2-Z.js";import{M as d}from"./p-DXVhHj6-.js";const p=".label-with-button{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.button-group{display:flex;gap:8px;align-items:center}.position-selector-button{padding:4px 12px;background:#1890ff;color:white;border:none;border-radius:4px;font-size:13px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;height:28px;line-height:20px}.position-selector-button:hover{background:#40a9ff}.position-selector-button:active{background:#096dd9}.phone-input{width:calc(100% - 16px);padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.phone-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.verification-code-container{display:flex;gap:8px;align-items:center}.verification-code-input{flex:1;padding:8px;border:1px solid #ddd;border-radius:4px;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s}.verification-code-input:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.send-code-button{padding:8px 16px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:14px;cursor:pointer;transition:all 0.3s ease;white-space:nowrap;min-width:100px}.send-code-button:hover:not(:disabled){background-color:#40a9ff}.send-code-button:disabled{background-color:rgba(0, 0, 0, 0.04);color:rgba(0, 0, 0, 0.25);cursor:not-allowed}.position-selector-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;align-items:center;justify-content:center;z-index:3000;padding:20px}.position-selector-modal{background:white;border-radius:8px;width:90%;max-width:900px;height:80vh;max-height:600px;display:flex;flex-direction:column;box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);animation:modalFadeIn 0.3s ease}@keyframes modalFadeIn{from{opacity:0;transform:scale(0.95) translateY(-20px)}to{opacity:1;transform:scale(1) translateY(0)}}.position-selector-modal-header{display:flex;justify-content:space-between;align-items:center;padding:16px 24px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.position-selector-modal-header h3{margin:0;font-size:16px;font-weight:500;color:rgba(0, 0, 0, 0.85)}.position-selector-close-btn{background:none;border:none;font-size:24px;line-height:1;cursor:pointer;color:rgba(0, 0, 0, 0.45);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all 0.3s}.position-selector-close-btn:hover{background-color:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.85)}.position-selector-modal-body{flex:1;overflow:hidden;display:flex;flex-direction:column}@media screen and (max-width: 768px){.position-selector-modal{width:100%;height:90vh;max-height:none;border-radius:8px 8px 0 0;margin-top:auto}.position-selector-modal-overlay{padding:0;align-items:flex-end}}";const c='.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.5);display:flex;z-index:1000;overflow-y:auto}.fullscreen-overlay{padding:0;background-color:rgba(0, 0, 0, 0.7);position:absolute;width:100%;height:auto}.modal-container{background-color:#fff;border-radius:8px;width:100%;display:flex;flex-direction:column;position:relative;margin:auto;transition:all 0.3s ease-out;overflow:hidden}.modal-container.fullscreen{width:100%;max-width:none;height:100%;border-radius:0;margin:0;display:flex;flex-direction:column;max-height:100%}.pc-layout{width:80%;max-width:600px;min-width:320px}@media screen and (max-width: 768px){.pc-layout{width:95%}.modal-overlay{padding:10px 0px 0px 0px}.modal-container.fullscreen{width:100%;height:100%;max-height:100%;border-radius:16px 16px 0 0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}}.modal-header{display:flex;justify-content:space-between;align-items:center;padding:4px 16px;height:50px;border-bottom:1px solid #e8e8e8;flex-shrink:0}.header-left{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:600;color:#333}.header-icon{width:24px;height:24px}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:4px}.close-button:hover{background-color:rgba(0, 0, 0, 0.04)}.close-button span{font-size:24px;line-height:1;color:#999}.close-button:hover span{color:#666}.upload-area{cursor:pointer;width:100%}.upload-placeholder{transition:all 0.3s ease;display:flex;flex-direction:column;align-items:center;background:rgba(0, 0, 0, 0.02);border:1px dashed #d9d9d9;border-radius:8px;cursor:pointer}.upload-placeholder:hover{border:1px dashed #1890ff}.upload-placeholder img{margin-top:8px;width:50px;height:50px}.upload-placeholder .upload-text{margin:4px 0;color:#332F39;font-size:14px}.upload-placeholder .upload-hint{font-size:14px;color:#949AA5;margin-top:8px;padding:0px 10px;text-align:center;white-space:normal;word-wrap:break-word;word-break:break-all;line-height:1.4}.file-item{position:relative;padding:16px;border:1px solid #e2e8f0;border-radius:8px;transition:border-color 0.3s;cursor:pointer;margin-bottom:16px;display:flex;justify-content:space-between;align-items:center}.file-item:hover{border-color:#0D75FB}.file-item-content{display:flex;align-items:center;gap:8px;flex:1;min-width:0;overflow:hidden}.file-icon{color:#0D75FB;flex-shrink:0}.file-name{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100% - 50px)}.remove-file{background:transparent;border:none;color:#94a3b8;cursor:pointer;font-size:18px;display:flex;align-items:center;justify-content:center;padding:4px;margin-left:8px;border-radius:4px;transition:all 0.2s;min-width:30px;min-height:30px}.remove-file:hover{background-color:#f1f5f9;color:#475569}.file-input{display:none}.input-container{padding:20px;display:flex;flex-direction:column;height:calc(100% - 50px);background:linear-gradient(150deg, #2a6ee933, #0000 50%) 0 0 / 400px 200px no-repeat, #fff;overflow-y:auto}.input-container h3{margin-top:0;margin-bottom:20px;font-size:18px;color:#333;text-align:center}.jd-input-section{margin-bottom:20px}.jd-input-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.job-description-textarea{width:calc(100% - 16px);border:1px solid #ddd;border-radius:4px;resize:vertical;font-family:inherit;font-size:14px;line-height:1.5;transition:border-color 0.3s;padding:8px}.job-description-textarea:focus{outline:none;border-color:#1890ff;box-shadow:0 0 0 2px rgba(24, 144, 255, 0.2)}.resume-upload-section{margin-bottom:20px;width:100%;display:flex;flex-direction:column}.resume-upload-section label{display:block;margin-bottom:8px;font-weight:500;color:#333}.interview-settings-section{margin-bottom:24px;padding:20px;background-color:#f8f9fa;border-radius:8px;border:1px solid #e9ecef}.settings-row{margin-bottom:20px}.settings-row:last-child{margin-bottom:0}.settings-label{display:block;font-weight:500;color:#333;margin-bottom:12px;font-size:14px}.question-number-section{width:100%}.slider-container{display:flex;align-items:center;gap:12px}.question-slider{flex:1;height:6px;background:#ddd;outline:none;border-radius:3px;-webkit-appearance:none;appearance:none}.question-slider::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.question-slider::-moz-range-thumb{width:20px;height:20px;background:#0D75FB;cursor:pointer;border-radius:50%;border:none;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}.slider-value{font-weight:600;color:#0D75FB;font-size:14px;min-width:30px;text-align:center}.analysis-toggle-section{width:100%}.toggle-container{display:flex;align-items:center;gap:12px}.toggle-switch{position:relative;display:inline-block;width:44px;height:24px}.toggle-switch input{opacity:0;width:0;height:0}.toggle-slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;transition:0.3s;border-radius:24px}.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:white;transition:0.3s;border-radius:50%;box-shadow:0 2px 4px rgba(0, 0, 0, 0.2)}input:checked+.toggle-slider{background-color:#0D75FB}input:checked+.toggle-slider:before{transform:translateX(20px)}.toggle-text{font-size:14px;color:#666;font-weight:500}.submit-button{margin-top:10px;padding:10px 30px;background:#0D75FB;color:white;border:none;border-radius:4px;font-size:16px;cursor:pointer;transition:all 0.3s ease;width:100%;max-width:400px;align-self:center}.submit-button:hover{background-color:#40a9ff}.submit-button:disabled{background-color:rgba(0,0,0,0.04);color:rgba(0,0,0,0.25);cursor:not-allowed}.ai-disclaimer{margin-top:16px;text-align:center;font-size:12px;color:#999;line-height:1.5}.ai-disclaimer p{margin:4px 0}.beian-info{display:flex;justify-content:center;flex-wrap:wrap;gap:4px}.ai-disclaimer a{color:#666;text-decoration:none;transition:color 0.2s ease}.ai-disclaimer a:hover{color:#1890ff;text-decoration:underline}.loading-container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding:24px}.loading-spinner{width:40px;height:40px;border:4px solid rgba(0, 0, 0, 0.1);border-radius:50%;border-top-color:var(--pcm-primary-color, #1890ff);animation:spin 1s linear infinite;margin-bottom:16px}.loading-text{font-size:16px;color:var(--pcm-text-color, #333)}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.header-history-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:4px 8px;border:none;border-radius:4px;background:transparent;color:#bbb;cursor:pointer;font-size:13px;font-family:inherit;line-height:1;transition:all 0.2s ease;flex-shrink:0;white-space:nowrap}.header-history-button svg{width:16px;height:16px;display:block;flex-shrink:0}.header-history-button:hover{background-color:rgba(0, 0, 0, 0.04);color:#666}.header-history-button:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-drawer-content{height:100%;display:flex;flex-direction:column}.conversation-list{flex:1;overflow-y:auto;padding:8px 0}.loading-conversations,.empty-conversations{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:40px 20px;color:#999}.loading-conversations .loading-spinner-small{margin-bottom:12px}.conversation-item{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;margin:0 8px 4px 8px;border-radius:8px;cursor:pointer;transition:all 0.2s ease;border:1px solid transparent}.conversation-item:hover{background:#f5f5f5}.conversation-info{flex:1;min-width:0}.conversation-title{font-size:14px;font-weight:500;color:#262626;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation-meta{display:flex;align-items:center;gap:8px;font-size:12px;color:#8c8c8c}.conversation-time{flex-shrink:0}.message-count{flex-shrink:0}.conversation-status{padding:2px 6px;border-radius:4px;font-size:11px;font-weight:500}.conversation-status.completed{background:#f6ffed;color:#52c41a}.conversation-status.running{background:#fff7e6;color:#fa8c16}.header-history-entry{display:inline-flex;align-items:center;justify-content:center;margin-left:8px;padding:4px 8px;border:none;border-radius:4px;background:#e6f7ff;color:#1890ff;cursor:pointer;font-size:12px;font-family:inherit;line-height:1;white-space:nowrap;transition:all 0.2s ease}.header-history-entry:hover{background:#bae7ff;color:#0958d9;transform:translateY(-1px)}.header-history-entry:focus-visible{outline:2px solid rgba(13, 117, 251, 0.35);outline-offset:2px}.history-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px 16px;border-top:1px solid #f0f0f0}.history-pagination-button{min-width:72px;padding:6px 12px;border:1px solid #d9d9d9;border-radius:6px;background:#fff;color:#595959;cursor:pointer;font-size:12px;transition:all 0.2s ease}.history-pagination-button:hover:not(:disabled){border-color:#1890ff;color:#1890ff;background:#e6f7ff}.history-pagination-button:disabled{border-color:#f0f0f0;color:#bfbfbf;background:#fafafa;cursor:not-allowed}.history-pagination-info{flex:1;text-align:center;color:#8c8c8c;font-size:12px}';const h=":host{font-size:16px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;font-weight:normal;font-style:normal;font-variant:normal;line-height:1.5;letter-spacing:normal;word-spacing:normal;color:#333;text-align:left;text-indent:0;text-transform:none;white-space:normal;word-wrap:normal;word-break:normal;visibility:visible;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;border-collapse:separate;border-spacing:0;caption-side:top;empty-cells:show;table-layout:auto;quotes:auto;cursor:auto;direction:ltr;orphans:2;widows:2;page-break-inside:auto;text-decoration:none;text-shadow:none;box-sizing:border-box;writing-mode:horizontal-tb;text-orientation:mixed}";const u=class{constructor(i){e(this,i);this.modalClosed=t(this,"modalClosed");this.uploadSuccess=t(this,"uploadSuccess");this.streamComplete=t(this,"streamComplete");this.conversationStart=t(this,"conversationStart");this.interviewComplete=t(this,"interviewComplete");this.tokenInvalid=t(this,"tokenInvalid");this.someErrorEvent=t(this,"someErrorEvent");this.sendSmsCodeRequest=t(this,"sendSmsCodeRequest");this.recordingError=t(this,"recordingError")}modalTitle="模拟面试";token;isOpen=false;modalClosed;icon;zIndex=1e3;isShowHeader=true;isNeedClose=true;conversationId;defaultQuery="请开始模拟面试";maxRecordingTime=120;waitingTime=10;fullscreen=false;customInputs={};showWorkspaceHistory=false;oemId;digitalId;openingIndex=0;enableVirtualHuman=false;showEndInterviewButton=false;playbackRate=1;uploadSuccess;streamComplete;conversationStart;interviewComplete;tokenInvalid;someErrorEvent;sendSmsCodeRequest;interviewMode="text";recordingError;showCopyButton=true;showFeedbackButtons=true;selectedFile=null;isUploading=false;uploadedFileInfo=null;showChatModal=false;phoneNumber="";verificationCode="";isSendingCode=false;countdown=0;isVerifyingCode=false;showPositionSelector=false;get hostElement(){return i(this)}jobDescription="";isSubmitting=false;tokenInvalidListener;removeErrorListener;virtualChatModalRef=null;handleTokenChange(e){if(e&&e!==n.getToken()){n.setToken(e)}}async handleIsOpenChange(e){if(!e){if(this.virtualChatModalRef){await this.virtualChatModalRef.setComponentActive(false)}this.resetState()}else{await s(this.token);if(this.conversationId){this.showChatModal=true}}}componentWillLoad(){if(this.zIndex){r.setItem("modal-zIndex",this.zIndex)}if(this.token){n.setToken(this.token)}this.tokenInvalidListener=()=>{this.tokenInvalid.emit()};this.removeErrorListener=l.addErrorListener((e=>{this.someErrorEvent.emit(e)}));document.addEventListener("pcm-token-invalid",this.tokenInvalidListener)}disconnectedCallback(){document.removeEventListener("pcm-token-invalid",this.tokenInvalidListener);if(this.removeErrorListener){this.removeErrorListener()}if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}resetState(){this.showChatModal=false;this.jobDescription="";this.isSubmitting=false;this.selectedFile=null;this.isUploading=false;this.uploadedFileInfo=null;this.phoneNumber="";this.verificationCode="";this.isSendingCode=false;this.isVerifyingCode=false;this.countdown=0;if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}handleClose=()=>{this.modalClosed.emit()};handleJobDescriptionChange=e=>{const t=e.target;this.jobDescription=t.value};handlePhoneNumberChange=e=>{const t=e.target;this.phoneNumber=t.value};handleVerificationCodeChange=e=>{const t=e.target;this.verificationCode=t.value};countdownTimer=null;startCountdown=()=>{this.countdown=60;if(this.countdownTimer){clearInterval(this.countdownTimer)}this.countdownTimer=setInterval((()=>{this.countdown--;if(this.countdown<=0){if(this.countdownTimer){clearInterval(this.countdownTimer);this.countdownTimer=null}}}),1e3)};handleSendCode=()=>{if(!this.phoneNumber.trim()){d.error("请输入手机号");return}const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){d.error("请输入正确的手机号");return}this.isSendingCode=true;this.sendSmsCodeRequest.emit({mobile:this.phoneNumber.trim(),codeType:8});this.startCountdown();this.isSendingCode=false};handleOpenPositionSelector=()=>{if(!this.oemId){d.info("未配置OEM ID,无法选择职位");return}this.showPositionSelector=true};handleClosePositionSelector=()=>{this.showPositionSelector=false};handlePositionSelected=e=>{const t=e.detail;this.jobDescription=t.formatted_text||"";this.showPositionSelector=false;d.success("职位信息已填充")};handleStartInterview=async()=>{if(!this.customInputs?.job_info&&!this.jobDescription.trim()){d.error("请输入职位描述");return}if(this.phoneNumber.trim()){const e=/^1[3-9]\d{9}$/;if(!e.test(this.phoneNumber.trim())){d.error("请输入正确的手机号");return}if(!this.verificationCode.trim()){d.error("请输入验证码");return}this.isVerifyingCode=true;try{const e=await a(this.phoneNumber.trim(),this.verificationCode.trim(),0);if(!e.success){d.error(e.error.detail||"验证码错误");this.isVerifyingCode=false;return}}catch(e){d.error("验证码校验失败");this.isVerifyingCode=false;return}this.isVerifyingCode=false}if(await(this.pcmUploadRef?.getIsUploading?.())){d.info("文件上传中,请稍后");return}this.isSubmitting=true;this.showChatModal=true};pcmUploadRef;render(){if(!this.isOpen)return null;const e={zIndex:String(this.zIndex)};const t={"modal-container":true,fullscreen:this.fullscreen,"pc-layout":true};const i={"modal-overlay":true,"fullscreen-overlay":this.fullscreen};const n=this.conversationId&&!this.showChatModal;const s=Boolean(this.customInputs&&this.customInputs.job_info);const r=Boolean(this.customInputs&&(this.customInputs.file_url||this.customInputs.resume_content));return o("div",{class:i,style:e},o("div",{class:t},this.isShowHeader&&o("div",{class:"modal-header"},o("div",{class:"header-left"},this.icon&&o("img",{src:this.icon,class:"header-icon",alt:"应用图标"}),o("div",null,this.modalTitle)),this.isNeedClose&&o("button",{class:"close-button",onClick:this.handleClose},o("span",null,"×"))),!this.showChatModal&&!this.conversationId&&o("div",{class:"input-container"},o("div",{class:"jd-input-section"},o("div",{class:"label-with-button"},o("label",{htmlFor:"job-description"},"请输入职位描述 (JD)"),!s&&o("div",{class:"button-group"},this.oemId&&o("button",{class:"position-selector-button",onClick:this.handleOpenPositionSelector,type:"button"},"选择职位"),o("pcm-mobile-input-btn",{name:"职位描述",onOk:e=>{this.jobDescription=e.detail}}))),o("textarea",{id:"job-description",class:"job-description-textarea",placeholder:"请输入职位描述,包括职责、要求等信息...",rows:6,value:this.customInputs?.job_info||this.jobDescription,onInput:this.handleJobDescriptionChange,disabled:s})),o("div",{class:"jd-input-section"},o("label",null,"上传简历(选填)"),o("pcm-upload",{ref:e=>this.pcmUploadRef=e,maxFileSize:15*1024*1024,multiple:false,mobileUploadAble:true,acceptFileSuffixList:[".txt",".md",".pdf",".docx",".doc"],uploadParams:{tags:["resume"]},defaultFileList:this.customInputs?.file_url?[{cos_key:this.customInputs.file_url,file_name:this.customInputs?.file_name||"预设简历",file_size:0,ext:""}]:undefined,disabled:r,onUploadChange:e=>{const t=e.detail??[];this.uploadedFileInfo=t[0];this.uploadSuccess.emit(this.uploadedFileInfo)}})),o("div",{class:"jd-input-section"},o("label",null,"手机号(选填,填写后报告结果将通过短信发送)"),o("input",{type:"tel",class:"phone-input",placeholder:"请输入手机号",maxLength:11,value:this.phoneNumber,onInput:this.handlePhoneNumberChange})),this.phoneNumber.trim().length===11&&o("div",{class:"jd-input-section"},o("label",null,"验证码"),o("div",{class:"verification-code-container"},o("input",{type:"text",class:"verification-code-input",placeholder:"请输入验证码",maxLength:6,value:this.verificationCode,onInput:this.handleVerificationCodeChange}),o("button",{class:"send-code-button",disabled:this.isSendingCode||this.countdown>0||!this.phoneNumber.trim(),onClick:this.handleSendCode},this.isSendingCode?"发送中...":this.countdown>0?`${this.countdown}秒`:"发送验证码"))),o("button",{class:"submit-button",disabled:!(this.customInputs?.job_info||this.jobDescription.trim())||this.isUploading||this.isSubmitting||this.isVerifyingCode,onClick:this.handleStartInterview},this.isUploading?"上传中...":this.isVerifyingCode?"验证中...":this.isSubmitting?"处理中...":"开始面试"),o("div",{class:"ai-disclaimer"},o("p",null,"所有内容均由AI生成仅供参考"),o("p",{class:"beian-info"},o("span",null,"中央网信办生成式人工智能服务备案号"),":",o("a",{href:"https://www.pincaimao.com",target:"_blank",rel:"noopener noreferrer"},"Hunan-PinCaiMao-202412310003")))),n&&o("div",{class:"loading-container"},o("div",{class:"loading-spinner"}),o("p",{class:"loading-text"},"正在加载对话...")),this.showChatModal&&o("div",null,this.enableVirtualHuman&&this.digitalId?o("pcm-virtual-chat-modal",{ref:e=>this.virtualChatModalRef=e,isOpen:true,fullscreen:this.fullscreen,botId:"3022316191018884",digitalId:this.digitalId,openingIndex:this.openingIndex,conversationId:this.conversationId,defaultQuery:this.defaultQuery,waitingTime:this.waitingTime,playbackRate:this.playbackRate,showEndInterviewButton:this.showEndInterviewButton,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription,question_number:this.customInputs?.question_number||5,ai_interview_type:this.digitalId,phone:this.phoneNumber.trim()||undefined}}):o("pcm-app-chat-modal",{isOpen:true,modalTitle:this.modalTitle,icon:this.icon,isShowHeader:this.isShowHeader,isNeedClose:this.isShowHeader,fullscreen:this.fullscreen,showWorkspaceHistory:this.showWorkspaceHistory,botId:"3022316191018884",digitalId:this.digitalId,conversationId:this.conversationId,defaultQuery:this.defaultQuery,maxRecordingTime:this.maxRecordingTime,waitingTime:this.waitingTime,playbackRate:this.playbackRate,showCopyButton:this.showCopyButton,showFeedbackButtons:this.showFeedbackButtons,showEndInterviewButton:this.showEndInterviewButton,customInputs:{...this.customInputs,file_url:this.customInputs?.file_url||this.uploadedFileInfo?.cos_key,file_name:this.customInputs?.file_name||this.uploadedFileInfo?.file_name,job_info:this.customInputs?.job_info||this.jobDescription,question_number:this.customInputs?.question_number||5,ai_interview_type:this.digitalId||(this.interviewMode==="video"?"2":"1"),phone:this.phoneNumber.trim()||undefined},interviewMode:this.interviewMode}))),this.showPositionSelector&&o("div",{class:"position-selector-modal-overlay"},o("div",{class:"position-selector-modal"},o("div",{class:"position-selector-modal-header"},o("h3",null,"选择职位"),o("button",{class:"position-selector-close-btn",onClick:this.handleClosePositionSelector},"×")),o("div",{class:"position-selector-modal-body"},o("components-position-selector",{oemId:this.oemId,multiple:false,onPositionSelected:this.handlePositionSelected})))))}static get watchers(){return{token:["handleTokenChange"],isOpen:["handleIsOpenChange"]}}};u.style=p+(c+h);export{u as oem_mnms_modal};
2
+ //# sourceMappingURL=p-d0a26bca.entry.js.map