@workos-inc/widgets 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/api/endpoint.cjs +4 -1
  3. package/dist/cjs/api/endpoint.cjs.map +1 -1
  4. package/dist/cjs/api/endpoint.d.cts +17 -9
  5. package/dist/cjs/experimental/api/fetch.cjs +1083 -0
  6. package/dist/cjs/experimental/api/fetch.cjs.map +1 -0
  7. package/dist/cjs/experimental/api/fetch.d.cts +1871 -0
  8. package/dist/cjs/experimental/api/react-query.cjs +1863 -0
  9. package/dist/cjs/experimental/api/react-query.cjs.map +1 -0
  10. package/dist/cjs/experimental/api/react-query.d.cts +2685 -0
  11. package/dist/cjs/experimental/api/swr.cjs +1972 -0
  12. package/dist/cjs/experimental/api/swr.cjs.map +1 -0
  13. package/dist/cjs/experimental/api/swr.d.cts +2585 -0
  14. package/dist/cjs/lib/add-mfa-dialog.cjs +2 -2
  15. package/dist/cjs/lib/add-mfa-dialog.cjs.map +1 -1
  16. package/dist/cjs/lib/admin-portal-domain-verification.cjs.map +1 -1
  17. package/dist/cjs/lib/api/user.d.cts +2 -2
  18. package/dist/cjs/lib/api-keys/api-keys-search.cjs +2 -2
  19. package/dist/cjs/lib/api-keys/api-keys-search.cjs.map +1 -1
  20. package/dist/cjs/lib/api-keys/create-api-key.cjs +8 -8
  21. package/dist/cjs/lib/api-keys/create-api-key.cjs.map +1 -1
  22. package/dist/cjs/lib/change-password-dialog.cjs +18 -18
  23. package/dist/cjs/lib/change-password-dialog.cjs.map +1 -1
  24. package/dist/cjs/lib/copy-button.cjs.map +1 -1
  25. package/dist/cjs/lib/edit-user-profile-dialog.cjs +8 -8
  26. package/dist/cjs/lib/edit-user-profile-dialog.cjs.map +1 -1
  27. package/dist/cjs/lib/elements/utils.cjs +3 -4
  28. package/dist/cjs/lib/elements/utils.cjs.map +1 -1
  29. package/dist/cjs/lib/elements.cjs.map +1 -1
  30. package/dist/cjs/lib/elevated-access.cjs +2 -2
  31. package/dist/cjs/lib/elevated-access.cjs.map +1 -1
  32. package/dist/cjs/lib/marker.cjs.map +1 -1
  33. package/dist/cjs/lib/organization-switcher.cjs.map +1 -1
  34. package/dist/cjs/lib/otp-input.cjs +6 -7
  35. package/dist/cjs/lib/otp-input.cjs.map +1 -1
  36. package/dist/cjs/lib/provider-icon.cjs.map +1 -1
  37. package/dist/cjs/lib/set-password-dialog.cjs +12 -12
  38. package/dist/cjs/lib/set-password-dialog.cjs.map +1 -1
  39. package/dist/cjs/lib/status.cjs.map +1 -1
  40. package/dist/cjs/lib/users-search.cjs +2 -2
  41. package/dist/cjs/lib/users-search.cjs.map +1 -1
  42. package/dist/cjs/organization-switcher.client.cjs.map +1 -1
  43. package/dist/esm/api/endpoint.d.ts +17 -9
  44. package/dist/esm/api/endpoint.js +4 -1
  45. package/dist/esm/api/endpoint.js.map +1 -1
  46. package/dist/esm/experimental/api/fetch.d.ts +1871 -0
  47. package/dist/esm/experimental/api/fetch.js +954 -0
  48. package/dist/esm/experimental/api/fetch.js.map +1 -0
  49. package/dist/esm/experimental/api/react-query.d.ts +2685 -0
  50. package/dist/esm/experimental/api/react-query.js +1641 -0
  51. package/dist/esm/experimental/api/react-query.js.map +1 -0
  52. package/dist/esm/experimental/api/swr.d.ts +2585 -0
  53. package/dist/esm/experimental/api/swr.js +1731 -0
  54. package/dist/esm/experimental/api/swr.js.map +1 -0
  55. package/dist/esm/lib/add-mfa-dialog.js +1 -1
  56. package/dist/esm/lib/add-mfa-dialog.js.map +1 -1
  57. package/dist/esm/lib/admin-portal-domain-verification.js.map +1 -1
  58. package/dist/esm/lib/api/user.d.ts +2 -2
  59. package/dist/esm/lib/api-keys/api-keys-search.js +1 -1
  60. package/dist/esm/lib/api-keys/api-keys-search.js.map +1 -1
  61. package/dist/esm/lib/api-keys/create-api-key.js +1 -1
  62. package/dist/esm/lib/api-keys/create-api-key.js.map +1 -1
  63. package/dist/esm/lib/change-password-dialog.js +1 -1
  64. package/dist/esm/lib/change-password-dialog.js.map +1 -1
  65. package/dist/esm/lib/copy-button.js.map +1 -1
  66. package/dist/esm/lib/edit-user-profile-dialog.js +1 -1
  67. package/dist/esm/lib/edit-user-profile-dialog.js.map +1 -1
  68. package/dist/esm/lib/elements/utils.js +1 -2
  69. package/dist/esm/lib/elements/utils.js.map +1 -1
  70. package/dist/esm/lib/elements.js.map +1 -1
  71. package/dist/esm/lib/elevated-access.js +1 -1
  72. package/dist/esm/lib/elevated-access.js.map +1 -1
  73. package/dist/esm/lib/marker.js.map +1 -1
  74. package/dist/esm/lib/organization-switcher.js.map +1 -1
  75. package/dist/esm/lib/otp-input.js +6 -3
  76. package/dist/esm/lib/otp-input.js.map +1 -1
  77. package/dist/esm/lib/provider-icon.js.map +1 -1
  78. package/dist/esm/lib/set-password-dialog.js +1 -1
  79. package/dist/esm/lib/set-password-dialog.js.map +1 -1
  80. package/dist/esm/lib/status.js.map +1 -1
  81. package/dist/esm/lib/users-search.js +1 -1
  82. package/dist/esm/lib/users-search.js.map +1 -1
  83. package/dist/esm/organization-switcher.client.js.map +1 -1
  84. package/package.json +33 -23
  85. package/dist/cjs/lib/use-layout-effect.cjs +0 -31
  86. package/dist/cjs/lib/use-layout-effect.cjs.map +0 -1
  87. package/dist/cjs/lib/use-layout-effect.d.cts +0 -5
  88. package/dist/esm/lib/use-layout-effect.d.ts +0 -5
  89. package/dist/esm/lib/use-layout-effect.js +0 -7
  90. package/dist/esm/lib/use-layout-effect.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/otp-input.tsx"],"sourcesContent":["\"use client\";\n\nimport { composeRefs, useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport * as Form from \"@radix-ui/react-form\";\nimport { Grid } from \"@radix-ui/themes\";\nimport * as React from \"react\";\nimport { TextField } from \"./elements.js\";\n\ninterface OptContextType {\n value: string[];\n readOnly?: boolean;\n state?: \"valid\" | \"invalid\";\n onEnterPressed: () => void;\n onChildAdd: (input: HTMLInputElement) => void;\n onCharChange: (char: string, index: number) => void;\n allChildrenAdded: boolean;\n}\n\nconst OtpContext = React.createContext<OptContextType | undefined>(undefined);\n\ntype OtpRootProps = React.ComponentPropsWithoutRef<typeof Grid> & {\n onValueChange?: (value: string) => void;\n id?: string;\n name?: string;\n readOnly?: boolean;\n state?: \"valid\" | \"invalid\";\n value?: string;\n defaultValue?: string;\n autoSubmit?: boolean;\n};\n\nexport const Root = React.forwardRef<HTMLInputElement, OtpRootProps>(\n function Root(\n {\n name,\n id,\n defaultValue,\n value: valueProp,\n onValueChange,\n autoSubmit,\n children,\n readOnly,\n state,\n ...gridProps\n },\n forwardedRef,\n ) {\n const [lastCharIndex, setLastCharIndex] = React.useState<number>(0);\n const [allChildrenAdded, setAllChildrenAdded] =\n React.useState<boolean>(false);\n const childCount = React.Children.count(children);\n\n const [value, setValue] = useControllableState({\n prop: getValueAsArray(valueProp, childCount),\n defaultProp: getValueAsArray(defaultValue, childCount) ?? [],\n onChange: (value) => onValueChange?.(value.join(\"\")),\n });\n\n const hiddenInputRef = React.useRef<HTMLInputElement>(null);\n const childrenRefs = React.useRef<HTMLInputElement[]>([]);\n\n const attemptAutoSubmit = React.useCallback(\n (enterPressed = false) => {\n if (\n autoSubmit &&\n value &&\n value.every((char) => char !== \"\") &&\n (enterPressed || lastCharIndex + 1 === childCount)\n ) {\n hiddenInputRef.current?.form?.requestSubmit();\n }\n },\n [value, childCount, lastCharIndex, autoSubmit],\n );\n\n const handleEnterPressed = React.useCallback(\n () => attemptAutoSubmit(true),\n [attemptAutoSubmit],\n );\n\n const handleChildAdd = React.useCallback(\n (input: HTMLInputElement) => {\n if (input) {\n input.dataset.index = `${childrenRefs.current.length}`;\n childrenRefs.current.push(input);\n } else {\n childrenRefs.current.pop();\n }\n\n if (childrenRefs.current.length === childCount) {\n setAllChildrenAdded(true);\n }\n },\n [childCount],\n );\n\n const handleCharChange = React.useCallback(\n (char: string, index: number) => {\n setValue((previousValue) => {\n const arrayToCopy = previousValue ?? createEmptyArray(childCount);\n const newValue = [...arrayToCopy];\n newValue[index] = char;\n return newValue;\n });\n setLastCharIndex(index);\n },\n [childCount, setValue],\n );\n\n const otpContext = React.useMemo(\n () => ({\n value: value ?? createEmptyArray(childCount),\n readOnly,\n state,\n allChildrenAdded,\n onEnterPressed: handleEnterPressed,\n onChildAdd: handleChildAdd,\n onCharChange: handleCharChange,\n }),\n [\n value,\n allChildrenAdded,\n readOnly,\n state,\n childCount,\n handleEnterPressed,\n handleChildAdd,\n handleCharChange,\n ],\n );\n\n React.useEffect(attemptAutoSubmit, [attemptAutoSubmit]);\n\n return (\n <OtpContext.Provider value={otpContext}>\n <Grid\n columns={`repeat(${childCount}, 1fr)`}\n {...gridProps}\n onPaste={(event: React.ClipboardEvent<HTMLDivElement>) => {\n event.preventDefault();\n const pastedValue = event.clipboardData.getData(\"Text\");\n const sanitizedValue = pastedValue\n .replace(/[^\\d]/g, \"\")\n .slice(0, childCount);\n const value = sanitizedValue\n .padEnd(childCount, \"#\")\n .split(\"\")\n .map((char) => (char === \"#\" ? \"\" : char));\n\n setValue(value);\n setLastCharIndex(sanitizedValue.length - 1);\n\n const index = Math.min(sanitizedValue.length, childCount - 1);\n childrenRefs.current?.[index]?.focus();\n }}\n >\n {children}\n <input\n ref={composeRefs(forwardedRef, hiddenInputRef)}\n defaultValue={value?.join(\"\")}\n minLength={childCount}\n name={name}\n type=\"hidden\"\n />\n </Grid>\n </OtpContext.Provider>\n );\n },\n);\n\ninterface InputProps extends React.ComponentProps<typeof TextField> {\n autoComplete?: \"one-time-code\" | \"off\";\n}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n function Input(\n { style, readOnly, autoComplete = \"off\", ...props },\n forwardedRef,\n ) {\n const otpContext = useOptContext();\n const inputRef = React.useRef<HTMLInputElement>(null);\n const composedInputRef = useComposedRefs(\n forwardedRef,\n inputRef,\n otpContext.onChildAdd,\n );\n\n // FIXME: This should be refactored\n // eslint-disable-next-line react-hooks/refs\n const index = Number(inputRef.current?.dataset.index ?? -1);\n const char = otpContext.value[index] ?? \"\";\n\n return (\n <Form.Field name={`otp-${index}`} asChild>\n <Form.Control asChild>\n <TextField\n ref={composedInputRef}\n autoComplete={index === 0 ? autoComplete : \"off\"}\n color={otpContext.state === \"invalid\" ? \"red\" : undefined}\n inputMode=\"numeric\"\n maxLength={1}\n pattern=\"\\d{1}\"\n readOnly={readOnly ?? otpContext.readOnly}\n size=\"3\"\n value={char}\n variant={otpContext.state === \"invalid\" ? \"soft\" : undefined}\n style={{\n ...style,\n height: \"auto\",\n \"--text-field-padding\": 0,\n textAlign: \"center\",\n }}\n onChange={(event) => {\n // Only update the value if it matches the input pattern (number only)\n if (event.target.validity.valid) {\n const char = event.target.value;\n const index = Number(event.target.dataset.index ?? -1);\n otpContext.onCharChange(char, index);\n if (char !== \"\") {\n focusSibling(event.currentTarget, { back: char === \"\" });\n }\n }\n }}\n onKeyDown={(event) => {\n if (event.key === \"ArrowLeft\") {\n focusSibling(event.currentTarget, { back: true });\n event.preventDefault();\n } else if (event.key === \"ArrowRight\") {\n focusSibling(event.currentTarget);\n event.preventDefault();\n } else if (event.key === \"Backspace\" && char === \"\") {\n focusSibling(event.currentTarget, { back: true });\n } else if (event.key === \"Enter\" && char !== \"\") {\n otpContext.onEnterPressed();\n }\n }}\n {...props}\n />\n </Form.Control>\n </Form.Field>\n );\n },\n);\n\nconst useOptContext = () => {\n const optContext = React.useContext(OtpContext);\n\n if (!optContext) {\n throw new Error(\n \"OtpInput compound components cannot be rendered outside the OtpRoot component\",\n );\n }\n\n return optContext;\n};\n\nfunction focusSibling(input: HTMLInputElement, { back = false } = {}) {\n const sibling = back\n ? input.parentElement?.previousSibling\n : input.parentElement?.nextSibling;\n const siblingInput = sibling?.firstChild;\n if (siblingInput && siblingInput instanceof HTMLInputElement) {\n siblingInput?.focus();\n siblingInput?.select();\n }\n}\n\nconst getValueAsArray = (value: string | undefined, length: number) => {\n if (!value) {\n return undefined;\n }\n\n return createEmptyArray(length).map((_, index) => value?.[index] ?? \"\");\n};\n\nconst createEmptyArray = (length: number): string[] =>\n Array.from<string>({ length }).fill(\"\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwIQ;AAtIR,gCAA6C;AAC7C,0CAAqC;AACrC,WAAsB;AACtB,oBAAqB;AACrB,YAAuB;AACvB,sBAA0B;AAY1B,MAAM,aAAa,MAAM,cAA0C,MAAS;AAarE,MAAM,OAAO,MAAM;AAAA,EACxB,SAASA,MACP;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,cACA;AACA,UAAM,CAAC,eAAe,gBAAgB,IAAI,MAAM,SAAiB,CAAC;AAClE,UAAM,CAAC,kBAAkB,mBAAmB,IAC1C,MAAM,SAAkB,KAAK;AAC/B,UAAM,aAAa,MAAM,SAAS,MAAM,QAAQ;AAEhD,UAAM,CAAC,OAAO,QAAQ,QAAI,0DAAqB;AAAA,MAC7C,MAAM,gBAAgB,WAAW,UAAU;AAAA,MAC3C,aAAa,gBAAgB,cAAc,UAAU,KAAK,CAAC;AAAA,MAC3D,UAAU,CAACC,WAAU,gBAAgBA,OAAM,KAAK,EAAE,CAAC;AAAA,IACrD,CAAC;AAED,UAAM,iBAAiB,MAAM,OAAyB,IAAI;AAC1D,UAAM,eAAe,MAAM,OAA2B,CAAC,CAAC;AAExD,UAAM,oBAAoB,MAAM;AAAA,MAC9B,CAAC,eAAe,UAAU;AACxB,YACE,cACA,SACA,MAAM,MAAM,CAAC,SAAS,SAAS,EAAE,MAChC,gBAAgB,gBAAgB,MAAM,aACvC;AACA,yBAAe,SAAS,MAAM,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S,aAAa,OAAyB,EAAE,OAAO,MAAM,IAAI,CAAC,GAAG;AACpE,QAAM,UAAU,OACZ,MAAM,eAAe,kBACrB,MAAM,eAAe;AACzB,QAAM,eAAe,SAAS;AAC9B,MAAI,gBAAgB,wBAAwB,kBAAkB;AAC5D,kBAAc,MAAM;AACpB,kBAAc,OAAO;AAAA,EACvB;AACF;AAEA,MAAM,kBAAkB,CAAC,OAA2B,WAAmB;AACrE,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,SAAO,iBAAiB,MAAM,EAAE,IAAI,CAAC,GAAG,UAAU,QAAQ,KAAK,KAAK,EAAE;AACxE;AAEA,MAAM,mBAAmB,CAAC,WACxB,MAAM,KAAa,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE;","names":["Root","value","Input","char","index"]}
