1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`a8f73c1`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:web20-front":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`291ad61e-42ca-4a7e-a7ff-c5c290252b3b`,e._sentryDebugIdIdentifier=`sentry-dbid-291ad61e-42ca-4a7e-a7ff-c5c290252b3b`)}catch{}})();import{E as e,Tt as t,dn as n}from"./CFadHmlZ.js";import{D as r,q as i}from"./C_AzAwxu.js";import{t as a}from"./CF_4RBc1.js";import{a as o,t as s}from"./DDQwr6IQ.js";import{t as c}from"./BLL2zuSQ.js";i();var l=()=>{let{$apiClient:i,$country:l,$router:u}=n(),d=e(`calculator-loading`,()=>!0),f=e(`calculator-loan-amount`,()=>0),p=e(`calculator-first-payment`,()=>0),m=e(`calculator-term`,()=>l.isRO()?60:0),h=e(`calculator-calculation`,()=>null),g=e(`calculator-last-cache-key`,()=>null),_=e(`calculator-financial-settings`,()=>null),v=e(`calculator-installments`,()=>[]),y=e(`calculator-installment-notice`,()=>null),b=e(`calculator-example-rendered`,()=>null),x=e(`calculator-abort-controller`),S=r(()=>u.currentRoute.value),C=r(()=>({[a.LOAN_AMOUNT]:s(f.value),[a.TERM]:s(m.value),[a.FIRST_PAYMENT]:s(p.value)})),w=r(()=>{if(h.value)return Math.floor(Math.min(...h.value.installments.map(e=>e.total).sort()))});function T(){if(!_.value)return;let e=o(S.value.query,a.LOAN_AMOUNT);e!==void 0&&(e=Math.max(e,_.value.min_amount),e=Math.min(e,_.value.max_amount),f.value=e);let t=o(S.value.query,a.TERM);t!==void 0&&(t=Math.max(t,_.value.min_term),t=Math.min(t,_.value.max_term),m.value=t);let n=o(S.value.query,a.FIRST_PAYMENT);n!==void 0&&(p.value=n)}async function E({productId:e,customAmount:n,customTerm:r,customFirstPayment:a,locale:o}){let s=`${n??f.value}-${r??m.value}-${a??p.value}-${e}-${o||``}`,l=n??f.value,u=r??m.value,_=a??p.value;if(g.value===s&&h.value)return{data:{calculation:h.value,installment_notice_rendered:y.value??``,example_rendered:b.value}};d.value=!0,x.value&&x.value.abort();let S=new AbortController;x.value=S;let C=!1;try{let t=await i.GET(`/calculator/schedule`,{params:{query:{loan_amount:l,product_id:Number(e),term:u}},signal:S.signal});return g.value=s,h.value=t.calculation,p.value=Math.floor(h.value.first_payment),v.value=h.value.installments,y.value=t.installment_notice_rendered,b.value=t.example_rendered,f.value=l,m.value=u,p.value=_,{data:t}}catch(e){if(c(e)){C=!0;return}throw t({status:500,statusText:`Failed to load calculator schedule`,cause:e})}finally{C||(d.value=!1)}}function D(e){f.value=e.default_amount,m.value=e.default_term,_.value=e}return{loading:d,loanAmount:f,firstPayment:p,term:m,calculation:h,lastCacheKey:g,financialSettings:_,installments:v,installmentNotice:y,exampleRendered:b,productCalculatorQueryParams:C,monthlyPaymentFrom:w,updateSettingsFromQuery:T,fetchCalculation:E,setFinancialSettings:D}};export{l as t};
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.