@isaiahiroko/tilmart-ngx-apps-buyer 0.2.0 → 0.2.2

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.
Files changed (26) hide show
  1. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-brand.module-CgHrtffy.mjs → isaiahiroko-tilmart-ngx-apps-buyer-brand.module-Br5yv3a2.mjs} +2 -2
  2. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-brand.module-CgHrtffy.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-brand.module-Br5yv3a2.mjs.map} +1 -1
  3. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-category.module-rO8B-yQ-.mjs → isaiahiroko-tilmart-ngx-apps-buyer-category.module-BfQVeg9X.mjs} +2 -2
  4. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-category.module-rO8B-yQ-.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-category.module-BfQVeg9X.mjs.map} +1 -1
  5. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-compare.module-B1hRah67.mjs → isaiahiroko-tilmart-ngx-apps-buyer-compare.module-C_YmeVgq.mjs} +2 -2
  6. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-compare.module-B1hRah67.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-compare.module-C_YmeVgq.mjs.map} +1 -1
  7. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-home.module-B4iLd9-f.mjs → isaiahiroko-tilmart-ngx-apps-buyer-home.module-Ce2bHkCT.mjs} +3 -3
  8. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-home.module-B4iLd9-f.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-home.module-Ce2bHkCT.mjs.map} +1 -1
  9. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-index-C-Wy1WQB.mjs → isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs} +2 -2
  10. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-index-C-Wy1WQB.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs.map} +1 -1
  11. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-kits.module-DEyCahqn.mjs → isaiahiroko-tilmart-ngx-apps-buyer-kits.module-BjHZeUdK.mjs} +2 -2
  12. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-kits.module-DEyCahqn.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-kits.module-BjHZeUdK.mjs.map} +1 -1
  13. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-learn.module-Dx2Ls_ie.mjs → isaiahiroko-tilmart-ngx-apps-buyer-learn.module-BogfPwVF.mjs} +2 -2
  14. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-learn.module-Dx2Ls_ie.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-learn.module-BogfPwVF.mjs.map} +1 -1
  15. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs +23 -0
  16. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs.map +1 -0
  17. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-product.module-Y5dhSf1T.mjs → isaiahiroko-tilmart-ngx-apps-buyer-product.module-3yM9Eiwy.mjs} +2 -2
  18. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-product.module-Y5dhSf1T.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-product.module-3yM9Eiwy.mjs.map} +1 -1
  19. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-DK7QQcu1.mjs → isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-B7sMTOJf.mjs} +2 -2
  20. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-DK7QQcu1.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-B7sMTOJf.mjs.map} +1 -1
  21. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search.module-wrKCi7aQ.mjs → isaiahiroko-tilmart-ngx-apps-buyer-search.module-cb-hifei.mjs} +2 -2
  22. package/fesm2022/{isaiahiroko-tilmart-ngx-apps-buyer-search.module-wrKCi7aQ.mjs.map → isaiahiroko-tilmart-ngx-apps-buyer-search.module-cb-hifei.mjs.map} +1 -1
  23. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer.mjs +16 -16
  24. package/package.json +1 -1
  25. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-DIgo1ZHk.mjs +0 -20
  26. package/fesm2022/isaiahiroko-tilmart-ngx-apps-buyer-media-DIgo1ZHk.mjs.map +0 -1
@@ -7,7 +7,7 @@ import * as i2 from '@thescaffold/ngx-ui';
7
7
  import { ElementsModule } from '@thescaffold/ngx-ui';
8
8
  import * as i3 from '@isaiahiroko/tilmart-ngx-ui';
9
9
  import { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';
10
- import { S as SearchResultsComponent, a as SearchResultsModule } from './isaiahiroko-tilmart-ngx-apps-buyer-index-C-Wy1WQB.mjs';
10
+ import { S as SearchResultsComponent, a as SearchResultsModule } from './isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs';
11
11
  import { takeUntil } from 'rxjs';
12
12
  import { S as SeoService } from './isaiahiroko-tilmart-ngx-apps-buyer-seo.service-BAXpRG4P.mjs';
13
13
  import { a as findBrandBySlug } from './isaiahiroko-tilmart-ngx-apps-buyer-taxonomy-DdxSUDs5.mjs';
@@ -99,4 +99,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
99
99
  }] });
100
100
 
101
101
  export { BrandModule };
102
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-brand.module-CgHrtffy.mjs.map
102
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-brand.module-Br5yv3a2.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-brand.module-CgHrtffy.mjs","sources":["../../../projects/buyer/src/lib/pages/brand/brand.component.ts","../../../projects/buyer/src/lib/pages/brand/brand.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { SeoService } from '../../services/seo.service';\nimport { BrandRow, findBrandBySlug } from '../../data/taxonomy';\n\n// CAT-07 — `/b/:slug` (TRD §5.3). `showFacets=false`: `SearchWorkflow`\n// only computes facets for a category-scoped search (P2.1/P2.2 scope\n// note — an unscoped cross-category facet set isn't a real R1 need), so\n// a brand page asking for facets would always render an empty rail.\n@Component({\n standalone: false,\n selector: 'x-brand',\n template: `\n @if (brand) {\n <x-tilmart-section-header [title]=\"brand.name\"></x-tilmart-section-header>\n @if (brand.description) {\n <p class=\"x-brand-desc\">{{ brand.description }}</p>\n }\n <x-search-results [brandId]=\"brand.id\" [showFacets]=\"false\"></x-search-results>\n } @else if (notFound) {\n <div class=\"x-brand-not-found\">Brand not found.</div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n `,\n styles: [\n `\n .x-brand-desc {\n color: var(--color-text-muted);\n font-size: 13.5px;\n margin: -8px 0 16px;\n max-width: 720px;\n }\n .x-brand-not-found {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n }\n `,\n ],\n})\nexport class BrandComponent extends BaseDirective {\n private readonly route = inject(ActivatedRoute);\n private readonly seo = inject(SeoService);\n\n brand?: BrandRow;\n notFound = false;\n\n override init = () => {\n this.route.paramMap.pipe(takeUntil(this.$)).subscribe((params) => {\n const slug = params.get('slug');\n if (!slug) return;\n this.brand = undefined;\n this.notFound = false;\n findBrandBySlug(this.apiService, slug)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((brand) => {\n this.brand = brand;\n this.notFound = !brand;\n if (brand) void this.seo.apply({ entityType: 'brand', entityId: brand.id });\n }),\n );\n });\n };\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { SearchResultsModule } from '../_shared/search-results';\nimport { BrandComponent } from './brand.component';\n\n@NgModule({\n declarations: [BrandComponent],\n imports: [\n SharedModule,\n ElementsModule,\n TilmartElementsModule,\n SearchResultsModule,\n RouterModule.forChild([{ path: '', component: BrandComponent }]),\n ],\n})\nexport class BrandModule {}\n"],"names":["i1","i2","i3.SearchResultsComponent"],"mappings":";;;;;;;;;;;;;;AAOA;AACA;AACA;AACA;AAiCM,MAAO,cAAe,SAAQ,aAAa,CAAA;AAhCjD,IAAA,WAAA,GAAA;;AAiCmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC;QAGzC,IAAA,CAAA,QAAQ,GAAG,KAAK;QAEP,IAAA,CAAA,IAAI,GAAG,MAAK;YACnB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,KAAI;gBAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;AAC/B,gBAAA,IAAI,CAAC,IAAI;oBAAE;AACX,gBAAA,IAAI,CAAC,KAAK,GAAG,SAAS;AACtB,gBAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;AACrB,gBAAA,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI;AAClC,qBAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACtB,qBAAA,SAAS,CACR,KAA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AC,CAAC;AACjE,qBAAA;AACF,iBAAA;;;;;"}
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-brand.module-Br5yv3a2.mjs","sources":["../../../projects/buyer/src/lib/pages/brand/brand.component.ts","../../../projects/buyer/src/lib/pages/brand/brand.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { SeoService } from '../../services/seo.service';\nimport { BrandRow, findBrandBySlug } from '../../data/taxonomy';\n\n// CAT-07 — `/b/:slug` (TRD §5.3). `showFacets=false`: `SearchWorkflow`\n// only computes facets for a category-scoped search (P2.1/P2.2 scope\n// note — an unscoped cross-category facet set isn't a real R1 need), so\n// a brand page asking for facets would always render an empty rail.\n@Component({\n standalone: false,\n selector: 'x-brand',\n template: `\n @if (brand) {\n <x-tilmart-section-header [title]=\"brand.name\"></x-tilmart-section-header>\n @if (brand.description) {\n <p class=\"x-brand-desc\">{{ brand.description }}</p>\n }\n <x-search-results [brandId]=\"brand.id\" [showFacets]=\"false\"></x-search-results>\n } @else if (notFound) {\n <div class=\"x-brand-not-found\">Brand not found.</div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n `,\n styles: [\n `\n .x-brand-desc {\n color: var(--color-text-muted);\n font-size: 13.5px;\n margin: -8px 0 16px;\n max-width: 720px;\n }\n .x-brand-not-found {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n }\n `,\n ],\n})\nexport class BrandComponent extends BaseDirective {\n private readonly route = inject(ActivatedRoute);\n private readonly seo = inject(SeoService);\n\n brand?: BrandRow;\n notFound = false;\n\n override init = () => {\n this.route.paramMap.pipe(takeUntil(this.$)).subscribe((params) => {\n const slug = params.get('slug');\n if (!slug) return;\n this.brand = undefined;\n this.notFound = false;\n findBrandBySlug(this.apiService, slug)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((brand) => {\n this.brand = brand;\n this.notFound = !brand;\n if (brand) void this.seo.apply({ entityType: 'brand', entityId: brand.id });\n }),\n );\n });\n };\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { SearchResultsModule } from '../_shared/search-results';\nimport { BrandComponent } from './brand.component';\n\n@NgModule({\n declarations: [BrandComponent],\n imports: [\n SharedModule,\n ElementsModule,\n TilmartElementsModule,\n SearchResultsModule,\n RouterModule.forChild([{ path: '', component: BrandComponent }]),\n ],\n})\nexport class BrandModule {}\n"],"names":["i1","i2","i3.SearchResultsComponent"],"mappings":";;;;;;;;;;;;;;AAOA;AACA;AACA;AACA;AAiCM,MAAO,cAAe,SAAQ,aAAa,CAAA;AAhCjD,IAAA,WAAA,GAAA;;AAiCmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC;QAGzC,IAAA,CAAA,QAAQ,GAAG,KAAK;QAEP,IAAA,CAAA,IAAI,GAAG,MAAK;YACnB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,KAAI;gBAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;AAC/B,gBAAA,IAAI,CAAC,IAAI;oBAAE;AACX,gBAAA,IAAI,CAAC,KAAK,GAAG,SAAS;AACtB,gBAAA,IAAI,CAAC,QAAQ,GAAG,KAAK;AACrB,gBAAA,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI;AAClC,qBAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACtB,qBAAA,SAAS,CACR,K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CAAC,CAAC;AACjE,qBAAA;AACF,iBAAA;;;;;"}
@@ -7,7 +7,7 @@ import * as i2 from '@thescaffold/ngx-ui';
7
7
  import { ElementsModule } from '@thescaffold/ngx-ui';
8
8
  import * as i3 from '@isaiahiroko/tilmart-ngx-ui';
9
9
  import { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';
10
- import { S as SearchResultsComponent, a as SearchResultsModule } from './isaiahiroko-tilmart-ngx-apps-buyer-index-C-Wy1WQB.mjs';
10
+ import { S as SearchResultsComponent, a as SearchResultsModule } from './isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs';
11
11
  import { takeUntil } from 'rxjs';
12
12
  import { S as SeoService } from './isaiahiroko-tilmart-ngx-apps-buyer-seo.service-BAXpRG4P.mjs';
13
13
  import { f as findCategoryBySlug } from './isaiahiroko-tilmart-ngx-apps-buyer-taxonomy-DdxSUDs5.mjs';
@@ -99,4 +99,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
99
99
  }] });
100
100
 
101
101
  export { CategoryModule };
