@smarterplan/ngx-smarterplan-core 1.4.27 → 1.4.29

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 (122) hide show
  1. package/README.md +24 -24
  2. package/esm2022/lib/components/checkbox-slider/checkbox-slider.component.mjs +33 -0
  3. package/esm2022/lib/components/csv-export/csv-export.component.mjs +3 -3
  4. package/esm2022/lib/components/inventory-runs/inventory-files.component.mjs +168 -81
  5. package/esm2022/lib/components/inventory-runs/inventory-launch.component.mjs +417 -0
  6. package/esm2022/lib/components/inventory-runs/inventory-runs.component.mjs +14 -3
  7. package/esm2022/lib/components/loader/loader.component.mjs +3 -3
  8. package/esm2022/lib/components/menu-bar/avatar/avatar.component.mjs +1 -1
  9. package/esm2022/lib/components/menu-bar/menu-bar.component.mjs +3 -3
  10. package/esm2022/lib/components/menu-bar/navigation-bar/navigation-bar.component.mjs +3 -3
  11. package/esm2022/lib/components/modal-switch-visit/modal-switch-visit.component.mjs +3 -3
  12. package/esm2022/lib/components/search-bar/search-bar.component.mjs +3 -3
  13. package/esm2022/lib/components/splat-viewer/splat-viewer.component.mjs +1 -1
  14. package/esm2022/lib/components/support-modal/support-modal.component.mjs +3 -3
  15. package/esm2022/lib/config.mjs +1 -1
  16. package/esm2022/lib/helpers.service.mjs +1 -1
  17. package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasImage.mjs +1 -1
  18. package/esm2022/lib/matterport-extensions/nest-thermostat/CanvasRenderer.mjs +1 -1
  19. package/esm2022/lib/matterport-extensions/nest-thermostat/NestThermostat.mjs +1 -1
  20. package/esm2022/lib/matterport-extensions/nest-thermostat/PlaneRenderer.mjs +1 -1
  21. package/esm2022/lib/matterport-extensions/scene-component/SceneComponent.mjs +1 -1
  22. package/esm2022/lib/matterport-extensions/security-camera/SecurityCamera.mjs +22 -22
  23. package/esm2022/lib/matterport-extensions/tv-player/TvPlayer.mjs +1 -1
  24. package/esm2022/lib/matterport-extensions/view-frustum-mesh/ViewFrustumMesh.mjs +22 -22
  25. package/esm2022/lib/mattertagData.mjs +1 -1
  26. package/esm2022/lib/ngx-smarterplan-core.module.mjs +14 -4
  27. package/esm2022/lib/ngx-smarterplan-core.service.mjs +1 -1
  28. package/esm2022/lib/pipes/duration-to-string.pipe.mjs +1 -1
  29. package/esm2022/lib/pipes/format-date-number-to-digits.pipe.mjs +1 -1
  30. package/esm2022/lib/pipes/hashtag-from-id.pipe.mjs +1 -1
  31. package/esm2022/lib/pipes/safe-url.pipe.mjs +1 -1
  32. package/esm2022/lib/pipes/time-date-to-local-string.pipe.mjs +1 -1
  33. package/esm2022/lib/pipes/username-from-id.pipe.mjs +1 -1
  34. package/esm2022/lib/services/amplify-cache.service.mjs +1 -1
  35. package/esm2022/lib/services/base-tab.service.mjs +1 -1
  36. package/esm2022/lib/services/baseVisibility.service.mjs +1 -1
  37. package/esm2022/lib/services/content.service.mjs +1 -1
  38. package/esm2022/lib/services/filter.service.mjs +10 -3
  39. package/esm2022/lib/services/intervention.service.mjs +1 -1
  40. package/esm2022/lib/services/locale.service.mjs +1 -1
  41. package/esm2022/lib/services/matterport-import.service.mjs +1 -1
  42. package/esm2022/lib/services/matterport-measurement.service.mjs +1 -1
  43. package/esm2022/lib/services/matterport-navigation.service.mjs +1 -1
  44. package/esm2022/lib/services/matterport-object3d.service.mjs +1 -1
  45. package/esm2022/lib/services/matterport-pointer.service.mjs +6 -6
  46. package/esm2022/lib/services/matterport-tag-copy.service.mjs +1 -1
  47. package/esm2022/lib/services/matterport-tag.service.mjs +5 -1
  48. package/esm2022/lib/services/matterport.service.mjs +30 -25
  49. package/esm2022/lib/services/models/affectation.service.mjs +1 -1
  50. package/esm2022/lib/services/models/base-object.service.mjs +1 -1
  51. package/esm2022/lib/services/models/capture.service.mjs +1 -1
  52. package/esm2022/lib/services/models/comment.service.mjs +1 -1
  53. package/esm2022/lib/services/models/domain.service.mjs +1 -1
  54. package/esm2022/lib/services/models/equipment.service.mjs +51 -23
  55. package/esm2022/lib/services/models/event.service.mjs +1 -1
  56. package/esm2022/lib/services/models/feature.service.mjs +15 -1
  57. package/esm2022/lib/services/models/hashtag.service.mjs +1 -1
  58. package/esm2022/lib/services/models/inventory-storage.mjs +21 -0
  59. package/esm2022/lib/services/models/inventory.service.mjs +52 -5
  60. package/esm2022/lib/services/models/layer.service.mjs +1 -1
  61. package/esm2022/lib/services/models/measurement.service.mjs +7 -1
  62. package/esm2022/lib/services/models/mission.service.mjs +1 -1
  63. package/esm2022/lib/services/models/navigation.service.mjs +1 -1
  64. package/esm2022/lib/services/models/node.service.mjs +1 -1
  65. package/esm2022/lib/services/models/object3D.service.mjs +1 -1
  66. package/esm2022/lib/services/models/operation.service.mjs +19 -5
  67. package/esm2022/lib/services/models/organisation.service.mjs +1 -1
  68. package/esm2022/lib/services/models/plan.service.mjs +1 -1
  69. package/esm2022/lib/services/models/poi.service.mjs +27 -27
  70. package/esm2022/lib/services/models/profile.service.mjs +1 -1
  71. package/esm2022/lib/services/models/property.service.mjs +1 -1
  72. package/esm2022/lib/services/models/space.service.mjs +1 -1
  73. package/esm2022/lib/services/models/template.service.mjs +1 -1
  74. package/esm2022/lib/services/models/ticket.service.mjs +6 -1
  75. package/esm2022/lib/services/models/visit.service.mjs +1 -1
  76. package/esm2022/lib/services/models/zone.service.mjs +1 -1
  77. package/esm2022/lib/services/navigator.service.mjs +1 -1
  78. package/esm2022/lib/services/obj-to-glb.mjs +1 -1
  79. package/esm2022/lib/services/retry-when-throttled.mjs +31 -0
  80. package/esm2022/lib/services/s3.service.mjs +1 -1
  81. package/esm2022/lib/services/search.service.mjs +1 -1
  82. package/esm2022/lib/services/support.service.mjs +1 -1
  83. package/esm2022/lib/services/sweep-locator.service.mjs +1 -1
  84. package/esm2022/lib/services/tag.service.mjs +16 -16
  85. package/esm2022/lib/services/threejs-import.service.mjs +1 -1
  86. package/esm2022/lib/services/threejs.service.mjs +1 -1
  87. package/esm2022/lib/services/user.service.mjs +1 -1
  88. package/esm2022/lib/services/utils/matterport-framing.util.mjs +1 -1
  89. package/esm2022/lib/services/utils/matterport-transform.util.mjs +1 -1
  90. package/esm2022/lib/services/validators.service.mjs +1 -1
  91. package/esm2022/lib/services/viewer.service.mjs +3 -3
  92. package/esm2022/lib/services/zone-drawer.service.mjs +1 -1
  93. package/esm2022/lib/services/zoneChange.service.mjs +1 -1
  94. package/esm2022/lib/tokens/matterport-sdk-key.token.mjs +1 -1
  95. package/esm2022/lib/types.service.mjs +1 -1
  96. package/esm2022/lib/validators/email.directive.mjs +1 -1
  97. package/esm2022/lib/validators/no-empty.directive.mjs +1 -1
  98. package/esm2022/lib/validators/number.directive.mjs +1 -1
  99. package/esm2022/lib/validators/text.directive.mjs +1 -1
  100. package/esm2022/public-api.mjs +3 -1
  101. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +965 -246
  102. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
  103. package/lib/components/checkbox-slider/checkbox-slider.component.d.ts +16 -0
  104. package/lib/components/inventory-runs/inventory-files.component.d.ts +37 -8
  105. package/lib/components/inventory-runs/inventory-launch.component.d.ts +122 -0
  106. package/lib/components/inventory-runs/inventory-runs.component.d.ts +7 -0
  107. package/lib/ngx-smarterplan-core.module.d.ts +9 -7
  108. package/lib/services/matterport-tag.service.d.ts +2 -0
  109. package/lib/services/models/equipment.service.d.ts +16 -1
  110. package/lib/services/models/feature.service.d.ts +5 -0
  111. package/lib/services/models/inventory-storage.d.ts +9 -0
  112. package/lib/services/models/inventory.service.d.ts +14 -2
  113. package/lib/services/models/measurement.service.d.ts +2 -0
  114. package/lib/services/models/operation.service.d.ts +10 -0
  115. package/lib/services/models/ticket.service.d.ts +2 -0
  116. package/lib/services/retry-when-throttled.d.ts +5 -0
  117. package/package.json +1 -1
  118. package/public-api.d.ts +2 -0
  119. package/src/assets/viewers/splat/convert.html +11 -11
  120. package/src/assets/viewers/splat/index.html +90 -90
  121. package/src/assets/viewers/splat/webp.wasm +0 -0
  122. package/src/assets/vs-app.json +67 -67
@@ -775,30 +775,30 @@ class SecurityCamera extends SceneComponent {
775
775
  }
776
776
  }
777
777
  function vertexShader$1() {
778
- return `
779
- uniform mat4 lightMatrix;
780
-
781
- varying vec4 vLightCoords;
782
-
783
- void main() {
784
- // create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
785
- vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
786
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
787
- }
778
+ return `
779
+ uniform mat4 lightMatrix;
780
+
781
+ varying vec4 vLightCoords;
782
+
783
+ void main() {
784
+ // create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
785
+ vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
786
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
787
+ }
788
788
  `;
789
789
  }
790
790
  function fragmentShader$1() {
791
- return `
792
- uniform vec3 color;
793
-
794
- varying vec4 vLightCoords;
795
-
796
- void main() {
797
- vec2 lightUV = vLightCoords.xy / vLightCoords.w;
798
- float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
799
-
800
- gl_FragColor = vec4(color, min(inView, 0.2));
801
- }
791
+ return `
792
+ uniform vec3 color;
793
+
794
+ varying vec4 vLightCoords;
795
+
796
+ void main() {
797
+ vec2 lightUV = vLightCoords.xy / vLightCoords.w;
798
+ float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
799
+
800
+ gl_FragColor = vec4(color, min(inView, 0.2));
801
+ }
802
802
  `;
803
803
  }
804
804
  function updateHighlightUniforms$1(projector, uniforms) {
@@ -991,30 +991,30 @@ class ViewFrustumMesh extends SceneComponent {
991
991
  }
992
992
  }
993
993
  function vertexShader() {
994
- return `
995
- uniform mat4 lightMatrix;
996
-
997
- varying vec4 vLightCoords;
998
-
999
- void main() {
1000
- // create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
1001
- vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
1002
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1003
- }
994
+ return `
995
+ uniform mat4 lightMatrix;
996
+
997
+ varying vec4 vLightCoords;
998
+
999
+ void main() {
1000
+ // create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
1001
+ vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
1002
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1003
+ }
1004
1004
  `;
1005
1005
  }
1006
1006
  function fragmentShader() {
1007
- return `
1008
- uniform vec3 color;
1009
-
1010
- varying vec4 vLightCoords;
1011
-
1012
- void main() {
1013
- vec2 lightUV = vLightCoords.xy / vLightCoords.w;
1014
- float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
1015
-
1016
- gl_FragColor = vec4(color, min(inView, 0.2));
1017
- }
1007
+ return `
1008
+ uniform vec3 color;
1009
+
1010
+ varying vec4 vLightCoords;
1011
+
1012
+ void main() {
1013
+ vec2 lightUV = vLightCoords.xy / vLightCoords.w;
1014
+ float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
1015
+
1016
+ gl_FragColor = vec4(color, min(inView, 0.2));
1017
+ }
1018
1018
  `;
1019
1019
  }
