import { jsxs as Ce, jsx as E } from "react/jsx-runtime";
import * as x from "react";
import { createElement as qt } from "react";
import { g as Te, c as we, A as Ae, s as _, F as le, l as Ee, L as Xt, G as rt, P as o, M as Jt, q as ce, e as Wt, E as Gt, k as $e, o as Yt, w as W, N as et, _ as C, O as G, u as ye, B as U, v as Qt, D as Zt, y as Ht, Q as Ne, r as te, C as tt, p as en, I as tn, S as nn, J as on, K as rn } from "./Stack-Bsa5WF4E.js";
import { u as sn, a as ln, b as an, w as xe, c as se, C as cn, d as dn, V as un, e as pn } from "./warning-BcYeNKLQ.js";
function fn(e) {
  return Te("PrivateSwitchBase", e);
}
we("PrivateSwitchBase", ["root", "checked", "disabled", "input", "edgeStart", "edgeEnd"]);
const mn = (e) => {
  const {
    classes: t,
    checked: n,
    disabled: r,
    edge: s
  } = e, I = {
    root: ["root", n && "checked", r && "disabled", s && `edge${le(s)}`],
    input: ["input"]
  };
  return Ee(I, fn, t);
}, In = _(Xt)({
  padding: 9,
  borderRadius: "50%",
  variants: [{
    props: {
      edge: "start",
      size: "small"
    },
    style: {
      marginLeft: -3
    }
  }, {
    props: ({
      edge: e,
      ownerState: t
    }) => e === "start" && t.size !== "small",
    style: {
      marginLeft: -12
    }
  }, {
    props: {
      edge: "end",
      size: "small"
    },
    style: {
      marginRight: -3
    }
  }, {
    props: ({
      edge: e,
      ownerState: t
    }) => e === "end" && t.size !== "small",
    style: {
      marginRight: -12
    }
  }]
}), gn = _("input", {
  shouldForwardProp: rt
})({
  cursor: "inherit",
  position: "absolute",
  opacity: 0,
  width: "100%",
  height: "100%",
  top: 0,
  left: 0,
  margin: 0,
  padding: 0,
  zIndex: 1
}), it = /* @__PURE__ */ x.forwardRef(function(t, n) {
  const {
    autoFocus: r,
    checked: s,
    checkedIcon: I,
    defaultChecked: c,
    disabled: l,
    disableFocusRipple: d = !1,
    edge: f = !1,
    icon: i,
    id: a,
    inputProps: u,
    inputRef: g,
    name: h,
    onBlur: m,
    onChange: p,
    onFocus: b,
    readOnly: y,
    required: T = !1,
    tabIndex: S,
    type: w,
    value: v,
    slots: M = {},
    slotProps: $ = {},
    ...q
  } = t, [A, N] = sn({
    controlled: s,
    default: !!c,
    name: "SwitchBase",
    state: "checked"
  }), D = ln(), Q = (R) => {
    b && b(R), D && D.onFocus && D.onFocus(R);
  }, z = (R) => {
    m && m(R), D && D.onBlur && D.onBlur(R);
  }, Z = (R) => {
    if (R.nativeEvent.defaultPrevented)
      return;
    const k = R.target.checked;
    N(k), p && p(R, k);
  };
  let j = l;
  D && typeof j > "u" && (j = D.disabled);
  const re = w === "checkbox" || w === "radio", X = {
    ...t,
    checked: A,
    disabled: j,
    disableFocusRipple: d,
    edge: f
  }, O = mn(X), J = {
    slots: M,
    slotProps: {
      input: u,
      ...$
    }
  }, [V, H] = Ae("root", {
    ref: n,
    elementType: In,
    className: O.root,
    shouldForwardComponentProp: !0,
    externalForwardedProps: {
      ...J,
      component: "span",
      ...q
    },
    getSlotProps: (R) => ({
      ...R,
      onFocus: (k) => {
        var L;
        (L = R.onFocus) == null || L.call(R, k), Q(k);
      },
      onBlur: (k) => {
        var L;
        (L = R.onBlur) == null || L.call(R, k), z(k);
      }
    }),
    ownerState: X,
    additionalProps: {
      centerRipple: !0,
      focusRipple: !d,
      disabled: j,
      role: void 0,
      tabIndex: null
    }
  }), [pe, Re] = Ae("input", {
    ref: g,
    elementType: gn,
    className: O.input,
    externalForwardedProps: J,
    getSlotProps: (R) => ({
      ...R,
      onChange: (k) => {
        var L;
        (L = R.onChange) == null || L.call(R, k), Z(k);
      }
    }),
    ownerState: X,
    additionalProps: {
      autoFocus: r,
      checked: s,
      defaultChecked: c,
      disabled: j,
      id: re ? a : void 0,
      name: h,
      readOnly: y,
      required: T,
      tabIndex: S,
      type: w,
      ...w === "checkbox" && v === void 0 ? {} : {
        value: v
      }
    }
  });
  return /* @__PURE__ */ Ce(V, {
    ...H,
    children: [/* @__PURE__ */ E(pe, {
      ...Re
    }), A ? I : i]
  });
});
process.env.NODE_ENV !== "production" && (it.propTypes = {
  /**
   * If `true`, the `input` element is focused during the first mount.
   */
  autoFocus: o.bool,
  /**
   * If `true`, the component is checked.
   */
  checked: o.bool,
  /**
   * The icon to display when the component is checked.
   */
  checkedIcon: o.node.isRequired,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  /**
   * @ignore
   */
  className: o.string,
  /**
   * @ignore
   */
  defaultChecked: o.bool,
  /**
   * If `true`, the component is disabled.
   */
  disabled: o.bool,
  /**
   * If `true`, the  keyboard focus ripple is disabled.
   * @default false
   */
  disableFocusRipple: o.bool,
  /**
   * If given, uses a negative margin to counteract the padding on one
   * side (this is often helpful for aligning the left or right
   * side of the icon with content above or below, without ruining the border
   * size and shape).
   * @default false
   */
  edge: o.oneOf(["end", "start", !1]),
  /**
   * The icon to display when the component is unchecked.
   */
  icon: o.node.isRequired,
  /**
   * The id of the `input` element.
   */
  id: o.string,
  /**
   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
   */
  inputProps: o.object,
  /**
   * Pass a ref to the `input` element.
   */
  inputRef: Jt,
  /*
   * @ignore
   */
  name: o.string,
  /**
   * @ignore
   */
  onBlur: o.func,
  /**
   * Callback fired when the state is changed.
   *
   * @param {object} event The event source of the callback.
   * You can pull out the new checked state by accessing `event.target.checked` (boolean).
   */
  onChange: o.func,
  /**
   * @ignore
   */
  onFocus: o.func,
  /**
   * It prevents the user from changing the value of the field
   * (not from interacting with the field).
   */
  readOnly: o.bool,
  /**
   * If `true`, the `input` element is required.
   */
  required: o.bool,
  /**
   * The props used for each slot inside.
   * @default {}
   */
  slotProps: o.shape({
    input: o.oneOfType([o.func, o.object]),
    root: o.oneOfType([o.func, o.object])
  }),
  /**
   * The components used for each slot inside.
   * @default {}
   */
  slots: o.shape({
    input: o.elementType,
    root: o.elementType
  }),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: o.object,
  /**
   * @ignore
   */
  tabIndex: o.oneOfType([o.number, o.string]),
  /**
   * The input component prop `type`.
   */
  type: o.string.isRequired,
  /**
   * The value of the component.
   */
  value: o.any
});
const bn = ce(/* @__PURE__ */ E("path", {
  d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
}), "CheckBoxOutlineBlank"), hn = ce(/* @__PURE__ */ E("path", {
  d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
}), "CheckBox"), yn = ce(/* @__PURE__ */ E("path", {
  d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
}), "IndeterminateCheckBox");
function xn(e) {
  return Te("MuiCheckbox", e);
}
const De = we("MuiCheckbox", ["root", "checked", "disabled", "indeterminate", "colorPrimary", "colorSecondary", "sizeSmall", "sizeMedium"]), Cn = (e) => {
  const {
    classes: t,
    indeterminate: n,
    color: r,
    size: s
  } = e, I = {
    root: ["root", n && "indeterminate", `color${le(r)}`, `size${le(s)}`]
  }, c = Ee(I, xn, t);
  return {
    ...t,
    // forward the disabled and checked classes to the SwitchBase
    ...c
  };
}, Tn = _(it, {
  shouldForwardProp: (e) => rt(e) || e === "classes",
  name: "MuiCheckbox",
  slot: "Root",
  overridesResolver: (e, t) => {
    const {
      ownerState: n
    } = e;
    return [t.root, n.indeterminate && t.indeterminate, t[`size${le(n.size)}`], n.color !== "default" && t[`color${le(n.color)}`]];
  }
})(Yt(({
  theme: e
}) => ({
  color: (e.vars || e).palette.text.secondary,
  variants: [{
    props: {
      color: "default",
      disableRipple: !1
    },
    style: {
      "&:hover": {
        backgroundColor: e.vars ? `rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})` : W(e.palette.action.active, e.palette.action.hoverOpacity)
      }
    }
  }, ...Object.entries(e.palette).filter(et()).map(([t]) => ({
    props: {
      color: t,
      disableRipple: !1
    },
    style: {
      "&:hover": {
        backgroundColor: e.vars ? `rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})` : W(e.palette[t].main, e.palette.action.hoverOpacity)
      }
    }
  })), ...Object.entries(e.palette).filter(et()).map(([t]) => ({
    props: {
      color: t
    },
    style: {
      [`&.${De.checked}, &.${De.indeterminate}`]: {
        color: (e.vars || e).palette[t].main
      },
      [`&.${De.disabled}`]: {
        color: (e.vars || e).palette.action.disabled
      }
    }
  })), {
    // Should be last to override other colors
    props: {
      disableRipple: !1
    },
    style: {
      // Reset on touch devices, it doesn't add specificity
      "&:hover": {
        "@media (hover: none)": {
          backgroundColor: "transparent"
        }
      }
    }
  }]
}))), wn = /* @__PURE__ */ E(hn, {}), En = /* @__PURE__ */ E(bn, {}), vn = /* @__PURE__ */ E(yn, {}), st = /* @__PURE__ */ x.forwardRef(function(t, n) {
  const r = Wt({
    props: t,
    name: "MuiCheckbox"
  }), {
    checkedIcon: s = wn,
    color: I = "primary",
    icon: c = En,
    indeterminate: l = !1,
    indeterminateIcon: d = vn,
    inputProps: f,
    size: i = "medium",
    disableRipple: a = !1,
    className: u,
    slots: g = {},
    slotProps: h = {},
    ...m
  } = r, p = l ? d : c, b = l ? d : s, y = {
    ...r,
    disableRipple: a,
    color: I,
    indeterminate: l,
    size: i
  }, T = Cn(y), S = h.input ?? f, [w, v] = Ae("root", {
    ref: n,
    elementType: Tn,
    className: $e(T.root, u),
    shouldForwardComponentProp: !0,
    externalForwardedProps: {
      slots: g,
      slotProps: h,
      ...m
    },
    ownerState: y,
    additionalProps: {
      type: "checkbox",
      icon: /* @__PURE__ */ x.cloneElement(p, {
        fontSize: p.props.fontSize ?? i
      }),
      checkedIcon: /* @__PURE__ */ x.cloneElement(b, {
        fontSize: b.props.fontSize ?? i
      }),
      disableRipple: a,
      slots: g,
      slotProps: {
        input: Gt(typeof S == "function" ? S(y) : S, {
          "data-indeterminate": l
        })
      }
    }
  });
  return /* @__PURE__ */ E(w, {
    ...v,
    classes: T
  });
});
process.env.NODE_ENV !== "production" && (st.propTypes = {
  // ┌────────────────────────────── Warning ──────────────────────────────┐
  // │ These PropTypes are generated from the TypeScript type definitions. │
  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │
  // └─────────────────────────────────────────────────────────────────────┘
  /**
   * If `true`, the component is checked.
   */
  checked: o.bool,
  /**
   * The icon to display when the component is checked.
   * @default <CheckBoxIcon />
   */
  checkedIcon: o.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  /**
   * @ignore
   */
  className: o.string,
  /**
   * The color of the component.
   * It supports both default and custom theme colors, which can be added as shown in the
   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
   * @default 'primary'
   */
  color: o.oneOfType([o.oneOf(["default", "primary", "secondary", "error", "info", "success", "warning"]), o.string]),
  /**
   * The default checked state. Use when the component is not controlled.
   */
  defaultChecked: o.bool,
  /**
   * If `true`, the component is disabled.
   * @default false
   */
  disabled: o.bool,
  /**
   * If `true`, the ripple effect is disabled.
   * @default false
   */
  disableRipple: o.bool,
  /**
   * The icon to display when the component is unchecked.
   * @default <CheckBoxOutlineBlankIcon />
   */
  icon: o.node,
  /**
   * The id of the `input` element.
   */
  id: o.string,
  /**
   * If `true`, the component appears indeterminate.
   * This does not set the native input element to indeterminate due
   * to inconsistent behavior across browsers.
   * However, we set a `data-indeterminate` attribute on the `input`.
   * @default false
   */
  indeterminate: o.bool,
  /**
   * The icon to display when the component is indeterminate.
   * @default <IndeterminateCheckBoxIcon />
   */
  indeterminateIcon: o.node,
  /**
   * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.
   * @deprecated Use `slotProps.input` instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](/material-ui/migration/migrating-from-deprecated-apis/) for more details.
   */
  inputProps: o.object,
  /**
   * Callback fired when the state is changed.
   *
   * @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
   * You can pull out the new checked state by accessing `event.target.checked` (boolean).
   */
  onChange: o.func,
  /**
   * If `true`, the `input` element is required.
   * @default false
   */
  required: o.bool,
  /**
   * The size of the component.
   * `small` is equivalent to the dense checkbox styling.
   * @default 'medium'
   */
  size: o.oneOfType([o.oneOf(["medium", "small"]), o.string]),
  /**
   * The props used for each slot inside.
   * @default {}
   */
  slotProps: o.shape({
    input: o.oneOfType([o.func, o.object]),
    root: o.oneOfType([o.func, o.object])
  }),
  /**
   * The components used for each slot inside.
   * @default {}
   */
  slots: o.shape({
    input: o.elementType,
    root: o.elementType
  }),
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object]),
  /**
   * The value of the component. The DOM API casts this to a string.
   * The browser uses "on" as the default value.
   */
  value: o.any
});
function lt(e) {
  return an;
}
function Pn(e) {
  return Te("MuiSimpleTreeView", e);
}
we("MuiSimpleTreeView", ["root"]);
const Sn = (e, t) => {
  const n = x.useRef({}), [r, s] = x.useState(() => {
    const c = {};
    return e.forEach((l) => {
      l.models && Object.entries(l.models).forEach(([d, f]) => {
        n.current[d] = {
          isControlled: t[d] !== void 0,
          getDefaultValue: f.getDefaultValue
        }, c[d] = f.getDefaultValue(t);
      });
    }), c;
  }), I = Object.fromEntries(Object.entries(n.current).map(([c, l]) => {
    const d = t[c] ?? r[c];
    return [c, {
      value: d,
      setControlledValue: (f) => {
        l.isControlled || s((i) => C({}, i, {
          [c]: f
        }));
      }
    }];
  }));
  return process.env.NODE_ENV !== "production" && Object.entries(n.current).forEach(([c, l]) => {
    const d = t[c], f = l.getDefaultValue(t);
    x.useEffect(() => {
      l.isControlled !== (d !== void 0) && console.error([`MUI X: A component is changing the ${l.isControlled ? "" : "un"}controlled ${c} state of TreeView to be ${l.isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${c} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join(`
`));
    }, [d]);
    const {
      current: i
    } = x.useRef(f);
    x.useEffect(() => {
      !l.isControlled && i !== f && console.error([`MUI X: A component is changing the default ${c} state of an uncontrolled TreeView after being initialized. To suppress this warning opt to use a controlled TreeView.`].join(`
`));
    }, [JSON.stringify(f)]);
  }), I;
};
class Rn {
  constructor() {
    this.maxListeners = 20, this.warnOnce = !1, this.events = {};
  }
  on(t, n, r = {}) {
    let s = this.events[t];
    if (s || (s = {
      highPriority: /* @__PURE__ */ new Map(),
      regular: /* @__PURE__ */ new Map()
    }, this.events[t] = s), r.isFirst ? s.highPriority.set(n, !0) : s.regular.set(n, !0), process.env.NODE_ENV !== "production") {
      const I = s.highPriority.size + s.regular.size;
      I > this.maxListeners && !this.warnOnce && (this.warnOnce = !0, console.warn([`Possible EventEmitter memory leak detected. ${I} ${t} listeners added.`].join(`
`)));
    }
  }
  removeListener(t, n) {
    this.events[t] && (this.events[t].regular.delete(n), this.events[t].highPriority.delete(n));
  }
  removeAllListeners() {
    this.events = {};
  }
  emit(t, ...n) {
    const r = this.events[t];
    if (!r)
      return;
    const s = Array.from(r.highPriority.keys()), I = Array.from(r.regular.keys());
    for (let c = s.length - 1; c >= 0; c -= 1) {
      const l = s[c];
      r.highPriority.has(l) && l.apply(this, n);
    }
    for (let c = 0; c < I.length; c += 1) {
      const l = I[c];
      r.regular.has(l) && l.apply(this, n);
    }
  }
  once(t, n) {
    const r = this;
    this.on(t, function s(...I) {
      r.removeListener(t, s), n.apply(r, I);
    });
  }
}
const Mn = (e) => e.isPropagationStopped !== void 0, at = () => {
  const [e] = x.useState(() => new Rn()), t = x.useCallback((...r) => {
    const [s, I, c = {}] = r;
    c.defaultMuiPrevented = !1, !(Mn(c) && c.isPropagationStopped()) && e.emit(s, I, c);
  }, [e]), n = x.useCallback((r, s) => (e.on(r, s), () => {
    e.removeListener(r, s);
  }), [e]);
  return {
    instance: {
      $$publishEvent: t,
      $$subscribeEvent: n
    }
  };
};
at.params = {};
const ct = ({
  plugins: e
}) => {
  const t = new Set(e);
  return {
    instance: {
      getAvailablePlugins: () => t
    }
  };
};
ct.params = {};
let nt = 0;
const kn = () => (nt += 1, `mui-tree-view-${nt}`), ve = ({
  id: e,
  treeId: t = "",
  itemId: n
}) => e ?? `${t}-${n}`, je = ({
  params: e,
  state: t,
  setState: n
}) => {
  x.useEffect(() => {
    n((s) => s.id.treeId === e.id && s.id.treeId !== void 0 ? s : C({}, s, {
      id: C({}, s.id, {
        treeId: e.id ?? kn()
      })
    }));
  }, [n, e.id]);
  const r = e.id ?? t.id.treeId;
  return {
    getRootProps: () => ({
      id: r
    }),
    contextValue: {
      treeId: r
    }
  };
};
je.params = {
  id: !0
};
je.getInitialState = ({
  id: e
}) => ({
  id: {
    treeId: e ?? void 0
  }
});
const On = [at, ct, je], Vn = ["slots", "slotProps", "apiRef", "experimentalFeatures"], Dn = (e) => {
  let {
    props: {
      slots: t,
      slotProps: n,
      apiRef: r,
      experimentalFeatures: s
    },
    plugins: I
  } = e, c = G(e.props, Vn);
  const l = {};
  I.forEach((u) => {
    Object.assign(l, u.params);
  });
  const d = {}, f = {};
  Object.keys(c).forEach((u) => {
    const g = c[u];
    l[u] ? d[u] = g : f[u] = g;
  });
  const i = s ?? {}, a = I.reduce((u, g) => g.getDefaultizedParams ? g.getDefaultizedParams({
    params: u,
    experimentalFeatures: i
  }) : u, d);
  return {
    apiRef: r,
    forwardedProps: f,
    pluginParams: a,
    slots: t ?? {},
    slotProps: n ?? {},
    experimentalFeatures: i
  };
}, Fn = ({
  plugins: e,
  instance: t,
  publicAPI: n,
  rootRef: r
}) => ({
  runItemPlugins: (l) => {
    let d = null, f = null;
    const i = [], a = {};
    e.forEach((h) => {
      if (!h.itemPlugin)
        return;
      const m = h.itemPlugin({
        props: l,
        rootRef: d,
        contentRef: f
      });
      m != null && m.rootRef && (d = m.rootRef), m != null && m.contentRef && (f = m.contentRef), m != null && m.propsEnhancers && (i.push(m.propsEnhancers), Object.keys(m.propsEnhancers).forEach((p) => {
        a[p] = !0;
      }));
    });
    const u = (h) => (m) => {
      const p = {};
      return i.forEach((b) => {
        const y = b[h];
        y != null && Object.assign(p, y(m));
      }), p;
    }, g = Object.fromEntries(Object.keys(a).map((h) => [h, u(h)]));
    return {
      contentRef: f,
      rootRef: d,
      propsEnhancers: g
    };
  },
  wrapItem: ({
    itemId: l,
    children: d
  }) => {
    let f = d;
    for (let i = e.length - 1; i >= 0; i -= 1) {
      const a = e[i];
      a.wrapItem && (f = a.wrapItem({
        itemId: l,
        children: f,
        instance: t
      }));
    }
    return f;
  },
  wrapRoot: ({
    children: l
  }) => {
    let d = l;
    for (let f = e.length - 1; f >= 0; f -= 1) {
      const i = e[f];
      i.wrapRoot && (d = i.wrapRoot({
        children: d,
        instance: t
      }));
    }
    return d;
  },
  instance: t,
  rootRef: r,
  publicAPI: n
});
function An(e) {
  const t = x.useRef({});
  return e ? (e.current == null && (e.current = {}), e.current) : t.current;
}
const Ln = ({
  plugins: e,
  rootRef: t,
  props: n
}) => {
  const r = [...On, ...e], {
    pluginParams: s,
    forwardedProps: I,
    apiRef: c,
    experimentalFeatures: l,
    slots: d,
    slotProps: f
  } = Dn({
    plugins: r,
    props: n
  }), i = Sn(r, s), u = x.useRef({}).current, g = An(c), h = x.useRef(null), m = ye(h, t), p = Fn({
    plugins: r,
    instance: u,
    publicAPI: g,
    rootRef: h
  }), [b, y] = x.useState(() => {
    const v = {};
    return r.forEach((M) => {
      M.getInitialState && Object.assign(v, M.getInitialState(s));
    }), v;
  }), T = [], S = (v) => {
    const M = v({
      instance: u,
      params: s,
      slots: d,
      slotProps: f,
      experimentalFeatures: l,
      state: b,
      setState: y,
      rootRef: h,
      models: i,
      plugins: r
    });
    M.getRootProps && T.push(M.getRootProps), M.publicAPI && Object.assign(g, M.publicAPI), M.instance && Object.assign(u, M.instance), M.contextValue && Object.assign(p, M.contextValue);
  };
  return r.forEach(S), {
    getRootProps: (v = {}) => {
      const M = C({
        role: "tree"
      }, I, v, {
        ref: m
      });
      return T.forEach(($) => {
        Object.assign(M, $(v));
      }), M;
    },
    rootRef: m,
    contextValue: p,
    instance: u
  };
}, Be = /* @__PURE__ */ x.createContext(null);
process.env.NODE_ENV !== "production" && (Be.displayName = "TreeViewContext");
function $n(e) {
  const {
    value: t,
    children: n
  } = e;
  return /* @__PURE__ */ E(Be.Provider, {
    value: t,
    children: t.wrapRoot({
      children: n,
      instance: t.instance
    })
  });
}
const oe = () => {
  const e = x.useContext(Be);
  if (e == null)
    throw new Error(["MUI X: Could not find the Tree View context.", "It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
`));
  return e;
}, dt = (e, t, n) => {
  e.$$publishEvent(t, n);
}, Y = "__TREE_VIEW_ROOT_PARENT_ID__", ut = (e) => {
  const t = {};
  return e.forEach((n, r) => {
    t[n] = r;
  }), t;
}, ne = /* @__PURE__ */ x.createContext(() => -1);
process.env.NODE_ENV !== "production" && (ne.displayName = "TreeViewItemDepthContext");
const Nn = ["children"], pt = ({
  items: e,
  isItemDisabled: t,
  getItemLabel: n,
  getItemId: r
}) => {
  const s = {}, I = {}, c = {
    [Y]: []
  }, l = (f, i, a) => {
    var m, p;
    const u = r ? r(f) : f.id;
    if (u == null)
      throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", "An item was provided without id in the `items` prop:", JSON.stringify(f)].join(`
`));
    if (s[u] != null)
      throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${u}"`].join(`
`));
    const g = n ? n(f) : f.label;
    if (g == null)
      throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.", "An item was provided without label in the `items` prop:", JSON.stringify(f)].join(`
`));
    s[u] = {
      id: u,
      label: g,
      parentId: a,
      idAttribute: void 0,
      expandable: !!((m = f.children) != null && m.length),
      disabled: t ? t(f) : !1,
      depth: i
    }, I[u] = f;
    const h = a ?? Y;
    c[h] || (c[h] = []), c[h].push(u), (p = f.children) == null || p.forEach((b) => l(b, i + 1, u));
  };
  e.forEach((f) => l(f, 0, null));
  const d = {};
  return Object.keys(c).forEach((f) => {
    d[f] = ut(c[f]);
  }), {
    itemMetaMap: s,
    itemMap: I,
    itemOrderedChildrenIds: c,
    itemChildrenIndexes: d
  };
}, de = ({
  instance: e,
  params: t,
  state: n,
  setState: r,
  experimentalFeatures: s
}) => {
  const I = x.useCallback((b) => n.items.itemMetaMap[b], [n.items.itemMetaMap]), c = x.useCallback((b) => n.items.itemMap[b], [n.items.itemMap]), l = x.useCallback(() => {
    const b = (y) => {
      const T = n.items.itemMap[y], S = G(T, Nn), w = n.items.itemOrderedChildrenIds[y];
      return w && (S.children = w.map(b)), S;
    };
    return n.items.itemOrderedChildrenIds[Y].map(b);
  }, [n.items.itemMap, n.items.itemOrderedChildrenIds]), d = x.useCallback((b) => {
    if (b == null)
      return !1;
    let y = e.getItemMeta(b);
    if (!y)
      return !1;
    if (y.disabled)
      return !0;
    for (; y.parentId != null; )
      if (y = e.getItemMeta(y.parentId), y.disabled)
        return !0;
    return !1;
  }, [e]), f = x.useCallback((b) => {
    const y = e.getItemMeta(b).parentId ?? Y;
    return n.items.itemChildrenIndexes[y][b];
  }, [e, n.items.itemChildrenIndexes]), i = x.useCallback((b) => n.items.itemOrderedChildrenIds[b ?? Y] ?? [], [n.items.itemOrderedChildrenIds]), a = (b) => {
    const y = e.getItemMeta(b);
    return y == null ? null : document.getElementById(ve({
      treeId: n.id.treeId,
      itemId: b,
      id: y.idAttribute
    }));
  }, u = (b) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(b), g = x.useRef(!1), h = x.useCallback(() => {
    g.current = !0;
  }, []), m = x.useCallback(() => g.current, []);
  return x.useEffect(() => {
    e.areItemUpdatesPrevented() || r((b) => {
      const y = pt({
        items: t.items,
        isItemDisabled: t.isItemDisabled,
        getItemId: t.getItemId,
        getItemLabel: t.getItemLabel
      });
      return Object.values(b.items.itemMetaMap).forEach((T) => {
        y.itemMetaMap[T.id] || dt(e, "removeItem", {
          id: T.id
        });
      }), C({}, b, {
        items: y
      });
    });
  }, [e, r, t.items, t.isItemDisabled, t.getItemId, t.getItemLabel]), {
    getRootProps: () => ({
      style: {
        "--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation
      }
    }),
    publicAPI: {
      getItem: c,
      getItemDOMElement: a,
      getItemTree: l,
      getItemOrderedChildrenIds: i
    },
    instance: {
      getItemMeta: I,
      getItem: c,
      getItemTree: l,
      getItemsToRender: () => {
        const b = (y) => {
          var S;
          const T = n.items.itemMetaMap[y];
          return {
            label: T.label,
            itemId: T.id,
            id: T.idAttribute,
            children: (S = n.items.itemOrderedChildrenIds[y]) == null ? void 0 : S.map(b)
          };
        };
        return n.items.itemOrderedChildrenIds[Y].map(b);
      },
      getItemIndex: f,
      getItemDOMElement: a,
      getItemOrderedChildrenIds: i,
      isItemDisabled: d,
      isItemNavigable: u,
      preventItemUpdates: h,
      areItemUpdatesPrevented: m
    },
    contextValue: {
      items: {
        onItemClick: t.onItemClick,
        disabledItemsFocusable: t.disabledItemsFocusable,
        indentationAtItemLevel: s.indentationAtItemLevel ?? !1
      }
    }
  };
};
de.getInitialState = (e) => ({
  items: pt({
    items: e.items,
    isItemDisabled: e.isItemDisabled,
    getItemId: e.getItemId,
    getItemLabel: e.getItemLabel
  })
});
de.getDefaultizedParams = ({
  params: e
}) => C({}, e, {
  disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
  itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
});
de.wrapRoot = ({
  children: e,
  instance: t
}) => /* @__PURE__ */ E(ne.Provider, {
  value: (n) => {
    var r;
    return ((r = t.getItemMeta(n)) == null ? void 0 : r.depth) ?? 0;
  },
  children: e
});
de.params = {
  disabledItemsFocusable: !0,
  items: !0,
  isItemDisabled: !0,
  getItemLabel: !0,
  getItemId: !0,
  onItemClick: !0,
  itemChildrenIndentation: !0
};
const Pe = ({
  instance: e,
  params: t,
  models: n
}) => {
  const r = x.useMemo(() => {
    const a = /* @__PURE__ */ new Map();
    return n.expandedItems.value.forEach((u) => {
      a.set(u, !0);
    }), a;
  }, [n.expandedItems.value]), s = (a, u) => {
    var g;
    (g = t.onExpandedItemsChange) == null || g.call(t, a, u), n.expandedItems.setControlledValue(u);
  }, I = x.useCallback((a) => r.has(a), [r]), c = x.useCallback((a) => {
    var u;
    return !!((u = e.getItemMeta(a)) != null && u.expandable);
  }, [e]), l = U((a, u) => {
    const g = e.isItemExpanded(u);
    e.setItemExpansion(a, u, !g);
  }), d = U((a, u, g) => {
    if (e.isItemExpanded(u) === g)
      return;
    let m;
    g ? m = [u].concat(n.expandedItems.value) : m = n.expandedItems.value.filter((p) => p !== u), t.onItemExpansionToggle && t.onItemExpansionToggle(a, u, g), s(a, m);
  }), f = (a, u) => {
    const g = e.getItemMeta(u), m = e.getItemOrderedChildrenIds(g.parentId).filter((b) => e.isItemExpandable(b) && !e.isItemExpanded(b)), p = n.expandedItems.value.concat(m);
    m.length > 0 && (t.onItemExpansionToggle && m.forEach((b) => {
      t.onItemExpansionToggle(a, b, !0);
    }), s(a, p));
  }, i = x.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
  return {
    publicAPI: {
      setItemExpansion: d
    },
    instance: {
      isItemExpanded: I,
      isItemExpandable: c,
      setItemExpansion: d,
      toggleItemExpansion: l,
      expandAllSiblings: f
    },
    contextValue: {
      expansion: {
        expansionTrigger: i
      }
    }
  };
};
Pe.models = {
  expandedItems: {
    getDefaultValue: (e) => e.defaultExpandedItems
  }
};
const jn = [];
Pe.getDefaultizedParams = ({
  params: e
}) => C({}, e, {
  defaultExpandedItems: e.defaultExpandedItems ?? jn
});
Pe.params = {
  expandedItems: !0,
  defaultExpandedItems: !0,
  onExpandedItemsChange: !0,
  onItemExpansionToggle: !0,
  expansionTrigger: !0
};
const ft = (e, t) => {
  let n = t.length - 1;
  for (; n >= 0 && !e.isItemNavigable(t[n]); )
    n -= 1;
  if (n !== -1)
    return t[n];
}, mt = (e, t) => {
  const n = e.getItemMeta(t), r = e.getItemOrderedChildrenIds(n.parentId), s = e.getItemIndex(t);
  if (s === 0)
    return n.parentId;
  let I = s - 1;
  for (; !e.isItemNavigable(r[I]) && I >= 0; )
    I -= 1;
  if (I === -1)
    return n.parentId == null ? null : mt(e, n.parentId);
  let c = r[I], l = ft(e, e.getItemOrderedChildrenIds(c));
  for (; e.isItemExpanded(c) && l != null; )
    c = l, l = e.getItemOrderedChildrenIds(c).find(e.isItemNavigable);
  return c;
}, ge = (e, t) => {
  if (e.isItemExpanded(t)) {
    const r = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
    if (r != null)
      return r;
  }
  let n = e.getItemMeta(t);
  for (; n != null; ) {
    const r = e.getItemOrderedChildrenIds(n.parentId), s = e.getItemIndex(n.id);
    if (s < r.length - 1) {
      let I = s + 1;
      for (; !e.isItemNavigable(r[I]) && I < r.length - 1; )
        I += 1;
      if (e.isItemNavigable(r[I]))
        return r[I];
    }
    n = e.getItemMeta(n.parentId);
  }
  return null;
}, It = (e) => {
  let t = null;
  for (; t == null || e.isItemExpanded(t); ) {
    const n = e.getItemOrderedChildrenIds(t), r = ft(e, n);
    if (r == null)
      return t;
    t = r;
  }
  return t;
}, ae = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), gt = (e, t, n) => {
  if (t === n)
    return [t, n];
  const r = e.getItemMeta(t), s = e.getItemMeta(n);
  if (r.parentId === s.id || s.parentId === r.id)
    return s.parentId === r.id ? [r.id, s.id] : [s.id, r.id];
  const I = [r.id], c = [s.id];
  let l = r.parentId, d = s.parentId, f = c.indexOf(l) !== -1, i = I.indexOf(d) !== -1, a = !0, u = !0;
  for (; !i && !f; )
    a && (I.push(l), f = c.indexOf(l) !== -1, a = l !== null, !f && a && (l = e.getItemMeta(l).parentId)), u && !f && (c.push(d), i = I.indexOf(d) !== -1, u = d !== null, !i && u && (d = e.getItemMeta(d).parentId));
  const g = f ? l : d, h = e.getItemOrderedChildrenIds(g), m = I[I.indexOf(g) - 1], p = c[c.indexOf(g) - 1];
  return h.indexOf(m) < h.indexOf(p) ? [t, n] : [n, t];
}, Bn = (e, t, n) => {
  const r = (d) => {
    if (e.isItemExpandable(d) && e.isItemExpanded(d))
      return e.getItemOrderedChildrenIds(d)[0];
    let f = e.getItemMeta(d);
    for (; f != null; ) {
      const i = e.getItemOrderedChildrenIds(f.parentId), a = e.getItemIndex(f.id);
      if (a < i.length - 1)
        return i[a + 1];
      f = e.getItemMeta(f.parentId);
    }
    throw new Error("Invalid range");
  }, [s, I] = gt(e, t, n), c = [s];
  let l = s;
  for (; l !== I; )
    l = r(l), e.isItemDisabled(l) || c.push(l);
  return c;
}, _n = (e) => {
  let t = ae(e);
  const n = [];
  for (; t != null; )
    n.push(t), t = ge(e, t);
  return n;
}, Le = (e, t) => t !== e.closest('*[role="treeitem"]'), be = (e) => Array.isArray(e) ? e : e != null ? [e] : [], Fe = (e) => {
  const t = {};
  return e.forEach((n) => {
    t[n] = !0;
  }), t;
}, Se = ({
  instance: e,
  params: t,
  models: n
}) => {
  const r = x.useRef(null), s = x.useRef({}), I = x.useMemo(() => {
    const m = /* @__PURE__ */ new Map();
    return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((p) => {
      m.set(p, !0);
    }) : n.selectedItems.value != null && m.set(n.selectedItems.value, !0), m;
  }, [n.selectedItems.value]), c = (m, p) => {
    if (t.onItemSelectionToggle)
      if (t.multiSelect) {
        const b = p.filter((T) => !e.isItemSelected(T)), y = n.selectedItems.value.filter((T) => !p.includes(T));
        b.forEach((T) => {
          t.onItemSelectionToggle(m, T, !0);
        }), y.forEach((T) => {
          t.onItemSelectionToggle(m, T, !1);
        });
      } else p !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(m, n.selectedItems.value, !1), p != null && t.onItemSelectionToggle(m, p, !0));
    t.onSelectedItemsChange && t.onSelectedItemsChange(m, p), n.selectedItems.setControlledValue(p);
  }, l = (m) => I.has(m), d = ({
    event: m,
    itemId: p,
    keepExistingSelection: b = !1,
    shouldBeSelected: y
  }) => {
    if (t.disableSelection)
      return;
    let T;
    if (b) {
      const S = be(n.selectedItems.value), w = e.isItemSelected(p);
      w && (y === !1 || y == null) ? T = S.filter((v) => v !== p) : !w && (y === !0 || y == null) ? T = [p].concat(S) : T = S;
    } else
      y === !1 || y == null && e.isItemSelected(p) ? T = t.multiSelect ? [] : null : T = t.multiSelect ? [p] : p;
    c(m, T), r.current = p, s.current = {};
  }, f = (m, [p, b]) => {
    if (t.disableSelection || !t.multiSelect)
      return;
    let y = be(n.selectedItems.value).slice();
    Object.keys(s.current).length > 0 && (y = y.filter((v) => !s.current[v]));
    const T = Fe(y), S = Bn(e, p, b), w = S.filter((v) => !T[v]);
    y = y.concat(w), c(m, y), s.current = Fe(S);
  };
  return {
    getRootProps: () => ({
      "aria-multiselectable": t.multiSelect
    }),
    publicAPI: {
      selectItem: d
    },
    instance: {
      isItemSelected: l,
      selectItem: d,
      selectAllNavigableItems: (m) => {
        if (t.disableSelection || !t.multiSelect)
          return;
        const p = _n(e);
        c(m, p), s.current = Fe(p);
      },
      expandSelectionRange: (m, p) => {
        if (r.current != null) {
          const [b, y] = gt(e, p, r.current);
          f(m, [b, y]);
        }
      },
      selectRangeFromStartToItem: (m, p) => {
        f(m, [ae(e), p]);
      },
      selectRangeFromItemToEnd: (m, p) => {
        f(m, [p, It(e)]);
      },
      selectItemFromArrowNavigation: (m, p, b) => {
        if (t.disableSelection || !t.multiSelect)
          return;
        let y = be(n.selectedItems.value).slice();
        Object.keys(s.current).length === 0 ? (y.push(b), s.current = {
          [p]: !0,
          [b]: !0
        }) : (s.current[p] || (s.current = {}), s.current[b] ? (y = y.filter((T) => T !== p), delete s.current[p]) : (y.push(b), s.current[b] = !0)), c(m, y);
      }
    },
    contextValue: {
      selection: {
        multiSelect: t.multiSelect,
        checkboxSelection: t.checkboxSelection,
        disableSelection: t.disableSelection
      }
    }
  };
};
Se.models = {
  selectedItems: {
    getDefaultValue: (e) => e.defaultSelectedItems
  }
};
const zn = [];
Se.getDefaultizedParams = ({
  params: e
}) => C({}, e, {
  disableSelection: e.disableSelection ?? !1,
  multiSelect: e.multiSelect ?? !1,
  checkboxSelection: e.checkboxSelection ?? !1,
  defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? zn : null)
});
Se.params = {
  disableSelection: !0,
  multiSelect: !0,
  checkboxSelection: !0,
  defaultSelectedItems: !0,
  selectedItems: !0,
  onSelectedItemsChange: !0,
  onItemSelectionToggle: !0
};
const ot = 1e3;
class Un {
  constructor(t = ot) {
    this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = ot, this.cleanupTimeout = t;
  }
  register(t, n, r) {
    this.timeouts || (this.timeouts = /* @__PURE__ */ new Map());
    const s = setTimeout(() => {
      typeof n == "function" && n(), this.timeouts.delete(r.cleanupToken);
    }, this.cleanupTimeout);
    this.timeouts.set(r.cleanupToken, s);
  }
  unregister(t) {
    const n = this.timeouts.get(t.cleanupToken);
    n && (this.timeouts.delete(t.cleanupToken), clearTimeout(n));
  }
  reset() {
    this.timeouts && (this.timeouts.forEach((t, n) => {
      this.unregister({
        cleanupToken: n
      });
    }), this.timeouts = void 0);
  }
}
class Kn {
  constructor() {
    this.registry = new FinalizationRegistry((t) => {
      typeof t == "function" && t();
    });
  }
  register(t, n, r) {
    this.registry.register(t, n, r);
  }
  unregister(t) {
    this.registry.unregister(t);
  }
  // eslint-disable-next-line class-methods-use-this
  reset() {
  }
}
class qn {
}
function Xn(e) {
  let t = 0;
  return function(r, s, I) {
    e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new Kn() : new Un());
    const [c] = x.useState(new qn()), l = x.useRef(null), d = x.useRef(void 0);
    d.current = I;
    const f = x.useRef(null);
    if (!l.current && d.current) {
      const i = (a, u) => {
        var g;
        u.defaultMuiPrevented || (g = d.current) == null || g.call(d, a, u);
      };
      l.current = r.$$subscribeEvent(s, i), t += 1, f.current = {
        cleanupToken: t
      }, e.registry.register(
        c,
        // The callback below will be called once this reference stops being retained
        () => {
          var a;
          (a = l.current) == null || a.call(l), l.current = null, f.current = null;
        },
        f.current
      );
    } else !d.current && l.current && (l.current(), l.current = null, f.current && (e.registry.unregister(f.current), f.current = null));
    x.useEffect(() => {
      if (!l.current && d.current) {
        const i = (a, u) => {
          var g;
          u.defaultMuiPrevented || (g = d.current) == null || g.call(d, a, u);
        };
        l.current = r.$$subscribeEvent(s, i);
      }
      return f.current && e.registry && (e.registry.unregister(f.current), f.current = null), () => {
        var i;
        (i = l.current) == null || i.call(l), l.current = null;
      };
    }, [r, s]);
  };
}
const Jn = {
  registry: null
}, Wn = Xn(Jn), bt = (e = document) => {
  const t = e.activeElement;
  return t ? t.shadowRoot ? bt(t.shadowRoot) : t : null;
};
function Gn(e) {
  return e.replace(/["\\]/g, "\\$&");
}
const Yn = (e, t) => {
  let n = be(t).find((r) => {
    if (!e.isItemNavigable(r))
      return !1;
    const s = e.getItemMeta(r);
    return s && (s.parentId == null || e.isItemExpanded(s.parentId));
  });
  return n == null && (n = ae(e)), n;
}, _e = ({
  instance: e,
  params: t,
  state: n,
  setState: r,
  models: s,
  rootRef: I
}) => {
  const c = Yn(e, s.selectedItems.value), l = U((p) => {
    const b = typeof p == "function" ? p(n.focusedItemId) : p;
    n.focusedItemId !== b && r((y) => C({}, y, {
      focusedItemId: b
    }));
  }), d = x.useCallback(() => !!I.current && I.current.contains(bt(Qt(I.current))), [I]), f = x.useCallback((p) => n.focusedItemId === p && d(), [n.focusedItemId, d]), i = (p) => {
    const b = e.getItemMeta(p);
    return b && (b.parentId == null || e.isItemExpanded(b.parentId));
  }, a = (p, b) => {
    const y = e.getItemDOMElement(b);
    y && y.focus(), l(b), t.onItemFocus && t.onItemFocus(p, b);
  }, u = U((p, b) => {
    i(b) && a(p, b);
  }), g = U(() => {
    if (n.focusedItemId == null)
      return;
    if (e.getItemMeta(n.focusedItemId)) {
      const b = e.getItemDOMElement(n.focusedItemId);
      b && b.blur();
    }
    l(null);
  }), h = (p) => p === c;
  Wn(e, "removeItem", ({
    id: p
  }) => {
    n.focusedItemId === p && a(null, c);
  });
  const m = (p) => (b) => {
    var y;
    (y = p.onFocus) == null || y.call(p, b), !b.defaultMuiPrevented && b.target === b.currentTarget && a(b, c);
  };
  return {
    getRootProps: (p) => ({
      onFocus: m(p)
    }),
    publicAPI: {
      focusItem: u
    },
    instance: {
      isItemFocused: f,
      canItemBeTabbed: h,
      focusItem: u,
      removeFocusedItem: g
    }
  };
};
_e.getInitialState = () => ({
  focusedItemId: null
});
_e.params = {
  onItemFocus: !0
};
const he = (e, t) => e.getAvailablePlugins().has(t), Qn = ({
  props: e
}) => {
  const {
    instance: t
  } = oe(), {
    label: n,
    itemId: r
  } = e, [s, I] = x.useState(n), c = t.isItemBeingEdited(r);
  return x.useEffect(() => {
    c || I(n);
  }, [c, n]), {
    propsEnhancers: {
      labelInput: ({
        externalEventHandlers: l,
        interactions: d
      }) => t.isItemEditable(r) ? {
        value: s ?? "",
        "data-element": "labelInput",
        onChange: (g) => {
          var h;
          (h = l.onChange) == null || h.call(l, g), I(g.target.value);
        },
        onKeyDown: (g) => {
          var m;
          if ((m = l.onKeyDown) == null || m.call(l, g), g.defaultMuiPrevented)
            return;
          const h = g.target;
          g.key === "Enter" && h.value ? d.handleSaveItemLabel(g, h.value) : g.key === "Escape" && d.handleCancelItemLabelEditing(g);
        },
        onBlur: (g) => {
          var h;
          (h = l.onBlur) == null || h.call(l, g), !g.defaultMuiPrevented && g.target.value && d.handleSaveItemLabel(g, g.target.value);
        },
        autoFocus: !0,
        type: "text"
      } : {}
    }
  };
}, K = ({
  instance: e,
  state: t,
  setState: n,
  params: r
}) => {
  const s = x.useRef(t.editedItemId), I = (a) => s.current === a, c = (a) => {
    n((u) => C({}, u, {
      editedItemId: a
    })), s.current = a;
  }, l = (a) => a === t.editedItemId, d = !!r.isItemEditable, f = (a) => {
    if (a == null || !d)
      return !1;
    const u = e.getItem(a);
    return u ? typeof r.isItemEditable == "function" ? r.isItemEditable(u) : !!r.isItemEditable : !1;
  }, i = (a, u) => {
    if (!u)
      throw new Error(["MUI X: The Tree View component requires all items to have a `label` property.", "The label of an item cannot be empty.", a].join(`
`));
    n((g) => {
      const h = g.items.itemMetaMap[a];
      return h.label !== u ? C({}, g, {
        items: C({}, g.items, {
          itemMetaMap: C({}, g.items.itemMetaMap, {
            [a]: C({}, h, {
              label: u
            })
          })
        })
      }) : g;
    }), r.onItemLabelChange && r.onItemLabelChange(a, u);
  };
  return {
    instance: {
      setEditedItemId: c,
      isItemBeingEdited: l,
      updateItemLabel: i,
      isItemEditable: f,
      isTreeViewEditable: d,
      isItemBeingEditedRef: I
    },
    publicAPI: {
      updateItemLabel: i
    }
  };
};
K.itemPlugin = Qn;
K.getDefaultizedParams = ({
  params: e,
  experimentalFeatures: t
}) => {
  const n = t == null ? void 0 : t.labelEditing;
  return process.env.NODE_ENV !== "production" && e.isItemEditable && !n && xe(["MUI X: The label editing feature requires the `labelEditing` experimental feature to be enabled.", "You can do it by passing `experimentalFeatures={{ labelEditing: true}}` to the Rich Tree View Pro component.", "Check the documentation for more details: https://mui.com/x/react-tree-view/rich-tree-view/editing/"]), C({}, e, {
    isItemEditable: n ? e.isItemEditable ?? !1 : !1
  });
};
K.getInitialState = () => ({
  editedItemId: null
});
K.params = {
  onItemLabelChange: !0,
  isItemEditable: !0
};
function Zn(e) {
  return !!e && e.length === 1 && !!e.match(/\S/);
}
const ht = ({
  instance: e,
  params: t,
  state: n
}) => {
  const r = Zt(), s = x.useRef({}), I = U((i) => {
    s.current = i(s.current);
  });
  x.useEffect(() => {
    if (e.areItemUpdatesPrevented())
      return;
    const i = {}, a = (u) => {
      i[u.id] = u.label.substring(0, 1).toLowerCase();
    };
    Object.values(n.items.itemMetaMap).forEach(a), s.current = i;
  }, [n.items.itemMetaMap, t.getItemId, e]);
  const c = (i, a) => {
    const u = a.toLowerCase(), g = (b) => {
      const y = ge(e, b);
      return y === null ? ae(e) : y;
    };
    let h = null, m = g(i);
    const p = {};
    for (; h == null && !p[m]; )
      s.current[m] === u ? h = m : (p[m] = !0, m = g(m));
    return h;
  }, l = (i) => !t.disableSelection && !e.isItemDisabled(i), d = (i) => !e.isItemDisabled(i) && e.isItemExpandable(i);
  return {
    instance: {
      updateFirstCharMap: I,
      handleItemKeyDown: (i, a) => {
        if (i.defaultMuiPrevented || i.altKey || Le(i.target, i.currentTarget))
          return;
        const u = i.ctrlKey || i.metaKey, g = i.key;
        switch (!0) {
          // Select the item when pressing "Space"
          case (g === " " && l(a)): {
            i.preventDefault(), t.multiSelect && i.shiftKey ? e.expandSelectionRange(i, a) : e.selectItem({
              event: i,
              itemId: a,
              keepExistingSelection: t.multiSelect,
              shouldBeSelected: t.multiSelect ? void 0 : !0
            });
            break;
          }
          // If the focused item has children, we expand it.
          // If the focused item has no children, we select it.
          case g === "Enter": {
            he(e, K) && e.isItemEditable(a) && !e.isItemBeingEdited(a) ? e.setEditedItemId(a) : d(a) ? (e.toggleItemExpansion(i, a), i.preventDefault()) : l(a) && (t.multiSelect ? (i.preventDefault(), e.selectItem({
              event: i,
              itemId: a,
              keepExistingSelection: !0
            })) : e.isItemSelected(a) || (e.selectItem({
              event: i,
              itemId: a
            }), i.preventDefault()));
            break;
          }
          // Focus the next focusable item
          case g === "ArrowDown": {
            const h = ge(e, a);
            h && (i.preventDefault(), e.focusItem(i, h), t.multiSelect && i.shiftKey && l(h) && e.selectItemFromArrowNavigation(i, a, h));
            break;
          }
          // Focuses the previous focusable item
          case g === "ArrowUp": {
            const h = mt(e, a);
            h && (i.preventDefault(), e.focusItem(i, h), t.multiSelect && i.shiftKey && l(h) && e.selectItemFromArrowNavigation(i, a, h));
            break;
          }
          // If the focused item is expanded, we move the focus to its first child
          // If the focused item is collapsed and has children, we expand it
          case (g === "ArrowRight" && !r || g === "ArrowLeft" && r): {
            if (u)
              return;
            if (e.isItemExpanded(a)) {
              const h = ge(e, a);
              h && (e.focusItem(i, h), i.preventDefault());
            } else d(a) && (e.toggleItemExpansion(i, a), i.preventDefault());
            break;
          }
          // If the focused item is expanded, we collapse it
          // If the focused item is collapsed and has a parent, we move the focus to this parent
          case (g === "ArrowLeft" && !r || g === "ArrowRight" && r): {
            if (u)
              return;
            if (d(a) && e.isItemExpanded(a))
              e.toggleItemExpansion(i, a), i.preventDefault();
            else {
              const h = e.getItemMeta(a).parentId;
              h && (e.focusItem(i, h), i.preventDefault());
            }
            break;
          }
          // Focuses the first item in the tree
          case g === "Home": {
            l(a) && t.multiSelect && u && i.shiftKey ? e.selectRangeFromStartToItem(i, a) : e.focusItem(i, ae(e)), i.preventDefault();
            break;
          }
          // Focuses the last item in the tree
          case g === "End": {
            l(a) && t.multiSelect && u && i.shiftKey ? e.selectRangeFromItemToEnd(i, a) : e.focusItem(i, It(e)), i.preventDefault();
            break;
          }
          // Expand all siblings that are at the same level as the focused item
          case g === "*": {
            e.expandAllSiblings(i, a), i.preventDefault();
            break;
          }
          // Multi select behavior when pressing Ctrl + a
          // Selects all the items
          case (String.fromCharCode(i.keyCode) === "A" && u && t.multiSelect && !t.disableSelection): {
            e.selectAllNavigableItems(i), i.preventDefault();
            break;
          }
          // Type-ahead
          // TODO: Support typing multiple characters
          case (!u && !i.shiftKey && Zn(g)): {
            const h = c(a, g);
            h != null && (e.focusItem(i, h), i.preventDefault());
            break;
          }
        }
      }
    }
  };
};
ht.params = {};
const yt = ({
  slots: e,
  slotProps: t
}) => ({
  contextValue: {
    icons: {
      slots: {
        collapseIcon: e.collapseIcon,
        expandIcon: e.expandIcon,
        endIcon: e.endIcon
      },
      slotProps: {
        collapseIcon: t.collapseIcon,
        expandIcon: t.expandIcon,
        endIcon: t.endIcon
      }
    }
  }
});
yt.params = {};
const ze = /* @__PURE__ */ x.createContext(null);
process.env.NODE_ENV !== "production" && (ze.displayName = "TreeViewChildrenItemContext");
function Ue(e) {
  const {
    children: t,
    itemId: n = null
  } = e, {
    instance: r,
    treeId: s,
    rootRef: I
  } = oe(), c = x.useRef(/* @__PURE__ */ new Map());
  x.useEffect(() => {
    if (!I.current)
      return;
    let d = null;
    if (n == null)
      d = I.current.id;
    else {
      const h = r.getItemMeta(n);
      h !== void 0 && (d = ve({
        itemId: n,
        treeId: s,
        id: h.idAttribute
      }));
    }
    if (d == null)
      return;
    const f = r.getItemOrderedChildrenIds(n ?? null) ?? [], i = Gn(d), a = I.current.querySelectorAll(`${n == null ? "" : `*[id="${i}"] `}[role="treeitem"]:not(*[id="${i}"] [role="treeitem"] [role="treeitem"])`), u = Array.from(a).map((h) => c.current.get(h.id));
    (u.length !== f.length || u.some((h, m) => h !== f[m])) && r.setJSXItemsOrderedChildrenIds(n ?? null, u);
  });
  const l = x.useMemo(() => ({
    registerChild: (d, f) => c.current.set(d, f),
    unregisterChild: (d) => c.current.delete(d),
    parentId: n
  }), [n]);
  return /* @__PURE__ */ E(ze.Provider, {
    value: l,
    children: t
  });
}
process.env.NODE_ENV !== "production" && (Ue.propTypes = {
  children: o.node,
  id: o.string
});
const ue = ({
  instance: e,
  setState: t
}) => {
  e.preventItemUpdates();
  const n = U((I) => (t((c) => {
    if (c.items.itemMetaMap[I.id] != null)
      throw new Error(["MUI X: The Tree View component requires all items to have a unique `id` property.", "Alternatively, you can use the `getItemId` prop to specify a custom id for each item.", `Two items were provided with the same id in the \`items\` prop: "${I.id}"`].join(`
`));
    return C({}, c, {
      items: C({}, c.items, {
        itemMetaMap: C({}, c.items.itemMetaMap, {
          [I.id]: I
        }),
        // For Simple Tree View, we don't have a proper `item` object, so we create a very basic one.
        itemMap: C({}, c.items.itemMap, {
          [I.id]: {
            id: I.id,
            label: I.label
          }
        })
      })
    });
  }), () => {
    t((c) => {
      const l = C({}, c.items.itemMetaMap), d = C({}, c.items.itemMap);
      return delete l[I.id], delete d[I.id], C({}, c, {
        items: C({}, c.items, {
          itemMetaMap: l,
          itemMap: d
        })
      });
    }), dt(e, "removeItem", {
      id: I.id
    });
  })), r = (I, c) => {
    const l = I ?? Y;
    t((d) => C({}, d, {
      items: C({}, d.items, {
        itemOrderedChildrenIds: C({}, d.items.itemOrderedChildrenIds, {
          [l]: c
        }),
        itemChildrenIndexes: C({}, d.items.itemChildrenIndexes, {
          [l]: ut(c)
        })
      })
    }));
  }, s = U((I, c) => (e.updateFirstCharMap((l) => (l[I] = c, l)), () => {
    e.updateFirstCharMap((l) => {
      const d = C({}, l);
      return delete d[I], d;
    });
  }));
  return {
    instance: {
      insertJSXItem: n,
      setJSXItemsOrderedChildrenIds: r,
      mapFirstCharFromJSX: s
    }
  };
}, xt = (e) => Array.isArray(e) ? e.length > 0 && e.some(xt) : !!e, Hn = ({
  props: e,
  rootRef: t,
  contentRef: n
}) => {
  const {
    instance: r,
    treeId: s
  } = oe(), {
    children: I,
    disabled: c = !1,
    label: l,
    itemId: d,
    id: f
  } = e, i = x.useContext(ze);
  if (i == null)
    throw new Error(["MUI X: Could not find the Tree View Children Item context.", "It looks like you rendered your component outside of a SimpleTreeView parent component.", "This can also happen if you are bundling multiple versions of the Tree View."].join(`
`));
  const {
    registerChild: a,
    unregisterChild: u,
    parentId: g
  } = i, h = xt(I), m = x.useRef(null), p = ye(m, n);
  return Ht(() => {
    const b = ve({
      itemId: d,
      treeId: s,
      id: f
    });
    return a(b, d), () => {
      u(b);
    };
  }, [a, u, d, f, s]), x.useEffect(() => r.insertJSXItem({
    id: d,
    idAttribute: f,
    parentId: g,
    expandable: h,
    disabled: c
  }), [r, g, d, h, c, f]), x.useEffect(() => {
    var b;
    if (l)
      return r.mapFirstCharFromJSX(d, (((b = m.current) == null ? void 0 : b.textContent) ?? "").substring(0, 1).toLowerCase());
  }, [r, d, l]), {
    contentRef: p,
    rootRef: t
  };
};
ue.itemPlugin = Hn;
ue.wrapItem = ({
  children: e,
  itemId: t
}) => {
  const n = x.useContext(ne);
  return /* @__PURE__ */ E(Ue, {
    itemId: t,
    children: /* @__PURE__ */ E(ne.Provider, {
      value: n + 1,
      children: e
    })
  });
};
ue.wrapRoot = ({
  children: e
}) => /* @__PURE__ */ E(Ue, {
  children: /* @__PURE__ */ E(ne.Provider, {
    value: 0,
    children: e
  })
});
ue.params = {};
const eo = [de, Pe, Se, _e, ht, yt, ue], to = lt(), no = (e) => {
  const {
    classes: t
  } = e;
  return Ee({
    root: ["root"]
  }, Pn, t);
}, oo = _("ul", {
  name: "MuiSimpleTreeView",
  slot: "Root",
  overridesResolver: (e, t) => t.root
})({
  padding: 0,
  margin: 0,
  listStyle: "none",
  outline: 0,
  position: "relative"
}), ro = [], Ct = /* @__PURE__ */ x.forwardRef(function(t, n) {
  const r = to({
    props: t,
    name: "MuiSimpleTreeView"
  }), s = r;
  process.env.NODE_ENV !== "production" && r.items != null && xe(["MUI X: The Simple Tree View component does not support the `items` prop.", "If you want to add items, you need to pass them as JSX children.", "Check the documentation for more details: https://mui.com/x/react-tree-view/simple-tree-view/items/."]);
  const {
    getRootProps: I,
    contextValue: c
  } = Ln({
    plugins: eo,
    rootRef: n,
    props: C({}, r, {
      items: ro
    })
  }), {
    slots: l,
    slotProps: d
  } = r, f = no(r), i = (l == null ? void 0 : l.root) ?? oo, a = se({
    elementType: i,
    externalSlotProps: d == null ? void 0 : d.root,
    className: f.root,
    getSlotProps: I,
    ownerState: s
  });
  return /* @__PURE__ */ E($n, {
    value: c,
    children: /* @__PURE__ */ E(i, C({}, a))
  });
});
process.env.NODE_ENV !== "production" && (Ct.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "pnpm proptypes"  |
  // ----------------------------------------------------------------------
  /**
   * The ref object that allows Tree View manipulation. Can be instantiated with `useTreeViewApiRef()`.
   */
  apiRef: o.shape({
    current: o.shape({
      focusItem: o.func.isRequired,
      getItem: o.func.isRequired,
      getItemDOMElement: o.func.isRequired,
      getItemOrderedChildrenIds: o.func.isRequired,
      getItemTree: o.func.isRequired,
      selectItem: o.func.isRequired,
      setItemExpansion: o.func.isRequired
    })
  }),
  /**
   * If `true`, the Tree View renders a checkbox at the left of its label that allows selecting it.
   * @default false
   */
  checkboxSelection: o.bool,
  /**
   * The content of the component.
   */
  children: o.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  className: o.string,
  /**
   * Expanded item ids.
   * Used when the item's expansion is not controlled.
   * @default []
   */
  defaultExpandedItems: o.arrayOf(o.string),
  /**
   * Selected item ids. (Uncontrolled)
   * When `multiSelect` is true this takes an array of strings; when false (default) a string.
   * @default []
   */
  defaultSelectedItems: o.any,
  /**
   * If `true`, will allow focus on disabled items.
   * @default false
   */
  disabledItemsFocusable: o.bool,
  /**
   * If `true` selection is disabled.
   * @default false
   */
  disableSelection: o.bool,
  /**
   * Expanded item ids.
   * Used when the item's expansion is controlled.
   */
  expandedItems: o.arrayOf(o.string),
  /**
   * The slot that triggers the item's expansion when clicked.
   * @default 'content'
   */
  expansionTrigger: o.oneOf(["content", "iconContainer"]),
  /**
   * Unstable features, breaking changes might be introduced.
   * For each feature, if the flag is not explicitly set to `true`,
   * the feature will be fully disabled and any property / method call will not have any effect.
   */
  experimentalFeatures: o.shape({
    indentationAtItemLevel: o.bool
  }),
  /**
   * This prop is used to help implement the accessibility logic.
   * If you don't provide this prop. It falls back to a randomly generated id.
   */
  id: o.string,
  /**
   * Horizontal indentation between an item and its children.
   * Examples: 24, "24px", "2rem", "2em".
   * @default 12px
   */
  itemChildrenIndentation: o.oneOfType([o.number, o.string]),
  /**
   * If `true`, `ctrl` and `shift` will trigger multiselect.
   * @default false
   */
  multiSelect: o.bool,
  /**
   * Callback fired when Tree Items are expanded/collapsed.
   * @param {React.SyntheticEvent} event The DOM event that triggered the change.
   * @param {array} itemIds The ids of the expanded items.
   */
  onExpandedItemsChange: o.func,
  /**
   * Callback fired when the `content` slot of a given Tree Item is clicked.
   * @param {React.MouseEvent} event The DOM event that triggered the change.
   * @param {string} itemId The id of the focused item.
   */
  onItemClick: o.func,
  /**
   * Callback fired when a Tree Item is expanded or collapsed.
   * @param {React.SyntheticEvent} event The DOM event that triggered the change.
   * @param {array} itemId The itemId of the modified item.
   * @param {array} isExpanded `true` if the item has just been expanded, `false` if it has just been collapsed.
   */
  onItemExpansionToggle: o.func,
  /**
   * Callback fired when a given Tree Item is focused.
   * @param {React.SyntheticEvent | null} event The DOM event that triggered the change. **Warning**: This is a generic event not a focus event.
   * @param {string} itemId The id of the focused item.
   */
  onItemFocus: o.func,
  /**
   * Callback fired when a Tree Item is selected or deselected.
   * @param {React.SyntheticEvent} event The DOM event that triggered the change.
   * @param {array} itemId The itemId of the modified item.
   * @param {array} isSelected `true` if the item has just been selected, `false` if it has just been deselected.
   */
  onItemSelectionToggle: o.func,
  /**
   * Callback fired when Tree Items are selected/deselected.
   * @param {React.SyntheticEvent} event The DOM event that triggered the change.
   * @param {string[] | string} itemIds The ids of the selected items.
   * When `multiSelect` is `true`, this is an array of strings; when false (default) a string.
   */
  onSelectedItemsChange: o.func,
  /**
   * Selected item ids. (Controlled)
   * When `multiSelect` is true this takes an array of strings; when false (default) a string.
   */
  selectedItems: o.any,
  /**
   * The props used for each component slot.
   */
  slotProps: o.object,
  /**
   * Overridable component slots.
   */
  slots: o.object,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
});
function Tt(e) {
  const {
    instance: t,
    items: {
      onItemClick: n
    },
    selection: {
      multiSelect: r,
      checkboxSelection: s,
      disableSelection: I
    },
    expansion: {
      expansionTrigger: c
    }
  } = oe(), l = t.isItemExpandable(e), d = t.isItemExpanded(e), f = t.isItemFocused(e), i = t.isItemSelected(e), a = t.isItemDisabled(e), u = t != null && t.isItemBeingEdited ? t == null ? void 0 : t.isItemBeingEdited(e) : !1, g = t.isItemEditable ? t.isItemEditable(e) : !1, h = (w) => {
    if (!a) {
      f || t.focusItem(w, e);
      const v = r && (w.shiftKey || w.ctrlKey || w.metaKey);
      l && !(v && t.isItemExpanded(e)) && t.toggleItemExpansion(w, e);
    }
  }, m = (w) => {
    a || (!f && !u && t.focusItem(w, e), r && (w.shiftKey || w.ctrlKey || w.metaKey) ? w.shiftKey ? t.expandSelectionRange(w, e) : t.selectItem({
      event: w,
      itemId: e,
      keepExistingSelection: !0
    }) : t.selectItem({
      event: w,
      itemId: e,
      shouldBeSelected: !0
    }));
  }, p = (w) => {
    if (I || a)
      return;
    const v = w.nativeEvent.shiftKey;
    r && v ? t.expandSelectionRange(w, e) : t.selectItem({
      event: w,
      itemId: e,
      keepExistingSelection: r,
      shouldBeSelected: w.target.checked
    });
  }, b = (w) => {
    (w.shiftKey || w.ctrlKey || w.metaKey || a) && w.preventDefault();
  }, y = () => {
    he(t, K) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
  };
  return {
    disabled: a,
    expanded: d,
    selected: i,
    focused: f,
    editable: g,
    editing: u,
    disableSelection: I,
    checkboxSelection: s,
    handleExpansion: h,
    handleSelection: m,
    handleCheckboxSelection: p,
    handleContentClick: n,
    preventSelection: b,
    expansionTrigger: c,
    toggleItemEditing: y,
    handleSaveItemLabel: (w, v) => {
      he(t, K) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, v), y(), t.focusItem(w, e));
    },
    handleCancelItemLabelEditing: (w) => {
      he(t, K) && t.isItemBeingEditedRef(e) && (y(), t.focusItem(w, e));
    }
  };
}
const io = _("div", {
  name: "MuiTreeItem2DragAndDropOverlay",
  slot: "Root",
  overridesResolver: (e, t) => t.root,
  shouldForwardProp: (e) => Ne(e) && e !== "action"
})(({
  theme: e
}) => ({
  position: "absolute",
  left: 0,
  display: "flex",
  top: 0,
  bottom: 0,
  right: 0,
  pointerEvents: "none",
  variants: [{
    props: {
      action: "make-child"
    },
    style: {
      marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
      borderRadius: e.shape.borderRadius,
      backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})` : W(e.palette.primary.dark, e.palette.action.focusOpacity)
    }
  }, {
    props: {
      action: "reorder-above"
    },
    style: {
      marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
      borderTop: `1px solid ${(e.vars || e).palette.action.active}`
    }
  }, {
    props: {
      action: "reorder-below"
    },
    style: {
      marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
      borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
    }
  }, {
    props: {
      action: "move-to-parent"
    },
    style: {
      marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
      borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
    }
  }]
}));
function wt(e) {
  return e.action == null ? null : /* @__PURE__ */ E(io, C({}, e));
}
process.env.NODE_ENV !== "production" && (wt.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "pnpm proptypes"  |
  // ----------------------------------------------------------------------
  action: o.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
  style: o.object
});
const so = _("input", {
  name: "MuiTreeItem2",
  slot: "LabelInput",
  overridesResolver: (e, t) => t.labelInput
})(({
  theme: e
}) => C({}, e.typography.body1, {
  width: "100%",
  backgroundColor: e.palette.background.paper,
  borderRadius: e.shape.borderRadius,
  border: "none",
  padding: "0 2px",
  boxSizing: "border-box",
  "&:focus": {
    outline: `1px solid ${e.palette.primary.main}`
  }
})), lo = ["classes", "className", "displayIcon", "expansionIcon", "icon", "label", "itemId", "onClick", "onMouseDown", "dragAndDropOverlayProps", "labelInputProps"], Ke = /* @__PURE__ */ x.forwardRef(function(t, n) {
  const {
    classes: r,
    className: s,
    displayIcon: I,
    expansionIcon: c,
    icon: l,
    label: d,
    itemId: f,
    onClick: i,
    onMouseDown: a,
    dragAndDropOverlayProps: u,
    labelInputProps: g
  } = t, h = G(t, lo), {
    disabled: m,
    expanded: p,
    selected: b,
    focused: y,
    editing: T,
    editable: S,
    disableSelection: w,
    checkboxSelection: v,
    handleExpansion: M,
    handleSelection: $,
    handleCheckboxSelection: q,
    handleContentClick: A,
    preventSelection: N,
    expansionTrigger: D,
    toggleItemEditing: Q
  } = Tt(f), z = l || c || I, Z = x.useRef(null), j = (O) => {
    N(O), a && a(O);
  }, re = (O) => {
    var J;
    A == null || A(O, f), !((J = Z.current) != null && J.contains(O.target)) && (D === "content" && M(O), v || $(O), i && i(O));
  }, X = (O) => {
    O.defaultMuiPrevented || Q();
  };
  return (
    /* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions -- Key event is handled by the TreeView */
    /* @__PURE__ */ Ce("div", C({}, h, {
      className: $e(r.root, s, p && r.expanded, b && r.selected, y && r.focused, m && r.disabled, T && r.editing, S && r.editable),
      onClick: re,
      onMouseDown: j,
      ref: n,
      children: [/* @__PURE__ */ E("div", {
        className: r.iconContainer,
        children: z
      }), v && /* @__PURE__ */ E(st, {
        className: r.checkbox,
        checked: b,
        onChange: q,
        disabled: m || w,
        ref: Z,
        tabIndex: -1
      }), T ? /* @__PURE__ */ E(so, C({}, g, {
        className: r.labelInput
      })) : /* @__PURE__ */ E("div", C({
        className: r.label
      }, S && {
        onDoubleClick: X
      }, {
        children: d
      })), u && /* @__PURE__ */ E(wt, C({}, u))]
    }))
  );
});
process.env.NODE_ENV !== "production" && (Ke.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "pnpm proptypes"  |
  // ----------------------------------------------------------------------
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object.isRequired,
  className: o.string,
  /**
   * The icon to display next to the Tree Item's label. Either a parent or end icon.
   */
  displayIcon: o.node,
  dragAndDropOverlayProps: o.shape({
    action: o.oneOf(["make-child", "move-to-parent", "reorder-above", "reorder-below"]),
    style: o.object
  }),
  /**
   * The icon to display next to the Tree Item's label. Either an expansion or collapse icon.
   */
  expansionIcon: o.node,
  /**
   * The icon to display next to the Tree Item's label.
   */
  icon: o.node,
  /**
   * The id of the item.
   */
  itemId: o.string.isRequired,
  /**
   * The Tree Item label.
   */
  label: o.node,
  labelInputProps: o.shape({
    autoFocus: o.oneOf([!0]),
    "data-element": o.oneOf(["labelInput"]),
    onBlur: o.func,
    onChange: o.func,
    onKeyDown: o.func,
    type: o.oneOf(["text"]),
    value: o.string
  })
});
function ao(e) {
  return Te("MuiTreeItem", e);
}
const B = we("MuiTreeItem", ["root", "groupTransition", "content", "expanded", "selected", "focused", "disabled", "iconContainer", "label", "checkbox", "labelInput", "editable", "editing", "dragAndDropOverlay"]), co = ce(/* @__PURE__ */ E("path", {
  d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
}), "TreeViewExpandIcon"), uo = ce(/* @__PURE__ */ E("path", {
  d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
}), "TreeViewCollapseIcon");
function Et(e) {
  const {
    children: t,
    itemId: n
  } = e, {
    wrapItem: r,
    instance: s
  } = oe();
  return r({
    children: t,
    itemId: n,
    instance: s
  });
}
Et.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "pnpm proptypes"  |
  // ----------------------------------------------------------------------
  children: o.node,
  itemId: o.string.isRequired
};
const po = ["children", "className", "slots", "slotProps", "ContentComponent", "ContentProps", "itemId", "id", "label", "onClick", "onMouseDown", "onFocus", "onBlur", "onKeyDown"], fo = ["ownerState"], mo = ["ownerState"], Io = ["ownerState"], go = lt(), bo = (e) => {
  const {
    classes: t
  } = e;
  return Ee({
    root: ["root"],
    content: ["content"],
    expanded: ["expanded"],
    selected: ["selected"],
    focused: ["focused"],
    disabled: ["disabled"],
    iconContainer: ["iconContainer"],
    checkbox: ["checkbox"],
    label: ["label"],
    labelInput: ["labelInput"],
    editing: ["editing"],
    editable: ["editable"],
    groupTransition: ["groupTransition"]
  }, ao, t);
}, ho = _("li", {
  name: "MuiTreeItem",
  slot: "Root",
  overridesResolver: (e, t) => t.root
})({
  listStyle: "none",
  margin: 0,
  padding: 0,
  outline: 0
}), yo = _(Ke, {
  name: "MuiTreeItem",
  slot: "Content",
  overridesResolver: (e, t) => [t.content, t.iconContainer && {
    [`& .${B.iconContainer}`]: t.iconContainer
  }, t.label && {
    [`& .${B.label}`]: t.label
  }],
  shouldForwardProp: (e) => Ne(e) && e !== "indentationAtItemLevel"
})(({
  theme: e
}) => ({
  padding: e.spacing(0.5, 1),
  borderRadius: e.shape.borderRadius,
  width: "100%",
  boxSizing: "border-box",
  // prevent width + padding to overflow
  position: "relative",
  display: "flex",
  alignItems: "center",
  gap: e.spacing(1),
  cursor: "pointer",
  WebkitTapHighlightColor: "transparent",
  "&:hover": {
    backgroundColor: (e.vars || e).palette.action.hover,
    // Reset on touch devices, it doesn't add specificity
    "@media (hover: none)": {
      backgroundColor: "transparent"
    }
  },
  [`&.${B.disabled}`]: {
    opacity: (e.vars || e).palette.action.disabledOpacity,
    backgroundColor: "transparent"
  },
  [`&.${B.focused}`]: {
    backgroundColor: (e.vars || e).palette.action.focus
  },
  [`&.${B.selected}`]: {
    backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : W(e.palette.primary.main, e.palette.action.selectedOpacity),
    "&:hover": {
      backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : W(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
      // Reset on touch devices, it doesn't add specificity
      "@media (hover: none)": {
        backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : W(e.palette.primary.main, e.palette.action.selectedOpacity)
      }
    },
    [`&.${B.focused}`]: {
      backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : W(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity)
    }
  },
  [`& .${B.iconContainer}`]: {
    width: 16,
    display: "flex",
    flexShrink: 0,
    justifyContent: "center",
    "& svg": {
      fontSize: 18
    }
  },
  [`& .${B.label}`]: C({
    width: "100%",
    boxSizing: "border-box",
    // prevent width + padding to overflow
    // fixes overflow - see https://github.com/mui/material-ui/issues/27372
    minWidth: 0,
    position: "relative"
  }, e.typography.body1),
  [`& .${B.checkbox}`]: {
    padding: 0
  },
  variants: [{
    props: {
      indentationAtItemLevel: !0
    },
    style: {
      paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))`
    }
  }]
})), xo = _(cn, {
  name: "MuiTreeItem",
  slot: "GroupTransition",
  overridesResolver: (e, t) => t.groupTransition,
  shouldForwardProp: (e) => Ne(e) && e !== "indentationAtItemLevel"
})({
  margin: 0,
  padding: 0,
  paddingLeft: "var(--TreeView-itemChildrenIndentation)",
  variants: [{
    props: {
      indentationAtItemLevel: !0
    },
    style: {
      paddingLeft: 0
    }
  }]
}), vt = /* @__PURE__ */ x.forwardRef(function(t, n) {
  var We, Ge, Ye, Qe;
  const {
    icons: r,
    runItemPlugins: s,
    items: {
      disabledItemsFocusable: I,
      indentationAtItemLevel: c
    },
    selection: {
      disableSelection: l
    },
    expansion: {
      expansionTrigger: d
    },
    treeId: f,
    instance: i
  } = oe(), a = x.useContext(ne), u = go({
    props: t,
    name: "MuiTreeItem"
  }), {
    children: g,
    className: h,
    slots: m,
    slotProps: p,
    ContentComponent: b = Ke,
    ContentProps: y,
    itemId: T,
    id: S,
    label: w,
    onClick: v,
    onMouseDown: M,
    onBlur: $,
    onKeyDown: q
  } = u, A = G(u, po), {
    expanded: N,
    focused: D,
    selected: Q,
    disabled: z,
    editing: Z,
    handleExpansion: j,
    handleCancelItemLabelEditing: re,
    handleSaveItemLabel: X
  } = Tt(T);
  process.env.NODE_ENV !== "production" && (u.ContentComponent && xe(["MUI X: The ContentComponent prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]), u.ContentProps && xe(["MUI X: The ContentProps prop of the TreeItem component is deprecated and will be removed in the next major release.", "You can use the new TreeItem2 component or the new useTreeItem2 hook to customize the rendering of the content.", "For more detail, see https://mui.com/x/react-tree-view/tree-item-customization/."]));
  const {
    contentRef: O,
    rootRef: J,
    propsEnhancers: V
  } = s(u), H = x.useRef(null), pe = x.useRef(null), Re = ye(n, J, H), R = ye(y == null ? void 0 : y.ref, O, pe), k = {
    expandIcon: (m == null ? void 0 : m.expandIcon) ?? r.slots.expandIcon ?? co,
    collapseIcon: (m == null ? void 0 : m.collapseIcon) ?? r.slots.collapseIcon ?? uo,
    endIcon: (m == null ? void 0 : m.endIcon) ?? r.slots.endIcon,
    icon: m == null ? void 0 : m.icon,
    groupTransition: m == null ? void 0 : m.groupTransition
  }, L = (P) => Array.isArray(P) ? P.length > 0 && P.some(L) : !!P, fe = L(g), Me = C({}, u, {
    expanded: N,
    focused: D,
    selected: Q,
    disabled: z,
    indentationAtItemLevel: c
  }), F = bo(Me), qe = k.groupTransition ?? void 0, St = se({
    elementType: qe,
    ownerState: {},
    externalSlotProps: p == null ? void 0 : p.groupTransition,
    additionalProps: C({
      unmountOnExit: !0,
      in: N,
      component: "ul",
      role: "group"
    }, c ? {
      indentationAtItemLevel: !0
    } : {}),
    className: F.groupTransition
  }), Rt = (P) => {
    d === "iconContainer" && j(P);
  }, ke = N ? k.collapseIcon : k.expandIcon, Mt = se({
    elementType: ke,
    ownerState: {},
    externalSlotProps: (P) => N ? C({}, te(r.slotProps.collapseIcon, P), te(p == null ? void 0 : p.collapseIcon, P)) : C({}, te(r.slotProps.expandIcon, P), te(p == null ? void 0 : p.expandIcon, P)),
    additionalProps: {
      onClick: Rt
    }
  }), kt = G(Mt, fo), Ot = fe && ke ? /* @__PURE__ */ E(ke, C({}, kt)) : null, Oe = fe ? void 0 : k.endIcon, Vt = se({
    elementType: Oe,
    ownerState: {},
    externalSlotProps: (P) => fe ? {} : C({}, te(r.slotProps.endIcon, P), te(p == null ? void 0 : p.endIcon, P))
  }), Dt = G(Vt, mo), Ft = Oe ? /* @__PURE__ */ E(Oe, C({}, Dt)) : null, Ve = k.icon, At = se({
    elementType: Ve,
    ownerState: {},
    externalSlotProps: p == null ? void 0 : p.icon
  }), Lt = G(At, Io), $t = Ve ? /* @__PURE__ */ E(Ve, C({}, Lt)) : null;
  let me;
  Q ? me = !0 : l || z ? me = void 0 : me = !1;
  function Nt(P) {
    !D && (!z || I) && P.currentTarget === P.target && i.focusItem(P, T);
  }
  function jt(P) {
    var ee, ie, Ze, He;
    $ == null || $(P), !(Z || // we can exit the editing state by clicking outside the input (within the Tree Item) or by pressing Enter or Escape -> we don't want to remove the focused item from the state in these cases
    // we can also exit the editing state by clicking on the root itself -> want to remove the focused item from the state in this case
    P.relatedTarget && Le(P.relatedTarget, H.current) && (P.target && ((ie = (ee = P.target) == null ? void 0 : ee.dataset) == null ? void 0 : ie.element) === "labelInput" && Le(P.target, H.current) || ((He = (Ze = P.relatedTarget) == null ? void 0 : Ze.dataset) == null ? void 0 : He.element) === "labelInput")) && i.removeFocusedItem();
  }
  const Bt = (P) => {
    var ee, ie;
    q == null || q(P), ((ie = (ee = P.target) == null ? void 0 : ee.dataset) == null ? void 0 : ie.element) !== "labelInput" && i.handleItemKeyDown(P, T);
  }, _t = ve({
    itemId: T,
    treeId: f,
    id: S
  }), zt = i.canItemBeTabbed(T) ? 0 : -1, Ie = {
    rootRefObject: H,
    contentRefObject: pe,
    interactions: {
      handleSaveItemLabel: X,
      handleCancelItemLabelEditing: re
    }
  }, Ut = ((We = V.root) == null ? void 0 : We.call(V, C({}, Ie, {
    externalEventHandlers: tt(A)
  }))) ?? {}, Kt = ((Ge = V.content) == null ? void 0 : Ge.call(V, C({}, Ie, {
    externalEventHandlers: tt(y)
  }))) ?? {}, Xe = ((Ye = V.dragAndDropOverlay) == null ? void 0 : Ye.call(V, C({}, Ie, {
    externalEventHandlers: {}
  }))) ?? {}, Je = ((Qe = V.labelInput) == null ? void 0 : Qe.call(V, C({}, Ie, {
    externalEventHandlers: {}
  }))) ?? {};
  return /* @__PURE__ */ E(Et, {
    itemId: T,
    children: /* @__PURE__ */ Ce(ho, C({
      className: $e(F.root, h),
      role: "treeitem",
      "aria-expanded": fe ? N : void 0,
      "aria-selected": me,
      "aria-disabled": z || void 0,
      id: _t,
      tabIndex: zt
    }, A, {
      ownerState: Me,
      onFocus: Nt,
      onBlur: jt,
      onKeyDown: Bt,
      ref: Re,
      style: c ? C({}, A.style, {
        "--TreeView-itemDepth": typeof a == "function" ? a(T) : a
      }) : A.style
    }, Ut, {
      children: [/* @__PURE__ */ E(yo, C({
        as: b,
        classes: {
          root: F.content,
          expanded: F.expanded,
          selected: F.selected,
          focused: F.focused,
          disabled: F.disabled,
          editable: F.editable,
          editing: F.editing,
          iconContainer: F.iconContainer,
          label: F.label,
          labelInput: F.labelInput,
          checkbox: F.checkbox
        },
        label: w,
        itemId: T,
        onClick: v,
        onMouseDown: M,
        icon: $t,
        expansionIcon: Ot,
        displayIcon: Ft,
        ownerState: Me
      }, y, Kt, Xe.action == null ? {} : {
        dragAndDropOverlayProps: Xe
      }, Je.value == null ? {} : {
        labelInputProps: Je
      }, {
        ref: R
      })), g && /* @__PURE__ */ E(xo, C({
        as: qe
      }, St, {
        children: g
      }))]
    }))
  });
});
process.env.NODE_ENV !== "production" && (vt.propTypes = {
  // ----------------------------- Warning --------------------------------
  // | These PropTypes are generated from the TypeScript type definitions |
  // | To update them edit the TypeScript types and run "pnpm proptypes"  |
  // ----------------------------------------------------------------------
  /**
   * The content of the component.
   */
  children: o.node,
  /**
   * Override or extend the styles applied to the component.
   */
  classes: o.object,
  className: o.string,
  /**
   * The component used to render the content of the item.
   * @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
   * @default TreeItemContent
   */
  ContentComponent: en,
  /**
   * Props applied to ContentComponent.
   * @deprecated Consider using the `<TreeItem2 />` component or the `useTreeItem2` hook instead. For more details, see https://mui.com/x/react-tree-view/tree-item-customization/.
   */
  ContentProps: o.object,
  /**
   * If `true`, the item is disabled.
   * @default false
   */
  disabled: o.bool,
  /**
   * The id of the item.
   */
  itemId: o.string.isRequired,
  /**
   * The Tree Item label.
   */
  label: o.node,
  /**
   * This prop isn't supported.
   * Use the `onItemFocus` callback on the tree if you need to monitor a item's focus.
   */
  onFocus: dn,
  /**
   * Callback fired when a key of the keyboard is pressed on the item.
   */
  onKeyDown: o.func,
  /**
   * The props used for each component slot.
   * @default {}
   */
  slotProps: o.object,
  /**
   * Overridable component slots.
   * @default {}
   */
  slots: o.object,
  /**
   * The system prop that allows defining system overrides as well as additional CSS styles.
   */
  sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
});
const Po = ({
  items: e,
  handleCheck: t,
  width: n = "250px",
  height: r = "350px",
  expanded: s
}) => /* @__PURE__ */ E(tn, { width: n, height: r, children: /* @__PURE__ */ E(Ct, { expandedItems: s, children: Pt(e, t) }) }), Pt = (e, t) => e.map((n) => /* @__PURE__ */ qt(Co, { ...n, key: n.id, handleCheck: t })), Co = ({
  id: e,
  checked: t,
  children: n,
  label: r,
  handleCheck: s
}) => /* @__PURE__ */ E(
  vt,
  {
    itemId: e,
    label: /* @__PURE__ */ Ce(nn, { flexDirection: "row", alignItems: "center", children: [
      /* @__PURE__ */ E(on, { children: r }),
      s && /* @__PURE__ */ E(
        rn,
        {
          disableRipple: !0,
          sx: { marginLeft: "auto" },
          onClick: (I) => {
            I.stopPropagation(), s(e, !t);
          },
          "data-testid": `toggle-visibility-${e}`,
          children: t ? /* @__PURE__ */ E(un, { "data-testid": `visibility-icon-${e}` }) : /* @__PURE__ */ E(pn, { "data-testid": `visibility-off-icon-${e}` })
        }
      )
    ] }),
    children: n.length > 0 && Pt(n, s)
  }
);
export {
  st as C,
  Po as T
};
