/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import{a as O,c as R,d as g,e as u}from"./CFQMS5AW.js";import{a}from"./CY2LR44V.js";import"./XM4WSP5R.js";import"./NT7UOXPG.js";import{b as s,d as o,e as c}from"./NV3OJG4B.js";import"./6SC7YR5Y.js";import"./G5YJM7GP.js";import"./Z6NOHRUL.js";import"./GVM4XYEI.js";import"./NGDVSE4Z.js";import"./BTNJZZQQ.js";import"./5MKH4QDV.js";import"./3GWWHA4S.js";import"./3YYHZQJB.js";import"./TONS7KZJ.js";import"./Q62UEPOL.js";import{c as r}from"./44A5XEM4.js";import"./3QPJ2JCA.js";var A={[r.channelRead]:s.READ,[r.channelWrite]:s.WRITE,[r.channelReadWrite]:s.READWRITE,[r.channelManage]:s.MANAGE,[r.channelModerate]:s.MODERATE,[r.channelOwner]:s.OWNER},C={[a.anonymous]:{category:o.ANONYMOUS_USER,subCategory:null},[a.authenticated]:{category:o.AUTHENTICATED_USER,subCategory:null},[a.group]:{category:o.GROUP,subCategory:c.MEMBER},[a.groupAdmin]:{category:o.GROUP,subCategory:c.ADMIN},[a.org]:{category:o.ORG,subCategory:c.MEMBER},[a.orgAdmin]:{category:o.ORG,subCategory:c.ADMIN},[a.owner]:{category:o.USER,subCategory:null},[a.user]:{category:o.USER,subCategory:null}};function i(n){function e(l,t){let E=C[t.collaborationType];return E?[...l,Object.assign(Object.assign({},E),{key:t.collaborationId||null,role:A[t.permission]})]:l}return{name:n.name,blockWords:n.blockWords,allowAsAnonymous:n.allowAsAnonymous,channelAclDefinition:n.permissions.reduce(e,[])}}async function f(n,e){let l=i(n),t=await O(Object.assign({data:l},e.hubRequestOptions));return u(t,e.currentUser)}async function I(n,e){let l=i(n),t=await R(Object.assign({channelId:n.id,data:l},e.hubRequestOptions));return u(t,e.currentUser)}async function T(n,e){await g(Object.assign({channelId:n},e.hubRequestOptions))}export{f as createHubChannel,T as deleteHubChannel,I as updateHubChannel};
