chunk-5IVP3KUS.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import {
  2. s
  3. } from "./chunk-E5O6P5I2.js";
  4. // node_modules/@arcgis/core/core/fontUtils.js
  5. var n = "woff2";
  6. var s2 = /* @__PURE__ */ new Map();
  7. async function o(t) {
  8. const r = i(t);
  9. let o2 = s2.get(r);
  10. if (o2)
  11. return o2;
  12. const a2 = new FontFace(t.family, `url('${s.fontsUrl}/woff2/${r}.${n}') format('${n}')`), u = document.fonts;
  13. return u.has(a2) && "loading" === a2.status ? a2.loaded : (o2 = a2.load(), s2.set(r, o2), u.add(a2), o2);
  14. }
  15. function a(e) {
  16. if (!e)
  17. return "arial-unicode-ms";
  18. const t = e.toLowerCase().split(" ").join("-");
  19. switch (t) {
  20. case "serif":
  21. return "noto-serif";
  22. case "sans-serif":
  23. return "arial-unicode-ms";
  24. case "monospace":
  25. return "ubuntu-mono";
  26. case "fantasy":
  27. return "cabin-sketch";
  28. case "cursive":
  29. return "redressed";
  30. default:
  31. return t;
  32. }
  33. }
  34. function i(e) {
  35. const t = c(e) + f(e);
  36. return a(e.family) + (t.length > 0 ? t : "-regular");
  37. }
  38. function c(e) {
  39. if (!e.weight)
  40. return "";
  41. switch (e.weight.toLowerCase()) {
  42. case "bold":
  43. case "bolder":
  44. return "-bold";
  45. }
  46. return "";
  47. }
  48. function f(e) {
  49. if (!e.style)
  50. return "";
  51. switch (e.style.toLowerCase()) {
  52. case "italic":
  53. case "oblique":
  54. return "-italic";
  55. }
  56. return "";
  57. }
  58. export {
  59. o,
  60. a,
  61. i
  62. };
  63. //# sourceMappingURL=chunk-5IVP3KUS.js.map