@kajoo-ai/sitecore-nextjs 19.0.2 → 19.0.3

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 (62) hide show
  1. package/README.md +31 -31
  2. package/dist/cjs/components/button.d.ts +8 -8
  3. package/dist/cjs/components/check-box.d.ts +7 -7
  4. package/dist/cjs/components/container.d.ts +13 -13
  5. package/dist/cjs/components/drop-down/drop-down.d.ts +3 -3
  6. package/dist/cjs/components/drop-down/index.d.ts +1 -1
  7. package/dist/cjs/components/image.d.ts +18 -18
  8. package/dist/cjs/components/kajoo-component/index.d.ts +1 -1
  9. package/dist/cjs/components/kajoo-component/kajoo-component.d.ts +39 -39
  10. package/dist/cjs/components/kajoo-component/services.d.ts +8 -8
  11. package/dist/cjs/components/link.d.ts +11 -11
  12. package/dist/cjs/components/list.d.ts +10 -10
  13. package/dist/cjs/components/radio-button.d.ts +7 -7
  14. package/dist/cjs/components/repeater.d.ts +3 -3
  15. package/dist/cjs/components/rich-text.d.ts +10 -10
  16. package/dist/cjs/components/text-area.d.ts +4 -4
  17. package/dist/cjs/components/text-input.d.ts +4 -4
  18. package/dist/cjs/components/text.d.ts +11 -11
  19. package/dist/cjs/components/toggle/index.d.ts +1 -1
  20. package/dist/cjs/components/toggle/toggle.d.ts +3 -3
  21. package/dist/cjs/components/type-form/index.d.ts +1 -1
  22. package/dist/cjs/components/type-form/type-form.d.ts +3 -3
  23. package/dist/cjs/components/video.d.ts +9 -9
  24. package/dist/cjs/factories/KajooLayoutFactory.d.ts +12 -12
  25. package/dist/cjs/index.d.ts +29 -29
  26. package/dist/cjs/index.js +1 -1
  27. package/dist/cjs/index.js.map +1 -1
  28. package/dist/cjs/toObject.d.ts +2 -2
  29. package/dist/cjs/types.d.ts +3 -3
  30. package/dist/cjs/utils.d.ts +6 -6
  31. package/dist/esm/components/button.d.ts +8 -8
  32. package/dist/esm/components/check-box.d.ts +7 -7
  33. package/dist/esm/components/container.d.ts +13 -13
  34. package/dist/esm/components/drop-down/drop-down.d.ts +3 -3
  35. package/dist/esm/components/drop-down/index.d.ts +1 -1
  36. package/dist/esm/components/image.d.ts +18 -18
  37. package/dist/esm/components/kajoo-component/index.d.ts +1 -1
  38. package/dist/esm/components/kajoo-component/kajoo-component.d.ts +39 -39
  39. package/dist/esm/components/kajoo-component/services.d.ts +8 -8
  40. package/dist/esm/components/link.d.ts +11 -11
  41. package/dist/esm/components/list.d.ts +10 -10
  42. package/dist/esm/components/radio-button.d.ts +7 -7
  43. package/dist/esm/components/repeater.d.ts +3 -3
  44. package/dist/esm/components/rich-text.d.ts +10 -10
  45. package/dist/esm/components/text-area.d.ts +4 -4
  46. package/dist/esm/components/text-input.d.ts +4 -4
  47. package/dist/esm/components/text.d.ts +11 -11
  48. package/dist/esm/components/toggle/index.d.ts +1 -1
  49. package/dist/esm/components/toggle/toggle.d.ts +3 -3
  50. package/dist/esm/components/type-form/index.d.ts +1 -1
  51. package/dist/esm/components/type-form/type-form.d.ts +3 -3
  52. package/dist/esm/components/video.d.ts +9 -9
  53. package/dist/esm/factories/KajooLayoutFactory.d.ts +12 -12
  54. package/dist/esm/index.d.ts +29 -29
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/index.js.map +1 -1
  57. package/dist/esm/toObject.d.ts +2 -2
  58. package/dist/esm/types.d.ts +3 -3
  59. package/dist/esm/utils.d.ts +6 -6
  60. package/dist/index.d.ts +116 -116
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +53 -52
package/README.md CHANGED
@@ -1,31 +1,31 @@
1
- # Introduction
2
-
3
- Kajoo-ai Sitecore Next.js components are a lightweight wrapper around the `@sitecore-jss/sitecore-jss-nextjs` library.
4
-
5
- **Note:** Use a matching version of this package with your project. For example, if your project is using `@sitecore-jss/sitecore-jss-nextjs@v19.x`, then use `@kajoo-ai/sitecore-nextjs@19.x`.
6
-
7
- # Getting Started
8
-
9
- This package requires React and ReactDOM version greater than v17.0.1.
10
-
11
- To install the package, you can use either npm or yarn:
12
-
13
- ```sh
14
- npm install @kajoo-ai/sitecore-nextjs
15
- ```
16
-
17
- or
18
-
19
- ```sh
20
- yarn add @kajoo-ai/sitecore-nextjs
21
- ```
22
-
23
- # Usage
24
-
25
- To import Kajoo Sitecore Next.js components:
26
-
27
- ```js
28
- import { ... } from '@kajoo-ai/sitecore-nextjs';
29
- ```
30
-
31
- Make sure to replace `...` with the specific components you want to import.
1
+ # Introduction
2
+
3
+ Kajoo-ai Sitecore Next.js components are a lightweight wrapper around the `@sitecore-jss/sitecore-jss-nextjs` library.
4
+
5
+ **Note:** Use a matching version of this package with your project. For example, if your project is using `@sitecore-jss/sitecore-jss-nextjs@v19.x`, then use `@kajoo-ai/sitecore-nextjs@19.x`.
6
+
7
+ # Getting Started
8
+
9
+ This package requires React and ReactDOM version greater than v17.0.1.
10
+
11
+ To install the package, you can use either npm or yarn:
12
+
13
+ ```sh
14
+ npm install @kajoo-ai/sitecore-nextjs
15
+ ```
16
+
17
+ or
18
+
19
+ ```sh
20
+ yarn add @kajoo-ai/sitecore-nextjs
21
+ ```
22
+
23
+ # Usage
24
+
25
+ To import Kajoo Sitecore Next.js components:
26
+
27
+ ```js
28
+ import { ... } from '@kajoo-ai/sitecore-nextjs';
29
+ ```
30
+
31
+ Make sure to replace `...` with the specific components you want to import.
@@ -1,8 +1,8 @@
1
- import { FC } from "react";
2
- import { TextField } from "../types";
3
- interface IButton {
4
- text: TextField | string;
5
- [key: string]: unknown;
6
- }
7
- declare const Button: FC<IButton>;
8
- export default Button;
1
+ import { FC } from "react";
2
+ import { TextField } from "../types";
3
+ interface IButton {
4
+ text: TextField | string;
5
+ [key: string]: unknown;
6
+ }
7
+ declare const Button: FC<IButton>;
8
+ export default Button;
@@ -1,7 +1,7 @@
1
- import { FC } from "react";
2
- export interface IProps {
3
- className: string;
4
- [key: string]: unknown;
5
- }
6
- declare const CheckBox: FC<IProps>;
7
- export default CheckBox;
1
+ import { FC } from "react";
2
+ export interface IProps {
3
+ className: string;
4
+ [key: string]: unknown;
5
+ }
6
+ declare const CheckBox: FC<IProps>;
7
+ export default CheckBox;
@@ -1,13 +1,13 @@
1
- import { FC, ComponentType, ReactNode } from 'react';
2
- export interface IProps {
3
- bgImage?: {
4
- value: {
5
- src: string;
6
- };
7
- };
8
- tag?: keyof JSX.IntrinsicElements | ComponentType;
9
- [key: string]: any;
10
- children: ReactNode | ReactNode[];
11
- }
12
- declare const Container: FC<IProps>;
13
- export default Container;
1
+ import { FC, ComponentType, ReactNode } from "react";
2
+ export interface IProps {
3
+ bgImage?: {
4
+ value: {
5
+ src: string;
6
+ };
7
+ };
8
+ tag?: keyof JSX.IntrinsicElements | ComponentType;
9
+ [key: string]: any;
10
+ children: ReactNode | ReactNode[];
11
+ }
12
+ declare const Container: FC<IProps>;
13
+ export default Container;
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- declare const Dropdown: FC<any>;
3
- export default Dropdown;
1
+ import { FC } from 'react';
2
+ declare const Dropdown: FC<any>;
3
+ export default Dropdown;
@@ -1 +1 @@
1
- export { default } from './drop-down';
1
+ export { default } from './drop-down';
@@ -1,18 +1,18 @@
1
- import { FC } from 'react';
2
- interface ImageFieldValue {
3
- [attributeName: string]: unknown;
4
- src?: string;
5
- alt?: string;
6
- }
7
- interface ImageField {
8
- value?: ImageFieldValue;
9
- editable?: string;
10
- }
11
- export interface IProps {
12
- src: ImageField | ImageFieldValue;
13
- alt?: string;
14
- srcSet?: string | any[];
15
- [key: string]: any;
16
- }
17
- declare const Image: FC<IProps>;
18
- export default Image;
1
+ import { FC } from 'react';
2
+ interface ImageFieldValue {
3
+ [attributeName: string]: unknown;
4
+ src?: string;
5
+ alt?: string;
6
+ }
7
+ interface ImageField {
8
+ value?: ImageFieldValue;
9
+ editable?: string;
10
+ }
11
+ export interface IProps {
12
+ src: ImageField | ImageFieldValue;
13
+ alt?: string;
14
+ srcSet?: string | any[];
15
+ [key: string]: any;
16
+ }
17
+ declare const Image: FC<IProps>;
18
+ export default Image;
@@ -1 +1 @@
1
- export { default } from "./kajoo-component";
1
+ export { default } from "./kajoo-component";
@@ -1,39 +1,39 @@
1
- import React from 'react';
2
- import { JsonObject } from 'type-fest';
3
- export interface IProps {
4
- component: ({ fields, children }: React.PropsWithChildren<{
5
- fields: JsonObject;
6
- }>) => JSX.Element;
7
- datasource: IConsciaIntegration | IContentstackIntegration | IKontentAiIntegration;
8
- loadingComponent?: JSX.Element;
9
- errorComponent?: JSX.Element;
10
- emptyComponent?: JSX.Element;
11
- children?: JSX.Element[];
12
- }
13
- export interface IContentstackIntegration {
14
- provider: 'contentstack';
15
- hostUrl?: string;
16
- apiKey: string;
17
- deliveryToken: string;
18
- language?: string;
19
- branch?: string;
20
- environment: string;
21
- contentTypeUid: string;
22
- entryUid: string;
23
- }
24
- export interface IConsciaIntegration {
25
- provider: 'conscia.ai';
26
- hostUrl: string;
27
- customerCode: string;
28
- apiToken: string;
29
- environment: string;
30
- componentCode: string;
31
- }
32
- export interface IKontentAiIntegration {
33
- provider: "kontent.ai";
34
- environmentId: string;
35
- deliveryApiToken: string;
36
- contentItemCodename: string;
37
- }
38
- declare const KajooComponent: (props: IProps) => import("react/jsx-runtime").JSX.Element;
39
- export default KajooComponent;
1
+ import React from 'react';
2
+ import { JsonObject } from 'type-fest';
3
+ export interface IProps {
4
+ component: ({ fields, children }: React.PropsWithChildren<{
5
+ fields: JsonObject;
6
+ }>) => JSX.Element;
7
+ datasource: IConsciaIntegration | IContentstackIntegration | IKontentAiIntegration;
8
+ loadingComponent?: JSX.Element;
9
+ errorComponent?: JSX.Element;
10
+ emptyComponent?: JSX.Element;
11
+ children?: JSX.Element[];
12
+ }
13
+ export interface IContentstackIntegration {
14
+ provider: 'contentstack';
15
+ hostUrl?: string;
16
+ apiKey: string;
17
+ deliveryToken: string;
18
+ language?: string;
19
+ branch?: string;
20
+ environment: string;
21
+ contentTypeUid: string;
22
+ entryUid: string;
23
+ }
24
+ export interface IConsciaIntegration {
25
+ provider: 'conscia.ai';
26
+ hostUrl: string;
27
+ customerCode: string;
28
+ apiToken: string;
29
+ environment: string;
30
+ componentCode: string;
31
+ }
32
+ export interface IKontentAiIntegration {
33
+ provider: "kontent.ai";
34
+ environmentId: string;
35
+ deliveryApiToken: string;
36
+ contentItemCodename: string;
37
+ }
38
+ declare const KajooComponent: (props: IProps) => import("react/jsx-runtime").JSX.Element;
39
+ export default KajooComponent;
@@ -1,8 +1,8 @@
1
- import { IConsciaIntegration, IContentstackIntegration, IKontentAiIntegration } from "./kajoo-component";
2
- export declare const contentstackService: {
3
- getSingleEntry: (datasource: IContentstackIntegration) => Promise<any>;
4
- };
5
- export declare const queryComponent: (datasource: IConsciaIntegration) => Promise<any>;
6
- export declare const kontentAiService: {
7
- getContentItem: (connection: IKontentAiIntegration) => Promise<any>;
8
- };
1
+ import { IConsciaIntegration, IContentstackIntegration, IKontentAiIntegration } from "./kajoo-component";
2
+ export declare const contentstackService: {
3
+ getSingleEntry: (datasource: IContentstackIntegration) => Promise<any>;
4
+ };
5
+ export declare const queryComponent: (datasource: IConsciaIntegration) => Promise<any>;
6
+ export declare const kontentAiService: {
7
+ getContentItem: (connection: IKontentAiIntegration) => Promise<any>;
8
+ };
@@ -1,11 +1,11 @@
1
- import { FC } from "react";
2
- import { Link as SitecoreLink } from "@sitecore-jss/sitecore-jss-nextjs";
3
- import { TextField } from "../types";
4
- type ISitecoreLink = Parameters<typeof SitecoreLink>[0];
5
- interface ILink extends Omit<ISitecoreLink, "field" | "href"> {
6
- text?: TextField | string;
7
- href: ISitecoreLink["field"] | string;
8
- [key: string]: any;
9
- }
10
- declare const Link: FC<ILink>;
11
- export default Link;
1
+ import { FC } from "react";
2
+ import { Link as SitecoreLink } from "@sitecore-jss/sitecore-jss-nextjs";
3
+ import { TextField } from "../types";
4
+ type ISitecoreLink = Parameters<typeof SitecoreLink>[0];
5
+ interface ILink extends Omit<ISitecoreLink, "field" | "href"> {
6
+ text?: TextField | string;
7
+ href: ISitecoreLink["field"] | string;
8
+ [key: string]: any;
9
+ }
10
+ declare const Link: FC<ILink>;
11
+ export default Link;
@@ -1,10 +1,10 @@
1
- import { FC } from "react";
2
- export interface IProps {
3
- list: {
4
- name: string;
5
- displayName: string;
6
- }[];
7
- [key: string]: any;
8
- }
9
- declare const List: FC<IProps>;
10
- export default List;
1
+ import { FC } from "react";
2
+ export interface IProps {
3
+ list: {
4
+ name: string;
5
+ displayName: string;
6
+ }[];
7
+ [key: string]: any;
8
+ }
9
+ declare const List: FC<IProps>;
10
+ export default List;
@@ -1,7 +1,7 @@
1
- import { FC } from "react";
2
- export interface IProps {
3
- className: string;
4
- [key: string]: any;
5
- }
6
- declare const Radiobutton: FC<IProps>;
7
- export default Radiobutton;
1
+ import { FC } from "react";
2
+ export interface IProps {
3
+ className: string;
4
+ [key: string]: any;
5
+ }
6
+ declare const Radiobutton: FC<IProps>;
7
+ export default Radiobutton;
@@ -1,3 +1,3 @@
1
- import { FC } from "react";
2
- declare const Repeater: FC<any>;
3
- export default Repeater;
1
+ import { FC } from "react";
2
+ declare const Repeater: FC<any>;
3
+ export default Repeater;
@@ -1,10 +1,10 @@
1
- import { FC } from "react";
2
- export interface IProps {
3
- value?: {
4
- value?: string;
5
- editable?: string;
6
- } | string;
7
- [key: string]: any;
8
- }
9
- declare const RichText: FC<IProps>;
10
- export default RichText;
1
+ import { FC } from "react";
2
+ export interface IProps {
3
+ value?: {
4
+ value?: string;
5
+ editable?: string;
6
+ } | string;
7
+ [key: string]: any;
8
+ }
9
+ declare const RichText: FC<IProps>;
10
+ export default RichText;
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
2
- export type IProps = JSX.IntrinsicElements["textarea"];
3
- declare const Textarea: FC<IProps>;
4
- export default Textarea;
1
+ import { FC } from "react";
2
+ export type IProps = JSX.IntrinsicElements["textarea"];
3
+ declare const Textarea: FC<IProps>;
4
+ export default Textarea;
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
2
- export type IProps = Omit<JSX.IntrinsicElements["input"], "type">;
3
- declare const Textinput: FC<IProps>;
4
- export default Textinput;
1
+ import { FC } from "react";
2
+ export type IProps = Omit<JSX.IntrinsicElements["input"], "type">;
3
+ declare const Textinput: FC<IProps>;
4
+ export default Textinput;
@@ -1,11 +1,11 @@
1
- import { FC } from 'react';
2
- export interface IProps {
3
- text?: {
4
- value?: string | number;
5
- editable?: string;
6
- } | string;
7
- tag?: keyof JSX.IntrinsicElements;
8
- [key: string]: any;
9
- }
10
- declare const Text: FC<IProps>;
11
- export default Text;
1
+ import { FC } from 'react';
2
+ export interface IProps {
3
+ text?: {
4
+ value?: string | number;
5
+ editable?: string;
6
+ } | string;
7
+ tag?: keyof JSX.IntrinsicElements;
8
+ [key: string]: any;
9
+ }
10
+ declare const Text: FC<IProps>;
11
+ export default Text;
@@ -1 +1 @@
1
- export { default } from './toggle';
1
+ export { default } from './toggle';
@@ -1,3 +1,3 @@
1
- import { FC } from "react";
2
- declare const Toggle: FC<any>;
3
- export default Toggle;
1
+ import { FC } from "react";
2
+ declare const Toggle: FC<any>;
3
+ export default Toggle;
@@ -1 +1 @@
1
- export { default } from './type-form';
1
+ export { default } from './type-form';
@@ -1,3 +1,3 @@
1
- import { FC } from "react";
2
- declare const TypeForm: FC<any>;
3
- export default TypeForm;
1
+ import { FC } from "react";
2
+ declare const TypeForm: FC<any>;
3
+ export default TypeForm;
@@ -1,9 +1,9 @@
1
- import { FC } from "react";
2
- type IVideo = Omit<JSX.IntrinsicElements["video"], "src">;
3
- export interface IProps extends IVideo {
4
- src?: {
5
- url: string;
6
- };
7
- }
8
- declare const Video: FC<IProps>;
9
- export default Video;
1
+ import { FC } from "react";
2
+ type IVideo = Omit<JSX.IntrinsicElements["video"], "src">;
3
+ export interface IProps extends IVideo {
4
+ src?: {
5
+ url: string;
6
+ };
7
+ }
8
+ declare const Video: FC<IProps>;
9
+ export default Video;
@@ -1,12 +1,12 @@
1
- import { RouteData, LayoutServiceData } from "@sitecore-jss/sitecore-jss-nextjs";
2
- import React from "react";
3
- interface ILayoutProps extends RouteData {
4
- layoutData: LayoutServiceData;
5
- }
6
- type ILayout = React.FC<ILayoutProps>;
7
- export declare class KajooLayoutFactory {
8
- private static readonly layoutsByName;
9
- static getLayout: (route: RouteData) => ILayout;
10
- static registerLayout: (name: string, layout: ILayout) => void;
11
- }
12
- export default KajooLayoutFactory;
1
+ import { RouteData, LayoutServiceData } from "@sitecore-jss/sitecore-jss-nextjs";
2
+ import React from "react";
3
+ interface ILayoutProps extends RouteData {
4
+ layoutData: LayoutServiceData;
5
+ }
6
+ type ILayout = React.FC<ILayoutProps>;
7
+ export declare class KajooLayoutFactory {
8
+ private static readonly layoutsByName;
9
+ static getLayout: (route: RouteData) => ILayout;
10
+ static registerLayout: (name: string, layout: ILayout) => void;
11
+ }
12
+ export default KajooLayoutFactory;
@@ -1,29 +1,29 @@
1
- /**
2
- * Exported Components
3
- */
4
- export { default as Button } from "./components/button";
5
- export { default as Checkbox } from "./components/check-box";
6
- export { default as Container } from "./components/container";
7
- export { default as Dropdown } from "./components/drop-down";
8
- export { default as Image } from "./components/image";
9
- export { default as Link } from "./components/link";
10
- export { default as List } from "./components/list";
11
- export { default as Radiobutton } from "./components/radio-button";
12
- export { default as Textarea } from "./components/text-area";
13
- export { default as Textinput } from "./components/text-input";
14
- export { default as Toggle } from "./components/toggle";
15
- export { default as TypeForm } from "./components/type-form";
16
- export { default as Video } from "./components/video";
17
- export { default as Text } from "./components/text";
18
- export { default as RichText } from "./components/rich-text";
19
- export { default as Repeater } from "./components/repeater";
20
- export { default as KajooComponent } from "./components/kajoo-component";
21
- export { default as KajooLayoutFactory } from "./factories/KajooLayoutFactory";
22
- /**
23
- * Exported Types
24
- */
25
- export type { IProps as CheckboxProps } from "./components/check-box";
26
- export type { IProps as RadiobuttonProps } from "./components/radio-button";
27
- export type { IProps as TextareaProps } from "./components/text-area";
28
- export type { IProps as TextinputProps } from "./components/text-input";
29
- export type { IProps as KajooComponentProps } from "./components/kajoo-component/kajoo-component";
1
+ /**
2
+ * Exported Components
3
+ */
4
+ export { default as Button } from "./components/button";
5
+ export { default as Checkbox } from "./components/check-box";
6
+ export { default as Container } from "./components/container";
7
+ export { default as Dropdown } from "./components/drop-down";
8
+ export { default as Image } from "./components/image";
9
+ export { default as Link } from "./components/link";
10
+ export { default as List } from "./components/list";
11
+ export { default as Radiobutton } from "./components/radio-button";
12
+ export { default as Textarea } from "./components/text-area";
13
+ export { default as Textinput } from "./components/text-input";
14
+ export { default as Toggle } from "./components/toggle";
15
+ export { default as TypeForm } from "./components/type-form";
16
+ export { default as Video } from "./components/video";
17
+ export { default as Text } from "./components/text";
18
+ export { default as RichText } from "./components/rich-text";
19
+ export { default as Repeater } from "./components/repeater";
20
+ export { default as KajooComponent } from "./components/kajoo-component";
21
+ export { default as KajooLayoutFactory } from "./factories/KajooLayoutFactory";
22
+ /**
23
+ * Exported Types
24
+ */
25
+ export type { IProps as CheckboxProps } from "./components/check-box";
26
+ export type { IProps as RadiobuttonProps } from "./components/radio-button";
27
+ export type { IProps as TextareaProps } from "./components/text-area";
28
+ export type { IProps as TextinputProps } from "./components/text-input";
29
+ export type { IProps as KajooComponentProps } from "./components/kajoo-component/kajoo-component";
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("@sitecore-jss/sitecore-jss-nextjs"),o=require("@typeform/embed-react"),n=require("react"),r=require("contentstack"),i=function(){return i=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function s(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}function l(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function l(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,l)}a((n=n.apply(e,t||[])).next())}))}function a(e,t){var o,n,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(l){return function(a){return function(l){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&l[0]?n.return:l[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;switch(n=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{o=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,a])}}}"function"==typeof SuppressedError&&SuppressedError;var c=function(e){return void 0===e&&(e={}),"string"==typeof e?d(e):"object"==typeof e?e:{}},d=function(e){void 0===e&&(e="{}");try{return JSON.parse(e)}catch(e){return{}}},u=function(e){var t;try{t="object"==typeof e?e:{value:JSON.parse('"'.concat(e,'"'))}}catch(o){t={value:e}}return t};function p(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var f="drop-down-module_dropbtn__6RDCs",m="drop-down-module_dropdown__UKh7X",y="drop-down-module_dropdownContent__YSmXE";p(".drop-down-module_dropbtn__6RDCs{cursor:pointer}.drop-down-module_dropdown__UKh7X{display:inline-block;position:relative}.drop-down-module_dropdownContent__YSmXE{background-color:#f9f9f9;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;position:absolute;z-index:1}.drop-down-module_dropdownContent__YSmXE span{color:#000;display:block;padding:12px 16px;text-decoration:none}.drop-down-module_dropdownContent__YSmXE span:hover{background-color:#f1f1f1}.drop-down-module_dropdown__UKh7X:hover .drop-down-module_dropdownContent__YSmXE{display:block}");var v=function(e){return"string"!=typeof e?e:e.split(", ").map((function(e){var t=e.split(" ");t[0];var o=t[1];return{w:(null==o?void 0:o.includes("w"))?parseInt(o):null}})).filter((function(e){return!!e.w}))},x="toggle-module_switch__VMi8c",h="toggle-module_input__wSn48",g="toggle-module_round__qn6ng";p('.toggle-module_switch__VMi8c{background-color:#888;display:inline-block;position:relative}.toggle-module_switch__VMi8c .toggle-module_input__wSn48{height:0;opacity:0;width:0}.toggle-module_slider__TOxdr{background-color:#444;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;-webkit-transition:.4s;transition:.4s}.toggle-module_slider__TOxdr:before{background-color:#fff;bottom:5%;content:"";height:90%;left:5%;position:absolute;transition:.4s;width:50%}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr{background-color:#545454}.toggle-module_input__wSn48:focus+.toggle-module_slider__TOxdr{box-shadow:0 0 1px #545454}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr:before{transform:translateX(80%)}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng{border-radius:34px}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng:before{border-radius:50%}');var _="type-form-module_errorContainer__dgVGi",b="type-form-module_errorMessage__z4AgA",j="type-form-module_modeContainer__zJRuI",w="type-form-module_mode__Ond9E";p(".type-form-module_errorContainer__dgVGi p{margin:0}.type-form-module_errorMessage__z4AgA{background-color:rgba(252,132,3,.6);border-radius:6px;margin-bottom:8px;padding:8px}.type-form-module_modeContainer__zJRuI{padding:8px}.type-form-module_mode__Ond9E{border-bottom:1px solid #000;padding-left:8px;padding-right:8px}");var k=["popupButton","sliderButton","widget","popover"],T=function(e){return l(void 0,void 0,void 0,(function(){var t,o,n,i,s,l,c,d;return a(this,(function(a){return t=e.apiKey,o=e.deliveryToken,n=e.environment,i=e.branch,s=e.hostUrl,l=e.contentTypeUid,c=e.entryUid,d=r.Stack({api_key:t,delivery_token:o,environment:n,branch:i}),s&&d.setHost(s),[2,d.ContentType(l).Entry(c).fetch().then((function(e){return e.toJSON()})).catch((function(e){console.log(e)}))]}))}))},C=function(e){return l(void 0,void 0,void 0,(function(){var t,o,n,r;return a(this,(function(i){switch(i.label){case 0:t=null===(r=e.hostUrl)||void 0===r?void 0:r.replace(/\/$/,""),o={method:"POST",body:JSON.stringify({componentCodes:[e.componentCode],context:{}}),headers:{Authorization:"Bearer ".concat(e.apiToken),"X-Customer-Code":e.customerCode,"X-Environment-Code":e.environment,"Content-Type":"application/json"}},i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("".concat(t,"/experience/components/_query"),o)];case 2:return[4,i.sent().json()];case 3:return[2,i.sent()];case 4:return n=i.sent(),console.log(n),[3,5];case 5:return[2]}}))}))},S=function(e){return l(void 0,void 0,void 0,(function(){var t,o,n,r,i,s;return a(this,(function(l){switch(l.label){case 0:t="https://deliver.kontent.ai/".concat(e.environmentId,"/items/").concat(e.contentItemCodename),o={Authorization:"Bearer ".concat(e.deliveryApiToken)},l.label=1;case 1:return l.trys.push([1,4,,5]),[4,fetch(t,{headers:o})];case 2:if(!(n=l.sent()).ok)throw new Error("Error fetching content item: ".concat(n.statusText));return[4,n.json()];case 3:return r=l.sent(),[2,null===(s=r.item)||void 0===s?void 0:s.elements];case 4:throw i=l.sent(),console.error("Error in getContentItem:",i),i;case 5:return[2]}}))}))},O=function(){function e(){}return e.layoutsByName={},e.getLayout=function(t){return e.layoutsByName[t.name]},e.registerLayout=function(t,o){e.layoutsByName[t]=o},e}();exports.Button=function(o){var n=o.text,r=void 0===n?"":n,l=o.children,a=o.style,d=void 0===a?{}:a,p=s(o,["text","children","style"]),f=u(r),m=c(d);return e.jsxs("button",i({},p,{style:m},{children:[e.jsx(t.Text,{field:f}),l]}))},exports.Checkbox=function(t){var o=t.style,n=c(o);return e.jsx("input",i({},t,{type:"checkbox",style:n}))},exports.Container=function(t){var o,n=t.bgImage,r=t.style,l=void 0===r?{}:r,a=t.tag,d=void 0===a?"div":a,u=t.children,p=s(t,["bgImage","style","tag","children"]),f=(null===(o=null==n?void 0:n.value)||void 0===o?void 0:o.src)||(null==n?void 0:n.value)||n,m=c(l),y=i(i({},m),f?{backgroundImage:"url(".concat(f,")")}:{}),v=d;return e.jsx(v,i({},p,{style:y},{children:Array.isArray(u)?u:[u]}))},exports.Dropdown=function(o){var n=o.style,r=c(n);return e.jsxs("div",i({className:"".concat(o.className," ").concat(m),style:r},{children:[e.jsx("button",i({className:f,style:{width:"100%",height:"100%"}},{children:e.jsx(t.Text,{field:o.text,editable:!0,encode:!0})})),e.jsx("div",i({className:y},{children:e.jsx("div",{children:o.list&&o.list.map((function(t,o){return e.jsx("div",{children:e.jsx("span",{children:t.name})},"listItem-"+o)}))})}))]}))},exports.Image=function(o){var n=o.src,r=o.alt,l=o.style,a=void 0===l?{}:l,d=o.srcSet,u=void 0===d?"":d,p=s(o,["src","alt","style","srcSet"]),f="string"==typeof n?{value:{src:n,alt:"string"==typeof r?r:""}}:n,m=v(u),y=c(a);return e.jsx(t.Image,i({},p,{field:f,style:y},m.length?{srcSet:m}:{}))},exports.KajooComponent=function(t){var o=t.component,r=t.datasource,s=t.loadingComponent,c=t.errorComponent,d=t.emptyComponent,u=t.children,p=n.useState(null),f=p[0],m=p[1],y=n.useState(!1),v=y[0],x=y[1],h=n.useState(!1),g=h[0],_=h[1];n.useEffect((function(){if("conscia.ai"===r.provider){l(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,C(r)];case 1:return e=o.sent(),m(e),_(!1),[3,4];case 2:return t=o.sent(),_(!0),console.log(t),[3,4];case 3:return x(!1),[7];case 4:return[2]}}))}))}if("contentstack"===r.provider){l(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,T(r)];case 1:return e=o.sent(),m(e),_(!1),[3,4];case 2:return t=o.sent(),_(!0),console.log(t),[3,4];case 3:return x(!1),[7];case 4:return[2]}}))}))}if("kontent.ai"===r.provider){l(void 0,void 0,void 0,(function(){var e,t;return a(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,S(r)];case 1:return e=o.sent(),m(e),_(!1),[3,4];case 2:return t=o.sent(),_(!0),console.log(t),[3,4];case 3:return x(!1),[7];case 4:return[2]}}))}))}}),[o,r]);var b=o;return v?s||null:g?c||null:f?e.jsx(b,i({fields:f},{children:u})):d||null},exports.KajooLayoutFactory=O,exports.Link=function(o){var n=o.href,r=void 0===n?"#":n,l=o.text,a=void 0===l?"":l,d=o.style,p=void 0===d?{}:d,f=s(o,["href","text","style"]),m=u(a),y="string"==typeof r?{value:{href:r,text:m.value}}:r,v=c(p);return e.jsx(t.Link,i({},f,{field:y,style:v}))},exports.List=function(t){var o=t.list,n=t.style,r=void 0===n?{}:n,l=s(t,["list","style"]),a=c(r);return o?e.jsx("ul",i({},l,{style:a},{children:null==o?void 0:o.map((function(t,o){return e.jsx("li",{children:e.jsx("span",{children:t.name||t.displayName})},"listItem-".concat(o))}))})):null},exports.Radiobutton=function(t){var o=t.style,n=c(o);return e.jsx("input",i({name:"radio"},t,{type:"radio",style:n}))},exports.Repeater=function(t){var o=t.columns,n=void 0===o?3:o,r=t.style,l=void 0===r?{}:r,a=t.children,d=s(t,["columns","style","children"]),u=c(l),p=i(i({},u),{display:"grid",gap:"10px",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))")});return e.jsx("div",i({},d,{style:p},{children:a}))},exports.RichText=function(o){var n=o.value,r=void 0===n?"":n,l=o.style,a=void 0===l?{}:l,d=s(o,["value","style"]),p=u(r),f=c(a);return e.jsx(t.RichText,i({},d,{field:p,style:f}))},exports.Text=function(o){var n=o.text,r=o.children,l=o.tag,a=void 0===l?"span":l,d=o.style,p=void 0===d?{}:d,f=s(o,["text","children","tag","style"]),m=u(n),y=c(p),v=a;return r?e.jsxs(v,i({},f,{style:y},{children:[e.jsx(t.Text,{field:m,tag:a}),Array.isArray(r)?r:[r]]})):e.jsx(t.Text,i({},f,{field:m,tag:a,style:y}))},exports.Textarea=function(t){var o=t.style,n=c(o);return e.jsx("textarea",i({},t,{style:n}))},exports.Textinput=function(t){var o=t.style,n=c(o);return e.jsx("input",i({},t,{type:"text",style:n}))},exports.Toggle=function(t){var o=t.style,n=c(o);return e.jsxs("label",i({className:"".concat(t.className," ").concat(x),style:n},{children:[e.jsx("input",{type:"checkbox",className:h}),e.jsx("span",{className:"".concat(t.slider," ").concat(g)})]}))},exports.TypeForm=function(n){var r=n.formId.value,l=n.mode,a=void 0===l?{}:l,d=n.buttonText,u=n.style,p=void 0===u?{}:u,f=s(n,["formId","mode","buttonText","style"]),m=a.value,y=k.includes(m),v=c(p);return!y&&t.isEditorActive()?e.jsxs("div",i({className:_},{children:[e.jsxs("div",i({className:b},{children:[e.jsx("p",{children:"Please enter a valid mode for type form and click on save."}),e.jsx("p",{children:'Type one of "'.concat(k.join('", "'),'"')})]})),e.jsxs("p",i({className:j},{children:["mode: ",e.jsx(t.Text,{field:a,tag:"span",className:w})]}))]})):"popupButton"===m?e.jsx(o.PopupButton,i({id:r,style:v},f,{children:e.jsx(t.Text,{field:d||"click to open"})})):"popover"===m?e.jsx(o.Sidetab,i({id:r,style:v},f,{buttonText:(null==d?void 0:d.value)||"click to open"})):"widget"===m?e.jsx(o.Widget,i({id:r,style:v},f)):"sliderButton"===m?e.jsx(o.SliderButton,i({id:r,style:v},f,{children:e.jsx(t.Text,{field:d||"click to open"})})):null},exports.Video=function(t){var o=t.src,n=s(t,["src"]),r=n.muted,l=void 0===r?"true":r,a=n.style,d=void 0===a?{}:a,u=s(n,["muted","style"]),p=c(d);return e.jsx("video",i({controls:!0},u,{muted:"true"===l,style:p},{children:e.jsx("source",{src:null==o?void 0:o.url})}))};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("@sitecore-jss/sitecore-jss-nextjs"),o=require("@typeform/embed-react"),n=require("react"),r=require("contentstack"),i=function(){return i=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var r in t=arguments[o])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i.apply(this,arguments)};function s(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}function l(e,t,o,n){return new(o||(o=Promise))((function(r,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function l(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(s,l)}c((n=n.apply(e,t||[])).next())}))}function c(e,t){var o,n,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(l){return function(c){return function(l){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(i=0)),i;)try{if(o=1,n&&(r=2&l[0]?n.return:l[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,l[1])).done)return r;switch(n=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{o=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}"function"==typeof SuppressedError&&SuppressedError;var a=function(e){return void 0===e&&(e={}),"string"==typeof e?d(e):"object"==typeof e?e:{}},d=function(e){void 0===e&&(e="{}");try{return JSON.parse(e)}catch(e){return{}}},u=function(e){var t;try{t="object"==typeof e?e:{value:JSON.parse('"'.concat(e,'"'))}}catch(o){t={value:e}}return t};function p(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}var f="drop-down-module_dropbtn__6RDCs",m="drop-down-module_dropdown__UKh7X",y="drop-down-module_dropdownContent__YSmXE";p(".drop-down-module_dropbtn__6RDCs{cursor:pointer}.drop-down-module_dropdown__UKh7X{display:inline-block;position:relative}.drop-down-module_dropdownContent__YSmXE{background-color:#f9f9f9;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);display:none;position:absolute;z-index:1}.drop-down-module_dropdownContent__YSmXE span{color:#000;display:block;padding:12px 16px;text-decoration:none}.drop-down-module_dropdownContent__YSmXE span:hover{background-color:#f1f1f1}.drop-down-module_dropdown__UKh7X:hover .drop-down-module_dropdownContent__YSmXE{display:block}");var v=function(e){return"string"!=typeof e?e:e.split(", ").map((function(e){var t=e.split(" ");t[0];var o=t[1];return{w:(null==o?void 0:o.includes("w"))?parseInt(o):null}})).filter((function(e){return!!e.w}))},x="toggle-module_switch__VMi8c",h="toggle-module_input__wSn48",g="toggle-module_round__qn6ng";p('.toggle-module_switch__VMi8c{background-color:#888;display:inline-block;position:relative}.toggle-module_switch__VMi8c .toggle-module_input__wSn48{height:0;opacity:0;width:0}.toggle-module_slider__TOxdr{background-color:#444;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;-webkit-transition:.4s;transition:.4s}.toggle-module_slider__TOxdr:before{background-color:#fff;bottom:5%;content:"";height:90%;left:5%;position:absolute;transition:.4s;width:50%}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr{background-color:#545454}.toggle-module_input__wSn48:focus+.toggle-module_slider__TOxdr{box-shadow:0 0 1px #545454}.toggle-module_input__wSn48:checked+.toggle-module_slider__TOxdr:before{transform:translateX(80%)}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng{border-radius:34px}.toggle-module_slider__TOxdr.toggle-module_round__qn6ng:before{border-radius:50%}');var _="type-form-module_errorContainer__dgVGi",b="type-form-module_errorMessage__z4AgA",j="type-form-module_modeContainer__zJRuI",w="type-form-module_mode__Ond9E";p(".type-form-module_errorContainer__dgVGi p{margin:0}.type-form-module_errorMessage__z4AgA{background-color:rgba(252,132,3,.6);border-radius:6px;margin-bottom:8px;padding:8px}.type-form-module_modeContainer__zJRuI{padding:8px}.type-form-module_mode__Ond9E{border-bottom:1px solid #000;padding-left:8px;padding-right:8px}");var k=["popupButton","sliderButton","widget","popover"],T=function(e){return l(void 0,void 0,void 0,(function(){var t,o,n,i,s,l,a,d;return c(this,(function(c){return t=e.apiKey,o=e.deliveryToken,n=e.environment,i=e.branch,s=e.hostUrl,l=e.contentTypeUid,a=e.entryUid,d=r.Stack({api_key:t,delivery_token:o,environment:n,branch:i}),s&&d.setHost(s),[2,d.ContentType(l).Entry(a).fetch().then((function(e){return e.toJSON()})).catch((function(e){console.log(e)}))]}))}))},C=function(e){return l(void 0,void 0,void 0,(function(){var t,o,n,r;return c(this,(function(i){switch(i.label){case 0:t=null===(r=e.hostUrl)||void 0===r?void 0:r.replace(/\/$/,""),o={method:"POST",body:JSON.stringify({componentCodes:[e.componentCode],context:{}}),headers:{Authorization:"Bearer ".concat(e.apiToken),"X-Customer-Code":e.customerCode,"X-Environment-Code":e.environment,"Content-Type":"application/json"}},i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch("".concat(t,"/experience/components/_query"),o)];case 2:return[4,i.sent().json()];case 3:return[2,i.sent()];case 4:return n=i.sent(),console.log(n),[3,5];case 5:return[2]}}))}))},S=function(e){return l(void 0,void 0,void 0,(function(){var t,o,n,r,i,s;return c(this,(function(l){switch(l.label){case 0:t="https://deliver.kontent.ai/".concat(e.environmentId,"/items/").concat(e.contentItemCodename),o={Authorization:"Bearer ".concat(e.deliveryApiToken)},l.label=1;case 1:return l.trys.push([1,4,,5]),[4,fetch(t,{headers:o})];case 2:if(!(n=l.sent()).ok)throw new Error("Error fetching content item: ".concat(n.statusText));return[4,n.json()];case 3:return r=l.sent(),[2,null===(s=r.item)||void 0===s?void 0:s.elements];case 4:throw i=l.sent(),console.error("Error in getContentItem:",i),i;case 5:return[2]}}))}))},O=function(){function e(){}return e.layoutsByName={},e.getLayout=function(t){return e.layoutsByName[t.name]},e.registerLayout=function(t,o){e.layoutsByName[t]=o},e}();exports.Button=function(o){var n=o.text,r=void 0===n?"":n,l=o.children,c=o.style,d=void 0===c?{}:c,p=s(o,["text","children","style"]),f=u(r),m=a(d);return e.jsxs("button",i({},p,{style:m},{children:[e.jsx(t.Text,{field:f}),l]}))},exports.Checkbox=function(t){var o=t.style,n=a(o);return e.jsx("input",i({},t,{type:"checkbox",style:n}))},exports.Container=function(t){var o,n=t.bgImage,r=t.style,l=void 0===r?{}:r,c=t.tag,d=void 0===c?"div":c,u=t.children,p=s(t,["bgImage","style","tag","children"]),f=(null===(o=null==n?void 0:n.value)||void 0===o?void 0:o.src)||(null==n?void 0:n.value)||n,m=a(l),y=i(i({},m),f?{backgroundImage:"url(".concat(f,")")}:{}),v=d;return e.jsx(v,i({},p,{style:y},{children:null!=u?u:null}))},exports.Dropdown=function(o){var n=o.style,r=a(n);return e.jsxs("div",i({className:"".concat(o.className," ").concat(m),style:r},{children:[e.jsx("button",i({className:f,style:{width:"100%",height:"100%"}},{children:e.jsx(t.Text,{field:o.text,editable:!0,encode:!0})})),e.jsx("div",i({className:y},{children:e.jsx("div",{children:o.list&&o.list.map((function(t,o){return e.jsx("div",{children:e.jsx("span",{children:t.name})},"listItem-"+o)}))})}))]}))},exports.Image=function(o){var n=o.src,r=o.alt,l=o.style,c=void 0===l?{}:l,d=o.srcSet,u=void 0===d?"":d,p=s(o,["src","alt","style","srcSet"]),f="string"==typeof n?{value:{src:n,alt:"string"==typeof r?r:""}}:n,m=v(u),y=a(c);return e.jsx(t.Image,i({},p,{field:f,style:y},m.length?{srcSet:m}:{}))},exports.KajooComponent=function(t){var o=t.component,r=t.datasource,s=t.loadingComponent,a=t.errorComponent,d=t.emptyComponent,u=t.children,p=n.useState(null),f=p[0],m=p[1],y=n.useState(!1),v=y[0],x=y[1],h=n.useState(!1),g=h[0],_=h[1];n.useEffect((function(){if("conscia.ai"===r.provider){l(void 0,void 0,void 0,(function(){var e,t;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,C(r)];case 1:return e=o.sent(),m(e),_(!1),[3,4];case 2:return t=o.sent(),_(!0),console.log(t),[3,4];case 3:return x(!1),[7];case 4:return[2]}}))}))}if("contentstack"===r.provider){l(void 0,void 0,void 0,(function(){var e,t;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,T(r)];case 1:return e=o.sent(),m(e),_(!1),[3,4];case 2:return t=o.sent(),_(!0),console.log(t),[3,4];case 3:return x(!1),[7];case 4:return[2]}}))}))}if("kontent.ai"===r.provider){l(void 0,void 0,void 0,(function(){var e,t;return c(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,S(r)];case 1:return e=o.sent(),m(e),_(!1),[3,4];case 2:return t=o.sent(),_(!0),console.log(t),[3,4];case 3:return x(!1),[7];case 4:return[2]}}))}))}}),[o,r]);var b=o;return v?s||null:g?a||null:f?e.jsx(b,i({fields:f},{children:u})):d||null},exports.KajooLayoutFactory=O,exports.Link=function(o){var n=o.href,r=void 0===n?"#":n,l=o.text,c=void 0===l?"":l,d=o.style,p=void 0===d?{}:d,f=s(o,["href","text","style"]),m=u(c),y="string"==typeof r?{value:{href:r,text:m.value}}:r,v=a(p);return e.jsx(t.Link,i({},f,{field:y,style:v}))},exports.List=function(t){var o=t.list,n=t.style,r=void 0===n?{}:n,l=s(t,["list","style"]),c=a(r);return o?e.jsx("ul",i({},l,{style:c},{children:null==o?void 0:o.map((function(t,o){return e.jsx("li",{children:e.jsx("span",{children:t.name||t.displayName})},"listItem-".concat(o))}))})):null},exports.Radiobutton=function(t){var o=t.style,n=a(o);return e.jsx("input",i({name:"radio"},t,{type:"radio",style:n}))},exports.Repeater=function(t){var o=t.columns,n=void 0===o?3:o,r=t.style,l=void 0===r?{}:r,c=t.children,d=s(t,["columns","style","children"]),u=a(l),p=i(i({},u),{display:"grid",gap:"10px",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))")});return e.jsx("div",i({},d,{style:p},{children:c}))},exports.RichText=function(o){var n=o.value,r=void 0===n?"":n,l=o.style,c=void 0===l?{}:l,d=s(o,["value","style"]),p=u(r),f=a(c);return e.jsx(t.RichText,i({},d,{field:p,style:f}))},exports.Text=function(o){var n=o.text,r=o.children,l=o.tag,c=void 0===l?"span":l,d=o.style,p=void 0===d?{}:d,f=s(o,["text","children","tag","style"]),m=u(n),y=a(p),v=c;return r?e.jsxs(v,i({},f,{style:y},{children:[e.jsx(t.Text,{field:m,tag:c}),Array.isArray(r)?r:[r]]})):e.jsx(t.Text,i({},f,{field:m,tag:c,style:y}))},exports.Textarea=function(t){var o=t.style,n=a(o);return e.jsx("textarea",i({},t,{style:n}))},exports.Textinput=function(t){var o=t.style,n=a(o);return e.jsx("input",i({},t,{type:"text",style:n}))},exports.Toggle=function(t){var o=t.style,n=a(o);return e.jsxs("label",i({className:"".concat(t.className," ").concat(x),style:n},{children:[e.jsx("input",{type:"checkbox",className:h}),e.jsx("span",{className:"".concat(t.slider," ").concat(g)})]}))},exports.TypeForm=function(n){var r=n.formId.value,l=n.mode,c=void 0===l?{}:l,d=n.buttonText,u=n.style,p=void 0===u?{}:u,f=s(n,["formId","mode","buttonText","style"]),m=c.value,y=k.includes(m),v=a(p);return!y&&t.isEditorActive()?e.jsxs("div",i({className:_},{children:[e.jsxs("div",i({className:b},{children:[e.jsx("p",{children:"Please enter a valid mode for type form and click on save."}),e.jsx("p",{children:'Type one of "'.concat(k.join('", "'),'"')})]})),e.jsxs("p",i({className:j},{children:["mode: ",e.jsx(t.Text,{field:c,tag:"span",className:w})]}))]})):"popupButton"===m?e.jsx(o.PopupButton,i({id:r,style:v},f,{children:e.jsx(t.Text,{field:d||"click to open"})})):"popover"===m?e.jsx(o.Sidetab,i({id:r,style:v},f,{buttonText:(null==d?void 0:d.value)||"click to open"})):"widget"===m?e.jsx(o.Widget,i({id:r,style:v},f)):"sliderButton"===m?e.jsx(o.SliderButton,i({id:r,style:v},f,{children:e.jsx(t.Text,{field:d||"click to open"})})):null},exports.Video=function(t){var o=t.src,n=s(t,["src"]),r=n.muted,l=void 0===r?"true":r,c=n.style,d=void 0===c?{}:c,u=s(n,["muted","style"]),p=a(d);return e.jsx("video",i({controls:!0},u,{muted:"true"===l,style:p},{children:e.jsx("source",{src:null==o?void 0:o.url})}))};
2
2
  //# sourceMappingURL=index.js.map