@kajoo-ai/sitecore-nextjs 0.0.25 → 18.0.0

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 -15
  2. package/dist/cjs/components/button.d.ts +8 -9
  3. package/dist/cjs/components/check-box.d.ts +7 -8
  4. package/dist/cjs/components/container.d.ts +13 -13
  5. package/dist/cjs/components/drop-down/drop-down.d.ts +3 -4
  6. package/dist/cjs/components/drop-down/index.d.ts +1 -1
  7. package/dist/cjs/components/image.d.ts +18 -20
  8. package/dist/cjs/components/kajoo-component/index.d.ts +1 -1
  9. package/dist/cjs/components/kajoo-component/kajoo-component.d.ts +33 -34
  10. package/dist/cjs/components/kajoo-component/services.d.ts +5 -5
  11. package/dist/cjs/components/link.d.ts +11 -12
  12. package/dist/cjs/components/list.d.ts +10 -11
  13. package/dist/cjs/components/radio-button.d.ts +7 -8
  14. package/dist/cjs/components/repeater.d.ts +3 -4
  15. package/dist/cjs/components/rich-text.d.ts +10 -11
  16. package/dist/cjs/components/text-area.d.ts +4 -5
  17. package/dist/cjs/components/text-input.d.ts +4 -5
  18. package/dist/cjs/components/text.d.ts +11 -12
  19. package/dist/cjs/components/toggle/index.d.ts +1 -1
  20. package/dist/cjs/components/toggle/toggle.d.ts +3 -4
  21. package/dist/cjs/components/type-form/index.d.ts +1 -1
  22. package/dist/cjs/components/type-form/type-form.d.ts +3 -4
  23. package/dist/cjs/components/video.d.ts +9 -10
  24. package/dist/cjs/factories/KajooLayoutFactory.d.ts +12 -13
  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 -4
  30. package/dist/cjs/utils.d.ts +6 -6
  31. package/dist/esm/components/button.d.ts +8 -9
  32. package/dist/esm/components/check-box.d.ts +7 -8
  33. package/dist/esm/components/container.d.ts +13 -13
  34. package/dist/esm/components/drop-down/drop-down.d.ts +3 -4
  35. package/dist/esm/components/drop-down/index.d.ts +1 -1
  36. package/dist/esm/components/image.d.ts +18 -20
  37. package/dist/esm/components/kajoo-component/index.d.ts +1 -1
  38. package/dist/esm/components/kajoo-component/kajoo-component.d.ts +33 -34
  39. package/dist/esm/components/kajoo-component/services.d.ts +5 -5
  40. package/dist/esm/components/link.d.ts +11 -12
  41. package/dist/esm/components/list.d.ts +10 -11
  42. package/dist/esm/components/radio-button.d.ts +7 -8
  43. package/dist/esm/components/repeater.d.ts +3 -4
  44. package/dist/esm/components/rich-text.d.ts +10 -11
  45. package/dist/esm/components/text-area.d.ts +4 -5
  46. package/dist/esm/components/text-input.d.ts +4 -5
  47. package/dist/esm/components/text.d.ts +11 -12
  48. package/dist/esm/components/toggle/index.d.ts +1 -1
  49. package/dist/esm/components/toggle/toggle.d.ts +3 -4
  50. package/dist/esm/components/type-form/index.d.ts +1 -1
  51. package/dist/esm/components/type-form/type-form.d.ts +3 -4
  52. package/dist/esm/components/video.d.ts +9 -10
  53. package/dist/esm/factories/KajooLayoutFactory.d.ts +12 -13
  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 -4
  59. package/dist/esm/utils.d.ts +6 -6
  60. package/dist/index.d.ts +115 -114
  61. package/dist/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +4 -3