1
+ {"version":3,"sources":["../../../src/lib/otp-input.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n composeRefs,\n useComposedRefs,\n useControllableState,\n} from \"radix-ui/internal\";\nimport { Form } from \"radix-ui\";\nimport { Grid } from \"@radix-ui/themes\";\nimport * as React from \"react\";\nimport { TextField } from \"./elements.js\";\n\ninterface OptContextType {\n value: string[];\n readOnly?: boolean;\n state?: \"valid\" | \"invalid\";\n onEnterPressed: () => void;\n onChildAdd: (input: HTMLInputElement) => void;\n onCharChange: (char: string, index: number) => void;\n allChildrenAdded: boolean;\n}\n\nconst OtpContext = React.createContext<OptContextType | undefined>(undefined);\n\ntype OtpRootProps = React.ComponentPropsWithoutRef<typeof Grid> & {\n onValueChange?: (value: string) => void;\n id?: string;\n name?: string;\n readOnly?: boolean;\n state?: \"valid\" | \"invalid\";\n value?: string;\n defaultValue?: string;\n autoSubmit?: boolean;\n};\n\nexport const Root = React.forwardRef<HTMLInputElement, OtpRootProps>(\n function Root(\n {\n name,\n id,\n defaultValue,\n value: valueProp,\n onValueChange,\n autoSubmit,\n children,\n readOnly,\n state,\n ...gridProps\n },\n forwardedRef,\n ) {\n const [lastCharIndex, setLastCharIndex] = React.useState<number>(0);\n const [allChildrenAdded, setAllChildrenAdded] =\n React.useState<boolean>(false);\n const childCount = React.Children.count(children);\n\n const [value, setValue] = useControllableState({\n prop: getValueAsArray(valueProp, childCount),\n defaultProp: getValueAsArray(defaultValue, childCount) ?? [],\n onChange: (value) => onValueChange?.(value.join(\"\")),\n });\n\n const hiddenInputRef = React.useRef<HTMLInputElement>(null);\n const childrenRefs = React.useRef<HTMLInputElement[]>([]);\n\n const attemptAutoSubmit = React.useCallback(\n (enterPressed = false) => {\n if (\n autoSubmit &&\n value &&\n value.every((char) => char !== \"\") &&\n (enterPressed || lastCharIndex + 1 === childCount)\n ) {\n hiddenInputRef.current?.form?.requestSubmit();\n }\n },\n [value, childCount, lastCharIndex, autoSubmit],\n );\n\n const handleEnterPressed = React.useCallback(\n () => attemptAutoSubmit(true),\n [attemptAutoSubmit],\n );\n\n const handleChildAdd = React.useCallback(\n (input: HTMLInputElement) => {\n if (input) {\n input.dataset.index = `${childrenRefs.current.length}`;\n childrenRefs.current.push(input);\n } else {\n childrenRefs.current.pop();\n }\n\n if (childrenRefs.current.length === childCount) {\n setAllChildrenAdded(true);\n }\n },\n [childCount],\n );\n\n const handleCharChange = React.useCallback(\n (char: string, index: number) => {\n setValue((previousValue) => {\n const arrayToCopy = previousValue ?? createEmptyArray(childCount);\n const newValue = [...arrayToCopy];\n newValue[index] = char;\n return newValue;\n });\n setLastCharIndex(index);\n },\n [childCount, setValue],\n );\n\n const otpContext = React.useMemo(\n () => ({\n value: value ?? createEmptyArray(childCount),\n readOnly,\n state,\n allChildrenAdded,\n onEnterPressed: handleEnterPressed,\n onChildAdd: handleChildAdd,\n onCharChange: handleCharChange,\n }),\n [\n value,\n allChildrenAdded,\n readOnly,\n state,\n childCount,\n handleEnterPressed,\n handleChildAdd,\n handleCharChange,\n ],\n );\n\n React.useEffect(attemptAutoSubmit, [attemptAutoSubmit]);\n\n return (\n <OtpContext.Provider value={otpContext}>\n <Grid\n columns={`repeat(${childCount}, 1fr)`}\n {...gridProps}\n onPaste={(event: React.ClipboardEvent<HTMLDivElement>) => {\n event.preventDefault();\n const pastedValue = event.clipboardData.getData(\"Text\");\n const sanitizedValue = pastedValue\n .replace(/[^\\d]/g, \"\")\n .slice(0, childCount);\n const value = sanitizedValue\n .padEnd(childCount, \"#\")\n .split(\"\")\n .map((char) => (char === \"#\" ? \"\" : char));\n\n setValue(value);\n setLastCharIndex(sanitizedValue.length - 1);\n\n const index = Math.min(sanitizedValue.length, childCount - 1);\n childrenRefs.current?.[index]?.focus();\n }}\n >\n {children}\n <input\n ref={composeRefs(forwardedRef, hiddenInputRef)}\n defaultValue={value?.join(\"\")}\n minLength={childCount}\n name={name}\n type=\"hidden\"\n />\n </Grid>\n </OtpContext.Provider>\n );\n },\n);\n\ninterface InputProps extends React.ComponentProps<typeof TextField> {\n autoComplete?: \"one-time-code\" | \"off\";\n}\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n function Input(\n { style, readOnly, autoComplete = \"off\", ...props },\n forwardedRef,\n ) {\n const otpContext = useOptContext();\n const inputRef = React.useRef<HTMLInputElement>(null);\n const composedInputRef = useComposedRefs(\n forwardedRef,\n inputRef,\n otpContext.onChildAdd,\n );\n\n // FIXME: This should be refactored\n // eslint-disable-next-line react-hooks/refs\n const index = Number(inputRef.current?.dataset.index ?? -1);\n const char = otpContext.value[index] ?? \"\";\n\n return (\n <Form.Field name={`otp-${index}`} asChild>\n <Form.Control asChild>\n <TextField\n ref={composedInputRef}\n autoComplete={index === 0 ? autoComplete : \"off\"}\n color={otpContext.state === \"invalid\" ? \"red\" : undefined}\n inputMode=\"numeric\"\n maxLength={1}\n pattern=\"\\d{1}\"\n readOnly={readOnly ?? otpContext.readOnly}\n size=\"3\"\n value={char}\n variant={otpContext.state === \"invalid\" ? \"soft\" : undefined}\n style={{\n ...style,\n height: \"auto\",\n \"--text-field-padding\": 0,\n textAlign: \"center\",\n }}\n onChange={(event) => {\n // Only update the value if it matches the input pattern (number only)\n if (event.target.validity.valid) {\n const char = event.target.value;\n const index = Number(event.target.dataset.index ?? -1);\n otpContext.onCharChange(char, index);\n if (char !== \"\") {\n focusSibling(event.currentTarget, { back: char === \"\" });\n }\n }\n }}\n onKeyDown={(event) => {\n if (event.key === \"ArrowLeft\") {\n focusSibling(event.currentTarget, { back: true });\n event.preventDefault();\n } else if (event.key === \"ArrowRight\") {\n focusSibling(event.currentTarget);\n event.preventDefault();\n } else if (event.key === \"Backspace\" && char === \"\") {\n focusSibling(event.currentTarget, { back: true });\n } else if (event.key === \"Enter\" && char !== \"\") {\n otpContext.onEnterPressed();\n }\n }}\n {...props}\n />\n </Form.Control>\n </Form.Field>\n );\n },\n);\n\nconst useOptContext = () => {\n const optContext = React.useContext(OtpContext);\n\n if (!optContext) {\n throw new Error(\n \"OtpInput compound components cannot be rendered outside the OtpRoot component\",\n );\n }\n\n return optContext;\n};\n\nfunction focusSibling(input: HTMLInputElement, { back = false } = {}) {\n const sibling = back\n ? input.parentElement?.previousSibling\n : input.parentElement?.nextSibling;\n const siblingInput = sibling?.firstChild;\n if (siblingInput && siblingInput instanceof HTMLInputElement) {\n siblingInput?.focus();\n siblingInput?.select();\n }\n}\n\nconst getValueAsArray = (value: string | undefined, length: number) => {\n if (!value) {\n return undefined;\n }\n\n return createEmptyArray(length).map((_, index) => value?.[index] ?? \"\");\n};\n\nconst createEmptyArray = (length: number): string[] =>\n Array.from<string>({ length }).fill(\"\");\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2IQ;AAzIR,sBAIO;AACP,sBAAqB;AACrB,oBAAqB;AACrB,YAAuB;AACvB,sBAA0B;AAY1B,MAAM,aAAa,MAAM,cAA0C,MAAS;AAarE,MAAM,OAAO,MAAM;AAAA,EACxB,SAASA,MACP;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,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../../src/lib/provider-icon.tsx"],"sourcesContent":["import { extractProps } from \"@radix-ui/themes/helpers\";\nimport { marginPropDefs, type MarginProps } from \"@radix-ui/themes/props\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\nimport type { IdentityProvider } from \"./identity-providers.js\";\nimport type { DataIntegrationIntegrationType } from \"../api/endpoint.js\";\n\ninterface ProviderIconProps\n extends React.ComponentPropsWithRef<\"div\">,\n MarginProps {\n provider: IdentityProvider | keyof typeof DataIntegrationIntegrationType;\n size?: \"1\" | \"2\" | \"3\" | \"4\";\n}\n\nconst ProviderIcon = React.forwardRef<HTMLDivElement, ProviderIconProps>(\n (props, forwardedRef) => {\n const {\n provider,\n size = \"4\",\n className,\n ...providerIconProps\n } = extractProps(props, marginPropDefs);\n\n return (\n <div\n {...providerIconProps}\n ref={forwardedRef}\n className={clsx(\"woswidgets-provider-icon\", `size-${size}`, className)}\n data-provider={provider}\n />\n );\n },\n);\n\nProviderIcon.displayName = \"ProviderIcon\";\n\nexport { ProviderIcon };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBM;AAxBN,qBAA6B;AAC7B,mBAAiD;AACjD,kBAAiB;AACjB,YAAuB;AAWvB,MAAM,eAAe,MAAM;AAAA,EACzB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,GAAG;AAAA,IACL,QAAI,6BAAa,OAAO,2BAAc;AAEtC,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,eAAW,YAAAA,SAAK,4BAA4B,QAAQ,IAAI,IAAI,SAAS;AAAA,QACrE,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":["clsx"]}
1
+ {"version":3,"sources":["../../../src/lib/provider-icon.tsx"],"sourcesContent":["import { extractProps } from \"@radix-ui/themes/helpers\";\nimport { marginPropDefs, type MarginProps } from \"@radix-ui/themes/props\";\nimport clsx from \"clsx\";\nimport * as React from \"react\";\nimport type { IdentityProvider } from \"./identity-providers.js\";\nimport type { DataIntegrationIntegrationType } from \"../api/endpoint.js\";\n\ninterface ProviderIconProps\n extends React.ComponentPropsWithRef<\"div\">, MarginProps {\n provider: IdentityProvider | keyof typeof DataIntegrationIntegrationType;\n size?: \"1\" | \"2\" | \"3\" | \"4\";\n}\n\nconst ProviderIcon = React.forwardRef<HTMLDivElement, ProviderIconProps>(\n (props, forwardedRef) => {\n const {\n provider,\n size = \"4\",\n className,\n ...providerIconProps\n } = extractProps(props, marginPropDefs);\n\n return (\n <div\n {...providerIconProps}\n ref={forwardedRef}\n className={clsx(\"woswidgets-provider-icon\", `size-${size}`, className)}\n data-provider={provider}\n />\n );\n },\n);\n\nProviderIcon.displayName = \"ProviderIcon\";\n\nexport { ProviderIcon };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBM;AAvBN,qBAA6B;AAC7B,mBAAiD;AACjD,kBAAiB;AACjB,YAAuB;AAUvB,MAAM,eAAe,MAAM;AAAA,EACzB,CAAC,OAAO,iBAAiB;AACvB,UAAM;AAAA,MACJ;AAAA,MACA,OAAO;AAAA,MACP;AAAA,MACA,GAAG;AAAA,IACL,QAAI,6BAAa,OAAO,2BAAc;AAEtC,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,KAAK;AAAA,QACL,eAAW,YAAAA,SAAK,4BAA4B,QAAQ,IAAI,IAAI,SAAS;AAAA,QACrE,iBAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;","names":["clsx"]}
@@ -36,7 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
36
36
  var import_themes = require("@radix-ui/themes");
37
37
  var React = __toESM(require("react"), 1);
38
38
  var import_elements = require("./elements.js");
39
- var Form = __toESM(require("@radix-ui/react-form"), 1);
39
+ var import_radix_ui = require("radix-ui");
40
40
  var import_endpoint = require("../api/endpoint.js");
41
41
  var import_use_security_settings = require("./use-security-settings.js");
42
42
  var import_elevated_access = require("./elevated-access.js");
@@ -93,7 +93,7 @@ function Content({ onClose }) {
93
93
  ) }) }),
