@rededor/site-front-end-lib 20.0.26 → 20.0.27
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/CHANGELOG.md +828 -0
- package/components/algolia-dropdown/algolia-dropdown.component.html +19 -0
- package/components/algolia-dropdown/algolia-dropdown.component.scss +0 -0
- package/components/algolia-dropdown/algolia-dropdown.component.spec.ts +22 -0
- package/components/algolia-dropdown/algolia-dropdown.component.ts +103 -0
- package/components/algolia-dropdown/index.ts +1 -0
- package/components/algolia-dropdown/ng-package.json +6 -0
- package/components/algolia-dropdown/public-api.ts +1 -0
- package/components/algolia-search/components/algolia-search/algolia-search.component.html +96 -0
- package/components/algolia-search/components/algolia-search/algolia-search.component.scss +588 -0
- package/components/algolia-search/components/algolia-search/algolia-search.component.spec.ts +21 -0
- package/components/algolia-search/components/algolia-search/algolia-search.component.ts +415 -0
- package/components/algolia-search/components/algolia-search-field/algolia-search-field.component.html +23 -0
- package/components/algolia-search/components/algolia-search-field/algolia-search-field.component.scss +5 -0
- package/components/algolia-search/components/algolia-search-field/algolia-search-field.component.spec.ts +22 -0
- package/components/algolia-search/components/algolia-search-field/algolia-search-field.component.ts +90 -0
- package/components/algolia-search/components/algolia-search-result-item/algolia-search-result-item.component.html +70 -0
- package/components/algolia-search/components/algolia-search-result-item/algolia-search-result-item.component.scss +27 -0
- package/components/algolia-search/components/algolia-search-result-item/algolia-search-result-item.component.spec.ts +21 -0
- package/components/algolia-search/components/algolia-search-result-item/algolia-search-result-item.component.ts +77 -0
- package/components/algolia-search/components/algolia-search-results/algolia-search-results.component.html +6 -0
- package/components/algolia-search/components/algolia-search-results/algolia-search-results.component.scss +0 -0
- package/components/algolia-search/components/algolia-search-results/algolia-search-results.component.spec.ts +21 -0
- package/components/algolia-search/components/algolia-search-results/algolia-search-results.component.ts +90 -0
- package/components/algolia-search/components/algolia-search-tooltip/algolia-search-tooltip.component.html +1 -0
- package/components/algolia-search/components/algolia-search-tooltip/algolia-search-tooltip.component.scss +0 -0
- package/components/algolia-search/components/algolia-search-tooltip/algolia-search-tooltip.component.spec.ts +21 -0
- package/components/algolia-search/components/algolia-search-tooltip/algolia-search-tooltip.component.ts +9 -0
- package/components/algolia-search/index.ts +1 -0
- package/components/algolia-search/models/algolia-component-style.enum.ts +4 -0
- package/components/algolia-search/models/algolia-config.model.ts +8 -0
- package/components/algolia-search/models/algolia-hint.model.ts +4 -0
- package/components/algolia-search/models/algolia-hit-description.model.ts +6 -0
- package/components/algolia-search/models/algolia-multiple-index.model.ts +7 -0
- package/components/algolia-search/models/algolia-results-item.model.ts +8 -0
- package/components/algolia-search/models/algolia-results-multiple.model.ts +6 -0
- package/components/algolia-search/models/algolia-search-params.model.ts +83 -0
- package/components/algolia-search/ng-package.json +6 -0
- package/components/algolia-search/public-api.ts +13 -0
- package/components/banner/content-banner/content-banner.component.html +51 -0
- package/components/banner/content-banner/content-banner.component.scss +91 -0
- package/components/banner/content-banner/content-banner.component.spec.ts +27 -0
- package/components/banner/content-banner/content-banner.component.ts +36 -0
- package/components/banner/index.ts +1 -0
- package/components/banner/ng-package.json +6 -0
- package/components/banner/public-api.ts +1 -0
- package/components/breadcrumbs/breadcrumbs.component.html +56 -0
- package/components/breadcrumbs/breadcrumbs.component.scss +55 -0
- package/components/breadcrumbs/breadcrumbs.component.spec.ts +22 -0
- package/components/breadcrumbs/breadcrumbs.component.ts +142 -0
- package/components/breadcrumbs/index.ts +1 -0
- package/components/breadcrumbs/ng-package.json +6 -0
- package/components/breadcrumbs/public-api.ts +1 -0
- package/components/cards/card-unidade-planos-convenios/card-unidade-planos-convenios.component.html +91 -0
- package/components/cards/card-unidade-planos-convenios/card-unidade-planos-convenios.component.scss +143 -0
- package/components/cards/card-unidade-planos-convenios/card-unidade-planos-convenios.component.spec.ts +22 -0
- package/components/cards/card-unidade-planos-convenios/card-unidade-planos-convenios.component.ts +66 -0
- package/components/cards/expandable-card/expandable-card.component.html +30 -0
- package/components/cards/expandable-card/expandable-card.component.scss +100 -0
- package/components/cards/expandable-card/expandable-card.component.spec.ts +27 -0
- package/components/cards/expandable-card/expandable-card.component.ts +60 -0
- package/components/cards/index.ts +1 -0
- package/components/cards/ng-package.json +6 -0
- package/components/cards/public-api.ts +3 -0
- package/components/cards/testimonial-card/testimonial-card.component.html +41 -0
- package/components/cards/testimonial-card/testimonial-card.component.scss +96 -0
- package/components/cards/testimonial-card/testimonial-card.component.spec.ts +27 -0
- package/components/cards/testimonial-card/testimonial-card.component.ts +65 -0
- package/components/carousels/index.ts +1 -0
- package/components/carousels/ng-package.json +6 -0
- package/components/carousels/public-api.ts +1 -0
- package/components/carousels/testimonials-carousel/testimonials-carousel.component.html +30 -0
- package/components/carousels/testimonials-carousel/testimonials-carousel.component.scss +91 -0
- package/components/carousels/testimonials-carousel/testimonials-carousel.component.spec.ts +27 -0
- package/components/carousels/testimonials-carousel/testimonials-carousel.component.ts +73 -0
- package/components/cta-wrapper/cta-wrapper.component.html +54 -0
- package/components/cta-wrapper/cta-wrapper.component.scss +123 -0
- package/components/cta-wrapper/cta-wrapper.component.spec.ts +22 -0
- package/components/cta-wrapper/cta-wrapper.component.ts +77 -0
- package/components/cta-wrapper/index.ts +1 -0
- package/components/cta-wrapper/ng-package.json +6 -0
- package/components/cta-wrapper/public-api.ts +1 -0
- package/components/error/error.component.html +65 -0
- package/components/error/error.component.scss +26 -0
- package/components/error/error.component.spec.ts +22 -0
- package/components/error/error.component.ts +182 -0
- package/components/error/index.ts +1 -0
- package/components/error/ng-package.json +6 -0
- package/components/error/public-api.ts +1 -0
- package/components/filter-letter-and-terms/filter-letter-and-terms.component.html +33 -0
- package/components/filter-letter-and-terms/filter-letter-and-terms.component.scss +98 -0
- package/components/filter-letter-and-terms/filter-letter-and-terms.component.spec.ts +22 -0
- package/components/filter-letter-and-terms/filter-letter-and-terms.component.ts +87 -0
- package/components/filter-letter-and-terms/index.ts +1 -0
- package/components/filter-letter-and-terms/ng-package.json +6 -0
- package/components/filter-letter-and-terms/public-api.ts +1 -0
- package/components/filters/filter-generic/USAGE.md +147 -0
- package/components/filters/filter-generic/filter-generic.component.html +174 -0
- package/components/filters/filter-generic/filter-generic.component.scss +266 -0
- package/components/filters/filter-generic/filter-generic.component.spec.ts +21 -0
- package/components/filters/filter-generic/filter-generic.component.ts +266 -0
- package/components/filters/filter-generic/index.ts +1 -0
- package/components/filters/filter-generic/ng-package.json +6 -0
- package/components/filters/filter-generic/public-api.ts +1 -0
- package/components/filters/filter-planos-convenios/filter-planos-convenios.component.html +76 -0
- package/components/filters/filter-planos-convenios/filter-planos-convenios.component.scss +84 -0
- package/components/filters/filter-planos-convenios/filter-planos-convenios.component.spec.ts +21 -0
- package/components/filters/filter-planos-convenios/filter-planos-convenios.component.ts +149 -0
- package/components/filters/filter-planos-convenios/index.ts +1 -0
- package/components/filters/filter-planos-convenios/ng-package.json +6 -0
- package/components/filters/filter-planos-convenios/public-api.ts +1 -0
- package/components/footer/footer.component.html +125 -0
- package/components/footer/footer.component.scss +451 -0
- package/components/footer/footer.component.spec.ts +22 -0
- package/components/footer/footer.component.ts +94 -0
- package/components/footer/helpers/footerTheme.func.ts +119 -0
- package/components/footer/index.ts +1 -0
- package/components/footer/models/FooterTheme.model.ts +8 -0
- package/components/footer/ng-package.json +6 -0
- package/components/footer/public-api.ts +1 -0
- package/components/header/components/action/header-action-menu/header-action-menu.component.html +41 -0
- package/components/header/components/action/header-action-menu/header-action-menu.component.scss +158 -0
- package/components/header/components/action/header-action-menu/header-action-menu.component.spec.ts +22 -0
- package/components/header/components/action/header-action-menu/header-action-menu.component.ts +30 -0
- package/components/header/components/action/index.ts +1 -0
- package/components/header/components/action/ng-package.json +6 -0
- package/components/header/components/action/public-api.ts +1 -0
- package/components/header/components/auxiliar/header-aux-menu-item/header-aux-menu-item.component.html +33 -0
- package/components/header/components/auxiliar/header-aux-menu-item/header-aux-menu-item.component.scss +60 -0
- package/components/header/components/auxiliar/header-aux-menu-item/header-aux-menu-item.component.spec.ts +22 -0
- package/components/header/components/auxiliar/header-aux-menu-item/header-aux-menu-item.component.ts +46 -0
- package/components/header/components/auxiliar/header-aux-menu-item-dropdown/header-aux-menu-item-dropdown.component.html +7 -0
- package/components/header/components/auxiliar/header-aux-menu-item-dropdown/header-aux-menu-item-dropdown.component.scss +27 -0
- package/components/header/components/auxiliar/header-aux-menu-item-dropdown/header-aux-menu-item-dropdown.component.spec.ts +22 -0
- package/components/header/components/auxiliar/header-aux-menu-item-dropdown/header-aux-menu-item-dropdown.component.ts +19 -0
- package/components/header/components/auxiliar/index.ts +1 -0
- package/components/header/components/auxiliar/ng-package.json +6 -0
- package/components/header/components/auxiliar/public-api.ts +2 -0
- package/components/header/components/header-logo/header-logo.component.html +5 -0
- package/components/header/components/header-logo/header-logo.component.scss +20 -0
- package/components/header/components/header-logo/header-logo.component.spec.ts +22 -0
- package/components/header/components/header-logo/header-logo.component.ts +23 -0
- package/components/header/components/main/header-main-menu-item/header-main-menu-item.component.html +30 -0
- package/components/header/components/main/header-main-menu-item/header-main-menu-item.component.scss +53 -0
- package/components/header/components/main/header-main-menu-item/header-main-menu-item.component.spec.ts +22 -0
- package/components/header/components/main/header-main-menu-item/header-main-menu-item.component.ts +88 -0
- package/components/header/components/main/header-main-menu-item-dropdown/header-main-menu-item-dropdown.component.html +112 -0
- package/components/header/components/main/header-main-menu-item-dropdown/header-main-menu-item-dropdown.component.scss +259 -0
- package/components/header/components/main/header-main-menu-item-dropdown/header-main-menu-item-dropdown.component.spec.ts +22 -0
- package/components/header/components/main/header-main-menu-item-dropdown/header-main-menu-item-dropdown.component.ts +107 -0
- package/components/header/components/main/index.ts +1 -0
- package/components/header/components/main/ng-package.json +6 -0
- package/components/header/components/main/public-api.ts +2 -0
- package/components/header/components/side/header-side-menu/header-side-menu.component.html +32 -0
- package/components/header/components/side/header-side-menu/header-side-menu.component.scss +81 -0
- package/components/header/components/side/header-side-menu/header-side-menu.component.spec.ts +22 -0
- package/components/header/components/side/header-side-menu/header-side-menu.component.ts +29 -0
- package/components/header/components/side/header-side-menu-item/header-side-menu-item.component.html +26 -0
- package/components/header/components/side/header-side-menu-item/header-side-menu-item.component.scss +104 -0
- package/components/header/components/side/header-side-menu-item/header-side-menu-item.component.spec.ts +22 -0
- package/components/header/components/side/header-side-menu-item/header-side-menu-item.component.ts +45 -0
- package/components/header/components/side/index.ts +1 -0
- package/components/header/components/side/ng-package.json +6 -0
- package/components/header/components/side/public-api.ts +2 -0
- package/components/header/header.component.html +81 -0
- package/components/header/header.component.scss +171 -0
- package/components/header/header.component.spec.ts +22 -0
- package/components/header/header.component.ts +135 -0
- package/components/header/helpers/headerTheme.func.ts +288 -0
- package/components/header/index.ts +1 -0
- package/components/header/models/HeaderTheme.model.ts +9 -0
- package/components/header/ng-package.json +6 -0
- package/components/header/public-api.ts +2 -0
- package/components/header/services/header.service.spec.ts +16 -0
- package/components/header/services/header.service.ts +40 -0
- package/components/header/services/index.ts +1 -0
- package/components/header/services/ng-package.json +6 -0
- package/components/header/services/public-api.ts +1 -0
- package/components/image/image.component.html +9 -0
- package/components/image/image.component.scss +12 -0
- package/components/image/image.component.spec.ts +22 -0
- package/components/image/image.component.ts +43 -0
- package/components/image/index.ts +1 -0
- package/components/image/ng-package.json +6 -0
- package/components/image/public-api.ts +1 -0
- package/components/load-screen/index.ts +1 -0
- package/components/load-screen/load-screen.component.html +128 -0
- package/components/load-screen/load-screen.component.scss +46 -0
- package/components/load-screen/load-screen.component.spec.ts +27 -0
- package/components/load-screen/load-screen.component.ts +18 -0
- package/components/load-screen/ng-package.json +6 -0
- package/components/load-screen/public-api.ts +1 -0
- package/components/modal/index.ts +1 -0
- package/components/modal/modal.component.html +12 -0
- package/components/modal/modal.component.scss +34 -0
- package/components/modal/modal.component.spec.ts +22 -0
- package/components/modal/modal.component.ts +74 -0
- package/components/modal/ng-package.json +6 -0
- package/components/modal/public-api.ts +1 -0
- package/components/modal-drawer/index.ts +1 -0
- package/components/modal-drawer/modal-drawer.component.html +22 -0
- package/components/modal-drawer/modal-drawer.component.scss +250 -0
- package/components/modal-drawer/modal-drawer.component.spec.ts +22 -0
- package/components/modal-drawer/modal-drawer.component.ts +148 -0
- package/components/modal-drawer/ng-package.json +6 -0
- package/components/modal-drawer/public-api.ts +1 -0
- package/components/overlay/index.ts +1 -0
- package/components/overlay/ng-package.json +6 -0
- package/components/overlay/overlay.component.html +1 -0
- package/components/overlay/overlay.component.scss +13 -0
- package/components/overlay/overlay.component.spec.ts +22 -0
- package/components/overlay/overlay.component.ts +15 -0
- package/components/overlay/public-api.ts +1 -0
- package/components/page-header/index.ts +1 -0
- package/components/page-header/ng-package.json +6 -0
- package/components/page-header/page-header.component.html +25 -0
- package/components/page-header/page-header.component.scss +110 -0
- package/components/page-header/page-header.component.spec.ts +22 -0
- package/components/page-header/page-header.component.ts +41 -0
- package/components/page-header/public-api.ts +1 -0
- package/components/page-template-fullcontent/index.ts +1 -0
- package/components/page-template-fullcontent/ng-package.json +6 -0
- package/components/page-template-fullcontent/page-template-fullcontent.component.html +37 -0
- package/components/page-template-fullcontent/page-template-fullcontent.component.scss +41 -0
- package/components/page-template-fullcontent/page-template-fullcontent.component.ts +22 -0
- package/components/page-template-fullcontent/public-api.ts +1 -0
- package/components/page-template-sidebar/index.ts +1 -0
- package/components/page-template-sidebar/ng-package.json +6 -0
- package/components/page-template-sidebar/page-template-sidebar.component.html +50 -0
- package/components/page-template-sidebar/page-template-sidebar.component.scss +80 -0
- package/components/page-template-sidebar/page-template-sidebar.component.spec.ts +22 -0
- package/components/page-template-sidebar/page-template-sidebar.component.ts +25 -0
- package/components/page-template-sidebar/public-api.ts +1 -0
- package/components/pagination/index.ts +1 -0
- package/components/pagination/ng-package.json +6 -0
- package/components/pagination/pagination.component.html +53 -0
- package/components/pagination/pagination.component.scss +124 -0
- package/components/pagination/pagination.component.spec.ts +22 -0
- package/components/pagination/pagination.component.ts +48 -0
- package/components/pagination/public-api.ts +1 -0
- package/components/search/index.ts +1 -0
- package/components/search/ng-package.json +6 -0
- package/components/search/public-api.ts +1 -0
- package/components/search/search.component.html +32 -0
- package/components/search/search.component.scss +59 -0
- package/components/search/search.component.spec.ts +22 -0
- package/components/search/search.component.ts +122 -0
- package/components/section-navigation/index.ts +1 -0
- package/components/section-navigation/ng-package.json +6 -0
- package/components/section-navigation/public-api.ts +1 -0
- package/components/section-navigation/section-navigation.component.html +23 -0
- package/components/section-navigation/section-navigation.component.scss +50 -0
- package/components/section-navigation/section-navigation.component.spec.ts +22 -0
- package/components/section-navigation/section-navigation.component.ts +159 -0
- package/components/side-ctas/components/side-ctas-bottom/side-ctas-bottom.component.html +8 -0
- package/components/side-ctas/components/side-ctas-bottom/side-ctas-bottom.component.scss +56 -0
- package/components/side-ctas/components/side-ctas-bottom/side-ctas-bottom.component.spec.ts +22 -0
- package/components/side-ctas/components/side-ctas-bottom/side-ctas-bottom.component.ts +31 -0
- package/components/side-ctas/components/side-ctas-right-bottom/side-ctas-right-bottom.component.html +11 -0
- package/components/side-ctas/components/side-ctas-right-bottom/side-ctas-right-bottom.component.scss +0 -0
- package/components/side-ctas/components/side-ctas-right-bottom/side-ctas-right-bottom.component.spec.ts +22 -0
- package/components/side-ctas/components/side-ctas-right-bottom/side-ctas-right-bottom.component.ts +23 -0
- package/components/side-ctas/components/side-ctas-right-middle/side-ctas-right-middle.component.html +10 -0
- package/components/side-ctas/components/side-ctas-right-middle/side-ctas-right-middle.component.scss +54 -0
- package/components/side-ctas/components/side-ctas-right-middle/side-ctas-right-middle.component.spec.ts +22 -0
- package/components/side-ctas/components/side-ctas-right-middle/side-ctas-right-middle.component.ts +30 -0
- package/components/side-ctas/components/side-ctas-right-top/side-ctas-right-top.component.html +1 -0
- package/components/side-ctas/components/side-ctas-right-top/side-ctas-right-top.component.scss +11 -0
- package/components/side-ctas/components/side-ctas-right-top/side-ctas-right-top.component.spec.ts +22 -0
- package/components/side-ctas/components/side-ctas-right-top/side-ctas-right-top.component.ts +9 -0
- package/components/side-ctas/index.ts +1 -0
- package/components/side-ctas/models/SideCta.model.ts +5 -0
- package/components/side-ctas/ng-package.json +6 -0
- package/components/side-ctas/public-api.ts +6 -0
- package/components/side-ctas/side-ctas.component.html +28 -0
- package/components/side-ctas/side-ctas.component.scss +62 -0
- package/components/side-ctas/side-ctas.component.spec.ts +22 -0
- package/components/side-ctas/side-ctas.component.ts +17 -0
- package/components/sidebar-navigation/index.ts +1 -0
- package/components/sidebar-navigation/ng-package.json +6 -0
- package/components/sidebar-navigation/public-api.ts +1 -0
- package/components/sidebar-navigation/sidebar-navigation.component.html +42 -0
- package/components/sidebar-navigation/sidebar-navigation.component.scss +25 -0
- package/components/sidebar-navigation/sidebar-navigation.component.ts +122 -0
- package/components/sticky-navigation/index.ts +1 -0
- package/components/sticky-navigation/ng-package.json +6 -0
- package/components/sticky-navigation/public-api.ts +1 -0
- package/components/sticky-navigation/sticky-navigation.component.html +39 -0
- package/components/sticky-navigation/sticky-navigation.component.scss +48 -0
- package/components/sticky-navigation/sticky-navigation.component.ts +134 -0
- package/components/whatsapp/index.ts +1 -0
- package/components/whatsapp/ng-package.json +6 -0
- package/components/whatsapp/public-api.ts +1 -0
- package/components/whatsapp/whatsapp.component.html +23 -0
- package/components/whatsapp/whatsapp.component.scss +113 -0
- package/components/whatsapp/whatsapp.component.spec.ts +22 -0
- package/components/whatsapp/whatsapp.component.ts +40 -0
- package/core/directives/rdsite-link/rdsite-link.directive.spec.ts +8 -0
- package/core/directives/rdsite-link/rdsite-link.directive.ts +200 -0
- package/core/directives/rdsite-phone-modal/rdsite-phone-modal.directive.spec.ts +8 -0
- package/core/directives/rdsite-phone-modal/rdsite-phone-modal.directive.ts +41 -0
- package/core/enums/RdsiteModalComponentStyle.enum.ts +13 -0
- package/core/enums/RdsiteModalDrawerComponentStyle.enum.ts +7 -0
- package/core/helpers/check-safari-agent.func.ts +6 -0
- package/core/helpers/djb2Hash.func.ts +18 -0
- package/core/helpers/executeWithRetry.func.ts +25 -0
- package/core/helpers/formatPhone.func.ts +22 -0
- package/core/helpers/getCircularReplacer.func.ts +45 -0
- package/core/helpers/getSiteUrl.func.ts +7 -0
- package/core/helpers/removeHtmlTags.func.ts +6 -0
- package/core/helpers/toQueryParams.func.ts +11 -0
- package/core/index.ts +1 -0
- package/core/interceptors/error.interceptor.ts +39 -0
- package/core/interceptors/log.interceptor.ts +35 -0
- package/core/interceptors/transfer-state-url.interceptor.ts +137 -0
- package/core/models/algolia-search-api.model.ts +213 -0
- package/core/models/breadcrumbs/breadcrumbs-items.model.ts +10 -0
- package/core/models/breadcrumbs/breadcrumbs-json-item.model.ts +8 -0
- package/core/models/centro-estudos-backend.model.ts +8 -0
- package/core/models/centro-medico.model.ts +33 -0
- package/core/models/content-banner.model.ts +7 -0
- package/core/models/cta-wrapper.model.ts +9 -0
- package/core/models/doenca-backend.model.ts +27 -0
- package/core/models/doenca-taxonomy.model.ts +21 -0
- package/core/models/especialidade-backend.model.ts +25 -0
- package/core/models/exame-backend.model.ts +26 -0
- package/core/models/filters/filter-planos-convenios.model.ts +34 -0
- package/core/models/filters/filter-section.type.ts +18 -0
- package/core/models/filters/filter-sections.model.ts +66 -0
- package/core/models/images/rdsite-image.model.ts +5 -0
- package/core/models/index.ts +1 -0
- package/core/models/medico-cv.model.ts +10 -0
- package/core/models/menu-de-unidade.model.ts +16 -0
- package/core/models/menu-item.model.ts +71 -0
- package/core/models/privacy-tools/privacy-tools.model.ts +9 -0
- package/core/models/rdsl-cobertura.model.ts +72 -0
- package/core/models/rdsl-convenio.model.ts +18 -0
- package/core/models/rdsl-especialidade.model.ts +36 -0
- package/core/models/rdsl-planos.model.ts +14 -0
- package/core/models/rdsl-post-category.model.ts +8 -0
- package/core/models/rdsl-unidade.model.ts +52 -0
- package/core/models/section-navigation.model.ts +10 -0
- package/core/models/seo/seo-data.model.ts +11 -0
- package/core/models/seo/seo-unidade.model.ts +6 -0
- package/core/models/social-meta-properties.model.ts +9 -0
- package/core/models/wordpress/WpEnvelopeResponse.model.ts +12 -0
- package/core/models/wordpress/WpHttpParams.model.ts +5 -0
- package/core/models/wordpress/WpQueryParams.model.ts +32 -0
- package/core/models/wordpress/WpResponse.model.ts +35 -0
- package/core/models/wordpress/category/wpCategory.model.ts +15 -0
- package/core/models/wordpress/category/wpCategoryRequestParams.model.ts +9 -0
- package/core/models/wordpress/flexiblecontent/flexiblecontent.model.ts +4 -0
- package/core/models/wordpress/general/content.model.ts +4 -0
- package/core/models/wordpress/general/excerpt.model.ts +4 -0
- package/core/models/wordpress/general/featuredMedia.model.ts +27 -0
- package/core/models/wordpress/general/guid.model.ts +3 -0
- package/core/models/wordpress/general/index.ts +10 -0
- package/core/models/wordpress/general/links.model.ts +47 -0
- package/core/models/wordpress/general/meta.model.ts +3 -0
- package/core/models/wordpress/general/title.model.ts +3 -0
- package/core/models/wordpress/general/yoastData.model.ts +4 -0
- package/core/models/wordpress/general/yoastHeadJson.model.ts +55 -0
- package/core/models/wordpress/general/yoastMeta.model.ts +5 -0
- package/core/models/wordpress/page/page.model.ts +11 -0
- package/core/models/wordpress/page/pageRequestParams.model.ts +11 -0
- package/core/models/wordpress/post/post.model.ts +37 -0
- package/core/models/wordpress/post/postRequestParams.model.ts +23 -0
- package/core/models/wordpress/unidade/wp-unidade-onco.model.ts +62 -0
- package/core/models/wordpress/unidade/wp-unidade-site-detalhe.model.ts +173 -0
- package/core/models/wordpress/unidade/wp-unidade-site.model.ts +48 -0
- package/core/ng-package.json +6 -0
- package/core/public-api.ts +79 -0
- package/core/services/error/error.service.spec.ts +16 -0
- package/core/services/error/error.service.ts +10 -0
- package/core/services/geoloc/geoloc.service.spec.ts +16 -0
- package/core/services/geoloc/geoloc.service.ts +225 -0
- package/core/services/http-client/http-client.service.spec.ts +16 -0
- package/core/services/http-client/http-client.service.ts +49 -0
- package/core/services/log/log.service.spec.ts +16 -0
- package/core/services/log/log.service.ts +36 -0
- package/core/services/mapbox/mapbox.service.spec.ts +16 -0
- package/core/services/mapbox/mapbox.service.ts +84 -0
- package/core/services/modal/modal.service.spec.ts +16 -0
- package/core/services/modal/modal.service.ts +124 -0
- package/core/services/modal-drawer/modal-drawer.service.spec.ts +16 -0
- package/core/services/modal-drawer/modal-drawer.service.ts +104 -0
- package/core/services/phone/phone.service.spec.ts +16 -0
- package/core/services/phone/phone.service.ts +19 -0
- package/core/services/privacy-tools/privacy-tools.service.spec.ts +16 -0
- package/core/services/privacy-tools/privacy-tools.service.ts +96 -0
- package/core/services/seo/seo.service.spec.ts +16 -0
- package/core/services/seo/seo.service.ts +537 -0
- package/core/services/server-response/server-response.service.spec.ts +16 -0
- package/core/services/server-response/server-response.service.ts +107 -0
- package/core/services/site-back-end/site-back-end.service.spec.ts +16 -0
- package/core/services/site-back-end/site-back-end.service.ts +48 -0
- package/core/services/ssr-response/ssr-response.service.spec.ts +16 -0
- package/core/services/ssr-response/ssr-response.service.ts +57 -0
- package/core/tokens/LibConfig.ts +64 -0
- package/core/tokens/express.tokens.ts +5 -0
- package/cura/accordion/cura-accordion/cura-accordion.component.html +1 -0
- package/cura/accordion/cura-accordion/cura-accordion.component.scss +7 -0
- package/cura/accordion/cura-accordion/cura-accordion.component.ts +203 -0
- package/cura/accordion/cura-accordion-item/cura-accordion-item.component.html +20 -0
- package/cura/accordion/cura-accordion-item/cura-accordion-item.component.scss +139 -0
- package/cura/accordion/cura-accordion-item/cura-accordion-item.component.ts +75 -0
- package/cura/accordion/cura-accordion.definitions.ts +5 -0
- package/cura/accordion/index.ts +1 -0
- package/cura/accordion/ng-package.json +6 -0
- package/cura/accordion/public-api.ts +3 -0
- package/cura/api/CuraConfig.ts +5 -0
- package/cura/api/cura-api.service.spec.ts +138 -0
- package/cura/api/cura-api.service.ts +104 -0
- package/cura/api/cura-api.types.ts +79 -0
- package/cura/api/index.ts +1 -0
- package/cura/api/modules/cura-theme-breakpoints.module.ts +22 -0
- package/cura/api/modules/cura-theme-colors.module.ts +89 -0
- package/cura/api/modules/cura-theme-fonts.module.ts +54 -0
- package/cura/api/modules/cura-theme-spacing.module.ts +23 -0
- package/cura/api/modules/cura-theme.module.ts +116 -0
- package/cura/api/ng-package.json +6 -0
- package/cura/api/public-api.ts +11 -0
- package/cura/api/theme-presets/static.ts +70 -0
- package/cura/api/theme-presets/theme-default.ts +49 -0
- package/cura/api/theme-presets/theme-maternidade-star.ts +49 -0
- package/cura/api/theme-presets/theme-presets.ts +13 -0
- package/cura/api/theme-presets/theme-star.ts +49 -0
- package/cura/badges/cura-badge-counter/cura-badge-counter.component.html +7 -0
- package/cura/badges/cura-badge-counter/cura-badge-counter.component.scss +41 -0
- package/cura/badges/cura-badge-counter/cura-badge-counter.component.ts +94 -0
- package/cura/badges/cura-badge-counter/index.ts +1 -0
- package/cura/badges/cura-badge-counter/ng-package.json +6 -0
- package/cura/badges/cura-badge-counter/public-api.ts +1 -0
- package/cura/badges/cura-badge-distance/cura-badge-distance.component.html +8 -0
- package/cura/badges/cura-badge-distance/cura-badge-distance.component.scss +16 -0
- package/cura/badges/cura-badge-distance/cura-badge-distance.component.ts +53 -0
- package/cura/badges/cura-badge-distance/index.ts +1 -0
- package/cura/badges/cura-badge-distance/ng-package.json +6 -0
- package/cura/badges/cura-badge-distance/public-api.ts +1 -0
- package/cura/badges/cura-badge-dot/cura-badge-dot.component.html +1 -0
- package/cura/badges/cura-badge-dot/cura-badge-dot.component.scss +50 -0
- package/cura/badges/cura-badge-dot/cura-badge-dot.component.ts +69 -0
- package/cura/badges/cura-badge-dot/index.ts +1 -0
- package/cura/badges/cura-badge-dot/ng-package.json +6 -0
- package/cura/badges/cura-badge-dot/public-api.ts +1 -0
- package/cura/badges/cura-badge-pill/cura-badge-pill.component.html +8 -0
- package/cura/badges/cura-badge-pill/cura-badge-pill.component.scss +74 -0
- package/cura/badges/cura-badge-pill/cura-badge-pill.component.ts +105 -0
- package/cura/badges/cura-badge-pill/index.ts +1 -0
- package/cura/badges/cura-badge-pill/ng-package.json +6 -0
- package/cura/badges/cura-badge-pill/public-api.ts +1 -0
- package/cura/badges/cura-badges.definitions.ts +5 -0
- package/cura/badges/index.ts +1 -0
- package/cura/badges/ng-package.json +6 -0
- package/cura/badges/public-api.ts +1 -0
- package/cura/buttons/cura-button/cura-button.component.html +47 -0
- package/cura/buttons/cura-button/cura-button.component.scss +66 -0
- package/cura/buttons/cura-button/cura-button.component.spec.ts +105 -0
- package/cura/buttons/cura-button/cura-button.component.ts +184 -0
- package/cura/buttons/cura-button/index.ts +1 -0
- package/cura/buttons/cura-button/ng-package.json +6 -0
- package/cura/buttons/cura-button/public-api.ts +1 -0
- package/cura/buttons/cura-button-outline/cura-button-outline.component.html +47 -0
- package/cura/buttons/cura-button-outline/cura-button-outline.component.scss +55 -0
- package/cura/buttons/cura-button-outline/cura-button-outline.component.spec.ts +57 -0
- package/cura/buttons/cura-button-outline/cura-button-outline.component.ts +184 -0
- package/cura/buttons/cura-button-outline/index.ts +1 -0
- package/cura/buttons/cura-button-outline/ng-package.json +6 -0
- package/cura/buttons/cura-button-outline/public-api.ts +1 -0
- package/cura/buttons/cura-button-select/cura-button-select.component.html +27 -0
- package/cura/buttons/cura-button-select/cura-button-select.component.scss +76 -0
- package/cura/buttons/cura-button-select/cura-button-select.component.spec.ts +96 -0
- package/cura/buttons/cura-button-select/cura-button-select.component.ts +140 -0
- package/cura/buttons/cura-button-select/index.ts +1 -0
- package/cura/buttons/cura-button-select/ng-package.json +6 -0
- package/cura/buttons/cura-button-select/public-api.ts +1 -0
- package/cura/buttons/cura-button-transparent/cura-button-transparent.component.html +47 -0
- package/cura/buttons/cura-button-transparent/cura-button-transparent.component.scss +29 -0
- package/cura/buttons/cura-button-transparent/cura-button-transparent.component.spec.ts +63 -0
- package/cura/buttons/cura-button-transparent/cura-button-transparent.component.ts +172 -0
- package/cura/buttons/cura-button-transparent/index.ts +1 -0
- package/cura/buttons/cura-button-transparent/ng-package.json +6 -0
- package/cura/buttons/cura-button-transparent/public-api.ts +1 -0
- package/cura/buttons/cura-button.definitions.ts +13 -0
- package/cura/buttons/index.ts +1 -0
- package/cura/buttons/ng-package.json +6 -0
- package/cura/buttons/public-api.ts +1 -0
- package/cura/cards/cura-card/cura-card.component.html +11 -0
- package/cura/cards/cura-card/cura-card.component.scss +167 -0
- package/cura/cards/cura-card/cura-card.component.ts +89 -0
- package/cura/cards/cura-card/cura-cards.definitions.ts +5 -0
- package/cura/cards/cura-card/index.ts +1 -0
- package/cura/cards/cura-card/ng-package.json +6 -0
- package/cura/cards/cura-card/public-api.ts +1 -0
- package/cura/feedback/cura-alert/cura-alert.component.html +21 -0
- package/cura/feedback/cura-alert/cura-alert.component.scss +32 -0
- package/cura/feedback/cura-alert/cura-alert.component.ts +94 -0
- package/cura/feedback/cura-alert/cura-alert.definitions.ts +15 -0
- package/cura/feedback/cura-alert/index.ts +1 -0
- package/cura/feedback/cura-alert/ng-package.json +6 -0
- package/cura/feedback/cura-alert/public-api.ts +2 -0
- package/cura/feedback/cura-modal/cura-modal.component.html +20 -0
- package/cura/feedback/cura-modal/cura-modal.component.scss +149 -0
- package/cura/feedback/cura-modal/cura-modal.component.ts +112 -0
- package/cura/feedback/cura-modal/cura-modal.definitions.ts +36 -0
- package/cura/feedback/cura-modal/index.ts +1 -0
- package/cura/feedback/cura-modal/ng-package.json +6 -0
- package/cura/feedback/cura-modal/public-api.ts +2 -0
- package/cura/feedback/cura-toast/cura-toast.component.html +23 -0
- package/cura/feedback/cura-toast/cura-toast.component.scss +96 -0
- package/cura/feedback/cura-toast/cura-toast.component.ts +213 -0
- package/cura/feedback/cura-toast/cura-toast.definitions.ts +22 -0
- package/cura/feedback/cura-toast/index.ts +1 -0
- package/cura/feedback/cura-toast/ng-package.json +6 -0
- package/cura/feedback/cura-toast/public-api.ts +2 -0
- package/cura/forms/cura-checkbox/cura-checkbox.component.html +35 -0
- package/cura/forms/cura-checkbox/cura-checkbox.component.scss +219 -0
- package/cura/forms/cura-checkbox/cura-checkbox.component.ts +284 -0
- package/cura/forms/cura-checkbox/cura-checkbox.definitions.ts +44 -0
- package/cura/forms/cura-checkbox/index.ts +1 -0
- package/cura/forms/cura-checkbox/ng-package.json +6 -0
- package/cura/forms/cura-checkbox/public-api.ts +2 -0
- package/cura/forms/cura-forms.definitions.ts +18 -0
- package/cura/forms/cura-input-text/cura-input-text.component.html +65 -0
- package/cura/forms/cura-input-text/cura-input-text.component.scss +165 -0
- package/cura/forms/cura-input-text/cura-input-text.component.ts +621 -0
- package/cura/forms/cura-input-text/cura-input-text.definitions.ts +104 -0
- package/cura/forms/cura-input-text/index.ts +1 -0
- package/cura/forms/cura-input-text/ng-package.json +6 -0
- package/cura/forms/cura-input-text/public-api.ts +2 -0
- package/cura/forms/cura-label/cura-label.component.html +3 -0
- package/cura/forms/cura-label/cura-label.component.scss +68 -0
- package/cura/forms/cura-label/cura-label.component.ts +93 -0
- package/cura/forms/cura-label/index.ts +1 -0
- package/cura/forms/cura-label/ng-package.json +6 -0
- package/cura/forms/cura-label/public-api.ts +1 -0
- package/cura/forms/cura-radio/cura-radio.component.html +28 -0
- package/cura/forms/cura-radio/cura-radio.component.scss +232 -0
- package/cura/forms/cura-radio/cura-radio.component.ts +261 -0
- package/cura/forms/cura-radio/cura-radio.definitions.ts +46 -0
- package/cura/forms/cura-radio/index.ts +1 -0
- package/cura/forms/cura-radio/ng-package.json +6 -0
- package/cura/forms/cura-radio/public-api.ts +2 -0
- package/cura/forms/cura-select/cura-select.component.html +88 -0
- package/cura/forms/cura-select/cura-select.component.scss +112 -0
- package/cura/forms/cura-select/cura-select.component.ts +459 -0
- package/cura/forms/cura-select/cura-select.definitions.ts +34 -0
- package/cura/forms/cura-select/index.ts +1 -0
- package/cura/forms/cura-select/ng-package.json +6 -0
- package/cura/forms/cura-select/public-api.ts +2 -0
- package/cura/forms/cura-select-option/cura-select-option.component.html +9 -0
- package/cura/forms/cura-select-option/cura-select-option.component.scss +33 -0
- package/cura/forms/cura-select-option/cura-select-option.component.ts +93 -0
- package/cura/forms/cura-select-option/cura-select-option.definitions.ts +12 -0
- package/cura/forms/cura-select-option/index.ts +1 -0
- package/cura/forms/cura-select-option/ng-package.json +6 -0
- package/cura/forms/cura-select-option/public-api.ts +2 -0
- package/cura/forms/cura-select-state/cura-select-state.component.html +14 -0
- package/cura/forms/cura-select-state/cura-select-state.component.ts +125 -0
- package/cura/forms/cura-select-state/cura-select-state.definitions.ts +19 -0
- package/cura/forms/cura-select-state/index.ts +1 -0
- package/cura/forms/cura-select-state/ng-package.json +6 -0
- package/cura/forms/cura-select-state/public-api.ts +2 -0
- package/cura/forms/cura-switch/cura-switch.component.html +25 -0
- package/cura/forms/cura-switch/cura-switch.component.scss +134 -0
- package/cura/forms/cura-switch/cura-switch.component.ts +196 -0
- package/cura/forms/cura-switch/cura-switch.definitions.ts +35 -0
- package/cura/forms/cura-switch/index.ts +1 -0
- package/cura/forms/cura-switch/ng-package.json +6 -0
- package/cura/forms/cura-switch/public-api.ts +2 -0
- package/cura/forms/cura-textarea/cura-textarea.component.html +44 -0
- package/cura/forms/cura-textarea/cura-textarea.component.scss +173 -0
- package/cura/forms/cura-textarea/cura-textarea.component.ts +226 -0
- package/cura/forms/cura-textarea/cura-textarea.definitions.ts +24 -0
- package/cura/forms/cura-textarea/index.ts +1 -0
- package/cura/forms/cura-textarea/ng-package.json +6 -0
- package/cura/forms/cura-textarea/public-api.ts +2 -0
- package/cura/forms/index.ts +1 -0
- package/cura/forms/ng-package.json +6 -0
- package/cura/forms/public-api.ts +1 -0
- package/cura/icons/cura-icon/cura-icon.component.html +3 -0
- package/cura/icons/cura-icon/cura-icon.component.scss +14 -0
- package/cura/icons/cura-icon/cura-icon.component.spec.ts +89 -0
- package/cura/icons/cura-icon/cura-icon.component.ts +79 -0
- package/cura/icons/cura-icon/cura-icon.definitions.ts +20 -0
- package/cura/icons/cura-icon/index.ts +1 -0
- package/cura/icons/cura-icon/ng-package.json +6 -0
- package/cura/icons/cura-icon/public-api.ts +2 -0
- package/cura/loaders/cura-loader-bar/cura-loader-bar.component.html +3 -0
- package/cura/loaders/cura-loader-bar/cura-loader-bar.component.scss +23 -0
- package/cura/loaders/cura-loader-bar/cura-loader-bar.component.ts +37 -0
- package/cura/loaders/cura-loader-bar/index.ts +1 -0
- package/cura/loaders/cura-loader-bar/ng-package.json +6 -0
- package/cura/loaders/cura-loader-bar/public-api.ts +1 -0
- package/cura/loaders/cura-loader-circle/cura-loader-circle.component.html +12 -0
- package/cura/loaders/cura-loader-circle/cura-loader-circle.component.scss +39 -0
- package/cura/loaders/cura-loader-circle/cura-loader-circle.component.ts +45 -0
- package/cura/loaders/cura-loader-circle/index.ts +1 -0
- package/cura/loaders/cura-loader-circle/ng-package.json +6 -0
- package/cura/loaders/cura-loader-circle/public-api.ts +1 -0
- package/cura/scss/mixins/buttons.scss +244 -0
- package/cura/scss/mixins/forms.scss +298 -0
- package/cura/scss/mixins/responsive.scss +69 -0
- package/cura/scss/mixins/shadows.scss +71 -0
- package/cura/scss/mixins/spacing.scss +33 -0
- package/cura/scss/mixins/text.scss +11 -0
- package/cura/texts/cura-display/cura-display.component.html +41 -0
- package/cura/texts/cura-display/cura-display.component.scss +91 -0
- package/cura/texts/cura-display/cura-display.component.ts +85 -0
- package/cura/texts/cura-display/index.ts +1 -0
- package/cura/texts/cura-display/ng-package.json +6 -0
- package/cura/texts/cura-display/public-api.ts +1 -0
- package/cura/texts/cura-heading/cura-heading.component.html +41 -0
- package/cura/texts/cura-heading/cura-heading.component.scss +160 -0
- package/cura/texts/cura-heading/cura-heading.component.ts +111 -0
- package/cura/texts/cura-heading/index.ts +1 -0
- package/cura/texts/cura-heading/ng-package.json +6 -0
- package/cura/texts/cura-heading/public-api.ts +1 -0
- package/cura/texts/cura-paragraph/cura-paragraph.component.html +3 -0
- package/cura/texts/cura-paragraph/cura-paragraph.component.scss +130 -0
- package/cura/texts/cura-paragraph/cura-paragraph.component.ts +94 -0
- package/cura/texts/cura-paragraph/index.ts +1 -0
- package/cura/texts/cura-paragraph/ng-package.json +6 -0
- package/cura/texts/cura-paragraph/public-api.ts +1 -0
- package/cura/texts/cura-texts.definitions.ts +9 -0
- package/cura/texts/index.ts +1 -0
- package/cura/texts/ng-package.json +6 -0
- package/cura/texts/public-api.ts +1 -0
- package/enums/EnumError.enum.ts +4 -0
- package/enums/EnumThemes.enum.ts +8 -0
- package/enums/Estados.enum.ts +29 -0
- package/enums/IconCuraDefaultType.enum.ts +119 -0
- package/enums/ImageMimeType.enum.ts +5 -0
- package/enums/UnidadeCoverageType.enum.ts +5 -0
- package/enums/index.ts +1 -0
- package/enums/ng-package.json +6 -0
- package/enums/public-api.ts +6 -0
- package/ng-package.json +8 -0
- package/package.json +9 -312
- package/services/algolia/algolia.service.spec.ts +16 -0
- package/services/algolia/algolia.service.ts +36 -0
- package/services/algolia/index.ts +1 -0
- package/services/algolia/ng-package.json +6 -0
- package/services/algolia/public-api.ts +1 -0
- package/services/algolia-search-api/algolia-search-api.service.spec.ts +16 -0
- package/services/algolia-search-api/algolia-search-api.service.ts +72 -0
- package/services/algolia-search-api/index.ts +1 -0
- package/services/algolia-search-api/ng-package.json +6 -0
- package/services/algolia-search-api/public-api.ts +1 -0
- package/services/ngu-carousel/index.ts +1 -0
- package/services/ngu-carousel/ng-package.json +6 -0
- package/services/ngu-carousel/ngu-carousel.service.spec.ts +16 -0
- package/services/ngu-carousel/ngu-carousel.service.ts +80 -0
- package/services/ngu-carousel/public-api.ts +1 -0
- package/services/ssr-loading/index.ts +1 -0
- package/services/ssr-loading/ng-package.json +6 -0
- package/services/ssr-loading/public-api.ts +1 -0
- package/services/ssr-loading/ssr-loading.service.spec.ts +16 -0
- package/services/ssr-loading/ssr-loading.service.ts +41 -0
- package/services/transfer-state/index.ts +1 -0
- package/services/transfer-state/ng-package.json +6 -0
- package/services/transfer-state/public-api.ts +1 -0
- package/services/transfer-state/transfer-state.service.spec.ts +16 -0
- package/services/transfer-state/transfer-state.service.ts +38 -0
- package/services/youtube/index.ts +1 -0
- package/services/youtube/ng-package.json +6 -0
- package/services/youtube/public-api.ts +1 -0
- package/services/youtube/youtube.service.spec.ts +16 -0
- package/services/youtube/youtube.service.ts +28 -0
- package/shared/directives/rdsite-click-outside/rdsite-click-outside.directive.spec.ts +8 -0
- package/shared/directives/rdsite-click-outside/rdsite-click-outside.directive.ts +18 -0
- package/shared/helpers/clean-text.func.ts +15 -0
- package/shared/helpers/mediaQueries.ts +11 -0
- package/shared/helpers/removeDuplicateObjectsFromArray.func.ts +5 -0
- package/shared/helpers/removeDuplicateValuesFromArray.func.ts +5 -0
- package/shared/helpers/stringToSlug.func.ts +32 -0
- package/shared/index.ts +1 -0
- package/shared/ng-package.json +6 -0
- package/shared/pipes/phone/phone.pipe.spec.ts +8 -0
- package/shared/pipes/phone/phone.pipe.ts +11 -0
- package/shared/public-api.ts +9 -0
- package/src/public-api.ts +5 -0
- package/styles/_mixins.scss +49 -0
- package/styles/_utilities.scss +22 -0
- package/tsconfig.lib.json +13 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/components/algolia-dropdown/index.d.ts +0 -38
- package/components/algolia-search/index.d.ts +0 -304
- package/components/banner/index.d.ts +0 -20
- package/components/breadcrumbs/index.d.ts +0 -42
- package/components/cards/index.d.ts +0 -102
- package/components/carousels/index.d.ts +0 -28
- package/components/cta-wrapper/index.d.ts +0 -33
- package/components/error/index.d.ts +0 -47
- package/components/filter-letter-and-terms/index.d.ts +0 -38
- package/components/filters/filter-generic/index.d.ts +0 -70
- package/components/filters/filter-planos-convenios/index.d.ts +0 -41
- package/components/footer/index.d.ts +0 -44
- package/components/header/components/action/index.d.ts +0 -17
- package/components/header/components/auxiliar/index.d.ts +0 -31
- package/components/header/components/main/index.d.ts +0 -72
- package/components/header/components/side/index.d.ts +0 -35
- package/components/header/index.d.ts +0 -63
- package/components/header/services/index.d.ts +0 -14
- package/components/image/index.d.ts +0 -23
- package/components/load-screen/index.d.ts +0 -14
- package/components/modal/index.d.ts +0 -28
- package/components/modal-drawer/index.d.ts +0 -46
- package/components/overlay/index.d.ts +0 -10
- package/components/page-header/index.d.ts +0 -30
- package/components/page-template-fullcontent/index.d.ts +0 -17
- package/components/page-template-sidebar/index.d.ts +0 -20
- package/components/pagination/index.d.ts +0 -30
- package/components/search/index.d.ts +0 -45
- package/components/section-navigation/index.d.ts +0 -45
- package/components/side-ctas/index.d.ts +0 -70
- package/components/sidebar-navigation/index.d.ts +0 -40
- package/components/sticky-navigation/index.d.ts +0 -42
- package/components/whatsapp/index.d.ts +0 -27
- package/core/index.d.ts +0 -2049
- package/cura/accordion/index.d.ts +0 -120
- package/cura/api/index.d.ts +0 -359
- package/cura/badges/cura-badge-counter/index.d.ts +0 -38
- package/cura/badges/cura-badge-distance/index.d.ts +0 -21
- package/cura/badges/cura-badge-dot/index.d.ts +0 -29
- package/cura/badges/cura-badge-pill/index.d.ts +0 -42
- package/cura/badges/index.d.ts +0 -5
- package/cura/buttons/cura-button/index.d.ts +0 -90
- package/cura/buttons/cura-button-outline/index.d.ts +0 -90
- package/cura/buttons/cura-button-select/index.d.ts +0 -39
- package/cura/buttons/cura-button-transparent/index.d.ts +0 -87
- package/cura/buttons/index.d.ts +0 -15
- package/cura/cards/cura-card/index.d.ts +0 -49
- package/cura/feedback/cura-alert/index.d.ts +0 -55
- package/cura/feedback/cura-modal/index.d.ts +0 -97
- package/cura/feedback/cura-toast/index.d.ts +0 -104
- package/cura/forms/cura-checkbox/index.d.ts +0 -157
- package/cura/forms/cura-input-text/index.d.ts +0 -236
- package/cura/forms/cura-label/index.d.ts +0 -47
- package/cura/forms/cura-radio/index.d.ts +0 -148
- package/cura/forms/cura-select/index.d.ts +0 -155
- package/cura/forms/cura-select-option/index.d.ts +0 -54
- package/cura/forms/cura-select-state/index.d.ts +0 -72
- package/cura/forms/cura-switch/index.d.ts +0 -113
- package/cura/forms/cura-textarea/index.d.ts +0 -113
- package/cura/forms/index.d.ts +0 -20
- package/cura/icons/cura-icon/index.d.ts +0 -46
- package/cura/loaders/cura-loader-bar/index.d.ts +0 -22
- package/cura/loaders/cura-loader-circle/index.d.ts +0 -24
- package/cura/texts/cura-display/index.d.ts +0 -54
- package/cura/texts/cura-heading/index.d.ts +0 -65
- package/cura/texts/cura-paragraph/index.d.ts +0 -54
- package/cura/texts/index.d.ts +0 -7
- package/enums/index.d.ts +0 -177
- package/fesm2022/rededor-site-front-end-lib-components-algolia-dropdown.mjs +0 -108
- package/fesm2022/rededor-site-front-end-lib-components-algolia-dropdown.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-algolia-search.mjs +0 -604
- package/fesm2022/rededor-site-front-end-lib-components-algolia-search.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-banner.mjs +0 -44
- package/fesm2022/rededor-site-front-end-lib-components-banner.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-breadcrumbs.mjs +0 -120
- package/fesm2022/rededor-site-front-end-lib-components-breadcrumbs.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-cards.mjs +0 -178
- package/fesm2022/rededor-site-front-end-lib-components-cards.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-carousels.mjs +0 -75
- package/fesm2022/rededor-site-front-end-lib-components-carousels.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-cta-wrapper.mjs +0 -78
- package/fesm2022/rededor-site-front-end-lib-components-cta-wrapper.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-error.mjs +0 -176
- package/fesm2022/rededor-site-front-end-lib-components-error.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs +0 -93
- package/fesm2022/rededor-site-front-end-lib-components-filter-letter-and-terms.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-generic.mjs +0 -245
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-generic.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-planos-convenios.mjs +0 -139
- package/fesm2022/rededor-site-front-end-lib-components-filters-filter-planos-convenios.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-footer.mjs +0 -199
- package/fesm2022/rededor-site-front-end-lib-components-footer.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-action.mjs +0 -34
- package/fesm2022/rededor-site-front-end-lib-components-header-components-action.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-auxiliar.mjs +0 -62
- package/fesm2022/rededor-site-front-end-lib-components-header-components-auxiliar.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-main.mjs +0 -167
- package/fesm2022/rededor-site-front-end-lib-components-header-components-main.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-components-side.mjs +0 -71
- package/fesm2022/rededor-site-front-end-lib-components-header-components-side.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-header-services.mjs +0 -50
- package/fesm2022/rededor-site-front-end-lib-components-header-services.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-header.mjs +0 -416
- package/fesm2022/rededor-site-front-end-lib-components-header.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-image.mjs +0 -48
- package/fesm2022/rededor-site-front-end-lib-components-image.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-load-screen.mjs +0 -30
- package/fesm2022/rededor-site-front-end-lib-components-load-screen.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-modal-drawer.mjs +0 -145
- package/fesm2022/rededor-site-front-end-lib-components-modal-drawer.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-modal.mjs +0 -82
- package/fesm2022/rededor-site-front-end-lib-components-modal.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-overlay.mjs +0 -24
- package/fesm2022/rededor-site-front-end-lib-components-overlay.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-header.mjs +0 -52
- package/fesm2022/rededor-site-front-end-lib-components-page-header.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-template-fullcontent.mjs +0 -27
- package/fesm2022/rededor-site-front-end-lib-components-page-template-fullcontent.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-page-template-sidebar.mjs +0 -30
- package/fesm2022/rededor-site-front-end-lib-components-page-template-sidebar.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-pagination.mjs +0 -55
- package/fesm2022/rededor-site-front-end-lib-components-pagination.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-search.mjs +0 -119
- package/fesm2022/rededor-site-front-end-lib-components-search.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-section-navigation.mjs +0 -141
- package/fesm2022/rededor-site-front-end-lib-components-section-navigation.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-side-ctas.mjs +0 -118
- package/fesm2022/rededor-site-front-end-lib-components-side-ctas.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs +0 -109
- package/fesm2022/rededor-site-front-end-lib-components-sidebar-navigation.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs +0 -120
- package/fesm2022/rededor-site-front-end-lib-components-sticky-navigation.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-components-whatsapp.mjs +0 -49
- package/fesm2022/rededor-site-front-end-lib-components-whatsapp.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-core.mjs +0 -1812
- package/fesm2022/rededor-site-front-end-lib-core.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-accordion.mjs +0 -252
- package/fesm2022/rededor-site-front-end-lib-cura-accordion.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-api.mjs +0 -643
- package/fesm2022/rededor-site-front-end-lib-cura-api.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-counter.mjs +0 -90
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-counter.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-distance.mjs +0 -55
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-distance.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-dot.mjs +0 -66
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-dot.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-pill.mjs +0 -91
- package/fesm2022/rededor-site-front-end-lib-cura-badges-cura-badge-pill.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-badges.mjs +0 -4
- package/fesm2022/rededor-site-front-end-lib-cura-badges.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-outline.mjs +0 -170
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-outline.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-select.mjs +0 -135
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-select.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-transparent.mjs +0 -161
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button-transparent.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button.mjs +0 -170
- package/fesm2022/rededor-site-front-end-lib-cura-buttons-cura-button.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-buttons.mjs +0 -13
- package/fesm2022/rededor-site-front-end-lib-cura-buttons.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-cards-cura-card.mjs +0 -72
- package/fesm2022/rededor-site-front-end-lib-cura-cards-cura-card.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-alert.mjs +0 -90
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-alert.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-modal.mjs +0 -105
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-modal.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs +0 -198
- package/fesm2022/rededor-site-front-end-lib-cura-feedback-cura-toast.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-checkbox.mjs +0 -258
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-checkbox.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-input-text.mjs +0 -587
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-input-text.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-label.mjs +0 -82
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-label.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-radio.mjs +0 -243
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-radio.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-option.mjs +0 -89
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-option.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-state.mjs +0 -123
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select-state.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select.mjs +0 -389
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-select.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-switch.mjs +0 -182
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-switch.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-textarea.mjs +0 -209
- package/fesm2022/rededor-site-front-end-lib-cura-forms-cura-textarea.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-forms.mjs +0 -21
- package/fesm2022/rededor-site-front-end-lib-cura-forms.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-icons-cura-icon.mjs +0 -88
- package/fesm2022/rededor-site-front-end-lib-cura-icons-cura-icon.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-bar.mjs +0 -44
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-bar.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-circle.mjs +0 -49
- package/fesm2022/rededor-site-front-end-lib-cura-loaders-cura-loader-circle.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-display.mjs +0 -84
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-display.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-heading.mjs +0 -104
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-heading.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-paragraph.mjs +0 -89
- package/fesm2022/rededor-site-front-end-lib-cura-texts-cura-paragraph.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-cura-texts.mjs +0 -4
- package/fesm2022/rededor-site-front-end-lib-cura-texts.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-enums.mjs +0 -188
- package/fesm2022/rededor-site-front-end-lib-enums.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-services-algolia-search-api.mjs +0 -74
- package/fesm2022/rededor-site-front-end-lib-services-algolia-search-api.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-services-algolia.mjs +0 -41
- package/fesm2022/rededor-site-front-end-lib-services-algolia.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-services-ngu-carousel.mjs +0 -88
- package/fesm2022/rededor-site-front-end-lib-services-ngu-carousel.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-services-ssr-loading.mjs +0 -52
- package/fesm2022/rededor-site-front-end-lib-services-ssr-loading.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs +0 -49
- package/fesm2022/rededor-site-front-end-lib-services-transfer-state.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-services-youtube.mjs +0 -40
- package/fesm2022/rededor-site-front-end-lib-services-youtube.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib-shared.mjs +0 -110
- package/fesm2022/rededor-site-front-end-lib-shared.mjs.map +0 -1
- package/fesm2022/rededor-site-front-end-lib.mjs +0 -11
- package/fesm2022/rededor-site-front-end-lib.mjs.map +0 -1
- package/index.d.ts +0 -3
- package/services/algolia/index.d.ts +0 -18
- package/services/algolia-search-api/index.d.ts +0 -17
- package/services/ngu-carousel/index.d.ts +0 -16
- package/services/ssr-loading/index.d.ts +0 -14
- package/services/transfer-state/index.d.ts +0 -13
- package/services/youtube/index.d.ts +0 -13
- package/shared/index.d.ts +0 -40
|
@@ -1,1812 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, DOCUMENT, Injectable, signal, PLATFORM_ID, ElementRef, model, HostListener, Directive, input, makeStateKey, TransferState, RESPONSE_INIT } from '@angular/core';
|
|
3
|
-
import { isPlatformBrowser, Location, isPlatformServer } from '@angular/common';
|
|
4
|
-
import { Router } from '@angular/router';
|
|
5
|
-
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
6
|
-
import { catchError, throwError, tap, of, BehaviorSubject, Observable, map } from 'rxjs';
|
|
7
|
-
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
|
8
|
-
import { differenceInMilliseconds } from 'date-fns';
|
|
9
|
-
import { v4 } from 'uuid';
|
|
10
|
-
import { Title, Meta } from '@angular/platform-browser';
|
|
11
|
-
import * as he from 'he';
|
|
12
|
-
|
|
13
|
-
// Configura a lib com informações especificas de cada projeto.
|
|
14
|
-
const LIB_CONFIG = new InjectionToken('libConfig');
|
|
15
|
-
|
|
16
|
-
const REQUEST = new InjectionToken('REQUEST');
|
|
17
|
-
const RESPONSE = new InjectionToken('RESPONSE');
|
|
18
|
-
|
|
19
|
-
class PhoneService {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.document = inject(DOCUMENT);
|
|
22
|
-
this.telRegex = /tel:/;
|
|
23
|
-
this.phoneModalIsAllowed = true; // variavel utilizada para permitir/bloquear o modal de telefone
|
|
24
|
-
}
|
|
25
|
-
/** Verifica se o 'href' é de telefone e se a janela está em tamanho desktop */
|
|
26
|
-
isPhoneModal(href) {
|
|
27
|
-
const width = this.document.defaultView?.innerWidth ?? 0;
|
|
28
|
-
const SMALL_BREAKPOINT = 718;
|
|
29
|
-
return this.telRegex.test(href) && width > SMALL_BREAKPOINT;
|
|
30
|
-
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PhoneService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
32
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PhoneService, providedIn: 'root' }); }
|
|
33
|
-
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PhoneService, decorators: [{
|
|
35
|
-
type: Injectable,
|
|
36
|
-
args: [{
|
|
37
|
-
providedIn: 'root',
|
|
38
|
-
}]
|
|
39
|
-
}] });
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Executa uma função recursivamente até que uma condição seja atendida ou atinja o máximo de tentativas
|
|
43
|
-
* @param fn - Função a ser executada quando a condição for atendida
|
|
44
|
-
* @param condition - Função que retorna true quando a condição for satisfeita
|
|
45
|
-
* @param maxTries - Número máximo de tentativas (padrão: 10)
|
|
46
|
-
* @param delay - Delay entre tentativas em ms (padrão: 200)
|
|
47
|
-
* @param currentTry - Contador interno de tentativas (padrão: 0)
|
|
48
|
-
* @param args - Argumentos que serão passados para a função fn
|
|
49
|
-
*/
|
|
50
|
-
function executeWithRetry(fn, condition, maxTries = 10, delay = 200, currentTry = 0, ...args) {
|
|
51
|
-
if (!condition() && currentTry < maxTries) {
|
|
52
|
-
setTimeout(() => {
|
|
53
|
-
executeWithRetry(fn, condition, maxTries, delay, currentTry + 1, ...args);
|
|
54
|
-
}, delay);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
fn(...args);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
class AbstractModalComponent {
|
|
62
|
-
}
|
|
63
|
-
class ModalService {
|
|
64
|
-
constructor() {
|
|
65
|
-
this.reference = null;
|
|
66
|
-
this.firstInteraction = signal(false, ...(ngDevMode ? [{ debugName: "firstInteraction" }] : []));
|
|
67
|
-
this.maxTries = 10;
|
|
68
|
-
this.delay = 200;
|
|
69
|
-
}
|
|
70
|
-
open() {
|
|
71
|
-
this.firstInteraction.set(true);
|
|
72
|
-
executeWithRetry(() => {
|
|
73
|
-
this.reference?.open();
|
|
74
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
75
|
-
}
|
|
76
|
-
setReference(element) {
|
|
77
|
-
this.reference = element;
|
|
78
|
-
}
|
|
79
|
-
setHeader(header) {
|
|
80
|
-
executeWithRetry(() => {
|
|
81
|
-
if (this.reference) {
|
|
82
|
-
this.reference.modalHeader = header;
|
|
83
|
-
}
|
|
84
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
85
|
-
}
|
|
86
|
-
setTitle(title) {
|
|
87
|
-
executeWithRetry(() => {
|
|
88
|
-
if (this.reference) {
|
|
89
|
-
this.reference.modalTitle = title;
|
|
90
|
-
}
|
|
91
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
92
|
-
}
|
|
93
|
-
setContent(content, context = {}) {
|
|
94
|
-
executeWithRetry(() => {
|
|
95
|
-
if (this.reference) {
|
|
96
|
-
this.reference.modalContent = content;
|
|
97
|
-
this.reference.modalContentContext = context;
|
|
98
|
-
}
|
|
99
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
100
|
-
}
|
|
101
|
-
setActions(actions) {
|
|
102
|
-
executeWithRetry(() => {
|
|
103
|
-
if (this.reference) {
|
|
104
|
-
this.reference.modalActions = actions;
|
|
105
|
-
}
|
|
106
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
107
|
-
}
|
|
108
|
-
setStyle(style) {
|
|
109
|
-
executeWithRetry(() => {
|
|
110
|
-
if (this.reference) {
|
|
111
|
-
this.reference.componentStyle = style;
|
|
112
|
-
}
|
|
113
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
114
|
-
}
|
|
115
|
-
setDefaultPhoneModal(modal) {
|
|
116
|
-
this.defaultPhoneModal = modal;
|
|
117
|
-
}
|
|
118
|
-
close() {
|
|
119
|
-
executeWithRetry(() => this.reference?.close(), () => !!this.reference, this.maxTries, this.delay);
|
|
120
|
-
}
|
|
121
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
122
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalService, providedIn: 'root' }); }
|
|
123
|
-
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalService, decorators: [{
|
|
125
|
-
type: Injectable,
|
|
126
|
-
args: [{
|
|
127
|
-
providedIn: 'root',
|
|
128
|
-
}]
|
|
129
|
-
}] });
|
|
130
|
-
|
|
131
|
-
var RdsiteModalComponentStyle;
|
|
132
|
-
(function (RdsiteModalComponentStyle) {
|
|
133
|
-
RdsiteModalComponentStyle["DEFAULT"] = "default";
|
|
134
|
-
RdsiteModalComponentStyle["ALERT"] = "alert";
|
|
135
|
-
RdsiteModalComponentStyle["LIGHT"] = "light";
|
|
136
|
-
RdsiteModalComponentStyle["DOCTORCARD"] = "doctor-card";
|
|
137
|
-
RdsiteModalComponentStyle["HOMESLIDE"] = "home-slide";
|
|
138
|
-
RdsiteModalComponentStyle["BASIC"] = "basic";
|
|
139
|
-
RdsiteModalComponentStyle["SHARING"] = "sharing";
|
|
140
|
-
RdsiteModalComponentStyle["FORMFALLBACK"] = "form-fallback";
|
|
141
|
-
RdsiteModalComponentStyle["FILTER"] = "filter";
|
|
142
|
-
RdsiteModalComponentStyle["FILTERDOENCAS"] = "filter-doencas";
|
|
143
|
-
RdsiteModalComponentStyle["PHOTOGALLERY"] = "photo-gallery";
|
|
144
|
-
})(RdsiteModalComponentStyle || (RdsiteModalComponentStyle = {}));
|
|
145
|
-
|
|
146
|
-
const formatPhone = (phone) => {
|
|
147
|
-
if (!phone)
|
|
148
|
-
return '';
|
|
149
|
-
const cleanPhone = phone.replace(/[^0-9]/gi, '');
|
|
150
|
-
let formatedPhone = '';
|
|
151
|
-
if (cleanPhone.length === 12) {
|
|
152
|
-
formatedPhone = cleanPhone.replace(/(\d{3})?(\d{5})?(\d{4})/, '($1) $2-$3');
|
|
153
|
-
}
|
|
154
|
-
else if (cleanPhone.length === 11) {
|
|
155
|
-
formatedPhone = cleanPhone.replace(/(\d{2})?(\d{5})?(\d{4})/, '($1) $2-$3');
|
|
156
|
-
}
|
|
157
|
-
else if (cleanPhone.length === 10) {
|
|
158
|
-
formatedPhone = cleanPhone.replace(/(\d{2})?(\d{4})?(\d{4})/, '($1) $2-$3');
|
|
159
|
-
}
|
|
160
|
-
else if (cleanPhone.length === 9) {
|
|
161
|
-
formatedPhone = cleanPhone.replace(/(\d{5})?(\d{4})/, '$1-$2');
|
|
162
|
-
}
|
|
163
|
-
else if (cleanPhone.length === 8) {
|
|
164
|
-
formatedPhone = cleanPhone.replace(/(\d{4})?(\d{4})/, '$1-$2');
|
|
165
|
-
}
|
|
166
|
-
else if (cleanPhone.length === 7) {
|
|
167
|
-
formatedPhone = cleanPhone.replace(/(\d{3})?(\d{4})/, '$1-$2');
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
formatedPhone = cleanPhone;
|
|
171
|
-
}
|
|
172
|
-
return formatedPhone;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
class RdsitePhoneModalDirective {
|
|
176
|
-
constructor() {
|
|
177
|
-
this.modalService = inject(ModalService);
|
|
178
|
-
this.platformId = inject(PLATFORM_ID);
|
|
179
|
-
this.element = inject((ElementRef));
|
|
180
|
-
this.phoneService = inject(PhoneService);
|
|
181
|
-
this.rdsitephonemodal = model(null, ...(ngDevMode ? [{ debugName: "rdsitephonemodal" }] : []));
|
|
182
|
-
this.allowedTags = ['A', 'CURA-BUTTON', 'CURA-BUTTON-OUTLINE', 'CURA-BUTTON-TRANSPARENT'];
|
|
183
|
-
}
|
|
184
|
-
// Intercepta cliques em telefones e aplica comportamentos diferentes em tamanho desktop.
|
|
185
|
-
onClick(event) {
|
|
186
|
-
if (!isPlatformBrowser(this.platformId) || !this.allowedTags.includes(this.element?.nativeElement?.tagName) || !this.phoneService.phoneModalIsAllowed)
|
|
187
|
-
return;
|
|
188
|
-
const href = this.element?.nativeElement?.getAttribute('href') ?? '';
|
|
189
|
-
if (this.phoneService.isPhoneModal(href)) {
|
|
190
|
-
this.openPhoneModal(event, href);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
openPhoneModal(event, href) {
|
|
194
|
-
event.preventDefault();
|
|
195
|
-
event.stopPropagation();
|
|
196
|
-
this.modalService.setContent(this.rdsitephonemodal() || this.modalService.defaultPhoneModal, { phone: formatPhone(href) });
|
|
197
|
-
this.modalService.setStyle(RdsiteModalComponentStyle.DEFAULT);
|
|
198
|
-
this.modalService.open();
|
|
199
|
-
}
|
|
200
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RdsitePhoneModalDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
201
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: RdsitePhoneModalDirective, isStandalone: true, selector: "[rdsitephonemodal]", inputs: { rdsitephonemodal: { classPropertyName: "rdsitephonemodal", publicName: "rdsitephonemodal", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rdsitephonemodal: "rdsitephonemodalChange" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
|
|
202
|
-
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RdsitePhoneModalDirective, decorators: [{
|
|
204
|
-
type: Directive,
|
|
205
|
-
args: [{
|
|
206
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
207
|
-
selector: '[rdsitephonemodal]',
|
|
208
|
-
}]
|
|
209
|
-
}], propDecorators: { rdsitephonemodal: [{ type: i0.Input, args: [{ isSignal: true, alias: "rdsitephonemodal", required: false }] }, { type: i0.Output, args: ["rdsitephonemodalChange"] }], onClick: [{
|
|
210
|
-
type: HostListener,
|
|
211
|
-
args: ['click', ['$event']]
|
|
212
|
-
}] } });
|
|
213
|
-
|
|
214
|
-
class RdsiteLinkDirective {
|
|
215
|
-
constructor() {
|
|
216
|
-
this.router = inject(Router);
|
|
217
|
-
this.platformId = inject(PLATFORM_ID);
|
|
218
|
-
this.document = inject(DOCUMENT);
|
|
219
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
220
|
-
this.element = inject((ElementRef));
|
|
221
|
-
this.phoneService = inject(PhoneService);
|
|
222
|
-
this.rdsitePhoneModalDirective = inject(RdsitePhoneModalDirective);
|
|
223
|
-
this.deviceDetectorService = inject(DeviceDetectorService);
|
|
224
|
-
this.anchorAdjustment = input(null, ...(ngDevMode ? [{ debugName: "anchorAdjustment" }] : []));
|
|
225
|
-
this.anchorExtraAdjustment = input(null, ...(ngDevMode ? [{ debugName: "anchorExtraAdjustment" }] : []));
|
|
226
|
-
this.phonemodal = input(null, ...(ngDevMode ? [{ debugName: "phonemodal" }] : []));
|
|
227
|
-
this.externalRegex = /^http:|https:|tel:|www\.|mailto:/;
|
|
228
|
-
this.telRegex = /tel:/;
|
|
229
|
-
this.mailRegex = /mailto:/;
|
|
230
|
-
this.siteUrlList = ['rededorsaoluiz', 'rededorlabs'];
|
|
231
|
-
this.allowedTags = ['A', 'CURA-BUTTON', 'CURA-BUTTON-OUTLINE', 'CURA-BUTTON-TRANSPARENT'];
|
|
232
|
-
}
|
|
233
|
-
onClick(event) {
|
|
234
|
-
event.preventDefault();
|
|
235
|
-
if (!isPlatformBrowser(this.platformId) || !this.allowedTags.includes(this.element?.nativeElement?.tagName))
|
|
236
|
-
return;
|
|
237
|
-
let href = this.element?.nativeElement?.getAttribute('href') ?? '';
|
|
238
|
-
if (!href)
|
|
239
|
-
return;
|
|
240
|
-
href = this.verifyUtm(href);
|
|
241
|
-
if (this.isPhone(href)) {
|
|
242
|
-
this.phoneClicked({
|
|
243
|
-
href,
|
|
244
|
-
event,
|
|
245
|
-
element: this.element,
|
|
246
|
-
phonemodal: this.phonemodal(),
|
|
247
|
-
});
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
const isMobile = this.deviceDetectorService.isMobile();
|
|
251
|
-
const deviceInfo = this.deviceDetectorService.getDeviceInfo();
|
|
252
|
-
if (this.isMail(href)) {
|
|
253
|
-
const target = isMobile || deviceInfo.browser !== 'Chrome' ? '_self' : '_blank';
|
|
254
|
-
window.open(href, target);
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
if (this.isExternalUrl(href)) {
|
|
258
|
-
const target = this.isSiteUrl(href) ? '_self' : '_blank';
|
|
259
|
-
window.open(href, target);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
if (this.isAnchor(href)) {
|
|
263
|
-
this.scrollToAnchor(href);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
this.navigateTo(href);
|
|
267
|
-
}
|
|
268
|
-
verifyUtm(href) {
|
|
269
|
-
if (!href.includes('/paciente'))
|
|
270
|
-
return href;
|
|
271
|
-
if (isPlatformBrowser(this.platformId) && typeof window !== 'undefined') {
|
|
272
|
-
const currentUrl = new URL(window.location.href);
|
|
273
|
-
const utmParams = Array.from(currentUrl.searchParams.entries()).filter(([key]) => key.startsWith('utm_'));
|
|
274
|
-
if (utmParams.length === 0)
|
|
275
|
-
return href;
|
|
276
|
-
const targetUrl = new URL(href);
|
|
277
|
-
utmParams.forEach(([key, value]) => targetUrl.searchParams.set(key, value));
|
|
278
|
-
return targetUrl.toString();
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
281
|
-
return href;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
isPhone(href) {
|
|
285
|
-
return this.telRegex.test(href);
|
|
286
|
-
}
|
|
287
|
-
isMail(href) {
|
|
288
|
-
return this.mailRegex.test(href);
|
|
289
|
-
}
|
|
290
|
-
phoneClicked(value) {
|
|
291
|
-
const { href, event, element, phonemodal } = value;
|
|
292
|
-
if (this.phoneService.isPhoneModal(href)) {
|
|
293
|
-
this.setPhoneModal(element, phonemodal);
|
|
294
|
-
this.rdsitePhoneModalDirective.openPhoneModal(event, href);
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
window.open(href, '_self');
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
setPhoneModal(element, phonemodal) {
|
|
301
|
-
if (!this.phonemodal())
|
|
302
|
-
return;
|
|
303
|
-
if (!this.libConfig?.customPhoneModalCondition) {
|
|
304
|
-
this.rdsitePhoneModalDirective.rdsitephonemodal.set(phonemodal);
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
if (this.libConfig?.customPhoneModalCondition(element)) {
|
|
308
|
-
this.rdsitePhoneModalDirective.rdsitephonemodal.set(phonemodal);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
isExternalUrl(href) {
|
|
312
|
-
return this.externalRegex.test(href);
|
|
313
|
-
}
|
|
314
|
-
isSiteUrl(href) {
|
|
315
|
-
const exception = '/paciente';
|
|
316
|
-
return this.siteUrlList.find((url) => href.includes(url) && !href.includes(exception));
|
|
317
|
-
}
|
|
318
|
-
isAnchor(href) {
|
|
319
|
-
return href.includes('#');
|
|
320
|
-
}
|
|
321
|
-
getAnchor(url) {
|
|
322
|
-
const hashIndex = url.indexOf('#');
|
|
323
|
-
return hashIndex !== -1 ? url.substring(hashIndex) : '';
|
|
324
|
-
}
|
|
325
|
-
scrollToAnchor(href) {
|
|
326
|
-
if (href === '#')
|
|
327
|
-
return;
|
|
328
|
-
const anchor = this.getAnchor(href);
|
|
329
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
330
|
-
const docElement = this.document.documentElement;
|
|
331
|
-
let adjustment = 0;
|
|
332
|
-
if (this.libConfig.customAnchorAdjustment) {
|
|
333
|
-
adjustment = this.libConfig.customAnchorAdjustment(this.document);
|
|
334
|
-
}
|
|
335
|
-
if (this.anchorAdjustment()) {
|
|
336
|
-
adjustment = this.anchorAdjustment();
|
|
337
|
-
}
|
|
338
|
-
if (this.anchorExtraAdjustment()) {
|
|
339
|
-
adjustment += this.anchorExtraAdjustment();
|
|
340
|
-
}
|
|
341
|
-
const bodyTop = this.document?.body?.getBoundingClientRect()?.top ?? 0;
|
|
342
|
-
const hrefTop = this.document?.querySelector(anchor)?.getBoundingClientRect()?.top ?? 0;
|
|
343
|
-
const scrollTop = bodyTop * -1 + hrefTop - adjustment;
|
|
344
|
-
docElement.scrollTo({ top: scrollTop, behavior: 'smooth' });
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
navigateTo(href) {
|
|
348
|
-
const siteBasePath = this.libConfig.siteSufix ?? '';
|
|
349
|
-
const siteBasePathNoSlash = siteBasePath.replace(/\//g, '');
|
|
350
|
-
let noBaseHref = href;
|
|
351
|
-
if (!this.libConfig?.skipDuplicationSufixRule) {
|
|
352
|
-
if (href.startsWith(siteBasePathNoSlash)) {
|
|
353
|
-
noBaseHref = href.replace(siteBasePathNoSlash, '');
|
|
354
|
-
}
|
|
355
|
-
else if (href.startsWith(siteBasePath)) {
|
|
356
|
-
noBaseHref = href.replace(siteBasePath, '');
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
if (this.libConfig?.customInternalLinkNavigation && this.libConfig.customInternalLinkNavigation(noBaseHref)) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
const [path, query] = noBaseHref.split('?');
|
|
363
|
-
const queryParams = {};
|
|
364
|
-
if (query) {
|
|
365
|
-
const queryArray = query.split('&');
|
|
366
|
-
queryArray.forEach((q) => {
|
|
367
|
-
const arr = q.split('=');
|
|
368
|
-
queryParams[arr[0]] = arr[1];
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
// Força reload da pagina
|
|
372
|
-
if (this.libConfig?.forcePageReload) {
|
|
373
|
-
const fullUrl = path + (query ? '?' + query : '');
|
|
374
|
-
window.location.href = fullUrl;
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
this.router.navigate([path], { queryParams: queryParams });
|
|
378
|
-
}
|
|
379
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RdsiteLinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
380
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.16", type: RdsiteLinkDirective, isStandalone: true, selector: "[rdsitelink]", inputs: { anchorAdjustment: { classPropertyName: "anchorAdjustment", publicName: "anchorAdjustment", isSignal: true, isRequired: false, transformFunction: null }, anchorExtraAdjustment: { classPropertyName: "anchorExtraAdjustment", publicName: "anchorExtraAdjustment", isSignal: true, isRequired: false, transformFunction: null }, phonemodal: { classPropertyName: "phonemodal", publicName: "phonemodal", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick($event)" } }, providers: [RdsitePhoneModalDirective], ngImport: i0 }); }
|
|
381
|
-
}
|
|
382
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: RdsiteLinkDirective, decorators: [{
|
|
383
|
-
type: Directive,
|
|
384
|
-
args: [{
|
|
385
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
386
|
-
selector: '[rdsitelink]',
|
|
387
|
-
providers: [RdsitePhoneModalDirective],
|
|
388
|
-
}]
|
|
389
|
-
}], propDecorators: { anchorAdjustment: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorAdjustment", required: false }] }], anchorExtraAdjustment: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchorExtraAdjustment", required: false }] }], phonemodal: [{ type: i0.Input, args: [{ isSignal: true, alias: "phonemodal", required: false }] }], onClick: [{
|
|
390
|
-
type: HostListener,
|
|
391
|
-
args: ['click', ['$event']]
|
|
392
|
-
}] } });
|
|
393
|
-
|
|
394
|
-
var RdsiteModalDrawerComponentStyle;
|
|
395
|
-
(function (RdsiteModalDrawerComponentStyle) {
|
|
396
|
-
RdsiteModalDrawerComponentStyle["DEFAULT"] = "default";
|
|
397
|
-
RdsiteModalDrawerComponentStyle["DRAWERDOCTOR"] = "doctor-card";
|
|
398
|
-
RdsiteModalDrawerComponentStyle["FORMFALLBACK"] = "form-fallback";
|
|
399
|
-
RdsiteModalDrawerComponentStyle["FILTERDOENCAS"] = "filter-doencas";
|
|
400
|
-
RdsiteModalDrawerComponentStyle["PHOTOGALLERY"] = "photo-gallery";
|
|
401
|
-
})(RdsiteModalDrawerComponentStyle || (RdsiteModalDrawerComponentStyle = {}));
|
|
402
|
-
|
|
403
|
-
const getSiteUrl = (siteUrl = '', siteSufix = '') => {
|
|
404
|
-
const baseUrl = siteUrl.endsWith('/') ? siteUrl.substring(0, siteUrl.length - 1) : siteUrl;
|
|
405
|
-
const baseSufix = siteSufix.endsWith('/') ? siteSufix.substring(0, siteSufix.length - 1) : siteSufix;
|
|
406
|
-
return `${baseUrl}${baseSufix}`;
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
function removeHtmlTags(content) {
|
|
410
|
-
content = content.replace(/<.*?>/g, '');
|
|
411
|
-
return content;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
const checkSafariAgent = () => {
|
|
415
|
-
const safariAgent = navigator.userAgent.includes('Safari');
|
|
416
|
-
const chromeAgent = navigator.userAgent.includes('Chrome');
|
|
417
|
-
return !chromeAgent && safariAgent;
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Função que retorna um replacer personalizado para o JSON.stringify que resolve problemas de estruturas circulares durante a serialização.
|
|
422
|
-
*/
|
|
423
|
-
function getCircularReplacer(customOptions) {
|
|
424
|
-
const seen = new WeakSet();
|
|
425
|
-
const options = {
|
|
426
|
-
ignoreKeys: customOptions?.ignoreKeys || [],
|
|
427
|
-
maxDepth: customOptions?.maxDepth || 100,
|
|
428
|
-
};
|
|
429
|
-
let depth = 0;
|
|
430
|
-
return (key, value) => {
|
|
431
|
-
// Ignora chaves específicas configuradas
|
|
432
|
-
if (options.ignoreKeys.includes(key)) {
|
|
433
|
-
return undefined;
|
|
434
|
-
}
|
|
435
|
-
// Controle de profundidade (opcional)
|
|
436
|
-
if (key === '') {
|
|
437
|
-
depth = 0; // Reinicia a profundidade na raiz
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
depth += 1; // Incrementa apenas quando descer na hierarquia
|
|
441
|
-
}
|
|
442
|
-
if (depth > options.maxDepth) {
|
|
443
|
-
return typeof value === 'object' ? '[Object]' : value;
|
|
444
|
-
}
|
|
445
|
-
// Lida com referências circulares
|
|
446
|
-
if (typeof value === 'object' && value !== null) {
|
|
447
|
-
// Se já vimos este objeto, é uma referência circular
|
|
448
|
-
if (seen.has(value)) {
|
|
449
|
-
return undefined; // Exclui valores circulares
|
|
450
|
-
}
|
|
451
|
-
// Adiciona o objeto ao conjunto de objetos vistos
|
|
452
|
-
seen.add(value);
|
|
453
|
-
}
|
|
454
|
-
return value;
|
|
455
|
-
};
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Função de hash djb2 para gerar chaves numéricas únicas
|
|
460
|
-
*
|
|
461
|
-
* @param str - String para gerar hash
|
|
462
|
-
* @returns Número hash único e positivo
|
|
463
|
-
*/
|
|
464
|
-
const djb2Hash = (str) => {
|
|
465
|
-
let hash = 5381; // Valor inicial do djb2 original
|
|
466
|
-
if (str.length === 0)
|
|
467
|
-
return hash;
|
|
468
|
-
for (let i = 0; i < str.length; i++) {
|
|
469
|
-
const char = str.charCodeAt(i);
|
|
470
|
-
hash = (hash << 5) + hash + char; // hash * 33 + char
|
|
471
|
-
hash = hash & hash; // Converte para 32bit integer
|
|
472
|
-
}
|
|
473
|
-
return Math.abs(hash);
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
class LogService {
|
|
477
|
-
constructor() {
|
|
478
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
479
|
-
this.platformId = inject(PLATFORM_ID);
|
|
480
|
-
this.location = inject(Location);
|
|
481
|
-
}
|
|
482
|
-
logMsg(msg, label) {
|
|
483
|
-
label = label ? `${label} ` : '';
|
|
484
|
-
if (!isPlatformBrowser(this.platformId) || (isPlatformBrowser(this.platformId) && !this.libConfig?.production)) {
|
|
485
|
-
console.log(`${label}${msg}`);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
logLoad(component) {
|
|
489
|
-
this.logMsg(`${this.getPageURL()}${component ? ' - ' + component : ''}`, 'LOAD');
|
|
490
|
-
}
|
|
491
|
-
log404(component) {
|
|
492
|
-
this.logMsg(`${this.getPageURL()}${component ? ' - ' + component : ''}`, '404');
|
|
493
|
-
}
|
|
494
|
-
log500(component) {
|
|
495
|
-
this.logMsg(`${this.getPageURL()}${component ? ' - ' + component : ''}`, '500');
|
|
496
|
-
}
|
|
497
|
-
getPageURL() {
|
|
498
|
-
return `${getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix)}${this.location.path()}`;
|
|
499
|
-
}
|
|
500
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
501
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LogService, providedIn: 'root' }); }
|
|
502
|
-
}
|
|
503
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LogService, decorators: [{
|
|
504
|
-
type: Injectable,
|
|
505
|
-
args: [{
|
|
506
|
-
providedIn: 'root',
|
|
507
|
-
}]
|
|
508
|
-
}] });
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Converte JSON para query string.
|
|
512
|
-
* @param params JSON
|
|
513
|
-
*/
|
|
514
|
-
function toQueryParams(params) {
|
|
515
|
-
return params
|
|
516
|
-
? `?${Object.keys(params)
|
|
517
|
-
.map((key) => key + '=' + params[key])
|
|
518
|
-
.join('&')}`
|
|
519
|
-
: '';
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
/* Adiciona os Headers necessários para funcionamento do site back-end */
|
|
523
|
-
class HttpClientService {
|
|
524
|
-
constructor() {
|
|
525
|
-
this.platformId = inject(PLATFORM_ID);
|
|
526
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
527
|
-
this.http = inject(HttpClient);
|
|
528
|
-
this.deviceService = inject(DeviceDetectorService);
|
|
529
|
-
}
|
|
530
|
-
get(url) {
|
|
531
|
-
const headers = this.getHeaders();
|
|
532
|
-
return this.http.get(url, { headers });
|
|
533
|
-
}
|
|
534
|
-
post(url, data) {
|
|
535
|
-
const headers = this.getHeaders();
|
|
536
|
-
return this.http.post(url, data, { headers });
|
|
537
|
-
}
|
|
538
|
-
getHeaders() {
|
|
539
|
-
const baseHeaders = new HttpHeaders()
|
|
540
|
-
.set('x-origin-application', this.libConfig.xOriginApplication)
|
|
541
|
-
.set('x-origin-channel', this.getOriginChannel())
|
|
542
|
-
.set('x-origin-device', this.getOriginDevice());
|
|
543
|
-
if (isPlatformServer(this.platformId) && this.libConfig.server) {
|
|
544
|
-
return baseHeaders.append('authorization', 'Basic ' + Buffer.from(`${this.libConfig.siteApi.auth.user}:${this.libConfig.siteApi.auth.password}`).toString('base64'));
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
return baseHeaders.append('client_id', this.libConfig.client_id);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
getOriginChannel() {
|
|
551
|
-
return this.deviceService.isDesktop() ? 'desktop' : 'mobile';
|
|
552
|
-
}
|
|
553
|
-
getOriginDevice() {
|
|
554
|
-
return `app-${this.deviceService.getDeviceInfo().os}`;
|
|
555
|
-
}
|
|
556
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HttpClientService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
557
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HttpClientService, providedIn: 'root' }); }
|
|
558
|
-
}
|
|
559
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: HttpClientService, decorators: [{
|
|
560
|
-
type: Injectable,
|
|
561
|
-
args: [{ providedIn: 'root' }]
|
|
562
|
-
}] });
|
|
563
|
-
|
|
564
|
-
class SiteBackendService {
|
|
565
|
-
constructor() {
|
|
566
|
-
this.httpClientService = inject(HttpClientService);
|
|
567
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
568
|
-
this.platformId = inject(PLATFORM_ID);
|
|
569
|
-
this.siteApiUrl = this.getApiUrl();
|
|
570
|
-
}
|
|
571
|
-
getApiUrl() {
|
|
572
|
-
if (isPlatformServer(this.platformId) && this.libConfig.server) {
|
|
573
|
-
return this.libConfig.siteApi.baseInternal;
|
|
574
|
-
}
|
|
575
|
-
return this.libConfig.siteApi.base;
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* GET para qualquer endpoint do back-end do site.
|
|
579
|
-
* @param path - O caminho do recurso. (Inicia sem '/'. Ex: 'unidades/wp')
|
|
580
|
-
* @param params - Parâmetros opcionais para a requisição.
|
|
581
|
-
* @returns Observable que emite os dados retornados pelo back-end.
|
|
582
|
-
*/
|
|
583
|
-
get(path, params) {
|
|
584
|
-
return this.httpClientService.get(`${this.siteApiUrl}${path}${toQueryParams(params)}`);
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* POST para qualquer endpoint do back-end do site.
|
|
588
|
-
* @param path - O caminho do recurso. (Inicia sem '/'. Ex: 'unidades/wp')
|
|
589
|
-
* @param params - Parâmetros opcionais para a requisição.
|
|
590
|
-
* @returns Observable que emite os dados retornados pelo back-end.
|
|
591
|
-
*/
|
|
592
|
-
post(path, params) {
|
|
593
|
-
return this.httpClientService.post(`${this.siteApiUrl}${path}`, params);
|
|
594
|
-
}
|
|
595
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SiteBackendService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
596
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SiteBackendService, providedIn: 'root' }); }
|
|
597
|
-
}
|
|
598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SiteBackendService, decorators: [{
|
|
599
|
-
type: Injectable,
|
|
600
|
-
args: [{
|
|
601
|
-
providedIn: 'root',
|
|
602
|
-
}]
|
|
603
|
-
}], ctorParameters: () => [] });
|
|
604
|
-
|
|
605
|
-
class ErrorInterceptor {
|
|
606
|
-
constructor() {
|
|
607
|
-
this.logService = inject(LogService);
|
|
608
|
-
this.siteBackendService = inject(SiteBackendService);
|
|
609
|
-
this.platformId = inject(PLATFORM_ID);
|
|
610
|
-
}
|
|
611
|
-
intercept(req, next) {
|
|
612
|
-
const queryParams = req.params.keys().length ? `?${req.params.toString()}` : '';
|
|
613
|
-
const requestUrl = `${req.url}${queryParams}`;
|
|
614
|
-
return next.handle(req).pipe(catchError((error) => {
|
|
615
|
-
this.logService.logMsg(`REQUEST ERROR => ${req.method} ${requestUrl}`, 'ERROR_INTERCEPTOR');
|
|
616
|
-
if (isPlatformBrowser(this.platformId) && !req.url.includes('/log/error')) {
|
|
617
|
-
const errorMessage = typeof error === 'string' ? error : error instanceof Error ? error.message : JSON.stringify(error);
|
|
618
|
-
this.siteBackendService
|
|
619
|
-
.post('log/error', {
|
|
620
|
-
error: errorMessage,
|
|
621
|
-
origin: window.location.href,
|
|
622
|
-
url: req.urlWithParams,
|
|
623
|
-
})
|
|
624
|
-
.subscribe();
|
|
625
|
-
}
|
|
626
|
-
return throwError(() => error);
|
|
627
|
-
}));
|
|
628
|
-
}
|
|
629
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
630
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorInterceptor, providedIn: 'root' }); }
|
|
631
|
-
}
|
|
632
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorInterceptor, decorators: [{
|
|
633
|
-
type: Injectable,
|
|
634
|
-
args: [{
|
|
635
|
-
providedIn: 'root',
|
|
636
|
-
}]
|
|
637
|
-
}] });
|
|
638
|
-
|
|
639
|
-
class LogInterceptor {
|
|
640
|
-
constructor() {
|
|
641
|
-
this.logService = inject(LogService);
|
|
642
|
-
}
|
|
643
|
-
intercept(req, next) {
|
|
644
|
-
const requestId = v4();
|
|
645
|
-
const startTime = Date.now();
|
|
646
|
-
const queryParams = req.params.keys().length ? `?${req.params.toString()}` : '';
|
|
647
|
-
const requestUrl = `${req.url}${queryParams}`;
|
|
648
|
-
this.logService.logMsg(`REQUEST ${requestId} => ${req.method} ${requestUrl}`, 'INTERCEPTOR');
|
|
649
|
-
return next.handle(req).pipe(tap((response) => {
|
|
650
|
-
const res = response;
|
|
651
|
-
if (res?.status) {
|
|
652
|
-
const elapsedTime = differenceInMilliseconds(Date.now(), startTime);
|
|
653
|
-
this.logService.logMsg(`RESPONSE ${requestId} => ${req.method} ${requestUrl} | Duração: ${elapsedTime}ms | Status: ${res.status} - ${res.statusText} | Body: ${!!res.body}`, 'INTERCEPTOR');
|
|
654
|
-
}
|
|
655
|
-
}));
|
|
656
|
-
}
|
|
657
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LogInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
658
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LogInterceptor, providedIn: 'root' }); }
|
|
659
|
-
}
|
|
660
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: LogInterceptor, decorators: [{
|
|
661
|
-
type: Injectable,
|
|
662
|
-
args: [{
|
|
663
|
-
providedIn: 'root',
|
|
664
|
-
}]
|
|
665
|
-
}] });
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* Cria uma chave numérica única para o cache
|
|
669
|
-
* Gera um hash baseado em método + URL + parâmetros
|
|
670
|
-
*/
|
|
671
|
-
function createCacheKey(req, url) {
|
|
672
|
-
const method = req.method;
|
|
673
|
-
const params = req.params.toString();
|
|
674
|
-
// Combina método, URL e parâmetros
|
|
675
|
-
const keyString = [method, url, params].filter((part) => part.length > 0).join('::');
|
|
676
|
-
// Gera hash numérico único
|
|
677
|
-
const hashNumber = djb2Hash(keyString);
|
|
678
|
-
return hashNumber.toString();
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
|
-
* Cria StateKey para o TransferState
|
|
682
|
-
*/
|
|
683
|
-
function getTransferStateKey(req, url) {
|
|
684
|
-
const cacheKey = createCacheKey(req, url);
|
|
685
|
-
return makeStateKey(cacheKey);
|
|
686
|
-
}
|
|
687
|
-
/**
|
|
688
|
-
* Interceptor para resolver o problema de TransferState com urls diferentes
|
|
689
|
-
*
|
|
690
|
-
* Problema: O SiteBackendService usa urls diferentes no server (baseInternal) e no client (base), fazendo com que o TransferState nativo do Angular não funcione corretamente.
|
|
691
|
-
*
|
|
692
|
-
* Solução:
|
|
693
|
-
* - Server: Usa url interna, mas salva no TransferState baseado na url externa
|
|
694
|
-
* - Client: Verifica TransferState usando url externa antes de fazer alguma requisição
|
|
695
|
-
*
|
|
696
|
-
* Dessa forma é possivel fazer o uso do TransferState mesmo com urls diferentes ("baseInternal" no server e "base" no client).
|
|
697
|
-
*/
|
|
698
|
-
class TransferStateUrlInterceptor {
|
|
699
|
-
constructor() {
|
|
700
|
-
this.platformId = inject(PLATFORM_ID);
|
|
701
|
-
this.transferState = inject(TransferState);
|
|
702
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
703
|
-
}
|
|
704
|
-
intercept(req, next) {
|
|
705
|
-
if (isPlatformServer(this.platformId)) {
|
|
706
|
-
return this.handleServerRequest(req, next);
|
|
707
|
-
}
|
|
708
|
-
else if (isPlatformBrowser(this.platformId)) {
|
|
709
|
-
return this.handleClientRequest(req, next);
|
|
710
|
-
}
|
|
711
|
-
return next.handle(req);
|
|
712
|
-
}
|
|
713
|
-
/**
|
|
714
|
-
* Filtra headers da resposta baseado na configuração no LibConfig
|
|
715
|
-
*/
|
|
716
|
-
filterHeaders(responseHeaders) {
|
|
717
|
-
const includeHeaders = this.libConfig.transferState?.includeHeaders;
|
|
718
|
-
if (!includeHeaders || includeHeaders.length === 0) {
|
|
719
|
-
return {};
|
|
720
|
-
}
|
|
721
|
-
// Filtra apenas os headers configurados
|
|
722
|
-
const filteredHeaders = {};
|
|
723
|
-
includeHeaders.forEach((headerName) => {
|
|
724
|
-
const headerValue = responseHeaders.get(headerName.toLowerCase());
|
|
725
|
-
if (headerValue) {
|
|
726
|
-
filteredHeaders[headerName.toLowerCase()] = headerValue;
|
|
727
|
-
}
|
|
728
|
-
});
|
|
729
|
-
return filteredHeaders;
|
|
730
|
-
}
|
|
731
|
-
handleServerRequest(req, next) {
|
|
732
|
-
const siteApi = this.libConfig.siteApi;
|
|
733
|
-
// Para urls internas
|
|
734
|
-
if (req.url.startsWith(siteApi.baseInternal)) {
|
|
735
|
-
const externalUrl = req.url.replace(siteApi.baseInternal, siteApi.base);
|
|
736
|
-
const stateKey = getTransferStateKey(req, externalUrl);
|
|
737
|
-
return next.handle(req).pipe(tap((event) => {
|
|
738
|
-
if (event instanceof HttpResponse) {
|
|
739
|
-
const filteredHeaders = this.filterHeaders(event.headers);
|
|
740
|
-
// Salva no TransferState baseado na url externa
|
|
741
|
-
this.transferState.set(stateKey, {
|
|
742
|
-
body: event.body,
|
|
743
|
-
status: event.status,
|
|
744
|
-
statusText: event.statusText,
|
|
745
|
-
headers: filteredHeaders,
|
|
746
|
-
});
|
|
747
|
-
}
|
|
748
|
-
}));
|
|
749
|
-
}
|
|
750
|
-
return next.handle(req);
|
|
751
|
-
}
|
|
752
|
-
handleClientRequest(req, next) {
|
|
753
|
-
const siteApi = this.libConfig.siteApi;
|
|
754
|
-
// Para urls externas
|
|
755
|
-
if (req.url.startsWith(siteApi.base)) {
|
|
756
|
-
const stateKey = getTransferStateKey(req, req.url);
|
|
757
|
-
const cachedResponse = this.transferState.get(stateKey, null);
|
|
758
|
-
if (cachedResponse) {
|
|
759
|
-
this.transferState.remove(stateKey);
|
|
760
|
-
// Retorna resposta do TransferState
|
|
761
|
-
return of(new HttpResponse({
|
|
762
|
-
body: cachedResponse.body,
|
|
763
|
-
status: cachedResponse.status,
|
|
764
|
-
statusText: cachedResponse.statusText,
|
|
765
|
-
headers: cachedResponse.headers,
|
|
766
|
-
}));
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
return next.handle(req);
|
|
770
|
-
}
|
|
771
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TransferStateUrlInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
772
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TransferStateUrlInterceptor, providedIn: 'root' }); }
|
|
773
|
-
}
|
|
774
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TransferStateUrlInterceptor, decorators: [{
|
|
775
|
-
type: Injectable,
|
|
776
|
-
args: [{
|
|
777
|
-
providedIn: 'root',
|
|
778
|
-
}]
|
|
779
|
-
}] });
|
|
780
|
-
|
|
781
|
-
var EnumDoencaTaxonomy;
|
|
782
|
-
(function (EnumDoencaTaxonomy) {
|
|
783
|
-
EnumDoencaTaxonomy["DOENCAS_CAT"] = "doencas_cat";
|
|
784
|
-
EnumDoencaTaxonomy["DOENCAS_TAG"] = "doencas_tag";
|
|
785
|
-
})(EnumDoencaTaxonomy || (EnumDoencaTaxonomy = {}));
|
|
786
|
-
var EnumDoencaTaxonomyCat;
|
|
787
|
-
(function (EnumDoencaTaxonomyCat) {
|
|
788
|
-
EnumDoencaTaxonomyCat["DOENCA"] = "doencas";
|
|
789
|
-
EnumDoencaTaxonomyCat["SINTOMA"] = "sintomas";
|
|
790
|
-
})(EnumDoencaTaxonomyCat || (EnumDoencaTaxonomyCat = {}));
|
|
791
|
-
|
|
792
|
-
var FilterType;
|
|
793
|
-
(function (FilterType) {
|
|
794
|
-
FilterType["INPUT"] = "input";
|
|
795
|
-
FilterType["SELECT"] = "select";
|
|
796
|
-
FilterType["CHECKBOX_GROUP"] = "checkbox-group";
|
|
797
|
-
FilterType["RADIO_GROUP"] = "radio-group";
|
|
798
|
-
FilterType["CUSTOM"] = "custom";
|
|
799
|
-
})(FilterType || (FilterType = {}));
|
|
800
|
-
|
|
801
|
-
class ErrorService {
|
|
802
|
-
constructor() {
|
|
803
|
-
this.ctas = new BehaviorSubject({});
|
|
804
|
-
}
|
|
805
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
806
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorService, providedIn: 'root' }); }
|
|
807
|
-
}
|
|
808
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ErrorService, decorators: [{
|
|
809
|
-
type: Injectable,
|
|
810
|
-
args: [{
|
|
811
|
-
providedIn: 'root',
|
|
812
|
-
}]
|
|
813
|
-
}] });
|
|
814
|
-
|
|
815
|
-
class MapBoxService {
|
|
816
|
-
constructor() {
|
|
817
|
-
this.http = inject(HttpClient);
|
|
818
|
-
this.logService = inject(LogService);
|
|
819
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
820
|
-
this.platformId = inject(PLATFORM_ID);
|
|
821
|
-
this.mapboxAccessToken = this.libConfig.mapboxAccessToken;
|
|
822
|
-
this.mapboxSSRAccessToken = this.libConfig.mapboxSSRAccessToken;
|
|
823
|
-
this.mapboxApiUrl = 'https://api.mapbox.com';
|
|
824
|
-
this.geocodingEp = 'search/geocode/v6';
|
|
825
|
-
}
|
|
826
|
-
/**
|
|
827
|
-
* Busca geocalizada por nome do local.
|
|
828
|
-
* Ex.: barra da tijuca, rio de janeiro - rio de janeiro, brasil
|
|
829
|
-
* @param query nome de local para a busca
|
|
830
|
-
* @param params parâmetros opcionais de busca e filtro
|
|
831
|
-
*/
|
|
832
|
-
forwardGeocoding(query, params = {}, logContext) {
|
|
833
|
-
this.logMapbox('forwardGeocoding', logContext);
|
|
834
|
-
if (query.length >= 256) {
|
|
835
|
-
return throwError(() => 'Query length exceeds 255 characters.');
|
|
836
|
-
}
|
|
837
|
-
const url = `${this.mapboxApiUrl}/${this.geocodingEp}/forward?q=${query}`;
|
|
838
|
-
params['access_token'] = isPlatformBrowser(this.platformId) ? this.mapboxAccessToken : this.mapboxSSRAccessToken;
|
|
839
|
-
return this.http.get(url, { params, headers: this.getHeaders() });
|
|
840
|
-
}
|
|
841
|
-
/**
|
|
842
|
-
* Busca local por longitude e latitude
|
|
843
|
-
* @param lng formato longitude
|
|
844
|
-
* @param lat formato latitude
|
|
845
|
-
* @param params parâmetros opcionais de busca e filtro
|
|
846
|
-
*/
|
|
847
|
-
reverseGeocoding(lng, lat, params = {}, logContext) {
|
|
848
|
-
this.logMapbox('reverseGeocoding', logContext);
|
|
849
|
-
const url = `${this.mapboxApiUrl}/${this.geocodingEp}/reverse?longitude=${lng}&latitude=${lat}`;
|
|
850
|
-
params['access_token'] = isPlatformBrowser(this.platformId) ? this.mapboxAccessToken : this.mapboxSSRAccessToken;
|
|
851
|
-
return this.http.get(url, { params });
|
|
852
|
-
}
|
|
853
|
-
logMapbox(callerFunction, context = 'no-context') {
|
|
854
|
-
const platform = isPlatformServer(this.platformId) ? 'server' : 'browser';
|
|
855
|
-
this.logService.logMsg(`${platform} - ${callerFunction} - ${context}`, 'MAPBOX');
|
|
856
|
-
}
|
|
857
|
-
getHeaders() {
|
|
858
|
-
return new HttpHeaders().set('Referrer-Policy', 'origin');
|
|
859
|
-
}
|
|
860
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MapBoxService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
861
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MapBoxService, providedIn: 'root' }); }
|
|
862
|
-
}
|
|
863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: MapBoxService, decorators: [{
|
|
864
|
-
type: Injectable,
|
|
865
|
-
args: [{
|
|
866
|
-
providedIn: 'root',
|
|
867
|
-
}]
|
|
868
|
-
}] });
|
|
869
|
-
|
|
870
|
-
var GeolocationPermissions;
|
|
871
|
-
(function (GeolocationPermissions) {
|
|
872
|
-
GeolocationPermissions["GRANTED"] = "granted";
|
|
873
|
-
GeolocationPermissions["PROMPT"] = "prompt";
|
|
874
|
-
GeolocationPermissions["DENIED"] = "denied";
|
|
875
|
-
})(GeolocationPermissions || (GeolocationPermissions = {}));
|
|
876
|
-
class GeolocService {
|
|
877
|
-
get switchStatus() {
|
|
878
|
-
return this._switchStatus;
|
|
879
|
-
}
|
|
880
|
-
get address() {
|
|
881
|
-
return this._address;
|
|
882
|
-
}
|
|
883
|
-
get permission() {
|
|
884
|
-
return this._permission;
|
|
885
|
-
}
|
|
886
|
-
get disableSwitch() {
|
|
887
|
-
return this._disableSwitch;
|
|
888
|
-
}
|
|
889
|
-
constructor() {
|
|
890
|
-
this.document = inject(DOCUMENT);
|
|
891
|
-
this.platformId = inject(PLATFORM_ID);
|
|
892
|
-
this.mapboxService = inject(MapBoxService);
|
|
893
|
-
this.logService = inject(LogService);
|
|
894
|
-
this._mapboxGeocodingParams = {
|
|
895
|
-
types: 'place',
|
|
896
|
-
limit: 1,
|
|
897
|
-
language: 'pt-BR',
|
|
898
|
-
country: 'BR',
|
|
899
|
-
};
|
|
900
|
-
this._hasConsent = false;
|
|
901
|
-
this._switchStatus = false;
|
|
902
|
-
this._address = null;
|
|
903
|
-
this._permission = GeolocationPermissions.PROMPT;
|
|
904
|
-
this.geolocation = new BehaviorSubject(null);
|
|
905
|
-
this.isChecked = new BehaviorSubject(false); // Emite true quando o geoloc está estável
|
|
906
|
-
this._isSafariAgent = false;
|
|
907
|
-
this._disableSwitch = false;
|
|
908
|
-
if (isPlatformServer(this.platformId)) {
|
|
909
|
-
this.isChecked.next(true);
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
this._isSafariAgent = checkSafariAgent();
|
|
913
|
-
if (this._isSafariAgent) {
|
|
914
|
-
this._hasConsent = this.checkACookieExists('geolocation_consent');
|
|
915
|
-
this.initGeolocation(this._hasConsent);
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
navigator?.permissions
|
|
919
|
-
?.query({ name: 'geolocation' })
|
|
920
|
-
.then((permission) => {
|
|
921
|
-
this._permission = permission.state;
|
|
922
|
-
this.initGeolocation(this._permission === GeolocationPermissions.GRANTED);
|
|
923
|
-
permission.onchange = () => {
|
|
924
|
-
this._permission = permission.state;
|
|
925
|
-
this.initGeolocation(this._permission === GeolocationPermissions.GRANTED);
|
|
926
|
-
};
|
|
927
|
-
})
|
|
928
|
-
.catch((error) => {
|
|
929
|
-
this.logService.logMsg(JSON.stringify(error, getCircularReplacer()), 'ERROR');
|
|
930
|
-
this._permission = GeolocationPermissions.DENIED;
|
|
931
|
-
this._disableSwitch = true;
|
|
932
|
-
this.initGeolocation(false);
|
|
933
|
-
});
|
|
934
|
-
}
|
|
935
|
-
initGeolocation(geolocAllowed = false) {
|
|
936
|
-
this._switchStatus = true;
|
|
937
|
-
if (geolocAllowed) {
|
|
938
|
-
this.getCurrentPosition().subscribe({
|
|
939
|
-
next: (position) => {
|
|
940
|
-
this._disableSwitch = false;
|
|
941
|
-
this.setGeolocation(position);
|
|
942
|
-
this.setConsentCookie(true, 3650);
|
|
943
|
-
this._hasConsent = true;
|
|
944
|
-
this._permission = GeolocationPermissions.GRANTED;
|
|
945
|
-
},
|
|
946
|
-
error: () => {
|
|
947
|
-
if (this._permission === GeolocationPermissions.DENIED) {
|
|
948
|
-
this._disableSwitch = true;
|
|
949
|
-
this.setConsentCookie(false, 15);
|
|
950
|
-
}
|
|
951
|
-
this.geolocation.next(null);
|
|
952
|
-
this._address = null;
|
|
953
|
-
this._hasConsent = false;
|
|
954
|
-
this._switchStatus = false;
|
|
955
|
-
this.isChecked.next(true);
|
|
956
|
-
},
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
else {
|
|
960
|
-
if (this.permission === GeolocationPermissions.DENIED) {
|
|
961
|
-
this._disableSwitch = true;
|
|
962
|
-
this.setConsentCookie(false, 15);
|
|
963
|
-
}
|
|
964
|
-
this.geolocation.next(null);
|
|
965
|
-
this._address = null;
|
|
966
|
-
this._hasConsent = false;
|
|
967
|
-
this._switchStatus = false;
|
|
968
|
-
this.isChecked.next(true);
|
|
969
|
-
}
|
|
970
|
-
}
|
|
971
|
-
getCurrentPosition() {
|
|
972
|
-
return new Observable((observer) => {
|
|
973
|
-
navigator.geolocation.getCurrentPosition((position) => {
|
|
974
|
-
observer.next(position);
|
|
975
|
-
observer.complete();
|
|
976
|
-
}, (error) => observer.error(error), { enableHighAccuracy: true });
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
setGeolocation(position) {
|
|
980
|
-
if (position) {
|
|
981
|
-
if (position.coords.latitude === this.geolocation.value?.lat && position.coords.longitude === this.geolocation.value?.lng)
|
|
982
|
-
return;
|
|
983
|
-
this.geolocation.next({
|
|
984
|
-
lat: position.coords.latitude,
|
|
985
|
-
lng: position.coords.longitude,
|
|
986
|
-
});
|
|
987
|
-
this.getMapboxAdress()
|
|
988
|
-
.pipe(map((response) => {
|
|
989
|
-
const city = response?.features[0]?.properties?.name;
|
|
990
|
-
const state = {
|
|
991
|
-
name: response?.features[0]?.properties?.context?.region?.name,
|
|
992
|
-
shortCode: response?.features[0]?.properties?.context?.region?.region_code,
|
|
993
|
-
};
|
|
994
|
-
return { city, state };
|
|
995
|
-
}))
|
|
996
|
-
.subscribe({
|
|
997
|
-
next: (response) => {
|
|
998
|
-
this._address = response;
|
|
999
|
-
this._switchStatus = true;
|
|
1000
|
-
this.isChecked.next(true);
|
|
1001
|
-
},
|
|
1002
|
-
error: (error) => {
|
|
1003
|
-
this.logService.logMsg(JSON.stringify(error, getCircularReplacer()), 'ERROR');
|
|
1004
|
-
this._switchStatus = false;
|
|
1005
|
-
this.geolocation.next(null);
|
|
1006
|
-
this._address = null;
|
|
1007
|
-
this.isChecked.next(true);
|
|
1008
|
-
},
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
else {
|
|
1012
|
-
this.geolocation.next(null);
|
|
1013
|
-
this._address = null;
|
|
1014
|
-
this._switchStatus = false;
|
|
1015
|
-
this.isChecked.next(true);
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
getMapboxAdress() {
|
|
1019
|
-
const lng = `${this.geolocation.value?.lng}`;
|
|
1020
|
-
const lat = `${this.geolocation.value?.lat}`;
|
|
1021
|
-
return this.mapboxService.reverseGeocoding(lng, lat, this._mapboxGeocodingParams, 'geolocalizacao.service getMapboxAdress');
|
|
1022
|
-
}
|
|
1023
|
-
checkACookieExists(name) {
|
|
1024
|
-
if (isPlatformServer(this.platformId) || typeof this.document === 'undefined' || !this.document?.cookie) {
|
|
1025
|
-
return false;
|
|
1026
|
-
}
|
|
1027
|
-
return this.document.cookie
|
|
1028
|
-
.split(';')
|
|
1029
|
-
.map((item) => item.trim())
|
|
1030
|
-
.some((item) => item.trim().startsWith(name));
|
|
1031
|
-
}
|
|
1032
|
-
setConsentCookie(status, days) {
|
|
1033
|
-
if (this.getCookieValue('geolocation_consent') !== status.toString()) {
|
|
1034
|
-
const lifetime = new Date(Date.now() + days * 86400000).toUTCString();
|
|
1035
|
-
this.document.cookie = `geolocation_consent=${status}; path=/; expires=${lifetime}; SameSite=None; Secure`;
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
getCookieValue(prop) {
|
|
1039
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
1040
|
-
const value = this.document.cookie
|
|
1041
|
-
.split(';')
|
|
1042
|
-
.map((item) => item.trim())
|
|
1043
|
-
.find((item) => item.startsWith(`${prop}=`));
|
|
1044
|
-
return value ? value.slice(prop.length + 1) : '';
|
|
1045
|
-
}
|
|
1046
|
-
return '';
|
|
1047
|
-
}
|
|
1048
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GeolocService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1049
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GeolocService, providedIn: 'root' }); }
|
|
1050
|
-
}
|
|
1051
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GeolocService, decorators: [{
|
|
1052
|
-
type: Injectable,
|
|
1053
|
-
args: [{
|
|
1054
|
-
providedIn: 'root',
|
|
1055
|
-
}]
|
|
1056
|
-
}], ctorParameters: () => [] });
|
|
1057
|
-
|
|
1058
|
-
class AbstractModalDrawerComponent {
|
|
1059
|
-
}
|
|
1060
|
-
class ModalDrawerService {
|
|
1061
|
-
constructor() {
|
|
1062
|
-
this.reference = null;
|
|
1063
|
-
this.firstInteraction = signal(false, ...(ngDevMode ? [{ debugName: "firstInteraction" }] : []));
|
|
1064
|
-
this.maxTries = 10;
|
|
1065
|
-
this.delay = 200;
|
|
1066
|
-
}
|
|
1067
|
-
open() {
|
|
1068
|
-
this.firstInteraction.set(true);
|
|
1069
|
-
executeWithRetry(() => {
|
|
1070
|
-
this.reference?.openSheet();
|
|
1071
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
1072
|
-
}
|
|
1073
|
-
setReference(element) {
|
|
1074
|
-
this.reference = element;
|
|
1075
|
-
}
|
|
1076
|
-
setContent(content) {
|
|
1077
|
-
executeWithRetry(() => {
|
|
1078
|
-
if (this.reference) {
|
|
1079
|
-
this.reference.modalContent?.set(content);
|
|
1080
|
-
}
|
|
1081
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
1082
|
-
}
|
|
1083
|
-
setStyle(style) {
|
|
1084
|
-
executeWithRetry(() => {
|
|
1085
|
-
if (this.reference) {
|
|
1086
|
-
this.reference.componentStyle.set(style);
|
|
1087
|
-
}
|
|
1088
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
1089
|
-
}
|
|
1090
|
-
setHeight(value) {
|
|
1091
|
-
executeWithRetry(() => {
|
|
1092
|
-
if (this.reference) {
|
|
1093
|
-
this.reference.maxHeight = value;
|
|
1094
|
-
}
|
|
1095
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
1096
|
-
}
|
|
1097
|
-
close() {
|
|
1098
|
-
executeWithRetry(() => {
|
|
1099
|
-
this.reference?.closeSheet();
|
|
1100
|
-
}, () => !!this.reference, this.maxTries, this.delay);
|
|
1101
|
-
}
|
|
1102
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalDrawerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1103
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalDrawerService, providedIn: 'root' }); }
|
|
1104
|
-
}
|
|
1105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ModalDrawerService, decorators: [{
|
|
1106
|
-
type: Injectable,
|
|
1107
|
-
args: [{
|
|
1108
|
-
providedIn: 'root',
|
|
1109
|
-
}]
|
|
1110
|
-
}] });
|
|
1111
|
-
|
|
1112
|
-
class PrivacyToolsService {
|
|
1113
|
-
constructor() {
|
|
1114
|
-
this.document = inject(DOCUMENT);
|
|
1115
|
-
this.platformId = inject(PLATFORM_ID);
|
|
1116
|
-
this.cookieBannerScriptId = 'PrivacyToolsScript';
|
|
1117
|
-
this.cookieBannerStyleId = 'PrivacyToolsStyle';
|
|
1118
|
-
this.cookieBannerScriptElement = null;
|
|
1119
|
-
this.configOptions = {};
|
|
1120
|
-
this.cookieConsent = null;
|
|
1121
|
-
}
|
|
1122
|
-
/* Config */
|
|
1123
|
-
config(options) {
|
|
1124
|
-
this.configOptions = options;
|
|
1125
|
-
}
|
|
1126
|
-
/* Setup cookie Banner */
|
|
1127
|
-
setupCookieBanner(unidadeBasePath) {
|
|
1128
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
1129
|
-
const banner = this.configOptions?.cookieBanners?.find((banner) => banner.basePath.includes(unidadeBasePath));
|
|
1130
|
-
if (banner) {
|
|
1131
|
-
this.addCookieBanner(banner);
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
openCookieBanner() {
|
|
1136
|
-
if (this.cookieConsent && this.cookieBannerScriptElement) {
|
|
1137
|
-
this.cookieConsent.privacyToolsShowCookieNotice();
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
/* Add cookie banner style and script */
|
|
1141
|
-
addCookieBanner(banner) {
|
|
1142
|
-
this.cookieBannerScriptElement = null;
|
|
1143
|
-
this.addCookieBannerStyle(banner.styleSrc);
|
|
1144
|
-
this.addCookieBannerScript(banner.scriptSrc);
|
|
1145
|
-
}
|
|
1146
|
-
/* Add cookie banner style. */
|
|
1147
|
-
addCookieBannerStyle(src) {
|
|
1148
|
-
if (isPlatformServer(this.platformId))
|
|
1149
|
-
return;
|
|
1150
|
-
this.document.getElementById('byRemovePortal')?.remove();
|
|
1151
|
-
const oldStyle = this.document.getElementById(this.cookieBannerStyleId);
|
|
1152
|
-
if (oldStyle) {
|
|
1153
|
-
oldStyle.remove();
|
|
1154
|
-
}
|
|
1155
|
-
const style = this.document.createElement('link');
|
|
1156
|
-
style.id = this.cookieBannerStyleId;
|
|
1157
|
-
style.rel = 'stylesheet';
|
|
1158
|
-
style.type = 'text/css';
|
|
1159
|
-
style.href = src;
|
|
1160
|
-
style.media = 'none';
|
|
1161
|
-
style.addEventListener('load', () => {
|
|
1162
|
-
style.media = 'all';
|
|
1163
|
-
});
|
|
1164
|
-
this.document.body.appendChild(style);
|
|
1165
|
-
}
|
|
1166
|
-
/* Add cookie banner script. */
|
|
1167
|
-
addCookieBannerScript(src) {
|
|
1168
|
-
if (isPlatformServer(this.platformId) || typeof window === 'undefined')
|
|
1169
|
-
return;
|
|
1170
|
-
window['cookieconsent'] = null;
|
|
1171
|
-
const oldScript = this.document.getElementById(this.cookieBannerScriptId);
|
|
1172
|
-
if (oldScript) {
|
|
1173
|
-
oldScript.remove();
|
|
1174
|
-
}
|
|
1175
|
-
const script = this.document.createElement('script');
|
|
1176
|
-
script.id = this.cookieBannerScriptId;
|
|
1177
|
-
script.src = src;
|
|
1178
|
-
script.addEventListener('load', () => {
|
|
1179
|
-
this.cookieBannerScriptElement = script;
|
|
1180
|
-
this.cookieConsent = window['cookieconsent'];
|
|
1181
|
-
window['portalBanner']?.call();
|
|
1182
|
-
});
|
|
1183
|
-
this.document.body.appendChild(script);
|
|
1184
|
-
}
|
|
1185
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PrivacyToolsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1186
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PrivacyToolsService, providedIn: 'root' }); }
|
|
1187
|
-
}
|
|
1188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: PrivacyToolsService, decorators: [{
|
|
1189
|
-
type: Injectable,
|
|
1190
|
-
args: [{
|
|
1191
|
-
providedIn: 'root',
|
|
1192
|
-
}]
|
|
1193
|
-
}] });
|
|
1194
|
-
|
|
1195
|
-
class SeoService {
|
|
1196
|
-
constructor() {
|
|
1197
|
-
this.title = inject(Title);
|
|
1198
|
-
this.meta = inject(Meta);
|
|
1199
|
-
this.location = inject(Location);
|
|
1200
|
-
this.libConfig = inject(LIB_CONFIG);
|
|
1201
|
-
this.document = inject(DOCUMENT);
|
|
1202
|
-
this.separator = ' - ';
|
|
1203
|
-
this.defaultTitle = 'Rede D’Or';
|
|
1204
|
-
this.sameAs = [
|
|
1205
|
-
'https://www.facebook.com/rededor/',
|
|
1206
|
-
'https://www.instagram.com/rededor_oficial/',
|
|
1207
|
-
'https://www.linkedin.com/company/rededor-saoluiz',
|
|
1208
|
-
'https://twitter.com/rededor',
|
|
1209
|
-
];
|
|
1210
|
-
this.twitterUser = '@rededor';
|
|
1211
|
-
this.jsonTagId = 'seoJSON';
|
|
1212
|
-
this.breadcrumbsJsonTagId = 'breadcrumbsJSON';
|
|
1213
|
-
this.unidade = null;
|
|
1214
|
-
this.unidadeName = '';
|
|
1215
|
-
this.unidadePath = '';
|
|
1216
|
-
this.unidadeSlug = '';
|
|
1217
|
-
this.customJsonType = [];
|
|
1218
|
-
}
|
|
1219
|
-
setFullSeo(data) {
|
|
1220
|
-
this.setTitle(data.title.text, !!data.title.sub);
|
|
1221
|
-
this.setDescription(data.description);
|
|
1222
|
-
this.setCanonicalHref(data.canonical);
|
|
1223
|
-
this.setPageJson();
|
|
1224
|
-
this.setSocialTags(data.socialTags);
|
|
1225
|
-
}
|
|
1226
|
-
/**
|
|
1227
|
-
* Define tag description da página
|
|
1228
|
-
* @param content conteúdo da descrição <string>
|
|
1229
|
-
*/
|
|
1230
|
-
setDescription(content) {
|
|
1231
|
-
const descTag = this.meta.getTag("name='description'");
|
|
1232
|
-
if (content) {
|
|
1233
|
-
content = he.decode(content);
|
|
1234
|
-
content = removeHtmlTags(content);
|
|
1235
|
-
}
|
|
1236
|
-
else {
|
|
1237
|
-
content = '';
|
|
1238
|
-
}
|
|
1239
|
-
this.activeDescription = content;
|
|
1240
|
-
const tagContent = { name: 'description', content };
|
|
1241
|
-
if (descTag) {
|
|
1242
|
-
this.meta.updateTag(tagContent);
|
|
1243
|
-
}
|
|
1244
|
-
else {
|
|
1245
|
-
this.meta.addTag(tagContent);
|
|
1246
|
-
}
|
|
1247
|
-
return this;
|
|
1248
|
-
}
|
|
1249
|
-
/**
|
|
1250
|
-
* Define meta tags para a página
|
|
1251
|
-
* @param tag nome da tag meta
|
|
1252
|
-
* @param content conteúdo da tag meta
|
|
1253
|
-
* @param type tipo de tag meta
|
|
1254
|
-
*/
|
|
1255
|
-
setMetaTag(tag, content, type = 'name') {
|
|
1256
|
-
const metatag = this.meta.getTag(`${type}='${tag}'`);
|
|
1257
|
-
content = he.decode(content);
|
|
1258
|
-
content = removeHtmlTags(content);
|
|
1259
|
-
const tagContent = {
|
|
1260
|
-
[type]: tag,
|
|
1261
|
-
content,
|
|
1262
|
-
};
|
|
1263
|
-
if (!metatag) {
|
|
1264
|
-
this.meta.addTag(tagContent);
|
|
1265
|
-
}
|
|
1266
|
-
else {
|
|
1267
|
-
this.meta.updateTag(tagContent);
|
|
1268
|
-
}
|
|
1269
|
-
return this;
|
|
1270
|
-
}
|
|
1271
|
-
/**
|
|
1272
|
-
* Remove meta tags da página
|
|
1273
|
-
* @param tag nome da tag meta
|
|
1274
|
-
* @param content conteúdo da tag meta
|
|
1275
|
-
* @param attr atributo da tag meta
|
|
1276
|
-
* @param type tipo de tag meta
|
|
1277
|
-
*/
|
|
1278
|
-
removeTag(tag, content, attr, type = 'name') {
|
|
1279
|
-
const metatag = this.meta.getTag(`${type}='${tag}'`);
|
|
1280
|
-
if (metatag) {
|
|
1281
|
-
this.meta.removeTag(`${attr}=${content}`);
|
|
1282
|
-
}
|
|
1283
|
-
return this;
|
|
1284
|
-
}
|
|
1285
|
-
/**
|
|
1286
|
-
* Define meta tags para Facebook
|
|
1287
|
-
* @param title título para o facebook
|
|
1288
|
-
* @param description descrição para o facebook
|
|
1289
|
-
* @param url url para definição do facebook
|
|
1290
|
-
* @param img imagem para definição no facebook
|
|
1291
|
-
*/
|
|
1292
|
-
setMetaFacebook(title, description, url, img = null) {
|
|
1293
|
-
this.setMetaTag('og:url', url, 'property');
|
|
1294
|
-
this.setMetaTag('og:title', title, 'property');
|
|
1295
|
-
this.setMetaTag('og:description', description, 'property');
|
|
1296
|
-
this.setMetaTag('og:type', 'website', 'property');
|
|
1297
|
-
this.setMetaTag('og:image', img ?? '', 'property');
|
|
1298
|
-
}
|
|
1299
|
-
/**
|
|
1300
|
-
* Define meta tags para Twitter
|
|
1301
|
-
* @param title título para o twitter
|
|
1302
|
-
* @param description descrição para o twitter
|
|
1303
|
-
* @param url url para o twitter
|
|
1304
|
-
* @param img imagem para definição no twitter
|
|
1305
|
-
*/
|
|
1306
|
-
setMetaTwitter(title, description, url, img = null) {
|
|
1307
|
-
this.setMetaTag('twitter:site', url, 'name');
|
|
1308
|
-
this.setMetaTag('twitter:title', title, 'name');
|
|
1309
|
-
this.setMetaTag('twitter:description', description, 'name');
|
|
1310
|
-
this.setMetaTag('twitter:image', img ?? '', 'name');
|
|
1311
|
-
}
|
|
1312
|
-
/**
|
|
1313
|
-
* Define tags de redes sociais (Twitter e Open Graph)
|
|
1314
|
-
* @param properties
|
|
1315
|
-
*/
|
|
1316
|
-
setSocialTags(properties) {
|
|
1317
|
-
const pagePath = this.location.path();
|
|
1318
|
-
const siteurl = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1319
|
-
let defaultProperties = {
|
|
1320
|
-
twitterCard: 'summary',
|
|
1321
|
-
twitterSite: this.twitterUser,
|
|
1322
|
-
type: 'website',
|
|
1323
|
-
title: this.getTitle(),
|
|
1324
|
-
description: this.activeDescription || '',
|
|
1325
|
-
url: `${siteurl}${pagePath}`,
|
|
1326
|
-
image: this.libConfig?.logoPath ? `${siteurl}${this.libConfig.logoPath}` : 'https://www.rededorsaoluiz.com.br/assets/imgs/logo-rededor-blue.png',
|
|
1327
|
-
};
|
|
1328
|
-
if (properties) {
|
|
1329
|
-
defaultProperties = { ...defaultProperties, ...properties };
|
|
1330
|
-
}
|
|
1331
|
-
this.setMetaTag('twitter:card', defaultProperties.twitterCard || '', 'name')
|
|
1332
|
-
.setMetaTag('twitter:site', defaultProperties.twitterSite || '', 'name')
|
|
1333
|
-
.setMetaTag('og:type', defaultProperties.type || '', 'property')
|
|
1334
|
-
.setMetaTag('og:title', defaultProperties.title || '', 'property')
|
|
1335
|
-
.setMetaTag('og:description', defaultProperties.description || '', 'property')
|
|
1336
|
-
.setMetaTag('og:url', defaultProperties.url || '', 'property')
|
|
1337
|
-
.setMetaTag('og:image', defaultProperties.image || '', 'property');
|
|
1338
|
-
return this;
|
|
1339
|
-
}
|
|
1340
|
-
/**
|
|
1341
|
-
* Define título da página
|
|
1342
|
-
* @param title título da página <string>
|
|
1343
|
-
* @param sub Se é subsite acrescenta unidade <boolean>
|
|
1344
|
-
*/
|
|
1345
|
-
setTitle(title, sub = false) {
|
|
1346
|
-
if (title && title !== '') {
|
|
1347
|
-
title = he.decode(title);
|
|
1348
|
-
title = removeHtmlTags(title);
|
|
1349
|
-
if (sub) {
|
|
1350
|
-
title = he.decode(`${title}${this.separator}${this.unidadeName}`);
|
|
1351
|
-
}
|
|
1352
|
-
this.title.setTitle(title);
|
|
1353
|
-
}
|
|
1354
|
-
return this;
|
|
1355
|
-
}
|
|
1356
|
-
/** Obtem título atual da página */
|
|
1357
|
-
getTitle() {
|
|
1358
|
-
return this.title.getTitle();
|
|
1359
|
-
}
|
|
1360
|
-
set404Title(component = 'Default Component') {
|
|
1361
|
-
if (component && component !== '') {
|
|
1362
|
-
component = he.decode(component);
|
|
1363
|
-
component = removeHtmlTags(component);
|
|
1364
|
-
if (this.unidadeName) {
|
|
1365
|
-
component = he.decode(`${component}${this.separator}${this.unidadeName}`);
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
const title = `Erro 404 - ${component} - ${this.libConfig?.siteName} - ${this.location.path()}`;
|
|
1369
|
-
this.title.setTitle(title);
|
|
1370
|
-
return this;
|
|
1371
|
-
}
|
|
1372
|
-
set500Title(component = 'Default Component') {
|
|
1373
|
-
if (component && component !== '') {
|
|
1374
|
-
component = he.decode(component);
|
|
1375
|
-
component = removeHtmlTags(component);
|
|
1376
|
-
if (this.unidadeName) {
|
|
1377
|
-
component = he.decode(`${component}${this.separator}${this.unidadeName}`);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
const title = `Erro 500 - ${component} - ${this.libConfig?.siteName} - ${this.location.path()}`;
|
|
1381
|
-
this.title.setTitle(title);
|
|
1382
|
-
return this;
|
|
1383
|
-
}
|
|
1384
|
-
/** Cria tag script para JSON de breadcrumbs */
|
|
1385
|
-
createBreadcrumbsJSONTag() {
|
|
1386
|
-
const tag = this.document.createElement('script');
|
|
1387
|
-
tag.id = this.breadcrumbsJsonTagId;
|
|
1388
|
-
tag.type = 'application/ld+json';
|
|
1389
|
-
this.document.head.appendChild(tag);
|
|
1390
|
-
this.breadcrumbsJsonTag = tag;
|
|
1391
|
-
return tag;
|
|
1392
|
-
}
|
|
1393
|
-
/** Retorna tag para script json de breadcrumbs ou cria se não houver. */
|
|
1394
|
-
getBreadcrumbsJSONTag() {
|
|
1395
|
-
const elements = this.document.head.children;
|
|
1396
|
-
let i;
|
|
1397
|
-
for (i = 0; i < elements.length; i++) {
|
|
1398
|
-
const elem = elements[i];
|
|
1399
|
-
if (elem && elem.id === this.breadcrumbsJsonTagId) {
|
|
1400
|
-
return elem;
|
|
1401
|
-
}
|
|
1402
|
-
}
|
|
1403
|
-
return this.createBreadcrumbsJSONTag();
|
|
1404
|
-
}
|
|
1405
|
-
/** Define o JSON de breadcrumbs da página */
|
|
1406
|
-
setBreadcrumbsJson(items) {
|
|
1407
|
-
this.breadcrumbsJsonTag = this.getBreadcrumbsJSONTag();
|
|
1408
|
-
const json = {
|
|
1409
|
-
'@context': 'http://schema.org',
|
|
1410
|
-
'@type': 'BreadcrumbList',
|
|
1411
|
-
itemListElement: this.getJsonBreadcrumbItems(items),
|
|
1412
|
-
};
|
|
1413
|
-
this.breadcrumbsJsonTag.innerHTML = JSON.stringify(json);
|
|
1414
|
-
return this;
|
|
1415
|
-
}
|
|
1416
|
-
/** Converte itens do breadcrumb em itens do JSON */
|
|
1417
|
-
getJsonBreadcrumbItems(items) {
|
|
1418
|
-
const jsonItems = [
|
|
1419
|
-
{
|
|
1420
|
-
'@type': 'ListItem',
|
|
1421
|
-
position: 1,
|
|
1422
|
-
item: { '@id': this.getBreadcrumbItemUrl(['/']), name: he.encode('Página Inicial') },
|
|
1423
|
-
},
|
|
1424
|
-
];
|
|
1425
|
-
items.forEach((item, i) => {
|
|
1426
|
-
const jsonItem = {
|
|
1427
|
-
'@type': 'ListItem',
|
|
1428
|
-
position: i + 2,
|
|
1429
|
-
item: { '@id': this.getBreadcrumbItemUrl(item?.url || []), name: he.encode(item.label) },
|
|
1430
|
-
};
|
|
1431
|
-
jsonItems.push(jsonItem);
|
|
1432
|
-
});
|
|
1433
|
-
return jsonItems;
|
|
1434
|
-
}
|
|
1435
|
-
/**
|
|
1436
|
-
* Monta a url do item de breadcrumb proveniente do array de urls
|
|
1437
|
-
* ou do caminho da própria página, conforme caso do último item.
|
|
1438
|
-
*/
|
|
1439
|
-
getBreadcrumbItemUrl(url) {
|
|
1440
|
-
const siteurl = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1441
|
-
if (!url || url.length <= 0) {
|
|
1442
|
-
const pagePath = this.location.path();
|
|
1443
|
-
return `${siteurl}${pagePath}`;
|
|
1444
|
-
}
|
|
1445
|
-
url = url.filter((u) => u !== this.unidadePath);
|
|
1446
|
-
const unidadePath = this.getUnidadePath();
|
|
1447
|
-
const fullPath = `${unidadePath}/${url.join('/').replace(/^\/?/, '')}`;
|
|
1448
|
-
return `${siteurl}${fullPath}`.replace(/\/$/, '');
|
|
1449
|
-
}
|
|
1450
|
-
/** Cria tag script para o JSON de SEO */
|
|
1451
|
-
createJSONTag() {
|
|
1452
|
-
const tag = this.document.createElement('script');
|
|
1453
|
-
tag.id = this.jsonTagId;
|
|
1454
|
-
tag.type = 'application/ld+json';
|
|
1455
|
-
this.document.head.appendChild(tag);
|
|
1456
|
-
this.jsonTag = tag;
|
|
1457
|
-
return tag;
|
|
1458
|
-
}
|
|
1459
|
-
/** Retorna tag para script json de breadcrumbs ou cria se não houver. */
|
|
1460
|
-
getJSONTag() {
|
|
1461
|
-
const elements = this.document.head.children;
|
|
1462
|
-
let i;
|
|
1463
|
-
for (i = 0; i < elements.length; i++) {
|
|
1464
|
-
const elem = elements[i];
|
|
1465
|
-
if (elem && elem.id === this.jsonTagId) {
|
|
1466
|
-
return elem;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
return this.createJSONTag();
|
|
1470
|
-
}
|
|
1471
|
-
/** Define JSON para SEO somente quando no servidor */
|
|
1472
|
-
setPageJson() {
|
|
1473
|
-
this.jsonTag = this.getJSONTag();
|
|
1474
|
-
const baseGraph = [this.getOrgJson(), this.getWebsiteJson(), this.getWebpageJson()];
|
|
1475
|
-
const extendedGraph = this.customJsonType.length ? [...baseGraph, ...this.customJsonType] : baseGraph;
|
|
1476
|
-
this.customJsonType = [];
|
|
1477
|
-
const json = {
|
|
1478
|
-
'@context': 'http://schema.org',
|
|
1479
|
-
'@graph': extendedGraph,
|
|
1480
|
-
};
|
|
1481
|
-
this.jsonTag.innerHTML = JSON.stringify(json);
|
|
1482
|
-
return this;
|
|
1483
|
-
}
|
|
1484
|
-
/** Obtem JSON da Organização */
|
|
1485
|
-
getOrgJson() {
|
|
1486
|
-
const siteurl = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1487
|
-
return {
|
|
1488
|
-
'@type': 'Organization',
|
|
1489
|
-
'@id': `${siteurl}#organization`,
|
|
1490
|
-
name: this.defaultTitle,
|
|
1491
|
-
keywords: this.libConfig?.keywords,
|
|
1492
|
-
url: `${siteurl}`,
|
|
1493
|
-
sameAs: this.sameAs,
|
|
1494
|
-
};
|
|
1495
|
-
}
|
|
1496
|
-
/** Obtem JSON do Website (portal, unidades, etc) */
|
|
1497
|
-
getWebsiteJson() {
|
|
1498
|
-
const unidadePath = this.getUnidadePath();
|
|
1499
|
-
const siteurl = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1500
|
-
return {
|
|
1501
|
-
'@type': 'WebSite',
|
|
1502
|
-
'@id': `${siteurl}${unidadePath}#website`,
|
|
1503
|
-
url: `${siteurl}${unidadePath}`,
|
|
1504
|
-
name: this.unidadeName,
|
|
1505
|
-
keywords: this.libConfig?.keywords,
|
|
1506
|
-
};
|
|
1507
|
-
}
|
|
1508
|
-
/** Obtem Json da página */
|
|
1509
|
-
getWebpageJson() {
|
|
1510
|
-
const unidadePath = this.getUnidadePath();
|
|
1511
|
-
const siteURL = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1512
|
-
const pagePath = `${siteURL}${this.location.path()}`;
|
|
1513
|
-
const desc = this.activeDescription ? this.activeDescription : '';
|
|
1514
|
-
return {
|
|
1515
|
-
'@type': 'WebPage',
|
|
1516
|
-
'@id': `${pagePath}#webpage`,
|
|
1517
|
-
url: pagePath,
|
|
1518
|
-
inLanguage: 'pt-BR',
|
|
1519
|
-
name: this.getTitle(),
|
|
1520
|
-
isPartOf: { '@id': `${siteURL}${unidadePath}#website` },
|
|
1521
|
-
about: { '@id': `${siteURL}#organization` },
|
|
1522
|
-
description: desc,
|
|
1523
|
-
};
|
|
1524
|
-
}
|
|
1525
|
-
getUnidadePath() {
|
|
1526
|
-
let unidadePath = '';
|
|
1527
|
-
if (this.unidade && this.unidadePath) {
|
|
1528
|
-
unidadePath = this.unidade?.path === '/' ? '' : this.unidadePath?.substring(0, this.unidadePath?.length - 1);
|
|
1529
|
-
}
|
|
1530
|
-
return unidadePath;
|
|
1531
|
-
}
|
|
1532
|
-
/**
|
|
1533
|
-
* Obtém a URL canônica da página.
|
|
1534
|
-
* @returns A URL canônica da página.
|
|
1535
|
-
*/
|
|
1536
|
-
getCanonicalHref() {
|
|
1537
|
-
if (!this.canonicalTag) {
|
|
1538
|
-
this.canonicalTag = this.getCanonicalTag();
|
|
1539
|
-
}
|
|
1540
|
-
return this.canonicalTag.href;
|
|
1541
|
-
}
|
|
1542
|
-
/** Cria tag para links canonicals no head */
|
|
1543
|
-
createCanonicalTag() {
|
|
1544
|
-
const tag = this.document.createElement('link');
|
|
1545
|
-
tag.setAttribute('rel', 'canonical');
|
|
1546
|
-
this.document.head.appendChild(tag);
|
|
1547
|
-
tag.setAttribute('href', this.document.URL);
|
|
1548
|
-
this.canonicalTag = tag;
|
|
1549
|
-
return tag;
|
|
1550
|
-
}
|
|
1551
|
-
/** Retorna tag para link canonical existe ou cria se não houver. */
|
|
1552
|
-
getCanonicalTag() {
|
|
1553
|
-
const elements = this.document.head.children;
|
|
1554
|
-
let i;
|
|
1555
|
-
for (i = 0; i < elements.length; i++) {
|
|
1556
|
-
const elem = elements[i];
|
|
1557
|
-
if (elem && elem.tagName === 'LINK' && elem.rel === 'canonical') {
|
|
1558
|
-
return elem;
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
return this.createCanonicalTag();
|
|
1562
|
-
}
|
|
1563
|
-
/**
|
|
1564
|
-
* Define link canonical da página
|
|
1565
|
-
* @param url url canonical
|
|
1566
|
-
*/
|
|
1567
|
-
setCanonicalHref(url) {
|
|
1568
|
-
if (!this.canonicalTag) {
|
|
1569
|
-
this.canonicalTag = this.getCanonicalTag();
|
|
1570
|
-
}
|
|
1571
|
-
let path = this.document.location.pathname;
|
|
1572
|
-
if (this.libConfig?.siteSufix && path.includes(this.libConfig?.siteSufix)) {
|
|
1573
|
-
path = path.replace(this.libConfig?.siteSufix, '');
|
|
1574
|
-
}
|
|
1575
|
-
if (!path.startsWith('/')) {
|
|
1576
|
-
path = `/${path}`;
|
|
1577
|
-
}
|
|
1578
|
-
const canonicalUrl = url && this.isCustomCanonical(url) ? url : `${getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix)}${path}`;
|
|
1579
|
-
this.canonicalTag.setAttribute('href', canonicalUrl);
|
|
1580
|
-
return this;
|
|
1581
|
-
}
|
|
1582
|
-
/**
|
|
1583
|
-
* Verifica se a URL fornecida é um link canonical personalizado
|
|
1584
|
-
* @param url URL fornecida
|
|
1585
|
-
*/
|
|
1586
|
-
isCustomCanonical(url) {
|
|
1587
|
-
const siteurl = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1588
|
-
return url.startsWith(siteurl);
|
|
1589
|
-
}
|
|
1590
|
-
/**
|
|
1591
|
-
* Obtém uma url válida na aplicação proveniente de uma URL gerada
|
|
1592
|
-
* pelo plugin Yoast para canonical automático.
|
|
1593
|
-
* Ex.: https://wp.rededorsaoluiz.com.br/brasil/especialidades/cardiologia/
|
|
1594
|
-
* @param urlFromWpApi URL canonica gerada pelo Yoast Plugin.
|
|
1595
|
-
*/
|
|
1596
|
-
toLocalCanonical(urlFromWpApi) {
|
|
1597
|
-
const apiUrl = this.libConfig?.wpUrl ?? '';
|
|
1598
|
-
const siteurl = getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix);
|
|
1599
|
-
const unidadeSlug = this.unidadeSlug;
|
|
1600
|
-
let converted = urlFromWpApi.replace(apiUrl, siteurl);
|
|
1601
|
-
if (unidadeSlug !== '/' && converted.includes(`/${unidadeSlug}/`)) {
|
|
1602
|
-
converted = converted.replace(`/${unidadeSlug}/`, `${this.unidadePath}`);
|
|
1603
|
-
}
|
|
1604
|
-
return converted;
|
|
1605
|
-
}
|
|
1606
|
-
getPostContent(post) {
|
|
1607
|
-
const content = post?.acf?.['rdsl_post_content'] ? post?.acf?.rdsl_post_content?.find((content) => content.acf_fc_layout === 'text_html') : null;
|
|
1608
|
-
return content?.content || post.content.rendered || '';
|
|
1609
|
-
}
|
|
1610
|
-
addArticleScript(post, scriptName) {
|
|
1611
|
-
const postContent = this.getPostContent(post);
|
|
1612
|
-
const postHeaderImage = post?.acf?.['rdsl_post_header_img']
|
|
1613
|
-
? {
|
|
1614
|
-
url: post?.acf?.['rdsl_post_header_img'].url,
|
|
1615
|
-
width: post?.acf?.['rdsl_post_header_img'].width,
|
|
1616
|
-
height: post?.acf?.['rdsl_post_header_img'].height,
|
|
1617
|
-
}
|
|
1618
|
-
: null;
|
|
1619
|
-
const structuredData = {
|
|
1620
|
-
'@context': 'https://schema.org',
|
|
1621
|
-
'@type': 'Article',
|
|
1622
|
-
mainEntityOfPage: `${getSiteUrl(this.libConfig?.siteUrl, this.libConfig?.siteSufix)}${this.location.path()}`,
|
|
1623
|
-
headline: post.title?.rendered,
|
|
1624
|
-
datePublished: post.date_gmt,
|
|
1625
|
-
publisher: {
|
|
1626
|
-
'@type': 'Organization',
|
|
1627
|
-
name: 'Rede D’Or',
|
|
1628
|
-
},
|
|
1629
|
-
description: post.title?.rendered,
|
|
1630
|
-
articleBody: removeHtmlTags(he.decode(postContent)),
|
|
1631
|
-
dateModified: post.modified_gmt,
|
|
1632
|
-
image: {
|
|
1633
|
-
'@type': 'ImageObject',
|
|
1634
|
-
url: postHeaderImage?.url || post.featured_media_path || '',
|
|
1635
|
-
height: postHeaderImage?.height || '',
|
|
1636
|
-
width: postHeaderImage?.width || '',
|
|
1637
|
-
},
|
|
1638
|
-
author: {
|
|
1639
|
-
'@type': 'Organization',
|
|
1640
|
-
name: 'Rede D’Or',
|
|
1641
|
-
},
|
|
1642
|
-
wordcount: postContent.split(' ').length,
|
|
1643
|
-
};
|
|
1644
|
-
const script = this.document.createElement('script');
|
|
1645
|
-
script.type = 'application/ld+json';
|
|
1646
|
-
script.id = scriptName;
|
|
1647
|
-
script.innerHTML = JSON.stringify(structuredData);
|
|
1648
|
-
this.document.head.appendChild(script);
|
|
1649
|
-
}
|
|
1650
|
-
removeArticleScript(scriptName) {
|
|
1651
|
-
const script = this.document.getElementById(scriptName);
|
|
1652
|
-
script?.remove();
|
|
1653
|
-
}
|
|
1654
|
-
setUnidade({ unidade = null, unidadeName = '', unidadePath = '', unidadeSlug = '' }) {
|
|
1655
|
-
this.unidade = unidade;
|
|
1656
|
-
this.unidadeName = unidadeName;
|
|
1657
|
-
this.unidadePath = unidadePath;
|
|
1658
|
-
this.unidadeSlug = unidadeSlug;
|
|
1659
|
-
}
|
|
1660
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SeoService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1661
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SeoService, providedIn: 'root' }); }
|
|
1662
|
-
}
|
|
1663
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SeoService, decorators: [{
|
|
1664
|
-
type: Injectable,
|
|
1665
|
-
args: [{
|
|
1666
|
-
providedIn: 'root',
|
|
1667
|
-
}]
|
|
1668
|
-
}] });
|
|
1669
|
-
|
|
1670
|
-
class ServerResponseService {
|
|
1671
|
-
constructor() {
|
|
1672
|
-
this.response = inject(RESPONSE, { optional: true });
|
|
1673
|
-
}
|
|
1674
|
-
getHeader(key) {
|
|
1675
|
-
if (this.response) {
|
|
1676
|
-
return this.response.getHeader(key);
|
|
1677
|
-
}
|
|
1678
|
-
return '';
|
|
1679
|
-
}
|
|
1680
|
-
setHeader(key, value) {
|
|
1681
|
-
if (this.response) {
|
|
1682
|
-
this.response.header(key, value);
|
|
1683
|
-
}
|
|
1684
|
-
return this;
|
|
1685
|
-
}
|
|
1686
|
-
appendHeader(key, value, delimiter = ',') {
|
|
1687
|
-
if (this.response) {
|
|
1688
|
-
const current = this.getHeader(key);
|
|
1689
|
-
if (!current) {
|
|
1690
|
-
return this.setHeader(key, value);
|
|
1691
|
-
}
|
|
1692
|
-
const newValue = [...current.split(delimiter), value].filter((el, i, a) => i === a.indexOf(el)).join(delimiter);
|
|
1693
|
-
this.response.header(key, newValue);
|
|
1694
|
-
}
|
|
1695
|
-
return this;
|
|
1696
|
-
}
|
|
1697
|
-
setHeaders(dictionary) {
|
|
1698
|
-
if (this.response) {
|
|
1699
|
-
Object.keys(dictionary).forEach((key) => this.setHeader(key, dictionary[key]));
|
|
1700
|
-
}
|
|
1701
|
-
return this;
|
|
1702
|
-
}
|
|
1703
|
-
setStatus(code, message) {
|
|
1704
|
-
if (this.response) {
|
|
1705
|
-
this.response.statusCode = code;
|
|
1706
|
-
if (message) {
|
|
1707
|
-
this.response.statusMessage = message;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
return this;
|
|
1711
|
-
}
|
|
1712
|
-
setNotFound(message = 'Não encontrado') {
|
|
1713
|
-
if (this.response) {
|
|
1714
|
-
this.response.statusCode = 404;
|
|
1715
|
-
this.response.statusMessage = message;
|
|
1716
|
-
}
|
|
1717
|
-
return this;
|
|
1718
|
-
}
|
|
1719
|
-
setUnauthorized(message = 'Não autorizado') {
|
|
1720
|
-
if (this.response) {
|
|
1721
|
-
this.response.statusCode = 401;
|
|
1722
|
-
this.response.statusMessage = message;
|
|
1723
|
-
}
|
|
1724
|
-
return this;
|
|
1725
|
-
}
|
|
1726
|
-
setError(message = 'Erro interno de servidor') {
|
|
1727
|
-
if (this.response) {
|
|
1728
|
-
this.response.statusCode = 500;
|
|
1729
|
-
this.response.statusMessage = message;
|
|
1730
|
-
}
|
|
1731
|
-
return this;
|
|
1732
|
-
}
|
|
1733
|
-
setRedirect({ statusCode, message, url } = {
|
|
1734
|
-
statusCode: 301,
|
|
1735
|
-
message: 'Redirecionado permanentemente',
|
|
1736
|
-
url: undefined,
|
|
1737
|
-
}) {
|
|
1738
|
-
if (this.response) {
|
|
1739
|
-
this.response.statusCode = statusCode || 301;
|
|
1740
|
-
this.response.statusMessage = message || 'Redirecionado permanentemente';
|
|
1741
|
-
if (url) {
|
|
1742
|
-
this.response.locals['redirectUrl'] = url; // Utilizado no ssr para redirect
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
return this;
|
|
1746
|
-
}
|
|
1747
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ServerResponseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1748
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ServerResponseService, providedIn: 'root' }); }
|
|
1749
|
-
}
|
|
1750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: ServerResponseService, decorators: [{
|
|
1751
|
-
type: Injectable,
|
|
1752
|
-
args: [{
|
|
1753
|
-
providedIn: 'root',
|
|
1754
|
-
}]
|
|
1755
|
-
}] });
|
|
1756
|
-
|
|
1757
|
-
class SsrResponseService {
|
|
1758
|
-
constructor() {
|
|
1759
|
-
this.responseInit = inject(RESPONSE_INIT, { optional: true });
|
|
1760
|
-
}
|
|
1761
|
-
setStatus(code, message) {
|
|
1762
|
-
if (this.responseInit) {
|
|
1763
|
-
this.responseInit.status = code;
|
|
1764
|
-
if (message !== undefined) {
|
|
1765
|
-
this.responseInit.statusText = message;
|
|
1766
|
-
}
|
|
1767
|
-
}
|
|
1768
|
-
return this;
|
|
1769
|
-
}
|
|
1770
|
-
setNotFound(message = 'Não encontrado') {
|
|
1771
|
-
if (this.responseInit) {
|
|
1772
|
-
this.responseInit.status = 404;
|
|
1773
|
-
this.responseInit.statusText = message;
|
|
1774
|
-
}
|
|
1775
|
-
return this;
|
|
1776
|
-
}
|
|
1777
|
-
setError(message = 'Erro interno de servidor') {
|
|
1778
|
-
if (this.responseInit) {
|
|
1779
|
-
this.responseInit.status = 500;
|
|
1780
|
-
this.responseInit.statusText = message;
|
|
1781
|
-
}
|
|
1782
|
-
return this;
|
|
1783
|
-
}
|
|
1784
|
-
setRedirect(params = {
|
|
1785
|
-
statusCode: 301,
|
|
1786
|
-
url: undefined,
|
|
1787
|
-
}) {
|
|
1788
|
-
if (this.responseInit && params.url) {
|
|
1789
|
-
this.responseInit.status = params.statusCode ?? 301;
|
|
1790
|
-
this.responseInit.statusText = params.statusCode === 302 ? 'Found' : 'Moved Permanently';
|
|
1791
|
-
const existingHeaders = this.responseInit.headers ? new Headers(this.responseInit.headers) : new Headers();
|
|
1792
|
-
existingHeaders.set('Location', params.url);
|
|
1793
|
-
this.responseInit.headers = existingHeaders;
|
|
1794
|
-
}
|
|
1795
|
-
return this;
|
|
1796
|
-
}
|
|
1797
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SsrResponseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1798
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SsrResponseService, providedIn: 'root' }); }
|
|
1799
|
-
}
|
|
1800
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SsrResponseService, decorators: [{
|
|
1801
|
-
type: Injectable,
|
|
1802
|
-
args: [{
|
|
1803
|
-
providedIn: 'root',
|
|
1804
|
-
}]
|
|
1805
|
-
}] });
|
|
1806
|
-
|
|
1807
|
-
/**
|
|
1808
|
-
* Generated bundle index. Do not edit.
|
|
1809
|
-
*/
|
|
1810
|
-
|
|
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 };
|
|
1812
|
-
//# sourceMappingURL=rededor-site-front-end-lib-core.mjs.map
|