import { c as _c } from "react/compiler-runtime";
import React, { type ReactNode, useCallback, useMemo, useState } from 'react';
import { Box, Text } from '../../ink.js';
import type { KeybindingAction } from '../../keybindings/types.js';
import { useKeybindings } from '../../keybindings/useKeybinding.js';
import { type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS, logEvent } from '../../services/analytics/index.js';
import { useSetAppState } from '../../state/AppState.js';
import { type OptionWithDescription, Select } from '../CustomSelect/select.js';
export type FeedbackType = 'accept' | 'reject';
export type PermissionPromptOption<T extends string> = {
  value: T;
  label: ReactNode;
  feedbackConfig?: {
    type: FeedbackType;
    placeholder?: string;
  };
  keybinding?: KeybindingAction;
};
export type ToolAnalyticsContext = {
  toolName: string;
  isMcp: boolean;
};
export type PermissionPromptProps<T extends string> = {
  options: PermissionPromptOption<T>[];
  onSelect: (value: T, feedback?: string) => void;
  onCancel?: () => void;
  question?: string | ReactNode;
  toolAnalyticsContext?: ToolAnalyticsContext;
};
const DEFAULT_PLACEHOLDERS: Record<FeedbackType, string> = {
  accept: 'tell Claude what to do next',
  reject: 'tell Claude what to do differently'
};

/**
 * Shared component for permission prompts with optional feedback input.
 *
 * Handles:
 * - "Do you want to proceed?" question with optional Tab hint
 * - Feature flag check for feedback capability
 * - Input mode toggling (Tab to expand feedback input)
 * - Analytics events for feedback interactions
 * - Transforming options to Select-compatible format
 */
