PageSourceSearch

https://usemailora.com/vite/assets/VariationPreviewView-78BnTLMg.js

js usemailora.com collected 2026-10-05 06:12:56 UTC 10,582 bytes, 1 lines download raw bytes

1import{c as Se,j as t,B as W,L as _e,r as Ve,g as ve}from"./inertia-CMh9pc4-.js";import{r as x}from"./vendor-react-ChqYkrhL.js";import{a as le,b as re,c as Le,C as Re}from"./card-BfRYII0P.js";import{V as we,g as ze}from"./types-TBH2e2Oq.js";import Pe from"./EmailPreviewIframe-CUoOPcTQ.js";import{LinksCustomization as Ue}from"./LinksCustomization-HjLMS00S.js";import{SubjectFromCustomization as $e}from"./SubjectFromCustomization-Ds8CoeVQ.js";import{ContentCustomization as Be}from"./ContentCustomization-B2sDY02R.js";import{FooterCustomization as He}from"./FooterCustomization-CTRkl-0N.js";import{C as Me}from"./circle-alert-B8Zu-rYE.js";import{S as ae}from"./square-pen-41T-WU9F.js";import"./checkbox-DNjJHpi7.js";import"./rotate-ccw-B9gYMFXy.js";import"./label-Cr2rJl2E.js";(function(){try{var d=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};d.SENTRY_RELEASE={id:"f1645e2"};var e=new d.Error().stack;e&&(d._sentryDebugIds=d._sentryDebugIds||{},d._sentryDebugIds[e]="d7a3cf66-d543-4dff-be84-88943473e4d1",d._sentryDebugIdIdentifier="sentry-dbid-d7a3cf66-d543-4dff-be84-88943473e4d1")}catch{}})();function Ae(d){const e=Se.c(88),{variation:s,index:h,variationType:n,mvtTestId:l,variationOptions:i}=d,j=n==="original",o=n==="links",N=n==="subject_from",r=n==="content",c=n==="footer",[f,g]=x.useState(s.manipulated_content.html),[b,_]=x.useState(s.manipulated_content.modifications),[p,v]=x.useState(s.manipulated_content.subject),[m,k]=x.useState(s.manipulated_content.from_name),[a,w]=x.useState(s.manipulated_content.text),[u,pe]=x.useState(!1),[S,je]=x.use
1State(!1),[y,ge]=x.useState(!1),[oe,be]=x.useState(!1);let X;e[0]!==(i==null?void 0:i.links)?(X=(i==null?void 0:i.links)||{remove_links:!0,remove_images:!0},e[0]=i==null?void 0:i.links,e[1]=X):X=e[1];const Ne=X,[ce,ye]=x.useState(Ne.remove_links),[me,Ce]=x.useState(Ne.remove_images),de=b.length>0,fe=!!f,ue=!!a;i!=null&&i.subject_from;let Z;e[2]===Symbol.for("react.memo_cache_sentinel")?(Z=(C,E,he,Fe)=>{g(C),_(E),ye(he),Ce(Fe)},e[2]=Z):Z=e[2];const Ee=Z;let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O=(C,E,he)=>{v(C),k(E),_(he)},e[3]=O):O=e[3];const ke=O;let Q;e[4]===Symbol.for("react.memo_cache_sentinel")?(Q=(C,E)=>{w(C),_(E)},e[4]=Q):Q=e[4];const Te=Q;let ee;e[5]===Symbol.for("react.memo_cache_sentinel")?(ee=(C,E)=>{g(C),_(E)},e[5]=ee):ee=e[5];const Ie=ee,xe=h+1;let T;e[6]!==xe?(T=t.jsx(ve,{className:"text-xs bg-blue-600",children:xe}),e[6]=xe,e[7]=T):T=e[7];let I;e[8]!==n?(I=ze(n),e[8]=n,e[9]=I):I=e[9];let F;e[10]!==T||e[11]!==I?(F=t.jsxs(Le,{className:"flex items-center gap-2",children:[T,I]}),e[10]=T,e[11]=I,e[12]=F):F=e[12];let V;e[13]!==c?(V=c&&t.jsxs(W,{size:"sm",variant:"outline",onClick:()=>be(!0),children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Edit"]}),e[13]=c,e[14]=V):V=e[14];let L;e[15]!==y||e[16]!==N?(L=N&&!y&&t.jsxs(W,{size:"sm",variant:"outline",onClick:()=>ge(!0),children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Edit"]}),e[15]=y,e[16]=N,e[17]=L):L=e[17];let R;e[18]!==S||e[19]!==o?(R=o&&!S&&t.jsxs(W,{size:"sm",variant:"outline",onClick:()=>je(!0),children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Edit"]}),e[18]=S,e[19]=o,e[20]=R):R=e[20];let z;e[21]!==r||e[22]!==u?(z=r&&!u&&t.jsxs(W,{size:"sm",variant:"outline",onClick:()=>pe(!0),children:[t.jsx(ae,{className:"h-3 w-3 mr-1"}),"Edit"]}),e[21]=r,e[22]=u,e[23]=z):z=e[23];let P;e[24]!==j?(P=j&&t.jsx(ve,{variant:"outline",children:"Baseline"}),e[24]=j,e[25]=P):P=e[25];let U;e[26]!==V||e[27]!==L||e[28]!==R||e[29]!==z||e[30]!==P?(U=t.jsxs("div",{className:"flex items-center gap-2",children:[V,L,R,z,P]}),e[26]=V,e[27]=L,e[28]=R,e[29]=z,e[30]=P,e[31]=U):U=e[31];let $;e[32]!==U||e[33]!==F?($=t.jsx(Re,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[F,U]})}),e[32]=U,e[33]=F,e[34]=$):$=e[34];let te;e[35]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx("p",{className:"text-muted-foreground",children:"Subject:"}),e[35]=te):te=e[35];let B;e[36]!==p?(B=t.jsxs("div",{children:[te,t.jsx("p",{className:"font-medium",children:p})]}),e[36]=p,e[37]=B):B=e[37];let se;e[38]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("p",{className:"text-muted-foreground",children:"From:"}),e[38]=se):se=e[38];let H;e[39]!==m||e[40]!==s.manipulated_content.from_email?(H=t.jsxs("div",{children:[se,t.jsxs("p",{className:"font-medium",children:[m," <",s.manipulated_content.from_email,">"]})]}),e[39]=m,e[40]=s.manipulated_content.from_email,e[41]=H):H=e[41];let M;e[42]!==B||e[43]!==H?(M=t.jsxs("div",{className:"grid grid-cols-2 gap-4 p-4 bg-gray-50 rounded-lg text-sm",children:[B,H]}),e[42]=B,e[43]=H,e[44]=M):M=e[44];let A;e[45]!==m||e[46]!==y||e[47]!==N||e[48]!==l||e[49]!==p?(A=N&&y&&t.jsx($e,{mvtTestId:l,currentSubject:p,currentFromName:m,isEditing:y,onCancel:()=>ge(!1),onUpdate:ke}),e[45]=m,e[46]=y,e[47]=N,e[48]=l,e[49]=p,e[50]=A):A=e[50];let D;e[51]!==r||e[52]!==u||e[53]!==l||e[54]!==a?(D=r&&a&&u&&t.jsx(Be,{mvtTestId:l,currentText:a,isEditing:u,onCancel:()=>pe(!1),onUpdate:Te}),e[51]=r,e[52]=u,e[53]=l,e[54]=a,e[55]=D):D=e[55];let Y;e[56]!==S||e[57]!==o||e[58]!==l||e[59]!==me||e[60]!==ce?(Y=o&&S&&t.jsx(Ue,{mvtTestId:l,currentRemoveLinks:ce,currentRemoveImages:me,isEditing:S,onCancel:()=>je(!1),onUpdate:Ee}),e[56]=S,e[57]=o,e[58]=l,e[59]=me,e[60]=ce,e[61]=Y):Y=e[61];let q;e[62]!==oe||e[63]!==c||e[64]!==l||e[65]!==f?(q=c&&t.jsx(He,{mvtTestId:l,currentHtml:f,isOpen:oe,onClose:()=>be(!1),onUpdate:Ie}),e[62]=oe,e[63]=c,e[64]=l,e[65]=f,e[66]=q):q=e[66];let G;e[67]!==de||e[68]!==b?(G=de&&t.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg",children:[t.jsx("p",{className:"text-sm font-medium text-blue-900 mb-2",children:"Modifications:"}),t.jsx("ul",{className:"text-sm text-blue-800 space-y-1",children:b.map(De)})]}),e[67]=de,e[68]=b,e[69]=G):G=e[69];let ie;e[70]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("p",{className:"text-sm font-medium mb-2",children:"Email Preview:"}),e[70]=ie):ie=e[70];let J;e[71]!==fe||e[72]!==ue||e[73]!==f||e[74]!==a||e[75]!==n?(J=t.jsxs("div",{children:[ie,t.jsx("div",{className:"border rounded-lg bg-white overflow-hidden",children:fe?t.jsx(Pe,{html:f,title:`${n} email preview`}):ue?t.jsxs("div",{className:"p-4 bg-gray-50",children:[t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"Plain Text Email (no HTML)"}),t.jsx("pre",{className:"whitespace-pre-wrap font-sans text-sm text-gray-800 leading-relaxed",children:a})]}):t.jsx("div",{className:"p-4 text-center text-gray-500",children:"No content available"})})]}),e[71]=fe,e[72]=ue,e[73]=f,e[74]=a,e[75]=n,e[76]=J):J=e[76];let K;e[77]!==M||e[78]!==A||e[79]!==D||e[80]!==Y||e[81]!==q||e[82]!==G||e[83]!==J?(K=t.jsxs(re,{className:"space-y-4",children:[M,A,D,Y,q,G,J]}),e[77]=M,e[78]=A,e[79]=D,e[80]=Y,e[81]=q,e[82]=G,e[83]=J,e[84]=K):K=e[84];let ne;return e[85]!==$||e[86]!==K?(ne=t.jsxs(le,{className:"shadow-none",children:[$,K]}
1),e[85]=$,e[86]=K,e[87]=ne):ne=e[87],ne}function De(d,e){return t.jsxs("li",{className:"flex items-start gap-2",children:[t.jsx("span",{className:"text-blue-600",children:"•"}),t.jsx("span",{children:d})]},e)}function nt(d){const e=Se.c(25),{mvtTest:s,mvtQuota:h}=d,[n,l]=x.useState(!1);let i;e[0]!==s.variation_tests?(i=s.variation_tests||{},e[0]=s.variation_tests,e[1]=i):i=e[1];const j=i,o=(h==null?void 0:h.is_next_free)??!1,N=(h==null?void 0:h.free_remaining)??0,r=(h==null?void 0:h.limit)??0,c=r-N+1;let f;e[2]!==j?(f=we.every(a=>{var w;return(w=j[a])==null?void 0:w.manipulated_content}),e[2]=j,e[3]=f):f=e[3];const g=f;let b;e[4]!==o||e[5]!==s.id||e[6]!==r||e[7]!==c?(b=()=>{const a=o?`No credits will be deducted — this is test ${c} of ${r} included in your plan.`:"This will deduct 5 credits (1 per variation).";confirm(`Are you ready to start this MVT test? ${a} Emails will be sent to seed accounts.`)&&(l(!0),Ve.post(`/mvt-tests/${s.id}/start`,{},{preserveState:!1,onFinish:()=>l(!1)}))},e[4]=o,e[5]=s.id,e[6]=r,e[7]=c,e[8]=b):b=e[8];const _=b;let p;e[9]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(le,{className:"border-blue-200 bg-blue-50 shadow-none",children:t.jsx(re,{className:"p-6",children:t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx(Me,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-blue-900 mb-1",children:"Preview Your Email Variations"}),t.jsx("p",{className:"text-sm text-blue-800",children:"Review how each variation will look before starting the test. Once you proceed, we'll send these 5 variations to seed accounts and compare their deliverability."})]})]})})}),e[9]=p):p=e[9];let v;e[10]!==g?(v=!g&&t.jsx(le,{className:"shadow-none",children:t.jsxs(re,{className:"p-8 text-center",children:[t.jsx(_e,{className:"h-12 w-12 mx-auto mb-4 text-blue-500 animate-spin"}),t.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Generating Variations"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Creating 5 email variations for testing. This will take a few seconds..."})]})}),e[10]=g,e[11]=v):v=e[11];let m;e[12]!==g||e[13]!==_||e[14]!==o||e[15]!==n||e[16]!==s.id||e[17]!==s.variation_options||e[18]!==r||e[19]!==c||e[20]!==j?(m=g&&t.jsxs(t.Fragment,{children:[we.map((a,w)=>{const u=j[a];return u!=null&&u.manipulated_content?t.jsx(Ae,{variation:u,index:w,variationType:a,mvtTestId:s.id,variationOptions:s.variation_options},a):null}),t.jsx(le,{className:"border-green-200 bg-green-50 shadow-none",children:t.jsx(re,{className:"p-6",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-semibold text-green-900 mb-1",children:"Ready to Start?"}),o?t.jsxs("p",{className:"text-sm text-green-800",children:["Included in your plan — ",t.jsx("strong",{children:"no credits"})," will be deducted.",t.jsxs("span",{className:"text-green-600 ml-1",children:["(Test ",c," of ",r," included)"]})]}):t.jsxs("p",{className:"text-sm text-green-800",children:["This will deduct ",t.jsx("strong",{children:"5 credits"})," (1 per variation) and send all variations to seed accounts."]})]}),t.jsx(W,{size:"lg",onClick:_,disabled:n,className:"bg-green-600 hover:bg-green-700",children:n?t.jsxs(t.Fragment,{children:[t.jsx(_e,{className:"mr-2 h-4 w-4 animate-spin"}),"Starting..."]}):"Start Test"})]})})})]}),e[12]=g,e[13]=_,e[14]=o,e[15]=n,e[16]=s.id,e[17]=s.variation_options,e[18]=r,e[19]=c,e[20]=j,e[21]=m):m=e[21];let k;return e[22]!==v||e[23]!==m?(k=t.jsxs("div",{className:"space-y-6",children:[p,v,m]}),e[22]=v,e[23]=m,e[24]=k):k=e[24],k}export{nt 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.