@syntrologie/adapt-content 2.16.0 → 2.18.0

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 (171) hide show
  1. package/dist/runtime.js +425 -366
  2. package/dist/runtime.js.map +7 -0
  3. package/dist/schema.d.ts +55 -16
  4. package/dist/schema.d.ts.map +1 -1
  5. package/dist/schema.js +316 -62
  6. package/dist/schema.js.map +7 -0
  7. package/package.json +2 -20
  8. package/dist/cdn.d.ts +0 -35
  9. package/dist/cdn.d.ts.map +0 -1
  10. package/dist/cdn.js +0 -39
  11. package/dist/components/AnchorPicker.d.ts +0 -8
  12. package/dist/components/AnchorPicker.d.ts.map +0 -1
  13. package/dist/components/AnchorPicker.js +0 -6
  14. package/dist/content-editor-state.d.ts +0 -45
  15. package/dist/content-editor-state.d.ts.map +0 -1
  16. package/dist/content-editor-state.js +0 -123
  17. package/dist/content-editor-ui.d.ts +0 -26
  18. package/dist/content-editor-ui.d.ts.map +0 -1
  19. package/dist/content-editor-ui.js +0 -291
  20. package/dist/editor.d.ts +0 -9
  21. package/dist/editor.d.ts.map +0 -1
  22. package/dist/editor.js +0 -8
  23. package/dist/reconciliation-guard.js +0 -80
  24. package/dist/sanitizer.js +0 -95
  25. package/dist/summarize.js +0 -88
  26. package/dist/types.js +0 -7
  27. package/dist/utils/selectorGenerator.d.ts +0 -6
  28. package/dist/utils/selectorGenerator.d.ts.map +0 -1
  29. package/dist/utils/selectorGenerator.js +0 -4
  30. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +0 -2
  31. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +0 -1
  32. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +0 -3
  33. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +0 -34
  34. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +0 -1
  35. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +0 -161
  36. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts +0 -84
  37. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts.map +0 -1
  38. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.js +0 -323
  39. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +0 -7
  40. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +0 -1
  41. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +0 -9
  42. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts +0 -25
  43. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts.map +0 -1
  44. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.js +0 -55
  45. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +0 -23
  46. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +0 -1
  47. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +0 -40
  48. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts +0 -33
  49. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts.map +0 -1
  50. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.js +0 -118
  51. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +0 -7
  52. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +0 -1
  53. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +0 -22
  54. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts +0 -32
  55. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts.map +0 -1
  56. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.js +0 -68
  57. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +0 -8
  58. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +0 -1
  59. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +0 -9
  60. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts +0 -34
  61. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts.map +0 -1
  62. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.js +0 -57
  63. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +0 -7
  64. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +0 -1
  65. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +0 -4
  66. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts +0 -13
  67. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts.map +0 -1
  68. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.js +0 -31
  69. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +0 -7
  70. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +0 -1
  71. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +0 -4
  72. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts +0 -7
  73. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts.map +0 -1
  74. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.js +0 -15
  75. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +0 -13
  76. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +0 -1
  77. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +0 -15
  78. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts +0 -36
  79. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts.map +0 -1
  80. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.js +0 -102
  81. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +0 -7
  82. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +0 -1
  83. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +0 -4
  84. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts +0 -20
  85. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts.map +0 -1
  86. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.js +0 -48
  87. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +0 -9
  88. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +0 -1
  89. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +0 -4
  90. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts +0 -16
  91. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts.map +0 -1
  92. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.js +0 -25
  93. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +0 -8
  94. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +0 -1
  95. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +0 -8
  96. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts +0 -66
  97. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts.map +0 -1
  98. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.js +0 -87
  99. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +0 -7
  100. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +0 -1
  101. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +0 -4
  102. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts +0 -7
  103. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts.map +0 -1
  104. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.js +0 -15
  105. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +0 -25
  106. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +0 -1
  107. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +0 -390
  108. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts +0 -66
  109. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts.map +0 -1
  110. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.js +0 -528
  111. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +0 -8
  112. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +0 -1
  113. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +0 -8
  114. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts +0 -41
  115. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts.map +0 -1
  116. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.js +0 -63
  117. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +0 -8
  118. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +0 -1
  119. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +0 -17
  120. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts +0 -55
  121. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts.map +0 -1
  122. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.js +0 -92
  123. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +0 -32
  124. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +0 -1
  125. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +0 -85
  126. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts +0 -90
  127. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts.map +0 -1
  128. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.js +0 -242
  129. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +0 -6
  130. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +0 -1
  131. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +0 -4
  132. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts +0 -12
  133. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts.map +0 -1
  134. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.js +0 -21
  135. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +0 -8
  136. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +0 -1
  137. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +0 -5
  138. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts +0 -21
  139. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts.map +0 -1
  140. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.js +0 -33
  141. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +0 -12
  142. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +0 -1
  143. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +0 -40
  144. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts +0 -28
  145. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts.map +0 -1
  146. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.js +0 -121
  147. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.d.ts +0 -110
  148. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.d.ts.map +0 -1
  149. package/node_modules/@syntrologie/shared-editor-ui/dist/controllers/PanelShellController.js +0 -481
  150. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +0 -26
  151. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +0 -1
  152. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +0 -202
  153. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +0 -8
  154. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +0 -1
  155. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +0 -46
  156. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +0 -24
  157. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +0 -1
  158. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.js +0 -86
  159. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +0 -36
  160. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +0 -1
  161. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +0 -26
  162. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts +0 -15
  163. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts.map +0 -1
  164. package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.js +0 -14
  165. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts +0 -33
  166. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts.map +0 -1
  167. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.js +0 -68
  168. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +0 -22
  169. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +0 -1
  170. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +0 -143
  171. package/node_modules/@syntrologie/shared-editor-ui/package.json +0 -55
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/reconciliation-guard.ts", "../src/sanitizer.ts", "../src/runtime.ts"],
4
+ "sourcesContent": ["/**\n * Reconciliation Guard - MutationObserver defense against React DOM removal.\n *\n * When the Syntrologie SDK inserts DOM nodes into a React-managed subtree\n * (via content:insertHtml), React's reconciliation will silently remove them\n * on the next render because they don't exist in React's virtual DOM.\n *\n * This guard watches for the removal of our inserted container and re-inserts\n * it using a debounced retry mechanism with a maximum retry count to prevent\n * infinite loops (e.g., in React StrictMode which double-invokes effects).\n */\n\nexport interface ReconciliationGuardOptions {\n /** Maximum re-insertion attempts before giving up. Default: 3 */\n maxRetries?: number;\n /** Debounce interval in ms to coalesce rapid removals. Default: 50 */\n debounceMs?: number;\n}\n\n/**\n * Watch for a container element being removed from the DOM by an external\n * framework (React, Vue, etc.) and call `reinsertFn` to re-insert it.\n *\n * @param container The element we inserted (has data-syntro-action-id)\n * @param anchor The anchor element our container is positioned relative to\n * @param reinsertFn Called when the container is removed \u2014 should re-insert it\n * @param opts Configuration for retry limits and debounce timing\n * @returns Cleanup function that disconnects the observer\n */\nexport function guardAgainstReconciliation(\n container: HTMLElement,\n anchor: HTMLElement,\n reinsertFn: () => void,\n opts?: ReconciliationGuardOptions\n): () => void {\n const maxRetries = opts?.maxRetries ?? 3;\n const debounceMs = opts?.debounceMs ?? 50;\n\n // Find the nearest parent to observe. Prefer container's parent, then anchor's.\n const observeTarget = container.parentElement ?? anchor.parentElement;\n if (!observeTarget) return () => {};\n\n let retries = 0;\n let debounceTimer: ReturnType<typeof setTimeout> | null = null;\n let disconnected = false;\n\n const observer = new MutationObserver((mutations) => {\n if (disconnected) return;\n\n for (const mutation of mutations) {\n for (const removed of mutation.removedNodes) {\n // Check if the removed node is our container\n if (removed !== container) continue;\n\n if (retries >= maxRetries) {\n observer.disconnect();\n disconnected = true;\n return;\n }\n\n // Debounce to coalesce rapid React re-renders\n if (debounceTimer) clearTimeout(debounceTimer);\n debounceTimer = setTimeout(() => {\n if (disconnected) return;\n // If the anchor has been removed from the DOM (SPA navigation),\n // the page has been torn down \u2014 stop fighting React's reconciler.\n // Re-inserting into a dying subtree triggers removeChild crashes.\n if (!anchor.isConnected) {\n observer.disconnect();\n disconnected = true;\n return;\n }\n retries++;\n try {\n reinsertFn();\n } catch {\n // Re-insertion failed \u2014 stop trying\n observer.disconnect();\n disconnected = true;\n }\n }, debounceMs);\n\n return; // Found our container, no need to check further\n }\n }\n });\n\n observer.observe(observeTarget, { childList: true, subtree: true });\n\n return () => {\n disconnected = true;\n observer.disconnect();\n if (debounceTimer) clearTimeout(debounceTimer);\n };\n}\n", "/**\n * HTML Sanitizer\n *\n * Sanitizes HTML to prevent XSS attacks.\n * Uses native Sanitizer API when available, falls back to whitelist approach.\n */\n\nconst ALLOWED_TAGS = new Set([\n 'b',\n 'strong',\n 'i',\n 'em',\n 'u',\n 'span',\n 'div',\n 'p',\n 'br',\n 'ul',\n 'ol',\n 'li',\n 'code',\n 'pre',\n 'small',\n 'sup',\n 'sub',\n 'a',\n 'button',\n // SVG elements (for inline Lucide icons in config HTML)\n 'svg',\n 'path',\n 'circle',\n 'line',\n 'polyline',\n 'polygon',\n 'rect',\n 'g',\n]);\n\nexport function sanitizeHtml(html: string): string {\n // Try native Sanitizer API first\n const hasNative = typeof (window as any).Sanitizer === 'function';\n if (hasNative) {\n try {\n const s = new (window as any).Sanitizer({});\n const frag = s.sanitizeToFragment(html);\n const div = document.createElement('div');\n div.append(frag);\n return div.innerHTML;\n } catch {\n // Fall through to manual sanitizer\n }\n }\n\n // Conservative fallback sanitizer\n const tpl = document.createElement('template');\n tpl.innerHTML = html;\n const root = tpl.content;\n const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, null);\n const toRemove: Element[] = [];\n\n while (walker.nextNode()) {\n const el = walker.currentNode as Element;\n const tag = el.tagName.toLowerCase();\n\n if (!ALLOWED_TAGS.has(tag)) {\n toRemove.push(el);\n continue;\n }\n\n // Remove dangerous attributes\n for (const attr of Array.from(el.attributes)) {\n const name = attr.name.toLowerCase();\n const value = attr.value.trim().toLowerCase();\n const isEvent = name.startsWith('on');\n const isUrlAttr = name === 'href' || name === 'src' || name === 'formaction';\n const isDangerousUrl =\n isUrlAttr &&\n (value.startsWith('javascript:') ||\n value.startsWith('vbscript:') ||\n value.startsWith('data:text/html'));\n\n if (isEvent || isDangerousUrl) {\n el.removeAttribute(attr.name);\n }\n }\n }\n\n // Strip SVG elements that contained script children (XSS vector)\n const svgs = Array.from(root.querySelectorAll('svg'));\n for (const svg of svgs) {\n if (toRemove.some((el) => svg.contains(el) && el.tagName.toLowerCase() === 'script')) {\n toRemove.push(svg);\n }\n }\n\n // Remove disallowed elements but keep their children\n for (const el of toRemove) {\n while (el.firstChild) {\n el.parentNode?.insertBefore(el.firstChild, el);\n }\n el.remove();\n }\n\n return tpl.innerHTML;\n}\n", "/**\n * Adaptive Content - Runtime Module\n *\n * DOM manipulation actions: insertHtml, setText, setAttr, addClass, removeClass, setStyle.\n * These follow the hostPatcher snapshot pattern for safe reversibility.\n */\n\nimport { guardAgainstReconciliation } from './reconciliation-guard';\nimport { sanitizeHtml } from './sanitizer';\nimport type {\n ActionExecutor,\n AddClassAction,\n ExecutorResult,\n InsertHtmlAction,\n RemoveClassAction,\n SetAttrAction,\n SetStyleAction,\n SetTextAction,\n} from './types';\n\n// ============================================================================\n// Executors\n// ============================================================================\n\n/**\n * Execute an insertHtml action\n */\nexport const executeInsertHtml: ActionExecutor<InsertHtmlAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n let anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl && context.waitForAnchor) {\n anchorEl = await context.waitForAnchor(action.anchorId, 3000);\n }\n if (!anchorEl) {\n console.warn(`[adaptive-content] Anchor not found after waiting: ${action.anchorId.selector}`);\n return { cleanup: () => {} };\n }\n\n // Sanitize HTML content using context utility\n const sanitizedHtml = sanitizeHtml(action.html);\n\n // Dedup: if a container for this action already exists, remove it first.\n // Uses the action label as a stable identifier across re-applications.\n // Check both inside the anchor (prepend/append) and in the parent (before/after).\n const dedupAttr = 'data-syntro-insert-label';\n const label = action.label;\n if (label) {\n const escapedLabel = CSS.escape(label);\n const searchRoot = anchorEl.parentElement ?? anchorEl;\n const existing = searchRoot.querySelector(`[${dedupAttr}=\"${escapedLabel}\"]`);\n if (existing) existing.remove();\n }\n\n // Create container for inserted content\n const container = document.createElement('div');\n container.setAttribute('data-syntro-action-id', context.generateId());\n if (label) container.setAttribute(dedupAttr, label);\n container.innerHTML = sanitizedHtml;\n\n // Keep track of original state for replace position\n let originalContent: string | null = null;\n\n switch (action.position) {\n case 'before':\n anchorEl.insertAdjacentElement('beforebegin', container);\n break;\n case 'after':\n anchorEl.insertAdjacentElement('afterend', container);\n break;\n case 'prepend':\n anchorEl.insertBefore(container, anchorEl.firstChild);\n break;\n case 'append':\n anchorEl.appendChild(container);\n break;\n case 'replace':\n originalContent = anchorEl.innerHTML;\n anchorEl.replaceWith(container);\n break;\n }\n\n // Deep-link click handler \u2014 opens canvas + publishes deep-link event\n let deepLinkHandler: (() => void) | null = null;\n if (action.deepLink) {\n const { tileId, itemId } = action.deepLink;\n deepLinkHandler = () => {\n const handle = (window as any).SynOS?.handle;\n if (handle) {\n handle.open();\n handle.runtime?.events?.publish('notification.deep_link', { tileId, itemId });\n }\n };\n container.style.cursor = 'pointer';\n container.addEventListener('click', deepLinkHandler);\n }\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'content:insertHtml',\n anchorId: action.anchorId,\n position: action.position,\n });\n\n // Guard against React reconciliation removing our container.\n // The reinsert function re-applies the same insertion strategy.\n const reinsertFn = () => {\n switch (action.position) {\n case 'before':\n anchorEl.insertAdjacentElement('beforebegin', container);\n break;\n case 'after':\n anchorEl.insertAdjacentElement('afterend', container);\n break;\n case 'prepend':\n anchorEl.insertBefore(container, anchorEl.firstChild);\n break;\n case 'append':\n anchorEl.appendChild(container);\n break;\n case 'replace':\n // Cannot re-insert for replace \u2014 anchor was already replaced\n break;\n }\n };\n\n const guardCleanup = guardAgainstReconciliation(container, anchorEl, reinsertFn);\n\n return {\n cleanup: () => {\n if (deepLinkHandler) {\n container.removeEventListener('click', deepLinkHandler);\n }\n guardCleanup();\n // Skip DOM mutations if nodes are already detached (SPA navigation)\n if (!container.isConnected) return;\n try {\n if (action.position === 'replace' && originalContent !== null) {\n // Restore original element\n const restoredEl = document.createElement(anchorEl.tagName);\n restoredEl.innerHTML = originalContent;\n // Copy attributes\n Array.from(anchorEl.attributes).forEach((attr) => {\n restoredEl.setAttribute(attr.name, attr.value);\n });\n container.replaceWith(restoredEl);\n } else {\n container.remove();\n }\n } catch {\n // DOM nodes already removed by host framework \u2014 safe to ignore\n }\n },\n updateFn: (changes) => {\n if ('html' in changes && typeof changes.html === 'string') {\n container.innerHTML = sanitizeHtml(changes.html);\n }\n },\n };\n};\n\n/**\n * Walk the DOM to find the deepest descendant that uniquely carries\n * text content. Avoids destroying sibling elements (icons, images)\n * when setting text on a container like a button.\n */\nfunction findTextTarget(el: Element): Element {\n if (el.children.length === 0) return el;\n const textChildren = Array.from(el.children).filter((child) => child.textContent?.trim());\n if (textChildren.length === 1) {\n const child = textChildren[0];\n if (child.textContent?.trim() === el.textContent?.trim()) {\n return findTextTarget(child);\n }\n }\n return el;\n}\n\n/**\n * Execute a setText action\n */\nexport const executeSetText: ActionExecutor<SetTextAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n let anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl && context.waitForAnchor) {\n anchorEl = await context.waitForAnchor(action.anchorId, 3000);\n }\n if (!anchorEl) {\n console.warn(`[adaptive-content] Anchor not found after waiting: ${action.anchorId.selector}`);\n return { cleanup: () => {} };\n }\n\n const textTarget = findTextTarget(anchorEl);\n\n // Snapshot original text\n const originalText = textTarget.textContent ?? '';\n\n // Set new text\n textTarget.textContent = action.text;\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'content:setText',\n anchorId: action.anchorId,\n });\n\n return {\n cleanup: () => {\n if (!anchorEl.isConnected) return;\n textTarget.textContent = originalText;\n },\n updateFn: (changes) => {\n if ('text' in changes && typeof changes.text === 'string') {\n textTarget.textContent = changes.text;\n }\n },\n };\n};\n\n/**\n * Execute a setAttr action\n */\nexport const executeSetAttr: ActionExecutor<SetAttrAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n let anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl && context.waitForAnchor) {\n anchorEl = await context.waitForAnchor(action.anchorId, 3000);\n }\n if (!anchorEl) {\n console.warn(`[adaptive-content] Anchor not found after waiting: ${action.anchorId.selector}`);\n return { cleanup: () => {} };\n }\n\n // Block dangerous attributes (case-insensitive)\n const lowerAttr = action.attr.toLowerCase();\n if (lowerAttr.startsWith('on')) {\n throw new Error(`Dangerous attribute not allowed: ${action.attr}`);\n }\n\n // Block dangerous URIs in URL-bearing attributes\n const isUrlAttr = lowerAttr === 'href' || lowerAttr === 'src' || lowerAttr === 'formaction';\n if (isUrlAttr) {\n const lowerValue = action.value.trim().toLowerCase();\n if (\n lowerValue.startsWith('javascript:') ||\n lowerValue.startsWith('vbscript:') ||\n lowerValue.startsWith('data:text/html')\n ) {\n throw new Error(`Dangerous URL not allowed in ${action.attr}: ${action.value}`);\n }\n }\n\n // Snapshot original attribute value\n const originalValue = anchorEl.getAttribute(action.attr);\n const hadAttribute = anchorEl.hasAttribute(action.attr);\n\n // Set new attribute\n anchorEl.setAttribute(action.attr, action.value);\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'content:setAttr',\n anchorId: action.anchorId,\n attr: action.attr,\n });\n\n return {\n cleanup: () => {\n if (!anchorEl.isConnected) return;\n if (hadAttribute && originalValue !== null) {\n anchorEl.setAttribute(action.attr, originalValue);\n } else {\n anchorEl.removeAttribute(action.attr);\n }\n },\n updateFn: (changes) => {\n if ('value' in changes && typeof changes.value === 'string') {\n anchorEl.setAttribute(action.attr, changes.value);\n }\n },\n };\n};\n\n/**\n * Execute an addClass action\n */\nexport const executeAddClass: ActionExecutor<AddClassAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n let anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl && context.waitForAnchor) {\n anchorEl = await context.waitForAnchor(action.anchorId, 3000);\n }\n if (!anchorEl) {\n console.warn(`[adaptive-content] Anchor not found after waiting: ${action.anchorId.selector}`);\n return { cleanup: () => {} };\n }\n\n // Check if class was already present\n const hadClass = anchorEl.classList.contains(action.className);\n\n // Add class\n anchorEl.classList.add(action.className);\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'content:addClass',\n anchorId: action.anchorId,\n className: action.className,\n });\n\n return {\n cleanup: () => {\n if (!anchorEl.isConnected) return;\n // Only remove if we added it\n if (!hadClass) {\n anchorEl.classList.remove(action.className);\n }\n },\n };\n};\n\n/**\n * Execute a removeClass action\n */\nexport const executeRemoveClass: ActionExecutor<RemoveClassAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n let anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl && context.waitForAnchor) {\n anchorEl = await context.waitForAnchor(action.anchorId, 3000);\n }\n if (!anchorEl) {\n console.warn(`[adaptive-content] Anchor not found after waiting: ${action.anchorId.selector}`);\n return { cleanup: () => {} };\n }\n\n // Check if class was present\n const hadClass = anchorEl.classList.contains(action.className);\n\n // Remove class\n anchorEl.classList.remove(action.className);\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'content:removeClass',\n anchorId: action.anchorId,\n className: action.className,\n });\n\n return {\n cleanup: () => {\n if (!anchorEl.isConnected) return;\n // Only re-add if we removed it\n if (hadClass) {\n anchorEl.classList.add(action.className);\n }\n },\n };\n};\n\n/**\n * Execute a setStyle action\n */\nexport const executeSetStyle: ActionExecutor<SetStyleAction> = async (\n action,\n context\n): Promise<ExecutorResult> => {\n let anchorEl = context.resolveAnchor(action.anchorId);\n if (!anchorEl && context.waitForAnchor) {\n anchorEl = await context.waitForAnchor(action.anchorId, 3000);\n }\n if (!anchorEl) {\n console.warn(`[adaptive-content] Anchor not found after waiting: ${action.anchorId.selector}`);\n return { cleanup: () => {} };\n }\n\n // Snapshot original styles\n const originalStyles = new Map<string, string>();\n for (const prop of Object.keys(action.styles)) {\n const current = (anchorEl as HTMLElement).style.getPropertyValue(prop);\n originalStyles.set(prop, current);\n }\n\n // Apply new styles\n for (const [prop, value] of Object.entries(action.styles)) {\n (anchorEl as HTMLElement).style.setProperty(prop, value);\n }\n\n context.publishEvent('action.applied', {\n id: context.generateId(),\n kind: 'content:setStyle',\n anchorId: action.anchorId,\n styles: Object.keys(action.styles),\n });\n\n return {\n cleanup: () => {\n if (!anchorEl.isConnected) return;\n // Restore original styles\n for (const [prop, originalValue] of originalStyles) {\n if (originalValue) {\n (anchorEl as HTMLElement).style.setProperty(prop, originalValue);\n } else {\n (anchorEl as HTMLElement).style.removeProperty(prop);\n }\n }\n },\n updateFn: (changes) => {\n if ('styles' in changes && typeof changes.styles === 'object' && changes.styles) {\n for (const [prop, value] of Object.entries(changes.styles as Record<string, string>)) {\n (anchorEl as HTMLElement).style.setProperty(prop, value);\n }\n }\n },\n };\n};\n\n// ============================================================================\n// Executor Definitions for Registration\n// ============================================================================\n\n/**\n * All executors provided by this app.\n * These are registered with the runtime's ExecutorRegistry.\n */\nexport const executors = [\n { kind: 'content:insertHtml', executor: executeInsertHtml },\n { kind: 'content:setText', executor: executeSetText },\n { kind: 'content:setAttr', executor: executeSetAttr },\n { kind: 'content:addClass', executor: executeAddClass },\n { kind: 'content:removeClass', executor: executeRemoveClass },\n { kind: 'content:setStyle', executor: executeSetStyle },\n] as const;\n\n/**\n * App runtime manifest.\n */\nexport const runtime = {\n id: 'adaptive-content',\n version: '1.0.0',\n name: 'Content',\n description: 'DOM manipulation for text, attributes, and styles',\n executors,\n};\n"],
5
+ "mappings": ";AA6BO,SAAS,2BACd,WACA,QACA,YACA,MACY;AACZ,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,aAAa,MAAM,cAAc;AAGvC,QAAM,gBAAgB,UAAU,iBAAiB,OAAO;AACxD,MAAI,CAAC,cAAe,QAAO,MAAM;AAAA,EAAC;AAElC,MAAI,UAAU;AACd,MAAI,gBAAsD;AAC1D,MAAI,eAAe;AAEnB,QAAM,WAAW,IAAI,iBAAiB,CAAC,cAAc;AACnD,QAAI,aAAc;AAElB,eAAW,YAAY,WAAW;AAChC,iBAAW,WAAW,SAAS,cAAc;AAE3C,YAAI,YAAY,UAAW;AAE3B,YAAI,WAAW,YAAY;AACzB,mBAAS,WAAW;AACpB,yBAAe;AACf;AAAA,QACF;AAGA,YAAI,cAAe,cAAa,aAAa;AAC7C,wBAAgB,WAAW,MAAM;AAC/B,cAAI,aAAc;AAIlB,cAAI,CAAC,OAAO,aAAa;AACvB,qBAAS,WAAW;AACpB,2BAAe;AACf;AAAA,U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AAA,MACF;AAAA,IACF;AAAA,EACF;AACF;AAUO,IAAM,YAAY;AAAA,EACvB,EAAE,MAAM,sBAAsB,UAAU,kBAAkB;AAAA,EAC1D,EAAE,MAAM,mBAAmB,UAAU,eAAe;AAAA,EACpD,EAAE,MAAM,mBAAmB,UAAU,eAAe;AAAA,EACpD,EAAE,MAAM,oBAAoB,UAAU,gBAAgB;AAAA,EACtD,EAAE,MAAM,uBAAuB,UAAU,mBAAmB;AAAA,EAC5D,EAAE,MAAM,oBAAoB,UAAU,gBAAgB;AACxD;AAKO,IAAM,UAAU;AAAA,EACrB,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AAAA,EACb;AACF;",
6
+ "names": []
7
+ }
package/dist/schema.d.ts CHANGED
@@ -59,16 +59,16 @@ export declare const configSchema: z.ZodObject<{
59
59
  selector: string;
60
60
  route: string | string[];
61
61
  };
