@flamingo-stack/openframe-frontend-core 0.0.711 → 0.0.712
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/chunk-2NASBO7O.js +1137 -0
- package/dist/{chunk-RQRX4YC3.cjs → chunk-2RKFMUNW.cjs} +46 -46
- package/dist/chunk-2Y7QZAB2.cjs +158 -0
- package/dist/chunk-34I6XI3N.js +136 -0
- package/dist/chunk-3K5ZLZE7.js +292 -0
- package/dist/chunk-3LU4UFPS.cjs +14 -0
- package/dist/{chunk-3UNL26CD.cjs → chunk-3RKBJT6K.cjs} +8 -6
- package/dist/{chunk-6GLQLTJI.js → chunk-3SEEGNRE.js} +35 -27
- package/dist/{chunk-FEMAJES4.cjs → chunk-3UAJLO5U.cjs} +41 -39
- package/dist/chunk-4HJRHEXD.cjs +1612 -0
- package/dist/{chunk-JPG7OHEG.js → chunk-4QFWGLZO.js} +1 -1
- package/dist/chunk-4R2L3DSA.js +14 -0
- package/dist/{chunk-2JTGK64G.js → chunk-4UYKNOZG.js} +12 -10
- package/dist/{chunk-TKZXHVBG.js → chunk-5SDELRH3.js} +5 -5
- package/dist/{chunk-Q6B35Y7O.js → chunk-5Y72YQEK.js} +22 -113
- package/dist/{chunk-KUC673HM.js → chunk-6T3BTD6Q.js} +204 -982
- package/dist/{chunk-F57ECE2I.js → chunk-6YPTUHM7.js} +4 -4
- package/dist/{chunk-WJUIXU6Y.js → chunk-7HNYYNKE.js} +28 -22
- package/dist/{chunk-P6G3JZNC.cjs → chunk-7NSU5EQD.cjs} +57 -148
- package/dist/chunk-AAYNCJMW.cjs +48 -0
- package/dist/{chunk-FXJ3WWUB.js → chunk-ADBE7QF3.js} +5 -252
- package/dist/chunk-AECTRMGQ.cjs +334 -0
- package/dist/chunk-AGVXKD4K.js +334 -0
- package/dist/chunk-AL2GUHAJ.cjs +18 -0
- package/dist/{chunk-WMX26HB5.js → chunk-APJZBDQN.js} +12 -12
- package/dist/chunk-AUMKE74M.cjs +16 -0
- package/dist/chunk-B4NCVYEQ.cjs +292 -0
- package/dist/{chunk-XWEBHS7O.cjs → chunk-BXSRTBLU.cjs} +82 -54
- package/dist/chunk-CMGFZHCN.js +233 -0
- package/dist/chunk-CMZ3QTFQ.js +1207 -0
- package/dist/chunk-CPA2CKRZ.cjs +125 -0
- package/dist/{chunk-G47AP6LX.cjs → chunk-CSCJU6YC.cjs} +35 -33
- package/dist/chunk-CYUUHFXL.js +41 -0
- package/dist/chunk-DC4RTYWK.cjs +1122 -0
- package/dist/{chunk-NF7GNGYG.js → chunk-DDWFCWOE.js} +5 -7
- package/dist/{chunk-K4PTDK34.js → chunk-EFNKS5W4.js} +322 -428
- package/dist/{chunk-QA6TROME.cjs → chunk-EOKSKJSS.cjs} +25 -83
- package/dist/{chunk-6NTPY5QA.cjs → chunk-ETYLOZOB.cjs} +978 -2413
- package/dist/chunk-F5BPGWGT.cjs +931 -0
- package/dist/{chunk-5HB7FLCV.js → chunk-FCAVAEHF.js} +8277 -9990
- package/dist/chunk-FFT56TYB.cjs +401 -0
- package/dist/chunk-FYEJTF5Y.js +125 -0
- package/dist/chunk-G3GRYDMS.js +16 -0
- package/dist/{chunk-VWFZRMQR.js → chunk-G3OMVCID.js} +13 -7
- package/dist/chunk-G6OHIX5C.cjs +100 -0
- package/dist/{chunk-UDFRUKLC.cjs → chunk-GEDY7HQI.cjs} +2 -2
- package/dist/chunk-GQ7JJUIT.cjs +1207 -0
- package/dist/chunk-H3PKYE4N.js +18 -0
- package/dist/{chunk-AGDVEUVL.js → chunk-H5R7U2D2.js} +206 -5
- package/dist/{chunk-7AM6C6XH.cjs → chunk-HETQETPV.cjs} +9641 -9678
- package/dist/{chunk-Y2GSOUCS.cjs → chunk-HWVUR735.cjs} +2 -2
- package/dist/chunk-II4QMH26.cjs +35 -0
- package/dist/chunk-ILNN6QRW.js +1612 -0
- package/dist/chunk-IYVFSLWJ.js +931 -0
- package/dist/{chunk-C4HRRB3V.cjs → chunk-JGCFRTND.cjs} +23 -17
- package/dist/chunk-JHQ334WS.js +655 -0
- package/dist/{chunk-WCVZCGK5.cjs → chunk-JO5TLJPM.cjs} +129 -907
- package/dist/{chunk-PRX7HVLE.cjs → chunk-JVCAK4W3.cjs} +210 -9
- package/dist/chunk-KBJJQFYU.js +1122 -0
- package/dist/chunk-KEKCQENI.js +48 -0
- package/dist/chunk-KHXZFLIN.cjs +41 -0
- package/dist/chunk-KT3U3ZRP.cjs +1137 -0
- package/dist/chunk-L2VUINHN.js +35 -0
- package/dist/{chunk-FYOKS5RI.cjs → chunk-L6ZQGWCX.cjs} +4521 -6234
- package/dist/{chunk-PLYEKV3N.cjs → chunk-MA4Q5RBP.cjs} +6 -6
- package/dist/{chunk-VMMHJFHG.js → chunk-N67XG5GY.js} +10 -8
- package/dist/chunk-NPAQSMRY.js +2087 -0
- package/dist/{chunk-IFWLJ66M.js → chunk-NQWJAOHO.js} +6 -4
- package/dist/{chunk-6K7QZDA6.cjs → chunk-OBZJICEA.cjs} +8 -8
- package/dist/{chunk-62KNLDXK.js → chunk-OPYODNV2.js} +3 -3
- package/dist/chunk-P3JMAMHP.js +401 -0
- package/dist/chunk-PPXR22YC.cjs +2087 -0
- package/dist/chunk-PSVSEN4J.cjs +655 -0
- package/dist/{chunk-EQWD4IJE.js → chunk-RBYVFPER.js} +74 -46
- package/dist/{chunk-SMAAV3HL.js → chunk-ROBQ5TR7.js} +10541 -10578
- package/dist/{chunk-K6Y5NX6L.cjs → chunk-T3CLXR43.cjs} +114 -220
- package/dist/{chunk-FI6GMDO7.js → chunk-TTVOLEUS.js} +3605 -5040
- package/dist/{chunk-LM7TXMLU.cjs → chunk-ULWVKHSI.cjs} +8 -255
- package/dist/{chunk-EX6GGCAC.cjs → chunk-UT3ODMBU.cjs} +15 -15
- package/dist/chunk-WANCBTUE.js +71 -0
- package/dist/{chunk-BIZNSF3U.cjs → chunk-WBNAEYTQ.cjs} +2 -51
- package/dist/chunk-WFPCCBOM.cjs +71 -0
- package/dist/chunk-WI6FHKD7.js +158 -0
- package/dist/chunk-WMNCVLES.js +100 -0
- package/dist/{chunk-UT4YHQZW.js → chunk-WSDT7LYL.js} +0 -49
- package/dist/chunk-WVOTC7HW.cjs +136 -0
- package/dist/{chunk-6AMIRXKM.cjs → chunk-WWJG4GVG.cjs} +93 -87
- package/dist/chunk-XXBLN4BP.cjs +233 -0
- package/dist/{chunk-4IBPRIQH.js → chunk-YBQQNDC7.js} +1 -1
- package/dist/{chunk-QGZPZ3RL.js → chunk-YBS5QGON.js} +70 -128
- package/dist/{chunk-CDM7OSFB.cjs → chunk-Z5SWJW5Q.cjs} +125 -117
- package/dist/{chunk-YD4LJZV4.cjs → chunk-ZX7SCPLO.cjs} +6 -8
- package/dist/cloud-tenants-KZUZGD4A.cjs +117 -0
- package/dist/cloud-tenants-OGLVVQ7X.js +117 -0
- package/dist/components/case-studies/index.cjs +45 -29
- package/dist/components/case-studies/index.js +32 -16
- package/dist/components/chat/ask-prompts.d.ts +64 -0
- package/dist/components/chat/ask-prompts.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/case-study-card.d.ts +6 -3
- package/dist/components/chat/entity-cards/case-study-card.d.ts.map +1 -1
- package/dist/components/chat/index.cjs +27 -8
- package/dist/components/chat/index.d.ts +1 -0
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +57 -38
- package/dist/components/chat/quick-action-chip.d.ts +7 -3
- package/dist/components/chat/quick-action-chip.d.ts.map +1 -1
- package/dist/components/contact/index.cjs +29 -13
- package/dist/components/contact/index.js +28 -12
- package/dist/components/docs/index.cjs +33 -16
- package/dist/components/docs/index.js +33 -16
- package/dist/components/docs/use-scroll-spy.d.ts +23 -1
- package/dist/components/docs/use-scroll-spy.d.ts.map +1 -1
- package/dist/components/embeds/index.cjs +29 -13
- package/dist/components/embeds/index.js +28 -12
- package/dist/components/faq/faq-section.d.ts +8 -1
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/index.cjs +30 -14
- package/dist/components/faq/index.js +29 -13
- package/dist/components/features/array-entry-manager.d.ts +5 -1
- package/dist/components/features/array-entry-manager.d.ts.map +1 -1
- package/dist/components/features/board/board.d.ts +2 -0
- package/dist/components/features/board/board.d.ts.map +1 -1
- package/dist/components/features/board/ticket-card.d.ts.map +1 -1
- package/dist/components/features/board/touch-board.d.ts +1 -1
- package/dist/components/features/board/touch-board.d.ts.map +1 -1
- package/dist/components/features/board/types.d.ts +3 -0
- package/dist/components/features/board/types.d.ts.map +1 -1
- package/dist/components/features/board/use-board-collapse.d.ts +6 -1
- package/dist/components/features/board/use-board-collapse.d.ts.map +1 -1
- package/dist/components/features/capability-explorer.d.ts +94 -0
- package/dist/components/features/capability-explorer.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/index.d.ts +14 -0
- package/dist/components/features/cloud-tenants/index.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-access-cell.d.ts +9 -0
- package/dist/components/features/cloud-tenants/tenant-access-cell.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-cell.d.ts +8 -0
- package/dist/components/features/cloud-tenants/tenant-cell.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-customer-cell.d.ts +9 -0
- package/dist/components/features/cloud-tenants/tenant-customer-cell.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-presentation.d.ts +42 -0
- package/dist/components/features/cloud-tenants/tenant-presentation.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenant-row.d.ts +22 -0
- package/dist/components/features/cloud-tenants/tenant-row.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenants-table-columns.d.ts +42 -0
- package/dist/components/features/cloud-tenants/tenants-table-columns.d.ts.map +1 -0
- package/dist/components/features/cloud-tenants/tenants-table-view.d.ts +26 -0
- package/dist/components/features/cloud-tenants/tenants-table-view.d.ts.map +1 -0
- package/dist/components/features/devices/device-last-online.d.ts +3 -0
- package/dist/components/features/devices/device-last-online.d.ts.map +1 -0
- package/dist/components/features/devices/device-name.d.ts +42 -0
- package/dist/components/features/devices/device-name.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selection-mode-radio.d.ts +26 -0
- package/dist/components/features/devices/device-selector/device-selection-mode-radio.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selector-skeleton.d.ts +25 -0
- package/dist/components/features/devices/device-selector/device-selector-skeleton.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selector.d.ts +38 -0
- package/dist/components/features/devices/device-selector/device-selector.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/device-selector.types.d.ts +133 -0
- package/dist/components/features/devices/device-selector/device-selector.types.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/narrowing.d.ts +13 -0
- package/dist/components/features/devices/device-selector/narrowing.d.ts.map +1 -0
- package/dist/components/features/devices/device-selector/use-device-selector.d.ts +17 -0
- package/dist/components/features/devices/device-selector/use-device-selector.d.ts.map +1 -0
- package/dist/components/features/devices/device-status.d.ts +23 -0
- package/dist/components/features/devices/device-status.d.ts.map +1 -0
- package/dist/components/features/devices/device-statuses.d.ts +40 -0
- package/dist/components/features/devices/device-statuses.d.ts.map +1 -0
- package/dist/components/features/devices/device-tags-filter-button.d.ts +22 -0
- package/dist/components/features/devices/device-tags-filter-button.d.ts.map +1 -0
- package/dist/components/features/devices/device-type-icon.d.ts +11 -0
- package/dist/components/features/devices/device-type-icon.d.ts.map +1 -0
- package/dist/components/features/devices/device-type-tile.d.ts +9 -0
- package/dist/components/features/devices/device-type-tile.d.ts.map +1 -0
- package/dist/components/features/devices/devices-filter-toolbar.d.ts +46 -0
- package/dist/components/features/devices/devices-filter-toolbar.d.ts.map +1 -0
- package/dist/components/features/devices/devices-grid-filters.d.ts +25 -0
- package/dist/components/features/devices/devices-grid-filters.d.ts.map +1 -0
- package/dist/components/features/devices/devices-grid.d.ts +12 -0
- package/dist/components/features/devices/devices-grid.d.ts.map +1 -0
- package/dist/components/features/devices/devices-list.d.ts +131 -0
- package/dist/components/features/devices/devices-list.d.ts.map +1 -0
- package/dist/components/features/devices/devices-panel-header.d.ts +46 -0
- package/dist/components/features/devices/devices-panel-header.d.ts.map +1 -0
- package/dist/components/features/devices/devices-panel-view.d.ts +79 -0
- package/dist/components/features/devices/devices-panel-view.d.ts.map +1 -0
- package/dist/components/features/devices/devices-table-columns.d.ts +76 -0
- package/dist/components/features/devices/devices-table-columns.d.ts.map +1 -0
- package/dist/components/features/devices/devices-view-config.d.ts +25 -0
- package/dist/components/features/devices/devices-view-config.d.ts.map +1 -0
- package/dist/components/features/devices/index.d.ts +24 -0
- package/dist/components/features/devices/index.d.ts.map +1 -0
- package/dist/components/features/devices/types.d.ts +68 -0
- package/dist/components/features/devices/types.d.ts.map +1 -0
- package/dist/components/features/devices/use-tag-filter-modal.d.ts +50 -0
- package/dist/components/features/devices/use-tag-filter-modal.d.ts.map +1 -0
- package/dist/components/features/index.cjs +227 -12
- package/dist/components/features/index.d.ts +7 -0
- package/dist/components/features/index.d.ts.map +1 -1
- package/dist/components/features/index.js +266 -51
- package/dist/components/features/knowledge-base/index.d.ts +7 -0
- package/dist/components/features/knowledge-base/index.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-article-view.d.ts +44 -0
- package/dist/components/features/knowledge-base/knowledge-base-article-view.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-item-icon.d.ts +13 -0
- package/dist/components/features/knowledge-base/knowledge-base-item-icon.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-status.d.ts +8 -0
- package/dist/components/features/knowledge-base/knowledge-base-status.d.ts.map +1 -0
- package/dist/components/features/knowledge-base/knowledge-base-table.d.ts +52 -0
- package/dist/components/features/knowledge-base/knowledge-base-table.d.ts.map +1 -0
- package/dist/components/features/logs/index.d.ts +12 -0
- package/dist/components/features/logs/index.d.ts.map +1 -0
- package/dist/components/features/logs/log-drawer.d.ts +29 -0
- package/dist/components/features/logs/log-drawer.d.ts.map +1 -0
- package/dist/components/features/logs/log-source-labels.d.ts +11 -0
- package/dist/components/features/logs/log-source-labels.d.ts.map +1 -0
- package/dist/components/features/logs/logs-page-view.d.ts +32 -0
- package/dist/components/features/logs/logs-page-view.d.ts.map +1 -0
- package/dist/components/features/logs/logs-table-columns.d.ts +15 -0
- package/dist/components/features/logs/logs-table-columns.d.ts.map +1 -0
- package/dist/components/features/logs/logs-table-view.d.ts +64 -0
- package/dist/components/features/logs/logs-table-view.d.ts.map +1 -0
- package/dist/components/features/logs/types.d.ts +52 -0
- package/dist/components/features/logs/types.d.ts.map +1 -0
- package/dist/components/features/policies/compute-policy-summary.d.ts +37 -0
- package/dist/components/features/policies/compute-policy-summary.d.ts.map +1 -0
- package/dist/components/features/policies/index.d.ts +8 -0
- package/dist/components/features/policies/index.d.ts.map +1 -0
- package/dist/components/features/policies/policies-table.d.ts +34 -0
- package/dist/components/features/policies/policies-table.d.ts.map +1 -0
- package/dist/components/features/policies/policy-summary-cards.d.ts +17 -0
- package/dist/components/features/policies/policy-summary-cards.d.ts.map +1 -0
- package/dist/components/features/policies/policy-table-row.d.ts +37 -0
- package/dist/components/features/policies/policy-table-row.d.ts.map +1 -0
- package/dist/components/features/remote-session/index.d.ts +8 -0
- package/dist/components/features/remote-session/index.d.ts.map +1 -1
- package/dist/components/features/remote-session/remote-desktop-chat-message-row.d.ts +21 -0
- package/dist/components/features/remote-session/remote-desktop-chat-message-row.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-desktop-chat-panel.d.ts +31 -0
- package/dist/components/features/remote-session/remote-desktop-chat-panel.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-desktop-fullscreen-toolbar.d.ts +21 -0
- package/dist/components/features/remote-session/remote-desktop-fullscreen-toolbar.d.ts.map +1 -0
- package/dist/components/features/remote-session/remote-desktop-view.d.ts +50 -0
- package/dist/components/features/remote-session/remote-desktop-view.d.ts.map +1 -0
- package/dist/components/features/software/index.d.ts +8 -0
- package/dist/components/features/software/index.d.ts.map +1 -0
- package/dist/components/features/software/package-managers.d.ts +30 -0
- package/dist/components/features/software/package-managers.d.ts.map +1 -0
- package/dist/components/features/software/package-search-field-placeholder.d.ts +7 -0
- package/dist/components/features/software/package-search-field-placeholder.d.ts.map +1 -0
- package/dist/components/features/software/schedule-fields.d.ts +34 -0
- package/dist/components/features/software/schedule-fields.d.ts.map +1 -0
- package/dist/components/features/software/software-action-copy.d.ts +25 -0
- package/dist/components/features/software/software-action-copy.d.ts.map +1 -0
- package/dist/components/features/software/software-action-form.d.ts +71 -0
- package/dist/components/features/software/software-action-form.d.ts.map +1 -0
- package/dist/components/features/software/software-row-fields.d.ts +23 -0
- package/dist/components/features/software/software-row-fields.d.ts.map +1 -0
- package/dist/components/features/software/software-row.d.ts +18 -0
- package/dist/components/features/software/software-row.d.ts.map +1 -0
- package/dist/components/features/sortable-list/index.d.ts +1 -0
- package/dist/components/features/sortable-list/index.d.ts.map +1 -1
- package/dist/components/features/sortable-list/sortable-drag-handle.d.ts +21 -0
- package/dist/components/features/sortable-list/sortable-drag-handle.d.ts.map +1 -0
- package/dist/components/help-center-pages/index.cjs +133 -114
- package/dist/components/help-center-pages/index.js +58 -39
- package/dist/components/index.cjs +320 -82
- package/dist/components/index.js +451 -213
- package/dist/components/layout/page-heading.d.ts +12 -3
- package/dist/components/layout/page-heading.d.ts.map +1 -1
- package/dist/components/meeting-scheduler/index.cjs +120 -98
- package/dist/components/meeting-scheduler/index.js +50 -28
- package/dist/components/navigation/index.cjs +36 -17
- package/dist/components/navigation/index.d.ts +3 -0
- package/dist/components/navigation/index.d.ts.map +1 -1
- package/dist/components/navigation/index.js +36 -17
- package/dist/components/navigation/mingo-ai-button.d.ts +23 -10
- package/dist/components/navigation/mingo-ai-button.d.ts.map +1 -1
- package/dist/components/navigation/sticky-section-nav.d.ts +14 -1
- package/dist/components/navigation/sticky-section-nav.d.ts.map +1 -1
- package/dist/components/onboarding-guides/index.cjs +32 -16
- package/dist/components/onboarding-guides/index.js +31 -15
- package/dist/components/product-demo/cast.d.ts +58 -0
- package/dist/components/product-demo/cast.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/cloud-tenants.d.ts +10 -0
- package/dist/components/product-demo/fixtures/cloud-tenants.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/devices.d.ts +14 -0
- package/dist/components/product-demo/fixtures/devices.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/knowledge.d.ts +14 -0
- package/dist/components/product-demo/fixtures/knowledge.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/logs.d.ts +15 -0
- package/dist/components/product-demo/fixtures/logs.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/policies.d.ts +13 -0
- package/dist/components/product-demo/fixtures/policies.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/remote-session.d.ts +20 -0
- package/dist/components/product-demo/fixtures/remote-session.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/shared.d.ts +156 -0
- package/dist/components/product-demo/fixtures/shared.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/software-update.d.ts +19 -0
- package/dist/components/product-demo/fixtures/software-update.d.ts.map +1 -0
- package/dist/components/product-demo/fixtures/tickets-board.d.ts +8 -0
- package/dist/components/product-demo/fixtures/tickets-board.d.ts.map +1 -0
- package/dist/components/product-demo/index.cjs +112 -0
- package/dist/components/product-demo/index.d.ts +6 -0
- package/dist/components/product-demo/index.d.ts.map +1 -0
- package/dist/components/product-demo/index.js +112 -0
- package/dist/components/product-demo/product-screen.d.ts +22 -0
- package/dist/components/product-demo/product-screen.d.ts.map +1 -0
- package/dist/components/product-demo/registry.d.ts +13 -0
- package/dist/components/product-demo/registry.d.ts.map +1 -0
- package/dist/components/product-demo/screen-keys.cjs +25 -0
- package/dist/components/product-demo/screen-keys.d.ts +27 -0
- package/dist/components/product-demo/screen-keys.d.ts.map +1 -0
- package/dist/components/product-demo/screen-keys.js +20 -0
- package/dist/components/product-demo/screens/cloud-tenants.d.ts +8 -0
- package/dist/components/product-demo/screens/cloud-tenants.d.ts.map +1 -0
- package/dist/components/product-demo/screens/devices.d.ts +10 -0
- package/dist/components/product-demo/screens/devices.d.ts.map +1 -0
- package/dist/components/product-demo/screens/knowledge.d.ts +9 -0
- package/dist/components/product-demo/screens/knowledge.d.ts.map +1 -0
- package/dist/components/product-demo/screens/logs.d.ts +4 -0
- package/dist/components/product-demo/screens/logs.d.ts.map +1 -0
- package/dist/components/product-demo/screens/policies.d.ts +8 -0
- package/dist/components/product-demo/screens/policies.d.ts.map +1 -0
- package/dist/components/product-demo/screens/remote-desktop-picture.d.ts +11 -0
- package/dist/components/product-demo/screens/remote-desktop-picture.d.ts.map +1 -0
- package/dist/components/product-demo/screens/remote-session.d.ts +8 -0
- package/dist/components/product-demo/screens/remote-session.d.ts.map +1 -0
- package/dist/components/product-demo/screens/software-update.d.ts +12 -0
- package/dist/components/product-demo/screens/software-update.d.ts.map +1 -0
- package/dist/components/product-demo/screens/tickets-board.d.ts +4 -0
- package/dist/components/product-demo/screens/tickets-board.d.ts.map +1 -0
- package/dist/components/product-demo/types.d.ts +9 -0
- package/dist/components/product-demo/types.d.ts.map +1 -0
- package/dist/components/related-content/index.cjs +14 -8
- package/dist/components/related-content/index.js +13 -7
- package/dist/components/tickets/index.cjs +36 -20
- package/dist/components/tickets/index.js +35 -19
- package/dist/components/ui/file-manager/index.cjs +38 -34
- package/dist/components/ui/file-manager/index.js +8 -4
- package/dist/components/ui/index.cjs +57 -17
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +141 -101
- package/dist/components/ui/product-screen-frame.d.ts +45 -0
- package/dist/components/ui/product-screen-frame.d.ts.map +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/snap-carousel.d.ts +11 -1
- package/dist/components/ui/snap-carousel.d.ts.map +1 -1
- package/dist/components/ui/tag.d.ts +1 -1
- package/dist/components/ui/tag.d.ts.map +1 -1
- package/dist/devices-LBMG42K6.js +81 -0
- package/dist/devices-YGYJIXQY.cjs +81 -0
- package/dist/hooks/index.cjs +17 -8
- package/dist/hooks/index.js +32 -23
- package/dist/hooks/ui/index.d.ts +1 -0
- package/dist/hooks/ui/index.d.ts.map +1 -1
- package/dist/hooks/ui/use-header-height.d.ts +12 -0
- package/dist/hooks/ui/use-header-height.d.ts.map +1 -1
- package/dist/hooks/ui/use-sticky-toolbar.d.ts +29 -0
- package/dist/hooks/ui/use-sticky-toolbar.d.ts.map +1 -0
- package/dist/hooks/use-location-hash.d.ts +2 -2
- package/dist/hooks/use-location-hash.d.ts.map +1 -1
- package/dist/hooks/use-scroll-to-hash.d.ts +7 -0
- package/dist/hooks/use-scroll-to-hash.d.ts.map +1 -1
- package/dist/index.cjs +276 -25
- package/dist/index.js +729 -478
- package/dist/knowledge-H5BIWJVI.js +108 -0
- package/dist/knowledge-KTCVJIWN.cjs +108 -0
- package/dist/logs-DB5Z7M5Q.js +216 -0
- package/dist/logs-RVCC2UQW.cjs +216 -0
- package/dist/policies-EWUULFBR.js +121 -0
- package/dist/policies-HV4IQCBV.cjs +121 -0
- package/dist/remote-session-GSGZOFDX.js +196 -0
- package/dist/remote-session-R6VAFESR.cjs +196 -0
- package/dist/software-update-6PXKRKBT.js +179 -0
- package/dist/software-update-D4OVSWSG.cjs +179 -0
- package/dist/tickets-board-BHLPAVNJ.cjs +137 -0
- package/dist/tickets-board-PYDNELSK.js +137 -0
- package/dist/types/case-study.d.ts +15 -1
- package/dist/types/case-study.d.ts.map +1 -1
- package/dist/utils/date-utils.d.ts +5 -0
- package/dist/utils/date-utils.d.ts.map +1 -1
- package/dist/utils/index.cjs +45 -2
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +41 -3
- package/dist/utils/open-in-new-tab.d.ts +7 -0
- package/dist/utils/open-in-new-tab.d.ts.map +1 -0
- package/dist/utils/same-page-hash-nav.d.ts +31 -0
- package/dist/utils/same-page-hash-nav.d.ts.map +1 -1
- package/dist/utils/scroll-into-view.d.ts +14 -1
- package/dist/utils/scroll-into-view.d.ts.map +1 -1
- package/package.json +13 -1
- package/src/components/chat/ask-prompts.tsx +226 -0
- package/src/components/chat/embeddable-chat.tsx +36 -2
- package/src/components/chat/entity-cards/case-study-card.tsx +122 -46
- package/src/components/chat/index.ts +1 -0
- package/src/components/chat/quick-action-chip.tsx +33 -9
- package/src/components/docs/use-scroll-spy.ts +93 -18
- package/src/components/faq/faq-section.tsx +82 -43
- package/src/components/features/array-entry-manager.tsx +10 -1
- package/src/components/features/board/board.tsx +4 -1
- package/src/components/features/board/ticket-card.tsx +11 -1
- package/src/components/features/board/touch-board.tsx +2 -1
- package/src/components/features/board/types.ts +3 -0
- package/src/components/features/board/use-board-collapse.ts +7 -2
- package/src/components/features/capability-explorer.tsx +412 -0
- package/src/components/features/cloud-tenants/index.ts +28 -0
- package/src/components/features/cloud-tenants/tenant-access-cell.tsx +24 -0
- package/src/components/features/cloud-tenants/tenant-cell.tsx +26 -0
- package/src/components/features/cloud-tenants/tenant-customer-cell.tsx +27 -0
- package/src/components/features/cloud-tenants/tenant-presentation.ts +111 -0
- package/src/components/features/cloud-tenants/tenant-row.ts +21 -0
- package/src/components/features/cloud-tenants/tenants-table-columns.ts +30 -0
- package/src/components/features/cloud-tenants/tenants-table-view.tsx +142 -0
- package/src/components/features/devices/device-last-online.ts +6 -0
- package/src/components/features/devices/device-name.ts +51 -0
- package/src/components/features/devices/device-selector/device-selection-mode-radio.tsx +107 -0
- package/src/components/features/devices/device-selector/device-selector-skeleton.tsx +32 -0
- package/src/components/features/devices/device-selector/device-selector.tsx +799 -0
- package/src/components/features/devices/device-selector/device-selector.types.ts +138 -0
- package/src/components/features/devices/device-selector/narrowing.ts +33 -0
- package/src/components/features/devices/device-selector/use-device-selector.ts +51 -0
- package/src/components/features/devices/device-status.ts +102 -0
- package/src/components/features/devices/device-statuses.ts +88 -0
- package/src/components/features/devices/device-tags-filter-button.tsx +49 -0
- package/src/components/features/devices/device-type-icon.tsx +29 -0
- package/src/components/features/devices/device-type-tile.tsx +17 -0
- package/src/components/features/devices/devices-filter-toolbar.tsx +114 -0
- package/src/components/features/devices/devices-grid-filters.tsx +99 -0
- package/src/components/features/devices/devices-grid.tsx +86 -0
- package/src/components/features/devices/devices-list.tsx +357 -0
- package/src/components/features/devices/devices-panel-header.tsx +97 -0
- package/src/components/features/devices/devices-panel-view.tsx +261 -0
- package/src/components/features/devices/devices-table-columns.tsx +356 -0
- package/src/components/features/devices/devices-view-config.tsx +38 -0
- package/src/components/features/devices/index.ts +89 -0
- package/src/components/features/devices/types.ts +74 -0
- package/src/components/features/devices/use-tag-filter-modal.ts +109 -0
- package/src/components/features/index.ts +9 -0
- package/src/components/features/knowledge-base/index.ts +19 -0
- package/src/components/features/knowledge-base/knowledge-base-article-view.tsx +134 -0
- package/src/components/features/knowledge-base/knowledge-base-item-icon.ts +14 -0
- package/src/components/features/knowledge-base/knowledge-base-status.ts +12 -0
- package/src/components/features/knowledge-base/knowledge-base-table.tsx +180 -0
- package/src/components/features/logs/index.ts +20 -0
- package/src/components/features/logs/log-drawer.tsx +138 -0
- package/src/components/features/logs/log-source-labels.ts +25 -0
- package/src/components/features/logs/logs-page-view.tsx +100 -0
- package/src/components/features/logs/logs-table-columns.ts +16 -0
- package/src/components/features/logs/logs-table-view.tsx +509 -0
- package/src/components/features/logs/types.ts +71 -0
- package/src/components/features/policies/compute-policy-summary.ts +115 -0
- package/src/components/features/policies/index.ts +14 -0
- package/src/components/features/policies/policies-table.tsx +235 -0
- package/src/components/features/policies/policy-summary-cards.tsx +69 -0
- package/src/components/features/policies/policy-table-row.ts +37 -0
- package/src/components/features/remote-session/index.ts +8 -0
- package/src/components/features/remote-session/remote-desktop-chat-message-row.tsx +56 -0
- package/src/components/features/remote-session/remote-desktop-chat-panel.tsx +102 -0
- package/src/components/features/remote-session/remote-desktop-fullscreen-toolbar.tsx +119 -0
- package/src/components/features/remote-session/remote-desktop-view.tsx +209 -0
- package/src/components/features/software/index.ts +39 -0
- package/src/components/features/software/package-managers.ts +54 -0
- package/src/components/features/software/package-search-field-placeholder.tsx +23 -0
- package/src/components/features/software/schedule-fields.tsx +105 -0
- package/src/components/features/software/software-action-copy.ts +70 -0
- package/src/components/features/software/software-action-form.tsx +199 -0
- package/src/components/features/software/software-row-fields.tsx +105 -0
- package/src/components/features/software/software-row.ts +22 -0
- package/src/components/features/sortable-list/index.ts +1 -0
- package/src/components/features/sortable-list/sortable-drag-handle.tsx +41 -0
- package/src/components/layout/page-heading.tsx +23 -6
- package/src/components/navigation/index.ts +5 -0
- package/src/components/navigation/mingo-ai-button.tsx +37 -13
- package/src/components/navigation/sticky-section-nav.tsx +99 -1
- package/src/components/product-demo/cast.tsx +78 -0
- package/src/components/product-demo/fixtures/cloud-tenants.ts +63 -0
- package/src/components/product-demo/fixtures/devices.ts +87 -0
- package/src/components/product-demo/fixtures/knowledge.ts +48 -0
- package/src/components/product-demo/fixtures/logs.ts +103 -0
- package/src/components/product-demo/fixtures/policies.ts +77 -0
- package/src/components/product-demo/fixtures/remote-session.ts +65 -0
- package/src/components/product-demo/fixtures/shared.ts +53 -0
- package/src/components/product-demo/fixtures/software-update.ts +63 -0
- package/src/components/product-demo/fixtures/tickets-board.ts +100 -0
- package/src/components/product-demo/index.ts +7 -0
- package/src/components/product-demo/product-screen.tsx +94 -0
- package/src/components/product-demo/registry.ts +20 -0
- package/src/components/product-demo/screen-keys.ts +31 -0
- package/src/components/product-demo/screens/cloud-tenants.tsx +23 -0
- package/src/components/product-demo/screens/devices.tsx +41 -0
- package/src/components/product-demo/screens/knowledge.tsx +27 -0
- package/src/components/product-demo/screens/logs.tsx +113 -0
- package/src/components/product-demo/screens/policies.tsx +29 -0
- package/src/components/product-demo/screens/remote-desktop-picture.tsx +118 -0
- package/src/components/product-demo/screens/remote-session.tsx +46 -0
- package/src/components/product-demo/screens/software-update.tsx +97 -0
- package/src/components/product-demo/screens/tickets-board.tsx +28 -0
- package/src/components/product-demo/types.ts +10 -0
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/product-screen-frame.tsx +136 -0
- package/src/components/ui/radio-group.tsx +16 -4
- package/src/components/ui/snap-carousel.tsx +26 -1
- package/src/components/ui/tag.tsx +5 -0
- package/src/hooks/ui/index.ts +1 -0
- package/src/hooks/ui/use-header-height.ts +51 -2
- package/src/hooks/ui/use-sticky-toolbar.ts +60 -0
- package/src/hooks/use-location-hash.ts +9 -5
- package/src/hooks/use-scroll-to-hash.ts +9 -1
- package/src/types/case-study.ts +21 -1
- package/src/utils/date-utils.ts +8 -1
- package/src/utils/index.ts +5 -0
- package/src/utils/open-in-new-tab.ts +12 -0
- package/src/utils/same-page-hash-nav.ts +57 -0
- package/src/utils/scroll-into-view.ts +21 -5
- package/dist/chunk-BM5MVGH3.cjs +0 -499
- package/dist/chunk-CUME3VTQ.js +0 -144
- package/dist/chunk-CZ7Y7UG4.js +0 -732
- package/dist/chunk-FLKJYMVB.js +0 -499
- package/dist/chunk-OF6GEI5A.cjs +0 -144
- package/dist/chunk-UVTD52MD.cjs +0 -732
|
@@ -0,0 +1,1207 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
apiErrorMessage
|
|
4
|
+
} from "./chunk-34I6XI3N.js";
|
|
5
|
+
import {
|
|
6
|
+
getPlatformBrandClasses,
|
|
7
|
+
useMediaQuery
|
|
8
|
+
} from "./chunk-ADBE7QF3.js";
|
|
9
|
+
import {
|
|
10
|
+
FlamingoLogo,
|
|
11
|
+
MiamiCyberGangLogoFaceOnly,
|
|
12
|
+
MlgLogo,
|
|
13
|
+
OpenFrameLogo,
|
|
14
|
+
OpenmspLogo
|
|
15
|
+
} from "./chunk-N45D4ZXQ.js";
|
|
16
|
+
import {
|
|
17
|
+
cn
|
|
18
|
+
} from "./chunk-7RXWKTAP.js";
|
|
19
|
+
|
|
20
|
+
// src/hooks/ui/use-debounce.ts
|
|
21
|
+
import { useState, useEffect } from "react";
|
|
22
|
+
function useDebounce(value, delay = 500) {
|
|
23
|
+
const [debouncedValue, setDebouncedValue] = useState(value);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const timer = setTimeout(() => {
|
|
26
|
+
setDebouncedValue(value);
|
|
27
|
+
}, delay);
|
|
28
|
+
return () => {
|
|
29
|
+
clearTimeout(timer);
|
|
30
|
+
};
|
|
31
|
+
}, [value, delay]);
|
|
32
|
+
return debouncedValue;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/hooks/ui/use-header-height.ts
|
|
36
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
37
|
+
var SITE_HEADER_SELECTOR = "[data-site-header]";
|
|
38
|
+
function useHeaderHeight(defaultHeight = 72, options = {}) {
|
|
39
|
+
const { enabled = true, stuckOnly = false } = options;
|
|
40
|
+
const [height, setHeight] = useState2(defaultHeight);
|
|
41
|
+
useEffect2(() => {
|
|
42
|
+
if (!enabled) return void 0;
|
|
43
|
+
if (stuckOnly) {
|
|
44
|
+
let stop;
|
|
45
|
+
const watch = (header2) => {
|
|
46
|
+
const measureStuck = () => setHeight(header2.style.transform.includes("-100%") ? 0 : header2.offsetHeight);
|
|
47
|
+
measureStuck();
|
|
48
|
+
const resize = new ResizeObserver(measureStuck);
|
|
49
|
+
resize.observe(header2);
|
|
50
|
+
const mutation = new MutationObserver(measureStuck);
|
|
51
|
+
mutation.observe(header2, { attributes: true, attributeFilter: ["style"] });
|
|
52
|
+
stop = () => {
|
|
53
|
+
resize.disconnect();
|
|
54
|
+
mutation.disconnect();
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const present = document.querySelector(SITE_HEADER_SELECTOR);
|
|
58
|
+
if (present) {
|
|
59
|
+
watch(present);
|
|
60
|
+
return () => stop?.();
|
|
61
|
+
}
|
|
62
|
+
const arrival = new MutationObserver(() => {
|
|
63
|
+
const header2 = document.querySelector(SITE_HEADER_SELECTOR);
|
|
64
|
+
if (!header2) return;
|
|
65
|
+
arrival.disconnect();
|
|
66
|
+
watch(header2);
|
|
67
|
+
});
|
|
68
|
+
arrival.observe(document.body, { childList: true, subtree: true });
|
|
69
|
+
return () => {
|
|
70
|
+
arrival.disconnect();
|
|
71
|
+
stop?.();
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const measure = () => {
|
|
75
|
+
let total = 0;
|
|
76
|
+
const header2 = document.querySelector("header");
|
|
77
|
+
if (header2) total += header2.offsetHeight;
|
|
78
|
+
const bar2 = document.querySelector("[data-announcement-bar]");
|
|
79
|
+
if (bar2 instanceof HTMLElement) total += bar2.offsetHeight;
|
|
80
|
+
setHeight(total > 0 ? total : defaultHeight);
|
|
81
|
+
};
|
|
82
|
+
measure();
|
|
83
|
+
const resizeObserver = new ResizeObserver(measure);
|
|
84
|
+
const header = document.querySelector("header");
|
|
85
|
+
if (header) resizeObserver.observe(header);
|
|
86
|
+
const bar = document.querySelector("[data-announcement-bar]");
|
|
87
|
+
if (bar) resizeObserver.observe(bar);
|
|
88
|
+
const mutationObserver = new MutationObserver((mutations) => {
|
|
89
|
+
for (const mutation of mutations) {
|
|
90
|
+
if (mutation.type === "childList" || mutation.type === "attributes") {
|
|
91
|
+
measure();
|
|
92
|
+
const newBar = document.querySelector("[data-announcement-bar]");
|
|
93
|
+
if (newBar) resizeObserver.observe(newBar);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
mutationObserver.observe(document.body, {
|
|
98
|
+
childList: true,
|
|
99
|
+
subtree: true,
|
|
100
|
+
attributes: true,
|
|
101
|
+
attributeFilter: ["data-announcement-bar"]
|
|
102
|
+
});
|
|
103
|
+
return () => {
|
|
104
|
+
resizeObserver.disconnect();
|
|
105
|
+
mutationObserver.disconnect();
|
|
106
|
+
};
|
|
107
|
+
}, [defaultHeight, enabled, stuckOnly]);
|
|
108
|
+
return height;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// src/hooks/ui/use-marquee-engine.ts
|
|
112
|
+
import { useCallback, useEffect as useEffect3, useRef } from "react";
|
|
113
|
+
var RESYNC_EPSILON = 1.5;
|
|
114
|
+
function useMarqueeEngine(options) {
|
|
115
|
+
const posRef = useRef(0);
|
|
116
|
+
const glideRemainingRef = useRef(0);
|
|
117
|
+
const speedEnvRef = useRef(0);
|
|
118
|
+
const optsRef = useRef(options);
|
|
119
|
+
useEffect3(() => {
|
|
120
|
+
optsRef.current = options;
|
|
121
|
+
});
|
|
122
|
+
const wrap = useCallback((pos) => {
|
|
123
|
+
const half = optsRef.current.getWrapSize();
|
|
124
|
+
if (half <= 0) return pos;
|
|
125
|
+
const min = optsRef.current.getWrapMin?.() ?? 0;
|
|
126
|
+
let wrapped = pos;
|
|
127
|
+
while (wrapped >= min + half) wrapped -= half;
|
|
128
|
+
while (wrapped < min) wrapped += half;
|
|
129
|
+
return wrapped;
|
|
130
|
+
}, []);
|
|
131
|
+
const glideBy = useCallback((px) => {
|
|
132
|
+
glideRemainingRef.current += px;
|
|
133
|
+
}, []);
|
|
134
|
+
const active = options.active;
|
|
135
|
+
useEffect3(() => {
|
|
136
|
+
if (!active) return void 0;
|
|
137
|
+
let raf = 0;
|
|
138
|
+
let last = performance.now();
|
|
139
|
+
const readBack = optsRef.current.readBack;
|
|
140
|
+
if (readBack) posRef.current = readBack();
|
|
141
|
+
const tick = (now) => {
|
|
142
|
+
const opts = optsRef.current;
|
|
143
|
+
const dt = Math.min(now - last, 100) / 1e3;
|
|
144
|
+
last = now;
|
|
145
|
+
const paused = opts.isPaused(now);
|
|
146
|
+
const targetSpeed = paused ? 0 : opts.speed;
|
|
147
|
+
speedEnvRef.current += (targetSpeed - speedEnvRef.current) * Math.min(1, dt / 0.25);
|
|
148
|
+
if (targetSpeed === 0 && speedEnvRef.current < 0.5) speedEnvRef.current = 0;
|
|
149
|
+
const external = opts.readBack ? opts.readBack() : null;
|
|
150
|
+
const resync = () => {
|
|
151
|
+
if (external !== null && Math.abs(external - posRef.current) > RESYNC_EPSILON) {
|
|
152
|
+
posRef.current = external;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const glide = glideRemainingRef.current;
|
|
156
|
+
if (glide !== 0) {
|
|
157
|
+
resync();
|
|
158
|
+
const speed = Math.max(Math.abs(glide) * 6, 240);
|
|
159
|
+
const step = Math.sign(glide) * Math.min(Math.abs(glide), speed * dt);
|
|
160
|
+
glideRemainingRef.current = Math.abs(glide - step) < 0.5 ? 0 : glide - step;
|
|
161
|
+
posRef.current = wrap(posRef.current + step);
|
|
162
|
+
opts.apply(posRef.current);
|
|
163
|
+
} else if (speedEnvRef.current > 0) {
|
|
164
|
+
resync();
|
|
165
|
+
posRef.current = wrap(posRef.current + speedEnvRef.current * dt);
|
|
166
|
+
opts.apply(posRef.current);
|
|
167
|
+
} else if (external !== null) {
|
|
168
|
+
posRef.current = external;
|
|
169
|
+
}
|
|
170
|
+
opts.onAfterFrame?.();
|
|
171
|
+
raf = requestAnimationFrame(tick);
|
|
172
|
+
};
|
|
173
|
+
raf = requestAnimationFrame(tick);
|
|
174
|
+
return () => cancelAnimationFrame(raf);
|
|
175
|
+
}, [active, wrap]);
|
|
176
|
+
return { posRef, glideBy, wrap };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// src/hooks/ui/use-reset-on-page-hidden.ts
|
|
180
|
+
import { useEffect as useEffect4 } from "react";
|
|
181
|
+
function useResetOnPageHidden(reset) {
|
|
182
|
+
useEffect4(() => {
|
|
183
|
+
const onVisibility = () => {
|
|
184
|
+
if (document.visibilityState === "hidden") reset();
|
|
185
|
+
};
|
|
186
|
+
window.addEventListener("blur", reset);
|
|
187
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
188
|
+
return () => {
|
|
189
|
+
window.removeEventListener("blur", reset);
|
|
190
|
+
document.removeEventListener("visibilitychange", onVisibility);
|
|
191
|
+
};
|
|
192
|
+
}, [reset]);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// src/hooks/ui/use-suppress-clone-focus.ts
|
|
196
|
+
import { useEffect as useEffect5, useRef as useRef2 } from "react";
|
|
197
|
+
var CLONE_FOCUSABLE_SELECTOR = 'a[href],button,input,select,textarea,iframe,summary,audio[controls],video[controls],[tabindex],[contenteditable]:not([contenteditable="false"])';
|
|
198
|
+
function useSuppressCloneFocus(active) {
|
|
199
|
+
const ref = useRef2(null);
|
|
200
|
+
useEffect5(() => {
|
|
201
|
+
const root = ref.current;
|
|
202
|
+
if (!root || !active) return void 0;
|
|
203
|
+
const suppress = () => {
|
|
204
|
+
root.querySelectorAll(CLONE_FOCUSABLE_SELECTOR).forEach((el) => {
|
|
205
|
+
if (el.getAttribute("tabindex") !== "-1") el.setAttribute("tabindex", "-1");
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
suppress();
|
|
209
|
+
const mo = new MutationObserver(suppress);
|
|
210
|
+
mo.observe(root, {
|
|
211
|
+
childList: true,
|
|
212
|
+
subtree: true,
|
|
213
|
+
attributes: true,
|
|
214
|
+
attributeFilter: ["href", "tabindex", "contenteditable", "controls"]
|
|
215
|
+
});
|
|
216
|
+
return () => mo.disconnect();
|
|
217
|
+
}, [active]);
|
|
218
|
+
return ref;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// src/hooks/ui/use-prefers-reduced-motion.ts
|
|
222
|
+
var PREFERS_REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
223
|
+
function usePrefersReducedMotion() {
|
|
224
|
+
return useMediaQuery(PREFERS_REDUCED_MOTION_QUERY) === true;
|
|
225
|
+
}
|
|
226
|
+
function usePrefersReducedMotionState() {
|
|
227
|
+
return useMediaQuery(PREFERS_REDUCED_MOTION_QUERY);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/hooks/ui/use-in-view.ts
|
|
231
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useRef as useRef3, useState as useState3 } from "react";
|
|
232
|
+
var STEPS = Array.from({ length: 21 }, (_, i) => i / 20);
|
|
233
|
+
function useInView({
|
|
234
|
+
threshold = 0,
|
|
235
|
+
rootMargin = "0px",
|
|
236
|
+
initial = false
|
|
237
|
+
} = {}) {
|
|
238
|
+
const [inView, setInView] = useState3(initial);
|
|
239
|
+
const observerRef = useRef3(null);
|
|
240
|
+
const disconnect = useCallback2(() => {
|
|
241
|
+
observerRef.current?.disconnect();
|
|
242
|
+
observerRef.current = null;
|
|
243
|
+
}, []);
|
|
244
|
+
const ref = useCallback2(
|
|
245
|
+
(node) => {
|
|
246
|
+
disconnect();
|
|
247
|
+
if (!node) {
|
|
248
|
+
setInView(false);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (typeof IntersectionObserver === "undefined") {
|
|
252
|
+
setInView(initial);
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const observer = new IntersectionObserver(
|
|
256
|
+
(entries) => {
|
|
257
|
+
const entry = entries[entries.length - 1];
|
|
258
|
+
if (!entry) return;
|
|
259
|
+
const ofElement = entry.intersectionRatio >= threshold;
|
|
260
|
+
const viewportHeight = entry.rootBounds?.height ?? 0;
|
|
261
|
+
const ofViewport = viewportHeight > 0 && (entry.intersectionRect?.height ?? 0) >= viewportHeight * threshold;
|
|
262
|
+
setInView(entry.isIntersecting && (ofElement || ofViewport));
|
|
263
|
+
},
|
|
264
|
+
{ threshold: STEPS, rootMargin }
|
|
265
|
+
);
|
|
266
|
+
observer.observe(node);
|
|
267
|
+
observerRef.current = observer;
|
|
268
|
+
},
|
|
269
|
+
[disconnect, threshold, rootMargin, initial]
|
|
270
|
+
);
|
|
271
|
+
useEffect6(() => disconnect, [disconnect]);
|
|
272
|
+
return { ref, inView };
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// src/hooks/ui/use-autoplay.ts
|
|
276
|
+
import { useEffect as useEffect7, useState as useState4 } from "react";
|
|
277
|
+
function useAutoplay(onScreen) {
|
|
278
|
+
const reducedState = usePrefersReducedMotionState();
|
|
279
|
+
const [paused, setPaused] = useState4(false);
|
|
280
|
+
const [tabHidden, setTabHidden] = useState4(false);
|
|
281
|
+
useEffect7(() => {
|
|
282
|
+
const sync = () => setTabHidden(document.visibilityState === "hidden");
|
|
283
|
+
sync();
|
|
284
|
+
document.addEventListener("visibilitychange", sync);
|
|
285
|
+
window.addEventListener("pageshow", sync);
|
|
286
|
+
return () => {
|
|
287
|
+
document.removeEventListener("visibilitychange", sync);
|
|
288
|
+
window.removeEventListener("pageshow", sync);
|
|
289
|
+
};
|
|
290
|
+
}, []);
|
|
291
|
+
return {
|
|
292
|
+
playing: onScreen && !paused && !tabHidden && reducedState === false,
|
|
293
|
+
paused,
|
|
294
|
+
setPaused,
|
|
295
|
+
reducedMotion: reducedState === true
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// src/utils/visitor-os.ts
|
|
300
|
+
var DESKTOP_OSES = ["mac", "windows", "linux"];
|
|
301
|
+
var HINT_PLATFORMS = {
|
|
302
|
+
macos: "mac",
|
|
303
|
+
windows: "windows",
|
|
304
|
+
linux: "linux",
|
|
305
|
+
"chrome os": "linux",
|
|
306
|
+
"chromium os": "linux",
|
|
307
|
+
android: "android",
|
|
308
|
+
ios: "ios"
|
|
309
|
+
};
|
|
310
|
+
function detectVisitorOs(userAgent, hints = {}) {
|
|
311
|
+
const touchMac = (os) => os === "mac" && (hints.maxTouchPoints ?? 0) > 1 ? "ios" : os;
|
|
312
|
+
const hinted = HINT_PLATFORMS[(hints.platform ?? "").replace(/"/g, "").trim().toLowerCase()];
|
|
313
|
+
if (hinted) return touchMac(hinted);
|
|
314
|
+
const ua = userAgent ?? "";
|
|
315
|
+
if (!ua) return null;
|
|
316
|
+
if (/iPhone|iPad|iPod/i.test(ua)) return "ios";
|
|
317
|
+
if (/Android/i.test(ua)) return "android";
|
|
318
|
+
if (/Windows NT|Win64|Win32/i.test(ua)) return "windows";
|
|
319
|
+
if (/Macintosh|Mac OS X/i.test(ua)) return touchMac("mac");
|
|
320
|
+
if (/Linux|X11|CrOS/i.test(ua)) return "linux";
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
function desktopOsOf(os) {
|
|
324
|
+
return os !== null && DESKTOP_OSES.includes(os) ? os : null;
|
|
325
|
+
}
|
|
326
|
+
function detectDesktopOs(userAgent, hints) {
|
|
327
|
+
return desktopOsOf(detectVisitorOs(userAgent, hints));
|
|
328
|
+
}
|
|
329
|
+
function usesCommandKey(os) {
|
|
330
|
+
return os === "mac" || os === "ios";
|
|
331
|
+
}
|
|
332
|
+
function shortcutLabel(os, key) {
|
|
333
|
+
return usesCommandKey(os) ? `\u2318${key}` : `Ctrl ${key}`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// src/hooks/ui/use-visitor-os.ts
|
|
337
|
+
import { useSyncExternalStore } from "react";
|
|
338
|
+
var UNKNOWN = { known: false, os: null };
|
|
339
|
+
var KNOWN = /* @__PURE__ */ new Map();
|
|
340
|
+
var subscribe = () => () => {
|
|
341
|
+
};
|
|
342
|
+
var getServerSnapshot = () => UNKNOWN;
|
|
343
|
+
function getSnapshot() {
|
|
344
|
+
const stated = navigator.userAgentData?.platform;
|
|
345
|
+
const os = detectVisitorOs(navigator.userAgent, { platform: stated, maxTouchPoints: navigator.maxTouchPoints });
|
|
346
|
+
let state = KNOWN.get(os);
|
|
347
|
+
if (!state) {
|
|
348
|
+
state = { known: true, os };
|
|
349
|
+
KNOWN.set(os, state);
|
|
350
|
+
}
|
|
351
|
+
return state;
|
|
352
|
+
}
|
|
353
|
+
function useVisitorOs() {
|
|
354
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// src/utils/platform-config.tsx
|
|
358
|
+
import { Globe } from "lucide-react";
|
|
359
|
+
import { jsx } from "react/jsx-runtime";
|
|
360
|
+
function renderPlatformIcon(platformName, className) {
|
|
361
|
+
const tinted = cn(className, getPlatformBrandClasses(platformName).accentText);
|
|
362
|
+
switch (platformName) {
|
|
363
|
+
case "openframe":
|
|
364
|
+
return /* @__PURE__ */ jsx(
|
|
365
|
+
OpenFrameLogo,
|
|
366
|
+
{
|
|
367
|
+
className: tinted,
|
|
368
|
+
lowerPathColor: "currentColor",
|
|
369
|
+
upperPathColor: "var(--ods-system-greys-white)"
|
|
370
|
+
}
|
|
371
|
+
);
|
|
372
|
+
case "openmsp":
|
|
373
|
+
return /* @__PURE__ */ jsx(
|
|
374
|
+
OpenmspLogo,
|
|
375
|
+
{
|
|
376
|
+
className: tinted,
|
|
377
|
+
backBubbleColor: "currentColor",
|
|
378
|
+
frontBubbleColor: "var(--ods-system-greys-white)",
|
|
379
|
+
innerFrontBubbleColor: "var(--ods-system-greys-black)"
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
case "tmcg":
|
|
383
|
+
return /* @__PURE__ */ jsx(MiamiCyberGangLogoFaceOnly, { className });
|
|
384
|
+
case "mlg":
|
|
385
|
+
return /* @__PURE__ */ jsx(MlgLogo, { className: tinted, size: 20 });
|
|
386
|
+
case "universal":
|
|
387
|
+
return /* @__PURE__ */ jsx(Globe, { className: tinted });
|
|
388
|
+
default:
|
|
389
|
+
return /* @__PURE__ */ jsx(FlamingoLogo, { className: tinted, fill: "currentColor" });
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
var platformIcons = {
|
|
393
|
+
openframe: renderPlatformIcon("openframe", "h-5 w-5"),
|
|
394
|
+
openmsp: renderPlatformIcon("openmsp", "h-5 w-5"),
|
|
395
|
+
flamingo: renderPlatformIcon("flamingo", "h-5 w-5"),
|
|
396
|
+
"flamingo-teaser": renderPlatformIcon("flamingo-teaser", "h-5 w-5"),
|
|
397
|
+
"marketing-hub": renderPlatformIcon("marketing-hub", "h-5 w-5"),
|
|
398
|
+
"product-hub": renderPlatformIcon("product-hub", "h-5 w-5"),
|
|
399
|
+
"revenue-hub": renderPlatformIcon("revenue-hub", "h-5 w-5"),
|
|
400
|
+
"people-hub": renderPlatformIcon("people-hub", "h-5 w-5"),
|
|
401
|
+
"company-hub": renderPlatformIcon("company-hub", "h-5 w-5"),
|
|
402
|
+
tmcg: renderPlatformIcon("tmcg", "h-5 w-5"),
|
|
403
|
+
mlg: renderPlatformIcon("mlg", "h-5 w-5"),
|
|
404
|
+
universal: renderPlatformIcon("universal", "h-5 w-5")
|
|
405
|
+
};
|
|
406
|
+
function transformPlatformConfigsToOptions(platformConfigs) {
|
|
407
|
+
return platformConfigs.map((platform) => ({
|
|
408
|
+
id: platform.id,
|
|
409
|
+
// Database UUID for matching
|
|
410
|
+
name: platform.name,
|
|
411
|
+
// Platform name enum
|
|
412
|
+
displayName: platform.display_name,
|
|
413
|
+
// Human-readable name
|
|
414
|
+
description: platform.description,
|
|
415
|
+
icon: getPlatformIcon(platform.name),
|
|
416
|
+
color: getPlatformColorClass(platform.name)
|
|
417
|
+
}));
|
|
418
|
+
}
|
|
419
|
+
function getPlatformIcon(platformName) {
|
|
420
|
+
return platformIcons[platformName] ?? platformIcons.universal;
|
|
421
|
+
}
|
|
422
|
+
function getSmallPlatformIcon(platformName) {
|
|
423
|
+
return renderPlatformIcon(platformName, "h-4 w-4 flex-shrink-0");
|
|
424
|
+
}
|
|
425
|
+
function getPlatformIconComponent(platformName, className = "h-6 w-6") {
|
|
426
|
+
return renderPlatformIcon(platformName, className);
|
|
427
|
+
}
|
|
428
|
+
function getPlatformColorClass(platformName) {
|
|
429
|
+
return getPlatformBrandClasses(platformName).accentBg;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// src/utils/access-code-client.ts
|
|
433
|
+
async function validateAccessCode(email, code, endpoints) {
|
|
434
|
+
try {
|
|
435
|
+
const response = await fetch(endpoints.validateUrl, {
|
|
436
|
+
method: "POST",
|
|
437
|
+
headers: {
|
|
438
|
+
"Content-Type": "application/json"
|
|
439
|
+
},
|
|
440
|
+
body: JSON.stringify({ email, code })
|
|
441
|
+
});
|
|
442
|
+
if (!response.ok) {
|
|
443
|
+
const failure = await response.json().catch(() => null);
|
|
444
|
+
throw new Error(apiErrorMessage(failure, "Validation request failed"));
|
|
445
|
+
}
|
|
446
|
+
return await response.json();
|
|
447
|
+
} catch (error) {
|
|
448
|
+
return {
|
|
449
|
+
valid: false,
|
|
450
|
+
message: error instanceof Error ? error.message : "Validation failed"
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
async function consumeAccessCode(email, code, endpoints) {
|
|
455
|
+
try {
|
|
456
|
+
const response = await fetch(endpoints.consumeUrl, {
|
|
457
|
+
method: "POST",
|
|
458
|
+
headers: {
|
|
459
|
+
"Content-Type": "application/json"
|
|
460
|
+
},
|
|
461
|
+
body: JSON.stringify({ email, code })
|
|
462
|
+
});
|
|
463
|
+
if (!response.ok) {
|
|
464
|
+
const failure = await response.json().catch(() => null);
|
|
465
|
+
throw new Error(apiErrorMessage(failure, "Consumption request failed"));
|
|
466
|
+
}
|
|
467
|
+
return await response.json();
|
|
468
|
+
} catch (error) {
|
|
469
|
+
return {
|
|
470
|
+
success: false,
|
|
471
|
+
consumed: false,
|
|
472
|
+
message: error instanceof Error ? error.message : "Consumption failed"
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
async function validateAndConsumeAccessCode(email, code, endpoints) {
|
|
477
|
+
const validation = await validateAccessCode(email, code, endpoints);
|
|
478
|
+
if (!validation.valid) {
|
|
479
|
+
return validation;
|
|
480
|
+
}
|
|
481
|
+
const consumption = await consumeAccessCode(email, code, endpoints);
|
|
482
|
+
return {
|
|
483
|
+
...validation,
|
|
484
|
+
consumed: consumption.consumed,
|
|
485
|
+
message: consumption.consumed ? `Access granted for ${validation.cohort_name}` : consumption.message || validation.message
|
|
486
|
+
};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// src/utils/embed-url-converters.ts
|
|
490
|
+
function toGoogleSheetsEmbedUrl(url) {
|
|
491
|
+
if (url.includes("/htmlembed")) return url;
|
|
492
|
+
const match = url.match(/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/);
|
|
493
|
+
if (!match) return url;
|
|
494
|
+
const gidMatch = url.match(/[#?&]gid=(\d+)/);
|
|
495
|
+
const gid = gidMatch ? gidMatch[1] : "0";
|
|
496
|
+
return `https://docs.google.com/spreadsheets/d/${match[1]}/htmlembed?widget=true&chrome=false&headers=false&gid=${gid}`;
|
|
497
|
+
}
|
|
498
|
+
function toGoogleSheetsOriginalUrl(url) {
|
|
499
|
+
const match = url.match(/\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/);
|
|
500
|
+
if (!match) return url;
|
|
501
|
+
const gidMatch = url.match(/[#?&]gid=(\d+)/);
|
|
502
|
+
const gid = gidMatch ? gidMatch[1] : "0";
|
|
503
|
+
return `https://docs.google.com/spreadsheets/d/${match[1]}/edit#gid=${gid}`;
|
|
504
|
+
}
|
|
505
|
+
function toFigmaEmbedUrl(url, opts) {
|
|
506
|
+
if (url.includes("embed.figma.com")) return url;
|
|
507
|
+
if (url.includes("figma.com/embed")) return url;
|
|
508
|
+
const match = url.match(/figma\.com\/(design|file|proto|board|slides|deck)\/([a-zA-Z0-9]+)(?:\/([^?]*))?(\?.*)?$/);
|
|
509
|
+
if (match) {
|
|
510
|
+
const [, urlType, fileKey, titleSlug, queryString] = match;
|
|
511
|
+
const isSlides = urlType === "slides" || urlType === "deck";
|
|
512
|
+
const embedType = urlType === "proto" ? "proto" : isSlides ? opts?.slidesView === "browse" ? "slides" : "deck" : "design";
|
|
513
|
+
const pathSuffix = titleSlug ? `/${titleSlug}` : "";
|
|
514
|
+
const params = new URLSearchParams(queryString?.replace(/^\?/, "") || "");
|
|
515
|
+
if (!params.has("embed-host")) {
|
|
516
|
+
params.set("embed-host", "flamingo");
|
|
517
|
+
}
|
|
518
|
+
const clientId = process.env.NEXT_PUBLIC_FIGMA_CLIENT_ID;
|
|
519
|
+
if (clientId && !params.has("client-id")) {
|
|
520
|
+
params.set("client-id", clientId);
|
|
521
|
+
}
|
|
522
|
+
return `https://embed.figma.com/${embedType}/${fileKey}${pathSuffix}?${params.toString()}`;
|
|
523
|
+
}
|
|
524
|
+
return `https://www.figma.com/embed?embed-host=flamingo&url=${encodeURIComponent(url)}`;
|
|
525
|
+
}
|
|
526
|
+
function isFigmaSlidesUrl(url) {
|
|
527
|
+
if (!url) return false;
|
|
528
|
+
return /(?:www\.|embed\.)?figma\.com\/(?:slides|deck)\/[a-zA-Z0-9]+/.test(url);
|
|
529
|
+
}
|
|
530
|
+
function toFigmaOriginalUrl(url) {
|
|
531
|
+
if (url.includes("embed.figma.com")) {
|
|
532
|
+
return url.replace("embed.figma.com", "www.figma.com").replace(/\?.*$/, "");
|
|
533
|
+
}
|
|
534
|
+
return url.replace(/\?.*$/, "");
|
|
535
|
+
}
|
|
536
|
+
function toClaudeMirrorPath(url, storageViewBaseUrl) {
|
|
537
|
+
if (!url || !storageViewBaseUrl) return null;
|
|
538
|
+
try {
|
|
539
|
+
const u = new URL(url);
|
|
540
|
+
const host = u.hostname.toLowerCase();
|
|
541
|
+
const id = host === "claude.ai" && /^\/(?:code\/artifact|public\/artifacts)\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[/?#]|$)/i.exec(
|
|
542
|
+
u.pathname
|
|
543
|
+
)?.[1] || host === "claude.site" && /^\/artifacts\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:[/?#]|$)/i.exec(
|
|
544
|
+
u.pathname
|
|
545
|
+
)?.[1] || null;
|
|
546
|
+
return id ? `${storageViewBaseUrl.replace(/\/$/, "")}/design-briefs/${id.toLowerCase()}.html` : null;
|
|
547
|
+
} catch {
|
|
548
|
+
return null;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
function toClaudeEmbedUrl(url) {
|
|
552
|
+
if (!url) return null;
|
|
553
|
+
try {
|
|
554
|
+
const u = new URL(url);
|
|
555
|
+
const host = u.hostname.toLowerCase();
|
|
556
|
+
const publicId = host === "claude.ai" && /^\/public\/artifacts\/([\w-]+)(?:\/embed)?\/?$/.exec(u.pathname)?.[1] || host === "claude.site" && /^\/artifacts\/([\w-]+)(?:\/embed)?\/?$/.exec(u.pathname)?.[1] || null;
|
|
557
|
+
return publicId ? `https://claude.ai/public/artifacts/${publicId}/embed` : null;
|
|
558
|
+
} catch {
|
|
559
|
+
return null;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// src/utils/markdown-fences.ts
|
|
564
|
+
var FENCE_RE = /^ {0,3}(`{3,}|~{3,})([^\n]*?)\r?$/;
|
|
565
|
+
var BLANK_LINE_RE = /^[ \t\r]*$/;
|
|
566
|
+
function isBlankLine(line) {
|
|
567
|
+
return BLANK_LINE_RE.test(line);
|
|
568
|
+
}
|
|
569
|
+
function createFenceTracker() {
|
|
570
|
+
let fenceChar = null;
|
|
571
|
+
let fenceLength = 0;
|
|
572
|
+
return {
|
|
573
|
+
push(line) {
|
|
574
|
+
const fence = FENCE_RE.exec(line);
|
|
575
|
+
if (fence) {
|
|
576
|
+
const run = fence[1];
|
|
577
|
+
if (fenceChar === null) {
|
|
578
|
+
fenceChar = run[0];
|
|
579
|
+
fenceLength = run.length;
|
|
580
|
+
return "open";
|
|
581
|
+
}
|
|
582
|
+
if (run[0] === fenceChar && run.length >= fenceLength && isBlankLine(fence[2])) {
|
|
583
|
+
fenceChar = null;
|
|
584
|
+
fenceLength = 0;
|
|
585
|
+
return "close";
|
|
586
|
+
}
|
|
587
|
+
return "inside";
|
|
588
|
+
}
|
|
589
|
+
return fenceChar === null ? "text" : "inside";
|
|
590
|
+
},
|
|
591
|
+
openChar: () => fenceChar,
|
|
592
|
+
openLength: () => fenceLength
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// src/utils/markdown-heading-id.ts
|
|
597
|
+
var HEADING_EMOJI_RE = /[\u{1F300}-\u{1F9FF}]|[\u{2600}-\u{26FF}]|[\u{2700}-\u{27BF}]/gu;
|
|
598
|
+
function stripHeadingEmojis(text) {
|
|
599
|
+
return text.replace(HEADING_EMOJI_RE, "").trim();
|
|
600
|
+
}
|
|
601
|
+
function slugifyHeadingBase(text) {
|
|
602
|
+
return text.trim().toLowerCase().replace(/[^\w\s-]/g, "").replace(/\s+/g, "-").replace(/^-+|-+$/g, "");
|
|
603
|
+
}
|
|
604
|
+
function slugifyHeadingText(text) {
|
|
605
|
+
return slugifyHeadingBase(stripHeadingEmojis(text));
|
|
606
|
+
}
|
|
607
|
+
var ATX_HEADING_RE = /^ {0,3}(#{1,6})[ \t]+(.*?)(?:[ \t]+#+)?[ \t]*\r?$/;
|
|
608
|
+
var ATX_EMPTY_RE = /^ {0,3}(#{1,6})[ \t]*#*[ \t]*\r?$/;
|
|
609
|
+
var RAW_HEADING_RE = /<h([1-6])\b[^>]*>([\s\S]*?)(?:<\/h\1>|$)/gi;
|
|
610
|
+
var CONTAINER_PREFIX_RE = /^ {0,3}(?:(?:>[ \t]?)+|(?:[-+*]|\d{1,9}[.)])[ \t]+)+/;
|
|
611
|
+
var SETEXT_UNDERLINE_RE = /^ {0,3}(=+|-+)[ \t]*\r?$/;
|
|
612
|
+
var THEMATIC_BREAK_RE = /^ {0,3}(\*|_){3,}[ \t]*\r?$/;
|
|
613
|
+
var HTML_BLOCK_TAGS = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";
|
|
614
|
+
var HTML_BLOCK_OPENER_RE = new RegExp(
|
|
615
|
+
`^ {0,3}(?:<(?:script|pre|style|textarea)(?:[\\s>]|$)|<!--|<\\?|<![a-zA-Z]|<!\\[CDATA\\[|</?(?:${HTML_BLOCK_TAGS})(?:[\\s/>]|$)|<[a-zA-Z][a-zA-Z0-9-]*(?:\\s[^>]*)?/?>[ \\t]*\\r?$|</[a-zA-Z][a-zA-Z0-9-]*[ \\t]*>[ \\t]*\\r?$)`,
|
|
616
|
+
"i"
|
|
617
|
+
);
|
|
618
|
+
function scanHeadings(content, options = {}) {
|
|
619
|
+
const { skipFrontmatter = true, includeRawHtml = true, skipFences = true } = options;
|
|
620
|
+
const out = [];
|
|
621
|
+
const lines = content.split("\n");
|
|
622
|
+
const fences = skipFences ? createFenceTracker() : null;
|
|
623
|
+
let start = 0;
|
|
624
|
+
if (skipFrontmatter && lines[0]?.trim() === "---") {
|
|
625
|
+
for (let i = 1; i < lines.length; i++) {
|
|
626
|
+
if (lines[i].trim() === "---" || lines[i].trim() === "...") {
|
|
627
|
+
start = i + 1;
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
let setextRun = null;
|
|
633
|
+
for (let i = start; i < lines.length; i++) {
|
|
634
|
+
const line = lines[i];
|
|
635
|
+
if (fences) {
|
|
636
|
+
const role = fences.push(line);
|
|
637
|
+
if (role !== "text") {
|
|
638
|
+
setextRun = null;
|
|
639
|
+
continue;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
const prefix = CONTAINER_PREFIX_RE.exec(line)?.[0] ?? "";
|
|
643
|
+
const body = prefix ? line.slice(prefix.length) : line;
|
|
644
|
+
const setext = SETEXT_UNDERLINE_RE.exec(body);
|
|
645
|
+
if (setext) {
|
|
646
|
+
if (setextRun && !setextRun.disqualified && setextRun.prefix === prefix) {
|
|
647
|
+
out.push({
|
|
648
|
+
line: setextRun.line,
|
|
649
|
+
level: setext[1][0] === "=" ? 1 : 2,
|
|
650
|
+
text: setextRun.lines.join("\n")
|
|
651
|
+
});
|
|
652
|
+
}
|
|
653
|
+
setextRun = null;
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
const atx = ATX_HEADING_RE.exec(body) ?? ATX_EMPTY_RE.exec(body);
|
|
657
|
+
if (atx) {
|
|
658
|
+
out.push({ line: i + 1, level: atx[1].length, text: (atx[2] ?? "").trim() });
|
|
659
|
+
setextRun = null;
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (includeRawHtml && line.indexOf("<") !== -1) {
|
|
663
|
+
RAW_HEADING_RE.lastIndex = 0;
|
|
664
|
+
let raw;
|
|
665
|
+
let matched = false;
|
|
666
|
+
while ((raw = RAW_HEADING_RE.exec(line)) !== null) {
|
|
667
|
+
matched = true;
|
|
668
|
+
out.push({
|
|
669
|
+
line: i + 1,
|
|
670
|
+
level: Number(raw[1]),
|
|
671
|
+
text: raw[2].replace(/<[^>]*>/g, "").trim()
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
if (matched) {
|
|
675
|
+
setextRun = null;
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (isBlankLine(body) || THEMATIC_BREAK_RE.test(body)) {
|
|
680
|
+
setextRun = null;
|
|
681
|
+
continue;
|
|
682
|
+
}
|
|
683
|
+
if (setextRun && setextRun.prefix === prefix) {
|
|
684
|
+
setextRun.lines.push(body.trim());
|
|
685
|
+
} else {
|
|
686
|
+
setextRun = {
|
|
687
|
+
line: i + 1,
|
|
688
|
+
prefix,
|
|
689
|
+
lines: [body.trim()],
|
|
690
|
+
disqualified: HTML_BLOCK_OPENER_RE.test(body)
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return out;
|
|
695
|
+
}
|
|
696
|
+
function createHeadingIdDeduper() {
|
|
697
|
+
const counts = {};
|
|
698
|
+
return (cleanId) => {
|
|
699
|
+
if (counts[cleanId]) {
|
|
700
|
+
counts[cleanId]++;
|
|
701
|
+
return `${cleanId}-${counts[cleanId]}`;
|
|
702
|
+
}
|
|
703
|
+
counts[cleanId] = 1;
|
|
704
|
+
return cleanId;
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// src/utils/anchor-id.ts
|
|
709
|
+
function normalizeAnchorId(raw) {
|
|
710
|
+
return slugifyHeadingText(raw).replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
|
711
|
+
}
|
|
712
|
+
var HEADING_SELECTOR = "h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]";
|
|
713
|
+
var DUPLICATE_SUFFIX_RE = /^(.+)-(\d+)$/;
|
|
714
|
+
function findDuplicateShifted(normalized, doc) {
|
|
715
|
+
const parts = DUPLICATE_SUFFIX_RE.exec(normalized);
|
|
716
|
+
if (!parts) return null;
|
|
717
|
+
const ordinal = Number(parts[2]);
|
|
718
|
+
if (!Number.isSafeInteger(ordinal)) return null;
|
|
719
|
+
return doc.getElementById(`${parts[1]}-${ordinal + 1}`);
|
|
720
|
+
}
|
|
721
|
+
function findAnchorElementByNormalizedId(rawId, doc) {
|
|
722
|
+
const normalized = normalizeAnchorId(rawId);
|
|
723
|
+
if (!normalized) return null;
|
|
724
|
+
if (normalized !== rawId) {
|
|
725
|
+
const direct = doc.getElementById(normalized);
|
|
726
|
+
if (direct) return direct;
|
|
727
|
+
}
|
|
728
|
+
for (const heading of Array.from(doc.querySelectorAll(HEADING_SELECTOR))) {
|
|
729
|
+
if (normalizeAnchorId(heading.id) === normalized) return heading;
|
|
730
|
+
}
|
|
731
|
+
return findDuplicateShifted(normalized, doc);
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// src/utils/scroll-into-view.ts
|
|
735
|
+
var activeRaf = 0;
|
|
736
|
+
var teardownActive = null;
|
|
737
|
+
function cancelActiveScroll() {
|
|
738
|
+
if (activeRaf) {
|
|
739
|
+
cancelAnimationFrame(activeRaf);
|
|
740
|
+
activeRaf = 0;
|
|
741
|
+
}
|
|
742
|
+
if (teardownActive) {
|
|
743
|
+
teardownActive();
|
|
744
|
+
teardownActive = null;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
var easeOutCubic = (t) => 1 - Math.pow(1 - t, 3);
|
|
748
|
+
function getScrollableAncestor(el) {
|
|
749
|
+
for (let node = el.parentElement; node; node = node.parentElement) {
|
|
750
|
+
const overflowY = getComputedStyle(node).overflowY;
|
|
751
|
+
if ((overflowY === "auto" || overflowY === "scroll" || overflowY === "overlay") && node.scrollHeight > node.clientHeight) {
|
|
752
|
+
return node;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return null;
|
|
756
|
+
}
|
|
757
|
+
function declaredScrollMarginTop(target) {
|
|
758
|
+
const margin = Number.parseFloat(getComputedStyle(target).scrollMarginTop);
|
|
759
|
+
return Number.isFinite(margin) ? margin : 0;
|
|
760
|
+
}
|
|
761
|
+
function scrollElementIntoView(target, options = {}) {
|
|
762
|
+
if (typeof window === "undefined" || !target) return;
|
|
763
|
+
const { headerOffset = 0, behavior = "smooth", adjustTargetY, durationMs = 320 } = options;
|
|
764
|
+
const container = getScrollableAncestor(target);
|
|
765
|
+
const readCurrent = () => container ? container.scrollTop : window.scrollY;
|
|
766
|
+
const writeTo = (y) => {
|
|
767
|
+
if (container) container.scrollTop = y;
|
|
768
|
+
else window.scrollTo(0, y);
|
|
769
|
+
};
|
|
770
|
+
const computeTarget = () => {
|
|
771
|
+
const offset = Math.max(headerOffset, declaredScrollMarginTop(target));
|
|
772
|
+
const raw = container ? container.scrollTop + (target.getBoundingClientRect().top - container.getBoundingClientRect().top) - offset : target.getBoundingClientRect().top + window.scrollY - offset;
|
|
773
|
+
const adjusted = adjustTargetY ? adjustTargetY(raw) : raw;
|
|
774
|
+
const maxScroll = container ? Math.max(0, container.scrollHeight - container.clientHeight) : Math.max(0, document.documentElement.scrollHeight - window.innerHeight);
|
|
775
|
+
return Math.min(Math.max(0, adjusted), maxScroll);
|
|
776
|
+
};
|
|
777
|
+
cancelActiveScroll();
|
|
778
|
+
const prefersReduced = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
779
|
+
if (behavior === "instant" || behavior === "auto" || prefersReduced) {
|
|
780
|
+
writeTo(computeTarget());
|
|
781
|
+
return;
|
|
782
|
+
}
|
|
783
|
+
let startY = null;
|
|
784
|
+
let startTime = 0;
|
|
785
|
+
const onUserGesture = () => cancelActiveScroll();
|
|
786
|
+
window.addEventListener("wheel", onUserGesture, { passive: true });
|
|
787
|
+
window.addEventListener("touchmove", onUserGesture, { passive: true });
|
|
788
|
+
teardownActive = () => {
|
|
789
|
+
window.removeEventListener("wheel", onUserGesture);
|
|
790
|
+
window.removeEventListener("touchmove", onUserGesture);
|
|
791
|
+
};
|
|
792
|
+
const step = (now) => {
|
|
793
|
+
if (startY === null) {
|
|
794
|
+
startY = readCurrent();
|
|
795
|
+
startTime = now;
|
|
796
|
+
}
|
|
797
|
+
const targetY = computeTarget();
|
|
798
|
+
const t = Math.min(1, (now - startTime) / durationMs);
|
|
799
|
+
const y = startY + (targetY - startY) * easeOutCubic(t);
|
|
800
|
+
writeTo(y);
|
|
801
|
+
if (t < 1) {
|
|
802
|
+
activeRaf = requestAnimationFrame(step);
|
|
803
|
+
} else {
|
|
804
|
+
writeTo(computeTarget());
|
|
805
|
+
activeRaf = 0;
|
|
806
|
+
if (teardownActive) {
|
|
807
|
+
teardownActive();
|
|
808
|
+
teardownActive = null;
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
};
|
|
812
|
+
activeRaf = requestAnimationFrame(step);
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
// src/utils/same-page-hash-nav.ts
|
|
816
|
+
var STICKY_HEADER_OFFSET_PX = 96;
|
|
817
|
+
var HUB_HEADER_OFFSET_PX = 80;
|
|
818
|
+
function normalizeHashFragment(hash) {
|
|
819
|
+
if (!hash) return "";
|
|
820
|
+
const second = hash.indexOf("#", 1);
|
|
821
|
+
return second < 0 ? hash : hash.slice(0, second);
|
|
822
|
+
}
|
|
823
|
+
function getHashTargetElement(id) {
|
|
824
|
+
if (!id) return null;
|
|
825
|
+
const direct = document.getElementById(id);
|
|
826
|
+
if (direct) return direct;
|
|
827
|
+
let decoded = id;
|
|
828
|
+
try {
|
|
829
|
+
decoded = decodeURIComponent(id);
|
|
830
|
+
if (decoded !== id) {
|
|
831
|
+
const decodedEl = document.getElementById(decoded);
|
|
832
|
+
if (decodedEl) return decodedEl;
|
|
833
|
+
}
|
|
834
|
+
} catch {
|
|
835
|
+
decoded = id;
|
|
836
|
+
}
|
|
837
|
+
return findAnchorElementByNormalizedId(decoded, document);
|
|
838
|
+
}
|
|
839
|
+
var LOCATION_HASH_SYNC_EVENT = "locationhashsync";
|
|
840
|
+
var ACTIVE_ANCHOR_ATTRIBUTE = "data-active-anchor";
|
|
841
|
+
var HASH_SYNC_STATE_KEY = "__hashSync";
|
|
842
|
+
var isRecord = (value) => typeof value === "object" && value !== null;
|
|
843
|
+
function replaceLocationHash(id) {
|
|
844
|
+
if (typeof window === "undefined") return;
|
|
845
|
+
const { pathname, search, hash } = window.location;
|
|
846
|
+
const next = id ? `#${id}` : "";
|
|
847
|
+
const state = window.history.state;
|
|
848
|
+
const noted = isRecord(state) ? state[HASH_SYNC_STATE_KEY] : void 0;
|
|
849
|
+
if (hash === next && (noted === next || !next)) return;
|
|
850
|
+
window.history.replaceState(
|
|
851
|
+
{ ...isRecord(state) ? state : {}, [HASH_SYNC_STATE_KEY]: next },
|
|
852
|
+
"",
|
|
853
|
+
`${pathname}${search}${next}`
|
|
854
|
+
);
|
|
855
|
+
if (hash !== next) window.dispatchEvent(new Event(LOCATION_HASH_SYNC_EVENT));
|
|
856
|
+
}
|
|
857
|
+
function isScrollSyncedHash() {
|
|
858
|
+
if (typeof window === "undefined" || !window.location.hash) return false;
|
|
859
|
+
const state = window.history.state;
|
|
860
|
+
return isRecord(state) && state[HASH_SYNC_STATE_KEY] === window.location.hash;
|
|
861
|
+
}
|
|
862
|
+
function navigateSamePageHash(target, options = {}) {
|
|
863
|
+
if (typeof window === "undefined") return false;
|
|
864
|
+
const { headerOffset = 0, history: historyMode = "push" } = options;
|
|
865
|
+
const normalizedTarget = target.startsWith("#") ? window.location.pathname + window.location.search + target : target;
|
|
866
|
+
let url;
|
|
867
|
+
try {
|
|
868
|
+
url = new URL(normalizedTarget, window.location.href);
|
|
869
|
+
} catch {
|
|
870
|
+
return false;
|
|
871
|
+
}
|
|
872
|
+
if (url.origin !== window.location.origin || url.pathname !== window.location.pathname || url.search !== window.location.search) {
|
|
873
|
+
return false;
|
|
874
|
+
}
|
|
875
|
+
const current = window.location.pathname + window.location.search + window.location.hash;
|
|
876
|
+
const normalizedHash = normalizeHashFragment(url.hash);
|
|
877
|
+
if (process.env.NODE_ENV === "development" && normalizedHash !== url.hash) {
|
|
878
|
+
console.warn(
|
|
879
|
+
`[navigateSamePageHash] malformed fragment "${url.hash}" \u2192 normalizing to "${normalizedHash}". Fix the upstream composer.`
|
|
880
|
+
);
|
|
881
|
+
}
|
|
882
|
+
const next = url.pathname + url.search + normalizedHash;
|
|
883
|
+
const id = normalizedHash && normalizedHash !== "#" ? normalizedHash.slice(1) : "";
|
|
884
|
+
if (!id && next !== current) return false;
|
|
885
|
+
if (next !== current) {
|
|
886
|
+
const oldURL = window.location.href;
|
|
887
|
+
if (historyMode === "replace") {
|
|
888
|
+
window.history.replaceState(null, "", next);
|
|
889
|
+
} else {
|
|
890
|
+
window.history.pushState(null, "", next);
|
|
891
|
+
}
|
|
892
|
+
window.dispatchEvent(
|
|
893
|
+
new HashChangeEvent("hashchange", {
|
|
894
|
+
oldURL,
|
|
895
|
+
newURL: window.location.href
|
|
896
|
+
})
|
|
897
|
+
);
|
|
898
|
+
}
|
|
899
|
+
const el = id ? getHashTargetElement(id) : null;
|
|
900
|
+
if (id && !el && process.env.NODE_ENV === "development") {
|
|
901
|
+
console.warn(`[navigateSamePageHash] anchor "#${id}" not found \u2014 scrolling to top.`);
|
|
902
|
+
}
|
|
903
|
+
scrollElementIntoView(el ?? document.documentElement, {
|
|
904
|
+
behavior: "smooth",
|
|
905
|
+
headerOffset
|
|
906
|
+
});
|
|
907
|
+
return true;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
// src/utils/humanity-signals.ts
|
|
911
|
+
var HONEYPOT_FIELD = "form_extra_note";
|
|
912
|
+
var ELAPSED_MS_FIELD = "form_elapsed_ms";
|
|
913
|
+
var DEFAULT_MIN_FILL_MS = 700;
|
|
914
|
+
var HUMANITY_SIGNAL_KEYS = [HONEYPOT_FIELD, ELAPSED_MS_FIELD];
|
|
915
|
+
var isHumanitySignalKey = (key) => HUMANITY_SIGNAL_KEYS.includes(key);
|
|
916
|
+
function extractHumanitySignals(body) {
|
|
917
|
+
const b = body ?? {};
|
|
918
|
+
const rawHp = b[HONEYPOT_FIELD];
|
|
919
|
+
const honeypot = rawHp == null ? "" : typeof rawHp === "string" ? rawHp : JSON.stringify(rawHp) ?? String(rawHp);
|
|
920
|
+
const rawMs = b[ELAPSED_MS_FIELD];
|
|
921
|
+
const elapsedMs = typeof rawMs === "number" && Number.isFinite(rawMs) ? rawMs : null;
|
|
922
|
+
return { honeypot, elapsedMs };
|
|
923
|
+
}
|
|
924
|
+
var normalizeForCopyMatch = (s) => s.normalize("NFKC").trim().toLowerCase();
|
|
925
|
+
var digitsOf = (s) => s.replace(/\D/g, "");
|
|
926
|
+
var MIN_COPY_MATCH_LENGTH = 2;
|
|
927
|
+
var MIN_PHONE_DIGITS = 7;
|
|
928
|
+
var phoneDigitsMatch = (a, b) => a.length >= MIN_PHONE_DIGITS && b.length >= MIN_PHONE_DIGITS && (a.endsWith(b) || b.endsWith(a));
|
|
929
|
+
function findHoneypotCopySource(body, honeypot) {
|
|
930
|
+
const hpNorm = normalizeForCopyMatch(honeypot);
|
|
931
|
+
const hpDigits = digitsOf(honeypot);
|
|
932
|
+
const phoneCandidate = hpDigits.length >= MIN_PHONE_DIGITS;
|
|
933
|
+
if (hpNorm.length < MIN_COPY_MATCH_LENGTH && !phoneCandidate) return null;
|
|
934
|
+
const matches = (value) => {
|
|
935
|
+
if (typeof value !== "string" || value.trim() === "") return false;
|
|
936
|
+
if (normalizeForCopyMatch(value) === hpNorm) return true;
|
|
937
|
+
return phoneCandidate && phoneDigitsMatch(digitsOf(value), hpDigits);
|
|
938
|
+
};
|
|
939
|
+
const matchInArray = (value) => Array.isArray(value) && value.some(matches);
|
|
940
|
+
const b = body ?? {};
|
|
941
|
+
for (const [key, value] of Object.entries(b)) {
|
|
942
|
+
if (isHumanitySignalKey(key)) continue;
|
|
943
|
+
if (matches(value)) return key;
|
|
944
|
+
if (matchInArray(value)) return `${key}[]`;
|
|
945
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
946
|
+
for (const [nestedKey, nested] of Object.entries(value)) {
|
|
947
|
+
if (matches(nested)) return `${key}.${nestedKey}`;
|
|
948
|
+
if (matchInArray(nested)) return `${key}.${nestedKey}[]`;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return null;
|
|
953
|
+
}
|
|
954
|
+
function evaluateHumanitySignals(body, opts) {
|
|
955
|
+
const { honeypot, elapsedMs } = extractHumanitySignals(body);
|
|
956
|
+
const diagnostics = {
|
|
957
|
+
honeypotLength: honeypot.length,
|
|
958
|
+
timingAffirmed: elapsedMs !== null && elapsedMs >= opts.minFillMs
|
|
959
|
+
};
|
|
960
|
+
const filled = honeypot.trim() !== "";
|
|
961
|
+
const sourceField = filled ? findHoneypotCopySource(body, honeypot) : null;
|
|
962
|
+
if (filled && sourceField === null) return { ...diagnostics, ok: false, reason: "honeypot" };
|
|
963
|
+
if (elapsedMs !== null && elapsedMs < opts.minFillMs) return { ...diagnostics, ok: false, reason: "too_fast" };
|
|
964
|
+
return sourceField !== null ? { ...diagnostics, ok: true, note: "honeypot_autofill", sourceField } : { ...diagnostics, ok: true };
|
|
965
|
+
}
|
|
966
|
+
var splitCsvEnv = (s) => s?.split(",").map((t) => t.trim()).filter(Boolean) ?? [];
|
|
967
|
+
|
|
968
|
+
// src/utils/form-rescue.ts
|
|
969
|
+
var FORM_ID_PATTERN = /^[a-z][a-z0-9_]{1,47}$/;
|
|
970
|
+
var definitions = /* @__PURE__ */ new Map();
|
|
971
|
+
function defineRescueForm(definition) {
|
|
972
|
+
if (!FORM_ID_PATTERN.test(definition.id)) throw new Error(`[form-rescue] invalid form id "${definition.id}"`);
|
|
973
|
+
const existing = definitions.get(definition.id);
|
|
974
|
+
if (existing) {
|
|
975
|
+
if (existing.label !== definition.label) {
|
|
976
|
+
throw new Error(`[form-rescue] form id "${definition.id}" is already defined as "${existing.label}"`);
|
|
977
|
+
}
|
|
978
|
+
return existing;
|
|
979
|
+
}
|
|
980
|
+
const frozen = Object.freeze({ id: definition.id, label: definition.label });
|
|
981
|
+
definitions.set(frozen.id, frozen);
|
|
982
|
+
return frozen;
|
|
983
|
+
}
|
|
984
|
+
function getRescueForm(id) {
|
|
985
|
+
return typeof id === "string" ? definitions.get(id) ?? null : null;
|
|
986
|
+
}
|
|
987
|
+
function listRescueForms() {
|
|
988
|
+
return [...definitions.values()];
|
|
989
|
+
}
|
|
990
|
+
var RESCUE_FORMS = {
|
|
991
|
+
contact: defineRescueForm({ id: "contact", label: "Contact form" }),
|
|
992
|
+
caseStudyPitch: defineRescueForm({ id: "case_study_pitch", label: "Case study pitch" }),
|
|
993
|
+
dataRoomRequest: defineRescueForm({ id: "data_room_request", label: "Data room request" }),
|
|
994
|
+
trustCenterRequest: defineRescueForm({ id: "trust_center_request", label: "Trust Center document request" }),
|
|
995
|
+
meetingBooking: defineRescueForm({ id: "meeting_booking", label: "Meeting booking" }),
|
|
996
|
+
waitlist: defineRescueForm({ id: "waitlist", label: "Waitlist" })
|
|
997
|
+
};
|
|
998
|
+
var FORM_RESCUE_VALUE_FIELDS = [
|
|
999
|
+
"email",
|
|
1000
|
+
"name",
|
|
1001
|
+
"firstName",
|
|
1002
|
+
"lastName",
|
|
1003
|
+
"company",
|
|
1004
|
+
"jobtitle",
|
|
1005
|
+
"companySize",
|
|
1006
|
+
"linkedin_url"
|
|
1007
|
+
];
|
|
1008
|
+
var EXCLUDED_FIELD_PATTERN = /pass(word|code)?|card|cvv|cvc|ssn|social.?security|iban|bank|routing|token|secret|otp|pin$/i;
|
|
1009
|
+
function isExcludedRescueField(name) {
|
|
1010
|
+
return EXCLUDED_FIELD_PATTERN.test(name);
|
|
1011
|
+
}
|
|
1012
|
+
var FORM_RESCUE_MAX_VALUE_CHARS = 200;
|
|
1013
|
+
var FORM_RESCUE_DEBOUNCE_MS = 1500;
|
|
1014
|
+
var FORM_RESCUE_MAX_FIELDS = 40;
|
|
1015
|
+
var FORM_RESCUE_ATTEMPT_FIELD = "form_attempt_id";
|
|
1016
|
+
var FORM_RESCUE_RESUME_FIELD = "form_resume_token";
|
|
1017
|
+
var FORM_RESCUE_SUBMIT_KEYS = [FORM_RESCUE_ATTEMPT_FIELD, FORM_RESCUE_RESUME_FIELD];
|
|
1018
|
+
var FORM_RESCUE_RESUME_PARAM = "resume";
|
|
1019
|
+
var RESUME_TOKEN_PATTERN = /^[A-Za-z0-9_-]{16,128}$/;
|
|
1020
|
+
function isResumeToken(value) {
|
|
1021
|
+
return typeof value === "string" && RESUME_TOKEN_PATTERN.test(value);
|
|
1022
|
+
}
|
|
1023
|
+
var FORM_DRAFT_STATUSES = ["started", "rescuable", "rescued", "submitted"];
|
|
1024
|
+
var FORM_RESCUE_SKIP_REASONS = {
|
|
1025
|
+
finishedElsewhere: "finished_elsewhere",
|
|
1026
|
+
alreadyRescued: "already_rescued",
|
|
1027
|
+
internal: "internal_email"
|
|
1028
|
+
};
|
|
1029
|
+
var EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
|
|
1030
|
+
function isRescueEmail(value) {
|
|
1031
|
+
return typeof value === "string" && value.length <= FORM_RESCUE_MAX_VALUE_CHARS && EMAIL_PATTERN.test(value.trim());
|
|
1032
|
+
}
|
|
1033
|
+
var UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1034
|
+
function isFormAttemptId(value) {
|
|
1035
|
+
return typeof value === "string" && UUID_PATTERN.test(value);
|
|
1036
|
+
}
|
|
1037
|
+
function isFilled(value) {
|
|
1038
|
+
if (value == null) return false;
|
|
1039
|
+
if (typeof value === "string") return value.trim().length > 0;
|
|
1040
|
+
if (typeof value === "boolean") return value;
|
|
1041
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
1042
|
+
if (typeof value === "object") return Object.values(value).some(isFilled);
|
|
1043
|
+
return true;
|
|
1044
|
+
}
|
|
1045
|
+
function sanitizeRescueValues(values) {
|
|
1046
|
+
const out = {};
|
|
1047
|
+
if (!values || typeof values !== "object") return out;
|
|
1048
|
+
for (const key of FORM_RESCUE_VALUE_FIELDS) {
|
|
1049
|
+
if (isExcludedRescueField(key)) continue;
|
|
1050
|
+
const raw = values[key];
|
|
1051
|
+
if (typeof raw !== "string") continue;
|
|
1052
|
+
const trimmed = raw.trim().slice(0, FORM_RESCUE_MAX_VALUE_CHARS);
|
|
1053
|
+
if (trimmed) out[key] = trimmed;
|
|
1054
|
+
}
|
|
1055
|
+
return out;
|
|
1056
|
+
}
|
|
1057
|
+
function filledRescueFields(values, fieldNames) {
|
|
1058
|
+
return fieldNames.filter((name) => !isExcludedRescueField(name) && isFilled(values[name])).slice(0, FORM_RESCUE_MAX_FIELDS);
|
|
1059
|
+
}
|
|
1060
|
+
function rescueCompletionPct(filledCount, totalCount) {
|
|
1061
|
+
if (totalCount <= 0) return 0;
|
|
1062
|
+
return Math.max(0, Math.min(100, Math.round(filledCount / totalCount * 100)));
|
|
1063
|
+
}
|
|
1064
|
+
function sanitizeRescueFieldName(value) {
|
|
1065
|
+
if (typeof value !== "string") return null;
|
|
1066
|
+
const trimmed = value.trim();
|
|
1067
|
+
return /^[A-Za-z0-9_.-]{1,64}$/.test(trimmed) && !isExcludedRescueField(trimmed) ? trimmed : null;
|
|
1068
|
+
}
|
|
1069
|
+
var UTM_KEYS = ["source", "medium", "campaign", "content", "term"];
|
|
1070
|
+
var MAX_SOURCE_PATH_CHARS = 500;
|
|
1071
|
+
function parseFormDraftSaveRequest(body) {
|
|
1072
|
+
const form = getRescueForm(body.form_id);
|
|
1073
|
+
if (!isFormAttemptId(body.attempt_id) || !form) return null;
|
|
1074
|
+
const rawValues = body.values && typeof body.values === "object" ? body.values : {};
|
|
1075
|
+
const values = sanitizeRescueValues(rawValues);
|
|
1076
|
+
const fieldsFilled = (Array.isArray(body.fields_filled) ? body.fields_filled : []).map(sanitizeRescueFieldName).filter((name) => name !== null).slice(0, FORM_RESCUE_MAX_FIELDS);
|
|
1077
|
+
const path = typeof body.source_path === "string" ? body.source_path : "";
|
|
1078
|
+
const utmIn = body.utm && typeof body.utm === "object" ? body.utm : {};
|
|
1079
|
+
const utm = {};
|
|
1080
|
+
for (const key of UTM_KEYS) {
|
|
1081
|
+
const value = utmIn[key];
|
|
1082
|
+
if (typeof value === "string" && value.trim()) utm[key] = value.trim().slice(0, FORM_RESCUE_MAX_VALUE_CHARS);
|
|
1083
|
+
}
|
|
1084
|
+
return {
|
|
1085
|
+
request: {
|
|
1086
|
+
attempt_id: body.attempt_id,
|
|
1087
|
+
form_id: form.id,
|
|
1088
|
+
values,
|
|
1089
|
+
fields_filled: fieldsFilled,
|
|
1090
|
+
last_field: sanitizeRescueFieldName(body.last_field),
|
|
1091
|
+
completion_pct: typeof body.completion_pct === "number" ? rescueCompletionPct(body.completion_pct, 100) : 0,
|
|
1092
|
+
// Same-site only: a path, never a scheme-relative or absolute URL.
|
|
1093
|
+
source_path: path.startsWith("/") && !path.startsWith("//") ? path.slice(0, MAX_SOURCE_PATH_CHARS) : "",
|
|
1094
|
+
...Object.keys(utm).length ? { utm } : {},
|
|
1095
|
+
...isResumeToken(body.resume_token) ? { resume_token: body.resume_token } : {}
|
|
1096
|
+
},
|
|
1097
|
+
dropped: Object.keys(rawValues).filter((key) => !(key in values))
|
|
1098
|
+
};
|
|
1099
|
+
}
|
|
1100
|
+
var FORM_RESCUE_EVENTS = {
|
|
1101
|
+
started: "form_started",
|
|
1102
|
+
progress: "form_progress",
|
|
1103
|
+
leadCaptured: "form_lead_captured",
|
|
1104
|
+
abandoned: "form_abandoned",
|
|
1105
|
+
submitted: "form_submitted",
|
|
1106
|
+
rescued: "form_rescued",
|
|
1107
|
+
resumed: "form_resumed"
|
|
1108
|
+
};
|
|
1109
|
+
function captureFormRescueEvent(event, properties) {
|
|
1110
|
+
try {
|
|
1111
|
+
if (typeof window === "undefined") return;
|
|
1112
|
+
const ph = window.posthog;
|
|
1113
|
+
if (typeof ph?.capture === "function") ph.capture(event, properties);
|
|
1114
|
+
} catch {
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
export {
|
|
1119
|
+
useDebounce,
|
|
1120
|
+
useHeaderHeight,
|
|
1121
|
+
useMarqueeEngine,
|
|
1122
|
+
useResetOnPageHidden,
|
|
1123
|
+
useSuppressCloneFocus,
|
|
1124
|
+
PREFERS_REDUCED_MOTION_QUERY,
|
|
1125
|
+
usePrefersReducedMotion,
|
|
1126
|
+
usePrefersReducedMotionState,
|
|
1127
|
+
useInView,
|
|
1128
|
+
useAutoplay,
|
|
1129
|
+
DESKTOP_OSES,
|
|
1130
|
+
detectVisitorOs,
|
|
1131
|
+
desktopOsOf,
|
|
1132
|
+
detectDesktopOs,
|
|
1133
|
+
usesCommandKey,
|
|
1134
|
+
shortcutLabel,
|
|
1135
|
+
useVisitorOs,
|
|
1136
|
+
platformIcons,
|
|
1137
|
+
transformPlatformConfigsToOptions,
|
|
1138
|
+
getPlatformIcon,
|
|
1139
|
+
getSmallPlatformIcon,
|
|
1140
|
+
getPlatformIconComponent,
|
|
1141
|
+
validateAccessCode,
|
|
1142
|
+
consumeAccessCode,
|
|
1143
|
+
validateAndConsumeAccessCode,
|
|
1144
|
+
toGoogleSheetsEmbedUrl,
|
|
1145
|
+
toGoogleSheetsOriginalUrl,
|
|
1146
|
+
toFigmaEmbedUrl,
|
|
1147
|
+
isFigmaSlidesUrl,
|
|
1148
|
+
toFigmaOriginalUrl,
|
|
1149
|
+
toClaudeMirrorPath,
|
|
1150
|
+
toClaudeEmbedUrl,
|
|
1151
|
+
isBlankLine,
|
|
1152
|
+
createFenceTracker,
|
|
1153
|
+
HEADING_EMOJI_RE,
|
|
1154
|
+
stripHeadingEmojis,
|
|
1155
|
+
slugifyHeadingBase,
|
|
1156
|
+
slugifyHeadingText,
|
|
1157
|
+
scanHeadings,
|
|
1158
|
+
createHeadingIdDeduper,
|
|
1159
|
+
normalizeAnchorId,
|
|
1160
|
+
findAnchorElementByNormalizedId,
|
|
1161
|
+
getScrollableAncestor,
|
|
1162
|
+
declaredScrollMarginTop,
|
|
1163
|
+
scrollElementIntoView,
|
|
1164
|
+
STICKY_HEADER_OFFSET_PX,
|
|
1165
|
+
HUB_HEADER_OFFSET_PX,
|
|
1166
|
+
normalizeHashFragment,
|
|
1167
|
+
getHashTargetElement,
|
|
1168
|
+
LOCATION_HASH_SYNC_EVENT,
|
|
1169
|
+
ACTIVE_ANCHOR_ATTRIBUTE,
|
|
1170
|
+
replaceLocationHash,
|
|
1171
|
+
isScrollSyncedHash,
|
|
1172
|
+
navigateSamePageHash,
|
|
1173
|
+
HONEYPOT_FIELD,
|
|
1174
|
+
ELAPSED_MS_FIELD,
|
|
1175
|
+
DEFAULT_MIN_FILL_MS,
|
|
1176
|
+
HUMANITY_SIGNAL_KEYS,
|
|
1177
|
+
isHumanitySignalKey,
|
|
1178
|
+
extractHumanitySignals,
|
|
1179
|
+
findHoneypotCopySource,
|
|
1180
|
+
evaluateHumanitySignals,
|
|
1181
|
+
splitCsvEnv,
|
|
1182
|
+
defineRescueForm,
|
|
1183
|
+
getRescueForm,
|
|
1184
|
+
listRescueForms,
|
|
1185
|
+
RESCUE_FORMS,
|
|
1186
|
+
FORM_RESCUE_VALUE_FIELDS,
|
|
1187
|
+
isExcludedRescueField,
|
|
1188
|
+
FORM_RESCUE_MAX_VALUE_CHARS,
|
|
1189
|
+
FORM_RESCUE_DEBOUNCE_MS,
|
|
1190
|
+
FORM_RESCUE_MAX_FIELDS,
|
|
1191
|
+
FORM_RESCUE_ATTEMPT_FIELD,
|
|
1192
|
+
FORM_RESCUE_RESUME_FIELD,
|
|
1193
|
+
FORM_RESCUE_SUBMIT_KEYS,
|
|
1194
|
+
FORM_RESCUE_RESUME_PARAM,
|
|
1195
|
+
isResumeToken,
|
|
1196
|
+
FORM_DRAFT_STATUSES,
|
|
1197
|
+
FORM_RESCUE_SKIP_REASONS,
|
|
1198
|
+
isRescueEmail,
|
|
1199
|
+
isFormAttemptId,
|
|
1200
|
+
sanitizeRescueValues,
|
|
1201
|
+
filledRescueFields,
|
|
1202
|
+
rescueCompletionPct,
|
|
1203
|
+
sanitizeRescueFieldName,
|
|
1204
|
+
parseFormDraftSaveRequest,
|
|
1205
|
+
FORM_RESCUE_EVENTS,
|
|
1206
|
+
captureFormRescueEvent
|
|
1207
|
+
};
|