102
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-category.module-rO8B-yQ-.mjs.map
102
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-category.module-BfQVeg9X.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-category.module-rO8B-yQ-.mjs","sources":["../../../projects/buyer/src/lib/pages/category/category.component.ts","../../../projects/buyer/src/lib/pages/category/category.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { SeoService } from '../../services/seo.service';\nimport { CategoryRow, findCategoryBySlug } from '../../data/taxonomy';\n\n// DIS-01/DIS-02 — `/c/:slug` (TRD §5.3). The category-resolution +\n// heading is the only thing specific to this page; the actual listing +\n// facets is `x-search-results` (shared with `search`/`brand`, P2.7).\n@Component({\n standalone: false,\n selector: 'x-category',\n template: `\n @if (category) {\n <x-tilmart-section-header [title]=\"category.name\"></x-tilmart-section-header>\n @if (category.description) {\n <p class=\"x-category-desc\">{{ category.description }}</p>\n }\n <x-search-results [categoryId]=\"category.id\"></x-search-results>\n } @else if (notFound) {\n <div class=\"x-category-not-found\">Category not found.</div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n `,\n styles: [\n `\n .x-category-desc {\n color: var(--color-text-muted);\n font-size: 13.5px;\n margin: -8px 0 16px;\n max-width: 720px;\n }\n .x-category-not-found {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n }\n `,\n ],\n})\nexport class CategoryComponent extends BaseDirective {\n private readonly route = inject(ActivatedRoute);\n private readonly seo = inject(SeoService);\n\n category?: CategoryRow;\n notFound = false;\n\n override init = () => {\n this.route.paramMap.pipe(takeUntil(this.$)).subscribe((params) => {\n const slug = params.get('slug');\n if (!slug) return;\n this.category = undefined;\n this.notFound = false;\n findCategoryBySlug(this.apiService, slug)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((category) => {\n this.category = category;\n this.notFound = !category;\n if (category) {\n void this.seo.apply({ entityType: 'category', entityId: category.id });\n }\n }),\n );\n });\n };\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { SearchResultsModule } from '../_shared/search-results';\nimport { CategoryComponent } from './category.component';\n\n@NgModule({\n declarations: [CategoryComponent],\n imports: [\n SharedModule,\n ElementsModule,\n TilmartElementsModule,\n SearchResultsModule,\n RouterModule.forChild([{ path: '', component: CategoryComponent }]),\n ],\n})\nexport class CategoryModule {}\n"],"names":["i1","i2","i3.SearchResultsComponent"],"mappings":";;;;;;;;;;;;;;AAOA;AACA;AACA;AAiCM,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CAE9B,YAAY;YACZ,cAAc;YACd,qBAAqB;YACrB,mBAAmB,EAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAPvB,YAAY;YACZ,cAAc;YACd,qBAAqB;YACrB,mBAAmB;AACnB,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG1D,cAAc,EAAA,UAAA,EAAA,CAAA;kBAV1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,qBAAqB;wBACrB,mBAAmB;AACnB,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpE,qBAAA;AACF,iBAAA;;;;;"}
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-category.module-BfQVeg9X.mjs","sources":["../../../projects/buyer/src/lib/pages/category/category.component.ts","../../../projects/buyer/src/lib/pages/category/category.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { SeoService } from '../../services/seo.service';\nimport { CategoryRow, findCategoryBySlug } from '../../data/taxonomy';\n\n// DIS-01/DIS-02 — `/c/:slug` (TRD §5.3). The category-resolution +\n// heading is the only thing specific to this page; the actual listing +\n// facets is `x-search-results` (shared with `search`/`brand`, P2.7).\n@Component({\n standalone: false,\n selector: 'x-category',\n template: `\n @if (category) {\n <x-tilmart-section-header [title]=\"category.name\"></x-tilmart-section-header>\n @if (category.description) {\n <p class=\"x-category-desc\">{{ category.description }}</p>\n }\n <x-search-results [categoryId]=\"category.id\"></x-search-results>\n } @else if (notFound) {\n <div class=\"x-category-not-found\">Category not found.</div>\n } @else {\n <x-element-loader></x-element-loader>\n }\n `,\n styles: [\n `\n .x-category-desc {\n color: var(--color-text-muted);\n font-size: 13.5px;\n margin: -8px 0 16px;\n max-width: 720px;\n }\n .x-category-not-found {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n }\n `,\n ],\n})\nexport class CategoryComponent extends BaseDirective {\n private readonly route = inject(ActivatedRoute);\n private readonly seo = inject(SeoService);\n\n category?: CategoryRow;\n notFound = false;\n\n override init = () => {\n this.route.paramMap.pipe(takeUntil(this.$)).subscribe((params) => {\n const slug = params.get('slug');\n if (!slug) return;\n this.category = undefined;\n this.notFound = false;\n findCategoryBySlug(this.apiService, slug)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((category) => {\n this.category = category;\n this.notFound = !category;\n if (category) {\n void this.seo.apply({ entityType: 'category', entityId: category.id });\n }\n }),\n );\n });\n };\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { SearchResultsModule } from '../_shared/search-results';\nimport { CategoryComponent } from './category.component';\n\n@NgModule({\n declarations: [CategoryComponent],\n imports: [\n SharedModule,\n ElementsModule,\n TilmartElementsModule,\n SearchResultsModule,\n RouterModule.forChild([{ path: '', component: CategoryComponent }]),\n ],\n})\nexport class CategoryModule {}\n"],"names":["i1","i2","i3.SearchResultsComponent"],"mappings":";;;;;;;;;;;;;;AAOA;AACA;AACA;AAiCM,MAAO,iBAAkB,SAAQ,aAAa,C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,qBAAqB;YACrB,mBAAmB,EAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIV,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAPvB,YAAY;YACZ,cAAc;YACd,qBAAqB;YACrB,mBAAmB;AACnB,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAG1D,cAAc,EAAA,UAAA,EAAA,CAAA;kBAV1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,iBAAiB,CAAC;AACjC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,qBAAqB;wBACrB,mBAAmB;AACnB,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACpE,qBAAA;AACF,iBAAA;;;;;"}
@@ -8,7 +8,7 @@ import { ElementsModule } from '@thescaffold/ngx-ui';
8
8
  import * as i3 from '@isaiahiroko/tilmart-ngx-ui';
9
9
  import { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';
10
10
  import { takeUntil, forkJoin, map } from 'rxjs';
11
- import { b as blobUrl } from './isaiahiroko-tilmart-ngx-apps-buyer-media-DIgo1ZHk.mjs';
11
+ import { b as blobUrl } from './isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs';
12
12
  import { C as CompareTrayService } from './isaiahiroko-tilmart-ngx-apps-buyer-compare-tray.service-DITbKdyD.mjs';
13
13
  import * as i1 from '@angular/forms';
14
14
 
@@ -263,4 +263,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
263
263
  }] });
264
264
 
265
265
  export { CompareModule };
