import { s as s2 } from "./chunk-HZRKBTHJ.js"; import { M, w2 as w } from "./chunk-6T6G6LCQ.js"; import { k2 as k } from "./chunk-PQFTYGF5.js"; import { e, l3 as l, m, n5 as n, y3 as y2 } from "./chunk-2Z2TG5CU.js"; import { b } from "./chunk-SQOPWYIT.js"; import { s3 as s } from "./chunk-E5O6P5I2.js"; import { y } from "./chunk-SPWQ3AWG.js"; import { f, r } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/portal/PortalQueryParams.js var u; var m2 = new s2({ avgRating: "avg-rating", numRatings: "num-ratings", numComments: "num-comments", numViews: "num-views" }); var c = u = class extends m { constructor(t) { 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; } get sortOrder() { return this._get("sortOrder") || "asc"; } set sortOrder(t) { "asc" !== t && "desc" !== t || this._set("sortOrder", t); } clone() { 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 }); } toRequestOptions(t, r2) { let e2, s3; if (this.categories && (e2 = this.categories.map((t2) => Array.isArray(t2) ? JSON.stringify(t2) : t2)), this.extent) { const t2 = M(this.extent, k.WGS84); r(t2) && (s3 = `${t2.xmin},${t2.ymin},${t2.xmax},${t2.ymax}`); } let i = this.query; !this.disableExtraQuery && t.extraQuery && (i = "(" + i + ")" + t.extraQuery); const a = { categories: e2, bbox: s3, q: i, filter: this.filter, num: this.num, sortField: null, sortOrder: null, start: this.start }; return this.sortField && (a.sortField = this.sortField.split(",").map((t2) => m2.toJSON(t2.trim())).join(","), a.sortOrder = this.sortOrder), { query: { ...r2, ...a } }; } }; 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); var d = c; // node_modules/@arcgis/core/portal/PortalGroup.js var u2 = class extends l { constructor(t) { 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; } get thumbnailUrl() { var _a; const t = this.url, r2 = this.thumbnail; return t && r2 && this.portal ? (_a = this.portal) == null ? void 0 : _a._normalizeUrl(`${t}/info/${r2}?f=json`) : null; } get url() { const t = this.get("portal.restUrl"); return t ? t + "/community/groups/" + this.id : null; } fetchCategorySchema(t) { return f(this.portal)._request(this.url + "/categorySchema", t).then((r2) => { const e2 = r2.categorySchema || []; return e2.some((t2) => "contentCategorySetsGroupQuery.LivingAtlas" === t2.source) ? this._fetchCategorySchemaSet("LivingAtlas", t) : e2; }); } fetchMembers(t) { return f(this.portal)._request(this.url + "/users", t); } getThumbnailUrl(t) { let r2 = this.thumbnailUrl; return r2 && t && (r2 += `&w=${t}`), r2; } toJSON() { throw new s("internal:not-yet-implemented", "PortalGroup.toJSON is not yet implemented"); } queryItems(t, r2) { let e2 = b(d, t); const s3 = f(this.portal); 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)); } _fetchCategorySchemaSet(t, e2) { const s3 = f(this.portal); return s3._fetchSelf(s3.authMode, true, e2).then((t2) => { const o = t2.contentCategorySetsGroupQuery; if (o) { const t3 = new d(); return t3.disableExtraQuery = true, t3.num = 1, t3.query = o, s3.queryGroups(t3, e2); } throw new s("portal-group:fetchCategorySchema", "contentCategorySetsGroupQuery value not found"); }).then((o) => { if (o.total) { const r2 = o.results[0], s4 = new d(); return s4.num = 1, s4.query = `typekeywords:"${t}"`, r2.queryItems(s4, e2); } throw new s("portal-group:fetchCategorySchema", "contentCategorySetsGroupQuery group not found"); }).then((t2) => { if (t2.total) { return t2.results[0].fetchData("json", e2).then((t3) => { const r2 = t3 && t3.categorySchema; return r2 && r2.length ? r2 : []; }); } return []; }); } }; 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); var p = u2; export { d, p }; //# sourceMappingURL=chunk-SFEFRQCL.js.map