export function PermissionPrompt(t0) {
  const $ = _c(54);
  const {
    options,
    onSelect,
    onCancel,
    question: t1,
    toolAnalyticsContext
  } = t0;
  const question = t1 === undefined ? "Do you want to proceed?" : t1;
  const setAppState = useSetAppState();
  const [acceptFeedback, setAcceptFeedback] = useState("");
  const [rejectFeedback, setRejectFeedback] = useState("");
  const [acceptInputMode, setAcceptInputMode] = useState(false);
  const [rejectInputMode, setRejectInputMode] = useState(false);
  const [focusedValue, setFocusedValue] = useState(null);
  const [acceptFeedbackModeEntered, setAcceptFeedbackModeEntered] = useState(false);
  const [rejectFeedbackModeEntered, setRejectFeedbackModeEntered] = useState(false);
  let t2;
  if ($[0] !== focusedValue || $[1] !== options) {
    let t3;
    if ($[3] !== focusedValue) {
      t3 = opt => opt.value === focusedValue;
      $[3] = focusedValue;
      $[4] = t3;
    } else {
      t3 = $[4];
    }
    t2 = options.find(t3);
    $[0] = focusedValue;
    $[1] = options;
    $[2] = t2;
  } else {
    t2 = $[2];
  }
  const focusedOption = t2;
  const focusedFeedbackType = focusedOption?.feedbackConfig?.type;
  const showTabHint = focusedFeedbackType === "accept" && !acceptInputMode || focusedFeedbackType === "reject" && !rejectInputMode;
  let t3;
  if ($[5] !== acceptInputMode || $[6] !== options || $[7] !== rejectInputMode) {
    let t4;
    if ($[9] !== acceptInputMode || $[10] !== rejectInputMode) {
      t4 = opt_0 => {
        const {
          value,
          label,
          feedbackConfig
        } = opt_0;
        if (!feedbackConfig) {
          return {
            label,
            value
          };
        }
        const {
          type,
          placeholder
        } = feedbackConfig;
        const isInputMode = type === "accept" ? acceptInputMode : rejectInputMode;
        const onChange = type === "accept" ? setAcceptFeedback : setRejectFeedback;
        const defaultPlaceholder = DEFAULT_PLACEHOLDERS[type];
        if (isInputMode) {
          return {
            type: "input" as const,
            label,
            value,
            placeholder: placeholder ?? defaultPlaceholder,
            onChange,
            allowEmptySubmitToCancel: true
          };
        }
        return {
          label,
          value
        };
      };
      $[9] = acceptInputMode;
      $[10] = rejectInputMode;
      $[11] = t4;
    } else {
      t4 = $[11];
    }
    t3 = options.map(t4);
    $[5] = acceptInputMode;
    $[6] = options;
    $[7] = rejectInputMode;
    $[8] = t3;
  } else {
    t3 = $[8];
  }
  const selectOptions = t3;
  let t4;
  if ($[12] !== acceptInputMode || $[13] !== options || $[14] !== rejectInputMode || $[15] !== toolAnalyticsContext?.isMcp || $[16] !== toolAnalyticsContext?.toolName) {
    t4 = value_0 => {
      const option = options.find(opt_1 => opt_1.value === value_0);
      if (!option?.feedbackConfig) {
        return;
      }
      const {
        type: type_0
      } = option.feedbackConfig;
      const analyticsProps = {
        toolName: toolAnalyticsContext?.toolName as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
        isMcp: toolAnalyticsContext?.isMcp ?? false
      };
      if (type_0 === "accept") {
        if (acceptInputMode) {
          setAcceptInputMode(false);
          logEvent("tengu_accept_feedback_mode_collapsed", analyticsProps);
        } else {
          setAcceptInputMode(true);
          setAcceptFeedbackModeEntered(true);
          logEvent("tengu_accept_feedback_mode_entered", analyticsProps);
        }
      } else {
        if (type_0 === "reject") {
          if (rejectInputMode) {
            setRejectInputMode(false);
            logEvent("tengu_reject_feedback_mode_collapsed", analyticsProps);
          } else {
            setRejectInputMode(true);
            setRejectFeedbackModeEntered(true);
            logEvent("tengu_reject_feedback_mode_entered", analyticsProps);
          }
        }
      }
    };
    $[12] = acceptInputMode;
    $[13] = options;
    $[14] = rejectInputMode;
    $[15] = toolAnalyticsContext?.isMcp;
    $[16] = toolAnalyticsContext?.toolName;
    $[17] = t4;
  } else {
    t4 = $[17];
  }
  const handleInputModeToggle = t4;
  let t5;
  if ($[18] !== acceptFeedback || $[19] !== acceptFeedbackModeEntered || $[20] !== onSelect || $[21] !== options || $[22] !== rejectFeedback || $[23] !== rejectFeedbackModeEntered || $[24] !== toolAnalyticsContext?.isMcp || $[25] !== toolAnalyticsContext?.toolName) {
    t5 = value_1 => {
      const option_0 = options.find(opt_2 => opt_2.value === value_1);
      if (!option_0) {
        return;
      }
      let feedback;
      if (option_0.feedbackConfig) {
        const rawFeedback = option_0.feedbackConfig.type === "accept" ? acceptFeedback : rejectFeedback;
        const trimmedFeedback = rawFeedback.trim();
        if (trimmedFeedback) {
          feedback = trimmedFeedback;
        }
        const analyticsProps_0 = {
          toolName: toolAnalyticsContext?.toolName as AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
          isMcp: toolAnalyticsContext?.isMcp ?? false,
          has_instructions: !!trimmedFeedback,
          instructions_length: trimmedFeedback?.length ?? 0,
          entered_feedback_mode: option_0.feedbackConfig.type === "accept" ? acceptFeedbackModeEntered : rejectFeedbackModeEntered
        };
        if (option_0.feedbackConfig.type === "accept") {
          logEvent("tengu_accept_submitted", analyticsProps_0);
        } else {
          if (option_0.feedbackConfig.type === "reject") {
            logEvent("tengu_reject_submitted", analyticsProps_0);
          }
        }
      }
      onSelect(value_1, feedback);
    };
    $[18] = acceptFeedback;
    $[19] = acceptFeedbackModeEntered;
    $[20] = onSelect;
    $[21] = options;
    $[22] = rejectFeedback;
    $[23] = rejectFeedbackModeEntered;
    $[24] = toolAnalyticsContext?.isMcp;
    $[25] = toolAnalyticsContext?.toolName;
    $[26] = t5;
  } else {
    t5 = $[26];
  }
  const handleSelect = t5;
  let handlers;
  if ($[27] !== handleSelect || $[28] !== options) {
    handlers = {};
    for (const opt_3 of options) {
      if (opt_3.keybinding) {
        handlers[opt_3.keybinding] = () => handleSelect(opt_3.value);
      }
    }
    $[27] = handleSelect;
    $[28] = options;
    $[29] = handlers;
  } else {
    handlers = $[29];
  }
  const keybindingHandlers = handlers;
  let t6;
  if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
    t6 = {
      context: "Confirmation"
    };
    $[30] = t6;
  } else {
    t6 = $[30];
  }
  useKeybindings(keybindingHandlers, t6);
  let t7;
  if ($[31] !== onCancel || $[32] !== setAppState) {
    t7 = () => {
      logEvent("tengu_permission_request_escape", {});
      setAppState(_temp);
      onCancel?.();
    };
    $[31] = onCancel;
    $[32] = setAppState;
    $[33] = t7;
  } else {
    t7 = $[33];
  }
  const handleCancel = t7;
  let t8;
  if ($[34] !== question) {
    t8 = typeof question === "string" ? <Text>{question}</Text> : question;
    $[34] = question;
    $[35] = t8;
  } else {
    t8 = $[35];
  }
  let t9;
  if ($[36] !== acceptFeedback || $[37] !== acceptInputMode || $[38] !== options || $[39] !== rejectFeedback || $[40] !== rejectInputMode) {
    t9 = value_2 => {
      const newOption = options.find(opt_4 => opt_4.value === value_2);
      if (newOption?.feedbackConfig?.type !== "accept" && acceptInputMode && !acceptFeedback.trim()) {
        setAcceptInputMode(false);
      }
      if (newOption?.feedbackConfig?.type !== "reject" && rejectInputMode && !rejectFeedback.trim()) {
        setRejectInputMode(false);
      }
      setFocusedValue(value_2);
    };
    $[36] = acceptFeedback;
    $[37] = acceptInputMode;
    $[38] = options;
    $[39] = rejectFeedback;
    $[40] = rejectInputMode;
    $[41] = t9;
  } else {
    t9 = $[41];
  }
  let t10;
  if ($[42] !== handleCancel || $[43] !== handleInputModeToggle || $[44] !== handleSelect || $[45] !== selectOptions || $[46] !== t9) {
    t10 = <Select options={selectOptions} inlineDescriptions={true} onChange={handleSelect} onCancel={handleCancel} onFocus={t9} onInputModeToggle={handleInputModeToggle} />;
    $[42] = handleCancel;
    $[43] = handleInputModeToggle;
    $[44] = handleSelect;
    $[45] = selectOptions;
    $[46] = t9;
    $[47] = t10;
  } else {
    t10 = $[47];
  }
  const t11 = showTabHint && " \xB7 Tab to amend";
  let t12;
  if ($[48] !== t11) {
    t12 = <Box marginTop={1}><Text dimColor={true}>Esc to cancel{t11}</Text></Box>;
    $[48] = t11;
    $[49] = t12;
  } else {
    t12 = $[49];
  }
  let t13;
  if ($[50] !== t10 || $[51] !== t12 || $[52] !== t8) {
    t13 = <Box flexDirection="column">{t8}{t10}{t12}</Box>;
    $[50] = t10;
    $[51] = t12;
    $[52] = t8;
    $[53] = t13;
  } else {
    t13 = $[53];
  }
  return t13;
}
function _temp(prev) {
  return {
    ...prev,
    attribution: {
      ...prev.attribution,
      escapeCount: prev.attribution.escapeCount + 1
    }
  };
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJSZWFjdCIsIlJlYWN0Tm9kZSIsInVzZUNhbGxiYWNrIiwidXNlTWVtbyIsInVzZVN0YXRlIiwiQm94IiwiVGV4dCIsIktleWJpbmRpbmdBY3Rpb24iLCJ1c2VLZXliaW5kaW5ncyIsIkFuYWx5dGljc01ldGFkYXRhX0lfVkVSSUZJRURfVE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