package/README.md CHANGED
@@ -1,15 +1,31 @@
1
- # Introduction
2
-
3
- This project is an npm package for Kajoo & Kajoo Sitecore components.
4
-
5
- # Getting Started
6
-
7
- _This package requires React & ReactDOM greater than v17.0.1_
8
-
9
- `npm install `
10
-
11
- `yarn add`
12
-
13
- # Usage
14
-
15
- To import kajoo-sitecore-nextjs components: `import { ... } from '@kajoo-ai/sitecore-nextjs`
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@v18.x`, then use `@kajoo-ai/sitecore-nextjs@18.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,9 +1,8 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- import { TextField } from "../types";
4
- interface IButton {
5
- text: TextField | string;
6
- [key: string]: unknown;
7
- }
8
- declare const Button: FC<IButton>;
9
- 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,8 +1,7 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export interface IProps {
4
- className: string;
5
- [key: string]: unknown;
6
- }
7
- declare const CheckBox: FC<IProps>;
8
- 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
- /// <reference types="@types/react" />
2
- import { FC, ComponentType } from "react";
3
- export interface IProps {
4
- bgImage?: {
5
- value: {
6
- src: string;
7
- };
8
- };
9
- tag?: keyof JSX.IntrinsicElements | ComponentType;
10
- [key: string]: any;
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,4 +1,3 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- declare const Dropdown: FC<any>;
4
- 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,20 +1,18 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from 'react';
3
- import { ImageSizeParameters } from '@sitecore-jss/sitecore-jss-nextjs';
4
- interface ImageFieldValue {
5
- [attributeName: string]: unknown;
6
- src?: string;
7
- alt?: string;
8
- }
9
- interface ImageField {
10
- value?: ImageFieldValue;
11
- editable?: string;
12
- }
13
- export interface IProps {
14
- src: ImageField | ImageFieldValue;
15
- alt?: string;
16
- srcSet?: string | ImageSizeParameters[];
17
- [key: string]: any;
18
- }
19
- declare const Image: FC<IProps>;
20
- 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,34 +1,33 @@
1
- /// <reference types="@types/react" />
2
- import React from 'react';
3
- import { JsonObject } from 'type-fest';
4
- export interface IProps {
5
- component: ({ fields, children }: React.PropsWithChildren<{
6
- fields: JsonObject;
7
- }>) => JSX.Element;
8
- datasource: IConsciaIntegration | IContentstackIntegration;
9
- loadingComponent?: JSX.Element;
10
- errorComponent?: JSX.Element;
11
- emptyComponent?: JSX.Element;
12
- children?: JSX.Element[];
13
- }
14
- export interface IContentstackIntegration {
15
- provider: 'contentstack';
16
- hostUrl?: string;
17
- apiKey: string;
18
- deliveryToken: string;
19
- language?: string;
20
- branch?: string;
21
- environment: string;
22
- contentTypeUid: string;
23
- entryUid: string;
24
- }
25
- export interface IConsciaIntegration {
26
- provider: 'conscia.ai';
27
- hostUrl: string;
28
- customerCode: string;
29
- apiToken: string;
30
- environment: string;
31
- componentCode: string;
32
- }
33
- declare const KajooComponent: (props: IProps) => JSX.Element;
34
- 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;
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
+ declare const KajooComponent: (props: IProps) => import("react/jsx-runtime").JSX.Element;
33
+ export default KajooComponent;
@@ -1,5 +1,5 @@
1
- import { IConsciaIntegration, IContentstackIntegration } from "./kajoo-component";
2
- export declare const contentstackService: {
3
- getSingleEntry: (datasource: IContentstackIntegration) => Promise<any>;
4
- };
5
- export declare const queryComponent: (datasource: IConsciaIntegration) => Promise<any>;
1
+ import { IConsciaIntegration, IContentstackIntegration } from "./kajoo-component";
2
+ export declare const contentstackService: {
3
+ getSingleEntry: (datasource: IContentstackIntegration) => Promise<any>;
4
+ };
5
+ export declare const queryComponent: (datasource: IConsciaIntegration) => Promise<any>;
@@ -1,12 +1,11 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- import { Link as SitecoreLink } from "@sitecore-jss/sitecore-jss-nextjs";
4
- import { TextField } from "../types";
5
- type ISitecoreLink = Parameters<typeof SitecoreLink>[0];
6
- interface ILink extends Omit<ISitecoreLink, "field" | "href"> {
7
- text?: TextField | string;
8
- href: ISitecoreLink["field"] | string;
9
- [key: string]: any;
10
- }
11
- declare const Link: FC<ILink>;
12
- 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,11 +1,10 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export interface IProps {
4
- list: {
5
- name: string;
6
- displayName: string;
7
- }[];
8
- [key: string]: any;
9
- }
10
- declare const List: FC<IProps>;
11
- 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,8 +1,7 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export interface IProps {
4
- className: string;
5
- [key: string]: any;
6
- }
7
- declare const Radiobutton: FC<IProps>;
8
- 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,4 +1,3 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- declare const Repeater: FC<any>;
4
- export default Repeater;
1
+ import { FC } from "react";
2
+ declare const Repeater: FC<any>;
3
+ export default Repeater;
@@ -1,11 +1,10 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export interface IProps {
4
- value?: {
5
- value?: string;
6
- editable?: string;
7
- } | string;
8
- [key: string]: any;
9
- }
10
- declare const RichText: FC<IProps>;
11
- 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,5 +1,4 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export type IProps = JSX.IntrinsicElements["textarea"];
4
- declare const Textarea: FC<IProps>;
5
- 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,5 +1,4 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export type IProps = Omit<JSX.IntrinsicElements["input"], "type">;
4
- declare const Textinput: FC<IProps>;
5
- 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,12 +1,11 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- export interface IProps {
4
- text?: {
5
- value?: string | number;
6
- editable?: string;
7
- } | string;
8
- tag?: keyof JSX.IntrinsicElements;
9
- [key: string]: any;
10
- }
11
- declare const Text: FC<IProps>;
12
- 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,4 +1,3 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- declare const Toggle: FC<any>;
4
- 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,4 +1,3 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- declare const TypeForm: FC<any>;
4
- export default TypeForm;
1
+ import { FC } from 'react';
2
+ declare const TypeForm: FC<any>;
3
+ export default TypeForm;
@@ -1,10 +1,9 @@
1
- /// <reference types="@types/react" />
2
- import { FC } from "react";
3
- type IVideo = Omit<JSX.IntrinsicElements["video"], "src">;
4
- export interface IProps extends IVideo {
5
- src?: {
6
- url: string;
7
- };
8
- }
9
- declare const Video: FC<IProps>;
10
- 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,13 +1,12 @@
1
- /// <reference types="@types/react" />
2
- import { RouteData, LayoutServiceData } from "@sitecore-jss/sitecore-jss-nextjs";
3
- import React from "react";
4
- interface ILayoutProps extends RouteData {
5
- layoutData: LayoutServiceData;
6
- }
7
- type ILayout = React.FC<ILayoutProps>;
8
- export declare class KajooLayoutFactory {
9
- private static readonly layoutsByName;
10
- static getLayout: (route: RouteData) => ILayout;
11
- static registerLayout: (name: string, layout: ILayout) => void;
12
- }
13
- 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("@sitecore-jss/sitecore-jss-nextjs/utils"),r=require("react"),i=require("contentstack"),l=function(){return l=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},l.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 d(e,t,o,n){return new(o||(o=Promise))((function(r,i){function l(e){try{d(n.next(e))}catch(e){i(e)}}function s(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,s)}d((n=n.apply(e,t||[])).next())}))}function a(e,t){var o,n,r,i,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(d){return function(s){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(l=0)),l;)try{if(o=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,n=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=t.call(e,l)}catch(e){s=[6,e],n=0}finally{o=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}"function"==typeof SuppressedError&&SuppressedError;var c=function(e){return void 0===e&&(e={}),"string"==typeof e?u(e):"object"==typeof e?e:{}},u=function(e){void 0===e&&(e="{}");try{return JSON.parse(e)}catch(e){return{}}},p=function(e){var t;try{t="object"==typeof e?e:{value:JSON.parse('"'.concat(e,'"'))}}catch(o){t={value:e}}return t};function f(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 m="drop-down-module_dropbtn__6RDCs",y="drop-down-module_dropdown__UKh7X",v="drop-down-module_dropdownContent__YSmXE";f(".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 x=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}))},h="toggle-module_switch__VMi8c",g="toggle-module_input__wSn48",_="toggle-module_round__qn6ng";f('.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 b="type-form-module_errorContainer__dgVGi",j="type-form-module_errorMessage__z4AgA",w="type-form-module_modeContainer__zJRuI",T="type-form-module_mode__Ond9E";f(".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"],S=function(e){return d(void 0,void 0,void 0,(function(){var t,o,n,r,l,s,d,c;return a(this,(function(a){return t=e.apiKey,o=e.deliveryToken,n=e.environment,r=e.branch,l=e.hostUrl,s=e.contentTypeUid,d=e.entryUid,c=i.Stack({api_key:t,delivery_token:o,environment:n,branch:r}),l&&c.setHost(l),[2,c.ContentType(s).Entry(d).fetch().then((function(e){return e.toJSON()})).catch((function(e){console.log(e)}))]}))}))},C=function(e){return d(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]}}))}))},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,i=o.children,d=o.style,a=void 0===d?{}:d,u=s(o,["text","children","style"]),f=p(r),m=c(a);return e.jsxs("button",l({},u,{style:m},{children:[e.jsx(t.Text,{field:f}),i]}))},exports.Checkbox=function(t){var o=t.style,n=c(o);return e.jsx("input",l({},t,{type:"checkbox",style:n}))},exports.Container=function(t){var o,n=t.bgImage,r=t.style,i=void 0===r?{}:r,d=t.tag,a=void 0===d?"div":d,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(i),y=l(l({},m),f?{backgroundImage:"url(".concat(f,")")}:{}),v=a;return e.jsx(v,l({},p,{style:y},{children:u}))},exports.Dropdown=function(o){var n=o.style,r=c(n);return e.jsxs("div",l({className:"".concat(o.className," ").concat(y),style:r},{children:[e.jsx("button",l({className:m,style:{width:"100%",height:"100%"}},{children:e.jsx(t.Text,{field:o.text,editable:!0,encode:!0})})),e.jsx("div",l({className:v},{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,i=o.style,d=void 0===i?{}:i,a=o.srcSet,u=void 0===a?"":a,p=s(o,["src","alt","style","srcSet"]),f="string"==typeof n?{value:{src:n,alt:"string"==typeof r?r:""}}:n,m=x(u),y=c(d);return e.jsx(t.Image,l({},p,{field:f,style:y},m.length?{srcSet:m}:{}))},exports.KajooComponent=function(t){var o=t.component,n=t.datasource,i=t.loadingComponent,s=t.errorComponent,c=t.emptyComponent,u=t.children,p=r.useState(null),f=p[0],m=p[1],y=r.useState(!1),v=y[0],x=y[1],h=r.useState(!1),g=h[0],_=h[1];r.useEffect((function(){if("conscia.ai"===n.provider){d(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(n)];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"===n.provider){d(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(n)];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,n]);var b=o;return v?i||null:g?s||null:f?e.jsx(b,l({fields:f},{children:u})):c||null},exports.KajooLayoutFactory=O,exports.Link=function(o){var n=o.href,r=void 0===n?"#":n,i=o.text,d=void 0===i?"":i,a=o.style,u=void 0===a?{}:a,f=s(o,["href","text","style"]),m=p(d),y="string"==typeof r?{value:{href:r,text:m.value}}:r,v=c(u);return e.jsx(t.Link,l({},f,{field:y,style:v}))},exports.List=function(t){var o=t.list,n=t.style,r=void 0===n?{}:n,i=s(t,["list","style"]),d=c(r);return o?e.jsx("ul",l({},i,{style:d},{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",l({name:"radio"},t,{type:"radio",style:n}))},exports.Repeater=function(t){var o=t.columns,n=void 0===o?3:o,r=t.style,i=void 0===r?{}:r,d=t.children,a=s(t,["columns","style","children"]),u=c(i),p=l(l({},u),{display:"grid",gap:"10px",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))")});return e.jsx("div",l({},a,{style:p},{children:d}))},exports.RichText=function(o){var n=o.value,r=void 0===n?"":n,i=o.style,d=void 0===i?{}:i,a=s(o,["value","style"]),u=p(r),f=c(d);return e.jsx(t.RichText,l({},a,{field:u,style:f}))},exports.Text=function(o){var n=o.text,r=o.children,i=o.tag,d=void 0===i?"span":i,a=o.style,u=void 0===a?{}:a,f=s(o,["text","children","tag","style"]),m=p(n),y=c(u),v=d;return r?e.jsxs(v,l({},f,{style:y},{children:[e.jsx(t.Text,{field:m,tag:d}),r]})):e.jsx(t.Text,l({},f,{field:m,tag:d,style:y}))},exports.Textarea=function(t){var o=t.style,n=c(o);return e.jsx("textarea",l({},t,{style:n}))},exports.Textinput=function(t){var o=t.style,n=c(o);return e.jsx("input",l({},t,{type:"text",style:n}))},exports.Toggle=function(t){var o=t.style,n=c(o);return e.jsxs("label",l({className:"".concat(t.className," ").concat(h),style:n},{children:[e.jsx("input",{type:"checkbox",className:g}),e.jsx("span",{className:"".concat(t.slider," ").concat(_)})]}))},exports.TypeForm=function(r){var i=r.formId.value,d=r.mode,a=void 0===d?{}:d,u=r.buttonText,p=r.style,f=void 0===p?{}:p,m=s(r,["formId","mode","buttonText","style"]),y=a.value,v=k.includes(y),x=c(f);return!v&&n.isEditorActive()?e.jsxs("div",l({className:b},{children:[e.jsxs("div",l({className:j},{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",l({className:w},{children:["mode: ",e.jsx(t.Text,{field:a,tag:"span",className:T})]}))]})):"popupButton"===y?e.jsx(o.PopupButton,l({id:i,style:x},m,{children:e.jsx(t.Text,{field:u||"click to open"})})):"popover"===y?e.jsx(o.Sidetab,l({id:i,style:x},m,{buttonText:(null==u?void 0:u.value)||"click to open"})):"widget"===y?e.jsx(o.Widget,l({id:i,style:x},m)):"sliderButton"===y?e.jsx(o.SliderButton,l({id:i,style:x},m,{children:e.jsx(t.Text,{field:u||"click to open"})})):null},exports.Video=function(t){var o=t.src,n=s(t,["src"]),r=n.muted,i=void 0===r?"true":r,d=n.style,a=void 0===d?{}:d,u=s(n,["muted","style"]),p=c(a);return e.jsx("video",l({controls:!0},u,{muted:"true"===i,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 l(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 s(e,t,o,n){return new(o||(o=Promise))((function(r,i){function l(e){try{d(n.next(e))}catch(e){i(e)}}function s(e){try{d(n.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,s)}d((n=n.apply(e,t||[])).next())}))}function d(e,t){var o,n,r,i,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(d){return function(s){if(o)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(l=0)),l;)try{if(o=1,n&&(r=2&s[0]?n.return:s[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;switch(n=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return l.label++,{value:s[1],done:!1};case 5:l.label++,n=s[1],s=[0];continue;case 7:s=l.ops.pop(),l.trys.pop();continue;default:if(!(r=l.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){l=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){l.label=s[1];break}if(6===s[0]&&l.label<r[1]){l.label=r[1],r=s;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(s);break}r[2]&&l.ops.pop(),l.trys.pop();continue}s=t.call(e,l)}catch(e){s=[6,e],n=0}finally{o=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,d])}}}"function"==typeof SuppressedError&&SuppressedError;var a=function(e){return void 0===e&&(e={}),"string"==typeof e?c(e):"object"==typeof e?e:{}},c=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",y="drop-down-module_dropdown__UKh7X",m="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 T=["popupButton","sliderButton","widget","popover"],k=function(e){return s(void 0,void 0,void 0,(function(){var t,o,n,i,l,s,a,c;return d(this,(function(d){return t=e.apiKey,o=e.deliveryToken,n=e.environment,i=e.branch,l=e.hostUrl,s=e.contentTypeUid,a=e.entryUid,c=r.Stack({api_key:t,delivery_token:o,environment:n,branch:i}),l&&c.setHost(l),[2,c.ContentType(s).Entry(a).fetch().then((function(e){return e.toJSON()})).catch((function(e){console.log(e)}))]}))}))},S=function(e){return s(void 0,void 0,void 0,(function(){var t,o,n,r;return d(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]}}))}))},C=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,s=o.children,d=o.style,c=void 0===d?{}:d,p=l(o,["text","children","style"]),f=u(r),y=a(c);return e.jsxs("button",i({},p,{style:y},{children:[e.jsx(t.Text,{field:f}),s]}))},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,s=void 0===r?{}:r,d=t.tag,c=void 0===d?"div":d,u=t.children,p=l(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,y=a(s),m=i(i({},y),f?{backgroundImage:"url(".concat(f,")")}:{}),v=c;return e.jsx(v,i({},p,{style:m},{children:Array.isArray(u)?u:[u]}))},exports.Dropdown=function(o){var n=o.style,r=a(n);return e.jsxs("div",i({className:"".concat(o.className," ").concat(y),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:m},{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,s=o.style,d=void 0===s?{}:s,c=o.srcSet,u=void 0===c?"":c,p=l(o,["src","alt","style","srcSet"]),f="string"==typeof n?{value:{src:n,alt:"string"==typeof r?r:""}}:n,y=v(u),m=a(d);return e.jsx(t.Image,i({},p,{field:f,style:m},y.length?{srcSet:y}:{}))},exports.KajooComponent=function(t){var o=t.component,r=t.datasource,l=t.loadingComponent,a=t.errorComponent,c=t.emptyComponent,u=t.children,p=n.useState(null),f=p[0],y=p[1],m=n.useState(!1),v=m[0],x=m[1],h=n.useState(!1),g=h[0],_=h[1];n.useEffect((function(){if("conscia.ai"===r.provider){s(void 0,void 0,void 0,(function(){var e,t;return d(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(),y(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){s(void 0,void 0,void 0,(function(){var e,t;return d(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,3,4]),x(!0),[4,k(r)];case 1:return e=o.sent(),y(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?l||null:g?a||null:f?e.jsx(b,i({fields:f},{children:u})):c||null},exports.KajooLayoutFactory=C,exports.Link=function(o){var n=o.href,r=void 0===n?"#":n,s=o.text,d=void 0===s?"":s,c=o.style,p=void 0===c?{}:c,f=l(o,["href","text","style"]),y=u(d),m="string"==typeof r?{value:{href:r,text:y.value}}:r,v=a(p);return e.jsx(t.Link,i({},f,{field:m,style:v}))},exports.List=function(t){var o=t.list,n=t.style,r=void 0===n?{}:n,s=l(t,["list","style"]),d=a(r);return o?e.jsx("ul",i({},s,{style:d},{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,s=void 0===r?{}:r,d=t.children,c=l(t,["columns","style","children"]),u=a(s),p=i(i({},u),{display:"grid",gap:"10px",gridTemplateColumns:"repeat(".concat(n,", minmax(0, 1fr))")});return e.jsx("div",i({},c,{style:p},{children:d}))},exports.RichText=function(o){var n=o.value,r=void 0===n?"":n,s=o.style,d=void 0===s?{}:s,c=l(o,["value","style"]),p=u(r),f=a(d);return e.jsx(t.RichText,i({},c,{field:p,style:f}))},exports.Text=function(o){var n=o.text,r=o.children,s=o.tag,d=void 0===s?"span":s,c=o.style,p=void 0===c?{}:c,f=l(o,["text","children","tag","style"]),y=u(n),m=a(p),v=d;return r?e.jsxs(v,i({},f,{style:m},{children:[e.jsx(t.Text,{field:y,tag:d}),Array.isArray(r)?r:[r]]})):e.jsx(t.Text,i({},f,{field:y,tag:d,style:m}))},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,s=n.mode,d=void 0===s?{}:s,c=n.buttonText,u=n.style,p=void 0===u?{}:u,f=l(n,["formId","mode","buttonText","style"]),y=d.value,m=T.includes(y),v=a(p);return!m&&t.isExperienceEditorActive()?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(T.join('", "'),'"')})]})),e.jsxs("p",i({className:j},{children:["mode: ",e.jsx(t.Text,{field:d,tag:"span",className:w})]}))]})):"popupButton"===y?e.jsx(o.PopupButton,i({id:r,style:v},f,{children:e.jsx(t.Text,{field:c||"click to open"})})):"popover"===y?e.jsx(o.Sidetab,i({id:r,style:v},f,{buttonText:(null==c?void 0:c.value)||"click to open"})):"widget"===y?e.jsx(o.Widget,i({id:r,style:v},f)):"sliderButton"===y?e.jsx(o.SliderButton,i({id:r,style:v},f,{children:e.jsx(t.Text,{field:c||"click to open"})})):null},exports.Video=function(t){var o=t.src,n=l(t,["src"]),r=n.muted,s=void 0===r?"true":r,d=n.style,c=void 0===d?{}:d,u=l(n,["muted","style"]),p=a(c);return e.jsx("video",i({controls:!0},u,{muted:"true"===s,style:p},{children:e.jsx("source",{src:null==o?void 0:o.url})}))};
2
2
  //# sourceMappingURL=index.js.map