{"id":50811,"date":"2026-02-10T08:26:12","date_gmt":"2026-02-10T08:26:12","guid":{"rendered":"https:\/\/toprankeurope.com\/cost-calculator\/"},"modified":"2026-09-15T22:45:01","modified_gmt":"2026-09-15T20:45:01","slug":"cost-calculator","status":"publish","type":"page","link":"https:\/\/toprankeurope.com\/fr\/cost-calculator\/","title":{"rendered":"Import calculator"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"50811\" class=\"elementor elementor-50811\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c41a101 e-flex e-con-full e-con e-parent\" data-id=\"c41a101\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c41a102 elementor-widget elementor-widget-html\" data-id=\"c41a102\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<div class=\"tre-simple-budget notranslate\" translate=\"no\" data-no-translation data-no-dynamic-translation><iframe data-tre-client=\"1\" title=\"TOPRANK import calculator \/ Calculateur d\u2019importation\" width=\"100%\" height=\"1900\" style=\"display:block;width:100%;max-width:100%;border:0;background:#08090b\" sandbox=\"allow-scripts allow-same-origin allow-top-navigation-by-user-activation\" allow=\"clipboard-write\" srcdoc=\"&lt;!doctype html&gt;&lt;html lang=&quot;en&quot; translate=&quot;no&quot; class=&quot;notranslate&quot; data-no-translation data-no-dynamic-translation&gt;&lt;head&gt;&lt;meta charset=&quot;utf-8&quot;&gt;&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,initial-scale=1&quot;&gt;&lt;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;&gt;&lt;title&gt;Import calculator \u2014 TOPRANK&lt;\/title&gt;&lt;style&gt;:root{color-scheme:dark;--bg:#08090b;--panel:#111619;--card:#151c20;--line:#303b40;--text:#f1f3f4;--muted:#b9c4c8;--gold:#c4ab83;--red:#b51f2a}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,Arial,sans-serif;font-size:16px;line-height:1.55}button,input,select,textarea{font:inherit}button,a,input,select,summary{touch-action:manipulation}button,a{transition:background-color .15s ease,border-color .15s ease}button{cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,textarea:focus-visible{outline:3px solid var(--gold);outline-offset:3px}.shell{max-width:1240px;margin:auto;padding:32px 24px 40px}.intro{max-width:950px;margin-bottom:28px}.eyebrow-row{display:flex;align-items:center;justify-content:space-between;gap:20px}.eyebrow{font-size:12px;font-weight:700;letter-spacing:.15em;color:var(--gold)}.languages{display:flex;border:1px solid var(--line);border-radius:99px;padding:3px;gap:3px}.languages button{border:0;background:transparent;color:var(--muted);padding:7px 11px;min-height:36px;border-radius:99px;font-size:13px;font-weight:700}.languages button[aria-pressed=true]{background:var(--gold);color:#101416}h1{font-size:clamp(32px,4.4vw,52px);line-height:1.12;letter-spacing:-.04em;margin:22px 0 12px}h2{font-size:21px;line-height:1.3;letter-spacing:-.015em;margin:0 0 20px}.intro&gt;p{font-size:18px;line-height:1.6;color:var(--muted);max-width:760px;margin:0}.calculator-grid{display:grid;grid-template-columns:minmax(0,1.36fr) minmax(320px,1fr);align-items:start;gap:24px}form{min-width:0}.card{padding:24px;background:var(--panel);border:1px solid var(--line);border-radius:16px;margin-bottom:16px}.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 16px}.field{min-width:0}.wide{grid-column:1\/-1}.field&gt;label{display:block;margin-bottom:7px;font-size:14px;font-weight:650;color:var(--text)}.field small,.helper{font-size:13px;line-height:1.55;color:var(--muted)}.field small{display:block;margin-top:6px}.helper{margin:12px 0}input,select{width:100%;min-width:0;background:#080d10;color:var(--text);border:1px solid #435159;border-radius:8px;min-height:48px;padding:10px 12px}select{padding-right:30px}input[aria-invalid=true],select[aria-invalid=true]{border-color:#ff929a;box-shadow:0 0 0 1px #ff929a}.input-wrap{position:relative}.input-wrap:has(&gt;span) input{padding-right:56px}.input-wrap&gt;span{position:absolute;right:12px;top:13px;font-size:13px;color:var(--muted);pointer-events:none}input[type=number]{appearance:textfield}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{appearance:none;margin:0}.mode-switch{display:flex;padding:4px;border-radius:11px;background:#080d10;border:1px solid var(--line);gap:4px;margin-bottom:22px}.mode-switch button{flex:1;min-width:0;border:0;border-radius:8px;background:transparent;color:var(--muted);min-height:48px;padding:10px 12px;font-size:14px;font-weight:700;line-height:1.4}.mode-switch button[aria-pressed=true]{background:var(--red);color:#fff}.main-price{margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}.main-price input{font-size:25px;font-weight:650;min-height:58px}.main-price .input-wrap&gt;span{top:19px}.price-row{display:grid;grid-template-columns:minmax(0,1fr) 115px;gap:12px}.price-row&gt;.field:only-child{grid-column:1\/-1}.check{display:flex;gap:10px;align-items:flex-start;font-size:14px;margin-top:18px;cursor:pointer}.check input{width:20px;height:20px;min-height:0;flex:none;margin:2px 0 0;accent-color:var(--red)}.fee-note{border-top:1px solid var(--line);padding-top:16px;margin:18px 0 0;font-size:14px;color:var(--muted)}.fee-note strong{color:var(--gold)}.fee-proposal{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:18px;padding:16px;border:1px solid #4d4435;background:#201c17;border-radius:10px;font-size:15px}.fee-proposal strong{color:var(--gold);font-size:20px}.fee-proposal small{grid-column:1\/-1;font-size:12px;color:var(--muted);line-height:1.5}.details{background:var(--panel);border:1px solid var(--line);border-radius:12px;margin-bottom:12px}.details&gt;summary{cursor:pointer;padding:16px 18px;min-height:54px;font-weight:650;font-size:14px;list-style:none;position:relative;padding-right:45px}.details&gt;summary::-webkit-details-marker{display:none}.details&gt;summary:after{content:&#x27;+&#x27;;position:absolute;right:19px;color:var(--gold);font-size:21px;line-height:22px}.details[open]&gt;summary:after{content:&#x27;\u2212&#x27;}.detail-body{padding:0 18px 18px}.detail-body&gt;.helper:first-child{margin-top:0}.summary-column{min-width:0;align-self:start;will-change:transform}.summary{background:linear-gradient(145deg,#1b2428,#11171a);border:1px solid #4b565b;border-radius:18px;padding:25px}.summary-head{display:flex;gap:12px;justify-content:space-between;align-items:center;margin-bottom:22px}.estimate-tag{font-size:11px;border:1px solid #756449;border-radius:99px;padding:3px 9px;color:#dec69f}.summary h2{font-size:16px;color:var(--muted);margin:0 0 10px;font-weight:500}.main-total{font-size:clamp(34px,4vw,48px);letter-spacing:-.045em;line-height:1.12;color:var(--gold);margin:0 0 18px;font-weight:750;overflow-wrap:anywhere}.summary-sub,.chf-total{font-size:14px;color:var(--muted);margin:0 0 16px}.chf-total{color:var(--text)}.cost-groups{padding:18px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.summary-row{display:flex;justify-content:space-between;gap:12px;align-items:baseline;font-size:14px;margin:9px 0}.summary-row strong{font-weight:650;white-space:nowrap}.summary-row small{color:var(--muted);font-size:11px}.estimate-callout{padding:16px 0;font-size:12px;color:var(--muted);line-height:1.6}.estimate-callout strong{font-size:13px;color:var(--text)}.estimate-callout p{margin:5px 0}.summary .details{background:transparent}.breakdown&gt;div{display:flex;justify-content:space-between;align-items:baseline;gap:14px;font-size:12px;padding:7px 0;border-bottom:1px solid var(--line)}.breakdown strong{font-weight:500;white-space:nowrap}.summary-actions{display:grid;gap:10px;margin-top:18px}.primary,.secondary{display:flex;justify-content:center;align-items:center;text-align:center;text-decoration:none;min-height:48px;padding:12px;border-radius:9px;font-size:14px;line-height:1.4;font-weight:700}.primary{background:var(--red);color:#fff;border:1px solid var(--red)}.primary:hover{background:#ca2633}.secondary{background:transparent;color:var(--text);border:1px solid #718087}.secondary:hover{background:#273136}.text-button{background:transparent;border:1px solid #718087;color:var(--text);border-radius:7px;min-height:44px;padding:8px 13px;font-size:13px}.copy-status,.rate-footnote{font-size:11px;line-height:1.5;color:var(--muted);margin:12px 0 0}.copy-status:empty{display:none}textarea{width:100%;background:#080d10;color:var(--text);border:1px solid var(--line);border-radius:8px;padding:12px;min-height:170px;font-size:12px}.form-error{font-size:13px;color:#ffb8bd}.form-error:empty{display:none}.estimate-error{color:#ffb8bd}.fine-print{font-size:12px;color:var(--muted);max-width:920px;margin:24px 0 0;line-height:1.65}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}@media(max-width:920px){.calculator-grid{grid-template-columns:minmax(0,1fr)}.summary-column{transform:none!important;will-change:auto}.shell{max-width:730px}.main-total{font-size:42px}}@media(max-width:520px){.shell{padding:22px 14px 28px}.card{padding:18px 16px;border-radius:12px}.fields{grid-template-columns:minmax(0,1fr);gap:16px}.summary{padding:22px 18px}.mode-switch button{padding:10px 8px;font-size:13px}.intro&gt;p{font-size:16px}.intro{margin-bottom:22px}.eyebrow{font-size:10px}.main-total{font-size:40px}.price-row{grid-template-columns:minmax(0,1fr) 105px}.field&gt;label{font-size:14px}.fee-proposal{grid-template-columns:1fr}.fee-proposal small{grid-column:auto}.summary-row{font-size:13px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}\n&lt;\/style&gt;&lt;\/head&gt;&lt;body&gt;&lt;main id=&quot;simple-calculator&quot;&gt;&lt;\/main&gt;&lt;noscript&gt;&lt;p&gt;This calculator requires JavaScript. Contact TOPRANK for an estimate. \/ Ce calculateur n\u00e9cessite JavaScript. Contactez TOPRANK pour une estimation.&lt;\/p&gt;&lt;a href=&quot;https:\/\/toprankeurope.com\/contact\/&quot; target=&quot;_top&quot;&gt;Contact \u00b7 EN&lt;\/a&gt; \u00b7 &lt;a href=&quot;https:\/\/toprankeurope.com\/fr\/contact\/&quot; target=&quot;_top&quot;&gt;Contact \u00b7 FR&lt;\/a&gt;&lt;\/noscript&gt;&lt;script&gt;(function(root){&quot;use strict&quot;;const own=(o,k)=&gt;Object.prototype.hasOwnProperty.call(o,k);const freeze=Object.freeze;const countryRules=freeze({FR:freeze({duty:10,vat:20,collectorVAT:5.5,auto:0}),BE:freeze({duty:10,vat:21,collectorVAT:6,auto:0}),DE:freeze({duty:10,vat:19,collectorVAT:7,auto:0}),CH:freeze({duty:0,vat:8.1,collectorVAT:null,auto:4})});const vehicleClassSurcharges=freeze({standard:0,luxury:7e4,supercar:2e5});const statuses=freeze([&quot;pending&quot;,&quot;estimated&quot;,&quot;quoted&quot;,&quot;included&quot;,&quot;not_applicable&quot;]);const approvalRoutes=freeze({FR:[&quot;unconfirmed&quot;,&quot;collection&quot;,&quot;avdt&quot;,&quot;rti&quot;,&quot;coc&quot;,&quot;local_quote&quot;],DE:[&quot;unconfirmed&quot;,&quot;coc&quot;,&quot;local_quote&quot;],BE:[&quot;unconfirmed&quot;,&quot;coc&quot;,&quot;local_quote&quot;],CH:[&quot;unconfirmed&quot;,&quot;coc&quot;,&quot;local_quote&quot;]});const defaults=freeze({mode:&quot;forward&quot;,source:&quot;JP&quot;,destination:&quot;FR&quot;,koreanInvoiceCurrency:&quot;EUR&quot;,priceJPY:15e5,priceEUR:15e3,priceKRW:2e7,budgetAmount:25e3,budgetCurrency:&quot;EUR&quot;,bidIncrementJPY:1e4,quoteIncrementEUR:1,bidIncrementKRW:1e4,eurJPY:182,usdJPY:152,eurKRW:1500,eurCHF:.94,package:&quot;standard&quot;,areaJPY:3e4,vehicleClass:&quot;standard&quot;,shipping:&quot;container&quot;,volume:10.1,containerUSD:5800,sharedCars:2,insurance:false,inspectionCount:0,postInspection:false,shippingEUR:null,shippingStatus:&quot;pending&quot;,brokerExtrasEUR:null,brokerExtrasStatus:&quot;pending&quot;,koreaAgencyEUR:null,koreaAgencyStatus:&quot;pending&quot;,clearancePays:&quot;destination&quot;,importRoute:&quot;unconfirmed&quot;,importerRole:&quot;unknown&quot;,region:&quot;&quot;,priceVatBasis:&quot;unconfirmed&quot;,taxBaseStatus:&quot;unconfirmed&quot;,vehicleAge:null,customsVehicleValue:null,taxScenario:&quot;ordinary&quot;,taxEvidence:&quot;unconfirmed&quot;,originPays:&quot;unknown&quot;,classificationReference:&quot;&quot;,manufactureYear:null,firstRegistrationDate:&quot;&quot;,portEUR:null,portStatus:&quot;pending&quot;,transportEUR:null,transportStatus:&quot;pending&quot;,registrationEUR:null,registrationStatus:&quot;pending&quot;,co2EUR:null,co2Status:&quot;pending&quot;,approvalRoute:&quot;unconfirmed&quot;,approvalQuoteEUR:null,approvalStatus:&quot;pending&quot;,cocEUR:null,cocStatus:&quot;pending&quot;,utacEUR:null,utacStatus:&quot;pending&quot;,approvalTransportEUR:null,approvalTransportStatus:&quot;pending&quot;,partsEUR:null,partsStatus:&quot;pending&quot;,maintenance:&quot;none&quot;,maintenanceEUR:0,lightingEUR:null,lightingStatus:&quot;pending&quot;,otherEUR:0,otherStatus:&quot;not_applicable&quot;,customsBaseOverrideEUR:null,vatBaseOverrideEUR:null,autoTaxBaseOverrideEUR:null,vatBaseAdditionEUR:0,extras:[]});function numeric(v){if(typeof v===&quot;number&quot;)return v;if(typeof v!==&quot;string&quot;)return NaN;const s=v.trim().replace(\/[\\u00a0\\u202f ]\/g,&quot;&quot;);return\/^[+]?(?:\\d+(?:[.,]\\d+)?|[.,]\\d+)$\/.test(s)?Number(s.replace(&quot;,&quot;,&quot;.&quot;)):NaN}function gcd(a,b){a=a&lt;0n?-a:a;while(b){const t=a%b;a=b;b=t&lt;0n?-t:t}return a||1n}class Q{constructor(n,d=1n){if(d===0n)throw Error(&quot;Zero denominator&quot;);if(d&lt;0n){n=-n;d=-d}const g=gcd(n,d);this.n=n\/g;this.d=d\/g}static of(v){if(v instanceof Q)return v;let s=String(v),sign=1n;if(s[0]===&quot;-&quot;){sign=-1n;s=s.slice(1)}const[mant,exp=&quot;0&quot;]=s.toLowerCase().split(&quot;e&quot;);const parts=mant.split(&quot;.&quot;),digits=parts.join(&quot;&quot;),scale=(parts[1]||&quot;&quot;).length-Number(exp);return scale&gt;=0?new Q(sign*BigInt(digits),10n**BigInt(scale)):new Q(sign*BigInt(digits)*10n**BigInt(-scale))}add(v){v=Q.of(v);return new Q(this.n*v.d+v.n*this.d,this.d*v.d)}sub(v){v=Q.of(v);return new Q(this.n*v.d-v.n*this.d,this.d*v.d)}mul(v){v=Q.of(v);return new Q(this.n*v.n,this.d*v.d)}div(v){v=Q.of(v);return new Q(this.n*v.d,this.d*v.n)}cmp(v){v=Q.of(v);const d=this.n*v.d-v.n*this.d;return d&lt;0n?-1:d&gt;0n?1:0}number(){return Number(this.n)\/Number(this.d)}cents(){const a=this.n*100n;return Number(a&gt;=0n?(a*2n+this.d)\/(2n*this.d):-((-a*2n+this.d)\/(2n*this.d)))}floorCents(){return Number(this.n*100n\/this.d)}}const sum=values=&gt;values.reduce((s,v)=&gt;s.add(v),Q.of(0));const blank=v=&gt;v===null||v===undefined||v===&quot;&quot;;const currencyCents=v=&gt;Q.of(v).mul(100).d===1n;function budgetCents(v){const n=numeric(v);if(!Number.isFinite(n)||n&lt;0)return NaN;const exact=typeof v===&quot;string&quot;?v.trim().replace(\/[\\u00a0\\u202f ]\/g,&quot;&quot;).replace(&quot;,&quot;,&quot;.&quot;):n;return Q.of(exact).floorCents()}function validate(raw={}){if(!raw||typeof raw!==&quot;object&quot;||Array.isArray(raw))return{valid:false,input:null,errors:{input:{object:true}}};const errors={},x={...defaults,...raw,extras:Array.isArray(raw.extras)?raw.extras.map(e=&gt;({...e})):raw.extras===undefined?[]:raw.extras};const choice=(key,values)=&gt;{if(!values.includes(x[key]))errors[key]={choice:values}};const num=(key,min,max,integer=false,nullable=false,money=false)=&gt;{if(nullable&amp;&amp;blank(x[key])){x[key]=null;return}const textValue=typeof x[key]===&quot;string&quot;?x[key].trim().replace(\/[\\u00a0\\u202f ]\/g,&quot;&quot;):null;const preciseMoney=textValue===null||!\/[.,]\\d{3,}$\/.test(textValue);const preciseInteger=textValue===null||!\/[.,]\\d*[1-9]\\d*$\/.test(textValue);const n=numeric(x[key]);if(!Number.isFinite(n)||n&lt;min||n&gt;max||integer&amp;&amp;(!Number.isInteger(n)||!preciseInteger)||money&amp;&amp;(!preciseMoney||Number.isFinite(n)&amp;&amp;!currencyCents(n)))errors[key]={min:min,max:max,integer:integer,money:money};else x[key]=n};choice(&quot;mode&quot;,[&quot;forward&quot;,&quot;reverse&quot;]);choice(&quot;source&quot;,[&quot;JP&quot;,&quot;KR&quot;]);choice(&quot;destination&quot;,Object.keys(countryRules));choice(&quot;koreanInvoiceCurrency&quot;,[&quot;EUR&quot;,&quot;KRW&quot;]);choice(&quot;budgetCurrency&quot;,[&quot;EUR&quot;,&quot;CHF&quot;]);choice(&quot;clearancePays&quot;,[&quot;destination&quot;,...Object.keys(countryRules)]);choice(&quot;importRoute&quot;,[&quot;unconfirmed&quot;,&quot;direct&quot;,&quot;transit&quot;,&quot;eu_cleared&quot;]);choice(&quot;importerRole&quot;,[&quot;unknown&quot;,&quot;customer_agent&quot;,&quot;resale&quot;]);choice(&quot;priceVatBasis&quot;,[&quot;unconfirmed&quot;,&quot;budget_figures&quot;]);choice(&quot;taxBaseStatus&quot;,[&quot;unconfirmed&quot;,&quot;reviewed&quot;]);choice(&quot;taxScenario&quot;,[&quot;ordinary&quot;,&quot;preferential&quot;,&quot;collector&quot;]);choice(&quot;taxEvidence&quot;,[&quot;unconfirmed&quot;,&quot;conditional&quot;,&quot;confirmed&quot;]);choice(&quot;maintenance&quot;,[&quot;none&quot;,&quot;standard&quot;,&quot;performance&quot;,&quot;custom&quot;]);choice(&quot;approvalRoute&quot;,approvalRoutes[x.destination]||[]);for(const k of[&quot;region&quot;,&quot;originPays&quot;,&quot;classificationReference&quot;,&quot;firstRegistrationDate&quot;])if(typeof x[k]!==&quot;string&quot;||x[k].length&gt;500)errors[k]={text:true};num(&quot;vehicleAge&quot;,0,150,true,true);const valuationCurrency=x.source===&quot;JP&quot;?&quot;JPY&quot;:x.koreanInvoiceCurrency;num(&quot;customsVehicleValue&quot;,valuationCurrency===&quot;EUR&quot;?.01:1,valuationCurrency===&quot;KRW&quot;?1e12:valuationCurrency===&quot;JPY&quot;?1e9:1e8,valuationCurrency!==&quot;EUR&quot;,true,valuationCurrency===&quot;EUR&quot;);if(!blank(x.manufactureYear))num(&quot;manufactureYear&quot;,1886,(new Date).getUTCFullYear(),true);else x.manufactureYear=null;if(x.firstRegistrationDate){const d=new Date(x.firstRegistrationDate+&quot;T00:00:00Z&quot;);if(!\/^\\d{4}-\\d{2}-\\d{2}$\/.test(x.firstRegistrationDate)||!Number.isFinite(d.getTime())||d.toISOString().slice(0,10)!==x.firstRegistrationDate||x.firstRegistrationDate&lt;&quot;1886-01-01&quot;||d.getTime()&gt;Date.now())errors.firstRegistrationDate={date:true}}if(x.mode===&quot;reverse&quot;){const budgetRaw=x.budgetAmount;num(&quot;budgetAmount&quot;,0,1e8);x._budgetCents=budgetCents(budgetRaw);if(x.source===&quot;JP&quot;)num(&quot;bidIncrementJPY&quot;,1,1e9,true);else if(x.koreanInvoiceCurrency===&quot;KRW&quot;)num(&quot;bidIncrementKRW&quot;,1,1e12,true);else num(&quot;quoteIncrementEUR&quot;,.01,1e8,false,false,true)}if(x.source===&quot;JP&quot;){if(x.mode===&quot;forward&quot;)num(&quot;priceJPY&quot;,1,1e9,true);num(&quot;eurJPY&quot;,.001,1e7);num(&quot;usdJPY&quot;,.001,1e7);choice(&quot;package&quot;,[&quot;budget&quot;,&quot;standard&quot;,&quot;premium&quot;]);choice(&quot;shipping&quot;,[&quot;roro&quot;,&quot;container&quot;]);choice(&quot;vehicleClass&quot;,Object.keys(vehicleClassSurcharges));x.areaJPY=numeric(x.areaJPY);choice(&quot;areaJPY&quot;,[3e4,5e4,8e4]);if(x.shipping===&quot;roro&quot;){x.volume=numeric(x.volume);choice(&quot;volume&quot;,[9.2,10.1,13.2,14.2,16.2])}else{num(&quot;containerUSD&quot;,0,1e6);num(&quot;sharedCars&quot;,1,100,true)}if(x.package!==&quot;premium&quot;)num(&quot;inspectionCount&quot;,0,100,true);else x.inspectionCount=0;for(const k of[&quot;insurance&quot;,&quot;postInspection&quot;])if(typeof x[k]!==&quot;boolean&quot;)errors[k]={boolean:true}}else if(x.source===&quot;KR&quot;){if(x.koreanInvoiceCurrency===&quot;KRW&quot;){num(&quot;eurKRW&quot;,.001,1e7);if(x.mode===&quot;forward&quot;)num(&quot;priceKRW&quot;,1,1e12,true)}else if(x.mode===&quot;forward&quot;)num(&quot;priceEUR&quot;,.01,1e8,false,false,true)}if(x.destination===&quot;CH&quot;||x.budgetCurrency===&quot;CHF&quot;)num(&quot;eurCHF&quot;,.001,1e3);for(const[amount,status]of[[&quot;portEUR&quot;,&quot;portStatus&quot;],[&quot;transportEUR&quot;,&quot;transportStatus&quot;],[&quot;registrationEUR&quot;,&quot;registrationStatus&quot;],[&quot;co2EUR&quot;,&quot;co2Status&quot;],[&quot;approvalQuoteEUR&quot;,&quot;approvalStatus&quot;],[&quot;cocEUR&quot;,&quot;cocStatus&quot;],[&quot;utacEUR&quot;,&quot;utacStatus&quot;],[&quot;approvalTransportEUR&quot;,&quot;approvalTransportStatus&quot;],[&quot;partsEUR&quot;,&quot;partsStatus&quot;],[&quot;lightingEUR&quot;,&quot;lightingStatus&quot;],[&quot;otherEUR&quot;,&quot;otherStatus&quot;],...x.source===&quot;KR&quot;?[[&quot;shippingEUR&quot;,&quot;shippingStatus&quot;],[&quot;brokerExtrasEUR&quot;,&quot;brokerExtrasStatus&quot;],[&quot;koreaAgencyEUR&quot;,&quot;koreaAgencyStatus&quot;]]:[]]){choice(status,statuses);num(amount,0,1e8,false,true,true);const hasPreset=amount===&quot;approvalQuoteEUR&quot;&amp;&amp;[&quot;collection&quot;,&quot;avdt&quot;,&quot;rti&quot;].includes(x.approvalRoute);if(x[amount]===null&amp;&amp;[&quot;quoted&quot;,&quot;estimated&quot;].includes(x[status])&amp;&amp;!hasPreset)errors[amount]={requiredForStatus:true}}if(x.maintenance===&quot;custom&quot;)num(&quot;maintenanceEUR&quot;,0,1e8,false,false,true);for(const k of[&quot;customsBaseOverrideEUR&quot;,&quot;vatBaseOverrideEUR&quot;,&quot;autoTaxBaseOverrideEUR&quot;])num(k,0,1e9,false,true,true);num(&quot;vatBaseAdditionEUR&quot;,0,1e8,false,false,true);if(!Array.isArray(x.extras)||x.extras.length&gt;30)errors.extras={array:true};else{const seen=new Set;x.extras.forEach((e,i)=&gt;{const key=&quot;extras.&quot;+i;if(!e||typeof e!==&quot;object&quot;||typeof e.id!==&quot;string&quot;||!\/^extra_[a-z0-9_]{1,40}$\/.test(e.id)||seen.has(e.id)){errors[key]={uniqueExtraId:true};return}seen.add(e.id);if(!statuses.includes(e.status)||typeof e.label!==&quot;string&quot;||e.label.length&gt;120||typeof e.inCustomsBase!==&quot;boolean&quot;||typeof e.inVatBase!==&quot;boolean&quot;)errors[key]={shape:true};const n=blank(e.amountEUR)?null:numeric(e.amountEUR),precise=typeof e.amountEUR!==&quot;string&quot;||!\/[.,]\\d{3,}$\/.test(e.amountEUR.trim().replace(\/[\\u00a0\\u202f ]\/g,&quot;&quot;));if(n!==null&amp;&amp;(!Number.isFinite(n)||n&lt;0||n&gt;1e8||!currencyCents(n)||!precise))errors[key]={amount:true};else e.amountEUR=n;if(n===null&amp;&amp;[&quot;quoted&quot;,&quot;estimated&quot;].includes(e.status))errors[key]={requiredForStatus:true}})}return{valid:!Object.keys(errors).length,input:x,errors:errors}}function effectiveTax(x){const country=x.clearancePays===&quot;destination&quot;?x.destination:x.clearancePays,r=countryRules[country];let duty=r.duty,vat=r.vat,scenario=&quot;ordinary&quot;,conditional=false;const proof=x.taxEvidence===&quot;confirmed&quot;&amp;&amp;x.classificationReference.trim().length&gt;0;const eligibleOrigin=[&quot;JP&quot;,&quot;KR&quot;].includes(x.originPays);const permitted=x.taxEvidence===&quot;conditional&quot;||proof;const collectorAgeBlocked=country===&quot;FR&quot;&amp;&amp;x.vehicleAge!==null&amp;&amp;x.vehicleAge&lt;30;if(country!==&quot;CH&quot;&amp;&amp;x.taxScenario===&quot;collector&quot;&amp;&amp;permitted&amp;&amp;!collectorAgeBlocked){duty=0;vat=r.collectorVAT;scenario=&quot;collector&quot;;conditional=!proof}if(country!==&quot;CH&quot;&amp;&amp;x.taxScenario===&quot;preferential&quot;&amp;&amp;permitted&amp;&amp;eligibleOrigin){duty=0;scenario=&quot;preferential&quot;;conditional=!proof}return{country:country,scenario:scenario,requestedScenario:x.taxScenario,evidence:x.taxEvidence,reference:x.classificationReference,dutyRate:duty,vatRate:vat,autoTaxRate:r.auto,conditional:conditional,proofAccepted:proof,eligibleOrigin:eligibleOrigin,collectorAgeBlocked:collectorAgeBlocked}}function compute(x,trustedConfig={}){if(!trustedConfig||typeof trustedConfig!==&quot;object&quot;)trustedConfig={};const pending=[],warnings=[],lines=[];const pend=(id,reason)=&gt;{if(!pending.some(p=&gt;p.id===id))pending.push({id:id,reason:reason})};const warning=code=&gt;{if(!warnings.includes(code))warnings.push(code)};const add=(id,value,status=&quot;estimated&quot;,meta={})=&gt;{value=Q.of(value);lines.push({id:id,amountEUR:value.number(),cents:value.cents(),status:status,...meta,_q:value});return value};const cost=(id,key,statusKey,preset)=&gt;{const status=x[statusKey];let v=x[key];if(v===null&amp;&amp;preset!==undefined)v=preset;if(status===&quot;pending&quot;)pend(id,&quot;cost_to_confirm&quot;);if(v===null)v=0;if([&quot;included&quot;,&quot;not_applicable&quot;].includes(status))v=0;return add(id,v,status,{includedElsewhere:status===&quot;included&quot;,unpriced:x[key]===null&amp;&amp;preset===undefined})};if(x.priceVatBasis===&quot;unconfirmed&quot;)pend(&quot;price_vat_basis&quot;,&quot;quoted_budget_figures_vat_basis_unconfirmed&quot;);if(x.taxBaseStatus===&quot;unconfirmed&quot;)pend(&quot;tax_base_review&quot;,&quot;inclusion_of_commission_services_and_transport_requires_review&quot;);if(x.mode===&quot;reverse&quot;&amp;&amp;[&quot;customsVehicleValue&quot;,&quot;customsBaseOverrideEUR&quot;,&quot;vatBaseOverrideEUR&quot;,&quot;autoTaxBaseOverrideEUR&quot;].some(k=&gt;x[k]!==null))pend(&quot;reverse_fixed_tax_base&quot;,&quot;purchase_ceiling_changes_price_reconfirm_fixed_assessment_values&quot;);if(x.customsVehicleValue!==null)pend(&quot;customs_vehicle_value&quot;,&quot;documented_vehicle_valuation_requires_customs_acceptance&quot;);warning(&quot;cash_amounts_used_as_entered_no_service_vat_inferred&quot;);if(x.importerRole===&quot;unknown&quot;)pend(&quot;importer_role&quot;,&quot;agency_or_resale_role_unconfirmed&quot;);if(x.importerRole===&quot;resale&quot;)pend(&quot;resale_tax_model&quot;,&quot;retail_resale_vat_and_margin_require_quote&quot;);if(x.importRoute===&quot;unconfirmed&quot;)pend(&quot;import_route&quot;,&quot;assumes_clearance_in_selected_country&quot;);if(x.clearancePays!==&quot;destination&quot;&amp;&amp;x.clearancePays!==x.destination)pend(&quot;clearance_destination&quot;,&quot;cross_border_registration_route_requires_review&quot;);if([&quot;BE&quot;,&quot;CH&quot;].includes(x.destination)&amp;&amp;!x.region.trim())pend(&quot;region&quot;,&quot;region_or_canton_not_selected&quot;);const q=v=&gt;Q.of(v);let sourceBase,agency,sourceDetails={};if(x.source===&quot;JP&quot;){const threshold={budget:1e6,standard:2e6,premium:3e6}[x.package],price=q(x.priceJPY),excess=x.priceJPY&gt;threshold?price.sub(threshold).mul(.05):q(0);const baseFees=q(4e4).add(x.areaJPY).add(excess),classFees=q(vehicleClassSurcharges[x.vehicleClass]);let roro=numeric(trustedConfig.roroUSD);if(!Number.isFinite(roro)||roro&lt;0||roro&gt;1e4){roro=170;if(own(trustedConfig,&quot;roroUSD&quot;))warning(&quot;invalid_admin_roro_config_using_fallback&quot;)}const shipping=x.shipping===&quot;roro&quot;?q(5e4).add(q(roro).add(15).mul(x.usdJPY).mul(x.volume)).add(24e3):q(6e4).add(q(13e4).add(3e4).add(q(x.containerUSD).add(x.package===&quot;budget&quot;?400:300).mul(x.usdJPY)).div(x.sharedCars)).add(x.package===&quot;budget&quot;?7e4:0);const insurance=x.insurance?sum([price,baseFees,classFees,shipping]).mul(.006):q(0);add(&quot;vehicle&quot;,price.div(x.eurJPY));add(&quot;japan_fees&quot;,baseFees.div(x.eurJPY));add(&quot;vehicle_class&quot;,classFees.div(x.eurJPY));add(&quot;shipping&quot;,shipping.div(x.eurJPY));add(&quot;insurance&quot;,insurance.div(x.eurJPY));sourceBase=sum([price,baseFees,classFees,shipping,insurance]).div(x.eurJPY);agency=add(&quot;agency&quot;,{budget:900,standard:1400,premium:2500}[x.package],&quot;estimated&quot;);add(&quot;inspections&quot;,x.package===&quot;premium&quot;?0:x.inspectionCount*50+(x.package===&quot;standard&quot;&amp;&amp;x.postInspection?400:0));sourceDetails={currency:&quot;JPY&quot;,purchaseAmount:x.priceJPY,japanBaseFeesJPY:baseFees.number(),vehicleClassJPY:classFees.number(),japanFeesJPY:baseFees.add(classFees).number(),shippingJPY:shipping.number(),insuranceJPY:insurance.number(),japanJPY:sourceBase.mul(x.eurJPY).number(),japanEUR:sourceBase.number(),agencyEUR:agency.number(),agencyStatus:&quot;estimated&quot;}}else{const purchase=x.koreanInvoiceCurrency===&quot;KRW&quot;?q(x.priceKRW).div(x.eurKRW):q(x.priceEUR);add(&quot;vehicle&quot;,purchase,&quot;quoted&quot;);const shipping=cost(&quot;shipping&quot;,&quot;shippingEUR&quot;,&quot;shippingStatus&quot;);const extras=cost(&quot;broker_extras&quot;,&quot;brokerExtrasEUR&quot;,&quot;brokerExtrasStatus&quot;);agency=cost(&quot;agency&quot;,&quot;koreaAgencyEUR&quot;,&quot;koreaAgencyStatus&quot;);sourceBase=sum([purchase,shipping,extras]);sourceDetails={currency:x.koreanInvoiceCurrency,purchaseAmount:x.koreanInvoiceCurrency===&quot;KRW&quot;?x.priceKRW:x.priceEUR,sourceEUR:sourceBase.number(),agencyEUR:agency.number(),agencyStatus:x.koreaAgencyStatus}}const port=cost(&quot;port&quot;,&quot;portEUR&quot;,&quot;portStatus&quot;),transport=cost(&quot;transport&quot;,&quot;transportEUR&quot;,&quot;transportStatus&quot;);const extraTax={customs:q(0),vatOnly:q(0)};for(const e of x.extras){if(e.status===&quot;pending&quot;)pend(e.id,&quot;extra_cost_to_confirm&quot;);const active=![&quot;included&quot;,&quot;not_applicable&quot;].includes(e.status);const val=add(e.id,active?e.amountEUR||0:0,e.status,{label:e.label,includedElsewhere:e.status===&quot;included&quot;,unpriced:e.amountEUR===null});if(e.inCustomsBase)extraTax.customs=extraTax.customs.add(val);else if(e.inVatBase)extraTax.vatOnly=extraTax.vatOnly.add(val)}const tax=effectiveTax(x);if(x.taxScenario!==&quot;ordinary&quot;){if(tax.country===&quot;CH&quot;)warning(&quot;swiss_collector_or_origin_selection_does_not_reduce_normal_taxes&quot;);else if(tax.scenario===&quot;ordinary&quot;)pend(&quot;tax_evidence&quot;,tax.collectorAgeBlocked&amp;&amp;x.taxScenario===&quot;collector&quot;?&quot;collector_age_below_model_threshold&quot;:&quot;requested_relief_not_applied_missing_origin_or_confirmation&quot;);if(tax.conditional)pend(&quot;tax_evidence&quot;,&quot;reduced_tax_scenario_conditional_on_document_review&quot;)}warning(&quot;taxable_base_components_require_customs_review&quot;);const vehicleRate=x.source===&quot;JP&quot;?x.eurJPY:x.koreanInvoiceCurrency===&quot;KRW&quot;?x.eurKRW:1;const actualVehicleEUR=q(sourceDetails.purchaseAmount).div(vehicleRate);const assessedVehicleEUR=x.customsVehicleValue===null?actualVehicleEUR:q(x.customsVehicleValue).div(vehicleRate);const customsBase=x.customsBaseOverrideEUR===null?sourceBase.sub(actualVehicleEUR).add(assessedVehicleEUR).add(extraTax.customs):q(x.customsBaseOverrideEUR);const autoBase=x.autoTaxBaseOverrideEUR===null?customsBase.add(port).add(transport):q(x.autoTaxBaseOverrideEUR);const autoTax=autoBase.mul(tax.autoTaxRate).div(100),duty=customsBase.mul(tax.dutyRate).div(100);const vatBase=x.vatBaseOverrideEUR===null?sum([customsBase,duty,autoTax,port,transport,x.vatBaseAdditionEUR,extraTax.vatOnly]):q(x.vatBaseOverrideEUR);const vat=vatBase.mul(tax.vatRate).div(100);const borderPending=x.importRoute===&quot;eu_cleared&quot;;if(borderPending)pend(&quot;border_taxes&quot;,&quot;already_cleared_invoice_tax_workflow_requires_quote&quot;);add(&quot;duty&quot;,borderPending?0:duty,borderPending?&quot;pending&quot;:tax.conditional?&quot;conditional&quot;:&quot;calculated&quot;,{unpriced:borderPending});add(&quot;automobile_tax&quot;,borderPending?0:autoTax,borderPending?&quot;pending&quot;:&quot;calculated&quot;,{unpriced:borderPending});add(&quot;import_vat&quot;,borderPending?0:vat,borderPending?&quot;pending&quot;:tax.conditional?&quot;conditional&quot;:&quot;calculated&quot;,{unpriced:borderPending});if(x.approvalRoute===&quot;unconfirmed&quot;)pend(&quot;approval_route&quot;,&quot;team_must_determine_route_from_vehicle_documents&quot;);const preset={collection:500,avdt:3e3,rti:1400}[x.approvalRoute];cost(&quot;approval&quot;,&quot;approvalQuoteEUR&quot;,&quot;approvalStatus&quot;,preset);if(x.approvalRoute===&quot;avdt&quot;)warning(&quot;avdt_german_registration_route_not_guaranteed_final_france_approval&quot;);if(x.approvalRoute===&quot;rti&quot;)warning(&quot;rti_1400_management_only_coc_utac_transport_parts_separate&quot;);if(x.approvalRoute===&quot;collection&quot;)warning(&quot;collection_500_service_allowance_not_official_ffve_fee_or_tax_approval&quot;);for(const[id,key,status]of[[&quot;coc&quot;,&quot;cocEUR&quot;,&quot;cocStatus&quot;],[&quot;utac&quot;,&quot;utacEUR&quot;,&quot;utacStatus&quot;],[&quot;approval_transport&quot;,&quot;approvalTransportEUR&quot;,&quot;approvalTransportStatus&quot;],[&quot;parts&quot;,&quot;partsEUR&quot;,&quot;partsStatus&quot;],[&quot;registration&quot;,&quot;registrationEUR&quot;,&quot;registrationStatus&quot;],[&quot;co2&quot;,&quot;co2EUR&quot;,&quot;co2Status&quot;],[&quot;lighting&quot;,&quot;lightingEUR&quot;,&quot;lightingStatus&quot;],[&quot;other&quot;,&quot;otherEUR&quot;,&quot;otherStatus&quot;]]){if(id===&quot;co2&quot;&amp;&amp;[&quot;BE&quot;,&quot;DE&quot;].includes(x.destination)&amp;&amp;x[key]===null&amp;&amp;x[status]===&quot;pending&quot;){add(id,0,&quot;not_applicable&quot;);continue}cost(id,key,status)}add(&quot;maintenance&quot;,x.maintenance===&quot;standard&quot;?1e3:x.maintenance===&quot;performance&quot;?2500:x.maintenance===&quot;custom&quot;?x.maintenanceEUR:0,x.maintenance===&quot;none&quot;?&quot;not_applicable&quot;:&quot;estimated&quot;);const total=sum(lines.map(l=&gt;l._q)),totalCents=total.cents(),rendered=lines.map(({_q:_q,...l})=&gt;l),delta=totalCents-rendered.reduce((s,l)=&gt;s+l.cents,0);if(delta)rendered.push({id:&quot;rounding&quot;,amountEUR:delta\/100,cents:delta,status:&quot;rounding&quot;});const taxes={...tax,vehicleValuationCurrency:sourceDetails.currency,actualVehicleValueEUR:actualVehicleEUR.number(),assessedVehicleValueEUR:assessedVehicleEUR.number(),customsVehicleValueUsed:x.customsVehicleValue!==null,customsBaseEUR:customsBase.number(),autoTaxBaseEUR:autoBase.number(),vatBaseEUR:vatBase.number(),dutyEUR:borderPending?null:duty.number(),automobileTaxEUR:borderPending?null:autoTax.number(),vatEUR:borderPending?null:vat.number(),pending:borderPending,baseOverrideUsed:[&quot;customsVehicleValue&quot;,&quot;customsBaseOverrideEUR&quot;,&quot;vatBaseOverrideEUR&quot;,&quot;autoTaxBaseOverrideEUR&quot;].some(k=&gt;x[k]!==null)};return{totalEUR:total.number(),totalCents:totalCents,plannedTotalEUR:total.number(),plannedTotalCents:totalCents,totalCHF:x.destination===&quot;CH&quot;?total.mul(x.eurCHF).number():null,totalCHFCents:x.destination===&quot;CH&quot;?total.mul(x.eurCHF).cents():null,lines:rendered,plannedLines:rendered,taxes:taxes,sourceDetails:sourceDetails,agencyStatus:sourceDetails.agencyStatus,pending:pending,warnings:warnings,provisional:pending.length&gt;0,complete:pending.length===0,amountStatus:pending.length?&quot;partial_estimate&quot;:&quot;estimate&quot;,_total:total}}function publicResult(r){const{_total:_total,...rest}=r;return rest}function forwardEstimate(raw={},trustedConfig={}){const checked=validate({...raw,mode:&quot;forward&quot;});if(!checked.valid)return{...checked,result:null};return{...checked,result:publicResult(compute(checked.input,trustedConfig))}}function solveBudget(raw={},trustedConfig={}){const checked=validate({...raw,mode:&quot;reverse&quot;});if(!checked.valid)return{...checked,result:null,reverse:{status:&quot;invalid&quot;}};const x=checked.input,spentInputCents=x._budgetCents,converted=qBudget(spentInputCents,x),spendableCents=converted.floorCents(),budget=Q.of(spendableCents).div(100);const currency=x.source===&quot;JP&quot;?&quot;JPY&quot;:x.koreanInvoiceCurrency;const key=currency===&quot;JPY&quot;?&quot;priceJPY&quot;:currency===&quot;KRW&quot;?&quot;priceKRW&quot;:&quot;priceEUR&quot;;const inc=currency===&quot;JPY&quot;?x.bidIncrementJPY:currency===&quot;KRW&quot;?x.bidIncrementKRW:x.quoteIncrementEUR;const scale=currency===&quot;EUR&quot;?100:1,unitStep=currency===&quot;EUR&quot;?Q.of(inc).mul(100).number():inc,maxUnits=currency===&quot;JPY&quot;?1e9:currency===&quot;KRW&quot;?1e12:1e10;const at=k=&gt;compute({...x,[key]:k*unitStep\/scale},trustedConfig);const first=at(1);if(first._total.cmp(budget)&gt;0)return{...checked,result:null,reverse:{status:&quot;unaffordable&quot;,currency:currency,budgetEUR:budget.number(),budgetCents:spendableCents,budgetInputCents:spentInputCents,maxBidJPY:null,maxQuoteEUR:null,maxBidKRW:null,minimumPurchase:inc,minimumBudgetEUR:Number((first._total.n*100n+first._total.d-1n)\/first._total.d)\/100,provisional:first.provisional,pending:first.pending}};let low=1,high=Math.floor(maxUnits\/unitStep),iterations=0;while(low&lt;high){const mid=Math.floor((low+high+1)\/2);if(at(mid)._total.cmp(budget)&lt;=0)low=mid;else high=mid-1;iterations++}const winner=at(low),maxPurchase=low*unitStep\/scale,capped=(low+1)*unitStep&gt;maxUnits,next=capped?null:at(low+1);return{...checked,input:{...x,[key]:maxPurchase},result:publicResult(winner),reverse:{status:&quot;ok&quot;,currency:currency,maxPurchase:maxPurchase,maxBidJPY:currency===&quot;JPY&quot;?maxPurchase:null,maxQuoteEUR:currency===&quot;EUR&quot;?maxPurchase:null,maxBidKRW:currency===&quot;KRW&quot;?maxPurchase:null,increment:inc,budgetEUR:budget.number(),budgetCents:spendableCents,budgetInputCents:spentInputCents,budgetCurrency:x.budgetCurrency,headroomEUR:budget.sub(winner._total).number(),headroomCents:spendableCents-winner.totalCents,nextPurchase:capped?null:(low+1)*unitStep\/scale,nextCostEUR:next?next.totalEUR:null,capped:capped,iterations:iterations,provisional:winner.provisional,verdict:winner.provisional?&quot;provisional_ceiling_excluding_unpriced_costs&quot;:&quot;estimated_budget_ceiling&quot;}}}function qBudget(c,x){const v=Q.of(c).div(100);return x.budgetCurrency===&quot;CHF&quot;?v.div(x.eurCHF):v}function estimate(raw={},trustedConfig={}){if(!raw||typeof raw!==&quot;object&quot;||Array.isArray(raw)||own(raw,&quot;mode&quot;)&amp;&amp;![&quot;forward&quot;,&quot;reverse&quot;].includes(raw.mode))return{valid:false,input:null,errors:{mode:{choice:[&quot;forward&quot;,&quot;reverse&quot;]}},result:null};return raw.mode===&quot;reverse&quot;?solveBudget(raw,trustedConfig):forwardEstimate(raw,trustedConfig)}const api={version:&quot;3.1.0&quot;,defaults:defaults,countryRules:countryRules,vehicleClassSurcharges:vehicleClassSurcharges,statuses:statuses,approvalRoutes:approvalRoutes,numeric:numeric,budgetCents:budgetCents,validate:validate,effectiveTax:effectiveTax,forwardEstimate:forwardEstimate,solveBudget:solveBudget,estimate:estimate};if(typeof module!==&quot;undefined&quot;&amp;&amp;module.exports)module.exports=api;root.TREUpgradeCalculator=api})(typeof globalThis!==&quot;undefined&quot;?globalThis:this);(function(){&quot;use strict&quot;;const E=window.TREUpgradeCalculator,HOST=parent.location.origin,app=document.getElementById(&quot;simple-calculator&quot;);countries=function(){const names=new Intl.DisplayNames([lang===&quot;fr&quot;?&quot;fr&quot;:&quot;en&quot;],{type:&quot;region&quot;});return [&quot;FR&quot;,&quot;BE&quot;,&quot;DE&quot;,&quot;CH&quot;].map(code=&gt;[code,names.of(code)]);};const treV4OriginalUpdate=update,treV4OriginalQuote=quoteText;\nconst treV4Incomplete=()=&gt;!!last?.result?.pending?.length;\nconst treV4Warning=()=&gt;t(&quot;This total is an incomplete estimate: unpriced costs are not included.&quot;,&quot;Ce total est estimatif et incomplet : les frais non chiffr\u00e9s ne sont pas inclus.&quot;);\nupdate=function(...args){treV4OriginalUpdate(...args);const total=document.getElementById(&quot;main-total&quot;);if(total&amp;&amp;treV4Incomplete()){const note=document.createElement(&quot;p&quot;);note.id=&quot;incomplete-total-warning&quot;;note.className=&quot;estimate-callout&quot;;note.style.cssText=&quot;border:1px solid #e6ab53;padding:12px;margin:12px 0;line-height:1.5;color:inherit&quot;;note.textContent=treV4Warning();total.insertAdjacentElement(&quot;afterend&quot;,note);}const link=document.getElementById(&quot;contact-link&quot;);if(link){const url=new URL(link.href);url.searchParams.set(&quot;source&quot;,state.source===&quot;KR&quot;?&quot;korea&quot;:&quot;japan&quot;);link.href=url.href;}};\nquoteText=function(){const quote=treV4OriginalQuote();return treV4Incomplete()?treV4Warning()+&quot;\\n\\n&quot;+quote:quote;};\napplyAgeScenario=function(){if(state.destination===&quot;FR&quot;&amp;&amp;state.taxScenario===&quot;collector&quot;&amp;&amp;underCollectorAge()){state.taxScenario=&quot;ordinary&quot;;state.taxEvidence=&quot;unconfirmed&quot;;}};\nageField=function(){return field(&quot;vehicleAge&quot;,t(&quot;Vehicle age (completed years at import)&quot;,&quot;\u00c2ge du v\u00e9hicule (ann\u00e9es r\u00e9volues \u00e0 l\u2019importation)&quot;),t(&quot;Age alone does not establish collector eligibility. Standard import taxes apply by default. To compare a reduced rate, choose a scenario under Tax assumptions; supporting documents remain required.&quot;,&quot;L\u2019\u00e2ge seul ne justifie pas le r\u00e9gime collection. Les taxes standards s\u2019appliquent par d\u00e9faut. Pour comparer un taux r\u00e9duit, choisissez un sc\u00e9nario dans Hypoth\u00e8ses fiscales ; les justificatifs restent n\u00e9cessaires.&quot;),{min:0,step:1,unit:t(&quot;years&quot;,&quot;ans&quot;)})+&#39;&lt;p id=&quot;age-scenario&quot; class=&quot;helper&quot;&gt;&lt;\/p&gt;&#39;;};\nlet lang=&quot;en&quot;;try{if(\/^\\\/fr(?:\\\/|$)\/.test(parent.location.pathname)||\/^fr\/i.test(parent.document.documentElement.lang))lang=&quot;fr&quot;}catch(_){}if(new URLSearchParams(location.search).get(&quot;lang&quot;)===&quot;fr&quot;)lang=&quot;fr&quot;;const fxKeys=[&quot;eurJPY&quot;,&quot;usdJPY&quot;,&quot;eurKRW&quot;,&quot;eurCHF&quot;],t=(en,fr)=&gt;lang===&quot;fr&quot;?fr:en;const esc=v=&gt;String(v??&quot;&quot;).replace(\/[&amp;&lt;&gt;&quot;&#x27;]\/g,c=&gt;({&quot;&amp;&quot;:&quot;&amp;amp;&quot;,&quot;&lt;&quot;:&quot;&amp;lt;&quot;,&quot;&gt;&quot;:&quot;&amp;gt;&quot;,&#x27;&quot;&#x27;:&quot;&amp;quot;&quot;,&quot;&#x27;&quot;:&quot;&amp;#39;&quot;}[c]));const money=(v,c=&quot;EUR&quot;)=&gt;new Intl.NumberFormat(lang===&quot;fr&quot;?&quot;fr-FR&quot;:&quot;en-GB&quot;,{style:&quot;currency&quot;,currency:c,maximumFractionDigits:[&quot;JPY&quot;,&quot;KRW&quot;].includes(c)?0:2}).format(v);const state={...E.defaults,importerRole:&quot;customer_agent&quot;,importRoute:&quot;direct&quot;,clearancePays:&quot;destination&quot;,priceVatBasis:&quot;budget_figures&quot;,taxBaseStatus:&quot;unconfirmed&quot;,portEUR:852.6,portStatus:&quot;estimated&quot;,koreaAgencyEUR:1800,koreaAgencyStatus:&quot;estimated&quot;};let last=null,rateInfo=null,rateState=&quot;loading&quot;,rateSettled=false,rateTimer=null,rateController=null,manualFX=new Set,config={roroUSD:170},comparison=&quot;&quot;,viewOffset=null,raf=0,lastHeight=0,announcerTimer=0;const budgetKeys=[&quot;portEUR&quot;,&quot;transportEUR&quot;,&quot;registrationEUR&quot;,&quot;co2EUR&quot;,&quot;cocEUR&quot;,&quot;utacEUR&quot;,&quot;approvalTransportEUR&quot;,&quot;partsEUR&quot;,&quot;lightingEUR&quot;,&quot;otherEUR&quot;];const statusKey={portEUR:&quot;portStatus&quot;,transportEUR:&quot;transportStatus&quot;,registrationEUR:&quot;registrationStatus&quot;,co2EUR:&quot;co2Status&quot;,cocEUR:&quot;cocStatus&quot;,utacEUR:&quot;utacStatus&quot;,approvalTransportEUR:&quot;approvalTransportStatus&quot;,partsEUR:&quot;partsStatus&quot;,lightingEUR:&quot;lightingStatus&quot;,otherEUR:&quot;otherStatus&quot;,shippingEUR:&quot;shippingStatus&quot;,brokerExtrasEUR:&quot;brokerExtrasStatus&quot;,koreaAgencyEUR:&quot;koreaAgencyStatus&quot;,approvalQuoteEUR:&quot;approvalStatus&quot;};const text={vehicle:[&quot;Vehicle&quot;,&quot;V\\xe9hicule&quot;],japan_fees:[&quot;Japan fees and inland transport&quot;,&quot;Frais au Japon et transport int\\xe9rieur&quot;],vehicle_class:[&quot;Transport supplement&quot;,&quot;Suppl\\xe9ment de transport&quot;],shipping:[&quot;Overseas shipping&quot;,&quot;Fret maritime&quot;],insurance:[&quot;Marine insurance&quot;,&quot;Assurance maritime&quot;],agency:[&quot;TOPRANK service fee&quot;,&quot;Honoraires TOPRANK&quot;],inspections:[&quot;Optional Japan inspections&quot;,&quot;Inspections facultatives au Japon&quot;],broker_extras:[&quot;Broker \/ export extras&quot;,&quot;Frais du courtier \/ d\\u2019export&quot;],port:[&quot;Arrival port and handling&quot;,&quot;Port d\\u2019arriv\\xe9e et manutention&quot;],transport:[&quot;Delivery after arrival&quot;,&quot;Livraison apr\\xe8s arriv\\xe9e&quot;],duty:[&quot;Customs duty&quot;,&quot;Droits de douane&quot;],automobile_tax:[&quot;Swiss automobile tax&quot;,&quot;Imp\\xf4t automobile suisse&quot;],import_vat:[&quot;Import VAT&quot;,&quot;TVA \\xe0 l\\u2019importation&quot;],approval:[&quot;Approval service allowance&quot;,&quot;Provision de service d\\u2019homologation&quot;],coc:[&quot;COC \/ partial COC&quot;,&quot;COC \/ COC partiel&quot;],utac:[&quot;Technical tests \/ UTAC&quot;,&quot;Essais techniques \/ UTAC&quot;],approval_transport:[&quot;Transport for approval&quot;,&quot;Transport pour l\\u2019homologation&quot;],parts:[&quot;Parts and workshop work&quot;,&quot;Pi\\xe8ces et travaux en atelier&quot;],registration:[&quot;Registration taxes, papers and plates&quot;,&quot;Taxes, documents et plaques d\\u2019immatriculation&quot;],co2:[&quot;CO\\u2082 \/ weight malus or sanction&quot;,&quot;Malus CO\\u2082 \/ masse ou sanction&quot;],lighting:[&quot;Headlights \/ rear fog light&quot;,&quot;Phares \/ antibrouillard arri\\xe8re&quot;],maintenance:[&quot;Maintenance reserve&quot;,&quot;Provision d\\u2019entretien&quot;],other:[&quot;Other expenses&quot;,&quot;Autres frais&quot;],rounding:[&quot;Rounding adjustment&quot;,&quot;Ajustement d\\u2019arrondi&quot;]};const label=id=&gt;id===&quot;utac&quot;&amp;&amp;state.destination!==&quot;FR&quot;?t(&quot;Technical approval tests&quot;,&quot;Essais techniques d\\u2019homologation&quot;):text[id]?t(...text[id]):t(&quot;Additional expense&quot;,&quot;Frais suppl\\xe9mentaire&quot;);const routes=()=&gt;({unconfirmed:t(&quot;TOPRANK review pending&quot;,&quot;\\xc0 \\xe9tudier avec TOPRANK&quot;),collection:t(&quot;Collection file \\xb7 \\u20ac500 allowance&quot;,&quot;Dossier collection \\xb7 provision de 500 \\u20ac&quot;),avdt:t(&quot;German registration + AVDT \\xb7 \\u20ac3,000&quot;,&quot;Immatriculation allemande + AVDT \\xb7 3 000 \\u20ac&quot;),rti:t(&quot;RTI management \\xb7 \\u20ac1,400 + extras&quot;,&quot;Gestion RTI \\xb7 1 400 \\u20ac + frais annexes&quot;),coc:t(&quot;COC \/ conformity quotation&quot;,&quot;Devis COC \/ conformit\\xe9&quot;),local_quote:t(&quot;Local approval quotation&quot;,&quot;Devis d\\u2019homologation local&quot;)});function field(key,title,help=&quot;&quot;,opts={}){return`&lt;div class=&quot;field ${opts.wide?&quot;wide&quot;:&quot;&quot;}&quot;&gt;&lt;label for=&quot;${key}&quot;&gt;${esc(title)}&lt;\/label&gt;&lt;div class=&quot;input-wrap&quot;&gt;&lt;input id=&quot;${key}&quot; name=&quot;${key}&quot; type=&quot;${opts.type||&quot;number&quot;}&quot; ${opts.type===&quot;text&quot;?&quot;&quot;:`min=&quot;${opts.min??0}&quot; step=&quot;${opts.step??&quot;0.01&quot;}&quot; inputmode=&quot;decimal&quot;`} value=&quot;${esc(state[key])}&quot; ${opts.placeholder?`placeholder=&quot;${esc(opts.placeholder)}&quot;`:&quot;&quot;} ${help?`aria-describedby=&quot;${key}-help&quot;`:&quot;&quot;}&gt;${opts.unit?`&lt;span aria-hidden=&quot;true&quot;&gt;${esc(opts.unit)}&lt;\/span&gt;`:&quot;&quot;}&lt;\/div&gt;${help?`&lt;small id=&quot;${key}-help&quot;&gt;${esc(help)}&lt;\/small&gt;`:&quot;&quot;}&lt;\/div&gt;`}function select(key,title,options,help=&quot;&quot;){return`&lt;div class=&quot;field&quot;&gt;&lt;label for=&quot;${key}&quot;&gt;${esc(title)}&lt;\/label&gt;&lt;select id=&quot;${key}&quot; name=&quot;${key}&quot; ${help?`aria-describedby=&quot;${key}-help&quot;`:&quot;&quot;}&gt;${options.map(([v,l])=&gt;`&lt;option value=&quot;${esc(v)}&quot; ${String(state[key])===String(v)?&quot;selected&quot;:&quot;&quot;}&gt;${esc(l)}&lt;\/option&gt;`).join(&quot;&quot;)}&lt;\/select&gt;${help?`&lt;small id=&quot;${key}-help&quot;&gt;${esc(help)}&lt;\/small&gt;`:&quot;&quot;}&lt;\/div&gt;`}function check(key,title){return`&lt;label class=&quot;check&quot;&gt;&lt;input type=&quot;checkbox&quot; id=&quot;${key}&quot; name=&quot;${key}&quot; ${state[key]?&quot;checked&quot;:&quot;&quot;}&gt;&lt;span&gt;${esc(title)}&lt;\/span&gt;&lt;\/label&gt;`}function detail(id,title,body){return`&lt;details id=&quot;${id}&quot; class=&quot;details&quot;&gt;&lt;summary&gt;${esc(title)}&lt;\/summary&gt;&lt;div class=&quot;detail-body&quot;&gt;${body}&lt;\/div&gt;&lt;\/details&gt;`}function countries(){return[[&quot;FR&quot;,&quot;France&quot;],[&quot;BE&quot;,t(&quot;Belgium&quot;,&quot;Belgique&quot;)],[&quot;DE&quot;,t(&quot;Allemagne&quot;,&quot;Allemagne&quot;)],[&quot;CH&quot;,t(&quot;Switzerland&quot;,&quot;Suisse&quot;)]]}const underCollectorAge=()=&gt;state.destination===&quot;FR&quot;&amp;&amp;Number.isInteger(E.numeric(state.vehicleAge))&amp;&amp;E.numeric(state.vehicleAge)&gt;=0&amp;&amp;E.numeric(state.vehicleAge)&lt;30;const purchaseCurrency=()=&gt;state.source===&quot;JP&quot;?&quot;JPY&quot;:state.koreanInvoiceCurrency;function ageField(){return field(&quot;vehicleAge&quot;,t(&quot;Vehicle age (completed years at import)&quot;,&quot;\\xc2ge du v\\xe9hicule (ann\\xe9es r\\xe9volues \\xe0 l\\u2019importation)&quot;),t(&quot;Completed years since manufacture. For France, 30 years or more selects a conditional collector comparison; original condition, a discontinued model and document review remain required.&quot;,&quot;Ann\\xe9es r\\xe9volues depuis la fabrication. Pour la France, 30 ans ou plus s\\xe9lectionne une comparaison collection sous conditions ; \\xe9tat d\\u2019origine, mod\\xe8le dont la production a cess\\xe9 et \\xe9tude des documents restent n\\xe9cessaires.&quot;),{min:0,step:1,unit:t(&quot;years&quot;,&quot;ans&quot;)})+&#x27;&lt;p id=&quot;age-scenario&quot; class=&quot;helper&quot;&gt;&lt;\/p&gt;&#x27;}function applyAgeScenario(){if(state.destination===&quot;FR&quot;){const n=E.numeric(state.vehicleAge);state.taxScenario=Number.isInteger(n)&amp;&amp;n&gt;=30&amp;&amp;n&lt;=150?&quot;collector&quot;:&quot;ordinary&quot;;state.taxEvidence=state.taxScenario===&quot;collector&quot;?&quot;conditional&quot;:&quot;unconfirmed&quot;}}function valuationDetails(){const currency=purchaseCurrency();return&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;By default, taxes use the actual purchase price plus the relevant freight, insurance and adjustments. A different vehicle value requires a justified customs valuation method and customs acceptance. This does not change the amount paid for the vehicle.&quot;,&quot;Par d\\xe9faut, les taxes utilisent le prix d\\u2019achat r\\xe9el, major\\xe9 du fret, de l\\u2019assurance et des ajustements concern\\xe9s. Une autre valeur du v\\xe9hicule n\\xe9cessite une m\\xe9thode d\\u2019\\xe9valuation douani\\xe8re justifi\\xe9e et l\\u2019acceptation de la douane. Cela ne modifie pas le prix r\\xe9ellement pay\\xe9.&quot;)+&quot;&lt;\/p&gt;&quot;+field(&quot;customsVehicleValue&quot;,t(&quot;Documented vehicle customs value&quot;,&quot;Valeur douani\\xe8re justifi\\xe9e du v\\xe9hicule&quot;),t(&quot;Vehicle value only, in the purchase currency. Blank uses the actual purchase price. Freight and other relevant costs are added separately.&quot;,&quot;Valeur du v\\xe9hicule seul, dans la devise d\\u2019achat. Vide reprend le prix d\\u2019achat r\\xe9el. Le fret et les autres frais concern\\xe9s sont ajout\\xe9s s\\xe9par\\xe9ment.&quot;),{unit:currency,min:currency===&quot;EUR&quot;?.01:1,step:currency===&quot;EUR&quot;?.01:1})+&#x27;&lt;button type=&quot;button&quot; id=&quot;reset-valuation&quot; class=&quot;text-button&quot;&gt;&#x27;+t(&quot;Use actual purchase price&quot;,&quot;Utiliser le prix d\\u2019achat r\\xe9el&quot;)+&#x27;&lt;\/button&gt;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;In budget mode, a documented value stays fixed while the purchase ceiling is recalculated. This ceiling remains provisional until that valuation is accepted.&quot;,&quot;En mode budget, la valeur justifi\\xe9e reste fixe pendant le recalcul du plafond d\\u2019achat. Ce plafond reste provisoire jusqu\\u2019\\xe0 l\\u2019acceptation de cette valeur.&quot;)+&quot;&lt;\/p&gt;&quot;}function priceBlock(){const example=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Example amounts are prefilled. Replace them with your vehicle quote or budget.&quot;,&quot;Des montants d\\u2019exemple sont pr\\xe9remplis. Remplacez-les par votre devis ou votre budget.&quot;)+&quot;&lt;\/p&gt;&quot;;if(state.mode===&quot;reverse&quot;)return`&lt;div class=&quot;price-row&quot;&gt;${field(&quot;budgetAmount&quot;,t(&quot;Your total budget&quot;,&quot;Votre budget total&quot;),t(&quot;We calculate a provisional maximum vehicle price.&quot;,&quot;Nous calculons un prix maximal de v\\xe9hicule provisoire.&quot;),{unit:state.budgetCurrency})}${state.destination===&quot;CH&quot;?select(&quot;budgetCurrency&quot;,t(&quot;Budget currency&quot;,&quot;Devise du budget&quot;),[[&quot;EUR&quot;,&quot;EUR&quot;],[&quot;CHF&quot;,&quot;CHF&quot;]]):&quot;&quot;}&lt;\/div&gt;`+example;const key=state.source===&quot;JP&quot;?&quot;priceJPY&quot;:state.koreanInvoiceCurrency===&quot;KRW&quot;?&quot;priceKRW&quot;:&quot;priceEUR&quot;,currency=state.source===&quot;JP&quot;?&quot;JPY&quot;:state.koreanInvoiceCurrency;return field(key,t(&quot;Vehicle purchase price&quot;,&quot;Prix d\\u2019achat du v\\xe9hicule&quot;),state.source===&quot;KR&quot;?t(&quot;Enter the vehicle quote; shipping stays separate.&quot;,&quot;Saisissez le devis du v\\xe9hicule ; le fret reste s\\xe9par\\xe9.&quot;):t(&quot;Your Japan purchase price or auction bid.&quot;,&quot;Votre prix d\\u2019achat ou votre ench\\xe8re au Japon.&quot;),{unit:currency,min:currency===&quot;EUR&quot;?.01:1,step:currency===&quot;EUR&quot;?.01:1,wide:true})+example}function japanBlock(){return&#x27;&lt;div class=&quot;fields&quot;&gt;&#x27;+select(&quot;package&quot;,t(&quot;Japan service package&quot;,&quot;Formule Japon&quot;),[[&quot;budget&quot;,t(&quot;Budget \\xb7 \\u20ac900&quot;,&quot;Budget \\xb7 900 \\u20ac&quot;)],[&quot;standard&quot;,t(&quot;Standard \\xb7 \\u20ac1,400&quot;,&quot;Standard \\xb7 1 400 \\u20ac&quot;)],[&quot;premium&quot;,t(&quot;Premium \\xb7 \\u20ac2,500&quot;,&quot;Premium \\xb7 2 500 \\u20ac&quot;)]])+select(&quot;shipping&quot;,t(&quot;Shipping method&quot;,&quot;Transport maritime&quot;),[[&quot;container&quot;,t(&quot;Container&quot;,&quot;Conteneur&quot;)],[&quot;roro&quot;,&quot;RoRo&quot;]])+select(&quot;vehicleClass&quot;,t(&quot;Vehicle category&quot;,&quot;Cat\\xe9gorie du v\\xe9hicule&quot;),[[&quot;standard&quot;,t(&quot;Normal \\xb7 no supplement&quot;,&quot;Normal \\xb7 sans suppl\\xe9ment&quot;)],[&quot;luxury&quot;,t(&quot;Luxury \\xb7 +\\xa570,000&quot;,&quot;Luxe \\xb7 +70 000 \\xa5&quot;)],[&quot;supercar&quot;,t(&quot;Supercar \\xb7 +\\xa5200,000&quot;,&quot;Supercar \\xb7 +200 000 \\xa5&quot;)]],t(&quot;One supplement, added to normal inland transport.&quot;,&quot;Un seul suppl\\xe9ment, ajout\\xe9 au transport int\\xe9rieur normal.&quot;))+(state.shipping===&quot;roro&quot;?select(&quot;volume&quot;,t(&quot;Vehicle volume&quot;,&quot;Volume du v\\xe9hicule&quot;),[9.2,10.1,13.2,14.2,16.2].map(v=&gt;[v,v+&quot; m\\xb3&quot;])):&quot;&quot;)+&quot;&lt;\/div&gt;&quot;+check(&quot;insurance&quot;,t(&quot;Add optional marine insurance&quot;,&quot;Ajouter l\\u2019assurance maritime facultative&quot;))+&#x27;&lt;p class=&quot;fee-note&quot;&gt;&#x27;+t(&quot;TOPRANK service fee: &quot;,&quot;Honoraires TOPRANK : &quot;)+&quot;&lt;strong&gt;&quot;+money({budget:900,standard:1400,premium:2500}[state.package])+&quot;&lt;\/strong&gt; \\xb7 &quot;+t(&quot;including VAT \\u2014 included in the estimate.&quot;,&quot;TTC \\u2014 compris dans l\\u2019estimation.&quot;)+&quot;&lt;\/p&gt;&quot;}function koreaBlock(){return&#x27;&lt;div class=&quot;fields&quot;&gt;&#x27;+field(&quot;shippingEUR&quot;,t(&quot;Your shipping quote&quot;,&quot;Votre devis de fret&quot;),t(&quot;Blank = not yet priced.&quot;,&quot;Vide = pas encore chiffr\\xe9.&quot;),{unit:&quot;EUR&quot;,placeholder:t(&quot;Shipping quote&quot;,&quot;Devis de fret&quot;)})+&#x27;&lt;\/div&gt;&lt;div class=&quot;fee-proposal&quot;&gt;&lt;span&gt;&#x27;+t(&quot;TOPRANK service fee&quot;,&quot;Honoraires TOPRANK&quot;)+&quot;&lt;\/span&gt;&lt;strong&gt;&quot;+(state.koreaAgencyEUR===null?t(&quot;Not priced&quot;,&quot;Non chiffr\\xe9&quot;):money(E.numeric(state.koreaAgencyEUR)))+&quot;&lt;\/strong&gt;&lt;small&gt;&quot;+t(&quot;Indicative fee: \\u20ac1,800 including VAT for standard sourcing. Your written quotation confirms the final amount; you can enter it below.&quot;,&quot;Honoraires indicatifs : 1 800 \\u20ac TTC pour une recherche standard. Le devis \\xe9crit confirme le montant final ; vous pouvez le saisir ci-dessous.&quot;)+&quot;&lt;\/small&gt;&lt;\/div&gt;&quot;}function preparation(){const opts=state.destination===&quot;FR&quot;?[&quot;unconfirmed&quot;,&quot;collection&quot;,&quot;avdt&quot;,&quot;rti&quot;,&quot;coc&quot;,&quot;local_quote&quot;]:[&quot;unconfirmed&quot;,&quot;coc&quot;,&quot;local_quote&quot;];let s=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Service allowances for a vehicle purchased with TOPRANK. Standalone homologation has a separate tariff.&quot;,&quot;Provisions de service pour un v\\xe9hicule achet\\xe9 avec TOPRANK. L\\u2019homologation seule suit un tarif distinct.&quot;)+&#x27;&lt;\/p&gt;&lt;div class=&quot;fields&quot;&gt;&#x27;+select(&quot;approvalRoute&quot;,t(&quot;Approval \/ registration support&quot;,&quot;Accompagnement homologation \/ immatriculation&quot;),opts.map(v=&gt;[v,routes()[v]]))+select(&quot;maintenance&quot;,t(&quot;Maintenance reserve \\u2014 optional&quot;,&quot;Provision d\\u2019entretien \\u2014 facultatif&quot;),[[&quot;none&quot;,t(&quot;Not included&quot;,&quot;Non incluse&quot;)],[&quot;standard&quot;,t(&quot;\\u20ac1,000 reserve&quot;,&quot;Provision de 1 000 \\u20ac&quot;)],[&quot;performance&quot;,t(&quot;\\u20ac2,500 reserve&quot;,&quot;Provision de 2 500 \\u20ac&quot;)],[&quot;custom&quot;,t(&quot;Custom amount&quot;,&quot;Montant personnalis\\xe9&quot;)]])+(state.maintenance===&quot;custom&quot;?field(&quot;maintenanceEUR&quot;,t(&quot;Maintenance reserve&quot;,&quot;Provision d\\u2019entretien&quot;),&quot;&quot;,{unit:&quot;EUR&quot;}):&quot;&quot;)+&quot;&lt;\/div&gt;&quot;;if(state.approvalRoute===&quot;rti&quot;)s+=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;\\u20ac1,400 covers RTI management only. COC, tests, transport, parts and registration are separate. The team determines the route from the vehicle file.&quot;,&quot;Les 1 400 \\u20ac couvrent uniquement la gestion RTI. COC, essais, transport, pi\\xe8ces et immatriculation sont s\\xe9par\\xe9s. L\\u2019\\xe9quipe d\\xe9termine le parcours \\xe0 partir du dossier.&quot;)+&quot;&lt;\/p&gt;&quot;;else if(state.approvalRoute===&quot;avdt&quot;)s+=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;\\u20ac3,000 is the German registration + AVDT service allowance for a France-bound project. Final French acceptance and additional work require vehicle review.&quot;,&quot;Les 3 000 \\u20ac correspondent \\xe0 la provision de service pour l\\u2019immatriculation allemande + AVDT d\\u2019un projet destin\\xe9 \\xe0 la France. L\\u2019acceptation finale et les travaux annexes d\\xe9pendent de l\\u2019\\xe9tude du v\\xe9hicule.&quot;)+&quot;&lt;\/p&gt;&quot;;else if(state.approvalRoute===&quot;collection&quot;)s+=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;\\u20ac500 is a service allowance, not the official FFVE fee or confirmation of collector status.&quot;,&quot;Les 500 \\u20ac sont une provision de service, pas le tarif officiel FFVE ni une confirmation du statut collection.&quot;)+&quot;&lt;\/p&gt;&quot;;return s}function advancedCosts(){let s=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Enter any known additional budgets. Blank means unpriced and excluded; enter 0 only when you have confirmed no extra cost. Amounts included in another quote must not be entered again.&quot;,&quot;Saisissez les budgets suppl\\xe9mentaires connus. Vide signifie non chiffr\\xe9 et exclu ; indiquez 0 uniquement si l\\u2019absence de frais est confirm\\xe9e. Ne ressaisissez pas un montant d\\xe9j\\xe0 inclus dans un autre devis.&quot;)+&#x27;&lt;\/p&gt;&lt;div class=&quot;fields&quot;&gt;&#x27;;if(state.source===&quot;KR&quot;)s+=field(&quot;brokerExtrasEUR&quot;,label(&quot;broker_extras&quot;),&quot;&quot;,{unit:&quot;EUR&quot;})+field(&quot;koreaAgencyEUR&quot;,t(&quot;Service fee quoted to you&quot;,&quot;Honoraires du devis client&quot;),t(&quot;Indicative \\u20ac1,800 including VAT, or the amount in your quotation.&quot;,&quot;Montant indicatif de 1 800 \\u20ac TTC, ou montant de votre devis.&quot;),{unit:&quot;EUR&quot;});s+=field(&quot;approvalQuoteEUR&quot;,t(&quot;Approval service budget&quot;,&quot;Budget du service d\\u2019homologation&quot;),t(&quot;With a selected service allowance, blank retains that amount. Enter a different budget to replace it.&quot;,&quot;Si une provision de service est choisie, le champ vide conserve ce montant. Saisissez un autre budget pour le remplacer.&quot;),{unit:&quot;EUR&quot;});for(const key of budgetKeys){const id={portEUR:&quot;port&quot;,transportEUR:&quot;transport&quot;,registrationEUR:&quot;registration&quot;,co2EUR:&quot;co2&quot;,cocEUR:&quot;coc&quot;,utacEUR:&quot;utac&quot;,approvalTransportEUR:&quot;approval_transport&quot;,partsEUR:&quot;parts&quot;,lightingEUR:&quot;lighting&quot;,otherEUR:&quot;other&quot;}[key];if(key===&quot;co2EUR&quot;&amp;&amp;![&quot;FR&quot;,&quot;CH&quot;].includes(state.destination))continue;s+=field(key,key===&quot;portEUR&quot;?t(&quot;Arrival costs&quot;,&quot;Frais \\xe0 l\\u2019arriv\\xe9e&quot;):label(id),key===&quot;portEUR&quot;&amp;&amp;state.destination===&quot;FR&quot;?t(&quot;Indicative \\u20ac852.60 allowance \\u2014 editable to match your quote.&quot;,&quot;Provision indicative de 852,60 \\u20ac \\u2014 modifiable selon votre devis.&quot;):&quot;&quot;,{unit:&quot;EUR&quot;})}s+=&quot;&lt;\/div&gt;&quot;;return s}function marketDetails(){let s=&#x27;&lt;div class=&quot;fields&quot;&gt;&#x27;;if(state.source===&quot;JP&quot;){if(state.shipping===&quot;container&quot;)s+=field(&quot;containerUSD&quot;,t(&quot;Container freight&quot;,&quot;Fret du conteneur&quot;),&quot;&quot;,{unit:&quot;USD&quot;})+field(&quot;sharedCars&quot;,t(&quot;Cars sharing the container&quot;,&quot;Voitures dans le conteneur&quot;),&quot;&quot;,{min:1,step:1});s+=select(&quot;areaJPY&quot;,t(&quot;Normal inland transport budget&quot;,&quot;Budget du transport int\\xe9rieur normal&quot;),[3e4,5e4,8e4].map(v=&gt;[v,money(v,&quot;JPY&quot;)]));if(state.mode===&quot;reverse&quot;)s+=field(&quot;bidIncrementJPY&quot;,t(&quot;Auction bid increment&quot;,&quot;Pas d\\u2019ench\\xe8re&quot;),&quot;&quot;,{unit:&quot;JPY&quot;,min:1,step:1});if(state.package!==&quot;premium&quot;)s+=field(&quot;inspectionCount&quot;,t(&quot;Pre-purchase inspections \\xb7 \\u20ac50 each&quot;,&quot;Inspections avant achat \\xb7 50 \\u20ac chacune&quot;),&quot;&quot;,{step:1});s+=&quot;&lt;\/div&gt;&quot;+(state.package===&quot;standard&quot;?check(&quot;postInspection&quot;,t(&quot;Separately quoted post-purchase inspection \\xb7 \\u20ac400&quot;,&quot;Inspection apr\\xe8s achat sur devis s\\xe9par\\xe9 \\xb7 400 \\u20ac&quot;)):&quot;&quot;);s+=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Only add a separate inspection if it is not already included in your package.&quot;,&quot;Ajoutez uniquement une inspection s\\xe9par\\xe9e si elle n\\u2019est pas d\\xe9j\\xe0 incluse dans votre formule.&quot;)+&quot;&lt;\/p&gt;&quot;}else{s+=select(&quot;koreanInvoiceCurrency&quot;,t(&quot;Actual vehicle invoice currency&quot;,&quot;Devise r\\xe9elle de la facture du v\\xe9hicule&quot;),[[&quot;EUR&quot;,t(&quot;EUR \\u2014 broker quote&quot;,&quot;EUR \\u2014 devis du courtier&quot;)],[&quot;KRW&quot;,t(&quot;KRW \\u2014 actual won invoice&quot;,&quot;KRW \\u2014 facture r\\xe9elle en wons&quot;)]],t(&quot;A fixed EUR quote never changes with the won exchange rate.&quot;,&quot;Un devis fixe en euros ne varie jamais avec le cours du won.&quot;));if(state.mode===&quot;reverse&quot;)s+=field(state.koreanInvoiceCurrency===&quot;EUR&quot;?&quot;quoteIncrementEUR&quot;:&quot;bidIncrementKRW&quot;,t(&quot;Purchase-price increment&quot;,&quot;Pas du prix d\\u2019achat&quot;),&quot;&quot;,{unit:state.koreanInvoiceCurrency,min:state.koreanInvoiceCurrency===&quot;EUR&quot;?.01:1,step:state.koreanInvoiceCurrency===&quot;EUR&quot;?.01:1});s+=&#x27;&lt;div class=&quot;field&quot;&gt;&lt;label for=&quot;krwComparison&quot;&gt;&#x27;+t(&quot;Compare a Korean listing \\xb7 KRW&quot;,&quot;Comparer une annonce cor\\xe9enne \\xb7 KRW&quot;)+&#x27;&lt;\/label&gt;&lt;input id=&quot;krwComparison&quot; type=&quot;number&quot; min=&quot;0&quot; step=&quot;1&quot; inputmode=&quot;decimal&quot; value=&quot;&#x27;+esc(comparison)+&#x27;&quot;&gt;&lt;small id=&quot;comparison-result&quot;&gt;&lt;\/small&gt;&lt;\/div&gt;&lt;\/div&gt;&#x27;}return s}function taxDetails(){let s=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;The standard scenario assumes import clearance in your selected country. An arrival port does not add a second country\\u2019s import tax. TOPRANK confirms the route and taxable costs before purchase.&quot;,&quot;Le sc\\xe9nario standard pr\\xe9voit le d\\xe9douanement dans le pays choisi. Le port d\\u2019arriv\\xe9e n\\u2019ajoute pas les taxes d\\u2019un second pays. TOPRANK confirme le parcours et les frais taxables avant achat.&quot;)+&quot;&lt;\/p&gt;&quot;;if(state.destination===&quot;CH&quot;)return s+&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Switzerland: 0% ordinary customs duty, 4% automobile tax and 8.1% VAT. Vehicle age alone does not remove these taxes. Registration and any CO\\u2082 sanction are separate.&quot;,&quot;Suisse : 0 % de droits ordinaires, 4 % d\\u2019imp\\xf4t automobile et 8,1 % de TVA. L\\u2019\\xe2ge seul ne supprime pas ces taxes. L\\u2019immatriculation et l\\u2019\\xe9ventuelle sanction CO\\u2082 sont s\\xe9par\\xe9es.&quot;)+&quot;&lt;\/p&gt;&quot;;s+=&#x27;&lt;div class=&quot;fields&quot;&gt;&#x27;+select(&quot;taxScenario&quot;,t(&quot;Tax scenario to compare&quot;,&quot;Sc\\xe9nario fiscal \\xe0 comparer&quot;),[[&quot;ordinary&quot;,t(&quot;Standard import&quot;,&quot;Importation standard&quot;)],[&quot;collector&quot;,t(&quot;Collector classification \\u2014 conditional&quot;,&quot;Classement collection \\u2014 sous conditions&quot;)],[&quot;preferential&quot;,t(&quot;Preferential origin \\u2014 conditional&quot;,&quot;Origine pr\\xe9f\\xe9rentielle \\u2014 sous conditions&quot;)]]);if(state.taxScenario===&quot;preferential&quot;)s+=select(&quot;originPays&quot;,t(&quot;Claimed manufacturing origin&quot;,&quot;Origine de fabrication d\\xe9clar\\xe9e&quot;),[[&quot;unknown&quot;,t(&quot;Unknown \/ other&quot;,&quot;Inconnue \/ autre&quot;)],[&quot;JP&quot;,t(&quot;Japan&quot;,&quot;Japon&quot;)],[&quot;KR&quot;,t(&quot;South Korea&quot;,&quot;Cor\\xe9e du Sud&quot;)]]);s+=&quot;&lt;\/div&gt;&quot;;s+=&#x27;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Reduced rates are a conditional comparison only. Age, brand or purchase country is not proof. A written review of classification\/origin documents is required; ordinary rates remain available.&quot;,&quot;Les taux r\\xe9duits servent uniquement \\xe0 une comparaison sous conditions. L\\u2019\\xe2ge, la marque ou le pays d\\u2019achat ne sont pas des justificatifs. Une v\\xe9rification \\xe9crite du classement ou de l\\u2019origine est n\\xe9cessaire ; les taux standards restent disponibles.&quot;)+&quot;&lt;\/p&gt;&quot;;return s}function rateDescription(){if(rateState===&quot;loading&quot;)return t(&quot;Checking daily reference rates\\u2026&quot;,&quot;V\\xe9rification des taux de r\\xe9f\\xe9rence quotidiens\\u2026&quot;);if(!rateInfo||rateInfo.rateDate===null)return t(&quot;Planning fallback rates. Verify them before relying on this estimate.&quot;,&quot;Taux de simulation de secours. V\\xe9rifiez-les avant d\\u2019utiliser cette estimation.&quot;);return t(&quot;Reference date: &quot;,&quot;Date de r\\xe9f\\xe9rence : &quot;)+new Intl.DateTimeFormat(lang===&quot;fr&quot;?&quot;fr-FR&quot;:&quot;en-GB&quot;,{year:&quot;numeric&quot;,month:&quot;short&quot;,day:&quot;numeric&quot;,timeZone:&quot;UTC&quot;}).format(new Date(rateInfo.rateDate+&quot;T00:00:00Z&quot;))+&quot; \\xb7 &quot;+rateInfo.source+(rateInfo.stale?t(&quot; \\xb7 cached rates; check before purchase&quot;,&quot; \\xb7 taux conserv\\xe9s ; \\xe0 v\\xe9rifier avant achat&quot;):&quot;&quot;)+(manualFX.size?t(&quot; \\xb7 your manual rates retained&quot;,&quot; \\xb7 vos taux manuels sont conserv\\xe9s&quot;):&quot;&quot;)}function rateDetails(){return&#x27;&lt;p id=&quot;rate-status&quot; class=&quot;helper&quot;&gt;&#x27;+esc(rateDescription())+&#x27;&lt;\/p&gt;&lt;div class=&quot;fields&quot;&gt;&#x27;+fxKeys.map(k=&gt;field(k,{eurJPY:&quot;1 EUR \\u2192 JPY&quot;,usdJPY:&quot;1 USD \\u2192 JPY&quot;,eurKRW:&quot;1 EUR \\u2192 KRW&quot;,eurCHF:&quot;1 EUR \\u2192 CHF&quot;}[k],&quot;&quot;,{min:.001,step:&quot;any&quot;})).join(&quot;&quot;)+&#x27;&lt;\/div&gt;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Reference rates are for budgeting; bank and customs rates can differ.&quot;,&quot;Les taux de r\\xe9f\\xe9rence servent au budget ; les taux bancaires et douaniers peuvent diff\\xe9rer.&quot;)+&#x27;&lt;\/p&gt;&lt;button type=&quot;button&quot; id=&quot;reset-rates&quot; class=&quot;text-button&quot;&gt;&#x27;+t(&quot;Use reference rates&quot;,&quot;Utiliser les taux de r\\xe9f\\xe9rence&quot;)+&quot;&lt;\/button&gt;&quot;}function render(){const opens=new Set([...document.querySelectorAll(&quot;details[open]&quot;)].map(d=&gt;d.id)),focus=document.activeElement?.id,selection=document.activeElement?.selectionStart;document.documentElement.lang=lang;document.title=t(&quot;Import calculator \\u2014 TOPRANK&quot;,&quot;Calculateur d\\u2019importation \\u2014 TOPRANK&quot;);app.innerHTML=&#x27;&lt;div class=&quot;shell&quot;&gt;&lt;header class=&quot;intro&quot;&gt;&lt;div class=&quot;eyebrow-row&quot;&gt;&lt;span class=&quot;eyebrow&quot;&gt;TOPRANK EUROPE&lt;\/span&gt;&lt;div class=&quot;languages&quot; role=&quot;group&quot; aria-label=&quot;&#x27;+t(&quot;Language&quot;,&quot;Langue&quot;)+&#x27;&quot;&gt;&lt;button type=&quot;button&quot; data-lang=&quot;en&quot; aria-pressed=&quot;&#x27;+(lang===&quot;en&quot;)+&#x27;&quot;&gt;EN&lt;\/button&gt;&lt;button type=&quot;button&quot; data-lang=&quot;fr&quot; aria-pressed=&quot;&#x27;+(lang===&quot;fr&quot;)+&#x27;&quot;&gt;FR&lt;\/button&gt;&lt;\/div&gt;&lt;\/div&gt;&lt;h1&gt;&#x27;+t(&quot;Your import budget.&quot;,&quot;Votre budget d\\u2019importation.&quot;)+&quot;&lt;\/h1&gt;&lt;p&gt;&quot;+t(&quot;Start with a vehicle price or a total budget. Adjust the details when you have them.&quot;,&quot;Partez d\\u2019un prix de v\\xe9hicule ou d\\u2019un budget total. Pr\\xe9cisez les d\\xe9tails \\xe0 votre rythme.&quot;)+&#x27;&lt;\/p&gt;&lt;\/header&gt;&lt;div class=&quot;calculator-grid&quot;&gt;&lt;form id=&quot;calculator-form&quot; novalidate&gt;&lt;section class=&quot;card&quot;&gt;&lt;div class=&quot;mode-switch&quot; role=&quot;group&quot; aria-label=&quot;&#x27;+t(&quot;Calculation direction&quot;,&quot;Sens du calcul&quot;)+&#x27;&quot;&gt;&lt;button type=&quot;button&quot; data-mode=&quot;forward&quot; aria-pressed=&quot;&#x27;+(state.mode===&quot;forward&quot;)+&#x27;&quot;&gt;&#x27;+t(&quot;I have a vehicle price&quot;,&quot;J\\u2019ai un prix de v\\xe9hicule&quot;)+&#x27;&lt;\/button&gt;&lt;button type=&quot;button&quot; data-mode=&quot;reverse&quot; aria-pressed=&quot;&#x27;+(state.mode===&quot;reverse&quot;)+&#x27;&quot;&gt;&#x27;+t(&quot;I have a total budget&quot;,&quot;J\\u2019ai un budget total&quot;)+&#x27;&lt;\/button&gt;&lt;\/div&gt;&lt;div class=&quot;fields&quot;&gt;&#x27;+select(&quot;source&quot;,t(&quot;Purchase market&quot;,&quot;March\\xe9 d\\u2019achat&quot;),[[&quot;JP&quot;,t(&quot;Japan&quot;,&quot;Japon&quot;)],[&quot;KR&quot;,t(&quot;South Korea&quot;,&quot;Cor\\xe9e du Sud&quot;)]])+select(&quot;destination&quot;,t(&quot;Import country&quot;,&quot;Pays d\\u2019importation&quot;),countries())+&#x27;&lt;\/div&gt;&lt;div class=&quot;main-price&quot;&gt;&#x27;+priceBlock()+ageField()+&#x27;&lt;\/div&gt;&lt;\/section&gt;&lt;section class=&quot;card&quot;&gt;&lt;h2&gt;&#x27;+t(&quot;Service &amp; shipping&quot;,&quot;Service et transport&quot;)+&quot;&lt;\/h2&gt;&quot;+(state.source===&quot;JP&quot;?japanBlock():koreaBlock())+&#x27;&lt;\/section&gt;&lt;section class=&quot;card&quot;&gt;&lt;h2&gt;&#x27;+t(&quot;Approval &amp; preparation&quot;,&quot;Homologation et pr\\xe9paration&quot;)+&quot;&lt;\/h2&gt;&quot;+preparation()+&quot;&lt;\/section&gt;&quot;+detail(&quot;additional-budgets&quot;,t(&quot;Add known costs and preparation budgets&quot;,&quot;Ajouter les frais et budgets de pr\\xe9paration connus&quot;),advancedCosts())+detail(&quot;market-details&quot;,t(&quot;More purchase and shipping options&quot;,&quot;Autres options d\\u2019achat et de transport&quot;),marketDetails())+detail(&quot;valuation-details&quot;,t(&quot;Customs vehicle value \\u2014 optional&quot;,&quot;Valeur douani\\xe8re du v\\xe9hicule \\u2014 facultatif&quot;),valuationDetails())+detail(&quot;tax-details&quot;,t(&quot;Tax assumptions&quot;,&quot;Hypoth\\xe8ses fiscales&quot;),taxDetails())+detail(&quot;fx-details&quot;,t(&quot;Exchange rates&quot;,&quot;Taux de change&quot;),rateDetails())+&#x27;&lt;div id=&quot;form-error&quot; class=&quot;form-error&quot; role=&quot;alert&quot;&gt;&lt;\/div&gt;&lt;\/form&gt;&lt;aside class=&quot;summary-column&quot; aria-label=&quot;&#x27;+t(&quot;Live estimate&quot;,&quot;Estimation actualis\\xe9e&quot;)+&#x27;&quot;&gt;&lt;div id=&quot;estimate-summary&quot; class=&quot;summary&quot;&gt;&lt;\/div&gt;&lt;\/aside&gt;&lt;\/div&gt;&lt;footer class=&quot;fine-print&quot;&gt;&#x27;+t(&quot;The customer imports the vehicle and TOPRANK provides import support. Figures are planning amounts; the written quote confirms the scope, costs and applicable VAT. Annual ownership taxes and insurance are separate.&quot;,&quot;Le client importe le v\\xe9hicule et TOPRANK l\\u2019accompagne. Les montants servent \\xe0 pr\\xe9parer le budget ; le devis \\xe9crit confirme le p\\xe9rim\\xe8tre, les frais et la TVA applicable. Les taxes annuelles et l\\u2019assurance d\\u2019usage sont s\\xe9par\\xe9es.&quot;)+&#x27;&lt;p class=&quot;service-links&quot;&gt;&lt;a href=&quot;&#x27;+HOST+(lang===&quot;fr&quot;?&quot;\/fr&quot;:&quot;&quot;)+&#x27;\/cost-calculator\/&quot; target=&quot;_top&quot;&gt;&#x27;+t(&quot;Import calculator&quot;,&quot;Calculateur d\\u2019importation&quot;)+&#x27;&lt;\/a&gt; \\xb7 &lt;a href=&quot;&#x27;+HOST+(lang===&quot;fr&quot;?&quot;\/fr&quot;:&quot;&quot;)+&#x27;\/homologation-service\/&quot; target=&quot;_top&quot;&gt;&#x27;+t(&quot;Homologation services&quot;,&quot;Services d\\u2019homologation&quot;)+&#x27;&lt;\/a&gt; \\xb7 &lt;a href=&quot;&#x27;+HOST+(lang===&quot;fr&quot;?&quot;\/fr&quot;:&quot;&quot;)+&#x27;\/korea-purchase-service\/&quot; target=&quot;_top&quot;&gt;&#x27;+t(&quot;Import from Korea&quot;,&quot;Importation depuis la Cor\\xe9e&quot;)+&#x27;&lt;\/a&gt;&lt;\/p&gt;&lt;\/footer&gt;&lt;div id=&quot;result-announcer&quot; class=&quot;sr-only&quot; aria-live=&quot;polite&quot; aria-atomic=&quot;true&quot;&gt;&lt;\/div&gt;&lt;\/div&gt;&#x27;;opens.forEach(id=&gt;{const d=document.getElementById(id);if(d)d.open=true});bind();update();if(focus){const el=document.getElementById(focus);if(el){el.focus({preventScroll:true});if(selection!==null&amp;&amp;selection!==undefined&amp;&amp;el.type===&quot;text&quot;)el.setSelectionRange(selection,selection)}}queueGeometry()}function toEngine(){return{...state,extras:[]}}function excludedGroups(r){const ids=new Set(r.pending.map(p=&gt;p.id)),groups=[];if([...ids].some(id=&gt;[&quot;approval&quot;,&quot;approval_route&quot;,&quot;coc&quot;,&quot;utac&quot;,&quot;approval_transport&quot;,&quot;parts&quot;,&quot;lighting&quot;,&quot;registration&quot;,&quot;co2&quot;].includes(id)))groups.push(t(&quot;approval, registration, tests or vehicle modifications not yet priced&quot;,&quot;homologation, immatriculation, essais ou modifications non chiffr\\xe9s&quot;));if([...ids].some(id=&gt;[&quot;shipping&quot;,&quot;broker_extras&quot;,&quot;port&quot;,&quot;transport&quot;,&quot;other&quot;,&quot;agency&quot;].includes(id)))groups.push(t(&quot;any unpriced shipping, delivery or other quoted fees&quot;,&quot;le fret, la livraison ou les autres frais sans devis&quot;));return groups}function summaryRows(r){const groups=[[&quot;purchase&quot;,t(&quot;Vehicle &amp; source costs&quot;,&quot;V\\xe9hicule et frais sur place&quot;),[&quot;vehicle&quot;,&quot;japan_fees&quot;,&quot;vehicle_class&quot;,&quot;broker_extras&quot;]],[&quot;shipping&quot;,t(&quot;Shipping &amp; arrival&quot;,&quot;Transport et arriv\\xe9e&quot;),[&quot;shipping&quot;,&quot;insurance&quot;,&quot;port&quot;,&quot;transport&quot;]],[&quot;service&quot;,t(&quot;TOPRANK &amp; inspections&quot;,&quot;TOPRANK et inspections&quot;),[&quot;agency&quot;,&quot;inspections&quot;]],[&quot;taxes&quot;,t(&quot;Import taxes&quot;,&quot;Taxes \\xe0 l\\u2019importation&quot;),[&quot;duty&quot;,&quot;automobile_tax&quot;,&quot;import_vat&quot;]],[&quot;preparation&quot;,t(&quot;Priced preparation&quot;,&quot;Pr\\xe9paration chiffr\\xe9e&quot;),[&quot;approval&quot;,&quot;coc&quot;,&quot;utac&quot;,&quot;approval_transport&quot;,&quot;parts&quot;,&quot;registration&quot;,&quot;co2&quot;,&quot;lighting&quot;,&quot;maintenance&quot;,&quot;other&quot;]]];const rounding=r.lines.find(l=&gt;l.id===&quot;rounding&quot;)?.cents||0;return groups.map(([id,title,ids])=&gt;{const lines=r.lines.filter(l=&gt;ids.includes(l.id)),cents=lines.reduce((n,l)=&gt;n+l.cents,0)+(id===&quot;purchase&quot;?rounding:0),unknown=lines.some(l=&gt;l.status===&quot;pending&quot;&amp;&amp;l.unpriced);return`&lt;div class=&quot;summary-row&quot; data-cost-group=&quot;${id}&quot;&gt;&lt;span&gt;${esc(title)}${unknown?&quot; &lt;small&gt;&quot;+t(&quot;partial&quot;,&quot;partiel&quot;)+&quot;&lt;\/small&gt;&quot;:&quot;&quot;}&lt;\/span&gt;&lt;strong&gt;${money(cents\/100)}&lt;\/strong&gt;&lt;\/div&gt;`}).join(&quot;&quot;)}function breakdown(r){return&#x27;&lt;div class=&quot;breakdown&quot;&gt;&#x27;+r.lines.filter(l=&gt;l.cents||l.status===&quot;pending&quot;).map(l=&gt;&quot;&lt;div&gt;&lt;span&gt;&quot;+esc(label(l.id))+&quot;&lt;\/span&gt;&lt;strong&gt;&quot;+(l.unpriced&amp;&amp;l.status===&quot;pending&quot;?t(&quot;Not priced&quot;,&quot;Non chiffr\\xe9&quot;):money(l.cents\/100))+&quot;&lt;\/strong&gt;&lt;\/div&gt;&quot;).join(&quot;&quot;)+&#x27;&lt;\/div&gt;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Customs duty &quot;,&quot;Droits de douane &quot;)+r.taxes.dutyRate+&quot;% \\xb7 &quot;+t(&quot;VAT &quot;,&quot;TVA &quot;)+r.taxes.vatRate+&quot;%&quot;+(state.destination===&quot;CH&quot;?&quot; \\xb7 &quot;+t(&quot;Automobile tax &quot;,&quot;Imp\\xf4t automobile &quot;)+r.taxes.autoTaxRate+&quot;%&quot;:&quot;&quot;)+&quot;. &quot;+(r.taxes.conditional?t(&quot;Reduced rates remain conditional on document review.&quot;,&quot;Les taux r\\xe9duits restent soumis \\xe0 la v\\xe9rification des documents.&quot;):&quot;&quot;)+&quot;&lt;\/p&gt;&quot;}function update(announce=false){const ageNote=document.getElementById(&quot;age-scenario&quot;);if(ageNote)ageNote.textContent=state.destination===&quot;FR&quot;&amp;&amp;state.taxScenario===&quot;collector&quot;?t(&quot;Conditional collector scenario: 0% duty \/ 5.5% import VAT. Age alone does not establish eligibility.&quot;,&quot;Sc\\xe9nario collection sous conditions : 0 % de droits \/ 5,5 % de TVA \\xe0 l\\u2019importation. L\\u2019\\xe2ge seul ne suffit pas \\xe0 \\xe9tablir l\\u2019\\xe9ligibilit\\xe9.&quot;):&quot;&quot;;const taxSelect=document.getElementById(&quot;taxScenario&quot;);if(taxSelect){taxSelect.value=state.taxScenario;const collector=taxSelect.querySelector(&quot;option[value=collector]&quot;);if(collector)collector.disabled=underCollectorAge()}const fee=document.querySelector(&quot;.fee-proposal strong&quot;);if(fee)fee.textContent=state.koreaAgencyEUR===null?t(&quot;Not priced&quot;,&quot;Non chiffr\\xe9&quot;):Number.isFinite(E.numeric(state.koreaAgencyEUR))?money(E.numeric(state.koreaAgencyEUR)):t(&quot;Check amount&quot;,&quot;V\\xe9rifiez le montant&quot;);last=E.estimate(toEngine(),config);const box=document.getElementById(&quot;estimate-summary&quot;),oldOpen=document.getElementById(&quot;cost-breakdown&quot;)?.open;document.querySelectorAll(&quot;[name]&quot;).forEach(el=&gt;el.setAttribute(&quot;aria-invalid&quot;,last.errors&amp;&amp;last.errors[el.name]?&quot;true&quot;:&quot;false&quot;));const err=document.getElementById(&quot;form-error&quot;);err.textContent=&quot;&quot;;if(!last.valid){box.innerHTML=&quot;&lt;h2&gt;&quot;+t(&quot;Your estimate&quot;,&quot;Votre estimation&quot;)+&#x27;&lt;\/h2&gt;&lt;p class=&quot;estimate-error&quot;&gt;&#x27;+t(&quot;Enter a valid amount in the highlighted field to update the estimate.&quot;,&quot;Saisissez un montant valide dans le champ signal\\xe9 pour actualiser l\\u2019estimation.&quot;)+&quot;&lt;\/p&gt;&quot;;err.textContent=t(&quot;Check the highlighted amounts.&quot;,&quot;V\\xe9rifiez les montants signal\\xe9s.&quot;);queueGeometry();return}if(!last.result){box.innerHTML=&quot;&lt;h2&gt;&quot;+t(&quot;Your budget is below the priced costs&quot;,&quot;Votre budget est inf\\xe9rieur aux frais chiffr\\xe9s&quot;)+&quot;&lt;\/h2&gt;&lt;p&gt;&quot;+t(&quot;Increase the budget or review the entered costs. The minimum for this purchase increment is &quot;,&quot;Augmentez le budget ou v\\xe9rifiez les frais saisis. Le minimum pour ce pas d\\u2019achat est &quot;)+money(last.reverse.minimumBudgetEUR)+&#x27;.&lt;\/p&gt;&lt;p class=&quot;helper&quot;&gt;&#x27;+t(&quot;Unpriced expenses may require an additional budget.&quot;,&quot;Les frais non chiffr\\xe9s peuvent n\\xe9cessiter un budget suppl\\xe9mentaire.&quot;)+&quot;&lt;\/p&gt;&quot;;queueGeometry();return}const r=last.result,reverse=last.reverse,groups=excludedGroups(r),mainValue=reverse?money(reverse.maxPurchase,reverse.currency):money(r.totalCents\/100),mainLabel=reverse?t(&quot;Provisional vehicle-price ceiling&quot;,&quot;Plafond provisoire du prix du v\\xe9hicule&quot;):t(&quot;Estimated import budget&quot;,&quot;Budget d\\u2019importation estim\\xe9&quot;);box.innerHTML=&#x27;&lt;div class=&quot;summary-head&quot;&gt;&lt;span class=&quot;eyebrow&quot;&gt;&#x27;+t(&quot;YOUR ESTIMATE&quot;,&quot;VOTRE ESTIMATION&quot;)+&#x27;&lt;\/span&gt;&lt;span class=&quot;estimate-tag&quot;&gt;&#x27;+t(&quot;Provisional&quot;,&quot;Provisoire&quot;)+&quot;&lt;\/span&gt;&lt;\/div&gt;&lt;h2&gt;&quot;+mainLabel+&#x27;&lt;\/h2&gt;&lt;p class=&quot;main-total&quot; id=&quot;main-total&quot;&gt;&#x27;+mainValue+&quot;&lt;\/p&gt;&quot;+(reverse?&#x27;&lt;p class=&quot;summary-sub&quot;&gt;&#x27;+t(&quot;Estimated total used: &quot;,&quot;Total estim\\xe9 utilis\\xe9 : &quot;)+money(r.totalCents\/100)+&quot;&lt;br&gt;&quot;+t(&quot;Budget remaining: &quot;,&quot;Budget restant : &quot;)+money(reverse.headroomCents\/100)+&quot;&lt;\/p&gt;&quot;:&quot;&quot;)+(state.destination===&quot;CH&quot;?&#x27;&lt;p class=&quot;chf-total&quot; id=&quot;chf-total&quot;&gt;&#x27;+t(&quot;Total equivalent: &quot;,&quot;\\xc9quivalent du total : &quot;)+money(r.totalCHFCents\/100,&quot;CHF&quot;)+&quot;&lt;\/p&gt;&quot;:&quot;&quot;)+&#x27;&lt;div class=&quot;cost-groups&quot;&gt;&#x27;+summaryRows(r)+&#x27;&lt;\/div&gt;&lt;div class=&quot;estimate-callout&quot;&gt;&lt;strong&gt;&#x27;+t(&quot;Before you buy&quot;,&quot;Avant l\\u2019achat&quot;)+&quot;&lt;\/strong&gt;&lt;p&gt;&quot;+t(&quot;TOPRANK confirms the quotation and tax assumptions. &quot;,&quot;TOPRANK confirme le devis et les hypoth\\xe8ses fiscales. &quot;)+(groups.length?t(&quot;This total excludes &quot;,&quot;Ce total exclut &quot;)+groups.join(t(&quot;; &quot;,&quot; ; &quot;))+&quot;.&quot;:t(&quot;Entered allowances remain estimates.&quot;,&quot;Les provisions saisies restent estimatives.&quot;))+(state.customsVehicleValue!==null?&quot; &quot;+t(&quot;The separate documented vehicle valuation requires customs acceptance; the actual purchase price remains in this budget.&quot;,&quot;La valeur justifi\\xe9e distincte requiert l\\u2019acceptation de la douane ; le prix d\\u2019achat r\\xe9el reste inclus dans ce budget.&quot;):&quot;&quot;)+(reverse?&quot; &quot;+t(&quot;The ceiling excludes those unpriced costs.&quot;,&quot;Le plafond exclut ces frais non chiffr\\xe9s.&quot;):&quot;&quot;)+&quot;&lt;\/p&gt;&lt;\/div&gt;&quot;+detail(&quot;cost-breakdown&quot;,t(&quot;See the cost breakdown&quot;,&quot;Voir le d\\xe9tail des co\\xfbts&quot;),breakdown(r))+&#x27;&lt;div class=&quot;summary-actions&quot;&gt;&lt;button type=&quot;button&quot; class=&quot;primary&quot; id=&quot;copy-estimate&quot;&gt;&#x27;+t(&quot;Copy my estimate&quot;,&quot;Copier mon estimation&quot;)+&#x27;&lt;\/button&gt;&lt;a class=&quot;secondary&quot; id=&quot;contact-link&quot; href=&quot;&#x27;+HOST+(lang===&quot;fr&quot;?&quot;\/fr\/contact\/&quot;:&quot;\/contact\/&quot;)+&#x27;&quot; target=&quot;_top&quot;&gt;&#x27;+t(&quot;Review my project with TOPRANK&quot;,&quot;\\xc9tudier mon projet avec TOPRANK&quot;)+&#x27;&lt;\/a&gt;&lt;\/div&gt;&lt;p id=&quot;copy-status&quot; class=&quot;copy-status&quot; role=&quot;status&quot;&gt;&lt;\/p&gt;&lt;textarea id=&quot;copy-output&quot; hidden readonly aria-label=&quot;&#x27;+t(&quot;Estimate to copy&quot;,&quot;Estimation \\xe0 copier&quot;)+&#x27;&quot;&gt;&lt;\/textarea&gt;&lt;p class=&quot;rate-footnote&quot;&gt;&#x27;+esc(rateDescription())+&quot;&lt;\/p&gt;&quot;;if(oldOpen)document.getElementById(&quot;cost-breakdown&quot;).open=true;document.getElementById(&quot;cost-breakdown&quot;).addEventListener(&quot;toggle&quot;,queueGeometry);document.getElementById(&quot;copy-estimate&quot;).addEventListener(&quot;click&quot;,copyEstimate);comparisonText();if(announce){clearTimeout(announcerTimer);announcerTimer=setTimeout(()=&gt;{const el=document.getElementById(&quot;result-announcer&quot;);if(el)el.textContent=mainLabel+&quot;: &quot;+mainValue},650)}queueGeometry()}function save(el){const key=el.name;if(!key)return;const v=el.type===&quot;checkbox&quot;?el.checked:el.value;state[key]=v===&quot;&quot;&amp;&amp;el.type===&quot;number&quot;?null:v;if(statusKey[key])state[statusKey[key]]=v===&quot;&quot;?&quot;pending&quot;:E.numeric(v)===0?&quot;not_applicable&quot;:&quot;estimated&quot;;if(key===&quot;approvalQuoteEUR&quot;&amp;&amp;v===&quot;&quot;&amp;&amp;[&quot;collection&quot;,&quot;avdt&quot;,&quot;rti&quot;].includes(state.approvalRoute))state.approvalStatus=&quot;estimated&quot;;if(fxKeys.includes(key))manualFX.add(key);if(key===&quot;source&quot;||key===&quot;koreanInvoiceCurrency&quot;)state.customsVehicleValue=null;if(key===&quot;destination&quot;){state.approvalRoute=&quot;unconfirmed&quot;;state.approvalQuoteEUR=null;state.approvalStatus=&quot;pending&quot;;state.region=&quot;&quot;;state.taxScenario=&quot;ordinary&quot;;state.taxEvidence=&quot;unconfirmed&quot;;state.originPays=&quot;unknown&quot;;state.budgetCurrency=&quot;EUR&quot;;state.portEUR=v===&quot;FR&quot;?852.6:null;state.portStatus=v===&quot;FR&quot;?&quot;estimated&quot;:&quot;pending&quot;;for(const k of[&quot;registrationEUR&quot;,&quot;co2EUR&quot;]){state[k]=null;state[statusKey[k]]=&quot;pending&quot;}}if(key===&quot;approvalRoute&quot;){state.approvalQuoteEUR={collection:500,avdt:3e3,rti:1400}[v]??null;state.approvalStatus=state.approvalQuoteEUR===null?&quot;pending&quot;:&quot;estimated&quot;}if(key===&quot;vehicleAge&quot;||key===&quot;destination&quot;)applyAgeScenario();if(key===&quot;taxScenario&quot;){if(v===&quot;collector&quot;&amp;&amp;underCollectorAge())state.taxScenario=&quot;ordinary&quot;;state.taxEvidence=state.taxScenario===&quot;ordinary&quot;?&quot;unconfirmed&quot;:&quot;conditional&quot;}}function bind(){document.getElementById(&quot;calculator-form&quot;).addEventListener(&quot;submit&quot;,e=&gt;e.preventDefault());document.querySelectorAll(&quot;[name]&quot;).forEach(el=&gt;{el.addEventListener(&quot;input&quot;,()=&gt;{if(el.tagName===&quot;INPUT&quot;&amp;&amp;el.type!==&quot;checkbox&quot;){save(el);update(true)}});el.addEventListener(&quot;change&quot;,()=&gt;{save(el);if(el.tagName===&quot;SELECT&quot;||el.type===&quot;checkbox&quot;)render();else update(true)})});document.querySelectorAll(&quot;[data-mode]&quot;).forEach(el=&gt;el.addEventListener(&quot;click&quot;,()=&gt;{state.mode=el.dataset.mode;render()}));document.querySelectorAll(&quot;[data-lang]&quot;).forEach(el=&gt;el.addEventListener(&quot;click&quot;,()=&gt;{lang=el.dataset.lang;render()}));document.querySelectorAll(&quot;details&quot;).forEach(d=&gt;d.addEventListener(&quot;toggle&quot;,queueGeometry));document.getElementById(&quot;reset-valuation&quot;).addEventListener(&quot;click&quot;,()=&gt;{state.customsVehicleValue=null;document.getElementById(&quot;customsVehicleValue&quot;).value=&quot;&quot;;update(true)});document.getElementById(&quot;reset-rates&quot;).addEventListener(&quot;click&quot;,()=&gt;{manualFX.clear();applyRates();render();document.getElementById(&quot;fx-details&quot;).open=true});const c=document.getElementById(&quot;krwComparison&quot;);if(c)c.addEventListener(&quot;input&quot;,()=&gt;{comparison=c.value;comparisonText()})}function comparisonText(){const el=document.getElementById(&quot;comparison-result&quot;);if(!el)return;const n=E.numeric(comparison),rate=E.numeric(state.eurKRW);el.textContent=comparison&amp;&amp;Number.isFinite(n)&amp;&amp;n&gt;=0&amp;&amp;rate&gt;0?t(&quot;Comparison only: &quot;,&quot;Comparaison uniquement : &quot;)+money(n\/rate):t(&quot;For comparison only; never added to the estimate.&quot;,&quot;Comparaison uniquement ; jamais ajout\\xe9 \\xe0 l\\u2019estimation.&quot;)}function quoteText(){const r=last.result,rev=last.reverse;const lines=[&quot;TOPRANK EUROPE \\u2014 &quot;+t(&quot;IMPORT ESTIMATE&quot;,&quot;ESTIMATION D\\u2019IMPORTATION&quot;),(new Date).toISOString().slice(0,10),t(&quot;Purchase market: &quot;,&quot;March\\xe9 d\\u2019achat : &quot;)+state.source,t(&quot;Import country: &quot;,&quot;Pays d\\u2019importation : &quot;)+state.destination,t(&quot;Estimated import budget: &quot;,&quot;Budget d\\u2019importation estim\\xe9 : &quot;)+money(r.totalCents\/100)];if(rev)lines.push(t(&quot;Customer budget: &quot;,&quot;Budget client : &quot;)+money(E.numeric(state.budgetAmount),state.budgetCurrency),t(&quot;Provisional vehicle-price ceiling: &quot;,&quot;Plafond provisoire du prix du v\\xe9hicule : &quot;)+money(rev.maxPurchase,rev.currency),t(&quot;Budget remaining: &quot;,&quot;Budget restant : &quot;)+money(rev.headroomCents\/100));if(state.destination===&quot;CH&quot;)lines.push(t(&quot;Total equivalent: &quot;,&quot;\\xc9quivalent du total : &quot;)+money(r.totalCHFCents\/100,&quot;CHF&quot;));lines.push(t(&quot;Approval route: &quot;,&quot;Parcours d\\u2019homologation : &quot;)+routes()[state.approvalRoute]);if(state.source===&quot;JP&quot;)lines.push(t(&quot;Japan package service fee includes VAT and is included in the estimate.&quot;,&quot;Les honoraires de la formule Japon sont TTC et compris dans l\\u2019estimation.&quot;));if(state.source===&quot;KR&quot;)lines.push(t(&quot;Korean service fee is indicative including VAT; your written quotation confirms it.&quot;,&quot;Les honoraires Cor\\xe9e sont indicatifs et TTC ; votre devis \\xe9crit les confirme.&quot;));lines.push(t(&quot;Vehicle age in completed years since manufacture: &quot;,&quot;\\xc2ge du v\\xe9hicule en ann\\xe9es r\\xe9volues depuis la fabrication : &quot;)+(state.vehicleAge===null?t(&quot;not supplied&quot;,&quot;non renseign\\xe9&quot;):state.vehicleAge),t(&quot;Actual vehicle payment: &quot;,&quot;Prix r\\xe9ellement pay\\xe9 pour le v\\xe9hicule : &quot;)+money(r.sourceDetails.purchaseAmount,r.sourceDetails.currency),t(&quot;Vehicle value used for customs: &quot;,&quot;Valeur du v\\xe9hicule retenue pour la douane : &quot;)+(state.customsVehicleValue===null?t(&quot;actual purchase price&quot;,&quot;prix d\\u2019achat r\\xe9el&quot;):money(E.numeric(state.customsVehicleValue),purchaseCurrency())+t(&quot; \\u2014 documented value pending customs acceptance&quot;,&quot; \\u2014 valeur justifi\\xe9e sous r\\xe9serve d\\u2019acceptation douani\\xe8re&quot;)));if(rev&amp;&amp;state.customsVehicleValue!==null)lines.push(t(&quot;The documented vehicle valuation stays fixed during this reverse calculation; the purchase ceiling remains provisional.&quot;,&quot;La valeur justifi\\xe9e du v\\xe9hicule reste fixe pendant ce calcul invers\\xe9 ; le plafond d\\u2019achat reste provisoire.&quot;));for(const l of r.lines.filter(l=&gt;l.cents||l.status===&quot;pending&quot;))lines.push(label(l.id)+&quot;: &quot;+(l.unpriced&amp;&amp;l.status===&quot;pending&quot;?t(&quot;UNPRICED \\u2014 excluded&quot;,&quot;NON CHIFFR\\xc9 \\u2014 exclu&quot;):money(l.cents\/100)));lines.push(t(&quot;Tax scenario: &quot;,&quot;Sc\\xe9nario fiscal : &quot;)+{ordinary:t(&quot;standard&quot;,&quot;standard&quot;),collector:t(&quot;collector \\u2014 conditional&quot;,&quot;collection \\u2014 sous conditions&quot;),preferential:t(&quot;preferential origin \\u2014 conditional&quot;,&quot;origine pr\\xe9f\\xe9rentielle \\u2014 sous conditions&quot;)}[r.taxes.scenario],t(&quot;Customs duty \/ VAT \/ automobile tax: &quot;,&quot;Droits de douane \/ TVA \/ imp\\xf4t automobile : &quot;)+r.taxes.dutyRate+&quot;% \/ &quot;+r.taxes.vatRate+&quot;% \/ &quot;+r.taxes.autoTaxRate+&quot;%&quot;,t(&quot;Customs value \/ import VAT base: &quot;,&quot;Valeur en douane \/ assiette de TVA \\xe0 l\\u2019importation : &quot;)+money(r.taxes.customsBaseEUR)+&quot; \/ &quot;+money(r.taxes.vatBaseEUR),t(&quot;Quotation and taxable-cost treatment remain subject to TOPRANK review. Unpriced approval, registration, modifications and other fees are excluded. Annual ownership costs are separate.&quot;,&quot;Le devis et le traitement des frais taxables restent soumis \\xe0 l\\u2019\\xe9tude TOPRANK. Les frais non chiffr\\xe9s d\\u2019homologation, d\\u2019immatriculation, de modification et autres sont exclus. Les frais annuels d\\u2019usage sont s\\xe9par\\xe9s.&quot;),rateDescription());for(const k of fxKeys)lines.push({eurJPY:&quot;1 EUR = &quot;,usdJPY:&quot;1 USD = &quot;,eurKRW:&quot;1 EUR = &quot;,eurCHF:&quot;1 EUR = &quot;}[k]+state[k]+&quot; &quot;+{eurJPY:&quot;JPY&quot;,usdJPY:&quot;JPY&quot;,eurKRW:&quot;KRW&quot;,eurCHF:&quot;CHF&quot;}[k]+(manualFX.has(k)?t(&quot; (manual)&quot;,&quot; (manuel)&quot;):&quot;&quot;));return lines.join(&quot;\\n&quot;)}async function copyEstimate(){if(!last?.result)return;const value=quoteText();try{await navigator.clipboard.writeText(value);document.getElementById(&quot;copy-status&quot;).textContent=t(&quot;Copied. Add your vehicle link when you contact us.&quot;,&quot;Copi\\xe9. Joignez le lien du v\\xe9hicule \\xe0 votre demande.&quot;)}catch(_){const out=document.getElementById(&quot;copy-output&quot;);out.hidden=false;out.value=value;out.focus();out.select();document.getElementById(&quot;copy-status&quot;).textContent=t(&quot;Copy the text below.&quot;,&quot;Copiez le texte ci-dessous.&quot;)}queueGeometry()}function validRates(d){if(!d||typeof d!==&quot;object&quot;||Array.isArray(d)||typeof d.stale!==&quot;boolean&quot;||typeof d.source!==&quot;string&quot;||!d.source.trim()||d.source.length&gt;120)return false;for(const k of[...fxKeys,&quot;roroUSD&quot;])if(typeof d[k]!==&quot;number&quot;||!Number.isFinite(d[k])||d[k]&lt;(k===&quot;roroUSD&quot;?0:.001)||d[k]&gt;(k===&quot;roroUSD&quot;?1e4:k===&quot;eurCHF&quot;?1e3:1e7))return false;if(d.rateDate===null&amp;&amp;d.checkedAt===null)return d.stale&amp;&amp;d.source===&quot;Planning fallback&quot;;if(typeof d.rateDate!==&quot;string&quot;||!\/^\\d{4}-\\d{2}-\\d{2}$\/.test(d.rateDate))return false;const date=Date.parse(d.rateDate+&quot;T00:00:00Z&quot;),checked=Date.parse(d.checkedAt);return Number.isFinite(date)&amp;&amp;new Date(date).toISOString().slice(0,10)===d.rateDate&amp;&amp;date&lt;=Date.now()&amp;&amp;typeof d.checkedAt===&quot;string&quot;&amp;&amp;Number.isFinite(checked)&amp;&amp;checked&lt;=Date.now()+3e5&amp;&amp;checked&gt;=date}function applyRates(){for(const k of fxKeys)if(!manualFX.has(k))state[k]=(rateInfo||E.defaults)[k];if(rateInfo)config.roroUSD=rateInfo.roroUSD}function finishRates(value){if(rateSettled)return;rateSettled=true;clearTimeout(rateTimer);rateInfo=value;rateState=value?&quot;ready&quot;:&quot;unavailable&quot;;applyRates();render()}async function loadRates(){let owner=&quot;&quot;;try{owner=parent===window?location.origin:parent.location.origin}catch(_){}if(owner!==HOST||typeof fetch!==&quot;function&quot;){finishRates(null);return}rateController=new AbortController;rateTimer=setTimeout(()=&gt;{finishRates(null);rateController.abort()},8e3);try{const response=await fetch(HOST+&quot;\/wp-json\/tre-budget\/v2\/config&quot;,{cache:&quot;no-store&quot;,credentials:&quot;omit&quot;,mode:&quot;same-origin&quot;,signal:rateController.signal});if(rateSettled)return;if(!response.ok)throw Error(&quot;rates&quot;);const data=await response.json();if(!rateSettled)finishRates(validRates(data)?data:null)}catch(_){finishRates(null)}}function geometry(){raf=0;const grid=document.querySelector(&quot;.calculator-grid&quot;),summary=document.querySelector(&quot;.summary-column&quot;);if(!grid||!summary)return;const wide=window.innerWidth&gt;920,top=grid.getBoundingClientRect().top+window.scrollY,offset=parent===window?window.scrollY+18:viewOffset??0;const limit=Math.max(0,grid.offsetHeight-summary.offsetHeight),shift=wide?Math.min(limit,Math.max(0,offset-top)):0;summary.style.transform=shift?&quot;translateY(&quot;+Math.round(shift)+&quot;px)&quot;:&quot;&quot;;if(parent!==window){const h=Math.ceil(app.getBoundingClientRect().height)+2;if(h!==lastHeight){lastHeight=h;parent.postMessage({type:&quot;tre-client:size&quot;,height:h,language:lang},HOST)}}}function queueGeometry(){if(!raf)raf=requestAnimationFrame(geometry)}if(&quot;ResizeObserver&quot;in window)new ResizeObserver(queueGeometry).observe(app);window.addEventListener(&quot;resize&quot;,queueGeometry);window.addEventListener(&quot;scroll&quot;,queueGeometry,{passive:true});window.addEventListener(&quot;message&quot;,e=&gt;{if(e.origin!==HOST||e.source!==parent||!e.data)return;if(e.data.type===&quot;tre-client:viewport&quot;&amp;&amp;Number.isFinite(e.data.offset)&amp;&amp;e.data.offset&gt;=0&amp;&amp;e.data.offset&lt;=1e5){viewOffset=e.data.offset;queueGeometry()}else if(e.data.type===&quot;tre-client:measure&quot;){lastHeight=0;queueGeometry()}});render();loadRates()})();&lt;\/script&gt;&lt;\/body&gt;&lt;\/html&gt;\"><\/iframe><\/div><script>(function(){const HOST='https:\/\/toprankeurope.com';if(location.origin!==HOST||window.__treClientBridge)return;window.__treClientBridge=true;let queued=false;function measure(){queued=false;for(const f of document.querySelectorAll('iframe[data-tre-client=\"1\"]')){f.contentWindow?.postMessage({type:'tre-client:viewport',offset:Math.max(0,-f.getBoundingClientRect().top+18)},HOST);}}function queue(){if(!queued){queued=true;requestAnimationFrame(measure);}}window.addEventListener('scroll',queue,{passive:true});window.addEventListener('resize',queue);window.addEventListener('message',e=>{if(e.origin!==HOST||!e.data)return;for(const f of document.querySelectorAll('iframe[data-tre-client=\"1\"]')){if(e.source!==f.contentWindow)continue;if(e.data.type==='tre-client:size'){const h=Number(e.data.height);if(Number.isFinite(h)&&h>=100&&h<=30000){const next=Math.ceil(h)+'px';if(f.style.height!==next){f.height=String(Math.ceil(h));f.style.height=next;}f.title=e.data.language==='fr'?'Calculateur d\u2019importation TOPRANK':'TOPRANK import calculator';queue();}}return;}});queue();})();<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_header_footer","meta":{"footnotes":""},"class_list":["post-50811","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/pages\/50811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/comments?post=50811"}],"version-history":[{"count":28,"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/pages\/50811\/revisions"}],"predecessor-version":[{"id":57206,"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/pages\/50811\/revisions\/57206"}],"wp:attachment":[{"href":"https:\/\/toprankeurope.com\/fr\/wp-json\/wp\/v2\/media?parent=50811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}