import{A as e,O as t,Tt as n,V as r,Z as i,h as a,l as o,p as s,r as c,s as l,u}from"./runtime-core.esm-bundler-BhgiVlyD.js";import{o as d}from"./runtime-dom.esm-bundler-Bz-VmL4A.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(a({__name:`RebalanceForm`,setup(a){let f=i([{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=i(5),N=i([{symbol:`AAPL`,targetPercent:40},{symbol:`MSFT`,targetPercent:35},{symbol:`GOOGL`,targetPercent:25}]),P=i(null),F=i(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(i,a)=>(t(),u(`div`,p,[a[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,[a[3]||=l(`h2`,null,`Current Composition`,-1),l(`table`,g,[a[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,[(t(!0),u(c,null,e(f.value,e=>(t(),u(`tr`,{key:e.symbol},[l(`td`,null,n(e.symbol),1),l(`td`,null,n(e.quantity.toLocaleString()),1),l(`td`,null,`$`+n(e.marketPrice.toFixed(2)),1),l(`td`,null,`$`+n(e.marketValue.toLocaleString()),1),l(`td`,null,n(e.weightPercent.toFixed(1))+`%`,1)]))),128))])]),l(`div`,_,[a[2]||=l(`strong`,null,`Total Portfolio Value:`,-1),s(` $`+n(F.value.toLocaleString()),1)])]),l(`div`,v,[a[5]||=l(`h2`,null,`Set Target Weights`,-1),l(`div`,y,[l(`div`,b,[a[4]||=l(`label`,null,`Drift Threshold %:`,-1),r(l(`input`,{"onUpdate:modelValue":a[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,[(t(!0),u(c,null,e(N.value,(e,n)=>(t(),u(`div`,{key:n,class:`target-row`},[r(l(`input`,{"onUpdate:modelValue":t=>e.symbol=t,placeholder:`Symbol`,class:`symbol-input`},null,8,S),[[d,e.symbol]]),r(l(`input`,{"onUpdate:modelValue":t=>e.targetPercent=t,type:`number`,min:`0`,max:`100`,step:`1`,placeholder:`%`,class:`percent-input`},null,8,C),[[d,e.targetPercent,void 0,{number:!0}]]),l(`button`,{onClick:e=>L(n),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?(t(),u(`div`,T,[a[10]||=l(`h2`,null,`Rebalance Queued`,-1),l(`div`,E,[a[6]||=l(`span`,null,`Job ID:`,-1),l(`span`,D,n(P.value.jobId),1)]),l(`div`,O,[a[7]||=l(`span`,null,`Status:`,-1),l(`span`,k,n(P.value.status),1)]),l(`div`,A,[a[8]||=l(`span`,null,`Estimated Trades:`,-1),l(`span`,null,n(P.value.estimatedTradeCount),1)]),l(`div`,j,[a[9]||=l(`span`,null,`Estimated Cost:`,-1),l(`span`,null,`$`+n(P.value.estimatedCost.toFixed(2)),1)])])):o(``,!0)])]))}}),[[`__scopeId`,`data-v-2da42d3a`]]);export{M as default};