// 暂时把地区信息打包在本地, 后续移到COS桶内
import provinces from './provinces.json';
import { CITIES } from './cities';
import { REGIONS } from './regions';
import weui from '../../../../utils/weui';
var tree;
export function getRegionTree() {
    if (!tree) {
        tree = provinces.map(function (province) {
            return {
                label: province.name,
                value: province.name,
                children: CITIES.filter(function (city) { return city.parent_code === province.code; }).map(function (city) {
                    return {
                        label: city.name,
                        value: city.name,
                        children: REGIONS.filter(function (region) { return region.parent_code === city.code; }).map(function (region) {
                            return {
                                label: region.name,
                                value: region.name,
                            };
                        }),
                    };
                }),
            };
        });
    }
    return tree;
}
export function regionPicker(options) {
    weui.picker(getRegionTree(), options);
}
//# sourceMappingURL=index.js.map