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AAjB,EAAaI,eAAO,IAAAa,GAApBA,EAAsBI,cAAcH,EACxC,CAfA,CAeA,EAGqD,C,sBClG7D,KAAgB,4BAA4B,uBAAuB,8BAA8B,uBAAuB,mBAAmB,uBAAuB,wBAAwB,uBAAuB,0BAA0B,uBAAuB,2BAA2B,uBAAuB,6BAA6B,uBAAuB,mBAAmB,uBAAuB,2BAA2B,uBAAuB,4BAA4B,uBAAuB,kBAAkB,uBAAuB,gBAAgB,uBAAuB,kBAAkB,uBAAuB,mBAAmB,uBAAuB,qBAAqB,uBAAuB,oBAAoB,uB,sBCA1tB,KAAgB,kBAAoB,uBAAuB,MAAQ,uBAAuB,YAAc,uBAAuB,KAAO,uBAAuB,iBAAmB,uBAAuB,kBAAkB,uBAAuB,iBAAiB,uBAAuB,kBAAkB,uBAAuB,iBAAiB,uBAAuB,4BAA4B,uBAAuB,8BAA8B,uBAAuB,wBAAwB,uBAAuB,0BAA0B,uBAAuB,2BAA2B,uBAAuB,6BAA6B,uBAAuB,mBAAmB,uBAAuB,2BAA2B,uBAAuB,4BAA4B,uBAAuB,kBAAkB,uBAAuB,gBAAgB,uBAAuB,qBAAqB,uBAAuB,aAAe,uB","sources":["webpack://Kristiania.Web/./Features/Blocks/ContentCard/ContentCardBlockVariant.csharp.ts","webpack://Kristiania.Web/./Features/Blocks/ContentCardLayout/ContentCardLayout.tsx","webpack://Kristiania.Web/./Features/Utils/MouseButton.ts","webpack://Kristiania.Web/./Features/Utils/Hooks/useClickProxyAllowingTextSelection.ts","webpack://Kristiania.Web/./Features/Blocks/ContentCardLayout/ContentCardBase.module.css?4984","webpack://Kristiania.Web/./Features/Blocks/ContentCardLayout/ContentCardLayout.module.css?eeb0"],"sourcesContent":["//     This code was generated by a Reinforced.Typings tool.\n//     Changes to this file may cause incorrect behavior and will be lost if\n//     the code is regenerated.\n\nexport enum ContentCardBlockVariant {\n\tYellow = \"yellow\",\n\tLightGreyPrimary = \"lightGreyPrimary\",\n\tBlackPrimary = \"blackPrimary\",\n\tDarkGreyPrimary = \"darkGreyPrimary\",\n\tLightGreySecondary = \"lightGreySecondary\",\n\tBlackSecondary = \"blackSecondary\",\n\tDarkGreySecondary = \"darkGreySecondary\",\n\tBlue = \"blue\",\n\tDarkRed = \"darkRed\",\n\tLightTransparent = \"lightTransparent\",\n\tDarkTransparent = \"darkTransparent\",\n\tLegacy = \"legacy\"\n}\n","import classNames from 'classnames';\nimport React from 'react';\nimport type { ContentCardBlockSize } from '../ContentCard/ContentCardBlockSize.csharp';\nimport { ContentCardBlockVariant } from '../ContentCard/ContentCardBlockVariant.csharp';\nimport type { ContentCardButtonType } from '../ContentCard/ContentCardButtonType.csharp';\nimport { ButtonSize } from '~/Partials/Button/ButtonSize.csharp';\nimport { ButtonTier } from '~/Partials/Button/ButtonTier.csharp';\nimport { Link } from '~/Partials/Link/Link';\nimport { LinkType } from '~/Partials/Link/LinkType.csharp';\nimport type { LinkViewModel } from '~/Partials/Link/LinkViewModel.csharp';\nimport { SvgIcon } from '~/Partials/SvgIcon/SvgIcon';\nimport styles from './ContentCardLayout.module.css';\n\nexport interface ContentCardLayoutProps {\n    title: string;\n    description: string;\n    variant: ContentCardBlockVariant;\n    useLegacyLink: boolean;\n    buttonType: ContentCardButtonType;\n    linkRef: React.RefObject<HTMLAnchorElement>;\n    size: ContentCardBlockSize;\n    callToActionLink?: LinkViewModel;\n    stretched?: boolean;\n}\n\nconst getButton = (\n    buttonType: `${ContentCardButtonType}`,\n    variant: ContentCardBlockVariant,\n    callToActionLink: LinkViewModel,\n    useLegacyLink: boolean,\n    ref: React.Ref<HTMLAnchorElement>\n) => {\n    if (useLegacyLink) {\n        return <Link {...callToActionLink} showIsExternal={false} className={styles.Link} ref={ref} />;\n    }\n\n    if (buttonType === 'circleButton') {\n        return (\n            <Link\n                {...callToActionLink}\n                type={LinkType.Clear}\n                showIsExternal={false}\n                className={styles.Link}\n                ref={ref}\n                title={callToActionLink.label}\n            >\n                <span className=\"visuallyHidden\">{callToActionLink.label}</span>\n                <SvgIcon iconName=\"arrow-right-circle\" className={styles.CircleButtonIcon} />\n            </Link>\n        );\n    }\n\n    return (\n        <Link\n            {...callToActionLink}\n            type={LinkType.Button}\n            buttonSize={ButtonSize.Large}\n            buttonTier={getButtonTier(variant)}\n            showIsExternal={false}\n            className={styles.Link}\n            ref={ref}\n        >\n            <span>{callToActionLink.label}</span>\n            <SvgIcon iconName=\"arrow-right\" />\n        </Link>\n    );\n};\n\nconst getButtonTier = (variant: ContentCardBlockVariant) => {\n    switch (variant) {\n        case ContentCardBlockVariant.LightGreyPrimary:\n        case ContentCardBlockVariant.DarkGreyPrimary:\n        case ContentCardBlockVariant.Yellow:\n        case ContentCardBlockVariant.Blue:\n        case ContentCardBlockVariant.LightTransparent:\n            return ButtonTier.Primary;\n        case ContentCardBlockVariant.LightGreySecondary:\n        case ContentCardBlockVariant.DarkGreySecondary:\n        case ContentCardBlockVariant.BlackSecondary:\n            return ButtonTier.Secondary;\n        case ContentCardBlockVariant.BlackPrimary:\n        case ContentCardBlockVariant.DarkRed:\n        case ContentCardBlockVariant.DarkTransparent:\n            return ButtonTier.Tertiary;\n        case ContentCardBlockVariant.Legacy:\n        default:\n            return ButtonTier.LegacyPrimary;\n    }\n};\n\nexport const ContentCardLayout = (props: ContentCardLayoutProps) => {\n    const { title, description, variant, callToActionLink, useLegacyLink, buttonType, linkRef, size, stretched } =\n        props;\n\n    const hasLink = callToActionLink?.href !== undefined;\n\n    return (\n        <div\n            className={classNames(\n                styles.ContentCardLayout,\n                variant === ContentCardBlockVariant.Legacy\n                    ? [styles['Variant--legacy'], styles[`Variant--${size}`]]\n                    : styles[`Variant--${variant}`],\n                stretched && styles['Variant--stretched']\n            )}\n        >\n            <h2 className={styles.Title}>{title}</h2>\n            <div className={styles.Description}>{description}</div>\n            {hasLink && getButton(buttonType, variant, callToActionLink, useLegacyLink, linkRef)}\n        </div>\n    );\n};\n","export const enum MouseButton {\n    Left = 0,\n    Middle = 1,\n    Right = 2,\n}\n","import isEmpty from 'lodash/isEmpty';\nimport * as React from 'react';\nimport { findClosestParent } from '~/Partials/Utils/utils';\nimport { MouseButton } from '~/Utils/MouseButton';\n\nconst isNonEmpty = (selection: Selection | null): selection is Selection => !isEmpty(selection?.toString());\n\nconst isLabel = (element: Element): element is HTMLLabelElement => element.tagName.toLowerCase() === 'label';\n\nconst willBeHandledByAssociatedElement = (eventTarget: Element, clickableElement: HTMLElement) => {\n    const nearestLabel = findClosestParent(eventTarget, isLabel);\n\n    if (nearestLabel === null) {\n        return false;\n    }\n\n    const associatedElementId = nearestLabel.getAttribute('for');\n\n    if (!associatedElementId) {\n        return false;\n    }\n\n    return associatedElementId === clickableElement.id;\n};\n\nconst portalContainerId = 'portal-container';\n\n// Due to event propagation from portal to React tree we have to manually exclude these events.\n// https://github.com/facebook/react/issues/11387\nconst willBubbleOutsideOfPortal = (eventTarget: Node | null, clickableElement: HTMLElement) => {\n    let potentialPortalContainer = eventTarget;\n    let previouslyCheckedElement: Node | null = null;\n\n    while (potentialPortalContainer) {\n        if (potentialPortalContainer instanceof HTMLElement && potentialPortalContainer.id === portalContainerId) {\n            // If we find a container, we are sure that the previous element is a root element for one of the portals.\n            // Then we only check whether the clickable element is part of that particular portal's tree so that\n            // multiple portals do not interfere with each other.\n            // If previouslyCheckedElement is null it means that event target is portal container itself.\n            // Then we treat an event as if it would bubble outside the portal.\n            return !previouslyCheckedElement || !previouslyCheckedElement.contains(clickableElement);\n        }\n\n        previouslyCheckedElement = potentialPortalContainer;\n        potentialPortalContainer = potentialPortalContainer.parentElement;\n    }\n\n    return false;\n};\n\nconst shouldIgnoreEvent = (eventTarget: EventTarget, clickableElement: HTMLElement | null) =>\n    clickableElement === null ||\n    !(eventTarget instanceof Element) ||\n    clickableElement.contains(eventTarget) ||\n    willBeHandledByAssociatedElement(eventTarget, clickableElement) ||\n    willBubbleOutsideOfPortal(eventTarget, clickableElement);\n\nexport const useClickProxyAllowingTextSelection = <TClickableElement extends HTMLElement>() => {\n    const clickableRef = React.useRef<TClickableElement>(null);\n\n    const onProxyMouseDown = (event: React.MouseEvent<HTMLElement, MouseEvent>) => {\n        if (shouldIgnoreEvent(event.target, clickableRef.current)) {\n            return;\n        }\n\n        if (event.button === MouseButton.Left) {\n            const userSelection = getSelection();\n\n            if (isNonEmpty(userSelection)) {\n                userSelection.removeAllRanges();\n            }\n        }\n\n        if (event.button === MouseButton.Middle) {\n            event.preventDefault();\n        }\n    };\n\n    const onProxyMouseUp = (event: React.MouseEvent<HTMLElement, MouseEvent>) => {\n        if (shouldIgnoreEvent(event.target, clickableRef.current)) {\n            return;\n        }\n\n        if (event.button === MouseButton.Left) {\n            if (isNonEmpty(getSelection())) {\n                return;\n            }\n\n            clickableRef.current?.click();\n            clickableRef.current?.focus();\n        }\n\n        if (event.button === MouseButton.Middle) {\n            const eventCopy = new MouseEvent('click', { button: event.button, bubbles: true });\n\n            clickableRef.current?.dispatchEvent(eventCopy);\n        }\n    };\n\n    return { clickableRef, onProxyMouseDown, onProxyMouseUp };\n};\n","// extracted by mini-css-extract-plugin\nexport default {\"Variant--lightGreyPrimary\":\"scB0V2YOXdrvrz_31_Sh\",\"Variant--lightGreySecondary\":\"wehGkJJ4r0sODDD_bGYU\",\"Variant--hasLink\":\"KfU6iJxklWZbYVZvHgox\",\"Variant--blackPrimary\":\"GVCcM3ty8VKYbJ2XT_Dk\",\"Variant--blackSecondary\":\"UjmWBHmG7byBqb6gBbH2\",\"Variant--darkGreyPrimary\":\"P8IhNmW1TiVNhzg8l5du\",\"Variant--darkGreySecondary\":\"AKTcwRYEKdBRbFEGAuOs\",\"Variant--darkRed\":\"LQwCx4VsA_20nL7PJl_A\",\"Variant--darkTransparent\":\"NFqvF1i5W73QPVnRoVRy\",\"Variant--lightTransparent\":\"tQw_ZqnEHaMnd30McsXW\",\"Variant--yellow\":\"ypRWIt78iWMmiPgWpgTu\",\"Variant--blue\":\"lPilJeSyiKAPS2CnbGOF\",\"Variant--legacy\":\"n_nI7FDHViBwqxpTOnMz\",\"Variant--rounded\":\"UmvrEMqsi3eWsu4AYzIA\",\"Variant--stretched\":\"IZTOdolcpgFPp5vAIVSf\",\"Variant--shadowed\":\"TlIPHGWdLjpQ9IQms3CI\"};","// extracted by mini-css-extract-plugin\nexport default {\"ContentCardLayout\":\"TYcoq9Rh8z7xyECZudNA\",\"Title\":\"ZiduBuPrxHXQhabvP6SQ\",\"Description\":\"BrxHX8d3IdyRW2EN5wWq\",\"Link\":\"gYkAa9g2NSCw73nq6w8P\",\"CircleButtonIcon\":\"ZZTVQHAQYCpOyObqO2AO\",\"Variant--legacy\":\"STpu5uTZEMz75zQlmbC9\",\"Variant--small\":\"yFuZXJJzMoZuou2MlCag\",\"Variant--medium\":\"vGU3wY5NP4zzq72ipLZ_\",\"Variant--large\":\"H2ATcrVqPu3W6eDBxJFi\",\"Variant--lightGreyPrimary\":\"LJogGaMDWMkAWNeNWLSA\",\"Variant--lightGreySecondary\":\"mIe9e6g2IgauQlQk1tRE\",\"Variant--blackPrimary\":\"mUg4eEAIUffj8Zar9HZK\",\"Variant--blackSecondary\":\"nI5bu_huwuVlYZjBFVle\",\"Variant--darkGreyPrimary\":\"r3q3Zu2ThUoWQlR0iiU9\",\"Variant--darkGreySecondary\":\"Q8FbMy7lWEMLqZ1WEZQq\",\"Variant--darkRed\":\"lwj1fS09bnWFOXW1AKFu\",\"Variant--darkTransparent\":\"yLDL7bcFO75sCL4vqZyD\",\"Variant--lightTransparent\":\"NyI9CyT88UVrxbfIWHRP\",\"Variant--yellow\":\"phcqoXrguA5MYUpXJuAx\",\"Variant--blue\":\"y1POrm4bkXIOXKM9V9E6\",\"Variant--stretched\":\"la0uKOQNZdLd8OUc_QfI\",\"CardWithLink\":\"VC_CHutChDPYnxQJpTef\"};"],"names":["ContentCardBlockVariant","getButtonTier","variant","LightGreyPrimary","DarkGreyPrimary","Yellow","Blue","LightTransparent","ButtonTier","Primary","LightGreySecondary","DarkGreySecondary","BlackSecondary","Secondary","BlackPrimary","DarkRed","DarkTransparent","Tertiary","Legacy","LegacyPrimary","ContentCardLayout","props","title","description","callToActionLink","useLegacyLink","buttonType","linkRef","size","stretched","hasLink","undefined","href","React","className","classNames","styles","concat","Title","Description","getButton","ref","Link","_extends","showIsExternal","type","LinkType","Clear","label","SvgIcon","iconName","CircleButtonIcon","Button","buttonSize","ButtonSize","Large","buttonTier","MouseButton","isNonEmpty","selection","isEmpty","toString","isLabel","element","tagName","toLowerCase","shouldIgnoreEvent","eventTarget","clickableElement","Element","contains","willBeHandledByAssociatedElement","nearestLabel","findClosestParent","associatedElementId","getAttribute","id","willBubbleOutsideOfPortal","potentialPortalContainer","previouslyCheckedElement","HTMLElement","parentElement","useClickProxyAllowingTextSelection","clickableRef","onProxyMouseDown","event","target","current","button","Left","userSelection","getSelection","removeAllRanges","Middle","preventDefault","onProxyMouseUp","_clickableRef$current","_clickableRef$current2","click","focus","_clickableRef$current3","eventCopy","MouseEvent","bubbles","dispatchEvent"],"sourceRoot":""}