import { __exports as f } from "../../../../../../../../_virtual/gatherSequenceExpressions.js";
import "../retrievers/getBindingIdentifiers.js";
import "../validators/generated/index.js";
import { __require as x } from "../builders/generated/index.js";
import "../clone/cloneNode.js";
import { __exports as h } from "../../../../../../../../_virtual/getBindingIdentifiers.js";
import { __exports as q } from "../../../../../../../../_virtual/index35.js";
import { __exports as g } from "../../../../../../../../_virtual/cloneNode.js";
var l;
function B() {
  if (l)
    return f;
  l = 1, Object.defineProperty(f, "__esModule", {
    value: !0
  }), f.default = o;
  var m = h, r = q, d = x(), c = g;
  function o(p, i, a) {
    const n = [];
    let u = !0;
    for (const e of p)
      if ((0, r.isEmptyStatement)(e) || (u = !1), (0, r.isExpression)(e))
        n.push(e);
      else if ((0, r.isExpressionStatement)(e))
        n.push(e.expression);
      else if ((0, r.isVariableDeclaration)(e)) {
        if (e.kind !== "var")
          return;
        for (const t of e.declarations) {
          const s = (0, m.default)(t);
          for (const _ of Object.keys(s))
            a.push({
              kind: e.kind,
              id: (0, c.default)(s[_])
            });
          t.init && n.push((0, d.assignmentExpression)("=", t.id, t.init));
        }
        u = !0;
      } else if ((0, r.isIfStatement)(e)) {
        const t = e.consequent ? o([e.consequent], i, a) : i.buildUndefinedNode(), s = e.alternate ? o([e.alternate], i, a) : i.buildUndefinedNode();
        if (!t || !s)
          return;
        n.push((0, d.conditionalExpression)(e.test, t, s));
      } else if ((0, r.isBlockStatement)(e)) {
        const t = o(e.body, i, a);
        if (!t)
          return;
        n.push(t);
      } else if ((0, r.isEmptyStatement)(e))
        p.indexOf(e) === 0 && (u = !0);
      else
        return;
    return u && n.push(i.buildUndefinedNode()), n.length === 1 ? n[0] : (0, d.sequenceExpression)(n);
  }
  return f;
}
export {
  B as __require
};
//# sourceMappingURL=gatherSequenceExpressions.js.map
