PageSourceSearch

https://surfacetech.ai/build/assets/StudioEmail-DR0YhkqQ.js

js surfacetech.ai collected 2026-10-05 12:58:18 UTC 9,038 bytes, 1 lines download raw bytes

1import{t as E,j as e,H as Be,A as De,r as Fe,B as T,I as n,T as Le,k as Re}from"./app-CZw4zvFM.js";import{u as w,p as d,T as Me,E as He}from"./StudioEmailDrawer-HR1cCMjZ.js";import{L as b}from"./index-CbEOvlCk.js";import{d as k}from"./dayjs.min-CEkUtFVV.js";import{r as Pe}from"./relativeTime-C2xL4j7D.js";import{F as h}from"./index-Tmleijx2.js";import{S as Ne}from"./index-BQJfYhUi.js";import{A as _e}from"./index-xTTpnXCd.js";import{I as qe}from"./index-75SXKuUs.js";import{D as Ge}from"./index-Cl-sUtUk.js";import{C as Oe}from"./index-BlW28zjE.js";/* empty css            */import"./react-BuyrQXxp.js";import"./CreateContactModal-CaAn_AJ5.js";import"./CheckCircleOutlined-Dz7n_P1a.js";import"./index-GHo0gMzn.js";import"./LinkOutlined-DU33UXfU.js";import"./PlusOutlined-CcDZkb5g.js";import"./index-B8SovKPY.js";import"./Overflow-uTMTJwUS.js";import"./index-DUZSKLIY.js";import"./move-1krGBtlZ.js";import"./DownOutlined-CTtnvDxu.js";import"./SearchOutlined-C9JuSteG.js";import"./UserOutlined-CdLdmkU7.js";import"./index-Fs5xZlrf.js";import"./index-C2ThPjwV.js";import"./index-CvHaq7bp.js";import"./Drawer-CiwctyAV.js";import"./FileManagerPickerModal-BAmgses2.js";import"./index-C0zODkqI.js";import"./dropdown-BPhbloOu.js";import"./EllipsisOutlined-B7OjL6qX.js";import"./index-ZUebQvBO.js";import"./useBubbleLock-BClqePJl.js";import"./index-6ZORLKDC.js";import"./index-DK3mN3jy.js";import"./index-D7FWo8t1.js";import"./Addon-DOudmed9.js";import"./FolderOpenOutlined-DvOf-kRu.js";import"./index-C7yKKq-w.js";import"./createPopper-rl6qdiaC.js";import"./index-m7vRUi73.js";import"./useForm-D-jYjTVi.js";import"./row-M-1fLFv3.js";import"./useBreakpoint-PA8SwT4Z.js";import"./callSuper-Cu6FRejo.js";import"./Input-DSSJiXAe.js";import"./EyeOutlined-CvZlSzKJ.js";const{Content:We}=b;function Ke({title:s,children:l}){const{token:m}=E.useToken();return e.jsxs(b,{style:{minHeight:"100vh",backgroundColor:m.colorBgContainer},children:[s&&e.jsx(Be,{title:s}),e.jsx(We,{style:{minHeight:"100vh",paddingTop:"env(safe-area-inset-top)",paddingBottom:"env(safe-area-inset-bottom)",paddingLeft:"env(safe-area-inset-left)",paddingRight:"env(safe-area-inset-right)"},children:l})]})}k.extend(Pe);const{Text:i}=Le,{TextArea:Qe}=qe;function Ot({existingDraftUuid:s,templateId:l,conversationId:m,messageId:x,toEmail:z,toName:A}){const{token:o}=E.useToken(),{message:B}=De.useApp(),[p]=h.useForm(),{step:a,isLoading:D,isLoadingTemplates:F,isLoadingDrafts:L,isSaving:R,isSending:M,isScheduling:H,isRegenerating:P,isGenerating:y,isAutoSaving:N,templates:_,selectedTemplate:c,email:g,drafts:r,lastSavedAt:q,previewKey:G,previewHtml:O,previewError:W,activeSectionId:K,activeSectionType:Q,activeSectionPosition:V,activeSectionPlacement:$,hoveredSectionId:J,hoveredSectionType:U,hoveredSectionRect:X,isInlineEditing:Y,inlineEditingSectionId:Z,inlineEditingSectionData:ee,inlineEditingSectionRect:te,error:u,aiMessage:ie,loadTemplates:oe,loadDrafts:ne,loadDraft:f,selectTemplate:v,createDraft:se,updateFields:re,discardDraft:le,setActiveSection:ae,clearActiveSection:ce,setHoveredSection:de,startInlineEdit:me,cancelInlineEdit:pe,saveInlineEdit:ye,autoSaveInlineEdit:ge,setStep:S,regenerateSection:ue,sendEmail:he,scheduleEmail:xe,cancelSchedule:fe,clearError:j,clearAiMessage:ve,setCustomInstructions:Se,loadPreview:je}=w();Fe.useEffect(()=>{(async()=>{if(s)await f(s),S("compose");else if(await Promise.all([oe(),ne()]),l){const I=w.getState().templates.find(Ae=>Ae.id===Number(l));I&&v(I)}d("composer:ready",{})})()},[]);const C=c!==null,Ce=async()=>{if(c)try{await p.validateFields();const t=p.getFieldsValue();await se({templateId:c.id,toEmail:z||"",toName:A||"",subject:"",customInstructions:t.custom_instructions,conversationId:m||void 0,messageId:x?Number(x):void 0})}catch{}},Ie=t=>{t&&v(t)},Te=async t=>{await f(t),S("compose")},we=async()=>{await le(),B.success("Email discarded")},Ee=()=>{a==="compose"&&g?d("composer:close-requested",{}):d("composer:close-requested",{})},be=a==="template-select"?0:1,ke=()=>e.jsxs("div",{style:{padding:16,overflow:"auto",flex:1},children:[u&&e.jsx(_e,{type:"error",title:u,closable:!0,onClose:j,style:{marginBottom:16}}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[e.jsx(n,{name:"FileText",size:16,style:{color:o.colorText}}),e.jsx(i,{strong:!0,style:{fontSize:14},children:"Start from Template"})]}),e.jsx(Me,{templates:_,loading:F,selectedId:c?.id||null,onSelect:Ie,isMobile:!0})]}),e.jsx("div",{style:{marginBottom:16},children:e.jsx(h,{form:p,layout:"vertical",size:"large",children:e.jsx(h.Item,{name:"custom_instructions",label:e.jsx("span",{style:{fontSize:13,fontWeight:500},children:"Custom Instructions (Optional)"}),extra:e.jsx("span",{style:{fontSize:12,color:o.colorTextSecondary},children:"Guide the tone and style for AI content"}),style:{marginBottom:0},children:e.jsx(Qe,{rows:2,maxLength:1e3,showCount:!0,placeholder:"E.g., Keep a professional tone...",onChange:t=>Se(t.target.value)})})})}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsx(T,{type:"primary",block:!0,size:"large",icon:e.jsx(n,{name:y?"Sparkles":"ChevronRight",size:16}),onClick:Ce,loading:D,disabled:!C,style:{height:48,fontSize:15,fontWeight:500},children:y?"Creating your email with AI...":C?"Create Email":"Select a Template to Continue"}),y&&e.jsx(i,{type:"secondary",style:{display:"block",textAlign:"center",marginTop:8,fontSize:13},children:"AI is writing your email content..."})]}),e.jsx(Ge,{style:{margin:"0 0 16px 0"},children:e.jsx(i,{type:"secondary",style:{fontSize:12},children:"or"})}),e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(n,{name:"Pencil",size:16,style:{color:o.colorText}}),e.jsx(i,{strong:!0,style:{fontSize:14},children:"Continue from Draft"})]}),r.length>0&&e.jsxs(i,{type:r.length>=8?"warning":"secondary",style:{fontSize:12},children:[r.length," / 10 drafts"]})]}),L?e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:12},children:[1,2].map(t=>e.jsx(Re.Button,{active:!0,block:!0,style:{height:80}},t))}):r.length>0?e.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:12},children:r.map(t=>e.jsxs(Oe,{size:"small",hoverable:!0,onClick:()=>Te(t.uuid),style:{cursor:"pointer",borderColor:o.colorBorderSecondary},styles:{body:{padding:12}},children:[e.jsx(i,{strong:!0,style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:13,marginBottom:4},children:t.subject||"No subject"}),e.jsxs(i,{type:"secondary",style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:12},children:["To: ",t.to_email||"No recipient"]}),e.jsx("div",{style:{marginTop:6},children:e.jsxs(i,{type:"secondary",style:{fontSize:11,display:"block"},children:[e.jsx(n,{name:"Clock",size:11,style:{marginRight:3}}),k(t.created_at).format("MMM D, h:mm A")]})})]},t.uuid))}):e.jsxs("div",{style:{padding:"24px 16px",textAlign:"center",backgroundColor:o.colorFillQuaternary,borderRadius:8},children:[e.jsx(n,{name:"Folder",size:24,style:{color:o.colorTextTertiary,marginBottom:8}}),e.jsx(i,{type:"secondary",style:{display:"block",fontSize:13},children:"No drafts saved yet"})]})]})]}),ze=()=>g?e.jsx(He,{email:g,previewHtml:O,previewKey:G,isSaving:R,isSending:M,isScheduling:H,isRegenerating:P,isAutoSaving:N,lastSavedAt:q,error:u,aiMessage:ie,activeSectionId:K,activeSectionType:Q,activeSectionPosition:V,activeSectionPlacement:$,onUpdateFields:re,onSectionClick:ae,onClearActiveSection:ce,onRegenerateSection:ue,hoveredSectionId:J,hoveredSectionType:U,hoveredSectionRect:X,onSectionHover:de,isInlineEditing:Y,inlineEditingSectionId:Z,inlineEditingSectionData:ee,
1inlineEditingSectionRect:te,onStartInlineEdit:me,onCancelInlineEdit:pe,onSaveInlineEdit:ye,onAutoSaveInlineEdit:ge,onSend:he,onSchedule:t=>xe(t),onCancelSchedule:fe,onDiscard:we,onSaveAndClose:()=>d("composer:close-requested",{}),onClearError:j,onClearAiMessage:ve,previewError:W,onRetryPreview:je,isMobile:!0}):e.jsx("div",{style:{padding:24,textAlign:"center"},children:e.jsx(i,{type:"secondary",children:"Loading email..."})});return e.jsx(Ke,{title:"Compose Email",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",overflow:"hidden"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:`1px solid ${o.colorBorderSecondary}`,backgroundColor:o.colorBgContainer,minHeight:48,flexShrink:0},children:[e.jsx(T,{type:"text",icon:e.jsx(n,{name:"ArrowLeft",size:18}),onClick:Ee,style:{padding:"4px 8px"}}),e.jsx(Ne,{current:be,size:"small",style:{maxWidth:160},items:[{title:"Configure"},{title:"Edit"}]}),e.jsx("div",{style:{width:40}})]}),e.jsxs("div",{style:{flex:1,overflow:"auto"},children:[a==="template-select"&&ke(),a==="compose"&&ze()]})]})})}export{Ot as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.