62
- value: string;
63
62
  attr: string;
63
+ value: string;
64
64
  }, {
65
65
  summary: string;
66
66
  anchorId: {
67
67
  selector: string;
68
68
  route: string | string[];
69
69
  };
70
- value: string;
71
70
  attr: string;
71
+ value: string;
72
72
  }>, "many">>;
73
73
  /** Style modifications */
74
74
  styleChanges: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -114,22 +114,40 @@ export declare const configSchema: z.ZodObject<{
114
114
  summary: z.ZodString;
115
115
  html: z.ZodString;
116
116
  position: z.ZodEnum<["before", "after", "prepend", "append", "replace"]>;
117
+ deepLink: z.ZodOptional<z.ZodObject<{
118
+ tileId: z.ZodString;
119
+ itemId: z.ZodOptional<z.ZodString>;
120
+ }, "strip", z.ZodTypeAny, {
121
+ tileId: string;
122
+ itemId?: string | undefined;
123
+ }, {
124
+ tileId: string;
125
+ itemId?: string | undefined;
126
+ }>>;
117
127
  }, "strip", z.ZodTypeAny, {
118
128
  html: string;
119
129
  summary: string;
120
- position: "replace" | "before" | "after" | "prepend" | "append";
121
130
  anchorId: {
122
131
  selector: string;
123
132
  route: string | string[];
124
133
  };
134
+ position: "before" | "after" | "prepend" | "append" | "replace";
135
+ deepLink?: {
136
+ tileId: string;
137
+ itemId?: string | undefined;
138
+ } | undefined;
125
139
  }, {
126
140
  html: string;
127
141
  summary: string;
128
- position: "replace" | "before" | "after" | "prepend" | "append";
129
142
  anchorId: {
130
143
  selector: string;
131
144
  route: string | string[];
132
145
  };
146
+ position: "before" | "after" | "prepend" | "append" | "replace";
147
+ deepLink?: {
148
+ tileId: string;
149
+ itemId?: string | undefined;
150
+ } | undefined;
133
151
  }>, "many">>;
