import {
  Controller,
  t,
  useFieldArray,
  useRemixForm,
  z
} from "/build/_shared/chunk-FEPQQQMY.js";
import {
  Input
} from "/build/_shared/chunk-E6JFCF7O.js";
import {
  Card,
  CardContent,
  CardFooter,
  CardHeader,
  CardTitle
} from "/build/_shared/chunk-WWUYM2PJ.js";
import {
  PageDocLink
} from "/build/_shared/chunk-T75MUU5G.js";
import {
  Dialog,
  DialogContent,
  DialogHeader,
  DialogTitle,
  DialogTrigger
} from "/build/_shared/chunk-WUQHNDXA.js";
import "/build/_shared/chunk-SC7ILUKJ.js";
import {
  DropdownMenu,
  DropdownMenuContent,
  DropdownMenuItem,
  DropdownMenuTrigger
} from "/build/_shared/chunk-BWG25Z4X.js";
import {
  $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2,
  $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9,
  $d7bdfb9eb0fdf311$export$c7109489551a4f4
} from "/build/_shared/chunk-JZ6W5YHO.js";
import {
  Label
} from "/build/_shared/chunk-Z3FLWRAR.js";
import {
  Button
} from "/build/_shared/chunk-UWBTKPLD.js";
import {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectTrigger,
  SelectValue
} from "/build/_shared/chunk-KORRUOSI.js";
import "/build/_shared/chunk-5HIGY2MY.js";
import {
  PageSubtitle
} from "/build/_shared/chunk-VV3RU6RL.js";
import {
  $f631663db3294ace$export$b39126d51d94e6f3
} from "/build/_shared/chunk-VO5VXZGS.js";
import "/build/_shared/chunk-4R7ODGQQ.js";
import "/build/_shared/chunk-A4I3UNHM.js";
import "/build/_shared/chunk-ERWYPUCA.js";
import {
  PageLayout
} from "/build/_shared/chunk-BXT5AGPN.js";
import "/build/_shared/chunk-5YPGPC4O.js";
import {
  $1746a345f3d73bb7$export$f680877a34711e37,
  $71cd76cc60e0454e$export$6f32135080cb4c3,
  $8927f6f2acc4f386$export$250ffa63cdc0d034,
  $921a889cee6df7e8$export$99c2b779aa4e8b8b,
  $c512c27ab02ef895$export$50c7b4e9d9f19c1,
  $e42e1063c40fb3ef$export$b9ecd428b558ff10
} from "/build/_shared/chunk-7K73PJIB.js";
import {
  MoreHorizontal,
  Trash,
  X
} from "/build/_shared/chunk-EJE2TVVM.js";
import {
  PlusCircledIcon,
  _extends,
  cn
} from "/build/_shared/chunk-LGQ4GCFK.js";
import "/build/_shared/chunk-AI5FD5Y6.js";
import {
  withAuth
} from "/build/_shared/chunk-NHF4CNMF.js";
import "/build/_shared/chunk-KQKP3VNY.js";
import {
  Form,
  init_esm2 as init_esm,
  useFetcher,
  useLoaderData,
  useNavigate,
  useParams
} from "/build/_shared/chunk-ZC2TL3GZ.js";
import {
  require_jsx_dev_runtime
} from "/build/_shared/chunk-ED7KKCRB.js";
import "/build/_shared/chunk-RYE6BCZB.js";
import {
  require_react
} from "/build/_shared/chunk-PECDPABK.js";
import {
  require_node
} from "/build/_shared/chunk-G7CHZRZX.js";
import "/build/_shared/chunk-TLLKLDIT.js";
import {
  Routes
} from "/build/_shared/chunk-N27UEDHN.js";
import {
  createHotContext,
  init_remix_hmr
} from "/build/_shared/chunk-G7KTOMTD.js";
import "/build/_shared/chunk-ZIPKILLR.js";
import {
  __toESM
} from "/build/_shared/chunk-PNG5AS42.js";

// app/routes/app+/project+/$projectId+/env+/$envId+/datasets+/index.tsx
init_remix_hmr();
var import_node = __toESM(require_node(), 1);
init_esm();

