{"version":3,"file":"ng-zorro-antd-progress.mjs","sources":["../../components/progress/utils.ts","../../components/progress/progress.component.ts","../../components/progress/progress.module.ts","../../components/progress/typings.ts","../../components/progress/public-api.ts","../../components/progress/ng-zorro-antd-progress.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { NzProgressColorGradient, NzProgressGradientProgress } from './typings';\n\nfunction stripPercentToNumber(percent: string): number {\n return +percent.replace('%', '');\n}\n\nexport const sortGradient = (gradients: NzProgressGradientProgress): Array<{ key: number; value: string }> => {\n let tempArr: Array<{ key: number; value: string }> = [];\n\n Object.keys(gradients).forEach(key => {\n const value = gradients[key];\n const formatKey = stripPercentToNumber(key);\n if (!isNaN(formatKey)) {\n tempArr.push({\n key: formatKey,\n value\n });\n }\n });\n\n tempArr = tempArr.sort((a, b) => a.key - b.key);\n return tempArr;\n};\n\nexport const handleCircleGradient = (\n strokeColor: NzProgressGradientProgress\n): Array<{ offset: string; color: string }> =>\n sortGradient(strokeColor).map(({ key, value }) => ({ offset: `${key}%`, color: value }));\n\nexport const handleLinearGradient = (strokeColor: NzProgressColorGradient): string => {\n const { from = '#1890ff', to = '#1890ff', direction = 'to right', ...rest } = strokeColor;\n if (Object.keys(rest).length !== 0) {\n const sortedGradients = sortGradient(rest as NzProgressGradientProgress)\n .map(({ key, value }) => `${value} ${key}%`)\n .join(', ');\n return `linear-gradient(${direction}, ${sortedGradients})`;\n }\n return `linear-gradient(${direction}, ${from}, ${to})`;\n};\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Direction, Directionality } from '@angular/cdk/bidi';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n ViewEncapsulation,\n numberAttribute\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport { NgStyleInterface } from 'ng-zorro-antd/core/types';\nimport { isNotNil, numberAttributeWithZeroFallback } from 'ng-zorro-antd/core/util';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\n\nimport {\n NzProgressCirclePath,\n NzProgressColorGradient,\n NzProgressFormatter,\n NzProgressGapPositionType,\n NzProgressGradientProgress,\n NzProgressStatusType,\n NzProgressStepItem,\n NzProgressStrokeColorType,\n NzProgressStrokeLinecapType,\n NzProgressTypeType\n} from './typings';\nimport { handleCircleGradient, handleLinearGradient } from './utils';\n\nlet gradientIdSeed = 0;\n\nconst NZ_CONFIG_MODULE_NAME: NzConfigKey = 'progress';\nconst statusIconNameMap = new Map([\n ['success', 'check'],\n ['exception', 'close']\n]);\nconst statusColorMap = new Map([\n ['normal', '#108ee9'],\n ['exception', '#ff5500'],\n ['success', '#87d068']\n]);\nconst defaultFormatter: NzProgressFormatter = (p: number): string => `${p}%`;\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n selector: 'nz-progress',\n exportAs: 'nzProgress',\n preserveWhitespaces: false,\n imports: [NzIconModule, NzOutletModule, NgTemplateOutlet],\n template: `\n