@rededor/site-front-end-lib 20.0.33 → 20.0.35
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.
- package/README.md +124 -124
- package/core/index.d.ts +45 -3
- package/fesm2022/rededor-site-front-end-lib-components-algolia-dropdown.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-algolia-dropdown.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-algolia-search.mjs +10 -10
- package/fesm2022/rededor-site-front-end-lib-components-algolia-search.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-banner.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-banner.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-breadcrumbs.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-cards.mjs +6 -6
- package/fesm2022/rededor-site-front-end-lib-components-cards.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-carousels.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-carousels.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-cta-wrapper.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-cta-wrapper.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-error.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-error.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-generic.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-generic.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-planos-convenios.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-planos-convenios.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-footer.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-footer.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-action.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-header-components-action.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-auxiliar.mjs +4 -4
- package/fesm2022/rededor-site-front-end-lib-components-header-components-auxiliar.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-main.mjs +4 -4
- package/fesm2022/rededor-site-front-end-lib-components-header-components-main.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-side.mjs +4 -4
- package/fesm2022/rededor-site-front-end-lib-components-header-components-side.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-services.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-header.mjs +4 -4
- package/fesm2022/rededor-site-front-end-lib-components-header.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-image.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-image.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-load-screen.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-load-screen.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-modal-drawer.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-modal-drawer.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-modal.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-modal.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-overlay.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-overlay.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-header.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-page-header.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-template-fullcontent.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-page-template-fullcontent.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-template-sidebar.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-page-template-sidebar.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-pagination.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-pagination.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-search.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-search.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-section-navigation.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-section-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-side-ctas.mjs +10 -10
- package/fesm2022/rededor-site-front-end-lib-components-side-ctas.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-components-whatsapp.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-components-whatsapp.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-core.mjs +293 -1
- package/fesm2022/rededor-site-front-end-lib-core.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-accordion.mjs +4 -4
- package/fesm2022/rededor-site-front-end-lib-cura-accordion.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-api.mjs +8 -8
- package/fesm2022/rededor-site-front-end-lib-cura-api.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-counter.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-counter.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-distance.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-distance.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-dot.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-dot.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-pill.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-pill.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-outline.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-outline.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-select.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-select.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-transparent.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-transparent.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-cards-cura-card.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-cards-cura-card.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-alert.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-alert.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-modal.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-modal.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-checkbox.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-checkbox.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-input-text.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-input-text.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-label.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-label.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-radio.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-radio.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-option.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-option.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-state.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-state.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-switch.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-switch.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-textarea.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-textarea.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-icons-cura-icon.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-icons-cura-icon.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-bar.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-bar.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-circle.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-circle.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-display.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-display.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-heading.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-heading.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-paragraph.mjs +2 -2
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-paragraph.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-enums.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-algolia-search-api.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-algolia.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-ngu-carousel.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-ssr-loading.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-services-youtube.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib-shared.mjs.map +1 -1
- package/fesm2022/rededor-site-front-end-lib.mjs.map +1 -1
- package/package.json +2 -1
- package/styles/_breakpoints.scss +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-sticky-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.ts","../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.html","../../../projects/site-front-end-lib/components/sticky-navigation/rededor-site-front-end-lib-components-sticky-navigation.ts"],"sourcesContent":["import {\n Component,\n ElementRef,\n Input,\n signal,\n HostListener,\n HostBinding,\n inject,\n input,\n output,\n viewChildren,\n PLATFORM_ID,\n DOCUMENT,\n AfterViewInit,\n} from '@angular/core';\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\nimport { Router } from '@angular/router';\nimport { isPlatformBrowser, Location } from '@angular/common';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'nav[rdsite-sticky-navigation]',\n imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent],\n templateUrl: './sticky-navigation.component.html',\n styleUrl: './sticky-navigation.component.scss',\n})\nexport class StickyNavigationComponent implements AfterViewInit {\n private curaApiService = inject(CuraApiService);\n private router = inject(Router);\n private location = inject(Location);\n private platformId = inject(PLATFORM_ID);\n private document = inject<Document>(DOCUMENT);\n\n public readonly sections = signal<SectionNavigationData[]>([]);\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\n readonly activeSection = signal<string>('');\n readonly isOpen = signal<boolean>(false);\n public selectedIndex = signal<number>(0);\n public defaultAnchorAdjustment = signal(0);\n\n private menuHeaderHeight = 0;\n private menuStickyClosedHeight = 0;\n\n readonly anchorAdjustment = input(0);\n readonly title = input('Nesta página');\n readonly ariaLabel = input('Navegação da página');\n readonly padding = input(20);\n\n @Input({ required: true })\n set navigationSections(value: SectionNavigationData[]) {\n if (!value?.length) {\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\n }\n this.sections.set(value);\n\n if (!this.activeSection()) {\n this.activeSection.set(value[0].id);\n }\n }\n\n @Input()\n set navigationConfig(value: SectionNavigationConfig) {\n this.config.set(value);\n }\n\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\n readonly sectionChange = output<SectionNavigationData>();\n\n @HostListener('window:scroll')\n onWindowScroll(): void {\n this.windowScroll();\n }\n\n @HostBinding('style') styleBinding = {\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n };\n\n ngAfterViewInit(): void {\n if (isPlatformBrowser(this.platformId)) {\n setTimeout(() => {\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\n this.menuStickyClosedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\n }, 200);\n }\n }\n\n private windowScroll(): void {\n this.sections()?.forEach((section, index) => {\n const element = this.document.querySelector<HTMLElement>(`#${section.id}`);\n if (!element) return;\n\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.menuStickyClosedHeight + this.padding();\n\n if (currentScroll >= elementTop) {\n this.selectedIndex.set(index);\n if (this.sections()?.[this.selectedIndex()]) {\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\n }\n }\n });\n }\n\n getBasePath(): string {\n const base = this.location.prepareExternalUrl('');\n const normalized = base.replace(/\\/$/, '');\n\n return normalized === '' || normalized === '/' ? '' : normalized;\n }\n\n getPath(sectionId: string): string {\n return `${this.getBasePath()}${this.router.url}#${sectionId}`;\n }\n\n onSectionClick(event: SectionNavigationData) {\n this.sectionChange.emit(event);\n this.isOpen.update((value) => !value);\n }\n\n toggleOpen(): void {\n this.isOpen.update((value) => !value);\n if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment()) {\n setTimeout(() => {\n // Utilizo o timeout para pegar a altura do elemento depois dele aberto\n const menuStickyOpenedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\n this.defaultAnchorAdjustment.set(menuStickyOpenedHeight + this.menuHeaderHeight);\n }, 100);\n }\n }\n}\n","<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\n @if (title()) {\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\n <b>{{ title() }}</b>\n </cura-paragraph>\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\n </div>\n @if (sections().length && !isOpen()) {\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\n <b>{{ sections()[selectedIndex()].title }}</b>\n </cura-paragraph>\n }\n }\n\n @if (isOpen()) {\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\n @for (section of sections(); track section.id) {\n <li role=\"none\">\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\n <a\n id=\"anchor-{{ section.id }}\"\n class=\"rdsite-sticky-link\"\n role=\"menuitem\"\n [href]=\"getPath(section.id)\"\n rdsitelink\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\n [attr.aria-label]=\"'Navegar para ' + section.title\"\n >\n <b>{{ section.title }}</b>\n </a>\n </cura-paragraph>\n </li>\n }\n </ul>\n }\n</nav>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CA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AA,EAAA,MAAA,EAAA,CAAA,koBAAA,CAAA,EAAA;;sBA0BxE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAYxB;4DAKgE,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AE5EtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-sticky-navigation.mjs","sources":["../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.ts","../../../projects/site-front-end-lib/components/sticky-navigation/sticky-navigation.component.html","../../../projects/site-front-end-lib/components/sticky-navigation/rededor-site-front-end-lib-components-sticky-navigation.ts"],"sourcesContent":["import {\r\n Component,\r\n ElementRef,\r\n Input,\r\n signal,\r\n HostListener,\r\n HostBinding,\r\n inject,\r\n input,\r\n output,\r\n viewChildren,\r\n PLATFORM_ID,\r\n DOCUMENT,\r\n AfterViewInit,\r\n} from '@angular/core';\r\nimport { RdsiteLinkDirective, SectionNavigationConfig, SectionNavigationData } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { CuraParagraphComponent } from '@rededor/site-front-end-lib/cura/texts/cura-paragraph';\r\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\r\nimport { Router } from '@angular/router';\r\nimport { isPlatformBrowser, Location } from '@angular/common';\r\n\r\n@Component({\r\n // eslint-disable-next-line @angular-eslint/component-selector\r\n selector: 'nav[rdsite-sticky-navigation]',\r\n imports: [RdsiteLinkDirective, CuraParagraphComponent, CuraIconComponent],\r\n templateUrl: './sticky-navigation.component.html',\r\n styleUrl: './sticky-navigation.component.scss',\r\n})\r\nexport class StickyNavigationComponent implements AfterViewInit {\r\n private curaApiService = inject(CuraApiService);\r\n private router = inject(Router);\r\n private location = inject(Location);\r\n private platformId = inject(PLATFORM_ID);\r\n private document = inject<Document>(DOCUMENT);\r\n\r\n public readonly sections = signal<SectionNavigationData[]>([]);\r\n readonly config = signal<SectionNavigationConfig | undefined>(undefined);\r\n readonly activeSection = signal<string>('');\r\n readonly isOpen = signal<boolean>(false);\r\n public selectedIndex = signal<number>(0);\r\n public defaultAnchorAdjustment = signal(0);\r\n\r\n private menuHeaderHeight = 0;\r\n private menuStickyClosedHeight = 0;\r\n\r\n readonly anchorAdjustment = input(0);\r\n readonly title = input('Nesta página');\r\n readonly ariaLabel = input('Navegação da página');\r\n readonly padding = input(20);\r\n\r\n @Input({ required: true })\r\n set navigationSections(value: SectionNavigationData[]) {\r\n if (!value?.length) {\r\n throw new Error('O SectionNavigationComponent requer pelo menos uma seção.');\r\n }\r\n this.sections.set(value);\r\n\r\n if (!this.activeSection()) {\r\n this.activeSection.set(value[0].id);\r\n }\r\n }\r\n\r\n @Input()\r\n set navigationConfig(value: SectionNavigationConfig) {\r\n this.config.set(value);\r\n }\r\n\r\n readonly anchorsEl = viewChildren<ElementRef<HTMLAnchorElement>>('anchorEl');\r\n readonly sectionChange = output<SectionNavigationData>();\r\n\r\n @HostListener('window:scroll')\r\n onWindowScroll(): void {\r\n this.windowScroll();\r\n }\r\n\r\n @HostBinding('style') styleBinding = {\r\n '--neutral-purewhite': this.curaApiService.theme.colors.getColor('neutral-purewhite'),\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n };\r\n\r\n ngAfterViewInit(): void {\r\n if (isPlatformBrowser(this.platformId)) {\r\n setTimeout(() => {\r\n this.menuHeaderHeight = this.document.querySelector<HTMLElement>('header[sl-hdr]')?.offsetHeight || 0;\r\n this.menuStickyClosedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\r\n }, 200);\r\n }\r\n }\r\n\r\n private windowScroll(): void {\r\n this.sections()?.forEach((section, index) => {\r\n const element = this.document.querySelector<HTMLElement>(`#${section.id}`);\r\n if (!element) return;\r\n\r\n const elementTop = element.getBoundingClientRect().top + window.scrollY;\r\n const currentScroll = window.scrollY + this.menuHeaderHeight + this.menuStickyClosedHeight + this.padding();\r\n\r\n if (currentScroll >= elementTop) {\r\n this.selectedIndex.set(index);\r\n if (this.sections()?.[this.selectedIndex()]) {\r\n this.activeSection.set(this.sections()?.[this.selectedIndex()]?.id);\r\n }\r\n }\r\n });\r\n }\r\n\r\n getBasePath(): string {\r\n const base = this.location.prepareExternalUrl('');\r\n const normalized = base.replace(/\\/$/, '');\r\n\r\n return normalized === '' || normalized === '/' ? '' : normalized;\r\n }\r\n\r\n getPath(sectionId: string): string {\r\n return `${this.getBasePath()}${this.router.url}#${sectionId}`;\r\n }\r\n\r\n onSectionClick(event: SectionNavigationData) {\r\n this.sectionChange.emit(event);\r\n this.isOpen.update((value) => !value);\r\n }\r\n\r\n toggleOpen(): void {\r\n this.isOpen.update((value) => !value);\r\n if (isPlatformBrowser(this.platformId) && this.isOpen() && !this.anchorAdjustment()) {\r\n setTimeout(() => {\r\n // Utilizo o timeout para pegar a altura do elemento depois dele aberto\r\n const menuStickyOpenedHeight = this.document.querySelector<HTMLElement>('nav[rdsite-sticky-navigation]')?.offsetHeight || 0;\r\n this.defaultAnchorAdjustment.set(menuStickyOpenedHeight + this.menuHeaderHeight);\r\n }, 100);\r\n }\r\n }\r\n}\r\n","<nav class=\"rdsite-sticky-navigation\" [attr.aria-label]=\"ariaLabel()\" [style.top.px]=\"config()?.offsetTop || 0\">\r\n @if (title()) {\r\n <div class=\"title-bar\" (click)=\"toggleOpen()\" [attr.aria-expanded]=\"isOpen()\" role=\"button\" tabindex=\"0\" (keydown.enter)=\"toggleOpen()\">\r\n <cura-paragraph size=\"small\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\" marginBlock=\"8px\">\r\n <b>{{ title() }}</b>\r\n </cura-paragraph>\r\n <cura-icon [name]=\"isOpen() ? 'up' : 'down'\" size=\"16\" [color]=\"isOpen() ? 'neutraldark' : 'primary-base'\"></cura-icon>\r\n </div>\r\n @if (sections().length && !isOpen()) {\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" color=\"neutral-black\">\r\n <b>{{ sections()[selectedIndex()].title }}</b>\r\n </cura-paragraph>\r\n }\r\n }\r\n\r\n @if (isOpen()) {\r\n <ul class=\"menu\" [class.open]=\"isOpen()\" role=\"menubar\">\r\n @for (section of sections(); track section.id) {\r\n <li role=\"none\">\r\n <cura-paragraph size=\"xsmall\" marginBlock=\"8px\" [color]=\"activeSection() === section.id ? 'neutral-black' : 'primary-base'\">\r\n <a\r\n id=\"anchor-{{ section.id }}\"\r\n class=\"rdsite-sticky-link\"\r\n role=\"menuitem\"\r\n [href]=\"getPath(section.id)\"\r\n rdsitelink\r\n (click)=\"onSectionClick({ id: section.id, title: section.title })\"\r\n [anchorAdjustment]=\"anchorAdjustment() || defaultAnchorAdjustment()\"\r\n [attr.aria-current]=\"activeSection() === section.id ? 'page' : null\"\r\n [attr.aria-label]=\"'Navegar para ' + section.title\"\r\n >\r\n <b>{{ section.title }}</b>\r\n </a>\r\n </cura-paragraph>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n</nav>\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,yBAAyB,CAAA;AAPtC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAA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E;;sBAYxB;4DAKgE,UAAU,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,cAAA,EAAA,CAAA;sBAG1E,YAAY;uBAAC,eAAe;;sBAK5B,WAAW;uBAAC,OAAO;;;AE5EtB;;AAEG;;;;"}
|
|
@@ -31,11 +31,11 @@ class WhatsappComponent {
|
|
|
31
31
|
this.whatsappClick.emit(event);
|
|
32
32
|
}
|
|
33
33
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: WhatsappComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
34
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: WhatsappComponent, isStandalone: true, selector: "rdsite-whatsapp", inputs: { link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, imgUrl: { classPropertyName: "imgUrl", publicName: "imgUrl", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgHover: { classPropertyName: "bgHover", publicName: "bgHover", isSignal: true, isRequired: false, transformFunction: null }, borderTop: { classPropertyName: "borderTop", publicName: "borderTop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { whatsappClick: "whatsappClick" }, host: { properties: { "style": "this.style" } }, ngImport: i0, template: "@if (link()) {\n <a\n class=\"rdsite-whatsapp\"\n [ngClass]=\"{ 'border-top': borderTop() }\"\n [href]=\"link()\"\n rdsitelink\n (mouseenter)=\"active = true\"\n (mouseleave)=\"active = false\"\n (click)=\"whatsappClicked($event)\"\n >\n @if (imgUrl()) {\n <div class=\"image\" [ngStyle]=\"{ 'background-image': imgUrl() }\"></div>\n }\n <div class=\"icon\" [ngClass]=\"{ active: active }\">\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\n </div>\n\n <div class=\"rdsite-whatsapp-animation\" [ngClass]=\"{ active: active }\">\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\n <span>{{ text() }}</span>\n </div>\n </a>\n}\n", styles: [":host{display:flex;justify-content:flex-end;width:536px;position:absolute;bottom:0;right:0;pointer-events:none}:host *{font-family:var(--font-family)}:host a.rdsite-whatsapp{box-sizing:content-box;display:block;position:relative;width:88px;height:88px;transition:background-color .25s linear!important;pointer-events:all;background-color:var(--bg-color)}:host a.rdsite-whatsapp .image{position:absolute;right:0;bottom:0;width:88px;height:88px;background-size:cover;background-position:50%}:host a.rdsite-whatsapp .icon{width:24px;height:24px;background-color:var(--bg-button);border-radius:50%;display:flex;align-items:center;justify-content:center;position:absolute;bottom:8px;right:8px}:host a.rdsite-whatsapp .icon.active{display:none}:host .rdsite-whatsapp-animation{background-color:var(--bg-button);width:0px;height:88px;position:absolute;bottom:0;right:88px;transition:width .5s ease-out,background-color .25s linear;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;color:var(--color-button)}:host .rdsite-whatsapp-animation cura-icon{--color: var(--color-button) !important}:host .rdsite-whatsapp-animation span{text-wrap:nowrap}:host .rdsite-whatsapp-animation.active{width:calc(100vw - 88px);pointer-events:all}:host .rdsite-whatsapp-animation:hover{background-color:var(--bg-button-hover);color:var(--color-button-hover)}:host .rdsite-whatsapp-animation:hover cura-icon{--color: var(--color-button-hover) !important}@media only screen and (min-width:1024px){:host a.rdsite-whatsapp.border-top{border-top:4px solid var(--border-top-color)}:host a.rdsite-whatsapp .rdsite-whatsapp-animation.active{width:448px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraIconComponent, selector: "cura-icon", inputs: ["name", "color", "size", "iconset", "disabled"] }] }); }
|
|
34
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.18", type: WhatsappComponent, isStandalone: true, selector: "rdsite-whatsapp", inputs: { link: { classPropertyName: "link", publicName: "link", isSignal: true, isRequired: false, transformFunction: null }, imgUrl: { classPropertyName: "imgUrl", publicName: "imgUrl", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, bgColor: { classPropertyName: "bgColor", publicName: "bgColor", isSignal: true, isRequired: false, transformFunction: null }, bgHover: { classPropertyName: "bgHover", publicName: "bgHover", isSignal: true, isRequired: false, transformFunction: null }, borderTop: { classPropertyName: "borderTop", publicName: "borderTop", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { whatsappClick: "whatsappClick" }, host: { properties: { "style": "this.style" } }, ngImport: i0, template: "@if (link()) {\r\n <a\r\n class=\"rdsite-whatsapp\"\r\n [ngClass]=\"{ 'border-top': borderTop() }\"\r\n [href]=\"link()\"\r\n rdsitelink\r\n (mouseenter)=\"active = true\"\r\n (mouseleave)=\"active = false\"\r\n (click)=\"whatsappClicked($event)\"\r\n >\r\n @if (imgUrl()) {\r\n <div class=\"image\" [ngStyle]=\"{ 'background-image': imgUrl() }\"></div>\r\n }\r\n <div class=\"icon\" [ngClass]=\"{ active: active }\">\r\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\r\n </div>\r\n\r\n <div class=\"rdsite-whatsapp-animation\" [ngClass]=\"{ active: active }\">\r\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\r\n <span>{{ text() }}</span>\r\n </div>\r\n </a>\r\n}\r\n", styles: [":host{display:flex;justify-content:flex-end;width:536px;position:absolute;bottom:0;right:0;pointer-events:none}:host *{font-family:var(--font-family)}:host a.rdsite-whatsapp{box-sizing:content-box;display:block;position:relative;width:88px;height:88px;transition:background-color .25s linear!important;pointer-events:all;background-color:var(--bg-color)}:host a.rdsite-whatsapp .image{position:absolute;right:0;bottom:0;width:88px;height:88px;background-size:cover;background-position:50%}:host a.rdsite-whatsapp .icon{width:24px;height:24px;background-color:var(--bg-button);border-radius:50%;display:flex;align-items:center;justify-content:center;position:absolute;bottom:8px;right:8px}:host a.rdsite-whatsapp .icon.active{display:none}:host .rdsite-whatsapp-animation{background-color:var(--bg-button);width:0px;height:88px;position:absolute;bottom:0;right:88px;transition:width .5s ease-out,background-color .25s linear;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;color:var(--color-button)}:host .rdsite-whatsapp-animation cura-icon{--color: var(--color-button) !important}:host .rdsite-whatsapp-animation span{text-wrap:nowrap}:host .rdsite-whatsapp-animation.active{width:calc(100vw - 88px);pointer-events:all}:host .rdsite-whatsapp-animation:hover{background-color:var(--bg-button-hover);color:var(--color-button-hover)}:host .rdsite-whatsapp-animation:hover cura-icon{--color: var(--color-button-hover) !important}@media only screen and (min-width: 1024px){:host a.rdsite-whatsapp.border-top{border-top:4px solid var(--border-top-color)}:host a.rdsite-whatsapp .rdsite-whatsapp-animation.active{width:448px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: RdsiteLinkDirective, selector: "[rdsitelink]", inputs: ["anchorAdjustment", "anchorExtraAdjustment", "phonemodal"] }, { kind: "component", type: CuraIconComponent, selector: "cura-icon", inputs: ["name", "color", "size", "iconset", "disabled"] }] }); }
|
|
35
35
|
}
|
|
36
36
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImport: i0, type: WhatsappComponent, decorators: [{
|
|
37
37
|
type: Component,
|
|
38
|
-
args: [{ selector: 'rdsite-whatsapp', imports: [CommonModule, RdsiteLinkDirective, CuraIconComponent], template: "@if (link()) {\n <a\n class=\"rdsite-whatsapp\"\n [ngClass]=\"{ 'border-top': borderTop() }\"\n [href]=\"link()\"\n rdsitelink\n (mouseenter)=\"active = true\"\n (mouseleave)=\"active = false\"\n (click)=\"whatsappClicked($event)\"\n >\n @if (imgUrl()) {\n <div class=\"image\" [ngStyle]=\"{ 'background-image': imgUrl() }\"></div>\n }\n <div class=\"icon\" [ngClass]=\"{ active: active }\">\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\n </div>\n\n <div class=\"rdsite-whatsapp-animation\" [ngClass]=\"{ active: active }\">\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\n <span>{{ text() }}</span>\n </div>\n </a>\n}\n", styles: [":host{display:flex;justify-content:flex-end;width:536px;position:absolute;bottom:0;right:0;pointer-events:none}:host *{font-family:var(--font-family)}:host a.rdsite-whatsapp{box-sizing:content-box;display:block;position:relative;width:88px;height:88px;transition:background-color .25s linear!important;pointer-events:all;background-color:var(--bg-color)}:host a.rdsite-whatsapp .image{position:absolute;right:0;bottom:0;width:88px;height:88px;background-size:cover;background-position:50%}:host a.rdsite-whatsapp .icon{width:24px;height:24px;background-color:var(--bg-button);border-radius:50%;display:flex;align-items:center;justify-content:center;position:absolute;bottom:8px;right:8px}:host a.rdsite-whatsapp .icon.active{display:none}:host .rdsite-whatsapp-animation{background-color:var(--bg-button);width:0px;height:88px;position:absolute;bottom:0;right:88px;transition:width .5s ease-out,background-color .25s linear;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;color:var(--color-button)}:host .rdsite-whatsapp-animation cura-icon{--color: var(--color-button) !important}:host .rdsite-whatsapp-animation span{text-wrap:nowrap}:host .rdsite-whatsapp-animation.active{width:calc(100vw - 88px);pointer-events:all}:host .rdsite-whatsapp-animation:hover{background-color:var(--bg-button-hover);color:var(--color-button-hover)}:host .rdsite-whatsapp-animation:hover cura-icon{--color: var(--color-button-hover) !important}@media only screen and (min-width:1024px){:host a.rdsite-whatsapp.border-top{border-top:4px solid var(--border-top-color)}:host a.rdsite-whatsapp .rdsite-whatsapp-animation.active{width:448px}}\n"] }]
|
|
38
|
+
args: [{ selector: 'rdsite-whatsapp', imports: [CommonModule, RdsiteLinkDirective, CuraIconComponent], template: "@if (link()) {\r\n <a\r\n class=\"rdsite-whatsapp\"\r\n [ngClass]=\"{ 'border-top': borderTop() }\"\r\n [href]=\"link()\"\r\n rdsitelink\r\n (mouseenter)=\"active = true\"\r\n (mouseleave)=\"active = false\"\r\n (click)=\"whatsappClicked($event)\"\r\n >\r\n @if (imgUrl()) {\r\n <div class=\"image\" [ngStyle]=\"{ 'background-image': imgUrl() }\"></div>\r\n }\r\n <div class=\"icon\" [ngClass]=\"{ active: active }\">\r\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\r\n </div>\r\n\r\n <div class=\"rdsite-whatsapp-animation\" [ngClass]=\"{ active: active }\">\r\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\r\n <span>{{ text() }}</span>\r\n </div>\r\n </a>\r\n}\r\n", styles: [":host{display:flex;justify-content:flex-end;width:536px;position:absolute;bottom:0;right:0;pointer-events:none}:host *{font-family:var(--font-family)}:host a.rdsite-whatsapp{box-sizing:content-box;display:block;position:relative;width:88px;height:88px;transition:background-color .25s linear!important;pointer-events:all;background-color:var(--bg-color)}:host a.rdsite-whatsapp .image{position:absolute;right:0;bottom:0;width:88px;height:88px;background-size:cover;background-position:50%}:host a.rdsite-whatsapp .icon{width:24px;height:24px;background-color:var(--bg-button);border-radius:50%;display:flex;align-items:center;justify-content:center;position:absolute;bottom:8px;right:8px}:host a.rdsite-whatsapp .icon.active{display:none}:host .rdsite-whatsapp-animation{background-color:var(--bg-button);width:0px;height:88px;position:absolute;bottom:0;right:88px;transition:width .5s ease-out,background-color .25s linear;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;color:var(--color-button)}:host .rdsite-whatsapp-animation cura-icon{--color: var(--color-button) !important}:host .rdsite-whatsapp-animation span{text-wrap:nowrap}:host .rdsite-whatsapp-animation.active{width:calc(100vw - 88px);pointer-events:all}:host .rdsite-whatsapp-animation:hover{background-color:var(--bg-button-hover);color:var(--color-button-hover)}:host .rdsite-whatsapp-animation:hover cura-icon{--color: var(--color-button-hover) !important}@media only screen and (min-width: 1024px){:host a.rdsite-whatsapp.border-top{border-top:4px solid var(--border-top-color)}:host a.rdsite-whatsapp .rdsite-whatsapp-animation.active{width:448px}}\n"] }]
|
|
39
39
|
}], propDecorators: { link: [{ type: i0.Input, args: [{ isSignal: true, alias: "link", required: false }] }], imgUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "imgUrl", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], bgColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgColor", required: false }] }], bgHover: [{ type: i0.Input, args: [{ isSignal: true, alias: "bgHover", required: false }] }], borderTop: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderTop", required: false }] }], whatsappClick: [{ type: i0.Output, args: ["whatsappClick"] }], style: [{
|
|
40
40
|
type: HostBinding,
|
|
41
41
|
args: ['style']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rededor-site-front-end-lib-components-whatsapp.mjs","sources":["../../../projects/site-front-end-lib/components/whatsapp/whatsapp.component.ts","../../../projects/site-front-end-lib/components/whatsapp/whatsapp.component.html","../../../projects/site-front-end-lib/components/whatsapp/rededor-site-front-end-lib-components-whatsapp.ts"],"sourcesContent":["import { Component, HostBinding, input, output, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RdsiteLinkDirective } from '@rededor/site-front-end-lib/core';\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\n\n@Component({\n selector: 'rdsite-whatsapp',\n imports: [CommonModule, RdsiteLinkDirective, CuraIconComponent],\n templateUrl: './whatsapp.component.html',\n styleUrl: './whatsapp.component.scss',\n})\nexport class WhatsappComponent {\n private curaApiService = inject(CuraApiService);\n\n readonly link = input<string>('');\n readonly imgUrl = input<string>('');\n readonly text = input<string>('Agende por Whatsapp');\n readonly bgColor = input<string>('#1DCD52');\n readonly bgHover = input<string>('#016720');\n readonly borderTop = input<boolean>(false);\n\n readonly whatsappClick = output<Event>();\n\n active: boolean = false;\n\n @HostBinding('style') style = {\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\n '--border-top-color': this.curaApiService.theme.colors.getColor('primary-light'),\n '--bg-color': this.curaApiService.theme.colors.getColor('primary-darker'),\n '--bg-button': this.bgColor(),\n '--bg-button-hover': this.bgHover(),\n '--color-button': this.curaApiService.theme.colors.getColor('neutral-black'),\n '--color-button-hover': this.curaApiService.theme.colors.getColor('neutral-white'),\n };\n\n whatsappClicked(event: Event) {\n this.whatsappClick.emit(event);\n }\n}\n","@if (link()) {\n <a\n class=\"rdsite-whatsapp\"\n [ngClass]=\"{ 'border-top': borderTop() }\"\n [href]=\"link()\"\n rdsitelink\n (mouseenter)=\"active = true\"\n (mouseleave)=\"active = false\"\n (click)=\"whatsappClicked($event)\"\n >\n @if (imgUrl()) {\n <div class=\"image\" [ngStyle]=\"{ 'background-image': imgUrl() }\"></div>\n }\n <div class=\"icon\" [ngClass]=\"{ active: active }\">\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\n </div>\n\n <div class=\"rdsite-whatsapp-animation\" [ngClass]=\"{ active: active }\">\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\n <span>{{ text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,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC;SACnF;AAKF,IAAA;AAHC,IAAA,eAAe,CAAC,KAAY,EAAA;AAC1B,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC;IAChC;+GA1BW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,05BCZ9B,
|
|
1
|
+
{"version":3,"file":"rededor-site-front-end-lib-components-whatsapp.mjs","sources":["../../../projects/site-front-end-lib/components/whatsapp/whatsapp.component.ts","../../../projects/site-front-end-lib/components/whatsapp/whatsapp.component.html","../../../projects/site-front-end-lib/components/whatsapp/rededor-site-front-end-lib-components-whatsapp.ts"],"sourcesContent":["import { Component, HostBinding, input, output, inject } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { RdsiteLinkDirective } from '@rededor/site-front-end-lib/core';\r\nimport { CuraApiService } from '@rededor/site-front-end-lib/cura/api';\r\nimport { CuraIconComponent } from '@rededor/site-front-end-lib/cura/icons/cura-icon';\r\n\r\n@Component({\r\n selector: 'rdsite-whatsapp',\r\n imports: [CommonModule, RdsiteLinkDirective, CuraIconComponent],\r\n templateUrl: './whatsapp.component.html',\r\n styleUrl: './whatsapp.component.scss',\r\n})\r\nexport class WhatsappComponent {\r\n private curaApiService = inject(CuraApiService);\r\n\r\n readonly link = input<string>('');\r\n readonly imgUrl = input<string>('');\r\n readonly text = input<string>('Agende por Whatsapp');\r\n readonly bgColor = input<string>('#1DCD52');\r\n readonly bgHover = input<string>('#016720');\r\n readonly borderTop = input<boolean>(false);\r\n\r\n readonly whatsappClick = output<Event>();\r\n\r\n active: boolean = false;\r\n\r\n @HostBinding('style') style = {\r\n '--font-family': this.curaApiService.theme.fonts.getFamily(''),\r\n '--border-top-color': this.curaApiService.theme.colors.getColor('primary-light'),\r\n '--bg-color': this.curaApiService.theme.colors.getColor('primary-darker'),\r\n '--bg-button': this.bgColor(),\r\n '--bg-button-hover': this.bgHover(),\r\n '--color-button': this.curaApiService.theme.colors.getColor('neutral-black'),\r\n '--color-button-hover': this.curaApiService.theme.colors.getColor('neutral-white'),\r\n };\r\n\r\n whatsappClicked(event: Event) {\r\n this.whatsappClick.emit(event);\r\n }\r\n}\r\n","@if (link()) {\r\n <a\r\n class=\"rdsite-whatsapp\"\r\n [ngClass]=\"{ 'border-top': borderTop() }\"\r\n [href]=\"link()\"\r\n rdsitelink\r\n (mouseenter)=\"active = true\"\r\n (mouseleave)=\"active = false\"\r\n (click)=\"whatsappClicked($event)\"\r\n >\r\n @if (imgUrl()) {\r\n <div class=\"image\" [ngStyle]=\"{ 'background-image': imgUrl() }\"></div>\r\n }\r\n <div class=\"icon\" [ngClass]=\"{ active: active }\">\r\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\r\n </div>\r\n\r\n <div class=\"rdsite-whatsapp-animation\" [ngClass]=\"{ active: active }\">\r\n <cura-icon name=\"whatsapp\" size=\"16\" color=\"neutral-purewhite\"></cura-icon>\r\n <span>{{ text() }}</span>\r\n </div>\r\n </a>\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAYa,iBAAiB,CAAA;AAN9B,IAAA,WAAA,GAAA;AAOU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAEtC,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE,gDAAC;AACxB,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,EAAE,kDAAC;AAC1B,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,qB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,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,05BCZ9B,syBAuBA,EAAA,MAAA,EAAA,CAAA,wnDAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDfY,YAAY,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,mBAAmB,8HAAE,iBAAiB,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FAInD,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,WAClB,CAAC,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAA,QAAA,EAAA,syBAAA,EAAA,MAAA,EAAA,CAAA,wnDAAA,CAAA,EAAA;;sBAkB9D,WAAW;uBAAC,OAAO;;;AE1BtB;;AAEG;;;;"}
|
|
@@ -1804,9 +1804,301 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.18", ngImpo
|
|
|
1804
1804
|
}]
|
|
1805
1805
|
}] });
|
|
1806
1806
|
|
|
1807
|
+
const ssrInitialization = (req, res, next) => {
|
|
1808
|
+
res.locals['requestId'] = v4();
|
|
1809
|
+
res.locals['startTime'] = Date.now();
|
|
1810
|
+
console.log(`SSR REQ ${res.locals['requestId']} => ${req.url} | HEADERS -> ${JSON.stringify(req.rawHeaders)}`);
|
|
1811
|
+
next();
|
|
1812
|
+
};
|
|
1813
|
+
|
|
1814
|
+
const DEFAULT_REDEDOR_LOGO_HTML = `<svg
|
|
1815
|
+
class="logo"
|
|
1816
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1817
|
+
width="160"
|
|
1818
|
+
height="38"
|
|
1819
|
+
viewBox="0 0 160 38"
|
|
1820
|
+
fill="none"
|
|
1821
|
+
>
|
|
1822
|
+
<path
|
|
1823
|
+
d="M94.714 35.5604C92.0424 34.3118 89.6803 33.6893 87.6278 33.6929C86.509 33.6929 85.6158 33.8469 84.9221 34.1639C84.2284 34.481 83.8797 34.886 83.8797 35.3771C83.8797 35.8683 84.2526 36.2403 84.9836 36.55C85.7146 36.8598 86.6619 37.0082 87.7808 37.0082C90.0036 37.0082 92.314 36.5256 94.7121 35.5604H94.714ZM96.6869 35.5861C98.3955 36.4547 100.289 36.9143 102.212 36.9276C105.039 36.9276 107.638 35.919 110.009 33.9019C113.332 31.0918 115.743 27.2481 117.242 22.3708C118.08 19.6353 118.5 17.0989 118.501 14.7616C118.494 13.2408 118.283 11.7275 117.874 10.2606C116.72 11.5882 115.646 12.9809 114.658 14.4317C113.699 15.8453 112.324 18.0628 110.531 21.0843C108.722 24.1387 107.208 26.4234 105.988 27.9384C104.652 29.5729 103.138 31.0593 101.474 32.3716C100.493 33.1474 98.8973 34.2189 96.6869 35.5861ZM118.419 9.73464C118.897 11.3329 119.144 12.9894 119.152 14.6553C119.128 17.3414 118.712 20.0102 117.915 22.5797C116.356 27.7955 113.794 31.8749 110.227 34.8182C108.003 36.728 105.145 37.7711 102.192 37.7504C101.228 37.7594 100.267 37.653 99.3293 37.4334C98.4752 37.2245 97.255 36.7865 95.6687 36.1194C92.8231 37.2593 90.1795 37.8298 87.7379 37.8311C86.7102 37.8545 85.6854 37.7134 84.7039 37.4132C84.2063 37.2561 83.7641 36.9639 83.4284 36.5702C83.111 36.241 82.9256 35.8101 82.9062 35.357C82.9062 34.5812 83.3414 33.9703 84.2116 33.5243C85.0818 33.0784 86.2523 32.8487 87.7229 32.8353C90.0353 32.8353 92.6863 33.5995 95.6762 35.1279C97.7272 33.7368 99.5776 32.0797 101.177 30.2017C102.248 28.9537 103.12 27.8633 103.788 26.903C104.456 25.9426 106.184 23.3714 108.957 19.16C111.12 15.9174 113.958 12.6186 117.472 9.26365C116.671 7.431 115.759 6.02596 114.736 5.04854C112.629 2.99231 109.791 1.96541 106.223 1.96785C101.532 1.96785 97.5584 3.52927 94.3037 6.65212C92.74 8.12695 91.4574 9.8648 90.5164 11.7836C89.7061 13.3872 89.2757 15.1503 89.2576 16.9406C89.2576 18.6658 89.8065 20.0604 90.9042 21.1246C91.9411 22.1435 93.3707 22.6536 95.1932 22.6549C97.7069 22.6549 100.12 21.6982 102.432 19.7849C105.576 17.1691 107.752 13.4757 108.959 8.70469L109.453 8.86046C108.976 11.9332 107.959 14.6443 106.402 16.9938C104.812 19.3762 102.848 21.1594 100.506 22.3085C98.8964 23.1199 97.114 23.5445 95.3051 23.5474C92.9431 23.5474 91.1311 22.766 89.8693 21.2034C88.7504 19.8216 88.2003 18.1227 88.2003 16.1214C88.2003 13.5557 88.958 11.0462 90.4735 8.5929C91.9672 6.1551 94.1004 4.1568 96.6496 2.80721C99.218 1.44738 102.077 0.766847 105.228 0.765625C109.415 0.765625 112.722 1.9764 115.15 4.39795C116.159 5.40224 117.119 6.83294 118.027 8.69003C120.052 6.93312 121.973 5.55619 123.789 4.55922L123.976 5.21348C122.294 6.25076 120.445 7.76026 118.428 9.74197L118.419 9.73464ZM125.742 1.59765H129.578V5.48838C129.578 7.05713 129.329 8.09564 128.832 8.60389C128.322 9.12803 127.401 9.42981 126.07 9.50923C125.859 9.46077 125.642 9.44043 125.425 9.44874V7.66924C126.04 7.66924 126.496 7.53362 126.792 7.26239C127.086 6.98932 127.224 6.46335 127.206 5.67898H125.733L125.742 1.59765Z"
|
|
1824
|
+
fill="#003DA5"
|
|
1825
|
+
/>
|
|
1826
|
+
<path
|
|
1827
|
+
d="M13.0739 25.5331C12.7851 25.8403 12.4182 26.0661 12.011 26.1874C11.4564 26.3271 10.8844 26.3888 10.3122 26.3706H4.22929V18.9814H10.1965C10.8212 18.9709 11.4455 19.0175 12.0613 19.1207C12.4985 19.1963 12.8946 19.4208 13.1802 19.7548C13.514 20.2404 13.6855 21.1696 13.6855 22.5312C13.6855 24.0083 13.4798 25.0071 13.0683 25.5276L13.0739 25.5331ZM14.0324 28.0933V28.0054C15.4086 27.7616 16.382 27.2888 16.9601 26.5924C17.6115 25.8373 17.936 24.2576 17.9335 21.8532C17.9335 19.6356 17.4909 18.0388 16.6058 17.0626C15.5988 15.9703 13.6719 15.4236 10.825 15.4236H0V37.0788H4.22929V29.915H10.1313C10.6821 29.902 11.2326 29.9506 11.7723 30.0598C12.1856 30.1581 12.5568 30.3819 12.8333 30.6994C13.1431 31.0479 13.3382 31.4804 13.3928 31.9401C13.4743 32.5605 13.5117 33.1857 13.5046 33.8112V37.0788H17.7545V33.0653C17.7545 31.4489 17.4903 30.2241 16.9619 29.3909C16.2999 28.6578 15.3209 28.2161 14.0342 28.097"
|
|
1828
|
+
fill="#003DA5"
|
|
1829
|
+
/>
|
|
1830
|
+
<path
|
|
1831
|
+
d="M21.0508 37.0716V15.4243H36.1759V18.9797H25.2801V24.4007H35.6183V27.7782H25.2801V33.5163H36.2337V37.0716H21.0508Z"
|
|
1832
|
+
fill="#003DA5"
|
|
1833
|
+
/>
|
|
1834
|
+
<path
|
|
1835
|
+
d="M54.3513 26.4257V27.8919C54.3513 29.8785 54.0672 31.2639 53.4991 32.0483C53.0777 32.6531 52.604 33.0489 52.0707 33.2359C51.4033 33.445 50.7047 33.5411 50.0045 33.5199H43.6308V18.9797H49.7099C51.1253 18.9797 52.1677 19.1629 52.839 19.5295C53.1489 19.6857 53.4213 19.9052 53.6381 20.1732C53.8548 20.4412 54.0109 20.7516 54.0958 21.0836C54.2674 21.758 54.3513 22.7329 54.3513 24.0158V26.4257ZM57.5755 18.5123C56.4181 16.4549 53.8944 15.4255 50.0045 15.4243H39.4033V37.0771H50.8511C51.6558 37.0697 52.4578 36.9844 53.2455 36.8224C53.9623 36.6969 54.6545 36.4612 55.2967 36.1241C57.5084 34.8449 58.6142 32.286 58.6142 28.4472V23.8289C58.6142 21.5539 58.2698 19.7824 57.5811 18.5142"
|
|
1836
|
+
fill="#003DA5"
|
|
1837
|
+
/>
|
|
1838
|
+
<path
|
|
1839
|
+
d="M61.3643 37.0716V15.4243H76.4894V18.9797H65.5935V24.4007H75.9318V27.7782H65.5935V33.5163H76.5472V37.0716H61.3643Z"
|
|
1840
|
+
fill="#003DA5"
|
|
1841
|
+
/>
|
|
1842
|
+
<path
|
|
1843
|
+
d="M134.867 23.5342V29.2778C134.871 29.9264 134.802 30.5736 134.662 31.2075C134.571 31.6885 134.394 32.1496 134.138 32.5692C133.734 33.0204 133.194 33.332 132.596 33.458C131.936 33.6266 130.96 33.7244 129.668 33.7513C128.677 33.7445 127.688 33.663 126.709 33.5075C126.41 33.4587 126.125 33.3503 125.871 33.1889C125.616 33.0275 125.398 32.8166 125.23 32.5692C124.819 31.9009 124.613 30.6791 124.613 28.9039V23.7725C124.618 23.5499 124.599 23.3275 124.555 23.109C124.643 21.8042 124.827 20.8439 125.114 20.2189C125.363 19.6643 125.856 19.2904 126.593 19.0974C127.339 18.8994 128.385 18.8041 129.75 18.8041C130.496 18.8041 131.194 18.8225 131.841 18.8609C132.889 18.9966 133.651 19.3136 134.136 19.8194C134.621 20.4095 134.865 21.3918 134.865 22.7517L134.867 23.5342ZM138.597 19.1578C138.25 18.2965 137.961 17.7485 137.732 17.5084C137.295 16.8542 136.629 16.363 135.729 16.0277C134.817 15.6911 133.864 15.4772 132.894 15.3917C131.902 15.3001 130.834 15.2524 129.683 15.2524C128.475 15.2524 127.398 15.2921 126.453 15.3716C125.516 15.4521 124.594 15.6561 123.712 15.9782C122.892 16.2497 122.176 16.7613 121.661 17.4443C121.133 18.2145 120.787 19.0912 120.648 20.01C120.478 21.1174 120.401 22.2366 120.417 23.3564V29.2778C120.417 32.2418 120.977 34.2717 122.095 35.3677C122.839 36.1552 123.819 36.6882 124.893 36.8888C126.29 37.1532 127.712 37.276 129.135 37.2553C130.511 37.2553 131.692 37.218 132.678 37.1435C133.654 37.0663 134.614 36.8592 135.533 36.5277C136.392 36.2442 137.143 35.7113 137.687 34.9993C138.133 34.3661 138.49 33.677 138.75 32.9504C138.998 32.2338 139.123 31.2222 139.123 29.9192V22.9294C139.123 21.269 138.949 20.0118 138.602 19.1578"
|
|
1844
|
+
fill="#003DA5"
|
|
1845
|
+
/>
|
|
1846
|
+
<path
|
|
1847
|
+
d="M155.14 25.5331C154.852 25.8403 154.485 26.0661 154.077 26.1874C153.523 26.327 152.952 26.3887 152.38 26.3706H146.296V18.9814H152.263C152.888 18.9709 153.512 19.0175 154.128 19.1207C154.565 19.1963 154.961 19.4208 155.247 19.7548C155.58 20.2404 155.752 21.1696 155.752 22.5312C155.752 24.0083 155.546 25.0071 155.135 25.5276L155.14 25.5331ZM156.099 28.0933V28.0054C157.475 27.7616 158.448 27.2888 159.026 26.5924C159.678 25.8373 160.002 24.2576 160 21.8532C160 19.6356 159.558 18.0388 158.674 17.0626C157.665 15.9703 155.738 15.4236 152.893 15.4224H142.066V37.0788H146.296V29.915H152.2C152.75 29.9021 153.3 29.9507 153.839 30.0598C154.252 30.1581 154.623 30.3819 154.9 30.6994C155.21 31.0479 155.405 31.4804 155.459 31.9401C155.542 32.5604 155.579 33.1857 155.571 33.8112V37.0788H159.821V33.0653C159.821 31.4489 159.557 30.2241 159.028 29.3909C158.366 28.6578 157.387 28.2161 156.101 28.097"
|
|
1848
|
+
fill="#003DA5"
|
|
1849
|
+
/>
|
|
1850
|
+
</svg>`;
|
|
1851
|
+
|
|
1852
|
+
const URL_VALIDATION_FONT_FAMILIES = {
|
|
1853
|
+
GOTHAM: "'Gotham', Arial, Helvetica, sans-serif",
|
|
1854
|
+
HANKEN_GROTESK: "'Hanken Grotesk', Arial, Helvetica, sans-serif",
|
|
1855
|
+
ROBOTO: "'Roboto', sans-serif",
|
|
1856
|
+
};
|
|
1857
|
+
const URL_VALIDATION_DEFAULT_COLORS = {
|
|
1858
|
+
TITLE: '#003da5',
|
|
1859
|
+
HOME_BUTTON_BACKGROUND: '#ff8200',
|
|
1860
|
+
HOME_BUTTON_TEXT: '#262626',
|
|
1861
|
+
};
|
|
1862
|
+
function buildFaviconHeadContent(faviconBasePath) {
|
|
1863
|
+
const base = faviconBasePath.replace(/\/$/, '');
|
|
1864
|
+
return `
|
|
1865
|
+
<link rel="apple-touch-icon" sizes="180x180" href="${base}/favicon-apple-touch-icon-180x180.png" />
|
|
1866
|
+
<link rel="icon" type="image/png" sizes="16x16" href="${base}/favicon-16x16.png" />
|
|
1867
|
+
<link rel="icon" type="image/png" sizes="32x32" href="${base}/favicon-32x32.png" />
|
|
1868
|
+
<link rel="icon" type="image/png" sizes="192x192" href="${base}/favicon-android-chrome-192x192.png" />
|
|
1869
|
+
<link rel="shortcut icon" href="${base}/favicon.ico" />`;
|
|
1870
|
+
}
|
|
1871
|
+
function buildGothamFontFaces(fontsBasePath) {
|
|
1872
|
+
return `
|
|
1873
|
+
@font-face {
|
|
1874
|
+
font-family: "Gotham";
|
|
1875
|
+
src: local("Gotham-Book"), local("Gotham Book");
|
|
1876
|
+
src: url("${fontsBasePath}/fonts/Gotham-Book.woff") format("woff");
|
|
1877
|
+
src: url("${fontsBasePath}/fonts/Gotham-Book.ttf") format("truetype");
|
|
1878
|
+
font-weight: 400;
|
|
1879
|
+
font-style: normal;
|
|
1880
|
+
font-display: swap;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
@font-face {
|
|
1884
|
+
font-family: "Gotham";
|
|
1885
|
+
src: local("Gotham-Medium"), local("Gotham Medium");
|
|
1886
|
+
src: url("${fontsBasePath}/fonts/Gotham-Medium.woff") format("woff");
|
|
1887
|
+
src: url("${fontsBasePath}/fonts/Gotham-Medium.ttf") format("truetype");
|
|
1888
|
+
font-weight: 500;
|
|
1889
|
+
font-style: normal;
|
|
1890
|
+
font-display: swap;
|
|
1891
|
+
}
|
|
1892
|
+
`;
|
|
1893
|
+
}
|
|
1894
|
+
function buildFontHeadContent(fontFamily, fontsBasePath) {
|
|
1895
|
+
if (fontFamily.includes('Hanken Grotesk')) {
|
|
1896
|
+
return `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500&display=swap" />`;
|
|
1897
|
+
}
|
|
1898
|
+
if (fontFamily.includes('Roboto') && !fontFamily.includes('Gotham')) {
|
|
1899
|
+
return `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" />`;
|
|
1900
|
+
}
|
|
1901
|
+
return `<style>${buildGothamFontFaces(fontsBasePath)}</style>`;
|
|
1902
|
+
}
|
|
1903
|
+
function buildLogoContent(logo) {
|
|
1904
|
+
if (!logo) {
|
|
1905
|
+
return DEFAULT_REDEDOR_LOGO_HTML;
|
|
1906
|
+
}
|
|
1907
|
+
if (logo.startsWith('<')) {
|
|
1908
|
+
return logo;
|
|
1909
|
+
}
|
|
1910
|
+
return `<img class="logo" src="${logo}" alt="Logo" />`;
|
|
1911
|
+
}
|
|
1912
|
+
function buildUrlValidationErrorPage(options) {
|
|
1913
|
+
const { url, homeHref = '/', fontsBasePath = '/assets', fontFamily = URL_VALIDATION_FONT_FAMILIES.GOTHAM, logo, titleColor = URL_VALIDATION_DEFAULT_COLORS.TITLE, homeButtonBackgroundColor = URL_VALIDATION_DEFAULT_COLORS.HOME_BUTTON_BACKGROUND, homeButtonTextColor = URL_VALIDATION_DEFAULT_COLORS.HOME_BUTTON_TEXT, faviconBasePath, } = options;
|
|
1914
|
+
const fontHeadContent = buildFontHeadContent(fontFamily, fontsBasePath);
|
|
1915
|
+
const logoContent = buildLogoContent(logo);
|
|
1916
|
+
const resolvedFaviconBasePath = (faviconBasePath ?? homeHref).replace(/\/$/, '');
|
|
1917
|
+
const faviconHeadContent = buildFaviconHeadContent(resolvedFaviconBasePath);
|
|
1918
|
+
return `
|
|
1919
|
+
<!DOCTYPE html>
|
|
1920
|
+
<html>
|
|
1921
|
+
<head>
|
|
1922
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1923
|
+
<title>Erro - Não foi possível acessar essa página - Rede D'Or - ${url}</title>
|
|
1924
|
+
${faviconHeadContent}
|
|
1925
|
+
${fontHeadContent}
|
|
1926
|
+
<style>
|
|
1927
|
+
body {
|
|
1928
|
+
text-align: center;
|
|
1929
|
+
padding: 0px;
|
|
1930
|
+
margin: 0px;
|
|
1931
|
+
height: 100vh;
|
|
1932
|
+
background-color: #fff;
|
|
1933
|
+
font-family: ${fontFamily};
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
.error-container {
|
|
1937
|
+
height: 100%;
|
|
1938
|
+
padding: 0px 162px;
|
|
1939
|
+
display: flex;
|
|
1940
|
+
flex-direction: column;
|
|
1941
|
+
justify-content: center;
|
|
1942
|
+
align-items: center;
|
|
1943
|
+
gap: 40px;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
.logo {
|
|
1947
|
+
margin-bottom: 30px;
|
|
1948
|
+
max-width: 280px;
|
|
1949
|
+
width: 100%;
|
|
1950
|
+
height: auto;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
.text-container {
|
|
1954
|
+
display: flex;
|
|
1955
|
+
flex-direction: column;
|
|
1956
|
+
align-items: center;
|
|
1957
|
+
gap: 16px;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
h1 {
|
|
1961
|
+
color: ${titleColor};
|
|
1962
|
+
margin: 0px;
|
|
1963
|
+
font-family: inherit;
|
|
1964
|
+
font-size: 28px;
|
|
1965
|
+
font-style: normal;
|
|
1966
|
+
font-weight: 500;
|
|
1967
|
+
line-height: 36px;
|
|
1968
|
+
letter-spacing: 0px;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
p {
|
|
1972
|
+
color: #262626;
|
|
1973
|
+
margin: 0px;
|
|
1974
|
+
font-family: inherit;
|
|
1975
|
+
font-size: 19px;
|
|
1976
|
+
font-style: normal;
|
|
1977
|
+
font-weight: 400;
|
|
1978
|
+
line-height: 28px;
|
|
1979
|
+
letter-spacing: 0px;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
a {
|
|
1983
|
+
color: ${homeButtonTextColor};
|
|
1984
|
+
background: ${homeButtonBackgroundColor};
|
|
1985
|
+
text-decoration: none;
|
|
1986
|
+
display: flex;
|
|
1987
|
+
padding: 12px 16px;
|
|
1988
|
+
justify-content: center;
|
|
1989
|
+
align-items: center;
|
|
1990
|
+
gap: 24px;
|
|
1991
|
+
border-radius: 4px;
|
|
1992
|
+
font-family: inherit;
|
|
1993
|
+
font-size: 16px;
|
|
1994
|
+
font-style: normal;
|
|
1995
|
+
font-weight: 500;
|
|
1996
|
+
line-height: 20px;
|
|
1997
|
+
letter-spacing: 0.32px;
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
@media screen and (max-width: 768px) {
|
|
2001
|
+
.error-container {
|
|
2002
|
+
padding: 0px 24px;
|
|
2003
|
+
gap: 32px;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
.logo {
|
|
2007
|
+
margin-bottom: 0px;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
.text-container {
|
|
2011
|
+
gap: 12px;
|
|
2012
|
+
}
|
|
2013
|
+
|
|
2014
|
+
h1 {
|
|
2015
|
+
font-size: 24px;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
p {
|
|
2019
|
+
font-size: 17px;
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
</style>
|
|
2023
|
+
</head>
|
|
2024
|
+
|
|
2025
|
+
<body>
|
|
2026
|
+
<div class="error-container">
|
|
2027
|
+
${logoContent}
|
|
2028
|
+
<div class="text-container">
|
|
2029
|
+
<h1>Informamos que ocorreu um erro ao acessar esta página.</h1>
|
|
2030
|
+
<p>
|
|
2031
|
+
Pedimos desculpas pelo inconveniente. Enquanto estamos trabalhando
|
|
2032
|
+
para resolver a situação, por favor, acesse novamente a nossa home
|
|
2033
|
+
</p>
|
|
2034
|
+
</div>
|
|
2035
|
+
<a href="${homeHref}">
|
|
2036
|
+
Ir para a página inicial
|
|
2037
|
+
<svg
|
|
2038
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
2039
|
+
width="17"
|
|
2040
|
+
height="17"
|
|
2041
|
+
viewBox="0 0 17 17"
|
|
2042
|
+
fill="none"
|
|
2043
|
+
>
|
|
2044
|
+
<path
|
|
2045
|
+
d="M15.0695 8.57667H1.83301M8.53734 15.1668L15.1663 8.48923L8.53734 1.8335"
|
|
2046
|
+
stroke="${homeButtonTextColor}"
|
|
2047
|
+
stroke-width="1.75"
|
|
2048
|
+
stroke-miterlimit="10"
|
|
2049
|
+
stroke-linecap="round"
|
|
2050
|
+
stroke-linejoin="round"
|
|
2051
|
+
/>
|
|
2052
|
+
</svg>
|
|
2053
|
+
</a>
|
|
2054
|
+
</div>
|
|
2055
|
+
</body>
|
|
2056
|
+
</html>
|
|
2057
|
+
`;
|
|
2058
|
+
}
|
|
2059
|
+
|
|
2060
|
+
const DANGEROUS_CHARACTERS = /(%00|%01|%02|%03|%04|%05|%06|%07|%08|%09|%0A|%0B|%0C|%0D|%0E|%0F|%10|%11|%12|%13|%14|%15|%16|%17|%18|%19|%1A|%1B|%1C|%1D|%1E|%1F|%22|%27|%28|%29|%3B|%3C|%3E|%5B|%5D|%7B|%7D)|[<>{}[\]()\\`"']/g;
|
|
2061
|
+
function createValidateUrlCharacters(options = {}) {
|
|
2062
|
+
const { homeHref = '/', fontsBasePath = '/assets', fontFamily = URL_VALIDATION_FONT_FAMILIES.GOTHAM, logo, titleColor, homeButtonBackgroundColor, homeButtonTextColor, faviconBasePath, } = options;
|
|
2063
|
+
return (req, res, next) => {
|
|
2064
|
+
try {
|
|
2065
|
+
const url = req.url;
|
|
2066
|
+
const matches = url.match(DANGEROUS_CHARACTERS);
|
|
2067
|
+
if (matches && matches.length > 1) {
|
|
2068
|
+
res.statusCode = 403;
|
|
2069
|
+
const requestId = res.locals['requestId'];
|
|
2070
|
+
console.log(`SSR MIDDLEWARE URL ${requestId} => ${req.url} | Caracteres perigosos: ${matches.length}`);
|
|
2071
|
+
const elapsedTime = differenceInMilliseconds(Date.now(), res.locals['startTime']);
|
|
2072
|
+
console.log(`SSR RES ${requestId} => ${req.url} | Status: ${res.statusCode} | Duração: ${elapsedTime}ms | Resposta interrompida por conter caracteres perigosos`);
|
|
2073
|
+
res.setHeader('Content-Type', 'text/html');
|
|
2074
|
+
return res.send(buildUrlValidationErrorPage({
|
|
2075
|
+
url: req.url,
|
|
2076
|
+
homeHref,
|
|
2077
|
+
fontsBasePath,
|
|
2078
|
+
fontFamily,
|
|
2079
|
+
logo,
|
|
2080
|
+
titleColor,
|
|
2081
|
+
homeButtonBackgroundColor,
|
|
2082
|
+
homeButtonTextColor,
|
|
2083
|
+
faviconBasePath,
|
|
2084
|
+
}));
|
|
2085
|
+
}
|
|
2086
|
+
return next();
|
|
2087
|
+
}
|
|
2088
|
+
catch (error) {
|
|
2089
|
+
console.error('Erro na validação da URL:', error);
|
|
2090
|
+
return res.status(500).json({
|
|
2091
|
+
error: 'Internal server error',
|
|
2092
|
+
code: '500',
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
const validateUrlCharacters = createValidateUrlCharacters();
|
|
2098
|
+
|
|
1807
2099
|
/**
|
|
1808
2100
|
* Generated bundle index. Do not edit.
|
|
1809
2101
|
*/
|
|
1810
2102
|
|
|
1811
|
-
export { AbstractModalComponent, AbstractModalDrawerComponent, EnumDoencaTaxonomy, EnumDoencaTaxonomyCat, ErrorInterceptor, ErrorService, FilterType, GeolocService, GeolocationPermissions, HttpClientService, LIB_CONFIG, LogInterceptor, LogService, MapBoxService, ModalDrawerService, ModalService, PhoneService, PrivacyToolsService, REQUEST, RESPONSE, RdsiteLinkDirective, RdsiteModalComponentStyle, RdsiteModalDrawerComponentStyle, RdsitePhoneModalDirective, SeoService, ServerResponseService, SiteBackendService, SsrResponseService, TransferStateUrlInterceptor, checkSafariAgent, djb2Hash, executeWithRetry, formatPhone, getCircularReplacer, getSiteUrl, removeHtmlTags };
|
|
2103
|
+
export { AbstractModalComponent, AbstractModalDrawerComponent, DEFAULT_REDEDOR_LOGO_HTML, EnumDoencaTaxonomy, EnumDoencaTaxonomyCat, ErrorInterceptor, ErrorService, FilterType, GeolocService, GeolocationPermissions, HttpClientService, LIB_CONFIG, LogInterceptor, LogService, MapBoxService, ModalDrawerService, ModalService, PhoneService, PrivacyToolsService, REQUEST, RESPONSE, RdsiteLinkDirective, RdsiteModalComponentStyle, RdsiteModalDrawerComponentStyle, RdsitePhoneModalDirective, SeoService, ServerResponseService, SiteBackendService, SsrResponseService, TransferStateUrlInterceptor, URL_VALIDATION_DEFAULT_COLORS, URL_VALIDATION_FONT_FAMILIES, buildUrlValidationErrorPage, checkSafariAgent, createValidateUrlCharacters, djb2Hash, executeWithRetry, formatPhone, getCircularReplacer, getSiteUrl, removeHtmlTags, ssrInitialization, validateUrlCharacters };
|
|
1812
2104
|
//# sourceMappingURL=rededor-site-front-end-lib-core.mjs.map
|