ng-prime-tools 1.1.10 → 1.1.11

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.
@@ -9793,6 +9793,7 @@ var PTNewsTickerTrend;
9793
9793
  })(PTNewsTickerTrend || (PTNewsTickerTrend = {}));
9794
9794
 
9795
9795
  class PTNewsTickerComponent {
9796
+ static { this.SCROLL_ANIMATION_NAME = 'pt-news-ticker-scroll'; }
9796
9797
  constructor(changeDetectorRef, zone) {
9797
9798
  this.changeDetectorRef = changeDetectorRef;
9798
9799
  this.zone = zone;
@@ -9842,6 +9843,7 @@ class PTNewsTickerComponent {
9842
9843
  this.pendingNews = null;
9843
9844
  this.animationFrameId = null;
9844
9845
  this.viewInitialized = false;
9846
+ this.applyingPendingNews = false;
9845
9847
  this.newBadgeTimeouts = new Map();
9846
9848
  this.expiredNewBadgeIds = new Set();
9847
9849
  }
@@ -9852,7 +9854,7 @@ class PTNewsTickerComponent {
9852
9854
  }
9853
9855
  if (changes['speed'] || changes['minSpeed'] || changes['maxSpeed']) {
9854
9856
  this.speed = this.normalizeSpeed(this.speed);
9855
- this.scheduleAnimationRefresh();
9857
+ this.scheduleAnimationRefresh(true);
9856
9858
  }
9857
9859
  if (changes['defaultSpeed']) {
9858
9860
  this.defaultSpeed = this.normalizeSpeed(this.defaultSpeed);
@@ -9863,19 +9865,22 @@ class PTNewsTickerComponent {
9863
9865
  if (changes['autoplay']) {
9864
9866
  this.playing = this.autoplay;
9865
9867
  this.emitPlayStateChange();
9868
+ if (!this.playing) {
9869
+ this.applyPendingNewsImmediately();
9870
+ }
9866
9871
  }
9867
9872
  if (changes['gap'] ||
9868
9873
  changes['height'] ||
9869
9874
  changes['direction'] ||
9870
9875
  changes['loop']) {
9871
- this.scheduleAnimationRefresh();
9876
+ this.scheduleAnimationRefresh(true);
9872
9877
  }
9873
9878
  }
9874
9879
  ngAfterViewInit() {
9875
9880
  this.viewInitialized = true;
9876
9881
  this.playing = this.autoplay;
9877
9882
  this.initializeResizeObserver();
9878
- this.scheduleAnimationRefresh();
9883
+ this.scheduleAnimationRefresh(true);
9879
9884
  this.changeDetectorRef.detectChanges();
9880
9885
  }
9881
9886
  ngOnDestroy() {
@@ -9900,7 +9905,7 @@ class PTNewsTickerComponent {
9900
9905
  : [...sourceNews, normalizedItem];
9901
9906
  this.queueOrApplyNews(updatedNews);
9902
9907
  this.emitNewsChange({
9903
- news: [...updatedNews],
9908
+ news: this.cloneNews(updatedNews),
9904
9909
  addedItem: normalizedItem,
9905
9910
  });
9906
9911
  }
@@ -9916,7 +9921,7 @@ class PTNewsTickerComponent {
9916
9921
  this.queueOrApplyNews(updatedNews);
9917
9922
  this.newsRemove.emit(removedItem);
9918
9923
  this.emitNewsChange({
9919
- news: [...updatedNews],
9924
+ news: this.cloneNews(updatedNews),
9920
9925
  removedItem,
9921
9926
  });
9922
9927
  }
@@ -9928,13 +9933,13 @@ class PTNewsTickerComponent {
9928
9933
  this.emitNewsChange({
9929
9934
  news: [],
9930
9935
  });
9931
- this.scheduleAnimationRefresh();
9936
+ this.scheduleAnimationRefresh(true);
9932
9937
  }
9933
9938
  replaceNews(news) {
9934
9939
  const normalizedNews = this.normalizeNews(news);
9935
9940
  this.queueOrApplyNews(normalizedNews);
9936
9941
  this.emitNewsChange({
9937
- news: [...normalizedNews],
9942
+ news: this.cloneNews(normalizedNews),
9938
9943
  });
9939
9944
  }
9940
9945
  play() {
@@ -9980,7 +9985,7 @@ class PTNewsTickerComponent {
9980
9985
  speed: nextSpeed,
9981
9986
  });
9982
9987
  this.emitPlayStateChange();
9983
- this.scheduleAnimationRefresh();
9988
+ this.scheduleAnimationRefresh(true);
9984
9989
  }
9985
9990
  onMouseEnter() {
9986
9991
  if (!this.pauseOnHover) {
@@ -9991,11 +9996,17 @@ class PTNewsTickerComponent {
9991
9996
  onMouseLeave() {
9992
9997
  this.hovered = false;
9993
9998
  }
9994
- onTrackAnimationIteration() {
9995
- this.applyPendingNews();
9999
+ onTrackAnimationIteration(event) {
10000
+ if (!this.isTickerScrollEvent(event)) {
10001
+ return;
10002
+ }
10003
+ this.applyPendingNewsAtCycleBoundary();
9996
10004
  }
9997
- onTrackAnimationEnd() {
9998
- this.applyPendingNews();
10005
+ onTrackAnimationEnd(event) {
10006
+ if (!this.isTickerScrollEvent(event)) {
10007
+ return;
10008
+ }
10009
+ this.applyPendingNewsAtCycleBoundary();
9999
10010
  }
10000
10011
  onItemClick(event, item) {
10001
10012
  if (item.disabled) {
@@ -10100,9 +10111,9 @@ class PTNewsTickerComponent {
10100
10111
  }
10101
10112
  getItemStyle(item) {
10102
10113
  const typeStyles = this.getTypeStyles(item.type);
10103
- const backgroundColor = item.backgroundColor ?? typeStyles.backgroundColor;
10104
- const textColor = item.textColor ?? typeStyles.textColor;
10105
- const iconColor = item.iconColor ?? textColor ?? this.containerTextColor;
10114
+ const backgroundColor = this.resolveItemBackgroundColor(item, typeStyles.backgroundColor);
10115
+ const textColor = item.textColor ?? typeStyles.textColor ?? this.containerTextColor;
10116
+ const iconColor = item.iconColor ?? textColor;
10106
10117
  const borderColor = item.borderColor ?? typeStyles.borderColor ?? 'transparent';
10107
10118
  const flashBackgroundColor = item.flashBackgroundColor ??
10108
10119
  item.backgroundColor ??
@@ -10111,8 +10122,8 @@ class PTNewsTickerComponent {
10111
10122
  const flashAlternateBackgroundColor = item.flashAlternateBackgroundColor ?? '#7f1d1d';
10112
10123
  const flashTextColor = item.flashTextColor ?? item.textColor ?? '#ffffff';
10113
10124
  return {
10114
- '--pt-news-item-background': backgroundColor ?? 'transparent',
10115
- '--pt-news-item-text-color': textColor ?? this.containerTextColor,
10125
+ '--pt-news-item-background': backgroundColor,
10126
+ '--pt-news-item-text-color': textColor,
10116
10127
  '--pt-news-item-icon-color': iconColor,
10117
10128
  '--pt-news-item-border-color': borderColor,
10118
10129
  '--pt-news-item-gap': this.itemGap,
@@ -10129,6 +10140,11 @@ class PTNewsTickerComponent {
10129
10140
  'pt-news-ticker__item--clickable': !item.disabled &&
10130
10141
  (this.hasItemLink(item) || this.newsClick.observers.length > 0),
10131
10142
  'pt-news-ticker__item--link': this.hasItemLink(item),
10143
+ 'pt-news-ticker__item--info': item.type === PTNewsTickerType.INFO,
10144
+ 'pt-news-ticker__item--default': !item.type || item.type === PTNewsTickerType.DEFAULT,
10145
+ 'pt-news-ticker__item--success': item.type === PTNewsTickerType.SUCCESS,
10146
+ 'pt-news-ticker__item--warning': item.type === PTNewsTickerType.WARNING,
10147
+ 'pt-news-ticker__item--danger': item.type === PTNewsTickerType.DANGER,
10132
10148
  };
10133
10149
  if (item.styleClass?.trim()) {
10134
10150
  classes[item.styleClass.trim()] = true;
@@ -10136,20 +10152,16 @@ class PTNewsTickerComponent {
10136
10152
  return classes;
10137
10153
  }
10138
10154
  getDuplicateItemClasses(item) {
10139
- const classes = {
10140
- 'pt-news-ticker__item--flash': this.isItemFlash(item),
10141
- 'pt-news-ticker__item--disabled': item.disabled === true,
10142
- };
10143
- if (item.styleClass?.trim()) {
10144
- classes[item.styleClass.trim()] = true;
10145
- }
10155
+ const classes = this.getItemClasses(item);
10156
+ classes['pt-news-ticker__item--clickable'] = false;
10157
+ classes['pt-news-ticker__item--link'] = false;
10146
10158
  return classes;
10147
10159
  }
10148
10160
  getTrackById(index, item) {
10149
- return `${item.id}-${index}`;
10161
+ return `${String(item.id)}-${index}`;
10150
10162
  }
10151
10163
  getDuplicateTrackById(index, item) {
10152
- return `duplicate-${item.id}-${index}`;
10164
+ return `duplicate-${String(item.id)}-${index}`;
10153
10165
  }
10154
10166
  getItemRole(item) {
10155
10167
  return this.hasItemLink(item) ? 'link' : null;
@@ -10163,14 +10175,15 @@ class PTNewsTickerComponent {
10163
10175
  : -1;
10164
10176
  }
10165
10177
  queueOrApplyNews(news) {
10166
- this.scheduleNewBadges(news);
10178
+ const clonedNews = this.cloneNews(news);
10179
+ this.scheduleNewBadges(clonedNews);
10167
10180
  if (this.shouldApplyNewsImmediately()) {
10168
10181
  this.pendingNews = null;
10169
- this.internalNews = [...news];
10170
- this.scheduleAnimationRefresh();
10182
+ this.internalNews = clonedNews;
10183
+ this.scheduleAnimationRefresh(true);
10171
10184
  return;
10172
10185
  }
10173
- this.pendingNews = [...news];
10186
+ this.pendingNews = clonedNews;
10174
10187
  }
10175
10188
  shouldApplyNewsImmediately() {
10176
10189
  return (!this.viewInitialized ||
@@ -10179,21 +10192,47 @@ class PTNewsTickerComponent {
10179
10192
  this.internalNews.length === 0 ||
10180
10193
  this.prefersReducedMotion());
10181
10194
  }
10182
- applyPendingNews() {
10183
- if (!this.pendingNews) {
10195
+ applyPendingNewsAtCycleBoundary() {
10196
+ if (!this.pendingNews || this.applyingPendingNews) {
10184
10197
  return;
10185
10198
  }
10186
- const nextNews = [...this.pendingNews];
10199
+ this.applyingPendingNews = true;
10200
+ const nextNews = this.cloneNews(this.pendingNews);
10187
10201
  this.pendingNews = null;
10188
10202
  this.internalNews = nextNews;
10189
10203
  this.changeDetectorRef.detectChanges();
10190
- this.scheduleAnimationRefresh();
10204
+ this.zone.runOutsideAngular(() => {
10205
+ requestAnimationFrame(() => {
10206
+ requestAnimationFrame(() => {
10207
+ this.zone.run(() => {
10208
+ this.calculateAnimationDuration();
10209
+ this.applyingPendingNews = false;
10210
+ });
10211
+ });
10212
+ });
10213
+ });
10191
10214
  }
10192
10215
  applyPendingNewsImmediately() {
10193
10216
  if (!this.pendingNews) {
10194
10217
  return;
10195
10218
  }
10196
- this.applyPendingNews();
10219
+ const nextNews = this.cloneNews(this.pendingNews);
10220
+ this.pendingNews = null;
10221
+ this.internalNews = nextNews;
10222
+ this.changeDetectorRef.detectChanges();
10223
+ this.scheduleAnimationRefresh(true);
10224
+ }
10225
+ isTickerScrollEvent(event) {
10226
+ return (event.animationName === PTNewsTickerComponent.SCROLL_ANIMATION_NAME &&
10227
+ event.target === event.currentTarget);
10228
+ }
10229
+ resolveItemBackgroundColor(item, typeBackgroundColor) {
10230
+ if (item.type === PTNewsTickerType.INFO ||
10231
+ !item.type ||
10232
+ item.type === PTNewsTickerType.DEFAULT) {
10233
+ return 'transparent';
10234
+ }
10235
+ return item.backgroundColor ?? typeBackgroundColor ?? 'transparent';
10197
10236
  }
10198
10237
  scheduleNewBadges(news) {
10199
10238
  news.forEach((item) => {
@@ -10290,25 +10329,25 @@ class PTNewsTickerComponent {
10290
10329
  }
10291
10330
  initializeResizeObserver() {
10292
10331
  if (typeof ResizeObserver === 'undefined' ||
10293
- !this.tickerGroup?.nativeElement) {
10332
+ !this.tickerViewport?.nativeElement) {
10294
10333
  return;
10295
10334
  }
10296
10335
  this.zone.runOutsideAngular(() => {
10297
10336
  this.resizeObserver = new ResizeObserver(() => {
10298
10337
  this.zone.run(() => {
10299
- this.calculateAnimationDuration();
10338
+ this.scheduleAnimationRefresh(true);
10300
10339
  });
10301
10340
  });
10302
- this.resizeObserver.observe(this.tickerGroup.nativeElement);
10303
- if (this.tickerViewport?.nativeElement) {
10304
- this.resizeObserver.observe(this.tickerViewport.nativeElement);
10305
- }
10341
+ this.resizeObserver.observe(this.tickerViewport.nativeElement);
10306
10342
  });
10307
10343
  }
10308
- scheduleAnimationRefresh() {
10344
+ scheduleAnimationRefresh(force = false) {
10309
10345
  if (!this.viewInitialized) {
10310
10346
  return;
10311
10347
  }
10348
+ if (!force && this.playing && this.loop) {
10349
+ return;
10350
+ }
10312
10351
  if (this.animationFrameId !== null) {
10313
10352
  cancelAnimationFrame(this.animationFrameId);
10314
10353
  }
@@ -10321,11 +10360,16 @@ class PTNewsTickerComponent {
10321
10360
  const groupElement = this.tickerGroup?.nativeElement;
10322
10361
  if (!groupElement || this.internalNews.length === 0) {
10323
10362
  this.animationDurationSeconds = 1;
10363
+ this.changeDetectorRef.markForCheck();
10324
10364
  return;
10325
10365
  }
10326
10366
  const contentWidth = Math.max(groupElement.scrollWidth, groupElement.getBoundingClientRect().width, 1);
10327
10367
  const normalizedSpeed = this.normalizeSpeed(this.speed);
10328
- this.animationDurationSeconds = Math.max(1, contentWidth / normalizedSpeed);
10368
+ const nextDuration = Math.max(1, contentWidth / normalizedSpeed);
10369
+ if (Math.abs(nextDuration - this.animationDurationSeconds) < 0.01) {
10370
+ return;
10371
+ }
10372
+ this.animationDurationSeconds = nextDuration;
10329
10373
  this.changeDetectorRef.markForCheck();
10330
10374
  }
10331
10375
  normalizeNews(news) {
@@ -10371,6 +10415,14 @@ class PTNewsTickerComponent {
10371
10415
  : String(segment.value).trim(),
10372
10416
  }));
10373
10417
  }
10418
+ cloneNews(news) {
10419
+ return news.map((item) => ({
10420
+ ...item,
10421
+ segments: item.segments?.map((segment) => ({
10422
+ ...segment,
10423
+ })),
10424
+ }));
10425
+ }
10374
10426
  normalizeSpeed(speed) {
10375
10427
  const numericSpeed = Number(speed);
10376
10428
  const safeMinSpeed = Math.max(1, Number(this.minSpeed) || 1);
@@ -10400,9 +10452,9 @@ class PTNewsTickerComponent {
10400
10452
  switch (type) {
10401
10453
  case PTNewsTickerType.INFO:
10402
10454
  return {
10403
- backgroundColor: '#dbeafe',
10455
+ backgroundColor: 'transparent',
10404
10456
  textColor: '#1e3a8a',
10405
- borderColor: '#93c5fd',
10457
+ borderColor: '#bfdbfe',
10406
10458
  };
10407
10459
  case PTNewsTickerType.SUCCESS:
10408
10460
  return {
@@ -10418,9 +10470,9 @@ class PTNewsTickerComponent {
10418
10470
  };
10419
10471
  case PTNewsTickerType.DANGER:
10420
10472
  return {
10421
- backgroundColor: '#fee2e2',
10422
- textColor: '#7f1d1d',
10423
- borderColor: '#fca5a5',
10473
+ backgroundColor: '#dc2626',
10474
+ textColor: '#ffffff',
10475
+ borderColor: '#991b1b',
10424
10476
  };
10425
10477
  case PTNewsTickerType.FLASH:
10426
10478
  return {
@@ -10430,18 +10482,18 @@ class PTNewsTickerComponent {
10430
10482
  };
10431
10483
  default:
10432
10484
  return {
10433
- backgroundColor: '#f8fafc',
10485
+ backgroundColor: 'transparent',
10434
10486
  textColor: '#0f172a',
10435
10487
  borderColor: '#e2e8f0',
10436
10488
  };
10437
10489
  }
10438
10490
  }
10439
10491
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTNewsTickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
10440
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTNewsTickerComponent, isStandalone: false, selector: "pt-news-ticker", inputs: { news: "news", speed: "speed", defaultSpeed: "defaultSpeed", speedStep: "speedStep", minSpeed: "minSpeed", maxSpeed: "maxSpeed", direction: "direction", autoplay: "autoplay", loop: "loop", pauseOnHover: "pauseOnHover", showControls: "showControls", showPlayPauseControl: "showPlayPauseControl", showSpeedControls: "showSpeedControls", showResetSpeedControl: "showResetSpeedControl", showRemoveButton: "showRemoveButton", showSpeedValue: "showSpeedValue", showNewBadge: "showNewBadge", newBadgeText: "newBadgeText", newBadgeDuration: "newBadgeDuration", height: "height", gap: "gap", itemGap: "itemGap", containerBackgroundColor: "containerBackgroundColor", containerTextColor: "containerTextColor", borderColor: "borderColor", borderWidth: "borderWidth", borderRadius: "borderRadius", controlsBackgroundColor: "controlsBackgroundColor", controlsBorderColor: "controlsBorderColor", emptyMessage: "emptyMessage", emptyIcon: "emptyIcon", ariaLabel: "ariaLabel" }, outputs: { newsClick: "newsClick", newsRemove: "newsRemove", newsChange: "newsChange", playStateChange: "playStateChange", speedChange: "speedChange" }, viewQueries: [{ propertyName: "tickerViewport", first: true, predicate: ["tickerViewport"], descendants: true }, { propertyName: "tickerGroup", first: true, predicate: ["tickerGroup"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n (animationiteration)=\"onTrackAnimationIteration()\"\n (animationend)=\"onTrackAnimationEnd()\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n [pTooltip]=\"segment.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getDuplicateItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:48rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--clickable,.pt-news-ticker__item--link{cursor:pointer}.pt-news-ticker__item--clickable:hover,.pt-news-ticker__item--link:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__content{display:inline-flex;align-items:center;flex:0 0 auto;gap:.55rem;min-width:0}.pt-news-ticker__item-title{display:inline-block;flex:0 0 auto;overflow:hidden;font-size:.85rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__segments{display:inline-flex;align-items:center;flex:0 0 auto;gap:.45rem;white-space:nowrap}.pt-news-ticker__segment{display:inline-flex;align-items:center;flex:0 0 auto;gap:.22rem;color:var(--pt-news-segment-color, currentColor);font-size:.82rem;font-weight:700;white-space:nowrap}.pt-news-ticker__segment-label{color:inherit;font-weight:700}.pt-news-ticker__segment-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--pt-news-segment-icon-color, currentColor);font-size:.68rem;font-weight:700}.pt-news-ticker__segment-value{color:inherit;font-variant-numeric:tabular-nums;font-weight:800}.pt-news-ticker__segment-separator{color:#94a3b8;font-size:.75rem;font-weight:700}.pt-news-ticker__new-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:1.15rem;padding:.12rem .42rem;border:1px solid #93c5fd;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.62rem;font-weight:800;line-height:1;letter-spacing:.025em;text-transform:uppercase;white-space:nowrap;animation:pt-news-ticker-new-badge-pulse 1.5s ease-in-out infinite}.pt-news-ticker__item--flash .pt-news-ticker__new-badge{border-color:#ffffffb3;background:#fff;color:#b91c1c}.pt-news-ticker__link-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:currentColor;font-size:.72rem;opacity:.75}.pt-news-ticker__item--link:hover .pt-news-ticker__link-icon{opacity:1}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@keyframes pt-news-ticker-new-badge-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.75;transform:scale(.96)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:34rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:24rem}.pt-news-ticker__item-title,.pt-news-ticker__item-text{font-size:.78rem}.pt-news-ticker__segment{font-size:.75rem}.pt-news-ticker__new-badge{font-size:.56rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__new-badge{animation:none!important}.pt-news-ticker__viewport{overflow-x:auto}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i13.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] }); }
10492
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.14", type: PTNewsTickerComponent, isStandalone: false, selector: "pt-news-ticker", inputs: { news: "news", speed: "speed", defaultSpeed: "defaultSpeed", speedStep: "speedStep", minSpeed: "minSpeed", maxSpeed: "maxSpeed", direction: "direction", autoplay: "autoplay", loop: "loop", pauseOnHover: "pauseOnHover", showControls: "showControls", showPlayPauseControl: "showPlayPauseControl", showSpeedControls: "showSpeedControls", showResetSpeedControl: "showResetSpeedControl", showRemoveButton: "showRemoveButton", showSpeedValue: "showSpeedValue", showNewBadge: "showNewBadge", newBadgeText: "newBadgeText", newBadgeDuration: "newBadgeDuration", height: "height", gap: "gap", itemGap: "itemGap", containerBackgroundColor: "containerBackgroundColor", containerTextColor: "containerTextColor", borderColor: "borderColor", borderWidth: "borderWidth", borderRadius: "borderRadius", controlsBackgroundColor: "controlsBackgroundColor", controlsBorderColor: "controlsBorderColor", emptyMessage: "emptyMessage", emptyIcon: "emptyIcon", ariaLabel: "ariaLabel" }, outputs: { newsClick: "newsClick", newsRemove: "newsRemove", newsChange: "newsChange", playStateChange: "playStateChange", speedChange: "speedChange" }, viewQueries: [{ propertyName: "tickerViewport", first: true, predicate: ["tickerViewport"], descendants: true }, { propertyName: "tickerTrack", first: true, predicate: ["tickerTrack"], descendants: true }, { propertyName: "tickerGroup", first: true, predicate: ["tickerGroup"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n #tickerTrack\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n (animationiteration)=\"onTrackAnimationIteration($event)\"\n (animationend)=\"onTrackAnimationEnd($event)\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n [pTooltip]=\"segment.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getDuplicateItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;contain:layout paint}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;transform:translateZ(0);animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;backface-visibility:hidden;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:48rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--info,.pt-news-ticker__item--default{background:transparent}.pt-news-ticker__item--clickable,.pt-news-ticker__item--link{cursor:pointer}.pt-news-ticker__item--clickable:hover,.pt-news-ticker__item--link:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__content{display:inline-flex;align-items:center;flex:0 0 auto;gap:.55rem;min-width:0}.pt-news-ticker__item-title{display:inline-block;flex:0 0 auto;overflow:hidden;font-size:.85rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__segments{display:inline-flex;align-items:center;flex:0 0 auto;gap:.45rem;white-space:nowrap}.pt-news-ticker__segment{display:inline-flex;align-items:center;flex:0 0 auto;gap:.22rem;color:var(--pt-news-segment-color, currentColor);font-size:.82rem;font-weight:700;white-space:nowrap}.pt-news-ticker__segment-label{color:inherit;font-weight:700}.pt-news-ticker__segment-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--pt-news-segment-icon-color, currentColor);font-size:.68rem;font-weight:700}.pt-news-ticker__segment-value{color:inherit;font-variant-numeric:tabular-nums;font-weight:800}.pt-news-ticker__segment-separator{color:#94a3b8;font-size:.75rem;font-weight:700}.pt-news-ticker__new-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:1.15rem;padding:.12rem .42rem;border:1px solid #93c5fd;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.62rem;font-weight:800;line-height:1;letter-spacing:.025em;text-transform:uppercase;white-space:nowrap;animation:pt-news-ticker-new-badge-pulse 1.5s ease-in-out infinite}.pt-news-ticker__item--flash .pt-news-ticker__new-badge{border-color:#ffffffb3;background:#fff;color:#b91c1c}.pt-news-ticker__item--danger .pt-news-ticker__new-badge{border-color:#ffffffbf;background:#fff;color:#b91c1c}.pt-news-ticker__link-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:currentColor;font-size:.72rem;opacity:.75}.pt-news-ticker__item--link:hover .pt-news-ticker__link-icon{opacity:1}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@keyframes pt-news-ticker-new-badge-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.75;transform:scale(.96)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:34rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:24rem}.pt-news-ticker__item-title,.pt-news-ticker__item-text{font-size:.78rem}.pt-news-ticker__segment{font-size:.75rem}.pt-news-ticker__new-badge{font-size:.56rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__new-badge{animation:none!important}.pt-news-ticker__viewport{overflow-x:auto;contain:none}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.ButtonDirective, selector: "[pButton]", inputs: ["ptButtonDirective", "pButtonPT", "pButtonUnstyled", "hostName", "text", "plain", "raised", "size", "outlined", "rounded", "iconPos", "loadingIcon", "fluid", "label", "icon", "loading", "buttonProps", "severity"] }, { kind: "directive", type: i13.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }] }); }
10441
10493
  }
10442
10494
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImport: i0, type: PTNewsTickerComponent, decorators: [{
10443
10495
  type: Component,
10444
- args: [{ selector: 'pt-news-ticker', standalone: false, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n (animationiteration)=\"onTrackAnimationIteration()\"\n (animationend)=\"onTrackAnimationEnd()\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n [pTooltip]=\"segment.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getDuplicateItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:48rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--clickable,.pt-news-ticker__item--link{cursor:pointer}.pt-news-ticker__item--clickable:hover,.pt-news-ticker__item--link:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__content{display:inline-flex;align-items:center;flex:0 0 auto;gap:.55rem;min-width:0}.pt-news-ticker__item-title{display:inline-block;flex:0 0 auto;overflow:hidden;font-size:.85rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__segments{display:inline-flex;align-items:center;flex:0 0 auto;gap:.45rem;white-space:nowrap}.pt-news-ticker__segment{display:inline-flex;align-items:center;flex:0 0 auto;gap:.22rem;color:var(--pt-news-segment-color, currentColor);font-size:.82rem;font-weight:700;white-space:nowrap}.pt-news-ticker__segment-label{color:inherit;font-weight:700}.pt-news-ticker__segment-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--pt-news-segment-icon-color, currentColor);font-size:.68rem;font-weight:700}.pt-news-ticker__segment-value{color:inherit;font-variant-numeric:tabular-nums;font-weight:800}.pt-news-ticker__segment-separator{color:#94a3b8;font-size:.75rem;font-weight:700}.pt-news-ticker__new-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:1.15rem;padding:.12rem .42rem;border:1px solid #93c5fd;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.62rem;font-weight:800;line-height:1;letter-spacing:.025em;text-transform:uppercase;white-space:nowrap;animation:pt-news-ticker-new-badge-pulse 1.5s ease-in-out infinite}.pt-news-ticker__item--flash .pt-news-ticker__new-badge{border-color:#ffffffb3;background:#fff;color:#b91c1c}.pt-news-ticker__link-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:currentColor;font-size:.72rem;opacity:.75}.pt-news-ticker__item--link:hover .pt-news-ticker__link-icon{opacity:1}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@keyframes pt-news-ticker-new-badge-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.75;transform:scale(.96)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:34rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:24rem}.pt-news-ticker__item-title,.pt-news-ticker__item-text{font-size:.78rem}.pt-news-ticker__segment{font-size:.75rem}.pt-news-ticker__new-badge{font-size:.56rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__new-badge{animation:none!important}.pt-news-ticker__viewport{overflow-x:auto}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"] }]
10496
+ args: [{ selector: 'pt-news-ticker', standalone: false, template: "<div\n class=\"pt-news-ticker\"\n [ngStyle]=\"getContainerStyle()\"\n [attr.aria-label]=\"ariaLabel\"\n role=\"region\"\n>\n @if (showControls) {\n <div class=\"pt-news-ticker__controls\">\n @if (showPlayPauseControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n [icon]=\"playing ? 'pi pi-pause' : 'pi pi-play'\"\n [pTooltip]=\"playing ? 'Mettre en pause' : 'Reprendre'\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"\n playing ? 'Mettre le ruban en pause' : 'Reprendre le ruban'\n \"\n (click)=\"togglePlayState()\"\n ></button>\n }\n\n @if (showSpeedControls) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-minus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Ralentir\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Ralentir le ruban\"\n [disabled]=\"speed <= minSpeed\"\n (click)=\"decreaseSpeed()\"\n ></button>\n\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-plus\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Acc\u00E9l\u00E9rer\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"Acc\u00E9l\u00E9rer le ruban\"\n [disabled]=\"speed >= maxSpeed\"\n (click)=\"increaseSpeed()\"\n ></button>\n }\n\n @if (showResetSpeedControl) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-refresh\"\n class=\"p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"R\u00E9initialiser la vitesse\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n aria-label=\"R\u00E9initialiser la vitesse\"\n [disabled]=\"speed === defaultSpeed\"\n (click)=\"resetSpeed()\"\n ></button>\n }\n\n @if (showSpeedValue) {\n <span\n class=\"pt-news-ticker__speed\"\n [attr.aria-label]=\"'Vitesse ' + speed + ' pixels par seconde'\"\n >\n {{ speed }} px/s\n </span>\n }\n </div>\n }\n\n <div\n #tickerViewport\n class=\"pt-news-ticker__viewport\"\n (mouseenter)=\"onMouseEnter()\"\n (mouseleave)=\"onMouseLeave()\"\n >\n @if (internalNews.length > 0) {\n <div\n #tickerTrack\n class=\"pt-news-ticker__track\"\n [class.pt-news-ticker__track--single]=\"!loop\"\n [ngStyle]=\"getTrackStyle()\"\n (animationiteration)=\"onTrackAnimationIteration($event)\"\n (animationend)=\"onTrackAnimationEnd($event)\"\n >\n <div\n #tickerGroup\n class=\"pt-news-ticker__group\"\n [attr.aria-hidden]=\"false\"\n >\n @for (item of internalNews; track getTrackById($index, item)) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n [pTooltip]=\"item.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-disabled]=\"item.disabled\"\n [attr.aria-label]=\"\n hasItemLink(item) ? item.text + ', ouvrir le lien' : item.text\n \"\n [attr.role]=\"getItemRole(item)\"\n [attr.tabindex]=\"getItemTabIndex(item)\"\n (click)=\"onItemClick($event, item)\"\n (keydown.enter)=\"onItemClick($event, item)\"\n (keydown.space)=\"onItemClick($event, item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n [pTooltip]=\"segment.tooltip || ''\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n class=\"pt-news-ticker__remove-button p-button-rounded p-button-text p-button-sm\"\n pTooltip=\"Supprimer l\u2019actualit\u00E9\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n [attr.aria-label]=\"'Supprimer : ' + item.text\"\n (click)=\"onRemoveClick($event, item)\"\n ></button>\n }\n </article>\n }\n </div>\n\n @if (loop) {\n <div class=\"pt-news-ticker__group\" aria-hidden=\"true\">\n @for (\n item of internalNews;\n track getDuplicateTrackById($index, item)\n ) {\n <article\n class=\"pt-news-ticker__item\"\n [ngClass]=\"getDuplicateItemClasses(item)\"\n [ngStyle]=\"getItemStyle(item)\"\n >\n @if (item.icon) {\n <i\n class=\"pt-news-ticker__item-icon\"\n [ngClass]=\"item.icon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n <div class=\"pt-news-ticker__content\">\n <span class=\"pt-news-ticker__item-title\">\n {{ item.text }}\n </span>\n\n @if (hasSegments(item)) {\n <span class=\"pt-news-ticker__segments\">\n @for (segment of item.segments; track $index) {\n @if ($index > 0) {\n <span\n class=\"pt-news-ticker__segment-separator\"\n aria-hidden=\"true\"\n >\n {{ getSegmentSeparator(item) }}\n </span>\n }\n\n <span\n class=\"pt-news-ticker__segment\"\n [ngStyle]=\"getSegmentStyle(segment)\"\n >\n @if (segment.label) {\n <span class=\"pt-news-ticker__segment-label\">\n {{ segment.label }}\n </span>\n }\n\n @if (getSegmentIcon(segment); as segmentIcon) {\n <i\n class=\"pt-news-ticker__segment-icon\"\n [ngClass]=\"segmentIcon\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (segment.value) {\n <span class=\"pt-news-ticker__segment-value\">\n {{ segment.value }}\n </span>\n }\n </span>\n }\n </span>\n }\n </div>\n\n @if (shouldShowNewBadge(item)) {\n <span class=\"pt-news-ticker__new-badge\">\n {{ getNewBadgeText(item) }}\n </span>\n }\n\n @if (hasItemLink(item)) {\n <i\n class=\"pt-news-ticker__link-icon pi pi-external-link\"\n aria-hidden=\"true\"\n ></i>\n }\n\n @if (isItemRemovable(item)) {\n <span\n class=\"pt-news-ticker__duplicate-remove-placeholder\"\n aria-hidden=\"true\"\n >\n <i class=\"pi pi-times\"></i>\n </span>\n }\n </article>\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"pt-news-ticker__empty\">\n @if (emptyIcon) {\n <i [ngClass]=\"emptyIcon\" aria-hidden=\"true\"></i>\n }\n\n <span>{{ emptyMessage }}</span>\n </div>\n }\n </div>\n</div>\n", styles: [":host{display:block;width:100%;min-width:0;max-width:100%;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:border-box}.pt-news-ticker{display:flex;align-items:stretch;width:100%;min-width:0;max-width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;border:var(--pt-news-ticker-border-width, 1px) solid var(--pt-news-ticker-border-color, #e2e8f0);border-radius:var(--pt-news-ticker-border-radius, 8px);background:var(--pt-news-ticker-background, #ffffff);color:var(--pt-news-ticker-text-color, #0f172a)}.pt-news-ticker__controls{position:relative;z-index:4;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;gap:.1rem;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.25rem .4rem;border-right:1px solid var(--pt-news-ticker-controls-border-color, #e2e8f0);background:var(--pt-news-ticker-controls-background, #f8fafc)}.pt-news-ticker__controls ::ng-deep .p-button.p-button-rounded.p-button-text{width:1.9rem;min-width:1.9rem;height:1.9rem;padding:0}.pt-news-ticker__controls ::ng-deep .p-button .p-button-icon{font-size:.78rem}.pt-news-ticker__speed{min-width:3.5rem;padding:0 .35rem;color:#475569;font-size:.7rem;font-weight:700;text-align:center;white-space:nowrap}.pt-news-ticker__viewport{position:relative;display:flex;align-items:center;flex:1 1 auto;width:100%;min-width:0;min-height:var(--pt-news-ticker-height, 3.25rem);overflow:hidden;contain:layout paint}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{position:absolute;z-index:3;top:0;bottom:0;width:2.5rem;content:\"\";pointer-events:none}.pt-news-ticker__viewport:before{left:0;background:linear-gradient(to right,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__viewport:after{right:0;background:linear-gradient(to left,var(--pt-news-ticker-background, #ffffff),transparent)}.pt-news-ticker__track{display:flex;align-items:center;flex:0 0 auto;width:max-content;min-width:max-content;transform:translateZ(0);animation-name:pt-news-ticker-scroll;animation-duration:var(--pt-news-ticker-duration, 20s);animation-timing-function:linear;animation-iteration-count:infinite;animation-fill-mode:both;backface-visibility:hidden;will-change:transform}.pt-news-ticker__track--single{animation-iteration-count:1;animation-fill-mode:forwards}.pt-news-ticker__group{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-ticker-gap, 2rem);min-width:max-content;padding-right:var(--pt-news-ticker-gap, 2rem)}.pt-news-ticker__item{display:inline-flex;align-items:center;flex:0 0 auto;gap:var(--pt-news-item-gap, .5rem);min-height:2.25rem;max-width:48rem;padding:.35rem .65rem;overflow:hidden;border:1px solid var(--pt-news-item-border-color, transparent);border-radius:999px;outline:none;background:var(--pt-news-item-background, transparent);color:var( --pt-news-item-text-color, var(--pt-news-ticker-text-color, #0f172a) );line-height:1.25;white-space:nowrap;transition:box-shadow .15s ease,opacity .15s ease,transform .15s ease}.pt-news-ticker__item--info,.pt-news-ticker__item--default{background:transparent}.pt-news-ticker__item--clickable,.pt-news-ticker__item--link{cursor:pointer}.pt-news-ticker__item--clickable:hover,.pt-news-ticker__item--link:hover{box-shadow:0 3px 10px #0f172a1f;transform:translateY(-1px)}.pt-news-ticker__item:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--primary-color, #3b82f6)}.pt-news-ticker__item--disabled{cursor:not-allowed;opacity:.5}.pt-news-ticker__item-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:var(--pt-news-item-icon-color, currentColor);font-size:.95rem}.pt-news-ticker__content{display:inline-flex;align-items:center;flex:0 0 auto;gap:.55rem;min-width:0}.pt-news-ticker__item-title{display:inline-block;flex:0 0 auto;overflow:hidden;font-size:.85rem;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__item-text{display:block;flex:1 1 auto;min-width:0;overflow:hidden;font-size:.85rem;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.pt-news-ticker__segments{display:inline-flex;align-items:center;flex:0 0 auto;gap:.45rem;white-space:nowrap}.pt-news-ticker__segment{display:inline-flex;align-items:center;flex:0 0 auto;gap:.22rem;color:var(--pt-news-segment-color, currentColor);font-size:.82rem;font-weight:700;white-space:nowrap}.pt-news-ticker__segment-label{color:inherit;font-weight:700}.pt-news-ticker__segment-icon{display:inline-flex;align-items:center;justify-content:center;color:var(--pt-news-segment-icon-color, currentColor);font-size:.68rem;font-weight:700}.pt-news-ticker__segment-value{color:inherit;font-variant-numeric:tabular-nums;font-weight:800}.pt-news-ticker__segment-separator{color:#94a3b8;font-size:.75rem;font-weight:700}.pt-news-ticker__new-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-height:1.15rem;padding:.12rem .42rem;border:1px solid #93c5fd;border-radius:999px;background:#dbeafe;color:#1d4ed8;font-size:.62rem;font-weight:800;line-height:1;letter-spacing:.025em;text-transform:uppercase;white-space:nowrap;animation:pt-news-ticker-new-badge-pulse 1.5s ease-in-out infinite}.pt-news-ticker__item--flash .pt-news-ticker__new-badge{border-color:#ffffffb3;background:#fff;color:#b91c1c}.pt-news-ticker__item--danger .pt-news-ticker__new-badge{border-color:#ffffffbf;background:#fff;color:#b91c1c}.pt-news-ticker__link-icon{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;color:currentColor;font-size:.72rem;opacity:.75}.pt-news-ticker__item--link:hover .pt-news-ticker__link-icon{opacity:1}.pt-news-ticker__remove-button{flex:0 0 auto}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button{width:1.45rem;min-width:1.45rem;height:1.45rem;padding:0;color:currentColor}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button .p-button-icon{font-size:.65rem}.pt-news-ticker__item ::ng-deep .pt-news-ticker__remove-button.p-button:not(:disabled):hover{background:#0f172a1a}.pt-news-ticker__duplicate-remove-placeholder{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.45rem;min-width:1.45rem;height:1.45rem;opacity:0;pointer-events:none}.pt-news-ticker__duplicate-remove-placeholder .pi{font-size:.65rem}.pt-news-ticker__item--flash{border-color:var(--pt-news-item-border-color, #991b1b);color:var(--pt-news-flash-text-color, #ffffff);animation-name:pt-news-ticker-flash;animation-duration:var(--pt-news-flash-duration, .7s);animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-direction:alternate}.pt-news-ticker__item--flash .pt-news-ticker__item-icon{color:var(--pt-news-item-icon-color, #ffffff)}.pt-news-ticker__empty{display:flex;align-items:center;justify-content:center;gap:.5rem;width:100%;min-height:var(--pt-news-ticker-height, 3.25rem);padding:.75rem 1rem;color:#64748b;font-size:.85rem;font-weight:500;text-align:center}.pt-news-ticker__empty .pi{font-size:1rem}@keyframes pt-news-ticker-scroll{0%{transform:translateZ(0)}to{transform:translate3d(-50%,0,0)}}@keyframes pt-news-ticker-flash{0%{background-color:var(--pt-news-flash-background, #dc2626)}to{background-color:var(--pt-news-flash-alternate-background, #7f1d1d)}}@keyframes pt-news-ticker-new-badge-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.75;transform:scale(.96)}}@media(max-width:768px){.pt-news-ticker{min-height:3rem}.pt-news-ticker__controls{padding-right:.25rem;padding-left:.25rem}.pt-news-ticker__speed{display:none}.pt-news-ticker__item{max-width:34rem}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{width:1.25rem}}@media(max-width:480px){.pt-news-ticker__item{max-width:24rem}.pt-news-ticker__item-title,.pt-news-ticker__item-text{font-size:.78rem}.pt-news-ticker__segment{font-size:.75rem}.pt-news-ticker__new-badge{font-size:.56rem}}@media(prefers-reduced-motion:reduce){.pt-news-ticker__track{animation:none!important;transform:none!important}.pt-news-ticker__item--flash{animation:none!important;background-color:var(--pt-news-flash-background, #dc2626)!important}.pt-news-ticker__new-badge{animation:none!important}.pt-news-ticker__viewport{overflow-x:auto;contain:none}.pt-news-ticker__viewport:before,.pt-news-ticker__viewport:after{display:none}}\n"] }]
10445
10497
  }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.NgZone }], propDecorators: { news: [{
10446
10498
  type: Input
10447
10499
  }], speed: [{
@@ -10519,6 +10571,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.14", ngImpo
10519
10571
  }], tickerViewport: [{
10520
10572
  type: ViewChild,
10521
10573
  args: ['tickerViewport', { static: false }]
10574
+ }], tickerTrack: [{
10575
+ type: ViewChild,
10576
+ args: ['tickerTrack', { static: false }]
10522
10577
  }], tickerGroup: [{
10523
10578
  type: ViewChild,
10524
10579
  args: ['tickerGroup', { static: false }]