chunk-SFEFRQCL.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. import {
  2. s as s2
  3. } from "./chunk-HZRKBTHJ.js";
  4. import {
  5. M,
  6. w2 as w
  7. } from "./chunk-6T6G6LCQ.js";
  8. import {
  9. k2 as k
  10. } from "./chunk-PQFTYGF5.js";
  11. import {
  12. e,
  13. l3 as l,
  14. m,
  15. n5 as n,
  16. y3 as y2
  17. } from "./chunk-2Z2TG5CU.js";
  18. import {
  19. b
  20. } from "./chunk-SQOPWYIT.js";
  21. import {
  22. s3 as s
  23. } from "./chunk-E5O6P5I2.js";
  24. import {
  25. y
  26. } from "./chunk-SPWQ3AWG.js";
  27. import {
  28. f,
  29. r
  30. } from "./chunk-YXWMMD76.js";
  31. // node_modules/@arcgis/core/portal/PortalQueryParams.js
  32. var u;
  33. var m2 = new s2({ avgRating: "avg-rating", numRatings: "num-ratings", numComments: "num-comments", numViews: "num-views" });
  34. var c = u = class extends m {
  35. constructor(t) {
  36. super(t), this.categories = null, this.disableExtraQuery = false, this.extent = null, this.filter = null, this.num = 10, this.query = null, this.sortField = null, this.start = 1;
  37. }
  38. get sortOrder() {
  39. return this._get("sortOrder") || "asc";
  40. }
  41. set sortOrder(t) {
  42. "asc" !== t && "desc" !== t || this._set("sortOrder", t);
  43. }
  44. clone() {
  45. return new u({ categories: this.categories ? y(this.categories) : null, disableExtraQuery: this.disableExtraQuery, extent: this.extent ? this.extent.clone() : null, filter: this.filter, num: this.num, query: this.query, sortField: this.sortField, sortOrder: this.sortOrder, start: this.start });
  46. }
  47. toRequestOptions(t, r2) {
  48. let e2, s3;
  49. if (this.categories && (e2 = this.categories.map((t2) => Array.isArray(t2) ? JSON.stringify(t2) : t2)), this.extent) {
  50. const t2 = M(this.extent, k.WGS84);
  51. r(t2) && (s3 = `${t2.xmin},${t2.ymin},${t2.xmax},${t2.ymax}`);
  52. }
  53. let i = this.query;
  54. !this.disableExtraQuery && t.extraQuery && (i = "(" + i + ")" + t.extraQuery);
  55. const a = { categories: e2, bbox: s3, q: i, filter: this.filter, num: this.num, sortField: null, sortOrder: null, start: this.start };
  56. return this.sortField && (a.sortField = this.sortField.split(",").map((t2) => m2.toJSON(t2.trim())).join(","), a.sortOrder = this.sortOrder), { query: { ...r2, ...a } };
  57. }
  58. };
  59. e([y2()], c.prototype, "categories", void 0), e([y2()], c.prototype, "disableExtraQuery", void 0), e([y2({ type: w })], c.prototype, "extent", void 0), e([y2()], c.prototype, "filter", void 0), e([y2()], c.prototype, "num", void 0), e([y2()], c.prototype, "query", void 0), e([y2()], c.prototype, "sortField", void 0), e([y2()], c.prototype, "sortOrder", null), e([y2()], c.prototype, "start", void 0), c = u = e([n("esri.portal.PortalQueryParams")], c);
  60. var d = c;
  61. // node_modules/@arcgis/core/portal/PortalGroup.js
  62. var u2 = class extends l {
  63. constructor(t) {
  64. super(t), this.access = null, this.created = null, this.description = null, this.id = null, this.isInvitationOnly = false, this.modified = null, this.owner = null, this.portal = null, this.snippet = null, this.sortField = null, this.sortOrder = null, this.tags = null, this.title = null;
  65. }
  66. get thumbnailUrl() {
  67. var _a;
  68. const t = this.url, r2 = this.thumbnail;
  69. return t && r2 && this.portal ? (_a = this.portal) == null ? void 0 : _a._normalizeUrl(`${t}/info/${r2}?f=json`) : null;
  70. }
  71. get url() {
  72. const t = this.get("portal.restUrl");
  73. return t ? t + "/community/groups/" + this.id : null;
  74. }
  75. fetchCategorySchema(t) {
  76. return f(this.portal)._request(this.url + "/categorySchema", t).then((r2) => {
  77. const e2 = r2.categorySchema || [];
  78. return e2.some((t2) => "contentCategorySetsGroupQuery.LivingAtlas" === t2.source) ? this._fetchCategorySchemaSet("LivingAtlas", t) : e2;
  79. });
  80. }
  81. fetchMembers(t) {
  82. return f(this.portal)._request(this.url + "/users", t);
  83. }
  84. getThumbnailUrl(t) {
  85. let r2 = this.thumbnailUrl;
  86. return r2 && t && (r2 += `&w=${t}`), r2;
  87. }
  88. toJSON() {
  89. throw new s("internal:not-yet-implemented", "PortalGroup.toJSON is not yet implemented");
  90. }
  91. queryItems(t, r2) {
  92. let e2 = b(d, t);
  93. const s3 = f(this.portal);
  94. return parseFloat(s3.currentVersion) > 5 ? (e2 = e2 || new d(), s3._queryPortal(`/content/groups/${this.id}/search`, e2, "PortalItem", r2)) : (e2 = e2 ? e2.clone() : new d(), e2.query = "group:" + this.id + (e2.query ? " " + e2.query : ""), s3.queryItems(e2, r2));
  95. }
  96. _fetchCategorySchemaSet(t, e2) {
  97. const s3 = f(this.portal);
  98. return s3._fetchSelf(s3.authMode, true, e2).then((t2) => {
  99. const o = t2.contentCategorySetsGroupQuery;
  100. if (o) {
  101. const t3 = new d();
  102. return t3.disableExtraQuery = true, t3.num = 1, t3.query = o, s3.queryGroups(t3, e2);
  103. }
  104. throw new s("portal-group:fetchCategorySchema", "contentCategorySetsGroupQuery value not found");
  105. }).then((o) => {
  106. if (o.total) {
  107. const r2 = o.results[0], s4 = new d();
  108. return s4.num = 1, s4.query = `typekeywords:"${t}"`, r2.queryItems(s4, e2);
  109. }
  110. throw new s("portal-group:fetchCategorySchema", "contentCategorySetsGroupQuery group not found");
  111. }).then((t2) => {
  112. if (t2.total) {
  113. return t2.results[0].fetchData("json", e2).then((t3) => {
  114. const r2 = t3 && t3.categorySchema;
  115. return r2 && r2.length ? r2 : [];
  116. });
  117. }
  118. return [];
  119. });
  120. }
  121. };
  122. e([y2()], u2.prototype, "access", void 0), e([y2({ type: Date })], u2.prototype, "created", void 0), e([y2()], u2.prototype, "description", void 0), e([y2()], u2.prototype, "id", void 0), e([y2()], u2.prototype, "isInvitationOnly", void 0), e([y2({ type: Date })], u2.prototype, "modified", void 0), e([y2()], u2.prototype, "owner", void 0), e([y2()], u2.prototype, "portal", void 0), e([y2()], u2.prototype, "snippet", void 0), e([y2()], u2.prototype, "sortField", void 0), e([y2()], u2.prototype, "sortOrder", void 0), e([y2()], u2.prototype, "tags", void 0), e([y2()], u2.prototype, "thumbnail", void 0), e([y2({ readOnly: true })], u2.prototype, "thumbnailUrl", null), e([y2()], u2.prototype, "title", void 0), e([y2({ readOnly: true })], u2.prototype, "url", null), u2 = e([n("esri.portal.PortalGroup")], u2);
  123. var p = u2;
  124. export {
  125. d,
  126. p
  127. };
  128. //# sourceMappingURL=chunk-SFEFRQCL.js.map