// app/pages/datasets/DatasetsPage.tsx
init_remix_hmr();
var import_react8 = __toESM(require_react(), 1);

// app/pages/datasets/CreateDatasetDialog.tsx
init_remix_hmr();

// app/components/ui/tabs.tsx
init_remix_hmr();

// ../../node_modules/@radix-ui/react-tabs/dist/index.mjs
var import_react = __toESM(require_react(), 1);
var $69cb30bb0017df05$var$TABS_NAME = "Tabs";
var [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
  $d7bdfb9eb0fdf311$export$c7109489551a4f4
]);
var $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
var [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME);
var $69cb30bb0017df05$export$b2539bed5023c21c = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
  const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
  const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
  const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
    prop: valueProp,
    onChange: onValueChange,
    defaultProp: defaultValue
  });
  return /* @__PURE__ */ (0, import_react.createElement)($69cb30bb0017df05$var$TabsProvider, {
    scope: __scopeTabs,
    baseId: $1746a345f3d73bb7$export$f680877a34711e37(),
    value,
    onValueChange: setValue,
    orientation,
    dir: direction,
    activationMode
  }, /* @__PURE__ */ (0, import_react.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
    dir: direction,
    "data-orientation": orientation
  }, tabsProps, {
    ref: forwardedRef
  })));
});
var $69cb30bb0017df05$var$TAB_LIST_NAME = "TabsList";
var $69cb30bb0017df05$export$9712d22edc0d78c1 = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
  const { __scopeTabs, loop = true, ...listProps } = props;
  const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
  const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
  return /* @__PURE__ */ (0, import_react.createElement)($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
    asChild: true
  }, rovingFocusGroupScope, {
    orientation: context.orientation,
    dir: context.dir,
    loop
  }), /* @__PURE__ */ (0, import_react.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
    role: "tablist",
    "aria-orientation": context.orientation
  }, listProps, {
    ref: forwardedRef
  })));
});
var $69cb30bb0017df05$var$TRIGGER_NAME = "TabsTrigger";
var $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
  const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
  const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs);
  const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
  const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
  const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
  const isSelected = value === context.value;
  return /* @__PURE__ */ (0, import_react.createElement)($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
    asChild: true
  }, rovingFocusGroupScope, {
    focusable: !disabled,
    active: isSelected
  }), /* @__PURE__ */ (0, import_react.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
    type: "button",
    role: "tab",
    "aria-selected": isSelected,
    "aria-controls": contentId,
    "data-state": isSelected ? "active" : "inactive",
    "data-disabled": disabled ? "" : void 0,
    disabled,
    id: triggerId
  }, triggerProps, {
    ref: forwardedRef,
    onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event) => {
      if (!disabled && event.button === 0 && event.ctrlKey === false)
        context.onValueChange(value);
      else
        event.preventDefault();
    }),
    onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
      if ([
        " ",
        "Enter"
      ].includes(event.key))
        context.onValueChange(value);
    }),
    onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, () => {
      const isAutomaticActivation = context.activationMode !== "manual";
      if (!isSelected && !disabled && isAutomaticActivation)
        context.onValueChange(value);
    })
  })));
});
var $69cb30bb0017df05$var$CONTENT_NAME = "TabsContent";
var $69cb30bb0017df05$export$bd905d70e8fd2ebb = /* @__PURE__ */ (0, import_react.forwardRef)((props, forwardedRef) => {
  const { __scopeTabs, value, forceMount, children, ...contentProps } = props;
  const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME, __scopeTabs);
  const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
  const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
  const isSelected = value === context.value;
  const isMountAnimationPreventedRef = (0, import_react.useRef)(isSelected);
  (0, import_react.useEffect)(() => {
    const rAF = requestAnimationFrame(
      () => isMountAnimationPreventedRef.current = false
    );
    return () => cancelAnimationFrame(rAF);
  }, []);
  return /* @__PURE__ */ (0, import_react.createElement)(
    $921a889cee6df7e8$export$99c2b779aa4e8b8b,
    {
      present: forceMount || isSelected
    },
    ({ present }) => /* @__PURE__ */ (0, import_react.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
      "data-state": isSelected ? "active" : "inactive",
      "data-orientation": context.orientation,
      role: "tabpanel",
      "aria-labelledby": triggerId,
      hidden: !present,
      id: contentId,
      tabIndex: 0
    }, contentProps, {
      ref: forwardedRef,
      style: {
        ...props.style,
        animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
      }
    }), present && children)
  );
});
function $69cb30bb0017df05$var$makeTriggerId(baseId, value) {
  return `${baseId}-trigger-${value}`;
}
function $69cb30bb0017df05$var$makeContentId(baseId, value) {
  return `${baseId}-content-${value}`;
}
var $69cb30bb0017df05$export$be92b6f5f03c0fe9 = $69cb30bb0017df05$export$b2539bed5023c21c;
var $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d22edc0d78c1;
var $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba;
var $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;

