@smarterplan/ngx-smarterplan-core 1.4.28 → 1.4.30

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 (125) hide show
  1. package/README.md +24 -24
  2. package/esm2022/lib/components/checkbox-slider/checkbox-slider.component.mjs +3 -3
  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 +301 -25
  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 +1 -1
  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 +1 -1
  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 +930 -138
  47. package/esm2022/lib/services/matterport-tag.service.mjs +1 -1
  48. package/esm2022/lib/services/matterport.service.mjs +17 -17
  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 +30 -23
  55. package/esm2022/lib/services/models/event.service.mjs +1 -1
  56. package/esm2022/lib/services/models/feature.service.mjs +1 -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 +1 -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 +1 -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 +22 -5
  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 +26 -1
  90. package/esm2022/lib/services/utils/object3d-model.util.mjs +155 -0
  91. package/esm2022/lib/services/utils/tag-archive.util.mjs +89 -0
  92. package/esm2022/lib/services/validators.service.mjs +1 -1
  93. package/esm2022/lib/services/viewer.service.mjs +1 -1
  94. package/esm2022/lib/services/zone-drawer.service.mjs +1 -1
  95. package/esm2022/lib/services/zoneChange.service.mjs +1 -1
  96. package/esm2022/lib/tokens/matterport-sdk-key.token.mjs +1 -1
  97. package/esm2022/lib/tokens/object3d-model-upload.token.mjs +14 -0
  98. package/esm2022/lib/types.service.mjs +1 -1
  99. package/esm2022/lib/validators/email.directive.mjs +1 -1
  100. package/esm2022/lib/validators/no-empty.directive.mjs +1 -1
  101. package/esm2022/lib/validators/number.directive.mjs +1 -1
  102. package/esm2022/lib/validators/text.directive.mjs +1 -1
  103. package/esm2022/public-api.mjs +4 -1
  104. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +1965 -390
  105. package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
  106. package/lib/components/inventory-runs/inventory-files.component.d.ts +37 -8
  107. package/lib/components/inventory-runs/inventory-launch.component.d.ts +69 -2
  108. package/lib/components/inventory-runs/inventory-runs.component.d.ts +7 -0
  109. package/lib/services/matterport-tag-copy.service.d.ts +233 -13
  110. package/lib/services/models/equipment.service.d.ts +9 -1
  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/operation.service.d.ts +10 -0
  114. package/lib/services/retry-when-throttled.d.ts +5 -0
  115. package/lib/services/s3.service.d.ts +15 -0
  116. package/lib/services/utils/matterport-transform.util.d.ts +14 -0
  117. package/lib/services/utils/object3d-model.util.d.ts +58 -0
  118. package/lib/services/utils/tag-archive.util.d.ts +97 -0
  119. package/lib/tokens/object3d-model-upload.token.d.ts +10 -0
  120. package/package.json +2 -1
  121. package/public-api.d.ts +3 -0
  122. package/src/assets/viewers/splat/convert.html +11 -11
  123. package/src/assets/viewers/splat/index.html +90 -90
  124. package/src/assets/viewers/splat/webp.wasm +0 -0
  125. package/src/assets/vs-app.json +67 -67
@@ -10,7 +10,7 @@ import * as i1 from '@angular/router';
10
10
  import { RouterModule } from '@angular/router';
11
11
  import { Subject, BehaviorSubject, takeUntil, Observable } from 'rxjs';
12
12
  import * as THREE from 'three';
13
- import { Matrix4, Vector3, Color, Object3D, Euler, PerspectiveCamera, CylinderBufferGeometry, BoxGeometry, MeshBasicMaterial, NormalBlending, BackSide, Mesh, EdgesGeometry, AdditiveBlending, ShaderMaterial, AnimationMixer, VectorKeyframeTrack, InterpolateSmooth, AnimationClip, LoopOnce, Group, PlaneBufferGeometry, CanvasTexture, Texture, LinearFilter, Box3, MathUtils } from 'three';
13
+ import { Matrix4, Vector3, Color, Object3D, Euler, PerspectiveCamera, CylinderBufferGeometry, BoxGeometry, MeshBasicMaterial, NormalBlending, BackSide, Mesh, EdgesGeometry, AdditiveBlending, ShaderMaterial, AnimationMixer, VectorKeyframeTrack, InterpolateSmooth, AnimationClip, LoopOnce, Group, PlaneBufferGeometry, CanvasTexture, Texture, LinearFilter, Box3, MathUtils, Quaternion } from 'three';
14
14
  import * as BufferGeometryUtils from 'three/examples/jsm/utils/BufferGeometryUtils.js';
15
15
  import { Storage, Auth, API, graphqlOperation, Cache } from 'aws-amplify';
16
16
  import { DateTime } from 'luxon';
@@ -47,6 +47,7 @@ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
47
47
  import checkIcon from '@iconify/icons-mdi/check';
48
48
  import * as CryptoJS from 'crypto-js';
49
49
  import { v4 } from 'uuid';
50
+ import { strToU8, zipSync, unzipSync, strFromU8 } from 'fflate';
50
51
 
51
52
  class NgxSmarterplanCoreService {
52
53
  constructor() { }
@@ -775,30 +776,30 @@ class SecurityCamera extends SceneComponent {
775
776
  }
776
777
  }
777
778
  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
- }
779
+ return `
780
+ uniform mat4 lightMatrix;
781
+
782
+ varying vec4 vLightCoords;
783
+
784
+ void main() {
785
+ // create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
786
+ vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
787
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
788
+ }
788
789
  `;
789
790
  }
790
791
  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
- }
792
+ return `
793
+ uniform vec3 color;
794
+
795
+ varying vec4 vLightCoords;
796
+
797
+ void main() {
798
+ vec2 lightUV = vLightCoords.xy / vLightCoords.w;
799
+ float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
800
+
801
+ gl_FragColor = vec4(color, min(inView, 0.2));
802
+ }
802
803
  `;
803
804
  }
804
805
  function updateHighlightUniforms$1(projector, uniforms) {
@@ -991,30 +992,30 @@ class ViewFrustumMesh extends SceneComponent {
991
992
  }
992
993
  }
993
994
  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
- }
995
+ return `
996
+ uniform mat4 lightMatrix;
997
+
998
+ varying vec4 vLightCoords;
999
+
1000
+ void main() {
1001
+ // create a UV region [0,1] x [0,1] to represent what the lightMatrix "sees"
1002
+ vLightCoords = lightMatrix * modelMatrix * vec4(position, 1.0);
1003
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
1004
+ }
1004
1005
  `;
1005
1006
  }
1006
1007
  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
- }
1008
+ return `
1009
+ uniform vec3 color;
1010
+
1011
+ varying vec4 vLightCoords;
1012
+
1013
+ void main() {
1014
+ vec2 lightUV = vLightCoords.xy / vLightCoords.w;
1015
+ float inView = float(max(lightUV.x, lightUV.y) <= 1.0 && min(lightUV.x, lightUV.y) >= 0.0 && vLightCoords.z > 0.0);
1016
+
1017
+ gl_FragColor = vec4(color, min(inView, 0.2));
1018
+ }
1018
1019
  `;
1019
1020
  }