266
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-compare.module-B1hRah67.mjs.map
266
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-compare.module-C_YmeVgq.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-compare.module-B1hRah67.mjs","sources":["../../../projects/buyer/src/lib/pages/compare/compare.component.ts","../../../projects/buyer/src/lib/pages/compare/compare.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { CompareColumn, CompareSpecValue } from '@isaiahiroko/tilmart-ngx-ui';\nimport { forkJoin, map, takeUntil } from 'rxjs';\nimport { blobUrl } from '../../data/media';\nimport { CompareTrayService } from '../../services/compare-tray.service';\n\n// DIS-04 — `/compare`. Reads/writes the comma-separated `?ids=` query\n// param so a comparison is a real, shareable URL (per DIS-04's own\n// acceptance criterion), backed by `CompareTrayService`'s localStorage\n// tray so it also survives plain navigation without a share link.\n//\n// Uses **product-level** attribute values only (no per-variant override,\n// unlike the PDP's spec table) — comparing four products' worth of\n// per-variant selection would need its own variant-picker UI per column,\n// real added complexity DIS-04's acceptance criteria don't actually ask\n// for. `AttributeDefinition.comparable` (P1.1) is the filter, not\n// `showInSpecTable` (that's the PDP's own flag).\n@Component({\n standalone: false,\n selector: 'x-compare',\n template: `\n <x-tilmart-section-header title=\"Compare\"></x-tilmart-section-header>\n\n @if (columns.length) {\n <label class=\"x-compare-diff-toggle\">\n <input type=\"checkbox\" [(ngModel)]=\"differencesOnly\" />\n Highlight differences only\n </label>\n\n <x-tilmart-compare-table\n [columns]=\"columns\"\n [specsByProduct]=\"specsByProduct\"\n [differencesOnly]=\"differencesOnly\"\n (addToCart)=\"onAddToCart()\"\n (remove)=\"onRemove($event)\"\n ></x-tilmart-compare-table>\n } @else if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-compare-empty\">\n Nothing to compare yet. Add products from\n <a routerLink=\"/search\">search</a> or any category page.\n </div>\n }\n `,\n styles: [\n `\n .x-compare-diff-toggle {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n color: var(--color-text);\n margin-bottom: 12px;\n }\n .x-compare-empty {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n }\n `,\n ],\n})\nexport class CompareComponent extends BaseDirective {\n private readonly route = inject(ActivatedRoute);\n private readonly compareTray = inject(CompareTrayService);\n private readonly productSource = this.apiService.on('apps/commerce/product');\n private readonly categorySource = this.apiService.on('apps/commerce/category');\n private readonly attrDefSource = this.apiService.on('apps/commerce/attribute-definition');\n private readonly attrValueSource = this.apiService.on('apps/commerce/product-attribute-value');\n private readonly mediaSource = this.apiService.on('apps/commerce/product-media');\n private readonly variantSource = this.apiService.on('apps/commerce/product-variant');\n\n columns: CompareColumn[] = [];\n specsByProduct: Record<string, CompareSpecValue[]> = {};\n differencesOnly = false;\n loading = true;\n\n override init = () => {\n const idsParam = this.route.snapshot.queryParamMap.get('ids');\n if (idsParam) {\n this.compareTray.setAll(idsParam.split(',').filter(Boolean));\n }\n\n this.compareTray.changes$.pipe(takeUntil(this.$)).subscribe((ids) => {\n this.syncUrl(ids);\n this.loadColumns(ids);\n });\n };\n\n private syncUrl(ids: string[]): void {\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: { ids: ids.length ? ids.join(',') : null },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n }\n\n private loadColumns(ids: string[]): void {\n if (!ids.length) {\n this.columns = [];\n this.specsByProduct = {};\n this.loading = false;\n return;\n }\n\n this.loading = true;\n this.productSource\n .getMany({ page: 1, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n const allProducts: any[] = response?.data ?? [];\n const products = ids\n .map((id) => allProducts.find((p) => p.id === id))\n .filter((p): p is any => !!p);\n if (!products.length) {\n this.columns = [];\n this.specsByProduct = {};\n this.loading = false;\n return;\n }\n this.loadDetails(products);\n }),\n );\n }\n\n private loadDetails(products: any[]): void {\n forkJoin({\n media: this.mediaSource.getMany({ page: 1, perPage: 1000 } as any),\n variants: this.variantSource.getMany({ page: 1, perPage: 1000 } as any),\n categories: this.categorySource.getMany({ page: 1, perPage: 200 } as any),\n definitions: this.attrDefSource.getMany({ page: 1, perPage: 1000 } as any),\n values: this.attrValueSource.getMany({ page: 1, perPage: 1000 } as any),\n })\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ media, variants, categories, definitions, values }: any) => {\n const mediaRows: any[] = media?.data ?? [];\n const variantRows: any[] = variants?.data ?? [];\n const categoryRows: any[] = categories?.data ?? [];\n const definitionRows: any[] = definitions?.data ?? [];\n const valueRows: any[] = values?.data ?? [];\n\n this.columns = products.map((product) => {\n const firstVariant = variantRows\n .filter((v) => v.productId === product.id)\n .sort((a, b) => a.createdAt?.localeCompare?.(b.createdAt) ?? 0)[0];\n const firstMedia = mediaRows\n .filter((m) => m.productId === product.id)\n .sort((a, b) => a.position - b.position)[0];\n return {\n productId: product.id,\n href: ['/p', product.slug ?? product.id],\n imageUrl: blobUrl(firstMedia?.blobId),\n name: product.name,\n inStock: true,\n variantId: firstVariant?.id,\n } as CompareColumn & { variantId?: string };\n });\n\n this.specsByProduct = {};\n for (const product of products) {\n const category = categoryRows.find((c) => c.id === product.primaryCategoryId);\n if (!category?.attributeTemplateId) continue;\n const defs = definitionRows.filter(\n (d) => d.templateId === category.attributeTemplateId && d.comparable,\n );\n const productValues = valueRows.filter((v) => v.productId === product.id);\n const specs: CompareSpecValue[] = [];\n for (const def of defs) {\n const value = productValues.find((v) => v.attributeDefinitionId === def.id);\n if (!value) continue;\n specs.push({\n key: def.key,\n label: def.label,\n unit: def.unit,\n value: formatSpecValue(value, def.dataType),\n });\n }\n this.specsByProduct[product.id] = specs;\n }\n\n this.loadPrices();\n }),\n );\n }\n\n private loadPrices(): void {\n const withVariants = this.columns.filter((c: any) => c.variantId);\n if (!withVariants.length) {\n this.loading = false;\n return;\n }\n forkJoin(\n withVariants.map((column: any) =>\n this.apiService.get(`apps/commerce/product-variant/${column.variantId}/price`).pipe(\n map((response: any) => ({\n productId: column.productId,\n amount: response?.data?.amount,\n currency: response?.data?.currency,\n })),\n ),\n ),\n )\n .pipe(takeUntil(this.$))\n .subscribe({\n next: (results: any[]) => {\n for (const result of results) {\n const column = this.columns.find((c) => c.productId === result.productId);\n if (column) {\n column.price = result.amount;\n column.currency = result.currency;\n }\n }\n this.loading = false;\n },\n error: () => {\n this.loading = false;\n },\n });\n }\n\n onAddToCart(): void {\n notify('Cart is coming soon.', undefined, 'info');\n }\n\n onRemove(productId: string): void {\n this.compareTray.remove(productId);\n }\n}\n\nfunction formatSpecValue(value: any, dataType: string): string {\n switch (dataType) {\n case 'boolean':\n return value.valueBool ? 'Yes' : 'No';\n case 'range':\n return `${value.valueNumber}–${value.valueNumberHigh}`;\n case 'number':\n return String(value.valueNumber);\n default:\n return value.valueText ?? '';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { CompareComponent } from './compare.component';\n\n@NgModule({\n declarations: [CompareComponent],\n imports: [\n SharedModule,\n ElementsModule,\n TilmartElementsModule,\n RouterModule.forChild([{ path: '', component: CompareComponent }]),\n ],\n})\nexport class CompareModule {}\n"],"names":["i2","i3","i4","i1"],"mappings":";;;;;;;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA+CM,MAAO,gBAAiB,SAAQ,aAAa,CAAA;AA9CnD,IAAA,WAAA,GAAA;;AA+CmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC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AAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIZ,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,YANtB,YAAY;YACZ,cAAc;YACd,qBAAqB;AACrB,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGzD,aAAa,EAAA,UAAA,EAAA,CAAA;kBATzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,qBAAqB;AACrB,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AACnE,qBAAA;AACF,iBAAA;;;;;"}
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-compare.module-C_YmeVgq.mjs","sources":["../../../projects/buyer/src/lib/pages/compare/compare.component.ts","../../../projects/buyer/src/lib/pages/compare/compare.module.ts"],"sourcesContent":["import { Component, inject } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { CompareColumn, CompareSpecValue } from '@isaiahiroko/tilmart-ngx-ui';\nimport { forkJoin, map, takeUntil } from 'rxjs';\nimport { blobUrl } from '../../data/media';\nimport { CompareTrayService } from '../../services/compare-tray.service';\n\n// DIS-04 — `/compare`. Reads/writes the comma-separated `?ids=` query\n// param so a comparison is a real, shareable URL (per DIS-04's own\n// acceptance criterion), backed by `CompareTrayService`'s localStorage\n// tray so it also survives plain navigation without a share link.\n//\n// Uses **product-level** attribute values only (no per-variant override,\n// unlike the PDP's spec table) — comparing four products' worth of\n// per-variant selection would need its own variant-picker UI per column,\n// real added complexity DIS-04's acceptance criteria don't actually ask\n// for. `AttributeDefinition.comparable` (P1.1) is the filter, not\n// `showInSpecTable` (that's the PDP's own flag).\n@Component({\n standalone: false,\n selector: 'x-compare',\n template: `\n <x-tilmart-section-header title=\"Compare\"></x-tilmart-section-header>\n\n @if (columns.length) {\n <label class=\"x-compare-diff-toggle\">\n <input type=\"checkbox\" [(ngModel)]=\"differencesOnly\" />\n Highlight differences only\n </label>\n\n <x-tilmart-compare-table\n [columns]=\"columns\"\n [specsByProduct]=\"specsByProduct\"\n [differencesOnly]=\"differencesOnly\"\n (addToCart)=\"onAddToCart()\"\n (remove)=\"onRemove($event)\"\n ></x-tilmart-compare-table>\n } @else if (loading) {\n <x-element-loader></x-element-loader>\n } @else {\n <div class=\"x-compare-empty\">\n Nothing to compare yet. Add products from\n <a routerLink=\"/search\">search</a> or any category page.\n </div>\n }\n `,\n styles: [\n `\n .x-compare-diff-toggle {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 13px;\n color: var(--color-text);\n margin-bottom: 12px;\n }\n .x-compare-empty {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n }\n `,\n ],\n})\nexport class CompareComponent extends BaseDirective {\n private readonly route = inject(ActivatedRoute);\n private readonly compareTray = inject(CompareTrayService);\n private readonly productSource = this.apiService.on('apps/commerce/product');\n private readonly categorySource = this.apiService.on('apps/commerce/category');\n private readonly attrDefSource = this.apiService.on('apps/commerce/attribute-definition');\n private readonly attrValueSource = this.apiService.on('apps/commerce/product-attribute-value');\n private readonly mediaSource = this.apiService.on('apps/commerce/product-media');\n private readonly variantSource = this.apiService.on('apps/commerce/product-variant');\n\n columns: CompareColumn[] = [];\n specsByProduct: Record<string, CompareSpecValue[]> = {};\n differencesOnly = false;\n loading = true;\n\n override init = () => {\n const idsParam = this.route.snapshot.queryParamMap.get('ids');\n if (idsParam) {\n this.compareTray.setAll(idsParam.split(',').filter(Boolean));\n }\n\n this.compareTray.changes$.pipe(takeUntil(this.$)).subscribe((ids) => {\n this.syncUrl(ids);\n this.loadColumns(ids);\n });\n };\n\n private syncUrl(ids: string[]): void {\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: { ids: ids.length ? ids.join(',') : null },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n }\n\n private loadColumns(ids: string[]): void {\n if (!ids.length) {\n this.columns = [];\n this.specsByProduct = {};\n this.loading = false;\n return;\n }\n\n this.loading = true;\n this.productSource\n .getMany({ page: 1, perPage: 200 } as any)\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n const allProducts: any[] = response?.data ?? [];\n const products = ids\n .map((id) => allProducts.find((p) => p.id === id))\n .filter((p): p is any => !!p);\n if (!products.length) {\n this.columns = [];\n this.specsByProduct = {};\n this.loading = false;\n return;\n }\n this.loadDetails(products);\n }),\n );\n }\n\n private loadDetails(products: any[]): void {\n forkJoin({\n media: this.mediaSource.getMany({ page: 1, perPage: 1000 } as any),\n variants: this.variantSource.getMany({ page: 1, perPage: 1000 } as any),\n categories: this.categorySource.getMany({ page: 1, perPage: 200 } as any),\n definitions: this.attrDefSource.getMany({ page: 1, perPage: 1000 } as any),\n values: this.attrValueSource.getMany({ page: 1, perPage: 1000 } as any),\n })\n .pipe(takeUntil(this.$))\n .subscribe(\n using(({ media, variants, categories, definitions, values }: any) => {\n const mediaRows: any[] = media?.data ?? [];\n const variantRows: any[] = variants?.data ?? [];\n const categoryRows: any[] = categories?.data ?? [];\n const definitionRows: any[] = definitions?.data ?? [];\n const valueRows: any[] = values?.data ?? [];\n\n this.columns = products.map((product) => {\n const firstVariant = variantRows\n .filter((v) => v.productId === product.id)\n .sort((a, b) => a.createdAt?.localeCompare?.(b.createdAt) ?? 0)[0];\n const firstMedia = mediaRows\n .filter((m) => m.productId === product.id)\n .sort((a, b) => a.position - b.position)[0];\n return {\n productId: product.id,\n href: ['/p', product.slug ?? product.id],\n imageUrl: blobUrl(firstMedia?.blobId),\n name: product.name,\n inStock: true,\n variantId: firstVariant?.id,\n } as CompareColumn & { variantId?: string };\n });\n\n this.specsByProduct = {};\n for (const product of products) {\n const category = categoryRows.find((c) => c.id === product.primaryCategoryId);\n if (!category?.attributeTemplateId) continue;\n const defs = definitionRows.filter(\n (d) => d.templateId === category.attributeTemplateId && d.comparable,\n );\n const productValues = valueRows.filter((v) => v.productId === product.id);\n const specs: CompareSpecValue[] = [];\n for (const def of defs) {\n const value = productValues.find((v) => v.attributeDefinitionId === def.id);\n if (!value) continue;\n specs.push({\n key: def.key,\n label: def.label,\n unit: def.unit,\n value: formatSpecValue(value, def.dataType),\n });\n }\n this.specsByProduct[product.id] = specs;\n }\n\n this.loadPrices();\n }),\n );\n }\n\n private loadPrices(): void {\n const withVariants = this.columns.filter((c: any) => c.variantId);\n if (!withVariants.length) {\n this.loading = false;\n return;\n }\n forkJoin(\n withVariants.map((column: any) =>\n this.apiService.get(`apps/commerce/product-variant/${column.variantId}/price`).pipe(\n map((response: any) => ({\n productId: column.productId,\n amount: response?.data?.amount,\n currency: response?.data?.currency,\n })),\n ),\n ),\n )\n .pipe(takeUntil(this.$))\n .subscribe({\n next: (results: any[]) => {\n for (const result of results) {\n const column = this.columns.find((c) => c.productId === result.productId);\n if (column) {\n column.price = result.amount;\n column.currency = result.currency;\n }\n }\n this.loading = false;\n },\n error: () => {\n this.loading = false;\n },\n });\n }\n\n onAddToCart(): void {\n notify('Cart is coming soon.', undefined, 'info');\n }\n\n onRemove(productId: string): void {\n this.compareTray.remove(productId);\n }\n}\n\nfunction formatSpecValue(value: any, dataType: string): string {\n switch (dataType) {\n case 'boolean':\n return value.valueBool ? 'Yes' : 'No';\n case 'range':\n return `${value.valueNumber}–${value.valueNumberHigh}`;\n case 'number':\n return String(value.valueNumber);\n default:\n return value.valueText ?? '';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { CompareComponent } from './compare.component';\n\n@NgModule({\n declarations: [CompareComponent],\n imports: [\n SharedModule,\n ElementsModule,\n TilmartElementsModule,\n RouterModule.forChild([{ path: '', component: CompareComponent }]),\n ],\n})\nexport class CompareModule {}\n"],"names":["i2","i3","i4","i1"],"mappings":";;;;;;;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA+CM,MAAO,gBAAiB,SAAQ,aAAa,CAAA;AA9CnD,IAAA,WAAA,GAAA;;AA+CmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;QACxC,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,uBAAuB,CAAC;QAC3D,IAAA,CAAA,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,wBAAwB,CAAC;QAC7D,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,oCAAoC,CAAC;QACxE,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,uCAAuC,CAAC;QAC7E,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,6BAA6B,CAAC;QAC/D,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,+BAA+B,CAAC;QAEpF,IAAA,CAAA,OAAO,GAAoB,EAAE;QAC7B,IAAA,CAAA,cAAc,GAAuC,EAAE;QACvD,IAAA,CAAA,eAAe,GAAG,KAAK;QACvB,IAAA,CAAA,OAAO,GAAG,IAAI;QAEL,IAAA,CAAA,IAAI,GAAG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isaiahiroko/tilmart-ngx-ui';
7
7
  import { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';
8
8
  import { forkJoin, catchError, of, takeUntil, firstValueFrom } from 'rxjs';
9
9
  import { l as listTopLevelCategories } from './isaiahiroko-tilmart-ngx-apps-buyer-taxonomy-DdxSUDs5.mjs';
10
- import { t as toProductCardVm } from './isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-DK7QQcu1.mjs';
10
+ import { t as toProductCardVm } from './isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-B7sMTOJf.mjs';
11
11
  import { C as CompareTrayService } from './isaiahiroko-tilmart-ngx-apps-buyer-compare-tray.service-DITbKdyD.mjs';
12
- import { b as blobUrl } from './isaiahiroko-tilmart-ngx-apps-buyer-media-DIgo1ZHk.mjs';
12
+ import { b as blobUrl } from './isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs';
13
13
  import * as i2 from '@angular/common';
14
14
  import * as i1 from '@angular/forms';
15
15
 
@@ -360,4 +360,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
360
360
  }] });
361
361
 
362
362
  export { HomeModule };
