PageSourceSearch

https://rivool.finance/app/assets/OfficeCommissioning-D-2qSXBm.js

js rivool.finance collected 2026-10-07 15:38:46 UTC 5,215 bytes, 1 lines download raw bytes

1import{M as e,r as x,aX as L,b6 as O}from"./vendor-BVFj3DJS.js";import{C,h as v,eJ as k,k as P,q as T,j as M,T as g,B as y,fO as E,fP as H,g6 as R,ez as F,g7 as V,H as U}from"./index-BqHVJPYg.js";import{P as q}from"./PageHeader-CecLChOu.js";import{F as B}from"./FeeSplitSlider-D5ZZ-cz1.js";import{u as N,C as z}from"./CascadeConfirmDialog-BQsfx85T.js";import{g as G,h as I,j as J}from"./useStockFee-CaNRbhdQ.js";import{f as K}from"./format-bps-oP4XycXo.js";import{u as S,T as X}from"./i18n-vendor-B3QzPf-b.js";import{A as $,a as Q,b as W,c as Y,d as Z,e as _,f as ee,g as se}from"./alert-dialog-DPVrakEi.js";import{u as ae}from"./useFormatPercent-S7L9qFU4.js";import"./stellar-vendor-6c0Jq5yJ.js";import"./slider-BeTGGI24.js";function te(){const{t:s,i18n:t}=S(),i=G();return i.isLoading?e.jsxs(C,{children:[e.jsx(v,{children:e.jsx(k,{children:s("stockFee.officeCard.title")})}),e.jsx(P,{children:e.jsx(T,{className:"h-24 w-full"})})]}):i.data?e.jsx(ie,{view:i.data,format:a=>K(a,t.language)}):null}function ie({view:s,format:t}){const{t:i}=S(),a=N(s.office.ownBps),l=I(),o=J(),[j,c]=x.useState(!1),[d,m]=x.useState(null),[u,b]=x.useState([]),[D,f]=x.useState(!1),p=a.draftBps??0,r=async()=>{const n=await l.mutateAsync({bps:a.draftBps});m(n.previewToken),b(n.demotions),f(!1),c(!0)},h=async()=>{if(d)try{await o.mutateAsync({bps:a.draftBps,previewToken:d}),a.reset(),c(!1)}catch(n){if(n.status===409){f(!0);try{await r()}catch{c(!1),f(!1)}return}c(!1)}};return e.jsxs(C,{children:[e.jsxs(v,{children:[e.jsx(k,{children:i("stockFee.officeCard.title")}),e.jsx(M,{children:i("stockFee.officeCard.description")})]}),e.jsxs(P,{className:"space-y-4",children:[e.jsx(B,{total:s.office.maxBps,officeValue:p,onChange:a.setDraftBps,officeLabel:i("stockFee.bar.yours"),advisorLabel:i("stockFee.bar.forAdvisors"),formatValue:t}),e.jsx(g,{variant:"footnote",muted:!0,children:i("stockFee.officeCard.splitAbsolute",{office:t(p),advisor:t(Math.max(0,s.office.maxBps-p)),max:t(s.office.maxBps)})}),e.jsx(g,{variant:"caption",muted:!0,children:s.office.ownBps===null&&!a.dirty?i("stockFee.officeCard.unconfiguredNote"):i("stockFee.officeCard.advisorDefaultDescription")}),e.jsx("div",{className:"flex justify-end",children:e.jsx(y,{disabled:!a.dirty||l.isPending||o.isPending,onClick:()=>void r(),children:i("stockFee.officeCard.save")})}),e.jsx(z,{open:j,onOpenChange:n=>{n||(c(!1),f(!1))},scope:"office",fromLabel:s.office.ownBps===null?i("stockFee.state.notConfigured"):t(s.office.ownBps),toLabel:a.draftBps===null?i("stockFee.state.notConfigured"):t(a.draftBps),demotions:u,isPreviewLoading:l.isPending,isSaving:o.isPending,isStale:D,formatBps:t,onConfirm:h})]})]})}function oe(s){return!s||!(s.maxFeePercent>0)?null:Math.round(s.officeFeePercent/s.maxFeePercent*100)}function re(s){return Math.min(100,Math.max(0,s))}const Ce=()=>{const{t:s}=S(),{formatPercentNumber:t}=ae(),{data:i,isError:a,refetch:l}=E(),o=i?H(i):null,j=R(),[c,d]=x.useState(!1),m=oe(o),{draftBps:u,setDraftBps:b,touched:D,dirty:f,reset:p}=N(m),r=re((D?u:m)??0),h=m===null,n=()=>{!f||h||a||d(!0)},A=async()=>{if(d(!1),!(u===null||h||a))try{await j.mutateAsync(u),p(),O.success(s("officeDashboard.settings.saved"))}catch{}};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(q,{title:s("officeDashboard.commissioning.title"),description:s("officeDashboard.commissioning.description")}),o===null?a?e.jsx(C,{className:"p-6",children:e.jsx(F,{message:s("officeDashboard.settings.splitLoadError"),onRetry:()=>l()})}):e.jsx(V,{blockClassName:"h-64 rounded-xl"}):e.jsxs(C,{className:"p-6",children:[e.jsx(U,{level:2,className:"text-foreground mb-1",children:s("officeDashboard.settings.aumFeeSectionTitle")}),a?e.jsx("div",{className:"mb-6",children:e.jsx(F,{message:s("officeDashboard.settings.splitLoadError"),onRetry:()=>l()})}):e.jsx(g,{variant:"callout",muted:!0,className:"mb-6",children:s("officeDashboard.settings.splitDescription",{maxFee:t(o.maxFeePercent)})}),e.jsx(B,{total:100,officeValue:r,onChange:b,disabled:a,officeLabel:s("officeDashboard.cards.office"),advisorLabel:s("officeDashboard.cards.advisor"),formatValue:w=>a?"—":`${w}%`}),e.jsx(g,{variant:"footnote",muted:!0,className:"mt-4",children:a?"—":s("officeDashboard.settings.splitAbsolute",{office:t(r/100*o.maxFeePercent),advisor:t((100-r)/100*o.maxFeePercent),max:t(o.maxFeePercent)})}),e.jsx(g,{variant:"footnote",muted:!0,className:"mt-1",children:e.jsx(X,{i18nKey:"officeDashboard.commissioning.individualNote",components:{advisors:e.jsx(L,{to:"/office/advisors",className:"underline underline-offset-2"})}})}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx(y,{onClick:n,disabled:j.isPending||!f||h||a,children:s("stockFee.officeCard.save")})})]}),e.jsx(te,{}),e.jsx($,{open:c,onOpenChange:d,children:e.jsxs(Q,{children:[e.jsxs(W,{children:[e.jsx(Y,{children:s("officeDashboard.splitConfirm.title")}),e.jsx(Z,{children:o&&s("officeDashboard.splitConfirm.description",{office:t(r/100*o.maxFeePercent),advisor:t((100-r)/100*o.maxFeePercent),max:t(o.maxFeePercent)})})]}),e.jsxs(_,{children:[e.jsx(ee,{children:s("officeDashboard.splitConfirm.cancel")}),e.jsx(se,{onClick:A,children:s("officeDashboard.splitConfirm.confirm")})]})]})})]})};export{Ce 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.