{"version":3,"sources":["../src/components/inputs/mode/FieldMode.context.ts"],"names":["createContext","useContext"],"mappings":";;;;;AAOO,IAAM,gBAAA,GAAmBA,oBAA4C,IAAI;AAUzE,SAAS,aAAa,QAAA,EAAiC;AAC5D,EAAA,MAAM,GAAA,GAAMC,iBAAW,gBAAgB,CAAA;AACvC,EAAA,OAAO,QAAA,IAAY,KAAK,IAAA,IAAQ,MAAA;AAClC","file":"chunk-L3V3BYVS.cjs","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { FieldMode } from \"../inputs.types\";\n\nexport interface FieldModeContextValue {\n  mode: FieldMode;\n}\n\nexport const FieldModeContext = createContext<FieldModeContextValue | null>(null);\n\n/**\n * Resolve the effective mode for an input. Precedence: an explicit prop wins,\n * then the nearest `<Form>` / `<FormProvider>` context, then `\"edit\"`.\n *\n * Deliberately tolerant (returns `\"edit\"` outside any provider) — unlike a slot\n * guard — so every input works standalone with zero context and existing call\n * sites behave identically.\n */\nexport function useFieldMode(explicit?: FieldMode): FieldMode {\n  const ctx = useContext(FieldModeContext);\n  return explicit ?? ctx?.mode ?? \"edit\";\n}\n"]}