{"version":3,"sources":["webpack:///./Avensia.Common/Features/Shared/Breadcrumbs/index.tsx"],"names":["Li","li","marginLeft","content","PathLink","color","textDecoration","CurrentLink","fontWeight","placeholderBreadcrum","text","url","state","isVariationPage","currentPage","dispatch","navigateMainMenu","key","props","Div","css","compose","row","breadcrumbs","slice","isSliced","map","breadcrumb","index","length","Item","itemProp","to","onClick","e","charAt","toUpperCase","substr","toLowerCase","String","display","flexFlow","justifyContent","lineHeight"],"mappings":"2LA4BMA,EAAK,IAAOC,GAAG,aACnBC,WAAY,aAAa,IACtB,YAAO,0BAA2B,CACnCC,QAAS,MACTD,WAAY,aAAa,OAIvBE,EAAW,YAAO,IAAM,CAC5BC,MAAO,KACP,SAAU,CACRC,eAAgB,aAElB,SAAU,CACRA,eAAgB,UAIdC,EAAc,YAAOH,EAAU,CACnCI,WAAY,SAGRC,EAAuB,CAC3B,CACEC,KAAM,GACNC,IAAK,MAIM,gBACb,aACE,SAACC,GAA4B,OAC3BC,gBAAiB,YAAgBD,EAAME,iBAGzC,SAACC,GAAkC,OACjCC,iBAAA,SAAiBC,GACfF,EAAS,YAAiBE,QAPhC,EAUE,SAACC,GAAoB,OACrB,kBAAC,IAAOC,IAAG,CAACC,IAAKF,EAAMG,WACrB,kBAAC,IAAE,CACDD,IAAG,EAUHE,KAAG,IAEDJ,EAAMK,aAAed,GACpBe,MAAMN,EAAMO,UAAY,EAAI,GAC5BC,KAAI,SAACC,EAAYC,EAAO,G,IAAEC,EAAA,EAAAA,OACnBC,EAAOZ,EAAML,iBAAmBe,IAAUC,EAAS,IAAMX,EAAMO,SAAWlB,EAAcH,EAE9F,OACE,kBAACJ,EAAE,CAACiB,IAAKU,EAAWhB,IAAMiB,EAAOG,SAAS,mBACxC,kBAACD,EAAI,CAACE,GAAIL,EAAWhB,IAAKoB,SAAS,OAAOE,QAAS,SAACC,GAAM,OAAAhB,EAAMF,iBAAiBW,EAAWhB,OAC/E,IAAViB,GAAgBV,EAAMO,SAEnBE,EAAWjB,KAAKyB,OAAO,GAAGC,cAAgBT,EAAWjB,KAAK2B,OAAO,GAAGC,cADpE,aAAU,8BAGhB,0BAAMP,SAAS,WAAW5B,QAASoC,OAAOX,EAAQ,e,WAvBxDvB,MAAO,KACPmC,QAAS,cACTC,SAAU,WACVC,eAAgB,SAChBC,WAAY,WACX,MAAsB,CACrBD,eAAgB,c","file":"assets/1.chunk.f786876f772582f95b83.js","sourcesContent":["import React from 'react';\r\nimport { translate } from '@avensia/scope';\r\nimport Link from 'Shared/Link';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { pseudo } from '@glitz/core';\r\nimport BreadcrumbsViewModel from './BreadcrumbsViewModel.type';\r\nimport Ul from '../Generic/Ul';\r\nimport { scorpion, minMediumMediaQuery, pixelsToUnit } from 'Shared/Style';\r\nimport connect from 'Shared/connect';\r\nimport isVariationPage from 'Product/current-page-is-variation';\r\nimport { ItemKeyType } from 'SiteLayout/MainMenu/item';\r\nimport { navigateMainMenu } from 'SiteLayout/MainMenu/action-creators';\r\n\r\ntype RequiredPropType = {\r\n breadcrumbs: BreadcrumbsViewModel[];\r\n isSliced?: boolean;\r\n};\r\n\r\ntype ConnectStateType = {\r\n isVariationPage: boolean;\r\n};\r\n\r\ntype ConnectDispatchType = {\r\n navigateMainMenu: (key: ItemKeyType) => void;\r\n};\r\n\r\ntype PropType = RequiredPropType & ConnectStateType & StyledProps & ConnectDispatchType;\r\n\r\nconst Li = styled.li({\r\n marginLeft: pixelsToUnit(5),\r\n ...pseudo(':not(:last-child):after', {\r\n content: '\"/\"',\r\n marginLeft: pixelsToUnit(5),\r\n }),\r\n});\r\n\r\nconst PathLink = styled(Link, {\r\n color: scorpion,\r\n ':hover': {\r\n textDecoration: 'underline',\r\n },\r\n ':focus': {\r\n textDecoration: 'none',\r\n },\r\n});\r\n\r\nconst CurrentLink = styled(PathLink, {\r\n fontWeight: 'bold',\r\n});\r\n\r\nconst placeholderBreadcrum = [\r\n {\r\n text: '',\r\n url: '/',\r\n },\r\n] as BreadcrumbsViewModel[];\r\n\r\nexport default styled(\r\n connect(\r\n (state): ConnectStateType => ({\r\n isVariationPage: isVariationPage(state.currentPage),\r\n }),\r\n\r\n (dispatch): ConnectDispatchType => ({\r\n navigateMainMenu(key: ItemKeyType) {\r\n dispatch(navigateMainMenu(key));\r\n },\r\n }),\r\n )((props: PropType) => (\r\n \r\n \r\n {(props.breadcrumbs || placeholderBreadcrum)\r\n .slice(props.isSliced ? -1 : 0)\r\n .map((breadcrumb, index, { length }) => {\r\n const Item = props.isVariationPage && index === length - 1 && !props.isSliced ? CurrentLink : PathLink;\r\n\r\n return (\r\n
  • \r\n props.navigateMainMenu(breadcrumb.url)}>\r\n {index === 0 && !props.isSliced\r\n ? translate('/Shared/Breadcrumbs/Start')\r\n : breadcrumb.text.charAt(0).toUpperCase() + breadcrumb.text.substr(1).toLowerCase()}\r\n \r\n \r\n
  • \r\n );\r\n })}\r\n \r\n
    \r\n )),\r\n);\r\n"],"sourceRoot":""}