import{B as e,Ct as t,D as n,Y as r,h as i,k as a,l as o,p as s,r as c,s as l,u}from"./runtime-core.esm-bundler-DJThmTxA.js";import{o as d}from"./runtime-dom.esm-bundler-oBbrWYFJ.js";import{t as f}from"./_plugin-vue_export-helper-BDNMzG2s.js";var p={class:`rebalance-form`},m={class:`content`},h={class:`card`},g={class:`positions-table`},_={class:`total`},v={class:`card`},y={class:`form-group`},b={class:`drift-threshold`},x={class:`targets`},S=[`onUpdate:modelValue`],C=[`onUpdate:modelValue`],w=[`onClick`],T={key:0,class:`card result`},E={class:`result-item`},D={class:`mono`},O={class:`result-item`},k={class:`status-badge`},A={class:`result-item`},j={class:`result-item`},M=f(i({__name:`RebalanceForm`,setup(i){let f=r([{symbol:`AAPL`,quantity:100,marketPrice:150.25,marketValue:15025,weightPercent:35.3},{symbol:`MSFT`,quantity:80,marketPrice:320.5,marketValue:25640,weightPercent:60.2},{symbol:`GOOGL`,quantity:50,marketPrice:140.75,marketValue:7037.5,weightPercent:16.5}]),M=r(5),N=r([{symbol:`AAPL`,targetPercent:40},{symbol:`MSFT`,targetPercent:35},{symbol:`GOOGL`,targetPercent:25}]),P=r(null),F=r(42700),I=()=>{N.value.push({symbol:``,targetPercent:0})},L=e=>{N.value.splice(e,1)},R=async()=>{P.value={jobId:`550e8400-e29b-41d4-a716-446655440001`,status:`Queued`,estimatedTradeCount:3,estimatedCost:127.35}};return(r,i)=>(n(),u(`div`,p,[i[11]||=l(`div`,{class:`header`},[l(`h1`,null,`Portfolio Rebalancing`),l(`p`,{class:`subtitle`},`Adjust target weights and trigger rebalancing`)],-1),l(`div`,m,[l(`div`,h,[i[3]||=l(`h2`,null,`Current Composition`,-1),l(`table`,g,[i[1]||=l(`thead`,null,[l(`tr`,null,[l(`th`,null,`Symbol`),l(`th`,null,`Quantity`),l(`th`,null,`Market Price`),l(`th`,null,`Market Value`),l(`th`,null,`Weight %`)])],-1),l(`tbody`,null,[(n(!0),u(c,null,a(f.value,e=>(n(),u(`tr`,{key:e.symbol},[l(`td`,null,t(e.symbol),1),l(`td`,null,t(e.quantity.toLocaleString()),1),l(`td`,null,`$`+t(e.marketPrice.toFixed(2)),1),l(`td`,null,`$`+t(e.marketValue.toLocaleString()),1),l(`td`,null,t(e.weightPercent.toFixed(1))+`%`,1)]))),128))])]),l(`div`,_,[i[2]||=l(`strong`,null,`Total Portfolio Value:`,-1),s(` $`+t(F.value.toLocaleString()),1)])]),l(`div`,v,[i[5]||=l(`h2`,null,`Set Target Weights`,-1),l(`div`,y,[l(`div`,b,[i[4]||=l(`label`,null,`Drift Threshold %:`,-1),e(l(`input`,{"onUpdate:modelValue":i[0]||=e=>M.value=e,type:`number`,min:`0`,max:`50`,step:`1`},null,512),[[d,M.value,void 0,{number:!0}]])])]),l(`div`,x,[(n(!0),u(c,null,a(N.value,(t,r)=>(n(),u(`div`,{key:r,class:`target-row`},[e(l(`input`,{"onUpdate:modelValue":e=>t.symbol=e,placeholder:`Symbol`,class:`symbol-input`},null,8,S),[[d,t.symbol]]),e(l(`input`,{"onUpdate:modelValue":e=>t.targetPercent=e,type:`number`,min:`0`,max:`100`,step:`1`,placeholder:`%`,class:`percent-input`},null,8,C),[[d,t.targetPercent,void 0,{number:!0}]]),l(`button`,{onClick:e=>L(r),class:`btn-remove`},`✕`,8,w)]))),128))]),l(`div`,{class:`actions`},[l(`button`,{onClick:I,class:`btn-secondary`},`+ Add Symbol`),l(`button`,{onClick:R,class:`btn-primary`},`Trigger Rebalance`)])]),P.value?(n(),u(`div`,T,[i[10]||=l(`h2`,null,`Rebalance Queued`,-1),l(`div`,E,[i[6]||=l(`span`,null,`Job ID:`,-1),l(`span`,D,t(P.value.jobId),1)]),l(`div`,O,[i[7]||=l(`span`,null,`Status:`,-1),l(`span`,k,t(P.value.status),1)]),l(`div`,A,[i[8]||=l(`span`,null,`Estimated Trades:`,-1),l(`span`,null,t(P.value.estimatedTradeCount),1)]),l(`div`,j,[i[9]||=l(`span`,null,`Estimated Cost:`,-1),l(`span`,null,`$`+t(P.value.estimatedCost.toFixed(2)),1)])])):o(``,!0)])]))}}),[[`__scopeId`,`data-v-2da42d3a`]]);export{M as default};