363
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-home.module-B4iLd9-f.mjs.map
363
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-home.module-Ce2bHkCT.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-home.module-B4iLd9-f.mjs","sources":["../../../projects/buyer/src/lib/pages/home/merch-page.component.ts","../../../projects/buyer/src/lib/pages/home/merch-page.component.html","../../../projects/buyer/src/lib/pages/home/home.component.ts","../../../projects/buyer/src/lib/pages/home/home.module.ts"],"sourcesContent":["import { Component, Input, TemplateRef } from '@angular/core';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, forkJoin, of, takeUntil } from 'rxjs';\nimport { blobUrl } from '../../data/media';\nimport { ProductCardVm, toProductCardVm } from '../../data/search-result-card';\n\ninterface BannerVm {\n id: string;\n slot: string;\n title?: string;\n subtitle?: string;\n imageUrl?: string;\n linkUrl?: string;\n ctaLabel?: string;\n startsAt?: string;\n endsAt?: string;\n enabled: boolean;\n}\n\ninterface RenderModule {\n id: string;\n type: string;\n title?: string;\n banners?: BannerVm[];\n products?: ProductCardVm[];\n categories?: { name: string; slug: string }[];\n brands?: { name: string; slug: string }[];\n flashItems?: (ProductCardVm & { salePrice: number; remaining: number })[];\n flashEndsAt?: string;\n html?: string;\n}\n\n// P6.8, PROMO-06 / PROMO-07 — the storefront renderer for a composed\n// page. Loads the enabled, in-window `MerchandisingModule` rows for\n// `page`, ordered by `position`, and renders each type. `Banner` rows\n// (referenced by id, or pulled by slot for a `promo_banner` module) are\n// scheduled + targeting-aware. When a page has no modules configured,\n// the host's `fallback` template renders instead.\n@Component({\n standalone: false,\n selector: 'x-merch-page',\n templateUrl: './merch-page.component.html',\n})\nexport class MerchPageComponent extends BaseDirective {\n @Input() page = 'home';\n @Input() fallback?: TemplateRef<unknown>;\n\n loading = true;\n modules: RenderModule[] = [];\n\n newsletterEmail = '';\n newsletterDone = false;\n\n private cardByProduct = new Map<string, ProductCardVm>();\n private cardByVariant = new Map<string, ProductCardVm>();\n\n override init = () => {\n this.load();\n };\n\n private load(): void {\n this.loading = true;\n forkJoin({\n modules: this.apiService\n .on('apps/commerce/merchandising-module')\n .getMany({ page: this.page, perPage: 200 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n search: this.apiService\n .on('apps/commerce/search')\n .create({ page: 1, perPage: 200, sort: 'newest' })\n .pipe(catchError(() => of({ data: { items: [] } }))),\n categories: this.apiService\n .on('apps/commerce/category')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n brands: this.apiService\n .on('apps/commerce/brand')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n banners: this.apiService\n .on('apps/commerce/banner')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n flash: this.apiService\n .get('apps/commerce/flash-sale/live')\n .pipe(catchError(() => of({ data: [] }))),\n })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n const rawItems: any[] = res?.search?.data?.items ?? [];\n for (const item of rawItems) {\n const vm = toProductCardVm(item);\n this.cardByProduct.set(item.productId, vm);\n if (item.variantId) this.cardByVariant.set(item.variantId, vm);\n }\n\n const categoryById = new Map<string, any>(\n (res?.categories?.data ?? []).map((c: any) => [c.id, c]),\n );\n const brandById = new Map<string, any>(\n (res?.brands?.data ?? []).map((b: any) => [b.id, b]),\n );\n const banners: BannerVm[] = (res?.banners?.data ?? []).map((b: any) => ({\n id: b.id,\n slot: b.slot,\n title: b.title,\n subtitle: b.subtitle,\n imageUrl: b.imageUrl || blobUrl(b.mediaBlobId),\n linkUrl: b.linkUrl,\n ctaLabel: b.ctaLabel,\n startsAt: b.startsAt,\n endsAt: b.endsAt,\n enabled: b.enabled !== false,\n }));\n const bannerById = new Map(banners.map((b) => [b.id, b]));\n const liveBanner = (b: BannerVm) =>\n b.enabled && this.inWindow(b.startsAt, b.endsAt);\n\n const flashViews: any[] = res?.flash?.data ?? [];\n\n const now = Date.now();\n const configured: any[] = (res?.modules?.data ?? [])\n .filter(\n (m: any) =>\n m.page === this.page &&\n m.enabled !== false &&\n (!m.startsAt || Date.parse(m.startsAt) <= now) &&\n (!m.endsAt || Date.parse(m.endsAt) >= now),\n )\n .sort((a: any, b: any) => (a.position ?? 0) - (b.position ?? 0));\n\n this.modules = configured\n .map((m: any) => this.buildModule(m, { bannerById, banners, liveBanner, categoryById, brandById, flashViews }))\n .filter((m): m is RenderModule => !!m);\n this.loading = false;\n }),\n );\n }\n\n private buildModule(\n m: any,\n ctx: {\n bannerById: Map<string, BannerVm>;\n banners: BannerVm[];\n liveBanner: (b: BannerVm) => boolean;\n categoryById: Map<string, any>;\n brandById: Map<string, any>;\n flashViews: any[];\n },\n ): RenderModule | null {\n const c = m.config ?? {};\n const base: RenderModule = { id: m.id, type: m.type, title: m.title };\n const ids = (v: any): string[] => (Array.isArray(v) ? v : []);\n\n switch (m.type) {\n case 'hero_carousel':\n case 'promo_banner': {\n let list = ids(c.bannerIds)\n .map((id) => ctx.bannerById.get(id))\n .filter((b): b is BannerVm => !!b);\n if (!list.length && c.slot) {\n list = ctx.banners.filter((b) => b.slot === c.slot);\n }\n list = list.filter(ctx.liveBanner);\n return list.length ? { ...base, banners: list } : null;\n }\n case 'product_rail': {\n const limit = Number(c.limit) || 12;\n let products: ProductCardVm[];\n if (ids(c.productIds).length) {\n products = ids(c.productIds)\n .map((id) => this.cardByProduct.get(id))\n .filter((p): p is ProductCardVm => !!p);\n } else {\n products = [...this.cardByProduct.values()];\n }\n products = products.slice(0, limit);\n return products.length ? { ...base, products } : null;\n }\n case 'category_grid': {\n const cats = ids(c.categoryIds)\n .map((id) => ctx.categoryById.get(id))\n .filter(Boolean)\n .map((cat: any) => ({ name: cat.name, slug: cat.slug }));\n return cats.length ? { ...base, categories: cats } : null;\n }\n case 'brand_strip': {\n const brands = ids(c.brandIds)\n .map((id) => ctx.brandById.get(id))\n .filter(Boolean)\n .map((b: any) => ({ name: b.name, slug: b.slug }));\n return brands.length ? { ...base, brands } : null;\n }\n case 'flash_sale_rail': {\n const views = c.flashSaleId\n ? ctx.flashViews.filter((v) => v.flashSaleId === c.flashSaleId)\n : ctx.flashViews;\n const items: (ProductCardVm & { salePrice: number; remaining: number })[] = [];\n let endsAt: string | undefined;\n for (const view of views) {\n endsAt = endsAt ?? view.endsAt;\n for (const it of view.items ?? []) {\n const card = this.cardByVariant.get(it.variantId);\n if (!card || it.remaining <= 0) continue;\n items.push({ ...card, salePrice: it.salePrice, remaining: it.remaining });\n }\n }\n return items.length ? { ...base, flashItems: items, flashEndsAt: endsAt } : null;\n }\n case 'rich_text':\n return c.html ? { ...base, html: String(c.html) } : null;\n case 'newsletter':\n case 'trust_bar':\n return base;\n default:\n return null;\n }\n }\n\n private inWindow(startsAt?: string, endsAt?: string): boolean {\n const now = Date.now();\n if (startsAt && Date.parse(startsAt) > now) return false;\n if (endsAt && Date.parse(endsAt) < now) return false;\n return true;\n }\n\n async submitNewsletter(): Promise<void> {\n const email = this.newsletterEmail.trim();\n if (!email) return;\n try {\n await firstValueFrom(\n this.apiService.post('apps/commerce/notification-preference/mine', {\n email,\n marketingConsent: true,\n marketingConsentSource: `merch:${this.page}`,\n }),\n );\n this.newsletterDone = true;\n notify('You’re on the list.', undefined, 'success');\n } catch {\n notify('Could not sign you up. Please try again.', undefined, 'error');\n }\n }\n}\n","@if (loading) {\n <div class=\"x-merch-loading\">Loading…</div>\n} @else if (!modules.length) {\n <ng-container *ngTemplateOutlet=\"fallback\"></ng-container>\n} @else {\n @for (m of modules; track m.id) {\n <section class=\"x-merch-mod\" [attr.data-type]=\"m.type\">\n @switch (m.type) {\n\n @case ('hero_carousel') {\n <div class=\"x-merch-hero-row\">\n @for (b of m.banners; track b.id) {\n <a class=\"x-merch-hero\" [href]=\"b.linkUrl || null\" [class.x-merch-hero-plain]=\"!b.imageUrl\">\n @if (b.imageUrl) {\n <img class=\"x-merch-hero-img\" [src]=\"b.imageUrl\" [alt]=\"b.title || ''\" />\n }\n <div class=\"x-merch-hero-copy\">\n @if (b.title) { <h2 class=\"x-merch-hero-title\">{{ b.title }}</h2> }\n @if (b.subtitle) { <p class=\"x-merch-hero-sub\">{{ b.subtitle }}</p> }\n @if (b.ctaLabel) { <span class=\"x-merch-hero-cta\">{{ b.ctaLabel }}</span> }\n </div>\n </a>\n }\n </div>\n }\n\n @case ('promo_banner') {\n @for (b of m.banners; track b.id) {\n <a class=\"x-merch-promo\" [href]=\"b.linkUrl || null\">\n @if (b.imageUrl) {\n <img class=\"x-merch-promo-img\" [src]=\"b.imageUrl\" [alt]=\"b.title || ''\" />\n } @else {\n <span class=\"x-merch-promo-text\">\n <strong>{{ b.title }}</strong>\n @if (b.subtitle) { <span> — {{ b.subtitle }}</span> }\n @if (b.ctaLabel) { <span class=\"x-merch-promo-cta\">{{ b.ctaLabel }}</span> }\n </span>\n }\n </a>\n }\n }\n\n @case ('product_rail') {\n @if (m.title) {\n <x-tilmart-section-header [title]=\"m.title\"></x-tilmart-section-header>\n }\n <div class=\"x-merch-grid\">\n @for (p of m.products; track p.productId) {\n <x-tilmart-product-card\n [href]=\"p.href\"\n [imageUrl]=\"p.imageUrl\"\n [brandName]=\"p.brandName\"\n [name]=\"p.name\"\n [specLine]=\"p.specLine\"\n [price]=\"p.price\"\n [inStock]=\"p.inStock\"\n [badges]=\"p.badges\"\n ></x-tilmart-product-card>\n }\n </div>\n }\n\n @case ('category_grid') {\n @if (m.title) {\n <x-tilmart-section-header [title]=\"m.title\"></x-tilmart-section-header>\n }\n <div class=\"x-merch-cat-grid\">\n @for (cat of m.categories; track cat.slug) {\n <a class=\"x-merch-cat\" [routerLink]=\"['/c', cat.slug]\">{{ cat.name }}</a>\n }\n </div>\n }\n\n @case ('brand_strip') {\n @if (m.title) {\n <x-tilmart-section-header [title]=\"m.title\"></x-tilmart-section-header>\n }\n <div class=\"x-merch-brands\">\n @for (b of m.brands; track b.slug) {\n <a class=\"x-merch-brand\" [routerLink]=\"['/b', b.slug]\">{{ b.name }}</a>\n }\n </div>\n }\n\n @case ('flash_sale_rail') {\n <x-tilmart-section-header [title]=\"m.title || 'Flash sale'\"></x-tilmart-section-header>\n <div class=\"x-merch-grid\">\n @for (p of m.flashItems; track p.productId) {\n <a class=\"x-merch-flash\" [routerLink]=\"p.href\">\n @if (p.imageUrl) {\n <img class=\"x-merch-flash-img\" [src]=\"p.imageUrl\" [alt]=\"p.name\" />\n }\n <div class=\"x-merch-flash-name\">{{ p.name }}</div>\n <div class=\"x-merch-flash-price\">\n <span class=\"x-merch-flash-sale\">{{ p.currency }} {{ p.salePrice | number: '1.0-0' }}</span>\n @if (p.price > p.salePrice) {\n <span class=\"x-merch-flash-was\">{{ p.currency }} {{ p.price | number: '1.0-0' }}</span>\n }\n </div>\n <div class=\"x-merch-flash-left\">{{ p.remaining }} left</div>\n </a>\n }\n </div>\n }\n\n @case ('rich_text') {\n <div class=\"x-merch-rich\" [innerHTML]=\"m.html\"></div>\n }\n\n @case ('newsletter') {\n <div class=\"x-merch-news\">\n <div class=\"x-merch-news-copy\">\n <strong>{{ m.title || 'Stay in the loop' }}</strong>\n <span>Deals, new stock and solar tips — no spam.</span>\n </div>\n @if (newsletterDone) {\n <span class=\"x-merch-news-done\">Thanks — you’re signed up.</span>\n } @else {\n <form class=\"x-merch-news-form\" (ngSubmit)=\"submitNewsletter()\">\n <input\n type=\"email\"\n placeholder=\"you@example.com\"\n [(ngModel)]=\"newsletterEmail\"\n name=\"newsletterEmail\"\n required\n />\n <button type=\"submit\">Sign up</button>\n </form>\n }\n </div>\n }\n\n @case ('trust_bar') {\n <div class=\"x-merch-trust\">\n <span>Delivery across Nigeria</span>\n <span>Manufacturer-backed warranties</span>\n <span>Support that answers</span>\n </div>\n }\n }\n </section>\n }\n}\n\n<style>\n .x-merch-loading { padding: 32px 0; color: var(--color-text-muted); font-size: 14px; }\n .x-merch-mod { margin-bottom: 32px; }\n .x-merch-hero-row { display: flex; gap: 16px; flex-wrap: wrap; }\n .x-merch-hero {\n flex: 1; min-width: 260px; position: relative; display: block;\n border-radius: var(--radius-lg); overflow: hidden; text-decoration: none;\n background: var(--color-brand); min-height: 200px;\n }\n .x-merch-hero-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }\n .x-merch-hero-copy { position: relative; padding: 32px 24px; }\n .x-merch-hero-plain .x-merch-hero-copy { color: #fff; }\n .x-merch-hero-title { font-size: 24px; font-weight: 800; margin: 0 0 6px; color: #fff; }\n .x-merch-hero-sub { font-size: 14px; color: rgba(255,255,255,0.88); margin: 0 0 12px; max-width: 420px; }\n .x-merch-hero-cta {\n display: inline-block; background: #fff; color: var(--color-brand);\n font-weight: 700; font-size: 12px; padding: 8px 16px; border-radius: var(--radius-sm);\n }\n .x-merch-promo {\n display: block; padding: 16px 20px; border-radius: var(--radius-md);\n background: var(--color-surface-2); text-decoration: none; color: var(--color-text);\n margin-bottom: 8px;\n }\n .x-merch-promo-img { width: 100%; border-radius: var(--radius-md); display: block; }\n .x-merch-promo-cta { margin-left: 8px; font-weight: 700; color: var(--color-brand); }\n .x-merch-grid {\n display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;\n }\n .x-merch-cat-grid {\n display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;\n }\n .x-merch-cat {\n display: flex; align-items: center; justify-content: center; text-align: center;\n padding: 20px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n background: var(--color-surface); color: var(--color-text); font-weight: 600; font-size: 13px;\n text-decoration: none;\n }\n .x-merch-cat:hover { border-color: var(--color-brand); }\n .x-merch-brands { display: flex; flex-wrap: wrap; gap: 10px; }\n .x-merch-brand {\n padding: 8px 16px; border: 1px solid var(--color-border); border-radius: 999px;\n font-size: 13px; font-weight: 600; text-decoration: none; color: var(--color-text);\n background: var(--color-surface);\n }\n .x-merch-flash {\n display: block; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n padding: 12px; text-decoration: none; color: var(--color-text);\n }\n .x-merch-flash-img { width: 100%; aspect-ratio: 1; object-fit: contain; }\n .x-merch-flash-name { font-size: 13px; font-weight: 600; margin: 6px 0 4px; }\n .x-merch-flash-sale { font-weight: 800; color: var(--color-danger, #c0362c); }\n .x-merch-flash-was { margin-left: 6px; font-size: 12px; color: var(--color-text-muted); text-decoration: line-through; }\n .x-merch-flash-left { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }\n .x-merch-rich { font-size: 14px; line-height: 1.6; color: var(--color-text); }\n .x-merch-news {\n display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;\n padding: 20px 24px; border-radius: var(--radius-lg); background: var(--color-surface-2);\n }\n .x-merch-news-copy { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }\n .x-merch-news-copy span { color: var(--color-text-muted); }\n .x-merch-news-form { display: flex; gap: 8px; }\n .x-merch-news-form input {\n padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 14px;\n }\n .x-merch-news-form button {\n padding: 9px 18px; border: 0; border-radius: var(--radius-sm); background: var(--color-brand);\n color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;\n }\n .x-merch-news-done { font-size: 13px; font-weight: 600; color: var(--color-success, #1a7f37); }\n .x-merch-trust {\n display: flex; justify-content: space-around; gap: 16px; flex-wrap: wrap;\n padding: 14px 20px; border-top: 1px solid var(--color-border);\n border-bottom: 1px solid var(--color-border);\n font-size: 12.5px; font-weight: 600; color: var(--color-text-muted);\n }\n</style>\n","import { Component, inject } from '@angular/core';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { CategoryRow, listTopLevelCategories } from '../../data/taxonomy';\nimport { ProductCardVm, toProductCardVm } from '../../data/search-result-card';\nimport { CompareTrayService } from '../../services/compare-tray.service';\n\n// `/` — the storefront root. PROMO-06: renders the ops-composed\n// `MerchandisingModule` list for the `home` page (P6.7 composer, P6.8\n// renderer). When ops hasn't configured any modules yet, the fallback\n// below renders instead: a category grid + a \"new in\" row off the real\n// catalogue (DIS-01/CAT-01 still need something to browse from at `/`).\n@Component({\n standalone: false,\n selector: 'x-home',\n template: `\n <x-merch-page page=\"home\" [fallback]=\"fallback\"></x-merch-page>\n\n <ng-template #fallback>\n <div class=\"x-home-hero\">\n <div class=\"x-home-hero-copy\">\n <h1 class=\"x-home-hero-title\">Power that doesn't quit.</h1>\n <p class=\"x-home-hero-subtitle\">\n Solar panels, inverters, batteries and complete kits — sized right,\n delivered across Nigeria.\n </p>\n <a class=\"x-home-hero-cta\" routerLink=\"/tools/calculator\">Size my system</a>\n </div>\n </div>\n\n @if (categories.length) {\n <x-tilmart-section-header title=\"Shop by category\"></x-tilmart-section-header>\n <div class=\"x-home-category-grid\">\n @for (category of categories; track category.id) {\n <a class=\"x-home-category-card\" [routerLink]=\"['/c', category.slug]\">\n {{ category.name }}\n </a>\n }\n </div>\n }\n\n @if (newIn.length) {\n <x-tilmart-section-header\n title=\"New in\"\n actionLabel=\"See all\"\n [actionUrl]=\"['/search']\"\n ></x-tilmart-section-header>\n <div class=\"x-home-product-grid\">\n @for (item of newIn; track item.productId) {\n <x-tilmart-product-card\n [href]=\"item.href\"\n [imageUrl]=\"item.imageUrl\"\n [brandName]=\"item.brandName\"\n [name]=\"item.name\"\n [specLine]=\"item.specLine\"\n [price]=\"item.price\"\n [inStock]=\"item.inStock\"\n [badges]=\"item.badges\"\n [compareSelected]=\"compareTray.has(item.productId)\"\n (compareChange)=\"compareTray.toggle(item.productId)\"\n ></x-tilmart-product-card>\n }\n </div>\n }\n </ng-template>\n `,\n styles: [\n `\n .x-home-hero {\n background: var(--color-brand);\n border-radius: var(--radius-lg);\n padding: 40px 28px;\n margin-bottom: 24px;\n }\n .x-home-hero-title {\n font-family: var(--font-sans);\n font-size: 32px;\n font-weight: 800;\n color: #fff;\n margin: 0 0 8px;\n }\n .x-home-hero-subtitle {\n color: rgba(255, 255, 255, 0.85);\n font-size: 15px;\n max-width: 480px;\n margin: 0 0 16px;\n }\n .x-home-hero-cta {\n display: inline-block;\n background: #fff;\n color: var(--color-brand);\n font-weight: 700;\n font-size: 13px;\n padding: 10px 18px;\n border-radius: var(--radius-sm);\n text-decoration: none;\n }\n .x-home-category-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));\n gap: 12px;\n margin-bottom: 32px;\n }\n .x-home-category-card {\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 20px 12px;\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n background: var(--color-surface);\n color: var(--color-text);\n font-weight: 600;\n font-size: 13px;\n text-decoration: none;\n }\n .x-home-category-card:hover {\n border-color: var(--color-brand);\n }\n .x-home-product-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 16px;\n }\n `,\n ],\n})\nexport class HomeComponent extends BaseDirective {\n private readonly searchSource = this.apiService.on('apps/commerce/search');\n readonly compareTray = inject(CompareTrayService);\n\n categories: CategoryRow[] = [];\n newIn: ProductCardVm[] = [];\n\n override init = () => {\n listTopLevelCategories(this.apiService)\n .pipe(takeUntil(this.$))\n .subscribe(using((categories) => (this.categories = categories)));\n\n this.searchSource\n .create({ sort: 'newest', page: 1, perPage: 8 })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.newIn = (response?.data?.items ?? []).map(toProductCardVm);\n }),\n );\n };\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { HomeComponent } from './home.component';\nimport { MerchPageComponent } from './merch-page.component';\n\n@NgModule({\n declarations: [HomeComponent, MerchPageComponent],\n exports: [MerchPageComponent],\n imports: [\n SharedModule,\n TilmartElementsModule,\n RouterModule.forChild([{ path: '', component: HomeComponent }]),\n ],\n})\nexport class HomeModule {}\n"],"names":["i1","i2","i3","i4","i3.MerchPageComponent"],"mappings":";;;;;;;;;;;;;;;AAgCA;AACA;AACA;AACA;AACA;AACA;AAMM,MAAO,kBAAmB,SAAQ,aAAa,CAAA;AALrD,IAAA,WAAA,GAAA;;QAMW,IAAA,CAAA,IAAI,GAAG,MAAM;QAGtB,IAAA,CAAA,OAAO,GAAG,IAAI;QACd,IAAA,CAAA,OAAO,GAAmB,EAAE;QAE5B,IAAA,CAAA,eAAe,GAAG,EAAE;QACpB,IAAA,CAAA,cAAc,GAAG,KAAK;AAEd,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAyB;AAChD,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAyB;QAE/C,IAAA,CAAA,IAAI,GAAG,MAAK;YAC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B;AACrB,YAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGtD,UAAU,EAAA,UAAA,EAAA,CAAA;kBATtB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,aAAa,EAAE,kBAAkB,CAAC;oBACjD,OAAO,EAAE,CAAC,kBAAkB,CAAC;AAC7B,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,qBAAqB;AACrB,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;AAChE,qBAAA;AACF,iBAAA;;;;;"}
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-home.module-Ce2bHkCT.mjs","sources":["../../../projects/buyer/src/lib/pages/home/merch-page.component.ts","../../../projects/buyer/src/lib/pages/home/merch-page.component.html","../../../projects/buyer/src/lib/pages/home/home.component.ts","../../../projects/buyer/src/lib/pages/home/home.module.ts"],"sourcesContent":["import { Component, Input, TemplateRef } from '@angular/core';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { catchError, firstValueFrom, forkJoin, of, takeUntil } from 'rxjs';\nimport { blobUrl } from '../../data/media';\nimport { ProductCardVm, toProductCardVm } from '../../data/search-result-card';\n\ninterface BannerVm {\n id: string;\n slot: string;\n title?: string;\n subtitle?: string;\n imageUrl?: string;\n linkUrl?: string;\n ctaLabel?: string;\n startsAt?: string;\n endsAt?: string;\n enabled: boolean;\n}\n\ninterface RenderModule {\n id: string;\n type: string;\n title?: string;\n banners?: BannerVm[];\n products?: ProductCardVm[];\n categories?: { name: string; slug: string }[];\n brands?: { name: string; slug: string }[];\n flashItems?: (ProductCardVm & { salePrice: number; remaining: number })[];\n flashEndsAt?: string;\n html?: string;\n}\n\n// P6.8, PROMO-06 / PROMO-07 — the storefront renderer for a composed\n// page. Loads the enabled, in-window `MerchandisingModule` rows for\n// `page`, ordered by `position`, and renders each type. `Banner` rows\n// (referenced by id, or pulled by slot for a `promo_banner` module) are\n// scheduled + targeting-aware. When a page has no modules configured,\n// the host's `fallback` template renders instead.\n@Component({\n standalone: false,\n selector: 'x-merch-page',\n templateUrl: './merch-page.component.html',\n})\nexport class MerchPageComponent extends BaseDirective {\n @Input() page = 'home';\n @Input() fallback?: TemplateRef<unknown>;\n\n loading = true;\n modules: RenderModule[] = [];\n\n newsletterEmail = '';\n newsletterDone = false;\n\n private cardByProduct = new Map<string, ProductCardVm>();\n private cardByVariant = new Map<string, ProductCardVm>();\n\n override init = () => {\n this.load();\n };\n\n private load(): void {\n this.loading = true;\n forkJoin({\n modules: this.apiService\n .on('apps/commerce/merchandising-module')\n .getMany({ page: this.page, perPage: 200 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n search: this.apiService\n .on('apps/commerce/search')\n .create({ page: 1, perPage: 200, sort: 'newest' })\n .pipe(catchError(() => of({ data: { items: [] } }))),\n categories: this.apiService\n .on('apps/commerce/category')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n brands: this.apiService\n .on('apps/commerce/brand')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n banners: this.apiService\n .on('apps/commerce/banner')\n .getMany({ perPage: 500 } as any)\n .pipe(catchError(() => of({ data: [] }))),\n flash: this.apiService\n .get('apps/commerce/flash-sale/live')\n .pipe(catchError(() => of({ data: [] }))),\n })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((res: any) => {\n const rawItems: any[] = res?.search?.data?.items ?? [];\n for (const item of rawItems) {\n const vm = toProductCardVm(item);\n this.cardByProduct.set(item.productId, vm);\n if (item.variantId) this.cardByVariant.set(item.variantId, vm);\n }\n\n const categoryById = new Map<string, any>(\n (res?.categories?.data ?? []).map((c: any) => [c.id, c]),\n );\n const brandById = new Map<string, any>(\n (res?.brands?.data ?? []).map((b: any) => [b.id, b]),\n );\n const banners: BannerVm[] = (res?.banners?.data ?? []).map((b: any) => ({\n id: b.id,\n slot: b.slot,\n title: b.title,\n subtitle: b.subtitle,\n imageUrl: b.imageUrl || blobUrl(b.mediaBlobId),\n linkUrl: b.linkUrl,\n ctaLabel: b.ctaLabel,\n startsAt: b.startsAt,\n endsAt: b.endsAt,\n enabled: b.enabled !== false,\n }));\n const bannerById = new Map(banners.map((b) => [b.id, b]));\n const liveBanner = (b: BannerVm) =>\n b.enabled && this.inWindow(b.startsAt, b.endsAt);\n\n const flashViews: any[] = res?.flash?.data ?? [];\n\n const now = Date.now();\n const configured: any[] = (res?.modules?.data ?? [])\n .filter(\n (m: any) =>\n m.page === this.page &&\n m.enabled !== false &&\n (!m.startsAt || Date.parse(m.startsAt) <= now) &&\n (!m.endsAt || Date.parse(m.endsAt) >= now),\n )\n .sort((a: any, b: any) => (a.position ?? 0) - (b.position ?? 0));\n\n this.modules = configured\n .map((m: any) => this.buildModule(m, { bannerById, banners, liveBanner, categoryById, brandById, flashViews }))\n .filter((m): m is RenderModule => !!m);\n this.loading = false;\n }),\n );\n }\n\n private buildModule(\n m: any,\n ctx: {\n bannerById: Map<string, BannerVm>;\n banners: BannerVm[];\n liveBanner: (b: BannerVm) => boolean;\n categoryById: Map<string, any>;\n brandById: Map<string, any>;\n flashViews: any[];\n },\n ): RenderModule | null {\n const c = m.config ?? {};\n const base: RenderModule = { id: m.id, type: m.type, title: m.title };\n const ids = (v: any): string[] => (Array.isArray(v) ? v : []);\n\n switch (m.type) {\n case 'hero_carousel':\n case 'promo_banner': {\n let list = ids(c.bannerIds)\n .map((id) => ctx.bannerById.get(id))\n .filter((b): b is BannerVm => !!b);\n if (!list.length && c.slot) {\n list = ctx.banners.filter((b) => b.slot === c.slot);\n }\n list = list.filter(ctx.liveBanner);\n return list.length ? { ...base, banners: list } : null;\n }\n case 'product_rail': {\n const limit = Number(c.limit) || 12;\n let products: ProductCardVm[];\n if (ids(c.productIds).length) {\n products = ids(c.productIds)\n .map((id) => this.cardByProduct.get(id))\n .filter((p): p is ProductCardVm => !!p);\n } else {\n products = [...this.cardByProduct.values()];\n }\n products = products.slice(0, limit);\n return products.length ? { ...base, products } : null;\n }\n case 'category_grid': {\n const cats = ids(c.categoryIds)\n .map((id) => ctx.categoryById.get(id))\n .filter(Boolean)\n .map((cat: any) => ({ name: cat.name, slug: cat.slug }));\n return cats.length ? { ...base, categories: cats } : null;\n }\n case 'brand_strip': {\n const brands = ids(c.brandIds)\n .map((id) => ctx.brandById.get(id))\n .filter(Boolean)\n .map((b: any) => ({ name: b.name, slug: b.slug }));\n return brands.length ? { ...base, brands } : null;\n }\n case 'flash_sale_rail': {\n const views = c.flashSaleId\n ? ctx.flashViews.filter((v) => v.flashSaleId === c.flashSaleId)\n : ctx.flashViews;\n const items: (ProductCardVm & { salePrice: number; remaining: number })[] = [];\n let endsAt: string | undefined;\n for (const view of views) {\n endsAt = endsAt ?? view.endsAt;\n for (const it of view.items ?? []) {\n const card = this.cardByVariant.get(it.variantId);\n if (!card || it.remaining <= 0) continue;\n items.push({ ...card, salePrice: it.salePrice, remaining: it.remaining });\n }\n }\n return items.length ? { ...base, flashItems: items, flashEndsAt: endsAt } : null;\n }\n case 'rich_text':\n return c.html ? { ...base, html: String(c.html) } : null;\n case 'newsletter':\n case 'trust_bar':\n return base;\n default:\n return null;\n }\n }\n\n private inWindow(startsAt?: string, endsAt?: string): boolean {\n const now = Date.now();\n if (startsAt && Date.parse(startsAt) > now) return false;\n if (endsAt && Date.parse(endsAt) < now) return false;\n return true;\n }\n\n async submitNewsletter(): Promise<void> {\n const email = this.newsletterEmail.trim();\n if (!email) return;\n try {\n await firstValueFrom(\n this.apiService.post('apps/commerce/notification-preference/mine', {\n email,\n marketingConsent: true,\n marketingConsentSource: `merch:${this.page}`,\n }),\n );\n this.newsletterDone = true;\n notify('You’re on the list.', undefined, 'success');\n } catch {\n notify('Could not sign you up. Please try again.', undefined, 'error');\n }\n }\n}\n","@if (loading) {\n <div class=\"x-merch-loading\">Loading…</div>\n} @else if (!modules.length) {\n <ng-container *ngTemplateOutlet=\"fallback\"></ng-container>\n} @else {\n @for (m of modules; track m.id) {\n <section class=\"x-merch-mod\" [attr.data-type]=\"m.type\">\n @switch (m.type) {\n\n @case ('hero_carousel') {\n <div class=\"x-merch-hero-row\">\n @for (b of m.banners; track b.id) {\n <a class=\"x-merch-hero\" [href]=\"b.linkUrl || null\" [class.x-merch-hero-plain]=\"!b.imageUrl\">\n @if (b.imageUrl) {\n <img class=\"x-merch-hero-img\" [src]=\"b.imageUrl\" [alt]=\"b.title || ''\" />\n }\n <div class=\"x-merch-hero-copy\">\n @if (b.title) { <h2 class=\"x-merch-hero-title\">{{ b.title }}</h2> }\n @if (b.subtitle) { <p class=\"x-merch-hero-sub\">{{ b.subtitle }}</p> }\n @if (b.ctaLabel) { <span class=\"x-merch-hero-cta\">{{ b.ctaLabel }}</span> }\n </div>\n </a>\n }\n </div>\n }\n\n @case ('promo_banner') {\n @for (b of m.banners; track b.id) {\n <a class=\"x-merch-promo\" [href]=\"b.linkUrl || null\">\n @if (b.imageUrl) {\n <img class=\"x-merch-promo-img\" [src]=\"b.imageUrl\" [alt]=\"b.title || ''\" />\n } @else {\n <span class=\"x-merch-promo-text\">\n <strong>{{ b.title }}</strong>\n @if (b.subtitle) { <span> — {{ b.subtitle }}</span> }\n @if (b.ctaLabel) { <span class=\"x-merch-promo-cta\">{{ b.ctaLabel }}</span> }\n </span>\n }\n </a>\n }\n }\n\n @case ('product_rail') {\n @if (m.title) {\n <x-tilmart-section-header [title]=\"m.title\"></x-tilmart-section-header>\n }\n <div class=\"x-merch-grid\">\n @for (p of m.products; track p.productId) {\n <x-tilmart-product-card\n [href]=\"p.href\"\n [imageUrl]=\"p.imageUrl\"\n [brandName]=\"p.brandName\"\n [name]=\"p.name\"\n [specLine]=\"p.specLine\"\n [price]=\"p.price\"\n [inStock]=\"p.inStock\"\n [badges]=\"p.badges\"\n ></x-tilmart-product-card>\n }\n </div>\n }\n\n @case ('category_grid') {\n @if (m.title) {\n <x-tilmart-section-header [title]=\"m.title\"></x-tilmart-section-header>\n }\n <div class=\"x-merch-cat-grid\">\n @for (cat of m.categories; track cat.slug) {\n <a class=\"x-merch-cat\" [routerLink]=\"['/c', cat.slug]\">{{ cat.name }}</a>\n }\n </div>\n }\n\n @case ('brand_strip') {\n @if (m.title) {\n <x-tilmart-section-header [title]=\"m.title\"></x-tilmart-section-header>\n }\n <div class=\"x-merch-brands\">\n @for (b of m.brands; track b.slug) {\n <a class=\"x-merch-brand\" [routerLink]=\"['/b', b.slug]\">{{ b.name }}</a>\n }\n </div>\n }\n\n @case ('flash_sale_rail') {\n <x-tilmart-section-header [title]=\"m.title || 'Flash sale'\"></x-tilmart-section-header>\n <div class=\"x-merch-grid\">\n @for (p of m.flashItems; track p.productId) {\n <a class=\"x-merch-flash\" [routerLink]=\"p.href\">\n @if (p.imageUrl) {\n <img class=\"x-merch-flash-img\" [src]=\"p.imageUrl\" [alt]=\"p.name\" />\n }\n <div class=\"x-merch-flash-name\">{{ p.name }}</div>\n <div class=\"x-merch-flash-price\">\n <span class=\"x-merch-flash-sale\">{{ p.currency }} {{ p.salePrice | number: '1.0-0' }}</span>\n @if (p.price > p.salePrice) {\n <span class=\"x-merch-flash-was\">{{ p.currency }} {{ p.price | number: '1.0-0' }}</span>\n }\n </div>\n <div class=\"x-merch-flash-left\">{{ p.remaining }} left</div>\n </a>\n }\n </div>\n }\n\n @case ('rich_text') {\n <div class=\"x-merch-rich\" [innerHTML]=\"m.html\"></div>\n }\n\n @case ('newsletter') {\n <div class=\"x-merch-news\">\n <div class=\"x-merch-news-copy\">\n <strong>{{ m.title || 'Stay in the loop' }}</strong>\n <span>Deals, new stock and solar tips — no spam.</span>\n </div>\n @if (newsletterDone) {\n <span class=\"x-merch-news-done\">Thanks — you’re signed up.</span>\n } @else {\n <form class=\"x-merch-news-form\" (ngSubmit)=\"submitNewsletter()\">\n <input\n type=\"email\"\n placeholder=\"you@example.com\"\n [(ngModel)]=\"newsletterEmail\"\n name=\"newsletterEmail\"\n required\n />\n <button type=\"submit\">Sign up</button>\n </form>\n }\n </div>\n }\n\n @case ('trust_bar') {\n <div class=\"x-merch-trust\">\n <span>Delivery across Nigeria</span>\n <span>Manufacturer-backed warranties</span>\n <span>Support that answers</span>\n </div>\n }\n }\n </section>\n }\n}\n\n<style>\n .x-merch-loading { padding: 32px 0; color: var(--color-text-muted); font-size: 14px; }\n .x-merch-mod { margin-bottom: 32px; }\n .x-merch-hero-row { display: flex; gap: 16px; flex-wrap: wrap; }\n .x-merch-hero {\n flex: 1; min-width: 260px; position: relative; display: block;\n border-radius: var(--radius-lg); overflow: hidden; text-decoration: none;\n background: var(--color-brand); min-height: 200px;\n }\n .x-merch-hero-img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }\n .x-merch-hero-copy { position: relative; padding: 32px 24px; }\n .x-merch-hero-plain .x-merch-hero-copy { color: #fff; }\n .x-merch-hero-title { font-size: 24px; font-weight: 800; margin: 0 0 6px; color: #fff; }\n .x-merch-hero-sub { font-size: 14px; color: rgba(255,255,255,0.88); margin: 0 0 12px; max-width: 420px; }\n .x-merch-hero-cta {\n display: inline-block; background: #fff; color: var(--color-brand);\n font-weight: 700; font-size: 12px; padding: 8px 16px; border-radius: var(--radius-sm);\n }\n .x-merch-promo {\n display: block; padding: 16px 20px; border-radius: var(--radius-md);\n background: var(--color-surface-2); text-decoration: none; color: var(--color-text);\n margin-bottom: 8px;\n }\n .x-merch-promo-img { width: 100%; border-radius: var(--radius-md); display: block; }\n .x-merch-promo-cta { margin-left: 8px; font-weight: 700; color: var(--color-brand); }\n .x-merch-grid {\n display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px;\n }\n .x-merch-cat-grid {\n display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px;\n }\n .x-merch-cat {\n display: flex; align-items: center; justify-content: center; text-align: center;\n padding: 20px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n background: var(--color-surface); color: var(--color-text); font-weight: 600; font-size: 13px;\n text-decoration: none;\n }\n .x-merch-cat:hover { border-color: var(--color-brand); }\n .x-merch-brands { display: flex; flex-wrap: wrap; gap: 10px; }\n .x-merch-brand {\n padding: 8px 16px; border: 1px solid var(--color-border); border-radius: 999px;\n font-size: 13px; font-weight: 600; text-decoration: none; color: var(--color-text);\n background: var(--color-surface);\n }\n .x-merch-flash {\n display: block; border: 1px solid var(--color-border); border-radius: var(--radius-md);\n padding: 12px; text-decoration: none; color: var(--color-text);\n }\n .x-merch-flash-img { width: 100%; aspect-ratio: 1; object-fit: contain; }\n .x-merch-flash-name { font-size: 13px; font-weight: 600; margin: 6px 0 4px; }\n .x-merch-flash-sale { font-weight: 800; color: var(--color-danger, #c0362c); }\n .x-merch-flash-was { margin-left: 6px; font-size: 12px; color: var(--color-text-muted); text-decoration: line-through; }\n .x-merch-flash-left { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }\n .x-merch-rich { font-size: 14px; line-height: 1.6; color: var(--color-text); }\n .x-merch-news {\n display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;\n padding: 20px 24px; border-radius: var(--radius-lg); background: var(--color-surface-2);\n }\n .x-merch-news-copy { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }\n .x-merch-news-copy span { color: var(--color-text-muted); }\n .x-merch-news-form { display: flex; gap: 8px; }\n .x-merch-news-form input {\n padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font-size: 14px;\n }\n .x-merch-news-form button {\n padding: 9px 18px; border: 0; border-radius: var(--radius-sm); background: var(--color-brand);\n color: #fff; font-weight: 700; font-size: 13px; cursor: pointer;\n }\n .x-merch-news-done { font-size: 13px; font-weight: 600; color: var(--color-success, #1a7f37); }\n .x-merch-trust {\n display: flex; justify-content: space-around; gap: 16px; flex-wrap: wrap;\n padding: 14px 20px; border-top: 1px solid var(--color-border);\n border-bottom: 1px solid var(--color-border);\n font-size: 12.5px; font-weight: 600; color: var(--color-text-muted);\n }\n</style>\n","import { Component, inject } from '@angular/core';\nimport { BaseDirective, using } from '@thescaffold/ngx-core';\nimport { takeUntil } from 'rxjs';\nimport { CategoryRow, listTopLevelCategories } from '../../data/taxonomy';\nimport { ProductCardVm, toProductCardVm } from '../../data/search-result-card';\nimport { CompareTrayService } from '../../services/compare-tray.service';\n\n// `/` — the storefront root. PROMO-06: renders the ops-composed\n// `MerchandisingModule` list for the `home` page (P6.7 composer, P6.8\n// renderer). When ops hasn't configured any modules yet, the fallback\n// below renders instead: a category grid + a \"new in\" row off the real\n// catalogue (DIS-01/CAT-01 still need something to browse from at `/`).\n@Component({\n standalone: false,\n selector: 'x-home',\n template: `\n <x-merch-page page=\"home\" [fallback]=\"fallback\"></x-merch-page>\n\n <ng-template #fallback>\n <div class=\"x-home-hero\">\n <div class=\"x-home-hero-copy\">\n <h1 class=\"x-home-hero-title\">Power that doesn't quit.</h1>\n <p class=\"x-home-hero-subtitle\">\n Solar panels, inverters, batteries and complete kits — sized right,\n delivered across Nigeria.\n </p>\n <a class=\"x-home-hero-cta\" routerLink=\"/tools/calculator\">Size my system</a>\n </div>\n </div>\n\n @if (categories.length) {\n <x-tilmart-section-header title=\"Shop by category\"></x-tilmart-section-header>\n <div class=\"x-home-category-grid\">\n @for (category of categories; track category.id) {\n <a class=\"x-home-category-card\" [routerLink]=\"['/c', category.slug]\">\n {{ category.name }}\n </a>\n }\n </div>\n }\n\n @if (newIn.length) {\n <x-tilmart-section-header\n title=\"New in\"\n actionLabel=\"See all\"\n [actionUrl]=\"['/search']\"\n ></x-tilmart-section-header>\n <div class=\"x-home-product-grid\">\n @for (item of newIn; track item.productId) {\n <x-tilmart-product-card\n [href]=\"item.href\"\n [imageUrl]=\"item.imageUrl\"\n [brandName]=\"item.brandName\"\n [name]=\"item.name\"\n [specLine]=\"item.specLine\"\n [price]=\"item.price\"\n [inStock]=\"item.inStock\"\n [badges]=\"item.badges\"\n [compareSelected]=\"compareTray.has(item.productId)\"\n (compareChange)=\"compareTray.toggle(item.productId)\"\n ></x-tilmart-product-card>\n }\n </div>\n }\n </ng-template>\n `,\n styles: [\n `\n .x-home-hero {\n background: var(--color-brand);\n border-radius: var(--radius-lg);\n padding: 40px 28px;\n margin-bottom: 24px;\n }\n .x-home-hero-title {\n font-family: var(--font-sans);\n font-size: 32px;\n font-weight: 800;\n color: #fff;\n margin: 0 0 8px;\n }\n .x-home-hero-subtitle {\n color: rgba(255, 255, 255, 0.85);\n font-size: 15px;\n max-width: 480px;\n margin: 0 0 16px;\n }\n .x-home-hero-cta {\n display: inline-block;\n background: #fff;\n color: var(--color-brand);\n font-weight: 700;\n font-size: 13px;\n padding: 10px 18px;\n border-radius: var(--radius-sm);\n text-decoration: none;\n }\n .x-home-category-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));\n gap: 12px;\n margin-bottom: 32px;\n }\n .x-home-category-card {\n display: flex;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 20px 12px;\n border: 1px solid var(--color-border);\n border-radius: var(--radius-md);\n background: var(--color-surface);\n color: var(--color-text);\n font-weight: 600;\n font-size: 13px;\n text-decoration: none;\n }\n .x-home-category-card:hover {\n border-color: var(--color-brand);\n }\n .x-home-product-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 16px;\n }\n `,\n ],\n})\nexport class HomeComponent extends BaseDirective {\n private readonly searchSource = this.apiService.on('apps/commerce/search');\n readonly compareTray = inject(CompareTrayService);\n\n categories: CategoryRow[] = [];\n newIn: ProductCardVm[] = [];\n\n override init = () => {\n listTopLevelCategories(this.apiService)\n .pipe(takeUntil(this.$))\n .subscribe(using((categories) => (this.categories = categories)));\n\n this.searchSource\n .create({ sort: 'newest', page: 1, perPage: 8 })\n .pipe(takeUntil(this.$))\n .subscribe(\n using((response: any) => {\n this.newIn = (response?.data?.items ?? []).map(toProductCardVm);\n }),\n );\n };\n}\n","import { NgModule } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { HomeComponent } from './home.component';\nimport { MerchPageComponent } from './merch-page.component';\n\n@NgModule({\n declarations: [HomeComponent, MerchPageComponent],\n exports: [MerchPageComponent],\n imports: [\n SharedModule,\n TilmartElementsModule,\n RouterModule.forChild([{ path: '', component: HomeComponent }]),\n ],\n})\nexport class HomeModule {}\n"],"names":["i1","i2","i3","i4","i3.MerchPageComponent"],"mappings":";;;;;;;;;;;;;;;AAgCA;AACA;AACA;AACA;AACA;AACA;AAMM,MAAO,kBAAmB,SAAQ,aAAa,CAAA;AALrD,IAAA,WAAA,GAAA;;QAMW,IAAA,CAAA,IAAI,GAAG,MAAM;QAGtB,IAAA,CAAA,OAAO,GAAG,IAAI;QACd,IAAA,CAAA,OAAO,GAAmB,EAAE;QAE5B,IAAA,CAAA,eAAe,GAAG,EAAE;QACpB,IAAA,CAAA,cAAc,GAAG,KAAK;AAEd,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAyB;AAChD,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,GAAG,EAAyB;QAE/C,IAAA,CAAA,IAAI,GAAG,MAAK;YACnB,IAAI,CAAC,IAAI,EAAE;AACb,QAAA,CAAC;AA0LF,IAAA;IAxLS,IAAI,GAAA;AACV,QAAA,IAAI,CAAC,OAAO,GAAG,IAAI;AACnB,QAAA,QAAQ,CAAC;YACP,OAAO,EAAE,IAAI,CAAC;iBACX,EAAE,CAAC,oCAAoC;AACvC,iBAAA,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAS;AAChD,iBAAA,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,EA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AqB;AACrB,wBAAA,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC,CAAC;AAChE,qBAAA;AACF,iBAAA;;;;;"}
@@ -3,7 +3,7 @@ import { inject, Input, Component, NgModule } from '@angular/core';
3
3
  import { ActivatedRoute } from '@angular/router';
