@flamingo-stack/openframe-frontend-core 0.0.815 → 0.0.817

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/build/export-map.json +1 -1
  2. package/dist/{case-study-card-NLT2JVI7.cjs → case-study-card-IZBMHA6R.cjs} +3 -3
  3. package/dist/{chunk-7ERD34HQ.cjs → chunk-24M2JYM5.cjs} +566 -774
  4. package/dist/{chunk-3E4FIJAM.cjs → chunk-4ROR52OW.cjs} +15 -15
  5. package/dist/{chunk-SWBLTIN4.cjs → chunk-5TSYOIIZ.cjs} +54 -52
  6. package/dist/{chunk-JH65CEO4.cjs → chunk-6F4YGHGM.cjs} +36 -36
  7. package/dist/{chunk-VDXI26G7.cjs → chunk-7KBHLP4E.cjs} +81 -78
  8. package/dist/{chunk-CNTBGJA7.cjs → chunk-A34UNP5V.cjs} +65 -1
  9. package/dist/{chunk-633NTKO2.cjs → chunk-BL2J5RJK.cjs} +31 -53
  10. package/dist/{chunk-7NYWHEQM.cjs → chunk-C2OUXL3Q.cjs} +15 -15
  11. package/dist/{chunk-53JJLHJM.cjs → chunk-DSBRWP5M.cjs} +20 -20
  12. package/dist/chunk-DVHSYPDB.cjs +471 -0
  13. package/dist/{chunk-5TUR7O7H.cjs → chunk-EX7M3VQC.cjs} +90 -90
  14. package/dist/{chunk-EJCUAADF.cjs → chunk-F2LVBRHC.cjs} +4 -4
  15. package/dist/{chunk-GAR2IIU6.cjs → chunk-IM366HS6.cjs} +105 -157
  16. package/dist/{chunk-FUEK43FL.cjs → chunk-IOFIHVVW.cjs} +206 -200
  17. package/dist/{chunk-JOOZTRXQ.cjs → chunk-JMOCM2SW.cjs} +4 -4
  18. package/dist/{chunk-PAI4A3UM.cjs → chunk-K5IICQNF.cjs} +61 -54
  19. package/dist/{chunk-JOKOQOLJ.cjs → chunk-LUID2IB3.cjs} +2 -2
  20. package/dist/{chunk-L7W4455K.cjs → chunk-MAHJY2PO.cjs} +3 -3
  21. package/dist/{chunk-4PMD3JUC.cjs → chunk-NPNZAAOB.cjs} +2 -2
  22. package/dist/{chunk-EB7YAUER.cjs → chunk-P7JQGOX4.cjs} +19 -19
  23. package/dist/{chunk-O6VWD2SB.cjs → chunk-RDHF3F5R.cjs} +3 -3
  24. package/dist/{chunk-HM7VCQSX.cjs → chunk-SBFBNOKU.cjs} +4 -4
  25. package/dist/{chunk-7O7EX7HQ.cjs → chunk-T266OITJ.cjs} +28 -20
  26. package/dist/{chunk-ZAWHRYJZ.cjs → chunk-TKEYWSDZ.cjs} +45 -45
  27. package/dist/{chunk-F4ZJRMMM.cjs → chunk-UDLDXVY4.cjs} +8 -8
  28. package/dist/{chunk-Y6MJMPHV.cjs → chunk-UEULXVW2.cjs} +32 -84
  29. package/dist/{chunk-RYJJHSHV.cjs → chunk-UFBVOBYR.cjs} +23 -23
  30. package/dist/{chunk-IKB6AZPV.cjs → chunk-ZECG6GU5.cjs} +2 -2
  31. package/dist/{chunk-3ELDGEM2.cjs → chunk-ZP4JMX7G.cjs} +87 -84
  32. package/dist/{cloud-tenants-SRTX2FZC.cjs → cloud-tenants-NMAXIJLL.cjs} +11 -11
  33. package/dist/components/announcement-bar.d.ts.map +1 -1
  34. package/dist/components/announcement-bar.js +5 -5
  35. package/dist/components/case-studies/index.cjs +26 -26
  36. package/dist/components/chat/chat-markdown-link.d.ts +15 -0
  37. package/dist/components/chat/chat-markdown-link.d.ts.map +1 -0
  38. package/dist/components/chat/chat-markdown-link.js +22 -0
  39. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  40. package/dist/components/chat/chat-message-enhanced.js +3 -9
  41. package/dist/components/chat/embeddable-chat.d.ts +4 -0
  42. package/dist/components/chat/embeddable-chat.d.ts.map +1 -1
  43. package/dist/components/chat/embeddable-chat.js +30 -67
  44. package/dist/components/chat/entity-cards/chat-card-disclosure.d.ts.map +1 -1
  45. package/dist/components/chat/entity-cards/chat-card-disclosure.js +8 -11
  46. package/dist/components/chat/entity-cards/dispatch.d.ts +5 -5
  47. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  48. package/dist/components/chat/entity-cards/dispatch.js +18 -17
  49. package/dist/components/chat/entity-cards/github-activity-card.d.ts +1 -1
  50. package/dist/components/chat/entity-cards/use-entity-card-link.d.ts +3 -2
  51. package/dist/components/chat/entity-cards/use-entity-card-link.d.ts.map +1 -1
  52. package/dist/components/chat/entity-cards/use-entity-card-link.js +6 -4
  53. package/dist/components/chat/index.cjs +28 -21
  54. package/dist/components/chat/index.d.ts +2 -2
  55. package/dist/components/chat/index.d.ts.map +1 -1
  56. package/dist/components/chat/index.js +4 -3
  57. package/dist/components/chat/{inline-app-link-chip.d.ts → inline-chip.d.ts} +1 -14
  58. package/dist/components/chat/inline-chip.d.ts.map +1 -0
  59. package/dist/components/chat/inline-chip.js +27 -0
  60. package/dist/components/chat/nav-link-anchor-via-runtime.d.ts +45 -11
  61. package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -1
  62. package/dist/components/chat/nav-link-anchor-via-runtime.js +32 -24
  63. package/dist/components/chat/source-action-button.d.ts +12 -3
  64. package/dist/components/chat/source-action-button.d.ts.map +1 -1
  65. package/dist/components/chat/source-action-button.js +41 -26
  66. package/dist/components/chat/types/component.types.d.ts +1 -1
  67. package/dist/components/chat/types/message.types.d.ts +1 -1
  68. package/dist/components/chat/types/message.types.d.ts.map +1 -1
  69. package/dist/components/chat/utils/chat-nav-resolution.d.ts +1 -6
  70. package/dist/components/chat/utils/chat-nav-resolution.d.ts.map +1 -1
  71. package/dist/components/chat/utils/chat-nav-resolution.js +2 -3
  72. package/dist/components/chat/utils/decide-new-tab.d.ts +0 -3
  73. package/dist/components/chat/utils/decide-new-tab.d.ts.map +1 -1
  74. package/dist/components/chat/utils/decide-new-tab.js +0 -1
  75. package/dist/components/chat/utils/execute-navigation.d.ts +36 -34
  76. package/dist/components/chat/utils/execute-navigation.d.ts.map +1 -1
  77. package/dist/components/chat/utils/execute-navigation.js +23 -19
  78. package/dist/components/chat/utils/index.d.ts +5 -5
  79. package/dist/components/chat/utils/index.d.ts.map +1 -1
  80. package/dist/components/chat/utils/index.js +14 -6
  81. package/dist/components/chat/utils/nav-anchor-props.d.ts +35 -8
  82. package/dist/components/chat/utils/nav-anchor-props.d.ts.map +1 -1
  83. package/dist/components/chat/utils/nav-anchor-props.js +14 -5
  84. package/dist/components/chat/utils/new-tab-rel.d.ts +15 -0
  85. package/dist/components/chat/utils/new-tab-rel.d.ts.map +1 -0
  86. package/dist/components/chat/utils/new-tab-rel.js +25 -0
  87. package/dist/components/contact/index.cjs +12 -12
  88. package/dist/components/docs/index.cjs +15 -15
  89. package/dist/components/embeds/index.cjs +12 -12
  90. package/dist/components/faq/index.cjs +13 -13
  91. package/dist/components/features/devices/devices-table-columns.d.ts.map +1 -1
  92. package/dist/components/features/devices/devices-table-columns.js +4 -1
  93. package/dist/components/features/index.cjs +11 -11
  94. package/dist/components/help-center-pages/index.cjs +105 -105
  95. package/dist/components/index.cjs +91 -83
  96. package/dist/components/meeting-scheduler/index.cjs +50 -50
  97. package/dist/components/navigation/app-header.d.ts +1 -4
  98. package/dist/components/navigation/app-header.d.ts.map +1 -1
  99. package/dist/components/navigation/app-header.js +0 -2
  100. package/dist/components/navigation/index.cjs +14 -14
  101. package/dist/components/navigation/ticket-alerts-button.d.ts +1 -4
  102. package/dist/components/navigation/ticket-alerts-button.d.ts.map +1 -1
  103. package/dist/components/navigation/ticket-alerts-button.js +5 -5
  104. package/dist/components/onboarding-guides/index.cjs +14 -14
  105. package/dist/components/product-demo/index.cjs +20 -20
  106. package/dist/components/related-content/card-registry.d.ts +1 -1
  107. package/dist/components/related-content/index.cjs +7 -7
  108. package/dist/components/related-content/related-content-section.d.ts +3 -3
  109. package/dist/components/related-content/related-content-section.d.ts.map +1 -1
  110. package/dist/components/related-content/related-content-section.js +5 -3
  111. package/dist/components/shared/doc-search/resolve-search-result-action.d.ts +10 -3
  112. package/dist/components/shared/doc-search/resolve-search-result-action.d.ts.map +1 -1
  113. package/dist/components/shared/doc-search/resolve-search-result-action.js +8 -17
  114. package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
  115. package/dist/components/shared/doc-search/use-doc-search.js +15 -27
  116. package/dist/components/shared/product-release/product-release-card.d.ts +2 -2
  117. package/dist/components/shared/product-release/product-releases-view.d.ts.map +1 -1
  118. package/dist/components/shared/product-release/product-releases-view.js +1 -3
  119. package/dist/components/tickets/index.cjs +18 -18
  120. package/dist/components/tickets/ticket-detail-drawer.d.ts.map +1 -1
  121. package/dist/components/tickets/ticket-detail-drawer.js +6 -3
  122. package/dist/components/tickets/types.d.ts +1 -1
  123. package/dist/components/ui/button/button.d.ts +1 -1
  124. package/dist/components/ui/hover-dropdown.d.ts +2 -2
  125. package/dist/components/ui/index.cjs +31 -23
  126. package/dist/components/ui/service-card.d.ts.map +1 -1
  127. package/dist/components/ui/service-card.js +4 -1
  128. package/dist/components/vendor-display-button.d.ts.map +1 -1
  129. package/dist/components/vendor-display-button.js +4 -1
  130. package/dist/contexts/chat-runtime-context.d.ts +11 -11
  131. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  132. package/dist/{devices-DL4YU64N.cjs → devices-QBKWVHE6.cjs} +12 -12
  133. package/dist/{embeddable-chat-YRKMPFDY.cjs → embeddable-chat-WNPCPMDL.cjs} +96 -137
  134. package/dist/hooks/index.cjs +5 -5
  135. package/dist/hooks/use-contact-submission.d.ts.map +1 -1
  136. package/dist/hooks/use-contact-submission.js +11 -8
  137. package/dist/index.cjs +40 -34
  138. package/dist/{knowledge-VQW5JL2Z.cjs → knowledge-FSAYWM25.cjs} +12 -12
  139. package/dist/{logs-IY3WBLMW.cjs → logs-OZX4SYHG.cjs} +19 -19
  140. package/dist/{policies-IXWTWMJO.cjs → policies-LPCUCTLX.cjs} +15 -15
  141. package/dist/{scripts-D5CLO5EG.cjs → scripts-ZNFZSONW.cjs} +16 -16
  142. package/dist/{software-update-ULNP6CKJ.cjs → software-update-BRYOVQVY.cjs} +14 -14
  143. package/dist/utils/index.cjs +116 -89
  144. package/dist/utils/open-in-new-tab.d.ts +2 -1
  145. package/dist/utils/open-in-new-tab.d.ts.map +1 -1
  146. package/dist/utils/open-in-new-tab.js +2 -1
  147. package/dist/utils/scroll-into-view.d.ts +1 -1
  148. package/eslint-config/base.js +11 -0
  149. package/eslint-config/navigation.js +142 -0
  150. package/package.json +1 -1
  151. package/src/components/announcement-bar.tsx +8 -6
  152. package/src/components/chat/chat-markdown-link.tsx +42 -0
  153. package/src/components/chat/chat-message-enhanced.tsx +10 -36
  154. package/src/components/chat/embeddable-chat.tsx +63 -106
  155. package/src/components/chat/entity-cards/chat-card-disclosure.tsx +9 -13
  156. package/src/components/chat/entity-cards/dispatch.tsx +45 -35
  157. package/src/components/chat/entity-cards/github-activity-card.tsx +1 -1
  158. package/src/components/chat/entity-cards/use-entity-card-link.ts +11 -16
  159. package/src/components/chat/index.ts +3 -1
  160. package/src/components/chat/{inline-app-link-chip.tsx → inline-chip.tsx} +1 -27
  161. package/src/components/chat/nav-link-anchor-via-runtime.tsx +73 -33
  162. package/src/components/chat/source-action-button.tsx +57 -33
  163. package/src/components/chat/types/component.types.ts +1 -1
  164. package/src/components/chat/types/message.types.ts +1 -1
  165. package/src/components/chat/utils/chat-nav-resolution.ts +3 -8
  166. package/src/components/chat/utils/decide-new-tab.ts +0 -3
  167. package/src/components/chat/utils/execute-navigation.ts +58 -58
  168. package/src/components/chat/utils/index.ts +13 -6
  169. package/src/components/chat/utils/nav-anchor-props.ts +56 -9
  170. package/src/components/chat/utils/new-tab-rel.ts +39 -0
  171. package/src/components/features/devices/devices-table-columns.tsx +4 -1
  172. package/src/components/navigation/app-header.tsx +0 -5
  173. package/src/components/navigation/ticket-alerts-button.tsx +7 -8
  174. package/src/components/related-content/card-registry.tsx +1 -1
  175. package/src/components/related-content/related-content-section.tsx +10 -10
  176. package/src/components/shared/doc-search/resolve-search-result-action.ts +19 -33
  177. package/src/components/shared/doc-search/use-doc-search.ts +21 -44
  178. package/src/components/shared/product-release/product-release-card.tsx +4 -4
  179. package/src/components/shared/product-release/product-releases-view.tsx +2 -5
  180. package/src/components/tickets/ticket-detail-drawer.tsx +7 -4
  181. package/src/components/tickets/types.ts +1 -1
  182. package/src/components/ui/button/button.tsx +2 -2
  183. package/src/components/ui/hover-dropdown.tsx +2 -2
  184. package/src/components/ui/service-card.tsx +4 -1
  185. package/src/components/vendor-display-button.tsx +5 -2
  186. package/src/contexts/chat-runtime-context.tsx +15 -12
  187. package/src/hooks/use-contact-submission.ts +13 -8
  188. package/src/utils/index.ts +1 -1
  189. package/src/utils/open-in-new-tab.ts +4 -2
  190. package/src/utils/scroll-into-view.ts +1 -1
  191. package/dist/chunk-RD66AGUI.cjs +0 -156
  192. package/dist/components/chat/inline-app-link-chip.d.ts.map +0 -1
  193. package/dist/components/chat/inline-app-link-chip.js +0 -37
