"use strict";(globalThis.webpackChunkinfinity_hitab_client=globalThis.webpackChunkinfinity_hitab_client||[]).push([[5424],{35424:(e,t,a)=>{a.r(t),a.d(t,{useCalcWeightStore:()=>m});var u=a(74003),n=a(57268),i=a(10435),r=a(14754);const l=[{name:"斤",unit:"jin",getValue:e=>(0,r.uf)(2*e),reverseValue:e=>(0,r.uf)(e/2)},{name:"两",unit:"两",getValue:e=>(0,r.uf)(20*e),reverseValue:e=>(0,r.uf)(e/20)},{name:"钱",unit:"qian",getValue:e=>(0,r.uf)(200*e),reverseValue:e=>(0,r.uf)(e/200)},{name:"担",unit:"dan",getValue:e=>(0,r.uf)(.02*e),reverseValue:e=>(0,r.uf)(e/.02)}],s=[{name:"千克",unit:"kg",base:!0,calcBase:!0,value:1},{name:"吨",unit:"t",getValue:e=>(0,r.uf)(e/1e3),reverseValue:e=>(0,r.uf)(1e3*e)},{name:"克",unit:"g",getValue:e=>(0,r.uf)(1e3*e),reverseValue:e=>(0,r.uf)(e/1e3)},{name:"毫克",unit:"mg",getValue:e=>(0,r.uf)(1e3*e*1e3),reverseValue:e=>(0,r.uf)(e/1e3/1e3)},{name:"微克",unit:"μg",getValue:e=>(0,r.uf)(1e3*e*1e3*1e3),reverseValue:e=>(0,r.uf)(e/1e3/1e3/1e3)},{name:"公担",unit:"q",getValue:e=>(0,r.uf)(.01*e),reverseValue:e=>(0,r.uf)(100*e)},{name:"克拉",unit:"ct",getValue:e=>(0,r.uf)(5e3*e),reverseValue:e=>(0,r.uf)(e/5e3)},{name:"磅",unit:"lb",getValue:e=>(0,r.uf)(2.2046226*e),reverseValue:e=>(0,r.uf)(e/2.2046226)},{name:"盎司",unit:"oz",getValue:e=>(0,r.uf)(35.2739619*e),reverseValue:e=>(0,r.uf)(e/35.2739619)},{name:"格令",unit:"gr",getValue:e=>(0,r.uf)(15432.3583529*e),reverseValue:e=>(0,r.uf)(e/15432.3583529)},{name:"长吨",unit:"l.t",getValue:e=>(0,r.uf)(9842e-7*e),reverseValue:e=>(0,r.uf)(e/9842e-7)},{name:"短吨",unit:"sh.t",getValue:e=>(0,r.uf)(.0011023*e),reverseValue:e=>(0,r.uf)(e/.0011023)},{name:"打兰",unit:"dr",getValue:e=>(0,r.uf)(564.3833912*e),reverseValue:e=>(0,r.uf)(e/564.3833912)},{name:"英担",unit:"cwt",getValue:e=>(0,r.uf)(.0196841*e),reverseValue:e=>(0,r.uf)(e/.0196841)},{name:"美担",unit:"cwt",getValue:e=>(0,r.uf)(.0220462*e),reverseValue:e=>(0,r.uf)(e/.0220462)},{name:"英石",unit:"uk.st",getValue:e=>(0,r.uf)(.157473*e),reverseValue:e=>(0,r.uf)(e/.157473)}],m=(0,i.Q_)("calc-components-weight",{state:()=>({unitItemsArr:u.sM?[...s,...l]:s}),getters:{getAllUnits(){return this.unitItemsArr},getBaseUnit(){return this.unitItemsArr.find((e=>e.base))},getPanelList(){return this.unitItemsArr.filter((e=>!e.base))},getCalcbase(){return this.unitItemsArr.find((e=>e.calcBase))}},actions:{changeBaseUnit(e){this.unitItemsArr=(0,r.vZ)(e,this.unitItemsArr)},changeBaseValue(e){this.getBaseUnit.value=e},calcUnitsArr(){this.unitItemsArr=(0,r.UC)(this.unitItemsArr)}}});(0,n.YP)((()=>{var e;return null===(e=m().unitItemsArr.find((e=>e.base)))||void 0===e?void 0:e.value}),(()=>{m().calcUnitsArr()}),{immediate:!0}),(0,n.YP)((()=>{var e;return null===(e=m().unitItemsArr.find((e=>e.base)))||void 0===e?void 0:e.name}),(()=>{m().calcUnitsArr()}))},14754:(e,t,a)=>{a.d(t,{D:()=>v,Mb:()=>o,UC:()=>i,WS:()=>f,fS:()=>l,uf:()=>u,vZ:()=>n,zX:()=>r});const u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;if(!e)return 0;const u=Math.floor(Math.log(Math.abs(e))/Math.LN10);if(Math.abs(u)<=t)return Number(e.toFixed(a));{const t=e*Math.pow(10,-u);return Number(t.toFixed(a))+"e"+(u>0?"+"+u:u)}},n=(e,t)=>{const a=[...t],u=a.find((e=>e.base)),n=a.find((t=>t.name===e.name));return u.base=!1,n.base=!0,n.value=u.value,a},i=e=>{const t=[...e],a=e.find((e=>e.calcBase)),u=e.find((e=>e.base));var n;a.base?t.map((e=>{var t;e.base||e.calcBase||(e.value=null===(t=e.getValue)||void 0===t?void 0:t.call(null,Number(a.value)))})):(a.value=null===(n=u.reverseValue)||void 0===n?void 0:n.call(null,Number(u.value)),t.map((e=>{var t;e.base||e.calcBase||(e.value=null===(t=e.getValue)||void 0===t?void 0:t.call(null,Number(a.value)))})));return t},r=(e,t)=>{const a=String(e).split("."),u=a[1].split("");let n=0;for(let e=0;e<a[1].length;e++)n+=u[e]*Math.pow(t,-1*(e+1));return parseInt(a[0],t)+n},l=e=>Number(e||0).toFixed(2).replace(/\d+/,(e=>e.replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"))),s=[{min:-1/0,max:36e3,rate:.03,deduction:0},{min:36e3,max:144e3,rate:.1,deduction:2520},{min:144e3,max:3e5,rate:.2,deduction:16920},{min:3e5,max:42e4,rate:.25,deduction:31920},{min:42e4,max:66e4,rate:.3,deduction:52920},{min:66e4,max:96e4,rate:.35,deduction:85920},{min:96e4,max:1/0,rate:.45,deduction:181920}],m=[{min:-1/0,max:3e3,rate:.03,deduction:0},{min:3e3,max:12e3,rate:.1,deduction:210},{min:12e3,max:25e3,rate:.2,deduction:1410},{min:25e3,max:35e3,rate:.25,deduction:2660},{min:35e3,max:55e3,rate:.3,deduction:4410},{min:55e3,max:8e4,rate:.35,deduction:7160},{min:8e4,max:1/0,rate:.45,deduction:15160}],d=[{min:-1/0,max:2e4,rate:.2,deduction:0},{min:2e4,max:5e4,rate:.3,deduction:2e3},{min:5e4,max:1/0,rate:.4,deduction:7e3}],c=(e,t)=>t.find((t=>e>t.min&&e<=t.max)),f=e=>c(e,s),o=e=>c(e,m),v=e=>c(e,d)}}]);