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AOrH,EAAAA,YACHwH,KAAS,SAAAC,EAAA,OAAwB,QAAxBA,EAAMH,EAAW9B,eAAO,IAAAiC,OAAA,EAAlBA,EAAAC,KAAAJ,EAAsB,GAAE3C,GACvC,CAAC2C,GAET,C,uECTO,SAASC,EAA4BI,GACxC,MAAMC,GAAcC,EAAAA,EAAAA,QAAUF,GAM9B,OAJAG,EAAAA,EAAAA,YAAU,KACNF,EAAYpC,QAAUmC,CAAQ,GAC/B,CAACA,IAEGC,CACX,C","sources":["webpack://Kristiania.Web/./Features/StudyPage/Campus/Sections/TestimoniesSection/TestimoniesSection.module.css?0f85","webpack://Kristiania.Web/./Features/StudyPage/Campus/Sections/TestimoniesSection/Testimony/Testimony.module.css?9aaa","webpack://Kristiania.Web/./Features/StudyPage/Campus/Sections/TestimoniesSection/Testimony/Testimony.tsx","webpack://Kristiania.Web/./Features/StudyPage/Campus/Sections/TestimoniesSection/TestimoniesSection.tsx","webpack://Kristiania.Web/./Features/Blocks/TestimoniesSectionBlock/View/TestimoniesSectionBlock.tsx","webpack://Kristiania.Web/./Features/Layouts/Components/PageSection/PageSection.tsx","webpack://Kristiania.Web/./Features/Layouts/Components/PageSection/PageSection.module.css?557e","webpack://Kristiania.Web/./Features/Layouts/Components/PageSectionHeading/PageSectionHeading.tsx","webpack://Kristiania.Web/./Features/Layouts/Components/PageSectionHeading/PageSectionHeading.module.css?ed34","webpack://Kristiania.Web/./Features/Partials/ActivityIndicator/ActivityIndicator.module.css?6d48","webpack://Kristiania.Web/./Features/Partials/ActivityIndicator/ActivityIndicator.tsx","webpack://Kristiania.Web/./Features/Partials/FetchData/useFetchData.ts","webpack://Kristiania.Web/./Features/Partials/Utils/usePrevious.ts","webpack://Kristiania.Web/./Features/StudyPage/Campus/Components/GobiStory/Utils/GobiApiUtils.ts","webpack://Kristiania.Web/./Features/StudyPage/Campus/Components/GobiStory/GobiStory.tsx","webpack://Kristiania.Web/./Features/StudyPage/Campus/Components/GobiStory/GobiStory.module.css?a7be","webpack://Kristiania.Web/./Features/Utils/Hooks/useDebounce.ts","webpack://Kristiania.Web/./Features/Utils/Hooks/useVariableWithStableRef.ts"],"sourcesContent":["// extracted by mini-css-extract-plugin\nexport default {\"TestimoniesSection\":\"xfIZ8IPRSKGxzL5KIyLz\",\"Heading\":\"Bje8lNYEARjKXkaadcjl\",\"Inner\":\"IP4WLEZAtSgblGP4Felg\",\"Media\":\"KCVvuotjBI0iy0ATTKfK\",\"Thumbnail\":\"ssmQS4h9jzEH4V0L4NSN\",\"Testimonies\":\"tZx0pZhK8q3JNoQI8LCj\",\"TestimonyItem\":\"i8yQuD9MeLJCD5eDKft2\",\"Variant--dark\":\"ZG9x_vn8GvsrSWPis7bl\",\"Variant--light\":\"ND3K5VOwkEcqG3pRSCDw\"};","// extracted by mini-css-extract-plugin\nexport default {\"Inner\":\"WWUAFGePNJBA0_seRWlX\",\"Heading\":\"TCpxq20heJlGBaSbNI4y\",\"Content\":\"AXbF9ehRSXzzERBwn1XK\",\"Variant--light\":\"cVALO6yJDjmV1Xvkvynu\",\"Variant--dark\":\"rnHZet7H8f4I0eCy29lg\"};","import classNames from 'classnames';\nimport React from 'react';\nimport type { HtmlString } from '~/Features/Types/HtmlString.csharp';\nimport { HtmlDiv } from '~/Partials/Controls/HtmlDiv';\nimport { HtmlHeading } from '~/Partials/Controls/HtmlHeading';\nimport styles from './Testimony.module.css';\nimport type { TestimonyVariant } from './TestimonyVariant';\n\nexport interface TestimonyProps {\n heading?: HtmlString;\n content?: HtmlString;\n variant?: TestimonyVariant;\n}\n\nexport const Testimony: React.FC = props => {\n const { heading, content, variant = 'light' } = props;\n\n return (\n
\n
\n {heading && }\n {content && (\n \n )}\n
\n
\n );\n};\n","import classNames from 'classnames';\nimport * as React from 'react';\nimport { PageSection } from '~/Features/Layouts/Components/PageSection/PageSection';\nimport { PageSectionHeading } from '~/Features/Layouts/Components/PageSectionHeading/PageSectionHeading';\nimport { useTheme } from '~/Features/Layouts/Theme/Context/ThemeContextProvider';\nimport type { GobiStoryProps } from '~/Features/StudyPage/Campus/Components/GobiStory/GobiStory';\nimport { GobiStory } from '~/Features/StudyPage/Campus/Components/GobiStory/GobiStory';\nimport type { HtmlString } from '~/Features/Types/HtmlString.csharp';\nimport { List } from '~/Partials/List/List';\nimport type { ImageBaseViewModel } from '~/Partials/Picture/ImageBaseViewModel.csharp';\nimport { Picture } from '~/Partials/Picture/Picture';\nimport { PictureProfiles } from '~/Partials/Picture/PictureProfiles';\nimport { PicturePlaceholder } from '~/Partials/Picture/Placeholder/PicturePlaceholder';\nimport type { Theme } from '~/Utils/Theme';\nimport styles from './TestimoniesSection.module.css';\nimport type { TestimonySectionVariant } from './TestimoniesSectionVariant';\nimport type { TestimonyProps } from './Testimony/Testimony';\nimport { Testimony } from './Testimony/Testimony';\n\nexport interface TestimoniesSectionProps {\n id: string;\n testimonies: TestimonyProps[];\n heading?: HtmlString;\n imageFallback?: ImageBaseViewModel;\n gobiStory?: GobiStoryProps;\n variant?: TestimonySectionVariant;\n theme?: Theme;\n}\n\nexport const TestimoniesSection: React.FC = props => {\n const contextualTheme = useTheme();\n const { id, heading, testimonies, imageFallback, gobiStory, variant = 'dark', theme = contextualTheme } = props;\n\n const testimonyVariant = variant === 'dark' ? 'light' : 'dark';\n\n const renderMedia = () => {\n if (gobiStory) {\n return ;\n }\n\n if (imageFallback) {\n return (\n \n );\n }\n\n return ;\n };\n\n const renderTestimony = (testimony: TestimonyProps, index: number) => (\n
  • \n \n
  • \n );\n\n return (\n \n {heading && }\n
    \n
    {renderMedia()}
    \n \n
    \n
    \n );\n};\n","import * as React from 'react';\nimport type { TestimoniesSectionBlockViewModel } from '../ViewModel/TestimoniesSectionBlockViewModel.csharp';\nimport type { GobiStoryProps } from '~/Features/StudyPage/Campus/Components/GobiStory/GobiStory';\nimport { TestimoniesSection } from '~/Features/StudyPage/Campus/Sections/TestimoniesSection/TestimoniesSection';\n\nexport const TestimoniesSectionBlock: React.FC = props => {\n const { id, heading, testimonies, gobiStoryId, imageFallback, translations, variant } = props;\n\n const getGobiProps = (): GobiStoryProps | undefined =>\n gobiStoryId\n ? {\n storyId: gobiStoryId,\n openLabel: translations.openPlayer,\n errorMessage: translations.failedToLoadVideo,\n }\n : undefined;\n\n return (\n \n );\n};\n","import * as React from 'react';\nimport styles from './PageSection.module.css';\n\nexport interface PageSectionProps {\n id?: string;\n className?: string;\n}\n\nexport const PageSection: React.FC> = props => {\n const { id, className, children } = props;\n\n return (\n
    \n
    \n
    {children}
    \n
    \n
    \n );\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"Wrapper\":\"Fov3KMlE7osNR74JI44t\",\"Inner\":\"Wf6h4ZdN2S9XvO6RoMCf\"};","import classNames from 'classnames';\nimport React from 'react';\nimport type { HtmlString } from '~/Features/Types/HtmlString.csharp';\nimport { HtmlHeading } from '~/Partials/Controls/HtmlHeading';\nimport styles from './PageSectionHeading.module.css';\n\ninterface PageSectionHeadingProps {\n heading: HtmlString;\n className?: string;\n}\n\nexport const PageSectionHeading: React.FC = props => {\n const { heading, className } = props;\n\n return ;\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"PageSectionHeading\":\"FrR9v_ssranAjR5kDzwF\"};","// extracted by mini-css-extract-plugin\nexport default {\"Inner\":\"EwPhzUN1NfTBa1XOsTE6\",\"ActivityIndicatorRotate\":\"ZNgVI5R_Ahgk3DnOyUhN\",\"Inner--cover\":\"TVMntCe8qkWIdDcQxQb6\",\"Outer\":\"FxrXNHIEItswETCvk14E\",\"Children\":\"rK8S3lKkJdvsHyzk1dZ1\"};","import classNames from 'classnames';\nimport * as React from 'react';\nimport styles from './ActivityIndicator.module.css';\n\nexport interface ActivityIndicatorProps {\n cover?: boolean;\n active?: boolean;\n modal?: boolean;\n children?: string | React.ReactNode;\n}\n\nconst ModalWrapper: React.FC> = props => {\n const { visible, children } = props;\n\n return (\n \n {children}\n \n );\n};\n\nexport const ActivityIndicator: React.FC> = React.memo(props => {\n const { modal = true, cover, active = true, children } = props;\n\n const Wrapper = modal ? ModalWrapper : React.Fragment;\n const wrapperProps = modal ? { visible: active } : {}; // react.Fragment cannot have any props\n\n return (\n \n \n {children && (\n {children}\n )}\n \n );\n});\n","import type { AxiosResponse, Canceler } from 'axios';\nimport axios, { isCancel } from 'axios';\nimport * as React from 'react';\nimport { usePrevious } from '../Utils/usePrevious';\nimport { checkEquals } from '../Utils/utils';\nimport { useDebounce } from '~/Utils/Hooks/useDebounce';\nimport { axiosWrapper } from './axiosWrapper';\nimport type { FetchDataAction, FetchDataHookProps, FetchDataHookReturn, FetchDataHookState } from './types';\n\nfunction reducer(\n state: FetchDataHookState,\n action: FetchDataAction\n): FetchDataHookState {\n switch (action.type) {\n case 'SET_DATA':\n return {\n ...state,\n data: action.payload,\n loading: false,\n error: undefined,\n };\n case 'SET_ERROR':\n return {\n ...state,\n loading: false,\n data: undefined,\n error: action.payload,\n };\n case 'START_REQUEST':\n return {\n ...state,\n error: undefined,\n loading: true,\n dataRequested: true,\n };\n default:\n return state;\n }\n}\n\nexport function useFetchData(\n props: FetchDataHookProps\n): FetchDataHookReturn {\n const { url, params, method = 'get', shouldMakeRequest = true, debounceTime = 200, timeout = 0 } = props;\n\n const [{ data, loading, error, dataRequested }, dispatch] = React.useReducer<\n React.Reducer, FetchDataAction>\n >(reducer, {\n data: undefined,\n loading: false,\n error: undefined,\n dataRequested: false,\n });\n\n const previousProps = usePrevious({ url, method, params });\n const requestWithDebounce = useDebounce(request, debounceTime);\n\n const cancelToken = React.useRef();\n\n React.useEffect(() => {\n if (shouldMakeRequest) {\n fetchData();\n }\n\n return () => {\n if (cancelToken.current) {\n cancelToken.current();\n }\n };\n }, []);\n\n React.useEffect(() => {\n const propsChanged = previousProps\n ? previousProps.url !== url || previousProps.method !== method || !checkEquals(previousProps.params, params)\n : false;\n\n if ((propsChanged || !dataRequested) && shouldMakeRequest) {\n fetchData();\n }\n }, [url, method, params, dataRequested, shouldMakeRequest]);\n\n function fetchData() {\n if (cancelToken.current) {\n cancelToken.current();\n }\n\n dispatch({ type: 'START_REQUEST' });\n requestWithDebounce();\n }\n\n function request() {\n axiosWrapper\n .request>({\n url,\n method,\n params,\n timeout,\n cancelToken: new axios.CancelToken(token => {\n cancelToken.current = token;\n }),\n })\n .then(response => {\n cancelToken.current = undefined;\n dispatch({ type: 'SET_DATA', payload: response.data });\n })\n .catch(e => {\n if (isCancel(e)) {\n return;\n }\n\n dispatch({ type: 'SET_ERROR', payload: e.message });\n // eslint-disable-next-line no-console\n console.error(e);\n });\n }\n\n return {\n data,\n loading,\n error,\n };\n}\n","import * as React from 'react';\n\nexport function usePrevious(value: T) {\n const ref = React.useRef();\n React.useEffect(() => {\n ref.current = value;\n });\n\n return ref.current as T;\n}\n","export const baseApiUrl = 'https://api.gobistories.com/api/v5/renders';\n\nexport interface GobiApiResponse {\n viewKey: string;\n version: number;\n title: string;\n videoUrl: string;\n streamingUrl: string;\n thumbnailUrl: string;\n posterUrl: string;\n coverUrl: string;\n chapters: {\n id: string;\n order: number;\n duration: number;\n stickers: {\n type: 'TEXT' | 'LINK' | 'DUMB';\n order: number;\n x: number;\n y: number;\n scale: number;\n rotation: number;\n imageUrl: string | null;\n linkUrl: string | null;\n text: string | null;\n }[];\n }[];\n animatedThumbnailUrl?: string;\n webmThumbnailUrl?: string;\n mp4ThumbnailUrl?: string;\n webmCoverUrl?: string;\n mp4CoverUrl?: string;\n whiteLabel?: boolean;\n}\n\nexport type GobiApiResponseNarrowed = Pick;\n","import { openPopup } from '@gobistories/gobi-web-integration';\nimport type { Options } from '@gobistories/gobi-web-integration/dist/types/options.types';\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport { useTheme } from '~/Features/Layouts/Theme/Context/ThemeContextProvider';\nimport { ActivityIndicator } from '~/Partials/ActivityIndicator/ActivityIndicator';\nimport { Button } from '~/Partials/Button/Button';\nimport { ButtonType } from '~/Partials/Button/ButtonType.csharp';\nimport { useFetchData } from '~/Partials/FetchData/useFetchData';\nimport { Picture } from '~/Partials/Picture/Picture';\nimport { PictureProfiles } from '~/Partials/Picture/PictureProfiles';\nimport { SvgIcon } from '~/Partials/SvgIcon/SvgIcon';\nimport type { Theme } from '~/Utils/Theme';\nimport styles from './GobiStory.module.css';\nimport type { GobiApiResponseNarrowed } from './Utils/GobiApiUtils';\nimport { baseApiUrl } from './Utils/GobiApiUtils';\n\nexport interface GobiStoryProps {\n storyId: string;\n openLabel: string;\n errorMessage: string;\n theme?: Pick;\n className?: string;\n}\n\nexport const GobiStory: React.FC = props => {\n const contextualTheme = useTheme();\n const { storyId, openLabel, errorMessage, className, theme = contextualTheme } = props;\n\n const [isOpened, setIsOpened] = React.useState(false);\n\n const { withRoundedCorners } = theme;\n\n const openStory = () => {\n if (isOpened) {\n return;\n }\n\n setIsOpened(true);\n\n openPopup(storyId, {\n on: {\n close: () => setIsOpened(false),\n },\n } as Options);\n };\n\n const { data, loading, error } = useFetchData({\n url: `${baseApiUrl}/${storyId}`,\n });\n\n const renderContent = () => {\n if (error) {\n return (\n
    \n \n {errorMessage}\n
    \n );\n }\n\n if (loading || !data) {\n return ;\n }\n\n const { posterUrl, title } = data;\n\n return (\n <>\n \n
    \n
    \n \n
    \n \n
    \n \n );\n };\n\n return (\n
    \n {renderContent()}\n
    \n );\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"GobiStory\":\"VNQ7BkWJFagCE_bBjsxQ\",\"PlayWrapper\":\"awya_ua8NF0CjmEFiP1W\",\"Play\":\"pIVhKXQKAuzUp3Upow3N\",\"OpenButton\":\"VorSZ59xzSqm4a74z90r\",\"ErrorContainer\":\"H7Kdh3CKpE4SIlhVCnLh\",\"ErrorIcon\":\"soOGIuDWHz9ZuRRzOGk1\",\"ErrorMessage\":\"HXGMpPQMi8ZIDLqqZSWo\",\"Variant--rounded\":\"ZLbmeOzjwEPCnL8UV8zG\"};","import debounce from 'lodash/debounce';\nimport * as React from 'react';\nimport { useVariableWithStableRef } from './useVariableWithStableRef';\n\nexport function useDebounce(callback: () => void, debounceTime: number) {\n const handlerRef = useVariableWithStableRef(callback);\n\n return React.useCallback(\n debounce(() => handlerRef.current?.(), debounceTime),\n [handlerRef]\n );\n}\n","import { useEffect, useRef } from 'react';\n\nexport function useVariableWithStableRef(variable: T) {\n const variableRef = useRef(variable);\n\n useEffect(() => {\n variableRef.current = variable;\n }, [variable]);\n\n return variableRef;\n}\n"],"names":["Testimony","props","heading","content","variant","React","className","styles","concat","Inner","HtmlHeading","type","html","Heading","HtmlDiv","classNames","Content","TestimoniesSection","contextualTheme","useTheme","id","testimonies","imageFallback","gobiStory","theme","testimonyVariant","PageSection","PageSectionHeading","Media","GobiStory","_extends","Thumbnail","Picture","profile","PictureProfiles","vertical","PicturePlaceholder","List","Testimonies","items","renderItem","renderTestimony","testimony","index","TestimonyItem","key","TestimoniesSectionBlock","gobiStoryId","translations","storyId","openLabel","openPlayer","errorMessage","failedToLoadVideo","undefined","children","ModalWrapper","visible","style","display","ActivityIndicator","modal","cover","active","Wrapper","wrapperProps","reducer","state","action","_objectSpread","data","payload","loading","error","dataRequested","useFetchData","url","params","method","shouldMakeRequest","debounceTime","timeout","dispatch","previousProps","usePrevious","requestWithDebounce","useDebounce","axiosWrapper","request","cancelToken","axios","CancelToken","token","current","then","response","catch","e","isCancel","message","console","fetchData","checkEquals","value","ref","isOpened","setIsOpened","withRoundedCorners","openStory","openPopup","on","close","renderContent","SvgIcon","iconName","posterUrl","title","alt","Button","onClick","ButtonType","Clear","callback","handlerRef","useVariableWithStableRef","debounce","_handlerRef$current","call","variable","variableRef","useRef","useEffect"],"sourceRoot":""}