// app/components/ui/tabs.tsx
var React = __toESM(require_react(), 1);
var import_jsx_dev_runtime = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/components/ui/tabs.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/components/ui/tabs.tsx"
  );
  import.meta.hot.lastModified = "1713199469912.1428";
}
var Tabs = $69cb30bb0017df05$export$be92b6f5f03c0fe9;
var TabsList = React.forwardRef(_c = ({
  className,
  ...props
}, ref) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)($69cb30bb0017df05$export$54c2e3dc7acea9f5, { ref, className: cn("bg-secondary text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1", className), ...props }, void 0, false, {
  fileName: "app/components/ui/tabs.tsx",
  lineNumber: 29,
  columnNumber: 12
}, this));
_c2 = TabsList;
TabsList.displayName = $69cb30bb0017df05$export$54c2e3dc7acea9f5.displayName;
var TabsTrigger = React.forwardRef(_c3 = ({
  className,
  ...props
}, ref) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)($69cb30bb0017df05$export$41fb9f06171c75f4, { ref, className: cn("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow", className), ...props }, void 0, false, {
  fileName: "app/components/ui/tabs.tsx",
  lineNumber: 35,
  columnNumber: 12
}, this));
_c4 = TabsTrigger;
TabsTrigger.displayName = $69cb30bb0017df05$export$41fb9f06171c75f4.displayName;
var TabsContent = React.forwardRef(_c5 = ({
  className,
  ...props
}, ref) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)($69cb30bb0017df05$export$7c6e2c02157bb7d2, { ref, className: cn("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2", className), ...props }, void 0, false, {
  fileName: "app/components/ui/tabs.tsx",
  lineNumber: 41,
  columnNumber: 12
}, this));
_c6 = TabsContent;
TabsContent.displayName = $69cb30bb0017df05$export$7c6e2c02157bb7d2.displayName;
var _c;
var _c2;
var _c3;
var _c4;
var _c5;
var _c6;
$RefreshReg$(_c, "TabsList$React.forwardRef");
$RefreshReg$(_c2, "TabsList");
$RefreshReg$(_c3, "TabsTrigger$React.forwardRef");
$RefreshReg$(_c4, "TabsTrigger");
$RefreshReg$(_c5, "TabsContent$React.forwardRef");
$RefreshReg$(_c6, "TabsContent");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/datasets/forms/CreateDatasetForm.tsx
init_remix_hmr();
init_esm();
var import_react3 = __toESM(require_react(), 1);