1020
1021
  function updateHighlightUniforms(projector, uniforms) {
@@ -1248,17 +1249,34 @@ const copyFileInS3 = async (sourceKey, destKey) => {
1248
1249
  * IMPORTANT: like copyFileInS3, this must NOT swallow errors.
1249
1250
  */
1250
1251
  const copyFileInS3ViaDownload = async (sourceKey, destKey) => {
1251
- const downloaded = await Storage.get(sourceKey, {
1252
+ const downloaded = await downloadS3Object(sourceKey);
1253
+ return uploadS3Object(destKey, downloaded.body, downloaded.contentType);
1254
+ };
1255
+ /**
1256
+ * Downloads an S3 object (public level) as a Blob, with its content type.
1257
+ * Used by the tag export, which packs the files into an archive so they can be re-uploaded
1258
+ * on another environment (another bucket).
1259
+ * IMPORTANT: does NOT swallow errors — callers need NoSuchKey to tell a missing file apart.
1260
+ */
1261
+ const downloadS3Object = async (key) => {
1262
+ const downloaded = await Storage.get(key, {
1252
1263
  download: true,
1253
1264
  level: "public",
1254
1265
  });
1255
1266
  const body = downloaded?.Body;
1256
1267
  if (!body) {
1257
- throw new Error(`Empty download for "${sourceKey}", cannot duplicate it`);
1268
+ throw new Error(`Empty download for "${key}"`);
1258
1269
  }
1259
- const result = await Storage.put(destKey, body, {
1270
+ return { body, contentType: downloaded.ContentType || null };
1271
+ };
1272
+ /**
1273
+ * Uploads raw content (Blob or bytes) under an exact S3 key (public level) and returns that key.
1274
+ * IMPORTANT: does NOT swallow errors.
1275
+ */
1276
+ const uploadS3Object = async (key, body, contentType = null) => {
1277
+ const result = await Storage.put(key, body, {
1260
1278
  level: "public",
1261
- contentType: downloaded.ContentType || undefined,
1279
+ contentType: contentType || undefined,
1262
1280
  });
1263
1281
  return result.key;
1264
1282
  };
@@ -2242,32 +2260,32 @@ class PoiService {
2242
2260
  if (!sweeps || sweeps.length === 0) {
2243
2261
  return [];
2244
2262
  }
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
- }
2263
+ const queryStatement = `
2264
+ query ListPOISLight($filter: ModelPOIFilterInput, $limit: Int, $nextToken: String) {
2265
+ listPOIS(filter: $filter, limit: $limit, nextToken: $nextToken) {
2266
+ items {
2267
+ id
2268
+ coordinate
2269
+ specific
2270
+ private
2271
+ global
2272
+ type
2273
+ elementID
2274
+ level
2275
+ role
2276
+ category
2277
+ domainID
2278
+ metadata
2279
+ tagIcon
2280
+ tagDescription
2281
+ tagImageID
2282
+ matterportSweepID
2283
+ createdAt
2284
+ updatedAt
2285
+ }
2286
+ nextToken
2287
+ }
2288
+ }
2271
2289
  `;
2272
2290
  const CHUNK_SIZE = 50; // safe margin for an "or" filter expression's practical size
2273
2291
  const chunks = [];
@@ -3135,11 +3153,11 @@ class MatterportPointerService {
3135
3153
  }
3136
3154
  updateCursorDisplay(poseMatterport) {
3137
3155
  if (this.textDisplayCursorPositionPanel && poseMatterport) {
3138
- this.textDisplayCursorPositionPanel.innerHTML = `position:
3139
- ${pointToString(poseMatterport.position)}\n
3140
- normal:
3141
- ${pointToString(poseMatterport.normal)}\n
3142
- floorId:
3156
+ this.textDisplayCursorPositionPanel.innerHTML = `position:
3157
+ ${pointToString(poseMatterport.position)}\n
3158
+ normal:
3159
+ ${pointToString(poseMatterport.normal)}\n
3160
+ floorId:
3143
3161
  ${poseMatterport.floorId}`;
3144
3162
  if (this.getCursorPositionButton) {
3145
3163
  this.getCursorPositionButton.style.display = 'none';
@@ -5855,22 +5873,22 @@ class MatterportService {
5855
5873
  );
5856
5874
  }*/
5857
5875
  addCustomCss() {
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
- }
5876
+ const css = `
5877
+ .footer-ui,
5878
+ .showcase-footer,
5879
+ .mp-nova-btn-group,
5880
+ .footer-divider,
5881
+ .logo-link,
5882
+ .footer-logo,
5883
+ .bottom-ui,
5884
+ img.logo-image,
5885
+ img[class^="logo-image"],
5886
+ img[class*=" logo-image"],
5887
+ [data-testid="showcase-footer"] {
5888
+ opacity: 0 !important;
5889
+ visibility: hidden !important;
5890
+ pointer-events: none !important;
5891
+ }
5874
5892
  `;
5875
5893
  // 1st method: Via Scene SDK
5876
5894
  if (this.sdk?.Scene?.addStyle) {
@@ -11603,11 +11621,11 @@ class ModalSwitchVisitComponent {
11603
11621
  });
11604
11622
  }
11605
11623
  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 });
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" }] });
11624
+ 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" }] });
11607
11625
  }
11608
11626
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ModalSwitchVisitComponent, decorators: [{
11609
11627
  type: Component,
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"] }]
11628
+ 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"] }]
11611
11629
  }], ctorParameters: () => [{ type: i1$2.NgbActiveModal }, { type: i1.Router }, { type: ViewerService }], propDecorators: { content: [{
11612
11630
  type: Input
11613
11631
  }], model3D: [{
@@ -12228,11 +12246,11 @@ class CsvExportComponent {
12228
12246
  link.remove();
12229
12247
  }
12230
12248
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CsvExportComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
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" }] });
12249
+ 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" }] });
12232
12250
  }
12233
12251
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CsvExportComponent, decorators: [{
12234
12252
  type: Component,
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"] }]
12253
+ 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"] }]
12236
12254
  }], propDecorators: { headers: [{
12237
12255
  type: Input
12238
12256
  }], rowsInput: [{
@@ -14303,6 +14321,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
14303
14321
  }]
14304
14322
  }], ctorParameters: () => [{ type: PoiService }, { type: NavigationService }, { type: VisitService }] });
14305
14323
 
14324
+ /**
14325
+ * What the API says when it refuses a request for coming too fast, in an Error or in the errors of a
14326
+ * GraphQL answer: the request was not done, and can be sent again a little later.
14327
+ */
14328
+ const THROTTLED = /rate exceeded|throttl|too many requests|status code 429|throughput exceeds|provisionedthroughputexceeded|requestlimitexceeded/i;
14329
+ function isThrottled(error) {
14330
+ const texts = [
14331
+ error?.message,
14332
+ error?.name,
14333
+ error?.code,
14334
+ ...(Array.isArray(error?.errors) ? error.errors : []).flatMap((e) => [e?.message, e?.errorType]),
14335
+ ];
14336
+ return texts.some((text) => typeof text === "string" && THROTTLED.test(text));
14337
+ }
14338
+ /** How long to wait before each new try, give or take half, so that requests do not come back together. */
14339
+ const THROTTLED_WAITS_MS = [500, 1000, 2000, 4000];
14340
+ /** Sends the request again, a little later each time, while the API refuses it for coming too fast. */
14341
+ async function retryWhenThrottled(request, waitsMs = THROTTLED_WAITS_MS) {
14342
+ for (let attempt = 0;; attempt++) {
14343
+ try {
14344
+ return await request();
14345
+ }
14346
+ catch (error) {
14347
+ if (attempt >= waitsMs.length || !isThrottled(error)) {
14348
+ throw error;
14349
+ }
14350
+ await new Promise((resolve) => setTimeout(resolve, waitsMs[attempt] * (0.5 + Math.random())));
14351
+ }
14352
+ }
14353
+ }
14354
+
14306
14355
  class OperationService {
14307
14356
  API; //AWS
14308
14357
  /** Equipments linked to a ticket in this session: their loaded `operations` may be outdated. */
@@ -14321,16 +14370,30 @@ class OperationService {
14321
14370
  const tickets = operations.map((operation) => operation.ticket);
14322
14371
  return tickets;
14323
14372
  }
14324
- /** Tickets of a loaded equipment, without a request when its list query shows it has no operation. */
14325
- async getTicketsForEquipment(equip) {
14373
+ /** Whether a loaded equipment's list query shows it has no operation, none linked since. */
14374
+ loadedWithoutOperations(equip) {
14326
14375
  const operations = equip.operations;
14327
- if (operations?.items?.length === 0
14376
+ return operations?.items?.length === 0
14328
14377
  && !operations.nextToken
14329
- && !this.linkedEquipmentIDs.has(equip.id)) {
14378
+ && !this.linkedEquipmentIDs.has(equip.id);
14379
+ }
14380
+ /** Tickets of a loaded equipment, without a request when its list query shows it has no operation. */
14381
+ async getTicketsForEquipment(equip) {
14382
+ if (this.loadedWithoutOperations(equip)) {
14330
14383
  return [];
14331
14384
  }
14332
14385
  return this.getTicketsByEquipmentID(equip.id);
14333
14386
  }
14387
+ /**
14388
+ * Deletes a loaded equipment's operations, without a request when its list query shows it has
14389
+ * none: for an equipment loaded just before, as one loaded long ago may have some since.
14390
+ */
14391
+ async deleteOperationsForLoadedEquipment(equip) {
14392
+ if (this.loadedWithoutOperations(equip)) {
14393
+ return [];
14394
+ }
14395
+ return this.deleteOperationsForEquipment(equip.id);
14396
+ }
14334
14397
  async deleteOperationsForEquipment(equipID) {
14335
14398
  const deleted = [];
14336
14399
  await this.getOperationsByEquipmentID(equipID)
@@ -15922,29 +15985,35 @@ class EquipmentService extends BaseObjectService {
15922
15985
  return null;
15923
15986
  });
15924
15987
  }
15925
- async deleteEquipment(equip) {
15926
- const deleted = await this.API.__proto__.DeleteEquipment({ id: equip.id });
15927
- console.log('Deleted equipment', deleted);
15928
- // delete POI
15929
- const [poi] = equip.pois.items;
15930
- if (poi) {
15931
- await this.poiService.deletePoi(poi.id);
15932
- }
15933
- // delete notes related
15934
- if (equip.notes.items.length > 0) {
15935
- await Promise.all(equip.notes.items.map(async (note) => {
15936
- // delete files from S3
15937
- /** Not shared with other equipment */
15938
- if (note.attachment &&
15939
- !note.attachment.split('/').pop().startsWith('BATCH_')) {
15940
- await deleteFromS3(note.attachment);
15941
- }
15942
- await this.API.__proto__.DeleteNote({ id: note.id });
15943
- }));
15988
+ /**
15989
+ * Deletes an equipment with what hangs on it: every one of its POIs (its tags in the visits), its
15990
+ * notes and their files, its operations. Those go first: when one of them fails, the equipment is
15991
+ * still there to be deleted again, instead of tags left pointing at an equipment that is gone.
15992
+ * A request the API refuses for coming too fast is sent again a little later. justLoaded: the
15993
+ * equipment comes from a list loaded just before, whose operations can be trusted, so none there
15994
+ * means no request for them.
15995
+ */
15996
+ async deleteEquipment(equip, justLoaded = false) {
15997
+ for (const poi of equip.pois?.items ?? []) {
15998
+ if (poi) {
15999
+ await retryWhenThrottled(() => this.poiService.deletePoi(poi.id));
16000
+ }
15944
16001
  }
15945
- // delete operations (remove from linked tickets)
15946
- await this.operationService.deleteOperationsForEquipment(equip.id);
15947
- return deleted;
16002
+ await Promise.all((equip.notes?.items ?? [])
16003
+ .filter((note) => !!note)
16004
+ .map(async (note) => {
16005
+ // Its file, unless a batch edit shares it with other equipment.
16006
+ if (note.attachment &&
16007
+ !note.attachment.split('/').pop().startsWith('BATCH_')) {
16008
+ await deleteFromS3(note.attachment);
16009
+ }
16010
+ await retryWhenThrottled(() => this.API.__proto__.DeleteNote({ id: note.id }));
16011
+ }));
16012
+ // Its operations, which also takes it off the tickets linked to it.
16013
+ await retryWhenThrottled(() => justLoaded
16014
+ ? this.operationService.deleteOperationsForLoadedEquipment(equip)
16015
+ : this.operationService.deleteOperationsForEquipment(equip.id));
16016
+ return retryWhenThrottled(() => this.API.__proto__.DeleteEquipment({ id: equip.id }));
15948
16017
  }
15949
16018
  async updateEquipmentLocation(equip, tagData) {
15950
16019
  const poiInput = {
@@ -16487,11 +16556,11 @@ class SearchBarComponent {
16487
16556
  this.searchEvent.emit(results);
16488
16557
  }
16489
16558
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchBarComponent, deps: [{ token: SearchService }], target: i0.ɵɵFactoryTarget.Component });
16490
- 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" }] });
16559
+ 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" }] });
16491
16560
  }
16492
16561
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SearchBarComponent, decorators: [{
16493
16562
  type: Component,
16494
- 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"] }]
16563
+ 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"] }]
16495
16564
  }], ctorParameters: () => [{ type: SearchService }], propDecorators: { searchable: [{
16496
16565
  type: Input
16497
16566
  }], objectType: [{
@@ -16939,11 +17008,11 @@ class LoaderComponent {
16939
17008
  document.documentElement.style.setProperty('--color', this.color);
16940
17009
  }
16941
17010
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
16942
- 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"] }] });
17011
+ 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"] }] });
16943
17012
  }
16944
17013
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LoaderComponent, decorators: [{
16945
17014
  type: Component,
16946
- 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"] }]
17015
+ 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"] }]
16947
17016
  }], ctorParameters: () => [], propDecorators: { useLogo: [{
16948
17017
  type: Input
16949
17018
  }], color: [{
@@ -17001,11 +17070,11 @@ class SupportModalComponent {
17001
17070
  }
17002
17071
  }
17003
17072
  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 });
17004
- 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" }] });
17073
+ 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" }] });
17005
17074
  }
17006
17075
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SupportModalComponent, decorators: [{
17007
17076
  type: Component,
17008
- 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"] }]
17077
+ 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"] }]
17009
17078
  }], ctorParameters: () => [{ type: SupportService }, { type: i1$2.NgbActiveModal }, { type: i3.UntypedFormBuilder }, { type: BaseUserService }, { type: ValidatorsService }] });
17010
17079
 
17011
17080
  class LocaleService {
@@ -18466,11 +18535,11 @@ class NavigationBarComponent {
18466
18535
  this.baseVisibilityService.isChangePositionVisible.next(false);
18467
18536
  }
18468
18537
  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 });
18469
- 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" }] });
18538
+ 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" }] });
18470
18539
  }
18471
18540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: NavigationBarComponent, decorators: [{
18472
18541
  type: Component,
18473
- 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"] }]
18542
+ 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"] }]
18474
18543
  }], ctorParameters: () => [{ type: undefined, decorators: [{
18475
18544
  type: Inject,
18476
18545
  args: ['currentAwsKinesisAnalyticsService']
@@ -18740,11 +18809,11 @@ class MenuBarComponent {
18740
18809
  }
18741
18810
  }
18742
18811
  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 });
18743
- 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" }] });
18812
+ 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" }] });
18744
18813
  }
18745
18814
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MenuBarComponent, decorators: [{
18746
18815
  type: Component,
18747
- 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"] }]
18816
+ 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"] }]
18748
18817
  }], 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: [{
18749
18818
  type: Input
18750
18819
  }] } });
@@ -19101,6 +19170,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19101
19170
  args: ['window:message', ['$event']]
19102
19171
  }] } });
19103
19172
 
19173
+ /**
19174
+ * Deletes one file of a visit's AI inventory, and nothing outside it.
19175
+ *
19176
+ * The inventory's only S3 delete. It lives here, out of the library's public API, rather than as a
19177
+ * generic helper beside the other S3 functions, so that no other code picks it up for something
19178
+ * else: it refuses any key outside `visits/<model3D>/inventory/`, and logs every deletion with the
19179
+ * reason its caller gives. Rejects when the key is refused or the file could not be deleted.
19180
+ */
19181
+ async function removeInventoryFile(model3D, key, reason) {
19182
+ const folder = `visits/${model3D}/inventory/`;
19183
+ const segments = key.split("/");
19184
+ const inside = !!model3D && key.startsWith(folder) && key.length > folder.length
19185
+ && !segments.includes("..") && !segments.includes(".");
19186
+ if (!inside || !reason?.trim()) {
19187
+ throw new Error(`Refused to delete "${key}": only a file of the inventory of visit "${model3D}", with a reason, can be deleted here.`);
19188
+ }
19189
+ console.info(`Inventory: deleting ${key} (${reason})`);
19190
+ await Storage.remove(key, { level: "public" });
19191
+ }
19192
+
19104
19193
  /**
19105
19194
  * The minimum scores a detection can be asked to beat. The model keeps those scoring strictly more
19106
19195
  * (yolact's postprocess: score > threshold), and a score is at most 1: 1.0 would keep none.
@@ -19115,6 +19204,8 @@ const PANORAMA = /\.(png|jpg|jpeg|tiff|bmp|gif)$/;
19115
19204
  * so: it no longer keeps another from being launched.
19116
19205
  */
19117
19206
  const INVENTORY_STALE_AFTER_MS = 3 * 60 * 60 * 1000;
19207
+ /** How many kept detection files are deleted at a time: a visit can have thousands. */
19208
+ const DISCARD_AT_ONCE = 20;
19118
19209
  /**
19119
19210
  * What is asked of each inventory: the most the API has of these, an environment whose backend
19120
19211
  * predates a field refusing any query that asks for it.
@@ -19150,8 +19241,8 @@ class InventoryService {
19150
19241
  }
19151
19242
  /** The space's inventories, the latest first. */
19152
19243
  async getRuns(spaceID) {
19153
- const query = (fields) => `query InventoriesBySpace($spaceID: ID!, $limit: Int) {
19154
- inventoriesBySpace(spaceID: $spaceID, limit: $limit) { items { ${fields} } }
19244
+ const query = (fields) => `query InventoriesBySpace($spaceID: ID!, $limit: Int) {
19245
+ inventoriesBySpace(spaceID: $spaceID, limit: $limit) { items { ${fields} } }
19155
19246
  }`;
19156
19247
  let response;
19157
19248
  try {
@@ -19192,6 +19283,47 @@ class InventoryService {
19192
19283
  isComplete(files) {
19193
19284
  return !!files && files.panoramas > 0 && files.dataJson && files.modelObj;
19194
19285
  }
19286
+ /**
19287
+ * How many panoramas' detections each inventory of the visit kept in the bucket, by inventory
19288
+ * (machine-learning: inventory_job.py); null when the bucket could not be read.
19289
+ */
19290
+ async keptDetections(model3D) {
19291
+ const files = await listFilesInFolder(`visits/${model3D}/inventory/runs/`);
19292
+ if (!files) {
19293
+ return null;
19294
+ }
19295
+ const kept = {};
19296
+ for (const file of files) {
19297
+ const run = /\/runs\/([^/]+)\/detections\/[^/]+\.json$/.exec(file.key ?? "")?.[1];
19298
+ if (run) {
19299
+ kept[run] = (kept[run] ?? 0) + 1;
19300
+ }
19301
+ }
19302
+ return kept;
19303
+ }
19304
+ /**
19305
+ * Deletes all the detections kept for the visit, going on past a file that fails, and says how
19306
+ * many could not be deleted. The equipment placed from them stays.
19307
+ */
19308
+ async discardDetections(model3D) {
19309
+ const files = await listFilesInFolder(`visits/${model3D}/inventory/runs/`);
19310
+ if (!files) {
19311
+ throw new Error(`Detections of ${model3D} not listed`);
19312
+ }
19313
+ const keys = files.map((file) => file.key).filter((key) => !!key);
19314
+ let failed = 0;
19315
+ for (let start = 0; start < keys.length; start += DISCARD_AT_ONCE) {
19316
+ const batch = keys.slice(start, start + DISCARD_AT_ONCE);
19317
+ const results = await Promise.allSettled(batch.map((key) => removeInventoryFile(model3D, key, "saved detections discarded")));
19318
+ results.forEach((result, i) => {
19319
+ if (result.status === "rejected") {
19320
+ failed += 1;
19321
+ console.error("Detection not deleted", batch[i], result.reason);
19322
+ }
19323
+ });
19324
+ }
19325
+ return failed;
19326
+ }
19195
19327
  /** The latest inventory of each visit, the latest first. */
19196
19328
  latestOfEachVisit(runs) {
19197
19329
  const latest = new Map();
@@ -19299,9 +19431,11 @@ class InventoryService {
19299
19431
  /**
19300
19432
  * Launches an inventory of each of the visits, unless one is already running in the space:
19301
19433
  * of all their panoramas, or of the one of `sweep` (the first 8 characters of its sweep, as
19302
- * the panoramas are named) when it is given.
19434
+ * the panoramas are named) when it is given. A visit given an inventory in `resumeFrom` starts
19435
+ * from that one's detections: with all its panoramas analysed, only the placing is done again,
19436
+ * with this cutoff.
19303
19437
  */
19304
- async launch(spaceID, nodeIDs, model, cutoffScore, sweep) {
19438
+ async launch(spaceID, nodeIDs, model, cutoffScore, sweep, resumeFrom = {}) {
19305
19439
  const runs = await this.getRuns(spaceID);
19306
19440
  if (runs.some((run) => this.isRunning(run))) {
19307
19441
  return "ALREADY_RUNNING";
@@ -19330,6 +19464,7 @@ class InventoryService {
19330
19464
  status: sweep
19331
19465
  ? InventoryStatus.TO_RUN_ONE_IMAGE
19332
19466
  : InventoryStatus.TO_RUN,
19467
+ ...(resumeFrom[nodeID] ? { resumeFrom: resumeFrom[nodeID] } : {}),
19333
19468
  });
19334
19469
  }));
19335
19470
  return "LAUNCHED";
@@ -19367,6 +19502,8 @@ class InventoryRunsComponent {
19367
19502
  /** Whether one of the inventories shown is running: said when it changes. */
19368
19503
  runningChange = new EventEmitter();
19369
19504
  runs = [];
19505
+ /** Every inventory of the space by its id, for where one that places detections again took them. */
19506
+ byId = new Map();
19370
19507
  /** The inventory whose cancelling waits for its confirmation. */
19371
19508
  confirmingCancel = null;
19372
19509
  /** The inventory being cancelled or resumed, its buttons disabled meanwhile. */
@@ -19402,6 +19539,7 @@ class InventoryRunsComponent {
19402
19539
  this.stopPolling();
19403
19540
  return;
19404
19541
  }
19542
+ this.byId = new Map(runs.map((run) => [run.id, run]));
19405
19543
  this.runs = this.inventoryService
19406
19544
  .latestOfEachVisit(runs)
19407
19545
  .filter((run) => !this.nodeIDs || this.nodeIDs.includes(run.nodeID));
@@ -19423,6 +19561,14 @@ class InventoryRunsComponent {
19423
19561
  this.stopPolling();
19424
19562
  }
19425
19563
  }
19564
+ /**
19565
+ * The finished inventory whose detections this one places again with its own cutoff, analysing
19566
+ * no panorama; null when it analyses them, resuming a stopped one included.
19567
+ */
19568
+ reusedFrom(run) {
19569
+ const source = run.resumeFrom ? this.byId.get(run.resumeFrom) : null;
19570
+ return source && this.inventoryService.state(source) === "done" ? source : null;
19571
+ }
19426
19572
  /**
19427
19573
  * About how many minutes the panoramas left will take, at the pace seen since the inventory
19428
19574
  * was first seen analysing them; null until a panorama has been done meanwhile.
@@ -19477,11 +19623,11 @@ class InventoryRunsComponent {
19477
19623
  }
19478
19624
  }
19479
19625
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryRunsComponent, deps: [{ token: InventoryService }], target: i0.ɵɵFactoryTarget.Component });
19480
- 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 <ng-container [ngSwitch]=\"inventoryService.state(run)\">\n <div *ngSwitchCase=\"'waiting'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'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 {{'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 <div *ngSwitchDefault>\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 </div>\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 .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" }] });
19626
+ 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 <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\r\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\r\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\r\n <span class=\"inventory-run-detail\">\r\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\r\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\r\n </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 {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : '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 {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : '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 <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\r\n <div *ngSwitchDefault>\r\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n <span *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-container>\r\n </div>\r\n <ng-template #analysing>\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 <!-- Counted by the image that detects down to a floor; null from older ones. -->\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-template>\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 .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" }] });
19481
19627
  }
19482
19628
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryRunsComponent, decorators: [{
19483
19629
  type: Component,
19484
- 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 <ng-container [ngSwitch]=\"inventoryService.state(run)\">\n <div *ngSwitchCase=\"'waiting'\">\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\n {{'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 {{'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 <div *ngSwitchDefault>\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 </div>\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 .progress-bar{background-color:var(--smarterplan-primary)}.inventory-runs .inventory-run .inventory-run-confirm{margin-top:.5rem;font-size:.85rem}\n"] }]
19630
+ 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 <!-- One that places a finished inventory's detections again: no panorama is analysed. -->\r\n <div class=\"inventory-run-reused\" *ngIf=\"reusedFrom(run) as source\">\r\n {{ 'Detections of {{date}} placed again with another cutoff: no panorama is analysed.' | translate: { date: (source.createdAt | date:'short') } }}\r\n <span class=\"inventory-run-detail\">\r\n {{ 'Cutoff {{before}} \u2192 {{now}}' | translate: { before: source.cutoffScore, now: run.cutoffScore } }}<ng-container\r\n *ngIf=\"source.objectsFound != null\">. {{ 'Equipment before' | translate }}: {{ source.objectsFound }}</ng-container>\r\n </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 {{ (reusedFrom(run) ? 'Starting the task on AWS\u2026' : '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 {{ (reusedFrom(run) ? 'Taking the saved detections and the panoramas\u2026' : '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 <!-- Nothing to analyse: the objects above the new cutoff are counted at once. -->\r\n <div *ngSwitchDefault>\r\n <ng-container *ngIf=\"reusedFrom(run); else analysing\">\r\n <ng-container *ngTemplateOutlet=\"busyBar\"></ng-container>\r\n <span *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}}' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-container>\r\n </div>\r\n <ng-template #analysing>\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 <!-- Counted by the image that detects down to a floor; null from older ones. -->\r\n <span class=\"inventory-run-detail\" *ngIf=\"run.objectsFound != null\">\r\n {{ 'Objects above the cutoff of {{cutoff}} so far' | translate: { cutoff: run.cutoffScore } }}: {{ run.objectsFound }}\r\n </span>\r\n </ng-template>\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 .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"] }]
19485
19631
  }], ctorParameters: () => [{ type: InventoryService }], propDecorators: { spaceID: [{
19486
19632
  type: Input
19487
19633
  }], nodeIDs: [{
@@ -19492,124 +19638,210 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19492
19638
  type: Output
19493
19639
  }] } });
19494
19640
 
19641
+ const INVENTORY_MESH_FILE = {
19642
+ name: "model.obj",
19643
+ field: "modelObj",
19644
+ accept: ".obj",
19645
+ extension: /\.obj$/i,
19646
+ type: "text/plain",
19647
+ send: "Send the .obj",
19648
+ wrongFile: "Choose the .obj file of the MatterPak.",
19649
+ };
19650
+ const INVENTORY_POSITIONS_FILE = {
19651
+ name: "data.json",
19652
+ field: "dataJson",
19653
+ accept: ".json",
19654
+ extension: /\.json$/i,
19655
+ type: "application/json",
19656
+ send: "Send the .json",
19657
+ wrongFile: "Choose a .json file.",
19658
+ };
19495
19659
  /**
19496
19660
  * What a visit has of what its AI inventory needs (InventoryService.checkFiles), and where what is
19497
- * missing comes from, for the screens to show before launching one. The mesh, which nothing else
19498
- * puts in the bucket, can be sent from here: the .obj of the visit's MatterPak, as it is.
19661
+ * missing comes from, for the screens to show before launching one. The mesh and the panoramas'
19662
+ * positions can be sent, replaced or deleted from here; the panoramas come from the visit's import.
19499
19663
  */
19500
19664
  class InventoryFilesComponent {
19501
19665
  files;
19502
- /** Said when the visit gets a file from here: [(files)]. */
19666
+ /** Said when a file of the visit is sent, replaced or deleted from here: [(files)]. */
19503
19667
  filesChange = new EventEmitter();
19504
19668
  /** The visit's Matterport model, the folder of its files. */
19505
19669
  model3D;
19506
- /** How much of the .obj is sent, from 0 to 100, while it is. */
19670
+ /** While an inventory runs or is launched: it reads these files, which must not change. */
19671
+ disabled = false;
19672
+ meshFile = INVENTORY_MESH_FILE;
19673
+ positionsFile = INVENTORY_POSITIONS_FILE;
19674
+ /** The file being sent. */
19675
+ sending = null;
19676
+ /** How much of it is sent, from 0 to 100. */
19507
19677
  uploadPercent = null;
19508
19678
  uploadName = null;
19509
- /** Why the .obj was not sent, as a key to translate. */
19510
- uploadError = null;
19511
- async onModelObjSelected(event) {
19679
+ /** The file whose deletion is waiting to be confirmed. */
19680
+ confirmingDelete = null;
19681
+ deletingFile = null;
19682
+ /** What went wrong, as a key to translate, and with which file. */
19683
+ error = null;
19684
+ errorFile = null;
19685
+ /** Whether the files cannot be changed for now. */
19686
+ get locked() {
19687
+ return this.disabled || !!this.sending || !!this.deletingFile;
19688
+ }
19689
+ fail(file, error) {
19690
+ this.errorFile = file;
19691
+ this.error = error;
19692
+ }
19693
+ async onFileSelected(target, event) {
19512
19694
  const input = event.target;
19513
19695
  const file = input.files?.[0];
19514
19696
  input.value = "";
19515
- if (!file) {
19697
+ // An inventory may have started while the file dialog was open.
19698
+ if (!file || this.locked) {
19516
19699
  return;
19517
19700
  }
19518
- if (!/\.obj$/i.test(file.name)) {
19519
- this.uploadError = "Choose the .obj file of the MatterPak.";
19701
+ if (!target.extension.test(file.name)) {
19702
+ this.fail(target, target.wrongFile);
19520
19703
  return;
19521
19704
  }
19522
- this.uploadError = null;
19705
+ this.fail(null, null);
19706
+ this.sending = target;
19523
19707
  this.uploadName = file.name;
19524
19708
  this.uploadPercent = 0;
19525
19709
  try {
19526
- // Where the inventory's task looks for it, whatever the file was called.
19527
- await uploadFileToS3WithProgress(`visits/${this.model3D}/inventory/`, new File([file], "model.obj", { type: "text/plain" }), (fraction) => (this.uploadPercent = Math.round(fraction * 100)));
19528
- this.files = { ...this.files, modelObj: true };
19710
+ await uploadFileToS3WithProgress(`visits/${this.model3D}/inventory/`, new File([file], target.name, { type: target.type }), (fraction) => (this.uploadPercent = Math.round(fraction * 100)));
19711
+ this.files = { ...this.files, [target.field]: true };
19529
19712
  this.filesChange.emit(this.files);
19530
19713
  }
19531
19714
  catch (error) {
19532
- console.error("model.obj not sent", error);
19533
- this.uploadError = "The file could not be sent.";
19715
+ console.error(`${target.name} not sent`, error);
19716
+ this.fail(target, "The file could not be sent.");
19534
19717
  }
19535
19718
  finally {
19719
+ this.sending = null;
19536
19720
  this.uploadPercent = null;
19537
19721
  }
19538
19722
  }
19723
+ async onDeleteConfirmed(target) {
19724
+ if (this.locked) {
19725
+ return;
19726
+ }
19727
+ this.fail(null, null);
19728
+ this.deletingFile = target;
19729
+ try {
19730
+ await removeInventoryFile(this.model3D, `visits/${this.model3D}/inventory/${target.name}`, `${target.name} deleted from the inventory files panel`);
19731
+ this.files = { ...this.files, [target.field]: false };
19732
+ this.filesChange.emit(this.files);
19733
+ }
19734
+ catch (error) {
19735
+ console.error(`${target.name} not deleted`, error);
19736
+ this.fail(target, "The file could not be deleted.");
19737
+ }
19738
+ finally {
19739
+ this.deletingFile = null;
19740
+ this.confirmingDelete = null;
19741
+ }
19742
+ }
19539
19743
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryFilesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19540
- 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: `
19541
- <ul class="inventory-files" *ngIf="files; else unknown">
19542
- <li [class.missing]="!files.panoramas">
19543
- {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19544
- <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19545
- </li>
19546
- <li [class.missing]="!files.dataJson">
19547
- {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19548
- <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19549
- </li>
19550
- <li [class.missing]="!files.modelObj">
19551
- {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19552
- <span class="hint" *ngIf="!files.modelObj">
19553
- {{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}
19554
- <label class="btn btn-sm btn-outline-primary rounded-pill upload" *ngIf="uploadPercent === null">
19555
- <input type="file" accept=".obj" (change)="onModelObjSelected($event)">
19556
- {{ "Send the .obj" | translate }}
19557
- </label>
19558
- <span *ngIf="uploadPercent !== null" class="sending">
19559
- <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19560
- <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19561
- </span>
19562
- {{ "Sending" | translate }} {{ uploadName }} — {{ uploadPercent }}%
19563
- </span>
19564
- <span class="error" *ngIf="uploadError">{{ uploadError | translate }}</span>
19565
- </span>
19566
- </li>
19567
- </ul>
19568
- <ng-template #unknown>
19569
- <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19570
- </ng-template>
19571
- `, 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" }] });
19744
+ 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: `
19745
+ <ul class="inventory-files" *ngIf="files; else unknown">
19746
+ <li [class.missing]="!files.panoramas">
19747
+ {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19748
+ <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19749
+ </li>
19750
+ <li [class.missing]="!files.dataJson">
19751
+ {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19752
+ <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19753
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
19754
+ </li>
19755
+ <li [class.missing]="!files.modelObj">
19756
+ {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19757
+ <span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
19758
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
19759
+ </li>
19760
+ </ul>
19761
+ <ng-template #actions let-file>
19762
+ <span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
19763
+ <label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
19764
+ <input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
19765
+ {{ (files[file.field] ? "Replace" : file.send) | translate }}
19766
+ </label>
19767
+ <button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
19768
+ [disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
19769
+ </span>
19770
+ <span class="file-actions" *ngIf="confirmingDelete === file">
19771
+ <span>{{ "Delete this file?" | translate }}</span>
19772
+ <button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
19773
+ (click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
19774
+ <button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
19775
+ (click)="confirmingDelete = null">{{ "No" | translate }}</button>
19776
+ </span>
19777
+ <span *ngIf="sending === file" class="sending">
19778
+ <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19779
+ <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19780
+ </span>
19781
+ {{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
19782
+ </span>
19783
+ <span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
19784
+ </ng-template>
19785
+ <ng-template #unknown>
19786
+ <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19787
+ </ng-template>
19788
+ `, 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" }] });
19572
19789
  }
19573
19790
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryFilesComponent, decorators: [{
19574
19791
  type: Component,
19575
- args: [{ selector: "lib-inventory-files", template: `
19576
- <ul class="inventory-files" *ngIf="files; else unknown">
19577
- <li [class.missing]="!files.panoramas">
19578
- {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19579
- <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19580
- </li>
19581
- <li [class.missing]="!files.dataJson">
19582
- {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19583
- <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19584
- </li>
19585
- <li [class.missing]="!files.modelObj">
19586
- {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19587
- <span class="hint" *ngIf="!files.modelObj">
19588
- {{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}
19589
- <label class="btn btn-sm btn-outline-primary rounded-pill upload" *ngIf="uploadPercent === null">
19590
- <input type="file" accept=".obj" (change)="onModelObjSelected($event)">
19591
- {{ "Send the .obj" | translate }}
19592
- </label>
19593
- <span *ngIf="uploadPercent !== null" class="sending">
19594
- <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19595
- <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19596
- </span>
19597
- {{ "Sending" | translate }} {{ uploadName }} — {{ uploadPercent }}%
19598
- </span>
19599
- <span class="error" *ngIf="uploadError">{{ uploadError | translate }}</span>
19600
- </span>
19601
- </li>
19602
- </ul>
19603
- <ng-template #unknown>
19604
- <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19605
- </ng-template>
19606
- `, 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"] }]
19792
+ args: [{ selector: "lib-inventory-files", template: `
19793
+ <ul class="inventory-files" *ngIf="files; else unknown">
19794
+ <li [class.missing]="!files.panoramas">
19795
+ {{ files.panoramas ? "✓" : "✗" }} {{ "Panoramas" | translate }}: {{ files.panoramas }}
19796
+ <span class="hint" *ngIf="!files.panoramas">{{ "Import the 360° images of the visit first." | translate }}</span>
19797
+ </li>
19798
+ <li [class.missing]="!files.dataJson">
19799
+ {{ files.dataJson ? "✓" : "✗" }} {{ "Panorama positions" | translate }} (data.json)
19800
+ <span class="hint" *ngIf="!files.dataJson">{{ "Import all the images of the visit again (Virtual Visits): the import writes it." | translate }}</span>
19801
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: positionsFile }"></ng-container>
19802
+ </li>
19803
+ <li [class.missing]="!files.modelObj">
19804
+ {{ files.modelObj ? "✓" : "✗" }} {{ "3D mesh" | translate }} (model.obj)
19805
+ <span class="hint" *ngIf="!files.modelObj">{{ "The .obj of the visit's MatterPak, from Matterport. Its textures are not needed." | translate }}</span>
19806
+ <ng-container *ngTemplateOutlet="actions; context: { $implicit: meshFile }"></ng-container>
19807
+ </li>
19808
+ </ul>
19809
+ <ng-template #actions let-file>
19810
+ <span class="file-actions" *ngIf="sending !== file && confirmingDelete !== file">
19811
+ <label class="btn btn-sm btn-outline-primary rounded-pill upload" [class.disabled]="locked">
19812
+ <input type="file" [accept]="file.accept" [disabled]="locked" (change)="onFileSelected(file, $event)">
19813
+ {{ (files[file.field] ? "Replace" : file.send) | translate }}
19814
+ </label>
19815
+ <button type="button" class="btn btn-sm btn-outline-danger rounded-pill delete" *ngIf="files[file.field]"
19816
+ [disabled]="locked" (click)="confirmingDelete = file">{{ "Delete" | translate }}</button>
19817
+ </span>
19818
+ <span class="file-actions" *ngIf="confirmingDelete === file">
19819
+ <span>{{ "Delete this file?" | translate }}</span>
19820
+ <button type="button" class="btn btn-sm btn-danger rounded-pill confirm" [disabled]="locked"
19821
+ (click)="onDeleteConfirmed(file)">{{ "Yes, delete" | translate }}</button>
19822
+ <button type="button" class="btn btn-sm btn-outline-secondary rounded-pill" [disabled]="deletingFile === file"
19823
+ (click)="confirmingDelete = null">{{ "No" | translate }}</button>
19824
+ </span>
19825
+ <span *ngIf="sending === file" class="sending">
19826
+ <span class="progress" role="progressbar" [attr.aria-valuenow]="uploadPercent" aria-valuemin="0" aria-valuemax="100">
19827
+ <span class="progress-bar" [style.width.%]="uploadPercent"></span>
19828
+ </span>
19829
+ {{ "Sending" | translate }} {{ uploadName }}: {{ uploadPercent }}%
19830
+ </span>
19831
+ <span class="error" *ngIf="errorFile === file">{{ error | translate }}</span>
19832
+ </ng-template>
19833
+ <ng-template #unknown>
19834
+ <p class="hint">{{ "The files of the visit could not be checked." | translate }}</p>
19835
+ </ng-template>
19836
+ `, 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"] }]
19607
19837
  }], propDecorators: { files: [{
19608
19838
  type: Input
19609
19839
  }], filesChange: [{
19610
19840
  type: Output
19611
19841
  }], model3D: [{
19612
19842
  type: Input
19843
+ }], disabled: [{
19844
+ type: Input
19613
19845
  }] } });
19614
19846
 
19615
19847
  /**
@@ -19627,11 +19859,11 @@ class CheckboxSliderComponent {
19627
19859
  this.checkedChange.emit(this.checked);
19628
19860
  }
19629
19861
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CheckboxSliderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
19630
- 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" }] });
19862
+ 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\">\r\n <span class=\"switch\">\r\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\r\n <span class=\"slider\"></span>\r\n </span>\r\n <span class=\"label\">{{ label | translate }}</span>\r\n</label>\r\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" }] });
19631
19863
  }
19632
19864
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CheckboxSliderComponent, decorators: [{
19633
19865
  type: Component,
19634
- 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"] }]
19866
+ args: [{ selector: "lib-checkbox-slider", template: "<label class=\"checkbox-slider\" [class.disabled]=\"disabled\">\r\n <span class=\"switch\">\r\n <input type=\"checkbox\" [checked]=\"checked\" [disabled]=\"disabled\" (change)=\"onChange($event)\">\r\n <span class=\"slider\"></span>\r\n </span>\r\n <span class=\"label\">{{ label | translate }}</span>\r\n</label>\r\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"] }]
19635
19867
  }], propDecorators: { label: [{
19636
19868
  type: Input
19637
19869
  }], checked: [{
@@ -19642,6 +19874,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19642
19874
  type: Output
19643
19875
  }] } });
19644
19876
 
19877
+ /**
19878
+ * How many equipment of the previous inventory are deleted at a time. All at once, hundreds of them
19879
+ * at three or more requests each, the API refused part of them and the launch stopped half way; a
19880
+ * request it refuses for coming too fast is now sent again (EquipmentService.deleteEquipment).
19881
+ */
19882
+ const INVENTORY_DELETE_AT_ONCE = 15;
19883
+ /** Where the panel keeps the model and the cutoff score last launched with, in the browser. */
19884
+ const LAST_SETTINGS_KEY = "inventory-launch.last-settings";
19645
19885
  /**
19646
19886
  * Launches an AI inventory, of the visits given or of one panorama of the visit, saying first what
19647
19887
  * it will do: what each visit has of what the inventory needs, and how many equipment the AI added
@@ -19651,6 +19891,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
19651
19891
  class InventoryLaunchComponent {
19652
19892
  inventoryService;
19653
19893
  equipmentService;
19894
+ navigationService;
19654
19895
  spaceID;
19655
19896
  visits = [];
19656
19897
  /** Only this panorama of the visit, as it is named: 110ee452_sweep.jpeg. */
@@ -19668,26 +19909,195 @@ class InventoryLaunchComponent {
19668
19909
  deletePrevious = false;
19669
19910
  /** How many of the location's equipment the AI added, which deletePrevious deletes. */
19670
19911
  aiEquipmentCount = null;
19912
+ /** While the previous inventory is deleted: how many of its equipment are done, of how many. */
19913
+ deleting = null;
19914
+ /** How many equipment of the previous inventory could not be deleted, for the message. */
19915
+ notDeleted = 0;
19916
+ /** Each visit's latest inventory when it is done and all its detections are still kept. */
19917
+ reusable = {};
19918
+ /**
19919
+ * The visits with detections kept that nothing is waiting for: their latest inventory is done.
19920
+ * A stopped one needs them to resume.
19921
+ */
19922
+ discardable = [];
19923
+ confirmingDiscard = false;
19924
+ discarding = false;
19925
+ /** Whether the saved detections were just discarded, for the panel to say so. */
19926
+ discarded = false;
19927
+ /** The latest reading of the kept detections: an older one answering late is ignored. */
19928
+ keptCheck = 0;
19929
+ /** The latest count of the previous inventory, for the same reason. */
19930
+ countCheck = 0;
19931
+ /**
19932
+ * Whether the launch places the latest inventories' detections again, with the cutoff chosen,
19933
+ * instead of analysing the panoramas: minutes instead of hours.
19934
+ */
19935
+ reuseDetections = false;
19671
19936
  /** What each visit has of what the inventory needs, by its node; null when the bucket could not be read. */
19672
19937
  visitFiles = {};
19673
19938
  checkingFiles = false;
19674
19939
  launching = false;
19675
19940
  /** What went wrong, or why nothing was launched, as a key to translate. */
19676
19941
  message = null;
19677
- constructor(inventoryService, equipmentService) {
19942
+ constructor(inventoryService, equipmentService, navigationService) {
19678
19943
  this.inventoryService = inventoryService;
19679
19944
  this.equipmentService = equipmentService;
19945
+ this.navigationService = navigationService;
19680
19946
  }
19681
19947
  async ngOnInit() {
19948
+ const last = this.lastSettings();
19949
+ if (last?.cutoffScore && this.cutoffScores.includes(last.cutoffScore)) {
19950
+ this.cutoffScore = last.cutoffScore;
19951
+ }
19682
19952
  this.models = await this.inventoryService.getModels();
19683
- if (!this.model && this.models.length === 1) {
19684
- this.model = this.models[0];
19953
+ if (!this.model) {
19954
+ // The one launched with last, from either screen, while it is still offered.
19955
+ this.model = this.models.find((model) => model.id === last?.modelID)
19956
+ ?? (this.models.length === 1 ? this.models[0] : undefined);
19957
+ }
19958
+ }
19959
+ /** The model and the cutoff score last launched with, from either screen; null when unknown. */
19960
+ lastSettings() {
19961
+ try {
19962
+ return JSON.parse(localStorage.getItem(LAST_SETTINGS_KEY)) ?? null;
19963
+ }
19964
+ catch {
19965
+ return null;
19966
+ }
19967
+ }
19968
+ keepSettings() {
19969
+ try {
19970
+ localStorage.setItem(LAST_SETTINGS_KEY,
19971
+ // Reusing, none may be selected: the detections keep their own.
19972
+ JSON.stringify({ modelID: this.model?.id, cutoffScore: this.cutoffScore }));
19973
+ }
19974
+ catch {
19975
+ // Storage blocked or full: the next launch starts from the defaults.
19685
19976
  }
19686
19977
  }
19687
19978
  ngOnChanges(changes) {
19688
19979
  if (changes.visits) {
19689
19980
  this.checkFiles();
19690
19981
  }
19982
+ if (changes.visits || changes.spaceID || changes.panorama || changes.running) {
19983
+ this.findReusable();
19984
+ }
19985
+ }
19986
+ /** Whether the inventory's detections of all its panoramas are among those kept. */
19987
+ keptAll(run, kept) {
19988
+ return run.imagesTotal > 0 && (kept?.[run.id] ?? 0) >= run.imagesTotal;
19989
+ }
19990
+ /** What the bucket has of the visits' detections, for their latest inventories that are done. */
19991
+ async readKept() {
19992
+ const reusable = {};
19993
+ const discardable = [];
19994
+ // One panorama is analysed in a minute or two: nothing to gain.
19995
+ if (!this.spaceID || this.panorama) {
19996
+ return { reusable, discardable };
19997
+ }
19998
+ const latest = this.inventoryService.latestOfEachVisit(await this.inventoryService.getRuns(this.spaceID));
19999
+ const done = new Map(latest
20000
+ .filter((run) => this.inventoryService.state(run) === "done")
20001
+ .map((run) => [run.nodeID, run]));
20002
+ const visits = (this.visits ?? []).filter((visit) => done.has(visit.nodeID));
20003
+ const kept = await Promise.all(visits.map((visit) => this.inventoryService.keptDetections(visit.model3D)));
20004
+ visits.forEach((visit, index) => {
20005
+ if (Object.keys(kept[index] ?? {}).length === 0) {
20006
+ return;
20007
+ }
20008
+ discardable.push(visit);
20009
+ const run = done.get(visit.nodeID);
20010
+ if (this.keptAll(run, kept[index])) {
20011
+ reusable[visit.nodeID] = run;
20012
+ }
20013
+ });
20014
+ return { reusable, discardable };
20015
+ }
20016
+ async findReusable() {
20017
+ const check = ++this.keptCheck;
20018
+ let found = {
20019
+ reusable: {},
20020
+ discardable: [],
20021
+ };
20022
+ try {
20023
+ found = await this.readKept();
20024
+ }
20025
+ catch (error) {
20026
+ console.warn("Inventories not read", error);
20027
+ }
20028
+ if (check !== this.keptCheck) {
20029
+ return;
20030
+ }
20031
+ this.reusable = found.reusable;
20032
+ this.discardable = found.discardable;
20033
+ if (this.discardable.length === 0) {
20034
+ this.confirmingDiscard = false;
20035
+ }
20036
+ if (!this.canReuse) {
20037
+ this.reuseDetections = false;
20038
+ }
20039
+ }
20040
+ /**
20041
+ * Every visit to analyse has a finished inventory of all its panoramas, with all its detections
20042
+ * kept: placing them again takes minutes, and analyses nothing. They are placed again under one
20043
+ * model, so all must come from the same.
20044
+ */
20045
+ get canReuse() {
20046
+ const visits = this.launchableVisits;
20047
+ const model = this.reusable[visits[0]?.nodeID]?.MLInventoryModelID;
20048
+ return visits.length > 0 && visits.every((visit) => {
20049
+ const run = this.reusable[visit.nodeID];
20050
+ return !!run && run.imagesTotal === this.visitFiles[visit.nodeID]?.panoramas
20051
+ && run.MLInventoryModelID === model;
20052
+ });
20053
+ }
20054
+ /** The model of the detections placed again: the one the launch uses when it reuses them. */
20055
+ get reusedModelName() {
20056
+ return this.reusable[this.launchableVisits[0]?.nodeID]?.MLInventoryModelName ?? "";
20057
+ }
20058
+ onFilesChange(visit, files) {
20059
+ this.visitFiles[visit.nodeID] = files;
20060
+ if (!this.canReuse) {
20061
+ this.reuseDetections = false;
20062
+ }
20063
+ if (this.deletePrevious) {
20064
+ // A visit gained or lost a file: what gets deleted depends on the visits analysed.
20065
+ this.countPrevious();
20066
+ }
20067
+ }
20068
+ /** Deletes the detections kept for the visits whose inventory is done. The equipment stays. */
20069
+ async onConfirmDiscard() {
20070
+ this.discarding = true;
20071
+ this.message = null;
20072
+ this.discarded = false;
20073
+ try {
20074
+ // Read again: an inventory launched since, from here or elsewhere, may need them.
20075
+ const { discardable } = await this.readKept();
20076
+ const failed = await Promise.all(discardable.map((visit) => this.inventoryService.discardDetections(visit.model3D)));
20077
+ this.notDeleted = failed.reduce((total, count) => total + count, 0);
20078
+ if (this.notDeleted > 0) {
20079
+ this.message = "{{count}} saved detections could not be discarded: try again.";
20080
+ }
20081
+ else {
20082
+ this.discarded = discardable.length > 0;
20083
+ }
20084
+ }
20085
+ catch (error) {
20086
+ console.error("Detections not discarded", error);
20087
+ this.message = "The saved detections could not be discarded.";
20088
+ }
20089
+ finally {
20090
+ this.discarding = false;
20091
+ this.confirmingDiscard = false;
20092
+ await this.findReusable();
20093
+ }
20094
+ }
20095
+ onReuseChange(reuse) {
20096
+ this.reuseDetections = reuse;
20097
+ if (reuse && !this.deletePrevious) {
20098
+ // Placed again beside those placed before, every object would be there twice.
20099
+ this.onDeletePreviousChange(true);
20100
+ }
19691
20101
  }
19692
20102
  async checkFiles() {
19693
20103
  const visits = this.visits ?? [];
@@ -19697,6 +20107,9 @@ class InventoryLaunchComponent {
19697
20107
  // Other visits may have come meanwhile, checked by their own call.
19698
20108
  if (visits === this.visits) {
19699
20109
  this.visitFiles = Object.fromEntries(visits.map((visit, index) => [visit.nodeID, files[index]]));
20110
+ if (this.deletePrevious) {
20111
+ this.countPrevious();
20112
+ }
19700
20113
  }
19701
20114
  }
19702
20115
  finally {
@@ -19713,35 +20126,129 @@ class InventoryLaunchComponent {
19713
20126
  });
19714
20127
  }
19715
20128
  get canLaunch() {
19716
- return !!this.model && !this.running && !this.launching && !this.checkingFiles
19717
- && this.launchableVisits.length > 0;
20129
+ // Reusing, the model is the one of the detections, whatever is selected.
20130
+ return (!!this.model || (this.reuseDetections && this.canReuse))
20131
+ && !this.running && !this.launching && !this.discarding
20132
+ && !this.checkingFiles && this.launchableVisits.length > 0;
19718
20133
  }
19719
20134
  async onDeletePreviousChange(deletePrevious) {
20135
+ if (!deletePrevious && this.reuseDetections) {
20136
+ // Placed again beside those placed before, every object would be there twice.
20137
+ return;
20138
+ }
19720
20139
  this.deletePrevious = deletePrevious;
19721
- if (deletePrevious && this.aiEquipmentCount === null) {
19722
- this.aiEquipmentCount = (await this.aiEquipments()).length;
20140
+ if (deletePrevious) {
20141
+ await this.countPrevious();
19723
20142
  }
19724
20143
  }
20144
+ /** Counts what the launch would delete: it depends on the visits analysed. */
20145
+ async countPrevious() {
20146
+ const check = ++this.countCheck;
20147
+ this.aiEquipmentCount = null;
20148
+ let count = null;
20149
+ try {
20150
+ count = (await this.aiEquipments()).length;
20151
+ }
20152
+ catch (error) {
20153
+ console.warn("Previous inventory not counted", error);
20154
+ }
20155
+ if (check === this.countCheck) {
20156
+ this.aiEquipmentCount = count;
20157
+ }
20158
+ }
20159
+ /**
20160
+ * The equipment the AI added to the visits analysed, known by the panoramas their tags are at:
20161
+ * a visit left out, for a missing file, keeps its own. One whose tag has no panorama cannot be
20162
+ * told apart, and is deleted only when every visit is analysed again.
20163
+ */
19725
20164
  async aiEquipments() {
19726
- const equipments = await this.equipmentService.getEquipmentsForSpace(this.spaceID);
19727
- return equipments.filter((equip) => equip.isCreatedByAI);
20165
+ const visits = this.launchableVisits;
20166
+ const everyVisit = visits.length === (this.visits ?? []).length;
20167
+ const [equipments, navigations] = await Promise.all([
20168
+ this.equipmentService.getEquipmentsForSpace(this.spaceID),
20169
+ Promise.all(visits.map((visit) => this.navigationService.getNavigationsForNode(visit.nodeID))),
20170
+ ]);
20171
+ const sweeps = new Set(navigations.flat().map((navigation) => navigation?.matterportSweepID).filter((sweep) => !!sweep));
20172
+ return equipments.filter((equip) => {
20173
+ if (!equip.isCreatedByAI) {
20174
+ return false;
20175
+ }
20176
+ const placedAt = (equip.pois?.items ?? [])
20177
+ .map((poi) => poi?.matterportSweepID)
20178
+ .filter((sweep) => !!sweep);
20179
+ return placedAt.length === 0 ? everyVisit : placedAt.some((sweep) => sweeps.has(sweep));
20180
+ });
20181
+ }
20182
+ /**
20183
+ * Deletes the equipment a few at a time, going on past one that fails (its error logged), and
20184
+ * says how many could not be deleted.
20185
+ */
20186
+ async deleteFewAtATime(equipments) {
20187
+ let failed = 0;
20188
+ this.deleting = { done: 0, total: equipments.length };
20189
+ try {
20190
+ for (let start = 0; start < equipments.length; start += INVENTORY_DELETE_AT_ONCE) {
20191
+ const batch = equipments.slice(start, start + INVENTORY_DELETE_AT_ONCE);
20192
+ const results = await Promise.allSettled(
20193
+ // Just loaded: an operation-less equipment's operations are not looked for again.
20194
+ batch.map((equip) => this.equipmentService.deleteEquipment(equip, true)));
20195
+ results.forEach((result, i) => {
20196
+ if (result.status === "rejected") {
20197
+ failed += 1;
20198
+ console.error("Equipment not deleted", batch[i].id, result.reason);
20199
+ }
20200
+ });
20201
+ this.deleting.done += batch.length;
20202
+ }
20203
+ }
20204
+ finally {
20205
+ this.deleting = null;
20206
+ }
20207
+ return failed;
19728
20208
  }
19729
20209
  async onLaunchClick() {
19730
20210
  this.launching = true;
19731
20211
  this.message = null;
20212
+ this.discarded = false;
19732
20213
  try {
19733
- if (this.deletePrevious) {
19734
- const previous = await this.aiEquipments();
19735
- await Promise.all(previous.map((equip) => this.equipmentService.deleteEquipment(equip)));
20214
+ const visits = this.launchableVisits;
20215
+ const reuse = this.reuseDetections && this.canReuse;
20216
+ const reusedRuns = reuse ? visits.map((visit) => this.reusable[visit.nodeID]) : [];
20217
+ if (reuse) {
20218
+ // Checked before deleting anything: without them, the previous equipment would be
20219
+ // gone and every panorama analysed again, for hours.
20220
+ const kept = await Promise.all(visits.map((visit) => this.inventoryService.keptDetections(visit.model3D)));
20221
+ if (!reusedRuns.every((run, index) => this.keptAll(run, kept[index]))) {
20222
+ this.message = "The saved detections are no longer available.";
20223
+ this.reuseDetections = false;
20224
+ this.findReusable();
20225
+ return;
20226
+ }
20227
+ }
20228
+ // Reusing always deletes them: placed again beside them, every object would be there twice.
20229
+ if (this.deletePrevious || reuse) {
20230
+ this.notDeleted = await this.deleteFewAtATime(await this.aiEquipments());
19736
20231
  this.aiEquipmentCount = null;
20232
+ if (this.notDeleted > 0) {
20233
+ // Launched anyway, the new equipment would sit beside what is left of the old.
20234
+ this.message = "{{count}} equipment of the previous inventory could not be deleted: launch again to retry.";
20235
+ return;
20236
+ }
19737
20237
  }
19738
- const launched = await this.inventoryService.launch(this.spaceID, this.launchableVisits.map((visit) => visit.nodeID), this.model, Number(this.cutoffScore),
20238
+ // Placed again, the detections keep the model that made them.
20239
+ const reused = reusedRuns[0];
20240
+ const launched = await this.inventoryService.launch(this.spaceID, visits.map((visit) => visit.nodeID), reused
20241
+ ? { id: reused.MLInventoryModelID, name: reused.MLInventoryModelName }
20242
+ : this.model, Number(this.cutoffScore),
19739
20243
  // Panoramas are named after their sweep's first 8 characters.
19740
- this.panorama ? this.panorama.split("_")[0] : undefined);
20244
+ this.panorama ? this.panorama.split("_")[0] : undefined, Object.fromEntries(reusedRuns.map((run) => [run.nodeID, run.id])));
19741
20245
  if (launched === "ALREADY_RUNNING") {
19742
20246
  this.message = "An inventory is already running for this location.";
19743
20247
  return;
19744
20248
  }
20249
+ this.reuseDetections = false;
20250
+ this.findReusable();
20251
+ this.keepSettings();
19745
20252
  this.launched.emit();
19746
20253
  }
19747
20254
  catch (error) {
@@ -19752,13 +20259,13 @@ class InventoryLaunchComponent {
19752
20259
  this.launching = false;
19753
20260
  }
19754
20261
  }
19755
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryLaunchComponent, deps: [{ token: InventoryService }, { token: EquipmentService }], target: i0.ɵɵFactoryTarget.Component });
19756
- 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]\" [model3D]=\"visit.model3D\"></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\" [disabled]=\"launching\"\n (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\n {{ 'Equipment added by the AI before, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\n </span>\n</div>\n\n<div class=\"inventory-launch-settings\">\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\">\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | 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 <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill\" [disabled]=\"launching\"\n (click)=\"cancelled.emit()\">{{ 'Cancel' | translate }}</button>\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill\" [disabled]=\"!canLaunch\"\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\n (click)=\"onLaunchClick()\">{{ 'Launch inventory' | translate }}</button>\n</div>\n\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate }}</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-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"], outputs: ["filesChange"] }, { kind: "component", type: CheckboxSliderComponent, selector: "lib-checkbox-slider", inputs: ["label", "checked", "disabled"], outputs: ["checkedChange"] }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
20262
+ 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 });
20263
+ 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. -->\r\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\r\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>\r\n\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\r\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\r\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\r\n</ul>\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\r\n <li>{{ 'Visits to analyse' | translate }}:\r\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\r\n</ul>\r\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\r\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\r\n\r\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\r\n<ng-container *ngIf=\"!checkingFiles\">\r\n <div *ngFor=\"let visit of visits\">\r\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\r\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\r\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\r\n </div>\r\n</ng-container>\r\n\r\n<div class=\"inventory-launch-delete\">\r\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\r\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\r\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\r\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\r\n </span>\r\n</div>\r\n\r\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\r\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\r\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\r\n </span>\r\n</div>\r\n\r\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\r\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\r\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\r\n {{ 'Discard the saved detections' | translate }}</button>\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\r\n </span>\r\n <div class=\"inventory-launch-confirm\">\r\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\r\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\r\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\r\n </div>\r\n </ng-container>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\r\n</div>\r\n\r\n<div class=\"inventory-launch-settings\">\r\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\r\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\r\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\r\n </select>\r\n <!-- Reusing, the detections keep the model that made them. -->\r\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\r\n [title]=\"'The detections keep the model that made them.' | translate\">\r\n <option>{{ reusedModelName | translate }}</option>\r\n </select>\r\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\r\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\r\n </select>\r\n</div>\r\n\r\n<div class=\"inventory-launch-buttons\">\r\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\r\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\r\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\r\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\r\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\r\n</div>\r\n\r\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\r\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" }] });
19757
20264
  }
19758
20265
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InventoryLaunchComponent, decorators: [{
19759
20266
  type: Component,
19760
- 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]\" [model3D]=\"visit.model3D\"></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\" [disabled]=\"launching\"\n (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\n {{ 'Equipment added by the AI before, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\n </span>\n</div>\n\n<div class=\"inventory-launch-settings\">\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\">\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | 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 <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill\" [disabled]=\"launching\"\n (click)=\"cancelled.emit()\">{{ 'Cancel' | translate }}</button>\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill\" [disabled]=\"!canLaunch\"\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\n (click)=\"onLaunchClick()\">{{ 'Launch inventory' | translate }}</button>\n</div>\n\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate }}</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-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"] }]
19761
- }], ctorParameters: () => [{ type: InventoryService }, { type: EquipmentService }], propDecorators: { spaceID: [{
20267
+ args: [{ selector: "lib-inventory-launch", template: "<!-- What the inventory will do, before it is done: it adds equipment to the location. -->\r\n<p *ngIf=\"panorama\">{{ 'The AI will look for equipment in this panorama and add what it finds to the location.' | translate }}</p>\r\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>\r\n\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"panorama\">\r\n <li>{{ 'Visit' | translate }}: <strong class=\"no-lowercase\">{{ visits?.[0]?.label }}</strong></li>\r\n <li>{{ 'Panorama' | translate }}: <strong class=\"no-lowercase\">{{ panorama }}</strong></li>\r\n</ul>\r\n<ul class=\"inventory-launch-summary\" *ngIf=\"!panorama && visits?.length > 0\">\r\n <li>{{ 'Visits to analyse' | translate }}:\r\n <strong>{{ checkingFiles ? '\u2026' : launchableVisits.length + ' / ' + visits.length }}</strong></li>\r\n</ul>\r\n<p class=\"text-danger\" *ngIf=\"visits?.length === 0\">\r\n {{ 'This location has no Matterport visit for the AI to analyse.' | translate }}</p>\r\n\r\n<lib-loader *ngIf=\"checkingFiles\"></lib-loader>\r\n<ng-container *ngIf=\"!checkingFiles\">\r\n <div *ngFor=\"let visit of visits\">\r\n <strong class=\"no-lowercase\" *ngIf=\"!panorama\">{{ visit.label }}</strong>\r\n <lib-inventory-files [files]=\"visitFiles[visit.nodeID]\" (filesChange)=\"onFilesChange(visit, $event)\"\r\n [model3D]=\"visit.model3D\" [disabled]=\"running || launching || discarding\"></lib-inventory-files>\r\n </div>\r\n</ng-container>\r\n\r\n<div class=\"inventory-launch-delete\">\r\n <lib-checkbox-slider label=\"Delete previous inventory ?\" [checked]=\"deletePrevious\"\r\n [disabled]=\"launching || reuseDetections\" (checkedChange)=\"onDeletePreviousChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deletePrevious\">\r\n {{ 'Equipment the AI added to these visits, deleted first' | translate }}: <strong>{{ aiEquipmentCount ?? '\u2026' }}</strong>\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Needed to reuse the detections, or every object would be there twice.' | translate }}\r\n </span>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"deleting\">\r\n {{ 'Deleting the previous inventory' | translate }}: {{ deleting.done }} / {{ deleting.total }}\r\n </span>\r\n</div>\r\n\r\n<!-- The last inventories' detections placed again with another cutoff: no panorama analysed again. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"canReuse\">\r\n <lib-checkbox-slider label=\"Reuse the detections of the last inventory\" [checked]=\"reuseDetections\"\r\n [disabled]=\"launching\" (checkedChange)=\"onReuseChange($event)\"></lib-checkbox-slider>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"reuseDetections\">\r\n {{ 'Only the placing is done again, with the cutoff chosen: a few minutes.' | translate }}\r\n </span>\r\n</div>\r\n\r\n<!-- Once the cutoff is chosen, the detections kept to change it can go. -->\r\n<div class=\"inventory-launch-delete\" *ngIf=\"discardable.length > 0 || discarded\">\r\n <ng-container *ngIf=\"discardable.length > 0 && !confirmingDiscard\">\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-danger rounded-pill inventory-launch-discard\"\r\n [disabled]=\"running || launching\" (click)=\"confirmingDiscard = true\">\r\n {{ 'Discard the saved detections' | translate }}</button>\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'Once the cutoff is chosen, this frees the space they take. The equipment stays.' | translate }}\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"discardable.length > 0 && confirmingDiscard\">\r\n <span class=\"inventory-launch-hint\">\r\n {{ 'The equipment stays. To change the cutoff later, the panoramas will have to be analysed again.' | translate }}\r\n </span>\r\n <div class=\"inventory-launch-confirm\">\r\n <button type=\"button\" class=\"btn btn-sm btn-danger rounded-pill\" [disabled]=\"running || launching || discarding\"\r\n (click)=\"onConfirmDiscard()\">{{ (discarding ? 'Discarding\u2026' : 'Yes, discard') | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary rounded-pill\" [disabled]=\"discarding\"\r\n (click)=\"confirmingDiscard = false\">{{ 'No, keep them' | translate }}</button>\r\n </div>\r\n </ng-container>\r\n <span class=\"inventory-launch-hint\" *ngIf=\"discarded\">{{ 'The saved detections were discarded.' | translate }}</span>\r\n</div>\r\n\r\n<div class=\"inventory-launch-settings\">\r\n <select class=\"no-lowercase form-select\" [(ngModel)]=\"model\" *ngIf=\"!reuseDetections\">\r\n <option [ngValue]=\"undefined\">{{ 'Select model' | translate }}</option>\r\n <option *ngFor=\"let option of models\" [ngValue]=\"option\">{{ option.name | translate }}</option>\r\n </select>\r\n <!-- Reusing, the detections keep the model that made them. -->\r\n <select class=\"no-lowercase form-select inventory-launch-reused-model\" *ngIf=\"reuseDetections\" disabled\r\n [title]=\"'The detections keep the model that made them.' | translate\">\r\n <option>{{ reusedModelName | translate }}</option>\r\n </select>\r\n <select class=\"form-select\" [(ngModel)]=\"cutoffScore\" [title]=\"'Cutoff score' | translate\">\r\n <option *ngFor=\"let score of cutoffScores\" [ngValue]=\"score\">{{ 'Cutoff score' | translate }} {{ score }}</option>\r\n </select>\r\n</div>\r\n\r\n<div class=\"inventory-launch-buttons\">\r\n <!-- Closes the panel only: \"Cancel the inventory\", below, is what stops one. -->\r\n <button type=\"button\" class=\"btn btn-outline-secondary rounded-pill inventory-launch-close\" [disabled]=\"launching\"\r\n (click)=\"cancelled.emit()\">{{ 'Close' | translate }}</button>\r\n <button type=\"button\" class=\"btn btn-outline-primary rounded-pill inventory-launch-go\" [disabled]=\"!canLaunch\"\r\n [title]=\"running ? ('An inventory is already running for this location.' | translate) : ''\"\r\n (click)=\"onLaunchClick()\">{{ (reuseDetections && canReuse ? 'Update' : 'Launch inventory') | translate }}</button>\r\n</div>\r\n\r\n<div class=\"text-danger mt-2\" *ngIf=\"message\">{{ message | translate: { count: notDeleted } }}</div>\r\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"] }]
20268
+ }], ctorParameters: () => [{ type: InventoryService }, { type: EquipmentService }, { type: NavigationService }], propDecorators: { spaceID: [{
19762
20269
  type: Input
19763
20270
  }], visits: [{
19764
20271
  type: Input
@@ -19945,27 +20452,27 @@ class BaseTagService {
19945
20452
  throw new Error('updatePoiMetadata is not implemented in the base class.');
19946
20453
  }*/
19947
20454
  async prepareEquipmentHtml(equip) {
19948
- throw new Error(`prepareEquipmentHtml is not implemented in the base class.
20455
+ throw new Error(`prepareEquipmentHtml is not implemented in the base class.
19949
20456
  Please override this method in your extended class.`);
19950
20457
  }
19951
20458
  async prepareTicketHtml(ticket) {
19952
- throw new Error(`prepareTicketHtml is not implemented in the base class.
20459
+ throw new Error(`prepareTicketHtml is not implemented in the base class.
19953
20460
  Please override this method in your extended class.`);
19954
20461
  }
19955
20462
  async prepareFeatureHtml(feature) {
19956
- throw new Error(`prepareFeatureHtml is not implemented in the base class.
20463
+ throw new Error(`prepareFeatureHtml is not implemented in the base class.
19957
20464
  Please override this method in your extended class.`);
19958
20465
  }
19959
20466
  async prepareMeasurementHtml(measure) {
19960
- throw new Error(`prepareMeasurementHtml is not implemented in the base class.
20467
+ throw new Error(`prepareMeasurementHtml is not implemented in the base class.
19961
20468
  Please override this method in your extended class.`);
19962
20469
  }
19963
20470
  async prepareDeskHtml(feature) {
19964
- throw new Error(`prepareDeskHtml is not implemented in the base class.
20471
+ throw new Error(`prepareDeskHtml is not implemented in the base class.
19965
20472
  Please override this method in your extended class.`);
19966
20473
  }
19967
20474
  async prepareIndicatorHtml(feature) {
19968
- throw new Error(`prepareDeskHtml is not implemented in the base class.
20475
+ throw new Error(`prepareDeskHtml is not implemented in the base class.
19969
20476
  Please override this method in your extended class.`);
19970
20477
  }
19971
20478
  async getSignedTagIconSource(tagIconSrc) {
@@ -19974,15 +20481,15 @@ class BaseTagService {
19974
20481
  getIconTagImageForFeature(feature, poi) {
19975
20482
  // const tagIcon = JSON.parse(poi.tagIcon);
19976
20483
  // return tagIcon.src;
19977
- throw new Error(`getIconTagImageForFeature is not implemented in the base class.
20484
+ throw new Error(`getIconTagImageForFeature is not implemented in the base class.
19978
20485
  Please override this method in your extended class.`);
19979
20486
  }
19980
20487
  getScriptForTag(object, tagType) {
19981
- throw new Error(`getScriptForTag is not implemented in the base class.
20488
+ throw new Error(`getScriptForTag is not implemented in the base class.
19982
20489
  Please override this method in your extended class.`);
19983
20490
  }
19984
20491
  getAnnexeForCommentTypeInFeature(feature, commentType) {
19985
- throw new Error(`getAnnexeForCommentTypeInFeature is not implemented in the base class.
20492
+ throw new Error(`getAnnexeForCommentTypeInFeature is not implemented in the base class.
19986
20493
  Please override this method in your extended class.`);
19987
20494
  }
19988
20495
  getBillboardMediaToEmbed(object) {
@@ -19991,27 +20498,27 @@ class BaseTagService {
19991
20498
  return { comment: null, tagDescription: '' };
19992
20499
  }
19993
20500
  onActionDetailClick(url) {
19994
- throw new Error(`onActionDetailClick is not implemented in the base class.
20501
+ throw new Error(`onActionDetailClick is not implemented in the base class.
19995
20502
  Please override this method in your extended class.`);
19996
20503
  }
19997
20504
  onActionAudioClick(audioCommentID) {
19998
- throw new Error(`onActionDetailClick is not implemented in the base class.
20505
+ throw new Error(`onActionDetailClick is not implemented in the base class.
19999
20506
  Please override this method in your extended class.`);
20000
20507
  }
20001
20508
  onActionVideoClick(url) {
20002
- throw new Error(`onActionVideoClick is not implemented in the base class.
20509
+ throw new Error(`onActionVideoClick is not implemented in the base class.
20003
20510
  Please override this method in your extended class.`);
20004
20511
  }
20005
20512
  onActionImageClick(imageCommentID) {
20006
- throw new Error(`onActionImageClick is not implemented in the base class.
20513
+ throw new Error(`onActionImageClick is not implemented in the base class.
20007
20514
  Please override this method in your extended class.`);
20008
20515
  }
20009
20516
  onActionDocClick(url) {
20010
- throw new Error(`onActionDocClick is not implemented in the base class.
20517
+ throw new Error(`onActionDocClick is not implemented in the base class.
20011
20518
  Please override this method in your extended class.`);
20012
20519
  }
20013
20520
  onActionYoutubeClick(url) {
20014
- throw new Error(`onActionYoutubeClick is not implemented in the base class.
20521
+ throw new Error(`onActionYoutubeClick is not implemented in the base class.
20015
20522
  Please override this method in your extended class.`);
20016
20523
  }
20017
20524
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: BaseTagService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
@@ -21398,6 +21905,285 @@ function applyRigidTransformToDirection(v, t) {
21398
21905
  z: v.x * sin + v.z * cos
21399
21906
  };
21400
21907
  }
21908
+ /**
21909
+ * Applies the rotation part of the transform to an object's orientation: the Euler angles
21910
+ * (radians, three.js "XYZ" order, the one Object3D.rotation is stored and loaded in).
21911
+ *
21912
+ * A 3D object placed in the scene keeps its full orientation, so adding the angle to the Y
21913
+ * component only — as applyRigidTransformToYRotationDeg() does for a tag's heading — would be
21914
+ * wrong as soon as the object is tilted on X or Z. The rotation is composed instead: the
21915
+ * object's own rotation first, then the turn around the vertical axis of the whole model.
21916
+ *
21917
+ * The turn is the one applyRigidTransformToPoint() applies to positions, written for (x, z) as
21918
+ * x' = x cos(a) - z sin(a), z' = x sin(a) + z cos(a): in three.js terms a rotation of -a
21919
+ * around +Y. So an object keeps pointing at the same thing in both models.
21920
+ */
21921
+ function applyRigidTransformToEulerXYZ(rotation, t) {
21922
+ if (!t.rotationYRad) {
21923
+ // no turn: the stored angles are kept exactly (a round trip through a quaternion
21924
+ // could give an equivalent but differently written set of angles)
21925
+ return { x: rotation.x, y: rotation.y, z: rotation.z };
21926
+ }
21927
+ const objectRotation = new Quaternion().setFromEuler(new Euler(rotation.x, rotation.y, rotation.z, 'XYZ'));
21928
+ const modelTurn = new Quaternion().setFromAxisAngle(new Vector3(0, 1, 0), -t.rotationYRad);
21929
+ const turned = new Euler().setFromQuaternion(objectRotation.premultiply(modelTurn), 'XYZ');
21930
+ return { x: turned.x, y: turned.y, z: turned.z };
21931
+ }
21932
+
21933
+ // tag-archive.util.ts
21934
+ //
21935
+ // File format of the tag export / import (see MatterportTagCopyService.exportTagsToArchive()
21936
+ // and importTagsFromArchive()). An archive moves every tag of a location — and everything a
21937
+ // tag points at — from one environment (dev, demo, staging, production) to another, where
21938
+ // database ids and the S3 bucket are different.
21939
+ //
21940
+ // It is a ZIP file:
21941
+ // manifest.json format, version, origin of the export, the data and the file index
21942
+ // files/<n>_<name> one entry per S3 file referenced by the data (photos, attachments,
21943
+ // 3D models, tag icons...), stored as is (no recompression of media)
21944
+ //
21945
+ // The data keeps the records exactly as the source environment returned them: ids included,
21946
+ // since they are what links the records together (POI.elementID, Comment.featureID,
21947
+ // POI.tagImageID...). They are never written as is in the target: the import creates new
21948
+ // records and remaps every reference, like the copy between two locations does.
21949
+ const TAG_ARCHIVE_FORMAT = 'smarterplan-tags';
21950
+ /** Bumped on any change of the manifest that an older import could misread. */
21951
+ const TAG_ARCHIVE_VERSION = 1;
21952
+ const TAG_ARCHIVE_MANIFEST = 'manifest.json';
21953
+ const TAG_ARCHIVE_FILES_FOLDER = 'files/';
21954
+ /** Why an archive cannot be read. `code` is the end of a `matterportCopy.*` translation key. */
21955
+ class TagArchiveError extends Error {
21956
+ code;
21957
+ params;
21958
+ constructor(code, params = {}) {
21959
+ super(`Invalid tag archive: ${code}`);
21960
+ this.code = code;
21961
+ this.params = params;
21962
+ this.name = 'TagArchiveError';
21963
+ }
21964
+ }
21965
+ /** Archive path of the n-th exported file. The original name is kept for readability only. */
21966
+ function tagArchiveFilePath(index, s3Key) {
21967
+ const name = (s3Key.substring(s3Key.lastIndexOf('/') + 1) || 'file').replace(/[^a-zA-Z0-9.\-_]/g, '_');
21968
+ return `${TAG_ARCHIVE_FILES_FOLDER}${index}_${name}`;
21969
+ }
21970
+ /**
21971
+ * Packs a manifest and its files into a ZIP. Media files are stored without compression:
21972
+ * images, videos and models are already compressed, recompressing them only costs time.
21973
+ */
21974
+ function buildTagArchive(manifest, files) {
21975
+ const entries = {
21976
+ [TAG_ARCHIVE_MANIFEST]: [strToU8(JSON.stringify(manifest)), { level: 6 }]
21977
+ };
21978
+ for (const [path, bytes] of Object.entries(files)) {
21979
+ entries[path] = [bytes, { level: 0 }];
21980
+ }
21981
+ return zipSync(entries);
21982
+ }
21983
+ /**
21984
+ * Reads a ZIP produced by buildTagArchive(). Checks the format and the version, not the
21985
+ * module: see MatterportTagCopyService.readTagArchive().
21986
+ */
21987
+ function readTagArchive(bytes) {
21988
+ let entries;
21989
+ try {
21990
+ entries = unzipSync(bytes);
21991
+ }
21992
+ catch {
21993
+ throw new TagArchiveError('errorArchiveNotZip');
21994
+ }
21995
+ const manifestBytes = entries[TAG_ARCHIVE_MANIFEST];
21996
+ if (!manifestBytes) {
21997
+ throw new TagArchiveError('errorArchiveNoManifest');
21998
+ }
21999
+ let manifest;
22000
+ try {
22001
+ manifest = JSON.parse(strFromU8(manifestBytes));
22002
+ }
22003
+ catch {
22004
+ throw new TagArchiveError('errorArchiveNoManifest');
22005
+ }
22006
+ if (manifest?.format !== TAG_ARCHIVE_FORMAT || !manifest.data || !manifest.origin) {
22007
+ throw new TagArchiveError('errorArchiveNoManifest');
22008
+ }
22009
+ if (manifest.version > TAG_ARCHIVE_VERSION) {
22010
+ throw new TagArchiveError('errorArchiveVersion', { version: manifest.version });
22011
+ }
22012
+ const files = {};
22013
+ for (const [path, content] of Object.entries(entries)) {
22014
+ if (path.startsWith(TAG_ARCHIVE_FILES_FOLDER)) {
22015
+ files[path] = content;
22016
+ }
22017
+ }
22018
+ return { manifest, files };
22019
+ }
22020
+
22021
+ // object3d-model.util.ts
22022
+ //
22023
+ // Where the model file of an Object3D lives, and the checks a model file uploaded by a user
22024
+ // must pass before it is stored.
22025
+ //
22026
+ // Object3D.path means one of three things:
22027
+ // - s3Bucket === true -> key of a file uploaded to our S3 bucket (public level);
22028
+ // - an absolute http(s) url -> a model hosted elsewhere;
22029
+ // - otherwise "3DObjects/objects/<file>" -> a model of the library shipped with the application
22030
+ // (assets/3Dobjects/objects/<file>).
22031
+ //
22032
+ // Uploaded models are restricted to binary glTF (.glb): the viewer reads an S3 file through a
22033
+ // signed url, next to which no companion file (textures, .bin, .mtl) could be resolved. A .glb
22034
+ // carries everything in a single file.
22035
+ /** Folder of the library models, as stored in Object3D.path. */
22036
+ const OBJECT3D_LIBRARY_FOLDER = '3DObjects/objects/';
22037
+ /** Folder the application serves the library models from (see MatterportObject3DService). */
22038
+ const OBJECT3D_LIBRARY_ASSET_FOLDER = 'assets/3Dobjects/objects/';
22039
+ /** Largest model file a user may upload. */
22040
+ const OBJECT3D_UPLOAD_MAX_BYTES = 50 * 1024 * 1024;
22041
+ /** S3 folder of the uploaded models; one sub-folder per space. */
22042
+ const OBJECT3D_S3_FOLDER = 'objects3D/';
22043
+ /** Model formats the 3D loaders handle (an S3 model copied between locations keeps its own). */
22044
+ const OBJECT3D_MODEL_EXTENSIONS = ['glb', 'gltf', 'obj', 'fbx', 'dae'];
22045
+ /** Content type the uploaded models are stored with. */
22046
+ const GLB_CONTENT_TYPE = 'model/gltf-binary';
22047
+ const GLB_MAGIC = 0x46546c67; // "glTF", little endian
22048
+ const GLB_CHUNK_JSON = 0x4e4f534a; // "JSON"
22049
+ const GLB_HEADER_BYTES = 12;
22050
+ const GLB_CHUNK_HEADER_BYTES = 8;
22051
+ /**
22052
+ * Checks that a file is a self-contained binary glTF 2.0 model, small enough to be uploaded:
22053
+ * - name ending in .glb, size between 1 byte and OBJECT3D_UPLOAD_MAX_BYTES;
22054
+ * - glb header: magic "glTF", version 2, declared length equal to the file size;
22055
+ * - first chunk of type JSON, holding a parseable glTF document of version 2.x;
22056
+ * - no buffer nor image pointing at another file or url (only embedded data): such a
22057
+ * reference cannot be resolved next to a signed S3 url, and would make the viewer fetch
22058
+ * an arbitrary address.
22059
+ * The content is only read, never executed. Returns the error, or null when the file is valid.
22060
+ */
22061
+ async function validateGlbFile(file) {
22062
+ const name = (file.name || '').toLowerCase();
22063
+ if (!name.endsWith('.glb')) {
22064
+ return 'Only .glb files can be uploaded.';
22065
+ }
22066
+ if (!file.size) {
22067
+ return 'The file is empty.';
22068
+ }
22069
+ if (file.size > OBJECT3D_UPLOAD_MAX_BYTES) {
22070
+ return 'The file is too large (50 MB maximum).';
22071
+ }
22072
+ if (file.size < GLB_HEADER_BYTES + GLB_CHUNK_HEADER_BYTES) {
22073
+ return 'This file is not a valid .glb model.';
22074
+ }
22075
+ const header = new DataView(await file.slice(0, GLB_HEADER_BYTES + GLB_CHUNK_HEADER_BYTES).arrayBuffer());
22076
+ const magic = header.getUint32(0, true);
22077
+ const version = header.getUint32(4, true);
22078
+ const declaredLength = header.getUint32(8, true);
22079
+ const jsonLength = header.getUint32(12, true);
22080
+ const jsonType = header.getUint32(16, true);
22081
+ const jsonStart = GLB_HEADER_BYTES + GLB_CHUNK_HEADER_BYTES;
22082
+ if (magic !== GLB_MAGIC || version !== 2 || declaredLength !== file.size
22083
+ || jsonType !== GLB_CHUNK_JSON || jsonLength === 0 || jsonStart + jsonLength > file.size) {
22084
+ return 'This file is not a valid .glb model.';
22085
+ }
22086
+ let gltf;
22087
+ try {
22088
+ const jsonText = new TextDecoder('utf-8', { fatal: true })
22089
+ .decode(await file.slice(jsonStart, jsonStart + jsonLength).arrayBuffer());
22090
+ gltf = JSON.parse(jsonText);
22091
+ }
22092
+ catch {
22093
+ return 'This file is not a valid .glb model.';
22094
+ }
22095
+ if (!gltf || typeof gltf !== 'object' || !/^2\./.test(String(gltf.asset?.version ?? ''))) {
22096
+ return 'This file is not a valid .glb model.';
22097
+ }
22098
+ const references = [...asArray(gltf.buffers), ...asArray(gltf.images)]
22099
+ .map((item) => item?.uri)
22100
+ .filter((uri) => uri !== undefined && uri !== null);
22101
+ if (references.some((uri) => typeof uri !== 'string' || !uri.startsWith('data:'))) {
22102
+ return 'This model refers to external files: export it as a single .glb file with embedded textures.';
22103
+ }
22104
+ return null;
22105
+ }
22106
+ function asArray(value) {
22107
+ return Array.isArray(value) ? value : [];
22108
+ }
22109
+ /**
22110
+ * S3 key of an uploaded model: under the space's folder, with a file name reduced to safe
22111
+ * characters, followed by the upload time (UTC, to the millisecond) and a short random suffix.
22112
+ * S3 overwrites an existing key without warning, and a model may be used by several objects
22113
+ * (duplicates, copies, imports): two uploads of the same file name must never share a key.
22114
+ * The user's file name never decides the folder.
22115
+ */
22116
+ function buildObject3DModelKey(spaceId, fileName, now = new Date()) {
22117
+ const base = (fileName || 'model.glb').split(/[\\/]/).pop() || 'model.glb';
22118
+ const withoutExtension = base.replace(/\.[^.]*$/, '');
22119
+ // a copied model keeps its format (the loader is chosen by the extension); anything else is a .glb
22120
+ const extension = OBJECT3D_MODEL_EXTENSIONS.find(ext => base.toLowerCase().endsWith(`.${ext}`)) ?? 'glb';
22121
+ const safeName = withoutExtension
22122
+ .normalize('NFD').replace(/[̀-ͯ]/g, '')
22123
+ .replace(/[^a-zA-Z0-9\-_]+/g, '_')
22124
+ .replace(/^_+|_+$/g, '')
22125
+ .substring(0, 80) || 'model';
22126
+ const safeSpace = (spaceId || 'space').replace(/[^a-zA-Z0-9\-_]/g, '');
22127
+ // 20261126T104512345Z: sortable, and free of the characters S3 keys handle badly (":" ".")
22128
+ const timestamp = now.toISOString().replace(/[-:.]/g, '');
22129
+ const random = Math.random().toString(36).slice(2, 6).padEnd(4, '0');
22130
+ return `${OBJECT3D_S3_FOLDER}${safeSpace}/${safeName}_${timestamp}_${random}.${extension}`;
22131
+ }
22132
+ /** File name and extension of a path or url ("a/b/chair.GLB?v=2" gives chair / glb). */
22133
+ function splitModelFile(path) {
22134
+ const file = path.split(/[?#]/)[0].split('/').pop() || '';
22135
+ const dotIndex = file.lastIndexOf('.');
22136
+ if (dotIndex <= 0 || dotIndex === file.length - 1) {
22137
+ return null;
22138
+ }
22139
+ return { object: file.slice(0, dotIndex), format: file.slice(dotIndex + 1).toLowerCase() };
22140
+ }
22141
+ /** File name of a library model ("3DObjects/objects/chair.glb" gives "chair.glb"), null otherwise. */
22142
+ function getObject3DLibraryFile(path) {
22143
+ if (!path || /^https?:\/\//i.test(path)) {
22144
+ return null;
22145
+ }
22146
+ const markerIndex = path.indexOf(OBJECT3D_LIBRARY_FOLDER);
22147
+ if (markerIndex === -1) {
22148
+ return null;
22149
+ }
22150
+ return path.slice(markerIndex + OBJECT3D_LIBRARY_FOLDER.length) || null;
22151
+ }
22152
+ /**
22153
+ * Where to load the model of an Object3D from (see the header of this file). A model uploaded
22154
+ * to S3 gets a signed url, valid for a limited time: resolve it when loading, never store it.
22155
+ * Null when the path is unusable.
22156
+ */
22157
+ async function resolveObject3DModelSource(object3D) {
22158
+ const path = object3D?.path;
22159
+ if (!path) {
22160
+ return null;
22161
+ }
22162
+ if (object3D.s3Bucket) {
22163
+ const parsed = splitModelFile(path);
22164
+ const url = parsed ? await getSignedFile(path) : null;
22165
+ return parsed && url ? { ...parsed, url } : null;
22166
+ }
22167
+ if (/^https?:\/\/\S+$/i.test(path)) {
22168
+ const parsed = splitModelFile(path);
22169
+ return parsed ? { ...parsed, url: path } : null;
22170
+ }
22171
+ const libraryFile = getObject3DLibraryFile(path);
22172
+ return libraryFile ? splitModelFile(libraryFile) : null;
22173
+ }
22174
+
22175
+ /**
22176
+ * Whether this application may write 3D model files to S3: a model uploaded by the operator,
22177
+ * a library model restored from a tag archive, a model copied with a 3D object.
22178
+ *
22179
+ * True by default. An application not ready for it yet provides false (see the app.module.ts
22180
+ * of smarterplan-museum): tag copies and imports then never create a model file — a 3D object
22181
+ * whose model would need one is reported in the log instead.
22182
+ */
22183
+ const OBJECT3D_MODEL_UPLOAD_ENABLED = new InjectionToken('OBJECT3D_MODEL_UPLOAD_ENABLED', {
22184
+ providedIn: 'root',
22185
+ factory: () => true
22186
+ });
21401
22187
 
21402
22188
  /* eslint-disable class-methods-use-this */
21403
22189
  class Object3DService {
@@ -21859,6 +22645,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImpo
21859
22645
  args: ['currentAPIService']
21860
22646
  }] }] });
21861
22647
 
22648
+ /** Rotation 0, no translation: leaves every position and orientation unchanged. */
22649
+ const IDENTITY_TRANSFORM = {
22650
+ rotationYRad: 0,
22651
+ refSource: { x: 0, y: 0, z: 0 },
22652
+ refTarget: { x: 0, y: 0, z: 0 }
22653
+ };
21862
22654
  /** Safely extracts a readable message from an unknown catch value, including Amplify's
21863
22655
  * GraphQL error shape ({ data, errors: [{ errorType, message }] }). */
21864
22656
  function toErrorMessage(err) {
@@ -21900,6 +22692,16 @@ class MissingS3FileError extends Error {
21900
22692
  this.name = 'MissingS3FileError';
21901
22693
  }
21902
22694
  }
22695
+ /** Thrown when a 3D object would need a model file written to S3 while this application does
22696
+ * not allow it (see OBJECT3D_MODEL_UPLOAD_ENABLED): the object is skipped and reported. */
22697
+ class Object3DModelUploadDisabledError extends Error {
22698
+ objectName;
22699
+ constructor(objectName) {
22700
+ super(`3D model upload disabled in this application, object "${objectName}" skipped`);
22701
+ this.objectName = objectName;
22702
+ this.name = 'Object3DModelUploadDisabledError';
22703
+ }
22704
+ }
21903
22705
  class MatterportTagCopyService {
21904
22706
  navigationService;
21905
22707
  userService;
@@ -21916,6 +22718,7 @@ class MatterportTagCopyService {
21916
22718
  domainService;
21917
22719
  translate;
21918
22720
  zoneService;
22721
+ modelUploadEnabled;
21919
22722
  // Emits progress updates during copyTagsFromVisit(); null when idle
21920
22723
  copyProgress$ = new BehaviorSubject(null);
21921
22724
  // Emits the accumulated log lines during copyTagsFromVisit(); [] when idle
@@ -21975,7 +22778,26 @@ class MatterportTagCopyService {
21975
22778
  targetDomainIdsByTypeAndName = new Map();
21976
22779
  /** Target space id of the run in progress — used to re-home copied tag icons. */
21977
22780
  targetSpaceId = null;
21978
- constructor(navigationService, userService, poiService, ticketService, equipmentService, object3DService, featureService, measurementService, commentService, hashtagService, missionService, operationService, domainService, translate, zoneService) {
22781
+ // Import of an archive (importTagsFromArchive()). The archive comes from ANOTHER
22782
+ // environment, whose ids designate nothing here: its users, missions and categories are
22783
+ // re-pointed to simple local values instead of being matched like a copy does.
22784
+ /** archive being imported; null for a copy between two locations */
22785
+ archive = null;
22786
+ /** an imported comment is credited to the operator running the import (their mission
22787
+ * on the target space): the original author's mission belongs to another environment */
22788
+ importOwnerMissionId = null;
22789
+ /** organisation in which the categories missing from the target are created on import */
22790
+ importDomainOrganisationId = null;
22791
+ /** same Matterport model on both sides: a source sweep id is kept when the target has it */
22792
+ keepSweepIds = false;
22793
+ /** library model file -> whether this application ships it (import only) */
22794
+ libraryModelAvailability = new Map();
22795
+ /** model reference (see object3DModelKeyOf()) -> .glb chosen by the operator to replace it */
22796
+ replacementModels = new Map();
22797
+ /** model reference -> S3 key its replacement was uploaded to: a model shared by several
22798
+ * objects is uploaded once */
22799
+ uploadedReplacementKeys = new Map();
22800
+ constructor(navigationService, userService, poiService, ticketService, equipmentService, object3DService, featureService, measurementService, commentService, hashtagService, missionService, operationService, domainService, translate, zoneService, modelUploadEnabled) {
21979
22801
  this.navigationService = navigationService;
21980
22802
  this.userService = userService;
21981
22803
  this.poiService = poiService;
@@ -21991,20 +22813,68 @@ class MatterportTagCopyService {
21991
22813
  this.domainService = domainService;
21992
22814
  this.translate = translate;
21993
22815
  this.zoneService = zoneService;
22816
+ this.modelUploadEnabled = modelUploadEnabled;
21994
22817
  this.spModule = userService.getSpModule();
21995
22818
  }
22819
+ /** Whether this application may write 3D model files (see OBJECT3D_MODEL_UPLOAD_ENABLED). */
22820
+ get object3DModelUploadEnabled() {
22821
+ return this.modelUploadEnabled !== false;
22822
+ }
21996
22823
  //
21997
22824
  // ---------- Public API ----------
21998
22825
  //
21999
22826
  async copyTagsFromVisit(sourceSpaceId, targetSpaceId, landmarkSourceA, landmarkTargetA, landmarkSourceB, landmarkTargetB) {
22827
+ console.log(`Copying Tags from source ${sourceSpaceId} to target ${targetSpaceId}`);
22828
+ const transform = computeRigidTransform(landmarkSourceA, landmarkTargetA, landmarkSourceB, landmarkTargetB);
22829
+ console.log('Rigid transform computed:', {
22830
+ rotationYDeg: transform.rotationYRad * (180 / Math.PI),
22831
+ refSource: transform.refSource,
22832
+ refTarget: transform.refTarget
22833
+ });
22834
+ return this.runCopy(targetSpaceId, transform, () => this.collectLiveSnapshot(sourceSpaceId));
22835
+ }
22836
+ /**
22837
+ * Imports into a location the tags of an archive produced by exportTagsToArchive(),
22838
+ * possibly on another environment (dev, demo, staging, production).
22839
+ *
22840
+ * Runs the very same phases as copyTagsFromVisit(), the source being the archive instead
22841
+ * of a location: same deduplication (re-importing the same archive creates nothing twice),
22842
+ * same healing, same keyword handling. What differs is how references are re-pointed,
22843
+ * since the archive's ids designate nothing on this environment:
22844
+ * - files are re-uploaded from the archive instead of being copied inside the bucket;
22845
+ * - comments are credited to the operator running the import (see importOwnerMissionId);
22846
+ * - categories are matched by name, and created in the operator's organisation when the
22847
+ * target has none of that name (see resolveImportedDomainID()).
22848
+ */
22849
+ async importTagsFromArchive(archive, targetSpaceId, calibration, replacementModels = {}) {
22850
+ const origin = archive.manifest.origin;
22851
+ console.log(`Importing Tags exported from ${origin.environment} (space ${origin.spaceId}) to target ${targetSpaceId}`);
22852
+ const transform = calibration.mode === 'LANDMARKS'
22853
+ ? computeRigidTransform(calibration.landmarkSourceA, calibration.landmarkTargetA, calibration.landmarkSourceB, calibration.landmarkTargetB)
22854
+ : IDENTITY_TRANSFORM;
22855
+ return this.runCopy(targetSpaceId, transform, async () => {
22856
+ // First log line of an import: where its content comes from, so the downloaded log
22857
+ // keeps the trace of it.
22858
+ this.appendInfoLog(this.translate.instant('matterportCopy.importOrigin', this.describeOrigin(origin)));
22859
+ // set here, after runCopy() reset the run state
22860
+ this.replacementModels = new Map(Object.entries(replacementModels || {}));
22861
+ return this.snapshotFromArchive(archive);
22862
+ }, archive, calibration.mode === 'SAME_MODEL');
22863
+ }
22864
+ /**
22865
+ * Body shared by a copy and an import: reads the source through `collect`, then creates
22866
+ * the records in the target space.
22867
+ */
22868
+ async runCopy(targetSpaceId, transform, collect, archive = null, keepSweepIds = false) {
22000
22869
  let errorCount = 0;
22001
22870
  let healedCount = 0;
22002
22871
  // items skipped because an equivalent already exists in the target (earlier run)
22003
22872
  let alreadyPresentCount = 0;
22004
22873
  this.resetLog();
22005
22874
  this.resetRunState(targetSpaceId);
22875
+ this.archive = archive;
22876
+ this.keepSweepIds = keepSweepIds;
22006
22877
  try {
22007
- console.log(`Copying Tags from source ${sourceSpaceId} to target ${targetSpaceId}`);
22008
22878
  this.setStepProgress('collecting', 'collecting', 0);
22009
22879
  this.copyProgress$.next({
22010
22880
  phase: 'collecting',
@@ -22014,67 +22884,36 @@ class MatterportTagCopyService {
22014
22884
  });
22015
22885
  const targetMission = this.userService.currentMission(targetSpaceId);
22016
22886
  const targetMissionId = targetMission ? targetMission.id : null;
22017
- const transform = computeRigidTransform(landmarkSourceA, landmarkTargetA, landmarkSourceB, landmarkTargetB);
22018
- console.log('Rigid transform computed:', {
22019
- rotationYDeg: transform.rotationYRad * (180 / Math.PI),
22020
- refSource: transform.refSource,
22021
- refTarget: transform.refTarget
22022
- });
22023
- const sourceSweepIds = await this.navigationService.getAllowedSweepsIDsForUserInSpace(sourceSpaceId);
22887
+ const snapshot = await collect();
22024
22888
  const targetSweepIds = await this.navigationService.getAllowedSweepsIDsForUserInSpace(targetSpaceId);
22025
- this.setStepProgress('collecting', 'collecting', 30);
22026
- const [sourceNavPositions, targetNavPositions] = await Promise.all([
22027
- this.buildNavigationPositionMap(sourceSpaceId, sourceSweepIds),
22028
- this.buildNavigationPositionMap(targetSpaceId, targetSweepIds)
22029
- ]);
22889
+ const sourceNavPositions = snapshot.sweepPositions;
22890
+ const targetNavPositions = await this.buildNavigationPositionMap(targetSpaceId, targetSweepIds);
22891
+ this.setStepProgress('collecting', 'collecting', 70);
22030
22892
  const elementIds = this.elementIds;
22031
- let sourceTickets = [];
22032
- let sourceEquipments = [];
22893
+ const sourceTickets = snapshot.tickets;
22894
+ const sourceEquipments = snapshot.equipments;
22895
+ const sourceObjects3D = snapshot.objects3D;
22896
+ const sourceFeatures = snapshot.features;
22897
+ const sourceMeasurements = snapshot.measurements;
22033
22898
  let targetTickets = [];
22034
22899
  let targetEquipments = [];
22035
- let sourceMeasurements = [];
22036
22900
  let targetMeasurements = [];
22037
22901
  if (this.spModule == SpModule.IMMO) {
22038
- sourceTickets = await this.ticketService.getTicketsBySpace(sourceSpaceId);
22039
- sourceEquipments = await this.equipmentService.getEquipmentsForSpace(sourceSpaceId);
22040
22902
  targetTickets = await this.ticketService.getTicketsBySpace(targetSpaceId);
22041
22903
  targetEquipments = await this.equipmentService.getEquipmentsForSpace(targetSpaceId);
22904
+ targetMeasurements = (await this.measurementService.getMeasurementsForSpaceForUser(targetSpaceId));
22042
22905
  }
22043
- this.setStepProgress('collecting', 'collecting', 55);
22044
- const sourceObjects3D = await this.object3DService.getObjects3DBySpace(sourceSpaceId);
22045
22906
  const targetObjects3D = await this.object3DService.getObjects3DBySpace(targetSpaceId);
22046
- // Paginated: a space routinely holds more than the 100 features a single AppSync
22047
- // page returns, and the tail was silently dropped.
22048
- //
22049
- // The source list keeps the historical "skip what the operator archived" rule, so
22050
- // the set of copied features does not change — but the check is now null-safe:
22051
- // FeatureService.isArchived() dereferences currentMission(spaceID).id and threw a
22052
- // TypeError when the operator had no mission on the source space (the common case
22053
- // for an archived v1 space), aborting the whole copy.
22054
- // The target list is NOT filtered: it only feeds duplicate detection, and an
22055
- // archived feature is still a feature that exists there.
22056
- const sourceFeatures = (await this.featureService.getAllFeaturesBySpaceRaw(sourceSpaceId))
22057
- .filter(feature => !this.isArchivedForOperator(feature, sourceSpaceId));
22907
+ // The target list is NOT filtered (unlike the source, see collectLiveSnapshot()): it
22908
+ // only feeds duplicate detection, and an archived feature is still a feature that
22909
+ // exists there.
22058
22910
  const targetFeatures = await this.featureService.getAllFeaturesBySpaceRaw(targetSpaceId);
22059
- this.setStepProgress('collecting', 'collecting', 75);
22060
- // Keywords: index both vocabularies now (read-only). The keywords the target space
22061
- // is missing are created later, POI by POI, only for those actually used.
22062
- await this.loadHashtagIndex(sourceSpaceId, targetSpaceId);
22063
- // Missions: index both spaces now (read-only), so copied comments can credit
22064
- // their real author instead of whoever is running the copy.
22065
- await this.loadMissionIndex(sourceSpaceId, targetSpaceId);
22066
- // Domains: index every domain either operator's mission can see (read-only), so
22067
- // a category survives a copy across two DIFFERENT organisations whenever it
22068
- // genuinely would be selectable in the target space's own dropdown — see
22069
- // loadDomainIndex() for why this is keyed to Mission, not to the Space itself.
22070
- await this.loadDomainIndex(sourceSpaceId, targetSpaceId);
22071
- if (this.spModule == SpModule.IMMO) {
22072
- sourceMeasurements = (await this.measurementService.getMeasurementsForSpaceForUser(sourceSpaceId))
22073
- .filter(m => (m.numberPoints ?? 0) > 0);
22074
- targetMeasurements = (await this.measurementService.getMeasurementsForSpaceForUser(targetSpaceId));
22075
- }
22911
+ this.setStepProgress('collecting', 'collecting', 80);
22912
+ // Keywords, comment authors and categories: index what the source references and
22913
+ // what the target already has (read-only — nothing is created at this stage).
22914
+ await this.loadReferenceIndexes(snapshot, targetSpaceId, targetMissionId);
22076
22915
  this.setStepProgress('collecting', 'collecting', 90);
22077
- const sourcePoisAll = await this.poiService.getPoisByMatterportSweeps(sourceSweepIds);
22916
+ const sourcePoisAll = snapshot.pois;
22078
22917
  const targetPoisAll = await this.poiService.getPoisByMatterportSweeps(targetSweepIds);
22079
22918
  // A POI is "owned" by an element (ticket, equipment, 3D object, feature, measurement)
22080
22919
  // when its elementID points at one. Those POIs are created by their element's phase,
@@ -22150,7 +22989,8 @@ class MatterportTagCopyService {
22150
22989
  level: rawSource.level,
22151
22990
  metadata: rawSource.metadata || null,
22152
22991
  read: rawSource.read || null,
22153
- projectID: rawSource.projectID || null,
22992
+ // A project of another environment designates nothing here.
22993
+ projectID: this.archive ? null : (rawSource.projectID || null),
22154
22994
  problemCode: rawSource.problemCode || null,
22155
22995
  // Missions are per-space: a source mission id designates nobody in
22156
22996
  // the target space. Carrying the list over would look like real data
@@ -22161,7 +23001,7 @@ class MatterportTagCopyService {
22161
23001
  parentID: null,
22162
23002
  // Reused unchanged in the same organisation, matched by name
22163
23003
  // across two — see resolveDomainID().
22164
- domainID: this.resolveDomainID(rawSource.domainID),
23004
+ domainID: await this.resolveDomainID(rawSource.domainID),
22165
23005
  ownerMissionID: targetMissionId
22166
23006
  };
22167
23007
  const createdObj = await this.ticketService.createTicket(ticketInput);
@@ -22172,14 +23012,7 @@ class MatterportTagCopyService {
22172
23012
  // They were never copied at all: a duplicated ticket arrived stripped
22173
23013
  // of every piece of evidence attached to it.
22174
23014
  if (createdObj) {
22175
- let sourceComments = [];
22176
- try {
22177
- sourceComments = await this.commentService.getAllCommentsForTicket(sourceObj.id);
22178
- }
22179
- catch (commentsFetchError) {
22180
- console.warn(`Falling back to the embedded comment list for ticket "${rawSource.title}":`, commentsFetchError);
22181
- sourceComments = (sourceObj.comments?.items || []).filter(c => !!c);
22182
- }
23015
+ const sourceComments = await snapshot.getTicketComments(sourceObj);
22183
23016
  for (const sourceComment of this.orderCommentsForCopy(sourceComments)) {
22184
23017
  try {
22185
23018
  const created = await this.copyCommentForTicket(sourceComment, createdObj.id, targetSpaceId);
@@ -22292,7 +23125,7 @@ class MatterportTagCopyService {
22292
23125
  spaceID: targetSpaceId,
22293
23126
  // Reused unchanged in the same organisation, matched by name
22294
23127
  // across two — see resolveDomainID().
22295
- domainID: this.resolveDomainID(rawSource.domainID),
23128
+ domainID: await this.resolveDomainID(rawSource.domainID),
22296
23129
  photo: copiedPhotoKey,
22297
23130
  // `subequipmentsIDs` is deliberately absent: it is remapped to the
22298
23131
  // copied equipments in the second pass, once they all exist.
@@ -22406,7 +23239,7 @@ class MatterportTagCopyService {
22406
23239
  continue;
22407
23240
  }
22408
23241
  try {
22409
- const sourceOps = await this.operationService.getOperationsByTicketID(sourceTicket.id);
23242
+ const sourceOps = await snapshot.getTicketOperations(sourceTicket.id);
22410
23243
  if (sourceOps.length === 0) {
22411
23244
  continue;
22412
23245
  }
@@ -22453,8 +23286,31 @@ class MatterportTagCopyService {
22453
23286
  // Copying unconditionally meant every library object failed with NoSuchKey and
22454
23287
  // the whole 3D object was skipped, model AND POI.
22455
23288
  let copiedPath = rawSource.path;
22456
- if (rawSource.path && rawSource.s3Bucket) {
22457
- copiedPath = await this.copyS3KeyIfPresent(rawSource.path, `3D object "${rawSource.name}"`);
23289
+ let s3Bucket = !!rawSource.s3Bucket;
23290
+ const replacementModel = this.replacementModelOf(rawSource);
23291
+ if (!this.object3DModelUploadEnabled) {
23292
+ // This application writes no model file: the model is referenced as is.
23293
+ copiedPath = await this.modelPathWithoutUpload(rawSource);
23294
+ }
23295
+ else if (replacementModel) {
23296
+ // Import: a model missing from both the archive and this application,
23297
+ // replaced by a .glb the operator chose (see getMissingObject3DModels()).
23298
+ copiedPath = await this.uploadReplacementModel(replacementModel, targetSpaceId);
23299
+ s3Bucket = true;
23300
+ }
23301
+ else if (rawSource.path && rawSource.s3Bucket) {
23302
+ // Stored like an uploaded model: target space folder, timestamped name,
23303
+ // so the copy never overwrites a model another object may use.
23304
+ copiedPath = await this.copyS3KeyIfPresent(rawSource.path, `3D object "${rawSource.name}"`, null, sourceKey => buildObject3DModelKey(targetSpaceId, sourceKey));
23305
+ }
23306
+ else if (this.archive) {
23307
+ // Import: a library model the target application does not ship is
23308
+ // uploaded to S3 from the archive, so the object keeps its model.
23309
+ const uploadedKey = await this.restoreMissingLibraryModel(rawSource, targetSpaceId);
23310
+ if (uploadedKey) {
23311
+ copiedPath = uploadedKey;
23312
+ s3Bucket = true;
23313
+ }
22458
23314
  }
22459
23315
  /**
22460
23316
  * Strict parser to ensure [float, float, float] format for GraphQL.
@@ -22497,12 +23353,15 @@ class MatterportTagCopyService {
22497
23353
  // Tells the viewer how to interpret `path`. Dropping it turned an
22498
23354
  // S3-hosted model into a library reference on the copy, which the
22499
23355
  // viewer then tried to resolve against assets/ and failed to load.
22500
- s3Bucket: !!rawSource.s3Bucket,
23356
+ s3Bucket,
22501
23357
  name: rawSource.name,
22502
23358
  description: rawSource.description || "",
22503
23359
  spaceID: targetSpaceId,
22504
- position: toFloatArray(rawSource.position, [0, 0, 0]),
22505
- rotation: toFloatArray(rawSource.rotation, [0, 0, 0])
23360
+ // Where the object stands in the scene lives on the object itself (its
23361
+ // POI has no coordinate): it is moved with the landmarks like any tag.
23362
+ // Copying it unchanged left the object at the SOURCE model's coordinates,
23363
+ // out of place — often out of sight — in the target visit.
23364
+ ...this.getAdjustedObject3DPlacement(toFloatArray(rawSource.position, [0, 0, 0]), toFloatArray(rawSource.rotation, [0, 0, 0]), transform)
22506
23365
  };
22507
23366
  if ('viewFrustum' in rawSource) {
22508
23367
  object3DInput.viewFrustum = !!rawSource.viewFrustum;
@@ -22542,9 +23401,14 @@ class MatterportTagCopyService {
22542
23401
  this.setStepProgress('objects3d', 'objects3d', 100);
22543
23402
  break;
22544
23403
  }
22545
- console.error(`Error copying object3D "${sourceObj?.name}":`, itemError);
22546
23404
  errorCount++;
22547
- this.logCopyItemError(itemError, 'errorObject3d', sourceObj?.name || sourceObj?.id);
23405
+ if (itemError instanceof Object3DModelUploadDisabledError) {
23406
+ this.logItemError('errorObject3dUploadDisabled', { name: itemError.objectName });
23407
+ }
23408
+ else {
23409
+ console.error(`Error copying object3D "${sourceObj?.name}":`, itemError);
23410
+ this.logCopyItemError(itemError, 'errorObject3d', sourceObj?.name || sourceObj?.id);
23411
+ }
22548
23412
  }
22549
23413
  processedOverall++;
22550
23414
  emitProgress('objects3d', i + 1, sourceObjects3D.length);
@@ -22590,7 +23454,7 @@ class MatterportTagCopyService {
22590
23454
  description: rawSource.description || null,
22591
23455
  // Reused unchanged in the same organisation, matched by name
22592
23456
  // across two — see resolveDomainID().
22593
- domainID: this.resolveDomainID(rawSource.domainID),
23457
+ domainID: await this.resolveDomainID(rawSource.domainID),
22594
23458
  spaceID: targetSpaceId,
22595
23459
  ownerMissionID: targetMissionId
22596
23460
  };
@@ -22602,17 +23466,8 @@ class MatterportTagCopyService {
22602
23466
  this.markHashtagsUsed(resolvedHashtags);
22603
23467
  }
22604
23468
  if (createdObj) {
22605
- // Read the media set through its own paginated query: the `comments`
22606
- // connection embedded in FeaturesBySpace is capped at 100 items and its
22607
- // nextToken was never followed, so rich POIs lost attachments silently.
22608
- let sourceComments = [];
22609
- try {
22610
- sourceComments = await this.commentService.getAllCommentsForFeature(sourceObj.id);
22611
- }
22612
- catch (commentsFetchError) {
22613
- console.warn(`Falling back to the embedded comment list for feature "${rawSource.title}":`, commentsFetchError);
22614
- sourceComments = (sourceObj.comments?.items || []).filter(c => !!c);
22615
- }
23469
+ // Read through its own paginated query, see collectLiveSnapshot().
23470
+ const sourceComments = await snapshot.getFeatureComments(sourceObj);
22616
23471
  for (const sourceComment of this.orderCommentsForCopy(sourceComments)) {
22617
23472
  try {
22618
23473
  const created = await this.copyCommentForFeature(sourceComment, createdObj.id, targetSpaceId);
@@ -22738,8 +23593,10 @@ class MatterportTagCopyService {
22738
23593
  alreadyPresentCount++;
22739
23594
  }
22740
23595
  if (!existsInTarget) {
23596
+ // An element that was not copied is kept as is by a copy (same
23597
+ // environment), but means nothing once imported on another one.
22741
23598
  const elementID = sourcePoi.elementID
22742
- ? (elementIds[sourcePoi.elementID] || sourcePoi.elementID)
23599
+ ? (elementIds[sourcePoi.elementID] || (this.archive ? null : sourcePoi.elementID))
22743
23600
  : sourcePoi.elementID;
22744
23601
  await this.createCopiedPoi(sourcePoi, elementID, sourceNavPositions, targetNavPositions, transform);
22745
23602
  }
@@ -22801,6 +23658,663 @@ class MatterportTagCopyService {
22801
23658
  const defaultName = `matterport-copy-log-${new Date().toISOString().replace(/[:.]/g, '-')}.txt`;
22802
23659
  downloadBlob(new Blob([text], { type: 'text/plain;charset=utf-8' }), filename || defaultName);
22803
23660
  }
23661
+ /**
23662
+ * Exports every tag of a location — and everything the tags point at: tickets, equipments
23663
+ * with their notes and links, 3D objects, POIs with their media, measurements, keywords,
23664
+ * categories — into a ZIP archive downloaded by the browser, together with the S3 files
23665
+ * they reference. The archive can then be imported in any location of any environment
23666
+ * (see importTagsFromArchive()): it records where it comes from (see TagArchiveOrigin).
23667
+ *
23668
+ * The location is read exactly as a copy reads its source (collectLiveSnapshot()), so an
23669
+ * export carries what a copy would. A file that cannot be downloaded is reported in the
23670
+ * log and left out; the import then treats it like a copy treats a missing file.
23671
+ *
23672
+ * Progress and log go through copyProgress$ / copyLog$ (phases 'collecting', 'files').
23673
+ */
23674
+ async exportTagsToArchive(spaceId, spaceName, visits = []) {
23675
+ let errorCount = 0;
23676
+ this.resetLog();
23677
+ this.resetRunState(null);
23678
+ const emitProgress = (phase, processed, total) => {
23679
+ this.copyProgress$.next({
23680
+ phase,
23681
+ processedInPhase: processed, totalInPhase: total,
23682
+ processedOverall: processed, totalOverall: total,
23683
+ percent: total > 0 ? Math.round((processed / total) * 100) : 100,
23684
+ errorCount, healedCount: 0
23685
+ });
23686
+ };
23687
+ try {
23688
+ console.log(`Exporting Tags of space ${spaceId}`);
23689
+ emitProgress('collecting', 0, 0);
23690
+ this.setStepProgress('collecting', 'collecting', 0);
23691
+ const snapshot = await this.collectLiveSnapshot(spaceId);
23692
+ // What a copy reads item by item is read up front here: it all goes in the archive.
23693
+ const ticketComments = {};
23694
+ const featureComments = {};
23695
+ const operations = [];
23696
+ await this.forEachInBatches(snapshot.tickets, async (ticket) => {
23697
+ ticketComments[ticket.id] = await snapshot.getTicketComments(ticket);
23698
+ try {
23699
+ const ticketOps = await snapshot.getTicketOperations(ticket.id);
23700
+ ticketOps
23701
+ .filter(op => !!op?.equipmentID)
23702
+ .forEach(op => operations.push({ ticketID: ticket.id, equipmentID: op.equipmentID }));
23703
+ }
23704
+ catch (opError) {
23705
+ console.error(`Error reading the ticket-equipment links of "${ticket?.title}":`, opError);
23706
+ errorCount++;
23707
+ this.logCopyItemError(opError, 'errorOperation', ticket?.title || ticket?.id);
23708
+ }
23709
+ });
23710
+ await this.forEachInBatches(snapshot.features, async (feature) => {
23711
+ featureComments[feature.id] = await snapshot.getFeatureComments(feature);
23712
+ });
23713
+ this.setStepProgress('collecting', 'collecting', 85);
23714
+ const allComments = [...Object.values(ticketComments), ...Object.values(featureComments)].flat();
23715
+ const domains = await this.collectExportDomains(spaceId, [
23716
+ ...snapshot.tickets, ...snapshot.equipments, ...snapshot.features, ...this.allSnapshotPois(snapshot)
23717
+ ]);
23718
+ this.setStepProgress('collecting', 'collecting', 100);
23719
+ // FILES — downloaded from S3, so that they can be re-uploaded on another environment.
23720
+ const fileKeys = this.collectArchiveFileKeys(snapshot, allComments);
23721
+ // Library models (.glb) used by the 3D objects: the application of the other
23722
+ // environment may not ship them (a model added by hand to the assets of this one).
23723
+ const libraryFiles = this.collectLibraryModelFiles(snapshot);
23724
+ const files = {};
23725
+ const fileIndex = {};
23726
+ let processedFiles = 0;
23727
+ emitProgress('files', 0, fileKeys.length);
23728
+ await this.forEachInBatches(fileKeys, async (key, index) => {
23729
+ try {
23730
+ const downloaded = await downloadS3Object(key);
23731
+ const bytes = new Uint8Array(await downloaded.body.arrayBuffer());
23732
+ const path = tagArchiveFilePath(index + 1, key);
23733
+ files[path] = bytes;
23734
+ fileIndex[key] = { path, contentType: downloaded.contentType, size: bytes.length };
23735
+ }
23736
+ catch (fileError) {
23737
+ console.warn(`[MatterportTagCopyService] Could not export the file "${key}":`, fileError);
23738
+ errorCount++;
23739
+ fileIndex[key] = { path: null, missing: true };
23740
+ this.logItemError(this.isMissingS3File(fileError) ? 'exportFileMissing' : 'exportFileError', { file: key, error: toErrorMessage(fileError) });
23741
+ }
23742
+ finally {
23743
+ processedFiles++;
23744
+ emitProgress('files', processedFiles, fileKeys.length);
23745
+ this.setStepProgress('files', 'files', fileKeys.length > 0 ? Math.round((processedFiles / fileKeys.length) * 100) : 100);
23746
+ }
23747
+ });
23748
+ for (const [index, libraryFile] of libraryFiles.entries()) {
23749
+ const archiveKey = OBJECT3D_LIBRARY_ASSET_FOLDER + libraryFile;
23750
+ try {
23751
+ const bytes = await this.fetchLibraryModel(libraryFile);
23752
+ if (!bytes) {
23753
+ throw new Error('not served by the application');
23754
+ }
23755
+ const path = tagArchiveFilePath(fileKeys.length + index + 1, libraryFile);
23756
+ files[path] = bytes;
23757
+ fileIndex[archiveKey] = { path, contentType: GLB_CONTENT_TYPE, size: bytes.length };
23758
+ }
23759
+ catch (fileError) {
23760
+ console.warn(`[MatterportTagCopyService] Could not export the library model "${libraryFile}":`, fileError);
23761
+ errorCount++;
23762
+ fileIndex[archiveKey] = { path: null, missing: true };
23763
+ this.logItemError('exportFileError', { file: archiveKey, error: toErrorMessage(fileError) });
23764
+ }
23765
+ }
23766
+ const origin = this.buildExportOrigin(spaceId, spaceName);
23767
+ const manifest = {
23768
+ format: TAG_ARCHIVE_FORMAT,
23769
+ version: TAG_ARCHIVE_VERSION,
23770
+ origin,
23771
+ visits: (visits || []).filter(visit => !!visit?.model3d),
23772
+ counts: {
23773
+ tickets: snapshot.tickets.length,
23774
+ equipments: snapshot.equipments.length,
23775
+ objects3D: snapshot.objects3D.length,
23776
+ features: snapshot.features.length,
23777
+ measurements: snapshot.measurements.length,
23778
+ pois: snapshot.pois.length,
23779
+ files: Object.keys(files).length
23780
+ },
23781
+ data: {
23782
+ tickets: snapshot.tickets,
23783
+ ticketComments,
23784
+ operations,
23785
+ equipments: snapshot.equipments,
23786
+ objects3D: snapshot.objects3D,
23787
+ features: snapshot.features,
23788
+ featureComments,
23789
+ measurements: snapshot.measurements,
23790
+ pois: snapshot.pois,
23791
+ sweepPositions: Object.fromEntries(snapshot.sweepPositions),
23792
+ hashtags: Object.fromEntries(snapshot.hashtagNames),
23793
+ domains
23794
+ },
23795
+ files: fileIndex
23796
+ };
23797
+ const zip = buildTagArchive(manifest, files);
23798
+ const date = origin.exportedAt.substring(0, 10);
23799
+ downloadBlob(new Blob([zip], { type: 'application/zip' }), `tags_${this.toFileName(spaceName || spaceId)}_${date}.zip`);
23800
+ emitProgress('done', 1, 1);
23801
+ this.appendInfoLog(this.translate.instant('matterportCopy.exportOrigin', this.describeOrigin(origin)));
23802
+ this.setStepLog('done', errorCount > 0
23803
+ ? this.translate.instant('matterportCopy.exportDoneWithErrors', { count: errorCount })
23804
+ : this.translate.instant('matterportCopy.exportDone'));
23805
+ return true;
23806
+ }
23807
+ catch (error) {
23808
+ console.error('Error exporting the tags:', error);
23809
+ this.appendErrorLog(this.translate.instant('matterportCopy.errorGeneral', { error: toErrorMessage(error) }));
23810
+ this.copyProgress$.next(null);
23811
+ return false;
23812
+ }
23813
+ }
23814
+ /**
23815
+ * Reads an archive chosen by the user (see exportTagsToArchive()). Throws a TagArchiveError
23816
+ * when it is not a tag archive, was made by a newer version, or by the application of
23817
+ * another module (MUSEUM vs IMMO): their models differ (Object3D, tickets...), the records
23818
+ * could not be created here.
23819
+ */
23820
+ async readTagArchive(file) {
23821
+ const archive = readTagArchive(new Uint8Array(await file.arrayBuffer()));
23822
+ if (archive.manifest.origin.module !== this.spModule) {
23823
+ throw new TagArchiveError('errorArchiveModule', { module: archive.manifest.origin.module });
23824
+ }
23825
+ return archive;
23826
+ }
23827
+ /** Placeholders of the matterportCopy.importOrigin / exportOrigin translations. */
23828
+ describeOrigin(origin) {
23829
+ return {
23830
+ environment: origin.environment || '?',
23831
+ space: origin.spaceName || origin.spaceId,
23832
+ date: origin.exportedAt ? new Date(origin.exportedAt).toLocaleString() : '?',
23833
+ user: origin.exportedBy?.name || origin.exportedBy?.userID || '?'
23834
+ };
23835
+ }
23836
+ //
23837
+ // ---------- Source of the tags: live location or archive ----------
23838
+ //
23839
+ /**
23840
+ * Reads a location of the current environment as the source of a copy or an export.
23841
+ *
23842
+ * Features archived by the operator are skipped (historical rule) — null-safe:
23843
+ * FeatureService.isArchived() dereferences currentMission(spaceID).id and threw a
23844
+ * TypeError when the operator had no mission on the source space (the common case for an
23845
+ * archived v1 space), aborting the whole copy. Features are paginated: a space routinely
23846
+ * holds more than the 100 features a single AppSync page returns, and the tail was
23847
+ * silently dropped.
23848
+ *
23849
+ * The attachments of tickets and features are read on demand, through their own
23850
+ * paginated query: the `comments` connection embedded in TicketsBySpace / FeaturesBySpace
23851
+ * is capped at 100 items and its nextToken was never followed, so rich POIs lost
23852
+ * attachments silently. The embedded list is only the fallback when that query fails.
23853
+ */
23854
+ async collectLiveSnapshot(spaceId) {
23855
+ const sweepIds = await this.navigationService.getAllowedSweepsIDsForUserInSpace(spaceId);
23856
+ const sweepPositions = await this.buildNavigationPositionMap(spaceId, sweepIds);
23857
+ this.setStepProgress('collecting', 'collecting', 20);
23858
+ let tickets = [];
23859
+ let equipments = [];
23860
+ let measurements = [];
23861
+ if (this.spModule == SpModule.IMMO) {
23862
+ tickets = await this.ticketService.getTicketsBySpace(spaceId);
23863
+ equipments = await this.equipmentService.getEquipmentsForSpace(spaceId);
23864
+ }
23865
+ this.setStepProgress('collecting', 'collecting', 35);
23866
+ const objects3D = await this.object3DService.getObjects3DBySpace(spaceId);
23867
+ const features = (await this.featureService.getAllFeaturesBySpaceRaw(spaceId))
23868
+ .filter(feature => !this.isArchivedForOperator(feature, spaceId));
23869
+ if (this.spModule == SpModule.IMMO) {
23870
+ measurements = (await this.measurementService.getMeasurementsForSpaceForUser(spaceId))
23871
+ .filter(m => (m.numberPoints ?? 0) > 0);
23872
+ }
23873
+ this.setStepProgress('collecting', 'collecting', 50);
23874
+ const pois = await this.poiService.getPoisByMatterportSweeps(sweepIds);
23875
+ const hashtagNames = await this.loadHashtagNames(spaceId);
23876
+ const missionUserIds = await this.loadMissionUserIds(spaceId);
23877
+ this.setStepProgress('collecting', 'collecting', 60);
23878
+ return {
23879
+ kind: 'live',
23880
+ spaceId,
23881
+ sweepPositions,
23882
+ tickets: (tickets || []).filter(t => !!t),
23883
+ equipments: (equipments || []).filter(e => !!e),
23884
+ objects3D: (objects3D || []).filter(o => !!o),
23885
+ features: (features || []).filter(f => !!f),
23886
+ measurements: (measurements || []).filter(m => !!m),
23887
+ pois: (pois || []).filter(p => !!p),
23888
+ hashtagNames,
23889
+ missionUserIds,
23890
+ domains: [],
23891
+ getTicketComments: async (ticket) => {
23892
+ try {
23893
+ return await this.commentService.getAllCommentsForTicket(ticket.id);
23894
+ }
23895
+ catch (commentsFetchError) {
23896
+ console.warn(`Falling back to the embedded comment list for ticket "${ticket?.title}":`, commentsFetchError);
23897
+ return (ticket.comments?.items || []).filter(c => !!c);
23898
+ }
23899
+ },
23900
+ getFeatureComments: async (feature) => {
23901
+ try {
23902
+ return await this.commentService.getAllCommentsForFeature(feature.id);
23903
+ }
23904
+ catch (commentsFetchError) {
23905
+ console.warn(`Falling back to the embedded comment list for feature "${feature?.title}":`, commentsFetchError);
23906
+ return (feature.comments?.items || []).filter(c => !!c);
23907
+ }
23908
+ },
23909
+ getTicketOperations: (ticketId) => this.operationService.getOperationsByTicketID(ticketId)
23910
+ };
23911
+ }
23912
+ /** Source of an import: the records of the archive, as the exporting environment read them. */
23913
+ snapshotFromArchive(archive) {
23914
+ const data = archive.manifest.data;
23915
+ const list = (items) => (items || []).filter(item => !!item);
23916
+ return {
23917
+ kind: 'archive',
23918
+ spaceId: archive.manifest.origin.spaceId,
23919
+ sweepPositions: new Map(Object.entries(data.sweepPositions || {})),
23920
+ tickets: list(data.tickets),
23921
+ equipments: list(data.equipments),
23922
+ objects3D: list(data.objects3D),
23923
+ features: list(data.features),
23924
+ measurements: list(data.measurements),
23925
+ pois: list(data.pois),
23926
+ hashtagNames: new Map(Object.entries(data.hashtags || {})),
23927
+ missionUserIds: new Map(),
23928
+ domains: list(data.domains),
23929
+ getTicketComments: async (ticket) => list(data.ticketComments?.[ticket.id]),
23930
+ getFeatureComments: async (feature) => list(data.featureComments?.[feature.id]),
23931
+ getTicketOperations: async (ticketId) => list(data.operations).filter(op => op.ticketID === ticketId)
23932
+ };
23933
+ }
23934
+ /**
23935
+ * READ-ONLY indexing of what the source references and the target already has: keywords,
23936
+ * comment authors and categories.
23937
+ * - copy: authors are matched by user (resolveCommentOwnerID()), categories by the
23938
+ * operator's missions on both spaces (loadDomainIndex());
23939
+ * - import: the archive's users belong to another environment, comments are credited to
23940
+ * the operator; categories are matched by name (loadImportedDomainIndex()).
23941
+ */
23942
+ async loadReferenceIndexes(snapshot, targetSpaceId, targetMissionId) {
23943
+ this.sourceHashtagNames = snapshot.hashtagNames;
23944
+ await this.loadTargetHashtagIndex(targetSpaceId);
23945
+ if (snapshot.kind === 'archive') {
23946
+ this.importOwnerMissionId = targetMissionId;
23947
+ await this.loadImportedDomainIndex(snapshot.domains, targetSpaceId);
23948
+ return;
23949
+ }
23950
+ this.sourceMissionUserIds = snapshot.missionUserIds;
23951
+ await this.loadTargetMissionIndex(targetSpaceId);
23952
+ await this.loadDomainIndex(snapshot.spaceId, targetSpaceId);
23953
+ }
23954
+ /**
23955
+ * READ-ONLY indexing for an import: the archived categories by their (foreign) id, and the
23956
+ * categories the operator's mission on the target space can see, by (type, name).
23957
+ * Missing categories are created in the mission's organisation, on demand — see
23958
+ * resolveImportedDomainID(). When the target categories cannot be read, none is created:
23959
+ * doing it blindly could duplicate existing ones.
23960
+ */
23961
+ async loadImportedDomainIndex(domains, targetSpaceId) {
23962
+ for (const domain of domains || []) {
23963
+ if (domain?.id) {
23964
+ this.domainsById.set(domain.id, domain);
23965
+ }
23966
+ }
23967
+ const targetMission = this.userService.currentMission(targetSpaceId);
23968
+ const orgIds = Array.from(new Set([targetMission?.organisationID, targetMission?.orderedOrganisationID]
23969
+ .filter((id) => !!id)));
23970
+ this.importDomainOrganisationId = targetMission?.organisationID ?? null;
23971
+ try {
23972
+ const domainLists = await Promise.all(orgIds.map(orgId => this.domainService.getAllGenericDomainsAndForOrganisation(orgId)));
23973
+ for (const domain of domainLists.flat()) {
23974
+ const key = domain?.name ? this.domainKey(domain.type, domain.name) : null;
23975
+ if (key && domain.id && !this.targetDomainIdsByTypeAndName.has(key)) {
23976
+ this.targetDomainIdsByTypeAndName.set(key, domain.id);
23977
+ }
23978
+ }
23979
+ }
23980
+ catch (error) {
23981
+ console.warn('[MatterportTagCopyService] Could not read the domains, imported categories will be dropped:', error);
23982
+ this.domainsById = new Map();
23983
+ this.importDomainOrganisationId = null;
23984
+ }
23985
+ }
23986
+ /**
23987
+ * Resolves an archived category for the target space: the category of the same type and
23988
+ * name the operator can see there, else a new one created in the organisation of their
23989
+ * mission on the target space (parents first, so the tree is kept). Dropped when it cannot
23990
+ * be created (no mission there, creation refused...).
23991
+ */
23992
+ async resolveImportedDomainID(sourceDomainId, visiting = new Set()) {
23993
+ const domain = this.domainsById.get(sourceDomainId);
23994
+ if (!domain?.name) {
23995
+ return null;
23996
+ }
23997
+ const key = this.domainKey(domain.type, domain.name);
23998
+ const existingId = this.targetDomainIdsByTypeAndName.get(key);
23999
+ if (existingId) {
24000
+ return existingId;
24001
+ }
24002
+ if (!this.importDomainOrganisationId) {
24003
+ return null;
24004
+ }
24005
+ visiting.add(sourceDomainId);
24006
+ const parentID = domain.parentID && !visiting.has(domain.parentID)
24007
+ ? await this.resolveImportedDomainID(domain.parentID, visiting)
24008
+ : null;
24009
+ try {
24010
+ const created = await this.domainService.createDomain({
24011
+ name: domain.name,
24012
+ slug: domain.slug ?? null,
24013
+ abbreviation: domain.abbreviation ?? null,
24014
+ description: domain.description ?? null,
24015
+ type: domain.type ?? null,
24016
+ parentID,
24017
+ organisationID: this.importDomainOrganisationId
24018
+ });
24019
+ if (!created?.id) {
24020
+ return null;
24021
+ }
24022
+ this.targetDomainIdsByTypeAndName.set(key, created.id);
24023
+ this.appendInfoLog(this.translate.instant('matterportCopy.domainCreated', { name: domain.name }));
24024
+ return created.id;
24025
+ }
24026
+ catch (error) {
24027
+ console.warn(`[MatterportTagCopyService] Could not create the category "${domain.name}":`, error);
24028
+ this.logItemError('errorDomainCreate', { name: domain.name, error: toErrorMessage(error) });
24029
+ // Remembered as "no equivalent", so the next item does not try again.
24030
+ this.domainsById.delete(sourceDomainId);
24031
+ return null;
24032
+ }
24033
+ }
24034
+ /**
24035
+ * Import counterpart of an S3 copy: uploads the archived bytes of `sourceKey` under
24036
+ * `destKey`. A file the export could not include is a MissingS3FileError, handled exactly
24037
+ * like an orphaned reference during a copy.
24038
+ */
24039
+ async restoreArchivedFile(sourceKey, destKey, contextLabel) {
24040
+ const entry = this.archive?.manifest.files?.[sourceKey];
24041
+ const bytes = entry?.path ? this.archive?.files[entry.path] : undefined;
24042
+ if (!bytes) {
24043
+ throw new MissingS3FileError(sourceKey, contextLabel);
24044
+ }
24045
+ const contentType = entry?.contentType || null;
24046
+ return uploadS3Object(destKey, new Blob([bytes], contentType ? { type: contentType } : undefined), contentType);
24047
+ }
24048
+ /** Runs `task` over `items`, a few at a time (keeps the API and S3 from throttling). */
24049
+ async forEachInBatches(items, task, batchSize = 5) {
24050
+ for (let i = 0; i < items.length; i += batchSize) {
24051
+ await Promise.all(items.slice(i, i + batchSize).map((item, j) => task(item, i + j)));
24052
+ }
24053
+ }
24054
+ /** Every POI of a snapshot: those on the sweeps and those embedded in the elements. */
24055
+ allSnapshotPois(snapshot) {
24056
+ const embedded = [...snapshot.tickets, ...snapshot.equipments, ...snapshot.objects3D, ...snapshot.features]
24057
+ .flatMap((element) => element?.pois?.items || []);
24058
+ const measurementPois = snapshot.measurements.map(measurement => measurement?.poi);
24059
+ return [...snapshot.pois, ...embedded, ...measurementPois].filter(poi => !!poi);
24060
+ }
24061
+ /**
24062
+ * Raw S3 keys of every file the copy duplicates (see the copy phases): equipment photos and
24063
+ * notes, attachments and media, measurement screenshots, uploaded 3D models, tag icons.
24064
+ */
24065
+ collectArchiveFileKeys(snapshot, comments) {
24066
+ const values = [];
24067
+ for (const equipment of snapshot.equipments) {
24068
+ values.push(equipment.photo);
24069
+ (equipment.notes?.items || []).forEach((note) => values.push(note?.attachment));
24070
+ }
24071
+ comments.forEach((comment) => values.push(comment?.annexe));
24072
+ snapshot.measurements.forEach((measurement) => values.push(measurement?.comment?.annexe));
24073
+ snapshot.objects3D
24074
+ .filter(object3D => object3D.s3Bucket)
24075
+ .forEach(object3D => values.push(object3D.path));
24076
+ for (const poi of this.allSnapshotPois(snapshot)) {
24077
+ try {
24078
+ values.push(poi.tagIcon ? JSON.parse(poi.tagIcon)?.src : null);
24079
+ }
24080
+ catch {
24081
+ // not JSON: duplicateTagIcon() leaves it untouched, there is no file to export
24082
+ }
24083
+ }
24084
+ const keys = new Set();
24085
+ values
24086
+ .filter((value) => typeof value === 'string' && !!value)
24087
+ .forEach(value => keys.add(this.extractS3KeyFromValue(value)));
24088
+ keys.delete('');
24089
+ return [...keys];
24090
+ }
24091
+ /**
24092
+ * Categories referenced by the exported records, with their ancestors: an import matches
24093
+ * them by name, and recreates the missing ones at the same place of the tree.
24094
+ */
24095
+ async collectExportDomains(spaceId, records) {
24096
+ const referenced = new Set(records.map(record => record?.domainID).filter((id) => !!id));
24097
+ if (referenced.size === 0) {
24098
+ return [];
24099
+ }
24100
+ const mission = this.userService.currentMission(spaceId);
24101
+ const orgIds = Array.from(new Set([mission?.organisationID, mission?.orderedOrganisationID]
24102
+ .filter((id) => !!id)));
24103
+ const known = new Map();
24104
+ const lists = await Promise.all(orgIds.map(orgId => this.domainService.getAllGenericDomainsAndForOrganisation(orgId).catch(error => {
24105
+ console.warn('[MatterportTagCopyService] Could not read the domains to export:', error);
24106
+ return [];
24107
+ })));
24108
+ lists.flat().forEach(domain => domain?.id && known.set(domain.id, domain));
24109
+ const exported = new Map();
24110
+ const add = async (id) => {
24111
+ if (!id || exported.has(id)) {
24112
+ return;
24113
+ }
24114
+ let domain = known.get(id);
24115
+ if (!domain) {
24116
+ domain = await this.domainService.getDomain(id).catch(() => null);
24117
+ }
24118
+ if (!domain?.name) {
24119
+ return;
24120
+ }
24121
+ exported.set(id, {
24122
+ id: domain.id,
24123
+ name: domain.name,
24124
+ slug: domain.slug ?? null,
24125
+ abbreviation: domain.abbreviation ?? null,
24126
+ description: domain.description ?? null,
24127
+ type: domain.type ?? null,
24128
+ organisationID: domain.organisationID ?? null,
24129
+ parentID: domain.parentID ?? null
24130
+ });
24131
+ await add(domain.parentID);
24132
+ };
24133
+ for (const id of referenced) {
24134
+ await add(id);
24135
+ }
24136
+ return [...exported.values()];
24137
+ }
24138
+ /** Where an export comes from: environment (application origin), location, date, operator. */
24139
+ buildExportOrigin(spaceId, spaceName) {
24140
+ const user = this.userService.cu;
24141
+ const name = user ? `${user.firstName || ''} ${user.lastName || ''}`.trim() : '';
24142
+ return {
24143
+ environment: typeof window !== 'undefined' ? window.location.origin : '',
24144
+ module: this.spModule,
24145
+ spaceId,
24146
+ spaceName: spaceName || '',
24147
+ exportedAt: new Date().toISOString(),
24148
+ exportedBy: { userID: user?.userID ?? user?.id ?? null, name: name || null }
24149
+ };
24150
+ }
24151
+ /** File-name-safe version of a label. */
24152
+ toFileName(label) {
24153
+ return (label || 'space')
24154
+ .normalize('NFD').replace(/[̀-ͯ]/g, '')
24155
+ .replace(/[^a-zA-Z0-9\-_]+/g, '_')
24156
+ .replace(/^_+|_+$/g, '')
24157
+ .substring(0, 60) || 'space';
24158
+ }
24159
+ //
24160
+ // ---------- 3D models of the library ----------
24161
+ //
24162
+ /**
24163
+ * Reference of the model of a 3D object, as the archive indexes its files: the raw S3 key
24164
+ * of an uploaded model, `assets/3Dobjects/objects/<file>` for a library model, null for a
24165
+ * model hosted at an absolute url (nothing to carry over).
24166
+ */
24167
+ object3DModelKeyOf(rawObject3D) {
24168
+ const path = rawObject3D?.path;
24169
+ if (!path) {
24170
+ return null;
24171
+ }
24172
+ if (rawObject3D.s3Bucket) {
24173
+ return this.extractS3KeyFromValue(path) || null;
24174
+ }
24175
+ const libraryFile = getObject3DLibraryFile(path);
24176
+ return libraryFile ? OBJECT3D_LIBRARY_ASSET_FOLDER + libraryFile : null;
24177
+ }
24178
+ /**
24179
+ * 3D models of an archive that an import could not give to their objects: neither in the
24180
+ * archive (missing on the source, or not exportable — a library model of another format
24181
+ * than .glb) nor shipped by this application. The operator can provide a .glb for each
24182
+ * before importing (see importTagsFromArchive(), `replacementModels`); otherwise the
24183
+ * object is created without a displayable model and the log says so.
24184
+ */
24185
+ async getMissingObject3DModels(archive) {
24186
+ const missing = new Map();
24187
+ const servedChecks = new Map();
24188
+ for (const object3D of archive?.manifest?.data?.objects3D || []) {
24189
+ const key = this.object3DModelKeyOf(object3D);
24190
+ if (!key) {
24191
+ continue;
24192
+ }
24193
+ const entry = archive.manifest.files?.[key];
24194
+ if (entry?.path && archive.files[entry.path]) {
24195
+ continue; // carried by the archive
24196
+ }
24197
+ const libraryFile = object3D.s3Bucket ? null : getObject3DLibraryFile(object3D.path);
24198
+ if (libraryFile) {
24199
+ if (!servedChecks.has(libraryFile)) {
24200
+ servedChecks.set(libraryFile, this.isLibraryModelServed(libraryFile));
24201
+ }
24202
+ if (await servedChecks.get(libraryFile)) {
24203
+ continue; // shipped by this application
24204
+ }
24205
+ }
24206
+ const model = missing.get(key) ?? { key, fileName: key.split('/').pop() || key, objectNames: [] };
24207
+ model.objectNames.push(object3D.name || object3D.id);
24208
+ missing.set(key, model);
24209
+ }
24210
+ return [...missing.values()];
24211
+ }
24212
+ /**
24213
+ * Model path of a copied / imported 3D object when this application may not write model
24214
+ * files (see OBJECT3D_MODEL_UPLOAD_ENABLED):
24215
+ * - copy between two locations: the same path, an S3 model included — both objects then
24216
+ * share the file, which nothing deletes with an object;
24217
+ * - import: a library model is referenced as is (reported when this application does not
24218
+ * ship it); an S3 model of the other environment cannot be referenced at all, the object
24219
+ * is skipped (Object3DModelUploadDisabledError).
24220
+ */
24221
+ async modelPathWithoutUpload(rawObject3D) {
24222
+ if (!this.archive) {
24223
+ return rawObject3D.path ?? null;
24224
+ }
24225
+ if (rawObject3D.s3Bucket) {
24226
+ throw new Object3DModelUploadDisabledError(rawObject3D.name || rawObject3D.id);
24227
+ }
24228
+ const file = getObject3DLibraryFile(rawObject3D.path);
24229
+ if (file && !(await this.isLibraryModelAvailable(file))) {
24230
+ this.logItemError('errorObject3dModelMissing', { name: rawObject3D.name || rawObject3D.id, file });
24231
+ }
24232
+ return rawObject3D.path ?? null;
24233
+ }
24234
+ /** Replacement model the operator chose for this object's model, if any. */
24235
+ replacementModelOf(rawObject3D) {
24236
+ const key = this.archive ? this.object3DModelKeyOf(rawObject3D) : null;
24237
+ const file = key ? this.replacementModels.get(key) : undefined;
24238
+ return key && file ? { key, file } : null;
24239
+ }
24240
+ /** Uploads a replacement model once, whatever the number of objects using it. */
24241
+ uploadReplacementModel(model, targetSpaceId) {
24242
+ if (!this.uploadedReplacementKeys.has(model.key)) {
24243
+ const fileName = model.file.name || model.key.split('/').pop() || 'model.glb';
24244
+ const upload = uploadS3Object(buildObject3DModelKey(targetSpaceId, fileName), model.file, GLB_CONTENT_TYPE)
24245
+ .then(key => {
24246
+ this.appendInfoLog(this.translate.instant('matterportCopy.object3dModelReplaced', { file: model.key.split('/').pop(), replacement: fileName }));
24247
+ return key;
24248
+ });
24249
+ // a failed upload is retried by the next object using the model
24250
+ upload.catch(() => this.uploadedReplacementKeys.delete(model.key));
24251
+ this.uploadedReplacementKeys.set(model.key, upload);
24252
+ }
24253
+ return this.uploadedReplacementKeys.get(model.key);
24254
+ }
24255
+ /** File names of the library .glb models the snapshot's 3D objects use (see object3d-model.util.ts). */
24256
+ collectLibraryModelFiles(snapshot) {
24257
+ const files = new Set();
24258
+ for (const object3D of snapshot.objects3D) {
24259
+ const file = object3D?.s3Bucket ? null : getObject3DLibraryFile(object3D?.path);
24260
+ if (file && file.toLowerCase().endsWith('.glb')) {
24261
+ files.add(file);
24262
+ }
24263
+ }
24264
+ return [...files];
24265
+ }
24266
+ /** Url this application serves a library model from. */
24267
+ libraryModelUrl(file) {
24268
+ const base = typeof document !== 'undefined' ? document.baseURI : '/';
24269
+ return new URL(OBJECT3D_LIBRARY_ASSET_FOLDER + file.split('/').map(encodeURIComponent).join('/'), base).toString();
24270
+ }
24271
+ /**
24272
+ * Bytes of a library model as this application serves it; null when it does not ship it.
24273
+ * A single-page host answers an unknown path with the index page (200, text/html): that is
24274
+ * a missing file too.
24275
+ */
24276
+ async fetchLibraryModel(file) {
24277
+ const response = await fetch(this.libraryModelUrl(file));
24278
+ if (!response.ok || (response.headers.get('content-type') || '').includes('text/html')) {
24279
+ return null;
24280
+ }
24281
+ return new Uint8Array(await response.arrayBuffer());
24282
+ }
24283
+ /** Whether this application ships a library model (checked once per file and per run). */
24284
+ async isLibraryModelAvailable(file) {
24285
+ if (!this.libraryModelAvailability.has(file)) {
24286
+ this.libraryModelAvailability.set(file, this.isLibraryModelServed(file));
24287
+ }
24288
+ return this.libraryModelAvailability.get(file);
24289
+ }
24290
+ /** Asks this application whether it serves a library model (an index page is a no). */
24291
+ isLibraryModelServed(file) {
24292
+ return fetch(this.libraryModelUrl(file), { method: 'HEAD' })
24293
+ .then(response => response.ok && !(response.headers.get('content-type') || '').includes('text/html'))
24294
+ .catch(() => false);
24295
+ }
24296
+ /**
24297
+ * Import of a 3D object whose model comes from the application's library: when the target
24298
+ * application does not ship that model, the copy exported in the archive is uploaded to S3
24299
+ * and the object switched to it. Returns the S3 key, or null to keep the library path
24300
+ * (model available, or impossible to restore — reported in the log).
24301
+ */
24302
+ async restoreMissingLibraryModel(rawObject3D, targetSpaceId) {
24303
+ const file = getObject3DLibraryFile(rawObject3D?.path);
24304
+ if (!file || await this.isLibraryModelAvailable(file)) {
24305
+ return null;
24306
+ }
24307
+ const entry = this.archive?.manifest.files?.[OBJECT3D_LIBRARY_ASSET_FOLDER + file];
24308
+ const bytes = entry?.path ? this.archive?.files[entry.path] : undefined;
24309
+ if (!bytes) {
24310
+ this.logItemError('errorObject3dModelMissing', { name: rawObject3D?.name || rawObject3D?.id, file });
24311
+ return null;
24312
+ }
24313
+ const key = buildObject3DModelKey(targetSpaceId, file);
24314
+ const uploaded = await uploadS3Object(key, new Blob([bytes], { type: GLB_CONTENT_TYPE }), GLB_CONTENT_TYPE);
24315
+ this.appendInfoLog(this.translate.instant('matterportCopy.object3dModelUploaded', { name: rawObject3D?.name || rawObject3D?.id, file }));
24316
+ return uploaded;
24317
+ }
22804
24318
  //
22805
24319
  // ---------- Progress / log helpers ----------
22806
24320
  //
@@ -22829,6 +24343,12 @@ class MatterportTagCopyService {
22829
24343
  this.log.push({ id: `healed-${this.logSeq}`, type: 'healed', text });
22830
24344
  this.copyLog$.next([...this.log]);
22831
24345
  }
24346
+ /** Appends a permanent, neutral log line (origin of an import, category created...). */
24347
+ appendInfoLog(text) {
24348
+ this.logSeq++;
24349
+ this.log.push({ id: `info-${this.logSeq}`, type: 'info', text });
24350
+ this.copyLog$.next([...this.log]);
24351
+ }
22832
24352
  /** Resets the log for a new run. */
22833
24353
  resetLog() {
22834
24354
  this.log = [];
@@ -22852,6 +24372,13 @@ class MatterportTagCopyService {
22852
24372
  this.targetVisibleDomainOrgIds = new Set();
22853
24373
  this.targetDomainIdsByTypeAndName = new Map();
22854
24374
  this.targetSpaceId = targetSpaceId;
24375
+ this.archive = null;
24376
+ this.importOwnerMissionId = null;
24377
+ this.importDomainOrganisationId = null;
24378
+ this.keepSweepIds = false;
24379
+ this.libraryModelAvailability = new Map();
24380
+ this.replacementModels = new Map();
24381
+ this.uploadedReplacementKeys = new Map();
22855
24382
  }
22856
24383
  /** Builds and sets a step's log line as "<translated label>: <percent>%", no step numbering. */
22857
24384
  setStepProgress(stepId, translationKey, percent) {
@@ -22976,10 +24503,13 @@ class MatterportTagCopyService {
22976
24503
  * - otherwise: matched by (type, name) against the domains visible to the TARGET
22977
24504
  * operator (loadDomainIndex()); dropped when no equivalent exists there.
22978
24505
  */
22979
- resolveDomainID(sourceDomainId) {
24506
+ async resolveDomainID(sourceDomainId) {
22980
24507
  if (!sourceDomainId) {
22981
24508
  return null;
22982
24509
  }
24510
+ if (this.archive) {
24511
+ return this.resolveImportedDomainID(sourceDomainId);
24512
+ }
22983
24513
  const domain = this.domainsById.get(sourceDomainId);
22984
24514
  if (!domain) {
22985
24515
  // Not visible to either operator's mission (lookup failed, or it belongs to
@@ -22996,35 +24526,46 @@ class MatterportTagCopyService {
22996
24526
  return name.trim().toLowerCase();
22997
24527
  }
22998
24528
  /**
22999
- * READ-ONLY indexing of both spaces' hashtags. Creates nothing.
24529
+ * READ-ONLY: hashtag id -> name of a space's hashtags. Creates nothing.
23000
24530
  *
23001
24531
  * `Feature.hashtags` stores Hashtag *ids*, and a Hashtag is a per-space record, so the
23002
- * ids have to be translated by name. The translation table is built here; the missing
23003
- * keywords are created later, one at a time, only when a POI that actually uses them is
23004
- * about to be written (see resolveHashtagIds()).
24532
+ * ids have to be translated by name. The translation table is built from this and
24533
+ * loadTargetHashtagIndex(); the missing keywords are created later, one at a time, only
24534
+ * when a POI that actually uses them is about to be written (see resolveHashtagIds()).
24535
+ * A failed read answers an empty map: the keywords are then dropped.
23005
24536
  */
23006
- async loadHashtagIndex(sourceSpaceId, targetSpaceId) {
23007
- let sourceHashtags = [];
23008
- let targetHashtags = [];
24537
+ async loadHashtagNames(spaceId) {
24538
+ const names = new Map();
23009
24539
  try {
23010
- [sourceHashtags, targetHashtags] = await Promise.all([
23011
- this.hashtagService.listHashtagsForSpace(sourceSpaceId),
23012
- this.hashtagService.listHashtagsForSpace(targetSpaceId)
23013
- ]);
24540
+ const hashtags = await this.hashtagService.listHashtagsForSpace(spaceId);
24541
+ for (const hashtag of hashtags || []) {
24542
+ if (hashtag?.id && hashtag.name) {
24543
+ names.set(hashtag.id, hashtag.name);
24544
+ }
24545
+ }
23014
24546
  }
23015
24547
  catch (error) {
23016
- console.warn('[MatterportTagCopyService] Could not read the hashtags, keywords will be dropped:', error);
23017
- return;
24548
+ console.warn('[MatterportTagCopyService] Could not read the source hashtags, keywords will be dropped:', error);
23018
24549
  }
23019
- for (const hashtag of sourceHashtags || []) {
23020
- if (hashtag?.id && hashtag.name) {
23021
- this.sourceHashtagNames.set(hashtag.id, hashtag.name);
24550
+ return names;
24551
+ }
24552
+ /**
24553
+ * READ-ONLY indexing of the target space's hashtags, by name. When they cannot be read,
24554
+ * the source keywords are dropped too: creating them blindly could duplicate keywords the
24555
+ * target already has.
24556
+ */
24557
+ async loadTargetHashtagIndex(targetSpaceId) {
24558
+ try {
24559
+ const targetHashtags = await this.hashtagService.listHashtagsForSpace(targetSpaceId);
24560
+ for (const hashtag of targetHashtags || []) {
24561
+ if (hashtag?.id && hashtag.name) {
24562
+ this.targetHashtagIdsByName.set(this.hashtagKey(hashtag.name), hashtag.id);
24563
+ }
23022
24564
  }
23023
24565
  }
23024
- for (const hashtag of targetHashtags || []) {
23025
- if (hashtag?.id && hashtag.name) {
23026
- this.targetHashtagIdsByName.set(this.hashtagKey(hashtag.name), hashtag.id);
23027
- }
24566
+ catch (error) {
24567
+ console.warn('[MatterportTagCopyService] Could not read the hashtags, keywords will be dropped:', error);
24568
+ this.sourceHashtagNames = new Map();
23028
24569
  }
23029
24570
  }
23030
24571
  /**
@@ -23080,36 +24621,42 @@ class MatterportTagCopyService {
23080
24621
  return resolved.length > 0 ? resolved : null;
23081
24622
  }
23082
24623
  /**
23083
- * READ-ONLY indexing of both spaces' missions.
24624
+ * READ-ONLY: mission id -> user id of a space's missions.
23084
24625
  *
23085
24626
  * A Mission is scoped to one space (it pairs a userID with a spaceID), so the id a
23086
24627
  * source comment's `ownerID` points at never designates anyone in the target space.
23087
- * This builds the two lookup tables resolveCommentOwnerID() needs to translate it:
23088
- * which user a source Mission id belongs to, and which Mission (if any) that same
23089
- * user already holds in the target space.
24628
+ * This and loadTargetMissionIndex() build the two lookup tables resolveCommentOwnerID()
24629
+ * needs to translate it: which user a source Mission id belongs to, and which Mission (if
24630
+ * any) that same user already holds in the target space.
24631
+ * A failed read answers an empty map: comment authorship is then dropped.
23090
24632
  */
23091
- async loadMissionIndex(sourceSpaceId, targetSpaceId) {
23092
- let sourceMissions = [];
23093
- let targetMissions = [];
24633
+ async loadMissionUserIds(spaceId) {
24634
+ const userIds = new Map();
23094
24635
  try {
23095
- [sourceMissions, targetMissions] = await Promise.all([
23096
- this.missionService.getAllMissionsForSpace(sourceSpaceId),
23097
- this.missionService.getAllMissionsForSpace(targetSpaceId)
23098
- ]);
24636
+ const missions = await this.missionService.getAllMissionsForSpace(spaceId);
24637
+ for (const mission of missions || []) {
24638
+ if (mission?.id && mission.userID) {
24639
+ userIds.set(mission.id, mission.userID);
24640
+ }
24641
+ }
23099
24642
  }
23100
24643
  catch (error) {
23101
- console.warn('[MatterportTagCopyService] Could not read the missions, comment authorship will be dropped:', error);
23102
- return;
24644
+ console.warn('[MatterportTagCopyService] Could not read the source missions, comment authorship will be dropped:', error);
23103
24645
  }
23104
- for (const mission of sourceMissions || []) {
23105
- if (mission?.id && mission.userID) {
23106
- this.sourceMissionUserIds.set(mission.id, mission.userID);
24646
+ return userIds;
24647
+ }
24648
+ /** READ-ONLY indexing of the target space's missions, by user. */
24649
+ async loadTargetMissionIndex(targetSpaceId) {
24650
+ try {
24651
+ const targetMissions = await this.missionService.getAllMissionsForSpace(targetSpaceId);
24652
+ for (const mission of targetMissions || []) {
24653
+ if (mission?.id && mission.userID && !this.targetMissionIdsByUserId.has(mission.userID)) {
24654
+ this.targetMissionIdsByUserId.set(mission.userID, mission.id);
24655
+ }
23107
24656
  }
23108
24657
  }
23109
- for (const mission of targetMissions || []) {
23110
- if (mission?.id && mission.userID && !this.targetMissionIdsByUserId.has(mission.userID)) {
23111
- this.targetMissionIdsByUserId.set(mission.userID, mission.id);
23112
- }
24658
+ catch (error) {
24659
+ console.warn('[MatterportTagCopyService] Could not read the missions, comment authorship will be dropped:', error);
23113
24660
  }
23114
24661
  }
23115
24662
  /**
@@ -23125,6 +24672,10 @@ class MatterportTagCopyService {
23125
24672
  * is honest, a misattributed one is not.
23126
24673
  */
23127
24674
  resolveCommentOwnerID(sourceOwnerID) {
24675
+ if (this.archive) {
24676
+ // Import: the author's mission belongs to another environment — see importOwnerMissionId.
24677
+ return this.importOwnerMissionId;
24678
+ }
23128
24679
  if (!sourceOwnerID) {
23129
24680
  return null;
23130
24681
  }
@@ -23317,7 +24868,7 @@ class MatterportTagCopyService {
23317
24868
  level: raw.level ?? null,
23318
24869
  role: raw.role ?? null,
23319
24870
  category: raw.category ?? null,
23320
- domainID: this.resolveDomainID(raw.domainID),
24871
+ domainID: await this.resolveDomainID(raw.domainID),
23321
24872
  // --- Matterport anchoring ---
23322
24873
  metadata: this.getAdjustedPoiMetadata(sourcePoi.metadata, transform)
23323
24874
  };
@@ -23408,7 +24959,7 @@ class MatterportTagCopyService {
23408
24959
  * Returns both the patch to send and the list of healed field names, so the caller can
23409
24960
  * both perform the update and describe it in the copy log.
23410
24961
  */
23411
- buildHealPatch(sourceObj, existingTarget, fields, includeDomain) {
24962
+ async buildHealPatch(sourceObj, existingTarget, fields, includeDomain) {
23412
24963
  const patch = {};
23413
24964
  const healedFields = [];
23414
24965
  const fillIfMissing = (key, sourceValue) => {
@@ -23424,7 +24975,7 @@ class MatterportTagCopyService {
23424
24975
  fillIfMissing(field, sourceObj[field]);
23425
24976
  }
23426
24977
  if (includeDomain && (existingTarget.domainID === null || existingTarget.domainID === undefined)) {
23427
- const resolvedDomainId = this.resolveDomainID(sourceObj.domainID);
24978
+ const resolvedDomainId = await this.resolveDomainID(sourceObj.domainID);
23428
24979
  if (resolvedDomainId) {
23429
24980
  patch.domainID = resolvedDomainId;
23430
24981
  healedFields.push('domainID');
@@ -23444,7 +24995,7 @@ class MatterportTagCopyService {
23444
24995
  * Returns the list of fields that were actually healed (empty if nothing was missing).
23445
24996
  */
23446
24997
  async healEquipmentIdentity(sourceObj, existingTarget) {
23447
- const { patch, healedFields } = this.buildHealPatch(sourceObj, existingTarget, ['status', 'annotation', 'family', 'sku', 'manufacturer', 'installDate', 'warrantyEndDate', 'metadata', 'isCreatedByAI'], true);
24998
+ const { patch, healedFields } = await this.buildHealPatch(sourceObj, existingTarget, ['status', 'annotation', 'family', 'sku', 'manufacturer', 'installDate', 'warrantyEndDate', 'metadata', 'isCreatedByAI'], true);
23448
24999
  if (!existingTarget.photo && sourceObj.photo) {
23449
25000
  patch.photo = await this.copyS3KeyIfPresent(sourceObj.photo, `equipment photo "${sourceObj.name}"`);
23450
25001
  healedFields.push('photo');
@@ -23462,7 +25013,7 @@ class MatterportTagCopyService {
23462
25013
  * are never part of the heal — by construction, they already agree with the source.
23463
25014
  */
23464
25015
  async healTicketIdentity(sourceObj, existingTarget) {
23465
- const { patch, healedFields } = this.buildHealPatch(sourceObj, existingTarget, ['friendlyLabel', 'status', 'type', 'priority', 'level', 'metadata', 'read', 'projectID', 'problemCode'], true);
25016
+ const { patch, healedFields } = await this.buildHealPatch(sourceObj, existingTarget, ['friendlyLabel', 'status', 'type', 'priority', 'level', 'metadata', 'read', 'projectID', 'problemCode'], true);
23466
25017
  if (healedFields.length === 0) {
23467
25018
  return healedFields;
23468
25019
  }
@@ -23473,7 +25024,7 @@ class MatterportTagCopyService {
23473
25024
  /** Same idea, for a pre-existing feature. Keywords, media and POIs are not healed here
23474
25025
  * for the same reason notes/POIs are not healed on equipment — see healEquipmentIdentity(). */
23475
25026
  async healFeatureIdentity(sourceObj, existingTarget) {
23476
- const { patch, healedFields } = this.buildHealPatch(sourceObj, existingTarget, ['shortDescription', 'level', 'type', 'index', 'stripeProductID', 'stripePriceID', 'bookingPriceMetadata', 'locale'], true);
25027
+ const { patch, healedFields } = await this.buildHealPatch(sourceObj, existingTarget, ['shortDescription', 'level', 'type', 'index', 'stripeProductID', 'stripePriceID', 'bookingPriceMetadata', 'locale'], true);
23477
25028
  if (healedFields.length === 0) {
23478
25029
  return healedFields;
23479
25030
  }
@@ -23531,6 +25082,19 @@ class MatterportTagCopyService {
23531
25082
  yRotation: applyRigidTransformToYRotationDeg(parsed.yRotation, transform)
23532
25083
  };
23533
25084
  }
25085
+ /**
25086
+ * Moves a 3D object of the scene with the rigid transform: its position like a tag's, its
25087
+ * orientation turned by the same angle around the vertical axis (applyRigidTransformToEulerXYZ).
25088
+ * Its scale does not change: both models are in meters.
25089
+ */
25090
+ getAdjustedObject3DPlacement(position, rotation, transform) {
25091
+ const moved = applyRigidTransformToPoint({ x: position[0], y: position[1], z: position[2] }, transform);
25092
+ const turned = applyRigidTransformToEulerXYZ({ x: rotation[0], y: rotation[1], z: rotation[2] }, transform);
25093
+ return {
25094
+ position: [moved.x, moved.y, moved.z],
25095
+ rotation: [turned.x, turned.y, turned.z]
25096
+ };
25097
+ }
23534
25098
  /**
23535
25099
  * Reads a stored coordinate (JSON string or object, whatever its spacing) as a position.
23536
25100
  * Null for a virtual POI or an unreadable value.
@@ -23572,6 +25136,11 @@ class MatterportTagCopyService {
23572
25136
  findClosestTargetSweepId(sourceSweepID, sourceNavPositions, targetNavPositions, transform) {
23573
25137
  if (!sourceSweepID)
23574
25138
  return null;
25139
+ // Same Matterport model on both sides: the sweep ids are the model's own, so the very
25140
+ // same sweep exists in the target visit.
25141
+ if (this.keepSweepIds && targetNavPositions.has(sourceSweepID)) {
25142
+ return sourceSweepID;
25143
+ }
23575
25144
  const sourcePos = sourceNavPositions.get(sourceSweepID);
23576
25145
  if (!sourcePos)
23577
25146
  return null;
@@ -23625,12 +25194,15 @@ class MatterportTagCopyService {
23625
25194
  * skip the whole item entirely, rather than creating a record with a broken file link.
23626
25195
  * - Any other kind of failure (permissions, network, etc.) still throws a generic Error.
23627
25196
  */
23628
- async copyS3KeyIfPresent(key, contextLabel, folderOverride = null) {
25197
+ async copyS3KeyIfPresent(key, contextLabel, folderOverride = null, buildDestKey = null) {
23629
25198
  if (!key) {
23630
25199
  return null;
23631
25200
  }
23632
25201
  const sourceKey = this.extractS3KeyFromValue(key);
23633
- const destKey = this.buildCopiedAttachmentKey(sourceKey, folderOverride);
25202
+ const destKey = buildDestKey ? buildDestKey(sourceKey) : this.buildCopiedAttachmentKey(sourceKey, folderOverride);
25203
+ if (this.archive) {
25204
+ return this.restoreArchivedFile(sourceKey, destKey, contextLabel);
25205
+ }
23634
25206
  // Log the source key to ensure it matches the real S3 object path
23635
25207
  console.log(`[DEBUG] Attempting S3 copy from source: "${sourceKey}" to dest: "${destKey}"`);
23636
25208
  try {
@@ -24168,13 +25740,16 @@ class MatterportTagCopyService {
24168
25740
  this.setStepLog('done', this.translate.instant('matterportCopy.recalibrateSummary', result));
24169
25741
  return result;
24170
25742
  }
24171
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, deps: [{ token: NavigationService }, { token: BaseUserService }, { token: PoiService }, { token: TicketsService }, { token: EquipmentService }, { token: Object3DService }, { token: FeatureService }, { token: MeasurementService }, { token: CommentService }, { token: HashtagService }, { token: MissionService }, { token: OperationService }, { token: DomainService }, { token: i1$1.TranslateService }, { token: ZoneService }], target: i0.ɵɵFactoryTarget.Injectable });
25743
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, deps: [{ token: NavigationService }, { token: BaseUserService }, { token: PoiService }, { token: TicketsService }, { token: EquipmentService }, { token: Object3DService }, { token: FeatureService }, { token: MeasurementService }, { token: CommentService }, { token: HashtagService }, { token: MissionService }, { token: OperationService }, { token: DomainService }, { token: i1$1.TranslateService }, { token: ZoneService }, { token: OBJECT3D_MODEL_UPLOAD_ENABLED }], target: i0.ɵɵFactoryTarget.Injectable });
24172
25744
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, providedIn: 'root' });
24173
25745
  }
24174
25746
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: MatterportTagCopyService, decorators: [{
24175
25747
  type: Injectable,
24176
25748
  args: [{ providedIn: 'root' }]
24177
- }], ctorParameters: () => [{ type: NavigationService }, { type: BaseUserService }, { type: PoiService }, { type: TicketsService }, { type: EquipmentService }, { type: Object3DService }, { type: FeatureService }, { type: MeasurementService }, { type: CommentService }, { type: HashtagService }, { type: MissionService }, { type: OperationService }, { type: DomainService }, { type: i1$1.TranslateService }, { type: ZoneService }] });
25749
+ }], ctorParameters: () => [{ type: NavigationService }, { type: BaseUserService }, { type: PoiService }, { type: TicketsService }, { type: EquipmentService }, { type: Object3DService }, { type: FeatureService }, { type: MeasurementService }, { type: CommentService }, { type: HashtagService }, { type: MissionService }, { type: OperationService }, { type: DomainService }, { type: i1$1.TranslateService }, { type: ZoneService }, { type: undefined, decorators: [{
25750
+ type: Inject,
25751
+ args: [OBJECT3D_MODEL_UPLOAD_ENABLED]
25752
+ }] }] });
24178
25753
 
24179
25754
  /* eslint-disable class-methods-use-this */
24180
25755
  class OrganisationService {
@@ -24308,5 +25883,5 @@ function floatValidator() {
24308
25883
  * Generated bundle index. Do not edit.
24309
25884
  */
24310
25885
 
24311
- 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_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 };
25886
+ 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, GLB_CONTENT_TYPE, 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, OBJECT3D_LIBRARY_ASSET_FOLDER, OBJECT3D_LIBRARY_FOLDER, OBJECT3D_MODEL_EXTENSIONS, OBJECT3D_MODEL_UPLOAD_ENABLED, OBJECT3D_S3_FOLDER, OBJECT3D_UPLOAD_MAX_BYTES, 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, TAG_ARCHIVE_FILES_FOLDER, TAG_ARCHIVE_FORMAT, TAG_ARCHIVE_MANIFEST, TAG_ARCHIVE_VERSION, THREEJS_MODEL_UP_OPTIONS, TagAction, TagArchiveError, TemplateService, ThreeJsImportService, ThreeJsService, TicketPriority, TicketStatus, TicketType, TicketsService, TimeDateToLocalStringPipe, TypeNote, UsernameFromIdPipe, VIEWER_BACKGROUND, ValidatorsService, ViewerInteractions, ViewerService, VisitService, ZoneChangeService, ZoneService, applyRigidTransformToDirection, applyRigidTransformToEulerXYZ, applyRigidTransformToPoint, applyRigidTransformToYRotationDeg, arraysContainSameElements, buildObject3DModelKey, buildTagArchive, checkElementById, computeRigidTransform, convertObjToGlb, convertTimestampToLocalZone, copyFileInS3, copyFileInS3ViaDownload, dateHasExpired, dateTimeToLocalString, deleteFromS3, distance, downloadBlob, downloadEquipmentDocument, downloadFile, downloadFileAsObject, downloadS3Object, durationToString, emailValidator, enumToArray, filterUniqueArrayByID, floatValidator, getBufferForFileFromS3, getCoefficientsForImage, getCurrentLang, getDistanceBetweenTwoPoints, getHighestLevelForMissions, getHighestRoleForMissions, getLevelsBelow, getLocaleLong, getLocaleShort, getMetaForImage, getObject3DLibraryFile, 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, readTagArchive, removeAllFilesFromFolderS3, removeNullKeysFromObject, resolveObject3DModelSource, showScanPointsOnPlanInDiv, shuffleArray, solveThreeJsAlignment, sortAlphabeticallyOnName, stringLocaleToEnum, stringToLowercaseNoSpaces, styleButton, svgToDataUrl, tagArchiveFilePath, textValidator, translateDatePeriod, uploadBase64Image, uploadBase64ImageWithRetry, uploadFileToS3, uploadFileToS3WithProgress, uploadJsonToS3, uploadS3Object, validEmail, validateGlbFile, wait, waitUntil };
24312
25887
  //# sourceMappingURL=smarterplan-ngx-smarterplan-core.mjs.map