@@ -0,0 +1,471 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+
3
+
4
+ var _chunkQOAA7ZHBcjs = require('./chunk-QOAA7ZHB.cjs');
5
+
6
+
7
+ var _chunk3V5JWG27cjs = require('./chunk-3V5JWG27.cjs');
8
+
9
+
10
+ var _chunkUJ7AXHRZcjs = require('./chunk-UJ7AXHRZ.cjs');
11
+
12
+
13
+ var _chunk63A4GZMBcjs = require('./chunk-63A4GZMB.cjs');
14
+
15
+ // src/hooks/ui/use-image-edge-color.ts
16
+ var _react = require('react');
17
+ var EDGE_SAMPLE_WIDTH = _chunkQOAA7ZHBcjs.IMAGE_FIXED_WIDTHS[2];
18
+ function extractEdgeColor(img) {
19
+ const canvas = document.createElement("canvas");
20
+ const ctx = canvas.getContext("2d");
21
+ if (!ctx) return "#000000";
22
+ const maxSize = EDGE_SAMPLE_WIDTH;
23
+ const scale = Math.min(maxSize / img.naturalWidth, maxSize / img.naturalHeight);
24
+ const w = Math.round(img.naturalWidth * scale);
25
+ const h = Math.round(img.naturalHeight * scale);
26
+ canvas.width = w;
27
+ canvas.height = h;
28
+ ctx.drawImage(img, 0, 0, w, h);
29
+ const data = ctx.getImageData(0, 0, w, h).data;
30
+ const edgeW = Math.max(2, Math.round(w * 0.15));
31
+ const edgeH = Math.max(2, Math.round(h * 0.15));
32
+ const bucketSize = 32;
33
+ const buckets = /* @__PURE__ */ new Map();
34
+ for (let y = 0; y < h; y++) {
35
+ for (let x = 0; x < w; x++) {
36
+ const isEdge = x < edgeW || x >= w - edgeW || y < edgeH || y >= h - edgeH;
37
+ if (!isEdge) continue;
38
+ const i = (y * w + x) * 4;
39
+ const a = data[i + 3];
40
+ if (a < 128) continue;
41
+ const r2 = data[i];
42
+ const g2 = data[i + 1];
43
+ const b2 = data[i + 2];
44
+ const br = Math.floor(r2 / bucketSize) * bucketSize;
45
+ const bg = Math.floor(g2 / bucketSize) * bucketSize;
46
+ const bb = Math.floor(b2 / bucketSize) * bucketSize;
47
+ const key = `${br},${bg},${bb}`;
48
+ const existing = buckets.get(key);
49
+ if (existing) {
50
+ existing.r += r2;
51
+ existing.g += g2;
52
+ existing.b += b2;
53
+ existing.count++;
54
+ } else {
55
+ buckets.set(key, { r: r2, g: g2, b: b2, count: 1 });
56
+ }
57
+ }
58
+ }
59
+ if (buckets.size === 0) return "#000000";
60
+ let bestBucket = null;
61
+ for (const bucket of buckets.values()) {
62
+ if (!bestBucket || bucket.count > bestBucket.count) {
63
+ bestBucket = bucket;
64
+ }
65
+ }
66
+ if (!bestBucket || bestBucket.count === 0) return "#000000";
67
+ const r = Math.round(bestBucket.r / bestBucket.count);
68
+ const g = Math.round(bestBucket.g / bestBucket.count);
69
+ const b = Math.round(bestBucket.b / bestBucket.count);
70
+ return `rgb(${r}, ${g}, ${b})`;
71
+ }
72
+ function useImageEdgeColor(givenUrl, fallback = "#000000") {
73
+ const imageUrl = _chunk63A4GZMBcjs.useLoadingScope.call(void 0, ) ? null : givenUrl;
74
+ const [color, setColor] = _react.useState.call(void 0, fallback);
75
+ const [resetFor, setResetFor] = _react.useState.call(void 0, { imageUrl, fallback });
76
+ if (resetFor.imageUrl !== imageUrl || resetFor.fallback !== fallback) {
77
+ setResetFor({ imageUrl, fallback });
78
+ if (!imageUrl) setColor(fallback);
79
+ }
80
+ _react.useEffect.call(void 0, () => {
81
+ if (!imageUrl) return void 0;
82
+ let cancelled = false;
83
+ const img = new Image();
84
+ img.crossOrigin = "anonymous";
85
+ img.onload = () => {
86
+ if (cancelled) return;
87
+ try {
88
+ setColor(extractEdgeColor(img));
89
+ } catch (e2) {
90
+ setColor(fallback);
91
+ }
92
+ };
93
+ const sampleUrl = _chunk3V5JWG27cjs.resizedImageUrl.call(void 0, imageUrl, EDGE_SAMPLE_WIDTH);
94
+ let triedOriginal = sampleUrl === imageUrl;
95
+ img.onerror = () => {
96
+ if (cancelled) return;
97
+ if (!triedOriginal) {
98
+ triedOriginal = true;
99
+ img.src = imageUrl;
100
+ return;
101
+ }
102
+ setColor(fallback);
103
+ };
104
+ img.src = sampleUrl;
105
+ return () => {
106
+ cancelled = true;
107
+ };
108
+ }, [imageUrl, fallback]);
109
+ return color;
110
+ }
111
+
112
+ // src/platform-domains.ts
113
+ var PLATFORM_DOMAINS = [
114
+ { key: "marketing-hub", defaultUrl: "https://marketing-hub.flamingo.so", envVar: "NEXT_PUBLIC_MARKETING_HUB_URL" },
115
+ { key: "company-hub", defaultUrl: "https://company-hub.flamingo.so", envVar: "NEXT_PUBLIC_COMPANY_HUB_URL" },
116
+ { key: "product-hub", defaultUrl: "https://product-hub.flamingo.so", envVar: "NEXT_PUBLIC_PRODUCT_HUB_URL" },
117
+ { key: "revenue-hub", defaultUrl: "https://revenue-hub.flamingo.so", envVar: "NEXT_PUBLIC_REVENUE_HUB_URL" },
118
+ { key: "people-hub", defaultUrl: "https://people-hub.flamingo.so", envVar: "NEXT_PUBLIC_PEOPLE_HUB_URL" },
119
+ { key: "coding-hub", defaultUrl: "https://coding-hub.flamingo.so", envVar: "NEXT_PUBLIC_CODING_HUB_URL" },
120
+ { key: "openmsp", defaultUrl: "https://www.openmsp.ai", envVar: "NEXT_PUBLIC_OPENMSP_URL" },
121
+ // ORDERING INVARIANT (first-wins, load-bearing): `flamingo` MUST precede `universal`.
122
+ // Both resolve to www.flamingo.run; the reverse index is first-wins → flamingo claims the shared host,
123
+ // universal contributes no unique host. `flamingo.cx` is the company's older domain: it maps to flamingo.
124
+ // ⚠️ DO NOT REORDER — enforced by the module-load self-check at the bottom of this file.
125
+ {
126
+ key: "flamingo",
127
+ defaultUrl: "https://www.flamingo.run",
128
+ envVar: "NEXT_PUBLIC_FLAMINGO_URL",
129
+ aliasHostnames: ["flamingo.cx", "www.flamingo.cx"]
130
+ },
131
+ { key: "tmcg", defaultUrl: "https://www.tmcg.miami", envVar: "NEXT_PUBLIC_TMCG_URL" },
132
+ { key: "mlg", defaultUrl: "https://www.mlg.soccer", envVar: "NEXT_PUBLIC_MLG_URL" },
133
+ {
134
+ key: "openframe",
135
+ defaultUrl: "https://openframe.ai",
136
+ envVar: "NEXT_PUBLIC_OPENFRAME_URL",
137
+ aliasHostnames: ["openframe.ai", "www.openframe.ai", "hub.openframe.ai"]
138
+ },
139
+ {
140
+ key: "openframe-dashboard",
141
+ defaultUrl: "https://openframe.ai",
142
+ envVar: "NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL",
143
+ pseudo: true
144
+ },
145
+ { key: "universal", defaultUrl: "https://www.flamingo.run", envVar: "NEXT_PUBLIC_FLAMINGO_URL" }
146
+ ];
147
+ var ENV_OVERRIDES = {
148
+ NEXT_PUBLIC_MARKETING_HUB_URL: process.env.NEXT_PUBLIC_MARKETING_HUB_URL,
149
+ NEXT_PUBLIC_COMPANY_HUB_URL: process.env.NEXT_PUBLIC_COMPANY_HUB_URL,
150
+ NEXT_PUBLIC_PRODUCT_HUB_URL: process.env.NEXT_PUBLIC_PRODUCT_HUB_URL,
151
+ NEXT_PUBLIC_REVENUE_HUB_URL: process.env.NEXT_PUBLIC_REVENUE_HUB_URL,
152
+ NEXT_PUBLIC_PEOPLE_HUB_URL: process.env.NEXT_PUBLIC_PEOPLE_HUB_URL,
153
+ NEXT_PUBLIC_CODING_HUB_URL: process.env.NEXT_PUBLIC_CODING_HUB_URL,
154
+ NEXT_PUBLIC_OPENMSP_URL: process.env.NEXT_PUBLIC_OPENMSP_URL,
155
+ NEXT_PUBLIC_FLAMINGO_URL: process.env.NEXT_PUBLIC_FLAMINGO_URL,
156
+ NEXT_PUBLIC_TMCG_URL: process.env.NEXT_PUBLIC_TMCG_URL,
157
+ NEXT_PUBLIC_MLG_URL: process.env.NEXT_PUBLIC_MLG_URL,
158
+ NEXT_PUBLIC_OPENFRAME_URL: process.env.NEXT_PUBLIC_OPENFRAME_URL,
159
+ NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL: process.env.NEXT_PUBLIC_OPENFRAME_DASHBOARD_URL
160
+ };
161
+ function byKey(key) {
162
+ return PLATFORM_DOMAINS.find((e) => e.key === key);
163
+ }
164
+ function envOverrideFor(key) {
165
+ const envVar = _optionalChain([byKey, 'call', _ => _(key), 'optionalAccess', _2 => _2.envVar]);
166
+ if (!envVar) return null;
167
+ return ENV_OVERRIDES[envVar] || null;
168
+ }
169
+ function ensureScheme(url) {
170
+ const trimmed = url.trim();
171
+ if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)) return trimmed;
172
+ return `https://${trimmed.replace(/^\/+/, "")}`;
173
+ }
174
+ function getPlatformProductionUrl(platform) {
175
+ const resolved = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(envOverrideFor(platform), () => ( _optionalChain([byKey, 'call', _3 => _3(platform), 'optionalAccess', _4 => _4.defaultUrl]))), () => ( envOverrideFor("flamingo"))), () => ( "https://www.flamingo.run"));
176
+ return ensureScheme(resolved);
177
+ }
178
+ function getPlatformUrl(platform, options = {}) {
179
+ const url = options.environment !== "production" && process.env.NODE_ENV !== "production" ? process.env.NEXT_PUBLIC_DEV_URL || "http://localhost:3000" : getPlatformProductionUrl(platform);
180
+ return url.replace(/\/+$/, "");
181
+ }
182
+ function getDeploymentUrl(options) {
183
+ if (typeof window !== "undefined") return window.location.origin;
184
+ const configured = _optionalChain([options, 'access', _5 => _5.configuredUrl, 'optionalAccess', _6 => _6.trim, 'call', _7 => _7()]);
185
+ if (configured) return ensureScheme(configured).replace(/\/+$/, "");
186
+ if (process.env.VERCEL_ENV === "preview" && process.env.VERCEL_URL) {
187
+ return ensureScheme(process.env.VERCEL_URL).replace(/\/+$/, "");
188
+ }
189
+ if (process.env.VERCEL_ENV === "production" || process.env.NODE_ENV === "production") {
190
+ return getPlatformUrl(options.platform, { environment: "production" });
191
+ }
192
+ return (process.env.NEXT_PUBLIC_DEV_URL || `http://localhost:${_nullishCoalesce(process.env.PORT, () => ( 3e3))}`).replace(/\/+$/, "");
193
+ }
194
+ var LOCAL_HOSTNAME = /^(localhost|127(?:\.\d{1,3}){3}|0\.0\.0\.0|\[::1\])$/i;
195
+ function isLocalUrl(url) {
196
+ try {
197
+ return LOCAL_HOSTNAME.test(new URL(url).hostname);
198
+ } catch (e3) {
199
+ return false;
200
+ }
201
+ }
202
+ function getRequestOrigin(headers, options) {
203
+ const host = headers.get("host");
204
+ if (!host) return getDeploymentUrl(options);
205
+ const local = LOCAL_HOSTNAME.test(host.replace(/:\d+$/, ""));
206
+ const proto = _optionalChain([headers, 'access', _8 => _8.get, 'call', _9 => _9("x-forwarded-proto"), 'optionalAccess', _10 => _10.split, 'call', _11 => _11(","), 'access', _12 => _12[0], 'access', _13 => _13.trim, 'call', _14 => _14()]) || (local ? "http" : "https");
207
+ return `${proto}://${host}`;
208
+ }
209
+ function resolveRedirectTarget(origin, target) {
210
+ const url = new URL(target, origin);
211
+ if (!/^https?:\/\//i.test(target) && url.origin !== new URL(origin).origin) {
212
+ throw new Error(`resolveRedirectTarget: "${target}" is not a same-origin path`);
213
+ }
214
+ return url;
215
+ }
216
+ function hostOf(value) {
217
+ if (!value) return null;
218
+ try {
219
+ return new URL(value).hostname.toLowerCase();
220
+ } catch (e4) {
221
+ return null;
222
+ }
223
+ }
224
+ function expandWwwApex(host) {
225
+ if (host.startsWith("www.")) return [host, host.slice(4)];
226
+ if (host.split(".").length === 2) return [host, `www.${host}`];
227
+ return [host];
228
+ }
229
+ function toRegistrableBaseDomain(host) {
230
+ const parts = host.split(".");
231
+ if (parts.length >= 2) return parts.slice(-2).join(".");
232
+ return void 0;
233
+ }
234
+ function aliasHostsOf(key) {
235
+ return _nullishCoalesce(_optionalChain([byKey, 'call', _15 => _15(key), 'optionalAccess', _16 => _16.aliasHostnames]), () => ( []));
236
+ }
237
+ function hostsForEntry(entry, opts) {
238
+ const resolved = hostOf(getPlatformProductionUrl(entry.key));
239
+ const hosts = resolved ? expandWwwApex(resolved) : [];
240
+ if (opts.includeAliases) hosts.push(...aliasHostsOf(entry.key));
241
+ return hosts;
242
+ }
243
+ function getPlatformByHostname(hostname) {
244
+ const host = hostname.toLowerCase();
245
+ for (const entry of PLATFORM_DOMAINS) {
246
+ if (entry.pseudo) continue;
247
+ if (hostsForEntry(entry, { includeAliases: true }).includes(host)) return entry.key;
248
+ }
249
+ return null;
250
+ }
251
+ function isPreviewHost(hostname) {
252
+ return hostname.endsWith(".vercel.app");
253
+ }
254
+ function getAllPlatformBaseDomains() {
255
+ if (typeof window === "undefined") return [];
256
+ const hostname = window.location.hostname;
257
+ if (hostname === "localhost" || hostname === "127.0.0.1" || hostname.startsWith("127.")) {
258
+ return [];
259
+ }
260
+ const previewEnv = process.env.VERCEL_ENV === "preview" || process.env.NEXT_PUBLIC_VERCEL_ENV === "preview" || isPreviewHost(hostname);
261
+ if (previewEnv) {
262
+ return [".vercel.app", "vercel.app"];
263
+ }
264
+ const baseDomains = /* @__PURE__ */ new Set();
265
+ for (const entry of PLATFORM_DOMAINS) {
266
+ if (entry.pseudo) continue;
267
+ const host = hostOf(getPlatformProductionUrl(entry.key));
268
+ if (!host) continue;
269
+ const base = toRegistrableBaseDomain(host);
270
+ if (base) {
271
+ baseDomains.add(`.${base}`);
272
+ baseDomains.add(base);
273
+ }
274
+ }
275
+ return Array.from(baseDomains);
276
+ }
277
+ var _orderIdx = (k) => PLATFORM_DOMAINS.findIndex((e) => e.key === k);
278
+ if (_orderIdx("flamingo") > _orderIdx("universal") || getPlatformByHostname("flamingo.cx") !== "flamingo" || getPlatformByHostname("hub.openframe.ai") !== "openframe") {
279
+ console.error(
280
+ "[platform-domains] \u26A0\uFE0F PLATFORM_DOMAINS ordering invariant violated \u2014 `flamingo` must precede `universal`, and the openframe and flamingo.cx aliases must be intact. Do not reorder the table."
281
+ );
282
+ }
283
+
284
+ // src/components/chat/utils/new-tab-rel.ts
285
+ function isRelativeHref(href) {
286
+ return !/^(?:[a-z][a-z0-9+.-]*:)?\/\//i.test(href);
287
+ }
288
+ function isOwnSiteHref(href) {
289
+ if (!href) return false;
290
+ if (href.startsWith("/") && !href.startsWith("//")) return true;
291
+ try {
292
+ const url = new URL(href);
293
+ return isLocalUrl(url.href) || getPlatformByHostname(url.hostname) !== null;
294
+ } catch (e5) {
295
+ return false;
296
+ }
297
+ }
298
+ function newTabRel(href, targetPlatform) {
299
+ return targetPlatform || isOwnSiteHref(href) ? "noopener" : "noopener noreferrer";
300
+ }
301
+ function newTabFeatures(href, targetPlatform) {
302
+ return newTabRel(href, targetPlatform).replace(" ", ",");
303
+ }
304
+
305
+ // src/components/chat/utils/chat-nav-resolution.ts
306
+ function isModifierClick(e) {
307
+ return e.button !== 0 || !!e.metaKey || !!e.ctrlKey || !!e.shiftKey || !!e.altKey;
308
+ }
309
+ function stripSameOriginToPath(href) {
310
+ if (!href.startsWith("http")) return href;
311
+ try {
312
+ const u = new URL(href);
313
+ return u.pathname + u.search + u.hash;
314
+ } catch (e6) {
315
+ return href;
316
+ }
317
+ }
318
+ function resolveHrefForRuntime(href, runtime) {
319
+ if (runtime.navigation.mode !== "embed") return href;
320
+ if (href.startsWith("http")) return href;
321
+ if (href.startsWith("//")) return href;
322
+ const origin = runtime.navigation.defaultContentOrigin;
323
+ if (!origin) return href;
324
+ return origin.replace(/\/+$/, "") + (href.startsWith("/") ? href : "/" + href);
325
+ }
326
+ function resolveExternalNavigation(args) {
327
+ let abs = args.href;
328
+ if (abs.startsWith("//")) abs = window.location.protocol + abs;
329
+ if (!abs.startsWith("http")) {
330
+ if (args.runtime.navigation.defaultContentOrigin) {
331
+ let origin = args.runtime.navigation.defaultContentOrigin;
332
+ while (origin.endsWith("/")) origin = origin.slice(0, -1);
333
+ abs = origin + (abs.startsWith("/") ? abs : "/" + abs);
334
+ } else if (args.runtime.navigation.mode === "embed" && process.env.NODE_ENV !== "production") {
335
+ console.warn(
336
+ "[chat-nav-resolution] relative href in embed mode with no defaultContentOrigin set on runtime.navigation \u2014 link will resolve against the embedder origin.",
337
+ { href: abs, targetPlatform: args.targetPlatform }
338
+ );
339
+ }
340
+ }
341
+ const open = () => {
342
+ if (args.runtime.navigation.openExternal) {
343
+ args.runtime.navigation.openExternal(abs);
344
+ } else {
345
+ window.open(abs, "_blank", newTabFeatures(abs, args.targetPlatform));
346
+ }
347
+ };
348
+ return { href: abs, open };
349
+ }
350
+
351
+ // src/components/chat/utils/is-cross-origin-url.ts
352
+ function isCrossOriginUrl(url) {
353
+ if (!url) return false;
354
+ if (url.startsWith("#") || url.startsWith("?")) return false;
355
+ if (url.startsWith("/") && !url.startsWith("//")) return false;
356
+ return true;
357
+ }
358
+
359
+ // src/components/chat/utils/decide-new-tab.ts
360
+ function decideNewTab(input) {
361
+ const { href, targetPlatform, openIn, alwaysNewTab, runtimeMode, currentSource } = input;
362
+ if (runtimeMode === "embed") return true;
363
+ if (openIn === "new-tab") return true;
364
+ if (alwaysNewTab === true) return true;
365
+ if (openIn === "same-tab") return false;
366
+ if (targetPlatform !== void 0 && targetPlatform !== null && currentSource) {
367
+ return targetPlatform !== currentSource;
368
+ }
369
+ if (!href) return false;
370
+ return isCrossOriginUrl(href);
371
+ }
372
+
373
+ // src/components/chat/utils/nav-anchor-props.ts
374
+ function isSameOriginAbsoluteHref(href) {
375
+ if (typeof window === "undefined") return false;
376
+ if (!/^https?:\/\//i.test(href)) return false;
377
+ try {
378
+ return new URL(href).origin === new URL(window.location.href).origin;
379
+ } catch (e7) {
380
+ return false;
381
+ }
382
+ }
383
+ function computeIsNewTab(runtime, href, targetPlatform) {
384
+ if (!href) return false;
385
+ if (runtime.navigation.mode === "embed") return !isSameOriginAbsoluteHref(href);
386
+ return _nullishCoalesce(_optionalChain([runtime, 'access', _17 => _17.navigation, 'access', _18 => _18.decideNewTab, 'optionalCall', _19 => _19({ href, targetPlatform })]), () => ( decideNewTab({
387
+ href,
388
+ targetPlatform,
389
+ currentSource: _nullishCoalesce(runtime.source, () => ( ""))
390
+ })));
391
+ }
392
+ function navLinkTarget(runtime, href, targetPlatform, { hostRoute = false, openIn } = {}) {
393
+ if (!runtime) return { href, isNewTab: decideNewTab({ href, openIn, currentSource: "" }) };
394
+ if (hostRoute && isRelativeHref(href)) return { href, isNewTab: openIn === "new-tab" };
395
+ const resolved = resolveHrefForRuntime(href, runtime);
396
+ const isNewTab = runtime.navigation.mode !== "embed" && openIn ? openIn === "new-tab" : computeIsNewTab(runtime, resolved, _nullishCoalesce(targetPlatform, () => ( null)));
397
+ return { href: resolved, isNewTab };
398
+ }
399
+ function newTabAnchorAttrs(isNewTab, href, targetPlatform) {
400
+ return isNewTab ? { target: "_blank", rel: newTabRel(href, targetPlatform) } : {};
401
+ }
402
+ function buildAnchorProps(href, isNewTab, targetPlatform) {
403
+ return href ? { href, ...newTabAnchorAttrs(isNewTab, href, targetPlatform) } : void 0;
404
+ }
405
+
406
+ // src/utils/og-placeholder.ts
407
+ var DEFAULT_OG_PLACEHOLDER_PATH = "/api/og-placeholder";
408
+ function resolveOgPlaceholderBase(endpoints) {
409
+ if (_optionalChain([endpoints, 'optionalAccess', _20 => _20.ogPlaceholderUrl])) return endpoints.ogPlaceholderUrl;
410
+ const imageProxy = _optionalChain([endpoints, 'optionalAccess', _21 => _21.imageProxyUrlPrefix]);
411
+ if (imageProxy) {
412
+ const derived = imageProxy.replace(/\/image-proxy(?=$|[?/])/, "/og-placeholder");
413
+ if (derived !== imageProxy) return derived;
414
+ }
415
+ return DEFAULT_OG_PLACEHOLDER_PATH;
416
+ }
417
+ function buildOgPlaceholderUrl(endpoints, title, options = {}) {
418
+ const base = resolveOgPlaceholderBase(endpoints);
419
+ const qIndex = base.indexOf("?");
420
+ const path = qIndex === -1 ? base : base.slice(0, qIndex);
421
+ const params = new URLSearchParams(qIndex === -1 ? "" : base.slice(qIndex + 1));
422
+ params.set("title", title);
423
+ if (options.site) params.set("site", options.site);
424
+ const width = _nullishCoalesce(options.width, () => ( (options.aspect === "square" ? 1024 : void 0)));
425
+ const height = _nullishCoalesce(options.height, () => ( (options.aspect === "square" ? 1024 : void 0)));
426
+ if (Number.isFinite(width)) params.set("w", String(width));
427
+ if (Number.isFinite(height)) params.set("h", String(height));
428
+ return `${path}?${params.toString()}`;
429
+ }
430
+
431
+ // src/hooks/use-og-placeholder-url.ts
432
+
433
+ function useOgPlaceholderUrl({
434
+ title,
435
+ siteName = "",
436
+ aspect = "wide",
437
+ enabled = true
438
+ }) {
439
+ const endpoints = _optionalChain([_chunkUJ7AXHRZcjs.useChatRuntime.call(void 0, ), 'optionalAccess', _22 => _22.endpoints]);
440
+ return _react.useMemo.call(void 0, () => {
441
+ if (!enabled || !title) return null;
442
+ return buildOgPlaceholderUrl(endpoints, title, { site: siteName || void 0, aspect });
443
+ }, [endpoints, title, siteName, aspect, enabled]);
444
+ }
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+ exports.useImageEdgeColor = useImageEdgeColor; exports.byKey = byKey; exports.getPlatformProductionUrl = getPlatformProductionUrl; exports.getPlatformUrl = getPlatformUrl; exports.getDeploymentUrl = getDeploymentUrl; exports.isLocalUrl = isLocalUrl; exports.getRequestOrigin = getRequestOrigin; exports.resolveRedirectTarget = resolveRedirectTarget; exports.getAllPlatformBaseDomains = getAllPlatformBaseDomains; exports.isRelativeHref = isRelativeHref; exports.newTabRel = newTabRel; exports.newTabFeatures = newTabFeatures; exports.isModifierClick = isModifierClick; exports.stripSameOriginToPath = stripSameOriginToPath; exports.resolveExternalNavigation = resolveExternalNavigation; exports.isCrossOriginUrl = isCrossOriginUrl; exports.decideNewTab = decideNewTab; exports.isSameOriginAbsoluteHref = isSameOriginAbsoluteHref; exports.computeIsNewTab = computeIsNewTab; exports.navLinkTarget = navLinkTarget; exports.newTabAnchorAttrs = newTabAnchorAttrs; exports.buildAnchorProps = buildAnchorProps; exports.buildOgPlaceholderUrl = buildOgPlaceholderUrl; exports.useOgPlaceholderUrl = useOgPlaceholderUrl;