function p(n, t) {
  const a = n.reduce((e, o) => {
    const l = o.teamUid;
    return e[l] || (e[l] = []), e[l].push({
      id: o.id,
      label: o.label
    }), e;
  }, {}), s = [];
  if (t !== "local") {
    const e = a[t] ?? [];
    e.length > 0 && s.push({
      label: "Team Workspaces",
      options: e
    });
  }
  return s.push({
    label: "Local Workspaces",
    options: a.local ?? []
  }), s;
}
export {
  p as groupWorkspacesByTeam
};