94
94
  setPassword.error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Callout.Root, { color: "red", my: "-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Callout.Text, { children: getMutationErrorMessage(setPassword.error) }) }) : null,
95
95
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
96
- Form.Root,
96
+ import_radix_ui.Form.Root,
97
97
  {
98
98
  onSubmit: handleSubmit,
99
99
  onChange: (event) => {
@@ -104,8 +104,8 @@ function Content({ onClose }) {
104
104
  },
105
105
  children: [
106
106
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { mt: "5", direction: "column", gap: "4", children: [
107
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Field, { name: "password", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "2", children: [
108
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Label, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
107
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Field, { name: "password", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "2", children: [
108
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Label, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
109
109
  import_translation.Translation,
110
110
  {
111
111
  defaultMessage: "Enter a new password",
@@ -113,7 +113,7 @@ function Content({ onClose }) {
113
113
  description: "Label for password input field"
114
114
  }
115
115
  ) }) }),
116
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Control, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
116
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Control, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
117
  import_elements.PasswordField,
118
118
  {
119
119
  autoFocus: true,
@@ -127,7 +127,7 @@ function Content({ onClose }) {
127
127
  disabled: setPassword.isPending || setPassword.isSuccess
128
128
  }
129
129
  ) }),
130
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Message, { match: "valueMissing", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "red", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Message, { match: "valueMissing", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "red", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
131
  import_translation.Translation,
132
132
  {
133
133
  defaultMessage: "Please enter a new password",
@@ -135,7 +135,7 @@ function Content({ onClose }) {
135
135
  description: "Error message when password field is empty"
136
136
  }
137
137
  ) }) }),
138
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Message, { match: (value) => value.length < 8, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "red", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
138
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Message, { match: (value) => value.length < 8, asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "red", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
139
139
  import_translation.Translation,
140
140
  {
141
141
  defaultMessage: "Password must be at least 8 characters",
@@ -144,8 +144,8 @@ function Content({ onClose }) {
144
144
  }
145
145
  ) }) })
146
146
  ] }) }),
147
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Field, { name: "confirmPassword", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "2", children: [
148
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Label, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Field, { name: "confirmPassword", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_themes.Flex, { direction: "column", gap: "2", children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Label, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_elements.Label, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
149
149
  import_translation.Translation,
150
150
  {
151
151
  defaultMessage: "Confirm your new password",
@@ -153,7 +153,7 @@ function Content({ onClose }) {
153
153
  description: "Label for password confirmation field"
154
154
  }
155
155
  ) }) }),
156
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Control, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Control, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
157
157
  import_elements.PasswordField,
158
158
  {
159
159
  required: true,
@@ -166,7 +166,7 @@ function Content({ onClose }) {
166
166
  disabled: setPassword.isPending || setPassword.isSuccess
167
167
  }
168
168
  ) }),
169
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Form.Message, { match: "valueMissing", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "red", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
169
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_radix_ui.Form.Message, { match: "valueMissing", asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_themes.Text, { size: "2", color: "red", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
170
170
  import_translation.Translation,
171
171
  {
172
172
  defaultMessage: "Please confirm your new password",
@@ -175,7 +175,7 @@ function Content({ onClose }) {
175
175
  }
176
176
  ) }) }),
