Spaces:
Running
Running
| ;(self.webpackChunk_carbon_ai_chat_examples_web_components_basic=self.webpackChunk_carbon_ai_chat_examples_web_components_basic||[]).push([[3424],{17933:function(e,t,n){n.d(t,{Y:function(){return y}});var a=n(7378),l=n(83281),o=n(61994),r=n(67733),s=n.n(r),i=n(48034),c=n.n(i),m=n(62562),d=n.n(m),u=n(39805),p=n.n(u),b=n(57577),g=n.n(b),f=n(79062),h=n.n(f),E=n(84870),v={};v.styleTagTransform=h(),v.setAttributes=p(),v.insert=d().bind(null,"head"),v.domAPI=c(),v.insertStyleElement=g();s()(E.A,v),E.A&&E.A.locals&&E.A.locals;const x="Not initialized";function y({threadId:e}){const[t,n]=(0,a.useState)(!1),[r,s]=(0,a.useState)(null),[i,c]=(0,a.useState)(!1),[m,d]=(0,a.useState)(null),[u,p]=(0,a.useState)(!1),[b,g]=(0,a.useState)(!1),f=(0,a.useCallback)(async()=>{if(!e||e===x)return d("No thread ID available"),void s(null);c(!0),d(null);try{const t=await fetch(`${o.JR}/api/agent/state`,{method:"GET",headers:{"X-Thread-ID":e}});if(503===t.status)return void s({thread_id:e,state:null,variables:{},variables_count:0,message:"Agent graph not initialized"});if(!t.ok)throw new Error(`Failed to fetch state: ${t.status} ${t.statusText}`);const n=await t.json();s(n)}catch(e){d(e instanceof Error?e.message:"Failed to fetch agent state")}finally{c(!1)}},[e]);(0,a.useEffect)(()=>{t&&e&&f()},[t,e,f]),(0,a.useEffect)(()=>{if(!u||!t||!e)return;const n=setInterval(()=>{f()},2e3);return()=>clearInterval(n)},[u,t,e,f]);return a.createElement("div",{className:"debug-panel-container"},a.createElement("button",{className:"debug-panel-toggle",onClick:()=>n(!t),title:"Toggle Debug Panel"},a.createElement(l.zPv,{size:16}),a.createElement("span",null,"Debug"),t?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),t&&a.createElement("div",{className:"debug-panel-content"},a.createElement("div",{className:"debug-panel-header"},a.createElement("h3",null,"Debug Information"),a.createElement("div",{className:"debug-panel-actions"},a.createElement("button",{className:"debug-action-btn",onClick:f,disabled:i,title:"Refresh State"},a.createElement(l.e9t,{size:14,className:i?"spinning":""})),a.createElement("label",{className:"debug-auto-refresh"},a.createElement("input",{type:"checkbox",checked:u,onChange:e=>p(e.target.checked)}),a.createElement("span",null,"Auto-refresh")))),a.createElement("div",{className:"debug-section"},a.createElement("div",{className:"debug-section-header"},a.createElement("strong",null,"Thread ID"),e&&e!==x&&a.createElement("button",{className:"debug-copy-btn",onClick:()=>{return t=e,navigator.clipboard.writeText(t),g(!0),void setTimeout(()=>g(!1),2e3);var t},title:"Copy Thread ID"},b?a.createElement(l.Jlk,{size:12}):a.createElement(l.QRo,{size:12}))),a.createElement("div",{className:"debug-thread-id"},e||x)),a.createElement("div",{className:"debug-section"},a.createElement("div",{className:"debug-section-header"},a.createElement("strong",null,"Agent State")),i&&a.createElement("div",{className:"debug-loading"},"Loading..."),m&&a.createElement("div",{className:"debug-error"},"Error: ",m),r&&a.createElement("div",{className:"debug-state-content"},a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"Thread ID:"),a.createElement("span",{className:"debug-value"},r.thread_id)),a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"Variables Count:"),a.createElement("span",{className:"debug-value"},r.variables_count)),r.state?a.createElement(a.Fragment,null,a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"Lite Mode:"),a.createElement("span",{className:"debug-value",style:{color:null===r.state.lite_mode?"#94a3b8":r.state.lite_mode?"#10b981":"#f59e0b",fontWeight:600}},null===r.state.lite_mode?"Not Set (using settings)":r.state.lite_mode?"True (Fast/Lite)":"False (Balanced)")),a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"Current App:"),a.createElement("span",{className:"debug-value"},r.state.current_app||"N/A")),a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"Chat Messages Count:"),a.createElement("span",{className:"debug-value"},r.state.chat_messages_count||0)),a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"URL:"),a.createElement("span",{className:"debug-value"},r.state.url||"N/A")),r.state.input&&a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"Input:"),a.createElement("span",{className:"debug-value"},r.state.input))):a.createElement("div",{className:"debug-state-item"},a.createElement("span",{className:"debug-label"},"State:"),a.createElement("span",{className:"debug-value"},r.message||"No state available")),Object.keys(r.variables).length>0&&a.createElement("div",{className:"debug-state-item debug-variables"},a.createElement("span",{className:"debug-label"},"Variables:"),a.createElement("pre",{className:"debug-json"},(e=>{try{return JSON.stringify(e,null,2)}catch{return String(e)}})(r.variables)))))))}},26944:function(e,t,n){var a=n(21598),l=n.n(a),o=n(2607),r=n.n(o)()(l());r.push([e.id,".followup-suggestions-container {\n margin: 16px 0;\n padding: 0;\n animation: fadeInUp 0.3s ease-out;\n}\n\n@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.followup-suggestions-header {\n margin-bottom: 12px;\n}\n\n.followup-suggestions-title {\n font-size: 13px;\n font-weight: 500;\n color: #64748b;\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.followup-suggestions-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.followup-suggestion-chip {\n padding: 12px 16px;\n background: #ffffff;\n border: 1.5px solid #e2e8f0;\n border-radius: 8px;\n font-size: 13px;\n color: #334155;\n text-align: left;\n cursor: pointer;\n transition: all 0.2s ease;\n font-weight: 400;\n line-height: 1.5;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n.followup-suggestion-chip:hover {\n background: #f8fafc;\n border-color: #cbd5e1;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);\n transform: translateY(-1px);\n}\n\n.followup-suggestion-chip:active {\n transform: translateY(0);\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);\n}\n\n",""]),t.A=r},27082:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(7378),l=n(83281);n(33802);function o({onClose:e}){const[t,n]=(0,a.useState)({enableMemory:!0,disableMemory:!1,memoryType:"both",contextWindow:4096,maxMemoryItems:100,semanticSearch:!0,autoSummarization:!0,factStorage:!1,learningFromFailures:!1,blockedMemoryItems:[],saveAndReuse:{enabled:!1,autoGeneralize:!1,minSuccessfulRuns:3,requireApproval:!0,savedTrajectories:[]}}),[o,r]=(0,a.useState)("idle"),[s,i]=(0,a.useState)(""),[c,m]=(0,a.useState)(null);(0,a.useEffect)(()=>{d()},[]);const d=async()=>{try{const e=await fetch("/api/config/memory");if(e.ok){const t=await e.json();n({enableMemory:t.enableMemory??!0,disableMemory:t.disableMemory??!1,memoryType:t.memoryType??"both",contextWindow:t.contextWindow??4096,maxMemoryItems:t.maxMemoryItems??100,semanticSearch:t.semanticSearch??!0,autoSummarization:t.autoSummarization??!0,factStorage:t.factStorage??!1,learningFromFailures:t.learningFromFailures??!1,blockedMemoryItems:t.blockedMemoryItems??[],saveAndReuse:t.saveAndReuse??{enabled:!1,autoGeneralize:!1,minSuccessfulRuns:3,requireApproval:!0,savedTrajectories:[]}})}}catch(e){}},u=()=>{s.trim()&&!t.blockedMemoryItems.includes(s.trim())&&(n({...t,blockedMemoryItems:[...t.blockedMemoryItems,s.trim()]}),i(""))};return a.createElement("div",{className:"config-modal-overlay",onClick:e},a.createElement("div",{className:"config-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"config-modal-header"},a.createElement("h2",null,"Memory Configuration"),a.createElement("button",{className:"config-modal-close",onClick:e},a.createElement(l.X,{size:20}))),a.createElement("div",{className:"config-modal-content"},a.createElement("div",{className:"config-card"},a.createElement("h3",null,"Memory Settings"),a.createElement("div",{className:"config-form"},a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.disableMemory,onChange:e=>{const a=e.target.checked;n({...t,disableMemory:a,enableMemory:!a&&t.enableMemory})}}),a.createElement("span",null,"Disable Memory Completely")),a.createElement("small",null,"Turn off all memory functionality")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.enableMemory,onChange:e=>n({...t,enableMemory:e.target.checked}),disabled:t.disableMemory}),a.createElement("span",null,"Enable Memory System")),a.createElement("small",null,"Allow the agent to remember context across conversations")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Max Memory Items"),a.createElement("input",{type:"number",value:t.maxMemoryItems,onChange:e=>n({...t,maxMemoryItems:parseInt(e.target.value)}),min:"10",max:"1000",disabled:!t.enableMemory||t.disableMemory}),a.createElement("small",null,"Maximum number of memory items to store")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.semanticSearch,onChange:e=>n({...t,semanticSearch:e.target.checked}),disabled:!t.enableMemory||t.disableMemory}),a.createElement("span",null,"Enable Semantic Search")),a.createElement("small",null,"Use embeddings to find relevant memories")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.autoSummarization,onChange:e=>n({...t,autoSummarization:e.target.checked}),disabled:!t.enableMemory||t.disableMemory}),a.createElement("span",null,"Auto-summarization")),a.createElement("small",null,"Automatically summarize long conversations")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.factStorage,onChange:e=>n({...t,factStorage:e.target.checked}),disabled:!t.enableMemory||t.disableMemory}),a.createElement("span",null,"Enable Fact Storage and Retrieval")),a.createElement("small",null,"Store and retrieve important facts like IDs, key values, and persistent information")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.learningFromFailures,onChange:e=>n({...t,learningFromFailures:e.target.checked}),disabled:!t.enableMemory||t.disableMemory}),a.createElement("span",null,"Enable Learning from Failures and Tip Injection")),a.createElement("small",null,"Learn from past failures and analyze trajectories to improve future task performance")),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Blocked Memory Items"),a.createElement("div",{style:{display:"flex",gap:"8px",alignItems:"center"}},a.createElement("input",{type:"text",value:s,onChange:e=>i(e.target.value),onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),u())},placeholder:"e.g., passwords, secrets",disabled:t.disableMemory,style:{width:"200px",padding:"4px 8px",fontSize:"12px"}}),a.createElement("button",{className:"add-small-btn",onClick:u,disabled:t.disableMemory||!s.trim()},a.createElement(l.FWt,{size:12}),"Add"))),0===t.blockedMemoryItems.length?a.createElement("div",{className:"policies-empty"},"No blocked items. Add items that the agent should never remember."):a.createElement("div",{className:"policies-list"},t.blockedMemoryItems.map((e,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("span",{style:{flex:1,padding:"8px",fontSize:"13px"}},e),a.createElement("button",{className:"remove-btn",onClick:()=>(e=>{n({...t,blockedMemoryItems:t.blockedMemoryItems.filter(t=>t!==e)})})(e),disabled:t.disableMemory},a.createElement(l.X,{size:14}))))),a.createElement("small",null,"Items the agent is not allowed to remember (e.g., sensitive information, passwords)")))),a.createElement("div",{className:"config-card"},a.createElement("h3",null,"Save & Reuse Trajectories"),a.createElement("div",{className:"config-form"},a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.saveAndReuse.enabled,onChange:e=>n({...t,saveAndReuse:{...t.saveAndReuse,enabled:e.target.checked}}),disabled:t.disableMemory}),a.createElement("span",null,"Enable Save & Reuse")),a.createElement("small",null,"Allow agent to save successful task trajectories as reusable tools")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.saveAndReuse.autoGeneralize,onChange:e=>n({...t,saveAndReuse:{...t.saveAndReuse,autoGeneralize:e.target.checked}}),disabled:!t.saveAndReuse.enabled||t.disableMemory}),a.createElement("span",null,"Auto-generalize Trajectories")),a.createElement("small",null,"Automatically identify patterns and create reusable tools from successful tasks")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Min. Successful Runs Before Saving"),a.createElement("input",{type:"number",value:t.saveAndReuse.minSuccessfulRuns,onChange:e=>n({...t,saveAndReuse:{...t.saveAndReuse,minSuccessfulRuns:parseInt(e.target.value)}}),min:"1",max:"10",disabled:!t.saveAndReuse.enabled||t.disableMemory}),a.createElement("small",null,"Number of successful executions before suggesting trajectory as reusable tool")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.saveAndReuse.requireApproval,onChange:e=>n({...t,saveAndReuse:{...t.saveAndReuse,requireApproval:e.target.checked}}),disabled:!t.saveAndReuse.enabled||t.disableMemory}),a.createElement("span",null,"Require User Approval")),a.createElement("small",null,"Ask for permission before saving new trajectories as tools")),a.createElement("div",{className:"form-group",style:{marginTop:"24px"}},a.createElement("label",{style:{fontSize:"14px",fontWeight:600,marginBottom:"12px",display:"block"}},"Saved Trajectories (",t.saveAndReuse.savedTrajectories.length,")"),0===t.saveAndReuse.savedTrajectories.length?a.createElement("div",{className:"policies-empty"},"No saved trajectories yet. When enabled, successful task patterns will appear here."):a.createElement("div",{className:"policies-list",style:{maxHeight:"400px",overflowY:"auto"}},t.saveAndReuse.savedTrajectories.map(e=>{const o=c===e.id;return a.createElement("div",{key:e.id,className:"policy-item",style:{flexDirection:"column",alignItems:"stretch"}},a.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px"}},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:()=>{return a=e.id,void n({...t,saveAndReuse:{...t.saveAndReuse,savedTrajectories:t.saveAndReuse.savedTrajectories.map(e=>e.id===a?{...e,enabled:!e.enabled}:e)}});var a},disabled:!t.saveAndReuse.enabled||t.disableMemory,style:{cursor:"pointer"}}),a.createElement("div",{style:{flex:1,cursor:"pointer"},onClick:()=>m(o?null:e.id)},a.createElement("div",{style:{fontWeight:600,fontSize:"13px",color:"#1e293b"}},e.name),a.createElement("div",{style:{fontSize:"11px",color:"#64748b",marginTop:"2px"}},e.description)),a.createElement("div",{style:{display:"flex",gap:"4px",alignItems:"center",fontSize:"11px",color:"#64748b"}},a.createElement("span",null,"Confidence: ",e.confidence,"%"),a.createElement("span",null,"•"),a.createElement("span",null,e.parameters.length," params")),a.createElement("button",{className:"remove-btn",onClick:()=>{return a=e.id,void n({...t,saveAndReuse:{...t.saveAndReuse,savedTrajectories:t.saveAndReuse.savedTrajectories.filter(e=>e.id!==a)}});var a},disabled:!t.saveAndReuse.enabled||t.disableMemory},a.createElement(l.TBR,{size:14}))),o&&a.createElement("div",{style:{padding:"12px",background:"#f8fafc",borderTop:"1px solid #e5e7eb",fontSize:"12px"}},a.createElement("div",{style:{marginBottom:"12px"}},a.createElement("strong",{style:{color:"#475569",display:"block",marginBottom:"6px"}},"Parameters:"),0===e.parameters.length?a.createElement("div",{style:{color:"#94a3b8",fontStyle:"italic"}},"No parameters"):a.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"6px"}},e.parameters.map((e,t)=>a.createElement("div",{key:t,style:{background:"white",padding:"6px 8px",borderRadius:"4px",border:"1px solid #e5e7eb"}},a.createElement("code",{style:{color:"#667eea",fontWeight:600,fontSize:"11px"}},e.name),a.createElement("span",{style:{color:"#64748b"}},": ",e.type),e.required&&a.createElement("span",{style:{color:"#ef4444",marginLeft:"4px"}},"*"),e.description&&a.createElement("div",{style:{color:"#64748b",fontSize:"11px",marginTop:"2px"}},e.description))))),a.createElement("div",{style:{display:"flex",gap:"16px",fontSize:"11px",color:"#64748b"}},a.createElement("span",null,"Min interactions: ",e.minInteractions),a.createElement("span",null,"•"),a.createElement("span",null,"Created: ",new Date(e.createdAt).toLocaleDateString()))))})),a.createElement("small",{style:{display:"block",marginTop:"8px"}},"Trajectories are automatically learned from successful task completions"))))),a.createElement("div",{className:"config-modal-footer"},a.createElement("button",{className:"cancel-btn",onClick:e},"Cancel"),a.createElement("button",{className:`save-btn ${o}`,onClick:async()=>{r("saving");try{(await fetch("/api/config/memory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(r("success"),setTimeout(()=>r("idle"),2e3)):(r("error"),setTimeout(()=>r("idle"),2e3))}catch(e){r("error"),setTimeout(()=>r("idle"),2e3)}},disabled:"saving"===o},a.createElement(l.eMP,{size:16}),"idle"===o&&"Save Changes","saving"===o&&"Saving...","success"===o&&"Saved!","error"===o&&"Error!"))))}},31681:function(e,t,n){n.d(t,{n:function(){return o}});var a=n(7378),l=n(83281);const o=({followupAction:e,callback:t})=>{const[n,o]=(0,a.useState)(""),[r,s]=(0,a.useState)([]),[i,c]=(0,a.useState)(!1),[m]=(0,a.useState)(Date.now()),[d,u]=(0,a.useState)(!0),{action_id:p,action_name:b,description:g,type:f,button_text:h,placeholder:E,options:v,max_selections:x,min_selections:y=1,required:N=!0,validation_pattern:w,max_length:k,min_length:C,color:P="primary"}=e;(0,a.useEffect)(()=>{const e=setTimeout(()=>{u(!1)},300);return()=>clearTimeout(e)},[]);const S={primary:{button:"bg-blue-500 hover:bg-blue-600 text-white",accent:"text-blue-600 border-blue-200 bg-blue-50"},success:{button:"bg-green-500 hover:bg-green-600 text-white",accent:"text-green-600 border-green-200 bg-green-50"},warning:{button:"bg-yellow-500 hover:bg-yellow-600 text-white",accent:"text-yellow-600 border-yellow-200 bg-yellow-50"},danger:{button:"bg-red-500 hover:bg-red-600 text-white",accent:"text-red-600 border-red-200 bg-red-50"},secondary:{button:"bg-gray-500 hover:bg-gray-600 text-white",accent:"text-gray-600 border-gray-200 bg-gray-50"}},A=S[P]||S.primary,T=e=>{if(i)return;c(!0);const n=(e=>({action_id:p,response_type:f,timestamp:(new Date).toISOString(),response_time_ms:Date.now()-m,client_info:{user_agent:navigator.userAgent,language:navigator.language,platform:navigator.platform},...e}))(e);t(n)},z=()=>{!n.trim()&&N||w&&!new RegExp(w).test(n)||C&&n.length<C||k&&n.length>k||T({text_response:n})},I=()=>{T({button_clicked:!0})},M=e=>{T({confirmed:e})},R=e=>{let t;if("multi_select"===f)if(r.includes(e))t=r.filter(t=>t!==e);else{if(x&&r.length>=x)return;t=[...r,e]}else t=[e];if(s(t),"select"===f){const e=(v||[]).filter(e=>t.includes(e.value));T({selected_values:t,selected_options:e})}},_=()=>{if(r.length<y)return;const e=(v||[]).filter(e=>r.includes(e.value));T({selected_values:r,selected_options:e})};return a.createElement("div",{className:"bg-white border border-gray-200 rounded p-4 mx-auto"},!d&&a.createElement("div",{className:"mb-4"},a.createElement("div",{className:"flex items-center gap-2 mb-2"},a.createElement("h3",{className:"font-medium text-gray-900 text-sm"},b),N&&a.createElement("span",{className:"text-red-500 text-xs"},"*")),g&&a.createElement("p",{className:"text-gray-600 text-xs"},g)),(()=>{if(d)return a.createElement("div",{className:"flex items-center justify-center py-4"},a.createElement("span",{className:"text-sm text-gray-500"},"Loading..."));if(i)return a.createElement("div",{className:"flex items-center justify-center py-4 text-green-600"},a.createElement("div",{className:"flex items-center space-x-2 bg-green-50 px-4 py-2 rounded border border-green-200"},a.createElement(l.Jlk,{className:"w-5 h-5"}),a.createElement("span",{className:"text-sm font-medium"},"Response submitted successfully!")));switch(f){case"button":return a.createElement("button",{onClick:I,disabled:i,className:`w-full px-4 py-3 rounded font-medium ${A.button} flex items-center justify-center gap-2 ${i?"opacity-50 cursor-not-allowed":""}`},a.createElement("span",null,h||b));case"text_input":case"natural_language":return a.createElement("div",{className:"space-y-3"},a.createElement("textarea",{value:n,onChange:e=>o(e.target.value),placeholder:E||"Enter your response...",disabled:i,className:`w-full px-4 py-3 border border-gray-200 rounded resize-none focus:outline-none focus:border-blue-500 text-sm ${n.trim()?A.accent:""} ${i?"opacity-50 cursor-not-allowed bg-gray-50":""}`,rows:"natural_language"===f?3:1,maxLength:k}),k&&a.createElement("div",{className:"text-xs text-gray-500 text-right"},a.createElement("span",{className:n.length>.8*k?"text-orange-500":""},n.length),"/",k),a.createElement("button",{onClick:z,disabled:i||!n.trim()&&N,className:`px-4 py-2 rounded text-sm font-medium ${i||!n.trim()&&N?"bg-gray-200 text-gray-400 cursor-not-allowed":A.button} flex items-center gap-2`},a.createElement(l.Vnp,{className:"w-4 h-4"}),"Submit"));case"select":return a.createElement("div",{className:"space-y-2"},(v||[]).map(e=>a.createElement("button",{key:e.value,onClick:()=>R(e.value),disabled:i,className:`w-full px-4 py-3 text-left rounded border text-sm ${r.includes(e.value)?A.button:"border-gray-200 hover:border-gray-300 hover:bg-gray-50"} ${i?"opacity-50 cursor-not-allowed":""}`},a.createElement("div",{className:"font-medium"},e.label),e.description&&a.createElement("div",{className:"text-xs opacity-75 mt-1"},e.description))));case"multi_select":return a.createElement("div",{className:"space-y-3"},a.createElement("div",{className:"space-y-2 max-h-48 overflow-y-auto"},(v||[]).map(e=>a.createElement("label",{key:e.value,className:`flex items-start gap-3 p-3 rounded border cursor-pointer ${r.includes(e.value)?A.accent:"border-gray-200 hover:border-gray-300 hover:bg-gray-50"}`},a.createElement("input",{type:"checkbox",checked:r.includes(e.value),onChange:()=>R(e.value),className:"mt-1 w-4 h-4 text-blue-600 rounded focus:ring-blue-500",disabled:i||!r.includes(e.value)&&!!x&&r.length>=x}),a.createElement("div",{className:"flex-1"},a.createElement("div",{className:"text-sm font-medium"},e.label),e.description&&a.createElement("div",{className:"text-xs text-gray-600 mt-1"},e.description))))),x&&a.createElement("div",{className:"text-xs text-gray-500"},a.createElement("span",{className:r.length===x?"text-orange-500 font-medium":""},r.length),"/",x," selected"),a.createElement("button",{onClick:_,disabled:i||r.length<y,className:`px-4 py-2 rounded text-sm font-medium ${i||r.length<y?"bg-gray-200 text-gray-400 cursor-not-allowed":A.button} flex items-center gap-2`},a.createElement(l.Jlk,{className:"w-4 h-4"}),"Submit (",r.length,")"));case"confirmation":return a.createElement("div",{className:"flex gap-3"},a.createElement("button",{onClick:()=>M(!0),disabled:i,className:"flex-1 px-4 py-3 bg-green-500 hover:bg-green-600 text-white rounded font-medium flex items-center justify-center gap-2 "+(i?"opacity-50 cursor-not-allowed":"")},a.createElement(l.Jlk,{className:"w-4 h-4"}),"Confirm"),a.createElement("button",{onClick:()=>M(!1),disabled:i,className:"flex-1 px-4 py-3 bg-gray-500 hover:bg-gray-600 text-white rounded font-medium flex items-center justify-center gap-2 "+(i?"opacity-50 cursor-not-allowed":"")},a.createElement(l.X,{className:"w-4 h-4"}),"Cancel"));default:return a.createElement("div",{className:"text-gray-500 text-sm"},"Unsupported action type: ",f)}})())}},46656:function(e,t,n){n.d(t,{B:function(){return v}});var a=n(7378),l=n(83281),o=n(67733),r=n.n(o),s=n(48034),i=n.n(s),c=n(62562),m=n.n(c),d=n(39805),u=n.n(d),p=n(57577),b=n.n(p),g=n(79062),f=n.n(g),h=n(83809),E={};E.styleTagTransform=f(),E.setAttributes=u(),E.insert=m().bind(null,"head"),E.domAPI=i(),E.insertStyleElement=b();r()(h.A,E),h.A&&h.A.locals&&h.A.locals;function v({onFileSelect:e,onAutocompleteOpen:t,onFileHover:o,disabled:r=!1}){const[s,i]=(0,a.useState)([]),[c,m]=(0,a.useState)([]),[d,u]=(0,a.useState)(!1),[p,b]=(0,a.useState)(0),[g,f]=(0,a.useState)(null),h=(0,a.useRef)(""),E=(0,a.useRef)(""),v=(0,a.useRef)(!1),x=(0,a.useRef)(null),y=(0,a.useRef)(!1),N=(0,a.useRef)(null),w=e=>{if(y.current||e===E.current)return;y.current=!0,E.current=e;const n=e.lastIndexOf("@");if(-1!==n){const a=n>0?e[n-1]:" ";if(0===n||/\s/.test(a)){const a=e.substring(n+1).split(/\s/)[0].trim();let l;if(""===a)l=s.slice(0,10);else{const e=a.toLowerCase();l=s.filter(t=>{const n=t.name.toLowerCase().includes(e),a=t.path.toLowerCase().includes(e);return n||a}).slice(0,10)}if(l.length>0){m(l),b(0),u(!0),t?.();const e=(()=>{const e=document.querySelector(".WACInputContainer");if(e){const t=e.getBoundingClientRect();return{top:t.top,left:t.left,width:t.width}}const t=document.querySelector("cds-aichat-react");if(t){const e=t.getBoundingClientRect();return{top:e.top,left:e.left,width:e.width}}const n=document.querySelector('.WAC__TextArea-textarea, textarea, input[type="text"]');if(n){const e=n.getBoundingClientRect();if(e.top>50&&e.left>0)return{top:e.top,left:e.left,width:e.width}}return{top:window.innerHeight-100,left:20,width:Math.min(600,window.innerWidth-40)}})(),n=Math.min(42*l.length+60,450);let a=e.top-n-8;a<0&&(a=e.top+60);const o={top:Math.max(10,a),left:Math.max(10,e.left+50)};f(o)}else u(!1)}else u(!1)}else u(!1);requestAnimationFrame(()=>{y.current=!1})},k=(0,a.useCallback)(t=>{const n=document.getElementById("main-input_field");if(!n)return;let a=n.value;const l=a.lastIndexOf("@");if(-1===l)return;const o=a.substring(l+1).split(/\s/)[0],r=a.substring(l+1+o.length),s=a.substring(0,l)+`./${t.path}`+r,i=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value")?.set;i?i.call(n,s):n.value=s;const c=new InputEvent("input",{bubbles:!0,composed:!0,inputType:"insertText",data:s});n.dispatchEvent(c),n.focus();const m=s.length;n.setSelectionRange(m,m),h.current=s,E.current=s,u(!1),e(t.path)},[e]);(0,a.useEffect)(()=>{if(r)return;C();const e=setInterval(C,15e3),t=()=>{const e=document.querySelector("cds-aichat-react"),n=document.getElementById("main-input_field");if(e||n){const t=e=>{const t=e.target||e.currentTarget,n=e=>"string"==typeof e&&(h.current=e,w(e),!0);if(n(t?.value))return;if(n(e.detail?.value))return;if("function"==typeof e.composedPath){const t=e.composedPath();for(const e of t){const t=e;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName||"true"===t.contentEditable)&&n(t.value||t.textContent))return}}const a=document.activeElement;if(a&&("TEXTAREA"===a.tagName||"INPUT"===a.tagName||"true"===a.contentEditable)&&n(a.value||a.textContent))return;const l=document.querySelector('.WAC__TextArea-textarea, textarea, input[type="text"], [contenteditable]');l&&n(l.value||l.textContent)};e&&(e.addEventListener("input",t),e.addEventListener("change",t),e.addEventListener("input-change",t),e.addEventListener("value-change",t)),setTimeout(()=>{document.querySelectorAll('.WAC__TextArea-textarea, textarea, input[type="text"], [contenteditable]').forEach(e=>{e.hasAttribute("data-autocomplete-listener")||(e.setAttribute("data-autocomplete-listener","true"),e.addEventListener("input",e=>{const t=e.target?.value||e.target?.textContent||"";h.current=t,w(t)}))})},1e3);const n=e=>{const t=e.target;if((!t||!t.hasAttribute("data-autocomplete-listener"))&&t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName||"true"===t.contentEditable)){const e=t.value||t.textContent||"";h.current=e,w(e)}};return document.addEventListener("input",n,!0),()=>{e&&(e.removeEventListener("input",t),e.removeEventListener("change",t),e.removeEventListener("input-change",t),e.removeEventListener("value-change",t)),document.removeEventListener("input",n,!0)}}setTimeout(t,500)};return t(),()=>{clearInterval(e)}},[r]),(0,a.useEffect)(()=>{if(r)return;const e=e=>{d&&0!==c.length&&("ArrowDown"===e.key?(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),b(e=>(e+1)%c.length)):"ArrowUp"===e.key?(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),b(e=>(e-1+c.length)%c.length)):"Enter"===e.key||"Tab"===e.key?(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),c[p]&&k(c[p])):"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),u(!1)))};return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[c,p,d,k,r]),(0,a.useEffect)(()=>{N.current&&N.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[p]),(0,a.useEffect)(()=>{d&&c.length>0&&p>=0&&p<c.length?o?.(c[p].path):d||o?.(null)},[p,d,c,o]);const C=async()=>{try{const{workspaceService:e}=await n.e(9135).then(n.bind(n,39135)),t=await e.getWorkspaceTree(),a=S(t.tree||[]);i(a)}catch(e){v.current||P()}},P=()=>{v.current=!0,i([{name:"top_opportunities_arkansas.txt",path:"cuga_workspace/top_opportunities_arkansas.txt"},{name:"top_10_opportunities_arkansas.txt",path:"cuga_workspace/top_10_opportunities_arkansas.txt"},{name:"top_3_opportunities_arkansas.txt",path:"cuga_workspace/top_3_opportunities_arkansas.txt"},{name:"analysis_report.md",path:"cuga_workspace/analysis_report.md"},{name:"data_export.json",path:"cuga_workspace/data_export.json"}])},S=e=>{const t=[];for(const n of e)"file"===n.type?t.push({name:n.name,path:n.path}):n.children&&t.push(...S(n.children));return t};return a.createElement(a.Fragment,null,d&&c.length>0&&g&&a.createElement("div",{ref:x,className:"file-autocomplete",style:{top:`${g.top}px`,left:`${g.left}px`},"data-debug-position":JSON.stringify(g)},a.createElement("div",{className:"file-autocomplete-header"},a.createElement("span",null,"Workspace Files"),a.createElement("span",{className:"file-count"},c.length)),a.createElement("div",{className:"file-autocomplete-list"},c.map((e,t)=>a.createElement("div",{key:e.path,ref:t===p?N:null,className:"file-autocomplete-item "+(t===p?"selected":""),onClick:t=>{t.preventDefault(),k(e)},onMouseEnter:()=>{b(t),o?.(e.path)},onMouseLeave:()=>o?.(null)},a.createElement(l.iUU,{size:16,className:"file-icon"}),a.createElement("div",{className:"file-info"},a.createElement("span",{className:"file-name"},e.name),a.createElement("span",{className:"file-path"},"./",e.path))))),a.createElement("div",{className:"file-autocomplete-footer"},a.createElement("span",{className:"hint"},"↑↓ navigate • Enter/Tab select • Esc close"))))}},49397:function(e,t,n){n.d(t,{a:function(){return E}});var a=n(7378),l=n(67733),o=n.n(l),r=n(48034),s=n.n(r),i=n(62562),c=n.n(i),m=n(39805),d=n.n(m),u=n(57577),p=n.n(u),b=n(79062),g=n.n(b),f=n(26944),h={};h.styleTagTransform=g(),h.setAttributes=d(),h.insert=c().bind(null,"head"),h.domAPI=s(),h.insertStyleElement=p();o()(f.A,h),f.A&&f.A.locals&&f.A.locals;function E({suggestions:e,onSuggestionClick:t}){return 0===e.length?null:a.createElement("div",{className:"followup-suggestions-container"},a.createElement("div",{className:"followup-suggestions-header"},a.createElement("span",{className:"followup-suggestions-title"},"Suggested followup questions:")),a.createElement("div",{className:"followup-suggestions-list"},e.map((e,n)=>a.createElement("button",{key:n,className:"followup-suggestion-chip",onClick:()=>t(e),type:"button"},e))))}},52068:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(7378),l=n(83281);n(33802);function o({onClose:e}){const[t,n]=(0,a.useState)({provider:"watsonx",model:"openai/gpt-oss-120b",temperature:.7,maxTokens:4096,topP:1}),[o,r]=(0,a.useState)("idle");(0,a.useEffect)(()=>{s()},[]);const s=async()=>{try{const e=await fetch("/api/config/model");if(e.ok){const t=await e.json();n(t)}}catch(e){}};return a.createElement("div",{className:"config-modal-overlay",onClick:e},a.createElement("div",{className:"config-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"config-modal-header"},a.createElement("h2",null,"Model Configuration"),a.createElement("button",{className:"config-modal-close",onClick:e},a.createElement(l.X,{size:20}))),a.createElement("div",{className:"config-modal-content"},a.createElement("div",{className:"config-card"},a.createElement("h3",null,"Language Model Settings"),a.createElement("div",{className:"config-form"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Provider"),a.createElement("select",{value:t.provider,onChange:e=>n({...t,provider:e.target.value})},a.createElement("option",{value:"anthropic"},"Anthropic"),a.createElement("option",{value:"openai"},"OpenAI"),a.createElement("option",{value:"azure"},"Azure OpenAI"),a.createElement("option",{value:"watsonx"},"IBM watsonx"),a.createElement("option",{value:"ollama"},"Ollama"))),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Model"),a.createElement("input",{type:"text",value:t.model,onChange:e=>n({...t,model:e.target.value}),placeholder:"e.g., claude-3-5-sonnet-20241022"})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Temperature: ",t.temperature),a.createElement("input",{type:"range",min:"0",max:"2",step:"0.1",value:t.temperature,onChange:e=>n({...t,temperature:parseFloat(e.target.value)})}),a.createElement("small",null,"Controls randomness: 0 = focused, 2 = creative")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Max Tokens"),a.createElement("input",{type:"number",value:t.maxTokens,onChange:e=>n({...t,maxTokens:parseInt(e.target.value)}),min:"1",max:"200000"})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Top P: ",t.topP),a.createElement("input",{type:"range",min:"0",max:"1",step:"0.01",value:t.topP,onChange:e=>n({...t,topP:parseFloat(e.target.value)})}),a.createElement("small",null,"Nucleus sampling threshold")),"ollama"!==t.provider&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"API Key"),a.createElement("input",{type:"password",value:t.apiKey||"",onChange:e=>n({...t,apiKey:e.target.value}),placeholder:"Enter API key..."}))))),a.createElement("div",{className:"config-modal-footer"},a.createElement("button",{className:"cancel-btn",onClick:e},"Cancel"),a.createElement("button",{className:`save-btn ${o}`,onClick:async()=>{r("saving");try{(await fetch("/api/config/model",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(r("success"),setTimeout(()=>r("idle"),2e3)):(r("error"),setTimeout(()=>r("idle"),2e3))}catch(e){r("error"),setTimeout(()=>r("idle"),2e3)}},disabled:"saving"===o},a.createElement(l.eMP,{size:16}),"idle"===o&&"Save Changes","saving"===o&&"Saving...","success"===o&&"Saved!","error"===o&&"Error!"))))}},57547:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(7378),l=n(83281);n(33802);function o({onClose:e}){const[t,n]=(0,a.useState)({sources:[],embeddingModel:"text-embedding-3-small",chunkSize:1e3,chunkOverlap:200}),[o,r]=(0,a.useState)("idle");(0,a.useEffect)(()=>{s()},[]);const s=async()=>{try{const e=await fetch("/api/config/knowledge");if(e.ok){const t=await e.json();n(t)}}catch(e){}},i=(e,a)=>{n({...t,sources:t.sources.map(t=>t.id===e?{...t,...a}:t)})};return a.createElement("div",{className:"config-modal-overlay",onClick:e},a.createElement("div",{className:"config-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"config-modal-header"},a.createElement("h2",null,"Knowledge Configuration"),a.createElement("button",{className:"config-modal-close",onClick:e},a.createElement(l.X,{size:20}))),a.createElement("div",{className:"config-modal-content"},a.createElement("div",{className:"config-card"},a.createElement("h3",null,"Embedding Settings"),a.createElement("div",{className:"config-form"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Embedding Model"),a.createElement("select",{value:t.embeddingModel,onChange:e=>n({...t,embeddingModel:e.target.value})},a.createElement("option",{value:"text-embedding-3-small"},"text-embedding-3-small"),a.createElement("option",{value:"text-embedding-3-large"},"text-embedding-3-large"),a.createElement("option",{value:"text-embedding-ada-002"},"text-embedding-ada-002"))),a.createElement("div",{className:"form-row"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Chunk Size"),a.createElement("input",{type:"number",value:t.chunkSize,onChange:e=>n({...t,chunkSize:parseInt(e.target.value)}),min:"100",max:"4000"})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Chunk Overlap"),a.createElement("input",{type:"number",value:t.chunkOverlap,onChange:e=>n({...t,chunkOverlap:parseInt(e.target.value)}),min:"0",max:"1000"}))))),a.createElement("div",{className:"config-card"},a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Knowledge Sources"),a.createElement("button",{className:"add-btn",onClick:()=>{const e={id:Date.now().toString(),name:"New Source",type:"file",enabled:!0};n({...t,sources:[...t.sources,e]})}},a.createElement(l.FWt,{size:16}),"Add Source")),a.createElement("div",{className:"sources-list"},t.sources.map(e=>a.createElement("div",{key:e.id,className:"source-item"},a.createElement("div",{className:"source-header"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>i(e.id,{enabled:t.target.checked})}),a.createElement("input",{type:"text",value:e.name,onChange:t=>i(e.id,{name:t.target.value}),className:"source-name"}),a.createElement("select",{value:e.type,onChange:t=>i(e.id,{type:t.target.value})},a.createElement("option",{value:"file"},"File"),a.createElement("option",{value:"url"},"URL"),a.createElement("option",{value:"database"},"Database")),a.createElement("button",{className:"delete-btn",onClick:()=>{return a=e.id,void n({...t,sources:t.sources.filter(e=>e.id!==a)});var a}},a.createElement(l.TBR,{size:16}))),a.createElement("div",{className:"source-details"},"file"===e.type&&a.createElement("div",{className:"form-group"},a.createElement("input",{type:"text",value:e.path||"",onChange:t=>i(e.id,{path:t.target.value}),placeholder:"File path..."})),"url"===e.type&&a.createElement("div",{className:"form-group"},a.createElement("input",{type:"text",value:e.url||"",onChange:t=>i(e.id,{url:t.target.value}),placeholder:"https://..."})))))),0===t.sources.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No knowledge sources configured. Click "Add Source" to get started.')))),a.createElement("div",{className:"config-modal-footer"},a.createElement("button",{className:"cancel-btn",onClick:e},"Cancel"),a.createElement("button",{className:`save-btn ${o}`,onClick:async()=>{r("saving");try{(await fetch("/api/config/knowledge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(r("success"),setTimeout(()=>r("idle"),2e3)):(r("error"),setTimeout(()=>r("idle"),2e3))}catch(e){r("error"),setTimeout(()=>r("idle"),2e3)}},disabled:"saving"===o},a.createElement(l.eMP,{size:16}),"idle"===o&&"Save Changes","saving"===o&&"Saving...","success"===o&&"Saved!","error"===o&&"Error!"))))}},67813:function(e,t,n){n.d(t,{J:function(){return v}});var a=n(7378),l=n(83281),o=n(67733),r=n.n(o),s=n(48034),i=n.n(s),c=n(62562),m=n.n(c),d=n(39805),u=n.n(d),p=n(57577),b=n.n(p),g=n(79062),f=n.n(g),h=n(90313),E={};E.styleTagTransform=f(),E.setAttributes=u(),E.insert=m().bind(null,"head"),E.domAPI=i(),E.insertStyleElement=b();r()(h.A,E),h.A&&h.A.locals&&h.A.locals;function v({steps:e,isActive:t,onComplete:n,onSkip:o}){const[r,s]=(0,a.useState)(0),[i,c]=(0,a.useState)({top:0,left:0}),[m,d]=(0,a.useState)({top:0,left:0,width:0,height:0}),u=(0,a.useCallback)(()=>{if(!t||r>=e.length)return;const n=e[r],a=n.target.split(",").map(e=>e.trim());let l=null;for(const e of a)if(l=document.querySelector(e),l)break;if(!l)return;const o=l.getBoundingClientRect(),s=n.highlightPadding||8;d({top:o.top-s,left:o.left-s,width:o.width+2*s,height:o.height+2*s});const i=320,m=200,u=16;let p=0,b=0;switch(n.placement||"bottom"){case"top":p=o.top-m-u,b=o.left+o.width/2-160;break;case"bottom":p=o.bottom+u,b=o.left+o.width/2-160;break;case"left":p=o.top+o.height/2-100,b=o.left-i-u;break;case"right":p=o.top+o.height/2-100,b=o.right+u}const g=window.innerWidth,f=window.innerHeight;b<u&&(b=u),b+i>g-u&&(b=g-i-u),p<u&&(p=u),p+m>f-u&&(p=f-m-u),c({top:p,left:b}),l.scrollIntoView({behavior:"smooth",block:"center"})},[t,r,e]);(0,a.useEffect)(()=>{if(t){u();const t=e[r];t?.beforeShow&&t.beforeShow();const n=()=>u();window.addEventListener("resize",n);const a=setTimeout(u,100);return()=>{window.removeEventListener("resize",n),clearTimeout(a)}}},[t,r,u,e]),(0,a.useEffect)(()=>{const n=e[r];n?.afterShow&&t&&n.afterShow()},[r,t,e]);const p=()=>{n(),s(0)},b=()=>{o(),s(0)};if(!t||r>=e.length)return null;const g=e[r],f=(r+1)/e.length*100;return a.createElement(a.Fragment,null,a.createElement("div",{className:"tour-overlay"}),a.createElement("div",{className:"tour-highlight",style:{top:`${m.top}px`,left:`${m.left}px`,width:`${m.width}px`,height:`${m.height}px`}}),a.createElement("div",{className:"tour-tooltip",style:{top:`${i.top}px`,left:`${i.left}px`}},a.createElement("div",{className:"tour-tooltip-header"},a.createElement("div",{className:"tour-step-counter"},"Step ",r+1," of ",e.length),a.createElement("button",{className:"tour-close-btn",onClick:b,title:"Skip tour"},a.createElement(l.X,{size:16}))),a.createElement("div",{className:"tour-tooltip-content"},a.createElement("h3",{className:"tour-tooltip-title"},g.title),a.createElement("p",{className:"tour-tooltip-text"},g.content)),a.createElement("div",{className:"tour-tooltip-footer"},a.createElement("div",{className:"tour-progress-bar"},a.createElement("div",{className:"tour-progress-fill",style:{width:`${f}%`}})),a.createElement("div",{className:"tour-tooltip-actions"},a.createElement("button",{className:"tour-btn tour-btn-secondary",onClick:b},"Skip Tour"),a.createElement("div",{className:"tour-navigation"},a.createElement("button",{className:"tour-btn tour-btn-icon",onClick:()=>{r>0&&s(r-1)},disabled:0===r,title:"Previous"},a.createElement(l.JGc,{size:16})),a.createElement("button",{className:"tour-btn tour-btn-primary",onClick:()=>{r<e.length-1?s(r+1):p()}},r===e.length-1?a.createElement(a.Fragment,null,a.createElement(l.Jlk,{size:16}),"Finish"):a.createElement(a.Fragment,null,"Next",a.createElement(l.c_$,{size:16}))))))))}},70944:function(e,t,n){n.d(t,{E:function(){return N}});var a=n(7378),l=n(83281),o=n(67733),r=n.n(o),s=n(48034),i=n.n(s),c=n(62562),m=n.n(c),d=n(39805),u=n.n(d),p=n(57577),b=n.n(p),g=n(79062),f=n.n(g),h=n(82066),E={};E.styleTagTransform=f(),E.setAttributes=u(),E.insert=m().bind(null,"head"),E.domAPI=i(),E.insertStyleElement=b();r()(h.A,E),h.A&&h.A.locals&&h.A.locals;var v=n(10534);const x=!1,y=!1;function N({globalVariables:e,variablesHistory:t,selectedAnswerId:n,onSelectAnswer:o,isCollapsed:r=!1,activeTab:s="conversations",onTabChange:i,leftSidebarRef:c}){const[m,d]=(0,a.useState)(!r);(0,a.useEffect)(()=>{d(!r)},[r]),(0,a.useEffect)(()=>{},[e,t]);const[u,p]=(0,a.useState)([]),[b,g]=(0,a.useState)(null),[f,h]=(0,a.useState)([]),[E,N]=(0,a.useState)(null),[w,k]=(0,a.useState)(null);(0,a.useEffect)(()=>{C(),A()},[]);const C=async()=>{try{const e=await fetch("/api/conversations");if(e.ok){const t=await e.json();p(t)}}catch(e){}},P=async e=>{const t={id:`conv-${Date.now()}`,title:e||"New Conversation",timestamp:Date.now()};p(e=>[t,...e]),g(t.id);try{const n=await fetch("/api/conversations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e||"New Conversation",timestamp:Date.now()})});if(n.ok){const e=await n.json();p(n=>n.map(n=>n.id===t.id?{...e,id:t.id}:n))}}catch(e){}},S=a.useCallback(e=>{P(e)},[]);a.useImperativeHandle(c,()=>({addConversation:S}),[S]),a.useEffect(()=>{},[c?.current]);const A=async()=>{try{const e=await fetch("/api/flows");if(e.ok){const t=await e.json();h(t.flows||[])}else h([])}catch(e){h([])}},T=e=>{const t=new Date(e),n=(new Date).getTime()-t.getTime(),a=Math.floor(n/6e4),l=Math.floor(n/36e5),o=Math.floor(n/864e5);return a<1?"1 minute ago":a<60?`${a} ${1===a?"minute":"minutes"} ago`:l<24?`${l} ${1===l?"hour":"hours"} ago`:1===o?"now":o<7?`${o} days ago`:t.toLocaleDateString()};return m?a.createElement("div",{className:"left-sidebar "+(m?"expanded":"collapsed")},a.createElement("div",{className:"left-sidebar-header"},a.createElement("div",{className:"left-sidebar-tabs"},x&&a.createElement("button",{className:"sidebar-tab "+("conversations"===s?"active":""),onClick:()=>i?i("conversations"):null},a.createElement(l.vEG,{size:16}),a.createElement("span",null,"Chats")),a.createElement("button",{className:"sidebar-tab "+("variables"===s?"active":""),onClick:()=>i?i("variables"):null},a.createElement(l.WmV,{size:16}),a.createElement("span",null,"Variables"),a.createElement("div",{className:"sidebar-tab-info-tooltip-wrapper",onClick:e=>e.stopPropagation(),onMouseEnter:e=>e.stopPropagation()},a.createElement(l.mNh,{size:14,className:"sidebar-info-icon"}),a.createElement("div",{className:"sidebar-tab-info-tooltip"},"Variables are the results from task execution. Ask any question about the variables and CUGA will respond."))),y&&a.createElement("button",{className:"sidebar-tab "+("savedflows"===s?"active":""),onClick:()=>i?i("savedflows"):null},a.createElement(l.WuS,{size:16}),a.createElement("span",null,"Saved Flows"))),a.createElement("button",{className:"left-sidebar-toggle",onClick:()=>d(!1)},a.createElement(l.JGc,{size:18}))),a.createElement("div",{className:"left-sidebar-content"},x&&"conversations"===s?a.createElement(a.Fragment,null,a.createElement("div",{className:"conversations-actions"},a.createElement("button",{className:"new-conversation-btn",onClick:()=>P()},a.createElement(l.FWt,{size:16}),a.createElement("span",null,"New Chat"))),a.createElement("div",{className:"conversations-list"},0===u.length?a.createElement("div",{className:"empty-state"},a.createElement(l.vEG,{size:32}),a.createElement("p",null,"No conversations yet"),a.createElement("small",null,"Start a new chat to begin")):u.map(e=>a.createElement("div",{key:e.id,className:"conversation-item "+(b===e.id?"selected":""),onClick:()=>g(e.id)},a.createElement("div",{className:"conversation-header"},a.createElement(l.vEG,{size:14}),a.createElement("span",{className:"conversation-title"},e.title),a.createElement("button",{className:"delete-conversation-btn",onClick:t=>(async(e,t)=>{t.stopPropagation();try{(await fetch(`/api/conversations/${e}`,{method:"DELETE"})).ok&&(p(u.filter(t=>t.id!==e)),b===e&&g(null))}catch(e){}})(e.id,t)},a.createElement(l.TBR,{size:14}))),e.preview&&a.createElement("div",{className:"conversation-preview"},e.preview),a.createElement("div",{className:"conversation-date"},T(e.timestamp)))))):"variables"===s?a.createElement("div",{className:"variables-wrapper"},a.createElement(v.A,{variables:e,history:t,selectedAnswerId:n,onSelectAnswer:o})):y&&"savedflows"===s?a.createElement(a.Fragment,null,a.createElement("div",{className:"conversations-list"},0===f.length?a.createElement("div",{className:"empty-state"},a.createElement(l.WuS,{size:32}),a.createElement("p",null,"No saved flows yet"),a.createElement("small",null,"Saved flows will appear here")):f.map(e=>a.createElement("div",{key:e.id,className:"conversation-item flow-item"},a.createElement("div",{className:"conversation-header"},a.createElement(l.WuS,{size:14}),a.createElement("span",{className:"conversation-title"},e.name),a.createElement("div",{className:"flow-info-icon-wrapper",onMouseEnter:t=>{const n=t.currentTarget.getBoundingClientRect(),a=window.innerWidth;let l=n.right+12;l+300>a&&(l=n.left-300-12);let o=n.top;o+120>window.innerHeight&&(o=window.innerHeight-120-10),o<10&&(o=10),k({top:o,left:l}),N(e.id)},onMouseLeave:e=>{const t=document.querySelector(".flow-info-tooltip");if(t){const n=t.getBoundingClientRect(),a=e.clientX,l=e.clientY;if(a>=n.left&&a<=n.right&&l>=n.top&&l<=n.bottom)return}N(null),k(null)}},a.createElement(l.R2D,{size:14,className:"flow-info-icon"}))),e.description&&a.createElement("div",{className:"conversation-preview"},e.description),a.createElement("div",{className:"flow-parameters"},a.createElement("div",{className:"flow-function-signature"},a.createElement("code",null,e.name,"("),a.createElement("div",{className:"flow-params-list"},e.parameters.map((t,n)=>a.createElement("div",{key:n,className:"flow-param"},a.createElement("code",{className:"param-name"},t.name),a.createElement("span",{className:"param-type"},": ",t.type),!t.required&&void 0!==t.default&&a.createElement("span",{className:"param-default"}," = ",JSON.stringify(t.default)),t.required&&a.createElement("span",{className:"param-required"},"*"),n<e.parameters.length-1&&a.createElement("span",null,",")))),a.createElement("code",null,")"))),a.createElement("div",{className:"conversation-date"},T(e.timestamp)))))):null),E&&w&&a.createElement("div",{className:"flow-info-tooltip",style:{top:`${w.top}px`,left:`${w.left}px`},onMouseEnter:()=>{N(E)},onMouseLeave:()=>{N(null),k(null)}},"Saved from a previous conversation where you completed a similar task using CRM, filesystem, and email tools. Reuse this flow to repeat the same pattern with different parameters.")):a.createElement("div",{className:"left-sidebar-floating-toggle",onClick:()=>d(!0)},a.createElement(l.c_$,{size:20}),a.createElement("div",{className:"sidebar-floating-count"},u.length))}},82066:function(e,t,n){var a=n(21598),l=n.n(a),o=n(2607),r=n.n(o)()(l());r.push([e.id,".left-sidebar {\n position: fixed;\n left: 0;\n top: 48px;\n bottom: 0;\n background: white;\n border-right: 1px solid #e5e7eb;\n z-index: 1000;\n display: flex;\n flex-direction: column;\n transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;\n box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);\n width: 320px;\n transform: translateX(0);\n overflow: visible;\n}\n\n.left-sidebar.collapsed {\n transform: translateX(-100%);\n box-shadow: none;\n}\n\n.left-sidebar.expanded {\n transform: translateX(0);\n animation: slideInFromLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n@keyframes slideInFromLeft {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(0);\n }\n}\n\n.left-sidebar-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px;\n border-bottom: 1px solid #e5e7eb;\n gap: 6px;\n background: #f9fafb;\n min-height: 52px;\n}\n\n.left-sidebar-tabs {\n display: flex;\n gap: 3px;\n flex: 1;\n min-width: 0;\n background: white;\n border-radius: 8px;\n padding: 3px;\n border: 1px solid #e5e7eb;\n overflow: hidden;\n}\n\n.sidebar-tab {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n padding: 6px 6px;\n background: transparent;\n border: none;\n border-radius: 6px;\n color: #64748b;\n font-size: 10.5px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n white-space: nowrap;\n min-width: 0;\n}\n\n.sidebar-tab span {\n white-space: nowrap;\n}\n\n.sidebar-tab:hover {\n background: #f8fafc;\n color: #4e00ec;\n}\n\n.sidebar-tab.active {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);\n}\n\n.sidebar-tab-info-tooltip-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n margin-left: 4px;\n cursor: help;\n}\n\n.sidebar-info-icon {\n color: #94a3b8;\n cursor: help;\n transition: color 0.2s ease;\n flex-shrink: 0;\n pointer-events: auto;\n}\n\n.sidebar-tab:hover .sidebar-info-icon {\n color: #4e00ec;\n}\n\n.sidebar-tab.active .sidebar-info-icon {\n color: white;\n}\n\n.sidebar-tab-info-tooltip-wrapper:hover .sidebar-info-icon {\n color: #4e00ec !important;\n}\n\n.sidebar-tab.active .sidebar-tab-info-tooltip-wrapper:hover .sidebar-info-icon {\n color: #e0e7ff !important;\n}\n\n.sidebar-tab-info-tooltip {\n position: fixed;\n top: 60px;\n left: 20px;\n width: 320px;\n max-width: calc(100vw - 40px);\n padding: 14px 16px;\n background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);\n border: 2px solid #e0e7ff;\n border-radius: 12px;\n box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);\n font-size: 13px;\n line-height: 1.6;\n color: #334155;\n opacity: 0;\n visibility: hidden;\n transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;\n z-index: 9999;\n pointer-events: none;\n transform-origin: top left;\n font-weight: 500;\n white-space: normal;\n word-wrap: break-word;\n word-break: break-word;\n overflow-wrap: break-word;\n hyphens: auto;\n}\n\n.sidebar-tab-info-tooltip code {\n background: #e0e7ff;\n color: #4f46e5;\n padding: 2px 6px;\n border-radius: 4px;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;\n font-size: 12px;\n font-weight: 600;\n white-space: nowrap;\n}\n\n.sidebar-tab-info-tooltip-wrapper:hover .sidebar-tab-info-tooltip {\n opacity: 1;\n visibility: visible;\n pointer-events: auto;\n transform: translateY(2px);\n}\n\n.left-sidebar-toggle {\n width: 32px;\n min-width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: white;\n border: 1px solid #e5e7eb;\n border-radius: 6px;\n cursor: pointer;\n color: #64748b;\n transition: all 0.2s;\n flex-shrink: 0;\n}\n\n.left-sidebar-toggle:hover {\n background: #f8fafc;\n border-color: #cbd5e1;\n color: #4e00ec;\n}\n\n.left-sidebar-content {\n flex: 1;\n overflow-y: auto;\n overflow-x: visible;\n display: flex;\n flex-direction: column;\n}\n\n.conversations-actions {\n padding: 12px;\n border-bottom: 1px solid #e5e7eb;\n background: #f9fafb;\n}\n\n.new-conversation-btn {\n width: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border: none;\n border-radius: 8px;\n color: white;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);\n}\n\n.new-conversation-btn:hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);\n}\n\n.new-conversation-btn:active {\n transform: translateY(0);\n}\n\n.conversations-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 12px;\n flex: 1;\n overflow: visible;\n}\n\n.conversation-item {\n background: #f8fafc;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n padding: 12px;\n cursor: pointer;\n transition: all 0.2s;\n position: relative;\n overflow: visible;\n}\n\n.conversation-item:hover {\n background: #f1f5f9;\n border-color: #cbd5e1;\n transform: translateY(-1px);\n box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);\n}\n\n.conversation-item.selected {\n background: #eef2ff;\n border-color: #667eea;\n box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);\n}\n\n.conversation-header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 6px;\n position: relative;\n overflow: visible;\n}\n\n.conversation-header svg {\n color: #667eea;\n flex-shrink: 0;\n}\n\n.conversation-title {\n font-size: 13px;\n font-weight: 600;\n color: #1e293b;\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.delete-conversation-btn {\n background: none;\n border: none;\n color: #94a3b8;\n cursor: pointer;\n padding: 4px;\n display: flex;\n align-items: center;\n border-radius: 4px;\n transition: all 0.2s;\n opacity: 0;\n}\n\n.conversation-item:hover .delete-conversation-btn {\n opacity: 1;\n}\n\n.delete-conversation-btn:hover {\n background: #fee2e2;\n color: #ef4444;\n}\n\n.conversation-preview {\n font-size: 12px;\n color: #64748b;\n line-height: 1.4;\n margin-bottom: 6px;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.conversation-date {\n font-size: 11px;\n color: #94a3b8;\n}\n\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 40px 20px;\n text-align: center;\n color: #94a3b8;\n gap: 8px;\n}\n\n.empty-state svg {\n opacity: 0.5;\n}\n\n.empty-state p {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n color: #64748b;\n}\n\n.empty-state small {\n font-size: 12px;\n}\n\n.variables-wrapper {\n flex: 1;\n overflow: hidden;\n position: relative;\n}\n\n.variables-wrapper .variables-sidebar {\n position: relative !important;\n left: 0 !important;\n top: 0 !important;\n height: 100%;\n width: 100%;\n border-right: none;\n box-shadow: none;\n transform: none !important;\n}\n\n.variables-wrapper .variables-sidebar-floating-toggle {\n display: none;\n}\n\n.left-sidebar-floating-toggle {\n position: fixed;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 48px;\n height: 64px;\n background: white;\n border: 1px solid #e5e7eb;\n border-left: none;\n border-radius: 0 8px 8px 0;\n box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);\n cursor: pointer;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 4px;\n z-index: 999;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n color: #64748b;\n animation: slideInToggle 0.5s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.left-sidebar-floating-toggle:hover {\n background: #f8fafc;\n color: #4e00ec;\n box-shadow: 2px 0 12px rgba(102, 126, 234, 0.2);\n transform: translateY(-50%) translateX(4px);\n}\n\n@keyframes slideInToggle {\n from {\n transform: translateY(-50%) translateX(-100%);\n opacity: 0;\n }\n to {\n transform: translateY(-50%) translateX(0);\n opacity: 1;\n }\n}\n\n.sidebar-floating-count {\n font-size: 11px;\n font-weight: 600;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n padding: 2px 6px;\n border-radius: 10px;\n min-width: 20px;\n text-align: center;\n}\n\n.left-sidebar-content::-webkit-scrollbar {\n width: 6px;\n}\n\n.left-sidebar-content::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.left-sidebar-content::-webkit-scrollbar-thumb {\n background: #cbd5e1;\n border-radius: 3px;\n}\n\n.left-sidebar-content::-webkit-scrollbar-thumb:hover {\n background: #94a3b8;\n}\n\n@media (max-width: 768px) {\n .left-sidebar {\n width: 280px;\n }\n}\n\n@media (max-width: 640px) {\n .left-sidebar {\n width: 100%;\n max-width: 300px;\n }\n}\n\n.flow-item {\n cursor: default;\n}\n\n.flow-parameters {\n margin: 8px 0;\n padding: 8px;\n background: white;\n border-radius: 6px;\n border: 1px solid #e5e7eb;\n}\n\n.flow-function-signature {\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;\n font-size: 11px;\n color: #1e293b;\n line-height: 1.6;\n}\n\n.flow-function-signature code {\n background: transparent;\n padding: 0;\n color: inherit;\n font-family: inherit;\n}\n\n.flow-params-list {\n margin-left: 12px;\n margin-top: 4px;\n}\n\n.flow-param {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 2px;\n}\n\n.param-name {\n color: #667eea;\n font-weight: 600;\n}\n\n.param-type {\n color: #64748b;\n font-style: italic;\n}\n\n.param-default {\n color: #10b981;\n}\n\n.param-required {\n color: #ef4444;\n font-weight: 600;\n margin-left: 2px;\n}\n\n.flow-info-icon-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n margin-left: auto;\n}\n\n.flow-info-icon {\n color: #94a3b8;\n cursor: pointer;\n transition: all 0.2s;\n flex-shrink: 0;\n}\n\n.flow-info-icon:hover {\n color: #667eea;\n transform: scale(1.1);\n}\n\n.flow-info-tooltip {\n position: fixed;\n width: 300px;\n background: #1e293b;\n color: white;\n padding: 14px 16px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.5;\n box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);\n z-index: 99999;\n animation: tooltipFadeIn 0.2s ease;\n pointer-events: auto;\n}\n\n.flow-info-tooltip::before {\n content: '';\n position: absolute;\n right: 100%;\n top: 20px;\n border: 8px solid transparent;\n border-right-color: #1e293b;\n}\n\n@keyframes tooltipFadeIn {\n from {\n opacity: 0;\n transform: translateY(4px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n\n",""]),t.A=r},83533:function(e,t,n){n.d(t,{A:function(){return o}});var a=n(7378),l=n(83281);n(33802);function o({onClose:e}){const[t,n]=(0,a.useState)({enablePolicies:!0,intentPolicies:[],sopPolicies:[],subAgentPolicies:[],appPolicies:[],toolGuards:[],toolEnrichments:[],answerPolicies:[],strictMode:!1,logViolations:!0}),[o,r]=(0,a.useState)("intent"),[s,i]=(0,a.useState)("guards"),[c,m]=(0,a.useState)(null),[d,u]=(0,a.useState)("idle");(0,a.useEffect)(()=>{p()},[]);const p=async()=>{try{const e=await fetch("/api/config/policies");if(e.ok){const t=await e.json();n({enablePolicies:t.enablePolicies??!0,intentPolicies:t.intentPolicies??[],sopPolicies:t.sopPolicies??[],subAgentPolicies:t.subAgentPolicies??[],appPolicies:t.appPolicies??[],toolGuards:t.toolGuards??[],toolEnrichments:t.toolEnrichments??[],answerPolicies:t.answerPolicies??[],strictMode:t.strictMode??!1,logViolations:t.logViolations??!0})}}catch(e){}},b=()=>{const e={id:Date.now().toString(),name:"New Intent Policy",policyType:"intent",enabled:!0,intentPattern:"",action:"block",response:"",allowedTopics:[]};n({...t,intentPolicies:[...t.intentPolicies,e]})},g=()=>{const e={id:Date.now().toString(),name:"New SOP",policyType:"sop",enabled:!0,trigger:"",steps:[""],description:""};n({...t,sopPolicies:[...t.sopPolicies,e]})},f=()=>{const e={id:Date.now().toString(),name:"New Sub-Agent Policy",policyType:"subagent",enabled:!0,subAgentName:"",constraints:[],allowedTools:[],restrictions:""};n({...t,subAgentPolicies:[...t.subAgentPolicies,e]})},h=()=>{const e={id:Date.now().toString(),name:"New App Policy",policyType:"app",enabled:!0,appName:"",instructions:"",rules:[],permissions:[]};n({...t,appPolicies:[...t.appPolicies,e]})},E=()=>{const e={id:Date.now().toString(),name:"New Tool Guard",policyType:"toolguard",enabled:!0,toolName:"",guardType:"rate_limit",config:{maxCallsPerMinute:10,maxCallsPerHour:100},description:""};n({...t,toolGuards:[...t.toolGuards,e]})},v=()=>{const e={id:Date.now().toString(),name:"New Answer Policy",policyType:"answer",enabled:!0,responseFormat:"natural",tone:"professional",includeConfidence:!1,includeSources:!1,customInstructions:[],forbiddenPhrases:[]};n({...t,answerPolicies:[...t.answerPolicies,e]})},x=()=>{const e={id:Date.now().toString(),name:"New Tool Enrichment",policyType:"toolenrichment",enabled:!0,toolName:"",customInstructions:[],exampleUsages:[],bestPractices:[]};n({...t,toolEnrichments:[...t.toolEnrichments,e]})},y=(e,a)=>{n({...t,intentPolicies:t.intentPolicies.map(t=>t.id===e?{...t,...a}:t)})},N=(e,a)=>{n({...t,sopPolicies:t.sopPolicies.map(t=>t.id===e?{...t,...a}:t)})},w=(e,a)=>{n({...t,subAgentPolicies:t.subAgentPolicies.map(t=>t.id===e?{...t,...a}:t)})},k=(e,a)=>{n({...t,appPolicies:t.appPolicies.map(t=>t.id===e?{...t,...a}:t)})},C=(e,a)=>{n({...t,toolGuards:t.toolGuards.map(t=>t.id===e?{...t,...a}:t)})},P=(e,a)=>{n({...t,answerPolicies:t.answerPolicies.map(t=>t.id===e?{...t,...a}:t)})},S=(e,a)=>{n({...t,toolEnrichments:t.toolEnrichments.map(t=>t.id===e?{...t,...a}:t)})},A=(e,a)=>{switch(a){case"intent":n({...t,intentPolicies:t.intentPolicies.filter(t=>t.id!==e)});break;case"sop":n({...t,sopPolicies:t.sopPolicies.filter(t=>t.id!==e)});break;case"subagent":n({...t,subAgentPolicies:t.subAgentPolicies.filter(t=>t.id!==e)});break;case"app":n({...t,appPolicies:t.appPolicies.filter(t=>t.id!==e)});break;case"toolguards":n({...t,toolGuards:t.toolGuards.filter(t=>t.id!==e)});break;case"toolenrichments":n({...t,toolEnrichments:t.toolEnrichments.filter(t=>t.id!==e)});break;case"answer":n({...t,answerPolicies:t.answerPolicies.filter(t=>t.id!==e)})}};return a.createElement("div",{className:"config-modal-overlay",onClick:e},a.createElement("div",{className:"config-modal",onClick:e=>e.stopPropagation()},a.createElement("div",{className:"config-modal-header"},a.createElement("h2",null,"Policies Configuration"),a.createElement("button",{className:"config-modal-close",onClick:e},a.createElement(l.X,{size:20}))),a.createElement("div",{className:"config-modal-tabs"},a.createElement("button",{className:"config-tab "+("intent"===o?"active":""),onClick:()=>r("intent")},"Intent Policies"),a.createElement("button",{className:"config-tab "+("sop"===o?"active":""),onClick:()=>r("sop")},"SOPs"),a.createElement("button",{className:"config-tab "+("subagent"===o?"active":""),onClick:()=>r("subagent")},"Sub-Agent Policies"),a.createElement("button",{className:"config-tab "+("app"===o?"active":""),onClick:()=>r("app")},"App Policies"),a.createElement("button",{className:"config-tab "+("toolguards"===o||"toolenrichments"===o?"active":""),onClick:()=>{r("toolguards"),i("guards")}},"Tools"),a.createElement("button",{className:"config-tab "+("answer"===o?"active":""),onClick:()=>r("answer")},"Answer Policy")),a.createElement("div",{className:"config-modal-content"},a.createElement("div",{className:"config-card"},a.createElement("h3",null,"Global Settings"),a.createElement("div",{className:"config-form"},a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.enablePolicies,onChange:e=>n({...t,enablePolicies:e.target.checked})}),a.createElement("span",null,"Enable All Policies")),a.createElement("small",null,"Master switch for all policy enforcement")),a.createElement("div",{className:"form-row"},a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.strictMode,onChange:e=>n({...t,strictMode:e.target.checked}),disabled:!t.enablePolicies}),a.createElement("span",null,"Strict Mode")),a.createElement("small",null,"Deny all actions not explicitly allowed")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:t.logViolations,onChange:e=>n({...t,logViolations:e.target.checked}),disabled:!t.enablePolicies}),a.createElement("span",null,"Log Violations")),a.createElement("small",null,"Record all policy violations"))))),"intent"===o&&a.createElement("div",{className:"config-card"},a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Intent Blockers & Redirections"),a.createElement("button",{className:"add-btn",onClick:b,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add Intent Policy")),a.createElement("div",{className:"sources-list"},t.intentPolicies.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>y(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>y(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"Policy Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"intent"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16})))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Intent Pattern"),a.createElement("input",{type:"text",value:e.intentPattern,onChange:t=>y(e.id,{intentPattern:t.target.value}),placeholder:"e.g., 'personal information', 'sensitive data'",disabled:!t.enablePolicies}),a.createElement("small",null,"Keywords or phrases that trigger this policy")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Action"),a.createElement("select",{value:e.action,onChange:t=>y(e.id,{action:t.target.value}),disabled:!t.enablePolicies},a.createElement("option",{value:"block"},"Block"),a.createElement("option",{value:"redirect"},"Redirect"),a.createElement("option",{value:"restrict"},"Restrict to Topics"))),"block"===e.action&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"Response Message"),a.createElement("textarea",{value:e.response||"",onChange:t=>y(e.id,{response:t.target.value}),placeholder:"I cannot help with that request.",rows:2,disabled:!t.enablePolicies})),"redirect"===e.action&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"Redirect To"),a.createElement("input",{type:"text",value:e.redirectTo||"",onChange:t=>y(e.id,{redirectTo:t.target.value}),placeholder:"Alternative response or agent",disabled:!t.enablePolicies})),"restrict"===e.action&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"Allowed Topics"),a.createElement("input",{type:"text",value:e.allowedTopics?.join(", ")||"",onChange:t=>y(e.id,{allowedTopics:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}),placeholder:"topic1, topic2, topic3",disabled:!t.enablePolicies}),a.createElement("small",null,"Comma-separated list of allowed topics"))))})),0===t.intentPolicies.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No intent policies configured. Click "Add Intent Policy" to create one.'))),"sop"===o&&a.createElement("div",{className:"config-card"},a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Standard Operating Procedures (SOPs)"),a.createElement("button",{className:"add-btn",onClick:g,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add SOP")),a.createElement("div",{className:"sources-list"},t.sopPolicies.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>N(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>N(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"SOP Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"sop"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16}))),!n&&a.createElement("div",{className:"agent-summary"},a.createElement("span",{className:"agent-summary-item"},e.steps.length," step",1!==e.steps.length?"s":""))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Description"),a.createElement("textarea",{value:e.description,onChange:t=>N(e.id,{description:t.target.value}),placeholder:"What this SOP is for...",rows:2,disabled:!t.enablePolicies})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Trigger Condition"),a.createElement("input",{type:"text",value:e.trigger,onChange:t=>N(e.id,{trigger:t.target.value}),placeholder:"When should this SOP be applied?",disabled:!t.enablePolicies}),a.createElement("small",null,"Condition or keywords that activate this SOP")),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Steps (in order)"),a.createElement("button",{className:"add-small-btn",onClick:()=>N(e.id,{steps:[...e.steps,""]}),disabled:!t.enablePolicies},a.createElement(l.FWt,{size:12}),"Add Step")),a.createElement("div",{className:"policies-list"},e.steps.map((n,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("span",{style:{fontWeight:"bold",marginRight:"8px"}},o+1,"."),a.createElement("textarea",{value:n,onChange:t=>{const n=[...e.steps];n[o]=t.target.value,N(e.id,{steps:n})},placeholder:"Describe this step...",rows:2,disabled:!t.enablePolicies}),a.createElement("button",{className:"remove-btn",onClick:()=>{const t=e.steps.filter((e,t)=>t!==o);N(e.id,{steps:t})},disabled:!t.enablePolicies},a.createElement(l.X,{size:14}))))))))})),0===t.sopPolicies.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No SOPs configured. Click "Add SOP" to create one.'))),"subagent"===o&&a.createElement("div",{className:"config-card"},a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Sub-Agent Policies"),a.createElement("button",{className:"add-btn",onClick:f,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add Sub-Agent Policy")),a.createElement("div",{className:"sources-list"},t.subAgentPolicies.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>w(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>w(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"Policy Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"subagent"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16})))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Sub-Agent Name"),a.createElement("input",{type:"text",value:e.subAgentName,onChange:t=>w(e.id,{subAgentName:t.target.value}),placeholder:"Which sub-agent does this apply to?",disabled:!t.enablePolicies})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Restrictions"),a.createElement("textarea",{value:e.restrictions,onChange:t=>w(e.id,{restrictions:t.target.value}),placeholder:"General restrictions for this sub-agent...",rows:2,disabled:!t.enablePolicies})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Constraints"),a.createElement("input",{type:"text",value:e.constraints.join(", "),onChange:t=>w(e.id,{constraints:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}),placeholder:"constraint1, constraint2, constraint3",disabled:!t.enablePolicies}),a.createElement("small",null,"Comma-separated behavioral constraints")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Allowed Tools"),a.createElement("input",{type:"text",value:e.allowedTools.join(", "),onChange:t=>w(e.id,{allowedTools:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}),placeholder:"tool1, tool2, tool3",disabled:!t.enablePolicies}),a.createElement("small",null,"Tools this sub-agent is allowed to use"))))})),0===t.subAgentPolicies.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No sub-agent policies configured. Click "Add Sub-Agent Policy" to create one.'))),"app"===o&&a.createElement("div",{className:"config-card"},a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Application Policies"),a.createElement("button",{className:"add-btn",onClick:h,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add App Policy")),a.createElement("div",{className:"sources-list"},t.appPolicies.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>k(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>k(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"Policy Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"app"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16})))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Application Name"),a.createElement("input",{type:"text",value:e.appName,onChange:t=>k(e.id,{appName:t.target.value}),placeholder:"Which app does this apply to?",disabled:!t.enablePolicies})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Instructions"),a.createElement("textarea",{value:e.instructions||"",onChange:t=>k(e.id,{instructions:t.target.value}),placeholder:"Specific instructions for how the agent should use this application...",disabled:!t.enablePolicies,rows:4,style:{resize:"vertical",fontFamily:"inherit"}}),a.createElement("small",null,"General guidance for using this app (separate from rules and permissions)")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Rules"),a.createElement("input",{type:"text",value:e.rules.join(", "),onChange:t=>k(e.id,{rules:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}),placeholder:"rule1, rule2, rule3",disabled:!t.enablePolicies}),a.createElement("small",null,"Comma-separated application rules")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Permissions"),a.createElement("input",{type:"text",value:e.permissions.join(", "),onChange:t=>k(e.id,{permissions:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}),placeholder:"read, write, execute",disabled:!t.enablePolicies}),a.createElement("small",null,"What the app is allowed to do"))))})),0===t.appPolicies.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No app policies configured. Click "Add App Policy" to create one.'))),("toolguards"===o||"toolenrichments"===o)&&a.createElement("div",{className:"config-card"},a.createElement("div",{className:"config-modal-tabs",style:{marginBottom:"16px"}},a.createElement("button",{className:"config-tab "+("guards"===s?"active":""),onClick:()=>i("guards")},"Tool Guards"),a.createElement("button",{className:"config-tab "+("enrichments"===s?"active":""),onClick:()=>i("enrichments")},"Tool Enrichment")),"guards"===s?a.createElement(a.Fragment,null,a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Tool Guards & Safety Rails"),a.createElement("button",{className:"add-btn",onClick:E,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add Tool Guard")),a.createElement("div",{className:"sources-list"},t.toolGuards.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>C(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>C(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"Guard Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"toolguards"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16}))),!n&&a.createElement("div",{className:"agent-summary"},a.createElement("span",{className:"agent-summary-item"},e.guardType.replace("_"," ")),a.createElement("span",{className:"agent-summary-item"},e.toolName||"No tool set"))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Tool Name"),a.createElement("input",{type:"text",value:e.toolName,onChange:t=>C(e.id,{toolName:t.target.value}),placeholder:"e.g., web_search, file_system, send_email",disabled:!t.enablePolicies}),a.createElement("small",null,"The specific tool this guard applies to")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Description"),a.createElement("textarea",{value:e.description,onChange:t=>C(e.id,{description:t.target.value}),placeholder:"What this guard does...",rows:2,disabled:!t.enablePolicies})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Guard Type"),a.createElement("select",{value:e.guardType,onChange:t=>{const n=t.target.value;let a={};switch(n){case"rate_limit":a={maxCallsPerMinute:10,maxCallsPerHour:100};break;case"input_validation":a={inputValidationRules:[]};break;case"output_filter":a={outputFilterPatterns:[]};break;case"approval_required":a={approvers:[],requireConfirmation:!0};break;case"time_restriction":a={allowedTimeRanges:[]}}C(e.id,{guardType:n,config:a})},disabled:!t.enablePolicies},a.createElement("option",{value:"rate_limit"},"Rate Limit"),a.createElement("option",{value:"input_validation"},"Input Validation"),a.createElement("option",{value:"output_filter"},"Output Filter"),a.createElement("option",{value:"approval_required"},"Approval Required"),a.createElement("option",{value:"time_restriction"},"Time Restriction")),a.createElement("small",null,"Type of safety mechanism")),"rate_limit"===e.guardType&&a.createElement("div",{className:"form-row"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Max Calls Per Minute"),a.createElement("input",{type:"number",value:e.config.maxCallsPerMinute||10,onChange:t=>C(e.id,{config:{...e.config,maxCallsPerMinute:parseInt(t.target.value)}}),min:"1",disabled:!t.enablePolicies})),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Max Calls Per Hour"),a.createElement("input",{type:"number",value:e.config.maxCallsPerHour||100,onChange:t=>C(e.id,{config:{...e.config,maxCallsPerHour:parseInt(t.target.value)}}),min:"1",disabled:!t.enablePolicies}))),"input_validation"===e.guardType&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"Validation Rules"),a.createElement("input",{type:"text",value:e.config.inputValidationRules?.join(", ")||"",onChange:t=>C(e.id,{config:{...e.config,inputValidationRules:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}}),placeholder:"no-urls, max-length-1000, alphanumeric-only",disabled:!t.enablePolicies}),a.createElement("small",null,"Rules to validate input parameters (comma-separated)")),"output_filter"===e.guardType&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"Filter Patterns"),a.createElement("input",{type:"text",value:e.config.outputFilterPatterns?.join(", ")||"",onChange:t=>C(e.id,{config:{...e.config,outputFilterPatterns:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}}),placeholder:"password, api-key, credit-card, ssn",disabled:!t.enablePolicies}),a.createElement("small",null,"Patterns to filter from tool output (comma-separated)")),"approval_required"===e.guardType&&a.createElement(a.Fragment,null,a.createElement("div",{className:"form-group"},a.createElement("label",null,"Approvers"),a.createElement("input",{type:"text",value:e.config.approvers?.join(", ")||"",onChange:t=>C(e.id,{config:{...e.config,approvers:t.target.value.split(",").map(e=>e.trim()).filter(e=>e)}}),placeholder:"admin, manager, supervisor",disabled:!t.enablePolicies}),a.createElement("small",null,"Who can approve tool execution (comma-separated)")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:e.config.requireConfirmation||!1,onChange:t=>C(e.id,{config:{...e.config,requireConfirmation:t.target.checked}}),disabled:!t.enablePolicies}),a.createElement("span",null,"Require Explicit Confirmation")),a.createElement("small",null,"User must manually confirm each tool call"))),"time_restriction"===e.guardType&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"Allowed Time Ranges"),a.createElement("input",{type:"text",value:e.config.allowedTimeRanges?.map(e=>`${e.start}-${e.end}`).join(", ")||"",onChange:t=>{const n=t.target.value.split(",").map(e=>{const[t,n]=e.trim().split("-");return t&&n?{start:t.trim(),end:n.trim()}:null}).filter(e=>null!==e);C(e.id,{config:{...e.config,allowedTimeRanges:n}})},placeholder:"09:00-17:00, 14:00-18:00",disabled:!t.enablePolicies}),a.createElement("small",null,"Time ranges when tool can be used (HH:MM-HH:MM, comma-separated)"))))})),0===t.toolGuards.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No tool guards configured. Click "Add Tool Guard" to create one.'))):a.createElement(a.Fragment,null,a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Tool Enrichment & Custom Instructions"),a.createElement("button",{className:"add-btn",onClick:x,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add Tool Enrichment")),a.createElement("div",{className:"sources-list"},t.toolEnrichments.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>S(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>S(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"Enrichment Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"toolenrichments"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16}))),!n&&a.createElement("div",{className:"agent-summary"},a.createElement("span",{className:"agent-summary-item"},e.toolName||"No tool set"),a.createElement("span",{className:"agent-summary-item"},e.customInstructions.length," instruction",1!==e.customInstructions.length?"s":""))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Tool Name"),a.createElement("input",{type:"text",value:e.toolName,onChange:t=>S(e.id,{toolName:t.target.value}),placeholder:"e.g., web_search, file_system, send_email",disabled:!t.enablePolicies}),a.createElement("small",null,"The specific tool this enrichment applies to")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Pre-Execution Prompt"),a.createElement("textarea",{value:e.preExecutionPrompt||"",onChange:t=>S(e.id,{preExecutionPrompt:t.target.value}),placeholder:"Instructions to consider before using this tool...",rows:3,disabled:!t.enablePolicies}),a.createElement("small",null,"Guidance provided to the agent before executing the tool")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Post-Processing Rules"),a.createElement("textarea",{value:e.postProcessingRules||"",onChange:t=>S(e.id,{postProcessingRules:t.target.value}),placeholder:"How to process or interpret the tool's output...",rows:3,disabled:!t.enablePolicies}),a.createElement("small",null,"Instructions for handling the tool's response")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Context Hints"),a.createElement("textarea",{value:e.contextHints||"",onChange:t=>S(e.id,{contextHints:t.target.value}),placeholder:"When this tool is most useful, what context to consider...",rows:2,disabled:!t.enablePolicies}),a.createElement("small",null,"Contextual information about when and how to use this tool")),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Custom Instructions"),a.createElement("button",{className:"add-small-btn",onClick:()=>S(e.id,{customInstructions:[...e.customInstructions,""]}),disabled:!t.enablePolicies},a.createElement(l.FWt,{size:12}),"Add Instruction")),a.createElement("small",null,"Specific instructions for using this tool effectively"),a.createElement("div",{className:"policies-list"},e.customInstructions.map((n,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("textarea",{value:n,onChange:t=>{const n=[...e.customInstructions];n[o]=t.target.value,S(e.id,{customInstructions:n})},placeholder:"e.g., Always verify the search query is relevant before calling",rows:2,disabled:!t.enablePolicies}),a.createElement("button",{className:"remove-btn",onClick:()=>{const t=e.customInstructions.filter((e,t)=>t!==o);S(e.id,{customInstructions:t})},disabled:!t.enablePolicies},a.createElement(l.X,{size:14})))))),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Example Usages"),a.createElement("button",{className:"add-small-btn",onClick:()=>S(e.id,{exampleUsages:[...e.exampleUsages,""]}),disabled:!t.enablePolicies},a.createElement(l.FWt,{size:12}),"Add Example")),a.createElement("small",null,"Example scenarios or use cases for this tool"),a.createElement("div",{className:"policies-list"},e.exampleUsages.map((n,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("textarea",{value:n,onChange:t=>{const n=[...e.exampleUsages];n[o]=t.target.value,S(e.id,{exampleUsages:n})},placeholder:"e.g., Use when user asks about current weather in a specific location",rows:2,disabled:!t.enablePolicies}),a.createElement("button",{className:"remove-btn",onClick:()=>{const t=e.exampleUsages.filter((e,t)=>t!==o);S(e.id,{exampleUsages:t})},disabled:!t.enablePolicies},a.createElement(l.X,{size:14})))))),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Best Practices"),a.createElement("button",{className:"add-small-btn",onClick:()=>S(e.id,{bestPractices:[...e.bestPractices,""]}),disabled:!t.enablePolicies},a.createElement(l.FWt,{size:12}),"Add Practice")),a.createElement("small",null,"Best practices and tips for optimal tool usage"),a.createElement("div",{className:"policies-list"},e.bestPractices.map((n,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("input",{type:"text",value:n,onChange:t=>{const n=[...e.bestPractices];n[o]=t.target.value,S(e.id,{bestPractices:n})},placeholder:"e.g., Limit search results to top 5 for faster processing",disabled:!t.enablePolicies}),a.createElement("button",{className:"remove-btn",onClick:()=>{const t=e.bestPractices.filter((e,t)=>t!==o);S(e.id,{bestPractices:t})},disabled:!t.enablePolicies},a.createElement(l.X,{size:14}))))))))})),0===t.toolEnrichments.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No tool enrichments configured. Click "Add Tool Enrichment" to create one.')))),"answer"===o&&a.createElement("div",{className:"config-card"},a.createElement("div",{className:"section-header"},a.createElement("h3",null,"Answer & Response Policies"),a.createElement("button",{className:"add-btn",onClick:v,disabled:!t.enablePolicies},a.createElement(l.FWt,{size:16}),"Add Answer Policy")),a.createElement("div",{className:"sources-list"},t.answerPolicies.map(e=>{const n=c===e.id;return a.createElement("div",{key:e.id,className:"agent-config-card"},a.createElement("div",{className:"agent-config-header"},a.createElement("div",{className:"agent-config-top"},a.createElement("input",{type:"checkbox",checked:e.enabled,onChange:t=>P(e.id,{enabled:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("input",{type:"text",value:e.name,onChange:t=>P(e.id,{name:t.target.value}),className:"agent-config-name",placeholder:"Policy Name",disabled:!t.enablePolicies}),a.createElement("button",{className:"expand-btn",onClick:()=>m(n?null:e.id)},n?a.createElement(l.rXn,{size:16}):a.createElement(l.yQN,{size:16})),a.createElement("button",{className:"delete-btn",onClick:()=>A(e.id,"answer"),disabled:!t.enablePolicies},a.createElement(l.TBR,{size:16}))),!n&&a.createElement("div",{className:"agent-summary"},a.createElement("span",{className:"agent-summary-item"},e.responseFormat),a.createElement("span",{className:"agent-summary-item"},e.tone," tone"))),n&&a.createElement("div",{className:"agent-config-details"},a.createElement("div",{className:"form-row"},a.createElement("div",{className:"form-group"},a.createElement("label",null,"Response Format"),a.createElement("select",{value:e.responseFormat,onChange:t=>P(e.id,{responseFormat:t.target.value}),disabled:!t.enablePolicies},a.createElement("option",{value:"natural"},"Natural Language"),a.createElement("option",{value:"json"},"JSON"),a.createElement("option",{value:"structured"},"Structured"),a.createElement("option",{value:"markdown"},"Markdown")),a.createElement("small",null,"How responses should be formatted")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Response Tone"),a.createElement("select",{value:e.tone,onChange:t=>P(e.id,{tone:t.target.value}),disabled:!t.enablePolicies},a.createElement("option",{value:"professional"},"Professional"),a.createElement("option",{value:"casual"},"Casual"),a.createElement("option",{value:"technical"},"Technical"),a.createElement("option",{value:"friendly"},"Friendly"),a.createElement("option",{value:"formal"},"Formal")),a.createElement("small",null,"Communication style for responses"))),"json"===e.responseFormat&&a.createElement("div",{className:"form-group"},a.createElement("label",null,"JSON Schema"),a.createElement("textarea",{value:e.jsonSchema||"",onChange:t=>P(e.id,{jsonSchema:t.target.value}),placeholder:'{\n "type": "object",\n "properties": {\n "answer": { "type": "string" }\n }\n}',rows:6,disabled:!t.enablePolicies,style:{fontFamily:"monospace",fontSize:"12px"}}),a.createElement("small",null,"JSON schema that responses must adhere to")),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Max Response Length"),a.createElement("input",{type:"number",value:e.maxResponseLength||"",onChange:t=>P(e.id,{maxResponseLength:t.target.value?parseInt(t.target.value):void 0}),placeholder:"e.g., 500",min:"1",disabled:!t.enablePolicies}),a.createElement("small",null,"Maximum number of characters (leave empty for no limit)")),a.createElement("div",{className:"form-row"},a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:e.includeConfidence,onChange:t=>P(e.id,{includeConfidence:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("span",null,"Include Confidence Score")),a.createElement("small",null,"Add confidence level to responses")),a.createElement("div",{className:"form-group"},a.createElement("label",{className:"checkbox-label"},a.createElement("input",{type:"checkbox",checked:e.includeSources,onChange:t=>P(e.id,{includeSources:t.target.checked}),disabled:!t.enablePolicies}),a.createElement("span",null,"Include Sources")),a.createElement("small",null,"Cite information sources in responses"))),a.createElement("div",{className:"form-group"},a.createElement("label",null,"Required Disclaimer"),a.createElement("textarea",{value:e.requiredDisclaimer||"",onChange:t=>P(e.id,{requiredDisclaimer:t.target.value}),placeholder:"Optional disclaimer to append to all responses...",rows:2,disabled:!t.enablePolicies}),a.createElement("small",null,"Text automatically added to every response")),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Custom Instructions"),a.createElement("button",{className:"add-small-btn",onClick:()=>P(e.id,{customInstructions:[...e.customInstructions,""]}),disabled:!t.enablePolicies},a.createElement(l.FWt,{size:12}),"Add Instruction")),a.createElement("small",null,"Additional rules the agent must follow when responding"),a.createElement("div",{className:"policies-list"},e.customInstructions.map((n,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("input",{type:"text",value:n,onChange:t=>{const n=[...e.customInstructions];n[o]=t.target.value,P(e.id,{customInstructions:n})},placeholder:"e.g., Always include a summary at the start",disabled:!t.enablePolicies}),a.createElement("button",{className:"remove-btn",onClick:()=>{const t=e.customInstructions.filter((e,t)=>t!==o);P(e.id,{customInstructions:t})},disabled:!t.enablePolicies},a.createElement(l.X,{size:14})))))),a.createElement("div",{className:"form-group"},a.createElement("div",{className:"form-group-header"},a.createElement("label",null,"Forbidden Phrases"),a.createElement("button",{className:"add-small-btn",onClick:()=>P(e.id,{forbiddenPhrases:[...e.forbiddenPhrases,""]}),disabled:!t.enablePolicies},a.createElement(l.FWt,{size:12}),"Add Phrase")),a.createElement("small",null,"Phrases that must not appear in responses"),a.createElement("div",{className:"policies-list"},e.forbiddenPhrases.map((n,o)=>a.createElement("div",{key:o,className:"policy-item"},a.createElement("input",{type:"text",value:n,onChange:t=>{const n=[...e.forbiddenPhrases];n[o]=t.target.value,P(e.id,{forbiddenPhrases:n})},placeholder:"e.g., I'm not sure, I don't know",disabled:!t.enablePolicies}),a.createElement("button",{className:"remove-btn",onClick:()=>{const t=e.forbiddenPhrases.filter((e,t)=>t!==o);P(e.id,{forbiddenPhrases:t})},disabled:!t.enablePolicies},a.createElement(l.X,{size:14}))))))))})),0===t.answerPolicies.length&&a.createElement("div",{className:"empty-state"},a.createElement("p",null,'No answer policies configured. Click "Add Answer Policy" to create one.')))),a.createElement("div",{className:"config-modal-footer"},a.createElement("button",{className:"cancel-btn",onClick:e},"Cancel"),a.createElement("button",{className:`save-btn ${d}`,onClick:async()=>{u("saving");try{(await fetch("/api/config/policies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).ok?(u("success"),setTimeout(()=>u("idle"),2e3)):(u("error"),setTimeout(()=>u("idle"),2e3))}catch(e){u("error"),setTimeout(()=>u("idle"),2e3)}},disabled:"saving"===d},a.createElement(l.eMP,{size:16}),"idle"===d&&"Save Changes","saving"===d&&"Saving...","success"===d&&"Saved!","error"===d&&"Error!"))))}},83809:function(e,t,n){var a=n(21598),l=n.n(a),o=n(2607),r=n.n(o)()(l());r.push([e.id,".file-autocomplete {\n position: fixed;\n background: white;\n border: 1px solid #e5e7eb;\n border-radius: 8px;\n box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);\n z-index: 99999;\n min-width: 320px;\n max-width: 500px;\n animation: slideUpFade 0.2s ease;\n pointer-events: auto;\n}\n\n@keyframes slideUpFade {\n from {\n opacity: 0;\n transform: translateY(10px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.file-autocomplete-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 8px 12px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n font-size: 11px;\n font-weight: 600;\n border-radius: 8px 8px 0 0;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.file-count {\n background: rgba(255, 255, 255, 0.2);\n padding: 2px 6px;\n border-radius: 10px;\n font-size: 10px;\n}\n\n.file-autocomplete-list {\n max-height: 400px;\n overflow-y: auto;\n padding: 4px;\n}\n\n.file-autocomplete-item {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 8px 10px;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.15s ease;\n margin-bottom: 2px;\n}\n\n.file-autocomplete-item:hover,\n.file-autocomplete-item.selected {\n background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);\n}\n\n.file-autocomplete-item.selected {\n border-left: 3px solid #667eea;\n padding-left: 7px;\n}\n\n.file-icon {\n flex-shrink: 0;\n color: #667eea;\n}\n\n.file-info {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n}\n\n.file-name {\n font-size: 13px;\n font-weight: 500;\n color: #1f2937;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.file-path {\n font-size: 11px;\n color: #6b7280;\n font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.file-autocomplete-footer {\n padding: 6px 12px;\n background: #f9fafb;\n border-top: 1px solid #e5e7eb;\n border-radius: 0 0 8px 8px;\n}\n\n.hint {\n font-size: 10px;\n color: #9ca3af;\n font-style: italic;\n}\n\n.file-autocomplete-list::-webkit-scrollbar {\n width: 6px;\n}\n\n.file-autocomplete-list::-webkit-scrollbar-track {\n background: transparent;\n}\n\n.file-autocomplete-list::-webkit-scrollbar-thumb {\n background: #cbd5e1;\n border-radius: 3px;\n}\n\n.file-autocomplete-list::-webkit-scrollbar-thumb:hover {\n background: #94a3b8;\n}\n\n",""]),t.A=r},84870:function(e,t,n){var a=n(21598),l=n.n(a),o=n(2607),r=n.n(o)()(l());r.push([e.id,'.debug-panel-container {\n position: fixed;\n bottom: 20px;\n right: 100px;\n z-index: 1000;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n}\n\n.debug-panel-toggle {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n border: none;\n border-radius: 8px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);\n transition: all 0.2s ease;\n}\n\n.debug-panel-toggle:hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n}\n\n.debug-panel-content {\n position: absolute;\n bottom: 50px;\n right: 0;\n width: 500px;\n max-height: 600px;\n background: white;\n border-radius: 12px;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n overflow: hidden;\n display: flex;\n flex-direction: column;\n}\n\n.debug-panel-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n}\n\n.debug-panel-header h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n}\n\n.debug-panel-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.debug-action-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n background: rgba(255, 255, 255, 0.2);\n border: none;\n border-radius: 6px;\n color: white;\n cursor: pointer;\n transition: all 0.2s ease;\n}\n\n.debug-action-btn:hover:not(:disabled) {\n background: rgba(255, 255, 255, 0.3);\n}\n\n.debug-action-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.debug-action-btn .spinning {\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n.debug-auto-refresh {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 12px;\n cursor: pointer;\n}\n\n.debug-auto-refresh input[type="checkbox"] {\n cursor: pointer;\n}\n\n.debug-section {\n padding: 16px;\n border-bottom: 1px solid #e5e7eb;\n}\n\n.debug-section:last-child {\n border-bottom: none;\n}\n\n.debug-section-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.debug-section-header strong {\n font-size: 14px;\n font-weight: 600;\n color: #374151;\n}\n\n.debug-copy-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n background: #f3f4f6;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n transition: all 0.2s ease;\n color: #6b7280;\n}\n\n.debug-copy-btn:hover {\n background: #e5e7eb;\n color: #374151;\n}\n\n.debug-thread-id {\n font-family: "Monaco", "Menlo", "Courier New", monospace;\n font-size: 12px;\n padding: 10px;\n background: #f9fafb;\n border: 1px solid #e5e7eb;\n border-radius: 6px;\n word-break: break-all;\n color: #111827;\n}\n\n.debug-state-content {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.debug-state-item {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n\n.debug-state-item.debug-variables {\n margin-top: 8px;\n}\n\n.debug-label {\n font-size: 12px;\n font-weight: 600;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.debug-value {\n font-size: 13px;\n color: #111827;\n word-break: break-word;\n}\n\n.debug-json {\n font-family: "Monaco", "Menlo", "Courier New", monospace;\n font-size: 11px;\n padding: 12px;\n background: #f9fafb;\n border: 1px solid #e5e7eb;\n border-radius: 6px;\n overflow-x: auto;\n max-height: 300px;\n overflow-y: auto;\n margin: 0;\n color: #111827;\n line-height: 1.5;\n}\n\n.debug-loading {\n padding: 12px;\n text-align: center;\n color: #6b7280;\n font-size: 13px;\n}\n\n.debug-error {\n padding: 12px;\n background: #fef2f2;\n border: 1px solid #fecaca;\n border-radius: 6px;\n color: #dc2626;\n font-size: 13px;\n}\n\n',""]),t.A=r},90313:function(e,t,n){var a=n(21598),l=n.n(a),o=n(2607),r=n.n(o)()(l());r.push([e.id,".tour-overly {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.6);\n z-index: 9998;\n animation: tourFadeIn 0.3s ease;\n}\n\n@keyframes tourFadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.tour-highlight {\n position: fixed;\n background: transparent;\n border: 3px solid #667eea;\n border-radius: 8px;\n box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 20px rgba(102, 126, 234, 0.8);\n z-index: 9999;\n transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n pointer-events: none;\n animation: tourPulse 2s ease-in-out infinite;\n}\n\n@keyframes tourPulse {\n 0%, 100% {\n border-color: #667eea;\n box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 20px rgba(102, 126, 234, 0.8);\n }\n 50% {\n border-color: #764ba2;\n box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6), 0 0 30px rgba(118, 75, 162, 1);\n }\n}\n\n.tour-tooltip {\n position: fixed;\n width: 320px;\n background: white;\n border-radius: 12px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n z-index: 10000;\n animation: tourSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n overflow: hidden;\n}\n\n@keyframes tourSlideIn {\n from {\n opacity: 0;\n transform: scale(0.9) translateY(20px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n}\n\n.tour-tooltip-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 16px;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n}\n\n.tour-step-counter {\n font-size: 12px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.tour-close-btn {\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 28px;\n height: 28px;\n border-radius: 6px;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s;\n}\n\n.tour-close-btn:hover {\n background: rgba(255, 255, 255, 0.3);\n transform: scale(1.05);\n}\n\n.tour-tooltip-content {\n padding: 20px;\n}\n\n.tour-tooltip-title {\n font-size: 18px;\n font-weight: 700;\n color: #1e293b;\n margin: 0 0 12px 0;\n line-height: 1.3;\n}\n\n.tour-tooltip-text {\n font-size: 14px;\n color: #64748b;\n line-height: 1.6;\n margin: 0;\n}\n\n.tour-tooltip-footer {\n padding: 0 16px 16px;\n}\n\n.tour-progress-bar {\n height: 4px;\n background: #e2e8f0;\n border-radius: 2px;\n overflow: hidden;\n margin-bottom: 12px;\n}\n\n.tour-progress-fill {\n height: 100%;\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n border-radius: 2px;\n transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.tour-tooltip-actions {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n}\n\n.tour-navigation {\n display: flex;\n gap: 8px;\n}\n\n.tour-btn {\n padding: 8px 16px;\n border: none;\n border-radius: 8px;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n gap: 6px;\n font-family: inherit;\n}\n\n.tour-btn-primary {\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\n box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);\n}\n\n.tour-btn-primary:hover {\n transform: translateY(-2px);\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n}\n\n.tour-btn-primary:active {\n transform: translateY(0);\n}\n\n.tour-btn-secondary {\n background: transparent;\n color: #64748b;\n border: 1px solid #e2e8f0;\n}\n\n.tour-btn-secondary:hover {\n background: #f8fafc;\n border-color: #cbd5e1;\n color: #475569;\n}\n\n.tour-btn-icon {\n padding: 8px;\n background: #f8fafc;\n color: #64748b;\n border: 1px solid #e2e8f0;\n}\n\n.tour-btn-icon:hover:not(:disabled) {\n background: #f1f5f9;\n border-color: #cbd5e1;\n color: #475569;\n}\n\n.tour-btn-icon:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.tour-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n@media (max-width: 640px) {\n .tour-tooltip {\n width: calc(100% - 32px);\n max-width: 320px;\n left: 16px !important;\n right: 16px;\n }\n\n .tour-tooltip-content {\n padding: 16px;\n }\n\n .tour-tooltip-title {\n font-size: 16px;\n }\n\n .tour-tooltip-text {\n font-size: 13px;\n }\n\n .tour-btn {\n padding: 6px 12px;\n font-size: 12px;\n }\n}\n\n",""]),t.A=r}}]); |