4
4
  import { BaseDirective, using, notify, SharedModule } from '@thescaffold/ngx-core';
5
5
  import { Subject, takeUntil } from 'rxjs';
6
- import { t as toProductCardVm } from './isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-DK7QQcu1.mjs';
6
+ import { t as toProductCardVm } from './isaiahiroko-tilmart-ngx-apps-buyer-search-result-card-B7sMTOJf.mjs';
7
7
  import { C as CompareTrayService } from './isaiahiroko-tilmart-ngx-apps-buyer-compare-tray.service-DITbKdyD.mjs';
8
8
  import * as i1 from '@angular/forms';
9
9
  import * as i2 from '@thescaffold/ngx-ui';
@@ -339,4 +339,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
339
339
  }] });
340
340
 
341
341
  export { SearchResultsComponent as S, SearchResultsModule as a };
342
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-index-C-Wy1WQB.mjs.map
342
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-index-C-Wy1WQB.mjs","sources":["../../../projects/buyer/src/lib/pages/_shared/search-results/search-results.component.ts","../../../projects/buyer/src/lib/pages/_shared/search-results/search-results.module.ts"],"sourcesContent":["import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { FacetFilterValue, FacetPanelFacet } from '@isaiahiroko/tilmart-ngx-ui';\nimport { Subject, takeUntil } from 'rxjs';\nimport { ProductCardVm, toProductCardVm } from '../../../data/search-result-card';\nimport { CompareTrayService } from '../../../services/compare-tray.service';\n\n// Shared by `category`, `search` and `brand` (P2.7) — all three are the\n// exact same filtered-result-set rendering against `SearchWorkflow.search`\n// (P2.1/P2.2/P2.3), differing only in which fixed filter (`categoryId` /\n// `brandId` / neither) the host page resolves from its own route slug.\n// Owns the DIS-02 \"shared URL state\" requirement itself (`q`/`sort`/\n// `page`/`f` query params via `ActivatedRoute`/`Router`) so none of the\n// three thin page components have to repeat it.\n@Component({\n standalone: false,\n selector: 'x-search-results',\n template: `\n <div class=\"x-sr-toolbar\">\n <div class=\"x-sr-count\">\n @if (!loading) {\n {{ total }} result{{ total === 1 ? '' : 's' }}\n }\n </div>\n <div class=\"x-sr-controls\">\n @if (showFacets && facets.length) {\n <button type=\"button\" class=\"x-sr-filters-btn\" (click)=\"facetOpen = true\">\n Filters\n </button>\n }\n <select\n class=\"x-sr-sort\"\n aria-label=\"Sort results\"\n [value]=\"sort\"\n (change)=\"onSortChange($event)\"\n >\n <option value=\"relevance\">Relevance</option>\n <option value=\"price_asc\">Price: low to high</option>\n <option value=\"price_desc\">Price: high to low</option>\n <option value=\"newest\">Newest</option>\n </select>\n </div>\n </div>\n\n @if (didYouMean) {\n <div class=\"x-sr-did-you-mean\">\n Did you mean\n <button type=\"button\" class=\"x-sr-did-you-mean-btn\" (click)=\"applyDidYouMean()\">\n {{ didYouMean }}\n </button>\n ?\n </div>\n }\n\n <div class=\"x-sr-layout\">\n @if (showFacets && facets.length) {\n <x-tilmart-facet-panel\n class=\"x-sr-facet-rail\"\n [facets]=\"facets\"\n [selected]=\"selectedFilters\"\n [open]=\"facetOpen\"\n [resultCount]=\"total\"\n (selectedChange)=\"onFiltersChange($event)\"\n (openChange)=\"facetOpen = $event\"\n ></x-tilmart-facet-panel>\n }\n\n <div class=\"x-sr-grid-col\">\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else if (items.length) {\n <div class=\"x-sr-grid\">\n @for (item of items; track item.productId) {\n <x-tilmart-product-card\n [href]=\"item.href\"\n [imageUrl]=\"item.imageUrl\"\n [brandName]=\"item.brandName\"\n [name]=\"item.name\"\n [specLine]=\"item.specLine\"\n [price]=\"item.price\"\n [perUnitAmount]=\"item.perUnitAmount\"\n [perUnitLabel]=\"item.perUnitLabel\"\n [inStock]=\"item.inStock\"\n [badges]=\"item.badges\"\n [compareSelected]=\"compareTray.has(item.productId)\"\n (addToCart)=\"onAddToCart()\"\n (compareChange)=\"compareTray.toggle(item.productId)\"\n ></x-tilmart-product-card>\n }\n </div>\n @if (totalPages > 1) {\n <div class=\"x-sr-pagination\">\n <button type=\"button\" [disabled]=\"page <= 1\" (click)=\"goToPage(page - 1)\">\n Prev\n </button>\n <span class=\"x-sr-page-label\">Page {{ page }} of {{ totalPages }}</span>\n <button type=\"button\" [disabled]=\"page >= totalPages\" (click)=\"goToPage(page + 1)\">\n Next\n </button>\n </div>\n }\n } @else {\n <div class=\"x-sr-empty\">\n No results{{ q ? ' for \"' + q + '\"' : '' }}.\n @if (didYouMean) {\n Try \"{{ didYouMean }}\" instead.\n }\n </div>\n }\n </div>\n </div>\n `,\n styles: [\n `\n .x-sr-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n margin-bottom: 12px;\n }\n .x-sr-count {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--color-text-muted);\n }\n .x-sr-controls {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .x-sr-filters-btn,\n .x-sr-sort {\n font-family: var(--font-mono);\n font-size: 12px;\n padding: 6px 10px;\n border-radius: var(--radius-sm);\n border: 1px solid var(--color-border);\n background: var(--color-surface);\n color: var(--color-text);\n cursor: pointer;\n }\n .x-sr-filters-btn {\n display: none;\n }\n .x-sr-did-you-mean {\n font-size: 13px;\n color: var(--color-text-muted);\n margin-bottom: 12px;\n }\n .x-sr-did-you-mean-btn {\n background: none;\n border: 0;\n padding: 0;\n color: var(--color-brand);\n text-decoration: underline;\n cursor: pointer;\n font-size: 13px;\n }\n .x-sr-layout {\n display: grid;\n grid-template-columns: 240px 1fr;\n gap: 20px;\n align-items: start;\n }\n .x-sr-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 16px;\n }\n .x-sr-pagination {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n margin-top: 24px;\n }\n .x-sr-pagination button {\n font-family: var(--font-mono);\n font-size: 12px;\n padding: 6px 12px;\n border-radius: var(--radius-sm);\n border: 1px solid var(--color-border);\n background: var(--color-surface);\n color: var(--color-text);\n cursor: pointer;\n }\n .x-sr-pagination button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .x-sr-page-label {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--color-text-muted);\n }\n .x-sr-empty {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n font-size: 14px;\n }\n\n @media (max-width: 900px) {\n .x-sr-layout {\n grid-template-columns: 1fr;\n }\n .x-sr-filters-btn {\n display: inline-block;\n }\n .x-sr-facet-rail {\n display: contents;\n }\n }\n `,\n ],\n})\nexport class SearchResultsComponent extends BaseDirective implements OnInit, OnDestroy {\n @Input() categoryId?: string;\n @Input() brandId?: string;\n @Input() showFacets = true;\n\n private readonly route = inject(ActivatedRoute);\n private readonly searchSource = this.apiService.on('apps/commerce/search');\n private readonly destroyed$ = new Subject<void>();\n readonly compareTray = inject(CompareTrayService);\n\n items: ProductCardVm[] = [];\n facets: FacetPanelFacet[] = [];\n selectedFilters: FacetFilterValue[] = [];\n total = 0;\n page = 1;\n perPage = 24;\n sort = 'relevance';\n q = '';\n loading = true;\n facetOpen = false;\n didYouMean?: string;\n\n get totalPages(): number {\n return Math.max(1, Math.ceil(this.total / this.perPage));\n }\n\n override init = () => {\n this.route.queryParamMap.pipe(takeUntil(this.destroyed$)).subscribe((params) => {\n this.q = params.get('q') ?? '';\n this.sort = params.get('sort') ?? 'relevance';\n this.page = Number(params.get('page') ?? '1') || 1;\n const rawFilters = params.get('f');\n this.selectedFilters = rawFilters ? this.safeParseFilters(rawFilters) : [];\n this.runSearch();\n });\n };\n\n // `categoryId`/`brandId` arrive asynchronously (the host page resolves\n // them from a route slug) and can also change outright when navigating\n // from one category/brand to another without the query string changing\n // at all — re-run on every change rather than guarding on `loading`,\n // since that guard would race the initial `init()` query-param fetch\n // (still in flight, `loading` already true) and silently drop the\n // categoryId/brandId that just arrived.\n override change = () => {\n this.runSearch();\n };\n\n override ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n super.ngOnDestroy();\n }\n\n private safeParseFilters(raw: string): FacetFilterValue[] {\n try {\n const parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? parsed : [];\n } catch {\n return [];\n }\n }\n\n private runSearch(): void {\n this.loading = true;\n this.searchSource\n .create({\n q: this.q || undefined,\n categoryId: this.categoryId,\n brandId: this.brandId,\n filters: this.selectedFilters,\n sort: this.sort,\n page: this.page,\n perPage: this.perPage,\n })\n .pipe(takeUntil(this.destroyed$))\n .subscribe(\n using((response: any) => {\n const data = response?.data ?? {};\n this.items = (data.items ?? []).map(toProductCardVm);\n this.facets = data.facets ?? [];\n this.total = data.total ?? 0;\n this.didYouMean = data.didYouMean;\n this.loading = false;\n }),\n );\n }\n\n onSortChange(event: Event): void {\n this.updateUrl({ sort: (event.target as HTMLSelectElement).value, page: 1 });\n }\n\n onFiltersChange(filters: FacetFilterValue[]): void {\n this.selectedFilters = filters;\n this.updateUrl({ f: filters.length ? JSON.stringify(filters) : null, page: 1 });\n }\n\n goToPage(page: number): void {\n this.updateUrl({ page });\n }\n\n applyDidYouMean(): void {\n if (this.didYouMean) {\n this.updateUrl({ q: this.didYouMean, page: 1 });\n }\n }\n\n onAddToCart(): void {\n // CartWorkflow lands in P4 — nothing to add to yet.\n notify('Cart is coming soon.', undefined, 'info');\n }\n\n private updateUrl(patch: Record<string, any>): void {\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: patch,\n queryParamsHandling: 'merge',\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { SearchResultsComponent } from './search-results.component';\n\n@NgModule({\n declarations: [SearchResultsComponent],\n imports: [SharedModule, ElementsModule, TilmartElementsModule],\n exports: [SearchResultsComponent],\n})\nexport class SearchResultsModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AA4MM,MAAO,sBAAuB,SAAQ,aAAa,CAAA;AA3MzD,IAAA,WAAA,GAAA;;QA8MW,IAAA,CAAA,UAAU,GAAG,IAAI;AAET,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;QAC9B,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,sBAAsB,CAAC;AACzD,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAQ;AACxC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;QAEjD,IAAA,CAAA,KAAK,GAAoB,EAAE;QAC3B,IAAA,CAAA,MAAM,GAAsB,EAAE;QAC9B,IAAA,CAAA,eAAe,GAAuB,EAAE;QACxC,IAAA,CAAA,KAAK,GAAG,CAAC;QACT,IAAA,CAAA,IAAI,GAAG,CAAC;QACR,IAAA,CAAA,OAAO,GAAG,EAAE;QACZ,IAAA,CAAA,IAAI,GAAG,WAAW;QAClB,IAAA,CAAA,CAAC,GAAG,EAAE;QACN,IAAA,CAAA,OAAO,GAAG,IAAI;QACd,IAAA,CAAA,SAAS,GAAG,KAAK;QAOR,IAAA,CAAA,IAAI,GAAG,MAAK;YACnB,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS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S;iCACI,KAAK,EAAA,QAAA,EACP,kBAAkB,EAAA,QAAA,EAClB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8FT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,4kDAAA,CAAA,EAAA;;sBA2GA;;sBACA;;sBACA;;;MClNU,mBAAmB,CAAA;+GAAnB,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAAnB,mBAAmB,EAAA,YAAA,EAAA,CAJf,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAC3B,YAAY,EAAE,cAAc,EAAE,qBAAqB,CAAA,EAAA,OAAA,EAAA,CACnD,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAErB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAAA,OAAA,EAAA,CAHpB,YAAY,EAAE,cAAc,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;;4FAGlD,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAL/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;AACtC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,qBAAqB,CAAC;oBAC9D,OAAO,EAAE,CAAC,sBAAsB,CAAC;AAClC,iBAAA;;;;;"}
1
+ {"version":3,"file":"isaiahiroko-tilmart-ngx-apps-buyer-index-DVfY14V6.mjs","sources":["../../../projects/buyer/src/lib/pages/_shared/search-results/search-results.component.ts","../../../projects/buyer/src/lib/pages/_shared/search-results/search-results.module.ts"],"sourcesContent":["import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { BaseDirective, notify, using } from '@thescaffold/ngx-core';\nimport { FacetFilterValue, FacetPanelFacet } from '@isaiahiroko/tilmart-ngx-ui';\nimport { Subject, takeUntil } from 'rxjs';\nimport { ProductCardVm, toProductCardVm } from '../../../data/search-result-card';\nimport { CompareTrayService } from '../../../services/compare-tray.service';\n\n// Shared by `category`, `search` and `brand` (P2.7) — all three are the\n// exact same filtered-result-set rendering against `SearchWorkflow.search`\n// (P2.1/P2.2/P2.3), differing only in which fixed filter (`categoryId` /\n// `brandId` / neither) the host page resolves from its own route slug.\n// Owns the DIS-02 \"shared URL state\" requirement itself (`q`/`sort`/\n// `page`/`f` query params via `ActivatedRoute`/`Router`) so none of the\n// three thin page components have to repeat it.\n@Component({\n standalone: false,\n selector: 'x-search-results',\n template: `\n <div class=\"x-sr-toolbar\">\n <div class=\"x-sr-count\">\n @if (!loading) {\n {{ total }} result{{ total === 1 ? '' : 's' }}\n }\n </div>\n <div class=\"x-sr-controls\">\n @if (showFacets && facets.length) {\n <button type=\"button\" class=\"x-sr-filters-btn\" (click)=\"facetOpen = true\">\n Filters\n </button>\n }\n <select\n class=\"x-sr-sort\"\n aria-label=\"Sort results\"\n [value]=\"sort\"\n (change)=\"onSortChange($event)\"\n >\n <option value=\"relevance\">Relevance</option>\n <option value=\"price_asc\">Price: low to high</option>\n <option value=\"price_desc\">Price: high to low</option>\n <option value=\"newest\">Newest</option>\n </select>\n </div>\n </div>\n\n @if (didYouMean) {\n <div class=\"x-sr-did-you-mean\">\n Did you mean\n <button type=\"button\" class=\"x-sr-did-you-mean-btn\" (click)=\"applyDidYouMean()\">\n {{ didYouMean }}\n </button>\n ?\n </div>\n }\n\n <div class=\"x-sr-layout\">\n @if (showFacets && facets.length) {\n <x-tilmart-facet-panel\n class=\"x-sr-facet-rail\"\n [facets]=\"facets\"\n [selected]=\"selectedFilters\"\n [open]=\"facetOpen\"\n [resultCount]=\"total\"\n (selectedChange)=\"onFiltersChange($event)\"\n (openChange)=\"facetOpen = $event\"\n ></x-tilmart-facet-panel>\n }\n\n <div class=\"x-sr-grid-col\">\n @if (loading) {\n <x-element-loader></x-element-loader>\n } @else if (items.length) {\n <div class=\"x-sr-grid\">\n @for (item of items; track item.productId) {\n <x-tilmart-product-card\n [href]=\"item.href\"\n [imageUrl]=\"item.imageUrl\"\n [brandName]=\"item.brandName\"\n [name]=\"item.name\"\n [specLine]=\"item.specLine\"\n [price]=\"item.price\"\n [perUnitAmount]=\"item.perUnitAmount\"\n [perUnitLabel]=\"item.perUnitLabel\"\n [inStock]=\"item.inStock\"\n [badges]=\"item.badges\"\n [compareSelected]=\"compareTray.has(item.productId)\"\n (addToCart)=\"onAddToCart()\"\n (compareChange)=\"compareTray.toggle(item.productId)\"\n ></x-tilmart-product-card>\n }\n </div>\n @if (totalPages > 1) {\n <div class=\"x-sr-pagination\">\n <button type=\"button\" [disabled]=\"page <= 1\" (click)=\"goToPage(page - 1)\">\n Prev\n </button>\n <span class=\"x-sr-page-label\">Page {{ page }} of {{ totalPages }}</span>\n <button type=\"button\" [disabled]=\"page >= totalPages\" (click)=\"goToPage(page + 1)\">\n Next\n </button>\n </div>\n }\n } @else {\n <div class=\"x-sr-empty\">\n No results{{ q ? ' for \"' + q + '\"' : '' }}.\n @if (didYouMean) {\n Try \"{{ didYouMean }}\" instead.\n }\n </div>\n }\n </div>\n </div>\n `,\n styles: [\n `\n .x-sr-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n margin-bottom: 12px;\n }\n .x-sr-count {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--color-text-muted);\n }\n .x-sr-controls {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .x-sr-filters-btn,\n .x-sr-sort {\n font-family: var(--font-mono);\n font-size: 12px;\n padding: 6px 10px;\n border-radius: var(--radius-sm);\n border: 1px solid var(--color-border);\n background: var(--color-surface);\n color: var(--color-text);\n cursor: pointer;\n }\n .x-sr-filters-btn {\n display: none;\n }\n .x-sr-did-you-mean {\n font-size: 13px;\n color: var(--color-text-muted);\n margin-bottom: 12px;\n }\n .x-sr-did-you-mean-btn {\n background: none;\n border: 0;\n padding: 0;\n color: var(--color-brand);\n text-decoration: underline;\n cursor: pointer;\n font-size: 13px;\n }\n .x-sr-layout {\n display: grid;\n grid-template-columns: 240px 1fr;\n gap: 20px;\n align-items: start;\n }\n .x-sr-grid {\n display: grid;\n grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));\n gap: 16px;\n }\n .x-sr-pagination {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n margin-top: 24px;\n }\n .x-sr-pagination button {\n font-family: var(--font-mono);\n font-size: 12px;\n padding: 6px 12px;\n border-radius: var(--radius-sm);\n border: 1px solid var(--color-border);\n background: var(--color-surface);\n color: var(--color-text);\n cursor: pointer;\n }\n .x-sr-pagination button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .x-sr-page-label {\n font-family: var(--font-mono);\n font-size: 12px;\n color: var(--color-text-muted);\n }\n .x-sr-empty {\n padding: 48px 16px;\n text-align: center;\n color: var(--color-text-muted);\n font-size: 14px;\n }\n\n @media (max-width: 900px) {\n .x-sr-layout {\n grid-template-columns: 1fr;\n }\n .x-sr-filters-btn {\n display: inline-block;\n }\n .x-sr-facet-rail {\n display: contents;\n }\n }\n `,\n ],\n})\nexport class SearchResultsComponent extends BaseDirective implements OnInit, OnDestroy {\n @Input() categoryId?: string;\n @Input() brandId?: string;\n @Input() showFacets = true;\n\n private readonly route = inject(ActivatedRoute);\n private readonly searchSource = this.apiService.on('apps/commerce/search');\n private readonly destroyed$ = new Subject<void>();\n readonly compareTray = inject(CompareTrayService);\n\n items: ProductCardVm[] = [];\n facets: FacetPanelFacet[] = [];\n selectedFilters: FacetFilterValue[] = [];\n total = 0;\n page = 1;\n perPage = 24;\n sort = 'relevance';\n q = '';\n loading = true;\n facetOpen = false;\n didYouMean?: string;\n\n get totalPages(): number {\n return Math.max(1, Math.ceil(this.total / this.perPage));\n }\n\n override init = () => {\n this.route.queryParamMap.pipe(takeUntil(this.destroyed$)).subscribe((params) => {\n this.q = params.get('q') ?? '';\n this.sort = params.get('sort') ?? 'relevance';\n this.page = Number(params.get('page') ?? '1') || 1;\n const rawFilters = params.get('f');\n this.selectedFilters = rawFilters ? this.safeParseFilters(rawFilters) : [];\n this.runSearch();\n });\n };\n\n // `categoryId`/`brandId` arrive asynchronously (the host page resolves\n // them from a route slug) and can also change outright when navigating\n // from one category/brand to another without the query string changing\n // at all — re-run on every change rather than guarding on `loading`,\n // since that guard would race the initial `init()` query-param fetch\n // (still in flight, `loading` already true) and silently drop the\n // categoryId/brandId that just arrived.\n override change = () => {\n this.runSearch();\n };\n\n override ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n super.ngOnDestroy();\n }\n\n private safeParseFilters(raw: string): FacetFilterValue[] {\n try {\n const parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? parsed : [];\n } catch {\n return [];\n }\n }\n\n private runSearch(): void {\n this.loading = true;\n this.searchSource\n .create({\n q: this.q || undefined,\n categoryId: this.categoryId,\n brandId: this.brandId,\n filters: this.selectedFilters,\n sort: this.sort,\n page: this.page,\n perPage: this.perPage,\n })\n .pipe(takeUntil(this.destroyed$))\n .subscribe(\n using((response: any) => {\n const data = response?.data ?? {};\n this.items = (data.items ?? []).map(toProductCardVm);\n this.facets = data.facets ?? [];\n this.total = data.total ?? 0;\n this.didYouMean = data.didYouMean;\n this.loading = false;\n }),\n );\n }\n\n onSortChange(event: Event): void {\n this.updateUrl({ sort: (event.target as HTMLSelectElement).value, page: 1 });\n }\n\n onFiltersChange(filters: FacetFilterValue[]): void {\n this.selectedFilters = filters;\n this.updateUrl({ f: filters.length ? JSON.stringify(filters) : null, page: 1 });\n }\n\n goToPage(page: number): void {\n this.updateUrl({ page });\n }\n\n applyDidYouMean(): void {\n if (this.didYouMean) {\n this.updateUrl({ q: this.didYouMean, page: 1 });\n }\n }\n\n onAddToCart(): void {\n // CartWorkflow lands in P4 — nothing to add to yet.\n notify('Cart is coming soon.', undefined, 'info');\n }\n\n private updateUrl(patch: Record<string, any>): void {\n this.router.navigate([], {\n relativeTo: this.route,\n queryParams: patch,\n queryParamsHandling: 'merge',\n });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SharedModule } from '@thescaffold/ngx-core';\nimport { ElementsModule } from '@thescaffold/ngx-ui';\nimport { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';\nimport { SearchResultsComponent } from './search-results.component';\n\n@NgModule({\n declarations: [SearchResultsComponent],\n imports: [SharedModule, ElementsModule, TilmartElementsModule],\n exports: [SearchResultsComponent],\n})\nexport class SearchResultsModule {}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AA4MM,MAAO,sBAAuB,SAAQ,aAAa,CAAA;AA3MzD,IAAA,WAAA,GAAA;;QA8MW,IAAA,CAAA,UAAU,GAAG,IAAI;AAET,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;QAC9B,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC,sBAAsB,CAAC;AACzD,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,OAAO,EAAQ;AACxC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;QAEjD,IAAA,CAAA,KAAK,GAAoB,EAAE;QAC3B,IAAA,CAAA,MAAM,GAAsB,EAAE;QAC9B,IAAA,CAAA,eAAe,GAAuB,EAAE;QACxC,IAAA,CAAA,KAAK,GAAG,CAAC;QACT,IAAA,CAAA,IAAI,GAAG,CAAC;QACR,IAAA,CAAA,OAAO,GAAG,EAAE;QACZ,IAAA,CAAA,IAAI,GAAG,WAAW;QAClB,IAAA,CAAA,CAAC,GAAG,EAAE;QACN,IAAA,CAAA,O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AsB,CAAC;AAClC,iBAAA;;;;;"}
@@ -8,7 +8,7 @@ import { ElementsModule } from '@thescaffold/ngx-ui';
8
8
  import * as i3 from '@isaiahiroko/tilmart-ngx-ui';
9
9
  import { TilmartElementsModule } from '@isaiahiroko/tilmart-ngx-ui';
10
10
  import { forkJoin, takeUntil, switchMap, of, map } from 'rxjs';
11
- import { b as blobUrl } from './isaiahiroko-tilmart-ngx-apps-buyer-media-DIgo1ZHk.mjs';
11
+ import { b as blobUrl } from './isaiahiroko-tilmart-ngx-apps-buyer-media-BchvXE95.mjs';
12
12
 
13
13
  // "Shop by Kit" (TRD §6.1) — `/kits`. Kits are 1:1 with a `type=kit`
14
14
  // Product (P1.4); this reuses `CatalogWorkflow.priceKit` (P1.12,
@@ -144,4 +144,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
144
144
  }] });
145
145
 
146
146
  export { KitsModule };
147
- //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-kits.module-DEyCahqn.mjs.map
147
+ //# sourceMappingURL=isaiahiroko-tilmart-ngx-apps-buyer-kits.module-BjHZeUdK.mjs.map