177
177
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
178
- Form.Message,
178
+ import_radix_ui.Form.Message,
179
179
  {
180
180
  match: (value, formData) => value !== formData.get("password"),
181
181
  asChild: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/set-password-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Callout, Flex, Text, VisuallyHidden } from \"@radix-ui/themes\";\nimport * as React from \"react\";\nimport { type ReactNode } from \"react\";\nimport { Dialog, Label, PasswordField, Button } from \"./elements.js\";\nimport * as Form from \"@radix-ui/react-form\";\nimport { useCreatePassword } from \"../api/endpoint.js\";\nimport { useSecuritySettings } from \"./use-security-settings.js\";\nimport { ElevatedAccess } from \"./elevated-access.js\";\nimport { SaveButton } from \"./save-button.js\";\nimport { useDialogClose } from \"./use-dialog-close.js\";\nimport { Translation } from \"./i18n/translation.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\n\ninterface SetPasswordDialogProps extends Dialog.RootProps {\n children?: ReactNode;\n}\n\nexport function SetPasswordDialog({\n children,\n ...props\n}: SetPasswordDialogProps) {\n const [open, setOpen] = React.useState(false);\n\n const handleClose = React.useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <Dialog.Root {...props} open={open} onOpenChange={setOpen}>\n <Dialog.Trigger>{children}</Dialog.Trigger>\n\n <Dialog.Content maxWidth=\"480px\">\n <ElevatedAccess>\n <Content onClose={handleClose} />\n </ElevatedAccess>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\ninterface ContentProps {\n onClose: () => void;\n}\n\nfunction Content({ onClose }: ContentProps) {\n const translate = useTranslation();\n const setPassword = useCreatePassword();\n const securitySettings = useSecuritySettings();\n const [disableSubmit, setDisableSubmit] = React.useState(true);\n\n const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n const formData = new FormData(event.currentTarget);\n const password = formData.get(\"password\")?.toString();\n\n if (!password) {\n return;\n }\n\n setPassword.mutate({ data: { password } });\n };\n\n useDialogClose(setPassword.isSuccess, () => {\n securitySettings.update(\"Password\", true);\n });\n\n return (\n <>\n <Dialog.Title mb=\"5\">\n <Translation\n defaultMessage=\"Set New Password\"\n id=\"4ymFUc\"\n description=\"Dialog title for setting a new password\"\n />\n </Dialog.Title>\n <VisuallyHidden>\n <Dialog.Description>\n <Translation\n defaultMessage=\"Set a new password for your account\"\n id=\"KYv5vS\"\n description=\"Screen reader description for set password dialog\"\n />\n </Dialog.Description>\n </VisuallyHidden>\n\n {setPassword.error ? (\n <Callout.Root color=\"red\" my=\"-2\">\n <Callout.Text>\n {getMutationErrorMessage(setPassword.error)}\n </Callout.Text>\n </Callout.Root>\n ) : null}\n\n <Form.Root\n onSubmit={handleSubmit}\n onChange={(event) => {\n const formData = new FormData(event.currentTarget);\n const password = formData.get(\"password\")?.toString();\n const confirmPassword = formData.get(\"confirmPassword\")?.toString();\n setDisableSubmit(password === \"\" || confirmPassword === \"\");\n }}\n >\n <Flex mt=\"5\" direction=\"column\" gap=\"4\">\n <Form.Field name=\"password\" asChild>\n <Flex direction=\"column\" gap=\"2\">\n <Form.Label asChild>\n <Label>\n <Translation\n defaultMessage=\"Enter a new password\"\n id=\"OHDxyL\"\n description=\"Label for password input field\"\n />\n </Label>\n </Form.Label>\n <Form.Control asChild>\n <PasswordField\n autoFocus\n required\n autoComplete=\"new-password\"\n placeholder={translate({\n defaultMessage: \"New password\",\n id: \"ABfT4E\",\n description: \"Placeholder for password input\",\n })}\n disabled={setPassword.isPending || setPassword.isSuccess}\n />\n </Form.Control>\n <Form.Message match=\"valueMissing\" asChild>\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"Please enter a new password\"\n id=\"+2kQs5\"\n description=\"Error message when password field is empty\"\n />\n </Text>\n </Form.Message>\n <Form.Message match={(value) => value.length < 8} asChild>\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"Password must be at least 8 characters\"\n id=\"WRjyrh\"\n description=\"Error message when password is too short\"\n />\n </Text>\n </Form.Message>\n </Flex>\n </Form.Field>\n\n <Form.Field name=\"confirmPassword\" asChild>\n <Flex direction=\"column\" gap=\"2\">\n <Form.Label asChild>\n <Label>\n <Translation\n defaultMessage=\"Confirm your new password\"\n id=\"K83lBn\"\n description=\"Label for password confirmation field\"\n />\n </Label>\n </Form.Label>\n <Form.Control asChild>\n <PasswordField\n required\n autoComplete=\"new-password\"\n placeholder={translate({\n defaultMessage: \"Confirm new password\",\n id: \"O79vjp\",\n description: \"Placeholder for password confirmation input\",\n })}\n disabled={setPassword.isPending || setPassword.isSuccess}\n />\n </Form.Control>\n <Form.Message match=\"valueMissing\" asChild>\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"Please confirm your new password\"\n id=\"vfwqWf\"\n description=\"Error message when password confirmation is empty\"\n />\n </Text>\n </Form.Message>\n <Form.Message\n match={(value, formData) => value !== formData.get(\"password\")}\n asChild\n >\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"The passwords you entered don't match.\"\n id=\"ayYwQx\"\n description=\"Error message when passwords don't match\"\n />\n </Text>\n </Form.Message>\n </Flex>\n </Form.Field>\n </Flex>\n\n <Flex mt=\"5\" gap=\"3\" justify=\"end\">\n <Dialog.Close>\n <Button\n variant=\"secondary\"\n disabled={setPassword.isPending || setPassword.isSuccess}\n >\n <Translation\n defaultMessage=\"Cancel\"\n id=\"VJVs4m\"\n description=\"Button to cancel setting password\"\n />\n </Button>\n </Dialog.Close>\n\n <SaveButton\n loading={setPassword.isPending}\n done={setPassword.isSuccess}\n onDone={onClose}\n type=\"submit\"\n disabled={disableSubmit || undefined}\n >\n <Translation\n defaultMessage=\"Set password\"\n id=\"jSfqX/\"\n description=\"Button to confirm setting new password\"\n />\n </SaveButton>\n </Flex>\n\n {/* mirror errors in a live region */}\n <VisuallyHidden asChild>\n <section aria-live=\"polite\">\n {getMutationErrorMessage(setPassword.error)}\n </section>\n </VisuallyHidden>\n </Form.Root>\n </>\n );\n}\n\nfunction getMutationErrorMessage(error: unknown) {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\"\n ) {\n return error.message;\n }\n\n return (\n <Translation\n defaultMessage=\"Something went wrong. Please try again.\"\n id=\"jLzoYu\"\n description=\"Generic error message for password setting failure\"\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BI;AA5BJ,oBAAoD;AACpD,YAAuB;AAEvB,sBAAqD;AACrD,WAAsB;AACtB,sBAAkC;AAClC,mCAAoC;AACpC,6BAA+B;AAC/B,yBAA2B;AAC3B,8BAA+B;AAC/B,yBAA4B;AAC5B,6BAA+B;AAMxB,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA,GAAG;AACL,GAA2B;AACzB,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAE5C,QAAM,cAAc,MAAM,YAAY,MAAM;AAC1C,YAAQ,KAAK;AAAA,EACf,GAAG,CAAC,CAAC;AAEL,SACE,6CAAC,uBAAO,MAAP,EAAa,GAAG,OAAO,MAAY,cAAc,SAChD;AAAA,gDAAC,uBAAO,SAAP,EAAgB,UAAS;AAAA,IAE1B,4CAAC,uBAAO,SAAP,EAAe,UAAS,SACvB,sDAAC,yCACC,sDAAC,WAAQ,SAA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;AAAA,gBACC,SAAS,YAAY;AAAA,gBACrB,MAAM,YAAY;AAAA,gBAClB,QAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,UAAU,iBAAiB;AAAA,gBAE3B;AAAA,kBAAC;AAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,IAAG;AAAA,oBACH,aAAY;AAAA;AAAA,gBACd;AAAA;AAAA,YACF;AAAA,aACF;AAAA,UAGA,4CAAC,gCAAe,SAAO,MACrB,sDAAC,aAAQ,aAAU,UAChB,kCAAwB,YAAY,KAAK,GAC5C,GACF;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,SAAS,wBAAwB,OAAgB;AAC/C,MAAI,iBAAiB,OAAO;AAC1B,WAAO,MAAM;AAAA,EACf;AAEA,MACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAO,MAAM,YAAY,UACzB;AACA,WAAO,MAAM;AAAA,EACf;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAe;AAAA,MACf,IAAG;AAAA,MACH,aAAY;AAAA;AAAA,EACd;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/lib/set-password-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { Callout, Flex, Text, VisuallyHidden } from \"@radix-ui/themes\";\nimport * as React from \"react\";\nimport { type ReactNode } from \"react\";\nimport { Dialog, Label, PasswordField, Button } from \"./elements.js\";\nimport { Form } from \"radix-ui\";\nimport { useCreatePassword } from \"../api/endpoint.js\";\nimport { useSecuritySettings } from \"./use-security-settings.js\";\nimport { ElevatedAccess } from \"./elevated-access.js\";\nimport { SaveButton } from \"./save-button.js\";\nimport { useDialogClose } from \"./use-dialog-close.js\";\nimport { Translation } from \"./i18n/translation.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\n\ninterface SetPasswordDialogProps extends Dialog.RootProps {\n children?: ReactNode;\n}\n\nexport function SetPasswordDialog({\n children,\n ...props\n}: SetPasswordDialogProps) {\n const [open, setOpen] = React.useState(false);\n\n const handleClose = React.useCallback(() => {\n setOpen(false);\n }, []);\n\n return (\n <Dialog.Root {...props} open={open} onOpenChange={setOpen}>\n <Dialog.Trigger>{children}</Dialog.Trigger>\n\n <Dialog.Content maxWidth=\"480px\">\n <ElevatedAccess>\n <Content onClose={handleClose} />\n </ElevatedAccess>\n </Dialog.Content>\n </Dialog.Root>\n );\n}\n\ninterface ContentProps {\n onClose: () => void;\n}\n\nfunction Content({ onClose }: ContentProps) {\n const translate = useTranslation();\n const setPassword = useCreatePassword();\n const securitySettings = useSecuritySettings();\n const [disableSubmit, setDisableSubmit] = React.useState(true);\n\n const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n\n const formData = new FormData(event.currentTarget);\n const password = formData.get(\"password\")?.toString();\n\n if (!password) {\n return;\n }\n\n setPassword.mutate({ data: { password } });\n };\n\n useDialogClose(setPassword.isSuccess, () => {\n securitySettings.update(\"Password\", true);\n });\n\n return (\n <>\n <Dialog.Title mb=\"5\">\n <Translation\n defaultMessage=\"Set New Password\"\n id=\"4ymFUc\"\n description=\"Dialog title for setting a new password\"\n />\n </Dialog.Title>\n <VisuallyHidden>\n <Dialog.Description>\n <Translation\n defaultMessage=\"Set a new password for your account\"\n id=\"KYv5vS\"\n description=\"Screen reader description for set password dialog\"\n />\n </Dialog.Description>\n </VisuallyHidden>\n\n {setPassword.error ? (\n <Callout.Root color=\"red\" my=\"-2\">\n <Callout.Text>\n {getMutationErrorMessage(setPassword.error)}\n </Callout.Text>\n </Callout.Root>\n ) : null}\n\n <Form.Root\n onSubmit={handleSubmit}\n onChange={(event) => {\n const formData = new FormData(event.currentTarget);\n const password = formData.get(\"password\")?.toString();\n const confirmPassword = formData.get(\"confirmPassword\")?.toString();\n setDisableSubmit(password === \"\" || confirmPassword === \"\");\n }}\n >\n <Flex mt=\"5\" direction=\"column\" gap=\"4\">\n <Form.Field name=\"password\" asChild>\n <Flex direction=\"column\" gap=\"2\">\n <Form.Label asChild>\n <Label>\n <Translation\n defaultMessage=\"Enter a new password\"\n id=\"OHDxyL\"\n description=\"Label for password input field\"\n />\n </Label>\n </Form.Label>\n <Form.Control asChild>\n <PasswordField\n autoFocus\n required\n autoComplete=\"new-password\"\n placeholder={translate({\n defaultMessage: \"New password\",\n id: \"ABfT4E\",\n description: \"Placeholder for password input\",\n })}\n disabled={setPassword.isPending || setPassword.isSuccess}\n />\n </Form.Control>\n <Form.Message match=\"valueMissing\" asChild>\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"Please enter a new password\"\n id=\"+2kQs5\"\n description=\"Error message when password field is empty\"\n />\n </Text>\n </Form.Message>\n <Form.Message match={(value) => value.length < 8} asChild>\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"Password must be at least 8 characters\"\n id=\"WRjyrh\"\n description=\"Error message when password is too short\"\n />\n </Text>\n </Form.Message>\n </Flex>\n </Form.Field>\n\n <Form.Field name=\"confirmPassword\" asChild>\n <Flex direction=\"column\" gap=\"2\">\n <Form.Label asChild>\n <Label>\n <Translation\n defaultMessage=\"Confirm your new password\"\n id=\"K83lBn\"\n description=\"Label for password confirmation field\"\n />\n </Label>\n </Form.Label>\n <Form.Control asChild>\n <PasswordField\n required\n autoComplete=\"new-password\"\n placeholder={translate({\n defaultMessage: \"Confirm new password\",\n id: \"O79vjp\",\n description: \"Placeholder for password confirmation input\",\n })}\n disabled={setPassword.isPending || setPassword.isSuccess}\n />\n </Form.Control>\n <Form.Message match=\"valueMissing\" asChild>\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"Please confirm your new password\"\n id=\"vfwqWf\"\n description=\"Error message when password confirmation is empty\"\n />\n </Text>\n </Form.Message>\n <Form.Message\n match={(value, formData) => value !== formData.get(\"password\")}\n asChild\n >\n <Text size=\"2\" color=\"red\">\n <Translation\n defaultMessage=\"The passwords you entered don't match.\"\n id=\"ayYwQx\"\n description=\"Error message when passwords don't match\"\n />\n </Text>\n </Form.Message>\n </Flex>\n </Form.Field>\n </Flex>\n\n <Flex mt=\"5\" gap=\"3\" justify=\"end\">\n <Dialog.Close>\n <Button\n variant=\"secondary\"\n disabled={setPassword.isPending || setPassword.isSuccess}\n >\n <Translation\n defaultMessage=\"Cancel\"\n id=\"VJVs4m\"\n description=\"Button to cancel setting password\"\n />\n </Button>\n </Dialog.Close>\n\n <SaveButton\n loading={setPassword.isPending}\n done={setPassword.isSuccess}\n onDone={onClose}\n type=\"submit\"\n disabled={disableSubmit || undefined}\n >\n <Translation\n defaultMessage=\"Set password\"\n id=\"jSfqX/\"\n description=\"Button to confirm setting new password\"\n />\n </SaveButton>\n </Flex>\n\n {/* mirror errors in a live region */}\n <VisuallyHidden asChild>\n <section aria-live=\"polite\">\n {getMutationErrorMessage(setPassword.error)}\n </section>\n </VisuallyHidden>\n </Form.Root>\n </>\n );\n}\n\nfunction getMutationErrorMessage(error: unknown) {\n if (error instanceof Error) {\n return error.message;\n }\n\n if (\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof error.message === \"string\"\n ) {\n return error.message;\n }\n\n return (\n <Translation\n defaultMessage=\"Something went wrong. Please try again.\"\n id=\"jLzoYu\"\n description=\"Generic error message for password setting failure\"\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BI;AA5BJ,oBAAoD;AACpD,YAAuB;AAEvB,sBAAqD;AACrD,sBAAqB;AACrB,sBAAkC;AAClC,mCAAoC;AACpC,6BAA+B;AAC/B,yBAA2B;AAC3B,8BAA+B;AAC/B,yBAA4B;AAC5B,6BAA+B;AAMxB,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA,GAAG;AACL,GAA2B;AACzB,QAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAE5C,QAAM,cAAc,MAAM,YAAY,MAAM;AAC1C,YAAQ,KAAK;AAAA,EACf,GAAG,CAAC,CAAC;AAEL,SACE,6CAAC,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ACR,UAAU,YAAY,aAAa,YAAY;AAAA,gBAE/C;AAAA,kBAAC;AAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,IAAG;AAAA,oBACH,aAAY;AAAA;AAAA,gBACd;AAAA;AAAA,YACF,GACF;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,SAAS,YAAY;AAAA,gBACrB,MAAM,YAAY;AAAA,gBAClB,QAAQ;AAAA,gBACR,MAAK;AAAA,gBACL,UAAU,iBAAiB;AAAA,gBAE3B;AAAA,kBAAC;AAAA;AAAA,oBACC,gBAAe;AAAA,oBACf,IAAG;AAAA,oBACH,aAAY;AAAA;AAAA,gBACd;AAAA;AAAA,YACF;AAAA,aACF;AAAA,UAGA,4CAAC,gCAAe,SAAO,MACrB,sDAAC,aAAQ,aAAU,UAChB,kCAAwB,YAAY,KAAK,GAC5C,GACF;AAAA;AAAA;AAAA,IACF;AAAA,KACF;AAEJ;AAEA,SAAS,wBAAwB,OAAgB;AAC/C,MAAI,iBAAiB,OAAO;AAC1B,WAAO,MAAM;AAAA,EACf;AAEA,MACE,OAAO,UAAU,YACjB,UAAU,QACV,aAAa,SACb,OAAO,MAAM,YAAY,UACzB;AACA,WAAO,MAAM;AAAA,EACf;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAe;AAAA,MACf,IAAG;AAAA,MACH,aAAY;AAAA;AAAA,EACd;AAEJ;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/status.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport * as React from \"react\";\nimport { MarginProps } from \"@radix-ui/themes/props\";\nimport { Spinner, Text } from \"@radix-ui/themes\";\n\nexport const getStatusColor = (\n state: \"success\" | \"waiting\" | \"error\",\n): \"green\" | \"gray\" | \"red\" => {\n switch (state) {\n case \"success\":\n return \"green\";\n case \"waiting\":\n return \"gray\";\n case \"error\":\n return \"red\";\n }\n};\n\nexport interface StatusProps\n extends Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\">,\n MarginProps {\n children?: React.ReactNode;\n state: \"success\" | \"waiting\" | \"error\";\n}\n\nconst Status = React.forwardRef<HTMLSpanElement, StatusProps>(\n ({ className, ...props }, forwardedRef) => (\n <Text\n ref={forwardedRef}\n className={clsx(className, \"woswidgets-status\")}\n data-state={props.state}\n {...props}\n size=\"2\"\n color={getStatusColor(props.state)}\n >\n {props.state === \"waiting\" && <Spinner />}\n {props.children}\n </Text>\n ),\n);\n\nStatus.displayName = \"Status\";\n\nexport { Status };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BI;AA3BJ,kBAAiB;AACjB,YAAuB;AAEvB,oBAA8B;AAEvB,MAAM,iBAAiB,CAC5B,UAC6B;AAC7B,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,EACX;AACF;AASA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,iBACxB;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAW,YAAAA,SAAK,WAAW,mBAAmB;AAAA,MAC9C,cAAY,MAAM;AAAA,MACjB,GAAG;AAAA,MACJ,MAAK;AAAA,MACL,OAAO,eAAe,MAAM,KAAK;AAAA,MAEhC;AAAA,cAAM,UAAU,aAAa,4CAAC,yBAAQ;AAAA,QACtC,MAAM;AAAA;AAAA;AAAA,EACT;AAEJ;AAEA,OAAO,cAAc;","names":["clsx"]}