1020
1020
  function updateHighlightUniforms(projector, uniforms) {
@@ -2242,32 +2242,32 @@ class PoiService {
2242
2242
  if (!sweeps || sweeps.length === 0) {
2243
2243
  return [];
2244
2244
  }
2245
- const queryStatement = `
2246
- query ListPOISLight($filter: ModelPOIFilterInput, $limit: Int, $nextToken: String) {
2247
- listPOIS(filter: $filter, limit: $limit, nextToken: $nextToken) {
2248
- items {
2249
- id
2250
- coordinate
2251
- specific
2252
- private
2253
- global
2254
- type
2255
- elementID
2256
- level
2257
- role
2258
- category
2259
- domainID
2260
- metadata
2261
- tagIcon
2262
- tagDescription
2263
- tagImageID
2264
- matterportSweepID
2265
- createdAt
2266
- updatedAt
2267
- }
2268
- nextToken
2269
- }
2270
- }
2245
+ const queryStatement = `
2246
+ query ListPOISLight($filter: ModelPOIFilterInput, $limit: Int, $nextToken: String) {
2247
+ listPOIS(filter: $filter, limit: $limit, nextToken: $nextToken) {
2248
+ items {
2249
+ id
2250
+ coordinate
2251
+ specific
2252
+ private
2253
+ global
2254
+ type
2255
+ elementID
2256
+ level
2257
+ role
2258
+ category
2259
+ domainID
2260
+ metadata
2261
+ tagIcon
2262
+ tagDescription
2263
+ tagImageID
2264
+ matterportSweepID
2265
+ createdAt
2266
+ updatedAt
2267
+ }
2268
+ nextToken
2269
+ }
2270
+ }
2271
2271
  `;
2272
2272
  const CHUNK_SIZE = 50; // safe margin for an "or" filter expression's practical size
2273
2273
  const chunks = [];
@@ -3135,11 +3135,11 @@ class MatterportPointerService {
3135
3135
  }
3136
3136
  updateCursorDisplay(poseMatterport) {
3137
3137
  if (this.textDisplayCursorPositionPanel && poseMatterport) {
3138
- this.textDisplayCursorPositionPanel.innerHTML = `position:
3139
- ${pointToString(poseMatterport.position)}\n
3140
- normal:
3141
- ${pointToString(poseMatterport.normal)}\n
3142
- floorId:
3138
+ this.textDisplayCursorPositionPanel.innerHTML = `position:
3139
+ ${pointToString(poseMatterport.position)}\n
3140
+ normal:
3141
+ ${pointToString(poseMatterport.normal)}\n
3142
+ floorId:
3143
3143
  ${poseMatterport.floorId}`;
3144
3144
  if (this.getCursorPositionButton) {
3145
3145
  this.getCursorPositionButton.style.display = 'none';
@@ -4382,6 +4382,10 @@ class MatterportTagService {
4382
4382
  getCachedTagIcon(tagId) {
4383
4383
  return this.tagsCurrentIcon.get(tagId);
4384
4384
  }
4385
+ /** Whether a tag can be opened, as updateTagsVisibilityForContext() last left it: yes until then. */
4386
+ isTagEnabled(tagId) {
4387
+ return this.tagsCurrentEnabled.get(tagId) ?? true;
4388
+ }
4385
4389
  /** Applies an icon to a tag through its own module and remembers it on success. */
4386
4390
  async editTagIcon(sdk, tagId, iconName) {
4387
4391
  await this.getTagModule(sdk, tagId).editIcon(tagId, iconName);
@@ -5393,14 +5397,15 @@ class MatterportService {
5393
5397
  console.warn('Cannot show details for tag', error);
5394
5398
  }
5395
5399
  };
5396
- // Disable native Matterport actions
5400
+ // Disable native Matterport actions. A tag hidden on another floor stays closed.
5397
5401
  const disableNativeActions = (sid) => {
5398
5402
  if (!this.sdk || sid === this.mattertagToFollow)
5399
5403
  return; // ignore when we are in positioning mode
5400
5404
  try {
5401
5405
  const tagModule = this.matterportTagService.getTagModule(this.sdk, sid);
5402
5406
  if (tagModule?.allowAction) {
5403
- tagModule.allowAction(sid, { opening: true, navigating: true, docking: false });
5407
+ const enabled = this.matterportTagService.isTagEnabled(sid);
5408
+ tagModule.allowAction(sid, { opening: enabled, navigating: enabled, docking: false });
5404
5409
  }
5405
5410
  }
5406
5411
  catch (e) {
@@ -5418,7 +5423,13 @@ class MatterportService {
5418
5423
  await this.matterportTagService.ensureSharedTagLayer(this.sdk);
5419
5424
  this.initViews();
5420
5425
  this.sdk.Camera.pose.subscribe((pose) => {
5426
+ // The pose changes on every frame the camera moves, while which tags show only
5427
+ // changes with the sweep (modes, floors and rooms have their own subscriptions):
5428
+ // going through every tag on each frame made models with many tags lag.
5429
+ const sweepChanged = pose?.sweep !== this.poseCamera?.sweep;
5421
5430
  this.poseCamera = pose;
5431
+ if (!sweepChanged)
5432
+ return;
5422
5433
  this.matterportTagService.updateTagsVisibilityForContext(this.sdk, this.sweepCollection, this.navigationService.currentCameraMode, this.mattertagToFollow, this.navigationService.currentFloorSequence, this.navigationService.currentRooms);
5423
5434
  });
5424
5435
  setTimeout(() => {
@@ -5427,17 +5438,15 @@ class MatterportService {
5427
5438
  if (this.interactionMode === ViewerInteractions.DEFAULT) {
5428
5439
  this.navigationService.action_toolbox_inside_view(this.sdk);
5429
5440
  }
5441
+ // Once per tag, when it appears. Not on every update: the SDK keeps each allowAction
5442
+ // in the tags' layer for good (it replays them on a change of view), and sending one
5443
+ // for every tag whenever any tag changed piled up tens of thousands of them in models
5444
+ // with many tags, which lagged even once loaded.
5430
5445
  if (this.sdk.Tag && this.sdk.Tag.data) {
5431
5446
  this.sdk.Tag.data.subscribe({
5432
5447
  onAdded: (sid) => {
5433
5448
  disableNativeActions(sid);
5434
5449
  },
5435
- onUpdated: (sid) => {
5436
- disableNativeActions(sid);
5437
- },
5438
- onCollectionUpdated: (collection) => {
5439
- Object.keys(collection).forEach((sid) => disableNativeActions(sid));
5440
- }
5441
5450
  });
5442
5451
  }
5443
5452
  resolve(true);
@@ -5846,22 +5855,22 @@ class MatterportService {
5846
5855
  );
5847
5856
  }*/
5848
5857
  addCustomCss() {
5849
- const css = `
5850
- .footer-ui,
5851
- .showcase-footer,
5852
- .mp-nova-btn-group,
5853
- .footer-divider,
5854
- .logo-link,
5855
- .footer-logo,
5856
- .bottom-ui,
5857
- img.logo-image,
5858
- img[class^="logo-image"],
5859
- img[class*=" logo-image"],
5860
- [data-testid="showcase-footer"] {
5861
- opacity: 0 !important;
5862
- visibility: hidden !important;
5863
- pointer-events: none !important;
5864
- }
5858
+ const css = `
5859
+ .footer-ui,
5860
+ .showcase-footer,
5861
+ .mp-nova-btn-group,
5862
+ .footer-divider,
5863
+ .logo-link,
5864
+ .footer-logo,
5865
+ .bottom-ui,
5866
+ img.logo-image,
5867
+ img[class^="logo-image"],
5868
+ img[class*=" logo-image"],
5869
+ [data-testid="showcase-footer"] {
5870
+ opacity: 0 !important;
5871
+ visibility: hidden !important;
5872
+ pointer-events: none !important;
5873
+ }
5865
5874
  `;
5866
5875
  // 1st method: Via Scene SDK
5867
5876
  if (this.sdk?.Scene?.addStyle) {
@@ -10624,8 +10633,8 @@ class ViewerService {
10624
10633
  await new Promise((resolve) => setTimeout(resolve));
10625
10634
  }
10626
10635
  // Newly created tags have no opacity/allowAction applied yet (only set by
10627
- // updateTagsVisibilityForContext, which runs on Mode/Sweep/Floor/Room/Camera
10628
- // events). If this batch loaded after those fired, the tags stay in whatever
10636
+ // updateTagsVisibilityForContext, which runs on Mode/Sweep/Floor/Room events and
10637
+ // when the camera changes sweep). If this batch loaded after those fired, the tags stay in whatever
10629
10638
  // default state the SDK gave them until something else nudges a refresh.
10630
10639
  if (this.checkMode('Matterport')) {
10631
10640
  this.matterportService.refreshTagsVisibility();
@@ -11594,11 +11603,11 @@ class ModalSwitchVisitComponent {
11594
11603
  });
11595
11604
  }
11596
11605
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalSwitchVisitComponent, deps: [{ token: i1$2.NgbActiveModal }, { token: i1.Router }, { token: ViewerService }], target: i0.ɵɵFactoryTarget.Component });
11597
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ModalSwitchVisitComponent, selector: "lib-modal-switch-visit", inputs: { content: "content", model3D: "model3D", spaceID: "spaceID", dataToMove: "dataToMove" }, ngImport: i0, template: "<div class=\"modal-container\">\r\n <p>{{content}}</p>\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\r\n</div>\r\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
11606
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ModalSwitchVisitComponent, selector: "lib-modal-switch-visit", inputs: { content: "content", model3D: "model3D", spaceID: "spaceID", dataToMove: "dataToMove" }, ngImport: i0, template: "<div class=\"modal-container\">\n <p>{{content}}</p>\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\n</div>\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
11598
11607
  }
11599
11608
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalSwitchVisitComponent, decorators: [{
11600
11609
  type: Component,
11601
- args: [{ selector: 'lib-modal-switch-visit', template: "<div class=\"modal-container\">\r\n <p>{{content}}</p>\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\r\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\r\n</div>\r\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"] }]
11610
+ args: [{ selector: 'lib-modal-switch-visit', template: "<div class=\"modal-container\">\n <p>{{content}}</p>\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"switchVisit()\">{{'Yes, switch visit' | translate }}</button>\n <button class=\"btn btn-outline-primary rounded-pill\"(click)=\"activeModal.close()\">{{'No, stay here' | translate }}</button>\n</div>\n", styles: [".modal-container{margin:10px}button{margin-right:8px}\n"] }]
11602
11611
  }], ctorParameters: () => [{ type: i1$2.NgbActiveModal }, { type: i1.Router }, { type: ViewerService }], propDecorators: { content: [{
11603
11612
  type: Input
11604
11613
  }], model3D: [{
@@ -12219,11 +12228,11 @@ class CsvExportComponent {
12219
12228
  link.remove();
12220
12229
  }
12221
12230
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CsvExportComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12222
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CsvExportComponent, selector: "lib-csv-export", inputs: { headers: "headers", rowsInput: "rowsInput", getRows: "getRows", title: "title", buttonLabel: "buttonLabel" }, ngImport: i0, template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\r\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\r\n {{ buttonLabel | translate}}\r\n</span>\r\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"], dependencies: [{ kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
12231
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CsvExportComponent, selector: "lib-csv-export", inputs: { headers: "headers", rowsInput: "rowsInput", getRows: "getRows", title: "title", buttonLabel: "buttonLabel" }, ngImport: i0, template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\n {{ buttonLabel | translate}}\n</span>\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"], dependencies: [{ kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
12223
12232
  }
12224
12233
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CsvExportComponent, decorators: [{
12225
12234
  type: Component,
12226
- args: [{ selector: 'lib-csv-export', template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\r\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\r\n {{ buttonLabel | translate}}\r\n</span>\r\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"] }]
12235
+ args: [{ selector: 'lib-csv-export', template: "<span [style.cursor]=\"'pointer'\" (click)=\"onClickDownload()\" class=\"download-csv d-flex\">\n <span class=\"iconify\" [icIcon]=\"fileDownloadIcon\"></span>\n {{ buttonLabel | translate}}\n</span>\n", styles: [".download-csv{color:var(--smarterplan-primary)}\n"] }]
12227
12236
  }], propDecorators: { headers: [{
12228
12237
  type: Input
12229
12238
  }], rowsInput: [{
@@ -12441,6 +12450,9 @@ class FilterService {
12441
12450
  async filterObjectsForZone(objects, // TODO: remove any here..
12442
12451
  zoneID = null, zone = null) {
12443
12452
  const filteredObjects = [];
12453
+ // Each space's zones, fetched once for all its objects: looking up the zones of each
12454
+ // object fetched them all again, a request per object.
12455
+ const zonesPerSpace = new Map();
12444
12456
  await Promise.all(objects.map(async (object) => {
12445
12457
  const pois = object.pois;
12446
12458
  if (pois) {
@@ -12471,8 +12483,12 @@ class FilterService {
12471
12483
  }
12472
12484
  }
12473
12485
  }
12474
- if (poi && !zone && zoneID) {
12475
- const zones = await this.zoneService.getZonesForObject(object);
12486
+ if (poi && !zone && zoneID && poi.matterportSweepID) {
12487
+ if (!zonesPerSpace.has(object.spaceID)) {
12488
+ zonesPerSpace.set(object.spaceID, this.zoneService.getZonesBySpace(object.spaceID));
12489
+ }
12490
+ const zones = (await zonesPerSpace.get(object.spaceID)).filter((zone_) => zone_.sweepIDs &&
12491
+ zone_.sweepIDs.includes(poi.matterportSweepID));
12476
12492
  if (zones &&
12477
12493
  zones.some((zone_) => zone_.id === zoneID ||
12478
12494
  zone_.parentID === zoneID)) {
@@ -14287,6 +14303,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
14287
14303
  }]
14288
14304
  }], ctorParameters: () => [{ type: PoiService }, { type: NavigationService }, { type: VisitService }] });
14289
14305
 
14306
+ /**
14307
+ * What the API says when it refuses a request for coming too fast, in an Error or in the errors of a
14308
+ * GraphQL answer: the request was not done, and can be sent again a little later.
14309
+ */
14310
+ const THROTTLED = /rate exceeded|throttl|too many requests|status code 429|throughput exceeds|provisionedthroughputexceeded|requestlimitexceeded/i;
14311
+ function isThrottled(error) {
14312
+ const texts = [
14313
+ error?.message,
14314
+ error?.name,
14315
+ error?.code,
14316
+ ...(Array.isArray(error?.errors) ? error.errors : []).flatMap((e) => [e?.message, e?.errorType]),
14317
+ ];
14318
+ return texts.some((text) => typeof text === "string" && THROTTLED.test(text));
14319
+ }
14320
+ /** How long to wait before each new try, give or take half, so that requests do not come back together. */
14321
+ const THROTTLED_WAITS_MS = [500, 1000, 2000, 4000];
14322
+ /** Sends the request again, a little later each time, while the API refuses it for coming too fast. */
14323
+ async function retryWhenThrottled(request, waitsMs = THROTTLED_WAITS_MS) {
14324
+ for (let attempt = 0;; attempt++) {
14325
+ try {
14326
+ return await request();
14327
+ }
14328
+ catch (error) {
14329
+ if (attempt >= waitsMs.length || !isThrottled(error)) {
14330
+ throw error;
14331
+ }
14332
+ await new Promise((resolve) => setTimeout(resolve, waitsMs[attempt] * (0.5 + Math.random())));
14333
+ }
14334
+ }
14335
+ }
14336
+
14290
14337
  class OperationService {
14291
14338
  API; //AWS
14292
14339
  /** Equipments linked to a ticket in this session: their loaded `operations` may be outdated. */
@@ -14305,16 +14352,30 @@ class OperationService {
14305
14352
  const tickets = operations.map((operation) => operation.ticket);
14306
14353
  return tickets;
14307
14354
  }
14308
- /** Tickets of a loaded equipment, without a request when its list query shows it has no operation. */
14309
- async getTicketsForEquipment(equip) {
14355
+ /** Whether a loaded equipment's list query shows it has no operation, none linked since. */
14356
+ loadedWithoutOperations(equip) {
14310
14357
  const operations = equip.operations;
14311
- if (operations?.items?.length === 0
14358
+ return operations?.items?.length === 0
14312
14359
  && !operations.nextToken
14313
- && !this.linkedEquipmentIDs.has(equip.id)) {
14360
+ && !this.linkedEquipmentIDs.has(equip.id);
14361
+ }
14362
+ /** Tickets of a loaded equipment, without a request when its list query shows it has no operation. */
14363
+ async getTicketsForEquipment(equip) {
14364
+ if (this.loadedWithoutOperations(equip)) {
14314
14365
  return [];
14315
14366
  }
14316
14367
  return this.getTicketsByEquipmentID(equip.id);
14317
14368
  }
14369
+ /**
14370
+ * Deletes a loaded equipment's operations, without a request when its list query shows it has
14371
+ * none: for an equipment loaded just before, as one loaded long ago may have some since.
14372
+ */
14373
+ async deleteOperationsForLoadedEquipment(equip) {
14374
+ if (this.loadedWithoutOperations(equip)) {
14375
+ return [];
14376
+ }
14377
+ return this.deleteOperationsForEquipment(equip.id);
14378
+ }
14318
14379
  async deleteOperationsForEquipment(equipID) {
14319
14380
  const deleted = [];
14320
14381
  await this.getOperationsByEquipmentID(equipID)
@@ -15037,6 +15098,8 @@ class TicketsService extends BaseObjectService {
15037
15098
  space: [],
15038
15099
  };
15039
15100
  ticketTags = new BehaviorSubject(null);
15101
+ /** The space's tickets the user sees, whatever ticketTypeFilter hides, for a filter to count them. Null until known. */
15102
+ ticketsUnfiltered = new BehaviorSubject(null);
15040
15103
  ticketsFiltered = [];
15041
15104
  ticketsUpdated = new Subject();
15042
15105
  currentSpaceID;
@@ -15113,6 +15176,7 @@ class TicketsService extends BaseObjectService {
15113
15176
  if (this.dateFilter && this.dateFilter[0] != "Invalid Date" && this.dateFilter[1] != "Invalid Date") {
15114
15177
  ticketsFiltered = this.filterService.filterObjectsForDateRange(ticketsFiltered, this.dateFilter);
15115
15178
  }
15179
+ this.ticketsUnfiltered.next(ticketsFiltered);
15116
15180
  if (this.ticketTypeFilter) {
15117
15181
  ticketsFiltered = ticketsFiltered.filter((ticket) => this.ticketTypeFilter.includes(ticket.type));
15118
15182
  }
@@ -15502,6 +15566,7 @@ class TicketsService extends BaseObjectService {
15502
15566
  this.currentSpaceID = this.navigatorService.currentSpaceID;
15503
15567
  if (!this.currentSpaceID) {
15504
15568
  this.ticketTags.next(null);
15569
+ this.ticketsUnfiltered.next(null);
15505
15570
  this.ticketsUpdated.next({ space: [], zone: null });
15506
15571
  this.ticketTypeFilter = null;
15507
15572
  this.zoneIDFilter = null;
@@ -15521,6 +15586,7 @@ class TicketsService extends BaseObjectService {
15521
15586
  this.zoneIDFilter = null;
15522
15587
  if (!spaceID) {
15523
15588
  this.ticketTags.next(null);
15589
+ this.ticketsUnfiltered.next(null);
15524
15590
  this.ticketsUpdated.next({ space: [], zone: null });
15525
15591
  this.ticketTypeFilter = null;
15526
15592
  return;
@@ -15581,6 +15647,11 @@ class EquipmentService extends BaseObjectService {
15581
15647
  zonesMap: new Map(),
15582
15648
  };
15583
15649
  equipmentsTags = new BehaviorSubject(null);
15650
+ /**
15651
+ * The space's equipment the user sees, whatever equipmentDomainFilter hides: what a domain
15652
+ * filter has to offer, and how many of each. Null until they are known.
15653
+ */
15654
+ equipmentsUnfiltered = new BehaviorSubject(null);
15584
15655
  zoneIDFilter;
15585
15656
  currentZone;
15586
15657
  currentSpaceID;
@@ -15896,29 +15967,35 @@ class EquipmentService extends BaseObjectService {
15896
15967
  return null;
15897
15968
  });
15898
15969
  }
15899
- async deleteEquipment(equip) {
15900
- const deleted = await this.API.__proto__.DeleteEquipment({ id: equip.id });
15901
- console.log('Deleted equipment', deleted);
15902
- // delete POI
15903
- const [poi] = equip.pois.items;
15904
- if (poi) {
15905
- await this.poiService.deletePoi(poi.id);
15906
- }
15907
- // delete notes related
15908
- if (equip.notes.items.length > 0) {
15909
- await Promise.all(equip.notes.items.map(async (note) => {
15910
- // delete files from S3
15911
- /** Not shared with other equipment */
15912
- if (note.attachment &&
15913
- !note.attachment.split('/').pop().startsWith('BATCH_')) {
15914
- await deleteFromS3(note.attachment);
15915
- }
15916
- await this.API.__proto__.DeleteNote({ id: note.id });
15917
- }));
15970
+ /**
15971
+ * Deletes an equipment with what hangs on it: every one of its POIs (its tags in the visits), its
15972
+ * notes and their files, its operations. Those go first: when one of them fails, the equipment is
15973
+ * still there to be deleted again, instead of tags left pointing at an equipment that is gone.
15974
+ * A request the API refuses for coming too fast is sent again a little later. justLoaded: the
15975
+ * equipment comes from a list loaded just before, whose operations can be trusted, so none there
15976
+ * means no request for them.
15977
+ */
15978
+ async deleteEquipment(equip, justLoaded = false) {
15979
+ for (const poi of equip.pois?.items ?? []) {
15980
+ if (poi) {
15981
+ await retryWhenThrottled(() => this.poiService.deletePoi(poi.id));
15982
+ }
15918
15983
  }
15919
- // delete operations (remove from linked tickets)
15920
- await this.operationService.deleteOperationsForEquipment(equip.id);
15921
- return deleted;
15984
+ await Promise.all((equip.notes?.items ?? [])
15985
+ .filter((note) => !!note)
15986
+ .map(async (note) => {
15987
+ // Its file, unless a batch edit shares it with other equipment.
15988
+ if (note.attachment &&
15989
+ !note.attachment.split('/').pop().startsWith('BATCH_')) {
15990
+ await deleteFromS3(note.attachment);
15991
+ }
15992
+ await retryWhenThrottled(() => this.API.__proto__.DeleteNote({ id: note.id }));
15993
+ }));
15994
+ // Its operations, which also takes it off the tickets linked to it.
15995
+ await retryWhenThrottled(() => justLoaded
15996
+ ? this.operationService.deleteOperationsForLoadedEquipment(equip)
15997
+ : this.operationService.deleteOperationsForEquipment(equip.id));
15998
+ return retryWhenThrottled(() => this.API.__proto__.DeleteEquipment({ id: equip.id }));
15922
15999
  }
15923
16000
  async updateEquipmentLocation(equip, tagData) {
15924
16001
  const poiInput = {
@@ -15963,6 +16040,7 @@ class EquipmentService extends BaseObjectService {
15963
16040
  equip.documentationImageUrlSigned =
15964
16041
  await getSignedImageUrlForEquipment(equip);
15965
16042
  }));
16043
+ this.equipmentsUnfiltered.next(filteredEquips);
15966
16044
  if (this.equipmentDomainFilter) {
15967
16045
  filteredEquips = this.filterService.filterEquipmentsByDomainList(filteredEquips, this.equipmentDomainFilter);
15968
16046
  }
@@ -15978,6 +16056,7 @@ class EquipmentService extends BaseObjectService {
15978
16056
  }); // for lateral menu
15979
16057
  }
15980
16058
  else {
16059
+ this.equipmentsUnfiltered.next([]);
15981
16060
  if (this.zoneIDFilter) {
15982
16061
  this.currentEquipments.zonesMap.set(this.zoneIDFilter, []);
15983
16062
  }
@@ -16126,13 +16205,21 @@ class EquipmentService extends BaseObjectService {
16126
16205
  this.currentEquipments.zonesMap.get(zone).splice(index, 1);
16127
16206
  }
16128
16207
  }
16208
+ this.updateUnfiltered((equips) => equips.filter((_equip) => _equip.id !== deletedEquipment.id));
16129
16209
  this.equipmentsUpdated.next({
16130
16210
  space: this.currentEquipments.space,
16131
16211
  zone: this.currentEquipments.zonesMap.get(this.zoneIDFilter),
16132
16212
  }); // for lateral menu
16133
16213
  }
16214
+ /** Keeps equipmentsUnfiltered up to date with an equipment created, changed or deleted. */
16215
+ updateUnfiltered(change) {
16216
+ if (this.equipmentsUnfiltered.value) {
16217
+ this.equipmentsUnfiltered.next(change(this.equipmentsUnfiltered.value));
16218
+ }
16219
+ }
16134
16220
  updateDueToCreate(createdEquip) {
16135
16221
  this.currentEquipments.space.unshift(createdEquip);
16222
+ this.updateUnfiltered((equips) => [createdEquip, ...equips]);
16136
16223
  // initEquips only records a zone's list when it has a zone or found equipments, so the first
16137
16224
  // equipment of a space viewed without zones (Three.js) arrives with no list to join.
16138
16225
  if (!this.currentEquipments.zonesMap.has(this.zoneIDFilter)) {
@@ -16147,6 +16234,9 @@ class EquipmentService extends BaseObjectService {
16147
16234
  }); // for lateral menu
16148
16235
  }
16149
16236
  updateDueToEquipUpdated(updatedEquip) {
16237
+ this.updateUnfiltered((equips) => this.isArchived(updatedEquip)
16238
+ ? equips.filter((_equip) => _equip.id !== updatedEquip.id)
16239
+ : equips.map((_equip) => (_equip.id === updatedEquip.id ? updatedEquip : _equip)));
16150
16240
  const equip = this.currentEquipments.space.find((_equip) => _equip.id === updatedEquip.id);
16151
16241
  if (equip) {
16152
16242
  const index = this.currentEquipments.space.indexOf(equip);
@@ -16191,6 +16281,7 @@ class EquipmentService extends BaseObjectService {
16191
16281
  if (!zone || !this.navigatorService.currentSpaceID) {
16192
16282
  this.currentSpaceID = this.navigatorService.currentSpaceID;
16193
16283
  this.equipmentsTags.next(null);
16284
+ this.equipmentsUnfiltered.next(null);
16194
16285
  this.equipmentsUpdated.next({ space: [], zone: null });
16195
16286
  this.zoneIDFilter = null;
16196
16287
  this.currentEquipments = {
@@ -16207,6 +16298,7 @@ class EquipmentService extends BaseObjectService {
16207
16298
  }
16208
16299
  else {
16209
16300
  this.currentSpaceID = this.navigatorService.currentSpaceID;
16301
+ this.equipmentsUnfiltered.next(null);
16210
16302
  this.initEquips();
16211
16303
  }
16212
16304
  }
@@ -16224,6 +16316,7 @@ class EquipmentService extends BaseObjectService {
16224
16316
  space: [],
16225
16317
  zonesMap: new Map(),
16226
16318
  };
16319
+ this.equipmentsUnfiltered.next(null);
16227
16320
  if (!spaceID) {
16228
16321
  this.equipmentsTags.next(null);
16229
16322
  this.equipmentsUpdated.next({ space: [], zone: null });
@@ -16445,11 +16538,11 @@ class SearchBarComponent {
16445
16538
  this.searchEvent.emit(results);
16446
16539
  }
16447
16540
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchBarComponent, deps: [{ token: SearchService }], target: i0.ɵɵFactoryTarget.Component });
16448
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchBarComponent, selector: "lib-search-bar", inputs: { searchable: "searchable", objectType: "objectType" }, outputs: { searchEvent: "searchEvent" }, ngImport: i0, template: "<div class=\"col-md-8 searchbar\">\r\n <div class=\"row depend\">\r\n <div class=\"col-md-5\">\r\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\r\n </div>\r\n <div class=\"col-md-5\">\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n</div>", styles: [".searchbar{margin-bottom:10px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
16541
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SearchBarComponent, selector: "lib-search-bar", inputs: { searchable: "searchable", objectType: "objectType" }, outputs: { searchEvent: "searchEvent" }, ngImport: i0, template: "<div class=\"col-md-8 searchbar\">\n <div class=\"row depend\">\n <div class=\"col-md-5\">\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\n </div>\n <div class=\"col-md-5\">\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\n translate}}</button>\n </div>\n </div>\n</div>", styles: [".searchbar{margin-bottom:10px}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
16449
16542
  }
16450
16543
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchBarComponent, decorators: [{
16451
16544
  type: Component,
16452
- args: [{ selector: 'lib-search-bar', template: "<div class=\"col-md-8 searchbar\">\r\n <div class=\"row depend\">\r\n <div class=\"col-md-5\">\r\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\r\n </div>\r\n <div class=\"col-md-5\">\r\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n</div>", styles: [".searchbar{margin-bottom:10px}\n"] }]
16545
+ args: [{ selector: 'lib-search-bar', template: "<div class=\"col-md-8 searchbar\">\n <div class=\"row depend\">\n <div class=\"col-md-5\">\n <input id=\"searchbar\" type=\"text\" class=\"form-control\" placeholder=\"keyword\" />\n </div>\n <div class=\"col-md-5\">\n <button class=\"btn btn-outline-primary rounded-pill\" (click)=\"onSubmit()\">{{ 'Search' |\n translate}}</button>\n </div>\n </div>\n</div>", styles: [".searchbar{margin-bottom:10px}\n"] }]
16453
16546
  }], ctorParameters: () => [{ type: SearchService }], propDecorators: { searchable: [{
16454
16547
  type: Input
16455
16548
  }], objectType: [{
@@ -16897,11 +16990,11 @@ class LoaderComponent {
16897
16990
  document.documentElement.style.setProperty('--color', this.color);
16898
16991
  }
16899
16992
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16900
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LoaderComponent, selector: "lib-loader", inputs: { useLogo: "useLogo", color: "color" }, ngImport: i0, template: "<div class=\"sk-fading-circle\">\r\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\r\n <div class=\"sk-circle1 sk-circle\"></div>\r\n <div class=\"sk-circle2 sk-circle\"></div>\r\n <div class=\"sk-circle3 sk-circle\"></div>\r\n <div class=\"sk-circle4 sk-circle\"></div>\r\n <div class=\"sk-circle5 sk-circle\"></div>\r\n <div class=\"sk-circle6 sk-circle\"></div>\r\n <div class=\"sk-circle7 sk-circle\"></div>\r\n <div class=\"sk-circle8 sk-circle\"></div>\r\n <div class=\"sk-circle9 sk-circle\"></div>\r\n <div class=\"sk-circle10 sk-circle\"></div>\r\n <div class=\"sk-circle11 sk-circle\"></div>\r\n <div class=\"sk-circle12 sk-circle\"></div>\r\n</div>\r\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
16993
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LoaderComponent, selector: "lib-loader", inputs: { useLogo: "useLogo", color: "color" }, ngImport: i0, template: "<div class=\"sk-fading-circle\">\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\n <div class=\"sk-circle1 sk-circle\"></div>\n <div class=\"sk-circle2 sk-circle\"></div>\n <div class=\"sk-circle3 sk-circle\"></div>\n <div class=\"sk-circle4 sk-circle\"></div>\n <div class=\"sk-circle5 sk-circle\"></div>\n <div class=\"sk-circle6 sk-circle\"></div>\n <div class=\"sk-circle7 sk-circle\"></div>\n <div class=\"sk-circle8 sk-circle\"></div>\n <div class=\"sk-circle9 sk-circle\"></div>\n <div class=\"sk-circle10 sk-circle\"></div>\n <div class=\"sk-circle11 sk-circle\"></div>\n <div class=\"sk-circle12 sk-circle\"></div>\n</div>\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
16901
16994
  }
16902
16995
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
16903
16996
  type: Component,
16904
- args: [{ selector: 'lib-loader', template: "<div class=\"sk-fading-circle\">\r\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\r\n <div class=\"sk-circle1 sk-circle\"></div>\r\n <div class=\"sk-circle2 sk-circle\"></div>\r\n <div class=\"sk-circle3 sk-circle\"></div>\r\n <div class=\"sk-circle4 sk-circle\"></div>\r\n <div class=\"sk-circle5 sk-circle\"></div>\r\n <div class=\"sk-circle6 sk-circle\"></div>\r\n <div class=\"sk-circle7 sk-circle\"></div>\r\n <div class=\"sk-circle8 sk-circle\"></div>\r\n <div class=\"sk-circle9 sk-circle\"></div>\r\n <div class=\"sk-circle10 sk-circle\"></div>\r\n <div class=\"sk-circle11 sk-circle\"></div>\r\n <div class=\"sk-circle12 sk-circle\"></div>\r\n</div>\r\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"] }]
16997
+ args: [{ selector: 'lib-loader', template: "<div class=\"sk-fading-circle\">\n <img *ngIf=\"useLogo\" src=\"../../../../assets/icons/smarterplan.svg\">\n <div class=\"sk-circle1 sk-circle\"></div>\n <div class=\"sk-circle2 sk-circle\"></div>\n <div class=\"sk-circle3 sk-circle\"></div>\n <div class=\"sk-circle4 sk-circle\"></div>\n <div class=\"sk-circle5 sk-circle\"></div>\n <div class=\"sk-circle6 sk-circle\"></div>\n <div class=\"sk-circle7 sk-circle\"></div>\n <div class=\"sk-circle8 sk-circle\"></div>\n <div class=\"sk-circle9 sk-circle\"></div>\n <div class=\"sk-circle10 sk-circle\"></div>\n <div class=\"sk-circle11 sk-circle\"></div>\n <div class=\"sk-circle12 sk-circle\"></div>\n</div>\n", styles: [".sk-fading-circle{width:88px;height:88px;position:relative}.sk-fading-circle img{width:2rem;position:absolute;left:calc(50% - 16px);top:calc(50% - 16px)}.sk-fading-circle .sk-circle{width:100%;height:100%;position:absolute;left:0;top:0}.sk-fading-circle .sk-circle:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;background-color:var(--color);border-radius:100%;-webkit-animation:sk-circleFadeDelay 1.2s infinite ease-in-out both;animation:sk-circleFadeDelay 1.2s infinite ease-in-out both}.sk-fading-circle .sk-circle2{-webkit-transform:rotate(30deg);-ms-transform:rotate(30deg);transform:rotate(30deg)}.sk-fading-circle .sk-circle3{-webkit-transform:rotate(60deg);-ms-transform:rotate(60deg);transform:rotate(60deg)}.sk-fading-circle .sk-circle4{-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.sk-fading-circle .sk-circle5{-webkit-transform:rotate(120deg);-ms-transform:rotate(120deg);transform:rotate(120deg)}.sk-fading-circle .sk-circle6{-webkit-transform:rotate(150deg);-ms-transform:rotate(150deg);transform:rotate(150deg)}.sk-fading-circle .sk-circle7{-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.sk-fading-circle .sk-circle8{-webkit-transform:rotate(210deg);-ms-transform:rotate(210deg);transform:rotate(210deg)}.sk-fading-circle .sk-circle9{-webkit-transform:rotate(240deg);-ms-transform:rotate(240deg);transform:rotate(240deg)}.sk-fading-circle .sk-circle10{-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.sk-fading-circle .sk-circle11{-webkit-transform:rotate(300deg);-ms-transform:rotate(300deg);transform:rotate(300deg)}.sk-fading-circle .sk-circle12{-webkit-transform:rotate(330deg);-ms-transform:rotate(330deg);transform:rotate(330deg)}.sk-fading-circle .sk-circle2:before{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.sk-fading-circle .sk-circle3:before{-webkit-animation-delay:-1s;animation-delay:-1s}.sk-fading-circle .sk-circle4:before{-webkit-animation-delay:-.9s;animation-delay:-.9s}.sk-fading-circle .sk-circle5:before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.sk-fading-circle .sk-circle6:before{-webkit-animation-delay:-.7s;animation-delay:-.7s}.sk-fading-circle .sk-circle7:before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.sk-fading-circle .sk-circle8:before{-webkit-animation-delay:-.5s;animation-delay:-.5s}.sk-fading-circle .sk-circle9:before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.sk-fading-circle .sk-circle10:before{-webkit-animation-delay:-.3s;animation-delay:-.3s}.sk-fading-circle .sk-circle11:before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.sk-fading-circle .sk-circle12:before{-webkit-animation-delay:-.1s;animation-delay:-.1s}@-webkit-keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}@keyframes sk-circleFadeDelay{0%,39%,to{opacity:0}40%{opacity:1}}\n"] }]
16905
16998
  }], ctorParameters: () => [], propDecorators: { useLogo: [{
16906
16999
  type: Input
16907
17000
  }], color: [{
@@ -16959,11 +17052,11 @@ class SupportModalComponent {
16959
17052
  }
16960
17053
  }
16961
17054
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SupportModalComponent, deps: [{ token: SupportService }, { token: i1$2.NgbActiveModal }, { token: i3.UntypedFormBuilder }, { token: BaseUserService }, { token: ValidatorsService }], target: i0.ɵɵFactoryTarget.Component });
16962
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SupportModalComponent, selector: "app-support-modal", ngImport: i0, template: "<div class=\"modal-header\">\r\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\r\n</div>\r\n<div class=\"modal-body\">\r\n <div class=\"support-loader-container\">\r\n <lib-loader *ngIf=\"loading\"></lib-loader>\r\n </div>\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\r\n <div>\r\n <label>{{'Title' | translate}} *</label>\r\n <div>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!currentUser\">\r\n <label>{{'Email' | translate}} *</label>\r\n <div>\r\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\r\n </div>\r\n </div>\r\n <div>\r\n <label>{{'Description' | translate}} *</label>\r\n <div>\r\n <textarea formControlName=\"description\" class=\"form-control\"\r\n data-testid=\"new-support-description\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\r\n </div>\r\n <div class=\"invalid-feedback\" >\r\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\r\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\r\n </div>\r\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\r\n data-testid=\"new-support-error-info\">\r\n\r\n </div>\r\n</div>\r\n<div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\r\n data-testid=\"new-support-close-btn\"></button>\r\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\r\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\r\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
17055
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: SupportModalComponent, selector: "app-support-modal", ngImport: i0, template: "<div class=\"modal-header\">\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\n</div>\n<div class=\"modal-body\">\n <div class=\"support-loader-container\">\n <lib-loader *ngIf=\"loading\"></lib-loader>\n </div>\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\n <div>\n <label>{{'Title' | translate}} *</label>\n <div>\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\n </div>\n </div>\n <div *ngIf=\"!currentUser\">\n <label>{{'Email' | translate}} *</label>\n <div>\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\n </div>\n </div>\n <div>\n <label>{{'Description' | translate}} *</label>\n <div>\n <textarea formControlName=\"description\" class=\"form-control\"\n data-testid=\"new-support-description\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\n </div>\n <div class=\"invalid-feedback\" >\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\n </div>\n </div>\n </form>\n\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\n </div>\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\n data-testid=\"new-support-error-info\">\n\n </div>\n</div>\n<div class=\"modal-footer\">\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\n data-testid=\"new-support-close-btn\"></button>\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.TranslateDirective, selector: "[translate],[ngx-translate]", inputs: ["translate", "translateParams"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
16963
17056
  }
16964
17057
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SupportModalComponent, decorators: [{
16965
17058
  type: Component,
16966
- args: [{ selector: 'app-support-modal', template: "<div class=\"modal-header\">\r\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\r\n</div>\r\n<div class=\"modal-body\">\r\n <div class=\"support-loader-container\">\r\n <lib-loader *ngIf=\"loading\"></lib-loader>\r\n </div>\r\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\r\n <div>\r\n <label>{{'Title' | translate}} *</label>\r\n <div>\r\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!currentUser\">\r\n <label>{{'Email' | translate}} *</label>\r\n <div>\r\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\r\n maxlength=\"255\">\r\n </div>\r\n <div class=\"invalid-feedback\">\r\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\r\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\r\n </div>\r\n </div>\r\n <div>\r\n <label>{{'Description' | translate}} *</label>\r\n <div>\r\n <textarea formControlName=\"description\" class=\"form-control\"\r\n data-testid=\"new-support-description\"\r\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\r\n </div>\r\n <div class=\"invalid-feedback\" >\r\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\r\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\r\n </div>\r\n </div>\r\n </form>\r\n\r\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\r\n </div>\r\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\r\n data-testid=\"new-support-error-info\">\r\n\r\n </div>\r\n</div>\r\n<div class=\"modal-footer\">\r\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\r\n data-testid=\"new-support-close-btn\"></button>\r\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\r\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\r\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"] }]
17059
+ args: [{ selector: 'app-support-modal', template: "<div class=\"modal-header\">\n <h5 class=\"modal-title\" translate=\"Help\"></h5>\n</div>\n<div class=\"modal-body\">\n <div class=\"support-loader-container\">\n <lib-loader *ngIf=\"loading\"></lib-loader>\n </div>\n <form (ngSubmit)=\"onSubmit()\" [formGroup]=\"supportForm\" style=\"margin-top:1rem;\" *ngIf=\"!loading && status==='new'\">\n <div>\n <label>{{'Title' | translate}} *</label>\n <div>\n <input type=\"text\" class=\"form-control\" formControlName=\"title\" data-testid=\"new-support-title\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['title'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-title-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['title'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['title'])\"></span>\n </div>\n </div>\n <div *ngIf=\"!currentUser\">\n <label>{{'Email' | translate}} *</label>\n <div>\n <input type=\"email\" class=\"form-control\" formControlName=\"email\" data-testid=\"new-support-email\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['email'])}\"\n maxlength=\"255\">\n </div>\n <div class=\"invalid-feedback\">\n <span data-testid=\"new-support-email-invalid\" [translate]=\"validatorsService.getError(supportForm.controls['email'])\"\n *ngIf=\" validatorsService.isControlError(supportForm.controls['email'])\"></span>\n </div>\n </div>\n <div>\n <label>{{'Description' | translate}} *</label>\n <div>\n <textarea formControlName=\"description\" class=\"form-control\"\n data-testid=\"new-support-description\"\n [ngClass]=\"{'is-invalid' : validatorsService.isControlError(supportForm.controls['description'])}\"></textarea>\n </div>\n <div class=\"invalid-feedback\" >\n <span data-testid=\"new-support-description-invalid\" [translate]=\" validatorsService.getError(supportForm.controls['description'])\"\n *ngIf=\"validatorsService.isControlError(supportForm.controls['description'])\"></span>\n </div>\n </div>\n </form>\n\n <div *ngIf=\"status ==='send'\" translate=\"Your request has been registered\" data-testid=\"new-support-send-info\">\n </div>\n <div *ngIf=\"status ==='error'\" translate=\"An error has occurred, please renew your request\"\n data-testid=\"new-support-error-info\">\n\n </div>\n</div>\n<div class=\"modal-footer\">\n <button type=\"button\" class=\"btn rounded-pill btn-museum\" data-dismiss=\"modal\" translate=\"Close\" (click)=\"onClose()\"\n data-testid=\"new-support-close-btn\"></button>\n <button *ngIf=\"!loading && status==='new'\" type=\"button\" class=\"btn rounded-pill btn-museum\" translate=\"Submit\"\n (click)=\"onSubmit()\" [disabled]=\"!supportForm.valid\" data-testid=\"new-support-submit-btn\"></button>\n</div>", styles: [".support-loader-container{width:88px;margin:auto}.invalid-feedback{height:16px}\n"] }]
16967
17060
  }], ctorParameters: () => [{ type: SupportService }, { type: i1$2.NgbActiveModal }, { type: i3.UntypedFormBuilder }, { type: BaseUserService }, { type: ValidatorsService }] });
16968
17061
 
16969
17062
  class LocaleService {
@@ -17170,6 +17263,11 @@ class FeatureService extends BaseObjectService {
17170
17263
  zone: [],
17171
17264
  };
17172
17265
  featureTags = new BehaviorSubject(null);
17266
+ /**
17267
+ * The space's info points and desks the user sees, whatever featureDomainFilter and
17268
+ * deskDomainFilter hide, for a filter to count them. Null until they are known.
17269
+ */
17270
+ featuresUnfiltered = new BehaviorSubject(null);
17173
17271
  featureFiltered = [];
17174
17272
  updateDone = new Subject();
17175
17273
  zoneIDFilter;
@@ -17198,6 +17296,7 @@ class FeatureService extends BaseObjectService {
17198
17296
  this.currentSpaceID = this.navigatorService.currentSpaceID;
17199
17297
  if (!this.currentSpaceID) {
17200
17298
  this.featureTags.next(null);
17299
+ this.featuresUnfiltered.next(null);
17201
17300
  this.featureUpdated.next({ space: [], zone: null });
17202
17301
  this.zoneIDFilter = null;
17203
17302
  }
@@ -17213,6 +17312,7 @@ class FeatureService extends BaseObjectService {
17213
17312
  this.zoneIDFilter = null;
17214
17313
  if (!spaceID) {
17215
17314
  this.featureTags.next(null);
17315
+ this.featuresUnfiltered.next(null);
17216
17316
  this.featureUpdated.next({ space: [], zone: null });
17217
17317
  }
17218
17318
  else if (!this.userService.isMuseumUser(spaceID)) {
@@ -17281,6 +17381,7 @@ class FeatureService extends BaseObjectService {
17281
17381
  const featureList = await this.getFeaturesForSpace(this.currentSpaceID);
17282
17382
  this.currentHashtags = await this.hashtagService.getHashtagsForSpace(this.currentSpaceID);
17283
17383
  // console.log(this.currentHashtags);
17384
+ this.featuresUnfiltered.next(featureList);
17284
17385
  if (featureList.length > 0) {
17285
17386
  let filteredFeatures = [...featureList];
17286
17387
  let filteredPointInterest = filteredFeatures.filter((feature) => feature.type !== FeatureType.DESK);
@@ -17526,6 +17627,9 @@ class FeatureService extends BaseObjectService {
17526
17627
  });
17527
17628
  }
17528
17629
  async updateDueToCreate(feature) {
17630
+ if (this.featuresUnfiltered.value) {
17631
+ this.featuresUnfiltered.next([feature, ...this.featuresUnfiltered.value]);
17632
+ }
17529
17633
  this.currentFeatures.space.unshift(feature);
17530
17634
  this.currentFeatures.zone.unshift(feature);
17531
17635
  this.featureUpdated.next({
@@ -17534,6 +17638,9 @@ class FeatureService extends BaseObjectService {
17534
17638
  }); // for lateral menu
17535
17639
  }
17536
17640
  async updateDueToDelete(deletedFeature) {
17641
+ if (this.featuresUnfiltered.value) {
17642
+ this.featuresUnfiltered.next(this.featuresUnfiltered.value.filter((_feature) => _feature.id !== deletedFeature.id));
17643
+ }
17537
17644
  const feature = this.currentFeatures.space.find((_feature) => _feature.id === deletedFeature.id);
17538
17645
  if (feature) {
17539
17646
  const index = this.currentFeatures.space.indexOf(feature);
@@ -17573,6 +17680,8 @@ class MeasurementService {
17573
17680
  path = 'measurements/';
17574
17681
  currentMeasurements = { space: [], zone: [] };
17575
17682
  measurementsTags = new BehaviorSubject(null);
17683
+ /** The space's measurements the user sees, whatever measurementFilter hides, for a filter to count them. Null until known. */
17684
+ measurementsUnfiltered = new BehaviorSubject(null);
17576
17685
  measurementsUpdated = new Subject();
17577
17686
  currentSpaceID;
17578
17687
  zoneIDFilter;
@@ -17599,6 +17708,7 @@ class MeasurementService {
17599
17708
  this.currentSpaceID = this.navigatorService.currentSpaceID;
17600
17709
  if (!this.currentSpaceID) {
17601
17710
  this.measurementsTags.next(null);
17711
+ this.measurementsUnfiltered.next(null);
17602
17712
  this.measurementsUpdated.next({ space: [], zone: null });
17603
17713
  this.measurementFilter = null;
17604
17714
  this.zoneIDFilter = null;
@@ -17616,6 +17726,7 @@ class MeasurementService {
17616
17726
  this.zoneIDFilter = null;
17617
17727
  if (!spaceID) {
17618
17728
  this.measurementsTags.next(null);
17729
+ this.measurementsUnfiltered.next(null);
17619
17730
  this.measurementsUpdated.next({ space: [], zone: null });
17620
17731
  this.measurementFilter = null;
17621
17732
  return;
@@ -17643,6 +17754,7 @@ class MeasurementService {
17643
17754
  if (this.dateFilter) {
17644
17755
  measurements = this.filterService.filterMeasurementsForDateRange(measurements, this.dateFilter);
17645
17756
  }
17757
+ this.measurementsUnfiltered.next(measurements);
17646
17758
  if (this.measurementFilter) {
17647
17759
  measurements = [];
17648
17760
  }
@@ -17664,6 +17776,7 @@ class MeasurementService {
17664
17776
  this.measurementsUpdated.next(this.currentMeasurements);
17665
17777
  }
17666
17778
  else {
17779
+ this.measurementsUnfiltered.next([]);
17667
17780
  this.currentMeasurements.space = [];
17668
17781
  this.currentMeasurements.zone = [];
17669
17782
  this.measurementsUpdated.next({ space: [], zone: [] }); // for lateral menu
@@ -18404,11 +18517,11 @@ class NavigationBarComponent {
18404
18517
  this.baseVisibilityService.isChangePositionVisible.next(false);
18405
18518
  }
18406
18519
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavigationBarComponent, deps: [{ token: 'currentAwsKinesisAnalyticsService' }, { token: i1.Router }, { token: SpaceService }, { token: BaseUserService }, { token: ZoneService }, { token: VisitService }, { token: ViewerService }, { token: NavigatorService }, { token: ZoneChangeService }, { token: BaseVisibilityService }], target: i0.ɵɵFactoryTarget.Component });
18407
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NavigationBarComponent, selector: "lib-navigation-bar", viewQueries: [{ propertyName: "navbarSelectMenu", first: true, predicate: ["navbarSelectMenu"], descendants: true }], ngImport: i0, template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\r\n <div class=\"d-flex w-100\">\r\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\r\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\r\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\r\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\r\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\r\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\r\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\r\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\r\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\r\n </option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\r\n (ngModelChange)=\"onFloorClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\r\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\r\n (ngModelChange)=\"onZoneClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\r\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\r\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\r\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\r\n </select>\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\r\n <p class=\"fw-bold lh-base align-middle text-center\">\r\n {{ showLocation() }}\r\n </p>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23565656;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23FFFFFF;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
18520
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: NavigationBarComponent, selector: "lib-navigation-bar", viewQueries: [{ propertyName: "navbarSelectMenu", first: true, predicate: ["navbarSelectMenu"], descendants: true }], ngImport: i0, template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\n <div class=\"d-flex w-100\">\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\n </option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\n (ngModelChange)=\"onFloorClick()\">\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\n (ngModelChange)=\"onZoneClick()\">\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\n </select>\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\n <p class=\"fw-bold lh-base align-middle text-center\">\n {{ showLocation() }}\n </p>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n </div>\n </div>\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23565656;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23FFFFFF;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
18408
18521
  }
18409
18522
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavigationBarComponent, decorators: [{
18410
18523
  type: Component,
18411
- args: [{ selector: 'lib-navigation-bar', template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\r\n <div class=\"d-flex w-100\">\r\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\r\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\r\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\r\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\r\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\r\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\r\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\r\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\r\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\r\n </option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\r\n (ngModelChange)=\"onFloorClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\r\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\r\n (ngModelChange)=\"onZoneClick()\">\r\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\r\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\r\n </select>\r\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\r\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\r\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\r\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\r\n </select>\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\r\n <p class=\"fw-bold lh-base align-middle text-center\">\r\n {{ showLocation() }}\r\n </p>\r\n </div>\r\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\r\n <button (click)=\"goTo()\"\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\r\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\r\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23565656;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0D%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0D%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0D%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0D%0A<style type=\"text/css\">%0D%0A%09.st0{fill:%23FFFFFF;}%0D%0A<\\/style>%0D%0A<g>%0D%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0D%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0D%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0D%0A%09%09/>%0D%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0D%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0D%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0D%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0D%0A</g>%0D%0A</svg>%0D%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"] }]
18524
+ args: [{ selector: 'lib-navigation-bar', template: "<nav class=\"navbar navbar-expand-md navbar-dark navbar-inverse second-nav\">\n <div class=\"d-flex w-100\">\n <div #navbarSelectMenu class=\"w-100\" id=\"nav-item-container-blue\">\n <div class=\"d-flex flex-column flex-md-row p-1 mt-2\">\n <select class=\"form-control flex-fill flex-lg-fill-unset location select-menu\"\n [(ngModel)]=\"selectedLocation\" (ngModelChange)=\"onLocationClick()\">\n <option [ngValue]=\"null\" selected>{{ 'Location' | translate }}</option>\n <option *ngFor=\"let loc of locations; index as index\" [ngValue]=\"loc\"> {{ loc.name }}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" (change)=\"onVisitClick($event)\"\n *ngIf=\"visitsPerSpace && visitsPerSpace.length > 1\">\n <option value=\"default\" selected disabled hidden>{{'Visit' | translate}}</option>\n <option *ngFor=\"let visit of visitsPerSpace; index as index\" value=\"{{index}}\">{{ visit.name}}\n </option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset floor select-menu\" [(ngModel)]=\"selectedFloor\"\n (ngModelChange)=\"onFloorClick()\">\n <option [ngValue]=\"null\" selected>{{'Floor' | translate}}</option>\n <option *ngFor=\"let floor of floorsPerSpace\" [ngValue]=\"floor\">{{ floor.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu zone\" [(ngModel)]=\"selectedZone\"\n (ngModelChange)=\"onZoneClick()\">\n <option [ngValue]=\"null\" selected>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of zonesPerFloor\" [ngValue]=\"zone\"><span\n *ngIf=\"zone.code_ref\">{{zone.code_ref}}_</span>{{zone.name}}</option>\n </select>\n <select class=\"form-control flex-fill flex-lg-fill-unset select-menu\" [(ngModel)]=\"selectedChildZone\"\n *ngIf=\"childrenZones && childrenZones.length>0\" (ngModelChange)=\"onChildZoneClick()\">\n <option [ngValue]=\"null\" selected disabled>{{'Zone' | translate}}</option>\n <option *ngFor=\"let zone of childrenZones\" [ngValue]=\"zone\">{{ zone.name}}</option>\n </select>\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d d-none d-lg-block\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1\" *ngIf=\"showLocation()\">\n <p class=\"fw-bold lh-base align-middle text-center\">\n {{ showLocation() }}\n </p>\n </div>\n <div class=\"row align-items-center justify-content-center ml-0 p-1 d-block d-lg-none\">\n <button (click)=\"goTo()\"\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center btn-3d\"\n [disabled]=\"!selectedLocation || !selectedModel3d || !canGo()\">\n <i class=\"icon-go-to-3d d-inline-block\"></i> {{'3D visit' | translate}}\n </button>\n </div>\n </div>\n </div>\n</nav>", styles: [":host{position:sticky;top:0;height:123px}.navbar{z-index:200;padding:.4rem 1rem}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0}@media (min-width: 992px){.flex-lg-fill-unset{flex:unset!important}}.form-control{width:100%;min-width:80px;max-width:18%}.location{width:auto;max-width:35%}.floor,.zone{width:auto;max-width:30%}button{color:#fff;padding:5px 10px;font-size:1.1em}.navbar-toggler{margin-right:1em}.select-menu{max-width:inherit}.btn-3d .icon-go-to-3d{width:30px;height:30px;background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23565656;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A');border:none;vertical-align:middle;fill:var(--smarterplan-primary)}.btn-3d:hover:enabled .icon-go-to-3d{background:url('data:image/svg+xml,<?xml version=\"1.0\" encoding=\"utf-8\"?>%0A<!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->%0A<svg version=\"1.1\" id=\"Calque_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"%0A%09 viewBox=\"0 0 60 60\" style=\"enable-background:new 0 0 60 60;\" xml:space=\"preserve\">%0A<style type=\"text/css\">%0A%09.st0{fill:%23FFFFFF;}%0A<\\/style>%0A<g>%0A%09<path class=\"st0\" d=\"M43.9,32.1V17.7c0-0.4-0.2-0.7-0.5-0.9l-12.8-8c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.4,0.1-0.6,0.2l-12.8,8%0A%09%09c-0.3,0.2-0.5,0.5-0.5,0.9v14.4c0,0.4,0.2,0.7,0.5,0.9l12.8,8c0.3,0.2,0.8,0.2,1.1,0l12.8-8C43.7,32.8,43.9,32.5,43.9,32.1z%0A%09%09 M28.9,38.2l-10.7-6.7v-12l10.7,6.7V38.2z M30,24.4l-10.8-6.8L30,10.9l10.8,6.8L30,24.4z M41.8,31.5l-10.7,6.7v-12l10.7-6.7V31.5z\"%0A%09%09/>%0A%09<path class=\"st0\" d=\"M56.1,29.3l-10.3-6.8v2l1.4,1v0l0.8,0.5l0,0l7,4.8c0.3,0.2,0.4,0.5,0.4,0.8c0,0.3-0.2,0.6-0.4,0.8l-6.8,4.7%0A%09%09l0,0l-0.9,0.7v0l-2.9,2v0l-13.8,9.6c-0.3,0.2-0.8,0.2-1.1,0l-14.2-9.8l-2.6-1.8v0L5,32.4c-0.3-0.2-0.4-0.5-0.4-0.8%0A%09%09c0-0.3,0.2-0.6,0.4-0.8l0,0l7.3-5l0,0l0.5-0.3v0l1.4-1v-2L3.9,29.3c-0.8,0.5-1.2,1.4-1.2,2.4c0,0.9,0.5,1.8,1.2,2.4l8.8,6.1v0%0A%09%09l4.5,3.1l11.2,7.7c1,0.7,2.3,0.7,3.3,0l13.7-9.5l1.9-1.3v0l8.8-6.1c0.8-0.5,1.2-1.4,1.2-2.4S56.9,29.8,56.1,29.3z\"/>%0A</g>%0A</svg>%0A')}.btn-3d[disabled]:hover .icon-go-to-3d{fill:var(--smarterplan-primary)}.outer_circle{background-color:#ebebeb;border-radius:50%;width:32px;height:32px;padding:1px}@media (max-width: 767px){.navbar{padding:.2rem .5rem}.form-control,.location,.floor,.zone{max-width:100%;margin-bottom:15px}input,select{margin-right:0;margin-bottom:15px}}\n"] }]
18412
18525
  }], ctorParameters: () => [{ type: undefined, decorators: [{
18413
18526
  type: Inject,
18414
18527
  args: ['currentAwsKinesisAnalyticsService']
@@ -18678,11 +18791,11 @@ class MenuBarComponent {
18678
18791
  }
18679
18792
  }
18680
18793
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuBarComponent, deps: [{ token: i1.Router }, { token: LocaleService }, { token: BaseUserService }, { token: NavigatorService }, { token: SupportService }, { token: BaseVisibilityService }, { token: i1$2.NgbCalendar }, { token: i1$2.NgbDateParserFormatter }, { token: FilterService }, { token: AmplifyCacheService }], target: i0.ɵɵFactoryTarget.Component });
18681
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MenuBarComponent, selector: "lib-menu-bar", inputs: { cacheName: "cacheName" }, ngImport: i0, template: "<div id=\"menu-bar\">\r\n <div *ngIf=\"!isVisitor\">\r\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\r\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\r\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\r\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\r\n </div>\r\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\r\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <p *ngIf=\"user && mission\" class=\"p-2\">\r\n <span class=\"username\">{{ user.displayName }}</span><br />\r\n <span class=\"user-role\">{{ mission.role }}</span><br />\r\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\r\n translate}}</span>\r\n </p>\r\n <div class=\"dropdown-divider\"></div>\r\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\r\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\r\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\r\n {{'Users management' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/profile\">\r\n {{'Profile' | translate}}</a>\r\n <div class=\"dropdown-divider\"></div>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\r\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\r\n [animation]=\"false\">\r\n <form\r\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\r\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\r\n (click)=\"onSubmit()\">{{'Search' |\r\n translate}}</button>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\r\n [value]=\"fromDate | formatDateNumberToDigits\"\r\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\r\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\r\n <ng-template #t let-date let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\r\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\r\n <button\r\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\r\n {{'Apply' | translate}}\r\n </button>\r\n <span\r\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n *ngIf=\"isDateFilterApplied && !dateChanged\">\r\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\r\n {{\"Applied\" | translate}}\r\n </span>\r\n <button\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\r\n |\r\n translate}}</button>\r\n <div\r\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\r\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\r\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\r\n for=\"btn-check-outlined\">{{\r\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </nav>\r\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\r\n </div>\r\n <div *ngIf=\"isVisitor && isVisible\">\r\n <div class=\"visitor-div\">\r\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\r\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\r\n </div>\r\n <div class=\"avatar-container-menu\">\r\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.NgbCollapse, selector: "[ngbCollapse]", inputs: ["animation", "ngbCollapse", "horizontal"], outputs: ["ngbCollapseChange", "shown", "hidden"], exportAs: ["ngbCollapse"] }, { kind: "directive", type: i1$2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "component", type: AvatarComponent, selector: "lib-avatar", inputs: ["size", "userID"] }, { kind: "component", type: NavigationBarComponent, selector: "lib-navigation-bar" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatDateNumberToDigitsPipe, name: "formatDateNumberToDigits" }] });
18794
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: MenuBarComponent, selector: "lib-menu-bar", inputs: { cacheName: "cacheName" }, ngImport: i0, template: "<div id=\"menu-bar\">\n <div *ngIf=\"!isVisitor\">\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\n </div>\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <p *ngIf=\"user && mission\" class=\"p-2\">\n <span class=\"username\">{{ user.displayName }}</span><br />\n <span class=\"user-role\">{{ mission.role }}</span><br />\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\n translate}}</span>\n </p>\n <div class=\"dropdown-divider\"></div>\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\n {{'Users management' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/profile\">\n {{'Profile' | translate}}</a>\n <div class=\"dropdown-divider\"></div>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\n [animation]=\"false\">\n <form\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\n (click)=\"onSubmit()\">{{'Search' |\n translate}}</button>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <div class=\"input-group date-selector m-1\">\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\n [value]=\"fromDate | formatDateNumberToDigits\"\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\n <ng-template #t let-date let-focused=\"focused\">\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\n (mouseleave)=\"hoveredDate = null\">\n {{ date.day }}\n </span>\n </ng-template>\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\n <div class=\"input-group date-selector m-1\">\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\n <button\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\n {{'Apply' | translate}}\n </button>\n <span\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n *ngIf=\"isDateFilterApplied && !dateChanged\">\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\n {{\"Applied\" | translate}}\n </span>\n <button\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\n |\n translate}}</button>\n <div\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\n for=\"btn-check-outlined\">{{\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\n </div>\n </div>\n </form>\n </div>\n </div>\n </nav>\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\n </div>\n <div *ngIf=\"isVisitor && isVisible\">\n <div class=\"visitor-div\">\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\n </div>\n <div class=\"avatar-container-menu\">\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"], dependencies: [{ kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: i1$2.NgbCollapse, selector: "[ngbCollapse]", inputs: ["animation", "ngbCollapse", "horizontal"], outputs: ["ngbCollapseChange", "shown", "hidden"], exportAs: ["ngbCollapse"] }, { kind: "directive", type: i1$2.NgbInputDatepicker, selector: "input[ngbDatepicker]", inputs: ["autoClose", "contentTemplate", "datepickerClass", "dayTemplate", "dayTemplateData", "displayMonths", "firstDayOfWeek", "footerTemplate", "markDisabled", "minDate", "maxDate", "navigation", "outsideDays", "placement", "popperOptions", "restoreFocus", "showWeekNumbers", "startDate", "container", "positionTarget", "weekdays", "disabled"], outputs: ["dateSelect", "navigate", "closed"], exportAs: ["ngbDatepicker"] }, { kind: "directive", type: i1$3.IconDirective, selector: "ic-icon,[icIcon]", inputs: ["icIcon", "icon", "color", "inline", "box", "size", "width", "height", "align", "hFlip", "vFlip", "flip", "rotate"] }, { kind: "component", type: AvatarComponent, selector: "lib-avatar", inputs: ["size", "userID"] }, { kind: "component", type: NavigationBarComponent, selector: "lib-navigation-bar" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: FormatDateNumberToDigitsPipe, name: "formatDateNumberToDigits" }] });
18682
18795
  }
18683
18796
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuBarComponent, decorators: [{
18684
18797
  type: Component,
18685
- args: [{ selector: 'lib-menu-bar', template: "<div id=\"menu-bar\">\r\n <div *ngIf=\"!isVisitor\">\r\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\r\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\r\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\r\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\r\n </div>\r\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\r\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <p *ngIf=\"user && mission\" class=\"p-2\">\r\n <span class=\"username\">{{ user.displayName }}</span><br />\r\n <span class=\"user-role\">{{ mission.role }}</span><br />\r\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\r\n translate}}</span>\r\n </p>\r\n <div class=\"dropdown-divider\"></div>\r\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\r\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\r\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\r\n {{'Users management' | translate}}</a>\r\n <a class=\"dropdown-item\" routerLink=\"/profile\">\r\n {{'Profile' | translate}}</a>\r\n <div class=\"dropdown-divider\"></div>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\r\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\r\n <span class=\"navbar-toggler-icon\"></span>\r\n </button>\r\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\r\n [animation]=\"false\">\r\n <form\r\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\r\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\r\n (click)=\"onSubmit()\">{{'Search' |\r\n translate}}</button>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\r\n [value]=\"fromDate | formatDateNumberToDigits\"\r\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\r\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\r\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\r\n <ng-template #t let-date let-focused=\"focused\">\r\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\r\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\r\n (mouseleave)=\"hoveredDate = null\">\r\n {{ date.day }}\r\n </span>\r\n </ng-template>\r\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\r\n <div class=\"input-group date-selector m-1\">\r\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\r\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\r\n <div class=\"input-group-append\">\r\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\r\n type=\"button\"></button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\r\n <button\r\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\r\n {{'Apply' | translate}}\r\n </button>\r\n <span\r\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n *ngIf=\"isDateFilterApplied && !dateChanged\">\r\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\r\n {{\"Applied\" | translate}}\r\n </span>\r\n <button\r\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\r\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\r\n |\r\n translate}}</button>\r\n <div\r\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\r\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\r\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\r\n for=\"btn-check-outlined\">{{\r\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </nav>\r\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\r\n </div>\r\n <div *ngIf=\"isVisitor && isVisible\">\r\n <div class=\"visitor-div\">\r\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\r\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\r\n </div>\r\n <div class=\"avatar-container-menu\">\r\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\r\n <lib-avatar></lib-avatar>\r\n </div>\r\n <div class=\"dropdown-menu dropdown-menu-right\">\r\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\r\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\r\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\r\n translate}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"] }]
18798
+ args: [{ selector: 'lib-menu-bar', template: "<div id=\"menu-bar\">\n <div *ngIf=\"!isVisitor\">\n <nav class=\"navbar navbar-expand-md navbar-light p-0\">\n <div class=\"container-fluid\" *ngIf=\"isVisible\">\n <div class=\"navbar-brand order-md-0\" [routerLink]=\"['/dashboard']\">\n <img alt=\"SmarterPlan\" src=\"../assets/images/logos/logo-immo.png\">\n </div>\n <div class=\"ms-auto nav-item dropdown profile_pic-container order-md-2\">\n <div class=\"profile_pic dropdown-toggle\" data-testid=\"dropdown-menu-button\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <p *ngIf=\"user && mission\" class=\"p-2\">\n <span class=\"username\">{{ user.displayName }}</span><br />\n <span class=\"user-role\">{{ mission.role }}</span><br />\n <span class=\"org\">{{ mission.organisation ? mission.organisation.name : \"No organisation\" |\n translate}}</span>\n </p>\n <div class=\"dropdown-divider\"></div>\n <!-- <a class=\"dropdown-item\" routerLink=\"/debug\" *ngIf=\"isManager\">Debug</a> -->\n <a class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/dashboard\">{{'Data management' | translate}}</a>\n <a class=\"dropdown-item\" data-testid=\"user-management-btn\" routerLink=\"/admin\" *ngIf=\"isManager\">\n {{'Users management' | translate}}</a>\n <a class=\"dropdown-item\" routerLink=\"/profile\">\n {{'Profile' | translate}}</a>\n <div class=\"dropdown-divider\"></div>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n <button class=\"navbar-toggler order-md-1\" (click)=\"navbarCollapse.toggle()\" type=\"button\"\n [attr.aria-expanded]=\"!isCollapsed\" aria-controls=\"navbar-collapse\">\n <span class=\"navbar-toggler-icon\"></span>\n </button>\n <div class=\"navbar-collapse order-md-1\" #navbarCollapse=\"ngbCollapse\" [(ngbCollapse)]=\"isCollapsed\"\n [animation]=\"false\">\n <form\n class=\"form-inline m-0 mt-2 form-container d-flex justify-content-start align-items-start align-items-md-center flex-column flex-md-row flex-nowrap filters-menu-block\">\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <input class=\"form-control search-button m-1\" placeholder=\"keyword\" id=\"mainSearchBar\" type=\"text\">\n <button class=\"btn btn-outline-primary rounded-pill m-1 w-fit-content h-fit-content align-self-md-center\"\n (click)=\"onSubmit()\">{{'Search' |\n translate}}</button>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-0\">\n <div class=\"input-group date-selector m-1\">\n <input #dpFromDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpFromDate\"\n [value]=\"fromDate | formatDateNumberToDigits\"\n (input)=\"fromDate = validateInput(fromDate, dpFromDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n <input name=\"datepicker\" class=\"form-control visually-hidden\" ngbDatepicker #datepicker=\"ngbDatepicker\"\n [autoClose]=\"'outside'\" (dateSelect)=\"onDateSelection($event)\" [displayMonths]=\"2\" [dayTemplate]=\"t\"\n outsideDays=\"hidden\" [startDate]=\"fromDate || calendar.getToday()\" [container]=\"'body'\" tabindex=\"-1\">\n <ng-template #t let-date let-focused=\"focused\">\n <span class=\"custom-day\" [class.focused]=\"focused\" [class.range]=\"isRange(date)\"\n [class.faded]=\"isHovered(date) || isInside(date)\" (mouseenter)=\"hoveredDate = date\"\n (mouseleave)=\"hoveredDate = null\">\n {{ date.day }}\n </span>\n </ng-template>\n <span class=\"ms-1 p-2\">{{'to' | translate}}</span>\n <div class=\"input-group date-selector m-1\">\n <input #dpToDate class=\"form-control\" placeholder=\"dd/MM/yyyy\" name=\"dpToDate\"\n [value]=\"toDate | formatDateNumberToDigits\" (input)=\"toDate = validateInput(toDate, dpToDate.value)\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary calendar\" (click)=\"datepicker.toggle()\"\n type=\"button\"></button>\n </div>\n </div>\n </div>\n <div class=\"input-group search-button-container d-flex flex-row flex-nowrap p-0 m-1 justify-content-evenly\">\n <button\n class=\"btn btn-primary rounded-pill ms-1 w-25 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onApply()\" *ngIf=\"!isDateFilterApplied || dateChanged\">\n {{'Apply' | translate}}\n </button>\n <span\n class=\"appliedText ms-1 py-2 align-self-md-center pb-md-0 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n *ngIf=\"isDateFilterApplied && !dateChanged\">\n <span class=\"iconify\" [icIcon]=\"checkIcon\" width=\"15\" height=\"15\"></span>\n {{\"Applied\" | translate}}\n </span>\n <button\n class=\"btn btn-outline-primary rounded-pill w-25 mx-2 w-md-fit-content h-md-fit-content align-self-md-center\"\n type=\"button\" (click)=\"onClearDates()\">{{'Clear'\n |\n translate}}</button>\n <div\n class=\"change-position-button align-self-end pb-2 align-self-md-center mx-2 pb-md-0 flex-nowrap w-25 w-md-fit-content h-md-fit-content\">\n <input type=\"checkbox\" class=\"btn-check\" id=\"btn-check-outlined\" autocomplete=\"off\">\n <label class=\"link-primary cursor-pointer text-decoration-underline\" (click)=\"onChangePositionClick()\"\n for=\"btn-check-outlined\">{{\n (isChangePositionVisible ? \"Close\" : \"Move to\") | translate }}</label>\n </div>\n </div>\n </form>\n </div>\n </div>\n </nav>\n <lib-navigation-bar *ngIf=\"isVisible && isChangePositionVisible\"></lib-navigation-bar>\n </div>\n <div *ngIf=\"isVisitor && isVisible\">\n <div class=\"visitor-div\">\n <div class=\"logo-container\" data-testid=\"dropdown-menu-button\">\n <img class=\"img-logo\" alt=\"SmarterPlanLogo\" src=\"../assets/images/logos/logo-reserve.png\">\n </div>\n <div class=\"avatar-container-menu\">\n <div class=\"profile_pic dropdown-toggle cursor-pointer\" data-bs-toggle=\"dropdown\">\n <lib-avatar></lib-avatar>\n </div>\n <div class=\"dropdown-menu dropdown-menu-right\">\n <button class=\"dropdown-item\" (click)=\"localeService.modal()\">{{'Language' | translate}}</button>\n <button class=\"dropdown-item\" (click)=\"openSupportForm()\">{{\"Help\" | translate}}</button>\n <button data-testid=\"logout-auth-btn\" class=\"dropdown-item\" (click)=\"signOut()\">{{\"Logout\" |\n translate}}</button>\n </div>\n </div>\n </div>\n </div>\n</div>", styles: ["#menu-bar{position:sticky;top:0;z-index:200}.navbar{z-index:200}.navbar-brand{padding-top:5px;padding-bottom:5px;cursor:pointer}.navbar-brand img{height:70px}.profile_pic{border-radius:50%;height:45px;width:45px;margin:8px;border:.2px solid rgb(150,150,150)}.navbar-nav .profile-pic-container .dropdown-menu{position:absolute}.navbar.second-nav{z-index:199;background-color:var(--smarterplan-primary)}.profile_pic.dropdown-toggle:after{display:none}.navbar-light{border-bottom:1px solid var(--smarterplan-primary);background-color:#fff}.navbar form{width:100%;margin:0;padding:0}input,select{margin-right:15px}.select{background:transparent;border:none;color:#fff;margin:6px 20px 0;width:auto}button{padding:5px 10px}button:disabled,button[disabled]{color:#c04f4f}.navbar-toggler{margin-right:1em}.icon{height:40px;width:40px;color:var(--smarterplan-primary)}.search-button-container{width:auto;align-items:stretch;justify-items:start}.search-button-container .search-button{width:auto;border-radius:1rem!important}.visitor-div{background-color:var(--smarterplan-primary);height:60px;display:flex;justify-content:space-between}.profile_pic-container{margin-right:1em}.logo-container,.img-logo{height:100%}.change-position-button{margin-left:2rem}.change-position-button label,.change-position-button .btn-check:checked,.change-position-button .btn-check:focus,.change-position-button .btn-outline-primary,.change-position-button .btn{box-shadow:none!important;outline:0}.change-position-button label{border-radius:16px}.change-position-button .btn-check:checked+.btn{background-color:var(--smarterplan-primary);color:#fff!important}.filters-menu-block{width:auto}@media (min-width: 1200px){.navbar-brand img{height:100px}.profile_pic{height:60px;width:60px;margin:15px}}@media (min-width: 992px) and (max-width: 1199.98px){.navbar-brand img{height:80px}.profile_pic{height:50px;width:50px;margin:12px}}@media (min-width: 768px) and (max-width: 991.98px){.navbar-brand img{height:60px}.profile_pic{height:40px;width:40px;margin:10px}}@media (max-width: 767.98px){.navbar-brand img{height:50px}.profile_pic{height:30px;width:30px;margin:8px}.search-button-container,.filters-menu-block{width:100%}}.form-container{margin:.5rem 0}.navbar-collapse.show{display:flex;padding-bottom:.5rem}.hidden{width:0;margin:0;border:none;padding:0}.custom-day{text-align:center;padding:.185rem .25rem;display:inline-block;height:2rem;width:2rem}.custom-day.focused{background-color:#e6e6e6}.custom-day.range,.custom-day:hover{background-color:var(--smarterplan-primary-lighter);color:#fff}.custom-day.faded{background-color:var(--smarterplan-primary-transparent)}.calendar{height:100%}.appliedText,.appliedText span{color:var(--smarterplan-primary)}@media (max-width: 767px){.form-inline{flex-direction:column}}.hidden{opacity:0}.date-selector{flex-wrap:nowrap}.date-selector input{min-width:80px;margin:0}@media (min-width: 768px){.w-md-fit-content{width:fit-content!important}.h-md-content{height:fit-content!important}}\n"] }]
18686
18799
  }], ctorParameters: () => [{ type: i1.Router }, { type: LocaleService }, { type: BaseUserService }, { type: NavigatorService }, { type: SupportService }, { type: BaseVisibilityService }, { type: i1$2.NgbCalendar }, { type: i1$2.NgbDateParserFormatter }, { type: FilterService }, { type: AmplifyCacheService }], propDecorators: { cacheName: [{
18687
18800
  type: Input
18688
18801
  }] } });
@@ -19039,6 +19152,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19039
19152
  args: ['window:message', ['$event']]
19040
19153
  }] } });
19041
19154
 
19155
+ /**
19156
+ * Deletes one file of a visit's AI inventory, and nothing outside it.
19157
+ *
19158
+ * The inventory's only S3 delete. It lives here, out of the library's public API, rather than as a
19159
+ * generic helper beside the other S3 functions, so that no other code picks it up for something
19160
+ * else: it refuses any key outside `visits/<model3D>/inventory/`, and logs every deletion with the
19161
+ * reason its caller gives. Rejects when the key is refused or the file could not be deleted.
19162
+ */
19163
+ async function removeInventoryFile(model3D, key, reason) {
19164
+ const folder = `visits/${model3D}/inventory/`;
19165
+ const segments = key.split("/");
19166
+ const inside = !!model3D && key.startsWith(folder) && key.length > folder.length
19167
+ && !segments.includes("..") && !segments.includes(".");
19168
+ if (!inside || !reason?.trim()) {
19169
+ throw new Error(`Refused to delete "${key}": only a file of the inventory of visit "${model3D}", with a reason, can be deleted here.`);
19170
+ }
19171
+ console.info(`Inventory: deleting ${key} (${reason})`);
19172
+ await Storage.remove(key, { level: "public" });
19173
+ }
19174
+
19042
19175
  /**
19043
19176
  * The minimum scores a detection can be asked to beat. The model keeps those scoring strictly more
19044
19177
  * (yolact's postprocess: score > threshold), and a score is at most 1: 1.0 would keep none.
@@ -19053,6 +19186,8 @@ const PANORAMA = /\.(png|jpg|jpeg|tiff|bmp|gif)$/;
19053
19186
  * so: it no longer keeps another from being launched.
19054
19187
  */
19055
19188
  const INVENTORY_STALE_AFTER_MS = 3 * 60 * 60 * 1000;
19189
+ /** How many kept detection files are deleted at a time: a visit can have thousands. */
19190
+ const DISCARD_AT_ONCE = 20;
19056
19191
  /**
19057
19192
  * What is asked of each inventory: the most the API has of these, an environment whose backend
19058
19193
  * predates a field refusing any query that asks for it.
@@ -19088,8 +19223,8 @@ class InventoryService {
19088
19223
  }
19089
19224
  /** The space's inventories, the latest first. */
19090
19225
  async getRuns(spaceID) {
19091
- const query = (fields) => `query InventoriesBySpace($spaceID: ID!, $limit: Int) {
19092
- inventoriesBySpace(spaceID: $spaceID, limit: $limit) { items { ${fields} } }
19226
+ const query = (fields) => `query InventoriesBySpace($spaceID: ID!, $limit: Int) {
19227
+ inventoriesBySpace(spaceID: $spaceID, limit: $limit) { items { ${fields} } }
19093
19228
  }`;
19094
19229
  let response;
19095
19230
  try {
@@ -19130,6 +19265,47 @@ class InventoryService {
19130
19265
  isComplete(files) {
19131
19266
  return !!files && files.panoramas > 0 && files.dataJson && files.modelObj;
19132
19267
  }
19268
+ /**
19269
+ * How many panoramas' detections each inventory of the visit kept in the bucket, by inventory
19270
+ * (machine-learning: inventory_job.py); null when the bucket could not be read.
19271
+ */
19272
+ async keptDetections(model3D) {
19273
+ const files = await listFilesInFolder(`visits/${model3D}/inventory/runs/`);
19274
+ if (!files) {
19275
+ return null;
19276
+ }
19277
+ const kept = {};
19278
+ for (const file of files) {
19279
+ const run = /\/runs\/([^/]+)\/detections\/[^/]+\.json$/.exec(file.key ?? "")?.[1];
19280
+ if (run) {
19281
+ kept[run] = (kept[run] ?? 0) + 1;
19282
+ }
19283
+ }
19284
+ return kept;
19285
+ }
19286
+ /**
19287
+ * Deletes all the detections kept for the visit, going on past a file that fails, and says how
19288
+ * many could not be deleted. The equipment placed from them stays.
19289
+ */
19290
+ async discardDetections(model3D) {
19291
+ const files = await listFilesInFolder(`visits/${model3D}/inventory/runs/`);
19292
+ if (!files) {
19293
+ throw new Error(`Detections of ${model3D} not listed`);
19294
+ }
19295
+ const keys = files.map((file) => file.key).filter((key) => !!key);
19296
+ let failed = 0;
19297
+ for (let start = 0; start < keys.length; start += DISCARD_AT_ONCE) {
19298
+ const batch = keys.slice(start, start + DISCARD_AT_ONCE);
19299
+ const results = await Promise.allSettled(batch.map((key) => removeInventoryFile(model3D, key, "saved detections discarded")));
19300
+ results.forEach((result, i) => {
19301
+ if (result.status === "rejected") {
19302
+ failed += 1;
19303
+ console.error("Detection not deleted", batch[i], result.reason);
19304
+ }
19305
+ });
19306
+ }
19307
+ return failed;
19308
+ }
19133
19309
  /** The latest inventory of each visit, the latest first. */
19134
19310
  latestOfEachVisit(runs) {
19135
19311
  const latest = new Map();
@@ -19237,9 +19413,11 @@ class InventoryService {
19237
19413
  /**
19238
19414
  * Launches an inventory of each of the visits, unless one is already running in the space:
19239
19415
  * of all their panoramas, or of the one of `sweep` (the first 8 characters of its sweep, as
19240
- * the panoramas are named) when it is given.
19416
+ * the panoramas are named) when it is given. A visit given an inventory in `resumeFrom` starts
19417
+ * from that one's detections: with all its panoramas analysed, only the placing is done again,
19418
+ * with this cutoff.
19241
19419
  */
19242
- async launch(spaceID, nodeIDs, model, cutoffScore, sweep) {
19420
+ async launch(spaceID, nodeIDs, model, cutoffScore, sweep, resumeFrom = {}) {
19243
19421
  const runs = await this.getRuns(spaceID);
19244
19422
  if (runs.some((run) => this.isRunning(run))) {
19245
19423
  return "ALREADY_RUNNING";
@@ -19268,6 +19446,7 @@ class InventoryService {
19268
19446
  status: sweep
19269
19447
  ? InventoryStatus.TO_RUN_ONE_IMAGE
19270
19448
  : InventoryStatus.TO_RUN,
19449
+ ...(resumeFrom[nodeID] ? { resumeFrom: resumeFrom[nodeID] } : {}),
19271
19450
  });
19272
19451
  }));
19273
19452
  return "LAUNCHED";
@@ -19305,6 +19484,8 @@ class InventoryRunsComponent {
19305
19484
  /** Whether one of the inventories shown is running: said when it changes. */
19306
19485
  runningChange = new EventEmitter();
19307
19486
  runs = [];
19487
+ /** Every inventory of the space by its id, for where one that places detections again took them. */
19488
+ byId = new Map();
19308
19489
  /** The inventory whose cancelling waits for its confirmation. */
19309
19490
  confirmingCancel = null;
19310
19491
  /** The inventory being cancelled or resumed, its buttons disabled meanwhile. */
@@ -19340,6 +19521,7 @@ class InventoryRunsComponent {
19340
19521
  this.stopPolling();
19341
19522
  return;
19342
19523
  }
19524
+ this.byId = new Map(runs.map((run) => [run.id, run]));
19343
19525
  this.runs = this.inventoryService
19344
19526
  .latestOfEachVisit(runs)
19345
19527
  .filter((run) => !this.nodeIDs || this.nodeIDs.includes(run.nodeID));
@@ -19361,6 +19543,14 @@ class InventoryRunsComponent {
19361
19543
  this.stopPolling();
19362
19544
  }
19363
19545
  }
19546
+ /**
19547
+ * The finished inventory whose detections this one places again with its own cutoff, analysing
19548
+ * no panorama; null when it analyses them, resuming a stopped one included.
19549
+ */
19550
+ reusedFrom(run) {
19551
+ const source = run.resumeFrom ? this.byId.get(run.resumeFrom) : null;
19552
+ return source && this.inventoryService.state(source) === "done" ? source : null;
19553
+ }
19364
19554
  /**
19365
19555
  * About how many minutes the panoramas left will take, at the pace seen since the inventory
19366
19556
  * was first seen analysing them; null until a panorama has been done meanwhile.
@@ -19415,11 +19605,11 @@ class InventoryRunsComponent {
19415
19605
  }
19416
19606
  }
19417
19607
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryRunsComponent, deps: [{ token: InventoryService }], target: i0.ɵɵFactoryTarget.Component });
19418
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryRunsComponent, selector: "lib-inventory-runs", inputs: { spaceID: "spaceID", nodeIDs: "nodeIDs", labels: "labels" }, outputs: { runningChange: "runningChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\r\n <h5>{{'Last inventory' | translate}}</h5>\r\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\r\n <div class=\"inventory-run-header\">\r\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\r\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\r\n </div>\r\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\r\n <div *ngSwitchCase=\"'waiting'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Waiting for the analysis to start\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'running'\">\r\n <ng-container [ngSwitch]=\"run.step\">\r\n <div *ngSwitchCase=\"'DOWNLOADING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Downloading the files of the visit\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'PLACING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Placing the objects in 3D\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'SAVING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Saving the equipment\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchDefault>\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\r\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\r\n </span>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\r\n {{'Cancel the inventory' | translate}}</button>\r\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\r\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\r\n <div class=\"mt-1\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\r\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\r\n {{'Yes, cancel' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\r\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\r\n {{'No, go on' | translate}}</button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'cancelled'\">\r\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n </span>\r\n </div>\r\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\r\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\r\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\r\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\r\n </ng-container>\r\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\r\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\r\n {{ inventoryService.failure(run) | translate }}\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\r\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\r\n {{'the analysis has probably stopped.' | translate}}\r\n </div>\r\n </ng-container>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\r\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\r\n </div>\r\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\r\n</div>\r\n\r\n<!-- Something is being done, of which there is nothing to count. -->\r\n<ng-template #busyBar>\r\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\r\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #panoramas let-run>\r\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\">\r\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\r\n </div>\r\n <div class=\"inventory-run-detail\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n ({{ inventoryService.percent(run) }}%)\r\n </div>\r\n</ng-template>\r\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
19608
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryRunsComponent, selector: "lib-inventory-runs", inputs: { spaceID: "spaceID", nodeIDs: "nodeIDs", labels: "labels" }, outputs: { runningChange: "runningChange" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\n <h5>{{'Last inventory' | translate}}</h5>\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\n <div class=\"inventory-run-header\">\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\n </div>\n <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\n <span class=\"inventory-run-detail\">\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\n </span>\n </div>\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\n <div *ngSwitchCase=\"'waiting'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : 'Waiting for the analysis to start\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'running'\">\n <ng-container [ngSwitch]=\"run.step\">\n <div *ngSwitchCase=\"'DOWNLOADING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : 'Downloading the files of the visit\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'PLACING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Placing the objects in 3D\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'SAVING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Saving the equipment\u2026' | translate}}\n </div>\n <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\n <div *ngSwitchDefault>\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n <span *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-container>\n </div>\n <ng-template #analysing>\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\n </span>\n <!-- Counted by the image that detects down to a floor; null from older ones. -->\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\n {{'Cancel the inventory' | translate}}</button>\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\n <div class=\"mt-1\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\n {{'Yes, cancel' | translate}}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\n {{'No, go on' | translate}}</button>\n </div>\n </div>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'cancelled'\">\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n </span>\n </div>\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\n </ng-container>\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\n </div>\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\n {{ inventoryService.failure(run) | translate }}\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\n </div>\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\n {{'the analysis has probably stopped.' | translate}}\n </div>\n </ng-container>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\n </div>\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\n</div>\n\n<!-- Something is being done, of which there is nothing to count. -->\n<ng-template #busyBar>\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\n </div>\n</ng-template>\n\n<ng-template #panoramas let-run>\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\n aria-valuemin=\"0\" aria-valuemax=\"100\">\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\n </div>\n <div class=\"inventory-run-detail\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n ({{ inventoryService.percent(run) }}%)\n </div>\n</ng-template>\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .inventory-run-reused{font-size:.85rem;margin-bottom:.25rem}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i2.DatePipe, name: "date" }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
19419
19609
  }
19420
19610
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryRunsComponent, decorators: [{
19421
19611
  type: Component,
19422
- args: [{ selector: "lib-inventory-runs", template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\r\n <h5>{{'Last inventory' | translate}}</h5>\r\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\r\n <div class=\"inventory-run-header\">\r\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\r\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\r\n </div>\r\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\r\n <div *ngSwitchCase=\"'waiting'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Waiting for the analysis to start\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'running'\">\r\n <ng-container [ngSwitch]=\"run.step\">\r\n <div *ngSwitchCase=\"'DOWNLOADING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Downloading the files of the visit\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'PLACING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Placing the objects in 3D\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'SAVING'\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n {{'Saving the equipment\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchDefault>\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\r\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\r\n </span>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\r\n {{'Cancel the inventory' | translate}}</button>\r\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\r\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\r\n <div class=\"mt-1\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\r\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\r\n {{'Yes, cancel' | translate}}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\r\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\r\n {{'No, go on' | translate}}</button>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\r\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\r\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\r\n </div>\r\n <div *ngSwitchCase=\"'cancelled'\">\r\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n </span>\r\n </div>\r\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\r\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\r\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\r\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\r\n </ng-container>\r\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\r\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\r\n {{ inventoryService.failure(run) | translate }}\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\r\n </div>\r\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\r\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\r\n {{'the analysis has probably stopped.' | translate}}\r\n </div>\r\n </ng-container>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\r\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\r\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\r\n </div>\r\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\r\n</div>\r\n\r\n<!-- Something is being done, of which there is nothing to count. -->\r\n<ng-template #busyBar>\r\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\r\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #panoramas let-run>\r\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\">\r\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\r\n </div>\r\n <div class=\"inventory-run-detail\">\r\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\r\n ({{ inventoryService.percent(run) }}%)\r\n </div>\r\n</ng-template>\r\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"] }]
19612
+ args: [{ selector: "lib-inventory-runs", template: "<div class=\"inventory-runs\" *ngIf=\"runs.length\">\n <h5>{{'Last inventory' | translate}}</h5>\n <div class=\"inventory-run\" *ngFor=\"let run of runs\">\n <div class=\"inventory-run-header\">\n <span class=\"no-lowercase\">{{ labels?.[run.nodeID] ?? run.nodeID }}</span>\n <span class=\"inventory-run-date\">{{ run.createdAt | date:'short' }}</span>\n </div>\n <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\n <span class=\"inventory-run-detail\">\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\n </span>\n </div>\n <ng-container [ngSwitch]=\"inventoryService.state(run)\">\n <div *ngSwitchCase=\"'waiting'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : 'Waiting for the analysis to start\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'running'\">\n <ng-container [ngSwitch]=\"run.step\">\n <div *ngSwitchCase=\"'DOWNLOADING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : 'Downloading the files of the visit\u2026') | translate }}\n </div>\n <div *ngSwitchCase=\"'PLACING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Placing the objects in 3D\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'SAVING'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'Saving the equipment\u2026' | translate}}\n </div>\n <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\n <div *ngSwitchDefault>\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n <span *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-container>\n </div>\n <ng-template #analysing>\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n <span class=\"inventory-run-detail\" *ngIf=\"minutesLeft(run) as minutes\">\n {{'About' | translate}} {{ minutes }} {{'min left' | translate}}\n </span>\n <!-- Counted by the image that detects down to a floor; null from older ones. -->\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\n </span>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"inventoryService.canCancel(run)\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"confirmingCancel !== run.id\" (click)=\"confirmingCancel = run.id\">\n {{'Cancel the inventory' | translate}}</button>\n <div class=\"inventory-run-confirm\" *ngIf=\"confirmingCancel === run.id\">\n <span>{{'It stops after the panorama it is on. Those analysed are kept, to resume from there.' | translate}}</span>\n <div class=\"mt-1\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill me-2\"\n [disabled]=\"busy === run.id\" (click)=\"onConfirmCancel(run)\">\n {{'Yes, cancel' | translate}}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill\"\n [disabled]=\"busy === run.id\" (click)=\"confirmingCancel = null\">\n {{'No, go on' | translate}}</button>\n </div>\n </div>\n </ng-container>\n </div>\n <div *ngSwitchCase=\"'cancelling'\" class=\"text-warning\">\n <ng-container *ngTemplateOutlet=\"panoramas; context: { $implicit: run }\"></ng-container>\n {{'Cancelling: it stops after the panorama it is on\u2026' | translate}}\n </div>\n <div *ngSwitchCase=\"'cancelled'\">\n <span class=\"text-warning\">{{'Cancelled' | translate}}.</span>\n <span class=\"inventory-run-detail\" *ngIf=\"run.imagesTotal\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n </span>\n </div>\n <div *ngSwitchCase=\"'done'\" class=\"text-success\">\n <!-- How many, when the task says so: the image before inventory_job.py does not. -->\n <ng-container *ngIf=\"run.objectsFound != null; else doneOnly\">\n {{'Done' | translate}}: {{ run.objectsFound }} {{'equipment added' | translate}}.\n </ng-container>\n <ng-template #doneOnly>{{'Done' | translate}}.</ng-template>\n <span class=\"inventory-run-detail\">{{'Reload the page to see them in the list.' | translate}}</span>\n </div>\n <div *ngSwitchCase=\"'failed'\" class=\"text-danger\">\n {{ inventoryService.failure(run) | translate }}\n <span class=\"inventory-run-detail\" *ngIf=\"run.errorMessage\">{{ run.errorMessage }}</span>\n </div>\n <div *ngSwitchCase=\"'stale'\" class=\"text-warning\">\n {{'No news since' | translate}} {{ run.updatedAt | date:'short' }}:\n {{'the analysis has probably stopped.' | translate}}\n </div>\n </ng-container>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary rounded-pill mt-2\"\n *ngIf=\"inventoryService.canResume(run)\" [disabled]=\"busy === run.id\" (click)=\"onResume(run)\">\n {{'Resume from where it stopped' | translate}} ({{ run.imagesDone }} / {{ run.imagesTotal }})</button>\n </div>\n <div class=\"text-danger\" *ngIf=\"message\">{{ message | translate }}</div>\n</div>\n\n<!-- Something is being done, of which there is nothing to count. -->\n<ng-template #busyBar>\n <div class=\"progress mb-1\" role=\"progressbar\" aria-label=\"\u2026\">\n <div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 100%\"></div>\n </div>\n</ng-template>\n\n<ng-template #panoramas let-run>\n <div class=\"progress\" role=\"progressbar\" [attr.aria-valuenow]=\"inventoryService.percent(run)\"\n aria-valuemin=\"0\" aria-valuemax=\"100\">\n <div class=\"progress-bar\" [style.width.%]=\"inventoryService.percent(run)\"></div>\n </div>\n <div class=\"inventory-run-detail\">\n {{'Panoramas analysed' | translate}}: {{ run.imagesDone ?? 0 }} / {{ run.imagesTotal }}\n ({{ inventoryService.percent(run) }}%)\n </div>\n</ng-template>\n", styles: [".inventory-runs{margin-top:1em}.inventory-runs h5{color:var(--smarterplan-primary)}.inventory-runs .inventory-run{background-color:#fff;border-radius:.25rem;padding:.5rem;margin-bottom:.5rem}.inventory-runs .inventory-run .inventory-run-header{display:flex;justify-content:space-between;gap:.5rem;margin-bottom:.25rem}.inventory-runs .inventory-run .inventory-run-date,.inventory-runs .inventory-run .inventory-run-detail{font-size:.8rem;color:#6c757d}.inventory-runs .inventory-run .inventory-run-detail{display:block}.inventory-runs .inventory-run .inventory-run-reused{font-size:.85rem;margin-bottom:.25rem}.inventory-runs .inventory-run .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"] }]
19423
19613
  }], ctorParameters: () => [{ type: InventoryService }], propDecorators: { spaceID: [{
19424
19614
  type: Input
19425
19615
  }], nodeIDs: [{
@@ -19430,124 +19620,645 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19430
19620
  type: Output
19431
19621
  }] } });
19432
19622
 
19623
+ const INVENTORY_MESH_FILE = {
19624
+ name: "model.obj",
19625
+ field: "modelObj",
19626
+ accept: ".obj",
19627
+ extension: /\.obj$/i,
19628
+ type: "text/plain",
19629
+ send: "Send the .obj",
19630
+ wrongFile: "Choose the .obj file of the MatterPak.",
19631
+ };
19632
+ const INVENTORY_POSITIONS_FILE = {
19633
+ name: "data.json",
19634
+ field: "dataJson",
19635
+ accept: ".json",
19636
+ extension: /\.json$/i,
19637
+ type: "application/json",
19638
+ send: "Send the .json",
19639
+ wrongFile: "Choose a .json file.",
19640
+ };
19433
19641
  /**
19434
19642
  * What a visit has of what its AI inventory needs (InventoryService.checkFiles), and where what is
19435
- * missing comes from, for the screens to show before launching one. The mesh, which nothing else
19436
- * puts in the bucket, can be sent from here: the .obj of the visit's MatterPak, as it is.
19643
+ * missing comes from, for the screens to show before launching one. The mesh and the panoramas'
19644
+ * positions can be sent, replaced or deleted from here; the panoramas come from the visit's import.
19437
19645
  */
19438
19646
  class InventoryFilesComponent {
19439
19647
  files;
19440
- /** Said when the visit gets a file from here: [(files)]. */
19648
+ /** Said when a file of the visit is sent, replaced or deleted from here: [(files)]. */
19441
19649
  filesChange = new EventEmitter();
19442
19650
  /** The visit's Matterport model, the folder of its files. */
19443
19651
  model3D;
19444
- /** How much of the .obj is sent, from 0 to 100, while it is. */
19652
+ /** While an inventory runs or is launched: it reads these files, which must not change. */
19653
+ disabled = false;
19654
+ meshFile = INVENTORY_MESH_FILE;
19655
+ positionsFile = INVENTORY_POSITIONS_FILE;
19656
+ /** The file being sent. */
19657
+ sending = null;
19658
+ /** How much of it is sent, from 0 to 100. */
19445
19659
  uploadPercent = null;
19446
19660
  uploadName = null;
19447
- /** Why the .obj was not sent, as a key to translate. */
19448
- uploadError = null;
19449
- async onModelObjSelected(event) {
19661
+ /** The file whose deletion is waiting to be confirmed. */
19662
+ confirmingDelete = null;
19663
+ deletingFile = null;
19664
+ /** What went wrong, as a key to translate, and with which file. */
19665
+ error = null;
19666
+ errorFile = null;
19667
+ /** Whether the files cannot be changed for now. */
19668
+ get locked() {
19669
+ return this.disabled || !!this.sending || !!this.deletingFile;
19670
+ }
19671
+ fail(file, error) {
19672
+ this.errorFile = file;
19673
+ this.error = error;
19674
+ }
19675
+ async onFileSelected(target, event) {
19450
19676
  const input = event.target;
19451
19677
  const file = input.files?.[0];
19452
19678
  input.value = "";
19453
- if (!file) {
19679
+ // An inventory may have started while the file dialog was open.
19680
+ if (!file || this.locked) {
19454
19681
  return;
19455
19682
  }
19456
- if (!/\.obj$/i.test(file.name)) {
19457
- this.uploadError = "Choose the .obj file of the MatterPak.";
19683
+ if (!target.extension.test(file.name)) {
19684
+ this.fail(target, target.wrongFile);
19458
19685
  return;
19459
19686
  }
19460
- this.uploadError = null;
19687
+ this.fail(null, null);
19688
+ this.sending = target;
19461
19689
  this.uploadName = file.name;
19462
19690
  this.uploadPercent = 0;
19463
19691
  try {
19464
- // Where the inventory's task looks for it, whatever the file was called.
19465
- await uploadFileToS3WithProgress(`visits/${this.model3D}/inventory/`, new File([file], "model.obj", { type: "text/plain" }), (fraction) => (this.uploadPercent = Math.round(fraction * 100)));
19466
- this.files = { ...this.files, modelObj: true };
19692
+ await uploadFileToS3WithProgress(`visits/${this.model3D}/inventory/`, new File([file], target.name, { type: target.type }), (fraction) => (this.uploadPercent = Math.round(fraction * 100)));
19693
+ this.files = { ...this.files, [target.field]: true };
19467
19694
  this.filesChange.emit(this.files);
19468
19695
  }
19469
19696
  catch (error) {
19470
- console.error("model.obj not sent", error);
19471
- this.uploadError = "The file could not be sent.";
19697
+ console.error(`${target.name} not sent`, error);
19698
+ this.fail(target, "The file could not be sent.");
19472
19699
  }
19473
19700
  finally {
19701
+ this.sending = null;
19474
19702
  this.uploadPercent = null;
19475
19703
  }
19476
19704
  }
19705
+ async onDeleteConfirmed(target) {
19706
+ if (this.locked) {
19707
+ return;
19708
+ }
19709
+ this.fail(null, null);
19710
+ this.deletingFile = target;
19711
+ try {
19712
+ await removeInventoryFile(this.model3D, `visits/${this.model3D}/inventory/${target.name}`, `${target.name} deleted from the inventory files panel`);
19713
+ this.files = { ...this.files, [target.field]: false };
19714
+ this.filesChange.emit(this.files);
19715
+ }
19716
+ catch (error) {
19717
+ console.error(`${target.name} not deleted`, error);
19718
+ this.fail(target, "The file could not be deleted.");
19719
+ }
19720
+ finally {
19721
+ this.deletingFile = null;
19722
+ this.confirmingDelete = null;
19723
+ }
19724
+ }
19477
19725
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19478
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: { files: "files", model3D: "model3D" }, outputs: { filesChange: "filesChange" }, ngImport: i0, template: `
19479
- <ul class="inventory-files" *ngIf="files; else unknown">
19480
- <li [class.missing]="!files.panoramas">
19481
- {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19482
- <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19483
- </li>
19484
- <li [class.missing]="!files.dataJson">
19485
- {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19486
- <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19487
- </li>
19488
- <li [class.missing]="!files.modelObj">
19489
- {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19490
- <span class="hint" *ngIf="!files.modelObj">
19491
- {{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}
19492
- <label class="btn btn-sm btn-outline-primary rounded-pill upload" *ngIf="uploadPercent === null">
19493
- <input type="file" accept=".obj" (change)="onModelObjSelected($event)">
19494
- {{ "Send the .obj" | translate }}
19495
- </label>
19496
- <span *ngIf="uploadPercent !== null" class="sending">
19497
- <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19498
- <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19499
- </span>
19500
- {{ "Sending" | translate }} {{ uploadName }} — {{ uploadPercent }}%
19501
- </span>
19502
- <span class="error" *ngIf="uploadError">{{ uploadError | translate }}</span>
19503
- </span>
19504
- </li>
19505
- </ul>
19506
- <ng-template #unknown>
19507
- <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19508
- </ng-template>
19509
- `, isInline: true, styles: [".inventory-files{list-style:none;padding-left:0;margin-bottom:.5rem}.missing{color:var(--bs-danger, #dc3545)}.hint{display:block;font-size:.8rem;color:#6c757d;margin-left:1.2rem}.upload{margin-top:.25rem}.upload input{display:none}.sending{display:block;margin-top:.25rem}.progress{display:flex;height:6px;margin-bottom:.25rem}.progress-bar{transition:none;background-color:var(--smarterplan-primary)}.error{display:block;color:var(--bs-danger, #dc3545)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
19726
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: { files: "files", model3D: "model3D", disabled: "disabled" }, outputs: { filesChange: "filesChange" }, ngImport: i0, template: `
19727
+ <ul class="inventory-files" *ngIf="files; else unknown">
19728
+ <li [class.missing]="!files.panoramas">
19729
+ {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19730
+ <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19731
+ </li>
19732
+ <li [class.missing]="!files.dataJson">
19733
+ {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19734
+ <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19735
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
19736
+ </li>
19737
+ <li [class.missing]="!files.modelObj">
19738
+ {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19739
+ <span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
19740
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
19741
+ </li>
19742
+ </ul>
19743
+ <ng-template #actions let-file>
19744
+ <span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
19745
+ <label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
19746
+ <input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
19747
+ {{ (files[file.field] ? "Replace" : file.send) | translate }}
19748
+ </label>
19749
+ <button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
19750
+ [disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
19751
+ </span>
19752
+ <span class="file-actions" *ngIf="confirmingDelete === file">
19753
+ <span>{{ "Delete this file?" | translate }}</span>
19754
+ <button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
19755
+ (click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
19756
+ <button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
19757
+ (click)="confirmingDelete = null">{{ "No" | translate }}</button>
19758
+ </span>
19759
+ <span *ngIf="sending === file" class="sending">
19760
+ <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19761
+ <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19762
+ </span>
19763
+ {{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
19764
+ </span>
19765
+ <span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
19766
+ </ng-template>
19767
+ <ng-template #unknown>
19768
+ <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19769
+ </ng-template>
19770
+ `, isInline: true, styles: [".inventory-files{list-style:none;padding-left:0;margin-bottom:.5rem}.missing{color:var(--bs-danger, #dc3545)}.hint{display:block;font-size:.8rem;color:#6c757d;margin-left:1.2rem}.file-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;margin:.25rem 0 0 1.2rem;font-size:.8rem}.upload{margin-bottom:0}.upload input{display:none}.sending{display:block;margin:.25rem 0 0 1.2rem;font-size:.8rem;color:#6c757d}.progress{display:flex;height:6px;margin-bottom:.25rem}.progress-bar{transition:none;background-color:var(--smarterplan-primary)}.error{display:block;margin-left:1.2rem;font-size:.8rem;color:var(--bs-danger, #dc3545)}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
19510
19771
  }
19511
19772
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryFilesComponent, decorators: [{
19512
19773
  type: Component,
19513
- args: [{ selector: "lib-inventory-files", template: `
19514
- <ul class="inventory-files" *ngIf="files; else unknown">
19515
- <li [class.missing]="!files.panoramas">
19516
- {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19517
- <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19518
- </li>
19519
- <li [class.missing]="!files.dataJson">
19520
- {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19521
- <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19522
- </li>
19523
- <li [class.missing]="!files.modelObj">
19524
- {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19525
- <span class="hint" *ngIf="!files.modelObj">
19526
- {{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}
19527
- <label class="btn btn-sm btn-outline-primary rounded-pill upload" *ngIf="uploadPercent === null">
19528
- <input type="file" accept=".obj" (change)="onModelObjSelected($event)">
19529
- {{ "Send the .obj" | translate }}
19530
- </label>
19531
- <span *ngIf="uploadPercent !== null" class="sending">
19532
- <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19533
- <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19534
- </span>
19535
- {{ "Sending" | translate }} {{ uploadName }} — {{ uploadPercent }}%
19536
- </span>
19537
- <span class="error" *ngIf="uploadError">{{ uploadError | translate }}</span>
19538
- </span>
19539
- </li>
19540
- </ul>
19541
- <ng-template #unknown>
19542
- <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19543
- </ng-template>
19544
- `, styles: [".inventory-files{list-style:none;padding-left:0;margin-bottom:.5rem}.missing{color:var(--bs-danger, #dc3545)}.hint{display:block;font-size:.8rem;color:#6c757d;margin-left:1.2rem}.upload{margin-top:.25rem}.upload input{display:none}.sending{display:block;margin-top:.25rem}.progress{display:flex;height:6px;margin-bottom:.25rem}.progress-bar{transition:none;background-color:var(--smarterplan-primary)}.error{display:block;color:var(--bs-danger, #dc3545)}\n"] }]
19774
+ args: [{ selector: "lib-inventory-files", template: `
19775
+ <ul class="inventory-files" *ngIf="files; else unknown">
19776
+ <li [class.missing]="!files.panoramas">
19777
+ {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19778
+ <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19779
+ </li>
19780
+ <li [class.missing]="!files.dataJson">
19781
+ {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19782
+ <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19783
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
19784
+ </li>
19785
+ <li [class.missing]="!files.modelObj">
19786
+ {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19787
+ <span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
19788
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
19789
+ </li>
19790
+ </ul>
19791
+ <ng-template #actions let-file>
19792
+ <span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
19793
+ <label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
19794
+ <input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
19795
+ {{ (files[file.field] ? "Replace" : file.send) | translate }}
19796
+ </label>
19797
+ <button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
19798
+ [disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
19799
+ </span>
19800
+ <span class="file-actions" *ngIf="confirmingDelete === file">
19801
+ <span>{{ "Delete this file?" | translate }}</span>
19802
+ <button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
19803
+ (click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
19804
+ <button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
19805
+ (click)="confirmingDelete = null">{{ "No" | translate }}</button>
19806
+ </span>
19807
+ <span *ngIf="sending === file" class="sending">
19808
+ <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19809
+ <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19810
+ </span>
19811
+ {{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
19812
+ </span>
19813
+ <span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
19814
+ </ng-template>
19815
+ <ng-template #unknown>
19816
+ <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19817
+ </ng-template>
19818
+ `, styles: [".inventory-files{list-style:none;padding-left:0;margin-bottom:.5rem}.missing{color:var(--bs-danger, #dc3545)}.hint{display:block;font-size:.8rem;color:#6c757d;margin-left:1.2rem}.file-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem;margin:.25rem 0 0 1.2rem;font-size:.8rem}.upload{margin-bottom:0}.upload input{display:none}.sending{display:block;margin:.25rem 0 0 1.2rem;font-size:.8rem;color:#6c757d}.progress{display:flex;height:6px;margin-bottom:.25rem}.progress-bar{transition:none;background-color:var(--smarterplan-primary)}.error{display:block;margin-left:1.2rem;font-size:.8rem;color:var(--bs-danger, #dc3545)}\n"] }]
19545
19819
  }], propDecorators: { files: [{
19546
19820
  type: Input
19547
19821
  }], filesChange: [{
19548
19822
  type: Output
19549
19823
  }], model3D: [{
19550
19824
  type: Input
19825
+ }], disabled: [{
19826
+ type: Input
19827
+ }] } });
19828
+
19829
+ /**
19830
+ * A checkbox drawn as an on/off slider, with its label: [(checked)]. The app's own, from when only
19831
+ * its Equipments had one; here for the screens the libraries share.
19832
+ */
19833
+ class CheckboxSliderComponent {
19834
+ /** A key to translate. */
19835
+ label;
19836
+ checked = false;
19837
+ disabled = false;
19838
+ checkedChange = new EventEmitter();
19839
+ onChange(event) {
19840
+ this.checked = event.target.checked;
19841
+ this.checkedChange.emit(this.checked);
19842
+ }
19843
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CheckboxSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19844
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: { label: "label", checked: "checked", disabled: "disabled" }, outputs: { checkedChange: "checkedChange" }, ngImport: i0, template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\n <span class=\"switch\">\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\n <span class=\"slider\"></span>\n </span>\n <span class=\"label\">{{ label | translate }}</span>\n</label>\n", styles: [":host{display:block}.checkbox-slider{display:flex;align-items:center;gap:1rem;margin:0;cursor:pointer}.checkbox-slider.disabled{cursor:default;opacity:.5}.switch{position:relative;display:inline-block;flex:none;width:60px;height:34px;border-radius:34px}.switch input{position:absolute;opacity:0;width:0;height:0}.switch input:checked+.slider{background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary)}.switch input:checked+.slider:before{background:#fff;transform:translate(26px)}.switch input:focus-visible+.slider{outline:2px solid var(--smarterplan-primary);outline-offset:2px}.switch .slider{position:absolute;inset:0;border:1px solid var(--smarterplan-primary);border-radius:34px;transition:.3s}.switch .slider:before{position:absolute;content:\"\";height:26px;width:26px;left:4px;bottom:3px;background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary);border-radius:50%;transition:.3s}\n"], dependencies: [{ kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
19845
+ }
19846
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CheckboxSliderComponent, decorators: [{
19847
+ type: Component,
19848
+ args: [{ selector: "lib-checkbox-slider", template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\n <span class=\"switch\">\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\n <span class=\"slider\"></span>\n </span>\n <span class=\"label\">{{ label | translate }}</span>\n</label>\n", styles: [":host{display:block}.checkbox-slider{display:flex;align-items:center;gap:1rem;margin:0;cursor:pointer}.checkbox-slider.disabled{cursor:default;opacity:.5}.switch{position:relative;display:inline-block;flex:none;width:60px;height:34px;border-radius:34px}.switch input{position:absolute;opacity:0;width:0;height:0}.switch input:checked+.slider{background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary)}.switch input:checked+.slider:before{background:#fff;transform:translate(26px)}.switch input:focus-visible+.slider{outline:2px solid var(--smarterplan-primary);outline-offset:2px}.switch .slider{position:absolute;inset:0;border:1px solid var(--smarterplan-primary);border-radius:34px;transition:.3s}.switch .slider:before{position:absolute;content:\"\";height:26px;width:26px;left:4px;bottom:3px;background-color:var(--smarterplan-primary);box-shadow:2px 2px 10px 0 var(--smarterplan-primary);border-radius:50%;transition:.3s}\n"] }]
19849
+ }], propDecorators: { label: [{
19850
+ type: Input
19851
+ }], checked: [{
19852
+ type: Input
19853
+ }], disabled: [{
19854
+ type: Input
19855
+ }], checkedChange: [{
19856
+ type: Output
19857
+ }] } });
19858
+
19859
+ /**
19860
+ * How many equipment of the previous inventory are deleted at a time. All at once, hundreds of them
19861
+ * at three or more requests each, the API refused part of them and the launch stopped half way; a
19862
+ * request it refuses for coming too fast is now sent again (EquipmentService.deleteEquipment).
19863
+ */
19864
+ const INVENTORY_DELETE_AT_ONCE = 15;
19865
+ /** Where the panel keeps the model and the cutoff score last launched with, in the browser. */
19866
+ const LAST_SETTINGS_KEY = "inventory-launch.last-settings";
19867
+ /**
19868
+ * Launches an AI inventory, of the visits given or of one panorama of the visit, saying first what
19869
+ * it will do: what each visit has of what the inventory needs, and how many equipment the AI added
19870
+ * before, when they are to be deleted. The location's Equipments and its 360° images both launch
19871
+ * theirs from here, so that they offer the same.
19872
+ */
19873
+ class InventoryLaunchComponent {
19874
+ inventoryService;
19875
+ equipmentService;
19876
+ navigationService;
19877
+ spaceID;
19878
+ visits = [];
19879
+ /** Only this panorama of the visit, as it is named: 110ee452_sweep.jpeg. */
19880
+ panorama = null;
19881
+ /** Whether an inventory of the location is running: no other is launched meanwhile. */
19882
+ running = false;
19883
+ cancelled = new EventEmitter();
19884
+ /** Said once an inventory is launched, for its progress to be looked at. */
19885
+ launched = new EventEmitter();
19886
+ models = [];
19887
+ model;
19888
+ cutoffScores = INVENTORY_CUTOFF_SCORES;
19889
+ cutoffScore = INVENTORY_DEFAULT_CUTOFF;
19890
+ /** Whether the equipment the AI added to the location before is deleted first. */
19891
+ deletePrevious = false;
19892
+ /** How many of the location's equipment the AI added, which deletePrevious deletes. */
19893
+ aiEquipmentCount = null;
19894
+ /** While the previous inventory is deleted: how many of its equipment are done, of how many. */
19895
+ deleting = null;
19896
+ /** How many equipment of the previous inventory could not be deleted, for the message. */
19897
+ notDeleted = 0;
19898
+ /** Each visit's latest inventory when it is done and all its detections are still kept. */
19899
+ reusable = {};
19900
+ /**
19901
+ * The visits with detections kept that nothing is waiting for: their latest inventory is done.
19902
+ * A stopped one needs them to resume.
19903
+ */
19904
+ discardable = [];
19905
+ confirmingDiscard = false;
19906
+ discarding = false;
19907
+ /** Whether the saved detections were just discarded, for the panel to say so. */
19908
+ discarded = false;
19909
+ /** The latest reading of the kept detections: an older one answering late is ignored. */
19910
+ keptCheck = 0;
19911
+ /** The latest count of the previous inventory, for the same reason. */
19912
+ countCheck = 0;
19913
+ /**
19914
+ * Whether the launch places the latest inventories' detections again, with the cutoff chosen,
19915
+ * instead of analysing the panoramas: minutes instead of hours.
19916
+ */
19917
+ reuseDetections = false;
19918
+ /** What each visit has of what the inventory needs, by its node; null when the bucket could not be read. */
19919
+ visitFiles = {};
19920
+ checkingFiles = false;
19921
+ launching = false;
19922
+ /** What went wrong, or why nothing was launched, as a key to translate. */
19923
+ message = null;
19924
+ constructor(inventoryService, equipmentService, navigationService) {
19925
+ this.inventoryService = inventoryService;
19926
+ this.equipmentService = equipmentService;
19927
+ this.navigationService = navigationService;
19928
+ }
19929
+ async ngOnInit() {
19930
+ const last = this.lastSettings();
19931
+ if (last?.cutoffScore && this.cutoffScores.includes(last.cutoffScore)) {
19932
+ this.cutoffScore = last.cutoffScore;
19933
+ }
19934
+ this.models = await this.inventoryService.getModels();
19935
+ if (!this.model) {
19936
+ // The one launched with last, from either screen, while it is still offered.
19937
+ this.model = this.models.find((model) => model.id === last?.modelID)
19938
+ ?? (this.models.length === 1 ? this.models[0] : undefined);
19939
+ }
19940
+ }
19941
+ /** The model and the cutoff score last launched with, from either screen; null when unknown. */
19942
+ lastSettings() {
19943
+ try {
19944
+ return JSON.parse(localStorage.getItem(LAST_SETTINGS_KEY)) ?? null;
19945
+ }
19946
+ catch {
19947
+ return null;
19948
+ }
19949
+ }
19950
+ keepSettings() {
19951
+ try {
19952
+ localStorage.setItem(LAST_SETTINGS_KEY,
19953
+ // Reusing, none may be selected: the detections keep their own.
19954
+ JSON.stringify({ modelID: this.model?.id, cutoffScore: this.cutoffScore }));
19955
+ }
19956
+ catch {
19957
+ // Storage blocked or full: the next launch starts from the defaults.
19958
+ }
19959
+ }
19960
+ ngOnChanges(changes) {
19961
+ if (changes.visits) {
19962
+ this.checkFiles();
19963
+ }
19964
+ if (changes.visits || changes.spaceID || changes.panorama || changes.running) {
19965
+ this.findReusable();
19966
+ }
19967
+ }
19968
+ /** Whether the inventory's detections of all its panoramas are among those kept. */
19969
+ keptAll(run, kept) {
19970
+ return run.imagesTotal > 0 && (kept?.[run.id] ?? 0) >= run.imagesTotal;
19971
+ }
19972
+ /** What the bucket has of the visits' detections, for their latest inventories that are done. */
19973
+ async readKept() {
19974
+ const reusable = {};
19975
+ const discardable = [];
19976
+ // One panorama is analysed in a minute or two: nothing to gain.
19977
+ if (!this.spaceID || this.panorama) {
19978
+ return { reusable, discardable };
19979
+ }
19980
+ const latest = this.inventoryService.latestOfEachVisit(await this.inventoryService.getRuns(this.spaceID));
19981
+ const done = new Map(latest
19982
+ .filter((run) => this.inventoryService.state(run) === "done")
19983
+ .map((run) => [run.nodeID, run]));
19984
+ const visits = (this.visits ?? []).filter((visit) => done.has(visit.nodeID));
19985
+ const kept = await Promise.all(visits.map((visit) => this.inventoryService.keptDetections(visit.model3D)));
19986
+ visits.forEach((visit, index) => {
19987
+ if (Object.keys(kept[index] ?? {}).length === 0) {
19988
+ return;
19989
+ }
19990
+ discardable.push(visit);
19991
+ const run = done.get(visit.nodeID);
19992
+ if (this.keptAll(run, kept[index])) {
19993
+ reusable[visit.nodeID] = run;
19994
+ }
19995
+ });
19996
+ return { reusable, discardable };
19997
+ }
19998
+ async findReusable() {
19999
+ const check = ++this.keptCheck;
20000
+ let found = {
20001
+ reusable: {},
20002
+ discardable: [],
20003
+ };
20004
+ try {
20005
+ found = await this.readKept();
20006
+ }
20007
+ catch (error) {
20008
+ console.warn("Inventories not read", error);
20009
+ }
20010
+ if (check !== this.keptCheck) {
20011
+ return;
20012
+ }
20013
+ this.reusable = found.reusable;
20014
+ this.discardable = found.discardable;
20015
+ if (this.discardable.length === 0) {
20016
+ this.confirmingDiscard = false;
20017
+ }
20018
+ if (!this.canReuse) {
20019
+ this.reuseDetections = false;
20020
+ }
20021
+ }
20022
+ /**
20023
+ * Every visit to analyse has a finished inventory of all its panoramas, with all its detections
20024
+ * kept: placing them again takes minutes, and analyses nothing. They are placed again under one
20025
+ * model, so all must come from the same.
20026
+ */
20027
+ get canReuse() {
20028
+ const visits = this.launchableVisits;
20029
+ const model = this.reusable[visits[0]?.nodeID]?.MLInventoryModelID;
20030
+ return visits.length > 0 && visits.every((visit) => {
20031
+ const run = this.reusable[visit.nodeID];
20032
+ return !!run && run.imagesTotal === this.visitFiles[visit.nodeID]?.panoramas
20033
+ && run.MLInventoryModelID === model;
20034
+ });
20035
+ }
20036
+ /** The model of the detections placed again: the one the launch uses when it reuses them. */
20037
+ get reusedModelName() {
20038
+ return this.reusable[this.launchableVisits[0]?.nodeID]?.MLInventoryModelName ?? "";
20039
+ }
20040
+ onFilesChange(visit, files) {
20041
+ this.visitFiles[visit.nodeID] = files;
20042
+ if (!this.canReuse) {
20043
+ this.reuseDetections = false;
20044
+ }
20045
+ if (this.deletePrevious) {
20046
+ // A visit gained or lost a file: what gets deleted depends on the visits analysed.
20047
+ this.countPrevious();
20048
+ }
20049
+ }
20050
+ /** Deletes the detections kept for the visits whose inventory is done. The equipment stays. */
20051
+ async onConfirmDiscard() {
20052
+ this.discarding = true;
20053
+ this.message = null;
20054
+ this.discarded = false;
20055
+ try {
20056
+ // Read again: an inventory launched since, from here or elsewhere, may need them.
20057
+ const { discardable } = await this.readKept();
20058
+ const failed = await Promise.all(discardable.map((visit) => this.inventoryService.discardDetections(visit.model3D)));
20059
+ this.notDeleted = failed.reduce((total, count) => total + count, 0);
20060
+ if (this.notDeleted > 0) {
20061
+ this.message = "{{count}} saved detections could not be discarded: try again.";
20062
+ }
20063
+ else {
20064
+ this.discarded = discardable.length > 0;
20065
+ }
20066
+ }
20067
+ catch (error) {
20068
+ console.error("Detections not discarded", error);
20069
+ this.message = "The saved detections could not be discarded.";
20070
+ }
20071
+ finally {
20072
+ this.discarding = false;
20073
+ this.confirmingDiscard = false;
20074
+ await this.findReusable();
20075
+ }
20076
+ }
20077
+ onReuseChange(reuse) {
20078
+ this.reuseDetections = reuse;
20079
+ if (reuse && !this.deletePrevious) {
20080
+ // Placed again beside those placed before, every object would be there twice.
20081
+ this.onDeletePreviousChange(true);
20082
+ }
20083
+ }
20084
+ async checkFiles() {
20085
+ const visits = this.visits ?? [];
20086
+ this.checkingFiles = true;
20087
+ try {
20088
+ const files = await Promise.all(visits.map((visit) => this.inventoryService.checkFiles(visit.model3D)));
20089
+ // Other visits may have come meanwhile, checked by their own call.
20090
+ if (visits === this.visits) {
20091
+ this.visitFiles = Object.fromEntries(visits.map((visit, index) => [visit.nodeID, files[index]]));
20092
+ if (this.deletePrevious) {
20093
+ this.countPrevious();
20094
+ }
20095
+ }
20096
+ }
20097
+ finally {
20098
+ if (visits === this.visits) {
20099
+ this.checkingFiles = false;
20100
+ }
20101
+ }
20102
+ }
20103
+ /** The visits that will be analysed: those with nothing known to be missing. */
20104
+ get launchableVisits() {
20105
+ return (this.visits ?? []).filter((visit) => {
20106
+ const files = this.visitFiles[visit.nodeID];
20107
+ return !files || this.inventoryService.isComplete(files);
20108
+ });
20109
+ }
20110
+ get canLaunch() {
20111
+ // Reusing, the model is the one of the detections, whatever is selected.
20112
+ return (!!this.model || (this.reuseDetections && this.canReuse))
20113
+ && !this.running && !this.launching && !this.discarding
20114
+ && !this.checkingFiles && this.launchableVisits.length > 0;
20115
+ }
20116
+ async onDeletePreviousChange(deletePrevious) {
20117
+ if (!deletePrevious && this.reuseDetections) {
20118
+ // Placed again beside those placed before, every object would be there twice.
20119
+ return;
20120
+ }
20121
+ this.deletePrevious = deletePrevious;
20122
+ if (deletePrevious) {
20123
+ await this.countPrevious();
20124
+ }
20125
+ }
20126
+ /** Counts what the launch would delete: it depends on the visits analysed. */
20127
+ async countPrevious() {
20128
+ const check = ++this.countCheck;
20129
+ this.aiEquipmentCount = null;
20130
+ let count = null;
20131
+ try {
20132
+ count = (await this.aiEquipments()).length;
20133
+ }
20134
+ catch (error) {
20135
+ console.warn("Previous inventory not counted", error);
20136
+ }
20137
+ if (check === this.countCheck) {
20138
+ this.aiEquipmentCount = count;
20139
+ }
20140
+ }
20141
+ /**
20142
+ * The equipment the AI added to the visits analysed, known by the panoramas their tags are at:
20143
+ * a visit left out, for a missing file, keeps its own. One whose tag has no panorama cannot be
20144
+ * told apart, and is deleted only when every visit is analysed again.
20145
+ */
20146
+ async aiEquipments() {
20147
+ const visits = this.launchableVisits;
20148
+ const everyVisit = visits.length === (this.visits ?? []).length;
20149
+ const [equipments, navigations] = await Promise.all([
20150
+ this.equipmentService.getEquipmentsForSpace(this.spaceID),
20151
+ Promise.all(visits.map((visit) => this.navigationService.getNavigationsForNode(visit.nodeID))),
20152
+ ]);
20153
+ const sweeps = new Set(navigations.flat().map((navigation) => navigation?.matterportSweepID).filter((sweep) => !!sweep));
20154
+ return equipments.filter((equip) => {
20155
+ if (!equip.isCreatedByAI) {
20156
+ return false;
20157
+ }
20158
+ const placedAt = (equip.pois?.items ?? [])
20159
+ .map((poi) => poi?.matterportSweepID)
20160
+ .filter((sweep) => !!sweep);
20161
+ return placedAt.length === 0 ? everyVisit : placedAt.some((sweep) => sweeps.has(sweep));
20162
+ });
20163
+ }
20164
+ /**
20165
+ * Deletes the equipment a few at a time, going on past one that fails (its error logged), and
20166
+ * says how many could not be deleted.
20167
+ */
20168
+ async deleteFewAtATime(equipments) {
20169
+ let failed = 0;
20170
+ this.deleting = { done: 0, total: equipments.length };
20171
+ try {
20172
+ for (let start = 0; start < equipments.length; start += INVENTORY_DELETE_AT_ONCE) {
20173
+ const batch = equipments.slice(start, start + INVENTORY_DELETE_AT_ONCE);
20174
+ const results = await Promise.allSettled(
20175
+ // Just loaded: an operation-less equipment's operations are not looked for again.
20176
+ batch.map((equip) => this.equipmentService.deleteEquipment(equip, true)));
20177
+ results.forEach((result, i) => {
20178
+ if (result.status === "rejected") {
20179
+ failed += 1;
20180
+ console.error("Equipment not deleted", batch[i].id, result.reason);
20181
+ }
20182
+ });
20183
+ this.deleting.done += batch.length;
20184
+ }
20185
+ }
20186
+ finally {
20187
+ this.deleting = null;
20188
+ }
20189
+ return failed;
20190
+ }
20191
+ async onLaunchClick() {
20192
+ this.launching = true;
20193
+ this.message = null;
20194
+ this.discarded = false;
20195
+ try {
20196
+ const visits = this.launchableVisits;
20197
+ const reuse = this.reuseDetections && this.canReuse;
20198
+ const reusedRuns = reuse ? visits.map((visit) => this.reusable[visit.nodeID]) : [];
20199
+ if (reuse) {
20200
+ // Checked before deleting anything: without them, the previous equipment would be
20201
+ // gone and every panorama analysed again, for hours.
20202
+ const kept = await Promise.all(visits.map((visit) => this.inventoryService.keptDetections(visit.model3D)));
20203
+ if (!reusedRuns.every((run, index) => this.keptAll(run, kept[index]))) {
20204
+ this.message = "The saved detections are no longer available.";
20205
+ this.reuseDetections = false;
20206
+ this.findReusable();
20207
+ return;
20208
+ }
20209
+ }
20210
+ // Reusing always deletes them: placed again beside them, every object would be there twice.
20211
+ if (this.deletePrevious || reuse) {
20212
+ this.notDeleted = await this.deleteFewAtATime(await this.aiEquipments());
20213
+ this.aiEquipmentCount = null;
20214
+ if (this.notDeleted > 0) {
20215
+ // Launched anyway, the new equipment would sit beside what is left of the old.
20216
+ this.message = "{{count}} equipment of the previous inventory could not be deleted: launch again to retry.";
20217
+ return;
20218
+ }
20219
+ }
20220
+ // Placed again, the detections keep the model that made them.
20221
+ const reused = reusedRuns[0];
20222
+ const launched = await this.inventoryService.launch(this.spaceID, visits.map((visit) => visit.nodeID), reused
20223
+ ? { id: reused.MLInventoryModelID, name: reused.MLInventoryModelName }
20224
+ : this.model, Number(this.cutoffScore),
20225
+ // Panoramas are named after their sweep's first 8 characters.
20226
+ this.panorama ? this.panorama.split("_")[0] : undefined, Object.fromEntries(reusedRuns.map((run) => [run.nodeID, run.id])));
20227
+ if (launched === "ALREADY_RUNNING") {
20228
+ this.message = "An inventory is already running for this location.";
20229
+ return;
20230
+ }
20231
+ this.reuseDetections = false;
20232
+ this.findReusable();
20233
+ this.keepSettings();
20234
+ this.launched.emit();
20235
+ }
20236
+ catch (error) {
20237
+ console.error("Inventory not launched", error);
20238
+ this.message = "The inventory could not be launched.";
20239
+ }
20240
+ finally {
20241
+ this.launching = false;
20242
+ }
20243
+ }
20244
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryLaunchComponent, deps: [{ token: InventoryService }, { token: EquipmentService }, { token: NavigationService }], target: i0.ɵɵFactoryTarget.Component });
20245
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: InventoryLaunchComponent, selector: "lib-inventory-launch", inputs: { spaceID: "spaceID", visits: "visits", panorama: "panorama", running: "running" }, outputs: { cancelled: "cancelled", launched: "launched" }, usesOnChanges: true, ngImport: i0, template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\n<p *ngIf=\"!panorama\">{{ 'The AI will look for equipment in the visits of this location and add what it finds to it.' | translate }}</p>\n\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\n</ul>\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\n <li>{{ 'Visits to analyse' | translate }}:\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\n</ul>\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\n\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\n<ng-container *ngIf=\"!checkingFiles\">\n <div *ngFor=\"let visit of visits\">\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\n </div>\n</ng-container>\n\n<div class=\"inventory-launch-delete\">\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\n </span>\n</div>\n\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\n </span>\n</div>\n\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\n {{ 'Discard the saved detections' | translate }}</button>\n <span class=\"inventory-launch-hint\">\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\n </span>\n </ng-container>\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\n <span class=\"inventory-launch-hint\">\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\n </span>\n <div class=\"inventory-launch-confirm\">\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\n </div>\n </ng-container>\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\n</div>\n\n<div class=\"inventory-launch-settings\">\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\n </select>\n <!-- Reusing, the detections keep the model that made them. -->\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\n [title]=\"'The detections keep the model that made them.' | translate\">\n <option>{{ reusedModelName | translate }}</option>\n </select>\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\n </select>\n</div>\n\n<div class=\"inventory-launch-buttons\">\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\n</div>\n\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\n", styles: [":host{display:block}.inventory-launch-summary{padding-left:1.2rem;margin-bottom:.5rem}.inventory-launch-delete{margin:.75rem 0}.inventory-launch-hint{display:block;margin-top:.25rem;font-size:.8rem;color:#6c757d}.inventory-launch-confirm{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}.inventory-launch-settings{display:flex;flex-wrap:wrap;gap:.5rem}.inventory-launch-settings select{flex:1 1 10rem}.inventory-launch-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}\n"], dependencies: [{ kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: LoaderComponent, selector: "lib-loader", inputs: ["useLogo", "color"] }, { kind: "component", type: InventoryFilesComponent, selector: "lib-inventory-files", inputs: ["files", "model3D", "disabled"], outputs: ["filesChange"] }, { kind: "component", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: ["label", "checked", "disabled"], outputs: ["checkedChange"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
20246
+ }
20247
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryLaunchComponent, decorators: [{
20248
+ type: Component,
20249
+ args: [{ selector: "lib-inventory-launch", template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\n<p *ngIf=\"!panorama\">{{ 'The AI will look for equipment in the visits of this location and add what it finds to it.' | translate }}</p>\n\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\n</ul>\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\n <li>{{ 'Visits to analyse' | translate }}:\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\n</ul>\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\n\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\n<ng-container *ngIf=\"!checkingFiles\">\n <div *ngFor=\"let visit of visits\">\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\n </div>\n</ng-container>\n\n<div class=\"inventory-launch-delete\">\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\n </span>\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\n </span>\n</div>\n\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\n </span>\n</div>\n\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\n {{ 'Discard the saved detections' | translate }}</button>\n <span class=\"inventory-launch-hint\">\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\n </span>\n </ng-container>\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\n <span class=\"inventory-launch-hint\">\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\n </span>\n <div class=\"inventory-launch-confirm\">\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\n </div>\n </ng-container>\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\n</div>\n\n<div class=\"inventory-launch-settings\">\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\n </select>\n <!-- Reusing, the detections keep the model that made them. -->\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\n [title]=\"'The detections keep the model that made them.' | translate\">\n <option>{{ reusedModelName | translate }}</option>\n </select>\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\n </select>\n</div>\n\n<div class=\"inventory-launch-buttons\">\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\n</div>\n\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\n", styles: [":host{display:block}.inventory-launch-summary{padding-left:1.2rem;margin-bottom:.5rem}.inventory-launch-delete{margin:.75rem 0}.inventory-launch-hint{display:block;margin-top:.25rem;font-size:.8rem;color:#6c757d}.inventory-launch-confirm{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.25rem}.inventory-launch-settings{display:flex;flex-wrap:wrap;gap:.5rem}.inventory-launch-settings select{flex:1 1 10rem}.inventory-launch-buttons{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.75rem}\n"] }]
20250
+ }], ctorParameters: () => [{ type: InventoryService }, { type: EquipmentService }, { type: NavigationService }], propDecorators: { spaceID: [{
20251
+ type: Input
20252
+ }], visits: [{
20253
+ type: Input
20254
+ }], panorama: [{
20255
+ type: Input
20256
+ }], running: [{
20257
+ type: Input
20258
+ }], cancelled: [{
20259
+ type: Output
20260
+ }], launched: [{
20261
+ type: Output
19551
20262
  }] } });
19552
20263
 
19553
20264
  class NgxSmarterplanCoreModule {
@@ -19579,7 +20290,9 @@ class NgxSmarterplanCoreModule {
19579
20290
  FormatDateNumberToDigitsPipe,
19580
20291
  SplatViewerComponent,
19581
20292
  InventoryRunsComponent,
19582
- InventoryFilesComponent], imports: [FormsModule,
20293
+ InventoryFilesComponent,
20294
+ InventoryLaunchComponent,
20295
+ CheckboxSliderComponent], imports: [FormsModule,
19583
20296
  ReactiveFormsModule,
19584
20297
  CommonModule,
19585
20298
  RouterModule,
@@ -19597,7 +20310,9 @@ class NgxSmarterplanCoreModule {
19597
20310
  AvatarComponent,
19598
20311
  SplatViewerComponent,
19599
20312
  InventoryRunsComponent,
19600
- InventoryFilesComponent] });
20313
+ InventoryFilesComponent,
20314
+ InventoryLaunchComponent,
20315
+ CheckboxSliderComponent] });
19601
20316
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NgxSmarterplanCoreModule, imports: [FormsModule,
19602
20317
  ReactiveFormsModule,
19603
20318
  CommonModule,
@@ -19628,7 +20343,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19628
20343
  FormatDateNumberToDigitsPipe,
19629
20344
  SplatViewerComponent,
19630
20345
  InventoryRunsComponent,
19631
- InventoryFilesComponent
20346
+ InventoryFilesComponent,
20347
+ InventoryLaunchComponent,
20348
+ CheckboxSliderComponent
19632
20349
  ],
19633
20350
  imports: [
19634
20351
  FormsModule,
@@ -19656,6 +20373,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19656
20373
  SplatViewerComponent,
19657
20374
  InventoryRunsComponent,
19658
20375
  InventoryFilesComponent,
20376
+ InventoryLaunchComponent,
20377
+ CheckboxSliderComponent,
19659
20378
  ]
19660
20379
  }]
19661
20380
  }] });
@@ -19715,27 +20434,27 @@ class BaseTagService {
19715
20434
  throw new Error('updatePoiMetadata is not implemented in the base class.');
19716
20435
  }*/
19717
20436
  async prepareEquipmentHtml(equip) {
19718
- throw new Error(`prepareEquipmentHtml is not implemented in the base class.
20437
+ throw new Error(`prepareEquipmentHtml is not implemented in the base class.
19719
20438
  Please override this method in your extended class.`);
19720
20439
  }
19721
20440
  async prepareTicketHtml(ticket) {
19722
- throw new Error(`prepareTicketHtml is not implemented in the base class.
20441
+ throw new Error(`prepareTicketHtml is not implemented in the base class.
19723
20442
  Please override this method in your extended class.`);
19724
20443
  }
19725
20444
  async prepareFeatureHtml(feature) {
19726
- throw new Error(`prepareFeatureHtml is not implemented in the base class.
20445
+ throw new Error(`prepareFeatureHtml is not implemented in the base class.
19727
20446
  Please override this method in your extended class.`);
19728
20447
  }
19729
20448
  async prepareMeasurementHtml(measure) {
19730
- throw new Error(`prepareMeasurementHtml is not implemented in the base class.
20449
+ throw new Error(`prepareMeasurementHtml is not implemented in the base class.
19731
20450
  Please override this method in your extended class.`);
19732
20451
  }
19733
20452
  async prepareDeskHtml(feature) {
19734
- throw new Error(`prepareDeskHtml is not implemented in the base class.
20453
+ throw new Error(`prepareDeskHtml is not implemented in the base class.
19735
20454
  Please override this method in your extended class.`);
19736
20455
  }
19737
20456
  async prepareIndicatorHtml(feature) {
19738
- throw new Error(`prepareDeskHtml is not implemented in the base class.
20457
+ throw new Error(`prepareDeskHtml is not implemented in the base class.
19739
20458
  Please override this method in your extended class.`);
19740
20459
  }
19741
20460
  async getSignedTagIconSource(tagIconSrc) {
@@ -19744,15 +20463,15 @@ class BaseTagService {
19744
20463
  getIconTagImageForFeature(feature, poi) {
19745
20464
  // const tagIcon = JSON.parse(poi.tagIcon);
19746
20465
  // return tagIcon.src;
19747
- throw new Error(`getIconTagImageForFeature is not implemented in the base class.
20466
+ throw new Error(`getIconTagImageForFeature is not implemented in the base class.
19748
20467
  Please override this method in your extended class.`);
19749
20468
  }
19750
20469
  getScriptForTag(object, tagType) {
19751
- throw new Error(`getScriptForTag is not implemented in the base class.
20470
+ throw new Error(`getScriptForTag is not implemented in the base class.
19752
20471
  Please override this method in your extended class.`);
19753
20472
  }
19754
20473
  getAnnexeForCommentTypeInFeature(feature, commentType) {
19755
- throw new Error(`getAnnexeForCommentTypeInFeature is not implemented in the base class.
20474
+ throw new Error(`getAnnexeForCommentTypeInFeature is not implemented in the base class.
19756
20475
  Please override this method in your extended class.`);
19757
20476
  }
19758
20477
  getBillboardMediaToEmbed(object) {
@@ -19761,27 +20480,27 @@ class BaseTagService {
19761
20480
  return { comment: null, tagDescription: '' };
19762
20481
  }
19763
20482
  onActionDetailClick(url) {
19764
- throw new Error(`onActionDetailClick is not implemented in the base class.
20483
+ throw new Error(`onActionDetailClick is not implemented in the base class.
19765
20484
  Please override this method in your extended class.`);
19766
20485
  }
19767
20486
  onActionAudioClick(audioCommentID) {
19768
- throw new Error(`onActionDetailClick is not implemented in the base class.
20487
+ throw new Error(`onActionDetailClick is not implemented in the base class.
19769
20488
  Please override this method in your extended class.`);
19770
20489
  }
19771
20490
  onActionVideoClick(url) {
19772
- throw new Error(`onActionVideoClick is not implemented in the base class.
20491
+ throw new Error(`onActionVideoClick is not implemented in the base class.
19773
20492
  Please override this method in your extended class.`);
19774
20493
  }
19775
20494
  onActionImageClick(imageCommentID) {
19776
- throw new Error(`onActionImageClick is not implemented in the base class.
20495
+ throw new Error(`onActionImageClick is not implemented in the base class.
19777
20496
  Please override this method in your extended class.`);
19778
20497
  }
19779
20498
  onActionDocClick(url) {
19780
- throw new Error(`onActionDocClick is not implemented in the base class.
20499
+ throw new Error(`onActionDocClick is not implemented in the base class.
19781
20500
  Please override this method in your extended class.`);
19782
20501
  }
19783
20502
  onActionYoutubeClick(url) {
19784
- throw new Error(`onActionYoutubeClick is not implemented in the base class.
20503
+ throw new Error(`onActionYoutubeClick is not implemented in the base class.
19785
20504
  Please override this method in your extended class.`);
19786
20505
  }
19787
20506
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseTagService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -24078,5 +24797,5 @@ function floatValidator() {
24078
24797
  * Generated bundle index. Do not edit.
24079
24798
  */
24080
24799
 
24081
- export { AffectationService, AvatarComponent, BaseLateralTabService, BaseTagService, BaseUserService, BaseVisibilityService, CameraMode, CaptureService, CaptureViewer, CommentService, CommentType, Config, ContentService, CsvExportComponent, DomainService, DomainType, DurationToStringPipe, EmailStatus, EquipmentService, EventService, EventStatus, EventType, FeatureService, FeatureType, FilterService, GAUSSIAN_SPLAT_PLY_SUFFIX, HashtagFromIdPipe, HashtagService, INVENTORY_CUTOFF_SCORES, INVENTORY_DEFAULT_CUTOFF, INVENTORY_STALE_AFTER_MS, InterventionService, InventoryFilesComponent, InventoryRunsComponent, InventoryService, InventoryStatus, LayerService, LevelStatus, LoaderComponent, Locale, LocaleService, MATTERPORT_SDK_KEY, MatterportImportService, MatterportService, MatterportTagCopyService, MatterportViewType, MattertagActionMode, MattertagData, MeasurementService, MenuBarComponent, MissionService, NavigationService, NavigatorService, NgxSmarterplanCoreModule, NgxSmarterplanCoreService, NodeService, Object3DService, OperationService, OrganisationService, PLAN_ICONS, PaymentStatus, PlanService, PoiService, PoiType, ProfileEntity, ProfileService, ProfileStatus, PropertyService, PropertyType, RoleStatus, SafeUrlPipe, SearchBarComponent, SearchObjectType, SearchService, SpModule, SpaceService, SpaceStatus, SplatViewerComponent, StatusEquipment, SupportModalComponent, SupportService, SweepLocatorService, THREEJS_MODEL_UP_OPTIONS, TagAction, TemplateService, ThreeJsImportService, ThreeJsService, TicketPriority, TicketStatus, TicketType, TicketsService, TimeDateToLocalStringPipe, TypeNote, UsernameFromIdPipe, VIEWER_BACKGROUND, ValidatorsService, ViewerInteractions, ViewerService, VisitService, ZoneChangeService, ZoneService, applyRigidTransformToDirection, applyRigidTransformToPoint, applyRigidTransformToYRotationDeg, arraysContainSameElements, checkElementById, computeRigidTransform, convertObjToGlb, convertTimestampToLocalZone, copyFileInS3, copyFileInS3ViaDownload, dateHasExpired, dateTimeToLocalString, deleteFromS3, distance, downloadBlob, downloadEquipmentDocument, downloadFile, downloadFileAsObject, durationToString, emailValidator, enumToArray, filterUniqueArrayByID, floatValidator, getBufferForFileFromS3, getCoefficientsForImage, getCurrentLang, getDistanceBetweenTwoPoints, getHighestLevelForMissions, getHighestRoleForMissions, getLevelsBelow, getLocaleLong, getLocaleShort, getMetaForImage, getRolesBelowForManager, getSignedFile, getSignedImageUrlForEquipment, getSignedImageUrlForProfile, getSignedImageUrlForSpace, getSpaceIDFromUrl, getThreeJsPoiOrigin, getVisitUrl, hasObjModel, iconData, iconToDataUrl, isEmptyObject, isGaussianSplatFile, isGaussianSplatPly, isStreamedSplatFile, listFilesInFolder, mean, noEmptyValidator, numberToDateString, openDocument, openModalForVisitSwitch, parseThreeJsPlacement, poiTypeToString, pointToString, readObj, removeAllFilesFromFolderS3, removeNullKeysFromObject, showScanPointsOnPlanInDiv, shuffleArray, solveThreeJsAlignment, sortAlphabeticallyOnName, stringLocaleToEnum, stringToLowercaseNoSpaces, styleButton, svgToDataUrl, textValidator, translateDatePeriod, uploadBase64Image, uploadBase64ImageWithRetry, uploadFileToS3, uploadFileToS3WithProgress, uploadJsonToS3, validEmail, wait, waitUntil };
24800
+ export { AffectationService, AvatarComponent, BaseLateralTabService, BaseTagService, BaseUserService, BaseVisibilityService, CameraMode, CaptureService, CaptureViewer, CheckboxSliderComponent, CommentService, CommentType, Config, ContentService, CsvExportComponent, DomainService, DomainType, DurationToStringPipe, EmailStatus, EquipmentService, EventService, EventStatus, EventType, FeatureService, FeatureType, FilterService, GAUSSIAN_SPLAT_PLY_SUFFIX, HashtagFromIdPipe, HashtagService, INVENTORY_CUTOFF_SCORES, INVENTORY_DEFAULT_CUTOFF, INVENTORY_DELETE_AT_ONCE, INVENTORY_MESH_FILE, INVENTORY_POSITIONS_FILE, INVENTORY_STALE_AFTER_MS, InterventionService, InventoryFilesComponent, InventoryLaunchComponent, InventoryRunsComponent, InventoryService, InventoryStatus, LayerService, LevelStatus, LoaderComponent, Locale, LocaleService, MATTERPORT_SDK_KEY, MatterportImportService, MatterportService, MatterportTagCopyService, MatterportViewType, MattertagActionMode, MattertagData, MeasurementService, MenuBarComponent, MissionService, NavigationService, NavigatorService, NgxSmarterplanCoreModule, NgxSmarterplanCoreService, NodeService, Object3DService, OperationService, OrganisationService, PLAN_ICONS, PaymentStatus, PlanService, PoiService, PoiType, ProfileEntity, ProfileService, ProfileStatus, PropertyService, PropertyType, RoleStatus, SafeUrlPipe, SearchBarComponent, SearchObjectType, SearchService, SpModule, SpaceService, SpaceStatus, SplatViewerComponent, StatusEquipment, SupportModalComponent, SupportService, SweepLocatorService, THREEJS_MODEL_UP_OPTIONS, TagAction, TemplateService, ThreeJsImportService, ThreeJsService, TicketPriority, TicketStatus, TicketType, TicketsService, TimeDateToLocalStringPipe, TypeNote, UsernameFromIdPipe, VIEWER_BACKGROUND, ValidatorsService, ViewerInteractions, ViewerService, VisitService, ZoneChangeService, ZoneService, applyRigidTransformToDirection, applyRigidTransformToPoint, applyRigidTransformToYRotationDeg, arraysContainSameElements, checkElementById, computeRigidTransform, convertObjToGlb, convertTimestampToLocalZone, copyFileInS3, copyFileInS3ViaDownload, dateHasExpired, dateTimeToLocalString, deleteFromS3, distance, downloadBlob, downloadEquipmentDocument, downloadFile, downloadFileAsObject, durationToString, emailValidator, enumToArray, filterUniqueArrayByID, floatValidator, getBufferForFileFromS3, getCoefficientsForImage, getCurrentLang, getDistanceBetweenTwoPoints, getHighestLevelForMissions, getHighestRoleForMissions, getLevelsBelow, getLocaleLong, getLocaleShort, getMetaForImage, getRolesBelowForManager, getSignedFile, getSignedImageUrlForEquipment, getSignedImageUrlForProfile, getSignedImageUrlForSpace, getSpaceIDFromUrl, getThreeJsPoiOrigin, getVisitUrl, hasObjModel, iconData, iconToDataUrl, isEmptyObject, isGaussianSplatFile, isGaussianSplatPly, isStreamedSplatFile, listFilesInFolder, mean, noEmptyValidator, numberToDateString, openDocument, openModalForVisitSwitch, parseThreeJsPlacement, poiTypeToString, pointToString, readObj, removeAllFilesFromFolderS3, removeNullKeysFromObject, showScanPointsOnPlanInDiv, shuffleArray, solveThreeJsAlignment, sortAlphabeticallyOnName, stringLocaleToEnum, stringToLowercaseNoSpaces, styleButton, svgToDataUrl, textValidator, translateDatePeriod, uploadBase64Image, uploadBase64ImageWithRetry, uploadFileToS3, uploadFileToS3WithProgress, uploadJsonToS3, validEmail, wait, waitUntil };
24082
24801
  //# sourceMappingURL=smarterplan-ngx-smarterplan-core.mjs.map