{"version":3,"file":"commonInfo.135591d2.js","sources":["../../src/utils/store/commonInfo.ts"],"sourcesContent":["import {Api} from \"@/api\";\r\nimport {ISelect} from \"@/components/Select/helper\";\r\n\r\nconst getCountryItem = async () => {\r\n let json: ISelect[];\r\n if (!sessionStorage.getItem('countryItem')) {\r\n const res = await Api.Country.GetZcountryList()\r\n json = res?.data?.reduce((result: ISelect[], i: { code: string, name: string }, index: number) => {\r\n result[index] = {\r\n label: i.name,\r\n value: i.code\r\n }\r\n return result\r\n }, [])\r\n if (json) {\r\n sessionStorage.setItem('countryItem', JSON.stringify(json))\r\n }\r\n } else {\r\n json = JSON.parse(sessionStorage.getItem('countryItem') || '')\r\n }\r\n return json\r\n}\r\n\r\n// const getCountryMap\r\nexport const commonInfo = () => {\r\n return {\r\n countryItem: () => getCountryItem()\r\n }\r\n}"],"names":["getCountryItem","json","sessionStorage","getItem","JSON","parse","res","Api","Country","GetZcountryList","data","reduce","result","i","index","label","name","value","code","setItem","stringify","commonInfo","countryItem"],"mappings":"wCAGA,KAAMA,GAAiB,SAAY,UAC3BC,MACCC,eAAeC,QAAQ,iBAajBC,KAAKC,MAAMH,eAAeC,QAAQ,gBAAkB,QAbnB,MAClCG,GAAM,KAAMC,GAAIC,QAAQC,oBACvBH,oBAAKI,OAALJ,cAAWK,OAAO,CAACC,EAAmBC,EAAmCC,OACrEA,GAAS,CACZC,MAAOF,EAAEG,KACTC,MAAOJ,EAAEK,MAENN,GACR,IACCX,kBACekB,QAAQ,cAAef,KAAKgB,UAAUnB,UAKtDA,IAIEoB,EAAa,IACf,EACHC,YAAa,IAAMtB"}