{"id":4563,"date":"2026-06-05T21:23:53","date_gmt":"2026-06-05T21:23:53","guid":{"rendered":"https:\/\/myaiagenthub.com\/?page_id=4563"},"modified":"2026-06-11T14:59:50","modified_gmt":"2026-06-11T14:59:50","slug":"invoice-proposal-generator-forms","status":"publish","type":"page","link":"https:\/\/myaiagenthub.com\/es\/invoice-proposal-generator-forms\/","title":{"rendered":"Invoice &#038; Proposal Generator Forms"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"4563\" class=\"elementor elementor-4563\">\n\t\t\t\t<div class=\"elementor-element elementor-element-48f81b9 e-flex e-con-boxed wpr-particle-no wpr-jarallax-no wpr-parallax-no wpr-sticky-section-no wpr-column-slider-no wpr-equal-height-no e-con e-parent\" data-id=\"48f81b9\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-61221ab elementor-widget__width-inherit elementor-widget elementor-widget-html\" data-id=\"61221ab\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t\r\n<style>\r\n@import url('https:\/\/fonts.googleapis.com\/css2?family=Poppins:wght@400;600;700;800&display=swap');\r\n\r\n.ipg-wrap { max-width: 680px; margin: 0 auto; font-family: 'Poppins', sans-serif; padding: 20px; }\r\n.ipg-wrap h2 { font-size: 26px; font-weight: 800; color: #0a0a2e; margin-bottom: 8px; text-align: center; }\r\n.ipg-wrap p.ipg-sub { font-size: 15px; color: #555; text-align: center; margin-bottom: 24px; }\r\n\r\n\/* Welcome box *\/\r\n.ipg-welcome-box {\r\n  background: #fff;\r\n  border: 2px solid #38bdf8;\r\n  border-radius: 14px;\r\n  padding: 16px 20px;\r\n  margin-bottom: 20px;\r\n  display: flex;\r\n  align-items: flex-start;\r\n  gap: 12px;\r\n}\r\n.ipg-welcome-box.invoice { border-color: #22c55e; }\r\n.ipg-welcome-box .w-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }\r\n.ipg-welcome-box .w-name { font-size: 11px; font-weight: 700; color: #0284c7; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }\r\n.ipg-welcome-box.invoice .w-name { color: #16a34a; }\r\n.ipg-welcome-box .w-msg { font-size: 14px; color: #1e293b; line-height: 1.6; min-height: 20px; }\r\n\r\n\/* Document type buttons *\/\r\n.ipg-type-select { display: flex; gap: 16px; justify-content: center; margin-bottom: 28px; flex-wrap: wrap; }\r\n.ipg-type-btn { flex: 1; min-width: 200px; max-width: 280px; padding: 18px 20px; border: none; border-radius: 12px; font-size: 16px; font-weight: 700; font-family: 'Poppins', sans-serif; cursor: pointer; transition: all 0.3s ease; opacity: 0.85; }\r\n.ipg-type-btn:hover { opacity: 1; transform: scale(1.02); }\r\n.ipg-type-btn.selected { opacity: 1; transform: scale(1.02); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }\r\n.btn-proposal { background: #38bdf8; color: #fff; }\r\n.btn-invoice { background: #22c55e; color: #fff; }\r\n\r\n\/* Progress dots *\/\r\n.ipg-progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; display: none; }\r\n.ipg-dot { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; transition: background 0.3s; }\r\n.ipg-dot.active { background: #38bdf8; }\r\n.ipg-dot.active.invoice { background: #22c55e; }\r\n.ipg-dot.done { background: #22c55e; }\r\n\r\n\/* Interview panel *\/\r\n.ipg-panel { background: #0f1e36; border-radius: 16px; padding: 28px 24px; text-align: center; margin-bottom: 24px; display: none; border: 2px solid #38bdf8; }\r\n.ipg-panel.invoice { border-color: #22c55e; }\r\n.ipg-q-label { font-size: 15px; font-weight: 700; margin-bottom: 6px; color: #38bdf8; }\r\n.ipg-panel.invoice .ipg-q-label { color: #22c55e; }\r\n\r\n\/* White editable transcript box *\/\r\n.ipg-transcript {\r\n  background: #ffffff;\r\n  border: 2px solid #38bdf8;\r\n  border-radius: 10px;\r\n  padding: 12px 14px;\r\n  font-size: 14px;\r\n  font-weight: 600;\r\n  color: #0f1e36;\r\n  font-family: 'Poppins', sans-serif;\r\n  min-height: 52px;\r\n  text-align: left;\r\n  margin: 12px 0;\r\n  width: 100%;\r\n  resize: vertical;\r\n  display: none;\r\n  box-sizing: border-box;\r\n}\r\n.ipg-transcript:focus { outline: none; border-color: #0284c7; background: #ffffff !important; color: #0f1e36 !important; }\r\n.ipg-panel.invoice .ipg-transcript { border-color: #22c55e; }\r\n\r\n.ipg-mic-btn { border: none; border-radius: 50%; width: 84px; height: 84px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.3s ease; margin: 14px auto; background: #38bdf8; box-shadow: 0 4px 20px rgba(56,189,248,0.4); }\r\n.ipg-mic-btn.invoice { background: #22c55e; box-shadow: 0 4px 20px rgba(34,197,94,0.4); }\r\n.ipg-mic-btn:hover { transform: scale(1.05); }\r\n.ipg-mic-btn.listening { background: #e11d48 !important; animation: ipg-pulse 1.2s infinite; box-shadow: 0 4px 24px rgba(225,29,72,0.5) !important; }\r\n.ipg-mic-btn.disabled { background: #475569 !important; cursor: not-allowed; box-shadow: none !important; transform: none !important; }\r\n.ipg-mic-btn svg { width: 38px; height: 38px; fill: #fff; }\r\n@keyframes ipg-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }\r\n\r\n.ipg-status { color: #cbd5e1; font-size: 13px; font-weight: 600; min-height: 22px; margin-top: 8px; }\r\n.ipg-status.active { color: #f87171; }\r\n.ipg-status.done { color: #4ade80; }\r\n\r\n.ipg-nav { display: none; gap: 10px; justify-content: center; margin-top: 10px; }\r\n.ipg-confirm-btn { padding: 11px 28px; background: #22c55e; color: #fff; border: none; border-radius: 50px; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 700; cursor: pointer; }\r\n.ipg-confirm-btn:hover { background: #16a34a; }\r\n.ipg-redo-btn { padding: 11px 20px; background: transparent; color: #38bdf8; border: 2px solid #38bdf8; border-radius: 50px; font-family: 'Poppins', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; }\r\n.ipg-panel.invoice .ipg-redo-btn { color: #22c55e; border-color: #22c55e; }\r\n\r\n\/* Form fields *\/\r\n.ipg-fields { background: #f0f4ff; border: 1px solid #d0e0ff; border-radius: 16px; padding: 24px; display: none; margin-bottom: 20px; }\r\n.ipg-field { margin-bottom: 16px; }\r\n.ipg-field label { display: block; font-size: 13px; font-weight: 600; color: #0a0a2e; margin-bottom: 4px; }\r\n.ipg-field input, .ipg-field textarea { width: 100%; padding: 10px 14px; border: 1px solid #c0d0f0; border-radius: 8px; font-size: 14px; font-family: 'Poppins', sans-serif; color: #111; background: white; box-sizing: border-box; resize: vertical; }\r\n.ipg-field textarea { height: 80px; }\r\n.ipg-field input.filled, .ipg-field textarea.filled { border-color: #38bdf8; background: #f0f9ff; }\r\n\r\n.ipg-submit-btn { display: none; width: 100%; padding: 15px; color: white; border: none; border-radius: 50px; font-size: 16px; font-weight: 700; font-family: 'Poppins', sans-serif; cursor: pointer; margin-top: 8px; }\r\n.ipg-submit-btn.proposal { background: linear-gradient(90deg, #0284c7, #38bdf8); }\r\n.ipg-submit-btn.invoice { background: linear-gradient(90deg, #16a34a, #22c55e); }\r\n.ipg-msg { text-align: center; margin-top: 14px; font-size: 14px; font-weight: 600; min-height: 20px; }\r\n<\/style>\r\n\r\n<!-- AUDIO FILES -->\r\n<audio id=\"ipg_proposal_welcome\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/Generate-a-Proposal-button-1.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_invoice_welcome\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/Generate-an-Invoice-button-1.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_q1\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/Q1-1.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_q2\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/Q2-2.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_proposal_q3\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/PROPOSAL-Q3.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_proposal_q4\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/PROPOSAL-Q4-2.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_invoice_q3\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/INVOICE-Q3.mp3\" preload=\"auto\"><\/audio>\r\n<audio id=\"ipg_invoice_q4\" src=\"https:\/\/myaiagenthub.com\/wp-content\/uploads\/2026\/06\/INVOICE-Q4.mp3\" preload=\"auto\"><\/audio>\r\n\r\n<div class=\"ipg-wrap\">\r\n  <h2>\ud83d\udcc4 Invoice & Proposal Generator<\/h2>\r\n  <p class=\"ipg-sub\">Choose what you need \u2014 then answer 4 quick questions. Your document will be in your inbox within minutes.<\/p>\r\n\r\n  <!-- Welcome box -->\r\n  <div class=\"ipg-welcome-box\" id=\"ipg_welcome_box\">\r\n    <div class=\"w-icon\">\ud83d\udc4b<\/div>\r\n    <div>\r\n      <div class=\"w-name\" id=\"ipg_welcome_name\">Invoice & Proposal Generator<\/div>\r\n      <div class=\"w-msg\" id=\"ipg_welcome_msg\">Choose Proposal or Invoice below to get started.<\/div>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <!-- Document type buttons -->\r\n  <div class=\"ipg-type-select\">\r\n    <button class=\"ipg-type-btn btn-proposal\" onclick=\"selectDocType('proposal')\">\ud83d\uddc2\ufe0f Generate a Proposal<\/button>\r\n    <button class=\"ipg-type-btn btn-invoice\" onclick=\"selectDocType('invoice')\">\ud83d\udcb0 Generate an Invoice<\/button>\r\n  <\/div>\r\n\r\n  <!-- Progress dots -->\r\n  <div class=\"ipg-progress\" id=\"ipg_progress\">\r\n    <div class=\"ipg-dot\" id=\"ipg_dot_1\"><\/div>\r\n    <div class=\"ipg-dot\" id=\"ipg_dot_2\"><\/div>\r\n    <div class=\"ipg-dot\" id=\"ipg_dot_3\"><\/div>\r\n    <div class=\"ipg-dot\" id=\"ipg_dot_4\"><\/div>\r\n  <\/div>\r\n\r\n  <!-- Interview panel -->\r\n  <div class=\"ipg-panel\" id=\"ipg_panel\">\r\n    <p class=\"ipg-q-label\" id=\"ipg_q_label\">\ud83c\udf99\ufe0f Getting ready...<\/p>\r\n    <textarea class=\"ipg-transcript\" id=\"ipg_transcript_input\" rows=\"3\"><\/textarea>\r\n    <button class=\"ipg-mic-btn disabled\" id=\"ipg_mic_btn\" onclick=\"toggleIPGMic()\">\r\n      <svg viewBox=\"0 0 24 24\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\r\n        <path d=\"M12 1a4 4 0 0 1 4 4v6a4 4 0 0 1-8 0V5a4 4 0 0 1 4-4zm-1 17.93V21H9v2h6v-2h-2v-2.07A8 8 0 0 0 20 11h-2a6 6 0 0 1-12 0H4a8 8 0 0 0 7 7.93z\"\/>\r\n      <\/svg>\r\n    <\/button>\r\n    <div class=\"ipg-status\" id=\"ipg_status\">Please wait...<\/div>\r\n    <div class=\"ipg-nav\" id=\"ipg_nav\">\r\n      <button class=\"ipg-confirm-btn\" onclick=\"confirmIPGAnswer()\">\u2705 Confirm<\/button>\r\n      <button class=\"ipg-redo-btn\" onclick=\"redoIPGAnswer()\">\ud83d\udd04 Redo<\/button>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <!-- Form fields -->\r\n  <div class=\"ipg-fields\" id=\"ipg_fields\">\r\n    <div class=\"ipg-field\"><label>Full Name<\/label><input type=\"text\" id=\"ipg_full_name\" placeholder=\"Your full name\" \/><\/div>\r\n    <div class=\"ipg-field\"><label>Email Address<\/label><input type=\"email\" id=\"ipg_email\" placeholder=\"your@email.com\" oninput=\"this.value=this.value.replace(\/\\s\/g,'').toLowerCase()\" \/><\/div>\r\n    <div class=\"ipg-field\"><label id=\"ipg_q3_label\">Business & Client Details<\/label><textarea id=\"ipg_q3_val\" placeholder=\"Business name, client name, and job details\"><\/textarea><\/div>\r\n    <div class=\"ipg-field\"><label id=\"ipg_q4_label\">Pricing & Timeline<\/label><textarea id=\"ipg_q4_val\" placeholder=\"Services, price, and timeline\"><\/textarea><\/div>\r\n  <\/div>\r\n\r\n  <button class=\"ipg-submit-btn\" id=\"ipg_submit_btn\" onclick=\"submitIPG()\">\ud83d\ude80 Generate My Document<\/button>\r\n  <p class=\"ipg-msg\" id=\"ipg_msg\"><\/p>\r\n<\/div>\r\n\r\n<script>\r\nvar PROPOSAL_AGENT_ID = '88eeb647-1211-46c4-b12f-e238bc003e72';\r\nvar PROPOSAL_AGENT_API_KEY = 'sk-YjJhODQ2NjgtMzkwZi00ZjAxLWFkMTEtN2Q4Mjg1ZTZkYmUz';\r\nvar INVOICE_AGENT_ID = '5b949e5a-6361-4337-9299-eb3eb3b2ca09';\r\nvar INVOICE_AGENT_API_KEY = 'sk-ODNlMDg2YTktNjYyYi00OWI1LTg4ZTctZTlhZjEzZjlmNWI5';\r\n\r\nvar ipgDocType = '';\r\nvar ipgStep = 0;\r\nvar ipgListening = false;\r\nvar ipgRecognition;\r\nvar ipgCurrentFinalText = '';\r\nvar ipgListenTimer = null;\r\n\r\nvar proposalQuestions = [\r\n  { label: 'Question 1 of 4', audio: 'ipg_q1', placeholder: 'Your full name will appear here...', typeOnly: false, listenSec: 8 },\r\n  { label: 'Question 2 of 4', audio: 'ipg_q2', placeholder: 'Type your email address here...', typeOnly: true, listenSec: 0 },\r\n  { label: 'Question 3 of 4', audio: 'ipg_proposal_q3', placeholder: 'Tell us about your business and client...', typeOnly: false, listenSec: 60 },\r\n  { label: 'Question 4 of 4', audio: 'ipg_proposal_q4', placeholder: 'Services, price, and timeline...', typeOnly: false, listenSec: 60 }\r\n];\r\n\r\nvar invoiceQuestions = [\r\n  { label: 'Question 1 of 4', audio: 'ipg_q1', placeholder: 'Your full name will appear here...', typeOnly: false, listenSec: 8 },\r\n  { label: 'Question 2 of 4', audio: 'ipg_q2', placeholder: 'Type your email address here...', typeOnly: true, listenSec: 0 },\r\n  { label: 'Question 3 of 4', audio: 'ipg_invoice_q3', placeholder: 'Tell us about your business, client, and services...', typeOnly: false, listenSec: 60 },\r\n  { label: 'Question 4 of 4', audio: 'ipg_invoice_q4', placeholder: 'Total amount owed and payment due date...', typeOnly: false, listenSec: 60 }\r\n];\r\n\r\nvar proposalWelcomeText = \"Welcome to the Proposal Generator. I'm going to ask you four quick questions and I'll build you a complete professional proposal delivered straight to your inbox. Let's get started.\";\r\nvar invoiceWelcomeText = \"Welcome to the Invoice Generator. I'm going to ask you four quick questions and I'll build you a complete professional invoice delivered straight to your inbox. Let's get started.\";\r\n\r\nfunction selectDocType(type) {\r\n  ipgDocType = type;\r\n  ipgStep = 0;\r\n  ipgCurrentFinalText = '';\r\n\r\n  \/\/ Update button selection\r\n  document.querySelectorAll('.ipg-type-btn').forEach(function(b) { b.classList.remove('selected'); });\r\n  document.querySelector('.btn-' + type).classList.add('selected');\r\n\r\n  \/\/ Update welcome box style\r\n  var welcomeBox = document.getElementById('ipg_welcome_box');\r\n  var welcomeName = document.getElementById('ipg_welcome_name');\r\n  var welcomeMsg = document.getElementById('ipg_welcome_msg');\r\n  welcomeBox.className = type === 'invoice' ? 'ipg-welcome-box invoice' : 'ipg-welcome-box';\r\n  welcomeName.textContent = type === 'proposal' ? 'Proposal Generator' : 'Invoice Generator';\r\n  welcomeMsg.textContent = '';\r\n\r\n  \/\/ Update panel style\r\n  var panel = document.getElementById('ipg_panel');\r\n  panel.className = type === 'invoice' ? 'ipg-panel invoice' : 'ipg-panel';\r\n\r\n  \/\/ Update mic btn style\r\n  var micBtn = document.getElementById('ipg_mic_btn');\r\n  micBtn.className = type === 'invoice' ? 'ipg-mic-btn invoice disabled' : 'ipg-mic-btn disabled';\r\n\r\n  \/\/ Show progress dots and panel\r\n  document.getElementById('ipg_progress').style.display = 'flex';\r\n  panel.style.display = 'block';\r\n  document.getElementById('ipg_fields').style.display = 'none';\r\n  document.getElementById('ipg_submit_btn').style.display = 'none';\r\n  document.getElementById('ipg_msg').textContent = '';\r\n\r\n  \/\/ Update submit btn style\r\n  document.getElementById('ipg_submit_btn').className = 'ipg-submit-btn ' + type;\r\n\r\n  \/\/ Update field labels\r\n  if (type === 'proposal') {\r\n    document.getElementById('ipg_q3_label').textContent = 'Business & Client Details';\r\n    document.getElementById('ipg_q4_label').textContent = 'Services, Price & Timeline';\r\n  } else {\r\n    document.getElementById('ipg_q3_label').textContent = 'Business, Client & Services';\r\n    document.getElementById('ipg_q4_label').textContent = 'Amount Owed & Payment Due';\r\n  }\r\n\r\n  \/\/ Play welcome audio with word typing\r\n  var welcomeAudio = document.getElementById(type === 'proposal' ? 'ipg_proposal_welcome' : 'ipg_invoice_welcome');\r\n  var welcomeTextStr = type === 'proposal' ? proposalWelcomeText : invoiceWelcomeText;\r\n  var words = welcomeTextStr.split(' ');\r\n  var wi = 0;\r\n  welcomeAudio.currentTime = 0;\r\n  welcomeAudio.play().catch(function() {});\r\n  var wInt = setInterval(function() {\r\n    if (wi < words.length) { welcomeMsg.textContent += (wi === 0 ? '' : ' ') + words[wi++]; }\r\n    else clearInterval(wInt);\r\n  }, 1000 \/ 2.8);\r\n  welcomeAudio.onended = function() {\r\n    clearInterval(wInt);\r\n    welcomeMsg.textContent = welcomeTextStr;\r\n    setTimeout(function() { startIPGQuestion(0); }, 1000);\r\n  };\r\n  welcomeAudio.onerror = function() {\r\n    welcomeMsg.textContent = welcomeTextStr;\r\n    setTimeout(function() { startIPGQuestion(0); }, 500);\r\n  };\r\n}\r\n\r\nfunction getQuestions() {\r\n  return ipgDocType === 'proposal' ? proposalQuestions : invoiceQuestions;\r\n}\r\n\r\nfunction startIPGQuestion(index) {\r\n  ipgStep = index;\r\n  var q = getQuestions()[index];\r\n\r\n  \/\/ Update dots\r\n  for (var i = 0; i < 4; i++) {\r\n    var dot = document.getElementById('ipg_dot_' + (i + 1));\r\n    if (i < index) dot.className = 'ipg-dot done';\r\n    else if (i === index) dot.className = 'ipg-dot active' + (ipgDocType === 'invoice' ? ' invoice' : '');\r\n    else dot.className = 'ipg-dot';\r\n  }\r\n\r\n  document.getElementById('ipg_q_label').textContent = '\ud83c\udf99\ufe0f ' + q.label;\r\n  document.getElementById('ipg_transcript_input').style.display = 'none';\r\n  document.getElementById('ipg_transcript_input').value = '';\r\n  document.getElementById('ipg_transcript_input').placeholder = q.placeholder;\r\n  document.getElementById('ipg_nav').style.display = 'none';\r\n  document.getElementById('ipg_mic_btn').className = (ipgDocType === 'invoice' ? 'ipg-mic-btn invoice' : 'ipg-mic-btn') + ' disabled';\r\n  setIPGStatus('Speaking \u2014 please wait...', '');\r\n  ipgCurrentFinalText = '';\r\n\r\n  var audio = document.getElementById(q.audio);\r\n  audio.currentTime = 0;\r\n  audio.play().catch(function() {});\r\n  audio.onended = function() {\r\n    if (q.typeOnly) {\r\n      document.getElementById('ipg_mic_btn').className = (ipgDocType === 'invoice' ? 'ipg-mic-btn invoice' : 'ipg-mic-btn') + ' disabled';\r\n      setIPGStatus('\ud83d\udce7 Please type your email address in the box below.', '');\r\n      document.getElementById('ipg_transcript_input').style.display = 'block';\r\n      document.getElementById('ipg_transcript_input').focus();\r\n      document.getElementById('ipg_nav').style.display = 'flex';\r\n    } else {\r\n      document.getElementById('ipg_mic_btn').className = ipgDocType === 'invoice' ? 'ipg-mic-btn invoice' : 'ipg-mic-btn';\r\n      setIPGStatus('Tap the mic and answer when ready', '');\r\n    }\r\n  };\r\n}\r\n\r\nfunction toggleIPGMic() {\r\n  if (document.getElementById('ipg_mic_btn').classList.contains('disabled')) return;\r\n  if (ipgListening) { stopIPGMic(); } else { startIPGMic(); }\r\n}\r\n\r\nfunction startIPGMic() {\r\n  var SR = window.SpeechRecognition || window.webkitSpeechRecognition;\r\n  if (!SR) { setIPGStatus('Please use Chrome for voice input.', ''); return; }\r\n  ipgRecognition = new SR();\r\n  ipgRecognition.continuous = true;\r\n  ipgRecognition.interimResults = true;\r\n  ipgRecognition.lang = 'en-US';\r\n  ipgListening = true;\r\n  ipgCurrentFinalText = '';\r\n  document.getElementById('ipg_mic_btn').classList.add('listening');\r\n  setIPGStatus('\ud83d\udd34 Listening... tap again when done', 'active');\r\n  document.getElementById('ipg_transcript_input').style.display = 'block';\r\n\r\n  ipgRecognition.onresult = function(e) {\r\n    var interim = '';\r\n    for (var i = e.resultIndex; i < e.results.length; i++) {\r\n      if (e.results[i].isFinal) ipgCurrentFinalText += e.results[i][0].transcript + ' ';\r\n      else interim += e.results[i][0].transcript;\r\n    }\r\n    document.getElementById('ipg_transcript_input').value = (ipgCurrentFinalText + interim).trim();\r\n  };\r\n  ipgRecognition.onend = function() { if (ipgListening) { try { ipgRecognition.start(); } catch(e){} } };\r\n  ipgRecognition.onerror = function() { stopIPGMic(); };\r\n  ipgRecognition.start();\r\n\r\n  clearTimeout(ipgListenTimer);\r\n  ipgListenTimer = setTimeout(function() { stopIPGMic(); }, getQuestions()[ipgStep].listenSec * 1000);\r\n}\r\n\r\nfunction stopIPGMic() {\r\n  ipgListening = false;\r\n  clearTimeout(ipgListenTimer);\r\n  if (ipgRecognition) { ipgRecognition.onend = null; try { ipgRecognition.stop(); } catch(e){} }\r\n  document.getElementById('ipg_mic_btn').classList.remove('listening');\r\n  var val = document.getElementById('ipg_transcript_input').value.trim();\r\n  if (val) {\r\n    setIPGStatus('Review your answer above \u2014 edit if needed.', 'done');\r\n    document.getElementById('ipg_nav').style.display = 'flex';\r\n  } else {\r\n    setIPGStatus('Tap the mic and answer the question.', '');\r\n  }\r\n}\r\n\r\nfunction confirmIPGAnswer() {\r\n  var val = document.getElementById('ipg_transcript_input').value.trim();\r\n  if (!val) { setIPGStatus('Please answer the question first.', ''); return; }\r\n\r\n  var fieldIds = ['ipg_full_name', 'ipg_email', 'ipg_q3_val', 'ipg_q4_val'];\r\n  var field = document.getElementById(fieldIds[ipgStep]);\r\n  if (field) {\r\n    field.value = (ipgStep === 1) ? val.replace(\/\\s\/g, '').toLowerCase() : val;\r\n    field.classList.add('filled');\r\n  }\r\n\r\n  document.getElementById('ipg_dot_' + (ipgStep + 1)).className = 'ipg-dot done';\r\n  document.getElementById('ipg_nav').style.display = 'none';\r\n  document.getElementById('ipg_transcript_input').style.display = 'none';\r\n  setIPGStatus('\u2705 Got it!', 'done');\r\n\r\n  setTimeout(function() {\r\n    if (ipgStep < 3) {\r\n      startIPGQuestion(ipgStep + 1);\r\n    } else {\r\n      for (var i = 0; i < 4; i++) { document.getElementById('ipg_dot_' + (i + 1)).className = 'ipg-dot done'; }\r\n      document.getElementById('ipg_q_label').textContent = '\u2705 All done!';\r\n      document.getElementById('ipg_transcript_input').value = 'Thank you! Review your answers below and click the button to generate your document.';\r\n      document.getElementById('ipg_transcript_input').style.display = 'block';\r\n      document.getElementById('ipg_mic_btn').className = 'ipg-mic-btn disabled';\r\n      document.getElementById('ipg_fields').style.display = 'block';\r\n      document.getElementById('ipg_submit_btn').style.display = 'block';\r\n    }\r\n  }, 800);\r\n}\r\n\r\nfunction redoIPGAnswer() {\r\n  document.getElementById('ipg_transcript_input').value = '';\r\n  document.getElementById('ipg_nav').style.display = 'none';\r\n  ipgCurrentFinalText = '';\r\n  setIPGStatus('Tap the mic and answer again.', '');\r\n  if (!getQuestions()[ipgStep].typeOnly) startIPGMic();\r\n}\r\n\r\nfunction setIPGStatus(text, type) {\r\n  var s = document.getElementById('ipg_status');\r\n  s.textContent = text;\r\n  s.className = 'ipg-status' + (type ? ' ' + type : '');\r\n}\r\n\r\nasync function submitIPG() {\r\n  var full_name = document.getElementById('ipg_full_name').value.trim();\r\n  var email = document.getElementById('ipg_email').value.trim();\r\n  var q3 = document.getElementById('ipg_q3_val').value.trim();\r\n  var q4 = document.getElementById('ipg_q4_val').value.trim();\r\n  var msg = document.getElementById('ipg_msg');\r\n\r\n  if (!full_name || !email) {\r\n    msg.style.color = '#e11d48';\r\n    msg.textContent = '\u26a0\ufe0f Please make sure your name and email are filled in.';\r\n    return;\r\n  }\r\n\r\n  var btn = document.getElementById('ipg_submit_btn');\r\n  btn.textContent = '\u23f3 Generating Your Document...';\r\n  btn.disabled = true;\r\n  msg.style.color = '#1a73e8';\r\n  msg.textContent = '\u23f3 Submitting your information now...';\r\n\r\n  var agentId = ipgDocType === 'proposal' ? PROPOSAL_AGENT_ID : INVOICE_AGENT_ID;\r\n  var agentKey = ipgDocType === 'proposal' ? PROPOSAL_AGENT_API_KEY : INVOICE_AGENT_API_KEY;\r\n  var docLabel = ipgDocType === 'proposal' ? 'PROPOSAL REQUEST' : 'INVOICE REQUEST';\r\n  var q3Label = ipgDocType === 'proposal' ? 'Business and Client Details' : 'Business, Client and Services';\r\n  var q4Label = ipgDocType === 'proposal' ? 'Services, Price and Timeline' : 'Amount Owed and Payment Due';\r\n\r\n  var content = docLabel + '\\n\\n'\r\n    + 'Full Name: ' + full_name + '\\n'\r\n    + 'Email: ' + email + '\\n'\r\n    + q3Label + ': ' + q3 + '\\n'\r\n    + q4Label + ': ' + q4;\r\n\r\n  try {\r\n    await fetch('https:\/\/api-bcbe5a.stack.tryrelevance.com\/latest\/agents\/trigger', {\r\n      method: 'POST',\r\n      headers: {\r\n        'Content-Type': 'application\/json',\r\n        'Authorization': 'b831f1f2-22e3-4067-b1f5-c431251db0cc:' + agentKey\r\n      },\r\n      body: JSON.stringify({\r\n        message: { role: 'user', content: content },\r\n        agent_id: agentId\r\n      })\r\n    });\r\n    msg.style.color = '#16a34a';\r\n    msg.textContent = '\u2705 Your ' + (ipgDocType === 'proposal' ? 'proposal' : 'invoice') + ' is being generated! Check your inbox in a few minutes.';\r\n    btn.textContent = '\u2705 Submitted!';\r\n  } catch(e) {\r\n    msg.style.color = '#e11d48';\r\n    msg.textContent = '\u274c Something went wrong. Please try again.';\r\n    btn.textContent = '\ud83d\ude80 Generate My Document';\r\n    btn.disabled = false;\r\n  }\r\n}\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\ud83d\udcc4 Invoice &#038; Proposal Generator Choose what you need \u2014 then answer 4 quick questions. Your document will be in your inbox within minutes. \ud83d\udc4b Invoice &#038; Proposal Generator Choose Proposal or Invoice below to get started. \ud83d\uddc2\ufe0f Generate a Proposal \ud83d\udcb0 Generate an Invoice \ud83c\udf99\ufe0f Getting ready&#8230; Please wait&#8230; \u2705 Confirm \ud83d\udd04 Redo Full Name Email Address Business &#038; Client Details Pricing &#038; Timeline \ud83d\ude80 Generate My Document<\/p>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-4563","page","type-page","status-publish","hentry"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/pages\/4563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/comments?post=4563"}],"version-history":[{"count":25,"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/pages\/4563\/revisions"}],"predecessor-version":[{"id":4933,"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/pages\/4563\/revisions\/4933"}],"wp:attachment":[{"href":"https:\/\/myaiagenthub.com\/es\/wp-json\/wp\/v2\/media?parent=4563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}