{"version":3,"file":"xxmachina-components-routes-query.mjs","sources":["../../../../../packages/@xxmachina/components/src/lib/routes/query/query.routes.ts","../../../../../packages/@xxmachina/components/src/lib/routes/query/xxmachina-components-routes-query.ts"],"sourcesContent":["import { effect } from '@angular/core';\nimport { Routes } from '@angular/router';\nimport { Query } from '@xxmachina/common/domain/models';\nimport { QueryPage, QueryPageStore } from '@xxmachina/components/pages/query';\nimport { injectOne } from '@ng-atomic/common/stores/entities';\nimport { injectRouteParam } from '@ng-atomic/common/utils';\nimport { applyToInput } from '@ng-atomic/core';\nimport dayjs from 'dayjs';\n\nexport function buildYearMonthColumns(startYearMonth: string, months: number): string[] {\n  return Array.from({length: months}, (_, i) => dayjs(startYearMonth).add(i, 'month').format('YYYY/MM'));\n}\n\nexport const routes: Routes = [\n\t{\n\t\tpath: '',\n\t\tcomponent: QueryPage,\n\t\tloadChildren: () => import('./pages/pages.routes').then(m => m.routes),\n\t\tproviders: [\n\t\t\tQueryPageStore.provideDefault(),\n\t\t\tQueryPageStore.DI.provideConfig(() => {\n\t\t\t\treturn config => ({\n\t\t\t\t\t...config, \n\t\t\t\t\tadditionalColumns: (items: object[]) => [],\n\t\t\t\t})\n\t\t\t}),\n\t\t\tQueryPageStore.Initializer.provide((store) => {\n\t\t\t\tconst queryId = injectRouteParam('queryId');\n        const query = injectOne(Query, { id: queryId });\n        effect(() => {\n          applyToInput(store, 'query', query() as never);\n        });\n      }),\n\t\t\tQueryPageStore.provideNavEndActionsInitializers(),\n\t\t]\n\t}\n];\n\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AASM,SAAU,qBAAqB,CAAC,cAAsB,EAAE,MAAc,EAAA;AAC1E,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,EAAC,MAAM,EAAE,MAAM,EAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,C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