134
152
  /** Class additions */
135
153
  classAdditions: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -147,18 +165,18 @@ export declare const configSchema: z.ZodObject<{
147
165
  className: z.ZodString;
148
166
  }, "strip", z.ZodTypeAny, {
149
167
  summary: string;
150
- className: string;
151
168
  anchorId: {
152
169
  selector: string;
153
170
  route: string | string[];
154
171
  };
172
+ className: string;
155
173
  }, {
156
174
  summary: string;
157
- className: string;
158
175
  anchorId: {
159
176
  selector: string;
160
177
  route: string | string[];
161
178
  };
179
+ className: string;
162
180
  }>, "many">>;
163
181
  /** Class removals */
164
182
  classRemovals: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -176,18 +194,18 @@ export declare const configSchema: z.ZodObject<{
176
194
  className: z.ZodString;
177
195
  }, "strip", z.ZodTypeAny, {
178
196
  summary: string;
179
- className: string;
180
197
  anchorId: {
181
198
  selector: string;
182
199
  route: string | string[];
183
200
  };
201
+ className: string;
184
202
  }, {
185
203
  summary: string;
186
- className: string;
187
204
  anchorId: {
188
205
  selector: string;
189
206
  route: string | string[];
190
207
  };
208
+ className: string;
191
209
  }>, "many">>;
