admin08077/Githubgemini
0
1import{r as s,j as e}from"./react-CIdJ77ke.js";import{as as u,au as f,S as b,ae as j,L as g,M as y}from"./index-CX7Qxd1D.js";import"./@braintree-DzxiOROe.js";import"./react-dom-R9L8nDNe.js";import"./scheduler-CoSDG3-6.js";import"./@google-CcUHq7Ay.js";import"./idb-Dob3nYDb.js";import"./marked-BrGMJkBT.js";import"./mermaid-KwKZWwy0.js";import"./dayjs-CeEF-NGT.js";import"./d3-transition-CiCB8KJE.js";import"./d3-timer-DdKHrDhs.js";import"./d3-dispatch-kxCwF96_.js";import"./d3-interpolate-CtIaNujU.js";import"./d3-color-amxIadob.js";import"./d3-selection-C52G7wmG.js";import"./d3-ease-DRPgKoYJ.js";import"./d3-zoom-BYoC3mS3.js";import"./dompurify-J5RlrwSC.js";import"./dagre-d3-es-CTpFWynZ.js";import"./lodash-es-Dt6r0yiR.js";import"./d3-shape-CX8xTzfR.js";import"./d3-path-CimkQT29.js";import"./d3-fetch-BOsq7VnW.js";import"./khroma-DUX6PT6k.js";import"./uuid-DhYbOkY1.js";import"./d3-scale-DRZz3QW5.js";import"./internmap-BkD7Hj8s.js";import"./d3-array-DGRYoJHh.js";import"./d3-format-CzD4bSOQ.js";import"./d3-time-format-CUNN4Ell.js";import"./d3-time-6cSPyVSY.js";import"./d3-axis-DSWTncID.js";import"./elkjs-oKFFZvz7.js";import"./cytoscape-DtBltrT8.js";import"./cytoscape-cose-bilkent-Cgr1thlj.js";import"./cose-base-CwCxnKwh.js";import"./layout-base-CMXQqlmj.js";import"./d3-sankey-DgqkLiUE.js";import"./d3-scale-chromatic-B-NsZVaP.js";import"./ts-dedent-DrFu-skq.js";import"./stylis-D5iaQeiq.js";import"./mdast-util-from-markdown-CLAsVoWb.js";import"./micromark-CTBPIv-_.js";import"./micromark-util-combine-extensions-Bka6Sc1c.js";import"./micromark-util-chunked-DrRIdSP-.js";import"./micromark-factory-space-x2vfxbz5.js";import"./micromark-util-character-Bcm1tP9o.js";import"./micromark-core-commonmark-AH8VCgT7.js";import"./micromark-util-classify-character-Cq7Fg3xE.js";import"./micromark-util-resolve-all-PQCKh0dx.js";import"./decode-named-character-reference-C3-224fz.js";import"./micromark-util-subtokenize-QwsxNXk2.js";import"./micromark-factory-destination-CypD_wgM.js";import"./micromark-factory-label-CRHH4ZHP.js";import"./micromark-factory-title-B7kCBvC9.js";import"./micromark-factory-whitespace-B322EA6O.js";import"./micromark-util-normalize-identifier-C9ANKk3v.js";import"./micromark-util-html-tag-name-DbKNfynz.js";import"./micromark-util-decode-numeric-character-reference-DRnCnno4.js";import"./micromark-util-decode-string-DJl8Y_PO.js";import"./unist-util-stringify-position-Ch_qCilz.js";import"./mdast-util-to-string-C_aolqmU.js";import"./jszip-CFFhfFtd.js";import"./octokit-B6bKu3NB.js";import"./@octokit-MBEWYTsi.js";import"./bottleneck-D_vuF9V7.js";import"./universal-user-agent-CLgqIJsR.js";import"./before-after-hook-y8XtM9xW.js";import"./fast-content-type-parse-3SwieiST.js";const t={from:"Alice <alice@example.com>",to:"Me <me@example.com>",subject:"Project Update & Question",body:`Hey,2 3Just wanted to give you a quick update. The new user authentication flow is complete and pushed to the staging server.4 5I had a question about the next task regarding the database migration. The ticket says we need to migrate the 'users' table, but it's not clear on the required schema changes. Should I just add the new 'last_login' column or are there other modifications needed?6 7Let me know when you have a chance.8 9Thanks,10Alice`},Oe=()=>{const[m,i]=s.useState(!1),[d,o]=s.useState(""),[a,l]=s.useState(!1),c=s.useCallback(async()=>{l(!0),o(""),i(!0);try{const r=`Generate a professional and friendly reply to the following email. Acknowledge the update and answer the question by stating that only the 'last_login' column (as a DATETIME) is needed for now.11 12EMAIL:13${t.body}`,x=u(r,"You are a helpful assistant writing a professional email reply.",.7);let n="";for await(const h of x)n+=h,o(n)}catch(r){o(`Error: ${r instanceof Error?r.message:"Could not generate reply."}`)}finally{l(!1)}},[]),p=()=>e.jsx("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm flex justify-center items-center p-4 z-20",children:e.jsxs("div",{className:"w-full max-w-2xl h-[70vh] bg-surface rounded-lg shadow-2xl flex flex-col animate-pop-in",children:[e.jsxs("header",{className:"flex justify-between items-center p-3 bg-gray-100 dark:bg-slate-700 rounded-t-lg",children:[e.jsx("h3",{className:"font-semibold text-sm",children:"New Message"}),e.jsx("button",{onClick:()=>i(!1),children:e.jsx(j,{})})]}),e.jsx("div",{className:"p-3 text-sm border-b border-border",children:e.jsxs("p",{children:[e.jsx("span",{className:"text-text-secondary",children:"To:"})," ",t.from]})}),e.jsx("div",{className:"p-3 text-sm border-b border-border",children:e.jsxs("p",{children:[e.jsx("span",{className:"text-text-secondary",children:"Subject:"})," Re: ",t.subject]})}),e.jsx("div",{className:"flex-grow p-3 overflow-y-auto",children:a?e.jsx("div",{className:"flex justify-center items-center h-full",children:e.jsx(g,{})}):e.jsx(y,{content:d})}),e.jsx("footer",{className:"p-3 border-t border-border",children:e.jsx("button",{className:"btn-primary px-6 py-2",children:"Send"})})]})});return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center",children:[e.jsx(f,{}),e.jsx("span",{className:"ml-3",children:"Gmail Add-on Simulator"})]}),e.jsx("p",{className:"text-text-secondary mt-1",children:"A simulation of how contextual add-on scopes would work inside Gmail."})]}),e.jsxs("div",{className:"relative flex-grow bg-surface border-2 border-dashed border-border rounded-lg p-6 flex items-center justify-center",children:[m&&e.jsx(p,{}),e.jsxs("div",{className:"w-full max-w-4xl h-full bg-white dark:bg-slate-800 rounded-xl shadow-2xl flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex-shrink-0 p-4 border-b border-border",children:[e.jsx("h2",{className:"text-xl font-bold",children:t.subject}),e.jsxs("div",{className:"flex items-center gap-2 text-sm mt-2",children:[e.jsx("img",{src:"https://avatar.vercel.sh/alice",alt:"Alice",className:"w-8 h-8 rounded-full"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:t.from.split("<")[0].trim()}),e.jsxs("p",{className:"text-text-secondary text-xs",children:["to ",t.to.split("<")[0].trim()]})]})]})]}),e.jsx("div",{className:"flex-grow p-4 overflow-y-auto",children:e.jsx("pre",{className:"whitespace-pre-wrap font-sans text-sm",children:t.body})}),e.jsxs("div",{className:"flex-shrink-0 p-4 border-t border-border bg-gray-50 dark:bg-slate-900/50 flex justify-between items-center",children:[e.jsxs("div",{className:"text-xs text-text-secondary",children:[e.jsx("strong",{children:"Disclaimer:"})," This is a simulation. The requested scopes allow this app to read the current email and compose replies ",e.jsx("strong",{children:"if it were running inside Gmail."})]}),e.jsxs("button",{onClick:c,disabled:a,className:"btn-primary flex items-center justify-center gap-2 px-4 py-2",children:[e.jsx(b,{})," AI Reply"]})]})]})]})]})};export{Oe as GmailAddonSimulator};14//# sourceMappingURL=GmailAddonSimulator-Bt9t_SwG.js.map15 