1
+ {"version":3,"sources":["../../../src/lib/status.tsx"],"sourcesContent":["import clsx from \"clsx\";\nimport * as React from \"react\";\nimport { MarginProps } from \"@radix-ui/themes/props\";\nimport { Spinner, Text } from \"@radix-ui/themes\";\n\nexport const getStatusColor = (\n state: \"success\" | \"waiting\" | \"error\",\n): \"green\" | \"gray\" | \"red\" => {\n switch (state) {\n case \"success\":\n return \"green\";\n case \"waiting\":\n return \"gray\";\n case \"error\":\n return \"red\";\n }\n};\n\nexport interface StatusProps\n extends Omit<React.ComponentPropsWithoutRef<\"span\">, \"color\">, MarginProps {\n children?: React.ReactNode;\n state: \"success\" | \"waiting\" | \"error\";\n}\n\nconst Status = React.forwardRef<HTMLSpanElement, StatusProps>(\n ({ className, ...props }, forwardedRef) => (\n <Text\n ref={forwardedRef}\n className={clsx(className, \"woswidgets-status\")}\n data-state={props.state}\n {...props}\n size=\"2\"\n color={getStatusColor(props.state)}\n >\n {props.state === \"waiting\" && <Spinner />}\n {props.children}\n </Text>\n ),\n);\n\nStatus.displayName = \"Status\";\n\nexport { Status };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA0BI;AA1BJ,kBAAiB;AACjB,YAAuB;AAEvB,oBAA8B;AAEvB,MAAM,iBAAiB,CAC5B,UAC6B;AAC7B,UAAQ,OAAO;AAAA,IACb,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,EACX;AACF;AAQA,MAAM,SAAS,MAAM;AAAA,EACnB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,iBACxB;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,eAAW,YAAAA,SAAK,WAAW,mBAAmB;AAAA,MAC9C,cAAY,MAAM;AAAA,MACjB,GAAG;AAAA,MACJ,MAAK;AAAA,MACL,OAAO,eAAe,MAAM,KAAK;AAAA,MAEhC;AAAA,cAAM,UAAU,aAAa,4CAAC,yBAAQ;AAAA,QACtC,MAAM;AAAA;AAAA;AAAA,EACT;AAEJ;AAEA,OAAO,cAAc;","names":["clsx"]}
@@ -33,7 +33,7 @@ __export(users_search_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(users_search_exports);
35
35
  var import_jsx_runtime = require("react/jsx-runtime");
36
- var import_react_compose_refs = require("@radix-ui/react-compose-refs");
36
+ var import_internal = require("radix-ui/internal");
37
37
  var import_react_icons = require("@radix-ui/react-icons");
38
38
  var import_clsx = __toESM(require("clsx"), 1);
39
39
  var React = __toESM(require("react"), 1);
@@ -58,7 +58,7 @@ const UsersSearch = React.forwardRef(
58
58
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
59
59
  import_elements.TextField,
60
60
  {
61
- ref: (0, import_react_compose_refs.useComposedRefs)(inputRef, ref),
61
+ ref: (0, import_internal.useComposedRefs)(inputRef, ref),
62
62
  className: (0, import_clsx.default)((0, import_utils.namespaceClassNames)("users-search"), className),
63
63
  autoComplete: "off",
64
64
  "aria-label": translate({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/users-search.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Cross2Icon, MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport cx from \"clsx\";\nimport * as React from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\nimport { IconButton, TextField, TextFieldSlot } from \"./elements.js\";\nimport { useSearchContext } from \"./search-provider.js\";\nimport { useUsersManagementContext } from \"./users-management-context.js\";\nimport { namespaceClassNames } from \"./utils.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\n\ntype UsersSearchProps = React.ComponentPropsWithoutRef<typeof TextField>;\n\nexport const UsersSearch = React.forwardRef<HTMLInputElement, UsersSearchProps>(\n ({ className, ...props }, ref) => {\n const { inputRef, clearSearch, searchValue, setSearchValue } =\n useSearchContext();\n const { dispatch } = useUsersManagementContext();\n const translate = useTranslation();\n\n const filter = useDebouncedCallback((value) => {\n dispatch({ type: \"FILTER_BY_SEARCH\", searchQuery: value });\n }, 200);\n\n const resetSearch = () => {\n clearSearch();\n filter.cancel();\n };\n\n return (\n <TextField\n ref={useComposedRefs(inputRef, ref)}\n className={cx(namespaceClassNames(\"users-search\"), className)}\n autoComplete=\"off\"\n aria-label={translate({\n defaultMessage: \"User search\",\n id: \"lzPOKv\",\n description: \"Label for the user search input field\",\n })}\n placeholder={translate({\n defaultMessage: \"Search by name or e-mail\",\n id: \"VH4IKy\",\n description: \"Placeholder text for the user search input field\",\n })}\n value={searchValue}\n onChange={(event) => {\n const value = event.target.value;\n setSearchValue(value);\n filter(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n resetSearch();\n }\n }}\n {...props}\n >\n <TextFieldSlot side=\"left\">\n <MagnifyingGlassIcon aria-hidden=\"true\" height=\"16\" width=\"16\" />\n </TextFieldSlot>\n\n <TextFieldSlot side=\"right\">\n {!!searchValue && (\n <IconButton\n size=\"1\"\n onClick={resetSearch}\n title={translate({\n defaultMessage: \"Clear search\",\n id: \"IBozK6\",\n description: \"Tooltip text for the clear search button\",\n })}\n >\n <Cross2Icon aria-hidden=\"true\" />\n </IconButton>\n )}\n </TextFieldSlot>\n </TextField>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCM;AA9BN,gCAAgC;AAChC,yBAAgD;AAChD,kBAAe;AACf,YAAuB;AACvB,0BAAqC;AACrC,sBAAqD;AACrD,6BAAiC;AACjC,sCAA0C;AAC1C,mBAAoC;AACpC,6BAA+B;AAIxB,MAAM,cAAc,MAAM;AAAA,EAC/B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,UAAM,EAAE,UAAU,aAAa,aAAa,eAAe,QACzD,yCAAiB;AACnB,UAAM,EAAE,SAAS,QAAI,2DAA0B;AAC/C,UAAM,gBAAY,uCAAe;AAEjC,UAAM,aAAS,0CAAqB,CAAC,UAAU;AAC7C,eAAS,EAAE,MAAM,oBAAoB,aAAa,MAAM,CAAC;AAAA,IAC3D,GAAG,GAAG;AAEN,UAAM,cAAc,MAAM;AACxB,kBAAY;AACZ,aAAO,OAAO;AAAA,IAChB;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAK,2CAAgB,UAAU,GAAG;AAAA,QAClC,eAAW,YAAAA,aAAG,kCAAoB,cAAc,GAAG,SAAS;AAAA,QAC5D,cAAa;AAAA,QACb,cAAY,UAAU;AAAA,UACpB,gBAAgB;AAAA,UAChB,IAAI;AAAA,UACJ,aAAa;AAAA,QACf,CAAC;AAAA,QACD,aAAa,UAAU;AAAA,UACrB,gBAAgB;AAAA,UAChB,IAAI;AAAA,UACJ,aAAa;AAAA,QACf,CAAC;AAAA,QACD,OAAO;AAAA,QACP,UAAU,CAAC,UAAU;AACnB,gBAAM,QAAQ,MAAM,OAAO;AAC3B,yBAAe,KAAK;AACpB,iBAAO,KAAK;AAAA,QACd;AAAA,QACA,WAAW,CAAC,UAAU;AACpB,cAAI,MAAM,QAAQ,UAAU;AAC1B,kBAAM,eAAe;AACrB,wBAAY;AAAA,UACd;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,sDAAC,iCAAc,MAAK,QAClB,sDAAC,0CAAoB,eAAY,QAAO,QAAO,MAAK,OAAM,MAAK,GACjE;AAAA,UAEA,4CAAC,iCAAc,MAAK,SACjB,WAAC,CAAC,eACD;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS;AAAA,cACT,OAAO,UAAU;AAAA,gBACf,gBAAgB;AAAA,gBAChB,IAAI;AAAA,gBACJ,aAAa;AAAA,cACf,CAAC;AAAA,cAED,sDAAC,iCAAW,eAAY,QAAO;AAAA;AAAA,UACjC,GAEJ;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;","names":["cx"]}
1
+ {"version":3,"sources":["../../../src/lib/users-search.tsx"],"sourcesContent":["\"use client\";\n\nimport { useComposedRefs } from \"radix-ui/internal\";\nimport { Cross2Icon, MagnifyingGlassIcon } from \"@radix-ui/react-icons\";\nimport cx from \"clsx\";\nimport * as React from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\nimport { IconButton, TextField, TextFieldSlot } from \"./elements.js\";\nimport { useSearchContext } from \"./search-provider.js\";\nimport { useUsersManagementContext } from \"./users-management-context.js\";\nimport { namespaceClassNames } from \"./utils.js\";\nimport { useTranslation } from \"./i18n/use-translation.js\";\n\ntype UsersSearchProps = React.ComponentPropsWithoutRef<typeof TextField>;\n\nexport const UsersSearch = React.forwardRef<HTMLInputElement, UsersSearchProps>(\n ({ className, ...props }, ref) => {\n const { inputRef, clearSearch, searchValue, setSearchValue } =\n useSearchContext();\n const { dispatch } = useUsersManagementContext();\n const translate = useTranslation();\n\n const filter = useDebouncedCallback((value) => {\n dispatch({ type: \"FILTER_BY_SEARCH\", searchQuery: value });\n }, 200);\n\n const resetSearch = () => {\n clearSearch();\n filter.cancel();\n };\n\n return (\n <TextField\n ref={useComposedRefs(inputRef, ref)}\n className={cx(namespaceClassNames(\"users-search\"), className)}\n autoComplete=\"off\"\n aria-label={translate({\n defaultMessage: \"User search\",\n id: \"lzPOKv\",\n description: \"Label for the user search input field\",\n })}\n placeholder={translate({\n defaultMessage: \"Search by name or e-mail\",\n id: \"VH4IKy\",\n description: \"Placeholder text for the user search input field\",\n })}\n value={searchValue}\n onChange={(event) => {\n const value = event.target.value;\n setSearchValue(value);\n filter(value);\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n resetSearch();\n }\n }}\n {...props}\n >\n <TextFieldSlot side=\"left\">\n <MagnifyingGlassIcon aria-hidden=\"true\" height=\"16\" width=\"16\" />\n </TextFieldSlot>\n\n <TextFieldSlot side=\"right\">\n {!!searchValue && (\n <IconButton\n size=\"1\"\n onClick={resetSearch}\n title={translate({\n defaultMessage: \"Clear search\",\n id: \"IBozK6\",\n description: \"Tooltip text for the clear search button\",\n })}\n >\n <Cross2Icon aria-hidden=\"true\" />\n </IconButton>\n )}\n </TextFieldSlot>\n </TextField>\n );\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgCM;AA9BN,sBAAgC;AA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,iCAAc,MAAK,SACjB,WAAC,CAAC,eACD;AAAA,YAAC;AAAA;AAAA,cACC,MAAK;AAAA,cACL,SAAS;AAAA,cACT,OAAO,UAAU;AAAA,gBACf,gBAAgB;AAAA,gBAChB,IAAI;AAAA,gBACJ,aAAa;AAAA,cACf,CAAC;AAAA,cAED,sDAAC,iCAAW,eAAY,QAAO;AAAA;AAAA,UACjC,GAEJ;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;","names":["cx"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/organization-switcher.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { ApiProvider, AuthToken, useApiReady } from \"./api/api-provider.js\";\nimport { OrganizationInfo, useOrganizations } from \"./api/endpoint.js\";\nimport * as React from \"react\";\nimport { ErrorBoundary } from \"./lib/error-boundary.js\";\nimport {\n OrganizationSwitcherError,\n OrganizationSwitcherLoading,\n OrganizationSwitcher as OrganizationSwitcherPresentational,\n} from \"./lib/organization-switcher.js\";\nimport type {\n OrganizationSwitcherErrorProps,\n OrganizationSwitcherLoadingProps,\n OrganizationSwitcherPassthroughProps,\n} from \"./lib/organization-switcher.js\";\nimport { useWorkOsApiUrl } from \"./lib/widgets-context.js\";\nimport { keepPreviousData } from \"@tanstack/react-query\";\n\ninterface OrganizationSwitcherProps\n extends OrganizationSwitcherPassthroughProps {\n authToken: AuthToken;\n}\n\nconst OrganizationSwitcher: React.FC<OrganizationSwitcherProps> = ({\n authToken,\n organizationLabel,\n switchToOrganization,\n truncateBehavior,\n variant,\n ...domProps\n}) => {\n const baseUrl = useWorkOsApiUrl();\n\n return (\n <ErrorBoundary\n fallbackRender={({ error }) => (\n <OrganizationSwitcherError\n error={error}\n variant={variant}\n {...domProps}\n />\n )}\n >\n <ApiProvider\n widgetType=\"organization-switcher\"\n authToken={authToken}\n baseUrl={baseUrl}\n >\n <OrganizationSwitcherImpl\n switchToOrganization={switchToOrganization}\n organizationLabel={organizationLabel}\n truncateBehavior={truncateBehavior}\n variant={variant}\n {...domProps}\n />\n </ApiProvider>\n </ErrorBoundary>\n );\n};\n\n// Constant reference to avoid unnecessary prop changes\nconst emptyOrganizations: OrganizationInfo[] = [];\n\nconst OrganizationSwitcherImpl = ({\n variant,\n switchToOrganization,\n organizationLabel,\n truncateBehavior,\n children,\n ...domProps\n}: OrganizationSwitcherPassthroughProps) => {\n const isApiReady = useApiReady();\n const organizationsQuery = useOrganizations({\n query: {\n placeholderData: keepPreviousData,\n },\n });\n\n const organizations = organizationsQuery.data?.data ?? emptyOrganizations;\n\n if (organizationsQuery.isLoading || !isApiReady) {\n return <OrganizationSwitcherLoading variant={variant} {...domProps} />;\n }\n\n if (organizationsQuery.isError) {\n return (\n <OrganizationSwitcherError\n error={organizationsQuery.error}\n variant={variant}\n {...domProps}\n />\n );\n }\n\n return (\n <ErrorBoundary\n fallbackRender={({ error }) => (\n <OrganizationSwitcherError\n error={error}\n variant={variant}\n {...domProps}\n />\n )}\n >\n <OrganizationSwitcherPresentational\n organizations={organizations}\n switchToOrganization={switchToOrganization}\n variant={variant}\n organizationLabel={organizationLabel}\n truncateBehavior={truncateBehavior}\n {...domProps}\n >\n {children}\n </OrganizationSwitcherPresentational>\n </ErrorBoundary>\n );\n};\n\nexport type {\n OrganizationSwitcherProps,\n OrganizationSwitcherLoadingProps,\n OrganizationSwitcherErrorProps,\n};\nexport {\n OrganizationSwitcher,\n OrganizationSwitcherLoading,\n OrganizationSwitcherError,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqCQ;AAnCR,0BAAoD;AACpD,sBAAmD;AAEnD,4BAA8B;AAC9B,mCAIO;AAMP,6BAAgC;AAChC,yBAAiC;AAOjC,MAAM,uBAA4D,CAAC;AAAA,EACjE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,cAAU,wCAAgB;AAEhC,SACE;AAAA,IAAC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{"version":3,"sources":["../../src/organization-switcher.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { ApiProvider, AuthToken, useApiReady } from \"./api/api-provider.js\";\nimport { OrganizationInfo, useOrganizations } from \"./api/endpoint.js\";\nimport * as React from \"react\";\nimport { ErrorBoundary } from \"./lib/error-boundary.js\";\nimport {\n OrganizationSwitcherError,\n OrganizationSwitcherLoading,\n OrganizationSwitcher as OrganizationSwitcherPresentational,\n} from \"./lib/organization-switcher.js\";\nimport type {\n OrganizationSwitcherErrorProps,\n OrganizationSwitcherLoadingProps,\n OrganizationSwitcherPassthroughProps,\n} from \"./lib/organization-switcher.js\";\nimport { useWorkOsApiUrl } from \"./lib/widgets-context.js\";\nimport { keepPreviousData } from \"@tanstack/react-query\";\n\ninterface OrganizationSwitcherProps extends OrganizationSwitcherPassthroughProps {\n authToken: AuthToken;\n}\n\nconst OrganizationSwitcher: React.FC<OrganizationSwitcherProps> = ({\n authToken,\n organizationLabel,\n switchToOrganization,\n truncateBehavior,\n variant,\n ...domProps\n}) => {\n const baseUrl = useWorkOsApiUrl();\n\n return (\n <ErrorBoundary\n fallbackRender={({ error }) => (\n <OrganizationSwitcherError\n error={error}\n variant={variant}\n {...domProps}\n />\n )}\n >\n <ApiProvider\n widgetType=\"organization-switcher\"\n authToken={authToken}\n baseUrl={baseUrl}\n >\n <OrganizationSwitcherImpl\n switchToOrganization={switchToOrganization}\n organizationLabel={organizationLabel}\n truncateBehavior={truncateBehavior}\n variant={variant}\n {...domProps}\n />\n </ApiProvider>\n </ErrorBoundary>\n );\n};\n\n// Constant reference to avoid unnecessary prop changes\nconst emptyOrganizations: OrganizationInfo[] = [];\n\nconst OrganizationSwitcherImpl = ({\n variant,\n switchToOrganization,\n organizationLabel,\n truncateBehavior,\n children,\n ...domProps\n}: OrganizationSwitcherPassthroughProps) => {\n const isApiReady = useApiReady();\n const organizationsQuery = useOrganizations({\n query: {\n placeholderData: keepPreviousData,\n },\n });\n\n const organizations = organizationsQuery.data?.data ?? emptyOrganizations;\n\n if (organizationsQuery.isLoading || !isApiReady) {\n return <OrganizationSwitcherLoading variant={variant} {...domProps} />;\n }\n\n if (organizationsQuery.isError) {\n return (\n <OrganizationSwitcherError\n error={organizationsQuery.error}\n variant={variant}\n {...domProps}\n />\n );\n }\n\n return (\n <ErrorBoundary\n fallbackRender={({ error }) => (\n <OrganizationSwitcherError\n error={error}\n variant={variant}\n {...domProps}\n />\n )}\n >\n <OrganizationSwitcherPresentational\n organizations={organizations}\n switchToOrganization={switchToOrganization}\n variant={variant}\n organizationLabel={organizationLabel}\n truncateBehavior={truncateBehavior}\n {...domProps}\n >\n {children}\n </OrganizationSwitcherPresentational>\n </ErrorBoundary>\n );\n};\n\nexport type {\n OrganizationSwitcherProps,\n OrganizationSwitcherLoadingProps,\n OrganizationSwitcherErrorProps,\n};\nexport {\n OrganizationSwitcher,\n OrganizationSwitcherLoading,\n OrganizationSwitcherError,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCQ;AAlCR,0BAAoD;AACpD,sBAAmD;AAEnD,4BAA8B;AAC9B,mCAIO;AAMP,6BAAgC;AAChC,yBAAiC;AAMjC,MAAM,uBAA4D,CAAC;AAAA,EACjE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,cAAU,wCAAgB;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAgB,CAAC,EAAE,MAAM,MACvB;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,MAGF;AAAA,QAAC;AAAA;AAAA,UACC,YAAW;AAAA,UACX;AAAA,UACA;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA,cACC,GAAG;AAAA;AAAA,UACN;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAGA,MAAM,qBAAyC,CAAC;AAEhD,MAAM,2BAA2B,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAA4C;AAC1C,QAAM,iBAAa,iCAAY;AAC/B,QAAM,yBAAqB,kCAAiB;AAAA,IAC1C,OAAO;AAAA,MACL,iBAAiB;AAAA,IACnB;AAAA,EACF,CAAC;AAED,QAAM,gBAAgB,mBAAmB,MAAM,QAAQ;AAEvD,MAAI,mBAAmB,aAAa,CAAC,YAAY;AAC/C,WAAO,4CAAC,4DAA4B,SAAmB,GAAG,UAAU;AAAA,EACtE;AAEA,MAAI,mBAAmB,SAAS;AAC9B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAO,mBAAmB;AAAA,QAC1B;AAAA,QACC,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,gBAAgB,CAAC,EAAE,MAAM,MACvB;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACC,GAAG;AAAA;AAAA,MACN;AAAA,MAGF;AAAA,QAAC,6BAAAA;AAAA,QAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACC,GAAG;AAAA,UAEH;AAAA;AAAA,MACH;AAAA;AAAA,EACF;AAEJ;","names":["OrganizationSwitcherPresentational"]}
@@ -565,16 +565,16 @@ interface ListOrganizationApiKeyPermissionsResponse {
565
565
  data: ListOrganizationApiKeyPermission[];
566
566
  listMetadata: ListOrganizationApiKeyPermissionsResponseListMetadata;
567
567
  }
568
- type DataInstallationObject = (typeof DataInstallationObject)[keyof typeof DataInstallationObject];
569
568
  declare const DataInstallationObject: {
570
569
  readonly data_installation: "data_installation";
570
+ readonly connected_account: "connected_account";
571
571
  };
572
572
  declare const DataInstallationState: {
573
573
  readonly connected: "connected";
574
574
  readonly needs_reauthorization: "needs_reauthorization";
575
575
  };
576
576
  interface DataInstallation {
577
- object: DataInstallationObject;
577
+ object: (typeof DataInstallationObject)[keyof typeof DataInstallationObject];
578
578
  id: string;
579
579
  /** @nullable */
580
580
  userlandUserId?: string | null;
@@ -592,6 +592,8 @@ declare const DataIntegrationObject: {
592
592
  declare const DataIntegrationIntegrationType: {
593
593
  readonly asana: "asana";
594
594
  readonly box: "box";
595
+ readonly "cal-dot-com": "cal-dot-com";
596
+ readonly calendly: "calendly";
595
597
  readonly confluence: "confluence";
596
598
  readonly dropbox: "dropbox";
597
599
  readonly "frame-io": "frame-io";
@@ -728,6 +730,9 @@ type ResendInvite403 = {
728
730
  type ResendInvite404 = {
729
731
  message: string;
730
732
  };
733
+ type ResendInvite422 = {
734
+ message: string;
735
+ };
731
736
  type RevokeInvite200 = {
732
737
  id: string;
733
738
  success: boolean;
@@ -770,6 +775,9 @@ type UpdateMember403 = {
770
775
  type UpdateMember404 = {
771
776
  message: string;
772
777
  };
778
+ type UpdateMember422 = {
779
+ message: string;
780
+ };
773
781
  type Organizations403 = {
774
782
  message: string;
775
783
  };
@@ -1110,7 +1118,7 @@ declare const useInviteMember: <TError = ErrorType<InviteMember400 | InviteMembe
1110
1118
  data: BodyType<InviteMemberInput>;
1111
1119
  }, TContext>;
1112
1120
  declare const useResendInviteHook: () => (userId: string, signal?: AbortSignal) => Promise<ResendInvite201>;
1113
- declare const useResendInviteMutationOptions: <TError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404>, TContext = unknown>(options?: {
1121
+ declare const useResendInviteMutationOptions: <TError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404 | ResendInvite422>, TContext = unknown>(options?: {
1114
1122
  mutation?: UseMutationOptions<Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>, TError, {
1115
1123
  userId: string;
1116
1124
  }, TContext>;
@@ -1118,8 +1126,8 @@ declare const useResendInviteMutationOptions: <TError = ErrorType<ResendInvite40
1118
1126
  userId: string;
1119
1127
  }, TContext>;
1120
1128
  type ResendInviteMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>>;
1121
- type ResendInviteMutationError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404>;
1122
- declare const useResendInvite: <TError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404>, TContext = unknown>(options?: {
1129
+ type ResendInviteMutationError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404 | ResendInvite422>;
1130
+ declare const useResendInvite: <TError = ErrorType<ResendInvite400 | ResendInvite403 | ResendInvite404 | ResendInvite422>, TContext = unknown>(options?: {
1123
1131
  mutation?: UseMutationOptions<Awaited<ReturnType<ReturnType<typeof useResendInviteHook>>>, TError, {
1124
1132
  userId: string;
1125
1133
  }, TContext>;
@@ -1161,7 +1169,7 @@ declare const useRemoveMember: <TError = ErrorType<RemoveMember400 | RemoveMembe
1161
1169
  userId: string;
1162
1170
  }, TContext>;
1163
1171
  declare const useUpdateMemberHook: () => (userId: string, updateMemberInput: BodyType<UpdateMemberInput>, signal?: AbortSignal) => Promise<UpdateMember200>;
1164
- declare const useUpdateMemberMutationOptions: <TError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404>, TContext = unknown>(options?: {
1172
+ declare const useUpdateMemberMutationOptions: <TError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404 | UpdateMember422>, TContext = unknown>(options?: {
1165
1173
  mutation?: UseMutationOptions<Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>, TError, {
1166
1174
  userId: string;
1167
1175
  data: BodyType<UpdateMemberInput>;
@@ -1172,8 +1180,8 @@ declare const useUpdateMemberMutationOptions: <TError = ErrorType<UpdateMember40
1172
1180
  }, TContext>;
1173
1181
  type UpdateMemberMutationResult = NonNullable<Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>>;
1174
1182
  type UpdateMemberMutationBody = BodyType<UpdateMemberInput>;
1175
- type UpdateMemberMutationError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404>;
1176
- declare const useUpdateMember: <TError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404>, TContext = unknown>(options?: {
1183
+ type UpdateMemberMutationError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404 | UpdateMember422>;
1184
+ declare const useUpdateMember: <TError = ErrorType<UpdateMember400 | UpdateMember403 | UpdateMember404 | UpdateMember422>, TContext = unknown>(options?: {
1177
1185
  mutation?: UseMutationOptions<Awaited<ReturnType<ReturnType<typeof useUpdateMemberHook>>>, TError, {
1178
1186
  userId: string;
1179
1187
  data: BodyType<UpdateMemberInput>;
@@ -1770,4 +1778,4 @@ declare const useDeleteDataInstallation: <TError = ErrorType<DeleteDataInstallat
1770
1778
  installationId: string;
1771
1779
  }, TContext>;
1772
1780
 
1773
- export { type ActiveSession, type ActiveSessionCurrentLocation, type ActiveSessionState, type ActiveSessionsResponse, type AuthenticationInformation403, type AuthenticationInformationQueryError, type AuthenticationInformationQueryResult, type AuthenticationInformationResponse, type AuthenticationInformationResponseData, type AuthenticationInformationResponseDataPasswordSettings, type AuthenticationInformationResponseDataVerificationMethods, type AuthenticationInformationResponseDataVerificationMethodsMfa, AuthenticationInformationResponseDataVerificationMethodsMfaProvider, type AuthenticationInformationResponseDataVerificationMethodsPasskey, type AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem, AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider, type AuthenticationInformationResponseDataVerificationMethodsPassword, AuthenticationInformationResponseDataVerificationMethodsPasswordProvider, type CreateOrganizationApiKey400, type CreateOrganizationApiKey403, type CreateOrganizationApiKey404, type CreateOrganizationApiKey422, type CreateOrganizationApiKey422ErrorsItem, type CreateOrganizationApiKeyMutationBody, type CreateOrganizationApiKeyMutationError, type CreateOrganizationApiKeyMutationResult, type CreateOrganizationApiKeyRequest, type CreateOrganizationApiKeyResponse, type CreatePassword201, type CreatePassword400, type CreatePassword403, type CreatePasswordMutationBody, type CreatePasswordMutationError, type CreatePasswordMutationResult, type CreatePasswordRequest, type CreateTotpFactor400, type CreateTotpFactor403, type CreateTotpFactorMutationError, type CreateTotpFactorMutationResult, type CreateTotpFactorResponse, type CreateTotpFactorResponseAuthenticationChallenge, type CreateTotpFactorResponseAuthenticationChallengeAllOf, CreateTotpFactorResponseAuthenticationChallengeAllOfObject, type CreateTotpFactorResponseAuthenticationChallengeAllOfThree, type CreateTotpFactorResponseAuthenticationFactor, type CreateTotpFactorResponseAuthenticationFactorAllOf, type CreateTotpFactorResponseAuthenticationFactorAllOfEight, CreateTotpFactorResponseAuthenticationFactorAllOfObject, type CreateTotpFactorResponseAuthenticationFactorAllOfSms, type CreateTotpFactorResponseAuthenticationFactorAllOfTotp, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo, CreateTotpFactorResponseAuthenticationFactorAllOfType, type DataInstallation, DataInstallationObject, DataInstallationState, type DataIntegration, DataIntegrationCredentialsType, type DataIntegrationInstallation, DataIntegrationIntegrationType, DataIntegrationObject, DataIntegrationOwnership, type DataIntegrationsResponse, type DeleteDataInstallation200, type DeleteDataInstallation403, type DeleteDataInstallation404, type DeleteDataInstallationMutationError, type DeleteDataInstallationMutationResult, type DeleteOrganizationApiKey200, type DeleteOrganizationApiKey403, type DeleteOrganizationApiKey404, type DeleteOrganizationApiKeyMutationError, type DeleteOrganizationApiKeyMutationResult, type DeleteOrganizationDomain403, type DeleteOrganizationDomain404, type DeleteOrganizationDomainMutationError, type DeleteOrganizationDomainMutationResult, type DeletePasskey200, type DeletePasskey400, type DeletePasskey403, type DeletePasskeyMutationError, type DeletePasskeyMutationResult, type DeleteTotpFactors200, type DeleteTotpFactors400, type DeleteTotpFactors403, type DeleteTotpFactorsMutationError, type DeleteTotpFactorsMutationResult, DomainVerificationNameServer, type GenerateAdminPortalLink201, type GenerateAdminPortalLink403, type GenerateAdminPortalLink404, type GenerateAdminPortalLink500, GenerateAdminPortalLinkIntent, type GenerateAdminPortalLinkMutationError, type GenerateAdminPortalLinkMutationResult, type GenerateAdminPortalLinkParams, type GetAuthorizationStatusResponse, type GetDataInstallationAuthorizationStatus400, type GetDataInstallationAuthorizationStatus403, type GetDataInstallationAuthorizationStatus404, type GetDataInstallationAuthorizationStatusQueryError, type GetDataInstallationAuthorizationStatusQueryResult, type GetDataIntegrationAuthorizeUrl400, type GetDataIntegrationAuthorizeUrl403, type GetDataIntegrationAuthorizeUrl404, type GetDataIntegrationAuthorizeUrlParams, type GetDataIntegrationAuthorizeUrlQueryError, type GetDataIntegrationAuthorizeUrlQueryResult, type GetDataIntegrationAuthorizeUrlResponse, type GetDataIntegrationAuthorizeUrlResponseAllOf, type GetDataIntegrationAuthorizeUrlResponseAllOfTwo, type InviteMember201, type InviteMember400, type InviteMember403, type InviteMember404, type InviteMemberInput, type InviteMemberMutationBody, type InviteMemberMutationError, type InviteMemberMutationResult, type ListMetadata, type ListOrganizationApiKeyPermission, type ListOrganizationApiKeyPermissions400, type ListOrganizationApiKeyPermissions403, type ListOrganizationApiKeyPermissionsParams, type ListOrganizationApiKeyPermissionsQueryError, type ListOrganizationApiKeyPermissionsQueryResult, type ListOrganizationApiKeyPermissionsResponse, type ListOrganizationApiKeyPermissionsResponseListMetadata, type ListOrganizationApiKeys400, type ListOrganizationApiKeys403, type ListOrganizationApiKeysParams, type ListOrganizationApiKeysQueryError, type ListOrganizationApiKeysQueryResult, type ListOrganizationApiKeysResponse, type ListOrganizationApiKeysResponseData, type ListOrganizationApiKeysResponseListMetadata, type ListOrganizationDomains200, type ListOrganizationDomains403, type ListOrganizationDomains404, type ListOrganizationDomainsQueryError, type ListOrganizationDomainsQueryResult, type ListSsoConnectionsQueryError, type ListSsoConnectionsQueryResult, type Me, type Me403, type MeOauthProfiles, type MeQueryError, type MeQueryResult, type Member, type MemberActions, MemberActionsItem, type MemberRole, type MemberRolesItem, MemberStatus, type Members200, type Members403, type Members404, type MembersParams, type MembersQueryError, type MembersQueryResult, type MyDataIntegrations403, type MyDataIntegrationsQueryError, type MyDataIntegrationsQueryResult, type OAuthProfile, OidcSessionState, type OrganizationDomain, OrganizationDomainState, type OrganizationInfo, type Organizations403, type Organizations404, type OrganizationsQueryError, type OrganizationsQueryResult, type OrganizationsResponse, type RegisterPasskey400, type RegisterPasskey403, type RegisterPasskeyMutationError, type RegisterPasskeyMutationResult, type RegisterPasskeyResponse, type RegisterPasskeyResponseOptions, type RemoveMember200, type RemoveMember400, type RemoveMember403, type RemoveMember404, type RemoveMemberMutationError, type RemoveMemberMutationResult, type ResendInvite201, type ResendInvite400, type ResendInvite403, type ResendInvite404, type ResendInviteMutationError, type ResendInviteMutationResult, type ReverifyOrganizationDomain403, type ReverifyOrganizationDomain404, type ReverifyOrganizationDomainMutationError, type ReverifyOrganizationDomainMutationResult, type RevokeAllSessions200, type RevokeAllSessions400, type RevokeAllSessions403, type RevokeAllSessionsMutationBody, type RevokeAllSessionsMutationError, type RevokeAllSessionsMutationResult, type RevokeAllSessionsRequest, type RevokeInvite200, type RevokeInvite400, type RevokeInvite403, type RevokeInvite404, type RevokeInviteMutationError, type RevokeInviteMutationResult, type RevokeSession200, type RevokeSession400, type RevokeSession403, type RevokeSessionMutationError, type RevokeSessionMutationResult, type Roles403, type Roles404, type RolesAndConfig403, type RolesAndConfig404, type RolesAndConfigQueryError, type RolesAndConfigQueryResult, type RolesAndConfigResponse, type RolesQueryError, type RolesQueryResult, SamlSessionState, type SendVerification400, type SendVerification403, type SendVerificationMutationError, type SendVerificationMutationResult, type SendVerificationResponse, SendVerificationResponseType, type Sessions403, type SessionsQueryError, type SessionsQueryResult, type Settings403, type SettingsQueryError, type SettingsQueryResult, type SettingsResponse, SettingsResponseObject, type SsoConnection, type SsoConnectionAnyOf, type SsoConnectionAnyOfEight, type SsoConnectionAnyOfEightAllOf, type SsoConnectionAnyOfEightAllOfLastSession, SsoConnectionAnyOfEightAllOfProviderTag, type SsoConnectionAnyOfEightAllOfSix, SsoConnectionAnyOfEightAllOfState, SsoConnectionAnyOfEightAllOfType, type SsoConnectionAnyOfLastSession, type SsoConnectionAnyOfLatestExpiredCertificate, type SsoConnectionAnyOfLatestExpiringCertificate, SsoConnectionAnyOfProviderTag, SsoConnectionAnyOfState, SsoConnectionAnyOfType, type SsoConnectionSessionJSON, SsoConnectionSessionJSONState, type UpdateMe400, type UpdateMe403, type UpdateMeInput, type UpdateMeMutationBody, type UpdateMeMutationError, type UpdateMeMutationResult, type UpdateMember200, type UpdateMember400, type UpdateMember403, type UpdateMember404, type UpdateMemberInput, type UpdateMemberMutationBody, type UpdateMemberMutationError, type UpdateMemberMutationResult, type UpdatePassword201, type UpdatePassword400, type UpdatePassword403, type UpdatePasswordMutationBody, type UpdatePasswordMutationError, type UpdatePasswordMutationResult, type UpdatePasswordRequest, type Verify400, type Verify403, type VerifyMutationBody, type VerifyMutationError, type VerifyMutationResult, type VerifyPasskey200, type VerifyPasskey400, type VerifyPasskey403, type VerifyPasskeyMutationBody, type VerifyPasskeyMutationError, type VerifyPasskeyMutationResult, type VerifyPasskeyRequest, type VerifyPasskeyRequestResponse, type VerifyRequest, type VerifyResponse, type VerifyTotpFactor200, type VerifyTotpFactor400, type VerifyTotpFactor403, type VerifyTotpFactorMutationBody, type VerifyTotpFactorMutationError, type VerifyTotpFactorMutationResult, type VerifyTotpFactorRequest, type X509CertificateJSON, getAuthenticationInformationQueryKey, getGetDataInstallationAuthorizationStatusQueryKey, getGetDataIntegrationAuthorizeUrlQueryKey, getListOrganizationApiKeyPermissionsQueryKey, getListOrganizationApiKeysQueryKey, getListOrganizationDomainsQueryKey, getListSsoConnectionsQueryKey, getMeQueryKey, getMembersQueryKey, getMyDataIntegrationsQueryKey, getOrganizationsQueryKey, getRolesAndConfigQueryKey, getRolesQueryKey, getSessionsQueryKey, getSettingsQueryKey, useAuthenticationInformation, useAuthenticationInformationHook, useAuthenticationInformationQueryOptions, useCreateOrganizationApiKey, useCreateOrganizationApiKeyHook, useCreateOrganizationApiKeyMutationOptions, useCreatePassword, useCreatePasswordHook, useCreatePasswordMutationOptions, useCreateTotpFactor, useCreateTotpFactorHook, useCreateTotpFactorMutationOptions, useDeleteDataInstallation, useDeleteDataInstallationHook, useDeleteDataInstallationMutationOptions, useDeleteOrganizationApiKey, useDeleteOrganizationApiKeyHook, useDeleteOrganizationApiKeyMutationOptions, useDeleteOrganizationDomain, useDeleteOrganizationDomainHook, useDeleteOrganizationDomainMutationOptions, useDeletePasskey, useDeletePasskeyHook, useDeletePasskeyMutationOptions, useDeleteTotpFactors, useDeleteTotpFactorsHook, useDeleteTotpFactorsMutationOptions, useGenerateAdminPortalLink, useGenerateAdminPortalLinkHook, useGenerateAdminPortalLinkMutationOptions, useGetDataInstallationAuthorizationStatus, useGetDataInstallationAuthorizationStatusHook, useGetDataInstallationAuthorizationStatusQueryOptions, useGetDataIntegrationAuthorizeUrl, useGetDataIntegrationAuthorizeUrlHook, useGetDataIntegrationAuthorizeUrlQueryOptions, useInviteMember, useInviteMemberHook, useInviteMemberMutationOptions, useListOrganizationApiKeyPermissions, useListOrganizationApiKeyPermissionsHook, useListOrganizationApiKeyPermissionsQueryOptions, useListOrganizationApiKeys, useListOrganizationApiKeysHook, useListOrganizationApiKeysQueryOptions, useListOrganizationDomains, useListOrganizationDomainsHook, useListOrganizationDomainsQueryOptions, useListSsoConnections, useListSsoConnectionsHook, useListSsoConnectionsQueryOptions, useMe, useMeHook, useMeQueryOptions, useMembers, useMembersHook, useMembersQueryOptions, useMyDataIntegrations, useMyDataIntegrationsHook, useMyDataIntegrationsQueryOptions, useOrganizations, useOrganizationsHook, useOrganizationsQueryOptions, useRegisterPasskey, useRegisterPasskeyHook, useRegisterPasskeyMutationOptions, useRemoveMember, useRemoveMemberHook, useRemoveMemberMutationOptions, useResendInvite, useResendInviteHook, useResendInviteMutationOptions, useReverifyOrganizationDomain, useReverifyOrganizationDomainHook, useReverifyOrganizationDomainMutationOptions, useRevokeAllSessions, useRevokeAllSessionsHook, useRevokeAllSessionsMutationOptions, useRevokeInvite, useRevokeInviteHook, useRevokeInviteMutationOptions, useRevokeSession, useRevokeSessionHook, useRevokeSessionMutationOptions, useRoles, useRolesAndConfig, useRolesAndConfigHook, useRolesAndConfigQueryOptions, useRolesHook, useRolesQueryOptions, useSendVerification, useSendVerificationHook, useSendVerificationMutationOptions, useSessions, useSessionsHook, useSessionsQueryOptions, useSettings, useSettingsHook, useSettingsQueryOptions, useUpdateMe, useUpdateMeHook, useUpdateMeMutationOptions, useUpdateMember, useUpdateMemberHook, useUpdateMemberMutationOptions, useUpdatePassword, useUpdatePasswordHook, useUpdatePasswordMutationOptions, useVerify, useVerifyHook, useVerifyMutationOptions, useVerifyPasskey, useVerifyPasskeyHook, useVerifyPasskeyMutationOptions, useVerifyTotpFactor, useVerifyTotpFactorHook, useVerifyTotpFactorMutationOptions };
1781
+ export { type ActiveSession, type ActiveSessionCurrentLocation, type ActiveSessionState, type ActiveSessionsResponse, type AuthenticationInformation403, type AuthenticationInformationQueryError, type AuthenticationInformationQueryResult, type AuthenticationInformationResponse, type AuthenticationInformationResponseData, type AuthenticationInformationResponseDataPasswordSettings, type AuthenticationInformationResponseDataVerificationMethods, type AuthenticationInformationResponseDataVerificationMethodsMfa, AuthenticationInformationResponseDataVerificationMethodsMfaProvider, type AuthenticationInformationResponseDataVerificationMethodsPasskey, type AuthenticationInformationResponseDataVerificationMethodsPasskeyPassKeysItem, AuthenticationInformationResponseDataVerificationMethodsPasskeyProvider, type AuthenticationInformationResponseDataVerificationMethodsPassword, AuthenticationInformationResponseDataVerificationMethodsPasswordProvider, type CreateOrganizationApiKey400, type CreateOrganizationApiKey403, type CreateOrganizationApiKey404, type CreateOrganizationApiKey422, type CreateOrganizationApiKey422ErrorsItem, type CreateOrganizationApiKeyMutationBody, type CreateOrganizationApiKeyMutationError, type CreateOrganizationApiKeyMutationResult, type CreateOrganizationApiKeyRequest, type CreateOrganizationApiKeyResponse, type CreatePassword201, type CreatePassword400, type CreatePassword403, type CreatePasswordMutationBody, type CreatePasswordMutationError, type CreatePasswordMutationResult, type CreatePasswordRequest, type CreateTotpFactor400, type CreateTotpFactor403, type CreateTotpFactorMutationError, type CreateTotpFactorMutationResult, type CreateTotpFactorResponse, type CreateTotpFactorResponseAuthenticationChallenge, type CreateTotpFactorResponseAuthenticationChallengeAllOf, CreateTotpFactorResponseAuthenticationChallengeAllOfObject, type CreateTotpFactorResponseAuthenticationChallengeAllOfThree, type CreateTotpFactorResponseAuthenticationFactor, type CreateTotpFactorResponseAuthenticationFactorAllOf, type CreateTotpFactorResponseAuthenticationFactorAllOfEight, CreateTotpFactorResponseAuthenticationFactorAllOfObject, type CreateTotpFactorResponseAuthenticationFactorAllOfSms, type CreateTotpFactorResponseAuthenticationFactorAllOfTotp, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOf, type CreateTotpFactorResponseAuthenticationFactorAllOfTotpAnyOfTwo, CreateTotpFactorResponseAuthenticationFactorAllOfType, type DataInstallation, DataInstallationObject, DataInstallationState, type DataIntegration, DataIntegrationCredentialsType, type DataIntegrationInstallation, DataIntegrationIntegrationType, DataIntegrationObject, DataIntegrationOwnership, type DataIntegrationsResponse, type DeleteDataInstallation200, type DeleteDataInstallation403, type DeleteDataInstallation404, type DeleteDataInstallationMutationError, type DeleteDataInstallationMutationResult, type DeleteOrganizationApiKey200, type DeleteOrganizationApiKey403, type DeleteOrganizationApiKey404, type DeleteOrganizationApiKeyMutationError, type DeleteOrganizationApiKeyMutationResult, type DeleteOrganizationDomain403, type DeleteOrganizationDomain404, type DeleteOrganizationDomainMutationError, type DeleteOrganizationDomainMutationResult, type DeletePasskey200, type DeletePasskey400, type DeletePasskey403, type DeletePasskeyMutationError, type DeletePasskeyMutationResult, type DeleteTotpFactors200, type DeleteTotpFactors400, type DeleteTotpFactors403, type DeleteTotpFactorsMutationError, type DeleteTotpFactorsMutationResult, DomainVerificationNameServer, type GenerateAdminPortalLink201, type GenerateAdminPortalLink403, type GenerateAdminPortalLink404, type GenerateAdminPortalLink500, GenerateAdminPortalLinkIntent, type GenerateAdminPortalLinkMutationError, type GenerateAdminPortalLinkMutationResult, type GenerateAdminPortalLinkParams, type GetAuthorizationStatusResponse, type GetDataInstallationAuthorizationStatus400, type GetDataInstallationAuthorizationStatus403, type GetDataInstallationAuthorizationStatus404, type GetDataInstallationAuthorizationStatusQueryError, type GetDataInstallationAuthorizationStatusQueryResult, type GetDataIntegrationAuthorizeUrl400, type GetDataIntegrationAuthorizeUrl403, type GetDataIntegrationAuthorizeUrl404, type GetDataIntegrationAuthorizeUrlParams, type GetDataIntegrationAuthorizeUrlQueryError, type GetDataIntegrationAuthorizeUrlQueryResult, type GetDataIntegrationAuthorizeUrlResponse, type GetDataIntegrationAuthorizeUrlResponseAllOf, type GetDataIntegrationAuthorizeUrlResponseAllOfTwo, type InviteMember201, type InviteMember400, type InviteMember403, type InviteMember404, type InviteMemberInput, type InviteMemberMutationBody, type InviteMemberMutationError, type InviteMemberMutationResult, type ListMetadata, type ListOrganizationApiKeyPermission, type ListOrganizationApiKeyPermissions400, type ListOrganizationApiKeyPermissions403, type ListOrganizationApiKeyPermissionsParams, type ListOrganizationApiKeyPermissionsQueryError, type ListOrganizationApiKeyPermissionsQueryResult, type ListOrganizationApiKeyPermissionsResponse, type ListOrganizationApiKeyPermissionsResponseListMetadata, type ListOrganizationApiKeys400, type ListOrganizationApiKeys403, type ListOrganizationApiKeysParams, type ListOrganizationApiKeysQueryError, type ListOrganizationApiKeysQueryResult, type ListOrganizationApiKeysResponse, type ListOrganizationApiKeysResponseData, type ListOrganizationApiKeysResponseListMetadata, type ListOrganizationDomains200, type ListOrganizationDomains403, type ListOrganizationDomains404, type ListOrganizationDomainsQueryError, type ListOrganizationDomainsQueryResult, type ListSsoConnectionsQueryError, type ListSsoConnectionsQueryResult, type Me, type Me403, type MeOauthProfiles, type MeQueryError, type MeQueryResult, type Member, type MemberActions, MemberActionsItem, type MemberRole, type MemberRolesItem, MemberStatus, type Members200, type Members403, type Members404, type MembersParams, type MembersQueryError, type MembersQueryResult, type MyDataIntegrations403, type MyDataIntegrationsQueryError, type MyDataIntegrationsQueryResult, type OAuthProfile, OidcSessionState, type OrganizationDomain, OrganizationDomainState, type OrganizationInfo, type Organizations403, type Organizations404, type OrganizationsQueryError, type OrganizationsQueryResult, type OrganizationsResponse, type RegisterPasskey400, type RegisterPasskey403, type RegisterPasskeyMutationError, type RegisterPasskeyMutationResult, type RegisterPasskeyResponse, type RegisterPasskeyResponseOptions, type RemoveMember200, type RemoveMember400, type RemoveMember403, type RemoveMember404, type RemoveMemberMutationError, type RemoveMemberMutationResult, type ResendInvite201, type ResendInvite400, type ResendInvite403, type ResendInvite404, type ResendInvite422, type ResendInviteMutationError, type ResendInviteMutationResult, type ReverifyOrganizationDomain403, type ReverifyOrganizationDomain404, type ReverifyOrganizationDomainMutationError, type ReverifyOrganizationDomainMutationResult, type RevokeAllSessions200, type RevokeAllSessions400, type RevokeAllSessions403, type RevokeAllSessionsMutationBody, type RevokeAllSessionsMutationError, type RevokeAllSessionsMutationResult, type RevokeAllSessionsRequest, type RevokeInvite200, type RevokeInvite400, type RevokeInvite403, type RevokeInvite404, type RevokeInviteMutationError, type RevokeInviteMutationResult, type RevokeSession200, type RevokeSession400, type RevokeSession403, type RevokeSessionMutationError, type RevokeSessionMutationResult, type Roles403, type Roles404, type RolesAndConfig403, type RolesAndConfig404, type RolesAndConfigQueryError, type RolesAndConfigQueryResult, type RolesAndConfigResponse, type RolesQueryError, type RolesQueryResult, SamlSessionState, type SendVerification400, type SendVerification403, type SendVerificationMutationError, type SendVerificationMutationResult, type SendVerificationResponse, SendVerificationResponseType, type Sessions403, type SessionsQueryError, type SessionsQueryResult, type Settings403, type SettingsQueryError, type SettingsQueryResult, type SettingsResponse, SettingsResponseObject, type SsoConnection, type SsoConnectionAnyOf, type SsoConnectionAnyOfEight, type SsoConnectionAnyOfEightAllOf, type SsoConnectionAnyOfEightAllOfLastSession, SsoConnectionAnyOfEightAllOfProviderTag, type SsoConnectionAnyOfEightAllOfSix, SsoConnectionAnyOfEightAllOfState, SsoConnectionAnyOfEightAllOfType, type SsoConnectionAnyOfLastSession, type SsoConnectionAnyOfLatestExpiredCertificate, type SsoConnectionAnyOfLatestExpiringCertificate, SsoConnectionAnyOfProviderTag, SsoConnectionAnyOfState, SsoConnectionAnyOfType, type SsoConnectionSessionJSON, SsoConnectionSessionJSONState, type UpdateMe400, type UpdateMe403, type UpdateMeInput, type UpdateMeMutationBody, type UpdateMeMutationError, type UpdateMeMutationResult, type UpdateMember200, type UpdateMember400, type UpdateMember403, type UpdateMember404, type UpdateMember422, type UpdateMemberInput, type UpdateMemberMutationBody, type UpdateMemberMutationError, type UpdateMemberMutationResult, type UpdatePassword201, type UpdatePassword400, type UpdatePassword403, type UpdatePasswordMutationBody, type UpdatePasswordMutationError, type UpdatePasswordMutationResult, type UpdatePasswordRequest, type Verify400, type Verify403, type VerifyMutationBody, type VerifyMutationError, type VerifyMutationResult, type VerifyPasskey200, type VerifyPasskey400, type VerifyPasskey403, type VerifyPasskeyMutationBody, type VerifyPasskeyMutationError, type VerifyPasskeyMutationResult, type VerifyPasskeyRequest, type VerifyPasskeyRequestResponse, type VerifyRequest, type VerifyResponse, type VerifyTotpFactor200, type VerifyTotpFactor400, type VerifyTotpFactor403, type VerifyTotpFactorMutationBody, type VerifyTotpFactorMutationError, type VerifyTotpFactorMutationResult, type VerifyTotpFactorRequest, type X509CertificateJSON, getAuthenticationInformationQueryKey, getGetDataInstallationAuthorizationStatusQueryKey, getGetDataIntegrationAuthorizeUrlQueryKey, getListOrganizationApiKeyPermissionsQueryKey, getListOrganizationApiKeysQueryKey, getListOrganizationDomainsQueryKey, getListSsoConnectionsQueryKey, getMeQueryKey, getMembersQueryKey, getMyDataIntegrationsQueryKey, getOrganizationsQueryKey, getRolesAndConfigQueryKey, getRolesQueryKey, getSessionsQueryKey, getSettingsQueryKey, useAuthenticationInformation, useAuthenticationInformationHook, useAuthenticationInformationQueryOptions, useCreateOrganizationApiKey, useCreateOrganizationApiKeyHook, useCreateOrganizationApiKeyMutationOptions, useCreatePassword, useCreatePasswordHook, useCreatePasswordMutationOptions, useCreateTotpFactor, useCreateTotpFactorHook, useCreateTotpFactorMutationOptions, useDeleteDataInstallation, useDeleteDataInstallationHook, useDeleteDataInstallationMutationOptions, useDeleteOrganizationApiKey, useDeleteOrganizationApiKeyHook, useDeleteOrganizationApiKeyMutationOptions, useDeleteOrganizationDomain, useDeleteOrganizationDomainHook, useDeleteOrganizationDomainMutationOptions, useDeletePasskey, useDeletePasskeyHook, useDeletePasskeyMutationOptions, useDeleteTotpFactors, useDeleteTotpFactorsHook, useDeleteTotpFactorsMutationOptions, useGenerateAdminPortalLink, useGenerateAdminPortalLinkHook, useGenerateAdminPortalLinkMutationOptions, useGetDataInstallationAuthorizationStatus, useGetDataInstallationAuthorizationStatusHook, useGetDataInstallationAuthorizationStatusQueryOptions, useGetDataIntegrationAuthorizeUrl, useGetDataIntegrationAuthorizeUrlHook, useGetDataIntegrationAuthorizeUrlQueryOptions, useInviteMember, useInviteMemberHook, useInviteMemberMutationOptions, useListOrganizationApiKeyPermissions, useListOrganizationApiKeyPermissionsHook, useListOrganizationApiKeyPermissionsQueryOptions, useListOrganizationApiKeys, useListOrganizationApiKeysHook, useListOrganizationApiKeysQueryOptions, useListOrganizationDomains, useListOrganizationDomainsHook, useListOrganizationDomainsQueryOptions, useListSsoConnections, useListSsoConnectionsHook, useListSsoConnectionsQueryOptions, useMe, useMeHook, useMeQueryOptions, useMembers, useMembersHook, useMembersQueryOptions, useMyDataIntegrations, useMyDataIntegrationsHook, useMyDataIntegrationsQueryOptions, useOrganizations, useOrganizationsHook, useOrganizationsQueryOptions, useRegisterPasskey, useRegisterPasskeyHook, useRegisterPasskeyMutationOptions, useRemoveMember, useRemoveMemberHook, useRemoveMemberMutationOptions, useResendInvite, useResendInviteHook, useResendInviteMutationOptions, useReverifyOrganizationDomain, useReverifyOrganizationDomainHook, useReverifyOrganizationDomainMutationOptions, useRevokeAllSessions, useRevokeAllSessionsHook, useRevokeAllSessionsMutationOptions, useRevokeInvite, useRevokeInviteHook, useRevokeInviteMutationOptions, useRevokeSession, useRevokeSessionHook, useRevokeSessionMutationOptions, useRoles, useRolesAndConfig, useRolesAndConfigHook, useRolesAndConfigQueryOptions, useRolesHook, useRolesQueryOptions, useSendVerification, useSendVerificationHook, useSendVerificationMutationOptions, useSessions, useSessionsHook, useSessionsQueryOptions, useSettings, useSettingsHook, useSettingsQueryOptions, useUpdateMe, useUpdateMeHook, useUpdateMeMutationOptions, useUpdateMember, useUpdateMemberHook, useUpdateMemberMutationOptions, useUpdatePassword, useUpdatePasswordHook, useUpdatePasswordMutationOptions, useVerify, useVerifyHook, useVerifyMutationOptions, useVerifyPasskey, useVerifyPasskeyHook, useVerifyPasskeyMutationOptions, useVerifyTotpFactor, useVerifyTotpFactorHook, useVerifyTotpFactorMutationOptions };
@@ -132,7 +132,8 @@ const SsoConnectionAnyOfEightAllOfProviderTag = {
132
132
  OpenIdConnect: "OpenIdConnect"
133
133
  };
134
134
  const DataInstallationObject = {
135
- data_installation: "data_installation"
135
+ data_installation: "data_installation",
136
+ connected_account: "connected_account"
136
137
  };
137
138
  const DataInstallationState = {
138
139
  connected: "connected",
@@ -144,6 +145,8 @@ const DataIntegrationObject = {
144
145
  const DataIntegrationIntegrationType = {
145
146
  asana: "asana",
146
147
  box: "box",
148
+ "cal-dot-com": "cal-dot-com",
149
+ calendly: "calendly",
147
150
  confluence: "confluence",
148
151
  dropbox: "dropbox",
149
152
  "frame-io": "frame-io",