import { _ as __nuxt_component_0 } from './nuxt-link-Cq8xZgFP.mjs';
import { defineComponent, ref, mergeProps, withCtx, unref, createTextVNode, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrIncludeBooleanAttr } from 'vue/server-renderer';
import { _ as _export_sfc, b as useRouter, u as useI18n, a as useHead } from './server.mjs';
import { u as useNotification } from './useNotification-BqDqaGnC.mjs';
import { u as usePipeline } from './usePipeline-ZPHbtOs6.mjs';
import '../nitro/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:crypto';
import 'stream';
import 'events';
import 'http';
import 'crypto';
import 'buffer';
import 'zlib';
import 'https';
import 'net';
import 'tls';
import 'url';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:path';
import 'vue-router';
import '@prisma/client';
import '@prisma/adapter-better-sqlite3';
import 'fs';
import 'path';
import 'fs/promises';
import 'child_process';
import 'node:child_process';
import 'node:url';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';

const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "new",
  __ssrInlineRender: true,
  setup(__props) {
    useRouter();
    const { t: $t } = useI18n();
    useNotification();
    const { generateSlug } = usePipeline();
    const name = ref("");
    const description = ref("");
    const creating = ref(false);
    useHead({
      title: `${$t("pipeline.new")} - AutoCode`
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_NuxtLink = __nuxt_component_0;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "new-pipeline-page" }, _attrs))} data-v-123b6ad2><header class="page-header card" data-v-123b6ad2><div class="header-left" data-v-123b6ad2>`);
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: "/settings/pipeline",
        class: "back-link"
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`← ${ssrInterpolate(unref($t)("nav.back"))}`);
          } else {
            return [
              createTextVNode("← " + toDisplayString(unref($t)("nav.back")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<span class="header-separator" data-v-123b6ad2>/</span><h1 data-v-123b6ad2>${ssrInterpolate(unref($t)("pipeline.new"))}</h1></div></header><div class="card form-card" data-v-123b6ad2><div class="form-group" data-v-123b6ad2><label class="form-label" data-v-123b6ad2>${ssrInterpolate(unref($t)("pipeline.name"))}</label><input${ssrRenderAttr("value", unref(name))} type="text" class="form-input"${ssrRenderAttr("placeholder", unref($t)("pipeline.namePlaceholder"))} data-v-123b6ad2>`);
      if (unref(name)) {
        _push(`<span class="input-hint" data-v-123b6ad2> key: ${ssrInterpolate(unref(generateSlug)(unref(name)))}</span>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="form-group" data-v-123b6ad2><label class="form-label" data-v-123b6ad2>${ssrInterpolate(unref($t)("pipeline.description"))}</label><textarea class="form-input" rows="4"${ssrRenderAttr("placeholder", unref($t)("pipeline.descriptionPlaceholder"))} data-v-123b6ad2>${ssrInterpolate(unref(description))}</textarea></div><div class="form-actions" data-v-123b6ad2>`);
      _push(ssrRenderComponent(_component_NuxtLink, {
        to: "/settings/pipeline",
        class: "btn btn-secondary"
      }, {
        default: withCtx((_, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(`${ssrInterpolate(unref($t)("modal.cancel"))}`);
          } else {
            return [
              createTextVNode(toDisplayString(unref($t)("modal.cancel")), 1)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`<button class="btn btn-primary"${ssrIncludeBooleanAttr(!unref(name).trim() || unref(creating)) ? " disabled" : ""} data-v-123b6ad2>${ssrInterpolate(unref(creating) ? unref($t)("form.saving") : unref($t)("form.create"))}</button></div></div></div>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/settings/pipeline/new.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const _new = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-123b6ad2"]]);

export { _new as default };
//# sourceMappingURL=new-BUvtXOoH.mjs.map
