PageSourceSearch

https://www.tradingwizard.ai/_next/static/chunks/54166-f2a27b2dbd2f42bd.js

js tradingwizard.ai collected 2026-09-24 13:28:44 UTC 15,362 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7daa1f1c-c5b2-4ce3-9dcc-227fcc623d46",e._sentryDebugIdIdentifier="sentry-dbid-7daa1f1c-c5b2-4ce3-9dcc-227fcc623d46")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[54166],{10543:(e,n,t)=>{"use strict";t.d(n,{XX:()=>a,dY:()=>s,lb:()=>r});let a=["daily","weekly","monthly"],r=5,s=1e4},19738:e=>{e.exports={panel:"PreviewRecurringBuy_panel__hWJFW",head:"PreviewRecurringBuy_head__BhuFn",lead:"PreviewRecurringBuy_lead__r21SQ",form:"PreviewRecurringBuy_form__vzvG1",field:"PreviewRecurringBuy_field__2ecPN",cadence:"PreviewRecurringBuy_cadence__psZQx",primary:"PreviewRecurringBuy_primary__SmFr8",quiet:"PreviewRecurringBuy_quiet__tfYus",review:"PreviewRecurringBuy_review__OPmZ_",reviewLine:"PreviewRecurringBuy_reviewLine__w6iat",reviewNote:"PreviewRecurringBuy_reviewNote__1lo8L",reviewActions:"PreviewRecurringBuy_reviewActions__SrCQM",notice:"PreviewRecurringBuy_notice__OR8B9",plans:"PreviewRecurringBuy_plans__RMuip",plan:"PreviewRecurringBuy_plan__aG1JJ",planBody:"PreviewRecurringBuy_planBody__DX_u4",planTitle:"PreviewRecurringBuy_planTitle__1eprc",planState:"PreviewRecurringBuy_planState__Bqbqw",planRecord:"PreviewRecurringBuy_planRecord__knNi2",planActions:"PreviewRecurringBuy_planActions__JeDZQ",foot:"PreviewRecurringBuy_foot__UM3uD"}},29502:(e,n,t)=>{"use strict";t.d(n,{A:()=>a});let a=(0,t(71847).A)("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]])},54166:(e,n,t)=>{"use strict";t.r(n),t.d(n,{PreviewRecurringBuy:()=>w,PreviewRecurringBuyView:()=>f,RECURRING_BUY_SECTION_ID:()=>h,default:()=>v});var a=t(95155),r=t(12115),s=t(29502),l=t(10543);let i={daily:"Every day",weekly:"Every week",monthly:"Every month"},c={customer:"You paused this plan.",budget_spent:"The budget you set is spent, so the plan is finished.",market_unavailable:"This plan could not buy for three days, so it paused itself. Resume it when the market is trading again.",account_paused:"Your account has all trading paused, so the plan paused itself. Resume trading first, then resume the plan.",access_expired:"Your access ended, so the plan paused itself. It can be resumed once your account is active again.",order_refused:"The order could not be placed and a retry would not help, so the plan paused itself."},u=e=>"$".concat(e.toLocaleString("en-US",{maximumFractionDigits:e<1?4:2}));function o(e){return"".concat(String(e).slice(0,16).replace("T"," ")," UTC")}var d=t(96629),p=t(72054),m=t(19738),y=t.n(m);let h="recurring-buy",b={symbol:"",amount:"",cadence:"weekly",budget:""};function g(e){let n=Number(String(e).trim());return Number.isFinite(n)&&n>0?Math.round(100*n)/100:null}function f(e){let{source:n,symbol:t,initialDraft:d,initialStep:m="form",initialNotice:f=null,onCreate:x,onSetState:w,example:v=!1}=e,[_,j]=(0,r.useState)(null!=d?d:{...b,symbol:t}),[N,R]=(0,r.useState)(m),[k,C]=(0,r.useState)(f),[B,P]=(0,r.useState)(!1),S=g(_.amount),T=_.budget.trim()?g(_.budget):null,A=(_.symbol||t).trim().toUpperCase(),U=!!A&&null!=S&&S>=l.lb&&S<=l.dY&&(!_.budget.trim()||null!=T&&T>=S),I=(0,r.useCallback)(async()=>{if(!U||B||null==S)return;P(!0);
1let e=await x({symbol:A,amountUsd:S,cadence:_.cadence,budgetUsd:T});P(!1),C(e?{message:e,upgrade:!1}:null),e||(R("form"),j({...b,symbol:A}))},[U,B,S,T,A,_.cadence,x]),E=(0,r.useCallback)(async(e,n)=>{if(B)return;P(!0);let t=await w(e,n);P(!1),C(t?{message:t,upgrade:!1}:null)},[B,w]);if(!(null==n?void 0:n.enabled))return null;let D=n.plans;return(0,a.jsxs)("section",{id:h,className:y().panel,"aria-labelledby":"recurring-buy-heading",children:[(0,a.jsxs)("header",{className:y().head,children:[(0,a.jsx)(s.A,{size:18,"aria-hidden":"true"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{id:"recurring-buy-heading",children:"Recurring buy"}),(0,a.jsx)("p",{className:y().lead,children:"Buy a set amount of one asset on a schedule, with demo money. It is not a bot and it reads nothing: it buys the amount on the day, or it tells you why it did not."})]})]}),"form"===N?(0,a.jsxs)("div",{className:y().form,children:[(0,a.jsxs)("label",{className:y().field,children:[(0,a.jsx)("span",{children:"Asset"}),(0,a.jsx)("input",{type:"text",inputMode:"text",autoComplete:"off",value:_.symbol,placeholder:t,onChange:e=>j(n=>({...n,symbol:e.target.value}))})]}),(0,a.jsxs)("label",{className:y().field,children:[(0,a.jsx)("span",{children:"Amount each time, demo dollars"}),(0,a.jsx)("input",{type:"number",inputMode:"decimal",min:l.lb,max:l.dY,value:_.amount,placeholder:String(l.lb),onChange:e=>j(n=>({...n,amount:e.target.value}))})]}),(0,a.jsxs)("div",{className:y().field,children:[(0,a.jsx)("span",{id:"recurring-cadence-label",children:"How often"}),(0,a.jsx)("div",{className:y().cadence,role:"group","aria-labelledby":"recurring-cadence-label",children:l.XX.map(e=>(0,a.jsx)("button",{type:"button","aria-pressed":_.cadence===e,onClick:()=>j(n=>({...n,cadence:e})),children:i[e]},e))})]}),(0,a.jsxs)("label",{className:y().field,children:[(0,a.jsx)("span",{children:"Budget, optional"}),(0,a.jsx)("input",{type:"number",inputMode:"decimal",min:0,value:_.budget,placeholder:"No end",onChange:e=>j(n=>({...n,budget:e.target.value}))})]}),(0,a.jsx)("button",{type:"button",className:y().primary,disabled:!U,onClick:()=>R("review"),children:"Review"})]}):(0,a.jsxs)("div",{className:y().review,children:[(0,a.jsxs)("p",{className:y().reviewLine,children:[(0,a.jsxs)("strong",{children:["$",null!=S?S:0," of ",A]}),", ",i[_.cadence].toLowerCase(),", with demo money.",null!=T&&" It finishes once it has spent $".concat(T,".")]}),(0,a.jsxs)("p",{className:y().reviewNote,children:["The first buy runs on the next check. Each one is an ordinary paper market order and appears in your ledger tagged Recurring. ","Real money is not available for recurring buys."]}),(0,a.jsxs)("div",{className:y().reviewActions,children:[(0,a.jsx)("button",{type:"button",className:y().quiet,onClick:()=>R("form"),children:"Back"}),(0,a.jsx)("button",{type:"button",className:y().primary,disabled:B,onClick:I,children:B?"Setting up…":"Set it up"})]})]}),k&&(0,a.jsxs)("p",{className:y().notice,role:"status",children:[k.message,k.upgrade&&!v&&(0,a.jsx)("button",{type:"button",className:y().quiet,onClick:()=>(0,p.ku)("pro","recurring_buy_limit"),children:"See plans"})]}),D.length>0&&(0,a.jsx)("ul",{className:y().plans,children:D.map(e=>(0,a.jsxs)("li",{className:y().plan,children:[(0,a.jsxs)("div",{className:y().planBody,children:[(0,a.jsx)("p",{className:y().planTitle,children:function(e){let n=i[e.cadence].toLowerCase(),t=null==e.budgetUsd?"":" Budget ".concat(u(e.budgetUsd),", ").concat(u(Math.max(0,e.budgetUsd-e.spentUsd))," left.");return"".concat(u(e.amountUsd)," of ").concat(e.symbol,", ").concat(n,", with demo money.").concat(t)}(e)}),(0,a.jsx)("p",{className:y().planState,children:function(e){switch(e.status){case"active":return"Next buy ".concat(o(e.nextRunAt),".");case"paused":return e.statusReason?c[e.statusReason]:"This plan is paused.";case"finished":return c.budget_spent;case"stopped":return"You stopped this plan. Its past buys stay in your ledger."}}(e)}),(0,a.jsx)("p",{className:y().planRecord,children:function(e){if(0===e.runs)return"No buys yet.";let n=e.lastRunAt?", last on ".concat(o(e.lastRunAt)):"";return"".concat(e.runs," ").concat(1===e.runs?"buy":"buys",", ").concat(u(e.spentUsd)," of demo money spent").concat(n,".")}(e)})]}),"stopped"!==e.status&&"finished"!==e.status&&(0,a.jsxs)("div",{className:y().planActions,children:[(0,a.jsx)("button",{type:"button",className:y().quiet,disabled:B,onClick:()=>E(e.id,"paused"===e.status?"resume":"pause"),children:"paused"===e.status?"Resume":"Pause"}),(0,a.jsx)("button",{type:"button",className:y().quiet,disabled:B,onClick:()=>E(e.id,"stop"),children:"Stop"})]})]},e.id))}),(0,a.jsx)("p",{className:y().foot,children:v?"Example plans. Nothing here was set up and nothing was sent.":"Demo money. Every buy is an ordinary paper order with its own receipt."})]})}async function x(e){try{let n=await fetch("/api/terminal/recurring-buy",{cache:"no-store",credentials:"same-origin",signal:e});if(!n.ok)return null;let t=await n.json().catch(()=>null),a=t&&"object"==typeof t?t:null;if(!(null==a?void 0:a.enabled)||!Array.isArray(a.plans))return null;return{enabled:!0,plans:a.plans}}catch(e){return null}}function w(e){let{symbol:n,example:t,enabled:s,onAvailable:l}=e,[i,c]=(0,r.useState)(null),[u,o]=(0,r.useState)(0);(0,r.useEffect)(()=>
1{if(t||!s)return;let e=new AbortController;return x(e.signal).then(n=>{e.signal.aborted||(c(n),null==l||l(!!(null==n?void 0:n.enabled)))}),()=>e.abort()},[t,s,u,l]);let p=(0,r.useRef)(null),m=(0,r.useCallback)(async e=>{if(t)return null;try{let n=JSON.stringify(e);p.current&&p.current.fingerprint===n||(p.current={fingerprint:n,key:"rbc_".concat(crypto.randomUUID().replace(/-/g,""))});let t=await fetch("/api/terminal/recurring-buy",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","Idempotency-Key":p.current.key},body:JSON.stringify(e)}),a=await t.json().catch(()=>null);if(!t.ok)return String((null==a?void 0:a.error)||"That recurring buy could not be set up.");return p.current=null,o(e=>e+1),null}catch(e){return"That recurring buy could not be set up."}},[t]),y=(0,r.useCallback)(async(e,n)=>{if(t)return null;try{let t="stop"===n?await fetch("/api/terminal/recurring-buy/".concat(encodeURIComponent(e)),{method:"DELETE",credentials:"same-origin"}):await fetch("/api/terminal/recurring-buy/".concat(encodeURIComponent(e)),{method:"PATCH",credentials:"same-origin",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:n})}),a=await t.json().catch(()=>null);if(!t.ok)return String((null==a?void 0:a.error)||"That recurring buy could not be changed.");return o(e=>e+1),null}catch(e){return"That recurring buy could not be changed."}},[t]);return(0,a.jsx)(f,{source:t?{enabled:!0,plans:(0,d.W$)("running").plans}:i,symbol:n,example:t,onCreate:m,onSetState:y})}let v=w},72054:(e,n,t)=>{"use strict";t.d(n,{TQ:()=>o,W0:()=>u,ku:()=>c});var a=t(95155),r=t(99708),s=t(5917),l=t(80557),i=t(16030);function c(e,n){try{(0,i.LI)(i.Cb.CAP_UPGRADE_CLICKED,{source:n,next_plan:e})}catch(e){}try{window.dispatchEvent(new CustomEvent("wiz-open-upgrade",{detail:{source:n,requiredPlan:e}}))}catch(e){}}function u(e){let{plan:n,className:t=""}=e,r=(0,l.cY)(n)||"var(--text-tertiary)",s="ultimate"===n?"Ultimate":"Pro";return(0,a.jsx)("span",{className:"inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-[10px] font-bold leading-none ".concat(t),style:{background:"".concat(r,"1A"),color:r},children:s})}function o(e){let{state:n,title:t,description:l,icon:i,requiredPlan:o,source:d="plan_gate_row",right:p,onClick:m,selected:y=!1,className:h=""}=e,b=(0,a.jsxs)(a.Fragment,{children:[null!=i&&(0,a.jsx)("span",{className:"shrink-0 ".concat(y?"text-theme-primary":"text-theme-secondary"),children:i}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-[13px] font-bold text-theme-primary",children:t}),l&&(0,a.jsx)("span",{className:"mt-0.5 block text-[11px] text-theme-tertiary text-pretty",children:l})]})]});if("locked"===n){let e=o||"pro";return(0,a.jsxs)("button",{"data-shape":"card",type:"button",onClick:()=>c(e,d),"aria-label":"".concat(t,": requires ").concat("ultimate"===e?"Ultimate":"Pro",". Opens upgrade."),className:"flex w-full items-center gap-2.5 rounded-2xl border border-theme bg-theme-secondary px-3.5 py-2.5 text-left transition-colors hover:bg-white/[0.02] focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)] ".concat(h),children:[b,(0,a.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[(0,a.jsx)(r.A,{className:"h-3.5 w-3.5 text-theme-tertiary","aria-hidden":!0}),(0,a.jsx)(u,{plan:e})]})]})}if("coming_soon"===n)return(0,a.jsxs)("div",{className:"flex w-full items-center gap-2.5 rounded-2xl border border-theme bg-theme-secondary px-3.5 py-2.5 opacity-70 ".concat(h),children:[b,(0,a.jsx)("span",{className:"ml-auto shrink-0 rounded-full bg-[color:var(--bg-tertiary)] px-2 py-0.5 text-[10px] font-semibold leading-none text-theme-tertiary",children:"Coming soon"})]});let g=null!=p?p:y?(0,a.jsx)(s.A,{className:"h-4 w-4",style:{color:"var(--wiz-green)"},"aria-hidden":!0}):null,f=y?{background:"var(--wiz-green-soft-bg)",borderColor:"transparent"}:void 0,x=y?"":"border-theme bg-theme-secondary hover:bg-white/[0.02]";return m?(0,a.jsxs)("button",{"data-shape":"card",type:"button",onClick:m,"aria-pressed":y,className:"flex w-full items-center gap-2.5 rounded-2xl border px-3.5 py-2.5 text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--wiz-focus)] ".concat(x," ").concat(h),style:f,children:[b,null!=g&&(0,a.jsx)("span",{className:"ml-auto shrink-0",children:g})]}):(0,a.jsxs)("div",{className:"flex w-full items-center gap-2.5 rounded-2xl border px-3.5 py-2.5 ".concat(x," ").concat(h),style:f,children:[b,null!=g&&(0,a.jsx)("span",{className:"ml-auto shrink-0",children:g})]})}},96629:(e,n,t)=>{"use strict";t.d(n,{PU:()=>r,W$:()=>c,nX:()=>a});let a=["empty","review","running","self-paused","plan-limit"],r={empty:"No plans yet",review:"Review before it is set up",running:"Plans running","self-paused":"Paused itself","plan-limit":"Plan boun
1d reached"};function s(e){return{ownerId:"preview-owner",instrumentClass:"crypto",account:{mode:"paper"},amountUsd:50,cadence:"weekly",budgetUsd:null,spentUsd:0,runs:0,postponedRuns:0,postponedSince:null,status:"active",statusReason:null,nextRunAt:"2026-09-29T09:00:00.000Z",lastRunAt:null,lastReceiptId:null,createdAt:"2026-09-22T09:00:00.000Z",...e}}let l=[s({id:"fixture-btc",symbol:"BTC-USD",amountUsd:50,cadence:"weekly",runs:6,spentUsd:300,lastRunAt:"2026-09-22T09:00:00.000Z",nextRunAt:"2026-09-29T09:00:00.000Z"}),s({id:"fixture-spy",symbol:"SPY",instrumentClass:"etf",amountUsd:100,cadence:"monthly",budgetUsd:1200,spentUsd:400,runs:4,lastRunAt:"2026-09-01T09:00:00.000Z",nextRunAt:"2026-10-01T09:00:00.000Z"})],i=[s({id:"fixture-eric",symbol:"ERIC-B.ST",instrumentClass:"stock",amountUsd:25,cadence:"daily",runs:11,spentUsd:275,status:"paused",statusReason:"market_unavailable",postponedRuns:9,postponedSince:"2026-09-19T09:00:00.000Z",lastRunAt:"2026-09-18T09:00:00.000Z",nextRunAt:"2026-09-22T10:00:00.000Z"}),l[0]];function c(e){let n={symbol:"BTC-USD",amount:"50",cadence:"weekly",budget:""};switch(e){case"review":return{plans:[],step:"review",draft:n,notice:null};case"running":return{plans:l,step:"form",draft:{...n,amount:""},notice:null};case"self-paused":return{plans:i,step:"form",draft:{...n,amount:""},notice:null};case"plan-limit":return{plans:l,step:"form",draft:n,notice:{message:"You already have as many recurring buys as your plan allows. Your plan allows 1.",upgrade:!0}};default:return{plans:[],step:"form",draft:{...n,amount:""},notice:null}}}}}]);

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.