// app/pages/datasets/forms/CreateDatasetValidator.tsx
init_remix_hmr();
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/datasets/forms/CreateDatasetValidator.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/datasets/forms/CreateDatasetValidator.tsx"
  );
  import.meta.hot.lastModified = "1713199469913.433";
}
var SchemaValueTypes = z.enum(["string", "number", "boolean", "object", "array"]);
var SchemaKeyValuePair = z.object({
  key: z.string().min(1, {
    message: "Key is required"
  }),
  value: SchemaValueTypes
});
var CreateDatasetSchema = z.object({
  name: z.string().min(1, {
    message: "Dataset name is required"
  }),
  description: z.string(),
  inputSchema: z.array(SchemaKeyValuePair).optional(),
  outputSchema: z.array(SchemaKeyValuePair).optional(),
  isFineTuning: z.boolean().optional()
});
var CreateDatasetResolver = t(CreateDatasetSchema);
_c7 = CreateDatasetResolver;
var _c7;
$RefreshReg$(_c7, "CreateDatasetResolver");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/datasets/forms/CreateDatasetForm.tsx
var import_jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/datasets/forms/CreateDatasetForm.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s = $RefreshSig$();
var _s2 = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/datasets/forms/CreateDatasetForm.tsx"
  );
  import.meta.hot.lastModified = "1713199469913.3257";
}
var SchemaField = ({
  control,
  name,
  label
}) => {
  _s();
  const {
    fields,
    append,
    remove
  } = useFieldArray({
    control,
    name
  });
  return /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "flex flex-col gap-2", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Label, { children: label }, void 0, false, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 50,
      columnNumber: 7
    }, this),
    fields.map((field, index) => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "flex items-center gap-2", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Controller, { name: `${name}.${index}.key`, control, render: ({
        field: field2
      }) => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Input, { ...field2, placeholder: "Key" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 54,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 52,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Controller, { name: `${name}.${index}.value`, control, render: ({
        field: field2
      }) => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Select, { ...field2, onValueChange: field2.onChange, children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SelectValue, { placeholder: "Type" }, void 0, false, {
          fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
          lineNumber: 59,
          columnNumber: 19
        }, this) }, void 0, false, {
          fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
          lineNumber: 58,
          columnNumber: 17
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SelectContent, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SelectGroup, { children: Object.values(SchemaValueTypes.enum).map((value) => /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SelectItem, { value, children: value }, value, false, {
          fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
          lineNumber: 63,
          columnNumber: 72
        }, this)) }, void 0, false, {
          fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
          lineNumber: 62,
          columnNumber: 19
        }, this) }, void 0, false, {
          fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
          lineNumber: 61,
          columnNumber: 17
        }, this)
      ] }, void 0, true, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 57,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 55,
        columnNumber: 11
      }, this),
      index !== 0 && /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Button, { type: "button", variant: "ghost", onClick: () => remove(index), children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(X, { className: "h-4 w-4" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 70,
        columnNumber: 15
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 69,
        columnNumber: 27
      }, this)
    ] }, field.id, true, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 51,
      columnNumber: 37
    }, this)),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "flex justify-end", children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Button, { type: "button", variant: "ghost", onClick: () => append({
      key: "",
      value: "string"
    }), children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(PlusCircledIcon, { className: "h-4 w-4" }, void 0, false, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 78,
      columnNumber: 11
    }, this) }, void 0, false, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 74,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 73,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
    lineNumber: 49,
    columnNumber: 10
  }, this);
};
_s(SchemaField, "ZUdpHmDLsHW29pYmVu7vZWnnIQg=", false, function() {
  return [useFieldArray];
});
_c8 = SchemaField;
var CreateDatasetForm = ({
  isOpen,
  onClose
}) => {
  _s2();
  const fetcher = useFetcher();
  const params = useParams();
  const [error, setError] = (0, import_react3.useState)(null);
  const {
    handleSubmit,
    formState: {
      errors,
      isSubmitting
    },
    register,
    control,
    reset
  } = useRemixForm({
    mode: "onSubmit",
    resolver: CreateDatasetResolver,
    defaultValues: {
      name: "",
      description: "",
      inputSchema: [{
        key: "",
        value: "string"
      }],
      outputSchema: [{
        key: "",
        value: "string"
      }]
    },
    fetcher,
    submitConfig: {
      method: "post",
      action: Routes.actions.dataset.create({
        projectId: params.projectId,
        envId: params.envId
      })
    }
  });
  const checkIfSuccessful = () => {
    if (!fetcher.data) {
      return;
    } else if (fetcher.data.error) {
      setError(fetcher.data.error);
    } else if (fetcher.data.dataset) {
      setError(null);
      reset();
      onClose();
    }
  };
  (0, import_react3.useEffect)(checkIfSuccessful, [fetcher.data]);
  const resetOnClose = () => {
    if (!isOpen) {
      reset();
      setError(null);
    }
  };
  (0, import_react3.useEffect)(resetOnClose, [isOpen]);
  return /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Form, { onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("fieldset", { disabled: isSubmitting, className: "flex flex-col gap-2", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Label, { htmlFor: "name", children: "Name" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 150,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Input, { ...register("name") }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 151,
        columnNumber: 11
      }, this),
      errors.name && /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("p", { className: "text-destructive", children: errors.name.message }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 152,
        columnNumber: 27
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 149,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Label, { htmlFor: "description", children: "Description" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 155,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Input, { ...register("description") }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 156,
        columnNumber: 11
      }, this),
      errors.description && /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("p", { className: "text-destructive", children: errors.description.message }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 157,
        columnNumber: 34
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 154,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "mt-4 grid grid-cols-2 gap-8", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SchemaField, { control, name: "inputSchema", label: "Input Schema" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 160,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(SchemaField, { control, name: "outputSchema", label: "Output Schema" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 161,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 159,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("div", { className: "mt-4 flex justify-end", children: [
      error && /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)("p", { className: "text-destructive", children: error }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 164,
        columnNumber: 21
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime2.jsxDEV)(Button, { type: "submit", children: "Create Dataset" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
        lineNumber: 165,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
      lineNumber: 163,
      columnNumber: 9
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
    lineNumber: 148,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "app/pages/datasets/forms/CreateDatasetForm.tsx",
    lineNumber: 147,
    columnNumber: 10
  }, this);
};
_s2(CreateDatasetForm, "HhkT7Mig/OjYquE6s5M9TanQFEA=", false, function() {
  return [useFetcher, useParams, useRemixForm];
});
_c22 = CreateDatasetForm;
var _c8;
var _c22;
$RefreshReg$(_c8, "SchemaField");
$RefreshReg$(_c22, "CreateDatasetForm");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx
init_remix_hmr();
init_esm();
var import_react5 = __toESM(require_react(), 1);
var import_jsx_dev_runtime3 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s3 = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx"
  );
  import.meta.hot.lastModified = "1713199469913.5637";
}
var CreateFinetuningDatasetForm = ({
  isOpen,
  onClose
}) => {
  _s3();
  const fetcher = useFetcher();
  const params = useParams();
  const [error, setError] = (0, import_react5.useState)(null);
  const {
    handleSubmit,
    formState: {
      errors,
      isSubmitting
    },
    register,
    reset
  } = useRemixForm({
    mode: "onSubmit",
    resolver: CreateDatasetResolver,
    defaultValues: {
      name: "",
      description: "",
      isFineTuning: true
    },
    fetcher,
    submitConfig: {
      method: "post",
      action: Routes.actions.dataset.create({
        projectId: params.projectId,
        envId: params.envId
      })
    }
  });
  const checkIfSuccessful = () => {
    if (!fetcher.data) {
      return;
    } else if (fetcher.data.error) {
      setError(fetcher.data.error);
    } else if (fetcher.data.dataset) {
      setError(null);
      reset();
      onClose();
    }
  };
  (0, import_react5.useEffect)(checkIfSuccessful, [fetcher.data]);
  const resetOnClose = () => {
    if (!isOpen) {
      reset();
      setError(null);
    }
  };
  (0, import_react5.useEffect)(resetOnClose, [isOpen]);
  return /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Form, { onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("fieldset", { disabled: isSubmitting, className: "flex flex-col gap-2", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Label, { htmlFor: "name", children: "Name" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 85,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Input, { ...register("name") }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 86,
        columnNumber: 11
      }, this),
      errors.name && /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("p", { className: "text-destructive", children: errors.name.message }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 87,
        columnNumber: 27
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
      lineNumber: 84,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Label, { htmlFor: "description", children: "Description" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 90,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Input, { ...register("description") }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 91,
        columnNumber: 11
      }, this),
      errors.description && /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("p", { className: "text-destructive", children: errors.description.message }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 92,
        columnNumber: 34
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
      lineNumber: 89,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("p", { children: "A Fine-Tuning dataset has a preset input and output schema. Check out our documentation for more information." }, void 0, false, {
      fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
      lineNumber: 95,
      columnNumber: 11
    }, this) }, void 0, false, {
      fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
      lineNumber: 94,
      columnNumber: 9
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("div", { className: "mt-4 flex justify-end", children: [
      error && /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)("p", { className: "text-destructive", children: error }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 100,
        columnNumber: 21
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime3.jsxDEV)(Button, { type: "submit", children: "Create Fine-Tuning Dataset" }, void 0, false, {
        fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
        lineNumber: 101,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
      lineNumber: 99,
      columnNumber: 9
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
    lineNumber: 83,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "app/pages/datasets/forms/CreateFinetuningDatasetForm.tsx",
    lineNumber: 82,
    columnNumber: 10
  }, this);
};
_s3(CreateFinetuningDatasetForm, "ZCrPXNfHv9KhVEiuXNPM2YaBiow=", false, function() {
  return [useFetcher, useParams, useRemixForm];
});
_c9 = CreateFinetuningDatasetForm;
var _c9;
$RefreshReg$(_c9, "CreateFinetuningDatasetForm");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/datasets/CreateDatasetDialog.tsx
var import_jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/datasets/CreateDatasetDialog.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/datasets/CreateDatasetDialog.tsx"
  );
  import.meta.hot.lastModified = "1713199469912.3975";
}
var CreateDatasetDialog = ({
  isDialogOpen,
  setIsDialogOpen
}) => {
  return /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(DialogContent, { className: "min-w-[600px]", children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(DialogTitle, { children: "Create Dataset" }, void 0, false, {
      fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
      lineNumber: 31,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
      lineNumber: 30,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(Tabs, { defaultValue: "default", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(TabsList, { className: "grid w-full grid-cols-2", children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(TabsTrigger, { value: "default", children: "Default" }, void 0, false, {
          fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
          lineNumber: 35,
          columnNumber: 11
        }, this),
        /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(TabsTrigger, { value: "finetuning", children: "Fine-Tuning" }, void 0, false, {
          fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
          lineNumber: 36,
          columnNumber: 11
        }, this)
      ] }, void 0, true, {
        fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
        lineNumber: 34,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(TabsContent, { value: "default", children: /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(CreateDatasetForm, { isOpen: isDialogOpen, onClose: () => setIsDialogOpen(false) }, void 0, false, {
        fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
        lineNumber: 39,
        columnNumber: 11
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
        lineNumber: 38,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(TabsContent, { value: "finetuning", children: /* @__PURE__ */ (0, import_jsx_dev_runtime4.jsxDEV)(CreateFinetuningDatasetForm, { isOpen: isDialogOpen, onClose: () => setIsDialogOpen(false) }, void 0, false, {
        fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
        lineNumber: 42,
        columnNumber: 11
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
        lineNumber: 41,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
      lineNumber: 33,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/datasets/CreateDatasetDialog.tsx",
    lineNumber: 29,
    columnNumber: 10
  }, this);
};
_c10 = CreateDatasetDialog;
var _c10;
$RefreshReg$(_c10, "CreateDatasetDialog");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/datasets/DatasetCard.tsx
init_remix_hmr();
init_esm();
var import_react7 = __toESM(require_react(), 1);
var import_jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/datasets/DatasetCard.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s4 = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/datasets/DatasetCard.tsx"
  );
  import.meta.hot.lastModified = "1713199469912.497";
}
var DatasetCard = ({
  dataset
}) => {
  _s4();
  const [isHovering, setIsHovering] = (0, import_react7.useState)(false);
  const params = useParams();
  const fetcher = useFetcher();
  const navigate = useNavigate();
  const handleDeleteDataset = (e) => {
    e.preventDefault();
    e.stopPropagation();
    if (fetcher.state !== "idle") {
      return;
    }
    fetcher.submit(null, {
      method: "DELETE",
      action: Routes.actions.dataset.delete({
        projectId: params.projectId,
        datasetId: dataset.id
      })
    });
  };
  const handleCardClick = () => {
    const path = {
      projectId: params.projectId,
      envId: dataset.envId,
      datasetId: dataset.id
    };
    navigate(Routes.app.project.env.datasetsId(path));
  };
  return /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Card, { className: `${isHovering ? "" : "hover:border-primary"} hover:cursor-pointer`, onClick: handleCardClick, children: [
    /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(CardTitle, { className: "flex justify-between", children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("p", { children: dataset.name }, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 62,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("p", { className: "text-md", children: dataset.isFineTuning ? "Fine-Tuning" : null }, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 63,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/DatasetCard.tsx",
      lineNumber: 61,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/pages/datasets/DatasetCard.tsx",
      lineNumber: 60,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(CardContent, { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("p", { children: dataset.description }, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 67,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)("p", { children: [
        "Slug ",
        dataset.slug
      ] }, void 0, true, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 68,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/DatasetCard.tsx",
      lineNumber: 66,
      columnNumber: 7
    }, this),
    /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(CardFooter, { className: "z-10 justify-end", children: /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(DropdownMenu, { children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(DropdownMenuTrigger, { asChild: true, onMouseEnter: () => setIsHovering(true), onMouseLeave: () => setIsHovering(false), children: /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Button, { variant: "ghost", children: /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(MoreHorizontal, {}, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 74,
        columnNumber: 15
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 73,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 72,
        columnNumber: 11
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(DropdownMenuContent, { className: "w-44", children: /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(DropdownMenuItem, { className: "text-destructive gap-2", onClick: handleDeleteDataset, children: [
        /* @__PURE__ */ (0, import_jsx_dev_runtime5.jsxDEV)(Trash, { size: 16 }, void 0, false, {
          fileName: "app/pages/datasets/DatasetCard.tsx",
          lineNumber: 79,
          columnNumber: 15
        }, this),
        " Delete Dataset"
      ] }, void 0, true, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 78,
        columnNumber: 13
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/DatasetCard.tsx",
        lineNumber: 77,
        columnNumber: 11
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/DatasetCard.tsx",
      lineNumber: 71,
      columnNumber: 9
    }, this) }, void 0, false, {
      fileName: "app/pages/datasets/DatasetCard.tsx",
      lineNumber: 70,
      columnNumber: 7
    }, this)
  ] }, void 0, true, {
    fileName: "app/pages/datasets/DatasetCard.tsx",
    lineNumber: 59,
    columnNumber: 10
  }, this);
};
_s4(DatasetCard, "UeOzqjBLDkpNutW+ybxIKqdCquY=", false, function() {
  return [useParams, useFetcher, useNavigate];
});
_c11 = DatasetCard;
var _c11;
$RefreshReg$(_c11, "DatasetCard");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/pages/datasets/DatasetsPage.tsx
var import_jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/pages/datasets/DatasetsPage.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/pages/datasets/DatasetsPage.tsx"
  );
  import.meta.hot.lastModified = "1713199469912.622";
}
var DatasetsPage = ({
  datasets
}) => {
  var _s6 = $RefreshSig$();
  const breadcrumbs = [{
    label: "Datasets"
  }];
  const subtitle = () => {
    return /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(PageSubtitle, { children: [
      "Create datasets to validate your pipelines.",
      " ",
      /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(PageDocLink, { to: Routes.external.docs.datasets, children: "Datasets Docs." }, void 0, false, {
        fileName: "app/pages/datasets/DatasetsPage.tsx",
        lineNumber: 40,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/DatasetsPage.tsx",
      lineNumber: 38,
      columnNumber: 12
    }, this);
  };
  const action = () => {
    _s6();
    const [isDialogOpen, setIsDialogOpen] = (0, import_react8.useState)(false);
    return /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(Dialog, { open: isDialogOpen, onOpenChange: setIsDialogOpen, children: [
      /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(DialogTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(Button, { children: "Create Dataset" }, void 0, false, {
        fileName: "app/pages/datasets/DatasetsPage.tsx",
        lineNumber: 48,
        columnNumber: 11
      }, this) }, void 0, false, {
        fileName: "app/pages/datasets/DatasetsPage.tsx",
        lineNumber: 47,
        columnNumber: 9
      }, this),
      /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(CreateDatasetDialog, { isDialogOpen, setIsDialogOpen }, void 0, false, {
        fileName: "app/pages/datasets/DatasetsPage.tsx",
        lineNumber: 50,
        columnNumber: 9
      }, this)
    ] }, void 0, true, {
      fileName: "app/pages/datasets/DatasetsPage.tsx",
      lineNumber: 46,
      columnNumber: 12
    }, this);
  };
  _s6(action, "kdxLf4O7tSmiZi3F0AsxHZT3Vao=");
  return /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(PageLayout, { breadcrumbs, subtitle, action, children: /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)("div", { className: "grid grid-cols-4 gap-4", children: datasets.length ? datasets.map((dataset) => /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)(DatasetCard, { dataset }, dataset.id, false, {
    fileName: "app/pages/datasets/DatasetsPage.tsx",
    lineNumber: 56,
    columnNumber: 52
  }, this)) : /* @__PURE__ */ (0, import_jsx_dev_runtime6.jsxDEV)("div", { className: "col-span-4 h-24 text-center", children: "No datasets." }, void 0, false, {
    fileName: "app/pages/datasets/DatasetsPage.tsx",
    lineNumber: 56,
    columnNumber: 106
  }, this) }, void 0, false, {
    fileName: "app/pages/datasets/DatasetsPage.tsx",
    lineNumber: 55,
    columnNumber: 7
  }, this) }, void 0, false, {
    fileName: "app/pages/datasets/DatasetsPage.tsx",
    lineNumber: 54,
    columnNumber: 10
  }, this);
};
_c12 = DatasetsPage;
var _c12;
$RefreshReg$(_c12, "DatasetsPage");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;

// app/routes/app+/project+/$projectId+/env+/$envId+/datasets+/index.tsx
var import_jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
if (!window.$RefreshReg$ || !window.$RefreshSig$ || !window.$RefreshRuntime$) {
  console.warn("remix:hmr: React Fast Refresh only works when the Remix compiler is running in development mode.");
} else {
  prevRefreshReg = window.$RefreshReg$;
  prevRefreshSig = window.$RefreshSig$;
  window.$RefreshReg$ = (type, id) => {
    window.$RefreshRuntime$.register(type, '"app/routes/app+/project+/$projectId+/env+/$envId+/datasets+/index.tsx"' + id);
  };
  window.$RefreshSig$ = window.$RefreshRuntime$.createSignatureFunctionForTransform;
}
var prevRefreshReg;
var prevRefreshSig;
var _s5 = $RefreshSig$();
if (import.meta) {
  import.meta.hot = createHotContext(
    //@ts-expect-error
    "app/routes/app+/project+/$projectId+/env+/$envId+/datasets+/index.tsx"
  );
  import.meta.hot.lastModified = "1713199469916.6733";
}
var loader = withAuth(async ({
  api,
  params
}) => {
  const envId = params.envId;
  const datasets = await api.dataset.datasetControllerGetAllDatasetsForEnv({
    envId
  });
  return (0, import_node.json)({
    datasets
  });
});
function DatasetsRoute() {
  _s5();
  const {
    datasets
  } = useLoaderData();
  return /* @__PURE__ */ (0, import_jsx_dev_runtime7.jsxDEV)(DatasetsPage, { datasets }, void 0, false, {
    fileName: "app/routes/app+/project+/$projectId+/env+/$envId+/datasets+/index.tsx",
    lineNumber: 43,
    columnNumber: 10
  }, this);
}
_s5(DatasetsRoute, "PaGveA6k7aWMUxXaRp4htYCGs2A=", false, function() {
  return [useLoaderData];
});
_c13 = DatasetsRoute;
var _c13;
$RefreshReg$(_c13, "DatasetsRoute");
window.$RefreshReg$ = prevRefreshReg;
window.$RefreshSig$ = prevRefreshSig;
export {
  DatasetsRoute as default
};
//# sourceMappingURL=/build/routes/app+/project+/$projectId+/env+/$envId+/datasets+/index-23O4NBNE.js.map
