import { r as st, a as lt, b as ut, c as ct, d as pt, e as ft, f as dt, g as mt, h as vt, i as yt, j as qe, k as Ae, l as Ee, m as s, U as Ie, n as V, o as bt, v as _e, q as Le, u as gt, p as ht, P as ue } from "./publicApi-fkG2o0UD.js";
import Pt, { useContext as St, useState as $, useEffect as ge, useMemo as jt, useCallback as Ot } from "react";
import { P as xt, s as he, u as wt, a as Tt, M as Me, b as H, c as Ct, d as Et, T as It, C as ce, e as _t, S as Mt, f as Nt, g as Ne, h as De, i as Dt, E as kt, j as Rt, k as qt } from "./usePlatform-BOsxQh1R.js";
import { P as At } from "./toUpper-ubLyw1wj.js";
import { M as re, D as Lt } from "./Menu-Cnrbj5kL.js";
import { r as Ut } from "./ChevronLeft-jY1XrbRi.js";
import { E as Bt } from "./ErrorBoundary-D8xyNCpV.js";
var be = { exports: {} }, ke;
function $t() {
  return ke || (ke = 1, (() => {
    var a = {};
    a.n = (t) => {
      var e = t && t.__esModule ? (
        /******/
        () => t.default
      ) : () => t;
      return a.d(e, {
        a: e
      }), e;
    }, a.d = (t, e) => {
      for (var n in e)
        a.o(e, n) && !a.o(t, n) && Object.defineProperty(t, n, {
          enumerable: !0,
          get: e[n]
        });
    }, a.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e), a.r = (t) => {
      typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, {
        value: "Module"
      }), Object.defineProperty(t, "__esModule", {
        value: !0
      });
    };
    var g = {};
    a.r(g), a.d(g, {
      Panel: () => (
        /* reexport */
        Se
      ),
      default: () => (
        /* reexport */
        rt
      )
    });
    const y = Pt;
    var S = a.n(y);
    const x = /* @__PURE__ */ st();
    var l = a.n(x);
    const w = lt();
    var k = a.n(w);
    const R = ut();
    var E = a.n(R);
    const h = ct();
    var b = a.n(h);
    const q = pt();
    var P = a.n(q);
    const I = yt, F = ft(), K = dt;
    var T = a.n(K);
    const u = mt();
    var Q = a.n(u);
    const W = vt();
    var z = T()((0, I.animated)(Q())).withConfig({
      displayName: "SlidingPanelsStyles__StyledBox",
      componentId: "su6isq-0"
    })(["overflow:hidden;position:relative;"]), Y = T()(I.animated.div).withConfig({
      displayName: "SlidingPanelsStyles__Styled",
      componentId: "su6isq-1"
    })(["", ";", ";"], W.mixins.reset("block"), W.mixins.clearfix());
    function J(t, e) {
      t && (typeof t == "function" ? t(e) : t.current = e);
    }
    function j(t) {
      "@babel/helpers - typeof";
      return j = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
        return typeof e;
      } : function(e) {
        return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
      }, j(t);
    }
    function f() {
      return f = Object.assign ? Object.assign.bind() : function(t) {
        for (var e = 1; e < arguments.length; e++) {
          var n = arguments[e];
          for (var r in n)
            ({}).hasOwnProperty.call(n, r) && (t[r] = n[r]);
        }
        return t;
      }, f.apply(null, arguments);
    }
    function p(t, e) {
      if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
    }
    function m(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, Pe(r.key), r);
      }
    }
    function i(t, e, n) {
      return e && m(t.prototype, e), Object.defineProperty(t, "prototype", {
        writable: !1
      }), t;
    }
    function v(t, e) {
      if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
      t.prototype = Object.create(e && e.prototype, {
        constructor: {
          value: t,
          writable: !0,
          configurable: !0
        }
      }), Object.defineProperty(t, "prototype", {
        writable: !1
      }), e && _(t, e);
    }
    function _(t, e) {
      return _ = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
        return n.__proto__ = r, n;
      }, _(t, e);
    }
    function M(t) {
      var e = ee();
      return function() {
        var n, r = A(t);
        if (e) {
          var o = A(this).constructor;
          n = Reflect.construct(r, arguments, o);
        } else n = r.apply(this, arguments);
        return Z(this, n);
      };
    }
    function Z(t, e) {
      if (e && (j(e) == "object" || typeof e == "function")) return e;
      if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return X(t);
    }
    function X(t) {
      if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return t;
    }
    function ee() {
      try {
        var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
      } catch {
      }
      return (ee = function() {
        return !!t;
      })();
    }
    function A(t) {
      return A = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
        return e.__proto__ || Object.getPrototypeOf(e);
      }, A(t);
    }
    function L(t, e, n) {
      return (e = Pe(e)) in t ? Object.defineProperty(t, e, {
        value: n,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : t[e] = n, t;
    }
    function Pe(t) {
      var e = Be(t, "string");
      return j(e) == "symbol" ? e : e + "";
    }
    function Be(t, e) {
      if (j(t) != "object" || !t) return t;
      var n = t[Symbol.toPrimitive];
      if (n !== void 0) {
        var r = n.call(t, e);
        if (j(r) != "object") return r;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (e === "string" ? String : Number)(t);
    }
    var $e = {
      elementRef: l().oneOfType([l().func, l().object]),
      panelId: l().any.isRequired,
      /**
      * @private.
      * Used internally, func passed in from outer place is overwritten
      * by SlidingPanels during rendering
      */
      onMount: l().func,
      /**
      * @private.
      * Used internally, func passed in from outer place is overwritten
      * by SlidingPanels during rendering
      */
      onUnmount: l().func
    }, Fe = {}, pe = function(t) {
      v(n, t);
      var e = M(n);
      function n() {
        var r;
        p(this, n);
        for (var o = arguments.length, c = new Array(o), d = 0; d < o; d++)
          c[d] = arguments[d];
        return r = e.call.apply(e, [this].concat(c)), L(X(r), "el", null), L(X(r), "handleMount", function(N) {
          r.el = N, J(r.props.elementRef, N);
        }), r;
      }
      return i(n, [{
        key: "componentDidMount",
        value: function() {
          var o, c;
          (o = (c = this.props).onMount) === null || o === void 0 || o.call(c, this);
        }
      }, {
        key: "componentWillUnmount",
        value: function() {
          var o, c;
          (o = (c = this.props).onUnmount) === null || o === void 0 || o.call(c, this);
        }
        // eslint-disable-next-line react/no-unused-class-component-methods
      }, {
        key: "getHeight",
        value: function() {
          var o;
          return (o = this.el) === null || o === void 0 ? void 0 : o.clientHeight;
        }
        // eslint-disable-next-line react/no-unused-class-component-methods
      }, {
        key: "getWidth",
        value: function() {
          var o;
          return (o = this.el) === null || o === void 0 ? void 0 : o.clientWidth;
        }
      }, {
        key: "render",
        value: function() {
          var o = this.props.panelId;
          return S().createElement(Y, f({
            "data-test": "panel",
            "data-test-panel-id": o
          }, b()(this.props, E()(n.propTypes)), {
            ref: this.handleMount
          }));
        }
      }]), n;
    }(y.Component);
    L(pe, "propTypes", $e), L(pe, "defaultProps", Fe);
    const Se = pe;
    function G(t) {
      "@babel/helpers - typeof";
      return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
        return typeof e;
      } : function(e) {
        return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
      }, G(t);
    }
    function fe() {
      return fe = Object.assign ? Object.assign.bind() : function(t) {
        for (var e = 1; e < arguments.length; e++) {
          var n = arguments[e];
          for (var r in n)
            ({}).hasOwnProperty.call(n, r) && (t[r] = n[r]);
        }
        return t;
      }, fe.apply(null, arguments);
    }
    function We(t, e) {
      if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function");
    }
    function je(t, e) {
      for (var n = 0; n < e.length; n++) {
        var r = e[n];
        r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, Te(r.key), r);
      }
    }
    function Oe(t, e, n) {
      return e && je(t.prototype, e), n && je(t, n), Object.defineProperty(t, "prototype", {
        writable: !1
      }), t;
    }
    function ze(t, e) {
      if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
      t.prototype = Object.create(e && e.prototype, {
        constructor: {
          value: t,
          writable: !0,
          configurable: !0
        }
      }), Object.defineProperty(t, "prototype", {
        writable: !1
      }), e && de(t, e);
    }
    function de(t, e) {
      return de = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
        return n.__proto__ = r, n;
      }, de(t, e);
    }
    function Xe(t) {
      var e = xe();
      return function() {
        var n, r = oe(t);
        if (e) {
          var o = oe(this).constructor;
          n = Reflect.construct(r, arguments, o);
        } else n = r.apply(this, arguments);
        return Ge(this, n);
      };
    }
    function Ge(t, e) {
      if (e && (G(e) == "object" || typeof e == "function")) return e;
      if (e !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
      return U(t);
    }
    function U(t) {
      if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
      return t;
    }
    function xe() {
      try {
        var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
        }));
      } catch {
      }
      return (xe = function() {
        return !!t;
      })();
    }
    function oe(t) {
      return oe = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
        return e.__proto__ || Object.getPrototypeOf(e);
      }, oe(t);
    }
    function we(t, e) {
      var n = Object.keys(t);
      if (Object.getOwnPropertySymbols) {
        var r = Object.getOwnPropertySymbols(t);
        e && (r = r.filter(function(o) {
          return Object.getOwnPropertyDescriptor(t, o).enumerable;
        })), n.push.apply(n, r);
      }
      return n;
    }
    function ae(t) {
      for (var e = 1; e < arguments.length; e++) {
        var n = arguments[e] != null ? arguments[e] : {};
        e % 2 ? we(Object(n), !0).forEach(function(r) {
          O(t, r, n[r]);
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : we(Object(n)).forEach(function(r) {
          Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
        });
      }
      return t;
    }
    function O(t, e, n) {
      return (e = Te(e)) in t ? Object.defineProperty(t, e, {
        value: n,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : t[e] = n, t;
    }
    function Te(t) {
      var e = He(t, "string");
      return G(e) == "symbol" ? e : e + "";
    }
    function He(t, e) {
      if (G(t) != "object" || !t) return t;
      var n = t[Symbol.toPrimitive];
      if (n !== void 0) {
        var r = n.call(t, e);
        if (G(r) != "object") return r;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return (e === "string" ? String : Number)(t);
    }
    var Ve = {
      activePanelId: l().any.isRequired,
      children: l().node,
      elementRef: l().oneOfType([l().func, l().object]),
      innerClassName: l().string,
      innerStyle: l().object,
      onAnimationEnd: l().func,
      outerClassName: l().string,
      outerStyle: l().object,
      transition: l().oneOf(["forward", "backward"])
    }, Ke = {
      transition: "forward"
    }, Qe = {
      precision: 1
    }, Ye = function(e) {
      var n = e.animating, r = e.outerStyle, o = e.interpolatedOuterStyle;
      return ae(ae({}, r), n ? o : {});
    }, Je = function(e) {
      return e ? {
        translateX: 1
      } : {};
    }, Ze = function(e) {
      var n = e ? e.getWidth() : 0, r = e ? e.getHeight() : 0;
      return {
        width: n,
        height: r
      };
    }, et = function(e) {
      var n, r = e.activePanelId, o = e.children, c = e.maxWidth, d = e.onMount, N = e.onUnmount, se = e.transition, le = e.transitionStyle, te = y.Children.toArray(o).filter(y.isValidElement).find(function(ne) {
        return ne.props.panelId === r;
      }), me = (n = le.translateX) === null || n === void 0 ? void 0 : n.to(function(ne) {
        return "translateX(".concat(ne * c * (se === "forward" ? 1 : -1), "px)");
      }), ve = te ? S().createElement(I.animated.div, {
        style: le
      }, (0, y.cloneElement)(te, {
        style: ae(ae({}, te.props.style), {}, {
          transform: me
        }),
        onMount: d,
        onUnmount: N
      })) : null;
      return ve;
    }, tt = function() {
      return {
        translateX: 0
      };
    }, nt = function(e) {
      return e ? {
        translateX: -1,
        position: "absolute",
        left: 0,
        top: 0
      } : {
        translateX: -1
      };
    }, ie = function(t) {
      ze(n, t);
      var e = Xe(n);
      Oe(n, null, [{
        key: "getDerivedStateFromProps",
        // @docs-props-type SlidingPanelsPropsBase
        value: function(o, c) {
          return o.activePanelId !== c.prevActivePanelId ? {
            animating: !0,
            panelLoading: !0,
            prevActivePanelId: o.activePanelId,
            slidingId: c.slidingId + 1
          } : null;
        }
      }]);
      function n(r) {
        var o;
        return We(this, n), o = e.call(this, r), O(U(o), "panelInstances", {}), O(U(o), "allowAnimationUpdates", !0), O(U(o), "handlePanelMount", function(c) {
          o.panelInstances[c.props.panelId] = c, c.props.panelId === o.props.activePanelId && o.setState({
            activePanel: c,
            panelLoading: !1
          });
        }), O(U(o), "handlePanelUnmount", function(c) {
          delete o.panelInstances[c.props.panelId];
        }), O(U(o), "handleAnimationEnd", function() {
          var c, d;
          o.allowAnimationUpdates && o.setState({
            animating: !1
          }), (c = (d = o.props).onAnimationEnd) === null || c === void 0 || c.call(d);
        }), O(U(o), "renderOuterContainer", function(c) {
          var d = o.props, N = d.activePanelId, se = d.children, le = d.elementRef, te = d.outerClassName, me = d.outerStyle, ve = d.innerClassName, ne = d.innerStyle, ye = o.state.animating, ot = Ye({
            animating: ye,
            outerStyle: me,
            interpolatedOuterStyle: c
          });
          y.Children.toArray(se).filter(y.isValidElement).find(function(C) {
            return C.props.panelId === N;
          });
          var at = k()(P()(o.panelInstances), function(C) {
            return !!C;
          }), it = at.map(function(C) {
            var B, Ce = o.panelInstances[C.props.panelId];
            return Ce && (B = Ce.getWidth()) !== null && B !== void 0 ? B : 0;
          }).reduce(function(C, B) {
            return Math.max(C, B);
          }, 0);
          return S().createElement(z, fe({
            className: te,
            "data-test-active-panel-id": N,
            "data-test": "sliding-panels",
            elementRef: le,
            style: ot
          }, b()(o.props, E()(n.propTypes))), S().createElement(
            F.Transition,
            {
              from: Je(ye),
              enter: tt(),
              leave: nt(ye),
              items: N
            },
            // eslint-disable-next-line @typescript-eslint/no-explicit-any
            function(C, B) {
              return S().createElement(I.animated.div, {
                style: ne,
                className: ve
              }, et({
                activePanelId: B,
                children: se,
                maxWidth: it,
                onMount: o.handlePanelMount,
                onUnmount: o.handlePanelUnmount,
                transition: o.props.transition,
                transitionStyle: C
              }));
            }
          ));
        }), o.state = {
          animating: !1,
          panelLoading: !1,
          prevActivePanelId: o.props.activePanelId,
          // eslint-disable-line react/no-unused-state
          slidingId: 0
        }, o;
      }
      return Oe(n, [{
        key: "componentWillUnmount",
        value: function() {
          this.allowAnimationUpdates = !1;
        }
      }, {
        key: "render",
        value: function() {
          var o = this.state, c = o.activePanel, d = o.panelLoading;
          return S().createElement(
            F.Spring,
            {
              to: Ze(c),
              onRest: this.handleAnimationEnd,
              immediate: d,
              config: Qe
            },
            /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
            this.renderOuterContainer
          );
        }
      }]), n;
    }(y.Component);
    O(ie, "propTypes", Ve), O(ie, "defaultProps", Ke), O(ie, "Panel", Se);
    const rt = ie;
    be.exports = g;
  })()), be.exports;
}
var Ft = $t();
const Re = /* @__PURE__ */ qe(Ft);
var Wt = Ut();
const zt = /* @__PURE__ */ qe(Wt);
function Xt() {
  const a = St(xt);
  if (!a)
    throw new Error("usePageContext must be used within <PageContextProvider />");
  return a;
}
const Gt = Le.span`
    color: ${_e.brandColorD20};
    font-size: ${_e.fontSizeSmall};
    font-weight: 500;
`, D = "main_panel";
function Ue({ handleRequestOpen: a }) {
  const [g, y] = $(D), [S, x] = $(
    "forward"
  ), [l, w] = $(!1), [k, R] = $(!0), { pages: E } = Ae(), h = Xt(), { inputs: b } = E;
  Ee(b);
  const q = "groupsMenu" in b ? b.groupsMenu : void 0, [P, I] = $(b.services);
  ge(() => {
    I(
      b.services.filter(
        (f) => !he(f.hideForPlatform, h.platform)
      )
    );
  }, [b.services, h.platform]);
  const F = ["clickAway", "escapeKey", "offScreen", "toggleClick"], K = /* @__PURE__ */ s.jsx(Ie, { id: "addInputBtn", label: V._("Create New Input"), isMenu: !0 });
  ge(() => {
    k || (w(!1), R(!0));
  }, [k]);
  const T = ({ reason: f }) => {
    w(!F.includes(f));
  }, u = () => {
    w(!0);
  }, Q = (f, p) => f.map(
    (m) => m?.hasSubmenu ? /* @__PURE__ */ s.jsx(
      re.Item,
      {
        hasSubmenu: !0,
        onClick: () => {
          y(m.name), x("forward");
        },
        children: m.title
      },
      m.name
    ) : /* @__PURE__ */ s.jsxs(
      re.Item,
      {
        onClick: () => {
          a({ serviceName: m.name, groupName: p }), R(!1);
        },
        children: [
          m.title,
          /* @__PURE__ */ s.jsxs(Gt, { children: [
            " ",
            m.subTitle
          ] })
        ]
      },
      m.name
    )
  ), W = () => /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
    /* @__PURE__ */ s.jsx(
      re.Item,
      {
        startAdornment: /* @__PURE__ */ s.jsx(zt, {}),
        onClick: () => {
          y(D), x("backward");
        },
        children: "Back"
      }
    ),
    /* @__PURE__ */ s.jsx(re.Divider, {})
  ] }), z = (f) => Object.keys(f).map((p) => /* @__PURE__ */ s.jsx(Re.Panel, { panelId: p, children: /* @__PURE__ */ s.jsxs(re, { children: [
    p !== D && W(),
    Q(f[p], p)
  ] }) }, p)), Y = jt(() => {
    const f = { [D]: [] };
    return q ? q.forEach((p) => {
      if (p?.groupServices)
        f[p.groupName] = [], p.groupServices.forEach((m) => {
          const i = P.find(
            (v) => v.name === m
          );
          i && f[p.groupName].push({
            name: m,
            hasSubmenu: !1,
            title: i?.title || "",
            // what should be done when title empty
            subTitle: i?.subTitle
          });
        }), f[p.groupName].length > 0 && f[D].push({
          name: p.groupName,
          title: p.groupTitle,
          hasSubmenu: !0
        });
      else {
        const m = P.find(
          (i) => i.name === p.groupName
        );
        m && f[D].push({
          name: p.groupName,
          title: p.groupTitle,
          subTitle: m?.subTitle,
          hasSubmenu: !1
        });
      }
    }) : f[D] = P.map((p) => ({
      name: p.name,
      title: p.title,
      subTitle: p.subTitle,
      hasSubmenu: !1
    })), z(f);
  }, [P]), J = () => /* @__PURE__ */ s.jsx(
    Lt,
    {
      toggle: K,
      open: l,
      onRequestClose: T,
      onRequestOpen: u,
      children: /* @__PURE__ */ s.jsx(
        Re,
        {
          activePanelId: g,
          transition: S,
          style: { width: "210px" },
          children: Y
        }
      )
    }
  ), j = () => /* @__PURE__ */ s.jsx(
    Ie,
    {
      label: bt(100),
      id: "addInputBtn",
      onClick: () => {
        a({ serviceName: P[0].name });
      }
    }
  );
  return Ee(P), P.length === 1 ? j() : J();
}
Ue.propTypes = {
  handleRequestOpen: At.func
};
const Ht = Le(ce.Row)`
    padding: 5px 0px;

    .title_menu_column {
        width: auto !important;
    }

    .page_subtitle {
        min-height: 20px;
    }

    .dropdown {
        text-align: right;
    }
`;
function Vt(a) {
  return a !== void 0 && "description" in a;
}
function Kt(a) {
  return a !== void 0 && "table" in a;
}
function rn() {
  const [a, g] = $({ open: !1 }), y = Ae(), S = wt(y, "inputs"), x = y.pages.inputs;
  let l = [], w, k, R, E;
  x && (Kt(x) ? ({ services: l, title: w, table: k, description: R, subDescription: E } = x, l = l.filter(
    (i) => !he(i.hideForPlatform, S)
  )) : ({ services: l, title: w } = x, l = l.filter(
    (i) => !he(i.hideForPlatform, S)
  )));
  const h = !k, [b, q] = $(l[0].name), P = l.find((i) => i.name === b), I = Vt(P), F = [Me, H, Ct], K = l.map((i) => i.name), T = gt(), u = Tt();
  ge(() => {
    Q(), W();
  }, [ht().search]);
  const Q = () => {
    const i = l.find((v) => v.name === u.get("service"));
    u && i && F.includes(u.get("action") || "") && !a.open ? u.get("action") !== H && a.stanzaName ? g({
      ...a,
      open: !0,
      isInputPageStyle: !0,
      serviceName: u.get("service") || "",
      mode: u.get("action") || ""
    }) : g({
      ...a,
      open: !0,
      isInputPageStyle: !0,
      serviceName: u.get("service") || "",
      formLabel: `Create ${i?.title}`,
      mode: H
    }) : (!u.get("service") || !u.get("action")) && a.open && a.isInputPageStyle && g({ ...a, open: !1 });
  }, W = () => {
    u && K.includes(u.get("service") || "") && q(u.get("service") || "");
  }, z = ({
    serviceName: i,
    groupName: v,
    input: _
  }) => {
    const M = l.find((A) => A.name === i), Z = M?.title, X = M?.formTitle, ee = M?.style === qt;
    if (g({
      ...a,
      open: !0,
      serviceName: i,
      mode: H,
      formLabel: X ? `Add ${X}` : `Add ${Z}`,
      isInputPageStyle: ee,
      groupName: v
    }), ee) {
      u.set("service", i), u.set("action", H);
      const L = _ || (v && v !== D ? v : null) || i;
      L ? u.set("input", L) : u.delete("input"), T({ search: u.toString() });
    }
  }, Y = () => {
    g({ ...a, open: !1 });
  }, J = () => a.serviceName && /* @__PURE__ */ s.jsx(
    Rt,
    {
      page: ue,
      open: a.open,
      handleRequestClose: Y,
      returnFocus: () => {
      },
      serviceName: a.serviceName,
      mode: H,
      formLabel: a.formLabel,
      groupName: a.groupName
    }
  ), j = (i, v) => {
    const _ = l.find((Z) => Z.name === i.serviceName), M = _?.formTitle || _?.title;
    g({
      ...a,
      open: !0,
      isInputPageStyle: !0,
      serviceName: i.serviceName,
      stanzaName: i.name,
      formLabel: v === Me ? `Clone ${M}` : `Update ${M}`,
      mode: v
    }), u.set("service", i.serviceName), u.set("action", v), T({ search: u.toString() });
  }, f = () => {
    g({ ...a, open: !1 }), h || u.delete("service"), u.delete("action"), T({ search: u.toString() });
  }, p = () => a.serviceName && a.mode ? /* @__PURE__ */ s.jsx(
    kt,
    {
      handleRequestClose: f,
      serviceName: a.serviceName,
      stanzaName: a.stanzaName,
      mode: a.mode,
      formLabel: a.formLabel,
      page: ue,
      groupName: a.groupName
    }
  ) : null, m = Ot(
    (i, { selectedTabId: v }) => {
      v && (q(v), u.delete("action"), u.set("service", v), T({ search: u.toString() }));
    },
    [b]
    // eslint-disable-line react-hooks/exhaustive-deps
  );
  return /* @__PURE__ */ s.jsx(Bt, { children: /* @__PURE__ */ s.jsx(Et, { platform: S, children: /* @__PURE__ */ s.jsxs(It, { children: [
    a.isInputPageStyle && a.open ? p() : null,
    /* @__PURE__ */ s.jsxs(
      "div",
      {
        style: a.isInputPageStyle && a.open ? { display: "none" } : { display: "block" },
        children: [
          /* @__PURE__ */ s.jsx(ce, { gutter: 8, children: /* @__PURE__ */ s.jsxs(Ht, { children: [
            /* @__PURE__ */ s.jsxs(
              ce.Column,
              {
                className: h ? "title_menu_column" : "",
                span: 9,
                children: [
                  /* @__PURE__ */ s.jsx(_t, { children: h ? V._(P?.title || "") : V._(w || "") }),
                  /* @__PURE__ */ s.jsx(
                    Mt,
                    {
                      className: h ? "pageSubtitle" : void 0,
                      children: h ? V._(I ? P?.description : "") : V._(R || "")
                    }
                  ),
                  /* @__PURE__ */ s.jsx(
                    Nt,
                    {
                      text: E?.text || "",
                      links: E?.links
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ s.jsx(
              ce.Column,
              {
                className: h ? "title_menu_column" : "dropdown",
                span: 3,
                children: !h && /* @__PURE__ */ s.jsx(Ue, { handleRequestOpen: z })
              }
            )
          ] }) }),
          h ? /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
            /* @__PURE__ */ s.jsx(Ne, { activeTabId: b, onChange: m, children: l.map((i) => /* @__PURE__ */ s.jsx(
              Ne.Tab,
              {
                label: V._(i.title),
                tabId: i.name
              },
              i.name
            )) }),
            l.map((i) => /* @__PURE__ */ s.jsx(
              "div",
              {
                style: i.name !== b ? { display: "none" } : { display: "block" },
                id: `${i.name}Tab`,
                children: /* @__PURE__ */ s.jsx(
                  De,
                  {
                    page: ue,
                    serviceName: i.name,
                    handleRequestModalOpen: () => z({
                      serviceName: i.name
                    }),
                    handleOpenPageStyleDialog: j
                  }
                )
              },
              i.name
            ))
          ] }) : /* @__PURE__ */ s.jsx(
            De,
            {
              page: ue,
              handleOpenPageStyleDialog: j,
              displayActionBtnAllRows: !0
            }
          ),
          /* @__PURE__ */ s.jsx(Dt, { position: "top-right" }),
          !a.isInputPageStyle && a.open ? J() : null
        ]
      }
    )
  ] }) }) });
}
export {
  rn as default
};
