"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var widget_prompt_input_area_stories_exports = {};
__export(widget_prompt_input_area_stories_exports, {
  AllowFileUpload: () => AllowFileUpload,
  Busy: () => Busy,
  Default: () => Default,
  Full: () => Full,
  Readonly: () => Readonly,
  ReadonlyAndBusy: () => ReadonlyAndBusy,
  ReadonlyAndDisabled: () => ReadonlyAndDisabled,
  WithAttachments: () => WithAttachments,
  WithMultilineText: () => WithMultilineText,
  WithPresetBar: () => WithPresetBar,
  WithText: () => WithText,
  default: () => widget_prompt_input_area_stories_default
});
module.exports = __toCommonJS(widget_prompt_input_area_stories_exports);
var import_react = __toESM(require("react"));
var import_create_ricos_component_story = require("./../../wix-rich-content-common/create-ricos-component-story.js");
var import_floating_prompt_input = require("./../../plugin-html/tiptap/floating-prompt-input.js");
var import_preset_bar = require("../../plugin-html/tiptap/preset-bar/preset-bar.js");
var import_prompt_input_area = require("./prompt-input-area.js");
const template = ({
  value: initialValue,
  minHeight,
  attachments: attachments2,
  busy,
  readonly,
  fileUploadFn,
  presetBarComponent
} = {
  value: "",
  attachments: [],
  busy: false,
  readonly: false
}) => (storyProps) => {
  const [value, setValue] = import_react.default.useState(initialValue);
  return (0, import_create_ricos_component_story.createRicosComponentStory)({
    component: /* @__PURE__ */ import_react.default.createElement("div", { style: { maxWidth: "650px" } }, /* @__PURE__ */ import_react.default.createElement(
      import_prompt_input_area.WidgetPromptInputArea,
      {
        maxLength: 1e3,
        onChange: (data) => {
          setValue(data);
        },
        onSubmit: (0, import_create_ricos_component_story.action)("onSubmit"),
        value,
        onCancel: (0, import_create_ricos_component_story.action)("onCancel"),
        zIndex: 0,
        dataHook: "prompt-input-area",
        minHeight,
        attachments: attachments2,
        busy,
        readonly,
        fileUploadFn,
        presetBarComponent
      }
    )),
    storyProps
  });
};
const attachments = [
  {
    status: "ok",
    id: "1",
    file: {
      name: "image.jpg",
      type: "jpg",
      url: "https://static.wixstatic.com/media/8bb438_0660e79effa64f8ea139c4fc03e0b773.jpg"
    }
  },
  {
    status: "ok",
    id: "2",
    file: {
      name: "Document",
      type: "text",
      url: ""
    }
  }
];
const Default = template();
const AllowFileUpload = template({
  value: "",
  fileUploadFn: async () => {
    return Promise.resolve();
  }
});
const Busy = template({
  value: "",
  busy: true
});
const Readonly = template({
  value: "",
  readonly: true
});
const ReadonlyAndBusy = template({
  value: "",
  readonly: true,
  busy: true
});
const ReadonlyAndDisabled = template({
  value: "",
  readonly: true
});
const WithText = template({
  value: "create me a blog post"
});
const WithMultilineText = template({
  value: "1 \n2 \n3 \n4 \n5 \n6 \n7 \n8 \n9 \n10"
});
const WithAttachments = template({
  value: "",
  attachments,
  fileUploadFn: async () => {
    return Promise.resolve();
  }
});
const WithPresetBar = template({
  value: "",
  presetBarComponent: /* @__PURE__ */ import_react.default.createElement(import_preset_bar.PresetList, { presets: import_floating_prompt_input.PRESETS_WIDGETS_CREATE, onPresetSelect: (0, import_create_ricos_component_story.action)("onPresetSelect") })
});
const Full = template({
  value: "",
  attachments,
  fileUploadFn: async () => {
    return Promise.resolve();
  },
  presetBarComponent: /* @__PURE__ */ import_react.default.createElement(import_preset_bar.PresetList, { presets: import_floating_prompt_input.PRESETS_WIDGETS_CREATE, onPresetSelect: (0, import_create_ricos_component_story.action)("onPresetSelect") })
});
var widget_prompt_input_area_stories_default = {
  name: "WidgetPromptInputArea"
};
//# sourceMappingURL=widget-prompt-input-area.stories.js.map
