@polycyphers/bim 0.1.2 → 0.1.6

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.
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { createContext as e, useCallback as t, useContext as n, useEffect as r, useRef as i, useState as a } from "react";
2
- import o from "dompurify";
3
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
- import { disableTelemetry as u, disableTelemetry as d, enableTelemetry as f, setBrand as p, verifySystemMessage as m } from "@polycyphers/license";
1
+ import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useRef as a, useState as o } from "react";
2
+ import s from "dompurify";
3
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ import { disableTelemetry as ee, disableTelemetry as te, enableTelemetry as d, setBrand as ne, verifySystemMessage as f } from "@polycyphers/license";
5
5
  // src/i18n.ts
6
- var h = {
6
+ var p = {
7
7
  studio: "Open studio",
8
8
  pricing: "Pricing",
9
9
  start: "Start with your sketch",
@@ -67,10 +67,10 @@ var h = {
67
67
  account: "Account",
68
68
  cancel: "Cancel",
69
69
  close: "Close"
70
- }, g = {
71
- en: h,
70
+ }, m = {
71
+ en: p,
72
72
  de: {
73
- ...h,
73
+ ...p,
74
74
  studio: "Studio öffnen",
75
75
  pricing: "Preise",
76
76
  start: "Mit Ihrer Skizze starten",
@@ -111,7 +111,7 @@ var h = {
111
111
  close: "Schließen"
112
112
  },
113
113
  fr: {
114
- ...h,
114
+ ...p,
115
115
  studio: "Ouvrir le studio",
116
116
  pricing: "Tarifs",
117
117
  start: "Commencez par votre croquis",
@@ -152,7 +152,7 @@ var h = {
152
152
  close: "Fermer"
153
153
  },
154
154
  ar: {
155
- ...h,
155
+ ...p,
156
156
  studio: "فتح الاستوديو",
157
157
  pricing: "الأسعار",
158
158
  start: "ابدأ برسمك",
@@ -193,7 +193,7 @@ var h = {
193
193
  close: "إغلاق"
194
194
  }
195
195
  };
196
- Object.assign(g.de, {
196
+ Object.assign(m.de, {
197
197
  workspace: "Wohnungskonzept",
198
198
  example: "Referenzprojekt · vor Ort bestätigte Geometrie",
199
199
  back: "Alle Projekte",
@@ -219,7 +219,7 @@ Object.assign(g.de, {
219
219
  width: "Breite",
220
220
  depth: "Tiefe",
221
221
  account: "Konto"
222
- }), Object.assign(g.fr, {
222
+ }), Object.assign(m.fr, {
223
223
  workspace: "Concept d’appartement",
224
224
  example: "Projet de référence · géométrie confirmée sur site",
225
225
  back: "Tous les projets",
@@ -245,7 +245,7 @@ Object.assign(g.de, {
245
245
  width: "Largeur",
246
246
  depth: "Profondeur",
247
247
  account: "Compte"
248
- }), Object.assign(g.ar, {
248
+ }), Object.assign(m.ar, {
249
249
  workspace: "تصوّر شقة",
250
250
  example: "مشروع مرجعي · هندسة مؤكدة ميدانياً",
251
251
  back: "كل المشاريع",
@@ -273,7 +273,7 @@ Object.assign(g.de, {
273
273
  account: "الحساب"
274
274
  });
275
275
  // src/workflowText.ts
276
- var _ = {
276
+ var h = {
277
277
  de: {
278
278
  "New project": "Neues Projekt",
279
279
  "Enter measurements": "Maße eingeben",
@@ -410,7 +410,7 @@ var _ = {
410
410
  "Discrepancy report": "تقرير الفروقات"
411
411
  }
412
412
  };
413
- Object.assign(_.de, {
413
+ Object.assign(h.de, {
414
414
  "Plan your next space": "Ihren nächsten Raum planen",
415
415
  "Apartment layout": "Wohnungsgrundriss",
416
416
  "House extension": "Hausanbau",
@@ -473,7 +473,7 @@ Object.assign(_.de, {
473
473
  "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.": "Der Dienst prüft und normalisiert das Bild vor der Speicherung. Die Dateiauswahl allein sendet es nicht an einen KI-Anbieter. Erst die angeforderte Skizzenanalyse übermittelt das bereinigte Bild an Anthropic Claude. EU-Speicherung bestimmt nicht den Ort der KI-Verarbeitung; Anbieterregion und Datenschutzbedingungen müssen konfiguriert werden.",
474
474
  "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.": "Die Analyse sendet dieses bereinigte Bild an Anthropic Claude. EU-Speicherung und KI-Verarbeitungsort sind getrennt; der Dienst muss die Datenschutzbedingungen konfigurieren.",
475
475
  "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.": "Damit wird die Löschung Ihrer Projekte, Skizzen und erzeugten Dateien in diesem Dienst angefordert. Kontoidentität, Abrechnungsdaten und notwendige Missbrauchsschutzdaten bleiben erhalten. Offene Abrechnung kann den Abschluss verzögern; das Ergebnis des Dienstes wird angezeigt."
476
- }), Object.assign(_.fr, {
476
+ }), Object.assign(h.fr, {
477
477
  "Plan your next space": "Préparez votre prochain espace",
478
478
  "Apartment layout": "Plan d’appartement",
479
479
  "House extension": "Extension de maison",
@@ -536,7 +536,7 @@ Object.assign(_.de, {
536
536
  "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.": "Le service contrôle et normalise l’image avant stockage. La sélection d’un fichier ne l’envoie pas à un fournisseur d’IA. Seule la lecture explicitement demandée transmet l’image assainie à Anthropic Claude. Le stockage dans l’UE ne détermine pas le lieu d’inférence ; la région du fournisseur et les conditions de traitement doivent être configurées.",
537
537
  "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.": "La lecture transmet cette image assainie à Anthropic Claude. Le stockage dans l’UE et le lieu d’inférence sont distincts ; le service doit configurer les conditions de traitement.",
538
538
  "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.": "Cette demande concerne les projets, croquis et fichiers générés dans ce service. L’identité du compte, la facturation et les données anti-abus nécessaires sont conservées. Une comptabilisation en attente peut retarder la suppression ; le résultat du service sera affiché."
539
- }), Object.assign(_.ar, {
539
+ }), Object.assign(h.ar, {
540
540
  "Plan your next space": "خطّط لمساحتك القادمة",
541
541
  "Apartment layout": "تخطيط شقة",
542
542
  "House extension": "توسعة منزل",
@@ -599,37 +599,37 @@ Object.assign(_.de, {
599
599
  "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.": "يفحص النظام الصورة ويوحّد تنسيقها قبل التخزين. اختيار الملف وحده لا يرسله إلى مزوّد ذكاء اصطناعي. تُرسل الصورة المنقّحة إلى Anthropic Claude فقط عند طلب قراءة الرسم المحفوظ. التخزين الأوروبي مستقل عن موقع المعالجة؛ يجب ضبط منطقة المزوّد وشروط معالجة البيانات.",
600
600
  "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.": "ترسل القراءة هذه الصورة المنقّحة إلى Anthropic Claude. التخزين الأوروبي وموقع المعالجة مستقلان؛ يجب أن يضبط النظام شروط معالجة البيانات.",
601
601
  "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.": "يطلب هذا حذف المشاريع والرسوم والملفات الناتجة في هذه الخدمة. تبقى هوية الحساب والفواتير وسجلات مكافحة الإساءة الضرورية محفوظة. قد تؤخر المحاسبة المعلّقة الإتمام؛ نعرض نتيجة الخدمة."
602
- }), Object.assign(_.de, {
602
+ }), Object.assign(h.de, {
603
603
  "Verifying component license…": "Komponentenlizenz wird geprüft…",
604
604
  "A valid component license is required": "Eine gültige Komponentenlizenz ist erforderlich",
605
605
  "The studio stays closed until its installation license and signed revocation status are verified.": "Das Studio bleibt geschlossen, bis Installationslizenz und signierter Sperrstatus geprüft sind.",
606
606
  "Check license again": "Lizenz erneut prüfen",
607
607
  "License management": "Lizenzverwaltung"
608
- }), Object.assign(_.fr, {
608
+ }), Object.assign(h.fr, {
609
609
  "Verifying component license…": "Vérification de la licence du composant…",
610
610
  "A valid component license is required": "Une licence valide du composant est requise",
611
611
  "The studio stays closed until its installation license and signed revocation status are verified.": "Le studio reste fermé tant que la licence d’installation et son état de révocation signé ne sont pas vérifiés.",
612
612
  "Check license again": "Vérifier à nouveau la licence",
613
613
  "License management": "Gestion des licences"
614
- }), Object.assign(_.ar, {
614
+ }), Object.assign(h.ar, {
615
615
  "Verifying component license…": "جارٍ التحقق من ترخيص المكوّن…",
616
616
  "A valid component license is required": "يلزم ترخيص صالح للمكوّن",
617
617
  "The studio stays closed until its installation license and signed revocation status are verified.": "يبقى الاستوديو مغلقاً حتى التحقق من ترخيص التثبيت وحالة الإلغاء الموقّعة.",
618
618
  "Check license again": "إعادة فحص الترخيص",
619
619
  "License management": "إدارة التراخيص"
620
- }), Object.assign(_.de, {
620
+ }), Object.assign(h.de, {
621
621
  "No layout proposal is available": "Kein Grundrissvorschlag verfügbar",
622
622
  "Your measurements are retained. Review the engine findings and measurements before trying again.": "Ihre Maße bleiben erhalten. Prüfen Sie die Hinweise der Engine und die Maße vor einem neuen Versuch.",
623
623
  "Review measurements": "Maße überprüfen"
624
- }), Object.assign(_.fr, {
624
+ }), Object.assign(h.fr, {
625
625
  "No layout proposal is available": "Aucune proposition de plan disponible",
626
626
  "Your measurements are retained. Review the engine findings and measurements before trying again.": "Vos mesures sont conservées. Vérifiez les observations du moteur et les mesures avant de réessayer.",
627
627
  "Review measurements": "Vérifier les mesures"
628
- }), Object.assign(_.ar, {
628
+ }), Object.assign(h.ar, {
629
629
  "No layout proposal is available": "لا يتوفر مقترح مخطط",
630
630
  "Your measurements are retained. Review the engine findings and measurements before trying again.": "تبقى أبعادك محفوظة. راجع ملاحظات المحرك والأبعاد قبل المحاولة مجدداً.",
631
631
  "Review measurements": "مراجعة الأبعاد"
632
- }), Object.assign(_.de, {
632
+ }), Object.assign(h.de, {
633
633
  "Saved as a new version. Earlier versions are unchanged.": "Als neue Version gespeichert. Frühere Versionen bleiben unverändert.",
634
634
  "Hide version history": "Versionsverlauf ausblenden",
635
635
  "Version history & compare": "Versionsverlauf und Vergleich",
@@ -644,7 +644,7 @@ Object.assign(_.de, {
644
644
  "Selected layout": "Gewählter Grundriss",
645
645
  "Changed inputs": "Geänderte Eingaben",
646
646
  "No input changes reported.": "Keine geänderten Eingaben gemeldet."
647
- }), Object.assign(_.fr, {
647
+ }), Object.assign(h.fr, {
648
648
  "Saved as a new version. Earlier versions are unchanged.": "Enregistré comme nouvelle version. Les versions précédentes restent inchangées.",
649
649
  "Hide version history": "Masquer l’historique",
650
650
  "Version history & compare": "Historique et comparaison",
@@ -659,7 +659,7 @@ Object.assign(_.de, {
659
659
  "Selected layout": "Plan sélectionné",
660
660
  "Changed inputs": "Entrées modifiées",
661
661
  "No input changes reported.": "Aucune modification des entrées signalée."
662
- }), Object.assign(_.ar, {
662
+ }), Object.assign(h.ar, {
663
663
  "Saved as a new version. Earlier versions are unchanged.": "حُفظ كنسخة جديدة. تبقى النسخ السابقة دون تغيير.",
664
664
  "Hide version history": "إخفاء سجل النسخ",
665
665
  "Version history & compare": "سجل النسخ والمقارنة",
@@ -674,186 +674,992 @@ Object.assign(_.de, {
674
674
  "Selected layout": "المخطط المختار",
675
675
  "Changed inputs": "المدخلات المتغيّرة",
676
676
  "No input changes reported.": "لم تُسجّل تغييرات في المدخلات."
677
+ }), Object.assign(h.de, {
678
+ "Pending inputs are saved privately. They are not an accepted result.": "Ausstehende Eingaben sind privat gespeichert. Sie sind noch kein bestätigtes Ergebnis.",
679
+ "This paid project reached its configured limit. Another purchase will not extend its allowance.": "Dieses bezahlte Projekt hat seine festgelegte Grenze erreicht. Ein weiterer Kauf erweitert das Kontingent nicht."
680
+ }), Object.assign(h.fr, {
681
+ "Pending inputs are saved privately. They are not an accepted result.": "Les données en attente sont enregistrées en privé. Elles ne constituent pas encore un résultat accepté.",
682
+ "This paid project reached its configured limit. Another purchase will not extend its allowance.": "Ce projet payé a atteint sa limite configurée. Un nouvel achat n’augmentera pas son quota."
683
+ }), Object.assign(h.ar, {
684
+ "Pending inputs are saved privately. They are not an accepted result.": "حُفظت المدخلات المعلقة بشكل خاص. وهي ليست نتيجة معتمدة بعد.",
685
+ "This paid project reached its configured limit. Another purchase will not extend its allowance.": "وصل هذا المشروع المدفوع إلى الحد المحدد. لن تزيد عملية شراء أخرى حصته."
677
686
  });
678
- function v(e, t) {
679
- return e === "en" ? t : _[e][t] ?? t;
687
+ function g(e, t) {
688
+ return e === "en" ? t : h[e][t] ?? t;
680
689
  }
681
690
  // src/VersionHistory.tsx
682
- function ee({ language: e, version: t, busy: n, preview: r, open: i, versions: a, comparison: o, left: s, right: u, onToggle: d, onLeftChange: f, onRightChange: p, onCompare: m, onRestore: h }) {
683
- let g = a?.some((e) => e.version === s), _ = a?.some((e) => e.version === u);
684
- return /* @__PURE__ */ l("section", {
691
+ function re({ language: e, version: t, busy: n, preview: r, open: i, versions: a, comparison: o, left: s, right: c, onToggle: ee, onLeftChange: te, onRightChange: d, onCompare: ne, onRestore: f }) {
692
+ let p = a?.some((e) => e.version === s), m = a?.some((e) => e.version === c);
693
+ return /* @__PURE__ */ u("section", {
685
694
  className: "paper version-history",
686
- children: [/* @__PURE__ */ c("button", {
695
+ children: [/* @__PURE__ */ l("button", {
687
696
  className: "outline",
688
697
  disabled: n,
689
698
  "aria-expanded": i,
690
699
  "aria-controls": "bim-version-history",
691
- onClick: d,
692
- children: v(e, i ? "Hide version history" : "Version history & compare")
693
- }), i && a && /* @__PURE__ */ l("div", {
700
+ onClick: ee,
701
+ children: g(e, i ? "Hide version history" : "Version history & compare")
702
+ }), i && a && /* @__PURE__ */ u("div", {
694
703
  id: "bim-version-history",
695
704
  children: [
696
- /* @__PURE__ */ c("h3", { children: v(e, "Saved versions") }),
697
- /* @__PURE__ */ c("p", { children: v(e, "History and comparison are read-only. Restoring creates a new version after the service checks the current version.") }),
698
- /* @__PURE__ */ c("ul", { children: a.map((t) => /* @__PURE__ */ l("li", { children: [
699
- /* @__PURE__ */ l("strong", { children: ["v", t.version] }),
705
+ /* @__PURE__ */ l("h3", { children: g(e, "Saved versions") }),
706
+ /* @__PURE__ */ l("p", { children: g(e, "History and comparison are read-only. Restoring creates a new version after the service checks the current version.") }),
707
+ /* @__PURE__ */ l("ul", { children: a.map((t) => /* @__PURE__ */ u("li", { children: [
708
+ /* @__PURE__ */ u("strong", { children: ["v", t.version] }),
700
709
  " · ",
701
710
  new Date(t.createdAtUtc).toLocaleString(e),
702
711
  t.selectedProposalId ? " · " + t.selectedProposalId : "",
703
712
  t.note ? " · " + t.note : ""
704
713
  ] }, t.version)) }),
705
- /* @__PURE__ */ l("div", {
714
+ /* @__PURE__ */ u("div", {
706
715
  className: "actions",
707
716
  children: [
708
- /* @__PURE__ */ l("label", {
717
+ /* @__PURE__ */ u("label", {
709
718
  className: "field",
710
- children: [v(e, "Earlier version"), /* @__PURE__ */ c("select", {
719
+ children: [g(e, "Earlier version"), /* @__PURE__ */ l("select", {
711
720
  disabled: n,
712
721
  value: s,
713
- onChange: (e) => f(Number(e.target.value)),
714
- children: a.map((e) => /* @__PURE__ */ l("option", {
722
+ onChange: (e) => te(Number(e.target.value)),
723
+ children: a.map((e) => /* @__PURE__ */ u("option", {
715
724
  value: e.version,
716
725
  children: ["v", e.version]
717
726
  }, e.version))
718
727
  })]
719
728
  }),
720
- /* @__PURE__ */ l("label", {
729
+ /* @__PURE__ */ u("label", {
721
730
  className: "field",
722
- children: [v(e, "Later version"), /* @__PURE__ */ c("select", {
731
+ children: [g(e, "Later version"), /* @__PURE__ */ l("select", {
723
732
  disabled: n,
724
- value: u,
725
- onChange: (e) => p(Number(e.target.value)),
726
- children: a.map((e) => /* @__PURE__ */ l("option", {
733
+ value: c,
734
+ onChange: (e) => d(Number(e.target.value)),
735
+ children: a.map((e) => /* @__PURE__ */ u("option", {
727
736
  value: e.version,
728
737
  children: ["v", e.version]
729
738
  }, e.version))
730
739
  })]
731
740
  }),
732
- /* @__PURE__ */ c("button", {
741
+ /* @__PURE__ */ l("button", {
733
742
  className: "outline",
734
- disabled: n || s === u || !g || !_,
735
- onClick: m,
736
- children: v(e, "Compare saved versions")
743
+ disabled: n || s === c || !p || !m,
744
+ onClick: ne,
745
+ children: g(e, "Compare saved versions")
737
746
  }),
738
- /* @__PURE__ */ c("button", {
747
+ /* @__PURE__ */ l("button", {
739
748
  className: "outline",
740
- disabled: n || r || s === t || !g,
741
- onClick: h,
742
- children: v(e, "Restore earlier version")
749
+ disabled: n || r || s === t || !p,
750
+ onClick: f,
751
+ children: g(e, "Restore earlier version")
743
752
  })
744
753
  ]
745
754
  }),
746
- o && /* @__PURE__ */ l("article", {
755
+ o && /* @__PURE__ */ u("article", {
747
756
  className: "comparison-summary",
748
757
  role: "status",
749
758
  children: [
750
- /* @__PURE__ */ l("h4", { children: [
759
+ /* @__PURE__ */ u("h4", { children: [
751
760
  "v",
752
761
  o.leftVersion,
753
762
  " → v",
754
763
  o.rightVersion
755
764
  ] }),
756
- o.areaDeltaM2 != null && /* @__PURE__ */ l("p", { children: [
757
- v(e, "Footprint area change"),
765
+ o.areaDeltaM2 != null && /* @__PURE__ */ u("p", { children: [
766
+ g(e, "Footprint area change"),
758
767
  ": ",
759
768
  o.areaDeltaM2.toLocaleString(e, { maximumFractionDigits: 4 }),
760
769
  " m² ",
761
- /* @__PURE__ */ l("small", {
770
+ /* @__PURE__ */ u("small", {
762
771
  className: "value-tag",
763
772
  children: [
764
- v(e, "calculated"),
773
+ g(e, "calculated"),
765
774
  " · ",
766
- v(e, "unconfirmed")
775
+ g(e, "unconfirmed")
767
776
  ]
768
777
  })
769
778
  ] }),
770
- /* @__PURE__ */ c("p", { children: v(e, "Engine comparison of saved inputs. Source measurements retain their uncertainty.") }),
771
- /* @__PURE__ */ l("p", { children: [
772
- v(e, "Selected layout"),
779
+ /* @__PURE__ */ l("p", { children: g(e, "Engine comparison of saved inputs. Source measurements retain their uncertainty.") }),
780
+ /* @__PURE__ */ u("p", { children: [
781
+ g(e, "Selected layout"),
773
782
  ": ",
774
783
  o.leftProposalId ?? "—",
775
784
  " → ",
776
785
  o.rightProposalId ?? "—"
777
786
  ] }),
778
- /* @__PURE__ */ c("h4", { children: v(e, "Changed inputs") }),
779
- o.changedInputs.length ? /* @__PURE__ */ c("ul", { children: o.changedInputs.map((e, t) => /* @__PURE__ */ c("li", { children: e }, t)) }) : /* @__PURE__ */ c("p", { children: v(e, "No input changes reported.") })
787
+ /* @__PURE__ */ l("h4", { children: g(e, "Changed inputs") }),
788
+ o.changedInputs.length ? /* @__PURE__ */ l("ul", { children: o.changedInputs.map((e, t) => /* @__PURE__ */ l("li", { children: e }, t)) }) : /* @__PURE__ */ l("p", { children: g(e, "No input changes reported.") })
780
789
  ]
781
790
  })
782
791
  ]
783
792
  })]
784
793
  });
785
794
  }
795
+ // src/digitizationTypes.ts
796
+ var ie = () => ({
797
+ schemaVersion: 1,
798
+ units: "m",
799
+ vertices: [],
800
+ boundaryVertexIds: [],
801
+ walls: [],
802
+ rooms: [],
803
+ openings: []
804
+ }), ae = (e) => ({
805
+ value: e,
806
+ origin: "user-given",
807
+ source: "Explicitly entered in existing-plan review."
808
+ }), oe = () => ({
809
+ value: NaN,
810
+ origin: "estimated",
811
+ source: "Unspecified; enter a known value before review."
812
+ }), _ = (e) => e.values.values.filter((t) => (t.origin === "measured" || t.origin === "user-given") && (!e.requiredReviewPaths || e.requiredReviewPaths.includes(t.path))).map((e) => e.path), v = (e) => [
813
+ ...e.vertices.flatMap((e) => [e.x, e.y]),
814
+ ...e.walls.map((e) => e.thickness),
815
+ ...e.openings.flatMap((e) => [e.offset, e.width])
816
+ ].every((e) => Number.isFinite(e.value));
817
+ function se(e) {
818
+ let t = /* @__PURE__ */ new Map(), n = (e, n) => {
819
+ let r = e + ":" + n, i = t.get(r);
820
+ return i || (i = crypto.randomUUID().replaceAll("-", ""), t.set(r, i)), i;
821
+ }, r = (e) => e ? {
822
+ value: e.value,
823
+ origin: "estimated",
824
+ source: e.source
825
+ } : oe();
826
+ return {
827
+ schemaVersion: 1,
828
+ units: e.units,
829
+ vertices: e.vertices.map((e) => ({
830
+ id: n("v", e.id),
831
+ x: r(e.x),
832
+ y: r(e.y)
833
+ })),
834
+ boundaryVertexIds: e.boundaryVertexIds.map((e) => n("v", e)),
835
+ walls: e.walls.map((e) => ({
836
+ ...e,
837
+ id: n("w", e.id),
838
+ startVertexId: n("v", e.startVertexId),
839
+ endVertexId: n("v", e.endVertexId),
840
+ thickness: r(e.thickness)
841
+ })),
842
+ rooms: e.rooms.map((e) => ({
843
+ ...e,
844
+ id: n("r", e.id),
845
+ vertexIds: e.vertexIds.map((e) => n("v", e))
846
+ })),
847
+ openings: e.openings.map((e) => ({
848
+ ...e,
849
+ id: n("o", e.id),
850
+ hostWallId: n("w", e.hostWallId),
851
+ offset: r(e.offset),
852
+ width: r(e.width),
853
+ height: null,
854
+ sill: null
855
+ }))
856
+ };
857
+ }
858
+ // src/DigitizationReview.tsx
859
+ var y = {
860
+ en: /* @__PURE__ */ "Preserve an existing plan,Enter known coordinates and review boundaries before export. Optional image observations remain unconfirmed and cannot establish physical scale.,Load saved plan,Corners,Add corner,Use corners as outer boundary,Walls,Add wall,Start,End,Thickness,Rooms,Add room,Name,Corner numbers in boundary order,Openings,Add opening,Host wall,Position,Width,Height,Sill,Review geometry,Save reviewed plan,I checked these user-given values against my source. Estimates remain unconfirmed.,Export reviewed plan,Saved revision,Restore revision,Restore,Remove,Download,Unsaved changes,Type".split(","),
861
+ de: /* @__PURE__ */ "Bestehenden Plan erhalten,Bekannte Koordinaten und Grenzen vor dem Export prüfen. Optionale Bildbeobachtungen bleiben unbestätigt und bestätigen keinen physischen Maßstab.,Plan laden,Ecken,Ecke hinzufügen,Ecken als Außenumriss verwenden,Wände,Wand hinzufügen,Anfang,Ende,Dicke,Räume,Raum hinzufügen,Name,Eckennummern in Umrissreihenfolge,Öffnungen,Öffnung hinzufügen,Wand,Position,Breite,Höhe,Brüstung,Geometrie prüfen,Geprüften Plan speichern,Ich habe die Nutzerangaben mit meiner Quelle verglichen. Schätzwerte bleiben unbestätigt.,Geprüften Plan exportieren,Gespeicherte Version,Version wiederherstellen,Wiederherstellen,Entfernen,Herunterladen,Ungespeicherte Änderungen,Art".split(","),
862
+ fr: /* @__PURE__ */ "Conserver un plan existant,Saisir les coordonnées connues et vérifier les limites avant export. Les observations d’image restent non confirmées et ne valident aucune échelle physique.,Charger le plan,Sommets,Ajouter un sommet,Utiliser comme contour extérieur,Murs,Ajouter un mur,Début,Fin,Épaisseur,Pièces,Ajouter une pièce,Nom,Numéros des sommets dans l’ordre du contour,Ouvertures,Ajouter une ouverture,Mur support,Position,Largeur,Hauteur,Allège,Vérifier la géométrie,Enregistrer le plan vérifié,J’ai vérifié ces valeurs avec ma source. Les estimations restent non confirmées.,Exporter le plan vérifié,Version enregistrée,Restaurer la version,Restaurer,Supprimer,Télécharger,Modifications non enregistrées,Type".split(","),
863
+ ar: /* @__PURE__ */ "الحفاظ على مخطط قائم,أدخل الإحداثيات المعروفة وراجع الحدود قبل التصدير. تبقى ملاحظات الصورة غير مؤكدة ولا تثبت مقياساً فعلياً.,تحميل المخطط,الزوايا,إضافة زاوية,استخدام الزوايا كحدود خارجية,الجدران,إضافة جدار,البداية,النهاية,السماكة,الغرف,إضافة غرفة,الاسم,أرقام الزوايا بترتيب الحدود,الفتحات,إضافة فتحة,الجدار,الموضع,العرض,الارتفاع,العتبة,فحص الهندسة,حفظ المخطط المراجع,راجعت القيم المقدمة مع مصدري. تبقى التقديرات غير مؤكدة.,تصدير المخطط المراجع,الإصدار المحفوظ,استعادة الإصدار,استعادة,إزالة,تنزيل,تغييرات غير محفوظة,النوع".split(",")
864
+ }, b = () => crypto.randomUUID().replaceAll("-", "");
865
+ function x({ projectId: t, projectVersion: n, language: r, api: c, onState: ee, onDownload: te, disabled: d = !1, sourceObjectId: ne, imageUrl: f, pendingDraft: p, persistPending: m, onPendingSaved: h, registerPendingSaver: g, loadSavedOnMount: re = !1 }) {
866
+ let [x, ce] = o(() => p?.graph ?? ie()), [S, C] = o(p?.baseDigitizationRevision ?? 0), [w, le] = o(null), [T, E] = o(!!p?.graph), [D, ue] = o(!1), [O, k] = o(""), [de, A] = o(!1), [fe, j] = o(null), [pe, M] = o(1), [me, he] = o(["svg", "dxf"]), [ge, N] = o(!1), [_e, ve] = o(50), [P, ye] = o(p?.sourceObjectId ?? ne), [F, be] = o(!1), [I, xe] = o(null), [Se, Ce] = o(null), [L, we] = o(""), [Te, Ee] = o(""), [De, Oe] = o(""), [ke, R] = o(() => p?.graph ? JSON.stringify(p.graph) : null), z = a(0), B = a(!0), Ae = a(!1), V = a(c), je = a(ee);
867
+ V.current = c, je.current = ee;
868
+ let H = d, U = y[r], Me = `/projects/${t}/digitization`, W = a(n), G = a({
869
+ g: x,
870
+ revision: S,
871
+ source: P,
872
+ dirty: T,
873
+ persistPending: m,
874
+ onPendingSaved: h
875
+ });
876
+ G.current = {
877
+ g: x,
878
+ revision: S,
879
+ source: P,
880
+ dirty: T,
881
+ persistPending: m,
882
+ onPendingSaved: h
883
+ };
884
+ async function Ne() {
885
+ let e = G.current;
886
+ if (!e.persistPending || !e.dirty && e.revision > 0) return null;
887
+ if (!v(e.g)) throw Error("Enter known numeric values before preserving this draft or checkout. Missing values are never replaced with zero.");
888
+ let n = z.current, r = await e.persistPending({
889
+ workflow: "existing-plan",
890
+ graph: e.g,
891
+ sourceObjectId: e.source,
892
+ baseDigitizationRevision: e.revision
893
+ }, W.current, t);
894
+ if (!B.current || n !== z.current) throw new DOMException("The pending workspace changed.", "AbortError");
895
+ return W.current = r.version, R(JSON.stringify(e.g)), e.onPendingSaved?.(r), r;
896
+ }
897
+ i(() => (g?.(Ne), () => g?.(null)), [g]), i(() => (B.current = !0, () => {
898
+ B.current = !1, z.current++, je.current({
899
+ busy: !1,
900
+ hasUnsavedChanges: !1
901
+ });
902
+ }), []), i(() => {
903
+ je.current({
904
+ busy: D,
905
+ hasUnsavedChanges: T && JSON.stringify(x) !== ke
906
+ });
907
+ }, [
908
+ D,
909
+ T,
910
+ x,
911
+ ke
912
+ ]), i(() => {
913
+ n !== W.current && (W.current = n, z.current++, le(null), A(!1), j(null), p?.graph && (ce(p.graph), R(JSON.stringify(p.graph)), C(p.baseDigitizationRevision ?? 0), E(!0)));
914
+ }, [n]), i(() => {
915
+ z.current++, S > 0 && P !== ne && E(!0), ye(ne), xe(null), Ce(null), be(!1), A(!1), le(null), j(null);
916
+ }, [ne]), i(() => {
917
+ if (!p?.graph && !re) return;
918
+ let e = z.current;
919
+ V.current(Me).then((t) => {
920
+ B.current && e === z.current && t && Number.isInteger(t.revision) && (p?.graph ? t.revision <= G.current.revision || (z.current++, C(t.revision), le(null), A(!1), j(null), k("The saved plan changed. Your pending observations are restored; review them again before saving.")) : Ie(t));
921
+ }).catch(() => {});
922
+ }, []);
923
+ function K(e) {
924
+ z.current++, ce(e), E(!0), le(null), j(null), A(!1);
925
+ }
926
+ async function Pe(e, t) {
927
+ let n = z.current, r = await V.current(e, t);
928
+ if (!B.current || n !== z.current) throw new DOMException("The reviewed workspace changed.", "AbortError");
929
+ return r;
930
+ }
931
+ async function Fe(e) {
932
+ if (!(Ae.current || H)) {
933
+ Ae.current = !0, ue(!0), k("");
934
+ try {
935
+ await e();
936
+ } catch (e) {
937
+ B.current && !(e instanceof DOMException && e.name === "AbortError") && k(e instanceof Error ? e.message : String(e));
938
+ } finally {
939
+ Ae.current = !1, B.current && ue(!1);
940
+ }
941
+ }
942
+ }
943
+ function Ie(e) {
944
+ B.current && (ye(e.sourceObjectId ?? ne), xe(null), Ce(null), be(!1), ce(e.graph), C(e.revision), le({
945
+ ...e.review,
946
+ svg: e.svg ?? e.review.svg,
947
+ pricingNotice: e.pricingNotice ?? e.review.pricingNotice
948
+ }), E(!1), R(null), A(!1), j(null), he(e.availableFormats ?? ["svg", "dxf"]), N(!1));
949
+ }
950
+ let q = (e, t, n = !1) => /* @__PURE__ */ l("button", {
951
+ type: "button",
952
+ className: "outline",
953
+ disabled: D || H || n,
954
+ onClick: t,
955
+ children: e
956
+ });
957
+ function Le(e, t, n) {
958
+ return /* @__PURE__ */ u("label", {
959
+ className: "field",
960
+ children: [
961
+ e,
962
+ " (",
963
+ x.units,
964
+ ")",
965
+ /* @__PURE__ */ l("input", {
966
+ type: "number",
967
+ step: "any",
968
+ value: !Number.isFinite(t.value) || t.origin === "estimated" ? "" : t.value,
969
+ placeholder: t.origin === "estimated" && Number.isFinite(t.value) ? String(t.value) : void 0,
970
+ onChange: (e) => {
971
+ let t = e.currentTarget.valueAsNumber;
972
+ n(Number.isFinite(t) ? ae(t) : {
973
+ value: NaN,
974
+ origin: "estimated",
975
+ source: "Unspecified; enter a known value before review."
976
+ });
977
+ }
978
+ }),
979
+ /* @__PURE__ */ u("small", { children: [
980
+ t.origin,
981
+ t.origin === "estimated" && Number.isFinite(t.value) ? ": " + t.value : "",
982
+ " · ",
983
+ t.source
984
+ ] })
985
+ ]
986
+ });
987
+ }
988
+ function J(e, t, n) {
989
+ return /* @__PURE__ */ u("label", {
990
+ className: "field",
991
+ children: [e, /* @__PURE__ */ u("select", {
992
+ value: t,
993
+ onChange: (e) => n(e.target.value),
994
+ children: [/* @__PURE__ */ l("option", {
995
+ value: "",
996
+ children: "—"
997
+ }), x.vertices.map((e, t) => /* @__PURE__ */ l("option", {
998
+ value: e.id,
999
+ children: t + 1
1000
+ }, e.id))]
1001
+ })]
1002
+ });
1003
+ }
1004
+ return /* @__PURE__ */ u("details", {
1005
+ className: "digitization-review paper",
1006
+ children: [/* @__PURE__ */ u("summary", { children: [
1007
+ U[0],
1008
+ " ",
1009
+ T && /* @__PURE__ */ l("small", { children: U[31] })
1010
+ ] }), /* @__PURE__ */ u("fieldset", {
1011
+ disabled: D || H,
1012
+ style: {
1013
+ border: 0,
1014
+ padding: 0,
1015
+ minWidth: 0
1016
+ },
1017
+ children: [
1018
+ /* @__PURE__ */ l("p", { children: U[1] }),
1019
+ /* @__PURE__ */ u("label", { children: [{
1020
+ en: "Input units",
1021
+ de: "Eingabeeinheit",
1022
+ fr: "Unité des données",
1023
+ ar: "وحدات الإدخال"
1024
+ }[r], /* @__PURE__ */ l("select", {
1025
+ disabled: D || H,
1026
+ value: x.units,
1027
+ onChange: (e) => K({
1028
+ ...x,
1029
+ units: e.target.value
1030
+ }),
1031
+ children: [
1032
+ "m",
1033
+ "cm",
1034
+ "mm"
1035
+ ].map((e) => /* @__PURE__ */ l("option", { children: e }, e))
1036
+ })] }),
1037
+ q(U[2], () => void Fe(async () => {
1038
+ let e = await Pe(Me);
1039
+ e ? Ie(e) : k({
1040
+ en: "No saved existing plan yet.",
1041
+ de: "Noch kein bestehender Plan gespeichert.",
1042
+ fr: "Aucun plan existant enregistré.",
1043
+ ar: "لا يوجد مخطط قائم محفوظ بعد."
1044
+ }[r]);
1045
+ }), T),
1046
+ S > 0 && /* @__PURE__ */ u("p", { children: [
1047
+ U[26],
1048
+ " ",
1049
+ S
1050
+ ] }),
1051
+ P && /* @__PURE__ */ u("section", { children: [
1052
+ /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ l("input", {
1053
+ type: "checkbox",
1054
+ checked: F,
1055
+ disabled: D || H,
1056
+ onChange: (e) => be(e.target.checked)
1057
+ }), {
1058
+ en: "Send this saved image to Anthropic for unconfirmed image-coordinate observations. This does not establish physical scale.",
1059
+ de: "Gespeichertes Bild an Anthropic für unbestätigte Bildkoordinaten senden. Dies bestätigt keinen Maßstab.",
1060
+ fr: "Envoyer cette image à Anthropic pour des observations non confirmées. Aucune échelle physique ne sera confirmée.",
1061
+ ar: "إرسال الصورة المحفوظة إلى Anthropic لملاحظات غير مؤكدة. هذا لا يحدد مقياساً فعلياً."
1062
+ }[r]] }),
1063
+ q({
1064
+ en: "Read image observations",
1065
+ de: "Bildbeobachtungen lesen",
1066
+ fr: "Lire les observations de l’image",
1067
+ ar: "قراءة ملاحظات الصورة"
1068
+ }[r], () => void Fe(async () => {
1069
+ let e = await Pe(Me + "/recognize", {
1070
+ expectedProjectVersion: W.current,
1071
+ expectedRevision: S,
1072
+ operationId: b(),
1073
+ sourceObjectId: P,
1074
+ intent: "Identify existing boundaries, walls, rooms and openings as unconfirmed image coordinates only.",
1075
+ allowAiProcessing: !0
1076
+ });
1077
+ B.current && (xe(e), Ce(null), we(""), Ee(""), Oe(""));
1078
+ }), !F),
1079
+ I && /* @__PURE__ */ u("div", {
1080
+ role: "status",
1081
+ children: [
1082
+ /* @__PURE__ */ l("p", { children: {
1083
+ en: "Estimated image tracing only. Physical calibration and reviewed measurements are still required; no metric plan was adopted.",
1084
+ de: "Nur geschätzte Bildkonturen. Physische Kalibrierung und geprüfte Maße fehlen; kein metrischer Plan wurde übernommen.",
1085
+ fr: "Tracé estimatif uniquement. Calibration et mesures vérifiées restent nécessaires ; aucun plan métrique adopté.",
1086
+ ar: "تتبع تقديري للصورة فقط. ما زالت المعايرة والقياسات المراجعة مطلوبة؛ لم يتم اعتماد مخطط متري."
1087
+ }[r] }),
1088
+ I.questions.map((e, t) => /* @__PURE__ */ l("p", { children: e }, t)),
1089
+ I.candidate && /* @__PURE__ */ u("svg", {
1090
+ "aria-label": "Unconfirmed image-coordinate tracing",
1091
+ viewBox: `0 0 ${I.candidate.imageWidthPx} ${I.candidate.imageHeightPx}`,
1092
+ style: {
1093
+ width: "100%",
1094
+ maxHeight: 350
1095
+ },
1096
+ children: [
1097
+ f && P === ne && /* @__PURE__ */ l("image", {
1098
+ href: f,
1099
+ width: I.candidate.imageWidthPx,
1100
+ height: I.candidate.imageHeightPx
1101
+ }),
1102
+ " ",
1103
+ I.candidate.walls.map((e) => {
1104
+ let t = I.candidate.vertices.find((t) => t.id === e.startVertexId), n = I.candidate.vertices.find((t) => t.id === e.endVertexId);
1105
+ return t && n ? /* @__PURE__ */ l("line", {
1106
+ x1: t.xPx,
1107
+ y1: t.yPx,
1108
+ x2: n.xPx,
1109
+ y2: n.yPx,
1110
+ stroke: "#397e70",
1111
+ strokeWidth: "2"
1112
+ }, e.id) : null;
1113
+ }),
1114
+ I.candidate.vertices.map((e) => /* @__PURE__ */ u("g", { children: [/* @__PURE__ */ l("circle", {
1115
+ cx: e.xPx,
1116
+ cy: e.yPx,
1117
+ r: Math.max(3, I.candidate.imageWidthPx / 120),
1118
+ fill: e.id === L || e.id === Te ? "#bd641c" : "#397e70"
1119
+ }), /* @__PURE__ */ l("text", {
1120
+ x: e.xPx + 5,
1121
+ y: e.yPx - 5,
1122
+ fontSize: Math.max(8, I.candidate.imageWidthPx / 60),
1123
+ fill: "#1f2b28",
1124
+ children: e.id
1125
+ })] }, e.id))
1126
+ ]
1127
+ })
1128
+ ]
1129
+ })
1130
+ ] }),
1131
+ I?.candidate && /* @__PURE__ */ u("section", { children: [
1132
+ /* @__PURE__ */ l("h3", { children: {
1133
+ en: "Calibration preview — not confirmed dimensions",
1134
+ de: "Kalibrierungsvorschau — keine bestätigten Maße",
1135
+ fr: "Aperçu calibré — mesures non confirmées",
1136
+ ar: "معاينة المعايرة — قياسات غير مؤكدة"
1137
+ }[r] }),
1138
+ /* @__PURE__ */ l("p", { children: {
1139
+ en: "Choose two endpoints and enter their known distance in metres. The selected start point is the coordinate origin. Uniform scaling assumes a rectified image; perspective remains uncorrected.",
1140
+ de: "Zwei Endpunkte und ihren bekannten Abstand in Metern angeben. Der Anfang ist der Ursprung. Gleichmäßige Skalierung setzt ein entzerrtes Bild voraus; Perspektive bleibt unkorrigiert.",
1141
+ fr: "Choisir deux points et saisir leur distance connue en mètres. Le début est l’origine. Une image rectifiée est supposée ; la perspective reste non corrigée.",
1142
+ ar: "اختر نقطتين وأدخل المسافة المعروفة بالأمتار. نقطة البداية هي الأصل. يفترض التحجيم صورة مصححة؛ المنظور يبقى دون تصحيح."
1143
+ }[r] }),
1144
+ [[
1145
+ "start",
1146
+ L,
1147
+ we
1148
+ ], [
1149
+ "end",
1150
+ Te,
1151
+ Ee
1152
+ ]].map(([e, t, n]) => /* @__PURE__ */ u("label", { children: [e === "start" ? U[8] : U[9], /* @__PURE__ */ u("select", {
1153
+ disabled: D || H,
1154
+ value: t,
1155
+ onChange: (e) => {
1156
+ n(e.target.value), z.current++, Ce(null);
1157
+ },
1158
+ children: [/* @__PURE__ */ l("option", {
1159
+ value: "",
1160
+ children: "—"
1161
+ }), I.candidate.vertices.map((e) => /* @__PURE__ */ l("option", {
1162
+ value: e.id,
1163
+ children: e.id
1164
+ }, e.id))]
1165
+ })] }, e)),
1166
+ /* @__PURE__ */ u("label", { children: [{
1167
+ en: "Known distance (m)",
1168
+ de: "Bekannter Abstand (m)",
1169
+ fr: "Distance connue (m)",
1170
+ ar: "المسافة المعروفة (م)"
1171
+ }[r], /* @__PURE__ */ l("input", {
1172
+ type: "number",
1173
+ min: "0",
1174
+ step: "any",
1175
+ disabled: D || H,
1176
+ value: De,
1177
+ onChange: (e) => {
1178
+ Oe(e.target.value), z.current++, Ce(null);
1179
+ }
1180
+ })] }),
1181
+ q({
1182
+ en: "Preview calibrated suggestions",
1183
+ de: "Kalibrierte Vorschläge anzeigen",
1184
+ fr: "Afficher les suggestions calibrées",
1185
+ ar: "عرض اقتراحات المعايرة"
1186
+ }[r], () => void Fe(async () => {
1187
+ let e = await Pe(Me + "/calibrate", {
1188
+ expectedProjectVersion: W.current,
1189
+ expectedRevision: S,
1190
+ candidate: I.candidate,
1191
+ sourceObjectId: P,
1192
+ calibration: {
1193
+ startVertexId: L,
1194
+ endVertexId: Te,
1195
+ originVertexId: L,
1196
+ knownLength: ae(Number(De)),
1197
+ units: "m"
1198
+ }
1199
+ });
1200
+ B.current && Ce(e);
1201
+ }), !L || !Te || L === Te || !Number.isFinite(Number(De)) || Number(De) <= 0),
1202
+ Se && /* @__PURE__ */ u("div", {
1203
+ role: "status",
1204
+ children: [
1205
+ Se.findings.map((e, t) => /* @__PURE__ */ u("p", { children: [
1206
+ e.code,
1207
+ ": ",
1208
+ e.message
1209
+ ] }, t)),
1210
+ Se.questions.map((e, t) => /* @__PURE__ */ l("p", { children: e }, t)),
1211
+ Se.draft && q({
1212
+ en: "Start review from unconfirmed suggestions",
1213
+ de: "Unbestätigte Vorschläge einzeln prüfen",
1214
+ fr: "Vérifier les suggestions non confirmées",
1215
+ ar: "بدء مراجعة الاقتراحات غير المؤكدة"
1216
+ }[r], () => K(se(Se.draft)), T)
1217
+ ]
1218
+ })
1219
+ ] }),
1220
+ /* @__PURE__ */ u("fieldset", {
1221
+ disabled: D || H,
1222
+ children: [
1223
+ /* @__PURE__ */ l("legend", { children: U[3] }),
1224
+ x.vertices.map((e, t) => /* @__PURE__ */ u("article", { children: [
1225
+ /* @__PURE__ */ l("strong", { children: t + 1 }),
1226
+ Le("X", e.x, (t) => K({
1227
+ ...x,
1228
+ vertices: x.vertices.map((n) => n.id === e.id ? {
1229
+ ...n,
1230
+ x: t
1231
+ } : n)
1232
+ })),
1233
+ Le("Y", e.y, (t) => K({
1234
+ ...x,
1235
+ vertices: x.vertices.map((n) => n.id === e.id ? {
1236
+ ...n,
1237
+ y: t
1238
+ } : n)
1239
+ })),
1240
+ q(U[29], () => K({
1241
+ ...x,
1242
+ vertices: x.vertices.filter((t) => t.id !== e.id)
1243
+ }))
1244
+ ] }, e.id)),
1245
+ q(U[4], () => K({
1246
+ ...x,
1247
+ vertices: [...x.vertices, {
1248
+ id: b(),
1249
+ x: oe(),
1250
+ y: oe()
1251
+ }]
1252
+ })),
1253
+ q(U[5], () => K({
1254
+ ...x,
1255
+ boundaryVertexIds: x.vertices.map((e) => e.id)
1256
+ }), x.vertices.length < 3)
1257
+ ]
1258
+ }),
1259
+ /* @__PURE__ */ u("fieldset", {
1260
+ disabled: D || H,
1261
+ children: [
1262
+ /* @__PURE__ */ l("legend", { children: U[6] }),
1263
+ x.walls.map((e) => /* @__PURE__ */ u("article", { children: [
1264
+ J(U[8], e.startVertexId, (t) => K({
1265
+ ...x,
1266
+ walls: x.walls.map((n) => n.id === e.id ? {
1267
+ ...n,
1268
+ startVertexId: t
1269
+ } : n)
1270
+ })),
1271
+ J(U[9], e.endVertexId, (t) => K({
1272
+ ...x,
1273
+ walls: x.walls.map((n) => n.id === e.id ? {
1274
+ ...n,
1275
+ endVertexId: t
1276
+ } : n)
1277
+ })),
1278
+ Le(U[10], e.thickness, (t) => K({
1279
+ ...x,
1280
+ walls: x.walls.map((n) => n.id === e.id ? {
1281
+ ...n,
1282
+ thickness: t
1283
+ } : n)
1284
+ })),
1285
+ /* @__PURE__ */ u("label", { children: [U[32], /* @__PURE__ */ l("select", {
1286
+ value: e.type,
1287
+ onChange: (t) => K({
1288
+ ...x,
1289
+ walls: x.walls.map((n) => n.id === e.id ? {
1290
+ ...n,
1291
+ type: t.target.value
1292
+ } : n)
1293
+ }),
1294
+ children: [
1295
+ "exterior",
1296
+ "party",
1297
+ "interior"
1298
+ ].map((e) => /* @__PURE__ */ l("option", { children: e }, e))
1299
+ })] }),
1300
+ q(U[29], () => K({
1301
+ ...x,
1302
+ walls: x.walls.filter((t) => t.id !== e.id)
1303
+ }))
1304
+ ] }, e.id)),
1305
+ q(U[7], () => K({
1306
+ ...x,
1307
+ walls: [...x.walls, {
1308
+ id: b(),
1309
+ startVertexId: "",
1310
+ endVertexId: "",
1311
+ thickness: oe(),
1312
+ type: "interior"
1313
+ }]
1314
+ }))
1315
+ ]
1316
+ }),
1317
+ /* @__PURE__ */ u("fieldset", {
1318
+ disabled: D || H,
1319
+ children: [
1320
+ /* @__PURE__ */ l("legend", { children: U[11] }),
1321
+ x.rooms.map((e) => /* @__PURE__ */ u("article", { children: [
1322
+ /* @__PURE__ */ u("label", { children: [U[13], /* @__PURE__ */ l("input", {
1323
+ value: e.name,
1324
+ onChange: (t) => K({
1325
+ ...x,
1326
+ rooms: x.rooms.map((n) => n.id === e.id ? {
1327
+ ...n,
1328
+ name: t.target.value
1329
+ } : n)
1330
+ })
1331
+ })] }),
1332
+ /* @__PURE__ */ u("label", { children: [{
1333
+ en: "Room use",
1334
+ de: "Raumnutzung",
1335
+ fr: "Usage de la pièce",
1336
+ ar: "استخدام الغرفة"
1337
+ }[r], /* @__PURE__ */ l("input", {
1338
+ value: e.function,
1339
+ onChange: (t) => K({
1340
+ ...x,
1341
+ rooms: x.rooms.map((n) => n.id === e.id ? {
1342
+ ...n,
1343
+ function: t.target.value
1344
+ } : n)
1345
+ })
1346
+ })] }),
1347
+ /* @__PURE__ */ u("label", { children: [U[14], /* @__PURE__ */ l("input", {
1348
+ value: e.vertexIds.map((e) => x.vertices.findIndex((t) => t.id === e) + 1).join(","),
1349
+ onChange: (t) => K({
1350
+ ...x,
1351
+ rooms: x.rooms.map((n) => n.id === e.id ? {
1352
+ ...n,
1353
+ vertexIds: t.target.value.split(",").map((e) => x.vertices[Number(e.trim()) - 1]?.id ?? "")
1354
+ } : n)
1355
+ })
1356
+ })] }),
1357
+ q(U[29], () => K({
1358
+ ...x,
1359
+ rooms: x.rooms.filter((t) => t.id !== e.id)
1360
+ }))
1361
+ ] }, e.id)),
1362
+ q(U[12], () => K({
1363
+ ...x,
1364
+ rooms: [...x.rooms, {
1365
+ id: b(),
1366
+ name: "",
1367
+ function: "unspecified",
1368
+ vertexIds: []
1369
+ }]
1370
+ }))
1371
+ ]
1372
+ }),
1373
+ /* @__PURE__ */ u("fieldset", {
1374
+ disabled: D || H,
1375
+ children: [
1376
+ /* @__PURE__ */ l("legend", { children: U[15] }),
1377
+ x.openings.map((t) => /* @__PURE__ */ u("article", { children: [
1378
+ /* @__PURE__ */ u("label", { children: [U[32], /* @__PURE__ */ u("select", {
1379
+ value: t.kind,
1380
+ onChange: (e) => K({
1381
+ ...x,
1382
+ openings: x.openings.map((n) => n.id === t.id ? {
1383
+ ...n,
1384
+ kind: e.target.value
1385
+ } : n)
1386
+ }),
1387
+ children: [/* @__PURE__ */ l("option", { children: "door" }), /* @__PURE__ */ l("option", { children: "window" })]
1388
+ })] }),
1389
+ /* @__PURE__ */ u("label", { children: [{
1390
+ en: "Opening operation",
1391
+ de: "Öffnungsart",
1392
+ fr: "Fonctionnement",
1393
+ ar: "طريقة الفتح"
1394
+ }[r], /* @__PURE__ */ l("select", {
1395
+ value: t.operation,
1396
+ onChange: (e) => K({
1397
+ ...x,
1398
+ openings: x.openings.map((n) => n.id === t.id ? {
1399
+ ...n,
1400
+ operation: e.target.value
1401
+ } : n)
1402
+ }),
1403
+ children: [
1404
+ "unknown",
1405
+ "hinged-left",
1406
+ "hinged-right",
1407
+ "sliding",
1408
+ "fixed"
1409
+ ].map((e) => /* @__PURE__ */ l("option", { children: e }, e))
1410
+ })] }),
1411
+ /* @__PURE__ */ u("label", { children: [U[17], /* @__PURE__ */ u("select", {
1412
+ value: t.hostWallId,
1413
+ onChange: (e) => K({
1414
+ ...x,
1415
+ openings: x.openings.map((n) => n.id === t.id ? {
1416
+ ...n,
1417
+ hostWallId: e.target.value
1418
+ } : n)
1419
+ }),
1420
+ children: [/* @__PURE__ */ l("option", {
1421
+ value: "",
1422
+ children: "—"
1423
+ }), x.walls.map((e, t) => /* @__PURE__ */ l("option", {
1424
+ value: e.id,
1425
+ children: t + 1
1426
+ }, e.id))]
1427
+ })] }),
1428
+ [
1429
+ "offset",
1430
+ "width",
1431
+ "height",
1432
+ "sill"
1433
+ ].map((n, r) => /* @__PURE__ */ l(e.Fragment, { children: Le(U[18 + r], t[n] ?? oe(), (e) => K({
1434
+ ...x,
1435
+ openings: x.openings.map((r) => r.id === t.id ? {
1436
+ ...r,
1437
+ [n]: (n === "height" || n === "sill") && !Number.isFinite(e.value) ? null : e
1438
+ } : r)
1439
+ })) }, n)),
1440
+ q(U[29], () => K({
1441
+ ...x,
1442
+ openings: x.openings.filter((e) => e.id !== t.id)
1443
+ }))
1444
+ ] }, t.id)),
1445
+ q(U[16], () => K({
1446
+ ...x,
1447
+ openings: [...x.openings, {
1448
+ id: b(),
1449
+ kind: "door",
1450
+ hostWallId: "",
1451
+ offset: oe(),
1452
+ width: oe(),
1453
+ height: null,
1454
+ sill: null,
1455
+ operation: "unknown"
1456
+ }]
1457
+ }))
1458
+ ]
1459
+ }),
1460
+ q(U[22], () => void Fe(async () => {
1461
+ let e = await Pe(Me + "/review", {
1462
+ expectedProjectVersion: W.current,
1463
+ expectedRevision: S,
1464
+ graph: x,
1465
+ sourceObjectId: P
1466
+ });
1467
+ B.current && (le(e), A(!1));
1468
+ }), !v(x)),
1469
+ w && /* @__PURE__ */ u("section", {
1470
+ "aria-live": "polite",
1471
+ children: [
1472
+ w.pricingNotice && /* @__PURE__ */ l("p", { children: w.pricingNotice }),
1473
+ w.svg && /* @__PURE__ */ l("div", {
1474
+ className: "engine-svg",
1475
+ dangerouslySetInnerHTML: { __html: s.sanitize(w.svg, { USE_PROFILES: {
1476
+ svg: !0,
1477
+ svgFilters: !0
1478
+ } }) }
1479
+ }),
1480
+ /* @__PURE__ */ l("ul", { children: w.findings.map((e, t) => /* @__PURE__ */ u("li", { children: [
1481
+ /* @__PURE__ */ l("strong", { children: e.code }),
1482
+ " ",
1483
+ e.message,
1484
+ " ",
1485
+ e.suggestedAction
1486
+ ] }, t)) }),
1487
+ /* @__PURE__ */ u("details", { children: [
1488
+ /* @__PURE__ */ l("summary", { children: U[22] }),
1489
+ w.values.values.map((e) => /* @__PURE__ */ u("p", { children: [
1490
+ e.path,
1491
+ ": ",
1492
+ e.value,
1493
+ " ",
1494
+ e.unit,
1495
+ " [",
1496
+ e.origin,
1497
+ "]"
1498
+ ] }, e.path)),
1499
+ w.values.discrepancies.map((e) => /* @__PURE__ */ u("p", { children: [
1500
+ e.message,
1501
+ " ",
1502
+ e.question
1503
+ ] }, e.id))
1504
+ ] }),
1505
+ /* @__PURE__ */ u("label", { children: [/* @__PURE__ */ l("input", {
1506
+ type: "checkbox",
1507
+ disabled: D || H,
1508
+ checked: de,
1509
+ onChange: (e) => A(e.target.checked)
1510
+ }), U[24]] }),
1511
+ q(U[23], () => void Fe(async () => {
1512
+ await Ne(), Ie(await Pe(Me, {
1513
+ expectedProjectVersion: W.current,
1514
+ expectedRevision: S,
1515
+ operationId: b(),
1516
+ graph: x,
1517
+ sourceObjectId: P,
1518
+ reviewContentHash: w.contentHash,
1519
+ reviewedValuePaths: _(w)
1520
+ }));
1521
+ }), !de || !w.geometryValidated || !T && S > 0 && w.canExport || (w.requiredReviewPaths?.some((e) => !_(w).includes(e)) ?? !1))
1522
+ ]
1523
+ }),
1524
+ me.includes("pdf") && /* @__PURE__ */ u("label", { children: [
1525
+ "PDF",
1526
+ /* @__PURE__ */ l("input", {
1527
+ type: "checkbox",
1528
+ disabled: D || H,
1529
+ checked: ge,
1530
+ onChange: (e) => {
1531
+ N(e.target.checked), j(null);
1532
+ }
1533
+ }),
1534
+ /* @__PURE__ */ u("select", {
1535
+ "aria-label": "PDF scale / paper",
1536
+ disabled: D || H,
1537
+ value: _e,
1538
+ onChange: (e) => {
1539
+ ve(Number(e.target.value)), j(null);
1540
+ },
1541
+ children: [/* @__PURE__ */ l("option", {
1542
+ value: 50,
1543
+ children: "1:50 · A2"
1544
+ }), /* @__PURE__ */ l("option", {
1545
+ value: 100,
1546
+ children: "1:100 · A3"
1547
+ })]
1548
+ }),
1549
+ /* @__PURE__ */ l("small", { children: "100% · 1:100: compact labels" })
1550
+ ] }),
1551
+ q(U[25], () => void Fe(async () => {
1552
+ let e = await Pe(Me + "/exports", {
1553
+ expectedProjectVersion: W.current,
1554
+ expectedRevision: S,
1555
+ operationId: b(),
1556
+ formats: ge ? [
1557
+ "svg",
1558
+ "dxf",
1559
+ "pdf"
1560
+ ] : ["svg", "dxf"],
1561
+ scaleDenominator: _e,
1562
+ paperSize: _e === 50 ? "A2" : "A3"
1563
+ });
1564
+ B.current && j(e);
1565
+ }), T || !w?.canExport || S < 1),
1566
+ S > 1 && /* @__PURE__ */ u("label", { children: [
1567
+ U[27],
1568
+ /* @__PURE__ */ l("input", {
1569
+ type: "number",
1570
+ min: "1",
1571
+ max: S - 1,
1572
+ value: pe,
1573
+ onChange: (e) => M(e.target.valueAsNumber)
1574
+ }),
1575
+ q(U[28], () => void Fe(async () => Ie(await Pe(Me + "/undo", {
1576
+ expectedProjectVersion: W.current,
1577
+ expectedRevision: S,
1578
+ targetRevision: pe,
1579
+ operationId: b()
1580
+ }))), T)
1581
+ ] }),
1582
+ fe && Object.keys(fe.files).map((t) => /* @__PURE__ */ l(e.Fragment, { children: q(U[30] + " " + t.toUpperCase(), () => te(t, fe), T) }, t)),
1583
+ O && /* @__PURE__ */ l("p", {
1584
+ role: "alert",
1585
+ children: O
1586
+ }),
1587
+ /* @__PURE__ */ l("p", { children: "Concept proposal, not a construction drawing; verify with a licensed architect/engineer." })
1588
+ ]
1589
+ })]
1590
+ });
1591
+ }
786
1592
  // src/packageVersion.ts
787
- var te = "0.1.2";
1593
+ var ce = "0.1.6";
788
1594
  // src/licensing.ts
789
- d();
790
- var ne = "bim", y = te, b = "https://licenseapi.polycyphers.com/api/license/revoked.json", re = "polycyphers-revocation-list", x = 1048576, S = 86400, ie = 6e4, ae = "", C = 0, oe = "not_set", w = null, T = null, E = /* @__PURE__ */ new Set();
791
- function se(e) {
792
- p(e === "karamentreprises" ? "karament" : null);
1595
+ te();
1596
+ var S = "bim", C = ce, w = "https://licenseapi.polycyphers.com/api/license/revoked.json", le = "polycyphers-revocation-list", T = 1048576, E = 86400, D = 6e4, ue = "", O = 0, k = "not_set", de = null, A = null, fe = /* @__PURE__ */ new Set();
1597
+ function j(e) {
1598
+ ne(e === "karamentreprises" ? "karament" : null);
793
1599
  }
794
- function ce(e) {
1600
+ function pe(e) {
795
1601
  let t = typeof e == "string" ? e.trim() : "";
796
- if (t !== ae) {
797
- ae = t, C++, w = null, oe = t ? "checking" : "not_set";
798
- for (let e of E) try {
1602
+ if (t !== ue) {
1603
+ ue = t, O++, de = null, k = t ? "checking" : "not_set";
1604
+ for (let e of fe) try {
799
1605
  e();
800
1606
  } catch {}
801
1607
  }
802
1608
  }
803
- function D() {
804
- ce("");
1609
+ function M() {
1610
+ pe("");
805
1611
  }
806
- function O(e) {
807
- return E.add(e), () => {
808
- E.delete(e);
1612
+ function me(e) {
1613
+ return fe.add(e), () => {
1614
+ fe.delete(e);
809
1615
  };
810
1616
  }
811
- function le() {
812
- return w ? Date.now() >= w.expires ? "expired" : Date.now() < w.until ? w.status : "checking" : oe;
1617
+ function he() {
1618
+ return de ? Date.now() >= de.expires ? "expired" : Date.now() < de.until ? de.status : "checking" : k;
813
1619
  }
814
- function ue(e) {
1620
+ function ge(e) {
815
1621
  return !!e && typeof e == "object" && !Array.isArray(e);
816
1622
  }
817
- function k(e, t = 256) {
1623
+ function N(e, t = 256) {
818
1624
  return typeof e == "string" && e.length > 0 && e.length <= t && !/[\u0000-\u001f\u007f]/.test(e);
819
1625
  }
820
- function A(e) {
1626
+ function _e(e) {
821
1627
  return typeof e == "number" && Number.isSafeInteger(e) && e > 0;
822
1628
  }
823
- function de(e) {
1629
+ function ve(e) {
824
1630
  if (e.length > 32768 || !/^[-_A-Za-z0-9]+\.[-_A-Za-z0-9]+$/.test(e)) return null;
825
1631
  try {
826
1632
  let t = Uint8Array.from(atob(e.split(".")[0].replace(/-/g, "+").replace(/_/g, "/")), (e) => e.charCodeAt(0)), n = JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(t));
827
- return ue(n) ? n : null;
1633
+ return ge(n) ? n : null;
828
1634
  } catch {
829
1635
  return null;
830
1636
  }
831
1637
  }
832
- function fe(e) {
1638
+ function P(e) {
833
1639
  if (e === "*") return !0;
834
- let t = e.split("."), n = y.split(".");
1640
+ let t = e.split("."), n = C.split(".");
835
1641
  return t.length <= 3 && t.every((e, t) => e === "x" || e === "*" || /^\d+$/.test(e) && e === n[t]);
836
1642
  }
837
- function j(e) {
838
- if (!k(e, 253)) return !1;
1643
+ function ye(e) {
1644
+ if (!N(e, 253)) return !1;
839
1645
  let t = e.toLowerCase().replace(/^\*\./, "").replace(/^\./, "");
840
1646
  return /^\[[0-9a-f:]+\]$/.test(t) || t.split(".").every((e) => /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(e));
841
1647
  }
842
- function pe(e, t) {
1648
+ function F(e, t) {
843
1649
  let n = e.toLowerCase();
844
1650
  return n === t ? !0 : n.startsWith("*.") ? t.endsWith(n.slice(1)) && t.length > n.length - 1 : n.startsWith(".") ? t === n.slice(1) || t.endsWith(n) : !1;
845
1651
  }
846
- async function me(e) {
1652
+ async function be(e) {
847
1653
  if (!e.ok) throw Error("License service unavailable");
848
1654
  let t = e.headers.get("content-length");
849
- if (t && (!/^\d+$/.test(t) || Number(t) > x)) throw Error("License response too large");
1655
+ if (t && (!/^\d+$/.test(t) || Number(t) > T)) throw Error("License response too large");
850
1656
  if (!e.body) throw Error("License response missing");
851
1657
  let n = e.body.getReader(), r = 0, i = [];
852
1658
  try {
853
1659
  for (;;) {
854
1660
  let e = await n.read();
855
1661
  if (e.done) break;
856
- if (r += e.value.byteLength, r > x) throw Error("License response too large");
1662
+ if (r += e.value.byteLength, r > T) throw Error("License response too large");
857
1663
  i.push(e.value);
858
1664
  }
859
1665
  } finally {
@@ -863,42 +1669,42 @@ async function me(e) {
863
1669
  for (let e of i) a.set(e, o), o += e.byteLength;
864
1670
  return JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(a));
865
1671
  }
866
- async function he(e, t) {
1672
+ async function I(e, t) {
867
1673
  let n = new AbortController(), r = setTimeout(() => n.abort(), 8e3);
868
1674
  try {
869
- let r = await me(await fetch(b, {
1675
+ let r = await be(await fetch(w, {
870
1676
  credentials: "omit",
871
1677
  cache: "no-store",
872
1678
  redirect: "error",
873
1679
  signal: n.signal
874
1680
  }));
875
- if (!ue(r) || typeof r.token != "string" || r.token.length > x || !A(r.iat) || !Array.isArray(r.revoked) || r.revoked.length > 1e5 || !r.revoked.every((e) => k(e, 128))) throw Error("Invalid revocation envelope");
876
- let i = r.revoked, a = await m(r.token, re, t);
1681
+ if (!ge(r) || typeof r.token != "string" || r.token.length > T || !_e(r.iat) || !Array.isArray(r.revoked) || r.revoked.length > 1e5 || !r.revoked.every((e) => N(e, 128))) throw Error("Invalid revocation envelope");
1682
+ let i = r.revoked, a = await f(r.token, le, t);
877
1683
  if (!a.ok) throw Error("Invalid signed revocation list");
878
1684
  let o = a.payload;
879
- if (!A(o.iat) || !A(o.exp) || o.exp <= t || o.exp <= o.iat || o.exp - o.iat > S || o.iat > t + 60 || t - o.iat > S || o.iat !== r.iat || !Array.isArray(o.revoked) || o.revoked.length !== r.revoked.length || !o.revoked.every((e, t) => k(e, 128) && e === i[t])) throw Error("Stale or inconsistent revocation list");
1685
+ if (!_e(o.iat) || !_e(o.exp) || o.exp <= t || o.exp <= o.iat || o.exp - o.iat > E || o.iat > t + 60 || t - o.iat > E || o.iat !== r.iat || !Array.isArray(o.revoked) || o.revoked.length !== r.revoked.length || !o.revoked.every((e, t) => N(e, 128) && e === i[t])) throw Error("Stale or inconsistent revocation list");
880
1686
  return {
881
1687
  revoked: r.revoked.includes(e),
882
- expires: Math.min(o.exp, o.iat + S) * 1e3
1688
+ expires: Math.min(o.exp, o.iat + E) * 1e3
883
1689
  };
884
1690
  } finally {
885
1691
  clearTimeout(r);
886
1692
  }
887
1693
  }
888
- async function ge(e = !1) {
889
- let t = le();
1694
+ async function xe(e = !1) {
1695
+ let t = he();
890
1696
  if (!e && t === "licensed") return t;
891
- if (!ae) return "not_set";
892
- if (T?.epoch === C) return T.promise;
893
- let n = C, r = ae, i = (async () => {
1697
+ if (!ue) return "not_set";
1698
+ if (A?.epoch === O) return A.promise;
1699
+ let n = O, r = ue, i = (async () => {
894
1700
  let e = "invalid_signature", t = null;
895
1701
  try {
896
- let n = de(r);
897
- if (!n || !k(n.sub)) return "invalid_signature";
898
- let i = Math.floor(Date.now() / 1e3), a = await m(r, n.sub, i);
1702
+ let n = ve(r);
1703
+ if (!n || !N(n.sub)) return "invalid_signature";
1704
+ let i = Math.floor(Date.now() / 1e3), a = await f(r, n.sub, i);
899
1705
  if (!a.ok) return a.status;
900
1706
  let o = a.payload;
901
- if (!k(o.sub) || !k(o.jti, 128) || !A(o.iat) || !A(o.exp) || o.iat > i + 60 || o.exp <= o.iat) return "invalid_signature";
1707
+ if (!N(o.sub) || !N(o.jti, 128) || !_e(o.iat) || !_e(o.exp) || o.iat > i + 60 || o.exp <= o.iat) return "invalid_signature";
902
1708
  if (![
903
1709
  "pro",
904
1710
  "team",
@@ -906,37 +1712,37 @@ async function ge(e = !1) {
906
1712
  "internal"
907
1713
  ].includes(String(o.tier))) return "wrong_tier";
908
1714
  if (o.exp <= i) return "expired";
909
- if (!Array.isArray(o.pkg) || !o.pkg.length || o.pkg.length > 32 || !o.pkg.every((e) => k(e, 128)) || !o.pkg.includes("bim") || o.pkg.includes("Polycyphers.Bim")) return "wrong_package";
910
- if (typeof o.ver != "string" || o.ver.length > 64 || !fe(o.ver)) return "wrong_version";
1715
+ if (!Array.isArray(o.pkg) || !o.pkg.length || o.pkg.length > 32 || !o.pkg.every((e) => N(e, 128)) || !o.pkg.includes("bim") || o.pkg.includes("Polycyphers.Bim")) return "wrong_package";
1716
+ if (typeof o.ver != "string" || o.ver.length > 64 || !P(o.ver)) return "wrong_version";
911
1717
  let s = typeof location > "u" ? "" : location.hostname.toLowerCase();
912
- if (!s || !Array.isArray(o.dom) || !o.dom.length || o.dom.length > 64 || !o.dom.every(j) || !o.dom.some((e) => pe(e, s))) return "wrong_domain";
913
- let c = await he(o.jti, i);
1718
+ if (!s || !Array.isArray(o.dom) || !o.dom.length || o.dom.length > 64 || !o.dom.every(ye) || !o.dom.some((e) => F(e, s))) return "wrong_domain";
1719
+ let c = await I(o.jti, i);
914
1720
  if (c.revoked) return "revoked";
915
1721
  let l = Math.min(o.exp * 1e3, c.expires);
916
1722
  return o.exp * 1e3 <= Date.now() ? "expired" : l <= Date.now() ? "unavailable" : (e = "licensed", t = {
917
- until: Math.min(l, Date.now() + ie),
1723
+ until: Math.min(l, Date.now() + D),
918
1724
  expires: l,
919
1725
  status: e
920
1726
  }, e);
921
1727
  } catch {
922
1728
  return "unavailable";
923
1729
  } finally {
924
- n === C && (w = t, oe = t?.status ?? "unavailable");
1730
+ n === O && (de = t, k = t?.status ?? "unavailable");
925
1731
  }
926
1732
  })();
927
- T = {
1733
+ A = {
928
1734
  epoch: n,
929
1735
  promise: i
930
1736
  };
931
1737
  try {
932
1738
  let e = await i;
933
- return n === C ? (oe = e, e) : le();
1739
+ return n === O ? (k = e, e) : he();
934
1740
  } finally {
935
- T?.promise === i && (T = null);
1741
+ A?.promise === i && (A = null);
936
1742
  }
937
1743
  }
938
1744
  // src/studioState.ts
939
- function _e(e, t) {
1745
+ function Se(e, t) {
940
1746
  if (typeof e.priceMinorUnits != "number" || !Number.isFinite(e.priceMinorUnits) || typeof e.currency != "string") return null;
941
1747
  try {
942
1748
  let n = new Intl.NumberFormat(t, {
@@ -948,29 +1754,29 @@ function _e(e, t) {
948
1754
  return null;
949
1755
  }
950
1756
  }
951
- function ve(e) {
1757
+ function Ce(e) {
952
1758
  return typeof e.freeProposalGenerations == "number" && typeof e.freeBimExports == "number" ? {
953
1759
  proposals: e.freeProposalGenerations,
954
1760
  exports: e.freeBimExports
955
1761
  } : null;
956
1762
  }
957
- function ye(e) {
1763
+ function L(e) {
958
1764
  return "polycyphers.bim.project.v1:" + encodeURIComponent(e);
959
1765
  }
960
- function be(e, t) {
1766
+ function we(e, t) {
961
1767
  try {
962
- let n = e.getItem(ye(t));
1768
+ let n = e.getItem(L(t));
963
1769
  return n && /^[a-f0-9]{32}$/i.test(n) ? n : null;
964
1770
  } catch {
965
1771
  return null;
966
1772
  }
967
1773
  }
968
- function xe(e, t, n) {
1774
+ function Te(e, t, n) {
969
1775
  try {
970
- n && /^[a-f0-9]{32}$/i.test(n) ? e.setItem(ye(t), n) : e.removeItem(ye(t));
1776
+ n && /^[a-f0-9]{32}$/i.test(n) ? e.setItem(L(t), n) : e.removeItem(L(t));
971
1777
  } catch {}
972
1778
  }
973
- function Se(e) {
1779
+ function Ee(e) {
974
1780
  return {
975
1781
  footprint: { edges: Array.from({ length: 4 }, (e, t) => ({
976
1782
  id: "W" + (t + 1),
@@ -1000,7 +1806,7 @@ function Se(e) {
1000
1806
  language: e
1001
1807
  };
1002
1808
  }
1003
- function Ce(e) {
1809
+ function De(e) {
1004
1810
  if (e.footprint.edges.length < 3 || e.footprint.edges.some((e) => !Number.isFinite(e.lengthM) || e.lengthM <= 0 || e.bearingDegrees !== null && !Number.isFinite(e.bearingDegrees))) return "Enter every measured wall length. Leave an unknown bearing blank.";
1005
1811
  if (e.programme) {
1006
1812
  let t = e.programme;
@@ -1016,138 +1822,138 @@ function Ce(e) {
1016
1822
  }
1017
1823
  return null;
1018
1824
  }
1019
- function we(e, t) {
1825
+ function Oe(e, t) {
1020
1826
  return !!e && !!t && e.isChanged && e.expectedVersion === t.version && e.snapshot.projectId === t.projectId;
1021
1827
  }
1022
- function Te(e) {
1828
+ function ke(e) {
1023
1829
  let t = e?.toLowerCase().split(/[-_]/)[0];
1024
1830
  return t === "de" || t === "fr" || t === "ar" ? t : "en";
1025
1831
  }
1026
- function M(e, t, n) {
1832
+ function R(e, t, n) {
1027
1833
  return n.some((e) => e.toLowerCase() === t.toLowerCase()) ? "estimated" : e.valueOrigins ? e.valueOrigins.userGivenPaths.some((e) => e.toLowerCase() === t.toLowerCase()) ? "user-given" : "estimated" : t.startsWith("programme.") ? e.programme?.source.startsWith("User-entered") ? "user-given" : "estimated" : t.startsWith("buildUps.") ? "estimated" : "user-given";
1028
1834
  }
1029
- function Ee(e, t, n) {
1030
- let r = e.valueOrigins?.userGivenPaths ?? [...e.footprint.edges.flatMap((e, t) => [...Number.isFinite(e.lengthM) ? [`footprint.edges[${t}].lengthM`] : [], ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]]), ...Object.entries(e.programme ?? {}).filter(([, e]) => typeof e == "number" && Number.isFinite(e)).map(([e]) => "programme." + e)].filter((t) => M(e, t, n) === "user-given");
1835
+ function z(e, t, n) {
1836
+ let r = e.valueOrigins?.userGivenPaths ?? [...e.footprint.edges.flatMap((e, t) => [...Number.isFinite(e.lengthM) ? [`footprint.edges[${t}].lengthM`] : [], ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]]), ...Object.entries(e.programme ?? {}).filter(([, e]) => typeof e == "number" && Number.isFinite(e)).map(([e]) => "programme." + e)].filter((t) => R(e, t, n) === "user-given");
1031
1837
  return {
1032
1838
  ...e,
1033
1839
  valueOrigins: { userGivenPaths: [...r.filter((e) => e.toLowerCase() !== t.toLowerCase()), t] }
1034
1840
  };
1035
1841
  }
1036
1842
  // src/BimStudio.tsx
1037
- var N = e("baulynq"), De = () => location.pathname === "/verify-email" || location.pathname === "/verify", P = () => crypto.randomUUID().replaceAll("-", "");
1038
- function Oe() {
1039
- let e = n(N);
1040
- return /* @__PURE__ */ l("span", {
1843
+ var B = t("baulynq"), Ae = () => location.pathname === "/verify-email" || location.pathname === "/verify", V = () => crypto.randomUUID().replaceAll("-", "");
1844
+ function je() {
1845
+ let e = r(B);
1846
+ return /* @__PURE__ */ u("span", {
1041
1847
  className: "brand",
1042
- children: [/* @__PURE__ */ c("svg", {
1848
+ children: [/* @__PURE__ */ l("svg", {
1043
1849
  viewBox: "0 0 28 28",
1044
1850
  "aria-hidden": "true",
1045
- children: /* @__PURE__ */ c("path", { d: "M4 23V5h13v7h7v11H4m7 0V12h6m0 0V5" })
1046
- }), /* @__PURE__ */ l("strong", { children: [e === "karamentreprises" ? "Karamentreprises" : "BauLynq", /* @__PURE__ */ c("span", { children: e === "karamentreprises" ? "BIM" : "Vision" })] })]
1851
+ children: /* @__PURE__ */ l("path", { d: "M4 23V5h13v7h7v11H4m7 0V12h6m0 0V5" })
1852
+ }), /* @__PURE__ */ u("strong", { children: [e === "karamentreprises" ? "Karamentreprises" : "BauLynq", /* @__PURE__ */ l("span", { children: e === "karamentreprises" ? "BIM" : "Vision" })] })]
1047
1853
  });
1048
1854
  }
1049
- function ke() {
1050
- return /* @__PURE__ */ c("span", {
1855
+ function H() {
1856
+ return /* @__PURE__ */ l("span", {
1051
1857
  "aria-hidden": "true",
1052
1858
  children: "↗"
1053
1859
  });
1054
1860
  }
1055
- function Ae() {
1056
- return /* @__PURE__ */ l("svg", {
1861
+ function U() {
1862
+ return /* @__PURE__ */ u("svg", {
1057
1863
  viewBox: "0 0 450 340",
1058
1864
  role: "img",
1059
1865
  "aria-label": "Illustrative hand sketch of the reference footprint",
1060
1866
  children: [
1061
- /* @__PURE__ */ c("defs", { children: /* @__PURE__ */ c("pattern", {
1867
+ /* @__PURE__ */ l("defs", { children: /* @__PURE__ */ l("pattern", {
1062
1868
  id: "sketchgrid",
1063
1869
  width: "16",
1064
1870
  height: "16",
1065
1871
  patternUnits: "userSpaceOnUse",
1066
- children: /* @__PURE__ */ c("path", {
1872
+ children: /* @__PURE__ */ l("path", {
1067
1873
  d: "M16 0H0V16",
1068
1874
  fill: "none",
1069
1875
  stroke: "#e9e4d8",
1070
1876
  strokeWidth: ".5"
1071
1877
  })
1072
1878
  }) }),
1073
- /* @__PURE__ */ c("rect", {
1879
+ /* @__PURE__ */ l("rect", {
1074
1880
  width: "450",
1075
1881
  height: "340",
1076
1882
  fill: "url(#sketchgrid)"
1077
1883
  }),
1078
- /* @__PURE__ */ l("g", {
1884
+ /* @__PURE__ */ u("g", {
1079
1885
  transform: "translate(66 53) rotate(-4 140 110)",
1080
1886
  fill: "none",
1081
1887
  stroke: "#77776e",
1082
1888
  strokeWidth: "2.2",
1083
1889
  strokeLinecap: "round",
1084
1890
  children: [
1085
- /* @__PURE__ */ c("path", { d: "M12 233L255 235l-1-37 56 1-2-159-19-17L18 22Z" }),
1086
- /* @__PURE__ */ c("path", {
1891
+ /* @__PURE__ */ l("path", { d: "M12 233L255 235l-1-37 56 1-2-159-19-17L18 22Z" }),
1892
+ /* @__PURE__ */ l("path", {
1087
1893
  d: "M13 232L17 21l272 4 19 14 2 160-55-2v36Z",
1088
1894
  opacity: ".4"
1089
1895
  }),
1090
- /* @__PURE__ */ c("path", {
1896
+ /* @__PURE__ */ l("path", {
1091
1897
  d: "M129 232V115h178M130 154h74v77",
1092
1898
  strokeDasharray: "5 7"
1093
1899
  }),
1094
- /* @__PURE__ */ c("path", {
1900
+ /* @__PURE__ */ l("path", {
1095
1901
  d: "M324 70v72m-5-7 5 8 5-8",
1096
1902
  stroke: "#328577"
1097
1903
  })
1098
1904
  ]
1099
1905
  }),
1100
- /* @__PURE__ */ l("g", {
1906
+ /* @__PURE__ */ u("g", {
1101
1907
  fontFamily: "monospace",
1102
1908
  fontSize: "15",
1103
1909
  fill: "#72756e",
1104
1910
  transform: "rotate(-4 200 170)",
1105
1911
  children: [
1106
- /* @__PURE__ */ l("text", {
1912
+ /* @__PURE__ */ u("text", {
1107
1913
  x: "145",
1108
1914
  y: "62",
1109
- children: ["8.34", /* @__PURE__ */ c("tspan", {
1915
+ children: ["8.34", /* @__PURE__ */ l("tspan", {
1110
1916
  fontSize: "7",
1111
1917
  children: " [user-given]"
1112
1918
  })]
1113
1919
  }),
1114
- /* @__PURE__ */ l("text", {
1920
+ /* @__PURE__ */ u("text", {
1115
1921
  x: "165",
1116
1922
  y: "318",
1117
- children: ["7.40", /* @__PURE__ */ c("tspan", {
1923
+ children: ["7.40", /* @__PURE__ */ l("tspan", {
1118
1924
  fontSize: "7",
1119
1925
  children: " [user-given]"
1120
1926
  })]
1121
1927
  }),
1122
- /* @__PURE__ */ l("text", {
1928
+ /* @__PURE__ */ u("text", {
1123
1929
  x: "21",
1124
1930
  y: "172",
1125
1931
  transform: "rotate(-90 21 172)",
1126
- children: ["6.40", /* @__PURE__ */ c("tspan", {
1932
+ children: ["6.40", /* @__PURE__ */ l("tspan", {
1127
1933
  fontSize: "7",
1128
1934
  children: " [user-given]"
1129
1935
  })]
1130
1936
  }),
1131
- /* @__PURE__ */ l("text", {
1937
+ /* @__PURE__ */ u("text", {
1132
1938
  x: "387",
1133
1939
  y: "153",
1134
1940
  transform: "rotate(90 387 153)",
1135
- children: ["4.81", /* @__PURE__ */ c("tspan", {
1941
+ children: ["4.81", /* @__PURE__ */ l("tspan", {
1136
1942
  fontSize: "7",
1137
1943
  children: " [user-given]"
1138
1944
  })]
1139
1945
  }),
1140
- /* @__PURE__ */ l("text", {
1946
+ /* @__PURE__ */ u("text", {
1141
1947
  x: "307",
1142
1948
  y: "282",
1143
- children: ["1.70", /* @__PURE__ */ c("tspan", {
1949
+ children: ["1.70", /* @__PURE__ */ l("tspan", {
1144
1950
  fontSize: "7",
1145
1951
  children: " [user-given]"
1146
1952
  })]
1147
1953
  })
1148
1954
  ]
1149
1955
  }),
1150
- /* @__PURE__ */ c("text", {
1956
+ /* @__PURE__ */ l("text", {
1151
1957
  x: "29",
1152
1958
  y: "32",
1153
1959
  fontFamily: "monospace",
@@ -1158,231 +1964,257 @@ function Ae() {
1158
1964
  ]
1159
1965
  });
1160
1966
  }
1161
- function je(e = {}) {
1162
- let n = e.brand ?? "baulynq", i = Te(e.language ?? e.initialInput?.language ?? (typeof navigator > "u" ? "en" : navigator.language)), [o, s] = a("checking"), [u, d] = a(0);
1163
- r(() => {
1164
- let e = !0, t = !1, r = !1;
1165
- se(n);
1967
+ function Me(e = {}) {
1968
+ let t = e.brand ?? "baulynq", r = ke(e.language ?? e.initialInput?.language ?? (typeof navigator > "u" ? "en" : navigator.language)), [a, s] = o("checking"), [c, ee] = o(0);
1969
+ i(() => {
1970
+ let e = !0, n = !1, r = !1;
1971
+ j(t);
1166
1972
  let i = async () => {
1167
- if (t) r = !0;
1973
+ if (n) r = !0;
1168
1974
  else {
1169
- t = !0;
1975
+ n = !0;
1170
1976
  try {
1171
- let t = await ge(!0);
1977
+ let t = await xe(!0);
1172
1978
  e && s(t);
1173
1979
  } catch {
1174
1980
  e && s("unavailable");
1175
1981
  } finally {
1176
- t = !1, r && e && (r = !1, i());
1982
+ n = !1, r && e && (r = !1, i());
1177
1983
  }
1178
1984
  }
1179
1985
  };
1180
1986
  i();
1181
- let a = O(() => {
1987
+ let a = me(() => {
1182
1988
  e && s("checking"), i();
1183
1989
  }), o = setInterval(() => {
1184
1990
  i();
1185
1991
  }, 3e4), c = setInterval(() => {
1186
- let t = le();
1992
+ let t = he();
1187
1993
  e && t !== "licensed" && s(t);
1188
1994
  }, 1e3);
1189
1995
  return () => {
1190
1996
  e = !1, clearInterval(o), clearInterval(c), a();
1191
1997
  };
1192
- }, [n, u]);
1193
- let f = t(async (t, n) => {
1194
- let r = await ge(), i = le();
1998
+ }, [t, c]);
1999
+ let te = n(async (t, n) => {
2000
+ let r = await xe(), i = he();
1195
2001
  if (r !== "licensed" || i !== "licensed") throw s(i), new DOMException("A valid component license is required.", "AbortError");
1196
2002
  return e.transport ? e.transport(t, n) : fetch("/v1" + t, n);
1197
- }, [e.transport]), p = o === "licensed";
1198
- return /* @__PURE__ */ c(N.Provider, {
1199
- value: n,
1200
- children: p ? /* @__PURE__ */ c(Me, {
2003
+ }, [e.transport]), d = a === "licensed";
2004
+ return /* @__PURE__ */ l(B.Provider, {
2005
+ value: t,
2006
+ children: d ? /* @__PURE__ */ l(W, {
1201
2007
  ...e,
1202
- transport: f
1203
- }, e.embedded ? e.workspaceKey ?? "unscoped" : "public") : /* @__PURE__ */ l("section", {
2008
+ transport: te
2009
+ }, e.embedded ? e.workspaceKey ?? "unscoped" : "public") : /* @__PURE__ */ u("section", {
1204
2010
  className: "bim-studio bim-license-gate",
1205
- dir: i === "ar" ? "rtl" : "ltr",
2011
+ dir: r === "ar" ? "rtl" : "ltr",
1206
2012
  "aria-label": "Component licensing",
1207
2013
  children: [
1208
- /* @__PURE__ */ c(Oe, {}),
1209
- /* @__PURE__ */ c("h1", { children: v(i, o === "checking" ? "Verifying component license…" : "A valid component license is required") }),
1210
- /* @__PURE__ */ l("p", { children: [
1211
- n === "karamentreprises" ? "Karamentreprises BIM" : "BauLynq Vision",
2014
+ /* @__PURE__ */ l(je, {}),
2015
+ /* @__PURE__ */ l("h1", { children: g(r, a === "checking" ? "Verifying component license…" : "A valid component license is required") }),
2016
+ /* @__PURE__ */ u("p", { children: [
2017
+ t === "karamentreprises" ? "Karamentreprises BIM" : "BauLynq Vision",
1212
2018
  " · ",
1213
- o
2019
+ a
1214
2020
  ] }),
1215
- /* @__PURE__ */ c("p", { children: v(i, "The studio stays closed until its installation license and signed revocation status are verified.") }),
1216
- o !== "checking" && /* @__PURE__ */ c("button", {
2021
+ /* @__PURE__ */ l("p", { children: g(r, "The studio stays closed until its installation license and signed revocation status are verified.") }),
2022
+ a !== "checking" && /* @__PURE__ */ l("button", {
1217
2023
  className: "outline",
1218
- onClick: () => d((e) => e + 1),
1219
- children: v(i, "Check license again")
2024
+ onClick: () => ee((e) => e + 1),
2025
+ children: g(r, "Check license again")
1220
2026
  }),
1221
- /* @__PURE__ */ l("a", {
1222
- href: n === "karamentreprises" ? "https://packages.karamentreprises.com/bim" : "https://packages.polycyphers.com/bim",
1223
- children: [v(i, "License management"), " ↗"]
2027
+ /* @__PURE__ */ u("a", {
2028
+ href: t === "karamentreprises" ? "https://packages.karamentreprises.com/bim" : "https://packages.polycyphers.com/bim",
2029
+ children: [g(r, "License management"), " ↗"]
1224
2030
  })
1225
2031
  ]
1226
2032
  })
1227
2033
  });
1228
2034
  }
1229
- function Me({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: u, language: d, onStateChange: f, brand: p = "baulynq" } = {}) {
1230
- let [m, h] = a(() => Te(d ?? n?.language ?? (typeof navigator > "u" ? "en" : navigator.language))), [_, te] = a(e || location.pathname === "/studio" ? "studio" : "home"), [ne, y] = a("measure"), [b, re] = a(null), [x, S] = a(n ?? null), [ie, ae] = a("A"), [C, oe] = a(!1), [w, T] = a(""), [E, se] = a(""), [ce, D] = a(""), [O, ue] = a(null), [k, A] = a(null), [de, fe] = a(null), [j, pe] = a(""), [me, he] = a(!e && De()), [ge, ye] = a(""), [M, Ee] = a(""), [N, je] = a({}), [Me, Ie] = a(!1), [I, Le] = a(De() ? "verify" : "login"), [Re, ze] = a(() => De() ? new URLSearchParams(location.search).get("token") ?? "" : ""), [Be, Ve] = a(), [He, Ue] = a(null), [L, R] = a(null), [z, We] = a(null), [Ge, Ke] = a(""), [B, qe] = a(null), [Je, Ye] = a([]), [Xe, Ze] = a(!1), [Qe, $e] = a(!1), [et, tt] = a(!1), [nt, rt] = a(null), [it, at] = a(null), [ot, st] = a(null), [ct, lt] = a(!1), [ut, dt] = a(1), [ft, pt] = a(1), [mt, ht] = a(!1), [gt, _t] = a(!1), [vt, yt] = a(!1), [V, bt] = a(null), [xt, St] = a(!1), [Ct, wt] = a([]), [Tt, Et] = a([]), [Dt, Ot] = a(!1), [kt, At] = a([]), [jt, Mt] = a(), Nt = i(null), Pt = i(!1), Ft = i(!0), H = i(0), It = i(""), Lt = i(void 0), Rt = i(u), U = g[m], W = u ?? Be, zt = i(f), Bt = mt || !!E.trim() || !!L || !!z && !B || xt;
1231
- r(() => {
1232
- zt.current = f;
1233
- }, [f]), r(() => {
1234
- zt.current?.({
1235
- busy: C,
1236
- hasUnsavedChanges: Bt
2035
+ function W({ enableExistingPlanReview: e = !1, embedded: t = !1, transport: r, initialInput: ee, workspaceKey: te, language: d, onStateChange: ne, brand: f = "baulynq" } = {}) {
2036
+ let [p, h] = o(() => ke(d ?? ee?.language ?? (typeof navigator > "u" ? "en" : navigator.language))), [ie, ae] = o(t || location.pathname === "/studio" ? "studio" : "home"), [oe, _] = o("measure"), [v, se] = o(null), [y, b] = o(ee ?? null), [ce, S] = o("A"), [C, w] = o(!1), [le, T] = o(""), [E, D] = o(""), [ue, O] = o(""), [k, de] = o(null), [A, fe] = o(null), [j, pe] = o(null), [M, me] = o(""), [ge, N] = o(!t && Ae()), [_e, ve] = o(""), [P, ye] = o(""), [F, be] = o({}), [I, xe] = o(!1), [L, R] = o(Ae() ? "verify" : "login"), [z, B] = o(() => Ae() ? new URLSearchParams(location.search).get("token") ?? "" : ""), [Me, W] = o(), [Fe, Ie] = o(null), [q, Le] = o(null), [J, Re] = o(null), [ze, Be] = o(""), [Ve, He] = o(null), [Ue, We] = o([]), [Ge, Ke] = o(!1), [qe, Je] = o(!1), [Ye, Xe] = o(!1), [Ze, Qe] = o(null), [$e, et] = o(null), [tt, nt] = o(null), [rt, it] = o(!1), [at, ot] = o(1), [st, ct] = o(1), [lt, ut] = o(!1), [dt, ft] = o(!1), [pt, mt] = o(!1), [ht, gt] = o(null), [_t, vt] = o(!1), [yt, bt] = o([]), [xt, St] = o([]), [Ct, wt] = o(null), Tt = a(null), Et = n((e) => {
2037
+ Tt.current = e;
2038
+ }, []), [Dt, Ot] = o(!1), [kt, At] = o([]), [jt, Mt] = o(), Nt = a(null), Pt = a(!1), Ft = a(!0), Y = a(0), It = a(""), Lt = a(void 0), Rt = a(te), X = m[p], zt = te ?? Me, [Bt, Vt] = o(!1), [Ht, Ut] = o({
2039
+ busy: !1,
2040
+ hasUnsavedChanges: !1
2041
+ }), Wt = n((e) => Ut(e), []), Gt = a(ne), Kt = Ht.hasUnsavedChanges || lt || !!q || _t, qt = Kt || !!E.trim() || !!J && !Ve;
2042
+ i(() => {
2043
+ Gt.current = ne;
2044
+ }, [ne]), i(() => {
2045
+ Gt.current?.({
2046
+ busy: C || Ht.busy,
2047
+ hasUnsavedChanges: qt
1237
2048
  });
1238
- }, [C, Bt]), r(() => () => {
1239
- zt.current?.({
2049
+ }, [
2050
+ C,
2051
+ Ht.busy,
2052
+ qt
2053
+ ]), i(() => () => {
2054
+ Gt.current?.({
1240
2055
  busy: !1,
1241
2056
  hasUnsavedChanges: !1
1242
2057
  });
1243
- }, []), r(() => {
1244
- at(null), st(null), dt(Math.max(1, (b?.version ?? 1) - 1)), pt(b?.version ?? 1), b || lt(!1);
1245
- }, [b?.projectId, b?.version]);
1246
- let G = L?.snapshot ?? b, K = G?.proposals.find((e) => e.id === ie) ?? G?.proposals[0], Vt = _e(N, m), Ht = ve(N), Ut = typeof N.checkoutAvailable == "boolean" ? N.checkoutAvailable : N.checkoutEnabled === !0, q = [
2058
+ }, []), i(() => {
2059
+ et(null), nt(null), ot(Math.max(1, (v?.version ?? 1) - 1)), ct(v?.version ?? 1), v || it(!1);
2060
+ }, [v?.projectId, v?.version]);
2061
+ let Jt = q?.snapshot ?? v, Z = Jt?.proposals.find((e) => e.id === ce) ?? Jt?.proposals[0], Yt = Se(F, p), Xt = Ce(F), Zt = typeof F.checkoutAvailable == "boolean" ? F.checkoutAvailable : F.checkoutEnabled === !0, Qt = [
1247
2062
  "paidRegenerations",
1248
2063
  "chatRefinementsPerProject",
1249
2064
  "exportsPerPaidProject"
1250
- ].every((e) => typeof N[e] == "number" && Number.isInteger(N[e]) && Number(N[e]) >= 0) ? {
1251
- regenerations: Number(N.paidRegenerations),
1252
- chat: Number(N.chatRefinementsPerProject),
1253
- exports: Number(N.exportsPerPaidProject)
2065
+ ].every((e) => typeof F[e] == "number" && Number.isInteger(F[e]) && Number(F[e]) >= 0) ? {
2066
+ regenerations: Number(F.paidRegenerations),
2067
+ chat: Number(F.chatRefinementsPerProject),
2068
+ exports: Number(F.exportsPerPaidProject)
1254
2069
  } : null;
1255
- r(() => (Ft.current = !0, () => {
1256
- Ft.current = !1, H.current++;
2070
+ i(() => (Ft.current = !0, () => {
2071
+ Ft.current = !1, Y.current++;
1257
2072
  }), []);
1258
- function J(e) {
1259
- let t = le();
1260
- if (!Ft.current || e !== H.current || t !== "licensed") throw new DOMException("The verified session changed.", "AbortError");
2073
+ function $t(e) {
2074
+ let t = he();
2075
+ if (!Ft.current || e !== Y.current || t !== "licensed") throw new DOMException("The verified session changed.", "AbortError");
1261
2076
  }
1262
- async function Wt(n, r) {
1263
- let i = H.current;
1264
- J(i);
1265
- let a = new Headers(r?.headers).get("Authorization");
1266
- if (!e && n !== "/session" && a && a !== "Bearer " + It.current) throw new DOMException("The verified session changed.", "AbortError");
1267
- let o = await (t ? t(n, r) : fetch("/v1" + n, r));
1268
- if (n !== "/config" && J(i), !e && o.status === 401 && !n.startsWith("/account/")) throw Kt(), Le("login"), he(!0), T("Sign in with a verified account to continue."), new DOMException("The verified session expired.", "AbortError");
2077
+ async function en(e, n) {
2078
+ let i = Y.current;
2079
+ $t(i);
2080
+ let a = new Headers(n?.headers).get("Authorization");
2081
+ if (!t && e !== "/session" && a && a !== "Bearer " + It.current) throw new DOMException("The verified session changed.", "AbortError");
2082
+ let o = await (r ? r(e, n) : fetch("/v1" + e, n));
2083
+ if (e !== "/config" && $t(i), !t && o.status === 401 && !e.startsWith("/account/")) throw nn(), R("login"), N(!0), T("Sign in with a verified account to continue."), new DOMException("The verified session expired.", "AbortError");
1269
2084
  return o;
1270
2085
  }
1271
- function Gt() {
1272
- ht(!1), yt(!1), T(""), D(""), _t(!1), rt(null), Ye([]), At([]), Mt(void 0), bt(null), St(!1), wt([]), Ze(!1), $e(!1), se(""), re(null), Et([]), S(null), R(null), We(null), fe(null), A(null), ue(null), qe(null), Ue(null), tt(!1);
2086
+ function tn() {
2087
+ wt(null), Tt.current = null, Vt(!1), Ut({
2088
+ busy: !1,
2089
+ hasUnsavedChanges: !1
2090
+ }), ut(!1), mt(!1), T(""), O(""), ft(!1), Qe(null), We([]), At([]), Mt(void 0), gt(null), vt(!1), bt([]), Ke(!1), Je(!1), D(""), se(null), St([]), b(null), Le(null), Re(null), pe(null), fe(null), de(null), He(null), Ie(null), Xe(!1);
1273
2091
  }
1274
- function Kt() {
1275
- (b || Lt.current) && Gt(), H.current++, It.current = "", Lt.current = void 0, pe(""), Ve(void 0);
2092
+ function nn() {
2093
+ (v || Lt.current) && tn(), Y.current++, It.current = "", Lt.current = void 0, me(""), W(void 0);
1276
2094
  }
1277
- async function Y(t, n, r) {
1278
- let i = H.current, a = await Wt(t, {
2095
+ async function Q(e, n, r) {
2096
+ let i = Y.current, a = await en(e, {
1279
2097
  method: r ?? (n ? "POST" : "GET"),
1280
2098
  headers: {
1281
2099
  ...n ? { "Content-Type": "application/json" } : {},
1282
- ...!e && j ? { Authorization: "Bearer " + j } : {}
2100
+ ...!t && M ? { Authorization: "Bearer " + M } : {}
1283
2101
  },
1284
2102
  body: n ? JSON.stringify(n) : void 0
1285
2103
  });
1286
2104
  if (!a.ok) {
1287
- let n = "The service is temporarily unavailable.";
2105
+ let n = "The service is temporarily unavailable.", r = {};
1288
2106
  try {
1289
2107
  let e = await a.json();
1290
- n = e.detail ?? e.title ?? e.error ?? n;
2108
+ e && typeof e == "object" && !Array.isArray(e) && (r = e), n = String(r.detail ?? r.title ?? r.error ?? n);
1291
2109
  } catch {}
1292
- throw J(i), a.status === 401 && (e || (Kt(), t.startsWith("/account/") || Le("login"), he(!0)), n = e ? "Your app session needs attention. Sign in again through your app." : "Sign in with a verified account to continue."), a.status === 402 && qt("paywall"), Error(n);
2110
+ $t(i), a.status === 401 && (t || (nn(), e.startsWith("/account/") || R("login"), N(!0)), n = t ? "Your app session needs attention. Sign in again through your app." : "Sign in with a verified account to continue.");
2111
+ let o = /^\/projects\/([a-f0-9]{32})\//.exec(e)?.[1];
2112
+ throw !t && a.status === 402 && r.code === "project_quota_exceeded" && o && [
2113
+ "operation_cap",
2114
+ "free_tier_unavailable",
2115
+ "provider_cost_cap"
2116
+ ].includes(String(r.reason)) && typeof r.projectPaid == "boolean" && typeof r.canPurchase == "boolean" && (wt({
2117
+ projectId: o,
2118
+ projectPaid: r.projectPaid,
2119
+ canPurchase: r.canPurchase,
2120
+ reason: String(r.reason)
2121
+ }), r.canPurchase && !r.projectPaid && rn("paywall")), Error(n);
1293
2122
  }
1294
2123
  let o = a.status === 204 ? null : await a.json();
1295
- return J(i), o;
2124
+ return $t(i), o;
1296
2125
  }
1297
- async function qt(t, n = Dt) {
1298
- if (!(e || N.analyticsEnabled !== !0)) try {
1299
- await Wt("/analytics/events", {
2126
+ async function rn(e, n = Dt) {
2127
+ if (!(t || F.analyticsEnabled !== !0)) try {
2128
+ await en("/analytics/events", {
1300
2129
  method: "POST",
1301
2130
  headers: {
1302
2131
  "Content-Type": "application/json",
1303
- ...j ? { Authorization: "Bearer " + j } : {}
2132
+ ...M ? { Authorization: "Bearer " + M } : {}
1304
2133
  },
1305
2134
  body: JSON.stringify({
1306
- eventId: P(),
1307
- kind: t,
2135
+ eventId: V(),
2136
+ kind: e,
1308
2137
  consentGranted: n
1309
2138
  })
1310
2139
  });
1311
2140
  } catch {}
1312
2141
  }
1313
- function Jt(e) {
1314
- Ot(e), qt("visit", e);
2142
+ function an(e) {
2143
+ Ot(e), rn("visit", e);
1315
2144
  }
1316
- r(() => {
1317
- d !== void 0 && h(Te(d));
1318
- }, [d]), r(() => {
1319
- e || (document.documentElement.lang = m, document.documentElement.dir = m === "ar" ? "rtl" : "ltr");
1320
- }, [m, e]), r(() => {
2145
+ i(() => {
2146
+ d !== void 0 && h(ke(d));
2147
+ }, [d]), i(() => {
2148
+ t || (document.documentElement.lang = p, document.documentElement.dir = p === "ar" ? "rtl" : "ltr");
2149
+ }, [p, t]), i(() => {
1321
2150
  let e = !0;
1322
- return Wt("/config").then((e) => e.ok ? e.json() : Promise.reject()).then((t) => {
1323
- e && je(t);
2151
+ return en("/config").then((e) => e.ok ? e.json() : Promise.reject()).then((t) => {
2152
+ e && be(t);
1324
2153
  }).catch(() => {}), () => {
1325
2154
  e = !1;
1326
2155
  };
1327
- }, [t]), r(() => {
1328
- !e && De() && history.replaceState({}, "", location.pathname);
1329
- }, [e]), r(() => {
1330
- if (!z) {
1331
- Ke("");
2156
+ }, [r]), i(() => {
2157
+ !t && Ae() && history.replaceState({}, "", location.pathname);
2158
+ }, [t]), i(() => {
2159
+ if (!J) {
2160
+ Be("");
1332
2161
  return;
1333
2162
  }
1334
- let e = URL.createObjectURL(z);
1335
- return Ke(e), () => URL.revokeObjectURL(e);
1336
- }, [z]), r(() => {
1337
- e && Rt.current !== u && (H.current++, Gt(), Rt.current = u);
1338
- }, [u, e]), r(() => {
1339
- if (!W) return;
1340
- let e = be(localStorage, W);
1341
- if (Ue(e), !e || x || b) return;
2163
+ let e = URL.createObjectURL(J);
2164
+ return Be(e), () => URL.revokeObjectURL(e);
2165
+ }, [J]), i(() => {
2166
+ t && Rt.current !== te && (Y.current++, tn(), Rt.current = te);
2167
+ }, [te, t]), i(() => {
2168
+ if (!zt) return;
2169
+ let e = we(localStorage, zt);
2170
+ if (Ie(e), !e || y || v) return;
1342
2171
  let t = !0;
1343
- return Y("/projects/" + e).then((e) => {
1344
- t && (X(e), y(e.input.isDraft ? "measure" : "proposals"));
2172
+ return Q("/projects/" + e).then((e) => {
2173
+ t && (on(e), _(e.input.isDraft ? "measure" : "proposals"));
1345
2174
  }).catch((e) => {
1346
2175
  t && T(e instanceof Error ? e.message : "Could not resume the project.");
1347
2176
  }), () => {
1348
2177
  t = !1;
1349
2178
  };
1350
- }, [W]);
1351
- function X(e) {
1352
- J(H.current), rt(e.reconciliation), tt(!1), e.input.isDraft || (ht(!1), St(!1)), e.input.isDraft || wt([]), re(e), S(e.input.isDraft ? x ?? Se(m) : e.input), ae(e.selectedProposalId ?? e.proposals.find((e) => e.recommended)?.id ?? "A"), fe(null), A(null), ue(null), R(null), W && (xe(localStorage, W, e.projectId), Ue(e.projectId));
2179
+ }, [zt]);
2180
+ function on(t) {
2181
+ Ct?.projectId !== t.projectId && wt(null), $t(Y.current), Qe(t.reconciliation), Xe(!1), t.input.isDraft || (ut(!1), vt(!1)), t.input.isDraft || bt([]), se(t), b(t.pendingDraft?.input ? {
2182
+ ...t.pendingDraft.input,
2183
+ isDraft: !1
2184
+ } : t.input.isDraft ? y ?? Ee(p) : t.input), Vt(e && (t.pendingDraft?.workflow ?? t.workflow) === "existing-plan"), t.pendingDraft && (t.pendingDraft.input && ut(!1), He(t.pendingDraft.sourceObjectId ?? null), D(t.pendingDraft.brief ?? "")), S(t.selectedProposalId ?? t.proposals.find((e) => e.recommended)?.id ?? "A"), pe(null), fe(null), de(null), Le(null), zt && (Te(localStorage, zt, t.projectId), Ie(t.projectId));
1353
2185
  }
1354
- async function Z(e) {
1355
- if (!Pt.current) {
1356
- Pt.current = !0, oe(!0), T("");
2186
+ async function $(e) {
2187
+ if (!(Pt.current || Ht.busy)) {
2188
+ Pt.current = !0, w(!0), T("");
1357
2189
  try {
1358
2190
  await e();
1359
2191
  } catch (e) {
1360
2192
  e instanceof DOMException && e.name === "AbortError" || T(e instanceof Error ? e.message : "Please try again.");
1361
2193
  } finally {
1362
- Pt.current = !1, oe(!1);
2194
+ Pt.current = !1, w(!1);
1363
2195
  }
1364
2196
  }
1365
2197
  }
1366
- function Q(t) {
1367
- yt(!1), te(t), e || history.pushState({}, "", t === "home" ? "/" : "/studio"), window.scrollTo(0, 0);
2198
+ function sn(e) {
2199
+ mt(!1), ae(e), t || history.pushState({}, "", e === "home" ? "/" : "/studio"), window.scrollTo(0, 0);
1368
2200
  }
1369
- function Yt(e = !1) {
1370
- ht(!1), e || We(null), Ze(!1), $e(!1), Ye([]), At([]), Mt(void 0), bt(null), St(!1), wt([]), se(""), re(null), Et([]), S(Se(m)), R(null), fe(null), A(null), ue(null), tt(!1), rt(null), qe(null), y("measure"), Q("studio");
2201
+ function cn(e = !1) {
2202
+ Ht.busy || Ht.hasUnsavedChanges || (wt(null), Tt.current = null, Vt(!1), ut(!1), e || Re(null), Ke(!1), Je(!1), We([]), At([]), Mt(void 0), gt(null), vt(!1), bt([]), D(""), se(null), St([]), b(Ee(p)), Le(null), pe(null), fe(null), de(null), Xe(!1), Qe(null), He(null), _("measure"), sn("studio"));
1371
2203
  }
1372
- async function Xt() {
1373
- N.mode === "local-demo" ? (Q("studio"), await Z(async () => {
1374
- let e = await Y("/reference?language=" + m);
1375
- S(e), ht(!1), tt(!1), y("measure"), D("Reference example loaded. Review its site-confirmed dimensions before generating.");
1376
- })) : Yt();
2204
+ async function ln() {
2205
+ F.mode === "local-demo" ? (sn("studio"), await $(async () => {
2206
+ let e = await Q("/reference?language=" + p);
2207
+ b(e), ut(!1), Xe(!1), _("measure"), O("Reference example loaded. Review its site-confirmed dimensions before generating.");
2208
+ })) : cn();
1377
2209
  }
1378
- async function Zt(t, n) {
1379
- let r = H.current;
1380
- if (!Xe || !Qe) throw Error("Review the image permissions and AI disclosure before upload.");
2210
+ async function un(e, n) {
2211
+ let r = Y.current;
2212
+ if (!Ge || !qe) throw Error("Review the image permissions and AI disclosure before upload.");
1381
2213
  let i = new FormData();
1382
2214
  i.append("file", n), i.append("rightsAcknowledged", "true"), i.append("aiProcessingAcknowledged", "true");
1383
- let a = await Wt(`/projects/${t.projectId}/uploads`, {
2215
+ let a = await en(`/projects/${e.projectId}/uploads`, {
1384
2216
  method: "POST",
1385
- headers: !e && j ? { Authorization: "Bearer " + j } : {},
2217
+ headers: !t && M ? { Authorization: "Bearer " + M } : {},
1386
2218
  body: i
1387
2219
  });
1388
2220
  if (!a.ok) {
@@ -1391,63 +2223,94 @@ function Me({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: u,
1391
2223
  let t = await a.json();
1392
2224
  e = t.detail ?? t.title ?? t.error ?? e;
1393
2225
  } catch {}
1394
- throw J(r), Error(e);
2226
+ throw $t(r), Error(e);
1395
2227
  }
1396
2228
  let o = await a.json();
1397
- J(r), qe(o.upload.id), D("Sketch stored privately. Reading produces observations to confirm, never unchecked dimensions.");
2229
+ return $t(r), He(o.upload.id), O("Sketch stored privately. Reading produces observations to confirm, never unchecked dimensions."), o.upload.id;
2230
+ }
2231
+ async function dn(e, t = v?.version ?? 0, n = v?.projectId ?? V()) {
2232
+ if (e.input) {
2233
+ let t = De(e.input);
2234
+ if (t) throw Error(t);
2235
+ }
2236
+ let r = await Q("/drafts", {
2237
+ projectId: n,
2238
+ operationId: V(),
2239
+ expectedVersion: t,
2240
+ pendingDraft: {
2241
+ ...e,
2242
+ brief: E
2243
+ }
2244
+ });
2245
+ if (r.projectId !== n || r.version !== t + 1 || r.pendingDraft?.workflow !== e.workflow) throw Error("Pending work could not be saved by this service. Checkout and generation are stopped; keep this page open.");
2246
+ return r;
1398
2247
  }
1399
- async function Qt() {
1400
- x && await Z(async () => {
1401
- let e = Ce(x);
2248
+ function fn(e) {
2249
+ on(e), _("measure");
2250
+ }
2251
+ async function pn() {
2252
+ y && await $(async () => {
2253
+ let e = De(y);
1402
2254
  if (e) throw Error(e);
1403
- if (z && !B && (!Xe || !Qe)) throw Error("Review the image permissions and AI disclosure, or remove the local image.");
1404
- if (!et) throw Error("Confirm the measured dimensions and bearings before generating.");
1405
- let t = {
1406
- ...x,
1407
- language: m
1408
- }, n = await Y("/footprints/reconcile", t.footprint);
1409
- if (rt(n), n.status !== "Unique") throw Error(n.findings.map((e) => e.message).join(" ") || "The footprint needs another confirmed measurement.");
1410
- let r = b ? await Y(`/projects/${b.projectId}/edits`, {
1411
- expectedVersion: b.version,
1412
- operationId: P(),
2255
+ if (J && !Ve && (!Ge || !qe)) throw Error("Review the image permissions and AI disclosure, or remove the local image.");
2256
+ if (!Ye) throw Error("Confirm the measured dimensions and bearings before generating.");
2257
+ let n = {
2258
+ ...y,
2259
+ isDraft: !1,
2260
+ language: p
2261
+ }, r = await Q("/footprints/reconcile", n.footprint);
2262
+ if (Qe(r), r.status !== "Unique") throw Error(r.findings.map((e) => e.message).join(" ") || "The footprint needs another confirmed measurement.");
2263
+ let i = v, a = Ve;
2264
+ t || (i = await dn({
2265
+ workflow: "manual",
2266
+ input: n,
2267
+ sourceObjectId: a ?? void 0
2268
+ }, i?.version ?? 0, i?.projectId ?? V()), on(i), Qe(r), J && !a && (a = await un(i, J), i = await dn({
2269
+ workflow: "manual",
2270
+ input: n,
2271
+ sourceObjectId: a
2272
+ }, i.version, i.projectId), on(i), Qe(r)));
2273
+ let o = i ? await Q(`/projects/${i.projectId}/edits`, {
2274
+ expectedVersion: i.version,
2275
+ operationId: V(),
1413
2276
  edit: {
1414
- replaceInput: t,
2277
+ replaceInput: n,
1415
2278
  note: "Confirmed measurements"
1416
2279
  }
1417
- }) : await Y("/projects", {
1418
- projectId: P(),
1419
- operationId: P(),
1420
- input: t
2280
+ }) : await Q("/projects", {
2281
+ projectId: V(),
2282
+ operationId: V(),
2283
+ input: n
1421
2284
  });
1422
- X(r), y(r.input.isDraft ? "measure" : "proposals"), z && !B && await Zt(r, z);
2285
+ on(o), wt(null), _(o.input.isDraft ? "measure" : "proposals"), J && !a && await un(o, J);
1423
2286
  });
1424
2287
  }
1425
- async function $t() {
1426
- E.trim() && b && await Z(async () => {
1427
- let e = await Y(`/projects/${b.projectId}/chat`, {
1428
- expectedVersion: b.version,
1429
- operationId: P(),
2288
+ async function mn() {
2289
+ E.trim() && v && await $(async () => {
2290
+ let e = await Q(`/projects/${v.projectId}/chat`, {
2291
+ expectedVersion: v.version,
2292
+ operationId: V(),
1430
2293
  message: E
1431
2294
  });
1432
- R(e.preview), D(e.reply), se(""), y("refine");
2295
+ Le(e.preview), O(e.reply), D(""), _("refine");
1433
2296
  });
1434
2297
  }
1435
- async function en() {
1436
- if (!we(L, b) || !L || !b) return;
1437
- let e = L;
1438
- await Z(async () => {
1439
- X(await Y(`/projects/${b.projectId}/edits`, {
2298
+ async function hn() {
2299
+ if (!Oe(q, v) || !q || !v) return;
2300
+ let e = q;
2301
+ await $(async () => {
2302
+ on(await Q(`/projects/${v.projectId}/edits`, {
1440
2303
  expectedVersion: e.expectedVersion,
1441
- operationId: P(),
2304
+ operationId: V(),
1442
2305
  edit: e.edit
1443
- })), D("Preview applied as a new saved version.");
2306
+ })), O("Preview applied as a new saved version.");
1444
2307
  });
1445
2308
  }
1446
- async function tn(e) {
1447
- b && !L && await Z(async () => {
1448
- X(await Y(`/projects/${b.projectId}/edits`, {
1449
- expectedVersion: b.version,
1450
- operationId: P(),
2309
+ async function gn(e) {
2310
+ v && !q && await $(async () => {
2311
+ on(await Q(`/projects/${v.projectId}/edits`, {
2312
+ expectedVersion: v.version,
2313
+ operationId: V(),
1451
2314
  edit: {
1452
2315
  selectProposalId: e.id,
1453
2316
  note: "Selected layout " + e.id
@@ -1455,348 +2318,482 @@ function Me({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: u,
1455
2318
  }));
1456
2319
  });
1457
2320
  }
1458
- async function nn() {
1459
- b && (ct ? lt(!1) : await Z(async () => {
1460
- let e = await Y(`/projects/${b.projectId}/history`);
1461
- at(e), lt(!0);
2321
+ async function _n() {
2322
+ v && (rt ? it(!1) : await $(async () => {
2323
+ let e = await Q(`/projects/${v.projectId}/history`);
2324
+ et(e), it(!0);
1462
2325
  }));
1463
2326
  }
1464
- async function rn() {
1465
- b && it?.some((e) => e.version === ut) && it.some((e) => e.version === ft) && await Z(async () => {
1466
- st(await Y(`/projects/${b.projectId}/compare?left=${ut}&right=${ft}`));
2327
+ async function vn() {
2328
+ v && $e?.some((e) => e.version === at) && $e.some((e) => e.version === st) && await $(async () => {
2329
+ nt(await Q(`/projects/${v.projectId}/compare?left=${at}&right=${st}`));
1467
2330
  });
1468
2331
  }
1469
- async function an() {
1470
- b && ut !== b.version && !L && it?.some((e) => e.version === ut) && await Z(async () => {
1471
- X(await Y(`/projects/${b.projectId}/undo`, {
1472
- expectedVersion: b.version,
1473
- targetVersion: ut,
1474
- operationId: P()
1475
- })), D(v(m, "Saved as a new version. Earlier versions are unchanged."));
2332
+ async function yn() {
2333
+ v && at !== v.version && !q && $e?.some((e) => e.version === at) && await $(async () => {
2334
+ on(await Q(`/projects/${v.projectId}/undo`, {
2335
+ expectedVersion: v.version,
2336
+ targetVersion: at,
2337
+ operationId: V()
2338
+ })), O(g(p, "Saved as a new version. Earlier versions are unchanged."));
1476
2339
  });
1477
2340
  }
1478
- async function on() {
1479
- b && !e && await Z(async () => {
1480
- let e = await Y("/account/quote", { projectId: b.projectId });
1481
- if (e.projectId !== b.projectId || !e.quoteId || _e({
2341
+ function bn() {
2342
+ return /* @__PURE__ */ u("section", {
2343
+ className: "project-price",
2344
+ children: [
2345
+ /* @__PURE__ */ l("h3", { children: g(p, "Project billing") }),
2346
+ /* @__PURE__ */ l("p", { children: Bt ? {
2347
+ en: "This workflow produces reviewed 2D files, not automatic BIM reconstruction. Saves use the configured project generation allowance; check the quote and limits before purchase.",
2348
+ de: "Dieser Ablauf erstellt geprüfte 2D-Dateien, keine automatische BIM-Rekonstruktion. Speichern nutzt das Generierungskontingent; Angebot und Grenzen vor dem Kauf prüfen.",
2349
+ fr: "Ce parcours produit des fichiers 2D vérifiés, sans reconstruction BIM automatique. L’enregistrement utilise le quota du projet ; vérifier le devis et les limites avant achat.",
2350
+ ar: "ينتج هذا المسار ملفات ثنائية الأبعاد مراجعة، وليس إعادة بناء BIM تلقائية. يستخدم الحفظ حصة المشروع؛ راجع السعر والحدود قبل الشراء."
2351
+ }[p] : "One project includes proposals, refinements and its BIM model within the configured caps. Free allowances are checked by the service." }),
2352
+ Qt ? /* @__PURE__ */ u("p", {
2353
+ className: "quota-disclosure",
2354
+ children: [
2355
+ "After the initial proposal request: ",
2356
+ Qt.regenerations,
2357
+ " regenerations · ",
2358
+ Qt.chat,
2359
+ " chat refinements · ",
2360
+ Qt.exports,
2361
+ " ",
2362
+ Qt.exports === 1 ? "BIM export" : "BIM exports",
2363
+ " per paid project."
2364
+ ]
2365
+ }) : /* @__PURE__ */ l("p", { children: "Project usage limits are unavailable. Checkout stays disabled until they can be shown." }),
2366
+ Ct !== null && Ct.projectId === v?.projectId && Ct.projectPaid ? /* @__PURE__ */ l("p", {
2367
+ role: "status",
2368
+ children: g(p, "This paid project reached its configured limit. Another purchase will not extend its allowance.")
2369
+ }) : k ? /* @__PURE__ */ u(c, { children: [
2370
+ /* @__PURE__ */ l("strong", { children: Se({
2371
+ priceMinorUnits: k.priceMinorUnits,
2372
+ currency: k.currency
2373
+ }, p) }),
2374
+ /* @__PURE__ */ u("p", { children: [
2375
+ "Quote valid until ",
2376
+ new Date(k.expiresAtUtc).toLocaleString(p),
2377
+ "."
2378
+ ] }),
2379
+ /* @__PURE__ */ l("button", {
2380
+ className: "ink full",
2381
+ disabled: C || !Zt || !Qt,
2382
+ onClick: Sn,
2383
+ children: g(p, "Continue to Stripe")
2384
+ }),
2385
+ /* @__PURE__ */ l("button", {
2386
+ className: "textbtn",
2387
+ disabled: C,
2388
+ onClick: xn,
2389
+ children: g(p, "Refresh project quote")
2390
+ })
2391
+ ] }) : /* @__PURE__ */ l("button", {
2392
+ className: "outline full",
2393
+ disabled: C || !Zt,
2394
+ onClick: xn,
2395
+ children: g(p, "View project price")
2396
+ }),
2397
+ !Zt && /* @__PURE__ */ l("small", { children: g(p, "Purchases are not enabled in this environment.") }),
2398
+ /* @__PURE__ */ l("small", { children: "A checkout return is not proof of payment; downloads use the service's verified entitlement." })
2399
+ ]
2400
+ });
2401
+ }
2402
+ async function xn() {
2403
+ v && !t && await $(async () => {
2404
+ let e = await Q("/account/quote", { projectId: v.projectId });
2405
+ if (e.projectId !== v.projectId || !e.quoteId || Se({
1482
2406
  priceMinorUnits: e.priceMinorUnits,
1483
2407
  currency: e.currency
1484
- }, m) === null || !Number.isFinite(Date.parse(e.expiresAtUtc))) throw Error("A valid project quote was not supplied.");
1485
- ue(e);
2408
+ }, p) === null || !Number.isFinite(Date.parse(e.expiresAtUtc))) throw Error("A valid project quote was not supplied.");
2409
+ de(e);
1486
2410
  });
1487
2411
  }
1488
- async function sn() {
1489
- b && O && !e && Ut && q && await Z(async () => {
1490
- if (O.projectId !== b.projectId || Date.parse(O.expiresAtUtc) <= Date.now()) throw Error("This quote expired. Refresh the project quote before purchase.");
1491
- let e = await Y("/account/checkout", {
1492
- projectId: b.projectId,
1493
- requestId: P(),
1494
- quoteId: O.quoteId
1495
- }), t = new URL(e.url);
1496
- if (t.protocol !== "https:" || t.hostname !== "checkout.stripe.com" || t.username || t.password) throw Error("The checkout address was not accepted.");
1497
- window.location.assign(t.href);
2412
+ async function Sn() {
2413
+ v && k && !t && Zt && Qt && (Ct?.projectId !== v.projectId || !Ct.projectPaid) && await $(async () => {
2414
+ let e = k;
2415
+ if (J && !Ve) throw Error("Scan and save the selected image before checkout so it can be restored after payment.");
2416
+ if (e.projectId !== v.projectId || Date.parse(e.expiresAtUtc) <= Date.now()) throw Error("This quote expired. Refresh the project quote before purchase.");
2417
+ let t = v;
2418
+ if (Bt) {
2419
+ let e = Tt.current;
2420
+ if (!e) throw Error("The existing-plan editor is not ready to preserve your latest work. Checkout is stopped; keep this page open.");
2421
+ t = await e() ?? t;
2422
+ } else y && (t = await dn({
2423
+ workflow: "manual",
2424
+ input: y,
2425
+ sourceObjectId: Ve ?? void 0
2426
+ }, t.version, t.projectId), on(t));
2427
+ if (Date.parse(e.expiresAtUtc) <= Date.now()) throw Error("This quote expired. Refresh the project quote before purchase.");
2428
+ let n = await Q("/account/checkout", {
2429
+ projectId: t.projectId,
2430
+ requestId: V(),
2431
+ quoteId: e.quoteId
2432
+ }), r = new URL(n.url);
2433
+ if (r.protocol !== "https:" || r.hostname !== "checkout.stripe.com" || r.username || r.password) throw Error("The checkout address was not accepted.");
2434
+ window.location.assign(r.href);
1498
2435
  });
1499
2436
  }
1500
- function cn() {
1501
- Gt(), H.current++, It.current = "", Lt.current = void 0, T(""), pe(""), Ve(void 0), Ee(""), ye(""), ze(""), D("Signed out. Your saved project stays private and can resume after sign-in.");
2437
+ function Cn() {
2438
+ tn(), Y.current++, It.current = "", Lt.current = void 0, T(""), me(""), W(void 0), ye(""), ve(""), B(""), O("Signed out. Your saved project stays private and can resume after sign-in.");
1502
2439
  }
1503
- async function ln() {
1504
- b && K && !L && await Z(async () => {
1505
- A(await Y(`/projects/${b.projectId}/drawings`, {
1506
- expectedVersion: b.version,
1507
- operationId: P(),
1508
- proposalId: K.id
1509
- })), D("2D concept drawings prepared. This does not spend the BIM model export.");
2440
+ async function wn() {
2441
+ v && Z && !q && await $(async () => {
2442
+ fe(await Q(`/projects/${v.projectId}/drawings`, {
2443
+ expectedVersion: v.version,
2444
+ operationId: V(),
2445
+ proposalId: Z.id
2446
+ })), O("2D concept drawings prepared. This does not spend the BIM model export.");
1510
2447
  });
1511
2448
  }
1512
- async function un() {
1513
- b && K && !L && await Z(async () => {
1514
- let e = await Y(`/projects/${b.projectId}/exports`, {
1515
- expectedVersion: b.version,
1516
- operationId: P(),
1517
- proposalId: K.id
2449
+ async function Tn() {
2450
+ v && Z && !q && await $(async () => {
2451
+ let e = await Q(`/projects/${v.projectId}/exports`, {
2452
+ expectedVersion: v.version,
2453
+ operationId: V(),
2454
+ proposalId: Z.id
1518
2455
  });
1519
- fe(e), y("download");
2456
+ pe(e), _("download");
1520
2457
  });
1521
2458
  }
1522
- async function dn(t, n = de) {
1523
- n && b && await Z(async () => {
1524
- let r = H.current, i = await Wt(`/projects/${b.projectId}/objects/${n.files[t].id}`, { headers: !e && j ? { Authorization: "Bearer " + j } : {} });
2459
+ async function En(e, n = j) {
2460
+ n && v && await $(async () => {
2461
+ let r = Y.current, i = await en(`/projects/${v.projectId}/objects/${n.files[e].id}`, { headers: !t && M ? { Authorization: "Bearer " + M } : {} });
1525
2462
  if (!i.ok) throw Error("Download unavailable.");
1526
2463
  let a = await i.blob();
1527
- J(r);
2464
+ $t(r);
1528
2465
  let o = URL.createObjectURL(a), s = document.createElement("a");
1529
- s.href = o, s.download = `${p === "karamentreprises" ? "karamentreprises" : "baulynq"}-${n.proposalId}-v${n.version}.${t}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
2466
+ s.href = o, s.download = `${f === "karamentreprises" ? "karamentreprises" : "baulynq"}-${n.proposalId}-v${n.version}.${e}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
1530
2467
  });
1531
2468
  }
1532
- async function fn(e) {
1533
- ![
2469
+ async function Dn(e) {
2470
+ Ht.busy || Pt.current || (![
1534
2471
  "image/png",
1535
2472
  "image/jpeg",
1536
2473
  "image/webp"
1537
- ].includes(e.type) || e.size > 8388608 ? T("Choose a PNG, JPEG or WebP up to 8 MB.") : (We(e), qe(null), Ze(!1), $e(!1), b ? (y("measure"), D("Local preview only. Review permissions and AI disclosure before uploading the image.")) : (x || Yt(!0), y("measure"), D("Local sketch preview only. Review permissions, then scan and store it privately before asking AI to read observations. No measured footprint is required for that step.")));
2474
+ ].includes(e.type) || e.size > 8388608 ? T("Choose a PNG, JPEG or WebP up to 8 MB.") : (Re(e), He(null), Ke(!1), Je(!1), v ? (_("measure"), O("Local preview only. Review permissions and AI disclosure before uploading the image.")) : (y || cn(!0), _("measure"), O("Local sketch preview only. Review permissions, then scan and store it privately before asking AI to read observations. No measured footprint is required for that step."))));
1538
2475
  }
1539
- async function pn() {
1540
- z && await Z(async () => {
1541
- let e = b;
1542
- e || (e = await Y("/drafts", {
1543
- projectId: P(),
1544
- operationId: P()
1545
- }), X(e), y("measure")), await Zt(e, z);
2476
+ async function On() {
2477
+ Kt || await $(async () => {
2478
+ on(await Q("/drafts", {
2479
+ projectId: V(),
2480
+ operationId: V()
2481
+ })), Vt(!0), _("measure"), sn("studio");
1546
2482
  });
1547
2483
  }
1548
- async function mn() {
1549
- b && B && await Z(async () => {
1550
- let e = await Y(`/projects/${b.projectId}/read-sketch`, {
1551
- expectedVersion: b.version,
1552
- operationId: P(),
1553
- objectId: B,
2484
+ function kn() {
2485
+ return /* @__PURE__ */ u("section", {
2486
+ className: "paper consent-panel",
2487
+ children: [
2488
+ /* @__PURE__ */ l("h3", { children: g(p, "Before image upload") }),
2489
+ /* @__PURE__ */ l("p", { children: g(p, "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.") }),
2490
+ /* @__PURE__ */ u("label", {
2491
+ className: "confirmation",
2492
+ children: [/* @__PURE__ */ l("input", {
2493
+ type: "checkbox",
2494
+ disabled: C,
2495
+ checked: Ge,
2496
+ onChange: (e) => Ke(e.target.checked)
2497
+ }), g(p, "I have permission to use this image for this project.")]
2498
+ }),
2499
+ /* @__PURE__ */ u("label", {
2500
+ className: "confirmation",
2501
+ children: [/* @__PURE__ */ l("input", {
2502
+ type: "checkbox",
2503
+ disabled: C,
2504
+ checked: qe,
2505
+ onChange: (e) => Je(e.target.checked)
2506
+ }), g(p, "I understand the AI image-processing disclosure above.")]
2507
+ }),
2508
+ /* @__PURE__ */ u("label", {
2509
+ className: "field",
2510
+ children: [g(p, "What would you like to create?"), /* @__PURE__ */ l("textarea", {
2511
+ "aria-label": "Sketch brief",
2512
+ disabled: C,
2513
+ value: E,
2514
+ maxLength: 8e3,
2515
+ placeholder: "Room wishes, entrance and view, fixed walls, country…",
2516
+ onChange: (e) => D(e.target.value)
2517
+ })]
2518
+ }),
2519
+ /* @__PURE__ */ l("button", {
2520
+ className: "ink",
2521
+ disabled: C || !Ge || !qe,
2522
+ onClick: An,
2523
+ children: g(p, "Upload for scanning")
2524
+ }),
2525
+ /* @__PURE__ */ l("button", {
2526
+ className: "quiet",
2527
+ disabled: C,
2528
+ onClick: () => {
2529
+ Re(null), Ke(!1), Je(!1);
2530
+ },
2531
+ children: g(p, "Remove local image")
2532
+ })
2533
+ ]
2534
+ });
2535
+ }
2536
+ async function An() {
2537
+ J && await $(async () => {
2538
+ let e = v;
2539
+ e || (e = await Q("/drafts", {
2540
+ projectId: V(),
2541
+ operationId: V()
2542
+ }), on(e), _("measure")), await un(e, J);
2543
+ });
2544
+ }
2545
+ async function jn() {
2546
+ v && Ve && await $(async () => {
2547
+ let e = await Q(`/projects/${v.projectId}/read-sketch`, {
2548
+ expectedVersion: v.version,
2549
+ operationId: V(),
2550
+ objectId: Ve,
1554
2551
  intent: E || "Read the sketch measurements and identify uncertainties."
1555
2552
  });
1556
- At(e.observations), Mt(e.values), bt(e.candidate ?? null), St(!1), Ye(e.questions), D("Recognized values remain estimated. Preview the outline, check labels and assumptions, then explicitly adopt reviewed measurements."), y("measure");
2553
+ At(e.observations), Mt(e.values), gt(e.candidate ?? null), vt(!1), We(e.questions), O("Recognized values remain estimated. Preview the outline, check labels and assumptions, then explicitly adopt reviewed measurements."), _("measure");
1557
2554
  });
1558
2555
  }
1559
- async function hn() {
1560
- b && await Z(async () => {
1561
- let e = await Y(`/projects/${b.projectId}`, void 0, "DELETE");
1562
- re(null), Et([]), S(null), fe(null), A(null), ue(null), R(null), ht(!1), We(null), qe(null), Ye([]), At([]), Mt(void 0), bt(null), St(!1), wt([]), rt(null), W && xe(localStorage, W, null), Ue(null), D(e.dataErased === !0 ? `Service reports project data erased. ${e.accountingPending ? "Accounting cleanup is still pending." : "Accounting cleanup completed."}` : "Deletion accepted; data erasure is still pending. The service will continue cleanup.");
2556
+ async function Mn() {
2557
+ v && await $(async () => {
2558
+ let e = await Q(`/projects/${v.projectId}`, void 0, "DELETE");
2559
+ se(null), St([]), b(null), pe(null), fe(null), de(null), Le(null), ut(!1), Re(null), He(null), We([]), At([]), Mt(void 0), gt(null), vt(!1), bt([]), Qe(null), zt && Te(localStorage, zt, null), Ie(null), O(e.dataErased === !0 ? `Service reports project data erased. ${e.accountingPending ? "Accounting cleanup is still pending." : "Accounting cleanup completed."}` : "Deletion accepted; data erasure is still pending. The service will continue cleanup.");
1563
2560
  });
1564
2561
  }
1565
- async function gn() {
1566
- !e && j && await Z(async () => {
1567
- let e = await Y("/account/data", void 0, "DELETE");
1568
- Dt && (await qt("visit", !1), Ot(!1)), Gt(), H.current++, W && xe(localStorage, W, null), y("measure"), D((e.dataErased ? "Service reports project content erased." : "Content deletion accepted; erasure is still pending.") + " " + (e.accountingPending ? "Accounting cleanup is still pending. " : "") + "Account identity, billing and required anti-abuse metadata are retained.");
2562
+ async function Nn() {
2563
+ !t && M && await $(async () => {
2564
+ let e = await Q("/account/data", void 0, "DELETE");
2565
+ Dt && (await rn("visit", !1), Ot(!1)), tn(), Y.current++, zt && Te(localStorage, zt, null), _("measure"), O((e.dataErased ? "Service reports project content erased." : "Content deletion accepted; erasure is still pending.") + " " + (e.accountingPending ? "Accounting cleanup is still pending. " : "") + "Account identity, billing and required anti-abuse metadata are retained.");
1569
2566
  });
1570
2567
  }
1571
- async function _n() {
1572
- await Z(async () => {
1573
- let e = H.current;
1574
- if (I === "signup") {
1575
- await Y("/account/signup", { email: ge }), D("Check your email for the verification link. No session is created until ownership is verified."), Le("verify"), Ee("");
2568
+ async function Pn() {
2569
+ await $(async () => {
2570
+ let e = Y.current;
2571
+ if (L === "signup") {
2572
+ await Q("/account/signup", { email: _e }), O("Check your email for the verification link. No session is created until ownership is verified."), R("verify"), ye("");
1576
2573
  return;
1577
2574
  }
1578
- let t = await Y(I === "verify" ? "/account/verification/complete" : "/account/login", I === "verify" ? {
1579
- token: Re,
1580
- password: M
2575
+ let t = await Q(L === "verify" ? "/account/verification/complete" : "/account/login", L === "verify" ? {
2576
+ token: z,
2577
+ password: P
1581
2578
  } : {
1582
- email: ge,
1583
- password: M
2579
+ email: _e,
2580
+ password: P
1584
2581
  });
1585
- if (Ee(""), ze(""), !t.token) {
1586
- Le("login"), D("Email verified. Sign in to continue.");
2582
+ if (ye(""), B(""), !t.token) {
2583
+ R("login"), O("Email verified. Sign in to continue.");
1587
2584
  return;
1588
2585
  }
1589
- let n = await Wt("/session", { headers: { Authorization: "Bearer " + t.token } });
2586
+ let n = await en("/session", { headers: { Authorization: "Bearer " + t.token } });
1590
2587
  if (!n.ok) throw Error("The verified workspace could not be loaded.");
1591
2588
  let r = await n.json();
1592
- if (J(e), typeof r.workspaceKey != "string" || !r.workspaceKey || r.workspaceKey.length > 512) throw Error("The verified workspace could not be loaded.");
1593
- Lt.current && Lt.current !== r.workspaceKey && Gt(), H.current++, It.current = t.token, Lt.current = r.workspaceKey, pe(t.token), Ve(r.workspaceKey), he(!1), D("Signed in. This session stays in memory only.");
2589
+ if ($t(e), typeof r.workspaceKey != "string" || !r.workspaceKey || r.workspaceKey.length > 512) throw Error("The verified workspace could not be loaded.");
2590
+ Lt.current && Lt.current !== r.workspaceKey && tn(), Y.current++, It.current = t.token, Lt.current = r.workspaceKey, me(t.token), W(r.workspaceKey), N(!1), O("Signed in. This session stays in memory only.");
1594
2591
  });
1595
2592
  }
1596
- function vn() {
1597
- V?.input && (ht(!0), S({
1598
- ...x ?? Se(m),
1599
- footprint: V.input
1600
- }), rt(V.reconciliation), wt(V.input.edges.flatMap((e, t) => [`footprint.edges[${t}].lengthM`, ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]])), St(!0), tt(!1), R(null), y("measure"), D("Recognized outline is a local estimated preview. No project version or proposal was changed. Review every length, bearing and wall type before adoption."));
2593
+ function Fn() {
2594
+ ht?.input && (ut(!0), b({
2595
+ ...y ?? Ee(p),
2596
+ footprint: ht.input
2597
+ }), Qe(ht.reconciliation), bt(ht.input.edges.flatMap((e, t) => [`footprint.edges[${t}].lengthM`, ...e.bearingDegrees == null ? [] : [`footprint.edges[${t}].bearingDegrees`]])), vt(!0), Xe(!1), Le(null), _("measure"), O("Recognized outline is a local estimated preview. No project version or proposal was changed. Review every length, bearing and wall type before adoption."));
1601
2598
  }
1602
- function yn(e) {
1603
- qe(e), y("measure"), D("Saved sanitized sketch selected. Reading it with AI is a separate explicit action.");
2599
+ function In(e) {
2600
+ Re(null), Be(""), He(e), _("measure"), O("Saved sanitized sketch selected. Reading it with AI is a separate explicit action.");
1604
2601
  }
1605
- async function bn(t, n) {
1606
- b && await Z(async () => {
1607
- let r = H.current, i = await Wt(`/projects/${b.projectId}/objects/${n.objectId}`, { headers: !e && j ? { Authorization: "Bearer " + j } : {} });
2602
+ async function Ln(e, n) {
2603
+ v && await $(async () => {
2604
+ let r = Y.current, i = await en(`/projects/${v.projectId}/objects/${n.objectId}`, { headers: !t && M ? { Authorization: "Bearer " + M } : {} });
1608
2605
  if (!i.ok) throw Error("Saved file is unavailable or expired.");
1609
2606
  let a = await i.blob();
1610
- J(r);
2607
+ $t(r);
1611
2608
  let o = URL.createObjectURL(a), s = document.createElement("a");
1612
- s.href = o, s.download = `${p === "karamentreprises" ? "karamentreprises" : "baulynq"}-${t.kind}${t.version ? "-v" + t.version : ""}.${n.format}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
2609
+ s.href = o, s.download = `${f === "karamentreprises" ? "karamentreprises" : "baulynq"}-${e.kind}${e.version ? "-v" + e.version : ""}.${n.format}`, s.click(), setTimeout(() => URL.revokeObjectURL(o), 1e3);
1613
2610
  });
1614
2611
  }
1615
- r(() => {
1616
- if (!b) return;
2612
+ i(() => {
2613
+ if (!v) return;
1617
2614
  let e = !0;
1618
- return Y(`/projects/${b.projectId}/artifacts`).then((t) => {
1619
- e && Et(Array.isArray(t) ? t : []);
2615
+ return Q(`/projects/${v.projectId}/artifacts`).then((t) => {
2616
+ e && St(Array.isArray(t) ? t : []);
1620
2617
  }).catch(() => {
1621
- e && Et([]);
2618
+ e && St([]);
1622
2619
  }), () => {
1623
2620
  e = !1;
1624
2621
  };
1625
2622
  }, [
1626
- b?.projectId,
1627
- b?.version,
1628
- B
2623
+ v?.projectId,
2624
+ v?.version,
2625
+ Ve
1629
2626
  ]);
1630
- let $ = ne === "measure" ? nt?.values : K?.values ?? G?.reconciliation.values ?? nt?.values, xn = K?.findings.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {}) ?? {};
1631
- return /* @__PURE__ */ l("div", {
2627
+ let Rn = oe === "measure" ? Ze?.values : Z?.values ?? Jt?.reconciliation.values ?? Ze?.values, zn = Z?.findings.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {}) ?? {};
2628
+ return /* @__PURE__ */ u("div", {
1632
2629
  className: "bim-studio",
1633
- dir: m === "ar" ? "rtl" : "ltr",
2630
+ dir: p === "ar" ? "rtl" : "ltr",
1634
2631
  children: [
1635
- !e && /* @__PURE__ */ l("header", { children: [/* @__PURE__ */ c("a", {
2632
+ !t && /* @__PURE__ */ u("header", { children: [/* @__PURE__ */ l("a", {
1636
2633
  className: "logo",
1637
2634
  href: "/",
1638
2635
  onClick: (e) => {
1639
- e.preventDefault(), Q("home");
2636
+ e.preventDefault(), sn("home");
1640
2637
  },
1641
- children: /* @__PURE__ */ c(Oe, {})
1642
- }), /* @__PURE__ */ l("nav", { children: [
1643
- /* @__PURE__ */ c("a", {
2638
+ children: /* @__PURE__ */ l(je, {})
2639
+ }), /* @__PURE__ */ u("nav", { children: [
2640
+ /* @__PURE__ */ l("a", {
1644
2641
  href: "/#pricing",
1645
- onClick: () => _ !== "home" && Q("home"),
1646
- children: U.pricing
2642
+ onClick: () => ie !== "home" && sn("home"),
2643
+ children: X.pricing
1647
2644
  }),
1648
- /* @__PURE__ */ c("select", {
1649
- "aria-label": U.language,
1650
- value: m,
2645
+ /* @__PURE__ */ l("select", {
2646
+ "aria-label": X.language,
2647
+ value: p,
1651
2648
  onChange: (e) => h(e.target.value),
1652
2649
  children: [
1653
2650
  "en",
1654
2651
  "de",
1655
2652
  "fr",
1656
2653
  "ar"
1657
- ].map((e) => /* @__PURE__ */ c("option", {
2654
+ ].map((e) => /* @__PURE__ */ l("option", {
1658
2655
  value: e,
1659
2656
  children: e.toUpperCase()
1660
2657
  }, e))
1661
2658
  }),
1662
- /* @__PURE__ */ c("button", {
2659
+ /* @__PURE__ */ l("button", {
1663
2660
  className: "quiet account-action",
1664
2661
  disabled: C,
1665
- onClick: () => j ? Q("studio") : he(!0),
1666
- children: j ? U.account : U.signin
2662
+ onClick: () => M ? sn("studio") : N(!0),
2663
+ children: M ? X.account : X.signin
1667
2664
  }),
1668
- j && /* @__PURE__ */ l("div", {
2665
+ M && /* @__PURE__ */ u("div", {
1669
2666
  className: "account-options",
1670
- children: [/* @__PURE__ */ c("button", {
2667
+ children: [/* @__PURE__ */ l("button", {
1671
2668
  className: "quiet",
1672
- "aria-label": v(m, "Account options"),
1673
- "aria-expanded": vt,
2669
+ "aria-label": g(p, "Account options"),
2670
+ "aria-expanded": pt,
1674
2671
  "aria-controls": "bim-account-actions",
1675
2672
  disabled: C,
1676
- onClick: () => yt(!vt),
2673
+ onClick: () => mt(!pt),
1677
2674
  children: "⋯"
1678
- }), vt && /* @__PURE__ */ l("div", {
2675
+ }), pt && /* @__PURE__ */ u("div", {
1679
2676
  id: "bim-account-actions",
1680
2677
  role: "group",
1681
- "aria-label": v(m, "Account actions"),
2678
+ "aria-label": g(p, "Account actions"),
1682
2679
  className: "account-actions",
1683
2680
  onKeyDown: (e) => {
1684
- e.key === "Escape" && (yt(!1), e.currentTarget.parentElement?.querySelector("button")?.focus());
2681
+ e.key === "Escape" && (mt(!1), e.currentTarget.parentElement?.querySelector("button")?.focus());
1685
2682
  },
1686
- children: [/* @__PURE__ */ c("button", {
2683
+ children: [/* @__PURE__ */ l("button", {
1687
2684
  className: "quiet full",
1688
2685
  disabled: C,
1689
2686
  onClick: () => {
1690
- yt(!1), _t(!0);
2687
+ mt(!1), ft(!0);
1691
2688
  },
1692
- children: v(m, "Delete project content")
1693
- }), /* @__PURE__ */ c("button", {
2689
+ children: g(p, "Delete project content")
2690
+ }), /* @__PURE__ */ l("button", {
1694
2691
  className: "quiet full",
1695
2692
  disabled: C,
1696
- onClick: cn,
1697
- children: v(m, "Sign out")
2693
+ onClick: Cn,
2694
+ children: g(p, "Sign out")
1698
2695
  })]
1699
2696
  })]
1700
2697
  }),
1701
- /* @__PURE__ */ l("button", {
2698
+ /* @__PURE__ */ u("button", {
1702
2699
  className: "ink",
1703
- onClick: () => Q("studio"),
1704
- children: [U.studio, /* @__PURE__ */ c(ke, {})]
2700
+ onClick: () => sn("studio"),
2701
+ children: [X.studio, /* @__PURE__ */ l(H, {})]
1705
2702
  })
1706
2703
  ] })] }),
1707
- _ === "home" ? /* @__PURE__ */ l("main", {
2704
+ ie === "home" ? /* @__PURE__ */ u("main", {
1708
2705
  className: "landing",
1709
2706
  children: [
1710
- /* @__PURE__ */ l("section", {
2707
+ /* @__PURE__ */ u("section", {
1711
2708
  className: "hero",
1712
2709
  children: [
1713
- /* @__PURE__ */ l("span", {
2710
+ /* @__PURE__ */ u("span", {
1714
2711
  className: "eyebrow",
1715
2712
  children: [
1716
- U.eyebrow,
2713
+ X.eyebrow,
1717
2714
  " ",
1718
- /* @__PURE__ */ c("span", { children: "01 — VISION" })
2715
+ /* @__PURE__ */ l("span", { children: "01 — VISION" })
1719
2716
  ]
1720
2717
  }),
1721
- /* @__PURE__ */ c("h1", { children: U.hero }),
1722
- /* @__PURE__ */ c("p", { children: U.intro }),
1723
- /* @__PURE__ */ l("div", {
2718
+ /* @__PURE__ */ l("h1", { children: X.hero }),
2719
+ /* @__PURE__ */ l("p", { children: X.intro }),
2720
+ /* @__PURE__ */ u("div", {
1724
2721
  className: "actions",
1725
- children: [/* @__PURE__ */ l("button", {
2722
+ children: [/* @__PURE__ */ u("button", {
1726
2723
  className: "ink large",
1727
- onClick: () => Q("studio"),
1728
- children: [U.start, /* @__PURE__ */ c(ke, {})]
1729
- }), N.mode === "local-demo" ? /* @__PURE__ */ l("button", {
2724
+ onClick: () => sn("studio"),
2725
+ children: [X.start, /* @__PURE__ */ l(H, {})]
2726
+ }), F.mode === "local-demo" ? /* @__PURE__ */ u("button", {
1730
2727
  className: "textbtn",
1731
- onClick: Xt,
1732
- children: [U.try, " →"]
1733
- }) : /* @__PURE__ */ l("button", {
2728
+ onClick: ln,
2729
+ children: [X.try, " →"]
2730
+ }) : /* @__PURE__ */ u("button", {
1734
2731
  className: "textbtn",
1735
- onClick: () => Yt(),
1736
- children: [v(m, "Enter measurements"), " →"]
2732
+ onClick: () => cn(),
2733
+ children: [g(p, "Enter measurements"), " →"]
1737
2734
  })]
1738
2735
  }),
1739
- /* @__PURE__ */ l("div", {
2736
+ /* @__PURE__ */ u("div", {
1740
2737
  className: "proof",
1741
- children: [/* @__PURE__ */ c("span", { className: "dot" }), "Your measurements. Checked geometry. One shared engine."]
2738
+ children: [/* @__PURE__ */ l("span", { className: "dot" }), "Your measurements. Checked geometry. One shared engine."]
1742
2739
  })
1743
2740
  ]
1744
2741
  }),
1745
- /* @__PURE__ */ l("section", {
2742
+ /* @__PURE__ */ u("section", {
1746
2743
  className: "transformation",
1747
2744
  children: [
1748
- /* @__PURE__ */ l("article", {
2745
+ /* @__PURE__ */ u("article", {
1749
2746
  className: "sketch-card",
1750
2747
  children: [
1751
- /* @__PURE__ */ l("div", {
2748
+ /* @__PURE__ */ u("div", {
1752
2749
  className: "card-title",
1753
- children: [/* @__PURE__ */ c("span", { children: "01 / SKETCH" }), /* @__PURE__ */ c("span", { children: "THE STARTING POINT" })]
2750
+ children: [/* @__PURE__ */ l("span", { children: "01 / SKETCH" }), /* @__PURE__ */ l("span", { children: "THE STARTING POINT" })]
1754
2751
  }),
1755
- /* @__PURE__ */ c(Ae, {}),
1756
- /* @__PURE__ */ c("h3", { children: U.before })
2752
+ /* @__PURE__ */ l(U, {}),
2753
+ /* @__PURE__ */ l("h3", { children: X.before })
1757
2754
  ]
1758
2755
  }),
1759
- /* @__PURE__ */ c("div", {
2756
+ /* @__PURE__ */ l("div", {
1760
2757
  className: "flow-arrow",
1761
2758
  children: "→"
1762
2759
  }),
1763
- /* @__PURE__ */ l("article", {
2760
+ /* @__PURE__ */ u("article", {
1764
2761
  className: "plan-card",
1765
2762
  children: [
1766
- /* @__PURE__ */ l("div", {
2763
+ /* @__PURE__ */ u("div", {
1767
2764
  className: "card-title",
1768
- children: [/* @__PURE__ */ c("span", { children: "02 / POSSIBILITIES" }), /* @__PURE__ */ c("span", {
2765
+ children: [/* @__PURE__ */ l("span", { children: "02 / POSSIBILITIES" }), /* @__PURE__ */ l("span", {
1769
2766
  className: "teal",
1770
2767
  children: "CHECKED BY THE ENGINE"
1771
2768
  })]
1772
2769
  }),
1773
- /* @__PURE__ */ c("div", {
2770
+ /* @__PURE__ */ l("div", {
1774
2771
  className: "mini-plan",
1775
- children: /* @__PURE__ */ c("img", {
2772
+ children: /* @__PURE__ */ l("img", {
1776
2773
  src: "/reference-plan.svg",
1777
2774
  alt: "Engine-generated reference layout A with checked dimensions"
1778
2775
  })
1779
2776
  }),
1780
- /* @__PURE__ */ c("h3", { children: U.after }),
1781
- N.mode === "local-demo" ? /* @__PURE__ */ l("button", {
2777
+ /* @__PURE__ */ l("h3", { children: X.after }),
2778
+ F.mode === "local-demo" ? /* @__PURE__ */ u("button", {
1782
2779
  className: "textbtn",
1783
- onClick: Xt,
1784
- children: [U.try, " ↗"]
1785
- }) : /* @__PURE__ */ l("button", {
2780
+ onClick: ln,
2781
+ children: [X.try, " ↗"]
2782
+ }) : /* @__PURE__ */ u("button", {
1786
2783
  className: "textbtn",
1787
- onClick: () => Yt(),
1788
- children: [v(m, "Enter measurements"), " ↗"]
2784
+ onClick: () => cn(),
2785
+ children: [g(p, "Enter measurements"), " ↗"]
1789
2786
  })
1790
2787
  ]
1791
2788
  })
1792
2789
  ]
1793
2790
  }),
1794
- /* @__PURE__ */ c("section", {
2791
+ /* @__PURE__ */ l("section", {
1795
2792
  className: "process",
1796
- children: U.steps.map((e, t) => /* @__PURE__ */ l("div", { children: [
1797
- /* @__PURE__ */ l("span", { children: ["0", t + 1] }),
1798
- /* @__PURE__ */ c("h3", { children: e }),
1799
- /* @__PURE__ */ c("p", { children: [
2793
+ children: X.steps.map((e, t) => /* @__PURE__ */ u("div", { children: [
2794
+ /* @__PURE__ */ u("span", { children: ["0", t + 1] }),
2795
+ /* @__PURE__ */ l("h3", { children: e }),
2796
+ /* @__PURE__ */ l("p", { children: [
1800
2797
  "A drawing or photo, with dimensions.",
1801
2798
  "Confirm dimensions and fixed constraints.",
1802
2799
  "Compare different ways to use your space.",
@@ -1804,966 +2801,951 @@ function Me({ embedded: e = !1, transport: t, initialInput: n, workspaceKey: u,
1804
2801
  ][t] })
1805
2802
  ] }, e))
1806
2803
  }),
1807
- /* @__PURE__ */ l("section", {
2804
+ /* @__PURE__ */ u("section", {
1808
2805
  className: "use-case-links",
1809
2806
  children: [
1810
- /* @__PURE__ */ c("h2", { children: v(m, "Plan your next space") }),
1811
- /* @__PURE__ */ l("a", {
2807
+ /* @__PURE__ */ l("h2", { children: g(p, "Plan your next space") }),
2808
+ /* @__PURE__ */ u("a", {
1812
2809
  href: "/apartment-layout/",
1813
- children: [v(m, "Apartment layout"), " ↗"]
2810
+ children: [g(p, "Apartment layout"), " ↗"]
1814
2811
  }),
1815
- /* @__PURE__ */ l("a", {
2812
+ /* @__PURE__ */ u("a", {
1816
2813
  href: "/house-extension/",
1817
- children: [v(m, "House extension"), " ↗"]
2814
+ children: [g(p, "House extension"), " ↗"]
1818
2815
  }),
1819
- /* @__PURE__ */ l("a", {
2816
+ /* @__PURE__ */ u("a", {
1820
2817
  href: "/renovation/",
1821
- children: [v(m, "Renovation"), " ↗"]
2818
+ children: [g(p, "Renovation"), " ↗"]
1822
2819
  })
1823
2820
  ]
1824
2821
  }),
1825
- /* @__PURE__ */ l("section", {
2822
+ /* @__PURE__ */ u("section", {
1826
2823
  className: "price-section",
1827
2824
  id: "pricing",
1828
- children: [/* @__PURE__ */ l("div", { children: [
1829
- /* @__PURE__ */ c("span", {
2825
+ children: [/* @__PURE__ */ u("div", { children: [
2826
+ /* @__PURE__ */ l("span", {
1830
2827
  className: "eyebrow",
1831
2828
  children: "A CLEAR START"
1832
2829
  }),
1833
- /* @__PURE__ */ l("h2", { children: [
2830
+ /* @__PURE__ */ u("h2", { children: [
1834
2831
  "A small project.",
1835
- /* @__PURE__ */ c("br", {}),
2832
+ /* @__PURE__ */ l("br", {}),
1836
2833
  "A useful next step."
1837
2834
  ] }),
1838
- /* @__PURE__ */ c("p", { children: "Free access is included in KEHBIMVISION and BauLynq BIM, within each app’s AI usage limits." })
1839
- ] }), /* @__PURE__ */ l("article", {
2835
+ /* @__PURE__ */ l("p", { children: "Free access is included in KEHBIMVISION and BauLynq BIM, within each app’s AI usage limits." })
2836
+ ] }), /* @__PURE__ */ u("article", {
1840
2837
  className: "price-card",
1841
2838
  children: [
1842
- /* @__PURE__ */ c("span", {
2839
+ /* @__PURE__ */ l("span", {
1843
2840
  className: "eyebrow",
1844
- children: p === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION"
2841
+ children: f === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION"
1845
2842
  }),
1846
- /* @__PURE__ */ c("h2", { children: Vt ?? "Pricing opens with the service" }),
1847
- /* @__PURE__ */ c("small", { children: "Base pricing. Your project quote is shown before purchase." }),
1848
- /* @__PURE__ */ c("p", { children: Ht ? `${Ht.proposals} free proposal generations · ${Ht.exports} BIM exports` : "The local preview does not accept payments." }),
1849
- /* @__PURE__ */ c("p", { children: "One project includes proposals, refinements and its model export." }),
1850
- q && /* @__PURE__ */ l("p", { children: [
2843
+ /* @__PURE__ */ l("h2", { children: Yt ?? "Pricing opens with the service" }),
2844
+ /* @__PURE__ */ l("small", { children: "Base pricing. Your project quote is shown before purchase." }),
2845
+ /* @__PURE__ */ l("p", { children: Xt ? `${Xt.proposals} free proposal generations · ${Xt.exports} BIM exports` : "The local preview does not accept payments." }),
2846
+ /* @__PURE__ */ l("p", { children: "One project includes proposals, refinements and its model export." }),
2847
+ Qt && /* @__PURE__ */ u("p", { children: [
1851
2848
  "After the initial proposal request: ",
1852
- q.regenerations,
2849
+ Qt.regenerations,
1853
2850
  " regenerations · ",
1854
- q.chat,
2851
+ Qt.chat,
1855
2852
  " chat refinements · ",
1856
- q.exports,
2853
+ Qt.exports,
1857
2854
  " ",
1858
- q.exports === 1 ? "BIM export" : "BIM exports",
2855
+ Qt.exports === 1 ? "BIM export" : "BIM exports",
1859
2856
  " per paid project."
1860
2857
  ] }),
1861
- /* @__PURE__ */ l("button", {
2858
+ /* @__PURE__ */ u("button", {
1862
2859
  className: "ink",
1863
- onClick: () => Q("studio"),
1864
- children: [U.start, /* @__PURE__ */ c(ke, {})]
2860
+ onClick: () => sn("studio"),
2861
+ children: [X.start, /* @__PURE__ */ l(H, {})]
1865
2862
  })
1866
2863
  ]
1867
2864
  })]
1868
2865
  }),
1869
- /* @__PURE__ */ l("footer", { children: [/* @__PURE__ */ c(Oe, {}), /* @__PURE__ */ c("span", { children: U.disclaimer })] })
2866
+ /* @__PURE__ */ u("footer", { children: [/* @__PURE__ */ l(je, {}), /* @__PURE__ */ l("span", { children: X.disclaimer })] })
1870
2867
  ]
1871
- }) : /* @__PURE__ */ l("main", {
2868
+ }) : /* @__PURE__ */ u("main", {
1872
2869
  className: "studio",
1873
2870
  children: [
1874
- /* @__PURE__ */ l("aside", {
2871
+ /* @__PURE__ */ u("aside", {
1875
2872
  className: "rail",
1876
2873
  children: [
1877
- /* @__PURE__ */ c("span", {
2874
+ /* @__PURE__ */ l("span", {
1878
2875
  className: "eyebrow",
1879
2876
  children: "WORKSPACE"
1880
2877
  }),
1881
- /* @__PURE__ */ c("h2", { children: U.workspace }),
1882
- /* @__PURE__ */ l("span", {
2878
+ /* @__PURE__ */ l("h2", { children: X.workspace }),
2879
+ /* @__PURE__ */ u("span", {
1883
2880
  className: "project-status",
1884
- children: [/* @__PURE__ */ c("span", { className: "dot" }), N.mode === "local-demo" ? "Local reference preview" : "Private project"]
2881
+ children: [/* @__PURE__ */ l("span", { className: "dot" }), F.mode === "local-demo" ? "Local reference preview" : "Private project"]
1885
2882
  }),
1886
- /* @__PURE__ */ c("div", {
2883
+ /* @__PURE__ */ l("div", {
1887
2884
  className: "stage-nav",
1888
2885
  children: [
1889
2886
  "measure",
1890
2887
  "proposals",
1891
2888
  "refine",
1892
2889
  "download"
1893
- ].map((e, t) => /* @__PURE__ */ l("button", {
1894
- className: ne === e ? "active" : "",
2890
+ ].map((e, t) => /* @__PURE__ */ u("button", {
2891
+ className: oe === e ? "active" : "",
1895
2892
  disabled: C,
1896
- onClick: () => y(e),
1897
- children: [/* @__PURE__ */ l("span", { children: ["0", t + 1] }), U[e]]
2893
+ onClick: () => _(e),
2894
+ children: [/* @__PURE__ */ u("span", { children: ["0", t + 1] }), X[e]]
1898
2895
  }, e))
1899
2896
  }),
1900
- /* @__PURE__ */ l("div", {
2897
+ /* @__PURE__ */ u("div", {
1901
2898
  className: "rail-bottom",
1902
2899
  children: [
1903
- /* @__PURE__ */ c("p", { children: U.privacy }),
1904
- typeof N.retentionDays == "number" && /* @__PURE__ */ l("p", { children: [
2900
+ /* @__PURE__ */ l("p", { children: X.privacy }),
2901
+ typeof F.retentionDays == "number" && /* @__PURE__ */ u("p", { children: [
1905
2902
  "Retention: ",
1906
- N.retentionDays,
2903
+ F.retentionDays,
1907
2904
  " days, as configured by the service."
1908
2905
  ] }),
1909
- b && /* @__PURE__ */ c("button", {
2906
+ v && /* @__PURE__ */ l("button", {
1910
2907
  className: "quiet danger",
1911
- onClick: hn,
1912
- children: U.delete
2908
+ onClick: Mn,
2909
+ children: X.delete
1913
2910
  })
1914
2911
  ]
1915
2912
  })
1916
2913
  ]
1917
2914
  }),
1918
- /* @__PURE__ */ l("section", {
2915
+ /* @__PURE__ */ u("section", {
1919
2916
  className: "workspace",
1920
2917
  children: [
1921
- /* @__PURE__ */ l("div", {
2918
+ /* @__PURE__ */ u("div", {
1922
2919
  className: "workspace-heading",
1923
- children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ c("span", {
2920
+ children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("span", {
1924
2921
  className: "eyebrow",
1925
- children: b ? `VERSION ${b.version} / ${b.projectId.slice(0, 8)}` : "YOUR NEXT SPACE"
1926
- }), /* @__PURE__ */ c("h1", { children: U[ne] })] }), /* @__PURE__ */ l("div", {
2922
+ children: v ? `VERSION ${v.version} / ${v.projectId.slice(0, 8)}` : "YOUR NEXT SPACE"
2923
+ }), /* @__PURE__ */ l("h1", { children: X[oe] })] }), /* @__PURE__ */ u("div", {
1927
2924
  className: "workspace-controls",
1928
2925
  children: [
1929
- e && /* @__PURE__ */ c("select", {
1930
- "aria-label": U.language,
1931
- value: m,
2926
+ t && /* @__PURE__ */ l("select", {
2927
+ "aria-label": X.language,
2928
+ value: p,
1932
2929
  onChange: (e) => h(e.target.value),
1933
2930
  children: [
1934
2931
  "en",
1935
2932
  "de",
1936
2933
  "fr",
1937
2934
  "ar"
1938
- ].map((e) => /* @__PURE__ */ c("option", {
2935
+ ].map((e) => /* @__PURE__ */ l("option", {
1939
2936
  value: e,
1940
2937
  children: e.toUpperCase()
1941
2938
  }, e))
1942
2939
  }),
1943
- /* @__PURE__ */ c("button", {
2940
+ /* @__PURE__ */ l("button", {
1944
2941
  className: "quiet",
1945
2942
  disabled: C,
1946
- onClick: () => Yt(),
1947
- children: v(m, "New project")
2943
+ onClick: () => cn(),
2944
+ children: g(p, "New project")
1948
2945
  }),
1949
- b && /* @__PURE__ */ c("button", {
2946
+ v && /* @__PURE__ */ l("button", {
1950
2947
  className: "quiet compact-delete",
1951
2948
  "aria-label": "Delete current project",
1952
2949
  disabled: C,
1953
- onClick: hn,
1954
- children: U.delete
2950
+ onClick: Mn,
2951
+ children: X.delete
1955
2952
  }),
1956
- b && /* @__PURE__ */ l("button", {
2953
+ v && /* @__PURE__ */ u("button", {
1957
2954
  className: "outline",
1958
- disabled: C || !!L || b.version < 2,
1959
- onClick: () => Z(async () => {
1960
- X(await Y(`/projects/${b.projectId}/undo`, {
1961
- expectedVersion: b.version,
1962
- targetVersion: b.version - 1,
1963
- operationId: P()
2955
+ disabled: C || !!q || v.version < 2,
2956
+ onClick: () => $(async () => {
2957
+ on(await Q(`/projects/${v.projectId}/undo`, {
2958
+ expectedVersion: v.version,
2959
+ targetVersion: v.version - 1,
2960
+ operationId: V()
1964
2961
  }));
1965
2962
  }),
1966
- children: ["↶ ", U.undo]
2963
+ children: ["↶ ", X.undo]
1967
2964
  })
1968
2965
  ]
1969
2966
  })]
1970
2967
  }),
1971
- w && /* @__PURE__ */ l("div", {
2968
+ le && /* @__PURE__ */ u("div", {
1972
2969
  role: "alert",
1973
2970
  className: "alert",
1974
- children: [p === "karamentreprises" ? w.replace(/Polycyphers/gi, "Karamentreprises") : w, /* @__PURE__ */ c("button", {
1975
- "aria-label": U.close,
2971
+ children: [f === "karamentreprises" ? le.replace(/Polycyphers/gi, "Karamentreprises") : le, /* @__PURE__ */ l("button", {
2972
+ "aria-label": X.close,
1976
2973
  onClick: () => T(""),
1977
2974
  children: "×"
1978
2975
  })]
1979
2976
  }),
1980
- ce && /* @__PURE__ */ l("div", {
2977
+ ue && /* @__PURE__ */ u("div", {
1981
2978
  role: "status",
1982
2979
  className: "notice",
1983
- children: [ce, /* @__PURE__ */ c("button", {
1984
- "aria-label": U.close,
1985
- onClick: () => D(""),
2980
+ children: [ue, /* @__PURE__ */ l("button", {
2981
+ "aria-label": X.close,
2982
+ onClick: () => O(""),
1986
2983
  children: "×"
1987
2984
  })]
1988
2985
  }),
1989
- L && /* @__PURE__ */ c("section", {
2986
+ q && /* @__PURE__ */ l("section", {
1990
2987
  className: "notice preview-banner",
1991
2988
  role: "status",
1992
- children: /* @__PURE__ */ l("div", { children: [
1993
- /* @__PURE__ */ c("strong", { children: v(m, "Unsaved edit preview") }),
1994
- /* @__PURE__ */ l("p", { children: [
2989
+ children: /* @__PURE__ */ u("div", { children: [
2990
+ /* @__PURE__ */ l("strong", { children: g(p, "Unsaved edit preview") }),
2991
+ /* @__PURE__ */ u("p", { children: [
1995
2992
  "Review the recomputed plan, schedule and rule findings below. Your saved version ",
1996
- b?.version,
2993
+ v?.version,
1997
2994
  " is unchanged."
1998
2995
  ] }),
1999
- /* @__PURE__ */ c("button", {
2996
+ /* @__PURE__ */ l("button", {
2000
2997
  className: "ink",
2001
- disabled: C || !we(L, b),
2002
- onClick: en,
2003
- children: v(m, "Apply as new version")
2998
+ disabled: C || !Oe(q, v),
2999
+ onClick: hn,
3000
+ children: g(p, "Apply as new version")
2004
3001
  }),
2005
- /* @__PURE__ */ c("button", {
3002
+ /* @__PURE__ */ l("button", {
2006
3003
  className: "outline",
2007
3004
  disabled: C,
2008
- onClick: () => R(null),
2009
- children: v(m, "Discard preview")
3005
+ onClick: () => Le(null),
3006
+ children: g(p, "Discard preview")
2010
3007
  })
2011
3008
  ] })
2012
3009
  }),
2013
- !b && !x ? /* @__PURE__ */ l("div", {
3010
+ !v && !y ? /* @__PURE__ */ u("div", {
2014
3011
  className: "empty",
2015
3012
  children: [
2016
- /* @__PURE__ */ c("span", {
3013
+ /* @__PURE__ */ l("span", {
2017
3014
  className: "empty-icon",
2018
3015
  children: "⌑"
2019
3016
  }),
2020
- /* @__PURE__ */ c("h2", { children: U.empty }),
2021
- /* @__PURE__ */ c("p", { children: U.emptyBody }),
2022
- /* @__PURE__ */ l("div", {
3017
+ /* @__PURE__ */ l("h2", { children: X.empty }),
3018
+ /* @__PURE__ */ l("p", { children: X.emptyBody }),
3019
+ /* @__PURE__ */ u("div", {
2023
3020
  className: "actions",
2024
- children: [/* @__PURE__ */ l("button", {
3021
+ children: [/* @__PURE__ */ u("button", {
2025
3022
  className: "ink large",
2026
3023
  disabled: C,
2027
3024
  onClick: () => Nt.current?.click(),
2028
- children: [U.upload, /* @__PURE__ */ c(ke, {})]
2029
- }), /* @__PURE__ */ c("button", {
3025
+ children: [X.upload, /* @__PURE__ */ l(H, {})]
3026
+ }), /* @__PURE__ */ l("button", {
2030
3027
  className: "outline",
2031
3028
  disabled: C,
2032
- onClick: () => Yt(),
2033
- children: v(m, "Enter measurements")
3029
+ onClick: () => cn(),
3030
+ children: g(p, "Enter measurements")
2034
3031
  })]
2035
3032
  }),
2036
- He && /* @__PURE__ */ c("button", {
3033
+ Fe && /* @__PURE__ */ l("button", {
2037
3034
  className: "outline",
2038
3035
  disabled: C,
2039
- onClick: () => Z(async () => {
2040
- let e = await Y("/projects/" + He);
2041
- X(e), y(e.input.isDraft ? "measure" : "proposals");
3036
+ onClick: () => $(async () => {
3037
+ let e = await Q("/projects/" + Fe);
3038
+ on(e), _(e.input.isDraft ? "measure" : "proposals");
2042
3039
  }),
2043
- children: v(m, "Resume saved project")
3040
+ children: g(p, "Resume saved project")
2044
3041
  }),
2045
- N.mode === "local-demo" && /* @__PURE__ */ c("button", {
3042
+ F.mode === "local-demo" && /* @__PURE__ */ l("button", {
2046
3043
  className: "textbtn",
2047
3044
  disabled: C,
2048
- onClick: Xt,
2049
- children: U.try
3045
+ onClick: ln,
3046
+ children: X.try
2050
3047
  })
2051
3048
  ]
2052
- }) : ne === "measure" && x ? /* @__PURE__ */ l(s, { children: [
2053
- /* @__PURE__ */ c(Pe, {
2054
- language: m,
2055
- input: x,
2056
- setInput: S,
3049
+ }) : Bt ? /* @__PURE__ */ u("section", {
3050
+ className: "paper consent-panel",
3051
+ children: [
3052
+ /* @__PURE__ */ l("h2", { children: {
3053
+ en: "Review an existing plan",
3054
+ de: "Bestehenden Plan prüfen",
3055
+ fr: "Vérifier un plan existant",
3056
+ ar: "مراجعة مخطط قائم"
3057
+ }[p] }),
3058
+ /* @__PURE__ */ l("p", { children: {
3059
+ en: "Preserve the supplied geometry. Image observations never become confirmed metric dimensions automatically.",
3060
+ de: "Die vorgegebene Geometrie bleibt erhalten. Bildbeobachtungen werden nie automatisch zu bestätigten metrischen Maßen.",
3061
+ fr: "Conserver la géométrie fournie. Les observations d’image ne deviennent jamais automatiquement des mesures métriques confirmées.",
3062
+ ar: "احفظ الهندسة المقدمة. لا تتحول ملاحظات الصورة تلقائياً إلى قياسات مترية مؤكدة."
3063
+ }[p] }),
3064
+ /* @__PURE__ */ l("button", {
3065
+ className: "outline",
3066
+ disabled: C || Ht.busy,
3067
+ onClick: () => Nt.current?.click(),
3068
+ children: X.upload
3069
+ }),
3070
+ ze && /* @__PURE__ */ l("img", {
3071
+ src: ze,
3072
+ alt: "Local source image preview",
3073
+ style: {
3074
+ maxWidth: "100%",
3075
+ maxHeight: 350
3076
+ }
3077
+ }),
3078
+ J && !Ve && kn()
3079
+ ]
3080
+ }) : oe === "measure" && y ? /* @__PURE__ */ u(c, { children: [
3081
+ /* @__PURE__ */ l(K, {
3082
+ language: p,
3083
+ input: y,
3084
+ setInput: b,
2057
3085
  onChange: (e) => {
2058
- ht(!0), tt(!1), R(null), rt((t) => e === "footprint.diagonals" && t ? {
3086
+ ut(!0), Xe(!1), Le(null), Qe((t) => e === "footprint.diagonals" && t ? {
2059
3087
  status: "Unvalidated",
2060
3088
  findings: [],
2061
3089
  suggestedDiagonal: t.suggestedDiagonal
2062
- } : null), e && wt((t) => t.filter((t) => t !== e));
3090
+ } : null), e && bt((t) => t.filter((t) => t !== e));
2063
3091
  },
2064
- estimatedFields: Ct,
2065
- confirmed: et,
2066
- setConfirmed: tt,
2067
- onGenerate: Qt,
3092
+ estimatedFields: yt,
3093
+ confirmed: Ye,
3094
+ setConfirmed: Xe,
3095
+ onGenerate: pn,
2068
3096
  busy: C,
2069
3097
  onUpload: () => Nt.current?.click(),
2070
- imageUrl: Ge,
2071
- geometry: nt
3098
+ imageUrl: ze,
3099
+ geometry: Ze
2072
3100
  }),
2073
- z && !B && /* @__PURE__ */ l("section", {
3101
+ J && !Ve && kn(),
3102
+ Ve && /* @__PURE__ */ u("section", {
2074
3103
  className: "paper consent-panel",
2075
3104
  children: [
2076
- /* @__PURE__ */ c("h3", { children: v(m, "Before image upload") }),
2077
- /* @__PURE__ */ c("p", { children: v(m, "The service scans and normalizes the image before storing it. Selecting a file alone does not send it to an AI provider. “Read saved sketch” sends the sanitized image to Anthropic Claude only when you request that step. EU storage is separate from inference location; provider region and data-processing terms require service configuration.") }),
2078
- /* @__PURE__ */ l("label", {
2079
- className: "confirmation",
2080
- children: [/* @__PURE__ */ c("input", {
2081
- type: "checkbox",
2082
- checked: Xe,
2083
- onChange: (e) => Ze(e.target.checked)
2084
- }), v(m, "I have permission to use this image for this project.")]
2085
- }),
2086
- /* @__PURE__ */ l("label", {
2087
- className: "confirmation",
2088
- children: [/* @__PURE__ */ c("input", {
2089
- type: "checkbox",
2090
- checked: Qe,
2091
- onChange: (e) => $e(e.target.checked)
2092
- }), v(m, "I understand the AI image-processing disclosure above.")]
2093
- }),
2094
- /* @__PURE__ */ l("label", {
3105
+ /* @__PURE__ */ l("p", { children: g(p, "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.") }),
3106
+ /* @__PURE__ */ u("label", {
2095
3107
  className: "field",
2096
- children: [v(m, "What would you like to create?"), /* @__PURE__ */ c("textarea", {
2097
- "aria-label": "Sketch brief",
2098
- value: E,
2099
- maxLength: 8e3,
2100
- placeholder: "Room wishes, entrance and view, fixed walls, country…",
2101
- onChange: (e) => se(e.target.value)
2102
- })]
2103
- }),
2104
- /* @__PURE__ */ c("button", {
2105
- className: "ink",
2106
- disabled: C || !Xe || !Qe,
2107
- onClick: pn,
2108
- children: v(m, "Upload for scanning")
2109
- }),
2110
- /* @__PURE__ */ c("button", {
2111
- className: "quiet",
2112
- onClick: () => {
2113
- We(null), Ze(!1), $e(!1);
2114
- },
2115
- children: v(m, "Remove local image")
2116
- })
2117
- ]
2118
- }),
2119
- B && /* @__PURE__ */ l("section", {
2120
- className: "paper consent-panel",
2121
- children: [
2122
- /* @__PURE__ */ c("p", { children: v(m, "Reading sends this sanitized image to Anthropic Claude. EU storage and provider inference location are separate; provider data-processing terms must be configured by the service.") }),
2123
- /* @__PURE__ */ l("label", {
2124
- className: "field",
2125
- children: [v(m, "What should the sketch reader focus on?"), /* @__PURE__ */ c("textarea", {
3108
+ children: [g(p, "What should the sketch reader focus on?"), /* @__PURE__ */ l("textarea", {
2126
3109
  "aria-label": "Saved sketch brief",
3110
+ disabled: C || Ht.busy,
2127
3111
  value: E,
2128
3112
  maxLength: 8e3,
2129
- onChange: (e) => se(e.target.value)
3113
+ onChange: (e) => D(e.target.value)
2130
3114
  })]
2131
3115
  }),
2132
- /* @__PURE__ */ c("button", {
3116
+ /* @__PURE__ */ l("button", {
2133
3117
  className: "outline",
2134
3118
  disabled: C,
2135
- onClick: mn,
2136
- children: v(m, "Read saved sketch with AI · observations only")
3119
+ onClick: jn,
3120
+ children: g(p, "Read saved sketch with AI · observations only")
2137
3121
  })
2138
3122
  ]
2139
3123
  }),
2140
- V && /* @__PURE__ */ l("section", {
3124
+ ht && /* @__PURE__ */ u("section", {
2141
3125
  className: "paper candidate-panel",
2142
3126
  children: [
2143
- /* @__PURE__ */ c("h3", { children: v(m, "Recognized outline · estimated") }),
2144
- /* @__PURE__ */ c("p", { children: V.input ? `${V.input.edges.length} linked boundary edges · geometry ${V.status}` : "The reader did not return a complete, valid outline. Enter or correct measurements manually." }),
2145
- /* @__PURE__ */ c("p", { children: "Lengths use explicit labels only. Image coordinates do not establish physical scale. Bearings and wall types remain assumptions to review." }),
2146
- /* @__PURE__ */ c("button", {
3127
+ /* @__PURE__ */ l("h3", { children: g(p, "Recognized outline · estimated") }),
3128
+ /* @__PURE__ */ l("p", { children: ht.input ? `${ht.input.edges.length} linked boundary edges · geometry ${ht.status}` : "The reader did not return a complete, valid outline. Enter or correct measurements manually." }),
3129
+ /* @__PURE__ */ l("p", { children: "Lengths use explicit labels only. Image coordinates do not establish physical scale. Bearings and wall types remain assumptions to review." }),
3130
+ /* @__PURE__ */ l("button", {
2147
3131
  className: "outline",
2148
- disabled: C || !V.input || xt,
2149
- onClick: vn,
2150
- children: v(m, "Preview recognized outline")
3132
+ disabled: C || !ht.input || _t,
3133
+ onClick: Fn,
3134
+ children: g(p, "Preview recognized outline")
2151
3135
  }),
2152
- xt && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("p", { children: v(m, "Local estimated preview only. The saved project is unchanged.") }), /* @__PURE__ */ c(Fe, { candidate: V })] }),
2153
- /* @__PURE__ */ c(Ne, {
2154
- report: V.values,
2155
- language: m
3136
+ _t && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("p", { children: g(p, "Local estimated preview only. The saved project is unchanged.") }), /* @__PURE__ */ l(Pe, { candidate: ht })] }),
3137
+ /* @__PURE__ */ l(Ne, {
3138
+ report: ht.values,
3139
+ language: p
2156
3140
  })
2157
3141
  ]
2158
3142
  }),
2159
- (kt.length > 0 || Je.length > 0) && /* @__PURE__ */ l("article", {
3143
+ (kt.length > 0 || Ue.length > 0) && /* @__PURE__ */ u("article", {
2160
3144
  className: "paper findings",
2161
3145
  children: [
2162
- /* @__PURE__ */ c("h3", { children: v(m, "Sketch observations to confirm") }),
2163
- /* @__PURE__ */ c("p", { children: "AI readings are estimated and unconfirmed. Compare them with your image and site measurements; enter the reviewed values in the footprint form. No value is applied automatically." }),
2164
- kt.map((e, t) => /* @__PURE__ */ l("section", { children: [
2165
- /* @__PURE__ */ l("strong", { children: [e.kind, e.edgeId ? " · " + e.edgeId : ""] }),
2166
- e.value != null && /* @__PURE__ */ l("p", { children: [
3146
+ /* @__PURE__ */ l("h3", { children: g(p, "Sketch observations to confirm") }),
3147
+ /* @__PURE__ */ l("p", { children: "AI readings are estimated and unconfirmed. Compare them with your image and site measurements; enter the reviewed values in the footprint form. No value is applied automatically." }),
3148
+ kt.map((e, t) => /* @__PURE__ */ u("section", { children: [
3149
+ /* @__PURE__ */ u("strong", { children: [e.kind, e.edgeId ? " · " + e.edgeId : ""] }),
3150
+ e.value != null && /* @__PURE__ */ u("p", { children: [
2167
3151
  e.value,
2168
3152
  " ",
2169
3153
  e.unit ?? "unit unknown",
2170
3154
  " ",
2171
- /* @__PURE__ */ c("span", {
3155
+ /* @__PURE__ */ l("span", {
2172
3156
  className: "value-tag origin-estimated",
2173
3157
  children: "estimated · unconfirmed"
2174
3158
  })
2175
3159
  ] }),
2176
- /* @__PURE__ */ c("p", { children: e.evidence })
3160
+ /* @__PURE__ */ l("p", { children: e.evidence })
2177
3161
  ] }, t)),
2178
- Je.map((e, t) => /* @__PURE__ */ c("p", { children: e }, t)),
2179
- jt && /* @__PURE__ */ c(Ne, {
3162
+ Ue.map((e, t) => /* @__PURE__ */ l("p", { children: e }, t)),
3163
+ jt && /* @__PURE__ */ l(Ne, {
2180
3164
  report: jt,
2181
- language: m
3165
+ language: p
2182
3166
  })
2183
3167
  ]
2184
3168
  })
2185
- ] }) : K ? /* @__PURE__ */ l(s, { children: [
2186
- /* @__PURE__ */ l("div", {
3169
+ ] }) : Z ? /* @__PURE__ */ u(c, { children: [
3170
+ /* @__PURE__ */ u("div", {
2187
3171
  className: "metrics",
2188
3172
  children: [
2189
- /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("span", { children: [
2190
- U.area,
3173
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("span", { children: [
3174
+ X.area,
2191
3175
  " ",
2192
- /* @__PURE__ */ c(F, {
2193
- language: m,
2194
- report: $,
3176
+ /* @__PURE__ */ l(G, {
3177
+ language: p,
3178
+ report: Rn,
2195
3179
  path: "centerlineAreaM2"
2196
3180
  })
2197
- ] }), /* @__PURE__ */ l("strong", { children: [K.centerlineAreaM2.toFixed(2), /* @__PURE__ */ c("small", { children: "m²" })] })] }),
2198
- /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("span", { children: [
2199
- U.net,
3181
+ ] }), /* @__PURE__ */ u("strong", { children: [Z.centerlineAreaM2.toFixed(2), /* @__PURE__ */ l("small", { children: "m²" })] })] }),
3182
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("span", { children: [
3183
+ X.net,
2200
3184
  " ",
2201
- /* @__PURE__ */ c(F, {
2202
- language: m,
2203
- report: $,
3185
+ /* @__PURE__ */ l(G, {
3186
+ language: p,
3187
+ report: Rn,
2204
3188
  path: "netAreaM2"
2205
3189
  })
2206
- ] }), /* @__PURE__ */ l("strong", { children: [K.netAreaM2.toFixed(2), /* @__PURE__ */ c("small", { children: "m²" })] })] }),
2207
- /* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("span", { children: [
2208
- U.perimeter,
3190
+ ] }), /* @__PURE__ */ u("strong", { children: [Z.netAreaM2.toFixed(2), /* @__PURE__ */ l("small", { children: "m²" })] })] }),
3191
+ /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ u("span", { children: [
3192
+ X.perimeter,
2209
3193
  " ",
2210
- /* @__PURE__ */ c(F, {
2211
- language: m,
2212
- report: $,
3194
+ /* @__PURE__ */ l(G, {
3195
+ language: p,
3196
+ report: Rn,
2213
3197
  path: "perimeterM"
2214
3198
  })
2215
- ] }), /* @__PURE__ */ l("strong", { children: [G?.reconciliation.solutions[0]?.perimeterM.toFixed(2), /* @__PURE__ */ c("small", { children: "m" })] })] }),
2216
- /* @__PURE__ */ l("div", {
3199
+ ] }), /* @__PURE__ */ u("strong", { children: [Jt?.reconciliation.solutions[0]?.perimeterM.toFixed(2), /* @__PURE__ */ l("small", { children: "m" })] })] }),
3200
+ /* @__PURE__ */ u("div", {
2217
3201
  className: "metric-note",
2218
- children: [K.hasRequiredConflicts ? U.warning : v(m, "Required layout checks passed"), /* @__PURE__ */ c("span", { children: v(m, "Reference sources remain visible below.") })]
3202
+ children: [Z.hasRequiredConflicts ? X.warning : g(p, "Required layout checks passed"), /* @__PURE__ */ l("span", { children: g(p, "Reference sources remain visible below.") })]
2219
3203
  })
2220
3204
  ]
2221
3205
  }),
2222
- /* @__PURE__ */ l("div", {
3206
+ /* @__PURE__ */ u("div", {
2223
3207
  className: "drawing-layout",
2224
- children: [/* @__PURE__ */ l("article", {
3208
+ children: [/* @__PURE__ */ u("article", {
2225
3209
  className: "drawing paper",
2226
3210
  children: [
2227
- /* @__PURE__ */ l("div", {
3211
+ /* @__PURE__ */ u("div", {
2228
3212
  className: "drawing-top",
2229
3213
  children: [
2230
- /* @__PURE__ */ l("span", { children: ["LAYOUT ", K.id] }),
2231
- /* @__PURE__ */ c("span", { children: L ? "UNSAVED EDIT PREVIEW" : "ENGINE-CHECKED CONCEPT" }),
2232
- /* @__PURE__ */ c("span", { children: "METRES / CONCEPT" })
3214
+ /* @__PURE__ */ u("span", { children: ["LAYOUT ", Z.id] }),
3215
+ /* @__PURE__ */ l("span", { children: q ? "UNSAVED EDIT PREVIEW" : "ENGINE-CHECKED CONCEPT" }),
3216
+ /* @__PURE__ */ l("span", { children: "METRES / CONCEPT" })
2233
3217
  ]
2234
3218
  }),
2235
- /* @__PURE__ */ c("div", {
3219
+ /* @__PURE__ */ l("div", {
2236
3220
  className: "engine-svg",
2237
- dangerouslySetInnerHTML: { __html: o.sanitize(K.svg, { USE_PROFILES: {
3221
+ dangerouslySetInnerHTML: { __html: s.sanitize(Z.svg, { USE_PROFILES: {
2238
3222
  svg: !0,
2239
3223
  svgFilters: !0
2240
3224
  } }) }
2241
3225
  }),
2242
- /* @__PURE__ */ l("div", {
3226
+ /* @__PURE__ */ u("div", {
2243
3227
  className: "drawing-bottom",
2244
- children: [/* @__PURE__ */ c("span", { children: p === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION" }), /* @__PURE__ */ l("span", { children: [
2245
- L ? "PREVIEW / " : "",
3228
+ children: [/* @__PURE__ */ l("span", { children: f === "karamentreprises" ? "KARAMENTREPRISES BIM" : "BAULYNQ VISION" }), /* @__PURE__ */ u("span", { children: [
3229
+ q ? "PREVIEW / " : "",
2246
3230
  "v",
2247
- G?.version,
3231
+ Jt?.version,
2248
3232
  " · ",
2249
- m.toUpperCase()
3233
+ p.toUpperCase()
2250
3234
  ] })]
2251
3235
  })
2252
3236
  ]
2253
- }), /* @__PURE__ */ l("aside", {
3237
+ }), /* @__PURE__ */ u("aside", {
2254
3238
  className: "proposal-panel",
2255
3239
  children: [
2256
- /* @__PURE__ */ c("span", {
3240
+ /* @__PURE__ */ l("span", {
2257
3241
  className: "eyebrow",
2258
3242
  children: "FIND YOUR FIT"
2259
3243
  }),
2260
- G?.proposals.map((e) => /* @__PURE__ */ l("button", {
2261
- className: "proposal-card " + (ie === e.id ? "selected" : ""),
3244
+ Jt?.proposals.map((e) => /* @__PURE__ */ u("button", {
3245
+ className: "proposal-card " + (ce === e.id ? "selected" : ""),
2262
3246
  disabled: C,
2263
3247
  onClick: () => {
2264
- ie !== e.id && (ae(e.id), fe(null), A(null));
3248
+ ce !== e.id && (S(e.id), pe(null), fe(null));
2265
3249
  },
2266
- children: [/* @__PURE__ */ c("span", {
3250
+ children: [/* @__PURE__ */ l("span", {
2267
3251
  className: "proposal-letter",
2268
3252
  children: e.id
2269
- }), /* @__PURE__ */ l("div", { children: [
2270
- e.recommended && /* @__PURE__ */ c("small", {
3253
+ }), /* @__PURE__ */ u("div", { children: [
3254
+ e.recommended && /* @__PURE__ */ l("small", {
2271
3255
  className: "badge",
2272
- children: U.recommended
3256
+ children: X.recommended
2273
3257
  }),
2274
- /* @__PURE__ */ c("h3", { children: e.title }),
2275
- /* @__PURE__ */ c("p", { children: e.tradeOffs[0] })
3258
+ /* @__PURE__ */ l("h3", { children: e.title }),
3259
+ /* @__PURE__ */ l("p", { children: e.tradeOffs[0] })
2276
3260
  ] })]
2277
3261
  }, e.id)),
2278
- /* @__PURE__ */ l("button", {
3262
+ /* @__PURE__ */ u("button", {
2279
3263
  className: "ink full",
2280
- disabled: C || !!L,
2281
- onClick: () => tn(K),
2282
- children: [U.select, /* @__PURE__ */ c(ke, {})]
3264
+ disabled: C || !!q,
3265
+ onClick: () => gn(Z),
3266
+ children: [X.select, /* @__PURE__ */ l(H, {})]
2283
3267
  }),
2284
- !e && b && /* @__PURE__ */ l("section", {
2285
- className: "project-price",
2286
- children: [
2287
- /* @__PURE__ */ c("h3", { children: v(m, "Project billing") }),
2288
- /* @__PURE__ */ c("p", { children: "One project includes proposals, refinements and its BIM model within the configured caps. Free allowances are checked by the service." }),
2289
- q ? /* @__PURE__ */ l("p", {
2290
- className: "quota-disclosure",
2291
- children: [
2292
- "After the initial proposal request: ",
2293
- q.regenerations,
2294
- " regenerations · ",
2295
- q.chat,
2296
- " chat refinements · ",
2297
- q.exports,
2298
- " ",
2299
- q.exports === 1 ? "BIM export" : "BIM exports",
2300
- " per paid project."
2301
- ]
2302
- }) : /* @__PURE__ */ c("p", { children: "Project usage limits are unavailable. Checkout stays disabled until they can be shown." }),
2303
- O ? /* @__PURE__ */ l(s, { children: [
2304
- /* @__PURE__ */ c("strong", { children: _e({
2305
- priceMinorUnits: O.priceMinorUnits,
2306
- currency: O.currency
2307
- }, m) }),
2308
- /* @__PURE__ */ l("p", { children: [
2309
- "Quote valid until ",
2310
- new Date(O.expiresAtUtc).toLocaleString(m),
2311
- "."
2312
- ] }),
2313
- /* @__PURE__ */ c("button", {
2314
- className: "ink full",
2315
- disabled: C || !Ut || !q,
2316
- onClick: sn,
2317
- children: v(m, "Continue to Stripe")
2318
- }),
2319
- /* @__PURE__ */ c("button", {
2320
- className: "textbtn",
2321
- disabled: C,
2322
- onClick: on,
2323
- children: v(m, "Refresh project quote")
2324
- })
2325
- ] }) : /* @__PURE__ */ c("button", {
2326
- className: "outline full",
2327
- disabled: C || !Ut,
2328
- onClick: on,
2329
- children: v(m, "View project price")
2330
- }),
2331
- !Ut && /* @__PURE__ */ c("small", { children: v(m, "Purchases are not enabled in this environment.") }),
2332
- /* @__PURE__ */ c("small", { children: "A checkout return is not proof of payment; downloads use the service's verified entitlement." })
2333
- ]
2334
- }),
2335
- /* @__PURE__ */ l("section", {
3268
+ !t && v && bn(),
3269
+ /* @__PURE__ */ u("section", {
2336
3270
  className: "drawing-downloads",
2337
3271
  children: [
2338
- /* @__PURE__ */ c("h3", { children: v(m, "2D concept drawings") }),
2339
- /* @__PURE__ */ c("button", {
3272
+ /* @__PURE__ */ l("h3", { children: g(p, "2D concept drawings") }),
3273
+ /* @__PURE__ */ l("button", {
2340
3274
  className: "outline full",
2341
- disabled: C || !!L,
2342
- onClick: ln,
2343
- children: v(m, "Prepare PDF / editable DXF / SVG")
3275
+ disabled: C || !!q,
3276
+ onClick: wn,
3277
+ children: g(p, "Prepare PDF / editable DXF / SVG")
2344
3278
  }),
2345
- k && Object.keys(k.files).map((e) => /* @__PURE__ */ l("button", {
3279
+ A && Object.keys(A.files).map((e) => /* @__PURE__ */ u("button", {
2346
3280
  className: "quiet",
2347
- onClick: () => dn(e, k),
3281
+ onClick: () => En(e, A),
2348
3282
  children: [e.toUpperCase(), " ↓"]
2349
3283
  }, e)),
2350
- /* @__PURE__ */ c("small", { children: "Separate from the BIM model export. PDF is included when the service has PDF rendering configured." })
3284
+ /* @__PURE__ */ l("small", { children: "Separate from the BIM model export. PDF is included when the service has PDF rendering configured." })
2351
3285
  ]
2352
3286
  }),
2353
- /* @__PURE__ */ l("div", {
3287
+ /* @__PURE__ */ u("div", {
2354
3288
  className: "tradeoffs",
2355
- children: [/* @__PURE__ */ c("h3", { children: U.tradeoffs }), K.tradeOffs.map((e, t) => /* @__PURE__ */ c("p", { children: e }, t))]
3289
+ children: [/* @__PURE__ */ l("h3", { children: X.tradeoffs }), Z.tradeOffs.map((e, t) => /* @__PURE__ */ l("p", { children: e }, t))]
2356
3290
  }),
2357
- ne === "download" ? /* @__PURE__ */ l(s, { children: [
2358
- /* @__PURE__ */ c("h3", { children: U.download }),
2359
- de ? Object.keys(de.files).map((e) => /* @__PURE__ */ l("button", {
3291
+ oe === "download" ? /* @__PURE__ */ u(c, { children: [
3292
+ /* @__PURE__ */ l("h3", { children: X.download }),
3293
+ j ? Object.keys(j.files).map((e) => /* @__PURE__ */ u("button", {
2360
3294
  className: "outline full",
2361
- onClick: () => dn(e),
3295
+ onClick: () => En(e),
2362
3296
  children: [e.toUpperCase(), " ↓"]
2363
- }, e)) : /* @__PURE__ */ l("button", {
3297
+ }, e)) : /* @__PURE__ */ u("button", {
2364
3298
  className: "ink full",
2365
- disabled: C || !!L || K.hasRequiredConflicts,
2366
- onClick: un,
2367
- children: [U.export, /* @__PURE__ */ c(ke, {})]
3299
+ disabled: C || !!q || Z.hasRequiredConflicts,
3300
+ onClick: Tn,
3301
+ children: [X.export, /* @__PURE__ */ l(H, {})]
2368
3302
  }),
2369
- /* @__PURE__ */ c("small", { children: de?.viewerVerification ?? U.downloadNote })
2370
- ] }) : /* @__PURE__ */ l("div", {
3303
+ /* @__PURE__ */ l("small", { children: j?.viewerVerification ?? X.downloadNote })
3304
+ ] }) : /* @__PURE__ */ u("div", {
2371
3305
  className: "chat",
2372
3306
  children: [
2373
- /* @__PURE__ */ c("h3", { children: U.chat }),
2374
- /* @__PURE__ */ c("textarea", {
2375
- "aria-label": U.chat,
2376
- placeholder: U.hint,
3307
+ /* @__PURE__ */ l("h3", { children: X.chat }),
3308
+ /* @__PURE__ */ l("textarea", {
3309
+ "aria-label": X.chat,
3310
+ disabled: C || Ht.busy,
3311
+ placeholder: X.hint,
2377
3312
  value: E,
2378
3313
  maxLength: 8e3,
2379
- onChange: (e) => se(e.target.value)
3314
+ onChange: (e) => D(e.target.value)
2380
3315
  }),
2381
- /* @__PURE__ */ l("button", {
3316
+ /* @__PURE__ */ u("button", {
2382
3317
  className: "outline full",
2383
3318
  disabled: C || !E.trim(),
2384
- onClick: $t,
2385
- children: [U.send, " →"]
3319
+ onClick: mn,
3320
+ children: [X.send, " →"]
2386
3321
  })
2387
3322
  ]
2388
3323
  })
2389
3324
  ]
2390
3325
  })]
2391
3326
  }),
2392
- /* @__PURE__ */ l("div", {
3327
+ /* @__PURE__ */ u("div", {
2393
3328
  className: "detail-grid",
2394
- children: [/* @__PURE__ */ l("article", {
3329
+ children: [/* @__PURE__ */ u("article", {
2395
3330
  className: "paper schedule",
2396
- children: [/* @__PURE__ */ c("h3", { children: U.schedule }), /* @__PURE__ */ l("table", { children: [
2397
- /* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", { children: [
2398
- /* @__PURE__ */ c("th", { children: v(m, "Room") }),
2399
- /* @__PURE__ */ c("th", { children: "W × D" }),
2400
- /* @__PURE__ */ c("th", { children: v(m, "Axis m²") }),
2401
- /* @__PURE__ */ c("th", { children: v(m, "Net m²") })
3331
+ children: [/* @__PURE__ */ l("h3", { children: X.schedule }), /* @__PURE__ */ u("table", { children: [
3332
+ /* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", { children: [
3333
+ /* @__PURE__ */ l("th", { children: g(p, "Room") }),
3334
+ /* @__PURE__ */ l("th", { children: "W × D" }),
3335
+ /* @__PURE__ */ l("th", { children: g(p, "Axis m²") }),
3336
+ /* @__PURE__ */ l("th", { children: g(p, "Net m²") })
2402
3337
  ] }) }),
2403
- /* @__PURE__ */ c("tbody", { children: K.schedule.map((e) => /* @__PURE__ */ l("tr", { children: [
2404
- /* @__PURE__ */ c("td", { children: e.name }),
2405
- /* @__PURE__ */ l("td", { children: [
3338
+ /* @__PURE__ */ l("tbody", { children: Z.schedule.map((e) => /* @__PURE__ */ u("tr", { children: [
3339
+ /* @__PURE__ */ l("td", { children: e.name }),
3340
+ /* @__PURE__ */ u("td", { children: [
2406
3341
  e.widthM.toFixed(2),
2407
3342
  " × ",
2408
3343
  e.depthM.toFixed(2),
2409
- /* @__PURE__ */ c(F, {
2410
- language: m,
2411
- report: $,
3344
+ /* @__PURE__ */ l(G, {
3345
+ language: p,
3346
+ report: Rn,
2412
3347
  path: `${e.roomId}.widthM`
2413
3348
  }),
2414
- /* @__PURE__ */ c(F, {
2415
- language: m,
2416
- report: $,
3349
+ /* @__PURE__ */ l(G, {
3350
+ language: p,
3351
+ report: Rn,
2417
3352
  path: `${e.roomId}.depthM`
2418
3353
  })
2419
3354
  ] }),
2420
- /* @__PURE__ */ l("td", { children: [e.centerlineAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2421
- language: m,
2422
- report: $,
3355
+ /* @__PURE__ */ u("td", { children: [e.centerlineAreaM2.toFixed(2), /* @__PURE__ */ l(G, {
3356
+ language: p,
3357
+ report: Rn,
2423
3358
  path: `${e.roomId}.centerlineAreaM2`
2424
3359
  })] }),
2425
- /* @__PURE__ */ l("td", { children: [e.netAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2426
- language: m,
2427
- report: $,
3360
+ /* @__PURE__ */ u("td", { children: [e.netAreaM2.toFixed(2), /* @__PURE__ */ l(G, {
3361
+ language: p,
3362
+ report: Rn,
2428
3363
  path: `${e.roomId}.netAreaM2`
2429
3364
  })] })
2430
3365
  ] }, e.roomId)) }),
2431
- /* @__PURE__ */ c("tfoot", { children: /* @__PURE__ */ l("tr", { children: [
2432
- /* @__PURE__ */ c("th", { children: v(m, "Total") }),
2433
- /* @__PURE__ */ c("td", {}),
2434
- /* @__PURE__ */ l("th", { children: [K.centerlineAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2435
- language: m,
2436
- report: $,
3366
+ /* @__PURE__ */ l("tfoot", { children: /* @__PURE__ */ u("tr", { children: [
3367
+ /* @__PURE__ */ l("th", { children: g(p, "Total") }),
3368
+ /* @__PURE__ */ l("td", {}),
3369
+ /* @__PURE__ */ u("th", { children: [Z.centerlineAreaM2.toFixed(2), /* @__PURE__ */ l(G, {
3370
+ language: p,
3371
+ report: Rn,
2437
3372
  path: "centerlineAreaM2"
2438
3373
  })] }),
2439
- /* @__PURE__ */ l("th", { children: [K.netAreaM2.toFixed(2), /* @__PURE__ */ c(F, {
2440
- language: m,
2441
- report: $,
3374
+ /* @__PURE__ */ u("th", { children: [Z.netAreaM2.toFixed(2), /* @__PURE__ */ l(G, {
3375
+ language: p,
3376
+ report: Rn,
2442
3377
  path: "netAreaM2"
2443
3378
  })] })
2444
3379
  ] }) })
2445
3380
  ] })]
2446
- }), /* @__PURE__ */ l("article", {
3381
+ }), /* @__PURE__ */ u("article", {
2447
3382
  className: "paper check-summary",
2448
3383
  children: [
2449
- /* @__PURE__ */ c("h3", { children: U.checks }),
2450
- /* @__PURE__ */ c("div", {
3384
+ /* @__PURE__ */ l("h3", { children: X.checks }),
3385
+ /* @__PURE__ */ l("div", {
2451
3386
  className: "check-counts",
2452
- children: Object.entries(xn).map(([e, t]) => /* @__PURE__ */ l("span", { children: [/* @__PURE__ */ c("strong", { children: t }), e] }, e))
3387
+ children: Object.entries(zn).map(([e, t]) => /* @__PURE__ */ u("span", { children: [/* @__PURE__ */ l("strong", { children: t }), e] }, e))
2453
3388
  }),
2454
- /* @__PURE__ */ l("button", {
3389
+ /* @__PURE__ */ u("button", {
2455
3390
  className: "textbtn",
2456
- onClick: () => Ie(!Me),
3391
+ onClick: () => xe(!I),
2457
3392
  children: [
2458
- Me ? v(m, "Hide") : U.notes,
3393
+ I ? g(p, "Hide") : X.notes,
2459
3394
  " ",
2460
- Me ? "−" : "+"
3395
+ I ? "−" : "+"
2461
3396
  ]
2462
3397
  }),
2463
- /* @__PURE__ */ c("p", { children: "Reference-only entries are disclosed, never presented as passed checks. Country statutory certification is not inferred." })
3398
+ /* @__PURE__ */ l("p", { children: "Reference-only entries are disclosed, never presented as passed checks. Country statutory certification is not inferred." })
2464
3399
  ]
2465
3400
  })]
2466
3401
  }),
2467
- Me && /* @__PURE__ */ c("article", {
3402
+ I && /* @__PURE__ */ l("article", {
2468
3403
  className: "paper findings",
2469
- children: K.findings.map((e, t) => /* @__PURE__ */ l("details", { children: [
2470
- /* @__PURE__ */ l("summary", { children: [
2471
- /* @__PURE__ */ c("span", {
3404
+ children: Z.findings.map((e, t) => /* @__PURE__ */ u("details", { children: [
3405
+ /* @__PURE__ */ u("summary", { children: [
3406
+ /* @__PURE__ */ l("span", {
2472
3407
  className: "status " + e.status,
2473
3408
  children: e.status
2474
3409
  }),
2475
- /* @__PURE__ */ c("code", { children: e.ruleId }),
2476
- /* @__PURE__ */ c("span", { children: e.subjectId })
3410
+ /* @__PURE__ */ l("code", { children: e.ruleId }),
3411
+ /* @__PURE__ */ l("span", { children: e.subjectId })
2477
3412
  ] }),
2478
- /* @__PURE__ */ c("p", { children: e.measurement }),
2479
- e.fix && /* @__PURE__ */ c("p", { children: e.fix }),
2480
- /* @__PURE__ */ c("small", { children: e.source })
3413
+ /* @__PURE__ */ l("p", { children: e.measurement }),
3414
+ e.fix && /* @__PURE__ */ l("p", { children: e.fix }),
3415
+ /* @__PURE__ */ l("small", { children: e.source })
2481
3416
  ] }, t))
2482
3417
  }),
2483
- /* @__PURE__ */ c("p", {
3418
+ /* @__PURE__ */ l("p", {
2484
3419
  className: "disclaimer",
2485
- children: U.disclaimer
3420
+ children: X.disclaimer
2486
3421
  })
2487
- ] }) : G ? /* @__PURE__ */ l("section", {
3422
+ ] }) : Jt ? /* @__PURE__ */ u("section", {
2488
3423
  className: "paper findings",
2489
3424
  role: "status",
2490
3425
  children: [
2491
- /* @__PURE__ */ c("h2", { children: v(m, "No layout proposal is available") }),
2492
- /* @__PURE__ */ c("p", { children: v(m, "Your measurements are retained. Review the engine findings and measurements before trying again.") }),
2493
- /* @__PURE__ */ l("p", { children: [
2494
- v(m, "Status"),
3426
+ /* @__PURE__ */ l("h2", { children: g(p, "No layout proposal is available") }),
3427
+ /* @__PURE__ */ l("p", { children: g(p, "Your measurements are retained. Review the engine findings and measurements before trying again.") }),
3428
+ /* @__PURE__ */ u("p", { children: [
3429
+ g(p, "Status"),
2495
3430
  ": ",
2496
- G.reconciliation.status
3431
+ Jt.reconciliation.status
2497
3432
  ] }),
2498
- G.reconciliation.findings.map((e, t) => /* @__PURE__ */ c("p", { children: e.message }, t)),
2499
- /* @__PURE__ */ c("button", {
3433
+ Jt.reconciliation.findings.map((e, t) => /* @__PURE__ */ l("p", { children: e.message }, t)),
3434
+ /* @__PURE__ */ l("button", {
2500
3435
  className: "outline",
2501
3436
  disabled: C,
2502
- onClick: () => y("measure"),
2503
- children: v(m, "Review measurements")
3437
+ onClick: () => _("measure"),
3438
+ children: g(p, "Review measurements")
2504
3439
  }),
2505
- /* @__PURE__ */ c("p", {
3440
+ /* @__PURE__ */ l("p", {
2506
3441
  className: "disclaimer",
2507
- children: U.disclaimer
3442
+ children: X.disclaimer
2508
3443
  })
2509
3444
  ]
2510
3445
  }) : null,
2511
- b && /* @__PURE__ */ c(ee, {
2512
- language: m,
2513
- version: b.version,
3446
+ e && !v && /* @__PURE__ */ l("button", {
3447
+ className: "outline",
3448
+ disabled: C || Ht.busy || Kt,
3449
+ onClick: () => void On(),
3450
+ children: {
3451
+ en: "Preserve an existing plan",
3452
+ de: "Bestehenden Plan erhalten",
3453
+ fr: "Conserver un plan existant",
3454
+ ar: "الحفاظ على مخطط قائم"
3455
+ }[p]
3456
+ }),
3457
+ e && v && /* @__PURE__ */ l("div", {
3458
+ className: "actions",
3459
+ children: /* @__PURE__ */ l("button", {
3460
+ className: "outline",
3461
+ disabled: C || Ht.busy || Kt,
3462
+ "aria-pressed": Bt,
3463
+ onClick: () => Vt(!Bt),
3464
+ children: {
3465
+ en: "Existing plan / layout design",
3466
+ de: "Bestandsplan / Entwurf",
3467
+ fr: "Plan existant / conception",
3468
+ ar: "مخطط قائم / تصميم"
3469
+ }[p]
3470
+ })
3471
+ }),
3472
+ v && !Z && !t && bn(),
3473
+ v?.pendingDraft && /* @__PURE__ */ l("p", {
3474
+ role: "status",
3475
+ children: g(p, "Pending inputs are saved privately. They are not an accepted result.")
3476
+ }),
3477
+ e && v && Bt && /* @__PURE__ */ l(x, {
3478
+ projectId: v.projectId,
3479
+ projectVersion: v.version,
3480
+ pendingDraft: v.pendingDraft ?? void 0,
3481
+ loadSavedOnMount: v.workflow === "existing-plan" && !v.pendingDraft?.graph,
3482
+ persistPending: t ? void 0 : dn,
3483
+ onPendingSaved: t ? void 0 : fn,
3484
+ registerPendingSaver: t ? void 0 : Et,
3485
+ language: p,
3486
+ disabled: C,
3487
+ sourceObjectId: Ve ?? void 0,
3488
+ imageUrl: ze || void 0,
3489
+ api: Q,
3490
+ onState: Wt,
3491
+ onDownload: (e, t) => void En(e, t)
3492
+ }, v.projectId),
3493
+ v && /* @__PURE__ */ l(re, {
3494
+ language: p,
3495
+ version: v.version,
2514
3496
  busy: C,
2515
- preview: !!L,
2516
- open: ct,
2517
- versions: it,
2518
- comparison: ot,
2519
- left: ut,
2520
- right: ft,
2521
- onToggle: nn,
3497
+ preview: !!q,
3498
+ open: rt,
3499
+ versions: $e,
3500
+ comparison: tt,
3501
+ left: at,
3502
+ right: st,
3503
+ onToggle: _n,
2522
3504
  onLeftChange: (e) => {
2523
- dt(e), st(null);
3505
+ ot(e), nt(null);
2524
3506
  },
2525
3507
  onRightChange: (e) => {
2526
- pt(e), st(null);
3508
+ ct(e), nt(null);
2527
3509
  },
2528
- onCompare: rn,
2529
- onRestore: an
3510
+ onCompare: vn,
3511
+ onRestore: yn
2530
3512
  }),
2531
- (G || nt) && /* @__PURE__ */ c(Ne, {
2532
- report: $,
2533
- language: m
3513
+ (Jt || Ze) && /* @__PURE__ */ l(Ne, {
3514
+ report: Rn,
3515
+ language: p
2534
3516
  })
2535
3517
  ]
2536
3518
  }),
2537
- /* @__PURE__ */ c("input", {
3519
+ /* @__PURE__ */ l("input", {
2538
3520
  hidden: !0,
2539
3521
  type: "file",
2540
3522
  ref: Nt,
2541
3523
  accept: "image/png,image/jpeg,image/webp",
2542
3524
  onChange: (e) => {
2543
3525
  let t = e.target.files?.[0];
2544
- t && fn(t), e.target.value = "";
3526
+ t && Dn(t), e.target.value = "";
2545
3527
  }
2546
3528
  })
2547
3529
  ]
2548
3530
  }),
2549
- C && /* @__PURE__ */ l("div", {
3531
+ C && /* @__PURE__ */ u("div", {
2550
3532
  className: "working",
2551
3533
  role: "status",
2552
- children: [/* @__PURE__ */ c("span", { className: "spinner" }), U.generating]
3534
+ children: [/* @__PURE__ */ l("span", { className: "spinner" }), X.generating]
2553
3535
  }),
2554
- _ === "studio" && b && Tt.length > 0 && /* @__PURE__ */ c("section", {
3536
+ ie === "studio" && v && xt.length > 0 && /* @__PURE__ */ l("section", {
2555
3537
  className: "paper saved-files",
2556
- children: /* @__PURE__ */ l("details", { children: [/* @__PURE__ */ c("summary", { children: v(m, "Saved project files · download without a new export") }), Tt.map((e) => /* @__PURE__ */ l("article", { children: [
2557
- /* @__PURE__ */ l("strong", { children: [
3538
+ children: /* @__PURE__ */ u("details", { children: [/* @__PURE__ */ l("summary", { children: g(p, "Saved project files · download without a new export") }), xt.map((e) => /* @__PURE__ */ u("article", { children: [
3539
+ /* @__PURE__ */ u("strong", { children: [
2558
3540
  e.kind,
2559
3541
  e.version ? " · v" + e.version : "",
2560
3542
  e.proposalId ? " · " + e.proposalId : ""
2561
3543
  ] }),
2562
- e.files.map((t) => /* @__PURE__ */ l("button", {
3544
+ e.files.map((t) => /* @__PURE__ */ u("button", {
2563
3545
  className: "quiet",
2564
3546
  disabled: C,
2565
- onClick: () => bn(e, t),
3547
+ onClick: () => Ln(e, t),
2566
3548
  children: [t.format.toUpperCase(), " ↓"]
2567
3549
  }, t.objectId)),
2568
3550
  e.kind === "upload" && e.files.find((e) => [
2569
3551
  "png",
2570
3552
  "jpeg",
2571
3553
  "webp"
2572
- ].includes(e.format)) && /* @__PURE__ */ c("button", {
3554
+ ].includes(e.format)) && /* @__PURE__ */ l("button", {
2573
3555
  className: "outline",
2574
3556
  disabled: C,
2575
- onClick: () => yn(e.files.find((e) => [
3557
+ onClick: () => In(e.files.find((e) => [
2576
3558
  "png",
2577
3559
  "jpeg",
2578
3560
  "webp"
2579
3561
  ].includes(e.format)).objectId),
2580
- children: v(m, "Use saved sketch")
3562
+ children: g(p, "Use saved sketch")
2581
3563
  })
2582
3564
  ] }, e.artifactId))] })
2583
3565
  }),
2584
- !e && N.analyticsEnabled === !0 && /* @__PURE__ */ l("aside", {
3566
+ !t && F.analyticsEnabled === !0 && /* @__PURE__ */ u("aside", {
2585
3567
  className: "analytics-choice",
2586
- children: [/* @__PURE__ */ l("label", { children: [/* @__PURE__ */ c("input", {
3568
+ children: [/* @__PURE__ */ u("label", { children: [/* @__PURE__ */ l("input", {
2587
3569
  type: "checkbox",
2588
3570
  checked: Dt,
2589
- onChange: (e) => Jt(e.target.checked)
2590
- }), " Allow optional visit and paywall analytics"] }), /* @__PURE__ */ c("small", { children: "We send event type only, without drawings, dimensions, prompts, URLs or account IDs. Uncheck to withdraw consent and request deletion of this browser's client observations." })]
3571
+ onChange: (e) => an(e.target.checked)
3572
+ }), " Allow optional visit and paywall analytics"] }), /* @__PURE__ */ l("small", { children: "We send event type only, without drawings, dimensions, prompts, URLs or account IDs. Uncheck to withdraw consent and request deletion of this browser's client observations." })]
2591
3573
  }),
2592
- !e && j && gt && /* @__PURE__ */ c("div", {
3574
+ !t && M && dt && /* @__PURE__ */ l("div", {
2593
3575
  className: "modal-backdrop",
2594
- children: /* @__PURE__ */ l("section", {
3576
+ children: /* @__PURE__ */ u("section", {
2595
3577
  className: "modal paper",
2596
3578
  role: "alertdialog",
2597
3579
  "aria-modal": "true",
2598
3580
  "aria-labelledby": "content-deletion-title",
2599
3581
  children: [
2600
- /* @__PURE__ */ c("h2", {
3582
+ /* @__PURE__ */ l("h2", {
2601
3583
  id: "content-deletion-title",
2602
- children: v(m, "Delete all project content?")
3584
+ children: g(p, "Delete all project content?")
2603
3585
  }),
2604
- /* @__PURE__ */ c("p", { children: v(m, "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.") }),
2605
- /* @__PURE__ */ c("button", {
3586
+ /* @__PURE__ */ l("p", { children: g(p, "This requests removal of your projects, sketches and generated files in this service. Account identity, billing and required anti-abuse records are retained. Pending accounting may delay completion; we show the service's result.") }),
3587
+ /* @__PURE__ */ l("button", {
2606
3588
  className: "outline full danger",
2607
3589
  disabled: C,
2608
- onClick: gn,
2609
- children: v(m, "Delete my project content")
3590
+ onClick: Nn,
3591
+ children: g(p, "Delete my project content")
2610
3592
  }),
2611
- /* @__PURE__ */ c("button", {
3593
+ /* @__PURE__ */ l("button", {
2612
3594
  className: "quiet full",
2613
3595
  disabled: C,
2614
- onClick: () => _t(!1),
2615
- children: v(m, "Cancel")
3596
+ onClick: () => ft(!1),
3597
+ children: g(p, "Cancel")
2616
3598
  })
2617
3599
  ]
2618
3600
  })
2619
3601
  }),
2620
- !e && me && /* @__PURE__ */ c("div", {
3602
+ !t && ge && /* @__PURE__ */ l("div", {
2621
3603
  className: "modal-backdrop",
2622
- children: /* @__PURE__ */ l("form", {
3604
+ children: /* @__PURE__ */ u("form", {
2623
3605
  className: "modal paper",
2624
3606
  onSubmit: (e) => {
2625
- e.preventDefault(), _n();
3607
+ e.preventDefault(), Pn();
2626
3608
  },
2627
3609
  children: [
2628
- /* @__PURE__ */ c("button", {
3610
+ /* @__PURE__ */ l("button", {
2629
3611
  type: "button",
2630
3612
  className: "close",
2631
- "aria-label": U.close,
2632
- onClick: () => he(!1),
3613
+ "aria-label": X.close,
3614
+ onClick: () => N(!1),
2633
3615
  children: "×"
2634
3616
  }),
2635
- /* @__PURE__ */ c(Oe, {}),
2636
- /* @__PURE__ */ c("h2", { children: I === "signup" ? v(m, "Create a verified account") : I === "verify" ? v(m, "Verify your email") : U.signin }),
2637
- w && /* @__PURE__ */ c("p", {
3617
+ /* @__PURE__ */ l(je, {}),
3618
+ /* @__PURE__ */ l("h2", { children: L === "signup" ? g(p, "Create a verified account") : L === "verify" ? g(p, "Verify your email") : X.signin }),
3619
+ le && /* @__PURE__ */ l("p", {
2638
3620
  role: "alert",
2639
- children: p === "karamentreprises" ? w.replace(/Polycyphers/gi, "Karamentreprises") : w
3621
+ children: f === "karamentreprises" ? le.replace(/Polycyphers/gi, "Karamentreprises") : le
2640
3622
  }),
2641
- ce && /* @__PURE__ */ c("p", {
3623
+ ue && /* @__PURE__ */ l("p", {
2642
3624
  role: "status",
2643
- children: ce
3625
+ children: ue
2644
3626
  }),
2645
- I !== "verify" && /* @__PURE__ */ l("label", {
3627
+ L !== "verify" && /* @__PURE__ */ u("label", {
2646
3628
  className: "field",
2647
- children: [U.email, /* @__PURE__ */ c("input", {
3629
+ children: [X.email, /* @__PURE__ */ l("input", {
2648
3630
  type: "email",
2649
3631
  autoComplete: "email",
2650
3632
  required: !0,
2651
- value: ge,
2652
- onChange: (e) => ye(e.target.value)
3633
+ value: _e,
3634
+ onChange: (e) => ve(e.target.value)
2653
3635
  })]
2654
3636
  }),
2655
- I === "verify" && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("p", { children: "Open the verification link sent to your email, or paste its token below. Verification happens only when you submit this form." }), /* @__PURE__ */ l("label", {
3637
+ L === "verify" && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("p", { children: "Open the verification link sent to your email, or paste its token below. Verification happens only when you submit this form." }), /* @__PURE__ */ u("label", {
2656
3638
  className: "field",
2657
- children: [v(m, "Verification token"), /* @__PURE__ */ c("input", {
3639
+ children: [g(p, "Verification token"), /* @__PURE__ */ l("input", {
2658
3640
  autoComplete: "off",
2659
3641
  required: !0,
2660
- value: Re,
2661
- onChange: (e) => ze(e.target.value)
3642
+ value: z,
3643
+ onChange: (e) => B(e.target.value)
2662
3644
  })]
2663
3645
  })] }),
2664
- I !== "signup" && /* @__PURE__ */ l("label", {
3646
+ L !== "signup" && /* @__PURE__ */ u("label", {
2665
3647
  className: "field",
2666
- children: [U.password, /* @__PURE__ */ c("input", {
3648
+ children: [X.password, /* @__PURE__ */ l("input", {
2667
3649
  type: "password",
2668
- autoComplete: I === "verify" ? "new-password" : "current-password",
2669
- minLength: I === "verify" ? 10 : void 0,
3650
+ autoComplete: L === "verify" ? "new-password" : "current-password",
3651
+ minLength: L === "verify" ? 10 : void 0,
2670
3652
  required: !0,
2671
- value: M,
2672
- onChange: (e) => Ee(e.target.value)
3653
+ value: P,
3654
+ onChange: (e) => ye(e.target.value)
2673
3655
  })]
2674
3656
  }),
2675
- /* @__PURE__ */ c("button", {
3657
+ /* @__PURE__ */ l("button", {
2676
3658
  className: "ink full",
2677
3659
  disabled: C,
2678
- children: I === "signup" ? v(m, "Send verification email") : I === "verify" ? v(m, "Verify & set password") : U.signin
3660
+ children: L === "signup" ? g(p, "Send verification email") : L === "verify" ? g(p, "Verify & set password") : X.signin
2679
3661
  }),
2680
- /* @__PURE__ */ l("div", {
3662
+ /* @__PURE__ */ u("div", {
2681
3663
  className: "account-modes",
2682
3664
  children: [
2683
- /* @__PURE__ */ c("button", {
3665
+ /* @__PURE__ */ l("button", {
2684
3666
  type: "button",
2685
3667
  className: "textbtn",
2686
- onClick: () => Le("login"),
2687
- children: v(m, "Sign in")
3668
+ onClick: () => R("login"),
3669
+ children: g(p, "Sign in")
2688
3670
  }),
2689
- /* @__PURE__ */ c("button", {
3671
+ /* @__PURE__ */ l("button", {
2690
3672
  type: "button",
2691
3673
  className: "textbtn",
2692
- onClick: () => Le("signup"),
2693
- children: v(m, "Create account")
3674
+ onClick: () => R("signup"),
3675
+ children: g(p, "Create account")
2694
3676
  }),
2695
- /* @__PURE__ */ c("button", {
3677
+ /* @__PURE__ */ l("button", {
2696
3678
  type: "button",
2697
3679
  className: "textbtn",
2698
- onClick: () => Le("verify"),
2699
- children: v(m, "Verify email")
3680
+ onClick: () => R("verify"),
3681
+ children: g(p, "Verify email")
2700
3682
  })
2701
3683
  ]
2702
3684
  }),
2703
- typeof N.verificationCompletionUrl == "string" && /* @__PURE__ */ l("p", { children: ["Verification destination: ", N.verificationCompletionUrl] })
3685
+ typeof F.verificationCompletionUrl == "string" && /* @__PURE__ */ u("p", { children: ["Verification destination: ", F.verificationCompletionUrl] })
2704
3686
  ]
2705
3687
  })
2706
3688
  })
2707
3689
  ]
2708
3690
  });
2709
3691
  }
2710
- function F({ report: e, path: t, language: n = "en" }) {
3692
+ function G({ report: e, path: t, language: n = "en" }) {
2711
3693
  let r = e?.values.find((e) => e.path === t) ?? e?.values.find((e) => e.path.endsWith("." + t));
2712
- return /* @__PURE__ */ l("small", {
3694
+ return /* @__PURE__ */ u("small", {
2713
3695
  className: "value-tag " + (r?.origin ?? "missing"),
2714
3696
  title: r?.source ?? "No provenance supplied for this displayed value.",
2715
3697
  children: [
2716
- v(n, r?.origin ?? "unlabelled"),
3698
+ g(n, r?.origin ?? "unlabelled"),
2717
3699
  " · ",
2718
- v(n, r?.origin !== "estimated" && r?.confirmed === !0 ? "reviewed evidence" : "unconfirmed")
3700
+ g(n, r?.origin !== "estimated" && r?.confirmed === !0 ? "reviewed evidence" : "unconfirmed")
2719
3701
  ]
2720
3702
  });
2721
3703
  }
2722
3704
  function Ne({ report: e, language: t }) {
2723
3705
  let n = t;
2724
- return /* @__PURE__ */ l("section", {
3706
+ return /* @__PURE__ */ u("section", {
2725
3707
  className: "paper provenance",
2726
3708
  children: [
2727
- /* @__PURE__ */ c("h3", { children: v(t, "Value provenance & discrepancies") }),
2728
- /* @__PURE__ */ c("p", { children: e?.notice ?? "No provenance report was supplied. Values are unconfirmed; do not treat them as measured or verified." }),
2729
- /* @__PURE__ */ c("h4", { children: v(t, "Discrepancy report") }),
2730
- e ? e.discrepancies.length ? e.discrepancies.map((e) => /* @__PURE__ */ l("article", { children: [
2731
- /* @__PURE__ */ l("strong", { children: [
3709
+ /* @__PURE__ */ l("h3", { children: g(t, "Value provenance & discrepancies") }),
3710
+ /* @__PURE__ */ l("p", { children: e?.notice ?? "No provenance report was supplied. Values are unconfirmed; do not treat them as measured or verified." }),
3711
+ /* @__PURE__ */ l("h4", { children: g(t, "Discrepancy report") }),
3712
+ e ? e.discrepancies.length ? e.discrepancies.map((e) => /* @__PURE__ */ u("article", { children: [
3713
+ /* @__PURE__ */ u("strong", { children: [
2732
3714
  e.kind,
2733
3715
  " · ",
2734
3716
  e.subject
2735
3717
  ] }),
2736
- /* @__PURE__ */ c("p", { children: e.message }),
2737
- e.appliedFix && /* @__PURE__ */ l("p", { children: ["Applied fix: ", e.appliedFix] }),
2738
- e.question && /* @__PURE__ */ l("p", { children: ["Measurement needed: ", e.question] }),
2739
- e.ruleId && /* @__PURE__ */ c("code", { children: e.ruleId })
2740
- ] }, e.id)) : /* @__PURE__ */ c("p", { children: v(n, "No discrepancies reported by the engine.") }) : /* @__PURE__ */ c("p", { children: v(n, "Discrepancy report unavailable.") }),
2741
- /* @__PURE__ */ l("details", { children: [/* @__PURE__ */ c("summary", { children: v(n, "Every supplied value and its source") }), /* @__PURE__ */ l("table", { children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ l("tr", { children: [
2742
- /* @__PURE__ */ c("th", { children: v(n, "Value") }),
2743
- /* @__PURE__ */ c("th", { children: v(n, "Origin / evidence") }),
2744
- /* @__PURE__ */ c("th", { children: v(n, "Source") })
2745
- ] }) }), /* @__PURE__ */ c("tbody", { children: e?.values.map((t) => /* @__PURE__ */ l("tr", { children: [
2746
- /* @__PURE__ */ l("td", { children: [
2747
- /* @__PURE__ */ c("code", { children: t.path }),
2748
- /* @__PURE__ */ c("br", {}),
3718
+ /* @__PURE__ */ l("p", { children: e.message }),
3719
+ e.appliedFix && /* @__PURE__ */ u("p", { children: ["Applied fix: ", e.appliedFix] }),
3720
+ e.question && /* @__PURE__ */ u("p", { children: ["Measurement needed: ", e.question] }),
3721
+ e.ruleId && /* @__PURE__ */ l("code", { children: e.ruleId })
3722
+ ] }, e.id)) : /* @__PURE__ */ l("p", { children: g(n, "No discrepancies reported by the engine.") }) : /* @__PURE__ */ l("p", { children: g(n, "Discrepancy report unavailable.") }),
3723
+ /* @__PURE__ */ u("details", { children: [/* @__PURE__ */ l("summary", { children: g(n, "Every supplied value and its source") }), /* @__PURE__ */ u("table", { children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ u("tr", { children: [
3724
+ /* @__PURE__ */ l("th", { children: g(n, "Value") }),
3725
+ /* @__PURE__ */ l("th", { children: g(n, "Origin / evidence") }),
3726
+ /* @__PURE__ */ l("th", { children: g(n, "Source") })
3727
+ ] }) }), /* @__PURE__ */ l("tbody", { children: e?.values.map((t) => /* @__PURE__ */ u("tr", { children: [
3728
+ /* @__PURE__ */ u("td", { children: [
3729
+ /* @__PURE__ */ l("code", { children: t.path }),
3730
+ /* @__PURE__ */ l("br", {}),
2749
3731
  t.value,
2750
3732
  " ",
2751
3733
  t.unit
2752
3734
  ] }),
2753
- /* @__PURE__ */ c("td", { children: /* @__PURE__ */ c(F, {
3735
+ /* @__PURE__ */ l("td", { children: /* @__PURE__ */ l(G, {
2754
3736
  language: n,
2755
3737
  report: e,
2756
3738
  path: t.path
2757
3739
  }) }),
2758
- /* @__PURE__ */ l("td", { children: [t.source, t.inputPaths.length > 0 && /* @__PURE__ */ l("small", { children: ["Inputs: ", t.inputPaths.join(", ")] })] })
3740
+ /* @__PURE__ */ u("td", { children: [t.source, t.inputPaths.length > 0 && /* @__PURE__ */ u("small", { children: ["Inputs: ", t.inputPaths.join(", ")] })] })
2759
3741
  ] }, t.path)) })] })] })
2760
3742
  ]
2761
3743
  });
2762
3744
  }
2763
- function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed: i, setConfirmed: a, onGenerate: o, busy: u, onUpload: d, imageUrl: f, geometry: p, language: m }) {
2764
- let h = m, g = (e, i) => {
2765
- i && (e = Ee(e, i, r)), t(e), n(i);
2766
- }, _ = e.programme, ee = [
3745
+ function K({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed: i, setConfirmed: a, onGenerate: o, busy: s, onUpload: ee, imageUrl: te, geometry: d, language: ne }) {
3746
+ let f = ne, p = (e, i) => {
3747
+ i && (e = z(e, i, r)), t(e), n(i);
3748
+ }, m = e.programme, h = [
2767
3749
  ["bedroomWidthM", "Bedroom width"],
2768
3750
  ["bedroomDepthM", "Bedroom depth"],
2769
3751
  ["bathroomWidthM", "Bathroom width"],
@@ -2773,7 +3755,7 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2773
3755
  ["balconyDepthM", "Balcony depth (0 for none)"],
2774
3756
  ["slidingDoorWidthM", "Balcony sliding door width"]
2775
3757
  ];
2776
- function te(t) {
3758
+ function re(t) {
2777
3759
  let n = e.footprint.edges, r = (t ? [...n, {
2778
3760
  id: "",
2779
3761
  startVertexId: "",
@@ -2788,54 +3770,54 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2788
3770
  startVertexId: "V" + (t + 1),
2789
3771
  endVertexId: "V" + ((t + 1) % n.length + 1)
2790
3772
  }));
2791
- g({
3773
+ p({
2792
3774
  ...e,
2793
3775
  footprint: { edges: r }
2794
3776
  });
2795
3777
  }
2796
- return /* @__PURE__ */ l("section", {
3778
+ return /* @__PURE__ */ u("section", {
2797
3779
  className: "measure-layout",
2798
- children: [/* @__PURE__ */ c("article", {
3780
+ children: [/* @__PURE__ */ l("article", {
2799
3781
  className: "paper form-card",
2800
- children: /* @__PURE__ */ l("fieldset", {
2801
- disabled: u,
3782
+ children: /* @__PURE__ */ u("fieldset", {
3783
+ disabled: s,
2802
3784
  style: {
2803
3785
  border: 0,
2804
3786
  padding: 0,
2805
3787
  minWidth: 0
2806
3788
  },
2807
3789
  children: [
2808
- /* @__PURE__ */ c("h2", { children: v(h, "Measured footprint") }),
2809
- /* @__PURE__ */ c("p", { children: "Enter walls in boundary order, counterclockwise. Bearings: 0° east, 90° north. Leave unknown angles blank; the solver may request one diagonal. These are your measurements, not generated dimensions." }),
2810
- /* @__PURE__ */ c("div", {
3790
+ /* @__PURE__ */ l("h2", { children: g(f, "Measured footprint") }),
3791
+ /* @__PURE__ */ l("p", { children: "Enter walls in boundary order, counterclockwise. Bearings: 0° east, 90° north. Leave unknown angles blank; the solver may request one diagonal. These are your measurements, not generated dimensions." }),
3792
+ /* @__PURE__ */ l("div", {
2811
3793
  className: "edge-table",
2812
- children: e.footprint.edges.map((t, n) => /* @__PURE__ */ l("div", {
3794
+ children: e.footprint.edges.map((t, n) => /* @__PURE__ */ u("div", {
2813
3795
  className: "edge-row",
2814
3796
  children: [
2815
- /* @__PURE__ */ l("strong", { children: [
3797
+ /* @__PURE__ */ u("strong", { children: [
2816
3798
  t.id,
2817
3799
  " ",
2818
- /* @__PURE__ */ l("small", { children: [
3800
+ /* @__PURE__ */ u("small", { children: [
2819
3801
  t.startVertexId,
2820
3802
  " → ",
2821
3803
  t.endVertexId
2822
3804
  ] })
2823
3805
  ] }),
2824
- /* @__PURE__ */ l("label", { children: [
2825
- v(h, "Length (m)"),
3806
+ /* @__PURE__ */ u("label", { children: [
3807
+ g(f, "Length (m)"),
2826
3808
  " ",
2827
- /* @__PURE__ */ l("small", { children: [
2828
- v(h, M(e, `footprint.edges[${n}].lengthM`, r)),
3809
+ /* @__PURE__ */ u("small", { children: [
3810
+ g(f, R(e, `footprint.edges[${n}].lengthM`, r)),
2829
3811
  " · ",
2830
- v(h, "unconfirmed")
3812
+ g(f, "unconfirmed")
2831
3813
  ] }),
2832
- /* @__PURE__ */ c("input", {
3814
+ /* @__PURE__ */ l("input", {
2833
3815
  "aria-label": `${t.id} length`,
2834
3816
  type: "number",
2835
3817
  min: "0",
2836
3818
  step: "any",
2837
3819
  value: Number.isFinite(t.lengthM) ? t.lengthM : "",
2838
- onChange: (t) => g({
3820
+ onChange: (t) => p({
2839
3821
  ...e,
2840
3822
  footprint: {
2841
3823
  ...e.footprint,
@@ -2847,21 +3829,21 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2847
3829
  }, `footprint.edges[${n}].lengthM`)
2848
3830
  })
2849
3831
  ] }),
2850
- /* @__PURE__ */ l("label", { children: [
2851
- v(h, "Bearing (°)"),
3832
+ /* @__PURE__ */ u("label", { children: [
3833
+ g(f, "Bearing (°)"),
2852
3834
  " ",
2853
- /* @__PURE__ */ l("small", { children: [
2854
- v(h, M(e, `footprint.edges[${n}].bearingDegrees`, r)),
3835
+ /* @__PURE__ */ u("small", { children: [
3836
+ g(f, R(e, `footprint.edges[${n}].bearingDegrees`, r)),
2855
3837
  " · ",
2856
- v(h, "unconfirmed")
3838
+ g(f, "unconfirmed")
2857
3839
  ] }),
2858
- /* @__PURE__ */ c("input", {
3840
+ /* @__PURE__ */ l("input", {
2859
3841
  "aria-label": `${t.id} bearing`,
2860
3842
  type: "number",
2861
3843
  step: "0.01",
2862
- placeholder: v(h, "Unknown"),
3844
+ placeholder: g(f, "Unknown"),
2863
3845
  value: t.bearingDegrees ?? "",
2864
- onChange: (t) => g({
3846
+ onChange: (t) => p({
2865
3847
  ...e,
2866
3848
  footprint: {
2867
3849
  ...e.footprint,
@@ -2873,10 +3855,10 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2873
3855
  }, `footprint.edges[${n}].bearingDegrees`)
2874
3856
  })
2875
3857
  ] }),
2876
- /* @__PURE__ */ l("label", { children: [v(h, "Wall"), /* @__PURE__ */ l("select", {
3858
+ /* @__PURE__ */ u("label", { children: [g(f, "Wall"), /* @__PURE__ */ u("select", {
2877
3859
  "aria-label": `${t.id} wall type`,
2878
3860
  value: t.wallType,
2879
- onChange: (t) => g({
3861
+ onChange: (t) => p({
2880
3862
  ...e,
2881
3863
  footprint: {
2882
3864
  ...e.footprint,
@@ -2886,52 +3868,52 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2886
3868
  } : e)
2887
3869
  }
2888
3870
  }),
2889
- children: [/* @__PURE__ */ c("option", {
3871
+ children: [/* @__PURE__ */ l("option", {
2890
3872
  value: "exterior",
2891
- children: v(h, "Exterior")
2892
- }), /* @__PURE__ */ c("option", {
3873
+ children: g(f, "Exterior")
3874
+ }), /* @__PURE__ */ l("option", {
2893
3875
  value: "party",
2894
- children: v(h, "Party · no openings")
3876
+ children: g(f, "Party · no openings")
2895
3877
  })]
2896
3878
  })] })
2897
3879
  ]
2898
3880
  }, t.id))
2899
3881
  }),
2900
- _?.source.startsWith("User-entered") && /* @__PURE__ */ l("div", {
3882
+ m?.source.startsWith("User-entered") && /* @__PURE__ */ u("div", {
2901
3883
  className: "actions",
2902
- children: [/* @__PURE__ */ c("button", {
3884
+ children: [/* @__PURE__ */ l("button", {
2903
3885
  className: "outline",
2904
3886
  disabled: e.footprint.edges.length >= 64,
2905
- onClick: () => te(!0),
2906
- children: v(h, "Add wall")
2907
- }), /* @__PURE__ */ c("button", {
3887
+ onClick: () => re(!0),
3888
+ children: g(f, "Add wall")
3889
+ }), /* @__PURE__ */ l("button", {
2908
3890
  className: "quiet",
2909
3891
  disabled: e.footprint.edges.length <= 3,
2910
- onClick: () => te(!1),
2911
- children: v(h, "Remove last wall")
3892
+ onClick: () => re(!1),
3893
+ children: g(f, "Remove last wall")
2912
3894
  })]
2913
3895
  }),
2914
- p?.suggestedDiagonal && /* @__PURE__ */ l("label", {
3896
+ d?.suggestedDiagonal && /* @__PURE__ */ u("label", {
2915
3897
  className: "field",
2916
3898
  children: [
2917
3899
  "Diagonal ",
2918
- p.suggestedDiagonal.startVertexId,
3900
+ d.suggestedDiagonal.startVertexId,
2919
3901
  " → ",
2920
- p.suggestedDiagonal.endVertexId,
3902
+ d.suggestedDiagonal.endVertexId,
2921
3903
  " (m)",
2922
- /* @__PURE__ */ c("small", { children: p.suggestedDiagonal.reason }),
2923
- /* @__PURE__ */ c("input", {
3904
+ /* @__PURE__ */ l("small", { children: d.suggestedDiagonal.reason }),
3905
+ /* @__PURE__ */ l("input", {
2924
3906
  type: "number",
2925
3907
  min: "0",
2926
3908
  step: "any",
2927
3909
  value: e.footprint.diagonals?.[0]?.lengthM ?? "",
2928
- onChange: (t) => g({
3910
+ onChange: (t) => p({
2929
3911
  ...e,
2930
3912
  footprint: {
2931
3913
  ...e.footprint,
2932
3914
  diagonals: t.target.value ? [{
2933
- startVertexId: p.suggestedDiagonal.startVertexId,
2934
- endVertexId: p.suggestedDiagonal.endVertexId,
3915
+ startVertexId: d.suggestedDiagonal.startVertexId,
3916
+ endVertexId: d.suggestedDiagonal.endVertexId,
2935
3917
  lengthM: Number(t.target.value)
2936
3918
  }] : []
2937
3919
  }
@@ -2939,31 +3921,31 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2939
3921
  })
2940
3922
  ]
2941
3923
  }),
2942
- /* @__PURE__ */ l("details", {
2943
- open: !!_,
2944
- children: [/* @__PURE__ */ c("summary", { children: v(h, "Room programme") }), _ ? /* @__PURE__ */ l(s, { children: [
2945
- /* @__PURE__ */ c("p", { children: v(h, "Requested dimensions. Every value is checked by the shared engine.") }),
2946
- /* @__PURE__ */ c("div", {
3924
+ /* @__PURE__ */ u("details", {
3925
+ open: !!m,
3926
+ children: [/* @__PURE__ */ l("summary", { children: g(f, "Room programme") }), m ? /* @__PURE__ */ u(c, { children: [
3927
+ /* @__PURE__ */ l("p", { children: g(f, "Requested dimensions. Every value is checked by the shared engine.") }),
3928
+ /* @__PURE__ */ l("div", {
2947
3929
  className: "programme-grid",
2948
- children: ee.map(([t, n]) => /* @__PURE__ */ l("label", {
3930
+ children: h.map(([t, n]) => /* @__PURE__ */ u("label", {
2949
3931
  className: "field",
2950
3932
  children: [
2951
- v(h, n),
3933
+ g(f, n),
2952
3934
  " (m)",
2953
- /* @__PURE__ */ l("small", { children: [
2954
- v(h, M(e, `programme.${t}`, r)),
3935
+ /* @__PURE__ */ u("small", { children: [
3936
+ g(f, R(e, `programme.${t}`, r)),
2955
3937
  " · ",
2956
- v(h, "unconfirmed")
3938
+ g(f, "unconfirmed")
2957
3939
  ] }),
2958
- /* @__PURE__ */ c("input", {
3940
+ /* @__PURE__ */ l("input", {
2959
3941
  type: "number",
2960
3942
  min: "0",
2961
3943
  step: "0.01",
2962
- value: Number.isFinite(_[t]) ? _[t] : "",
2963
- onChange: (n) => g({
3944
+ value: Number.isFinite(m[t]) ? m[t] : "",
3945
+ onChange: (n) => p({
2964
3946
  ...e,
2965
3947
  programme: {
2966
- ..._,
3948
+ ...m,
2967
3949
  [t]: n.target.value === "" ? NaN : Number(n.target.value)
2968
3950
  }
2969
3951
  }, `programme.${t}`)
@@ -2971,61 +3953,61 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
2971
3953
  ]
2972
3954
  }, t))
2973
3955
  }),
2974
- ["entranceEdgeId", "balconyEdgeId"].map((t) => /* @__PURE__ */ l("label", {
3956
+ ["entranceEdgeId", "balconyEdgeId"].map((t) => /* @__PURE__ */ u("label", {
2975
3957
  className: "field",
2976
- children: [v(h, t === "entranceEdgeId" ? "Entrance wall" : "Balcony wall"), /* @__PURE__ */ l("select", {
2977
- value: _[t],
2978
- onChange: (n) => g({
3958
+ children: [g(f, t === "entranceEdgeId" ? "Entrance wall" : "Balcony wall"), /* @__PURE__ */ u("select", {
3959
+ value: m[t],
3960
+ onChange: (n) => p({
2979
3961
  ...e,
2980
3962
  programme: {
2981
- ..._,
3963
+ ...m,
2982
3964
  [t]: n.target.value
2983
3965
  }
2984
3966
  }),
2985
- children: [/* @__PURE__ */ c("option", {
3967
+ children: [/* @__PURE__ */ l("option", {
2986
3968
  value: "",
2987
- children: v(h, "Choose a wall")
2988
- }), e.footprint.edges.map((e) => /* @__PURE__ */ c("option", { children: e.id }, e.id))]
3969
+ children: g(f, "Choose a wall")
3970
+ }), e.footprint.edges.map((e) => /* @__PURE__ */ l("option", { children: e.id }, e.id))]
2989
3971
  })]
2990
3972
  }, t))
2991
- ] }) : /* @__PURE__ */ l("p", { children: ["This example uses engine concept programme assumptions. They remain estimated until replaced with your own dimensions. ", /* @__PURE__ */ c("button", {
3973
+ ] }) : /* @__PURE__ */ u("p", { children: ["This example uses engine concept programme assumptions. They remain estimated until replaced with your own dimensions. ", /* @__PURE__ */ l("button", {
2992
3974
  className: "textbtn",
2993
- onClick: () => g({
3975
+ onClick: () => p({
2994
3976
  ...e,
2995
- programme: Se(e.language).programme
3977
+ programme: Ee(e.language).programme
2996
3978
  }),
2997
3979
  children: "Enter my own room dimensions"
2998
3980
  })] })]
2999
3981
  }),
3000
- /* @__PURE__ */ l("label", {
3982
+ /* @__PURE__ */ u("label", {
3001
3983
  className: "field",
3002
- children: [v(h, "Main view wall"), /* @__PURE__ */ l("select", {
3984
+ children: [g(f, "Main view wall"), /* @__PURE__ */ u("select", {
3003
3985
  value: e.viewEdgeId,
3004
- onChange: (t) => g({
3986
+ onChange: (t) => p({
3005
3987
  ...e,
3006
3988
  viewEdgeId: t.target.value
3007
3989
  }),
3008
- children: [/* @__PURE__ */ c("option", {
3990
+ children: [/* @__PURE__ */ l("option", {
3009
3991
  value: "",
3010
- children: v(h, "No preference")
3011
- }), e.footprint.edges.map((e) => /* @__PURE__ */ c("option", { children: e.id }, e.id))]
3992
+ children: g(f, "No preference")
3993
+ }), e.footprint.edges.map((e) => /* @__PURE__ */ l("option", { children: e.id }, e.id))]
3012
3994
  })]
3013
3995
  }),
3014
- /* @__PURE__ */ l("label", {
3996
+ /* @__PURE__ */ u("label", {
3015
3997
  className: "field",
3016
3998
  children: [
3017
- v(h, "Clear ceiling height (m)"),
3018
- /* @__PURE__ */ l("small", { children: [
3019
- v(h, M(e, "buildUps.clearCeilingHeightM", r)),
3999
+ g(f, "Clear ceiling height (m)"),
4000
+ /* @__PURE__ */ u("small", { children: [
4001
+ g(f, R(e, "buildUps.clearCeilingHeightM", r)),
3020
4002
  " · ",
3021
- v(h, "unconfirmed")
4003
+ g(f, "unconfirmed")
3022
4004
  ] }),
3023
- /* @__PURE__ */ c("input", {
4005
+ /* @__PURE__ */ l("input", {
3024
4006
  type: "number",
3025
4007
  step: "0.01",
3026
4008
  min: "0",
3027
4009
  value: Number(e.buildUps?.clearCeilingHeightM ?? 2.8),
3028
- onChange: (t) => g({
4010
+ onChange: (t) => p({
3029
4011
  ...e,
3030
4012
  buildUps: {
3031
4013
  ...e.buildUps,
@@ -3035,66 +4017,66 @@ function Pe({ input: e, setInput: t, onChange: n, estimatedFields: r, confirmed:
3035
4017
  })
3036
4018
  ]
3037
4019
  }),
3038
- /* @__PURE__ */ c("p", { children: "Other wall/slab build-ups remain labelled concept placeholders from the shared engine." }),
3039
- /* @__PURE__ */ l("label", {
4020
+ /* @__PURE__ */ l("p", { children: "Other wall/slab build-ups remain labelled concept placeholders from the shared engine." }),
4021
+ /* @__PURE__ */ u("label", {
3040
4022
  className: "field",
3041
- children: [v(h, "Country"), /* @__PURE__ */ l("select", {
4023
+ children: [g(f, "Country"), /* @__PURE__ */ u("select", {
3042
4024
  value: e.country,
3043
- onChange: (t) => g({
4025
+ onChange: (t) => p({
3044
4026
  ...e,
3045
4027
  country: t.target.value
3046
4028
  }),
3047
4029
  children: [
3048
- /* @__PURE__ */ c("option", { children: "unspecified" }),
3049
- /* @__PURE__ */ c("option", { children: "Lebanon" }),
3050
- /* @__PURE__ */ c("option", { children: "Germany" })
4030
+ /* @__PURE__ */ l("option", { children: "unspecified" }),
4031
+ /* @__PURE__ */ l("option", { children: "Lebanon" }),
4032
+ /* @__PURE__ */ l("option", { children: "Germany" })
3051
4033
  ]
3052
4034
  })]
3053
4035
  }),
3054
- /* @__PURE__ */ l("label", {
4036
+ /* @__PURE__ */ u("label", {
3055
4037
  className: "confirmation",
3056
- children: [/* @__PURE__ */ c("input", {
4038
+ children: [/* @__PURE__ */ l("input", {
3057
4039
  type: "checkbox",
3058
4040
  checked: i,
3059
4041
  onChange: (e) => a(e.target.checked)
3060
- }), v(h, "I confirm these measured dimensions and angle assumptions.")]
4042
+ }), g(f, "I confirm these measured dimensions and angle assumptions.")]
3061
4043
  }),
3062
- /* @__PURE__ */ c("button", {
4044
+ /* @__PURE__ */ l("button", {
3063
4045
  className: "ink full",
3064
- disabled: u || !i,
4046
+ disabled: s || !i,
3065
4047
  onClick: o,
3066
- children: v(h, "Check footprint & generate")
4048
+ children: g(f, "Check footprint & generate")
3067
4049
  }),
3068
- /* @__PURE__ */ c("button", {
4050
+ /* @__PURE__ */ l("button", {
3069
4051
  className: "outline full",
3070
- onClick: d,
3071
- children: v(h, "Attach sketch")
4052
+ onClick: ee,
4053
+ children: g(f, "Attach sketch")
3072
4054
  })
3073
4055
  ]
3074
4056
  })
3075
- }), /* @__PURE__ */ c("aside", {
4057
+ }), /* @__PURE__ */ l("aside", {
3076
4058
  className: "paper measure-sketch",
3077
- children: f ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("img", {
4059
+ children: te ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("img", {
3078
4060
  className: "uploaded-preview",
3079
- src: f,
4061
+ src: te,
3080
4062
  alt: "Your selected sketch, local preview"
3081
- }), /* @__PURE__ */ c("p", { children: v(h, "Local image preview. No dimensions are inferred from this display.") })] }) : /* @__PURE__ */ l("div", {
4063
+ }), /* @__PURE__ */ l("p", { children: g(f, "Local image preview. No dimensions are inferred from this display.") })] }) : /* @__PURE__ */ u("div", {
3082
4064
  className: "empty",
3083
4065
  children: [
3084
- /* @__PURE__ */ c("h3", { children: v(h, "Your measurements define the plan.") }),
3085
- /* @__PURE__ */ c("p", { children: v(h, "Attach your sketch for reference. There is no sample footprint hidden behind this form.") }),
3086
- /* @__PURE__ */ c("button", {
4066
+ /* @__PURE__ */ l("h3", { children: g(f, "Your measurements define the plan.") }),
4067
+ /* @__PURE__ */ l("p", { children: g(f, "Attach your sketch for reference. There is no sample footprint hidden behind this form.") }),
4068
+ /* @__PURE__ */ l("button", {
3087
4069
  className: "outline",
3088
- disabled: u,
3089
- onClick: d,
3090
- children: v(h, "Choose sketch image")
4070
+ disabled: s,
4071
+ onClick: ee,
4072
+ children: g(f, "Choose sketch image")
3091
4073
  })
3092
4074
  ]
3093
4075
  })
3094
4076
  })]
3095
4077
  });
3096
4078
  }
3097
- function Fe({ candidate: e }) {
4079
+ function Pe({ candidate: e }) {
3098
4080
  let t = e.reconciliation?.status === "Unique" ? e.reconciliation.solutions[0]?.vertices : null, n = /* @__PURE__ */ new Map();
3099
4081
  for (let t of e.values.values) {
3100
4082
  let e = /^sketch\.topology\.vertices\.([A-Za-z0-9_-]+)\.(x|y)$/.exec(t.path);
@@ -3115,38 +4097,38 @@ function Fe({ candidate: e }) {
3115
4097
  ...n.get(e.startVertexId)
3116
4098
  })).filter((e) => Number.isFinite(e.x) && Number.isFinite(e.y)) ?? [];
3117
4099
  if (r.length < 3 || r.length !== e.input?.edges.length) return null;
3118
- let i = Math.min(...r.map((e) => e.x)), a = Math.min(...r.map((e) => e.y)), o = Math.max(...r.map((e) => e.x)) - i, s = Math.max(...r.map((e) => e.y)) - a, u = Math.min(560 / Math.max(o, 1e-6), 300 / Math.max(s, 1e-6)), d = r.map((e) => ({
4100
+ let i = Math.min(...r.map((e) => e.x)), a = Math.min(...r.map((e) => e.y)), o = Math.max(...r.map((e) => e.x)) - i, s = Math.max(...r.map((e) => e.y)) - a, c = Math.min(560 / Math.max(o, 1e-6), 300 / Math.max(s, 1e-6)), ee = r.map((e) => ({
3119
4101
  id: e.id,
3120
- x: 40 + (e.x - i) * u,
3121
- y: 40 + (e.y - a) * u
4102
+ x: 40 + (e.x - i) * c,
4103
+ y: 40 + (e.y - a) * c
3122
4104
  }));
3123
- return /* @__PURE__ */ l("figure", {
4105
+ return /* @__PURE__ */ u("figure", {
3124
4106
  className: "recognized-outline",
3125
- children: [/* @__PURE__ */ l("svg", {
4107
+ children: [/* @__PURE__ */ u("svg", {
3126
4108
  viewBox: "0 0 640 390",
3127
4109
  role: "img",
3128
4110
  "aria-label": "Unconfirmed recognized outline preview",
3129
- children: [/* @__PURE__ */ c("polygon", {
3130
- points: d.map((e) => `${e.x},${e.y}`).join(" "),
4111
+ children: [/* @__PURE__ */ l("polygon", {
4112
+ points: ee.map((e) => `${e.x},${e.y}`).join(" "),
3131
4113
  fill: "rgba(41,124,112,.07)",
3132
4114
  stroke: "#286e62",
3133
4115
  strokeWidth: "2"
3134
- }), d.map((t, n) => {
3135
- let r = d[(n + 1) % d.length], i = e.input?.edges.find((e) => e.startVertexId === t.id);
3136
- return /* @__PURE__ */ l("g", { children: [
3137
- /* @__PURE__ */ c("circle", {
4116
+ }), ee.map((t, n) => {
4117
+ let r = ee[(n + 1) % ee.length], i = e.input?.edges.find((e) => e.startVertexId === t.id);
4118
+ return /* @__PURE__ */ u("g", { children: [
4119
+ /* @__PURE__ */ l("circle", {
3138
4120
  cx: t.x,
3139
4121
  cy: t.y,
3140
4122
  r: "3",
3141
4123
  fill: "#286e62"
3142
4124
  }),
3143
- /* @__PURE__ */ c("text", {
4125
+ /* @__PURE__ */ l("text", {
3144
4126
  x: t.x + 5,
3145
4127
  y: t.y - 7,
3146
4128
  fontSize: "10",
3147
4129
  children: t.id
3148
4130
  }),
3149
- i && /* @__PURE__ */ l("text", {
4131
+ i && /* @__PURE__ */ u("text", {
3150
4132
  x: (t.x + r.x) / 2 + 5,
3151
4133
  y: (t.y + r.y) / 2 + 12,
3152
4134
  fontSize: "11",
@@ -3159,7 +4141,7 @@ function Fe({ candidate: e }) {
3159
4141
  })
3160
4142
  ] }, t.id);
3161
4143
  })]
3162
- }), /* @__PURE__ */ l("figcaption", { children: [t?.length ? "Deterministic closure preview from estimated inputs." : "Image-space outline estimate; no physical scale.", " Original recognized outline; form edits are checked when you request reconciliation."] })]
4144
+ }), /* @__PURE__ */ u("figcaption", { children: [t?.length ? "Deterministic closure preview from estimated inputs." : "Image-space outline estimate; no physical scale.", " Original recognized outline; form edits are checked when you request reconciliation."] })]
3163
4145
  });
3164
4146
  }
3165
- export { ne as BIM_PACKAGE_ID, y as BIM_PACKAGE_VERSION, je as BimStudio, ge as checkBimLicense, D as clearLicense, u as disableTelemetry, f as enableTelemetry, ce as setLicense };
4147
+ export { S as BIM_PACKAGE_ID, C as BIM_PACKAGE_VERSION, Me as BimStudio, xe as checkBimLicense, M as clearLicense, ee as disableTelemetry, d as enableTelemetry, pe as setLicense };