var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/dataSourceComponents/fields/Input.Mobile/serve.ts
var serve_exports = {};
__export(serve_exports, {
  getCountryDataList: () => getCountryDataList,
  useCountries: () => useCountries
});
module.exports = __toCommonJS(serve_exports);
var import_ahooks = require("ahooks");
var import_utils = require("../../../table/utils");
var getCountryDataList = async () => {
  const { data } = await import_utils.request.getRequest().get(`/country:list`, {}, {
    isNocobase: true,
    fullResult: true,
    headers: {
      "x-data-source": "pisell2"
    }
  });
  return data.map((item) => ({
    ...item,
    prefix: `+${item.calling_code}`
  }));
};
var useCountries = () => {
  const { data } = (0, import_ahooks.useRequest)(getCountryDataList, {
    cacheKey: "phone-countries",
    staleTime: 1e3 * 60 * 5,
    // 5分钟后数据过期
    cacheTime: 1e3 * 60 * 60
    // 1小时后清除缓存
  });
  return { data };
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getCountryDataList,
  useCountries
});