192
210
  }, "strip", z.ZodTypeAny, {
193
211
  textReplacements?: {
@@ -204,8 +222,8 @@ export declare const configSchema: z.ZodObject<{
204
222
  selector: string;
205
223
  route: string | string[];
206
224
  };
207
- value: string;
208
225
  attr: string;
226
+ value: string;
209
227
  }[] | undefined;
210
228
  styleChanges?: {
211
229
  summary: string;
@@ -218,27 +236,31 @@ export declare const configSchema: z.ZodObject<{
218
236
  htmlInsertions?: {
219
237
  html: string;
220
238
  summary: string;
221
- position: "replace" | "before" | "after" | "prepend" | "append";
222
239
  anchorId: {
223
240
  selector: string;
224
241
  route: string | string[];
225
242
  };
243
+ position: "before" | "after" | "prepend" | "append" | "replace";
244
+ deepLink?: {
245
+ tileId: string;
246
+ itemId?: string | undefined;
247
+ } | undefined;
226
248
  }[] | undefined;
227
249
  classAdditions?: {
228
250
  summary: string;
229
- className: string;
230
251
  anchorId: {
231
252
  selector: string;
232
253
  route: string | string[];
233
254
  };
255
+ className: string;
234
256
  }[] | undefined;
235
257
  classRemovals?: {
236
258
  summary: string;
237
- className: string;
238
259
  anchorId: {
239
260
  selector: string;
240
261
  route: string | string[];
241
262
  };
263
+ className: string;
242
264
  }[] | undefined;
243
265
  }, {
244
266
  textReplacements?: {
@@ -255,8 +277,8 @@ export declare const configSchema: z.ZodObject<{
255
277
  selector: string;
256
278
  route: string | string[];
257
279
  };
258
- value: string;
259
280
  attr: string;
281
+ value: string;
260
282
  }[] | undefined;
261
283
  styleChanges?: {
262
284
  summary: string;
@@ -269,28 +291,45 @@ export declare const configSchema: z.ZodObject<{
269
291
  htmlInsertions?: {
270
292
  html: string;
271
293
  summary: string;
272
- position: "replace" | "before" | "after" | "prepend" | "append";
273
294
  anchorId: {
274
295
  selector: string;
275
296
  route: string | string[];
276
297
  };
298
+ position: "before" | "after" | "prepend" | "append" | "replace";
299
+ deepLink?: {
300
+ tileId: string;
301
+ itemId?: string | undefined;
302
+ } | undefined;
277
303
  }[] | undefined;
278
304
  classAdditions?: {
279
305
  summary: string;
280
- className: string;
281
306
  anchorId: {
282
307
  selector: string;
283
308
  route: string | string[];
284
309
  };
310
+ className: string;
285
311
  }[] | undefined;
286
312
  classRemovals?: {
287
313
  summary: string;
288
- className: string;
289
314
  anchorId: {
290
315
  selector: string;
291
316
  route: string | string[];
292
317
  };
318
+ className: string;
293
319
  }[] | undefined;
294
320
  }>;
295
321
  export type ContentConfig = z.infer<typeof configSchema>;
322
+ export declare const CAPABILITIES_DOCUMENTATION: {
323
+ packageId: string;
324
+ description: string;
325
+ whenToUse: {
326
+ goal: string;
327
+ action: string;
328
+ }[];
329
+ conventions: {
330
+ name: string;
331
+ description: string;
332
+ }[];
333
+ events: never[];
334
+ };
296
335
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWxB,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAY9B,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAW1B,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAYtB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAWtB,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,YAAY;IAErB,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwBxB,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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