@oscharko-dev/keiko 1.2.6 → 1.2.7

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 (172) hide show
  1. package/dist/ui/csp-hashes.json +8 -8
  2. package/dist/ui/static/404.html +1 -1
  3. package/dist/ui/static/__next.__PAGE__.txt +5 -5
  4. package/dist/ui/static/__next._full.txt +5 -5
  5. package/dist/ui/static/__next._tree.txt +1 -1
  6. package/dist/ui/static/_next/static/chunks/06hwq8_gunvuo.js +29 -0
  7. package/dist/ui/static/_next/static/chunks/0891-mvb901op.js +1 -1
  8. package/dist/ui/static/_next/static/chunks/{30-f39wg2ukb0.js → 09v8w4wuj4m1_.js} +2 -2
  9. package/dist/ui/static/_next/static/chunks/0alcm0tnx-n8-.js +1 -1
  10. package/dist/ui/static/_next/static/chunks/0c_k9ehs17w4l.js +1 -1
  11. package/dist/ui/static/_next/static/chunks/0kjv5jpoy_3wx.js +1 -1
  12. package/dist/ui/static/_next/static/chunks/0ob6quzp23sqe.js +1 -1
  13. package/dist/ui/static/_next/static/chunks/0squn2lq5smnf.js +1 -1
  14. package/dist/ui/static/_next/static/chunks/{3ks40owmq5dke.css → 0vqzhbpt7iewb.css} +10 -9
  15. package/dist/ui/static/_next/static/chunks/0xbqv2_0xajgv.js +1 -1
  16. package/dist/ui/static/_next/static/chunks/11186fkh5coce.js +2 -0
  17. package/dist/ui/static/_next/static/chunks/12ncxpwq54-k2.js +1 -1
  18. package/dist/ui/static/_next/static/chunks/14tr5ujuc_u34.js +1 -1
  19. package/dist/ui/static/_next/static/chunks/1daa_1zod-ndb.js +1 -1
  20. package/dist/ui/static/_next/static/chunks/{10-ixote6buhh.js → 1layk925byvud.js} +1 -1
  21. package/dist/ui/static/_next/static/chunks/1mxu3l7fz5yz1.js +1 -1
  22. package/dist/ui/static/_next/static/chunks/1nqe0rzxqwjkw.js +732 -0
  23. package/dist/ui/static/_next/static/chunks/1p6h98yn2nqtv.js +1 -1
  24. package/dist/ui/static/_next/static/chunks/{2bc_13-_upoqj.js → 1wsoxouji7eb9.js} +1 -1
  25. package/dist/ui/static/_next/static/chunks/20ij-phmydgc3.js +1 -1
  26. package/dist/ui/static/_next/static/chunks/{1xivtevfo8yzl.js → 2206mw-z43vyo.js} +1 -1
  27. package/dist/ui/static/_next/static/chunks/{3j_pd5g21st5o.js → 22pvivewswjat.js} +1 -1
  28. package/dist/ui/static/_next/static/chunks/{1293esxg_t46n.css → 272m__6w4ehe1.css} +6 -4
  29. package/dist/ui/static/_next/static/chunks/2az51zfcfe4w7.js +1 -1
  30. package/dist/ui/static/_next/static/chunks/2fr8bahvq9eg9.js +1 -1
  31. package/dist/ui/static/_next/static/chunks/{209aaqjv6z8gh.js → 2gvu8dyrhibpa.js} +1 -1
  32. package/dist/ui/static/_next/static/chunks/2na7t_nmk3z_c.js +1 -1
  33. package/dist/ui/static/_next/static/chunks/2nxhnrgae6nij.js +1 -1
  34. package/dist/ui/static/_next/static/chunks/{1t276xv4ec2k7.js → 2ql8dczlqzd4u.js} +1 -1
  35. package/dist/ui/static/_next/static/chunks/{33po7i9f3y-hi.js → 2ty81249w2gdw.js} +1 -1
  36. package/dist/ui/static/_next/static/chunks/2vmw7uw9qfxtm.js +2 -0
  37. package/dist/ui/static/_next/static/chunks/37kujq-6rc3ey.js +1 -1
  38. package/dist/ui/static/_next/static/chunks/3i3kblvx52ywv.js +1 -1
  39. package/dist/ui/static/_next/static/chunks/3j8fuk7gt_nsd.js +1 -1
  40. package/dist/ui/static/_next/static/chunks/3n0xbx7qq5429.js +1 -1
  41. package/dist/ui/static/_next/static/chunks/3n16srxs2afdp.js +1 -1
  42. package/dist/ui/static/_next/static/chunks/3rg7mh8olm1dj.js +1 -0
  43. package/dist/ui/static/_next/static/chunks/3s1wb0rz0bdep.js +1 -1
  44. package/dist/ui/static/_next/static/chunks/{turbopack-17n7tuo0-0vcg.js → turbopack-3-2dc0s_e9msx.js} +1 -1
  45. package/dist/ui/static/_next/static/media/{codicon.2b_iqd4rvjgu4.ttf → codicon.42hqluqtoi4oe.ttf} +0 -0
  46. package/dist/ui/static/_not-found/__next._full.txt +1 -1
  47. package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +1 -1
  48. package/dist/ui/static/_not-found/__next._tree.txt +1 -1
  49. package/dist/ui/static/_not-found.html +1 -1
  50. package/dist/ui/static/_not-found.txt +1 -1
  51. package/dist/ui/static/atlassian-connectors/__next._full.txt +1 -1
  52. package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
  53. package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +1 -1
  54. package/dist/ui/static/atlassian-connectors.html +1 -1
  55. package/dist/ui/static/atlassian-connectors.txt +1 -1
  56. package/dist/ui/static/index.html +1 -1
  57. package/dist/ui/static/index.txt +5 -5
  58. package/dist/ui/static/launch/__next._full.txt +5 -5
  59. package/dist/ui/static/launch/__next._tree.txt +1 -1
  60. package/dist/ui/static/launch/__next.launch.__PAGE__.txt +5 -5
  61. package/dist/ui/static/launch.html +1 -1
  62. package/dist/ui/static/launch.txt +5 -5
  63. package/dist/ui/static/local-knowledge/__next._full.txt +5 -5
  64. package/dist/ui/static/local-knowledge/__next._tree.txt +1 -1
  65. package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +5 -5
  66. package/dist/ui/static/local-knowledge/capsule/__next._full.txt +1 -1
  67. package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
  68. package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +1 -1
  69. package/dist/ui/static/local-knowledge/capsule.html +1 -1
  70. package/dist/ui/static/local-knowledge/capsule.txt +1 -1
  71. package/dist/ui/static/local-knowledge.html +1 -1
  72. package/dist/ui/static/local-knowledge.txt +5 -5
  73. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts +5 -0
  74. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts.map +1 -1
  75. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.js +6 -0
  76. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts +7 -0
  77. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts.map +1 -1
  78. package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.js +9 -1
  79. package/node_modules/@oscharko-dev/keiko-activity-log/package.json +3 -3
  80. package/node_modules/@oscharko-dev/keiko-cli/package.json +15 -15
  81. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.d.ts +1 -1
  82. package/node_modules/@oscharko-dev/keiko-connectors/dist/version.js +1 -1
  83. package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
  84. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.d.ts +2 -2
  85. package/node_modules/@oscharko-dev/keiko-contracts/dist/version.js +2 -2
  86. package/node_modules/@oscharko-dev/keiko-contracts/package.json +1 -1
  87. package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
  88. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
  89. package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
  90. package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
  91. package/node_modules/@oscharko-dev/keiko-git/dist/version.d.ts +1 -1
  92. package/node_modules/@oscharko-dev/keiko-git/dist/version.js +1 -1
  93. package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
  94. package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
  95. package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
  96. package/node_modules/@oscharko-dev/keiko-harness/package.json +7 -7
  97. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
  98. package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
  99. package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +6 -6
  100. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
  101. package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
  102. package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
  103. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
  104. package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
  105. package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
  106. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
  107. package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
  108. package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
  109. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
  110. package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
  111. package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
  112. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
  113. package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
  114. package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
  115. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
  116. package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
  117. package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +4 -4
  118. package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
  119. package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
  120. package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
  121. package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
  122. package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
  123. package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
  124. package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
  125. package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +6 -5
  126. package/node_modules/@oscharko-dev/keiko-server/package.json +24 -24
  127. package/node_modules/@oscharko-dev/keiko-tool-catalog/package.json +3 -3
  128. package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
  129. package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
  130. package/node_modules/@oscharko-dev/keiko-tools/package.json +7 -7
  131. package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
  132. package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
  133. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
  134. package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
  135. package/node_modules/@oscharko-dev/keiko-workspace/package.json +4 -4
  136. package/package.json +38 -38
  137. package/release-impact.catalog.json +73 -0
  138. package/vendor/oscharko-dev-keiko-activity-log-1.2.7.tgz +0 -0
  139. package/vendor/{oscharko-dev-keiko-cli-1.2.6.tgz → oscharko-dev-keiko-cli-1.2.7.tgz} +0 -0
  140. package/vendor/{oscharko-dev-keiko-connectors-1.2.6.tgz → oscharko-dev-keiko-connectors-1.2.7.tgz} +0 -0
  141. package/vendor/{oscharko-dev-keiko-contracts-1.2.6.tgz → oscharko-dev-keiko-contracts-1.2.7.tgz} +0 -0
  142. package/vendor/{oscharko-dev-keiko-evaluations-1.2.6.tgz → oscharko-dev-keiko-evaluations-1.2.7.tgz} +0 -0
  143. package/vendor/{oscharko-dev-keiko-evidence-1.2.6.tgz → oscharko-dev-keiko-evidence-1.2.7.tgz} +0 -0
  144. package/vendor/{oscharko-dev-keiko-git-1.2.6.tgz → oscharko-dev-keiko-git-1.2.7.tgz} +0 -0
  145. package/vendor/{oscharko-dev-keiko-harness-1.2.6.tgz → oscharko-dev-keiko-harness-1.2.7.tgz} +0 -0
  146. package/vendor/{oscharko-dev-keiko-local-knowledge-1.2.6.tgz → oscharko-dev-keiko-local-knowledge-1.2.7.tgz} +0 -0
  147. package/vendor/{oscharko-dev-keiko-memory-capture-1.2.6.tgz → oscharko-dev-keiko-memory-capture-1.2.7.tgz} +0 -0
  148. package/vendor/{oscharko-dev-keiko-memory-consolidation-1.2.6.tgz → oscharko-dev-keiko-memory-consolidation-1.2.7.tgz} +0 -0
  149. package/vendor/{oscharko-dev-keiko-memory-governance-1.2.6.tgz → oscharko-dev-keiko-memory-governance-1.2.7.tgz} +0 -0
  150. package/vendor/{oscharko-dev-keiko-memory-retrieval-1.2.6.tgz → oscharko-dev-keiko-memory-retrieval-1.2.7.tgz} +0 -0
  151. package/vendor/{oscharko-dev-keiko-memory-vault-1.2.6.tgz → oscharko-dev-keiko-memory-vault-1.2.7.tgz} +0 -0
  152. package/vendor/{oscharko-dev-keiko-model-gateway-1.2.6.tgz → oscharko-dev-keiko-model-gateway-1.2.7.tgz} +0 -0
  153. package/vendor/{oscharko-dev-keiko-quality-intelligence-1.2.6.tgz → oscharko-dev-keiko-quality-intelligence-1.2.7.tgz} +0 -0
  154. package/vendor/{oscharko-dev-keiko-sandbox-1.2.6.tgz → oscharko-dev-keiko-sandbox-1.2.7.tgz} +0 -0
  155. package/vendor/{oscharko-dev-keiko-sdk-1.2.6.tgz → oscharko-dev-keiko-sdk-1.2.7.tgz} +0 -0
  156. package/vendor/{oscharko-dev-keiko-security-1.2.6.tgz → oscharko-dev-keiko-security-1.2.7.tgz} +0 -0
  157. package/vendor/oscharko-dev-keiko-server-1.2.7.tgz +0 -0
  158. package/vendor/{oscharko-dev-keiko-tool-catalog-1.2.6.tgz → oscharko-dev-keiko-tool-catalog-1.2.7.tgz} +0 -0
  159. package/vendor/{oscharko-dev-keiko-tools-1.2.6.tgz → oscharko-dev-keiko-tools-1.2.7.tgz} +0 -0
  160. package/vendor/{oscharko-dev-keiko-verification-1.2.6.tgz → oscharko-dev-keiko-verification-1.2.7.tgz} +0 -0
  161. package/vendor/{oscharko-dev-keiko-workflows-1.2.6.tgz → oscharko-dev-keiko-workflows-1.2.7.tgz} +0 -0
  162. package/vendor/{oscharko-dev-keiko-workspace-1.2.6.tgz → oscharko-dev-keiko-workspace-1.2.7.tgz} +0 -0
  163. package/dist/ui/static/_next/static/chunks/0f-ub6bs0i1sj.js +0 -2
  164. package/dist/ui/static/_next/static/chunks/18voy19pok4ko.js +0 -671
  165. package/dist/ui/static/_next/static/chunks/2eif0mrb2ok4e.js +0 -1
  166. package/dist/ui/static/_next/static/chunks/3ggg2nmiwuz90.js +0 -27
  167. package/dist/ui/static/_next/static/chunks/3qhgsd4mwnt9v.js +0 -2
  168. package/vendor/oscharko-dev-keiko-activity-log-1.2.6.tgz +0 -0
  169. package/vendor/oscharko-dev-keiko-server-1.2.6.tgz +0 -0
  170. /package/dist/ui/static/_next/static/{dHwBvAPZHCBS19_AHKzGd → H3xxDPi4xvbxoz-xJSbax}/_buildManifest.js +0 -0
  171. /package/dist/ui/static/_next/static/{dHwBvAPZHCBS19_AHKzGd → H3xxDPi4xvbxoz-xJSbax}/_clientMiddlewareManifest.js +0 -0
  172. /package/dist/ui/static/_next/static/{dHwBvAPZHCBS19_AHKzGd → H3xxDPi4xvbxoz-xJSbax}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+"";}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92913,e=>{e.v({cmpBar:"h2tPpG_cmpBar",cmpBarSegment:"h2tPpG_cmpBarSegment",cmpChevron:"h2tPpG_cmpChevron",cmpCompact:"h2tPpG_cmpCompact",cmpDetailsToggle:"h2tPpG_cmpDetailsToggle",cmpExplanation:"h2tPpG_cmpExplanation",cmpFill:"h2tPpG_cmpFill",cmpHelp:"h2tPpG_cmpHelp",cmpLegend:"h2tPpG_cmpLegend",cmpLegendDetail:"h2tPpG_cmpLegendDetail",cmpLegendLabel:"h2tPpG_cmpLegendLabel",cmpLegendRow:"h2tPpG_cmpLegendRow",cmpLegendShare:"h2tPpG_cmpLegendShare",cmpLegendValue:"h2tPpG_cmpLegendValue",cmpMetrics:"h2tPpG_cmpMetrics",cmpPanel:"h2tPpG_cmpPanel",cmpProtected:"h2tPpG_cmpProtected",cmpRoot:"h2tPpG_cmpRoot",cmpSavings:"h2tPpG_cmpSavings",cmpSpinning:"h2tPpG_cmpSpinning",cmpSwatch:"h2tPpG_cmpSwatch",cmpTotal:"h2tPpG_cmpTotal",cmpTrack:"h2tPpG_cmpTrack",cmpTrigger:"h2tPpG_cmpTrigger",cmpWarning:"h2tPpG_cmpWarning","context-spin":"h2tPpG_context-spin"});},8552,e=>{e.v({"cmp-partial-transcript":"iU4D6a_cmp-partial-transcript","cmp-voice-attachments":"iU4D6a_cmp-voice-attachments","cmp-voice-attachments-label":"iU4D6a_cmp-voice-attachments-label","cmp-voice-content":"iU4D6a_cmp-voice-content",cmpBatchFailedTranscript:"iU4D6a_cmpBatchFailedTranscript",cmpBatchModeLabel:"iU4D6a_cmpBatchModeLabel",cmpBox:"iU4D6a_cmpBox",cmpDraftNotice:"iU4D6a_cmpDraftNotice",cmpFooter:"iU4D6a_cmpFooter",cmpUserMessage:"iU4D6a_cmpUserMessage",cmpUserMessageBubble:"iU4D6a_cmpUserMessageBubble",composerLayer:"iU4D6a_composerLayer",contextWindowNotice:"iU4D6a_contextWindowNotice",memoryActivationButton:"iU4D6a_memoryActivationButton",memoryBudgetControl:"iU4D6a_memoryBudgetControl",memoryBudgetSetting:"iU4D6a_memoryBudgetSetting",memoryControls:"iU4D6a_memoryControls",normalLayer:"iU4D6a_normalLayer",pendingVoiceTurnNotice:"iU4D6a_pendingVoiceTurnNotice",responseVersionControl:"iU4D6a_responseVersionControl",responseVersionLabel:"iU4D6a_responseVersionLabel",responseVersionSelect:"iU4D6a_responseVersionSelect",responseVersionSummary:"iU4D6a_responseVersionSummary",sessionNotice:"iU4D6a_sessionNotice",turnEndState:"iU4D6a_turnEndState",voiceDialogBox:"iU4D6a_voiceDialogBox",voiceLayer:"iU4D6a_voiceLayer"});},219,e=>{"use strict";var t,n,r,i,s,o,a,l,c,u,d,h,p,f=e.i(43476),m=e.i(85912),g=e.i(8552);function v({draft:e,persistence:t}){let n=(0,m.a)();if(void 0===t||"saved"===t.phase&&!(e.length>0))return null;let{phase:r,pending:i,retry:s,keepLocal:o,restoreSaved:a}=t,l="failed"===r||"unavailable"===r;return(0,f.jsxs)("div",{className:l||"conflict"===r?g.default.cmpDraftNotice:g.default.cmpBatchModeLabel,role:l||"conflict"===r?"alert":"status",children:[(0,f.jsx)("span",{children:n(`chat.draft.${r}`)}),l?(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",disabled:i,onClick:()=>void s(),children:n("chat.draft.retry")}):null,"conflict"===r?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",disabled:i,onClick:()=>void o(),children:n("chat.draft.keepLocal")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",disabled:i,onClick:()=>void a(),children:n("chat.draft.useSaved")})]}):null]});}var y=e.i(71645),k=e.i(70478),b=e.i(95508),x=e.i(46095),w=e.i(50850);function C(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t-=1;return e.slice(0,t);}function S(e){return C(e.replaceAll("\\","/"));}function D(e){return C(function(e){let t=0;for(;t<e.length&&"/"===e[t];)t+=1;return e.slice(t);}(e.replaceAll("\\","/")));}function A(e,t){return`${e}\x01${t}`;}let E=/(^|\s)@((?:[A-Za-z0-9_.-]+\/)*[A-Za-z0-9_.-]+\.[A-Za-z0-9][A-Za-z0-9]{0,15})(?=$|\s)/gu;var M=e.i(68611);function N(e,t,n,r=Date.now){let i=D(n);if(0===i.length)throw Error("EMPTY_REPOSITORY_FILE_SELECTION");let s=(0,M.m)(e),o=[],a=!1,l=!1;for(let n of s){var _n$root;let s=(_n$root=n.root)!==null&&_n$root!==void 0?_n$root:e.projectPath;if("files"===n.kind&&s===t){if(a=!0,n.relativePaths.includes(i)){o.push(n);continue;}if(n.relativePaths.length>=50)throw Error("REPOSITORY_FILE_SCOPE_LIMIT");o.push({...n,root:t,relativePaths:[...n.relativePaths,i],connectedAtMs:r()}),l=!0;continue;}o.push(n);}return a||(o.push({kind:"files",root:t,relativePaths:[i],connectedAtMs:r()}),l=!0),{scopes:o,changed:l};}var _=e.i(6225),T=e.i(20081),R=e.i(24541);function I(e,t){(0,R.v)("client.scope.notice",{correlationId:(0,T.y)(),scopeNotice:{reason:e,scopeKind:t.kind,pathCount:t.relativePaths.length}});}function j(e,t){return(0,_.R)([e])===(0,_.R)([t]);}function F({chat:e}){let t=(0,M.m)(e),n=(0,_.R)(t),r=(0,y.useRef)(t);(0,y.useEffect)(()=>{r.current=t;},[t]);let i=(0,y.useRef)({id:e.id,scopes:t});return(0,y.useEffect)(()=>{let t=i.current,n=r.current;if(i.current={id:e.id,scopes:n},t.id!==e.id)return;let s=n.filter(e=>!t.scopes.some(t=>j(t,e))),o=setTimeout(()=>{for(let e of s)I(function(e,t){return"workspace-root"===t.kind?"widened":"files"===t.kind?"narrowed-to-file":void 0!==e&&e.relativePaths.length>0&&e.relativePaths.every(e=>t.relativePaths.some(t=>e.startsWith(`${t}/`)))?"widened":"narrowed-to-directory";}(function(e,t,n){let r=e.filter(e=>e.root===n.root&&!t.some(t=>j(e,t)));return 1===r.length?r[0]:void 0;}(t.scopes,n,e),e),e);},100);return()=>clearTimeout(o);},[e.id,n]),null;}var O=e.i(86090),z=e.i(67914),B=e.i(50471);function P({declaration:e,roots:t,...n}){var _t$;let r=(0,w.t)(),[i,s]=(0,y.useState)(""),o=t.includes(i)?i:"",a=1===t.length?(_t$=t[0])!==null&&_t$!==void 0?_t$:"":o,l=function(e,t,n){let r,i=(0,w.t)(),s=(r=(0,y.useRef)(e),(0,y.useEffect)(()=>{r.current=e;},[e]),r),[o,a]=(0,y.useState)(!1),[l,c]=(0,y.useState)(null),u=async()=>{let r=e.chat;if(!o&&void 0!==r&&0!==n.length){a(!0),c(null);try{var _e$updateScopes;let o=N(r,n,t),a=()=>{var _e;var e;return e=s.current.chat,((_e=e)===null||_e===void 0?void 0:_e.id)===r.id&&e.projectPath===r.projectPath&&e.groundingScopeIdentity===r.groundingScopeIdentity&&e===r;},l=e=>{a()&&s.current.onChatChanged(e);},c=o.changed?await(0,x.C)(r,o.scopes,(_e$updateScopes=e.updateScopes)!==null&&_e$updateScopes!==void 0?_e$updateScopes:b.i$,l):{chat:r};if(!a())return;I("missing-evidence-added",{kind:"files",root:n,relativePaths:[t],connectedAtMs:Date.now()}),l(c.chat);let u=i("scope.missing.followUp",{path:t});s.current.setDraft(s.current.draft?`${s.current.draft}
2
- ${u}`:u),s.current.focusComposer();}catch(e){c((0,O.A)(e,i("scope.missing.failed")));}finally{a(!1);}}};return{busy:o,error:l,add:u};}(n,e.scopePath,a);return 0===t.length?null:(0,f.jsxs)("div",{className:B.default.cmpNotice,children:[(0,f.jsx)("span",{title:e.scopePath,children:r("scope.pill.file",{name:(0,_.p)(e.scopePath)})}),t.length>1?(0,f.jsx)(z.f,{value:a,sections:[{options:t.map(e=>({value:e,label:e}))}],onValueChange:s,ariaLabel:r("scope.missing.folder"),placeholder:r("scope.missing.chooseFolder")}):null,(0,f.jsx)("button",{type:"button",disabled:0===a.length,"aria-disabled":l.busy,onClick:()=>{l.add();},children:r("scope.missing.add")}),null===l.error?null:(0,f.jsx)("span",{role:"alert",children:l.error})]});}function L(e){var _n$insufficiencyDecla,_n$insufficiencyDecla2;let t=(0,w.t)(),{answer:n,chat:r}=e;if(void 0===r||void 0===n||"local-knowledge"===n.groundingKind||"insufficiency"!==n.answerKind)return null;let i=(_n$insufficiencyDecla=(_n$insufficiencyDecla2=n.insufficiencyDeclarations)===null||_n$insufficiencyDecla2===void 0?void 0:_n$insufficiencyDecla2.filter(e=>"unread-in-scope"===e.state))!==null&&_n$insufficiencyDecla!==void 0?_n$insufficiencyDecla:[];return 0===i.length?null:(0,f.jsxs)("section",{className:B.default.cmpNotice,"aria-label":t("scope.missing.title"),children:[(0,f.jsx)("p",{children:t("scope.missing.count",{count:i.length})}),(0,f.jsxs)("details",{children:[(0,f.jsx)("summary",{children:t("scope.missing.help")}),(0,f.jsx)("p",{children:t("chat.grounding.help")})]}),i.map((t,n)=>(0,f.jsx)(P,{...e,declaration:t,roots:"unread-in-scope"===t.state&&(0,k.x)(t.scopePath)?Array.from(new Set((0,M.m)(r).filter(e=>{var n;return n=t.scopePath,"workspace-root"===e.kind||("files"===e.kind?e.relativePaths.includes(n):e.relativePaths.some(e=>n.startsWith(`${e}/`)));}).map(e=>{var _e$root;return(_e$root=e.root)!==null&&_e$root!==void 0?_e$root:r.projectPath;}))):[]},`${t.scopePath}-${String(n)}`))]});}var $=e.i(25164),q=e.i(74080),V=e.i(26428),U=e.i(71166),W=e.i(94843),K=e.i(74952),H=e.i(80144),J=e.i(79056),G=e.i(54523),Z=e.i(29835),Q=e.i(92215),Y=e.i(30644),X=e.i(17161),ee=e.i(92913);let et=X.f.lock,en=new Set(["system","skill","knowledge"]);function er({status:e}){let t=(0,m.a)(),n=(0,w.X)(),r=[[t("chat.context.used"),e.estimatedInputTokens.toLocaleString(n)],[t("chat.context.inputBudget"),e.inputBudgetTokens.toLocaleString(n)],[t("chat.context.window"),e.contextWindowTokens.toLocaleString(n)],[t("chat.context.outputReserve"),e.reservedOutputTokens.toLocaleString(n)],[t("chat.context.safetyMargin"),e.safetyMarginTokens.toLocaleString(n)]];return(0,f.jsx)("dl",{className:ee.default.cmpMetrics,children:r.map(([e,t])=>(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:e}),(0,f.jsx)("dd",{children:t})]},e))});}function ei({segments:e,window:t}){return(0,f.jsx)("div",{className:ee.default.cmpBar,"aria-hidden":"true",children:e.map(e=>(0,f.jsx)("span",{className:ee.default.cmpBarSegment,"data-segment":e.id,style:{flexGrow:e.tokens/Math.max(1,t)}},e.id))});}function es({id:e}){let t=(0,m.a)();if(!en.has(e))return null;let n=t("chat.context.notCompacted");return(0,f.jsx)("span",{className:ee.default.cmpProtected,role:"img","aria-label":n,title:n,children:(0,f.jsx)(et,{size:13})});}function eo({segment:e,status:t}){var n;let r=(0,m.a)(),i=(0,w.X)(),s=function(e,t,n,_t$count){let r=(_t$count=t.count)!==null&&_t$count!==void 0?_t$count:0;if("messages"===t.id&&r>0)return e(1===r?"chat.context.count.messages.one":"chat.context.count.messages",{count:r});if("summary"===t.id&&r>0)return e(1===r?"chat.context.count.summary.one":"chat.context.count.summary",{count:r});let i=n.knowledgeSources;if("knowledge"===t.id&&void 0!==i)return e("chat.context.count.references",{sent:i.sentReferenceCount,available:i.availableReferenceCount});}(r,e,t),o=e.tokens/Math.max(1,t.contextWindowTokens)*100;return(0,f.jsxs)("li",{className:ee.default.cmpLegendRow,"data-segment":e.id,children:[(0,f.jsx)("span",{className:ee.default.cmpSwatch,"data-segment":e.id,"aria-hidden":"true"}),(0,f.jsxs)("span",{className:ee.default.cmpLegendLabel,children:[(n=void 0!==t.conversationInputBudgetTokens,{system:r("chat.context.segment.system"),skill:r("chat.context.segment.skill"),summary:r("chat.context.segment.summary"),messages:r("chat.context.segment.messages"),knowledge:r("chat.context.segment.knowledge"),free:r(n?"chat.context.segment.conversationFree":"chat.context.segment.free"),"compaction-buffer":r("chat.context.segment.compactionBuffer"),"source-capacity":r("chat.context.segment.sourceCapacity"),"input-capacity-unavailable":r("chat.context.segment.inputUnavailable"),"output-reserve":r("chat.context.outputReserve"),"safety-margin":r("chat.context.safetyMargin")}[e.id]),(0,f.jsx)(es,{id:e.id}),void 0===s?null:(0,f.jsx)("span",{className:ee.default.cmpLegendDetail,children:s})]}),(0,f.jsx)("span",{className:ee.default.cmpLegendValue,children:e.tokens.toLocaleString(i)}),(0,f.jsx)("span",{className:ee.default.cmpLegendShare,children:r("chat.context.percent",{percent:ek(o,i)})})]});}function ea({status:e,segments:t}){let n=(0,m.a)(),r=(0,w.X)(),i=t.filter(e=>"summary"!==e.id||e.tokens>0);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:ee.default.cmpTotal,children:n("chat.context.total",{used:e.estimatedInputTokens.toLocaleString(r),usable:e.inputBudgetTokens.toLocaleString(r),window:e.contextWindowTokens.toLocaleString(r)})}),(0,f.jsx)(ei,{segments:i,window:e.contextWindowTokens}),(0,f.jsx)("ul",{className:ee.default.cmpLegend,"aria-label":n("chat.context.breakdown"),children:i.map(t=>(0,f.jsx)(eo,{segment:t,status:e},t.id))})]});}function el({status:e}){let t=(0,m.a)(),n=(0,w.X)(),r=e.knowledgeSources;return void 0!==r&&r.sentReferenceCount<r.availableReferenceCount?(0,f.jsx)("p",{className:ee.default.cmpWarning,role:"note",children:t("chat.context.referencesTrimmed",{sent:r.sentReferenceCount.toLocaleString(n),available:r.availableReferenceCount.toLocaleString(n)})}):null;}function ec({status:e}){var t;let n,r=(0,m.a)(),i=(0,w.X)(),s=e=>e.toLocaleString(i),o=void 0===e.autoCompactionAtTokens?void 0:Math.max(0,e.autoCompactionAtTokens-e.estimatedInputTokens);return(0,f.jsxs)(f.Fragment,{children:[void 0===e.lastRequest?null:(0,f.jsx)("p",{className:ee.default.cmpHelp,children:(n=s((t=e.lastRequest).promptTokens),t.measured?void 0===t.estimatedTokens||t.estimatedTokens===t.promptTokens?r("chat.context.lastRequestMeasured",{tokens:n}):r("chat.context.lastRequestMeasuredWithEstimate",{tokens:n,estimated:s(t.estimatedTokens)}):r("chat.context.lastRequestEstimated",{tokens:n}))}),void 0===o?null:(0,f.jsx)("p",{className:ee.default.cmpHelp,children:r(void 0===e.conversationInputBudgetTokens?"chat.context.untilCompaction":"chat.context.untilConversationCompaction",{tokens:s(o)})})]});}function eu({status:e}){return(0,f.jsxs)(f.Fragment,{children:[void 0===e.segments?(0,f.jsx)(er,{status:e}):(0,f.jsx)(ea,{status:e,segments:e.segments}),(0,f.jsx)(el,{status:e}),(0,f.jsx)(eh,{status:e})]});}function ed({status:e}){var _e$segments;let t=(0,m.a)(),n=(0,w.X)(),r=(_e$segments=e.segments)===null||_e$segments===void 0?void 0:_e$segments.some(e=>"input-capacity-unavailable"===e.id&&e.tokens>0);return void 0===e.inputLimitTokens||!0!==r?null:(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.declaredInputLimit",{tokens:e.inputLimitTokens.toLocaleString(n)})});}function eh({status:e}){let t=(0,m.a)(),n=(0,w.X)();return(0,f.jsxs)(f.Fragment,{children:[void 0===e.compaction?null:(0,f.jsx)("p",{className:ee.default.cmpSavings,children:t(1===e.compaction.messagesCompacted?"chat.context.saved.one":"chat.context.saved",{tokens:e.compaction.tokensSaved.toLocaleString(n),count:e.compaction.messagesCompacted.toLocaleString(n)})}),void 0===e.pendingCompaction?null:(0,f.jsx)("p",{className:ee.default.cmpSavings,children:t("chat.context.pending",{before:e.pendingCompaction.tokensBefore.toLocaleString(n),after:e.pendingCompaction.tokensAfter.toLocaleString(n)})}),!0===e.contextWindowAssumed?(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.windowAssumed")}):null]});}function ep({status:e}){var _r$toLocaleString;let t=(0,m.a)(),n=(0,w.X)(),r=e===null||e===void 0?void 0:e.conversationInputBudgetTokens;return(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t(void 0===r?"chat.context.automatic":"chat.context.automaticGrounded",{tokens:(_r$toLocaleString=r===null||r===void 0?void 0:r.toLocaleString(n))!==null&&_r$toLocaleString!==void 0?_r$toLocaleString:""})});}function ef({status:e}){var _r$toLocaleString2;let t=(0,m.a)(),n=(0,w.X)(),r=e.conversationInputBudgetTokens;return(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t(void 0===r?"chat.context.sourcesPolicy":"chat.context.sourcesPolicyGrounded",{tokens:(_r$toLocaleString2=r===null||r===void 0?void 0:r.toLocaleString(n))!==null&&_r$toLocaleString2!==void 0?_r$toLocaleString2:""})});}function em({status:e}){let t=(0,m.a)(),n=(0,y.useId)(),[r,i]=(0,y.useState)(!1);return(0,f.jsxs)("div",{className:ee.default.cmpExplanation,children:[(0,f.jsxs)("button",{type:"button",className:ee.default.cmpDetailsToggle,"aria-expanded":r,"aria-controls":n,onClick:()=>{i(!r),(0,R.v)("Keiko context explanation visibility changed.",{composerActivity:r?"context-details-collapsed":"context-details-expanded"});},children:[(0,f.jsx)("span",{className:ee.default.cmpChevron,"aria-hidden":"true",children:"›"}),t("chat.context.details")]}),(0,f.jsxs)("div",{id:n,hidden:!r,children:[(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.estimate")}),(0,f.jsx)(ep,{status:e}),(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.retained")}),(e===null||e===void 0?void 0:e.knowledgeSources)===void 0?null:(0,f.jsx)(ef,{status:e}),void 0===e?null:(0,f.jsx)(ec,{status:e}),void 0===e?null:(0,f.jsx)(ed,{status:e})]})]});}function eg(e){var _e$status;let t=(0,m.a)();return(0,f.jsxs)(f.Fragment,{children:[void 0===e.status?(0,f.jsx)("p",{children:t("chat.context.unavailable")}):(0,f.jsx)(eu,{status:e.status}),e.error?(0,f.jsx)("p",{children:(0,f.jsxs)("output",{children:[t("chat.context.error")," ",(0,f.jsx)("button",{type:"button",onClick:e.onRetry,children:t("chat.context.retry")})]})}):null,(0,f.jsx)("button",{type:"button",className:ee.default.cmpCompact,disabled:e.busy||e.compacting||((_e$status=e.status)===null||_e$status===void 0?void 0:_e$status.canCompact)!==!0,onClick:e.onCompact,children:t(e.compacting?"chat.context.compacting":"chat.context.compact")}),e.busy?(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.wait")}):null,(0,f.jsx)(em,{status:e.status})]});}function ev({percent:e,compacting:t}){return(0,f.jsxs)("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",className:t?ee.default.cmpSpinning:void 0,children:[(0,f.jsx)("circle",{className:ee.default.cmpTrack,cx:"12",cy:"12",r:"9",fill:"none",strokeWidth:"3"}),(0,f.jsx)("circle",{className:ee.default.cmpFill,cx:"12",cy:"12",r:"9",fill:"none",strokeWidth:"3",pathLength:"100",strokeDasharray:"100",strokeDashoffset:100-Math.min(100,e!==null&&e!==void 0?e:0),transform:"rotate(-90 12 12)"})]});}function ey(e){var t;let n=(0,m.a)(),r=(0,w.X)(),i=(0,y.useId)(),s=function(){let e=(0,y.useRef)(null),t=(0,y.useRef)(null),[n,r]=(0,y.useState)(!1),i=function(e,t,n){let[r,i]=(0,y.useState)({visibility:"hidden"});return(0,y.useLayoutEffect)(()=>{if(!e)return;let r=0,s="",o=()=>{if(null!==t.current&&null!==n.current){let e=(0,Y.f)({anchor:t.current.getBoundingClientRect(),width:320,height:n.current.scrollHeight+2,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,gap:8,preferUp:!0}),r=JSON.stringify(e);r!==s&&(s=r,i({left:e.left,top:e.top,width:e.width,maxHeight:e.maxHeight}));}r=requestAnimationFrame(o);};return o(),()=>cancelAnimationFrame(r);},[e,t,n]),r;}(n,e,t);return(0,y.useEffect)(()=>{if(!n)return;let i=n=>{var _e$current;"Tab"===n.key?function(e,t,n,_i$current,_i$current2){var r,i,s,o;let a=n.current;if(null===a)return!0;let l=Array.from(a.querySelectorAll("button:not(:disabled)")),c=l[0];return e.target!==t.current||e.shiftKey||void 0===c?(r=e,i=t,s=l,o=a,r.target===s[0]&&r.shiftKey?(r.preventDefault(),(_i$current=i.current)!==null&&_i$current!==void 0&&_i$current.focus(),!1):r.target!==s.at(-1)||r.shiftKey?!(r.target instanceof Node&&o.contains(r.target)):((_i$current2=i.current)!==null&&_i$current2!==void 0&&_i$current2.focus(),!0)):(e.preventDefault(),c.focus(),!1);}(n,e,t)&&r(!1):"Escape"===n.key&&(n.preventDefault(),n.stopPropagation(),(_e$current=e.current)!==null&&_e$current!==void 0&&_e$current.focus(),r(!1));},s=n=>{var _e$current2,_t$current;var i;i=n.target,i instanceof Node&&(((_e$current2=e.current)===null||_e$current2===void 0?void 0:_e$current2.contains(i))===!0||((_t$current=t.current)===null||_t$current===void 0?void 0:_t$current.contains(i))===!0)||r(!1);};return document.addEventListener("keydown",i,!0),document.addEventListener("pointerdown",s,!0),document.addEventListener("focusin",s),()=>{document.removeEventListener("keydown",i,!0),document.removeEventListener("pointerdown",s,!0),document.removeEventListener("focusin",s);};},[n]),{trigger:e,panel:t,open:n,position:i,toggle:()=>r(e=>!e)};}(),o=void 0===(t=e.status)?void 0:t.estimatedInputTokens/Math.max(1,t.inputBudgetTokens),a=void 0===o?void 0:100*o,l=void 0===a?void 0:ek(a,r),c=void 0===l?n("chat.context.unavailable"):n("chat.context.label",{percent:l});return(0,f.jsxs)("div",{className:ee.default.cmpRoot,"data-tone":void 0===o?"unknown":o>=.9?"critical":o>=.8?"warning":"normal","aria-busy":e.compacting,children:[(0,f.jsx)("button",{type:"button",ref:s.trigger,className:ee.default.cmpTrigger,"aria-label":c,title:c,"aria-controls":s.open?i:void 0,"aria-expanded":s.open,onClick:s.toggle,children:(0,f.jsx)(ev,{percent:a,compacting:e.compacting})}),s.open?(0,q.createPortal)((0,f.jsxs)("section",{ref:s.panel,id:i,className:ee.default.cmpPanel,style:s.position,"aria-label":n("chat.context.title"),children:[(0,f.jsx)("h3",{children:void 0===l?n("chat.context.title"):n("chat.context.heading",{percent:l})}),(0,f.jsx)(eg,{...e})]}),document.body):null]});}function ek(e,t){return e>0&&e<.1?`<${.1.toLocaleString(t)}`:e.toLocaleString(t,{maximumFractionDigits:1});}function eb({session:e}){let t=function(e,_e$activeChat,_e$activeChat2,_d,_d2,_d$groundingScopeIden,_d3,_u$connectedScopes,_u,_u2,_u$localKnowledgeScop,_u3,_u4,_u5,_t$markdownSkill){var t,n,r,i,s,o,a,l,c;let u,d,h,p=(_e$activeChat=e.activeChat)===null||_e$activeChat===void 0?void 0:_e$activeChat.id,f=(_e$activeChat2=e.activeChat)===null||_e$activeChat2===void 0?void 0:_e$activeChat2.projectPath,m=e.selectedModel,g=(d=(t=e).activeChat,JSON.stringify([(_d=d)===null||_d===void 0?void 0:_d.id,(_d2=d)===null||_d2===void 0?void 0:_d2.projectPath,t.selectedModel,(_d$groundingScopeIden=(_d3=d)===null||_d3===void 0?void 0:_d3.groundingScopeIdentity)!==null&&_d$groundingScopeIden!==void 0?_d$groundingScopeIden:(u=t.activeChat,[(_u$connectedScopes=(_u=u)===null||_u===void 0?void 0:_u.connectedScopes)!==null&&_u$connectedScopes!==void 0?_u$connectedScopes:(_u2=u)===null||_u2===void 0?void 0:_u2.connectedScope,(_u$localKnowledgeScop=(_u3=u)===null||_u3===void 0?void 0:_u3.localKnowledgeScopes)!==null&&_u$localKnowledgeScop!==void 0?_u$localKnowledgeScop:(_u4=u)===null||_u4===void 0?void 0:_u4.localKnowledgeScope,(_u5=u)===null||_u5===void 0?void 0:_u5.gitChangeScopes]),(_t$markdownSkill=t.markdownSkill)===null||_t$markdownSkill===void 0||(_t$markdownSkill=_t$markdownSkill.view)===null||_t$markdownSkill===void 0?void 0:_t$markdownSkill.selection])),v=JSON.stringify([g,function(e){let t=e.models.find(t=>t.id===e.selectedModel);if(void 0===t)return[];let n=t.tokenAccounting;return[t.contextWindow,t.maxInputTokens,t.maxOutputTokens,t.contextWindowAssumed,t.contextWindowReported,n===null||n===void 0?void 0:n.source,n===null||n===void 0?void 0:n.counterId,n===null||n===void 0?void 0:n.scaleMilli,n===null||n===void 0?void 0:n.offsetTokens];}(e)]),k=e.sending||void 0!==e.regeneratingMessageId,x=(n=e.messages,(0,y.useMemo)(()=>JSON.stringify(n.map(e=>e.id)),[n])),[w,C]=(0,y.useState)({key:v,compacting:!1,error:!1}),[S,D]=(0,y.useState)(0),A=(h=(0,y.useRef)(null),(0,y.useEffect)(()=>()=>{var _h$current;(_h$current=h.current)!==null&&_h$current!==void 0&&_h$current.controller.abort(),h.current=null;},[]),h),E=(0,y.useRef)(g);E.current=g;let M=(0,y.useRef)(w.status);M.current=w.status;let N=(r=p,i=f,s=m,o=v,a=g,l=A,c=C,(0,y.useCallback)(async e=>{if(null!==l.current){if(!e)return;l.current.controller.abort(),l.current=null;}if(void 0===r||void 0===i||void 0===s)return;let t=new AbortController();l.current={controller:t,authorityKey:a,compact:e},e&&c(e=>{var t,n,r;return t=e,n=o,r=a,{key:n,status:t.key===n?t.status:void 0,compacting:!0,compactionAuthorityKey:r,error:!1};});let n=e?b.OF:b.ao;try{return await ex(n(r,i,s,t.signal),t,o,c,e);}finally{var _l$current;((_l$current=l.current)===null||_l$current===void 0?void 0:_l$current.controller)===t&&(l.current=null);}},[r,i,s,o,a,l,c])),_=w.compacting&&w.compactionAuthorityKey===g,T=w.key!==v&&_;return(0,y.useEffect)(()=>{var _M$current;var t,n,r;let i,s,o,a;if(e.loading)return;let l=(t=N,n=k,r=(_M$current=M.current)===null||_M$current===void 0?void 0:_M$current.estimatedInputTokens,s=!1,o=0,(a=async()=>{var e;let l=await t(!1);s||void 0===l||o>=6||(e=r,(!0===l.contextWindowProbePending||n&&(void 0===e||l.estimatedInputTokens===e))&&(r=l.estimatedInputTokens,i=setTimeout(()=>{a();},Math.min(1e3*2**o++,8e3))));})(),()=>{s=!0,clearTimeout(i);});return()=>{var _t,_t2;var e;let t;l(),e=E.current,t=A.current,(((_t=t)===null||_t===void 0?void 0:_t.compact)!==!0||t.authorityKey!==e)&&((_t2=t)!==null&&_t2!==void 0&&_t2.controller.abort(),A.current=null);};},[N,k,e.loading,x,S,T,A]),{state:w.key===v?w:{key:v,compacting:_,error:!1},busy:k,compact:()=>{k||_||N(!0);},retry:()=>{D(e=>e+1);}};}(e);return void 0===e.activeChat||void 0===e.selectedModel?null:(0,f.jsx)(ey,{status:t.state.status,busy:t.busy,compacting:t.state.compacting,error:t.state.error,onCompact:t.compact,onRetry:t.retry});}async function ex(e,t,n,r,i){try{let i=await e;if(t.signal.aborted)return;return r({key:n,status:i,compacting:!1,error:!1}),i;}catch(e){if(t.signal.aborted)return;(0,R.v)(i?"Keiko manual context compaction request failed.":"Keiko context status request failed.",{correlationId:(0,Z.E)(e),errorKind:(0,Q.J)(e),errorEvidence:(0,K.f)(e)}),r(e=>({...e,compacting:!1,error:!0}));return;}}var ew=e.i(32574),eC=e.i(70703),eS=e.i(69361),eD=e.i(10651);let eA=(0,eC.default)(()=>e.A(73334).then(e=>e.MarkdownSkillDialog),{loadableGenerated:{modules:[89750]},ssr:!1,loading:eS.f});function eE({skill:e,disabled:t,modelId:n}){let r=(0,m.a)(),[i,s]=(0,y.useState)(!1);return(e===null||e===void 0?void 0:e.chatId)===void 0?null:(0,f.jsxs)("div",{className:eD.default.cmpControls,children:[(0,f.jsx)("button",{type:"button",onClick:()=>s(!0),"aria-haspopup":"dialog",children:r("chat.skills.title")}),(0,f.jsx)(eM,{skill:e,disabled:t,onOpen:()=>s(!0)}),e.failed&&!0!==e.requireNoSkill?(0,f.jsx)("span",{role:"alert",children:r("chat.skills.requestError")}):null,i?(0,f.jsx)(eA,{modelId:n,skill:e,disabled:t,onClose:()=>s(!1)}):null]});}function eM({skill:e,disabled:t,onOpen:n}){var _e$view,_e$view2;let r=(0,m.a)(),i=(_e$view=e.view)===null||_e$view===void 0?void 0:_e$view.selection.skill;return i?(0,f.jsxs)("span",{className:eD.default.cmpChip,children:[(0,f.jsxs)("button",{type:"button",onClick:n,title:r("chat.skills.protected"),children:[(0,f.jsx)("span",{className:eD.default.cmpChipName,children:((_e$view2=e.view)===null||_e$view2===void 0?void 0:_e$view2.availability)==="available"?e.view.name:r("chat.skills.unavailable")}),(0,f.jsxs)("span",{className:eD.default.cmpRevision,children:[" · v",i.revision]})]}),(0,f.jsx)("button",{type:"button","aria-label":r("chat.skills.remove"),disabled:t||e.busy,onClick:()=>{e.select(null).catch(()=>void 0);},children:"×"})]}):null;}var eN=e.i(57269);let e_="keiko-conservative-content-v2";Object.freeze(["calibrated","fallback-estimated"]);let eT=(0,eN.f)({source:"fallback-estimated",counterId:e_}),eR=Object.freeze(["system-contract","user-task","active-plan","repo-evidence","tool-observations","working-memory","history-summary","verification-evidence"]);Object.freeze(["none","summarize-then-drop","drop-oldest","drop-lowest-score"]),(0,eN.f)({schemaVersion:"1",maxInputTokens:128e3,reservedOutputTokens:8e3,safetyMarginTokens:4e3,effectiveInputBudget:116e3,tokenEstimatorId:e_,tokenAccounting:eT}),new Set("{}[]()<>;:=+-*/%&|!?,.#`$@\\\"'"),"u"<typeof TextEncoder||new TextEncoder();var eI=e.i(83449);let ej={"system-contract":"context.lane.system","user-task":"context.lane.task","active-plan":"context.lane.plan","repo-evidence":"context.lane.repository","tool-observations":"context.lane.tools","working-memory":"context.lane.memory","history-summary":"context.lane.history","verification-evidence":"context.lane.verification"};function eF(e,t){return t("low"===e?"context.pressure.low":"moderate"===e?"context.pressure.moderate":"high"===e?"context.pressure.high":"context.pressure.exceeded");}function eO({laneCounts:e,locale:t}){let n=(0,m.a)(),r=eR.map(t=>[t,e[t]]).filter(([,e])=>e>0);return(0,f.jsx)(f.Fragment,{children:r.map(([e,r])=>(0,f.jsx)(G.t,{label:n(ej[e]),value:r.toLocaleString(t)},`lane-${e}`))});}function ez({contextSummary:e}){var t;let n,r=(0,w.X)(),i=(0,m.a)();return void 0===e?null:(0,f.jsxs)("details",{className:"ctx-status grounded-evidence-disclosure",children:[(0,f.jsxs)("summary",{className:"ctx-status-summary grounded-evidence-summary","aria-label":i("context.details.aria"),title:i("context.details.hint",{estimator:e_}),children:[(0,f.jsx)("span",{className:"grounded-evidence-summary-title",children:i("context.details.title")}),(0,f.jsx)("span",{className:"grounded-evidence-summary-meta",children:(t=e.laneCounts,n=eR.filter(e=>t[e]>0).length,[i("context.meta.tokens",{tokens:(0,eI.k)(e.totalEstimatedTokens)}),i("context.meta.pressure",{pressure:eF(e.budgetPressure,i)}),i("context.meta.lanes",{count:n.toLocaleString(r)}),i(e.compactionActive?"context.compaction.active":"context.compaction.inactive")].join(" · "))})]}),(0,f.jsx)("div",{className:"ctx-status-body grounded-evidence-body",children:(0,f.jsxs)("dl",{className:"ctx-status-dl grounded-context-pack-dl",children:[(0,f.jsx)(G.t,{label:i("context.metric.estimator"),value:e_}),(0,f.jsx)(G.t,{label:i("context.metric.assembledEstimate"),value:i("context.metric.tokensShort",{tokens:(0,eI.k)(e.totalEstimatedTokens)})}),(0,f.jsx)(G.t,{label:i("context.metric.budgetPressure"),value:eF(e.budgetPressure,i)}),(0,f.jsx)(eO,{laneCounts:e.laneCounts,locale:r}),(0,f.jsx)(G.t,{label:i("context.metric.compaction"),value:i(e.compactionActive?"context.compaction.active":"context.compaction.inactive")})]})})]});}var eB=e.i(20405),eP=e.i(60865),eL=e.i(93806),e$=e.i(64344);let eq=X.f.file,eV=X.f.close,eU=X.f.plus;function eW({attachment:e,onRemove:t}){let n=(0,m.a)()("attachment.remove",{name:e.name}),r=function(e,t=32){if(e.length<=t)return e;let n=e.lastIndexOf(".");if(n>0&&e.length-n<=8){let r=e.slice(n);return`${e.slice(0,t-r.length-1)}…${r}`;}return`${e.slice(0,t-1)}…`;}(e.name);return(0,f.jsxs)("li",{className:"attach-chip",children:["image"===e.kind&&void 0!==e.previewUrl?(0,f.jsx)("img",{src:e.previewUrl,alt:"",className:"attach-chip-thumb",width:40,height:40}):(0,f.jsx)("span",{className:"attach-chip-icon","aria-hidden":"true",children:(0,f.jsx)(eq,{size:16})}),(0,f.jsx)("span",{className:"attach-chip-name",title:e.name,children:r}),(0,f.jsx)("span",{className:"attach-chip-size",children:(0,eI.L)(e.sizeBytes)}),(0,f.jsx)("button",{type:"button",className:"attach-chip-remove","aria-label":n,onClick:()=>t(e.id),children:(0,f.jsx)(eV,{size:12})})]});}function eK({attachments:e,onRemove:t}){let n=(0,m.a)();return 0===e.length?null:(0,f.jsx)("ul",{className:"attach-strip",style:eP.d,"aria-label":n("attachment.pending"),children:e.map(e=>(0,f.jsx)(eW,{attachment:e,onRemove:t},e.id))});}function eH({enabled:e,onFiles:t}){let n=(0,m.a)(),[r,i]=(0,y.useState)(!1),[s,o]=(0,y.useState)(!1);(0,y.useEffect)(()=>{if(!e)return;let t=0,n=e=>{var _e$dataTransfer$types,_e$dataTransfer;Array.from((_e$dataTransfer$types=(_e$dataTransfer=e.dataTransfer)===null||_e$dataTransfer===void 0?void 0:_e$dataTransfer.types)!==null&&_e$dataTransfer$types!==void 0?_e$dataTransfer$types:[]).includes("Files")&&(t+=1,o(!0));},r=()=>{0===(t=Math.max(0,t-1))&&o(!1);},i=()=>{t=0,o(!1);};return window.addEventListener("dragenter",n),window.addEventListener("dragleave",r),window.addEventListener("drop",i),window.addEventListener("dragend",i),()=>{window.removeEventListener("dragenter",n),window.removeEventListener("dragleave",r),window.removeEventListener("drop",i),window.removeEventListener("dragend",i);};},[e]);let a=(0,y.useCallback)(t=>{e&&(t.preventDefault(),i(!0));},[e]),l=(0,y.useCallback)(()=>{i(!1);},[]),c=(0,y.useCallback)(n=>{if(n.preventDefault(),i(!1),!e)return;let r=Array.from(n.dataTransfer.files);r.length>0&&t(r);},[e,t]);return e?(0,f.jsx)("div",{className:"attach-drop-zone","data-dragover":r?"true":void 0,"data-active":s?"true":"false","aria-hidden":"true",onDragOver:a,onDragLeave:l,onDrop:c,children:(0,f.jsx)("span",{className:"attach-drop-hint",children:n("attachment.drop")})}):null;}function eJ({model:e,onFiles:t}){let n=(0,m.a)(),r=(0,y.useRef)(null),i=void 0!==e&&(e.supportsImageInput||e.supportsDocumentInput),s=function(e){if(void 0===e)return"";let t=[];return e.supportsImageInput&&t.push("image/*"),e.supportsDocumentInput&&t.push(".pdf,.txt,.md,.csv,.json,.yaml,.yml"),t.join(",");}(e),o=(0,y.useCallback)(()=>{var _r$current;i&&((_r$current=r.current)===null||_r$current===void 0?void 0:_r$current.click());},[i]),a=(0,y.useCallback)(()=>{var _r$current$files,_r$current2;let e=Array.from((_r$current$files=(_r$current2=r.current)===null||_r$current2===void 0?void 0:_r$current2.files)!==null&&_r$current$files!==void 0?_r$current$files:[]);e.length>0&&(t(e),null!==r.current&&(r.current.value=""));},[t]);return i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("input",{ref:r,type:"file",multiple:!0,accept:s,className:"sr-only",tabIndex:-1,"aria-hidden":"true",onChange:a}),(0,f.jsx)("button",{type:"button",className:"cmp-icon cmp-tip-start","aria-label":n("attachment.attachFile"),"data-tip":n("attachment.attachFile"),onClick:o,children:(0,f.jsx)(eU,{size:16})})]}):null;}function eG({reason:e,mimeType:t}){let n=(0,m.a)(),r=(0,m.a)();return void 0===e?null:(0,f.jsx)("div",{role:"alert",className:"attach-rejection-alert",children:function(e,t,n,r,_n){let i=t!==null&&t!==void 0?t:(e,t)=>{var _t$mime;switch(e){case"attachment.rejection.textOnly":return"The selected model can't accept this attachment type. Choose a model that supports images or documents.";case"attachment.rejection.unsupported":return`Unsupported file type${String((_t$mime=t===null||t===void 0?void 0:t.mime)!==null&&_t$mime!==void 0?_t$mime:"")}. Supported types: images (image/*), PDF, plain text, markdown, JSON, YAML.`;case"attachment.rejection.oversized":return"File is larger than the 8 MiB limit. Choose a smaller file or summarize the content as text.";case"attachment.rejection.empty":return"Empty file. Add a file with content to attach.";default:return e;}},s=void 0!==r&&r.length>0?`: ${r}`:"";switch(e){case"text-only-model":return i("attachment.rejection.textOnly");case"unsupported-type":return i("attachment.rejection.unsupported",{mime:s});case"oversized":return i("attachment.rejection.oversized");case"empty":return i("attachment.rejection.empty");case"delivery-refused":return(_n=n===null||n===void 0?void 0:n("attachment.rejection.deliveryRefused"))!==null&&_n!==void 0?_n:"The image could not be stored or authorized for delivery. Add it again and retry.";}}(e,n,r,t)});}let eZ=(0,y.memo)(function({documents:e}){let t=(0,m.a)();if(0===e.length)return null;let n=e.some(e=>e.truncated);return(0,f.jsxs)("div",{role:"note",className:"sent-docs-note","aria-label":t("attachment.docsContext"),children:[(0,f.jsx)("span",{className:"sent-docs-note-label",children:1===e.length?t("attachment.docContextLabel"):t("attachment.docsContextLabel")}),(0,f.jsx)("ul",{className:"sent-docs-note-list",children:e.map(e=>(0,f.jsxs)("li",{className:"sent-docs-note-item",children:[e.displayName,e.truncated?(0,f.jsx)("span",{className:"sent-docs-note-trunc",children:t("attachment.truncated")}):null]},e.id))}),n?(0,f.jsx)("span",{className:"sent-docs-note-hint",children:t("attachment.truncatedHint")}):null]});});function eQ({images:e}){let t=(0,m.a)();return 0===e.length?null:(0,f.jsxs)("div",{role:"note",className:"sent-docs-note","aria-label":t("attachment.imagesDelivered"),children:[(0,f.jsx)("span",{className:"sent-docs-note-label",children:t("attachment.imagesDelivered")}),(0,f.jsx)("ul",{className:"sent-docs-note-list",children:e.map(e=>(0,f.jsx)("li",{className:"sent-docs-note-item",children:e.displayName},e.id))})]});}let eY=X.f.spark;function eX(e){return"system"===e.role&&"string"==typeof e.runId;}function e0({message:e,onOpenResult:t}){var _e$workflowStatus,_ref,_e$workflowId;let n=(_e$workflowStatus=e.workflowStatus)!==null&&_e$workflowStatus!==void 0?_e$workflowStatus:"queued",r=(_ref=(_e$workflowId=e.workflowId)!==null&&_e$workflowId!==void 0?_e$workflowId:e.taskType)!==null&&_ref!==void 0?_ref:"workflow",i=void 0===e.runId?"":e.runId.slice(0,8),s=void 0===e.runId?void 0:`/api/evidence/${encodeURIComponent(e.runId)}`,[o,a]=(0,y.useState)(""),l=(0,y.useRef)(n);return(0,y.useEffect)(()=>{l.current!==n&&(l.current=n,a(`Workflow ${r}: ${n}`));},[n,r]),(0,f.jsxs)("article",{className:"run-summary-card","data-testid":"run-summary-card","data-status":n,"aria-label":`Workflow run ${r} - ${n}`,children:[(0,f.jsxs)("header",{className:"run-summary-card-head",children:[(0,f.jsx)(eY,{size:14,style:{color:"var(--accent)"}}),(0,f.jsx)("span",{className:"run-summary-card-workflow mono",children:r}),(0,f.jsx)("span",{className:"run-summary-card-status","data-status":n,children:n})]}),(0,f.jsxs)("div",{className:"run-summary-card-body",children:[(0,f.jsx)("p",{className:"run-summary-card-line",children:e.content}),void 0!==e.shortResult&&e.shortResult.length>0?(0,f.jsx)("p",{className:"run-summary-card-result",children:e.shortResult}):null,void 0!==e.runId?(0,f.jsxs)("p",{className:"run-summary-card-meta mono",children:["run"," ",(0,f.jsx)("span",{className:"run-summary-card-runshort","data-runid":e.runId,title:e.runId,children:i})]}):null,void 0!==e.runId?(0,f.jsxs)("div",{className:"run-summary-card-actions","aria-label":"Workflow result actions",children:[void 0!==t?(0,f.jsx)("button",{type:"button",className:"run-summary-card-action",onClick:()=>t(e),children:"Open result"}):null,void 0!==s?(0,f.jsx)("a",{className:"run-summary-card-action run-summary-card-action-secondary",href:s,target:"_blank",rel:"noreferrer",children:"Evidence"}):null]}):null]}),(0,f.jsx)("p",{className:"sr-only",role:"status","aria-live":"polite","data-testid":"run-summary-card-sr",children:o})]});}var e1=e.i(98729);e.i(87552);var e2=e.i(81056),e3=e.i(13493),e6=e.i(12541),e5=e.i(76826),e4=e.i(84832),e9=e.i(61287),e8=e.i(82178);let e7=Array.from({length:64},(e,t)=>6*t+3);function te({controller:e,visible:t=!0}){let n=(0,e9.f)(),r=t&&"recording"===e.phase&&e.micReady,i=function(e,t){let n=(0,y.useRef)(0);n.current=Number.isFinite(e)?Math.min(1,Math.max(0,e)):0;let[r,i]=(0,y.useState)(()=>Array(64).fill(0));return(0,y.useEffect)(()=>{if(i(Array(64).fill(0)),!t)return;let e=setInterval(()=>{i(e=>[...e.slice(1),n.current]);},80);return()=>clearInterval(e);},[t]),r;}(e.audioLevel,r),s=n("requesting"===e.phase?"voice.dictation.starting":"finalizing"===e.phase?"voice.dictation.finishing":"transcribing"===e.phase?"voice.dictation.transcribing":e.micReady?e.heardSpeech?"voice.dictation.capturing":"voice.dictation.listening":"voice.dictation.preparingMic");return t&&e.busy?(0,f.jsx)("div",{className:e8.default.cmpWaveform,"data-recording":r,role:"status","aria-live":"polite",children:r?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"sr-only",children:s}),(0,f.jsx)("svg",{viewBox:"0 0 384 32",preserveAspectRatio:"none","aria-hidden":"true",children:e7.map((e,t)=>{var _i$t;let n=(_i$t=i[t])!==null&&_i$t!==void 0?_i$t:0;return(0,f.jsx)("line",{x1:e,x2:e,y1:15-13*n,y2:17+13*n,vectorEffect:"non-scaling-stroke"},e);})})]}):(0,f.jsx)("span",{className:e8.default.cmpStatus,children:s})}):null;}var tt=e.i(18829),tn=e.i(29673),tr=e.i(31317);let ti=["preparing","speaking","paused"],ts=["interrupted","canceled","failed","complete"];function to(e){return ti.includes(e);}function ta(e){return ts.includes(e);}function tl(e){switch(e){case"unavailable":return;case"preparing":case"complete":return"idle";case"speaking":return"playing";case"paused":return"paused";case"interrupted":return"interrupted";case"canceled":case"failed":return"stopped";default:throw Error(`unhandled voice playback phase: ${JSON.stringify(e)}`);}}function tc(){return{now:()=>performance.now()};}tr.Z;let tu={prepare:e=>e.playbackAllowed,"play-started":e=>e.playbackAllowed,pause:e=>e.playbackAllowed,resume:e=>e.playbackAllowed,interrupt:e=>e.interruptAllowed,stop:e=>e.playbackAllowed,fail:e=>e.playbackAllowed,complete:e=>e.playbackAllowed,replay:e=>e.playbackAllowed&&e.replayAllowed,"set-muted":e=>e.playbackAllowed};function td(e){return{phase:"unavailable",muted:!1,spoke:!1,interruptions:0,replays:0,failureKind:void 0,lastInterruptAtMs:void 0,lastTransitionAtMs:void 0};}async function th(e){null!==e.body&&(await e.body.cancel().catch(()=>{}));}async function tp(e){var _e$headers$get,_e$body;if(((_e$headers$get=e.headers.get("content-type"))===null||_e$headers$get===void 0||(_e$headers$get=_e$headers$get.split(";",1)[0])===null||_e$headers$get===void 0?void 0:_e$headers$get.trim())!=="audio/pcm"){var _e$headers$get2;await th(e),(0,R.v)("[keiko] assistant speech switched to buffered playback",{kind:"voice-dialogue",voiceDialogueStage:"playback-fallback",correlationId:(_e$headers$get2=e.headers.get(T.p))!==null&&_e$headers$get2!==void 0?_e$headers$get2:void 0});return;}return(_e$body=e.body)!==null&&_e$body!==void 0?_e$body:void 0;}class tf extends Error{}async function tm(e){try{await e.resume();}catch{window.reportError(Error("Assistant speech audio context resume failed."));}}function tg(){let e,t,n;if(!("u">typeof AudioContext&&"u">typeof AudioWorkletNode))return;async function r(e,t,n){try{return await(0,b.S1)(e,t,n);}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return"cancelled";return(0,R.v)("[keiko] assistant speech stream failed; using buffered playback",{kind:"voice-playback",correlationId:(0,Z.E)(e)}),"fallback";}}let i=0,s=0,o=new WeakMap();function a(e){let t=o.get(e);if(void 0!==t)return t;let n=e.close().catch(()=>{window.reportError(Error("Assistant speech audio context cleanup failed."));});return o.set(e,n),n;}function l(e){var _e$port$close,_e$port;e!==null&&e!==void 0&&e.port.postMessage(null),void 0!==e&&(e.port.onmessage=null),e===null||e===void 0||(_e$port$close=(_e$port=e.port).close)===null||_e$port$close===void 0?void 0:_e$port$close.call(_e$port);try{e===null||e===void 0||e.disconnect();}catch{}}function c(t,n){return e===t&&s===n;}async function u(n,r){let i;try{if(await n.audioWorklet.addModule("/keiko-playback-worklet.js"),!c(n,r)||((i=new AudioWorkletNode(n,"keiko-playback",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[1]})).connect(n.destination),!c(n,r)))throw new tf();return t=i,{context:n,generation:r,node:i};}catch(r){throw t!==i&&l(i),e===n&&(e=void 0),await a(n),r;}}function d(){let t;if(void 0!==e)return{context:e,generation:s};try{t=new AudioContext({sampleRate:24e3});}catch{return;}return e=t,{context:t,generation:s};}async function h(){if(void 0!==t&&void 0!==e)return{context:e,generation:s,node:t};if(void 0!==n)return n;let r=d();if(void 0===r)throw Error("Assistant speech audio context is unavailable.");let i=u(r.context,r.generation);n=i;try{return await i;}finally{n===i&&(n=void 0);}}function p(){let r=t,o=e;s+=1,n=void 0,t=void 0,e=void 0,i=0,l(r),void 0!==o&&a(o);}function f(e,n){return!n.aborted&&c(e.context,e.generation)&&t===e.node;}async function m(e,t,n,r){let i,s=t.getReader(),o=0;try{for(;;){let{done:t,value:r}=await s.read();if(t)break;if(n.aborted)return void(await s.cancel());let{samples:a,leftover:l}=function(e,t){let n=e;if(void 0!==t&&t.length>0){let r=new Uint8Array(t.length+e.length);r.set(t),r.set(e,t.length),n=r;}let r=n.length-n.length%2,i=r<n.length?n.slice(r):void 0,s=new Int16Array(r/2),o=new DataView(n.buffer,n.byteOffset,r);for(let e=0;e<s.length;e+=1)s[e]=o.getInt16(2*e,!0);return{samples:s,leftover:i};}(r,i);i=l,a.length>0&&(o+=a.length,e.port.postMessage(a,[a.buffer]));}0===o?r.onError():e.port.postMessage({type:"end"});}catch{n.aborted||r.onError();}}return{primeFromUserGesture(){let e=d();void 0!==e&&(tm(e.context),h().catch(()=>{}));},async play(e,t,n,s){let o;try{o=await h();}catch(e){if(t.aborted||e instanceof tf)return!0;return!1;}if(!f(o,t))return!0;i=0;let a=!1;tm(o.context);let l=o.node;l.port.postMessage({type:"config",primeFrames:2400}),l.port.onmessage=e=>{var _t$frames;let t=e.data;"position"===t.type?(i=(_t$frames=t.frames)!==null&&_t$frames!==void 0?_t$frames:i,a||(a=!0,n.onStart())):"ended"===t.type&&n.onEnded();};let c=await r(e,t,s);if("cancelled"===c)return!0;if("fallback"===c)return!1;if(!f(o,t))return await th(c),!0;let u=await tp(c);return f(o,t)?void 0!==u&&(m(l,u,t,n),!0):(await th(c),!0);},stop(){p();},positionMs(){if(void 0!==t&&0!==i)return Math.round(i/24e3*1e3);},dispose(){p();}};}function tv(e){return(t,n,r)=>(0,b.R8)(void 0===e?{text:t}:{text:t,persona:e},n,r);}function ty(){return new Audio();}function tk(e){return URL.createObjectURL(e);}function tb(e){URL.revokeObjectURL(e);}function tx(e){return e instanceof DOMException&&"AbortError"===e.name;}var tw=e.i(37448),tC=e.i(64268),tS=e.i(28269);let tD=tr.$.signalingMs;class tA extends Error{constructor(e,t){super(t),_defineProperty(this,"reason",void 0),this.reason=e,this.name="VoiceControlError";}}var tE=e.i(79274);let tM={disabled:"none",idle:"none",listening:"user",thinking:"assistant",speaking:"assistant",interrupted:"none",yielding:"none",recovering:"none"},tN={"user-speech-start":e=>e.canCaptureUserVoice,"user-end-of-turn":e=>e.canCaptureUserVoice,"dictation-commit":e=>e.usesManualCommit,"dictation-discard":e=>e.usesManualCommit,"assistant-speech-start":e=>e.playbackAllowed,"assistant-speech-end":e=>e.playbackAllowed,"user-interrupt":e=>e.interruptAllowed,backchannel:e=>e.floorControl&&e.playbackAllowed,"provider-failure":()=>!0,"permission-denied":()=>!0,recovered:()=>!0,"session-closed":()=>!0};function t_(e){return{state:"none"===e?"disabled":"idle",turnIndex:0,interruptions:0,backchannels:0,pendingCommit:!1,lastEndOfTurnAtMs:void 0,lastInterruptAtMs:void 0,lastTransitionAtMs:void 0};}var tT=e.i(81046);let tR=/[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD\u{10100}-\u{10102}\u{10137}-\u{1013F}\u{10179}-\u{10189}\u{1018C}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FC}\u{1039F}\u{103D0}\u{1056F}\u{10857}\u{10877}\u{10878}\u{1091F}\u{1093F}\u{10A50}-\u{10A58}\u{10A7F}\u{10AC8}\u{10AF0}-\u{10AF6}\u{10B39}-\u{10B3F}\u{10B99}-\u{10B9C}\u{10D6E}\u{10D8E}\u{10D8F}\u{10EAD}\u{10ED0}-\u{10ED8}\u{10F55}-\u{10F59}\u{10F86}-\u{10F89}\u{11047}-\u{1104D}\u{110BB}\u{110BC}\u{110BE}-\u{110C1}\u{11140}-\u{11143}\u{11174}\u{11175}\u{111C5}-\u{111C8}\u{111CD}\u{111DB}\u{111DD}-\u{111DF}\u{11238}-\u{1123D}\u{112A9}\u{113D4}\u{113D5}\u{113D7}\u{113D8}\u{1144B}-\u{1144F}\u{1145A}\u{1145B}\u{1145D}\u{114C6}\u{115C1}-\u{115D7}\u{11641}-\u{11643}\u{11660}-\u{1166C}\u{116B9}\u{1173C}-\u{1173F}\u{1183B}\u{11944}-\u{11946}\u{119E2}\u{11A3F}-\u{11A46}\u{11A9A}-\u{11A9C}\u{11A9E}-\u{11AA2}\u{11B00}-\u{11B09}\u{11BE1}\u{11C41}-\u{11C45}\u{11C70}\u{11C71}\u{11EF7}\u{11EF8}\u{11F43}-\u{11F4F}\u{11FD5}-\u{11FF1}\u{11FFF}\u{12470}-\u{12474}\u{12FF1}\u{12FF2}\u{16A6E}\u{16A6F}\u{16AF5}\u{16B37}-\u{16B3F}\u{16B44}\u{16B45}\u{16D6D}-\u{16D6F}\u{16E97}-\u{16E9A}\u{16FE2}\u{1BC9C}\u{1BC9F}\u{1CC00}-\u{1CCEF}\u{1CCFA}-\u{1CCFC}\u{1CD00}-\u{1CEB3}\u{1CEBA}-\u{1CED0}\u{1CEE0}-\u{1CEF0}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D164}\u{1D16A}-\u{1D16C}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1EA}\u{1D200}-\u{1D241}\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1E14F}\u{1E2FF}\u{1E5FF}\u{1E95E}\u{1E95F}\u{1ECAC}\u{1ECB0}\u{1ED2E}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F10D}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D8}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F8D0}-\u{1F8D8}\u{1F900}-\u{1FA57}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBEF}\u{1FBFA}]/u,tI=/[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19\u{10107}-\u{10133}\u{10140}-\u{10178}\u{1018A}\u{1018B}\u{102E1}-\u{102FB}\u{10320}-\u{10323}\u{10341}\u{1034A}\u{103D1}-\u{103D5}\u{104A0}-\u{104A9}\u{10858}-\u{1085F}\u{10879}-\u{1087F}\u{108A7}-\u{108AF}\u{108FB}-\u{108FF}\u{10916}-\u{1091B}\u{109BC}\u{109BD}\u{109C0}-\u{109CF}\u{109D2}-\u{109FF}\u{10A40}-\u{10A48}\u{10A7D}\u{10A7E}\u{10A9D}-\u{10A9F}\u{10AEB}-\u{10AEF}\u{10B58}-\u{10B5F}\u{10B78}-\u{10B7F}\u{10BA9}-\u{10BAF}\u{10CFA}-\u{10CFF}\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}\u{10F1D}-\u{10F26}\u{10F51}-\u{10F54}\u{10FC5}-\u{10FCB}\u{11052}-\u{1106F}\u{110F0}-\u{110F9}\u{11136}-\u{1113F}\u{111D0}-\u{111D9}\u{111E1}-\u{111F4}\u{112F0}-\u{112F9}\u{11450}-\u{11459}\u{114D0}-\u{114D9}\u{11650}-\u{11659}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11730}-\u{1173B}\u{118E0}-\u{118F2}\u{11950}-\u{11959}\u{11BF0}-\u{11BF9}\u{11C50}-\u{11C6C}\u{11D50}-\u{11D59}\u{11DA0}-\u{11DA9}\u{11DE0}-\u{11DE9}\u{11F50}-\u{11F59}\u{11FC0}-\u{11FD4}\u{12400}-\u{1246E}\u{16130}-\u{16139}\u{16A60}-\u{16A69}\u{16AC0}-\u{16AC9}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16D70}-\u{16D79}\u{16E80}-\u{16E96}\u{16FF4}-\u{16FF6}\u{1CCF0}-\u{1CCF9}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D7CE}-\u{1D7FF}\u{1E140}-\u{1E149}\u{1E2F0}-\u{1E2F9}\u{1E4F0}-\u{1E4F9}\u{1E5F1}-\u{1E5FA}\u{1E8C7}-\u{1E8CF}\u{1E950}-\u{1E959}\u{1EC71}-\u{1ECAB}\u{1ECAD}-\u{1ECAF}\u{1ECB1}-\u{1ECB4}\u{1ED01}-\u{1ED2D}\u{1ED2F}-\u{1ED3D}\u{1F100}-\u{1F10C}\u{1FBF0}-\u{1FBF9}]/u,tj=/(?:[_:.#/\\-]|[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0296-\u02AF\u0300-\u036F\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u0483-\u0489\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u10D0-\u10FA\u10FD-\u10FF\u135D-\u135F\u13F8-\u13FD\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1C80-\u1C88\u1C8A\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1DC0-\u1DFF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u20D0-\u20F0\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5F\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE-\u2CF1\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA66F-\uA672\uA674-\uA67D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA69E\uA69F\uA6F0\uA6F1\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C1\uA7C3\uA7C8\uA7CA\uA7CD\uA7CF\uA7D1\uA7D3\uA7D5\uA7D7\uA7D9\uA7DB\uA7F6\uA7FA\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uABE3-\uABEA\uABEC\uABED\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF41-\uFF5A\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10428}-\u{1044F}\u{104D8}-\u{104FB}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10CC0}-\u{10CF2}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10D70}-\u{10D85}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{118C0}-\u{118DF}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11B60}-\u{11B67}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16E60}-\u{16E7F}\u{16EBB}-\u{16ED3}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1D41A}-\u{1D433}\u{1D44E}-\u{1D454}\u{1D456}-\u{1D467}\u{1D482}-\u{1D49B}\u{1D4B6}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D4CF}\u{1D4EA}-\u{1D503}\u{1D51E}-\u{1D537}\u{1D552}-\u{1D56B}\u{1D586}-\u{1D59F}\u{1D5BA}-\u{1D5D3}\u{1D5EE}-\u{1D607}\u{1D622}-\u{1D63B}\u{1D656}-\u{1D66F}\u{1D68A}-\u{1D6A5}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6E1}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D71B}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D755}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D78F}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7C9}\u{1D7CB}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF09}\u{1DF0B}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E922}-\u{1E94A}\u{E0100}-\u{E01EF}][A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C89\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7CB\uA7CC\uA7CE\uA7D0\uA7D2\uA7D4\uA7D6\uA7D8\uA7DA\uA7DC\uA7F5\uFF21-\uFF3A\u{10400}-\u{10427}\u{104B0}-\u{104D3}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10C80}-\u{10CB2}\u{10D50}-\u{10D65}\u{118A0}-\u{118BF}\u{16E40}-\u{16E5F}\u{16EA0}-\u{16EB8}\u{1D400}-\u{1D419}\u{1D434}-\u{1D44D}\u{1D468}-\u{1D481}\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B5}\u{1D4D0}-\u{1D4E9}\u{1D504}\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D538}\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D56C}-\u{1D585}\u{1D5A0}-\u{1D5B9}\u{1D5D4}-\u{1D5ED}\u{1D608}-\u{1D621}\u{1D63C}-\u{1D655}\u{1D670}-\u{1D689}\u{1D6A8}-\u{1D6C0}\u{1D6E2}-\u{1D6FA}\u{1D71C}-\u{1D734}\u{1D756}-\u{1D76E}\u{1D790}-\u{1D7A8}\u{1D7CA}\u{1E900}-\u{1E921}]|^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C89\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7CB\uA7CC\uA7CE\uA7D0\uA7D2\uA7D4\uA7D6\uA7D8\uA7DA\uA7DC\uA7F5\uFF21-\uFF3A\u{10400}-\u{10427}\u{104B0}-\u{104D3}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10C80}-\u{10CB2}\u{10D50}-\u{10D65}\u{118A0}-\u{118BF}\u{16E40}-\u{16E5F}\u{16EA0}-\u{16EB8}\u{1D400}-\u{1D419}\u{1D434}-\u{1D44D}\u{1D468}-\u{1D481}\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B5}\u{1D4D0}-\u{1D4E9}\u{1D504}\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D538}\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D56C}-\u{1D585}\u{1D5A0}-\u{1D5B9}\u{1D5D4}-\u{1D5ED}\u{1D608}-\u{1D621}\u{1D63C}-\u{1D655}\u{1D670}-\u{1D689}\u{1D6A8}-\u{1D6C0}\u{1D6E2}-\u{1D6FA}\u{1D71C}-\u{1D734}\u{1D756}-\u{1D76E}\u{1D790}-\u{1D7A8}\u{1D7CA}\u{1E900}-\u{1E921}]{2,}$)/u,tF=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C89\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7CB\uA7CC\uA7CE\uA7D0\uA7D2\uA7D4\uA7D6\uA7D8\uA7DA\uA7DC\uA7F5\uFF21-\uFF3A\u{10400}-\u{10427}\u{104B0}-\u{104D3}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10C80}-\u{10CB2}\u{10D50}-\u{10D65}\u{118A0}-\u{118BF}\u{16E40}-\u{16E5F}\u{16EA0}-\u{16EB8}\u{1D400}-\u{1D419}\u{1D434}-\u{1D44D}\u{1D468}-\u{1D481}\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B5}\u{1D4D0}-\u{1D4E9}\u{1D504}\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D538}\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D56C}-\u{1D585}\u{1D5A0}-\u{1D5B9}\u{1D5D4}-\u{1D5ED}\u{1D608}-\u{1D621}\u{1D63C}-\u{1D655}\u{1D670}-\u{1D689}\u{1D6A8}-\u{1D6C0}\u{1D6E2}-\u{1D6FA}\u{1D71C}-\u{1D734}\u{1D756}-\u{1D76E}\u{1D790}-\u{1D7A8}\u{1D7CA}\u{1E900}-\u{1E921}]['\x2D\.A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u0870-\u0887\u0889-\u088F\u0897-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5C\u0C5D\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0-\u0CE3\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1715\u171F-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u180F\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B4C\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2019\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10940}-\u{10959}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D27}\u{10D4A}-\u{10D65}\u{10D69}-\u{10D6D}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EAB}\u{10EAC}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10EFA}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F50}\u{10F70}-\u{10F85}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11000}-\u{11046}\u{11070}-\u{11075}\u{1107F}-\u{110BA}\u{110C2}\u{110D0}-\u{110E8}\u{11100}-\u{11134}\u{11144}-\u{11147}\u{11150}-\u{11173}\u{11176}\u{11180}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{11237}\u{1123E}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112EA}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D3}\u{113E1}\u{113E2}\u{11400}-\u{1144A}\u{1145E}-\u{11461}\u{11480}-\u{114C5}\u{114C7}\u{11580}-\u{115B5}\u{115B8}-\u{115C0}\u{115D8}-\u{115DD}\u{11600}-\u{11640}\u{11644}\u{11680}-\u{116B8}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11740}-\u{11746}\u{11800}-\u{1183A}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11943}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E1}\u{119E3}\u{119E4}\u{11A00}-\u{11A3E}\u{11A47}\u{11A50}-\u{11A99}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11B60}-\u{11B67}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C40}\u{11C72}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DB0}-\u{11DDB}\u{11EE0}-\u{11EF6}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13440}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1612F}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF4}\u{16B00}-\u{16B36}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FE4}\u{16FF0}-\u{16FF3}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2EF}\u{1E4D0}-\u{1E4EF}\u{1E5D0}-\u{1E5F0}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6F5}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E8D0}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{E0100}-\u{E01EF}]{2,}$/u,tO=/[.!?\u2026]["'\)\]\}\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63]*$/u,tz={balanced:()=>({type:"server_vad",threshold:.5,prefix_padding_ms:300,silence_duration_ms:500}),headset:()=>({type:"server_vad",threshold:.4,prefix_padding_ms:200,silence_duration_ms:420}),laptop:()=>({type:"server_vad",threshold:.55,prefix_padding_ms:300,silence_duration_ms:620}),noisy:()=>({type:"server_vad",threshold:.66,prefix_padding_ms:300,silence_duration_ms:760}),semantic:()=>({type:"semantic_vad",eagerness:"low"})},tB={phase:"idle",errorReason:void 0,errorMessage:void 0};function tP(e,t){switch(t.type){case"requesting":return{...tB,phase:"requesting"};case"negotiating":return{...tB,phase:"negotiating"};case"connected":return{...tB,phase:"connected"};case"error":return{...tB,phase:"error",errorReason:t.reason,errorMessage:t.message};case"reset":return tB;}}function tL(e){let t=[...e],n=0,r=t.length;for(;n<r&&tR.test((_t$n=t[n])!==null&&_t$n!==void 0?_t$n:"");){var _t$n;n+=1;}for(;r>n&&tR.test((_t3=t[r-1])!==null&&_t3!==void 0?_t3:"");){var _t3;r-=1;}return t.slice(n,r).join("");}function t$(e){return tL(e).normalize("NFC").toLowerCase();}function tq(e,t){let n=t$(e);return n.length>0&&n===t$(t);}function tV(e,t){let n=tH(e!==null&&e!==void 0?e:""),r=tH(t);if(0===n.length)return r;if(0===r.length)return n;let i=n.split(" "),s=r.split(" "),o=function(e,t){if(tO.test(e.join(" ")))return 0;let n=Math.min(e.length,t.length,8);for(let r=n;r>=2;r-=1){let n=e.length-r;if(t.slice(0,r).every((t,r)=>{var _e2;return tq((_e2=e[n+r])!==null&&_e2!==void 0?_e2:"",t);}))return r;}let r=e.at(-1),i=t[0];return void 0!==r&&void 0!==i&&function(e,t){if(!tq(e,t))return!1;let n=tL(e),r=tL(t),i=t$(e);return tI.test(i)||tj.test(n)||tj.test(r)||tF.test(n)&&tF.test(r);}(r,i)?1:0;}(i,s);return`${n} ${s.slice(o).join(" ")}`.trimEnd();}function tU(){return{answerApplied:!1,rtcConnected:!1,dataChannelOpen:!1,sessionUpdated:!1,warmupComplete:!1,requiresDataChannelAck:!0};}function tW(){let e=new Uint32Array(4);return globalThis.crypto.getRandomValues(e),[...e].map(e=>e.toString(16).padStart(8,"0")).join("");}function tK(e){return e instanceof e5.b||e instanceof tA?{reason:e.reason,message:e.message}:{reason:"connection-failed",message:"Real-time voice could not be started."};}function tH(e){return e.replace(/\s+/gu," ").trim();}var tJ=e.i(69243);function tG(e,t,n,r,i){(0,R.v)(`[keiko] batch voice dialogue (stage=${e})`,{kind:"voice-dialogue",voiceDialogueStage:e,...(void 0===r?{}:{voiceCaptureReason:r}),...(void 0===i?{}:{voiceCaptureError:i}),...(void 0===n?{}:{parentCorrelationId:n}),...(void 0===t?{}:{correlationId:t})});}function tZ(e,t){return e.active&&e.generation===t;}function tQ(e,t,n,r,i){e.generation+=1,e.active=t,e.expectedAnswerId=void 0,e.expectedAnswerCorrelationId=void 0,e.sessionCorrelationId=t?crypto.randomUUID():void 0,n(!1),r(void 0),i(void 0);}async function tY(e){try{if(await e.prepare(),!tZ(e.flagsRef.current,e.generation))return;e.preparedRef.current=!0,e.setPreparing(!1),e.startDictation();}catch{if(!tZ(e.flagsRef.current,e.generation))return;e.setPreparing(!1),e.setStartupError("Voice could not be prepared. Try again."),tG("preparation-failed",e.flagsRef.current.sessionCorrelationId);}}function tX(e){return"requesting"===e||"recording"===e||"finalizing"===e||"transcribing"===e;}function t0({action:e,onAccept:t,onReject:n}){let r=(0,e9.f)(),[i,s]=(0,y.useState)(null),[o,a]=(0,y.useState)(),l=(0,y.useCallback)((t,n)=>{void 0!==n&&null===i&&(s(t),a(void 0),n(e.proposalId).catch(e=>{a(e instanceof Error?e.message:r("voice.realtime.memory.updateFailed"));}).finally(()=>s(null)));},[e.proposalId,i,r]);return(0,f.jsxs)("div",{className:"cmp-voice-memory-candidate",children:[(0,f.jsx)("span",{className:"cmp-voice-memory-candidate-text",children:e.body}),(0,f.jsxs)("div",{className:"cmp-voice-memory-actions",children:[(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn cmp-voice-btn-primary","aria-busy":"accept"===i,"aria-disabled":null!==i||void 0===t,onClick:()=>l("accept",t),children:r("memoria.approve")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn","aria-busy":"reject"===i,"aria-disabled":null!==i||void 0===n,onClick:()=>l("reject",n),children:r("memoria.reject")})]}),void 0!==o?(0,f.jsx)("span",{className:"cmp-voice-memory-error",children:o}):null]});}function t1({memoryContextText:e,memoryContextCount:t,memoryActions:n,onAcceptMemoryCandidate:r,onRejectMemoryCandidate:i}){var _n$filter;let s=(0,e9.f)(),o=void 0!==e&&e.trim().length>0,a=void 0!==t&&t>0?s(1===t?"voice.realtime.memory.one":"voice.realtime.memory.many",{count:t}):o?s("voice.realtime.memory.contextActive"):null,l=(_n$filter=n===null||n===void 0?void 0:n.filter(e=>"candidate"===e.kind&&"proposed"===e.status))!==null&&_n$filter!==void 0?_n$filter:[];return null===a&&0===l.length?null:(0,f.jsxs)("div",{className:"cmp-voice-memory","aria-label":s("voice.realtime.memory.region"),children:[null!==a?(0,f.jsx)("span",{className:"cmp-voice-memory-summary",children:a}):null,l.map(e=>(0,f.jsx)(t0,{action:e,onAccept:r,onReject:i},e.proposalId))]});}function t2({phase:e,error:t,onRetry:n,onDismiss:r,memoryContextText:i,memoryContextCount:s,memoryActions:o,onAcceptMemoryCandidate:a,onRejectMemoryCandidate:l}){let c=(0,e9.f)(),u=(0,y.useRef)(null);return((0,y.useEffect)(()=>{var _u$current;"error"===e&&((_u$current=u.current)===null||_u$current===void 0?void 0:_u$current.focus());},[e]),"negotiating"===e)?(0,f.jsxs)("div",{className:"cmp-voice-preview",role:"status","aria-live":"polite",children:[(0,f.jsx)("span",{className:"cmp-loading-dot","aria-hidden":"true"}),c("voice.realtime.connecting")]}):"connected"===e?(0,f.jsxs)("section",{className:"cmp-voice-preview","aria-label":c("voice.realtime.status"),children:[(0,f.jsxs)("div",{className:"cmp-voice-connected-line",role:"status","aria-live":"polite",children:[(0,f.jsx)("span",{className:"cmp-voice-dot","aria-hidden":"true"}),c("voice.realtime.connected")]}),(0,f.jsx)(t1,{memoryContextText:i,memoryContextCount:s,memoryActions:o,onAcceptMemoryCandidate:a,onRejectMemoryCandidate:l})]}):"error"===e&&void 0!==t?(0,f.jsxs)("div",{className:"cmp-voice-preview cmp-voice-error",role:"alert","aria-atomic":"true",children:[(0,f.jsx)("p",{className:"cmp-voice-error-text",children:function(e,t){switch(e){case"permission-denied":return t("voice.realtime.error.permission");case"no-microphone":return t("voice.error.noMicrophone");case"unsupported":return t("voice.realtime.error.unsupported");case"unavailable":return t("voice.realtime.error.unavailable");case"negotiation-failed":return t("voice.realtime.error.negotiationFailed");case"connection-failed":return t("voice.realtime.error.connectionFailed");}}(t.reason,c)}),(0,f.jsx)("p",{className:"cmp-voice-error-text",children:t.message}),(0,f.jsxs)("div",{className:"cmp-voice-actions",children:[(0,f.jsx)("button",{type:"button",ref:u,className:"cmp-voice-btn",onClick:n,children:c("common.tryAgain")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",onClick:r,children:c("common.dismiss")})]})]}):null;}function t3({controller:e,onAfterDismiss:t,memoryContextText:n,memoryContextCount:r,memoryActions:i,onAcceptMemoryCandidate:s,onRejectMemoryCandidate:o}){return(0,f.jsx)(t2,{phase:e.phase,error:e.error,onRetry:e.retry,memoryContextText:n,memoryContextCount:r,memoryActions:i,onAcceptMemoryCandidate:s,onRejectMemoryCandidate:o,onDismiss:()=>{e.stop(),t();}});}X.f.close,X.f.mic;var t6=e.i(18138);let t5=new Map();function t4(e){if("number"==typeof e)return Number.isInteger(e)&&e>0?e:void 0;let t=e.trim();if(null===/^(?:\[(\d+)\]|【(\d+)】|[(\d+)]|(\d+))$/u.exec(t))return;let n=Number.parseInt(t.replace(/^[\u005B【[]/u,"").replace(/[\u005D】]]$/u,""),10);return Number.isInteger(n)&&n>0?n:void 0;}function t9(e,t,n){let r=t4(n.marker);return`${e}:${t}:${String(r!==null&&r!==void 0?r:n.marker)}:${n.stableId}`;}function t8(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),r;}let t7={ready:"Voice dialogue is ready.",preparing:"Preparing the voice dialogue…",reconnecting:"Reconnecting the voice dialogue…",listening:"Listening to you.",thinking:"The assistant is thinking.","checking-sources":"Checking connected sources…",speaking:"The assistant is speaking.",muted:"Voice dialogue microphone is muted.",interrupted:"Voice dialogue interrupted.",error:"Voice dialogue could not continue. You can keep chatting in text."};var ne=e.i(13271),nt=e.i(95973),nn=e.i(14674),nr=e.i(10644),ni=e.i(64798);function ns(e){return"capsule"===e.kind?`capsule:${e.capsuleId}`:`set:${e.capsuleSetId}`;}function no(e){let{label:t,t:n}=e,{busy:r,disconnectRef:i,handleDisconnect:s}=function({chat:e,scope:t,allScopes:n,onDisconnect:r,updateScopes:i,setError:s,t:o}){let[a,l]=(0,y.useState)(!1),c=(0,y.useRef)(null),u=ns(t);async function d(){if(a)return;s(null),l(!0);let t=c.current,d=t===null||t===void 0?void 0:t.closest(".chat-scope-header");try{let t=n.filter(e=>ns(e)!==u),s=await(0,x.C)(e,t.length>0?t:null,i,r);r===null||r===void 0||r(s.chat);}catch(e){s((0,O.A)(e,o("localKnowledge.scopePill.disconnectError")));}finally{l(!1),(0,nn.a)(d,t);}}return{busy:a,disconnectRef:c,handleDisconnect:d};}(e),o=n("localKnowledge.scopePill.disconnect",{label:t});return(0,f.jsx)("span",{className:`scope-pill-wrap ${B.default.cmpPillWrap}`,children:(0,f.jsxs)("span",{className:"scope-pill scope-pill--connector",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"◆"}),(0,f.jsx)("span",{"aria-label":t,children:t}),(0,f.jsx)("button",{type:"button",ref:i,className:"scope-pill-disconnect","aria-disabled":r,"aria-label":o,title:o,onClick:()=>{s();},children:(0,f.jsx)("span",{"aria-hidden":"true",children:"×"})})]})});}function na({announcement:e}){return(0,f.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","data-testid":"connector-scope-announcer",children:e});}function nl({chat:e,onDisconnect:t,updateScopes:n=b.WQ,labels:r=new Map(),labelsSettled:i=!0}){let s=(0,nr.u)(),{error:o,setError:a}=(0,ni.u)(e),l=(0,M.r)(e),c=l.map(e=>ns(e)).join(" "),[u,d]=(0,y.useState)(""),h=(0,y.useRef)(c);(0,y.useEffect)(()=>{if(h.current!==c){var e;h.current=c,d((e=l.length,0===e?s("localKnowledge.scopePill.removed"):1===e?s("localKnowledge.scopePill.updated.one"):s("localKnowledge.scopePill.updated.other",{count:e})));}},[c,l.length,s]);let p=(0,f.jsx)(na,{announcement:u});return 0===l.length?(0,ni.k)(u,p,o):(0,f.jsxs)("span",{className:"scope-pill-group scope-pill-group--connector",children:[p,(0,f.jsx)(ni.L,{error:o}),l.map(o=>(0,f.jsx)(no,{chat:e,scope:o,allScopes:l,onDisconnect:t,updateScopes:n,setError:a,label:function(e,t,n,r){let i=t.get(ns(e));if(void 0!==i&&i.length>0)return i;let s="capsule"===e.kind;return r(n?s?"localKnowledge.picker.unavailablePod":"localKnowledge.picker.unavailableSet":s?"localKnowledge.scopePill.pendingPod":"localKnowledge.scopePill.pendingSet");}(o,r,i,s),t:s},ns(o)))]});}var nc=e.i(56049),nu=e.i(2268),nd=e.i(92902);function nh(e){this.content=e;}function np(e){return e>=56320&&e<57344;}function nf(e){return e>=55296&&e<56320;}nh.prototype={constructor:nh,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1;},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1];},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new nh(s);},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new nh(n);},addToStart:function(e,t){return new nh([e,t].concat(this.remove(e).content));},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new nh(n);},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(-1==s?i.length:s,0,t,n),new nh(i);},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1]);},prepend:function(e){return(e=nh.from(e)).size?new nh(e.content.concat(this.subtract(e).content)):this;},append:function(e){return(e=nh.from(e)).size?new nh(this.subtract(e).content.concat(e.content)):this;},subtract:function(e){var t=this;e=nh.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t;},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n;}),e;},get size(){return this.content.length>>1;}},nh.from=function(e){if(e instanceof nh)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new nh(t);};class nm{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize;}nodesBetween(e,t,n,r=0,i){for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;if(l>e&&!1!==n(a,r+o,i||null,s)&&a.content.size){let i=o+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i);}o=l;}}descendants(e){this.nodesBetween(0,this.size,e);}textBetween(e,t,n,r){let i="",s=!0;return this.nodesBetween(e,t,(o,a)=>{let l=o.isText?o.text.slice(Math.max(e,a)-a,t-a):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&l||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=l;},0),i;}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new nm(r,this.size+e.size);}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,s=0;s<t;i++){let o=this.content[i],a=s+o.nodeSize;a>e&&((s<e||a>t)&&(o=o.isText?o.cut(Math.max(0,e-s),Math.min(o.text.length,t-s)):o.cut(Math.max(0,e-s-1),Math.min(o.content.size,t-s-1))),n.push(o),r+=o.nodeSize),s=a;}return new nm(n,r);}cutByIndex(e,t){return e==t?nm.empty:0==e&&t==this.content.length?this:new nm(this.content.slice(e,t));}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new nm(r,i);}addToStart(e){return new nm([e].concat(this.content),this.size+e.nodeSize);}addToEnd(e){return new nm(this.content.concat(e),this.size+e.nodeSize);}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0;}get firstChild(){return this.content.length?this.content[0]:null;}get lastChild(){return this.content.length?this.content[this.content.length-1]:null;}get childCount(){return this.content.length;}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t;}maybeChild(e){return this.content[e]||null;}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize;}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let s=t.child(i),o=n.child(i);if(s==o){r+=s.nodeSize;continue;}if(!s.sameMarkup(o))return r;if(s.isText&&s.text!=o.text){let e=s.text,t=o.text,n=0;for(;e[n]==t[n];n++)r++;return n&&n<e.length&&n<t.length&&nf(e.charCodeAt(n-1))&&np(e.charCodeAt(n))&&r--,r;}if(s.content.size||o.content.size){let t=e(s.content,o.content,r+1);if(null!=t)return t;}r+=s.nodeSize;}}(this,e,t);}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let s=t.childCount,o=n.childCount;;){if(0==s||0==o)return s==o?null:{a:r,b:i};let a=t.child(--s),l=n.child(--o),c=a.nodeSize;if(a==l){r-=c,i-=c;continue;}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let e=a.text,t=l.text,n=e.length,s=t.length;for(;n>0&&s>0&&e[n-1]==t[s-1];)n--,s--,r--,i--;return n&&s&&n<e.length&&nf(e.charCodeAt(n-1))&&np(e.charCodeAt(n))&&(r++,i++),{a:r,b:i};}if(a.content.size||l.content.size){let t=e(a.content,l.content,r-1,i-1);if(t)return t;}r-=c,i-=c;}}(this,e,t,n);}findIndex(e){if(0==e)return nv(0,e);if(e==this.size)return nv(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return nv(t+1,r);return nv(t,n);}n=r;}}toString(){return"<"+this.toStringInner()+">";}toStringInner(){return this.content.join(", ");}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null;}static fromJSON(e,t){if(!t)return nm.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return nm.fromArray(t.map(e.nodeFromJSON));}static fromArray(e){if(!e.length)return nm.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i);}return new nm(t||e,n);}static from(e){if(!e)return nm.empty;if(e instanceof nm)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new nm([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""));}}nm.empty=new nm([],0);let ng={index:0,offset:0};function nv(e,t){return ng.index=e,ng.offset=t,ng;}function ny(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!ny(e[n],t[n]))return!1;}else{for(let n in e)if(!(n in t)||!ny(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1;}return!0;}class nk{constructor(e,t){this.type=e,this.attrs=t;}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i);}}return t||(t=e.slice()),n||t.push(this),t;}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e;}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1;}eq(e){return this==e||this.type==e.type&&ny(this.attrs,e.attrs);}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break;}return e;}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs);}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0;}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return nk.none;if(e instanceof nk)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t;}}nk.none=[];class nb extends Error{}class nx{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n;}get size(){return this.content.size-this.openStart-this.openEnd;}insertAt(e,t){let n=function e(t,n,r,i,s,o){let{index:a,offset:l}=t.findIndex(n),c=t.maybeChild(a);if(l==n||c.isText)return o&&i<=0&&s<=0&&!o.canReplace(a,a,r)?null:t.cut(0,n).append(r).append(t.cut(n));let u=e(c.content,n-l-1,r,0==a?i-1:0,a==t.childCount-1?s-1:0,c);return u&&t.replaceChild(a,c.copy(u));}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new nx(n,this.openStart,this.openEnd);}removeBetween(e,t){return new nx(function e(t,n,r){let{index:i,offset:s}=t.findIndex(n),o=t.maybeChild(i),{index:a,offset:l}=t.findIndex(r);if(s==n||o.isText){if(l!=r&&!t.child(a).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r));}if(i!=a)throw RangeError("Removing non-flat range");return t.replaceChild(i,o.copy(e(o.content,n-s-1,r-s-1)));}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd);}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd;}toString(){return this.content+"("+this.openStart+","+this.openEnd+")";}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e;}static fromJSON(e,t){if(!t)return nx.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new nx(nm.fromJSON(e,t.content),n,r);}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new nx(e,n,r);}}function nw(e,t){if(!t.type.compatibleContent(e.type))throw new nb("Cannot join "+t.type.name+" onto "+e.type.name);}function nC(e,t,n){let r=e.node(n);return nw(r,t.node(n)),r;}function nS(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e);}function nD(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(nS(e.nodeAfter,r),s++));for(let e=s;e<o;e++)nS(i.child(e),r);t&&t.depth==n&&t.textOffset&&nS(t.nodeBefore,r);}function nA(e,t){if(!e.type.validContent(t))throw new nb("Invalid content for node "+e.type.name);return e.copy(t);}function nE(e,t,n){let r=[];return nD(null,e,n,r),e.depth>n&&nS(nA(nC(e,t,n+1),nE(e,t,n+1)),r),nD(t,null,n,r),new nm(r);}nx.empty=new nx(nm.empty,0,0);class nM{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1;}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e;}get parent(){return this.node(this.depth);}get doc(){return this.node(0);}node(e){return this.path[3*this.resolveDepth(e)];}index(e){return this.path[3*this.resolveDepth(e)+1];}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0);}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1;}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size;}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1];}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize;}get textOffset(){return this.pos-this.path[this.path.length-1];}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r;}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1);}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r;}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return nk.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e;}let i=n.marks;for(var s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i;}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n;}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0;}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new nR(this,e,n);return null;}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset;}max(e){return e.pos>this.pos?e:this;}min(e){return e.pos<this.pos?e:this;}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset;}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:s}=t.content.findIndex(i),o=i-s;if(n.push(t,e,r+s),!o||(t=t.child(e)).isText)break;i=o-1,r+=s+1;}return new nM(t,n,i);}static resolveCached(e,t){let n=nT.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r;}else nT.set(e,n=new nN());let r=n.elts[n.i]=nM.resolve(e,t);return n.i=(n.i+1)%n_,r;}}class nN{constructor(){this.elts=[],this.i=0;}}let n_=12,nT=new WeakMap();class nR{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n;}get start(){return this.$from.before(this.depth+1);}get end(){return this.$to.after(this.depth+1);}get parent(){return this.$from.node(this.depth);}get startIndex(){return this.$from.index(this.depth);}get endIndex(){return this.$to.indexAfter(this.depth);}}let nI=Object.create(null);class nj{constructor(e,t,n,r=nk.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||nm.empty;}get children(){return this.content.content;}get nodeSize(){return this.isLeaf?1:2+this.content.size;}get childCount(){return this.content.childCount;}child(e){return this.content.child(e);}maybeChild(e){return this.content.maybeChild(e);}forEach(e){this.content.forEach(e);}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this);}descendants(e){this.nodesBetween(0,this.content.size,e);}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"");}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r);}get firstChild(){return this.content.firstChild;}get lastChild(){return this.content.lastChild;}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content);}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks);}hasMarkup(e,t,n){return this.type==e&&ny(this.attrs,t||e.defaultAttrs||nI)&&nk.sameSet(this.marks,n||nk.none);}copy(e=null){return e==this.content?this:new nj(this.type,this.attrs,e,this.marks);}mark(e){return e==this.marks?this:new nj(this.type,this.attrs,this.content,e);}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t));}slice(e,t=this.content.size,n=!1){if(e==t)return nx.empty;let r=this.resolve(e),i=this.resolve(t),s=n?0:r.sharedDepth(t),o=r.start(s);return new nx(r.node(s).content.cut(r.pos-o,i.pos-o),r.depth-s,i.depth-s);}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new nb("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new nb("Inconsistent open depths");return function e(t,n,r,i){let s=t.index(i),o=t.node(i);if(s==n.index(i)&&i<t.depth-r.openStart){let a=e(t,n,r,i+1);return o.copy(o.content.replaceChild(s,a));}if(!r.content.size)return nA(o,nE(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(nm.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)};}(r,t);return nA(o,function e(t,n,r,i,s){let o=t.depth>s&&nC(t,n,s+1),a=i.depth>s&&nC(r,i,s+1),l=[];return nD(null,t,s,l),o&&a&&n.index(s)==r.index(s)?(nw(o,a),nS(nA(o,e(t,n,r,i,s+1)),l)):(o&&nS(nA(o,nE(t,n,s+1)),l),nD(n,r,s,l),a&&nS(nA(a,nE(r,i,s+1)),l)),nD(i,null,s,l),new nm(l);}(t,e,s,n,i));}{let e=t.parent,i=e.content;return nA(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)));}}(r,i,n,0);}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1;}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n};}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize};}resolve(e){return nM.resolveCached(this,e);}resolveNoCache(e){return nM.resolve(this,e);}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r;}get isBlock(){return this.type.isBlock;}get isTextblock(){return this.type.isTextblock;}get inlineContent(){return this.type.inlineContent;}get isInline(){return this.type.isInline;}get isText(){return this.type.isText;}get isLeaf(){return this.type.isLeaf;}get isAtom(){return this.type.isAtom;}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),nO(this.marks,e);}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t;}canReplace(e,t,n=nm.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),o=s&&s.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0;}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),s=i&&i.matchFragment(this.content,t);return!!s&&s.validEnd;}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type);}check(){this.type.checkContent(this.content),nz(this.type.attrs,this.attrs,"node",this.type.name);let e=nk.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];nz(n.type.attrs,n.attrs,"mark",n.type.name),e=n.addToSet(e);}if(!nk.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check());}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break;}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e;}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON);}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n);}let r=nm.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n);}}nj.prototype.text=void 0;class nF extends nj{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n;}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nO(this.marks,JSON.stringify(this.text));}get textContent(){return this.text;}textBetween(e,t){return this.text.slice(e,t);}get nodeSize(){return this.text.length;}mark(e){return e==this.marks?this:new nF(this.type,this.attrs,this.text,e);}withText(e){return e==this.text?this:new nF(this.type,this.attrs,e,this.marks);}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t));}eq(e){return this.sameMarkup(e)&&this.text==e.text;}toJSON(){let e=super.toJSON();return e.text=this.text,e;}}function nO(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t;}function nz(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n]);}class nB{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[];}static parse(e,t){var n;let r,i=new nP(e,t);if(null==i.next)return nB.empty;let s=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n;}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r);}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i;}(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e};}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=nL(e),r=n;return e.eat(",")&&(r="}"!=e.next?nL(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t};}(t,n);else break;return n;}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n};}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n};}(i);i.next&&i.err("Unexpected trailing text");let o=(n=function(e){let t=[[]];return i(function e(t,s){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,s)),[]);if("seq"==t.type)for(let r=0;;r++){let o=e(t.exprs[r],s);if(r==t.exprs.length-1)return o;i(o,s=n());}else if("star"==t.type){let o=n();return r(s,o),i(e(t.expr,o),o),[r(o)];}else if("plus"==t.type){let o=n();return i(e(t.expr,s),o),i(e(t.expr,o),o),[r(o)];}else if("opt"==t.type)return[r(s)].concat(e(t.expr,s));else if("range"==t.type){let o=s;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,o),r),o=r;}if(-1==t.max)i(e(t.expr,o),o);else for(let s=t.min;s<t.max;s++){let s=n();r(o,s),i(e(t.expr,o),s),o=s;}return[r(o)];}else if("name"==t.type)return[r(s,void 0,t.value)];else throw Error("Unknown expr type");}(e,0),n()),t;function n(){return t.push([])-1;}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i;}function i(e,t){e.forEach(e=>e.to=t);}}(s),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);nq(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t);});}});});let s=r[t.join(",")]=new nB(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(n$);s.next.push({type:i[t][0],next:r[n.join(",")]||e(n)});}return s;}(nq(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,s=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];s.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(o)&&r.push(o);}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)");}}(o,i),o;}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null;}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r;}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline;}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t;}return null;}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1;}fillBefore(e,t=!1,n=0){let r=[this];return function i(s,o){let a=s.matchFragment(e,n);if(a&&(!t||a.validEnd))return nm.from(o.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,o.concat(t));if(e)return e;}}return null;}(this,[]);}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t;}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse();}for(let e=0;e<i.next.length;e++){let{type:s,next:o}=i.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in t||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),t[s.name]=!0);}}return null;}get edgeCount(){return this.next.length;}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e];}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next);}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r;}).join("\n");}}nB.empty=new nB(!0);class nP{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift();}get next(){return this.tokens[this.pos];}eat(e){return this.next==e&&(this.pos++||!0);}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')");}}function nL(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t;}function n$(e,t){return t-e;}function nq(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:s}=i[e];r||-1!=n.indexOf(s)||t(s);}}(t),n.sort(n$);}function nV(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default;}return t;}function nU(e,t){let n=Object.create(null);for(let r in e){let i=e[r],s=t&&t[r];if(void 0===s){if(i.hasDefault)s=i.default;else throw RangeError("No value supplied for attribute "+r);}else i.validate&&i.validate(s);n[r]=s;}return n;}function nW(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new nH(e,r,t[r]);return n;}class nK{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=nW(e,n.attrs),this.defaultAttrs=nV(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e;}get isInline(){return!this.isBlock;}get isTextblock(){return this.isBlock&&this.inlineContent;}get isLeaf(){return this.contentMatch==nB.empty;}get isAtom(){return this.isLeaf||!!this.spec.atom;}isInGroup(e){return this.groups.indexOf(e)>-1;}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal");}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1;}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch);}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:nU(this.attrs,e);}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new nj(this,this.computeAttrs(e),nm.from(t),nk.setFrom(n));}createChecked(e=null,t,n){return t=nm.from(t),this.checkContent(t),new nj(this,this.computeAttrs(e),t,nk.setFrom(n));}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=nm.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t);}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(nm.empty,!0);return i?new nj(this,e,t.append(i),nk.setFrom(n)):null;}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0;}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`);}checkAttrs(e){}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1;}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0;}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:nk.none:e;}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new nK(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n;}}class nH{constructor(e,t,n){let r;this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?(r=n.validate.split("|"),n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`);}):n.validate;}get isRequired(){return!this.hasDefault;}}class nJ{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=nW(e,r.attrs),this.excluded=null;let i=nV(this.attrs);this.instance=i?new nk(this,i):null;}create(e=null){return!e&&this.instance?this.instance:new nk(this,nU(this.attrs,e));}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new nJ(e,r++,t,i)),n;}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e;}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t];}excludes(e){return this.excluded.indexOf(e)>-1;}}class nG{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=nh.from(e.nodes),t.marks=nh.from(e.marks||{}),this.nodes=nK.compile(this.spec.nodes,this),this.marks=nJ.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=nB.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t;}t.markSet="_"==i?null:i?nZ(this,i.split(" ")):""!=i&&t.inlineContent?null:[];}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:nZ(this,n.split(" "));}this.nodeFromJSON=e=>nj.fromJSON(this,e),this.markFromJSON=e=>nk.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null);}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof nK){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")");}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r);}text(e,t){let n=this.nodes.text;return new nF(n,n.defaultAttrs,e,nk.setFrom(t));}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t);}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t;}}function nZ(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=r);}if(!o)throw SyntaxError("Unknown mark type: '"+t[r]+"'");}return n;}class nQ{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e);}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n);});}parse(e,t={}){let n=new n3(this,t,!1);return n.addAll(e,nk.none,t.from,t.to),n.finish();}parseSlice(e,t={}){let n=new n3(this,t,!0);return n.addAll(e,nk.none,t.from,t.to),nx.maxOpen(n.finish());}matchTag(e,t,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){var r,i;let n=this.tags[s];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0;}return n;}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],s=r.style;if(0==s.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(s.length>e.length)||61==s.charCodeAt(e.length)&&s.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0;}return r;}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break;}t.splice(r,0,e);}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=n6(e)),e.mark||e.ignore||e.clearMark||(e.mark=t);});}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=n6(e)),e.node||e.ignore||e.mark||(e.node=t);});}return t;}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nQ(e,nQ.schemaRules(e)));}}let nY={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nX={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},n0={ol:!0,ul:!0};function n1(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n;}class n2{constructor(e,t,n,r,i,s){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=nk.none,this.match=i||(4&s?null:e.contentMatch);}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(nm.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null;}}return this.match.findWrapping(e.type);}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)));}let t=nm.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(nm.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t;}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!nY.hasOwnProperty(e.parentNode.nodeName.toLowerCase());}}class n3{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,s=n1(null,t.preserveWhitespace,0)|4*!!n;i=r?new n2(r.type,r.attrs,nk.none,!0,t.topMatch||r.type.contentMatch,s):n?new n2(null,null,nk.none,!0,null,s):new n2(e.schema.topNodeType,null,nk.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1;}get top(){return this.nodes[this.open];}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t);}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i){if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(s.text(e[n]),t,!/\S/.test(e[n]));n="";}else n=n.replace(/\r?\n|\r/g," ");}else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1));}n&&this.insertNode(s.text(n),t,!/\S/.test(n)),this.findInText(e);}else this.findInside(e);}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;n0.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&n0.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null);}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(a?a.ignore:nX.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(nY.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e;}let o=a&&a.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r;}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?o:void 0);}this.localPreserveWS=r;}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t);}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0);}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break;}}return t;}addElementByRule(e,t,n,r){let i,s;if(t.node){if((s=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(s.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(s,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e);}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs));}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1);}i&&this.sync(o)&&this.open--;}addAll(e,t,n,r){let i=n||0;for(let s=n?e.childNodes[n]:e.firstChild,o=null==r?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,t);this.findAtPoint(e,i);}findPlace(e,t,n){let r,i;for(let t=this.open,s=0;t>=0;t--){let o=this.nodes[t],a=o.findWrapping(e);if(a&&(!r||r.length>a.length+s)&&(r=a,i=o,!a.length))break;if(o.solid){if(n)break;s+=2;}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t;}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t));}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=nk.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):n5(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0;}return!1;}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i;}enterInner(e,t,n,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=n1(e,i,s.options);4&s.options&&0==s.content.length&&(o|=4);let a=nk.none;return n=n.filter(t=>(s.type?!s.type.allowsMarkType(t.type):!n5(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new n2(e,t,a,r,null,o)),this.open++,n;}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1;}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen));}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1;}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++;}return e;}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos);}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos);}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos);}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset));}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,s=(e,o)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;o>=i;o--)if(s(e-1,o))return!0;return!1;}{let e=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;o--;}}return!0;};return s(t.length-1,this.open);}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n;}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t;}}}function n6(e){let t={};for(let n in e)t[n]=e[n];return t;}function n5(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=e=>{s.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>s.indexOf(i)&&o(i))return!0;}};if(o(i.contentMatch))return!0;}}class n4{constructor(e,t){this.nodes=e,this.marks=t;}serializeFragment(e,t={},n){n||(n=n8(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,s=0;for(;n<i.length&&s<e.marks.length;){let t=e.marks[s];if(!this.marks[t.type.name]){s++;continue;}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,s++;}for(;n<i.length;)r=i.pop()[1];for(;s<e.marks.length;){let n=e.marks[s++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom);}}r.appendChild(this.serializeNodeInner(e,t));}),n;}serializeNodeInner(e,t){if(e.isText)return n8(t).createTextNode(e.text);let{dom:n,contentDOM:r}=re(n8(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r);}return n;}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom);}return n;}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&re(n8(n),r(e,t),null,e.attrs);}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:re(e,t,n,r);}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new n4(this.nodesFromSchema(e),this.marksFromSchema(e)));}static nodesFromSchema(e){let t=n9(e.nodes);return t.text||(t.text=e=>e.text),t;}static marksFromSchema(e){return n9(e.marks);}}function n9(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r);}return t;}function n8(e){return e.document||window.document;}let n7=new WeakMap();function re(e,t,n,r){let i,s,o;if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let a=t[0],l;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(s=n7.get(r))&&n7.set(r,(o=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t)){if("string"==typeof t[0])o||(o=[]),o.push(t);else for(let n=0;n<t.length;n++)e(t[n]);}else for(let n in t)e(t[n]);}(r),s=o)),l=s)&&l.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=a.indexOf(" ");c>0&&(n=a.slice(0,c),a=a.slice(c+1));let u=n?e.createElementNS(n,a):e.createElement(a),d=t[1],h=1;if(d&&"object"==typeof d&&null==d.nodeType&&!Array.isArray(d)){for(let e in h=2,d)if(null!=d[e]){let t=e.indexOf(" ");t>0?u.setAttributeNS(e.slice(0,t),e.slice(t+1),d[e]):"style"==e&&u.style?u.style.cssText=d[e]:u.setAttribute(e,d[e]);}}for(let s=h;s<t.length;s++){let o=t[s];if(0===o){if(s<t.length-1||s>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u};}if("string"==typeof o)u.appendChild(e.createTextNode(o));else{let{dom:t,contentDOM:s}=re(e,o,n,r);if(u.appendChild(t),s){if(i)throw RangeError("Multiple content holes");i=s;}}}return{dom:u,contentDOM:i};}class rt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n;}get deleted(){return(8&this.delInfo)>0;}get deletedBefore(){return(5&this.delInfo)>0;}get deletedAfter(){return(6&this.delInfo)>0;}get deletedAcross(){return(4&this.delInfo)>0;}}class rn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&rn.empty)return rn.empty;}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536;}mapResult(e,t=1){return this._map(e,t,!1);}map(e,t=1){return this._map(e,t,!0);}_map(e,t,n){let r=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[o+i],c=this.ranges[o+s],u=a+l;if(e<=u){let i=l?e==a?-1:e==u?1:t:t,s=a+r+(i<0?0:c);if(n)return s;let d=e==(t<0?a:u)?null:o/3+(e-a)*65536,h=0;return l&&(h|=e==a?2:e==u?1:4,(t<0?e!=a:e!=u)&&(h|=8)),new rt(s,h,d);}r+=c-l;}return n?e+r:new rt(e+r,0,null);}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,s=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let a=this.ranges[t+i];if(e<=o+a&&t==3*r)return!0;n+=this.ranges[t+s]-a;}return!1;}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let s=this.ranges[r],o=s-(this.inverted?i:0),a=s+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(o,o+l,a,a+c),i+=c-l;}}invert(){return new rn(this.ranges,!this.inverted);}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges);}static offset(e){return 0==e?rn.empty:new rn(e<0?[0,-e,0]:[0,0,e]);}}rn.empty=new rn([]);class rr{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t);}get maps(){return this._maps;}slice(e=0,t=this.maps.length){return new rr(this._maps,this.mirror,e,t);}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t);}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0);}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)];}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t);}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0);}}invert(){let e=new rr();return e.appendMappingInverted(this),e;}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e;}mapResult(e,t=1){return this._map(e,t,!1);}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue;}}r|=i.delInfo,e=i.pos;}return n?e:new rt(e,r,null);}}let ri=Object.create(null);class rs{getMap(){return rn.empty;}merge(e){return null;}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=ri[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t);}static jsonID(e,t){if(e in ri)throw RangeError("Duplicate use of step JSON ID "+e);return ri[e]=t,t.prototype.jsonID=e,t;}}class ro{constructor(e,t){this.doc=e,this.failed=t;}static ok(e){return new ro(e,null);}static fail(e){return new ro(null,e);}static fromReplace(e,t,n,r){try{return ro.ok(e.replace(t,n,r));}catch(e){if(e instanceof nb)return ro.fail(e.message);throw e;}}}function ra(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(ra(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s);}return nm.fromArray(r);}class rl extends rs{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n;}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new nx(ra(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return ro.fromReplace(e,this.from,this.to,i);}invert(){return new rc(this.from,this.to,this.mark);}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new rl(t.pos,n.pos,this.mark);}merge(e){return e instanceof rl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null;}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to};}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new rl(t.from,t.to,e.markFromJSON(t.mark));}}rs.jsonID("addMark",rl);class rc extends rs{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n;}apply(e){let t=e.slice(this.from,this.to),n=new nx(ra(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ro.fromReplace(e,this.from,this.to,n);}invert(){return new rl(this.from,this.to,this.mark);}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new rc(t.pos,n.pos,this.mark);}merge(e){return e instanceof rc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null;}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to};}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rc(t.from,t.to,e.markFromJSON(t.mark));}}rs.jsonID("removeMark",rc);class ru extends rs{constructor(e,t){super(),this.pos=e,this.mark=t;}apply(e){let t=e.nodeAt(this.pos);if(!t)return ro.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ro.fromReplace(e,this.pos,this.pos+1,new nx(nm.from(n),0,+!t.isLeaf));}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new ru(this.pos,t.marks[n]);return new ru(this.pos,this.mark);}}return new rd(this.pos,this.mark);}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ru(t.pos,this.mark);}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()};}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ru(t.pos,e.markFromJSON(t.mark));}}rs.jsonID("addNodeMark",ru);class rd extends rs{constructor(e,t){super(),this.pos=e,this.mark=t;}apply(e){let t=e.nodeAt(this.pos);if(!t)return ro.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ro.fromReplace(e,this.pos,this.pos+1,new nx(nm.from(n),0,+!t.isLeaf));}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ru(this.pos,this.mark):this;}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rd(t.pos,this.mark);}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()};}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new rd(t.pos,e.markFromJSON(t.mark));}}rs.jsonID("removeNodeMark",rd);class rh extends rs{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r;}apply(e){return this.structure&&rf(e,this.from,this.to)?ro.fail("Structure replace would overwrite content"):ro.fromReplace(e,this.from,this.to,this.slice);}getMap(){return new rn([this.from,this.to-this.from,this.slice.size]);}invert(e){return new rh(this.from,this.from+this.slice.size,e.slice(this.from,this.to));}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&rh.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new rh(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure);}merge(e){if(!(e instanceof rh)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?nx.empty:new nx(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rh(e.from,this.to,t,this.structure);}{let t=this.slice.size+e.slice.size==0?nx.empty:new nx(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rh(this.from,this.to+(e.to-e.from),t,this.structure);}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e;}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new rh(t.from,t.to,nx.fromJSON(e,t.slice),!!t.structure);}}rh.MAP_BIAS=1,rs.jsonID("replace",rh);class rp extends rs{constructor(e,t,n,r,i,s,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=s,this.structure=o;}apply(e){if(this.structure&&(rf(e,this.from,this.gapFrom)||rf(e,this.gapTo,this.to)))return ro.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ro.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?ro.fromReplace(e,this.from,this.to,n):ro.fail("Content does not fit in gap");}getMap(){return new rn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert]);}invert(e){let t=this.gapTo-this.gapFrom;return new rp(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure);}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new rp(t.pos,n.pos,r,i,this.slice,this.insert,this.structure);}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e;}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new rp(t.from,t.to,t.gapFrom,t.gapTo,nx.fromJSON(e,t.slice),t.insert,!!t.structure);}}function rf(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let e=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--;}}return!1;}function rm(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),o=[],a=t+1;for(let t=0;t<s.childCount;t++){let l=s.child(t),c=a+l.nodeSize,u=r.matchType(l.type);if(u){r=u;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new rc(a,c,l.marks[t]));if(i&&l.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(l.text);)r||(r=new nx(nm.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),o.push(new rh(a+e.index,a+e.index+e[0].length,r));}}else o.push(new rh(a,c,nx.empty));a=c;}if(!r.validEnd){let t=r.fillBefore(nm.empty,!0);e.replace(a,a,new nx(t,0,0));}for(let t=o.length-1;t>=0;t--)e.step(o[t]);}function rg(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let s=e.$from.node(n),o=e.$from.index(n)+r,a=e.$to.indexAfter(n)-i;if(n<e.depth&&s.canReplace(o,a,t))return n;if(0==n||s.type.spec.isolating||!((0==o||s.canReplace(o,s.childCount))&&(a==s.childCount||s.canReplace(0,a))))break;o&&(r=1),a<s.childCount&&(i=1);}return null;}function rv(e){return{type:e,attrs:null};}function ry(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let i=e.mapping.slice(r).map(n+1+s+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create());}}});}function rk(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+s);e.replaceWith(i,i+1,t.type.schema.text("\n"));}});}function rb(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>s;e--,t--){let n=i.node(e),s=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(s,n.childCount),a=r&&r[t+1];a&&(o=o.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(s+1,n.childCount)||!l.type.validContent(o))return!1;}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type);}function rx(e,t){var n,r;let i=e.resolve(t),s=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let s=t.child(i),o=s.type==r?e.type.schema.nodes.text:s.type;if(!(n=n.matchType(o))||!e.type.allowsMarks(s.marks))return!1;}return n.validEnd;}(n,r))&&i.parent.canReplace(s,s+1);}function rw(e,t,n=t,r=nx.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return rC(i,s,r)?new rh(t,n,r):new rS(i,s,r).fit();}function rC(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content);}rs.jsonID("replaceAround",rp);class rS{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=nm.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))});}for(let t=e.depth;t>0;t--)this.placed=nm.from(e.node(t).copy(this.placed));}get depth(){return this.frontier.length-1;}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode();}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,s=n.depth,o=r.depth;for(;s&&o&&1==i.childCount;)i=i.firstChild.content,s--,o--;let a=new nx(i,s,o);return e>-1?new rp(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new rh(n.pos,r.pos,a):null;}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break;}t=i.content;}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=rE(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:s,match:o}=this.frontier[i],a,l=null;if(1==t&&(r?o.matchType(r.type)||(l=o.fillBefore(nm.from(r),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:l};if(2==t&&r&&(a=o.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:a};if(e&&o.matchType(e.type))break;}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return!(rN(e,-1)<=t)&&(this.unplaced.size>1&&rN(e,1)>n&&n++,this.unplaced=new nx(e,t+1,n),!0);}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=rE(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new nx(rD(e,t-1,1),t-1,i?t-1:n);}else this.unplaced=new nx(rD(e,t,1),t,n);}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let s=this.unplaced,o=n?n.content:s.content,a=s.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r);}let h=o.size+e-(s.content.size-s.openEnd);for(;l<o.childCount;){let e=o.child(l),t=u.matchType(e.type);if(!t)break;(++l>1||0==a||e.content.size)&&(u=t,c.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(nm.empty,!0)))),t.copy(i);}(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==o.childCount?h:-1)));}let p=l==o.childCount;p||(h=-1),this.placed=rA(this.placed,t,nm.from(c)),this.frontier[t].match=u,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content;}this.unplaced=p?0==e?nx.empty:new nx(rD(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new nx(rD(s.content,e,l),s.openStart,s.openEnd);}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!rM(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r;}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=rM(e,t,r,n,i);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=rM(e,n,r,t,!0);if(!i||i.childCount)continue t;}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e};}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=rA(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r);}return e;}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=rA(this.placed,this.depth,nm.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch});}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(nm.empty,!0);e.childCount&&(this.placed=rA(this.placed,this.frontier.length,e));}}function rD(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(rD(e.firstChild.content,t-1,n)));}function rA(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(rA(e.lastChild.content,t-1,n)));}function rE(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e;}function rM(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1;}(n,s.content,o)?a:null;}function rN(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content;}}function r_(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i);}return n;}class rT extends rs{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n;}apply(e){let t=e.nodeAt(this.pos);if(!t)return ro.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return ro.fromReplace(e,this.pos,this.pos+1,new nx(nm.from(r),0,+!t.isLeaf));}getMap(){return rn.empty;}invert(e){return new rT(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr]);}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rT(t.pos,this.attr,this.value);}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value};}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new rT(t.pos,t.attr,t.value);}}rs.jsonID("attr",rT);class rR extends rs{constructor(e,t){super(),this.attr=e,this.value=t;}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return ro.ok(n);}getMap(){return rn.empty;}invert(e){return new rR(this.attr,e.attrs[this.attr]);}map(e){return this;}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value};}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new rR(t.attr,t.value);}}rs.jsonID("docAttr",rR);let rI=class extends Error{};(rI=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n;}).prototype=Object.create(Error.prototype),rI.prototype.constructor=rI,rI.prototype.name="TransformError";class rj{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rr();}get before(){return this.docs.length?this.docs[0]:this.doc;}step(e){let t=this.maybeStep(e);if(t.failed)throw new rI(t.failed);return this;}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t;}get docChanged(){return this.steps.length>0;}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,s)=>{e=Math.min(e,i),t=Math.max(t,s);});}return 1e9==e?null:{from:e,to:t};}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t;}replace(e,t=e,n=nx.empty){let r=rw(this.doc,e,t,n);return r&&this.step(r),this;}replaceWith(e,t,n){return this.replace(e,t,new nx(nm.from(n),0,0));}delete(e,t){return this.replace(e,t,nx.empty);}insert(e,t){return this.replaceWith(e,e,t);}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(rC(i,s,r))return e.step(new rh(t,n,r));let o=r_(i,s);0==o[o.length-1]&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?a=e:i.before(e)==t&&o.splice(1,0,-e);}let l=o.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content;}for(let e=u-1;e>=0;e--){var d;let t=c[e],n=(d=t.type).spec.defining||d.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))u=e;else if(n||!t.type.isTextblock)break;}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<o.length;t++){let c=o[(t+l)%o.length],u=!0;c<0&&(u=!1,c=-c);let h=i.node(c-1),p=i.index(c-1);if(h.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(c),u?s.after(c):n,new nx(function e(t,n,r,i,s){if(n<r){let s=t.firstChild;t=t.replaceChild(0,s.copy(e(s.content,n+1,r,i,s)));}if(n>i){let e=s.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(nm.empty,!0));}return t;}(r.content,0,r.openStart,a),a,r.openEnd));}}let h=e.steps.length;for(let a=o.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>h));a--){let e=o[a];e<0||(t=i.before(e),n=s.after(e));}}(this,e,t,n),this;}replaceRangeWith(e,t,n){var r=e,i=t;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null;}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break;}return null;}(this.doc,r,n.type);null!=e&&(r=i=e);}return this.replaceRange(r,i,new nx(nm.from(n),0,0)),this;}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&0==r.parentOffset&&0==i.parentOffset){let s=r.sharedDepth(n),o=!1;for(let e=r.depth;e>s;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>s;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n);}}let s=r_(r,i);for(let t=0;t<s.length;t++){let n=s[t],o=t==s.length-1;if(o&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n));}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n);}(this,e,t),this;}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:s}=t,o=r.before(s+1),a=i.after(s+1),l=o,c=a,u=nm.empty,d=0;for(let e=s,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=nm.from(r.node(e).copy(u)),d++):l--;let h=nm.empty,p=0;for(let e=s,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=nm.from(i.node(e).copy(h)),p++):c++;e.step(new rp(l,c,o,a,new nx(u.append(h),d,p),u.size-d,!0));}(this,e,t),this;}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),o=s.node().type;if(i&&o.inlineContent){let e="pre"==o.whitespace,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0);}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);rk(e,r.node(),r.before(),a);}o.inlineContent&&rm(e,t+n-1,o,s.node().contentMatchAt(s.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new rh(c,l.map(t+n,-1),nx.empty,!0)),!0===r){let t=e.doc.resolve(c);ry(e,t.node(),t.before(),e.steps.length);}}(this,e,t),this;}wrap(e,t){return!function(e,t,n){let r=nm.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");}r=nm.from(n[e].type.create(n[e].attrs,r));}let i=t.start,s=t.end;e.step(new rp(i,s,i,s,new nx(r,0,0),n.length,!0));}(this,e,t),this;}setBlockType(e,t=e,n,r=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var o,a,l;let c,u,d="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,d)&&(o=i.doc,a=i.mapping.slice(s).map(t),l=n,u=(c=o.resolve(a)).index(),c.parent.canReplaceWith(u,u+1,l))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0);}!1===r&&rk(i,e,t,s),rm(i,i.mapping.slice(s).map(t,1),n,void 0,null===r);let o=i.mapping.slice(s),a=o.map(t,1),l=o.map(t+e.nodeSize,1);return i.step(new rp(a,l,a+1,l-1,new nx(nm.from(n.create(d,null,e.marks)),0,0),1,!0)),!0===r&&ry(i,e,t,s),!1;}}),this;}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,o);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);e.step(new rp(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new nx(nm.from(o),0,0),1,!0));}(this,e,t,n,r),this;}setNodeAttribute(e,t,n){return this.step(new rT(e,t,n)),this;}setDocAttribute(e,t){return this.step(new rR(e,t)),this;}addNodeMark(e,t){return this.step(new ru(e,t)),this;}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof nk)t.isInSet(n.marks)&&this.step(new rd(e,t));else{let r=n.marks,i,s=[];for(;i=t.isInSet(r);)s.push(new rd(e,i)),r=i.removeFromSet(r);for(let e=s.length-1;e>=0;e--)this.step(s[e]);}return this;}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),s=nm.empty,o=nm.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){s=nm.from(i.node(e).copy(s));let t=r&&r[a];o=nm.from(t?t.type.create(t.attrs,o):i.node(e).copy(o));}e.step(new rh(t,t,new nx(s.append(o),n,n),!0));}(this,e,t,n),this;}addMark(e,t,n){var r;let i,s,o,a;return r=this,o=[],a=[],r.doc.nodesBetween(e,t,(r,l,c)=>{if(!r.isInline)return;let u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){let c=Math.max(l,e),d=Math.min(l+r.nodeSize,t),h=n.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(h)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=d:o.push(i=new rc(c,d,u[e])));s&&s.to==c?s.to=d:a.push(s=new rl(c,d,n));}}),o.forEach(e=>r.step(e)),a.forEach(e=>r.step(e)),this;}removeMark(e,t,n){var r;let i,s;return r=this,i=[],s=0,r.doc.nodesBetween(e,t,(r,o)=>{if(!r.isInline)return;s++;let a=null;if(n instanceof nJ){let e=r.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e);}else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length){let n=Math.min(o+r.nodeSize,t);for(let t=0;t<a.length;t++){let r=a[t],l;for(let e=0;e<i.length;e++){let t=i[e];t.step==s-1&&r.eq(i[e].style)&&(l=t);}l?(l.to=n,l.step=s):i.push({style:r,from:Math.max(o,e),to:n,step:s});}}}),i.forEach(e=>r.step(new rc(e.from,e.to,e.style))),this;}clearIncompatible(e,t,n){return rm(this,e,t,n),this;}}let rF=Object.create(null);class rO{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new rz(e.min(t),e.max(t))];}get anchor(){return this.$anchor.pos;}get head(){return this.$head.pos;}get from(){return this.$from.pos;}get to(){return this.$to.pos;}get $from(){return this.ranges[0].$from;}get $to(){return this.ranges[0].$to;}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0;}content(){return this.$from.doc.slice(this.from,this.to,!0);}replace(e,t=nx.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),o?nx.empty:t),0==o&&rH(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1);}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],a=e.mapping.slice(n),l=a.map(s.pos),c=a.map(o.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),rH(e,n,t.isInline?-1:1));}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new rL(e):rK(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?rK(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):rK(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i;}return null;}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new rU(e.node(0));}static atStart(e){return rK(e,e,0,0,1)||new rU(e);}static atEnd(e){return rK(e,e,e.content.size,e.childCount,-1)||new rU(e);}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=rF[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t);}static jsonID(e,t){if(e in rF)throw RangeError("Duplicate use of selection JSON ID "+e);return rF[e]=t,t.prototype.jsonID=e,t;}getBookmark(){return rL.between(this.$anchor,this.$head).getBookmark();}}rO.prototype.visible=!0;class rz{constructor(e,t){this.$from=e,this.$to=t;}}let rB=!1;function rP(e){rB||e.parent.inlineContent||(rB=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"));}class rL extends rO{constructor(e,t=e){rP(e),rP(t),super(e,t);}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null;}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return rO.near(n);let r=e.resolve(t.map(this.anchor));return new rL(r.parent.inlineContent?r:n,n);}replace(e,t=nx.empty){if(super.replace(e,t),t==nx.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t);}}eq(e){return e instanceof rL&&e.anchor==this.anchor&&e.head==this.head;}getBookmark(){return new r$(this.anchor,this.head);}toJSON(){return{type:"text",anchor:this.anchor,head:this.head};}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new rL(e.resolve(t.anchor),e.resolve(t.head));}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n));}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=rO.findFrom(t,n,!0)||rO.findFrom(t,-n,!0);if(!e)return rO.near(t,n);t=e.$head;}return e.parent.inlineContent||(0==r?e=t:(e=(rO.findFrom(e,-n,!0)||rO.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new rL(e,t);}}rO.jsonID("text",rL);class r${constructor(e,t){this.anchor=e,this.head=t;}map(e){return new r$(e.map(this.anchor),e.map(this.head));}resolve(e){return rL.between(e.resolve(this.anchor),e.resolve(this.head));}}class rq extends rO{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t;}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?rO.near(i):new rq(i);}content(){return new nx(nm.from(this.node),0,0);}eq(e){return e instanceof rq&&e.anchor==this.anchor;}toJSON(){return{type:"node",anchor:this.anchor};}getBookmark(){return new rV(this.anchor);}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new rq(e.resolve(t.anchor));}static create(e,t){return new rq(e.resolve(t));}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable;}}rq.prototype.visible=!1,rO.jsonID("node",rq);class rV{constructor(e){this.anchor=e;}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new r$(n,n):new rV(n);}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&rq.isSelectable(n)?new rq(t):rO.near(t);}}class rU extends rO{constructor(e){super(e.resolve(0),e.resolve(e.content.size));}replace(e,t=nx.empty){if(t==nx.empty){e.delete(0,e.doc.content.size);let t=rO.atStart(e.doc);t.eq(e.selection)||e.setSelection(t);}else super.replace(e,t);}toJSON(){return{type:"all"};}static fromJSON(e){return new rU(e);}map(e){return new rU(e);}eq(e){return e instanceof rU;}getBookmark(){return rW;}}rO.jsonID("all",rU);let rW={map(){return this;},resolve:e=>new rU(e)};function rK(e,t,n,r,i,s=!1){if(t.inlineContent)return rL.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(r.isAtom){if(!s&&rq.isSelectable(r))return rq.create(e,n-(i<0?r.nodeSize:0));}else{let t=rK(e,r,n+i,i<0?r.childCount:0,i,s);if(t)return t;}n+=r.nodeSize*i;}return null;}function rH(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let s=e.steps[i];(s instanceof rh||s instanceof rp)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i);}),e.setSelection(rO.near(e.doc.resolve(r),n)));}class rJ extends rj{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks;}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection;}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this;}get selectionSet(){return(1&this.updated)>0;}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this;}ensureMarks(e){return nk.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this;}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()));}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()));}get storedMarksSet(){return(2&this.updated)>0;}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null;}setTime(e){return this.time=e,this;}replaceSelection(e){return this.selection.replace(this,e),this;}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||nk.none))),n.replaceWith(this,e),this;}deleteSelection(){return this.selection.replace(this),this;}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n));}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(rO.near(this.selection.$to)),this;}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this;}getMeta(e){return this.meta["string"==typeof e?e:e.key];}get isGeneric(){for(let e in this.meta)return!1;return!0;}scrollIntoView(){return this.updated|=4,this;}get scrolledIntoView(){return(4&this.updated)>0;}}function rG(e,t){return t&&e?e.bind(t):e;}class rZ{constructor(e,t,n){this.name=e,this.init=rG(t.init,n),this.apply=rG(t.apply,n);}}let rQ=[new rZ("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new rZ("selection",{init:(e,t)=>e.selection||rO.atStart(t.doc),apply:e=>e.selection}),new rZ("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new rZ("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class rY{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rQ.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new rZ(e.key,e.spec.state,e));});}}class rX{constructor(e){this.config=e;}get schema(){return this.config.schema;}get plugins(){return this.config.plugins;}apply(e){return this.applyTransaction(e).state;}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1;}return!0;}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let o=this.config.plugins[s];if(o.spec.appendTransaction){let a=r?r[s].n:0,l=r?r[s].state:this,c=a<t.length&&o.spec.appendTransaction.call(o,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<s?{state:n,n:t.length}:{state:this,n:0});}t.push(c),n=n.applyInner(c),i=!0;}r&&(r[s]={state:n,n:t.length});}}if(!i)return{state:n,transactions:t};}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new rX(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t);}return t;}get tr(){return new rJ(this);}static create(e){let t=new rY(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new rX(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n;}reconfigure(e){let t=new rY(this.schema,e.plugins),n=t.fields,r=new rX(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r);}return r;}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]));}return t;}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new rY(e.schema,e.plugins),i=new rX(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=nj.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=rO.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let s in n){let o=n[s],a=o.spec.state;if(o.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){i[r.name]=a.fromJSON.call(o,e,t[s],i);return;}}i[r.name]=r.init(e,i);}}),i;}}class r0{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let s=t[i];s instanceof Function?s=s.bind(n):"handleDOMEvents"==i&&(s=e(s,n,{})),r[i]=s;}return r;}(e.props,this,this.props),this.key=e.key?e.key.key:r2("plugin");}getState(e){return e[this.key];}}let r1=Object.create(null);function r2(e){return e in r1?e+"$"+ ++r1[e]:(r1[e]=0,e+"$");}class r3{constructor(e="key"){this.key=r2(e);}get(e){return e.config.pluginsByKey[this.key];}getState(e){return e[this.key];}}let r6=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t;},r5=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t;},r4=null,r9=function(e,t,n){let r=r4||(r4=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r;},r8=function(){r4=null;},r7=function(e,t,n,r){return n&&(it(e,t,n,r,-1)||it(e,t,n,r,1));},ie=/^(img|br|input|textarea|hr)$/i;function it(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ir(e))){let n=e.parentNode;if(!n||!ii(n)||ia(e)||ie.test(e.nodeName)||"false"==e.contentEditable)return!1;t=r6(e)+(i<0?0:1),e=n;}else{if(!ii(e))return!1;let n=e.childNodes[t+(i<0?-1:0)];if(ii(n)&&"false"==n.contentEditable){if(null==(s=n.pmViewDesc)||!s.ignoreForSelection)return!1;else t+=i;}else e=n,t=i<0?ir(e):0;}}}function ir(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length;}function ii(e){return 1==e.nodeType;}function is(e){return 3==e.nodeType;}function io(e,t){return!!t&&e.contains(ii(t)?t:t.parentNode);}function ia(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e);}let il=function(e){return e.focusNode&&r7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset);};function ic(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n;}let iu="u">typeof navigator?navigator:null,id="u">typeof document?document:null,ih=iu&&iu.userAgent||"",ip=/Edge\/(\d+)/.exec(ih),im=/MSIE \d/.exec(ih),ig=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ih),iv=!!(im||ig||ip),iy=im?document.documentMode:ig?+ig[1]:ip?+ip[1]:0,ik=!iv&&/gecko\/(\d+)/i.test(ih);ik&&(/Firefox\/(\d+)/.exec(ih)||[0,0])[1];let ib=!iv&&/Chrome\/(\d+)/.exec(ih),ix=!!ib,iw=ib?+ib[1]:0,iC=!iv&&!!iu&&/Apple Computer/.test(iu.vendor),iS=iC&&(/Mobile\/\w+/.test(ih)||!!iu&&iu.maxTouchPoints>2),iD=iS||!!iu&&/Mac/.test(iu.platform),iA=!!iu&&/Win/.test(iu.platform),iE=/Android \d/.test(ih),iM=!!id&&"webkitFontSmoothing"in id.documentElement.style,iN=iM?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function i_(e,t){return"number"==typeof e?e:e[t];}function iT(e,t,n){if(!iO(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!ii(o)){o=r5(o);continue;}let e=o==s.body,n=e?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight};}(s):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r};}(o),a=0,l=0;if(t.top<n.top+i_(r,"top")?l=-(n.top-t.top+i_(i,"top")):t.bottom>n.bottom-i_(r,"bottom")&&(l=t.bottom-t.top>n.bottom-n.top?t.top+i_(i,"top")-n.top:t.bottom-n.bottom+i_(i,"bottom")),t.left<n.left+i_(r,"left")?a=-(n.left-t.left+i_(i,"left")):t.right>n.right-i_(r,"right")&&(a=t.right-n.right+i_(i,"right")),a||l)if(e)s.defaultView.scrollBy(a,l);else{let e=o.scrollLeft,n=o.scrollTop;l&&(o.scrollTop+=l),a&&(o.scrollLeft+=a);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i};}let c=e?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(c))break;o="absolute"==c?o.offsetParent:r5(o);}}function iR(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=r5(r));return t;}function iI(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s);}}let ij=null;function iF(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1;}function iO(e){return e.top<e.bottom||e.left<e.right;}function iz(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(iO(e))return e;}return Array.prototype.find.call(n,iO)||e.getBoundingClientRect();}let iB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function iP(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),o=iM||ik;if(is(r))if(o&&(iB.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=iz(r9(r,i,i),n);if(ik&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=iz(r9(r,i-1,i-1),-1);if(t.top==e.top){let n=iz(r9(r,i,i+1),-1);if(n.top!=e.top)return iL(n,n.left<t.left);}}return e;}else{let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==r.nodeValue.length?(e--,s=1):n<0?e--:t++,iL(iz(r9(r,e,t),s),s<0);}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==ir(r))){let e=r.childNodes[i-1];if(ii(e))return i$(e.getBoundingClientRect(),!1);}if(null==s&&i<ir(r)){let e=r.childNodes[i];if(ii(e))return i$(e.getBoundingClientRect(),!0);}return i$(r.getBoundingClientRect(),n>=0);}if(null==s&&i&&(n<0||i==ir(r))){let e=r.childNodes[i-1],t=is(e)?r9(e,ir(e)-!o):ii(e)&&("BR"!=e.nodeName||!e.nextSibling)?e:null;if(t)return iL(iz(t,1),!1);}if(null==s&&i<ir(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?is(e)?r9(e,0,+!o):ii(e)?e:null:null;if(t)return iL(iz(t,-1),!0);}return iL(iz(is(r)?r9(r):r,-n),n>=0);}function iL(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n};}function i$(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right};}function iq(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n();}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus();}}let iV=/[\u0590-\u08ac]/,iU=null,iW=null,iK=!1;class iH{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this;}matchesWidget(e){return!1;}matchesMark(e){return!1;}matchesNode(e,t,n){return!1;}matchesHack(e){return!1;}parseRule(e){return null;}stopEvent(e){return!1;}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e;}get border(){return 0;}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy();}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size;}}get posBefore(){return this.parent.posBeforeChild(this);}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0;}get posAfter(){return this.posBefore+this.size;}get posAtEnd(){return this.posAtStart+this.size-2*this.border;}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&io(this.contentDOM,e))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling;}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart;}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling;}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd;}if(e==this.dom&&this.contentDOM)r=t>r6(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(4&e.compareDocumentPosition(this.contentDOM));else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break;}if(t.previousSibling)break;}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break;}if(t.nextSibling)break;}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart;}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),s;if(i&&(!t||i.node))if(!n||!(s=i.nodeDOM)||(ii(s)?io(s,e):s==e))return i;else n=!1;}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t;}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n);}return-1;}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break;}}return r;}if(e<i)return r.descAt(e-n-r.border);n=i;}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=t+this.children[n].size;if(i>e){r=e-t;break;}t=i;}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof i0||e instanceof iJ&&e.side>=0))break;}if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?r6(e.dom)+1:0};}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?r6(e.dom):this.contentDOM.childNodes.length};}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=n,o=0;;o++){let n=this.children[o],a=s+n.size;if(-1==r&&e<=a){let i=s+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=r6(n.dom)+1;break;}e-=n.size;}-1==r&&(r=0);}if(r>-1&&(a>t||o==this.children.length-1)){t=a;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=r6(n.dom);break;}t+=n.size;}-1==i&&(i=this.contentDOM.childNodes.length);break;}s=a;}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i};}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e);}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!ii(t)||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n];}setSelection(e,t,n,r=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let o=0,a=0;o<this.children.length;o++){let l=this.children[o],c=a+l.size;if(i>a&&s<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c;}let o=this.domFromPos(e,e?-1:1),a=t==e?o:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((ik||iC)&&e==t){let{node:e,offset:t}=o;if(is(e)){if((u=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(o=a={node:n.parentNode,offset:r6(n)+1});break;}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break;}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable);}}if(ik&&c.focusNode&&c.focusNode!=a.node&&ii(c.focusNode)){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0);}if(!(r||u&&iC)&&r7(o.node,o.offset,c.anchorNode,c.anchorOffset)&&r7(a.node,a.offset,c.focusNode,c.focusOffset))return;let d=!1;if((l.extend||e==t)&&!(u&&ik)){l.collapse(o.node,o.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0;}catch(e){}}if(!d){if(e>t){let e=o;o=a,a=e;}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(o.node,o.offset),l.removeAllRanges(),l.addRange(n);}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type;}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM);}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let r=n+i.border,o=s-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==s?2:1,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return;}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2;}n=s;}this.dirty=2;}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n);}}get domAtom(){return!1;}get ignoreForCoords(){return!1;}get ignoreForSelection(){return!1;}isText(e){return!1;}}class iJ extends iH{constructor(e,t,n,r){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){let e=ii(s)?s:document.createElement("span");e!=s&&e.appendChild(s),e.hasAttribute("contenteditable")||(e.contentEditable="false"),e.classList.add("ProseMirror-widget");}super(e,[],s,null),this.widget=t,this.widget=t,i=this;}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type);}parseRule(){return{ignore:!0};}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e);}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection;}destroy(){this.widget.type.destroy(this.dom),super.destroy();}get domAtom(){return!0;}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide;}get side(){return this.widget.type.side;}}class iG extends iH{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r;}get size(){return this.text.length;}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t;}domFromPos(e){return{node:this.textDOM,offset:e};}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue;}}class iZ extends iH{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i;}static create(e,t,n,r){let i=r.nodeViews[t.type.name],s=i&&i(t,r,n);return s&&s.dom||(s=n4.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new iZ(e,t,s.dom,s.contentDOM||s.dom,s);}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM};}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e);}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0;}}slice(e,t,n){let r=iZ.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=st(i,t,s,n)),e>0&&(i=st(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r;}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e);}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}}class iQ extends iH{constructor(e,t,n,r,i,s,o){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o;}static create(e,t,n,r,i,s){let o=i.nodeViews[t.type.name],a,l=o&&o(t,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText){if(c){if(!is(c))throw RangeError("Text must be rendered as a DOM text node");}else c=document.createTextNode(t.text);}else if(!c){let e=n4.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e);}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return(c=i4(c,n,t),l)?a=new i1(e,t,n,r,c,u||null,d,l):t.isText?new iX(e,t,n,r,c,d):new iQ(e,t,n,r,c,u||null,d);}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break;}}if(!t.contentElement){let n=e&&e.find(t=>ii(t)&&0>e.indexOf(t.parentNode)&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>nm.empty;}}else t.contentElement=this.contentDOM;}else t.getContent=()=>this.node.content;return t;}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&i9(t,this.outerDeco)&&n.eq(this.innerDeco);}get size(){return this.node.nodeSize;}get border(){return+!this.node.isLeaf;}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,o=i&&i.pos<0,a=new i7(this,s&&s.node,e),l=this.node.inlineContent,c=l&&this.node.isBlock;(function(e,t,n,r){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(s,o),n),s+=o.nodeSize;}return;}let o=0,a=[],l=null;for(let c=0;;){let u,d,h,p;for(;o<i.length&&i[o].to==s;){let e=i[o++];e.widget&&(u?(d||(d=[u])).push(e):u=e);}if(u)if(d){d.sort(se);for(let e=0;e<d.length;e++)n(d[e],c,!!l);}else n(u,c,!!l);if(l)p=-1,h=l,l=null;else if(c<e.childCount)p=c,h=e.child(c++);else break;for(let e=0;e<a.length;e++)a[e].to<=s&&a.splice(e--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let f=s+h.nodeSize;if(h.isText){let e=f;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-s),h=h.cut(0,e-s),f=e,p=-1);}else for(;o<i.length&&i[o].to<f;)o++;let m=h.isInline&&!h.isLeaf?a.filter(e=>!e.inline):a.slice();r(h,m,t.forChild(s,h),p),s=f;}})(this.node,this.innerDeco,(t,i,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!s&&a.syncToMarks(i==this.node.childCount?nk.none:this.node.child(i).marks,n,e,i),a.placeWidget(t,e,r);},(t,s,u,d)=>{let h;a.syncToMarks(t.marks,n,e,d),c&&t.isAtom&&!t.isText&&a.addHackNode("IMG",a.top),a.findNodeMatch(t,s,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,s,u,h,e)||a.updateNextNode(t,s,u,e,d,r)||a.addNode(t,s,u,e,r),r+=t.nodeSize,l&&(c=t.isAtom&&!t.isText);}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,r){let i=t.firstChild,s=!1;for(let o=0;o<n.length;o++){let a=n[o],l=a.dom;if(l.parentNode==t){for(;l!=i;)i=i8(i),s=!0;i=i.nextSibling;}else s=!0,t.insertBefore(l,i);if(a instanceof iZ){let n=i?i.previousSibling:t.lastChild;e(a.contentDOM,a.children,r),i=n?n.nextSibling:t.firstChild;}}for(;i;)i=i8(i),s=!0;s&&r.trackWrites==t&&(r.trackWrites=null);}(this.contentDOM,this.children,e),iS&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t;}}(this.dom));}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof rL)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,s=function(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let o=e.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;l+=t.text;}if(s>=n){if(s>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r;}}return-1;}(this.node.content,e,n-t,r-t);return s<0?null:{node:i,pos:s,text:e};}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0);}let s=new iG(this,i,t,r);e.input.compositionNodes.push(s),this.children=st(this.children,n,n+r.length,e,s);}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0);}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0;}updateOuterDeco(e){if(i9(e,this.outerDeco))return;let t=!ii(this.nodeDOM),n=this.dom;this.dom=i5(this.dom,this.nodeDOM,i6(this.outerDeco,this.node,t),i6(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e;}selectNode(){ii(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0));}deselectNode(){ii(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"));}get domAtom(){return this.node.isAtom;}}function iY(e,t,n,r,i){i4(r,t,e);let s=new iQ(void 0,e,t,n,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s;}class iX extends iQ{constructor(e,t,n,r,i,s){super(e,t,n,r,i,null,s);}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0};}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0);}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1;}domFromPos(e){return{node:this.nodeDOM,offset:e};}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n);}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type;}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new iX(this.parent,r,this.outerDeco,this.innerDeco,i,i);}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3);}get domAtom(){return!1;}isText(e){return this.node.text==e;}}class i0 extends iH{parseRule(){return{ignore:!0};}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e;}get domAtom(){return!0;}get ignoreForCoords(){return"IMG"==this.dom.nodeName;}}class i1 extends iQ{constructor(e,t,n,r,i,s,o,a){super(e,t,n,r,i,s,o),this.spec=a;}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i;}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r);}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode();}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode();}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r);}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e);}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e);}}let i2=function(e){e&&(this.nodeName=e);};i2.prototype=Object.create(null);let i3=[new i2()];function i6(e,t,n){if(0==e.length)return i3;let r=n?i3[0]:new i2(),i=[r];for(let s=0;s<e.length;s++){let o=e[s].type.attrs;if(o)for(let e in o.nodeName&&i.push(r=new i2(o.nodeName)),o){let s=o[e];null!=s&&(n&&1==i.length&&i.push(r=new i2(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+s:"style"==e?r.style=(r.style?r.style+";":"")+s:"nodeName"!=e&&(r[e]=s));}}return i;}function i5(e,t,n,r){if(n==i3&&r==i3)return t;let i=t;for(let t=0;t<r.length;t++){let s=r[t],o=n[t];if(t){let t;o&&o.nodeName==s.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==s.nodeName||((t=document.createElement(s.nodeName)).pmIsDeco=!0,t.appendChild(i),o=i3[0]),i=t;}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class");}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1]);}n.style&&(e.style.cssText+=n.style);}}(i,o||i3[0],s);}return i;}function i4(e,t,n){return i5(e,e,i3,i6(t,n,!ii(e)));}function i9(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0;}function i8(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t;}class i7{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map(),o=[];n:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(e instanceof iZ)n=e,r=e.children.length;else{a=e,r--;break;}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let l=a.node;if(l){if(l!=e.child(i-1))break;--i,s.set(a,i),o.push(a);}}return{index:i,matched:s,matches:o.reverse()};}(e.node.content,e);}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0;}}destroyRest(){this.destroyBetween(this.index,this.top.children.length);}syncToMarks(e,t,n,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[s])&&!this.isLocked(n.dom)){i=t;break;}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof iZ&&3!=t.dirty&&t.mark.type==e[s].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[s])&&(t.mark=e[s],i=this.index,this.changed=!0);}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=iZ.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0;}this.index=0,s++;}}findNodeMatch(e,t,n,r){let i=-1,s;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,n))i=this.top.children.indexOf(s,this.index);else for(let r=this.index,s=Math.min(this.top.children.length,r+5);r<s;r++){let s=this.top.children[r];if(s.matchesNode(e,t,n)&&!this.preMatch.matched.has(s)){i=r;break;}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0);}updateNodeAt(e,t,n,r,i){let s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0);}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;}return-1;}e=t;}}updateNextNode(e,t,n,r,i,s){for(let o=this.index;o<this.top.children.length;o++){let a=this.top.children[o];if(a instanceof iQ){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c=a.dom,u,d=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&i9(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,o),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(a,e,t,n,r,s)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(r,s+1),u.dirty=0),this.changed=!0,this.index++,!0;break;}}return!1;}recreateWrapper(e,t,n,r,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!i9(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=iQ.create(this.top,t,n,r,i,s);if(o.contentDOM)for(let t of(o.children=e.children,e.children=[],o.children))t.parent=o;return e.destroy(),o;}addNode(e,t,n,r,i){let s=iQ.create(this.top,e,t,n,r,i);s.contentDOM&&s.updateChildren(r,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0;}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new iJ(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0;}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof iZ;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof iX)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((iC||ix)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top));}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new i0(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0;}}isLocked(e){return this.lock&&(e==this.lock||ii(e)&&e.contains(this.lock.parentNode));}}function se(e,t){return e.type.side-t.type.side;}function st(e,t,n,r,i){let s=[];for(let o=0,a=0;o<e.length;o++){let l=e[o],c=a,u=a+=l.size;c>=n||u<=t?s.push(l):(c<t&&s.push(l.slice(0,t-c,r)),i&&(s.push(i),i=void 0),u>n&&s.push(l.slice(n-c,l.size,r)));}return s;}function sn(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(il(n)){for(l=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&rq.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&function(e,t,n){for(let r=0==t,i=t==ir(e);r||i;){if(e==n)return!0;let t=r6(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==ir(e);}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;c=new rq(o==e?a:r.resolve(e));}else if(ik&&"key"==t&&o>e.state.selection.to&&ii(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if("visible"!=getComputedStyle(e).overflow){c=rO.findFrom(r.resolve(i.posAtStart),1);break;}if(e==i.dom||e.nextSibling||!e.parentNode||!ii(e.parentNode))break;}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let s=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(s.endContainer,s.endOffset,-1));}if(t<0)return null;[l,o]=i==e.state.selection.anchor?[i,t]:[t,i],a=r.resolve(o);}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;}let u=r.resolve(l);if(!c){let n="pointer"==t||e.state.selection.head<a.pos&&!s?1:-1;c=sd(e,u,a,n);}return c;}function sr(e){return e.editable?e.hasFocus():sp(e)&&document.activeElement&&document.activeElement.contains(e.dom);}function si(e,t=!1){let n=e.state.selection;if(sc(e,n),!sr(e))return;let r=e.input.mouseDown;if(!t&&ix&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&r7(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void e.domObserver.setCurSelection();}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,r6(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&iv&&iy<=11&&(n.disabled=!0,n.disabled=!1);}(e);else{var i;let r,s,o,a,{anchor:l,head:c}=n,u,d;ss&&!(n instanceof rL)&&(n.$from.parent.inlineContent||(u=so(e,n.from)),n.empty||n.$from.parent.inlineContent||(d=so(e,n.to))),e.docView.setSelection(l,c,e,t),ss&&(u&&sl(u),d&&sl(d)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((r=(i=e).dom.ownerDocument).removeEventListener("selectionchange",i.input.hideSelectionGuard),o=(s=i.domSelectionRange()).anchorNode,a=s.anchorOffset,r.addEventListener("selectionchange",i.input.hideSelectionGuard=()=>{(s.anchorNode!=o||s.anchorOffset!=a)&&(r.removeEventListener("selectionchange",i.input.hideSelectionGuard),setTimeout(()=>{(!sr(i)||i.state.selection.visible)&&i.dom.classList.remove("ProseMirror-hideselection");},20));})));}e.domObserver.setCurSelection(),e.domObserver.connectSelection();}let ss=iC||ix&&iw<63;function so(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(iC&&i&&"false"==i.contentEditable)return sa(i);if((!i||"false"==i.contentEditable)&&(!s||"false"==s.contentEditable)){if(i)return sa(i);else if(s)return sa(s);}}function sa(e){return e.contentEditable="true",iC&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e;}function sl(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null);}function sc(e,t){if(t instanceof rq){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(su(e),n&&n.selectNode(),e.lastSelectedViewDesc=n);}else su(e);}function su(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0);}function sd(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||rL.between(t,n,r);}function sh(e){return(!e.editable||!!e.hasFocus())&&sp(e);}function sp(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return io(e.dom,t.anchorNode)&&(e.editable||io(e.dom,t.focusNode));}catch(e){return!1;}}function sf(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&rO.findFrom(s,t);}function sm(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0;}function sg(e,t,n){let r=e.state.selection;if(r instanceof rL){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return sm(e,new rL(r.$anchor,s));}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=sf(e.state,t);return!!n&&n instanceof rq&&sm(e,n);}else if(!(iD&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,s;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(s=e.docView.descAt(o))&&!s.contentDOM)&&(rq.isSelectable(i)?sm(e,new rq(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):sm(e,new rL(e.state.doc.resolve(t<0?o:o+i.nodeSize))));}}else{if(r instanceof rq&&r.node.isInline)return sm(e,new rL(t>0?r.$to:r.$from));let n=sf(e.state,t);return!!n&&sm(e,n);}}function sv(e,t){let n=e.pmViewDesc;return n?0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName):ii(e)&&"false"==e.contentEditable;}function sy(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=!1;for(ik&&ii(n)&&r<ir(n)&&sv(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!ii(n))break;let e=n.childNodes[r-1];if(sv(e,-1))i=n,s=--r;else if(is(e))r=(n=e).nodeValue.length;else break;}else if(sk(n))break;else{let t=n.previousSibling;for(;t&&sv(t,-1);)i=n.parentNode,s=r6(t),t=t.previousSibling;if(t)r=ir(n=t);else{if((n=n.parentNode)==e.dom)break;r=0;}}o?sb(e,n,r):i&&sb(e,i,s);}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,s=r.focusOffset;if(!i)return;let o=ir(i);for(;;)if(s<o){if(!ii(i))break;if(sv(i.childNodes[s],1))t=i,n=++s;else break;}else if(sk(i))break;else{let r=i.nextSibling;for(;r&&sv(r,1);)t=r.parentNode,n=r6(r)+1,r=r.nextSibling;if(r)s=0,o=ir(i=r);else{if((i=i.parentNode)==e.dom)break;s=o=0;}}t&&sb(e,t,n);}(e);}function sk(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock;}function sb(e,t,n){if(!is(t)){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!ia(e);)t=r6(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(is(n))return n;if(ii(n)&&"false"==n.contentEditable)break;e=n,t=0;}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!ia(e);)t=r6(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(is(n))return n;if(ii(n)&&"false"==n.contentEditable)break;t=(e=n).childNodes.length;}}(t,n))&&(t=e,n=e.nodeValue.length);}let r=e.domSelection();if(!r)return;if(il(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e);}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&si(e);},50);}function sx(e,t){let n=e.state.doc.resolve(t);if(!(ix||iA)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl";}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl";}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr";}function sw(e,t,n){let r=e.state.selection;if(r instanceof rL&&!r.empty||n.indexOf("s")>-1||iD&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=sf(e.state,t);if(n&&n instanceof rq)return sm(e,n);}if(!i.parent.inlineContent){let n=t<0?i:s,o=r instanceof rU?rO.near(n,t):rO.findFrom(n,t);return!!o&&sm(e,o);}return!1;}function sC(e,t){if(!(e.state.selection instanceof rL))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0;}return!1;}function sS(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start();}function sD(e,t){e.someProp("transformCopied",n=>{t=n(t,e);});let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content;}let o=e.someProp("clipboardSerializer")||n4.fromSchema(e.state.schema),a=sR(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&ii(c)&&(u=sT[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++;}c=l.firstChild;}return c&&ii(c)&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t};}function sA(e,t,n,r,i){let s,o,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e);}),a)return o=new nx(nm.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{o=t(o,e,!0);}),o;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)o=n;else{let n=i.marks(),{schema:r}=e.state,o=n4.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(o.serializeNode(r.text(e,n)));});}}else e.someProp("transformPastedHTML",t=>{n=t(n,e);}),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=sR(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),s;if((s=i&&sT[i[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!sI){if(sI=t.defaultPolicy)try{return sI.createHTML(e);}catch(e){}sI=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e});}return sI.createHTML(e);}(e),s)for(let e=0;e<s.length;e++)r=r.querySelector(s[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText;}}}return r;}(n),iM&&function(e){let t=e.querySelectorAll(ix?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r);}}(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=s.firstChild;for(;e&&!ii(e);)e=e.nextSibling;if(!e)break;s=e;}if(o||(o=(e.someProp("clipboardParser")||e.someProp("domParser")||nQ.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||sE.test(e.parentNode.nodeName)?null:{ignore:!0}})),u)o=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t);}catch(t){return e;}let{content:i,openStart:s,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=nm.from(t.create(r[e+1],i));}catch(e){break;}s++,o++;}return new nx(i,s,o);}(s_(o,+u[1],+u[2]),u[4]);else if((o=nx.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(e=>{if(!s)return;let t=r.findWrapping(e.type),n;if(!t)return s=null;if(n=s.length&&i.length&&function e(t,n,r,i,s){if(s<t.length&&s<n.length&&t[s]==n[s]){let o=e(t,n,r,i.lastChild,s+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(s==t.length-1?r.type:t[s+1]))return i.copy(i.content.append(nm.from(sM(r,t,s+1))));}}(t,i,e,s[s.length-1],0))s[s.length-1]=n;else{s.length&&(s[s.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(nm.empty,!0);return t.copy(r.append(i));}(s[s.length-1],i.length));let n=sM(e,t);s.push(n),r=r.matchType(n.type),i=t;}}),s)return nm.from(s);}return e;}(o.content,i),!0)).openStart||o.openEnd){let e=0,t=0;for(let t=o.content.firstChild;e<o.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=o.content.lastChild;t<o.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);o=s_(o,e,t);}return e.someProp("transformPasted",t=>{o=t(o,e,l);}),o;}let sE=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function sM(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,nm.from(e));return e;}function sN(e,t,n,r,i,s){let o=t<0?e.firstChild:e.lastChild,a=o.content;return e.childCount>1&&(s=0),i<r-1&&(a=sN(a,t,n,r,i+1,s)),i>=n&&(a=t<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(nm.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(a));}function s_(e,t,n){return t<e.openStart&&(e=new nx(sN(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new nx(sN(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e;}let sT={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function sR(){return document.implementation.createHTMLDocument("title");}let sI=null,sj={},sF={},sO={touchstart:!0,touchmove:!0};class sz{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null;}}function sB(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now();}function sP(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>sL(e,t));});}function sL(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented);});}function s$(e){return{left:e.clientX,top:e.clientY};}function sq(e,t,n,r,i){if(-1==r)return!1;let s=e.state.doc.resolve(r);for(let r=s.depth+1;r>0;r--)if(e.someProp(t,t=>r>s.depth?t(e,n,s.nodeAfter,s.before(r),i,!0):t(e,n,s.node(r),s.before(r),i,!1)))return!0;return!1;}function sV(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r);}function sU(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?rL.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),s=i.before(e);if(t.inlineContent)return rL.create(r,s+1,s+1+t.content.size);if(n&&rq.isSelectable(t))return rq.create(r,s);}return null;}sF.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!sG(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!iE||!ix||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!iS||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||iD&&72==r&&"c"==i)return sC(e,-1)||sy(e,-1);if(46==r&&!t.shiftKey||iD&&68==r&&"c"==i)return sC(e,1)||sy(e,1);if(13==r||27==r)return!0;if(37==r||iD&&66==r&&"c"==i){let t=37==r?"ltr"==sx(e,e.state.selection.from)?-1:1:-1;return sg(e,t,i)||sy(e,t);}if(39==r||iD&&70==r&&"c"==i){let t=39==r?"ltr"==sx(e,e.state.selection.from)?1:-1:1;return sg(e,t,i)||sy(e,t);}else if(38==r||iD&&80==r&&"c"==i)return sw(e,-1,i)||sy(e,-1);else if(40==r||iD&&78==r&&"c"==i)return function(e){if(!iC||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&ii(t)&&0==n&&t.firstChild&&ii(t.firstChild)&&"false"==t.firstChild.contentEditable){let n=t.firstChild;sS(e,n,"true"),setTimeout(()=>sS(e,n,"false"),20);}return!1;}(e)||sw(e,1,i)||sy(e,1);else if(i==(iD?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1;}(e,t)?t.preventDefault():sB(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter"))),e.input.lastIOSEnter=0);},200);}},sF.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1);},sF.keypress=(e,t)=>{if(sG(e)||!t.charCode||t.ctrlKey&&!t.altKey||iD&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof rL)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault();}};let sW=iD?"metaKey":"ctrlKey";sj.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let s=sX(e),o=Date.now(),a="singleClick";o-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[sW]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:a,button:t.button},e.input.mouseDown&&e.input.mouseDown.done();let l=e.posAtCoords(s$(t));l&&("singleClick"==a?e.input.mouseDown=new sH(e,l,t,!!s):("doubleClick"==a?function(e,t,n,r){return sq(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r));}:function(e,t,n,r){return sq(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=sU(e,t,!0),i=e.state.doc;return!!r&&(sV(e,r),r instanceof rL&&i.eq(e.state.doc)&&(e.input.mouseDown=new sJ(e,r)),!0);}(e,n,r);})(e,l.pos,l.inside,t)?t.preventDefault():sB(e,"pointer"));};class sK{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this));}up(e){this.done();}move(e){0==e.buttons&&this.done();}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null);}delaySelUpdate(){return!1;}}class sH extends sK{constructor(e,t,n,r){let i,s;if(super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[sW],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,s=n.depth?n.before():0;}let o=r?null:n.target,a=o?e.docView.nearestDesc(o,!0):null;this.target=a&&ii(a.nodeDOM)?a.nodeDOM:null;let{selection:l}=e.state;0==n.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof rq&&l.from<=s&&l.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ik&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false");},20),this.view.domObserver.start()),sB(e,"pointer");}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||si(this.view);});}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(s$(e))),this.updateAllowDefault(e),this.allowDefault||!t)sB(this.view,"pointer");else{var n,r,i,s;(n=this.view,r=t.pos,i=t.inside,s=this.selectNode,sq(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(s?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof rq&&(r=n.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(rq.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?s.before(n.$from.depth):s.before(e);break;}}return null!=i&&(sV(e,rq.create(e.state.doc,i)),!0);}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&rq.isSelectable(r))&&(sV(e,new rq(n)),!0);}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||iC&&this.mightDrag&&!this.mightDrag.node.isAtom||ix&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(sV(this.view,rO.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):sB(this.view,"pointer");}}move(e){this.updateAllowDefault(e),sB(this.view,"pointer"),super.move(e);}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0);}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0);}}class sJ extends sK{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc;}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),sB(this.view,"pointer");let t=this.view.posAtCoords(s$(e)),n=t&&sU(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[s,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];sV(this.view,rL.create(r,s,o));}}function sG(e,t){return!!e.composing||!!(iC&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0);}sj.touchstart=e=>{e.input.lastTouch=Date.now(),sX(e),sB(e,"pointer");},sj.touchmove=e=>{e.input.lastTouch=Date.now(),sB(e,"pointer");},sj.contextmenu=e=>sX(e);let sZ=iE?5e3:-1;function sQ(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>sX(e),t));}function sY(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty();}function sX(e,t=!1){if(!iE||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sY(e),t||e.docView&&e.docView.dirty){let n=sn(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0;}return!1;}}sF.compositionstart=sF.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof rL&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||ix&&iA&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!ii(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return ii(r)&&"false"==r.contentEditable;}(e)))e.markCursor=e.state.storedMarks||n.marks(),sX(e,!0),e.markCursor=null;else if(sX(e,!t.selection.empty),ik&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&ii(n)&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(is(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break;}n=t,r=-1;}}e.input.composing=!0;}sQ(e,sZ);},sF.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,sQ(e,20));};let s0=iv&&iy<15||iS&&iN<604;function s1(e,t,n,r,i){let s=sA(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,s||nx.empty)))return!0;if(!s)return!1;let o=0==s.openStart&&0==s.openEnd&&1==s.content.childCount?s.content.firstChild:null,a=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0;}function s2(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):"";}sj.copy=sF.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=s0?null:t.clipboardData,{dom:s,text:o}=sD(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",o)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus();},50);}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));},sF.paste=(e,t)=>{if(e.composing&&!iE)return;let n=s0?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&s1(e,s2(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?s1(e,r.value,null,i,t):s1(e,r.textContent,r.innerHTML,i,t);},50);}(e,t);};class s3{constructor(e,t,n){this.slice=e,this.move=t,this.node=n;}}let s6=iD?"altKey":"ctrlKey";function s5(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t);}),null!=n?!n:!t[s6];}for(let e in sj.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(s$(t));if(s&&s.pos>=i.from&&s.pos<=(i instanceof rq?i.to-1:i.to));else if(r&&r.mightDrag)n=rq.create(e.state.doc,r.mightDrag.pos);else if(t.target&&ii(t.target)){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=rq.create(e.state.doc,r.posBefore));}let o=(n||e.state.selection).content(),{dom:a,text:l,slice:c}=sD(e,o);t.dataTransfer.files.length&&ix&&!(iw>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(s0?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",s0||t.dataTransfer.setData("text/plain",l),e.dragging=new s3(c,s5(e,t),n);},sj.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null);},50);},sF.dragover=sF.dragenter=(e,t)=>t.preventDefault(),sF.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(s$(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",t=>{s=t(s,e,!1);}):s=sA(e,s2(t.dataTransfer),s0?null:t.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&s5(e,t));if(e.someProp("handleDrop",n=>n(e,t,s||nx.empty,o)))return t.preventDefault();if(!s)return;t.preventDefault();let a=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,s=r.index(t)+ +(n>0),o=r.node(t),a=!1;if(1==e)a=o.canReplace(s,s,i);else{let e=o.contentMatchAt(s).findWrapping(i.firstChild.type);a=e&&o.canReplaceWith(s,s,e[0]);}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1);}return null;}(e.state.doc,i.pos,s):i.pos;null==a&&(a=i.pos);let l=e.state.tr;if(o){let{node:e}=n;e?e.replace(l):l.deleteSelection();}let c=l.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=l.doc;if(u?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(d))return;let h=l.doc.resolve(c);if(u&&rq.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new rq(h));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),l.setSelection(sd(e,h,l.doc.resolve(t)));}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"));}(e,t,e.dragging);}finally{e.dragging=null;}},sj.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&si(e);},20));},sj.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1);},sj.beforeinput=(e,t)=>{if(iE&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,ic(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView());},50);}},sF)sj[e]=sF[e];function s4(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0;}class s9{constructor(e,t){this.toDOM=e,this.spec=t||on,this.side=this.spec.side||0;}map(e,t,n,r){let{pos:i,deleted:s}=e.mapResult(t.from+r,this.side<0?-1:1);return s?null:new oe(i-n,i-n,this);}valid(){return!0;}eq(e){return this==e||e instanceof s9&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&s4(this.spec,e.spec));}destroy(e){this.spec.destroy&&this.spec.destroy(e);}}class s8{constructor(e,t){this.attrs=e,this.spec=t||on;}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new oe(i,s,this);}valid(e,t){return t.from<t.to;}eq(e){return this==e||e instanceof s8&&s4(this.attrs,e.attrs)&&s4(this.spec,e.spec);}static is(e){return e.type instanceof s8;}destroy(){}}class s7{constructor(e,t){this.attrs=e,this.spec=t||on;}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let s=e.mapResult(t.to+r,-1);return s.deleted||s.pos<=i.pos?null:new oe(i.pos-n,s.pos-n,this);}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to;}eq(e){return this==e||e instanceof s7&&s4(this.attrs,e.attrs)&&s4(this.spec,e.spec);}destroy(){}}class oe{constructor(e,t,n){this.from=e,this.to=t,this.type=n;}copy(e,t){return new oe(e,t,this.type);}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to;}map(e,t,n){return this.type.map(e,this,t,n);}static widget(e,t,n){return new oe(e,e,new s9(t,n));}static inline(e,t,n,r){return new oe(e,t,new s8(n,r));}static node(e,t,n,r){return new oe(e,t,new s7(n,r));}get spec(){return this.type.spec;}get inline(){return this.type instanceof s8;}get widget(){return this.type instanceof s9;}}let ot=[],on={};class or{constructor(e,t){this.local=e.length?e:ot,this.children=t.length?t:ot;}static create(e,t){return t.length?ou(t,e,0,on):oi;}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r;}findInner(e,t,n,r,i){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r));}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,t-o,n,r+o,i);}}map(e,t,n){return this==oi||0==e.maps.length?this:this.mapInner(e,t,0,0,n||on);}mapInner(e,t,n,r,i){let s;for(let o=0;o<this.local.length;o++){let a=this.local[o].map(e,n,r);a&&a.type.valid(t,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[o].spec);}return this.children.length?function(e,t,n,r,i,s,o){let a=e.slice();for(let e=0,t=s;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,s)=>{let o=s-i-(n-e);for(let i=0;i<a.length;i+=3){let s=a[i+1];if(s<0||e>s+t-r)continue;let l=a[i]+t-r;n>=l?a[i+1]=e<=l?-2:-1:e>=t&&o&&(a[i]+=o,a[i+1]+=o);}r+=o;}),t=n.maps[e].map(t,-1);}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue;}let c=n.map(e[t]+s),u=c-i;if(u<0||u>=r.content.size){l=!0;continue;}let d=n.map(e[t+1]+s,-1)-i,{index:h,offset:p}=r.content.findIndex(u),f=r.maybeChild(h);if(f&&p==u&&p+f.nodeSize==d){let r=a[t+2].mapInner(n,f,c+1,e[t]+s+1,o);r!=oi?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0);}else l=!0;}if(l){let l=ou(function(e,t,n,r,i,s,o){for(let a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,s){for(let e=0;e<t.local.length;e++){let a=t.local[e].map(r,i,s);a?n.push(a):o.onRemove&&o.onRemove(t.local[e].spec);}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+s+1);}(e[a+2],t[a]+s+1);return n;}(a,e,t,n,i,s,o),r,0,o);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let n=l.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2]);}}return new or(t.sort(od),a);}(this.children,s||[],e,t,n,r,i):s?new or(s.sort(od),ot):oi;}add(e,t){return t.length?this==oi?or.create(e,t):this.addInner(e,t,0):this;}addInner(e,t,n){let r,i=0;e.forEach((e,s)=>{let o=s+n,a;if(a=ol(t,e,o)){for(r||(r=this.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(e,a,o+1):r.splice(i,0,s,s+e.nodeSize,ou(a,e,o+1,on)),i+=3;}});let s=oa(i?oc(t):t,-n);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||s.splice(t--,1);return new or(s.length?this.local.concat(s).sort(od):this.local,r||this.children);}remove(e){return 0==e.length||this==oi?this:this.removeInner(e,0);}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,s=n[r]+t,o=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>s&&n.to<o&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,s+1);a!=oi?n[r+2]=a:(n.splice(r,3),r-=3);}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));}return n==this.children&&r==this.local?this:r.length||n.length?new or(r,n):oi;}forChild(e,t){let n,r;if(this==oi)return this;if(t.isLeaf)return or.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break;}let i=e+1,s=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<s&&t.to>i&&t.type instanceof s8){let e=Math.max(i,t.from)-i,n=Math.min(s,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n));}}if(r){let e=new or(r.sort(od),ot);return n?new oo([e,n]):e;}return n||oi;}eq(e){if(this==e)return!0;if(!(e instanceof or)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0;}locals(e){return oh(this.localsInner(e));}localsInner(e){if(this==oi)return ot;if(e.inlineContent||!this.local.some(s8.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof s8||t.push(this.local[e]);return t;}forEachSet(e){e(this);}}or.empty=new or([],[]),or.removeOverlap=oh;let oi=or.empty;class oo{constructor(e){this.members=e;}map(e,t){let n=this.members.map(n=>n.map(e,t,on));return oo.from(n);}forChild(e,t){if(t.isLeaf)return or.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=oi&&(i instanceof oo?n=n.concat(i.members):n.push(i));}return oo.from(n);}eq(e){if(!(e instanceof oo)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0;}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e]);}else t=i;}return t?oh(n?t:t.sort(od)):ot;}static from(e){switch(e.length){case 0:return oi;case 1:return e[0];default:return new oo(e.every(e=>e instanceof or)?e:e.reduce((e,t)=>e.concat(t instanceof or?t:t.members),[]));}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e);}}function oa(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new oe(i.from+t,i.to+t,i.type));}return n;}function ol(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,s;t<e.length;t++)(s=e[t])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[t]=null);return i;}function oc(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t;}function ou(e,t,n,r){let i=[],s=!1;t.forEach((t,o)=>{let a=ol(e,t,o+n);if(a){s=!0;let e=ou(a,t,n+o+1,r);e!=oi&&i.push(o,o+t.nodeSize,e);}});let o=oa(s?oc(e):e,-n).sort(od);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new or(o,i):oi;}function od(e,t){return e.from-t.from||e.to-t.to;}function oh(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),op(t,i+1,s.copy(r.to,s.to)));continue;}s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),op(t,i,r.copy(s.from,r.to)));break;}}return t;}function op(e,t,n){for(;t<e.length&&od(n,e[t])>0;)t++;e.splice(t,0,n);}function of(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=oi&&t.push(r);}),e.cursorWrapper&&t.push(or.create(e.state.doc,[e.cursorWrapper.deco])),oo.from(t);}let om={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},og=iv&&iy<=11;class ov{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset;}clear(){this.anchorNode=this.focusNode=null;}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset;}}class oy{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ov(),this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);iv&&iy<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():iC&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush();}),og&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this);}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush();},20));}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush());}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,om)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection();}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20);}this.observer.disconnect();}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection();}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50);}onSelectionChange(){if(sh(this.view)){if(this.suppressingSelectionUpdates)return si(this.view);if(iv&&iy<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&r7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon();}this.flush();}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange());}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set(),n;for(let n=e.focusNode;n;n=r5(n))t.add(n);for(let r=e.anchorNode;r;r=r5(r))if(t.has(r)){n=r;break;}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:is(n)?n.parentNode:n}))return this.setCurSelection(),!0;}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue;}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&sh(t)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],l);t&&(s=s<0?t.from:Math.min(t.from,s),o=o<0?t.to:Math.max(t.to,o),t.typeOver&&(a=!0));}if(l.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||ix&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let e of l)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&ii(t);){if("false"==t.contentEditable){e.parentNode.removeChild(e);break;}t=t.firstChild;}}}else if(ik&&l.length){let e=l.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove();}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n;}return null;}(t,n)!=e)&&r.remove();}}}let c=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&il(r)&&(c=sn(t))&&c.eq(rO.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,si(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,o),e=t,!ok.has(e)&&(ok.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=ik,ob||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ob=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let s of t)if((null==(n=s.parentNode)?void 0:n.nodeName)=="TR"){let t=s.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||!ii(e)||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e;}n.insertBefore(s,n.firstChild),r==s&&e.domSelection().collapse(s,i);}else s.parentNode.removeChild(s);}}(t,l)),this.handleDOMChange(s,o,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||si(t),this.currentSelection.set(r));}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),is(r)&&(this.lastChangedTextNode=r);}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(iv&&iy<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!s||0>Array.prototype.indexOf.call(e.addedNodes,s))&&(i=s);}let s=r&&r.parentNode==e.target?r6(r)+1:0,o=n.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?r6(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,a,1)};}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue});}}let ok=new WeakMap(),ob=!1;function ox(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return r7(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s};}let ow=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function oC(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:sd(e,t.resolve(n.anchor),t.resolve(n.head));}function oS(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++;}return i;}class oD{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new sz(),this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(o_),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=oM(this),oE(this),this.nodeViews=oN(this),this.docView=iY(this.state.doc,oA(this),of(this),this.dom,this),this.domObserver=new oy(this,(e,t,n,r)=>function(e,t,n,r,i){var s,o,a;let l,c,u,d,h,p=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=sn(e,t);if(n&&!e.state.selection.eq(n)){if(ix&&iE&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),p&&r.setMeta("composition",p),e.dispatch(r);}return;}let f=e.state.doc.resolve(t),m=f.sharedDepth(n);t=f.before(m+1),n=e.state.doc.resolve(n).after(m+1);let g=e.state.selection,v=function(e,t,n,r){let i,s,{node:o,fromOffset:a,toOffset:l,from:c,to:u}=e.docView.parseRange(t,n),d=e.domSelectionRange(),h=d.anchorNode;if(h&&io(e.dom,h)&&(s=[{node:h,offset:d.anchorOffset}],il(d)||s.push({node:d.focusNode,offset:d.focusOffset})),ix&&8===e.input.lastKeyCode)for(let e=l;e>a;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break;}if(!n||n.size)break;}let p=e.state.doc,f=e.someProp("domParser")||nQ.fromSchema(e.state.schema),m=p.resolve(c),g=null,v=f.parse(o,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:l,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:s,ruleFromNode:(i=r,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(i);if("BR"==e.nodeName&&e.parentNode){if(iC&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e};}else if(e.parentNode.lastChild==e||iC&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0};}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null;}),context:m});if(s&&null!=s[0].pos){let e=s[0].pos,t=s[1]&&s[1].pos;null==t&&(t=e),g={anchor:e+c,head:t+c};}return{doc:v,sel:g,from:c,to:u};}(e,t,n,i),y=e.state.doc,k=y.slice(v.from,v.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,d="end"):(u=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let b=function(e,t,n,r,i){let s=e.findDiffStart(t,n),o=n+e.size,a=n+t.size;if(null==s)return null;let{a:l,b:c}=e.findDiffEnd(t,o,a);if("end"==i){let e=Math.max(0,s-Math.min(l,c));r-=l+e-s;}if(l<s&&o<a){let e=r<=s&&r>=l?s-r:0;s-=e,c=s+(c-l),l=s;}else if(c<s){let e=r<=s&&r>=c?s-r:0;s-=e,l=s+(l-c),c=s;}return{start:s,endA:l,endB:c};}(k.content,v.doc.content,v.from,u,d);if(b&&e.input.domChangeCount++,(iS&&e.input.lastIOSEnter>Date.now()-225||iE)&&i.some(e=>ii(e)&&!ow.test(e.nodeName))&&(!b||b.endA>=b.endB)&&e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return;}if(!b)if(r&&g instanceof rL&&!g.empty&&g.$head.sameParent(g.$anchor)&&!e.composing&&!(v.sel&&v.sel.anchor!=v.sel.head))b={start:g.from,endA:g.to,endB:g.to};else{if(v.sel){let t=oC(e,e.state.doc,v.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);p&&n.setMeta("composition",p),e.dispatch(n);}}return;}e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof rL&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2&&e.state.selection.from>=v.from?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&e.state.selection.to<=v.to&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),iv&&iy<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>v.from&&"  "==v.doc.textBetween(b.start-v.from-1,b.start-v.from+1)&&(b.start--,b.endA--,b.endB--);let x=v.doc.resolveNoCache(b.start-v.from),w=v.doc.resolveNoCache(b.endB-v.from),C=y.resolve(b.start),S=x.sameParent(w)&&x.parent.inlineContent&&C.end()>=b.endA;if((iS&&e.input.lastIOSEnter>Date.now()-225&&(!S||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!S&&(s=v.doc,o=x.pos,a=w.pos,l=0,c=0,s.nodesBetween(o,a,(e,t)=>{e.isTextblock&&t>=o&&t<a?l++:(e.isText?/\S/.test(e.text.slice(Math.max(0,o-t),Math.min(e.nodeSize,a-t))):e.isLeaf)&&c++;}),0==c&&1==l))&&e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return;}if(e.state.selection.anchor>b.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||oS(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize;}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=e.resolve(oS(s,!0,!0));return!(!o.parent.isTextblock||o.pos>n||oS(o,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(o.parent.content);}(y,b.start,b.endA,x,w)&&e.someProp("handleKeyDown",t=>t(e,ic(8,"Backspace")))){iE&&ix&&e.domObserver.suppressSelectionUpdates();return;}ix&&b.endB==b.start&&(e.input.lastChromeDelete=Date.now()),iE&&!S&&x.start()!=w.start()&&0==w.parentOffset&&x.depth==w.depth&&v.sel&&v.sel.anchor==v.sel.head&&v.sel.head==b.endA&&(b.endB-=2,w=v.doc.resolveNoCache(b.endB-v.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,ic(13,"Enter"));});},20));let D=b.start,A=b.endA,E=t=>{let n=t||e.state.tr.replace(D,A,v.doc.slice(b.start-v.from,b.endB-v.from));if(v.sel){let t=oC(e,n.doc,v.sel);t&&!(ix&&e.composing&&t.empty&&(b.start!=b.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==D||t.head==n.mapping.map(A)-1)||iv&&t.empty&&t.head==D)&&n.setSelection(t);}return p&&n.setMeta("composition",p),n.scrollIntoView();};if(S){if(x.pos==w.pos){iv&&iy<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>si(e),20));let t=E(e.state.tr.delete(D,A)),n=y.resolve(b.start).marksAcross(y.resolve(b.endA));n&&t.ensureMarks(n),e.dispatch(t);}else if(b.endA==b.endB&&(h=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,o,a,l;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)s=n[e].removeFromSet(s);if(1==i.length&&0==s.length)a=i[0],o="add",l=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=s.length)return null;a=s[0],o="remove",l=e=>e.mark(a.removeFromSet(e.marks));}let c=[];for(let e=0;e<t.childCount;e++)c.push(l(t.child(e)));if(nm.from(c).eq(e))return{mark:a,type:o};}(x.parent.content.cut(x.parentOffset,w.parentOffset),C.parent.content.cut(C.parentOffset,b.endA-C.start())))){let t=E(e.state.tr);"add"==h.type?t.addMark(D,A,h.mark):t.removeMark(D,A,h.mark),e.dispatch(t);}else if(x.parent.child(x.index()).isText&&x.index()==w.index()-!w.textOffset){let t=x.parent.textBetween(x.parentOffset,w.parentOffset),n=()=>E(e.state.tr.insertText(t,D,A));e.someProp("handleTextInput",r=>r(e,D,A,t,n))||e.dispatch(n());}else e.dispatch(E());}else e.dispatch(E());}(this,e,t,n,r)),this.domObserver.start();var n=this;for(let e in sj){let t=sj[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=e=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0;}(n,e)||sL(n,e)||!n.editable&&e.type in sF||t(n,e);},sO[e]?{passive:!0}:void 0);}iC&&n.dom.addEventListener("input",()=>null),sP(n),this.updatePluginViews();}get composing(){return this.input.composing;}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state;}return this._props;}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&sP(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(o_),this.directPlugins=e.plugins),this.updateStateInner(e.state,t);}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t);}updateState(e){this.updateStateInner(e,this._props);}updateStateInner(e,t){var n,r,i;let s=this.state,o=!1,a=!1;e.storedMarks&&this.composing&&(sY(this),a=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=oN(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++;}for(let e in t)r++;return n!=r;})(e,this.nodeViews)&&(this.nodeViews=e,o=!0);}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&sP(this),this.editable=oM(this),oE(this);let c=of(this),u=oA(this),d=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",h=o||!this.docView.matchesNode(e.doc,u,c);(h||!e.selection.eq(s.selection))&&(a=!0);let p="preserve"==d&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let s=(r.left+r.right)/2,o=i+1;o<Math.min(innerHeight,r.bottom);o+=5){let r=e.root.elementFromPoint(s,o);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break;}}return{refDOM:t,refTop:n,stack:iR(e.dom)};}(this);if(a){let t,n,a;this.domObserver.stop();let l=h&&(iv||ix)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&(r=s.selection,i=e.selection,a=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(a)!=i.$anchor.start(a));if(h){let t=ix?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(is(e)&&t)return e;if(ii(e)&&t>0){if("false"==e.contentEditable)return null;t=ir(e=e.childNodes[t-1]);}else{if(!e.parentNode||ia(e))return null;t=r6(e),e=e.parentNode;}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(is(e)&&t<e.nodeValue.length)return e;if(ii(e)&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0;}else{if(!e.parentNode||ia(e))return null;t=r6(e)+1,e=e.parentNode;}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r;}}return n||r;}(this)),(o||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=iY(e.doc,u,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(l=!0);}let d=this.input.mouseDown;l||!(d&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),r7(t.node,t.offset,n.anchorNode,n.anchorOffset))&&d.delaySelUpdate())?si(this,l):(sc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(s),(null==(n=this.dragging)?void 0:n.node)&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),"reset"==d?this.dom.scrollTop=0:"to selection"==d?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;iI(n,0==r?0:r-t);}(p);}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&io(this.dom,e))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof rq){let t=this.docView.domAfterPos(this.state.selection.from);ii(t)&&iT(this,t.getBoundingClientRect(),e);}else iT(this,this.coordsAtPos(this.state.selection.head,1),e);}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy();}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e);}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this));}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this));}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e);}this.dragging=new s3(e.slice,e.move,r<0?void 0:rq.create(this.state.doc,r));}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r;}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let s=i[n].props[e];if(null!=s&&(r=t?t(s):s))return r;}}hasFocus(){if(iv){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement;}return!0;}return this.root.activeElement==this.dom;}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ij)return e.focus(ij);let t=iR(e);e.focus(null==ij?{get preventScroll(){return ij={preventScroll:!0},!0;}}:void 0),ij||(ij=!1,iI(t,0));}(this.dom),si(this),this.domObserver.start();}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;}return e||document;}updateRoot(){this._root=null;}posAtCoords(e){return function(e,t){var n;let r,i,s=e.dom.ownerDocument,o,a=0,l=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ir(r.offsetNode),r.offset)};}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ir(r.startContainer),r.startOffset)};}}(s,t.left,t.top);l&&({node:o,offset:a}=l);let c=(e.root.elementFromPoint?e.root:s).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(c)){let n=e.dom.getBoundingClientRect();if(!iF(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let s=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),o=s;;){let r=t.childNodes[o];if(ii(r)){let t=r.getClientRects();for(let i=0;i<t.length;i++){let s=t[i];if(iF(n,s))return e(r,n,s);}}if((o=(o+1)%i)==s)break;}return t;}(e.dom,t,n)))return null;}if(iC)for(let e=c;o&&e;e=r5(e))e.draggable&&(o=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,o){let n;if(ik&&ii(o)&&(a=Math.min(a,o.childNodes.length))<o.childNodes.length){let e=o.childNodes[a],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&a++;}iM&&a&&ii(o)&&ii(n=o.childNodes[a-1])&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&a--,o==e.dom&&a==o.childNodes.length-1&&ii(o.lastChild)&&t.top>o.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:0!=a&&ii(o)&&"BR"==o.childNodes[a-1].nodeName||(i=function(e,t,n,r){let i=-1;for(let n=t,s=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(ii(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!s&&o.left>r.left||o.top>r.top?i=t.posBefore:(!s&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),s=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode;}return i>-1?i:e.docView.posFromDOM(t,n,-1);}(e,o,a,t));}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,s,o=2e8,a,l=0,c=n.top,u=n.top;for(let e=t.firstChild,d=0;e;e=e.nextSibling,d++){let t;if(ii(e))t=e.getClientRects();else{if(!is(e))continue;t=r9(e).getClientRects();}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=c&&p.bottom>=u){c=Math.max(p.bottom,c),u=Math.min(p.top,u);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<o){r=e,o=t,a=t&&is(r)?{left:p.right<n.left?p.right:p.left,top:n.top}:n,ii(e)&&t&&(l=d+ +(n.left>=(p.left+p.right)/2));continue;}}else p.top>n.top&&!i&&p.left<=n.left&&p.right>=n.left&&(i=e,s={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!r&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(l=d+1);}}return(!r&&i&&(r=i,a=s,o=0),r&&is(r))?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let n=iz(r,1);if(n.top!=n.bottom&&iF(t,n)){i={node:e,offset:s+ +(t.left>=(n.left+n.right)/2)};break;}}return r.detach(),i||{node:e,offset:0};}(r,a):!r||o?{node:t,offset:l}:e(r,a);}(t,n),s=-1;if(ii(r)&&!r.firstChild){let e=r.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1;}return e.docView.posFromDOM(r,i,s);}(e,c,t));let u=e.docView.nearestDesc(c,!0);return{pos:i,inside:u?u.posAtStart-u.border:-1};}(this,e);}coordsAtPos(e,t=1){return iP(this,e,t);}domAtPos(e,t=0){return this.docView.domFromPos(e,t);}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null;}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r;}endOfTextblock(e,t){return function(e,t,n){let r,i;return iU==t&&iW==n?iK:(iU=t,iW=n,iK="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,iq(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break;}t=n.dom.parentNode;}let r=iP(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(ii(e))t=e.getClientRects();else{if(!is(e))continue;t=r9(e,0,e.nodeValue.length).getClientRects();}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1;}}return!0;})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=i==r.parent.content.size,o=e.domSelection();return o?iV.test(r.parent.textContent)&&o.modify?iq(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:s,anchorOffset:a}=e.domSelectionRange(),l=o.caretBidiLevel;o.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),h=u&&!io(c,u)||t==u&&i==d;try{o.collapse(s,a),t&&(t!=s||i!=a)&&o.extend&&o.extend(t,i);}catch(e){}return null!=l&&(o.caretBidiLevel=l),h;}):"left"==n||"backward"==n?!i:s:r.pos==r.start()||r.pos==r.end();}(e,t,n));}(this,t||this.state,e);}pasteHTML(e,t){return s1(this,"",e,!1,t||new ClipboardEvent("paste"));}pasteText(e,t){return s1(this,e,null,!0,t||new ClipboardEvent("paste"));}serializeForClipboard(e){return sD(this,e);}destroy(){if(this.docView){for(let e in this.input.mouseDown&&this.input.mouseDown.done(),this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],of(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,r8();}}get isDestroyed(){return null==this.docView;}dispatchEvent(e){!sL(this,e)&&sj[e.type]&&(this.editable||!(e.type in sF))&&sj[e.type](this,e);}domSelectionRange(){let e=!1!==this.dom.isConnected&&this.domSelection();return e?iC&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t;}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ox(e,n);}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0];}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?ox(e,n):null;}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0};}domSelection(){return this.root.getSelection();}}function oA(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]));}),t.translate||(t.translate="no"),[oe.node(0,e.state.doc.content.size,t)];}function oE(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:oe.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})};}else e.cursorWrapper=null;}function oM(e){return!e.someProp("editable",t=>!1===t(e.state));}function oN(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);}return e.someProp("nodeViews",n),e.someProp("markViews",n),t;}function o_(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component");}oD.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e));};let oT=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function oR(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break;}return!1;}function oI(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break;}return null;}function oj(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break;}return null;}function oF(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n;}return null;}let oO=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof rU||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=oF(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,s.createAndFill());o.setSelection(rL.create(o.doc,n+1)),t(o.scrollIntoView());}return!0;},oz=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(rb(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0;}let r=n.blockRange(),i=r&&rg(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0);},oB=(e,t)=>{if(e.selection instanceof rq&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!rb(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof rL||e.selection instanceof rU)&&n.deleteSelection();let{$from:r}=n.selection,i=n.steps.length,s=[],o,a,l=!1,c=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let t;l=r.end(e)==r.pos+(r.depth-e),c=r.start(e)==r.pos-(r.depth-e),a=oF(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));s.unshift(t||(l&&a?{type:a}:null)),o=e;break;}if(1==e)return!1;s.unshift(null);}let u=r.pos,d=rb(n.doc,u,s.length,s);if(d||(s[0]=a?{type:a}:null,d=rb(n.doc,u,s.length,s)),!d)return!1;if(n.split(u,s.length,s),!l&&c&&r.node(o).type!=a){let e=n.mapping.slice(i),t=e.map(r.before(o)),s=n.doc.resolve(t);a&&r.node(o-1).canReplaceWith(s.index(),s.index()+1,a)&&n.setNodeMarkup(e.map(r.before(o)),a);}return t&&t(n.scrollIntoView()),!0;};function oP(e,t,n,r){let i,s,o,a=t.nodeBefore,l=t.nodeAfter,c,u,d=a.type.spec.isolating||l.type.spec.isolating;if(!d&&(i=t.nodeBefore,s=t.nodeAfter,o=t.index(),i&&s&&i.type.compatibleContent(s.type)&&(!i.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(o,o+1)&&!!(s.isTextblock||rx(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let h=!d&&t.parent.canReplace(t.index(),t.index()+1);if(h&&(c=(u=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&u.matchType(c[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=nm.empty;for(let e=c.length-1;e>=0;e--)i=nm.from(c[e].create(null,i));i=nm.from(a.copy(i));let s=e.tr.step(new rp(t.pos-1,r,t.pos,r,new nx(i,1,0),c.length,!0)),o=s.doc.resolve(r+2*c.length);o.nodeAfter&&o.nodeAfter.type==a.type&&rx(s.doc,o.pos)&&s.join(o.pos),n(s.scrollIntoView());}return!0;}let p=l.type.spec.isolating||r>0&&d?null:rO.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&rg(f);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0;if(h&&oR(l,"start",!0)&&oR(a,"end")){let r=a,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let s=l,o=1;for(;!s.isTextblock;s=s.firstChild)o++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=nm.empty;for(let e=i.length-1;e>=0;e--)r=nm.from(i[e].copy(r));n(e.tr.step(new rp(t.pos-i.length,t.pos+l.nodeSize,t.pos+o,t.pos+l.nodeSize-o,new nx(r,i.length,0),0,!0)).scrollIntoView());}return!0;}}return!1;}function oL(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--;}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(rL.create(t.doc,e<0?i.start(s):i.end(s)))),!0);};}let o$=oL(-1),oq=oL(1);function oV(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(s,o,(r,s)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(s),r=t.index();i=t.parent.canReplaceWith(r,r+1,e);}});}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(s,o,e,t);}r(i.scrollIntoView());}return!0;};}function oU(e,t=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms),s=!(n&&n.includeWhitespace);return function(n,o){let{empty:a,$cursor:l,ranges:c}=n.selection;if(a&&!l||!function(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:s,$to:o}=t[i],a=0==s.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(s.pos,o.pos,(e,t)=>{if(a||!r&&e.isAtom&&e.isInline&&t>=s.pos&&t+e.nodeSize<=o.pos)return!1;a=e.inlineContent&&e.type.allowsMarkType(n);}),a)return!0;}return!1;}(n.doc,c,e,i))return!1;if(o)if(l)o(e.isInSet(n.storedMarks||l.marks())?n.tr.removeStoredMark(e):n.tr.addStoredMark(e.create(t)));else{let a,l=n.tr;i||(c=function(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new rz(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1;}),r.pos<i.pos&&t.push(new rz(r,i));}return t;}(c)),a=r?!c.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!c.every(t=>{let n=!1;return l.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,s)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!s&&s.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))));}),!n;});for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(a){let n=r.pos,o=i.pos,a=r.nodeAfter,c=i.nodeBefore,u=s&&a&&a.isText?/^\s*/.exec(a.text)[0].length:0,d=s&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+u<o&&(n+=u,o-=d),l.addMark(n,o,e.create(t));}else l.removeMark(r.pos,i.pos,e);}o(l.scrollIntoView());}return!0;};}function oW(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1;};}let oK=oW(oT,(e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null;}(e,n);if(!r)return!1;let i=oI(r);if(!i){let n=r.blockRange(),i=n&&rg(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0);}let s=i.nodeBefore;if(oP(e,i,t,-1))return!0;if(0==r.parent.content.size&&(oR(s,"end")||rq.isSelectable(s)))for(let n=r.depth;;n--){let o=rw(e.doc,r.before(n),r.after(n),nx.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(oR(s,"end")?rO.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):rq.create(n.doc,i.pos-s.nodeSize)),t(n.scrollIntoView());}return!0;}if(1==n||r.node(n-1).childCount>1)break;}return!!s.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0);},(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=oI(r);}let o=s&&s.nodeBefore;return!!o&&!!rq.isSelectable(o)&&(t&&t(e.tr.setSelection(rq.create(e.doc,s.pos-o.nodeSize)).scrollIntoView()),!0);}),oH=oW(oT,(e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null;}(e,n);if(!r)return!1;let i=oj(r);if(!i)return!1;let s=i.nodeAfter;if(oP(e,i,t,1))return!0;if(0==r.parent.content.size&&(oR(s,"start")||rq.isSelectable(s))){let n=rw(e.doc,r.before(),r.after(),nx.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(oR(s,"start")?rO.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):rq.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView());}return!0;}}return!!s.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0);},(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=oj(r);}let o=s&&s.nodeAfter;return!!o&&!!rq.isSelectable(o)&&(t&&t(e.tr.setSelection(rq.create(e.doc,s.pos)).scrollIntoView()),!0);}),oJ={Enter:oW((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0);},oO,oz,oB),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=oF(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(rO.near(i.doc.resolve(r),1)),t(i.scrollIntoView());}return!0;},Backspace:oK,"Mod-Backspace":oK,"Shift-Backspace":oK,Delete:oH,"Mod-Delete":oH,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new rU(e.doc))),!0)},oG={"Ctrl-h":oJ.Backspace,"Alt-Backspace":oJ["Mod-Backspace"],"Ctrl-d":oJ.Delete,"Ctrl-Alt-Backspace":oJ["Mod-Delete"],"Alt-Delete":oJ["Mod-Delete"],"Alt-d":oJ["Mod-Delete"],"Ctrl-a":o$,"Ctrl-e":oq};for(let e in oJ)oG[e]=oJ[e];let oZ=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?oG:oJ;var oQ=function(){};oQ.prototype.append=function(e){return e.length?(e=oQ.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this;},oQ.prototype.prepend=function(e){return e.length?oQ.from(e).append(this):this;},oQ.prototype.appendInner=function(e){return new oX(this,e);},oQ.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?oQ.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t));},oQ.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e);},oQ.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0);},oQ.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n));},t,n),r;},oQ.from=function(e){return e instanceof oQ?e:e&&e.length?new oY(e):oQ.empty;};var oY=function(e){function t(t){e.call(this),this.values=t;}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values;},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n));},t.prototype.getInner=function(e){return this.values[e];},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1;},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1;},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()));},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values));},n.length.get=function(){return this.values.length;},n.depth.get=function(){return 0;},Object.defineProperties(t.prototype,n),t;}(oQ);oQ.empty=new oY([]);var oX=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1;}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten());},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length);},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1;},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1;},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n));},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n);},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right);},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e);},t;}(oQ);class o0{constructor(e,t){this.items=e,this.eventCount=t;}popEvent(e,t){let n,r,i,s;if(0==this.eventCount)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break;}t&&(r=(n=this.remapping(o,this.items.length)).maps.length);let a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(o,t+1)).maps.length),r--,c.push(e);return;}if(n){c.push(new o1(e.map));let t=e.step.map(n.slice(r)),i;t&&a.maybeStep(t).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new o1(i,void 0,void 0,l.length+c.length))),r--,i&&n.appendMap(i,r);}else a.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,s=new o0(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1;},this.items.length,0),{remaining:s,transform:a,selection:i};}addTransform(e,t,n,r){var i,s;let o,a=[],l=this.eventCount,c=this.items,u=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),s=new o1(e.mapping.maps[n],i,t),o;(o=u&&u.merge(s))&&(s=o,n?a.pop():c=c.slice(0,c.length-1)),a.push(s),t&&(l++,t=void 0),r||(u=s);}let d=l-n.depth;return d>o3&&(i=c,s=d,i.forEach((e,t)=>{if(e.selection&&0==s--)return o=t,!1;}),c=i.slice(o),l-=d),new o0(c.append(a),l);}remapping(e,t){let n=new rr();return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i);},e,t),n;}addMaps(e){return 0==this.eventCount?this:new o0(this.items.append(e.map(e=>new o1(e))),this.eventCount);}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(e=>{e.selection&&o--;},r);let a=t;this.items.forEach(t=>{let r=i.getMirror(--a);if(null==r)return;s=Math.min(s,r);let l=i.maps[r];if(t.step){let s=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&o++,n.push(new o1(l,s,c));}else n.push(new o1(l));},r);let l=[];for(let e=t;e<s;e++)l.push(new o1(i.maps[e]));let c=new o0(this.items.slice(0,r).append(l).append(n),o);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c;}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++;}),e;}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)r.push(s),s.selection&&i++;else if(s.step){let e=s.step.map(t.slice(n)),o=e&&e.getMap();if(n--,o&&t.appendMap(o,n),e){let a=s.selection&&s.selection.map(t.slice(n));a&&i++;let l=new o1(o.invert(),e,a),c,u=r.length-1;(c=r.length&&r[u].merge(l))?r[u]=c:r.push(l);}}else s.map&&n--;},this.items.length,0),new o0(oQ.from(r.reverse()),i);}}o0.empty=new o0(oQ.empty,0);class o1{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r;}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new o1(t.getMap().invert(),t,this.selection);}}}class o2{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i;}}let o3=20;function o6(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t;}function o5(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s);}return n;}let o4=!1,o9=null;function o8(e){let t=e.plugins;if(o9!=t){o4=!1,o9=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){o4=!0;break;}}return o4;}let o7=new r3("history"),ae=new r3("closeHistory");function at(e,t){return(n,r)=>{let i=o7.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let s=function(e,t,n){let r=o8(t),i=o7.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),l=new o2(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(o7,{redo:n,historyState:l});}(i,n,e);s&&r(t?s.scrollIntoView():s);}return!0;};}let an=at(!1,!0),ar=at(!0,!0);at(!1,!1),at(!0,!1);class ai{constructor(e,t,n={}){var r;this.match=e,this.match=e,this.handler="string"==typeof t?(r=t,function(e,t,n,i){let s=r;if(t[1]){let e=t[0].lastIndexOf(t[1]);s+=t[0].slice(e+t[1].length);let r=(n+=e)-i;r>0&&(s=t[0].slice(e-r,e)+s,n=i);}return e.tr.insertText(s,n,i);}):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark;}}function as(e,t,n,r,i,s){if(e.composing)return!1;let o=e.state,a=o.doc.resolve(t),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c<i.length;c++){let u=i[c];if(!u.inCodeMark&&a.marks().some(e=>e.type.spec.code))continue;if(a.parent.type.spec.code){if(!u.inCode)continue;}else if("only"===u.inCode)continue;let d=u.match.exec(l);if(!d||d[0].length<r.length)continue;let h=t-(d[0].length-r.length);if(!u.inCodeMark){let e=!1;if(o.doc.nodesBetween(h,a.pos,t=>{t.isInline&&t.marks.some(e=>e.type.spec.code)&&(e=!0);}),e)continue;}let p=u.handler(o,d,h,n);if(p)return u.undoable&&p.setMeta(s,{transform:p,from:t,to:n,text:r}),e.dispatch(p),!0;}return!1;}let ao=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){let n=e.tr,r=s.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(s.text){let t=n.doc.resolve(s.from).marks();n.replaceWith(s.from,s.to,e.schema.text(s.text,t));}else n.delete(s.from,s.to);t(n);}return!0;}}return!1;};function aa(e,t,n=null,r){return new ai(e,(e,i,s,o)=>{let a=n instanceof Function?n(i):n,l=e.tr.delete(s,o),c=l.doc.resolve(s).blockRange(),u=c&&function(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null;}(e,t),s=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?o:null;}(r,t);return s?i.map(rv).concat({type:t,attrs:n}).concat(s.map(rv)):null;}(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(s-1).nodeBefore;return d&&d.type==t&&rx(l.doc,s-1)&&(!r||r(i,d))&&l.join(s-1),l;});}new ai(/--$/,"—",{inCodeMark:!1}),new ai(/\.\.\.$/,"…",{inCodeMark:!1}),new ai(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new ai(/"$/,"”",{inCodeMark:!1}),new ai(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new ai(/'$/,"’",{inCodeMark:!1});for(var al={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ac={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},au="u">typeof navigator&&/Mac/.test(navigator.platform),ad="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ah=0;ah<10;ah++)al[48+ah]=al[96+ah]=String(ah);for(var ah=1;ah<=24;ah++)al[ah+111]="F"+ah;for(var ah=65;ah<=90;ah++)al[ah]=String.fromCharCode(ah+32),ac[ah]=String.fromCharCode(ah);for(var ap in al)ac.hasOwnProperty(ap)||(ac[ap]=al[ap]);let af="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),am="u">typeof navigator&&/Win/.test(navigator.platform);function ag(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e;}function av(e){let t;return new r0({props:{handleKeyDown:(t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,s=e.split(/-(?!$)/),o=s[s.length-1];"Space"==o&&(o=" ");for(let e=0;e<s.length-1;e++){let o=s[e];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))t=!0;else if(/^(c|ctrl|control)$/i.test(o))n=!0;else if(/^s(hift)?$/i.test(o))r=!0;else if(/^mod$/i.test(o))af?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+o);}return t&&(o="Alt-"+o),n&&(o="Ctrl-"+o),i&&(o="Meta-"+o),r&&(o="Shift-"+o),o;}(n)]=e[n];return t;}(e),function(e,n){var r;let i=("Esc"==(r=!(au&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ad&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?ac:al)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),s,o=t[ag(i,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[ag(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0;}if((n.altKey||n.metaKey||n.ctrlKey)&&!(am&&n.ctrlKey&&n.altKey)&&(s=al[n.keyCode])&&s!=i){let r=t[ag(s,n)];if(r&&r(e.state,e.dispatch,e))return!0;}}return!1;})}});}function ay(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return!!s&&(!n||(r.node(s.depth-1).type==e?function(e,t,n,r){let i=e.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new rp(s-1,o,s,o,new nx(nm.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new nR(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let a=rg(r);if(null==a)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return rx(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0;}(t,n,e,s):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,s=n.startIndex;t>s;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+ +!a,u+1,o.content.append(l?nm.empty:nm.from(i))))return!1;let d=s.pos,h=d+o.nodeSize;return r.step(new rp(d-!!a,h+ +!!l,d+1,h-1,new nx((a?nm.empty:nm.from(i.copy(nm.empty))).append(l?nm.empty:nm.from(i.copy(nm.empty))),+!a,+!l),+!a)),t(r.scrollIntoView()),!0;}(t,n,s)));};}let ak={};function ab(e,t){"string"!=typeof t&&(t=ab.defaultChars);let n=function(e){let t=ak[e];if(t)return t;t=ak[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n);}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2);}return t;}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let r=0,i=e.length;r<i;r+=3){let s=parseInt(e.slice(r+1,r+3),16);if(s<128){t+=n[s];continue;}if((224&s)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((192&n)==128){let e=s<<6&1984|63&n;e<128?t+="��":t+=String.fromCharCode(e),r+=3;continue;}}if((240&s)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((192&n)==128&&(192&i)==128){let e=s<<12&61440|n<<6&4032|63&i;e<2048||e>=55296&&e<=57343?t+="���":t+=String.fromCharCode(e),r+=6;continue;}}if((248&s)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((192&n)==128&&(192&i)==128&&(192&o)==128){let e=s<<18&1835008|n<<12&258048|i<<6&4032|63&o;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue;}}t+="�";}return t;});}ab.defaultChars=";/?:@&=+$,#",ab.componentChars="";let ax={};function aw(e,t,n){"string"!=typeof t&&(n=t,t=aw.defaultChars),void 0===n&&(n=!0);let r=function(e){let t=ax[e];if(t)return t;t=ax[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t;}(t),i="";for(let t=0,s=e.length;t<s;t++){let o=e.charCodeAt(t);if(n&&37===o&&t+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue;}if(o<128){i+=r[o];continue;}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<s){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue;}}i+="%EF%BF%BD";continue;}i+=encodeURIComponent(e[t]);}return i;}function aC(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"";}function aS(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null;}aw.defaultChars=";/?:@&=+$,-_.!~*'()#",aw.componentChars="-_.!~*'()";let aD=/^([a-z0-9.+-]+:)/i,aA=/:[0-9]*$/,aE=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,aM=["%","/","?",";","#"].concat(["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]))),aN=["/","?","#"],a_=/^[+a-z0-9A-Z_-]{0,63}$/,aT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,aR={javascript:!0,"javascript:":!0},aI={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};aS.prototype.parse=function(e,t){let n,r,i,s=e;if(s=s.trim(),!t&&1===e.split("#").length){let e=aE.exec(s);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this;}let o=aD.exec(s);if(o&&(n=(o=o[0]).toLowerCase(),this.protocol=o,s=s.substr(o.length)),(t||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===s.substr(0,2))&&!(o&&aR[o])&&(s=s.substr(2),this.slashes=!0),!aR[o]&&(i||o&&!aI[o])){let e,t,n=-1;for(let e=0;e<aN.length;e++)-1!==(r=s.indexOf(aN[e]))&&(-1===n||r<n)&&(n=r);-1!==(t=-1===n?s.lastIndexOf("@"):s.lastIndexOf("@",n))&&(e=s.slice(0,t),s=s.slice(t+1),this.auth=e),n=-1;for(let e=0;e<aM.length;e++)-1!==(r=s.indexOf(aM[e]))&&(-1===n||r<n)&&(n=r);-1===n&&(n=s.length),":"===s[n-1]&&n--;let i=s.slice(0,n);s=s.slice(n),this.parseHost(i),this.hostname=this.hostname||"";let o="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(a_)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(a_)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(aT);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(s=i.join(".")+s),this.hostname=r.join(".");break;}}}}this.hostname.length>255&&(this.hostname=""),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2));}let a=s.indexOf("#");-1!==a&&(this.hash=s.substr(a),s=s.slice(0,a));let l=s.indexOf("?");return-1!==l&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),aI[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this;},aS.prototype.parseHost=function(e){let t=aA.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e);};let aj=function(e,t){if(e&&e instanceof aS)return e;let n=new aS();return n.parse(e,t),n;};e.s(["decode",0,ab,"encode",0,aw,"format",0,aC,"parse",0,aj],65555);var aF=e.i(65555);let aO=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,az=/[\0-\x1F\x7F-\x9F]/,aB=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,aP=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,aL=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;e.s(["Any",0,aO,"Cc",0,az,"Cf",0,/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,"P",0,aB,"S",0,aP,"Z",0,aL],7055);var a$=e.i(7055);let aq=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),aV=new Uint16Array("Ȁaglq \x15\x18\x1bɭ\x0f\0\0\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),aU=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),aW=null!=(a=String.fromCodePoint)?a:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e);};function aK(e){return e>=l.ZERO&&e<=l.NINE;}(t=l||(l={}))[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z",(n=c||(c={}))[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE",(r=u||(u={}))[r.EntityStart=0]="EntityStart",r[r.NumericStart=1]="NumericStart",r[r.NumericDecimal=2]="NumericDecimal",r[r.NumericHex=3]="NumericHex",r[r.NamedEntity=4]="NamedEntity",(i=d||(d={}))[i.Legacy=0]="Legacy",i[i.Strict=1]="Strict",i[i.Attribute=2]="Attribute";class aH{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=u.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=d.Strict;}startEntity(e){this.decodeMode=e,this.state=u.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1;}write(e,t){switch(this.state){case u.EntityStart:if(e.charCodeAt(t)===l.NUM)return this.state=u.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1);return this.state=u.NamedEntity,this.stateNamedEntity(e,t);case u.NumericStart:return this.stateNumericStart(e,t);case u.NumericDecimal:return this.stateNumericDecimal(e,t);case u.NumericHex:return this.stateNumericHex(e,t);case u.NamedEntity:return this.stateNamedEntity(e,t);}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===l.LOWER_X?(this.state=u.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=u.NumericDecimal,this.stateNumericDecimal(e,t));}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i;}}stateNumericHex(e,t){let n=t;for(;t<e.length;){var r;let i=e.charCodeAt(t);if(!aK(i)&&(!((r=i)>=l.UPPER_A)||!(r<=l.UPPER_F))&&(!(r>=l.LOWER_A)||!(r<=l.LOWER_F)))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(i,3);t+=1;}return this.addToNumericResult(e,n,t,16),-1;}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(!aK(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1;}return this.addToNumericResult(e,n,t,10),-1;}emitNumericEntity(e,t){var n,r,i;if(this.consumed<=t)return null==(n=this.errors)||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===l.SEMI)this.consumed+=1;else if(this.decodeMode===d.Strict)return 0;return this.emitCodePoint((r=this.result)>=55296&&r<=57343||r>1114111?65533:null!=(i=aU.get(r))?i:r,this.consumed),this.errors&&(e!==l.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed;}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&c.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let s=e.charCodeAt(t);if(this.treeIndex=function(e,t,n,r){let i=(t&c.BRANCH_LENGTH)>>7,s=t&c.JUMP_TABLE;if(0===i)return 0!==s&&r===s?n:-1;if(s){let t=r-s;return t<0||t>=i?-1:e[n+t]-1;}let o=n,a=o+i-1;for(;o<=a;){let t=o+a>>>1,n=e[t];if(n<r)o=t+1;else{if(!(n>r))return e[t+i];a=t-1;}}return-1;}(n,r,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return 0===this.result||this.decodeMode===d.Attribute&&(0===i||function(e){var t;return e===l.EQUALS||(t=e)>=l.UPPER_A&&t<=l.UPPER_Z||t>=l.LOWER_A&&t<=l.LOWER_Z||aK(t);}(s))?0:this.emitNotTerminatedNamedEntity();if(0!=(i=((r=n[this.treeIndex])&c.VALUE_LENGTH)>>14)){if(s===l.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==d.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0);}}return-1;}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&c.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null==(e=this.errors)||e.missingSemicolonAfterCharacterReference(),this.consumed;}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~c.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n;}end(){var e;switch(this.state){case u.NamedEntity:return 0!==this.result&&(this.decodeMode!==d.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case u.NumericDecimal:return this.emitNumericEntity(0,2);case u.NumericHex:return this.emitNumericEntity(0,3);case u.NumericStart:return null==(e=this.errors)||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case u.EntityStart:return 0;}}}function aJ(e){let t="",n=new aH(e,e=>t+=aW(e));return function(e,r){let i=0,s=0;for(;(s=e.indexOf("&",s))>=0;){t+=e.slice(i,s),n.startEntity(r);let o=n.write(e,s+1);if(o<0){i=s+n.end();break;}i=s+o,s=0===o?i+1:i;}let o=t+e.slice(i);return t="",o;};}let aG=aJ(aq);aJ(aV);let aZ=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);function aQ(e,t){return function(n){let r,i=0,s="";for(;r=e.exec(n);)i!==r.index&&(s+=n.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+n.substring(i);};}String.prototype.codePointAt,aQ(/[&<>'"]/g,aZ),aQ(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),aQ(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),(s=h||(h={}))[s.XML=0]="XML",s[s.HTML=1]="HTML",(o=p||(p={}))[o.UTF8=0]="UTF8",o[o.ASCII=1]="ASCII",o[o.Extensive=2]="Extensive",o[o.Attribute=3]="Attribute",o[o.Text=4]="Text";let aY=Object.prototype.hasOwnProperty;function aX(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n];});}}),e;}function a0(e){return(!(e>=55296)||!(e<=57343))&&(!(e>=64976)||!(e<=65007))&&(65535&e)!=65535&&(65535&e)!=65534&&(!(e>=0)||!(e<=8))&&11!==e&&(!(e>=14)||!(e<=31))&&(!(e>=127)||!(e<=159))&&!(e>1114111)&&!0;}function a1(e){return e>65535?String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e)):String.fromCharCode(e);}let a2=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,a3=RegExp(a2.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),a6=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function a5(e){return 0>e.indexOf("\\")&&0>e.indexOf("&")?e:e.replace(a3,function(e,t,n){if(t)return t;if(35===n.charCodeAt(0)&&a6.test(n)){let t="x"===n[1].toLowerCase()?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return a0(t)?a1(t):e;}let r=function(e,t=d.Legacy){return aG(e,t);}(e);return r!==e?r:e;});}let a4=/[&<>"]/,a9=/[&<>"]/g,a8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function a7(e){return a8[e];}function le(e){return a4.test(e)?e.replace(a9,a7):e;}let lt=/[.?*+^$[\]\\(){}|-]/g;function ln(e){switch(e){case 9:case 32:return!0;}return!1;}function lr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0;}return!1;}function li(e){return aB.test(e)||aP.test(e);}function ls(e){return li(a1(e));}function lo(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1;}}function la(e){return(e=e.trim().replace(/\s+/g," ")).toLowerCase().toUpperCase();}function ll(e){return 32===e||9===e||10===e||13===e;}function lc(e){let t=0;for(;t<e.length&&ll(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&ll(e.charCodeAt(n));n--);return e.slice(t,n+1);}e.s(["arrayReplaceAt",0,function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1));},"asciiTrim",0,lc,"assign",0,aX,"escapeHtml",0,le,"escapeRE",0,function(e){return e.replace(lt,"\\$&");},"fromCodePoint",0,a1,"has",0,function(e,t){return aY.call(e,t);},"isMdAsciiPunct",0,lo,"isPunctChar",0,li,"isPunctCharCode",0,ls,"isSpace",0,ln,"isString",0,function(e){return"[object String]"===Object.prototype.toString.call(e);},"isValidEntityCode",0,a0,"isWhiteSpace",0,lr,"lib",0,{mdurl:aF,ucmicro:a$},"normalizeReference",0,la,"unescapeAll",0,a5,"unescapeMd",0,function(e){return 0>e.indexOf("\\")?e:e.replace(a2,"$1");}],37422);var lu=e.i(37422);e.s(["parseLinkDestination",0,function(e,t,n){let r,i=t,s={ok:!1,pos:0,str:""};if(60===e.charCodeAt(i)){for(i++;i<n&&10!==(r=e.charCodeAt(i))&&60!==r;){if(62===r){s.pos=i+1,s.str=a5(e.slice(t+1,i)),s.ok=!0;break;}if(92===r&&i+1<n){i+=2;continue;}i++;}return s;}let o=0;for(;i<n&&32!==(r=e.charCodeAt(i))&&!(r<32)&&127!==r;){if(92===r&&i+1<n){if(32===e.charCodeAt(i+1)){i++;continue;}i+=2;continue;}if(40===r&&++o>32)return s;if(41===r){if(0===o)break;o--;}i++;}return t===i||0!==o||(s.str=a5(e.slice(t,i)),s.pos=i,s.ok=!0),s;},"parseLinkLabel",0,function(e,t,n){let r,i,s,o,a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(93===(s=e.src.charCodeAt(e.pos))&&0==--r){i=!0;break;}if(o=e.pos,e.md.inline.skipToken(e),91===s){if(o===e.pos-1)r++;else if(n)return e.pos=l,-1;}}let c=-1;return i&&(c=e.pos),e.pos=l,c;},"parseLinkTitle",0,function(e,t,n,r){let i,s=t,o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let r=e.charCodeAt(s);if(34!==r&&39!==r&&40!==r)return o;t++,s++,40===r&&(r=41),o.marker=r;}for(;s<n;){if((i=e.charCodeAt(s))===o.marker)return o.pos=s+1,o.str+=a5(e.slice(t,s)),o.ok=!0,o;if(40===i&&41===o.marker)return o;92===i&&s+1<n&&s++,s++;}return o.can_continue=!0,o.str+=a5(e.slice(t,s)),o;}],39414);var ld=e.i(39414);let lh={};function lp(){this.rules=aX({},lh);}function lf(){this.__rules__=[],this.__cache__=null;}function lm(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1;}function lg(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t;}lh.code_inline=function(e,t,n,r,i){let s=e[t];return"<code"+i.renderAttrs(s)+">"+le(s.content)+"</code>";},lh.code_block=function(e,t,n,r,i){let s=e[t];return"<pre"+i.renderAttrs(s)+"><code>"+le(e[t].content)+"</code></pre>\n";},lh.fence=function(e,t,n,r,i){let s,o=e[t],a=o.info?a5(o.info).trim():"",l="",c="";if(a){let e=a.split(/(\s+)/g);l=e[0],c=e.slice(2).join("");}if(0===(s=n.highlight&&n.highlight(o.content,l,c)||le(o.content)).indexOf("<pre"))return s+"\n";if(a){let e=o.attrIndex("class"),t=o.attrs?o.attrs.slice():[];return e<0?t.push(["class",n.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+l),`<pre><code${i.renderAttrs({attrs:t})}>${s}</code></pre>
1
+ function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+"";}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===e?String:Number)(t);}(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92913,e=>{e.v({cmpBar:"h2tPpG_cmpBar",cmpBarSegment:"h2tPpG_cmpBarSegment",cmpChevron:"h2tPpG_cmpChevron",cmpCompact:"h2tPpG_cmpCompact",cmpDetailsToggle:"h2tPpG_cmpDetailsToggle",cmpExplanation:"h2tPpG_cmpExplanation",cmpFill:"h2tPpG_cmpFill",cmpHelp:"h2tPpG_cmpHelp",cmpLegend:"h2tPpG_cmpLegend",cmpLegendDetail:"h2tPpG_cmpLegendDetail",cmpLegendLabel:"h2tPpG_cmpLegendLabel",cmpLegendRow:"h2tPpG_cmpLegendRow",cmpLegendShare:"h2tPpG_cmpLegendShare",cmpLegendValue:"h2tPpG_cmpLegendValue",cmpMetrics:"h2tPpG_cmpMetrics",cmpPanel:"h2tPpG_cmpPanel",cmpProtected:"h2tPpG_cmpProtected",cmpRoot:"h2tPpG_cmpRoot",cmpSavings:"h2tPpG_cmpSavings",cmpSpinning:"h2tPpG_cmpSpinning",cmpSwatch:"h2tPpG_cmpSwatch",cmpTotal:"h2tPpG_cmpTotal",cmpTrack:"h2tPpG_cmpTrack",cmpTrigger:"h2tPpG_cmpTrigger",cmpWarning:"h2tPpG_cmpWarning","context-spin":"h2tPpG_context-spin"});},8552,e=>{e.v({"cmp-partial-transcript":"iU4D6a_cmp-partial-transcript","cmp-voice-attachments":"iU4D6a_cmp-voice-attachments","cmp-voice-attachments-label":"iU4D6a_cmp-voice-attachments-label","cmp-voice-content":"iU4D6a_cmp-voice-content",cmpBatchFailedTranscript:"iU4D6a_cmpBatchFailedTranscript",cmpBatchModeLabel:"iU4D6a_cmpBatchModeLabel",cmpBox:"iU4D6a_cmpBox",cmpDraftNotice:"iU4D6a_cmpDraftNotice",cmpFooter:"iU4D6a_cmpFooter",cmpUserMessage:"iU4D6a_cmpUserMessage",cmpUserMessageBubble:"iU4D6a_cmpUserMessageBubble",composerLayer:"iU4D6a_composerLayer",contextWindowNotice:"iU4D6a_contextWindowNotice",memoryActivationButton:"iU4D6a_memoryActivationButton",memoryBudgetControl:"iU4D6a_memoryBudgetControl",memoryBudgetSetting:"iU4D6a_memoryBudgetSetting",memoryControls:"iU4D6a_memoryControls",normalLayer:"iU4D6a_normalLayer",pendingVoiceTurnNotice:"iU4D6a_pendingVoiceTurnNotice",responseVersionControl:"iU4D6a_responseVersionControl",responseVersionLabel:"iU4D6a_responseVersionLabel",responseVersionSelect:"iU4D6a_responseVersionSelect",responseVersionSummary:"iU4D6a_responseVersionSummary",sessionNotice:"iU4D6a_sessionNotice",turnEndState:"iU4D6a_turnEndState",voiceDialogBox:"iU4D6a_voiceDialogBox",voiceLayer:"iU4D6a_voiceLayer"});},219,e=>{"use strict";var t,n,r,i,s,o,a,l,c,u,d,h,p,f=e.i(43476),m=e.i(85912),g=e.i(8552);function v({draft:e,persistence:t}){let n=(0,m.a)();if(void 0===t||"saved"===t.phase&&!(e.length>0))return null;let{phase:r,pending:i,retry:s,keepLocal:o,restoreSaved:a}=t,l="failed"===r||"unavailable"===r;return(0,f.jsxs)("div",{className:l||"conflict"===r?g.default.cmpDraftNotice:g.default.cmpBatchModeLabel,role:l||"conflict"===r?"alert":"status",children:[(0,f.jsx)("span",{children:n(`chat.draft.${r}`)}),l?(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",disabled:i,onClick:()=>void s(),children:n("chat.draft.retry")}):null,"conflict"===r?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",disabled:i,onClick:()=>void o(),children:n("chat.draft.keepLocal")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",disabled:i,onClick:()=>void a(),children:n("chat.draft.useSaved")})]}):null]});}var y=e.i(71645),k=e.i(70478),b=e.i(95508),x=e.i(46095),w=e.i(50850);function C(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t-=1;return e.slice(0,t);}function S(e){return C(e.replaceAll("\\","/"));}function D(e){return C(function(e){let t=0;for(;t<e.length&&"/"===e[t];)t+=1;return e.slice(t);}(e.replaceAll("\\","/")));}function A(e,t){return`${e}\x01${t}`;}let E=/(^|\s)@((?:[A-Za-z0-9_.-]+\/)*[A-Za-z0-9_.-]+\.[A-Za-z0-9][A-Za-z0-9]{0,15})(?=$|\s)/gu;var M=e.i(68611);function N(e,t,n,r=Date.now){let i=D(n);if(0===i.length)throw Error("EMPTY_REPOSITORY_FILE_SELECTION");let s=(0,M.m)(e),o=[],a=!1,l=!1;for(let n of s){var _n$root;let s=(_n$root=n.root)!==null&&_n$root!==void 0?_n$root:e.projectPath;if("files"===n.kind&&s===t){if(a=!0,n.relativePaths.includes(i)){o.push(n);continue;}if(n.relativePaths.length>=50)throw Error("REPOSITORY_FILE_SCOPE_LIMIT");o.push({...n,root:t,relativePaths:[...n.relativePaths,i],connectedAtMs:r()}),l=!0;continue;}o.push(n);}return a||(o.push({kind:"files",root:t,relativePaths:[i],connectedAtMs:r()}),l=!0),{scopes:o,changed:l};}var _=e.i(6225),T=e.i(20081),R=e.i(24541);function I(e,t){(0,R.v)("client.scope.notice",{correlationId:(0,T.y)(),scopeNotice:{reason:e,scopeKind:t.kind,pathCount:t.relativePaths.length}});}function j(e,t){return(0,_.R)([e])===(0,_.R)([t]);}function F({chat:e}){let t=(0,M.m)(e),n=(0,_.R)(t),r=(0,y.useRef)(t);(0,y.useEffect)(()=>{r.current=t;},[t]);let i=(0,y.useRef)({id:e.id,scopes:t});return(0,y.useEffect)(()=>{let t=i.current,n=r.current;if(i.current={id:e.id,scopes:n},t.id!==e.id)return;let s=n.filter(e=>!t.scopes.some(t=>j(t,e))),o=setTimeout(()=>{for(let e of s)I(function(e,t){return"workspace-root"===t.kind?"widened":"files"===t.kind?"narrowed-to-file":void 0!==e&&e.relativePaths.length>0&&e.relativePaths.every(e=>t.relativePaths.some(t=>e.startsWith(`${t}/`)))?"widened":"narrowed-to-directory";}(function(e,t,n){let r=e.filter(e=>e.root===n.root&&!t.some(t=>j(e,t)));return 1===r.length?r[0]:void 0;}(t.scopes,n,e),e),e);},100);return()=>clearTimeout(o);},[e.id,n]),null;}var O=e.i(86090),z=e.i(67914),B=e.i(50471);function P({declaration:e,roots:t,...n}){var _t$;let r=(0,w.t)(),[i,s]=(0,y.useState)(""),o=t.includes(i)?i:"",a=1===t.length?(_t$=t[0])!==null&&_t$!==void 0?_t$:"":o,l=function(e,t,n){let r,i=(0,w.t)(),s=(r=(0,y.useRef)(e),(0,y.useEffect)(()=>{r.current=e;},[e]),r),[o,a]=(0,y.useState)(!1),[l,c]=(0,y.useState)(null),u=async()=>{let r=e.chat;if(!o&&void 0!==r&&0!==n.length){a(!0),c(null);try{var _e$updateScopes;let o=N(r,n,t),a=()=>{var _e;var e;return e=s.current.chat,((_e=e)===null||_e===void 0?void 0:_e.id)===r.id&&e.projectPath===r.projectPath&&e.groundingScopeIdentity===r.groundingScopeIdentity&&e===r;},l=e=>{a()&&s.current.onChatChanged(e);},c=o.changed?await(0,x.C)(r,o.scopes,(_e$updateScopes=e.updateScopes)!==null&&_e$updateScopes!==void 0?_e$updateScopes:b.i$,l):{chat:r};if(!a())return;I("missing-evidence-added",{kind:"files",root:n,relativePaths:[t],connectedAtMs:Date.now()}),l(c.chat);let u=i("scope.missing.followUp",{path:t});s.current.setDraft(s.current.draft?`${s.current.draft}
2
+ ${u}`:u),s.current.focusComposer();}catch(e){c((0,O.A)(e,i("scope.missing.failed")));}finally{a(!1);}}};return{busy:o,error:l,add:u};}(n,e.scopePath,a);return 0===t.length?null:(0,f.jsxs)("div",{className:B.default.cmpNotice,children:[(0,f.jsx)("span",{title:e.scopePath,children:r("scope.pill.file",{name:(0,_.p)(e.scopePath)})}),t.length>1?(0,f.jsx)(z.f,{value:a,sections:[{options:t.map(e=>({value:e,label:e}))}],onValueChange:s,ariaLabel:r("scope.missing.folder"),placeholder:r("scope.missing.chooseFolder")}):null,(0,f.jsx)("button",{type:"button",disabled:0===a.length,"aria-disabled":l.busy,onClick:()=>{l.add();},children:r("scope.missing.add")}),null===l.error?null:(0,f.jsx)("span",{role:"alert",children:l.error})]});}function L(e){var _n$insufficiencyDecla,_n$insufficiencyDecla2;let t=(0,w.t)(),{answer:n,chat:r}=e;if(void 0===r||void 0===n||"local-knowledge"===n.groundingKind||"insufficiency"!==n.answerKind)return null;let i=(_n$insufficiencyDecla=(_n$insufficiencyDecla2=n.insufficiencyDeclarations)===null||_n$insufficiencyDecla2===void 0?void 0:_n$insufficiencyDecla2.filter(e=>"unread-in-scope"===e.state))!==null&&_n$insufficiencyDecla!==void 0?_n$insufficiencyDecla:[];return 0===i.length?null:(0,f.jsxs)("section",{className:B.default.cmpNotice,"aria-label":t("scope.missing.title"),children:[(0,f.jsx)("p",{children:t("scope.missing.count",{count:i.length})}),(0,f.jsxs)("details",{children:[(0,f.jsx)("summary",{children:t("scope.missing.help")}),(0,f.jsx)("p",{children:t("chat.grounding.help")})]}),i.map((t,n)=>(0,f.jsx)(P,{...e,declaration:t,roots:"unread-in-scope"===t.state&&(0,k.x)(t.scopePath)?Array.from(new Set((0,M.m)(r).filter(e=>{var n;return n=t.scopePath,"workspace-root"===e.kind||("files"===e.kind?e.relativePaths.includes(n):e.relativePaths.some(e=>n.startsWith(`${e}/`)));}).map(e=>{var _e$root;return(_e$root=e.root)!==null&&_e$root!==void 0?_e$root:r.projectPath;}))):[]},`${t.scopePath}-${String(n)}`))]});}var $=e.i(25164),q=e.i(74080),V=e.i(26428),U=e.i(71166),W=e.i(94843),K=e.i(74952),H=e.i(80144),J=e.i(79056),G=e.i(54523),Z=e.i(29835),Q=e.i(92215),Y=e.i(30644),X=e.i(17161),ee=e.i(92913);let et=X.f.lock,en=new Set(["system","skill","knowledge"]);function er({status:e}){let t=(0,m.a)(),n=(0,w.X)(),r=[[t("chat.context.used"),e.estimatedInputTokens.toLocaleString(n)],[t("chat.context.inputBudget"),e.inputBudgetTokens.toLocaleString(n)],[t("chat.context.window"),e.contextWindowTokens.toLocaleString(n)],[t("chat.context.outputReserve"),e.reservedOutputTokens.toLocaleString(n)],[t("chat.context.safetyMargin"),e.safetyMarginTokens.toLocaleString(n)]];return(0,f.jsx)("dl",{className:ee.default.cmpMetrics,children:r.map(([e,t])=>(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:e}),(0,f.jsx)("dd",{children:t})]},e))});}function ei({segments:e,window:t}){return(0,f.jsx)("div",{className:ee.default.cmpBar,"aria-hidden":"true",children:e.map(e=>(0,f.jsx)("span",{className:ee.default.cmpBarSegment,"data-segment":e.id,style:{flexGrow:e.tokens/Math.max(1,t)}},e.id))});}function es({id:e}){let t=(0,m.a)();if(!en.has(e))return null;let n=t("chat.context.notCompacted");return(0,f.jsx)("span",{className:ee.default.cmpProtected,role:"img","aria-label":n,title:n,children:(0,f.jsx)(et,{size:13})});}function eo({segment:e,status:t}){var n;let r=(0,m.a)(),i=(0,w.X)(),s=function(e,t,n,_t$count){let r=(_t$count=t.count)!==null&&_t$count!==void 0?_t$count:0;if("messages"===t.id&&r>0)return e(1===r?"chat.context.count.messages.one":"chat.context.count.messages",{count:r});if("summary"===t.id&&r>0)return e(1===r?"chat.context.count.summary.one":"chat.context.count.summary",{count:r});let i=n.knowledgeSources;if("knowledge"===t.id&&void 0!==i)return e("chat.context.count.references",{sent:i.sentReferenceCount,available:i.availableReferenceCount});}(r,e,t),o=e.tokens/Math.max(1,t.contextWindowTokens)*100;return(0,f.jsxs)("li",{className:ee.default.cmpLegendRow,"data-segment":e.id,children:[(0,f.jsx)("span",{className:ee.default.cmpSwatch,"data-segment":e.id,"aria-hidden":"true"}),(0,f.jsxs)("span",{className:ee.default.cmpLegendLabel,children:[(n=void 0!==t.conversationInputBudgetTokens,{system:r("chat.context.segment.system"),skill:r("chat.context.segment.skill"),summary:r("chat.context.segment.summary"),messages:r("chat.context.segment.messages"),knowledge:r("chat.context.segment.knowledge"),free:r(n?"chat.context.segment.conversationFree":"chat.context.segment.free"),"compaction-buffer":r("chat.context.segment.compactionBuffer"),"source-capacity":r("chat.context.segment.sourceCapacity"),"input-capacity-unavailable":r("chat.context.segment.inputUnavailable"),"output-reserve":r("chat.context.outputReserve"),"safety-margin":r("chat.context.safetyMargin")}[e.id]),(0,f.jsx)(es,{id:e.id}),void 0===s?null:(0,f.jsx)("span",{className:ee.default.cmpLegendDetail,children:s})]}),(0,f.jsx)("span",{className:ee.default.cmpLegendValue,children:e.tokens.toLocaleString(i)}),(0,f.jsx)("span",{className:ee.default.cmpLegendShare,children:r("chat.context.percent",{percent:ek(o,i)})})]});}function ea({status:e,segments:t}){let n=(0,m.a)(),r=(0,w.X)(),i=t.filter(e=>"summary"!==e.id||e.tokens>0);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:ee.default.cmpTotal,children:n("chat.context.total",{used:e.estimatedInputTokens.toLocaleString(r),usable:e.inputBudgetTokens.toLocaleString(r),window:e.contextWindowTokens.toLocaleString(r)})}),(0,f.jsx)(ei,{segments:i,window:e.contextWindowTokens}),(0,f.jsx)("ul",{className:ee.default.cmpLegend,"aria-label":n("chat.context.breakdown"),children:i.map(t=>(0,f.jsx)(eo,{segment:t,status:e},t.id))})]});}function el({status:e}){let t=(0,m.a)(),n=(0,w.X)(),r=e.knowledgeSources;return void 0!==r&&r.sentReferenceCount<r.availableReferenceCount?(0,f.jsx)("p",{className:ee.default.cmpWarning,role:"note",children:t("chat.context.referencesTrimmed",{sent:r.sentReferenceCount.toLocaleString(n),available:r.availableReferenceCount.toLocaleString(n)})}):null;}function ec({status:e}){var t;let n,r=(0,m.a)(),i=(0,w.X)(),s=e=>e.toLocaleString(i),o=void 0===e.autoCompactionAtTokens?void 0:Math.max(0,e.autoCompactionAtTokens-e.estimatedInputTokens);return(0,f.jsxs)(f.Fragment,{children:[void 0===e.lastRequest?null:(0,f.jsx)("p",{className:ee.default.cmpHelp,children:(n=s((t=e.lastRequest).promptTokens),t.measured?void 0===t.estimatedTokens||t.estimatedTokens===t.promptTokens?r("chat.context.lastRequestMeasured",{tokens:n}):r("chat.context.lastRequestMeasuredWithEstimate",{tokens:n,estimated:s(t.estimatedTokens)}):r("chat.context.lastRequestEstimated",{tokens:n}))}),void 0===o?null:(0,f.jsx)("p",{className:ee.default.cmpHelp,children:r(void 0===e.conversationInputBudgetTokens?"chat.context.untilCompaction":"chat.context.untilConversationCompaction",{tokens:s(o)})})]});}function eu({status:e}){return(0,f.jsxs)(f.Fragment,{children:[void 0===e.segments?(0,f.jsx)(er,{status:e}):(0,f.jsx)(ea,{status:e,segments:e.segments}),(0,f.jsx)(el,{status:e}),(0,f.jsx)(eh,{status:e})]});}function ed({status:e}){var _e$segments;let t=(0,m.a)(),n=(0,w.X)(),r=(_e$segments=e.segments)===null||_e$segments===void 0?void 0:_e$segments.some(e=>"input-capacity-unavailable"===e.id&&e.tokens>0);return void 0===e.inputLimitTokens||!0!==r?null:(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.declaredInputLimit",{tokens:e.inputLimitTokens.toLocaleString(n)})});}function eh({status:e}){let t=(0,m.a)(),n=(0,w.X)();return(0,f.jsxs)(f.Fragment,{children:[void 0===e.compaction?null:(0,f.jsx)("p",{className:ee.default.cmpSavings,children:t(1===e.compaction.messagesCompacted?"chat.context.saved.one":"chat.context.saved",{tokens:e.compaction.tokensSaved.toLocaleString(n),count:e.compaction.messagesCompacted.toLocaleString(n)})}),void 0===e.pendingCompaction?null:(0,f.jsx)("p",{className:ee.default.cmpSavings,children:t("chat.context.pending",{before:e.pendingCompaction.tokensBefore.toLocaleString(n),after:e.pendingCompaction.tokensAfter.toLocaleString(n)})}),!0===e.contextWindowAssumed?(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.windowAssumed")}):null]});}function ep({status:e}){var _r$toLocaleString;let t=(0,m.a)(),n=(0,w.X)(),r=e===null||e===void 0?void 0:e.conversationInputBudgetTokens;return(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t(void 0===r?"chat.context.automatic":"chat.context.automaticGrounded",{tokens:(_r$toLocaleString=r===null||r===void 0?void 0:r.toLocaleString(n))!==null&&_r$toLocaleString!==void 0?_r$toLocaleString:""})});}function ef({status:e}){var _r$toLocaleString2;let t=(0,m.a)(),n=(0,w.X)(),r=e.conversationInputBudgetTokens;return(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t(void 0===r?"chat.context.sourcesPolicy":"chat.context.sourcesPolicyGrounded",{tokens:(_r$toLocaleString2=r===null||r===void 0?void 0:r.toLocaleString(n))!==null&&_r$toLocaleString2!==void 0?_r$toLocaleString2:""})});}function em({status:e}){let t=(0,m.a)(),n=(0,y.useId)(),[r,i]=(0,y.useState)(!1);return(0,f.jsxs)("div",{className:ee.default.cmpExplanation,children:[(0,f.jsxs)("button",{type:"button",className:ee.default.cmpDetailsToggle,"aria-expanded":r,"aria-controls":n,onClick:()=>{i(!r),(0,R.v)("Keiko context explanation visibility changed.",{composerActivity:r?"context-details-collapsed":"context-details-expanded"});},children:[(0,f.jsx)("span",{className:ee.default.cmpChevron,"aria-hidden":"true",children:"›"}),t("chat.context.details")]}),(0,f.jsxs)("div",{id:n,hidden:!r,children:[(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.estimate")}),(0,f.jsx)(ep,{status:e}),(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.retained")}),(e===null||e===void 0?void 0:e.knowledgeSources)===void 0?null:(0,f.jsx)(ef,{status:e}),void 0===e?null:(0,f.jsx)(ec,{status:e}),void 0===e?null:(0,f.jsx)(ed,{status:e})]})]});}function eg(e){var _e$status;let t=(0,m.a)();return(0,f.jsxs)(f.Fragment,{children:[void 0===e.status?(0,f.jsx)("p",{children:t("chat.context.unavailable")}):(0,f.jsx)(eu,{status:e.status}),e.error?(0,f.jsx)("p",{children:(0,f.jsxs)("output",{children:[t("chat.context.error")," ",(0,f.jsx)("button",{type:"button",onClick:e.onRetry,children:t("chat.context.retry")})]})}):null,(0,f.jsx)("button",{type:"button",className:ee.default.cmpCompact,disabled:e.busy||e.compacting||((_e$status=e.status)===null||_e$status===void 0?void 0:_e$status.canCompact)!==!0,onClick:e.onCompact,children:t(e.compacting?"chat.context.compacting":"chat.context.compact")}),e.busy?(0,f.jsx)("p",{className:ee.default.cmpHelp,children:t("chat.context.wait")}):null,(0,f.jsx)(em,{status:e.status})]});}function ev({percent:e,compacting:t}){return(0,f.jsxs)("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",className:t?ee.default.cmpSpinning:void 0,children:[(0,f.jsx)("circle",{className:ee.default.cmpTrack,cx:"12",cy:"12",r:"9",fill:"none",strokeWidth:"3"}),(0,f.jsx)("circle",{className:ee.default.cmpFill,cx:"12",cy:"12",r:"9",fill:"none",strokeWidth:"3",pathLength:"100",strokeDasharray:"100",strokeDashoffset:100-Math.min(100,e!==null&&e!==void 0?e:0),transform:"rotate(-90 12 12)"})]});}function ey(e){var t;let n=(0,m.a)(),r=(0,w.X)(),i=(0,y.useId)(),s=function(){let e=(0,y.useRef)(null),t=(0,y.useRef)(null),[n,r]=(0,y.useState)(!1),i=function(e,t,n){let[r,i]=(0,y.useState)({visibility:"hidden"});return(0,y.useLayoutEffect)(()=>{if(!e)return;let r=0,s="",o=()=>{if(null!==t.current&&null!==n.current){let e=(0,Y.f)({anchor:t.current.getBoundingClientRect(),width:320,height:n.current.scrollHeight+2,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,gap:8,preferUp:!0}),r=JSON.stringify(e);r!==s&&(s=r,i({left:e.left,top:e.top,width:e.width,maxHeight:e.maxHeight}));}r=requestAnimationFrame(o);};return o(),()=>cancelAnimationFrame(r);},[e,t,n]),r;}(n,e,t);return(0,y.useEffect)(()=>{if(!n)return;let i=n=>{var _e$current;"Tab"===n.key?function(e,t,n,_i$current,_i$current2){var r,i,s,o;let a=n.current;if(null===a)return!0;let l=Array.from(a.querySelectorAll("button:not(:disabled)")),c=l[0];return e.target!==t.current||e.shiftKey||void 0===c?(r=e,i=t,s=l,o=a,r.target===s[0]&&r.shiftKey?(r.preventDefault(),(_i$current=i.current)!==null&&_i$current!==void 0&&_i$current.focus(),!1):r.target!==s.at(-1)||r.shiftKey?!(r.target instanceof Node&&o.contains(r.target)):((_i$current2=i.current)!==null&&_i$current2!==void 0&&_i$current2.focus(),!0)):(e.preventDefault(),c.focus(),!1);}(n,e,t)&&r(!1):"Escape"===n.key&&(n.preventDefault(),n.stopPropagation(),(_e$current=e.current)!==null&&_e$current!==void 0&&_e$current.focus(),r(!1));},s=n=>{var _e$current2,_t$current;var i;i=n.target,i instanceof Node&&(((_e$current2=e.current)===null||_e$current2===void 0?void 0:_e$current2.contains(i))===!0||((_t$current=t.current)===null||_t$current===void 0?void 0:_t$current.contains(i))===!0)||r(!1);};return document.addEventListener("keydown",i,!0),document.addEventListener("pointerdown",s,!0),document.addEventListener("focusin",s),()=>{document.removeEventListener("keydown",i,!0),document.removeEventListener("pointerdown",s,!0),document.removeEventListener("focusin",s);};},[n]),{trigger:e,panel:t,open:n,position:i,toggle:()=>r(e=>!e)};}(),o=void 0===(t=e.status)?void 0:t.estimatedInputTokens/Math.max(1,t.inputBudgetTokens),a=void 0===o?void 0:100*o,l=void 0===a?void 0:ek(a,r),c=void 0===l?n("chat.context.unavailable"):n("chat.context.label",{percent:l});return(0,f.jsxs)("div",{className:ee.default.cmpRoot,"data-tone":void 0===o?"unknown":o>=.9?"critical":o>=.8?"warning":"normal","aria-busy":e.compacting,children:[(0,f.jsx)("button",{type:"button",ref:s.trigger,className:ee.default.cmpTrigger,"aria-label":c,title:c,"aria-controls":s.open?i:void 0,"aria-expanded":s.open,onClick:s.toggle,children:(0,f.jsx)(ev,{percent:a,compacting:e.compacting})}),s.open?(0,q.createPortal)((0,f.jsxs)("section",{ref:s.panel,id:i,className:ee.default.cmpPanel,style:s.position,"aria-label":n("chat.context.title"),children:[(0,f.jsx)("h3",{children:void 0===l?n("chat.context.title"):n("chat.context.heading",{percent:l})}),(0,f.jsx)(eg,{...e})]}),document.body):null]});}function ek(e,t){return e>0&&e<.1?`<${.1.toLocaleString(t)}`:e.toLocaleString(t,{maximumFractionDigits:1});}function eb({session:e}){let t=function(e,_e$activeChat,_e$activeChat2,_d,_d2,_d$groundingScopeIden,_d3,_u$connectedScopes,_u,_u2,_u$localKnowledgeScop,_u3,_u4,_u5,_t$markdownSkill){var t,n,r,i,s,o,a,l,c;let u,d,h,p=(_e$activeChat=e.activeChat)===null||_e$activeChat===void 0?void 0:_e$activeChat.id,f=(_e$activeChat2=e.activeChat)===null||_e$activeChat2===void 0?void 0:_e$activeChat2.projectPath,m=e.selectedModel,g=(d=(t=e).activeChat,JSON.stringify([(_d=d)===null||_d===void 0?void 0:_d.id,(_d2=d)===null||_d2===void 0?void 0:_d2.projectPath,t.selectedModel,(_d$groundingScopeIden=(_d3=d)===null||_d3===void 0?void 0:_d3.groundingScopeIdentity)!==null&&_d$groundingScopeIden!==void 0?_d$groundingScopeIden:(u=t.activeChat,[(_u$connectedScopes=(_u=u)===null||_u===void 0?void 0:_u.connectedScopes)!==null&&_u$connectedScopes!==void 0?_u$connectedScopes:(_u2=u)===null||_u2===void 0?void 0:_u2.connectedScope,(_u$localKnowledgeScop=(_u3=u)===null||_u3===void 0?void 0:_u3.localKnowledgeScopes)!==null&&_u$localKnowledgeScop!==void 0?_u$localKnowledgeScop:(_u4=u)===null||_u4===void 0?void 0:_u4.localKnowledgeScope,(_u5=u)===null||_u5===void 0?void 0:_u5.gitChangeScopes]),(_t$markdownSkill=t.markdownSkill)===null||_t$markdownSkill===void 0||(_t$markdownSkill=_t$markdownSkill.view)===null||_t$markdownSkill===void 0?void 0:_t$markdownSkill.selection])),v=JSON.stringify([g,function(e){let t=e.models.find(t=>t.id===e.selectedModel);if(void 0===t)return[];let n=t.tokenAccounting;return[t.contextWindow,t.maxInputTokens,t.maxOutputTokens,t.contextWindowAssumed,t.contextWindowReported,n===null||n===void 0?void 0:n.source,n===null||n===void 0?void 0:n.counterId,n===null||n===void 0?void 0:n.scaleMilli,n===null||n===void 0?void 0:n.offsetTokens];}(e)]),k=e.sending||void 0!==e.regeneratingMessageId,x=(n=e.messages,(0,y.useMemo)(()=>JSON.stringify(n.map(e=>e.id)),[n])),[w,C]=(0,y.useState)({key:v,compacting:!1,error:!1}),[S,D]=(0,y.useState)(0),A=(h=(0,y.useRef)(null),(0,y.useEffect)(()=>()=>{var _h$current;(_h$current=h.current)!==null&&_h$current!==void 0&&_h$current.controller.abort(),h.current=null;},[]),h),E=(0,y.useRef)(g);E.current=g;let M=(0,y.useRef)(w.status);M.current=w.status;let N=(r=p,i=f,s=m,o=v,a=g,l=A,c=C,(0,y.useCallback)(async e=>{if(null!==l.current){if(!e)return;l.current.controller.abort(),l.current=null;}if(void 0===r||void 0===i||void 0===s)return;let t=new AbortController();l.current={controller:t,authorityKey:a,compact:e},e&&c(e=>{var t,n,r;return t=e,n=o,r=a,{key:n,status:t.key===n?t.status:void 0,compacting:!0,compactionAuthorityKey:r,error:!1};});let n=e?b.OF:b.ao;try{return await ex(n(r,i,s,t.signal),t,o,c,e);}finally{var _l$current;((_l$current=l.current)===null||_l$current===void 0?void 0:_l$current.controller)===t&&(l.current=null);}},[r,i,s,o,a,l,c])),_=w.compacting&&w.compactionAuthorityKey===g,T=w.key!==v&&_;return(0,y.useEffect)(()=>{var _M$current;var t,n,r;let i,s,o,a;if(e.loading)return;let l=(t=N,n=k,r=(_M$current=M.current)===null||_M$current===void 0?void 0:_M$current.estimatedInputTokens,s=!1,o=0,(a=async()=>{var e;let l=await t(!1);s||void 0===l||o>=6||(e=r,(!0===l.contextWindowProbePending||n&&(void 0===e||l.estimatedInputTokens===e))&&(r=l.estimatedInputTokens,i=setTimeout(()=>{a();},Math.min(1e3*2**o++,8e3))));})(),()=>{s=!0,clearTimeout(i);});return()=>{var _t,_t2;var e;let t;l(),e=E.current,t=A.current,(((_t=t)===null||_t===void 0?void 0:_t.compact)!==!0||t.authorityKey!==e)&&((_t2=t)!==null&&_t2!==void 0&&_t2.controller.abort(),A.current=null);};},[N,k,e.loading,x,S,T,A]),{state:w.key===v?w:{key:v,compacting:_,error:!1},busy:k,compact:()=>{k||_||N(!0);},retry:()=>{D(e=>e+1);}};}(e);return void 0===e.activeChat||void 0===e.selectedModel?null:(0,f.jsx)(ey,{status:t.state.status,busy:t.busy,compacting:t.state.compacting,error:t.state.error,onCompact:t.compact,onRetry:t.retry});}async function ex(e,t,n,r,i){try{let i=await e;if(t.signal.aborted)return;return r({key:n,status:i,compacting:!1,error:!1}),i;}catch(e){if(t.signal.aborted)return;(0,R.v)(i?"Keiko manual context compaction request failed.":"Keiko context status request failed.",{correlationId:(0,Z.E)(e),errorKind:(0,Q.J)(e),errorEvidence:(0,K.f)(e)}),r(e=>({...e,compacting:!1,error:!0}));return;}}var ew=e.i(32574),eC=e.i(70703),eS=e.i(69361),eD=e.i(10651);let eA=(0,eC.default)(()=>e.A(73334).then(e=>e.MarkdownSkillDialog),{loadableGenerated:{modules:[89750]},ssr:!1,loading:eS.f});function eE({skill:e,disabled:t,modelId:n}){let r=(0,m.a)(),[i,s]=(0,y.useState)(!1);return(e===null||e===void 0?void 0:e.chatId)===void 0?null:(0,f.jsxs)("div",{className:eD.default.cmpControls,children:[(0,f.jsx)("button",{type:"button",onClick:()=>s(!0),"aria-haspopup":"dialog",children:r("chat.skills.title")}),(0,f.jsx)(eM,{skill:e,disabled:t,onOpen:()=>s(!0)}),e.failed&&!0!==e.requireNoSkill?(0,f.jsx)("span",{role:"alert",children:r("chat.skills.requestError")}):null,i?(0,f.jsx)(eA,{modelId:n,skill:e,disabled:t,onClose:()=>s(!1)}):null]});}function eM({skill:e,disabled:t,onOpen:n}){var _e$view,_e$view2;let r=(0,m.a)(),i=(_e$view=e.view)===null||_e$view===void 0?void 0:_e$view.selection.skill;return i?(0,f.jsxs)("span",{className:eD.default.cmpChip,children:[(0,f.jsxs)("button",{type:"button",onClick:n,title:r("chat.skills.protected"),children:[(0,f.jsx)("span",{className:eD.default.cmpChipName,children:((_e$view2=e.view)===null||_e$view2===void 0?void 0:_e$view2.availability)==="available"?e.view.name:r("chat.skills.unavailable")}),(0,f.jsxs)("span",{className:eD.default.cmpRevision,children:[" · v",i.revision]})]}),(0,f.jsx)("button",{type:"button","aria-label":r("chat.skills.remove"),disabled:t||e.busy,onClick:()=>{e.select(null).catch(()=>void 0);},children:"×"})]}):null;}var eN=e.i(57269);let e_="keiko-conservative-content-v2";Object.freeze(["calibrated","fallback-estimated"]);let eT=(0,eN.f)({source:"fallback-estimated",counterId:e_}),eR=Object.freeze(["system-contract","user-task","active-plan","repo-evidence","tool-observations","working-memory","history-summary","verification-evidence"]);Object.freeze(["none","summarize-then-drop","drop-oldest","drop-lowest-score"]),(0,eN.f)({schemaVersion:"1",maxInputTokens:128e3,reservedOutputTokens:8e3,safetyMarginTokens:4e3,effectiveInputBudget:116e3,tokenEstimatorId:e_,tokenAccounting:eT}),new Set("{}[]()<>;:=+-*/%&|!?,.#`$@\\\"'"),"u"<typeof TextEncoder||new TextEncoder();var eI=e.i(83449);let ej={"system-contract":"context.lane.system","user-task":"context.lane.task","active-plan":"context.lane.plan","repo-evidence":"context.lane.repository","tool-observations":"context.lane.tools","working-memory":"context.lane.memory","history-summary":"context.lane.history","verification-evidence":"context.lane.verification"};function eF(e,t){return t("low"===e?"context.pressure.low":"moderate"===e?"context.pressure.moderate":"high"===e?"context.pressure.high":"context.pressure.exceeded");}function eO({laneCounts:e,locale:t}){let n=(0,m.a)(),r=eR.map(t=>[t,e[t]]).filter(([,e])=>e>0);return(0,f.jsx)(f.Fragment,{children:r.map(([e,r])=>(0,f.jsx)(G.t,{label:n(ej[e]),value:r.toLocaleString(t)},`lane-${e}`))});}function ez({contextSummary:e}){var t;let n,r=(0,w.X)(),i=(0,m.a)();return void 0===e?null:(0,f.jsxs)("details",{className:"ctx-status grounded-evidence-disclosure",children:[(0,f.jsxs)("summary",{className:"ctx-status-summary grounded-evidence-summary","aria-label":i("context.details.aria"),title:i("context.details.hint",{estimator:e_}),children:[(0,f.jsx)("span",{className:"grounded-evidence-summary-title",children:i("context.details.title")}),(0,f.jsx)("span",{className:"grounded-evidence-summary-meta",children:(t=e.laneCounts,n=eR.filter(e=>t[e]>0).length,[i("context.meta.tokens",{tokens:(0,eI.k)(e.totalEstimatedTokens)}),i("context.meta.pressure",{pressure:eF(e.budgetPressure,i)}),i("context.meta.lanes",{count:n.toLocaleString(r)}),i(e.compactionActive?"context.compaction.active":"context.compaction.inactive")].join(" · "))})]}),(0,f.jsx)("div",{className:"ctx-status-body grounded-evidence-body",children:(0,f.jsxs)("dl",{className:"ctx-status-dl grounded-context-pack-dl",children:[(0,f.jsx)(G.t,{label:i("context.metric.estimator"),value:e_}),(0,f.jsx)(G.t,{label:i("context.metric.assembledEstimate"),value:i("context.metric.tokensShort",{tokens:(0,eI.k)(e.totalEstimatedTokens)})}),(0,f.jsx)(G.t,{label:i("context.metric.budgetPressure"),value:eF(e.budgetPressure,i)}),(0,f.jsx)(eO,{laneCounts:e.laneCounts,locale:r}),(0,f.jsx)(G.t,{label:i("context.metric.compaction"),value:i(e.compactionActive?"context.compaction.active":"context.compaction.inactive")})]})})]});}var eB=e.i(20405),eP=e.i(60865),eL=e.i(93806),e$=e.i(64344);let eq=X.f.file,eV=X.f.close,eU=X.f.plus;function eW({attachment:e,onRemove:t}){let n=(0,m.a)()("attachment.remove",{name:e.name}),r=function(e,t=32){if(e.length<=t)return e;let n=e.lastIndexOf(".");if(n>0&&e.length-n<=8){let r=e.slice(n);return`${e.slice(0,t-r.length-1)}…${r}`;}return`${e.slice(0,t-1)}…`;}(e.name);return(0,f.jsxs)("li",{className:"attach-chip",children:["image"===e.kind&&void 0!==e.previewUrl?(0,f.jsx)("img",{src:e.previewUrl,alt:"",className:"attach-chip-thumb",width:40,height:40}):(0,f.jsx)("span",{className:"attach-chip-icon","aria-hidden":"true",children:(0,f.jsx)(eq,{size:16})}),(0,f.jsx)("span",{className:"attach-chip-name",title:e.name,children:r}),(0,f.jsx)("span",{className:"attach-chip-size",children:(0,eI.L)(e.sizeBytes)}),(0,f.jsx)("button",{type:"button",className:"attach-chip-remove","aria-label":n,onClick:()=>t(e.id),children:(0,f.jsx)(eV,{size:12})})]});}function eK({attachments:e,onRemove:t}){let n=(0,m.a)();return 0===e.length?null:(0,f.jsx)("ul",{className:"attach-strip",style:eP.d,"aria-label":n("attachment.pending"),children:e.map(e=>(0,f.jsx)(eW,{attachment:e,onRemove:t},e.id))});}function eH({enabled:e,onFiles:t}){let n=(0,m.a)(),[r,i]=(0,y.useState)(!1),[s,o]=(0,y.useState)(!1);(0,y.useEffect)(()=>{if(!e)return;let t=0,n=e=>{var _e$dataTransfer$types,_e$dataTransfer;Array.from((_e$dataTransfer$types=(_e$dataTransfer=e.dataTransfer)===null||_e$dataTransfer===void 0?void 0:_e$dataTransfer.types)!==null&&_e$dataTransfer$types!==void 0?_e$dataTransfer$types:[]).includes("Files")&&(t+=1,o(!0));},r=()=>{0===(t=Math.max(0,t-1))&&o(!1);},i=()=>{t=0,o(!1);};return window.addEventListener("dragenter",n),window.addEventListener("dragleave",r),window.addEventListener("drop",i),window.addEventListener("dragend",i),()=>{window.removeEventListener("dragenter",n),window.removeEventListener("dragleave",r),window.removeEventListener("drop",i),window.removeEventListener("dragend",i);};},[e]);let a=(0,y.useCallback)(t=>{e&&(t.preventDefault(),i(!0));},[e]),l=(0,y.useCallback)(()=>{i(!1);},[]),c=(0,y.useCallback)(n=>{if(n.preventDefault(),i(!1),!e)return;let r=Array.from(n.dataTransfer.files);r.length>0&&t(r);},[e,t]);return e?(0,f.jsx)("div",{className:"attach-drop-zone","data-dragover":r?"true":void 0,"data-active":s?"true":"false","aria-hidden":"true",onDragOver:a,onDragLeave:l,onDrop:c,children:(0,f.jsx)("span",{className:"attach-drop-hint",children:n("attachment.drop")})}):null;}function eJ({model:e,onFiles:t}){let n=(0,m.a)(),r=(0,y.useRef)(null),i=void 0!==e&&(e.supportsImageInput||e.supportsDocumentInput),s=function(e){if(void 0===e)return"";let t=[];return e.supportsImageInput&&t.push("image/*"),e.supportsDocumentInput&&t.push(".pdf,.txt,.md,.csv,.json,.yaml,.yml"),t.join(",");}(e),o=(0,y.useCallback)(()=>{var _r$current;i&&((_r$current=r.current)===null||_r$current===void 0?void 0:_r$current.click());},[i]),a=(0,y.useCallback)(()=>{var _r$current$files,_r$current2;let e=Array.from((_r$current$files=(_r$current2=r.current)===null||_r$current2===void 0?void 0:_r$current2.files)!==null&&_r$current$files!==void 0?_r$current$files:[]);e.length>0&&(t(e),null!==r.current&&(r.current.value=""));},[t]);return i?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("input",{ref:r,type:"file",multiple:!0,accept:s,className:"sr-only",tabIndex:-1,"aria-hidden":"true",onChange:a}),(0,f.jsx)("button",{type:"button",className:"cmp-icon cmp-tip-start","aria-label":n("attachment.attachFile"),"data-tip":n("attachment.attachFile"),onClick:o,children:(0,f.jsx)(eU,{size:16})})]}):null;}function eG({reason:e,mimeType:t}){let n=(0,m.a)(),r=(0,m.a)();return void 0===e?null:(0,f.jsx)("div",{role:"alert",className:"attach-rejection-alert",children:function(e,t,n,r,_n){let i=t!==null&&t!==void 0?t:(e,t)=>{var _t$mime;switch(e){case"attachment.rejection.textOnly":return"The selected model can't accept this attachment type. Choose a model that supports images or documents.";case"attachment.rejection.unsupported":return`Unsupported file type${String((_t$mime=t===null||t===void 0?void 0:t.mime)!==null&&_t$mime!==void 0?_t$mime:"")}. Supported types: images (image/*), PDF, plain text, markdown, JSON, YAML.`;case"attachment.rejection.oversized":return"File is larger than the 8 MiB limit. Choose a smaller file or summarize the content as text.";case"attachment.rejection.empty":return"Empty file. Add a file with content to attach.";default:return e;}},s=void 0!==r&&r.length>0?`: ${r}`:"";switch(e){case"text-only-model":return i("attachment.rejection.textOnly");case"unsupported-type":return i("attachment.rejection.unsupported",{mime:s});case"oversized":return i("attachment.rejection.oversized");case"empty":return i("attachment.rejection.empty");case"delivery-refused":return(_n=n===null||n===void 0?void 0:n("attachment.rejection.deliveryRefused"))!==null&&_n!==void 0?_n:"The image could not be stored or authorized for delivery. Add it again and retry.";}}(e,n,r,t)});}let eZ=(0,y.memo)(function({documents:e}){let t=(0,m.a)();if(0===e.length)return null;let n=e.some(e=>e.truncated);return(0,f.jsxs)("div",{role:"note",className:"sent-docs-note","aria-label":t("attachment.docsContext"),children:[(0,f.jsx)("span",{className:"sent-docs-note-label",children:1===e.length?t("attachment.docContextLabel"):t("attachment.docsContextLabel")}),(0,f.jsx)("ul",{className:"sent-docs-note-list",children:e.map(e=>(0,f.jsxs)("li",{className:"sent-docs-note-item",children:[e.displayName,e.truncated?(0,f.jsx)("span",{className:"sent-docs-note-trunc",children:t("attachment.truncated")}):null]},e.id))}),n?(0,f.jsx)("span",{className:"sent-docs-note-hint",children:t("attachment.truncatedHint")}):null]});});function eQ({images:e}){let t=(0,m.a)();return 0===e.length?null:(0,f.jsxs)("div",{role:"note",className:"sent-docs-note","aria-label":t("attachment.imagesDelivered"),children:[(0,f.jsx)("span",{className:"sent-docs-note-label",children:t("attachment.imagesDelivered")}),(0,f.jsx)("ul",{className:"sent-docs-note-list",children:e.map(e=>(0,f.jsx)("li",{className:"sent-docs-note-item",children:e.displayName},e.id))})]});}let eY=X.f.spark;function eX(e){return"system"===e.role&&"string"==typeof e.runId;}function e0({message:e,onOpenResult:t}){var _e$workflowStatus,_ref,_e$workflowId;let n=(_e$workflowStatus=e.workflowStatus)!==null&&_e$workflowStatus!==void 0?_e$workflowStatus:"queued",r=(_ref=(_e$workflowId=e.workflowId)!==null&&_e$workflowId!==void 0?_e$workflowId:e.taskType)!==null&&_ref!==void 0?_ref:"workflow",i=void 0===e.runId?"":e.runId.slice(0,8),s=void 0===e.runId?void 0:`/api/evidence/${encodeURIComponent(e.runId)}`,[o,a]=(0,y.useState)(""),l=(0,y.useRef)(n);return(0,y.useEffect)(()=>{l.current!==n&&(l.current=n,a(`Workflow ${r}: ${n}`));},[n,r]),(0,f.jsxs)("article",{className:"run-summary-card","data-testid":"run-summary-card","data-status":n,"aria-label":`Workflow run ${r} - ${n}`,children:[(0,f.jsxs)("header",{className:"run-summary-card-head",children:[(0,f.jsx)(eY,{size:14,style:{color:"var(--accent)"}}),(0,f.jsx)("span",{className:"run-summary-card-workflow mono",children:r}),(0,f.jsx)("span",{className:"run-summary-card-status","data-status":n,children:n})]}),(0,f.jsxs)("div",{className:"run-summary-card-body",children:[(0,f.jsx)("p",{className:"run-summary-card-line",children:e.content}),void 0!==e.shortResult&&e.shortResult.length>0?(0,f.jsx)("p",{className:"run-summary-card-result",children:e.shortResult}):null,void 0!==e.runId?(0,f.jsxs)("p",{className:"run-summary-card-meta mono",children:["run"," ",(0,f.jsx)("span",{className:"run-summary-card-runshort","data-runid":e.runId,title:e.runId,children:i})]}):null,void 0!==e.runId?(0,f.jsxs)("div",{className:"run-summary-card-actions","aria-label":"Workflow result actions",children:[void 0!==t?(0,f.jsx)("button",{type:"button",className:"run-summary-card-action",onClick:()=>t(e),children:"Open result"}):null,void 0!==s?(0,f.jsx)("a",{className:"run-summary-card-action run-summary-card-action-secondary",href:s,target:"_blank",rel:"noreferrer",children:"Evidence"}):null]}):null]}),(0,f.jsx)("p",{className:"sr-only",role:"status","aria-live":"polite","data-testid":"run-summary-card-sr",children:o})]});}var e1=e.i(98729);e.i(87552);var e2=e.i(81056),e3=e.i(13493),e6=e.i(12541),e5=e.i(76826),e4=e.i(84832),e9=e.i(61287),e8=e.i(82178);let e7=Array.from({length:64},(e,t)=>6*t+3);function te({controller:e,visible:t=!0}){let n=(0,e9.f)(),r=t&&"recording"===e.phase&&e.micReady,i=function(e,t){let n=(0,y.useRef)(0);n.current=Number.isFinite(e)?Math.min(1,Math.max(0,e)):0;let[r,i]=(0,y.useState)(()=>Array(64).fill(0));return(0,y.useEffect)(()=>{if(i(Array(64).fill(0)),!t)return;let e=setInterval(()=>{i(e=>[...e.slice(1),n.current]);},80);return()=>clearInterval(e);},[t]),r;}(e.audioLevel,r),s=n("requesting"===e.phase?"voice.dictation.starting":"finalizing"===e.phase?"voice.dictation.finishing":"transcribing"===e.phase?"voice.dictation.transcribing":e.micReady?e.heardSpeech?"voice.dictation.capturing":"voice.dictation.listening":"voice.dictation.preparingMic");return t&&e.busy?(0,f.jsx)("div",{className:e8.default.cmpWaveform,"data-recording":r,role:"status","aria-live":"polite",children:r?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"sr-only",children:s}),(0,f.jsx)("svg",{viewBox:"0 0 384 32",preserveAspectRatio:"none","aria-hidden":"true",children:e7.map((e,t)=>{var _i$t;let n=(_i$t=i[t])!==null&&_i$t!==void 0?_i$t:0;return(0,f.jsx)("line",{x1:e,x2:e,y1:15-13*n,y2:17+13*n,vectorEffect:"non-scaling-stroke"},e);})})]}):(0,f.jsx)("span",{className:e8.default.cmpStatus,children:s})}):null;}var tt=e.i(18829),tn=e.i(29673),tr=e.i(31317);let ti=["preparing","speaking","paused"],ts=["interrupted","canceled","failed","complete"];function to(e){return ti.includes(e);}function ta(e){return ts.includes(e);}function tl(e){switch(e){case"unavailable":return;case"preparing":case"complete":return"idle";case"speaking":return"playing";case"paused":return"paused";case"interrupted":return"interrupted";case"canceled":case"failed":return"stopped";default:throw Error(`unhandled voice playback phase: ${JSON.stringify(e)}`);}}function tc(){return{now:()=>performance.now()};}tr.Z;let tu={prepare:e=>e.playbackAllowed,"play-started":e=>e.playbackAllowed,pause:e=>e.playbackAllowed,resume:e=>e.playbackAllowed,interrupt:e=>e.interruptAllowed,stop:e=>e.playbackAllowed,fail:e=>e.playbackAllowed,complete:e=>e.playbackAllowed,replay:e=>e.playbackAllowed&&e.replayAllowed,"set-muted":e=>e.playbackAllowed};function td(e){return{phase:"unavailable",muted:!1,spoke:!1,interruptions:0,replays:0,failureKind:void 0,lastInterruptAtMs:void 0,lastTransitionAtMs:void 0};}async function th(e){null!==e.body&&(await e.body.cancel().catch(()=>{}));}async function tp(e){var _e$headers$get,_e$body;if(((_e$headers$get=e.headers.get("content-type"))===null||_e$headers$get===void 0||(_e$headers$get=_e$headers$get.split(";",1)[0])===null||_e$headers$get===void 0?void 0:_e$headers$get.trim())!=="audio/pcm"){var _e$headers$get2;await th(e),(0,R.v)("[keiko] assistant speech switched to buffered playback",{kind:"voice-dialogue",voiceDialogueStage:"playback-fallback",correlationId:(_e$headers$get2=e.headers.get(T.p))!==null&&_e$headers$get2!==void 0?_e$headers$get2:void 0});return;}return(_e$body=e.body)!==null&&_e$body!==void 0?_e$body:void 0;}class tf extends Error{}async function tm(e){try{await e.resume();}catch{window.reportError(Error("Assistant speech audio context resume failed."));}}function tg(){let e,t,n;if(!("u">typeof AudioContext&&"u">typeof AudioWorkletNode))return;async function r(e,t,n){try{return await(0,b.S1)(e,t,n);}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return"cancelled";return(0,R.v)("[keiko] assistant speech stream failed; using buffered playback",{kind:"voice-playback",correlationId:(0,Z.E)(e)}),"fallback";}}let i=0,s=0,o=new WeakMap();function a(e){let t=o.get(e);if(void 0!==t)return t;let n=e.close().catch(()=>{window.reportError(Error("Assistant speech audio context cleanup failed."));});return o.set(e,n),n;}function l(e){var _e$port$close,_e$port;e!==null&&e!==void 0&&e.port.postMessage(null),void 0!==e&&(e.port.onmessage=null),e===null||e===void 0||(_e$port$close=(_e$port=e.port).close)===null||_e$port$close===void 0?void 0:_e$port$close.call(_e$port);try{e===null||e===void 0||e.disconnect();}catch{}}function c(t,n){return e===t&&s===n;}async function u(n,r){let i;try{if(await n.audioWorklet.addModule("/keiko-playback-worklet.js"),!c(n,r)||((i=new AudioWorkletNode(n,"keiko-playback",{numberOfInputs:0,numberOfOutputs:1,outputChannelCount:[1]})).connect(n.destination),!c(n,r)))throw new tf();return t=i,{context:n,generation:r,node:i};}catch(r){throw t!==i&&l(i),e===n&&(e=void 0),await a(n),r;}}function d(){let t;if(void 0!==e)return{context:e,generation:s};try{t=new AudioContext({sampleRate:24e3});}catch{return;}return e=t,{context:t,generation:s};}async function h(){if(void 0!==t&&void 0!==e)return{context:e,generation:s,node:t};if(void 0!==n)return n;let r=d();if(void 0===r)throw Error("Assistant speech audio context is unavailable.");let i=u(r.context,r.generation);n=i;try{return await i;}finally{n===i&&(n=void 0);}}function p(){let r=t,o=e;s+=1,n=void 0,t=void 0,e=void 0,i=0,l(r),void 0!==o&&a(o);}function f(e,n){return!n.aborted&&c(e.context,e.generation)&&t===e.node;}async function m(e,t,n,r){let i,s=t.getReader(),o=0;try{for(;;){let{done:t,value:r}=await s.read();if(t)break;if(n.aborted)return void(await s.cancel());let{samples:a,leftover:l}=function(e,t){let n=e;if(void 0!==t&&t.length>0){let r=new Uint8Array(t.length+e.length);r.set(t),r.set(e,t.length),n=r;}let r=n.length-n.length%2,i=r<n.length?n.slice(r):void 0,s=new Int16Array(r/2),o=new DataView(n.buffer,n.byteOffset,r);for(let e=0;e<s.length;e+=1)s[e]=o.getInt16(2*e,!0);return{samples:s,leftover:i};}(r,i);i=l,a.length>0&&(o+=a.length,e.port.postMessage(a,[a.buffer]));}0===o?r.onError():e.port.postMessage({type:"end"});}catch{n.aborted||r.onError();}}return{primeFromUserGesture(){let e=d();void 0!==e&&(tm(e.context),h().catch(()=>{}));},async play(e,t,n,s){let o;try{o=await h();}catch(e){if(t.aborted||e instanceof tf)return!0;return!1;}if(!f(o,t))return!0;i=0;let a=!1;tm(o.context);let l=o.node;l.port.postMessage({type:"config",primeFrames:2400}),l.port.onmessage=e=>{var _t$frames;let t=e.data;"position"===t.type?(i=(_t$frames=t.frames)!==null&&_t$frames!==void 0?_t$frames:i,a||(a=!0,n.onStart())):"ended"===t.type&&n.onEnded();};let c=await r(e,t,s);if("cancelled"===c)return!0;if("fallback"===c)return!1;if(!f(o,t))return await th(c),!0;let u=await tp(c);return f(o,t)?void 0!==u&&(m(l,u,t,n),!0):(await th(c),!0);},stop(){p();},positionMs(){if(void 0!==t&&0!==i)return Math.round(i/24e3*1e3);},dispose(){p();}};}function tv(e){return(t,n,r)=>(0,b.R8)(void 0===e?{text:t}:{text:t,persona:e},n,r);}function ty(){return new Audio();}function tk(e){return URL.createObjectURL(e);}function tb(e){URL.revokeObjectURL(e);}function tx(e){return e instanceof DOMException&&"AbortError"===e.name;}var tw=e.i(37448),tC=e.i(64268),tS=e.i(28269);let tD=tr.$.signalingMs;class tA extends Error{constructor(e,t){super(t),_defineProperty(this,"reason",void 0),this.reason=e,this.name="VoiceControlError";}}var tE=e.i(79274);let tM={disabled:"none",idle:"none",listening:"user",thinking:"assistant",speaking:"assistant",interrupted:"none",yielding:"none",recovering:"none"},tN={"user-speech-start":e=>e.canCaptureUserVoice,"user-end-of-turn":e=>e.canCaptureUserVoice,"dictation-commit":e=>e.usesManualCommit,"dictation-discard":e=>e.usesManualCommit,"assistant-speech-start":e=>e.playbackAllowed,"assistant-speech-end":e=>e.playbackAllowed,"user-interrupt":e=>e.interruptAllowed,backchannel:e=>e.floorControl&&e.playbackAllowed,"provider-failure":()=>!0,"permission-denied":()=>!0,recovered:()=>!0,"session-closed":()=>!0};function t_(e){return{state:"none"===e?"disabled":"idle",turnIndex:0,interruptions:0,backchannels:0,pendingCommit:!1,lastEndOfTurnAtMs:void 0,lastInterruptAtMs:void 0,lastTransitionAtMs:void 0};}var tT=e.i(81046);let tR=/[!-\/:-@\[-`\{-~\xA1-\xA9\xAB\xAC\xAE-\xB1\xB4\xB6-\xB8\xBB\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u037E\u0384\u0385\u0387\u03F6\u0482\u055A-\u055F\u0589\u058A\u058D-\u058F\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0606-\u060F\u061B\u061D-\u061F\u066A-\u066D\u06D4\u06DE\u06E9\u06FD\u06FE\u0700-\u070D\u07F6-\u07F9\u07FE\u07FF\u0830-\u083E\u085E\u0888\u0964\u0965\u0970\u09F2\u09F3\u09FA\u09FB\u09FD\u0A76\u0AF0\u0AF1\u0B70\u0BF3-\u0BFA\u0C77\u0C7F\u0C84\u0D4F\u0D79\u0DF4\u0E3F\u0E4F\u0E5A\u0E5B\u0F01-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F85\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u104A-\u104F\u109E\u109F\u10FB\u1360-\u1368\u1390-\u1399\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DB\u1800-\u180A\u1940\u1944\u1945\u19DE-\u19FF\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2010-\u2027\u2030-\u205E\u207A-\u207E\u208A-\u208E\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2775\u2794-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u303F\u309B\u309C\u30A0\u30FB\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAA77-\uAA79\uAADE\uAADF\uAAF0\uAAF1\uAB5B\uAB6A\uAB6B\uABEB\uFB29\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDCF\uFDFC-\uFDFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD\u{10100}-\u{10102}\u{10137}-\u{1013F}\u{10179}-\u{10189}\u{1018C}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FC}\u{1039F}\u{103D0}\u{1056F}\u{10857}\u{10877}\u{10878}\u{1091F}\u{1093F}\u{10A50}-\u{10A58}\u{10A7F}\u{10AC8}\u{10AF0}-\u{10AF6}\u{10B39}-\u{10B3F}\u{10B99}-\u{10B9C}\u{10D6E}\u{10D8E}\u{10D8F}\u{10EAD}\u{10ED0}-\u{10ED8}\u{10F55}-\u{10F59}\u{10F86}-\u{10F89}\u{11047}-\u{1104D}\u{110BB}\u{110BC}\u{110BE}-\u{110C1}\u{11140}-\u{11143}\u{11174}\u{11175}\u{111C5}-\u{111C8}\u{111CD}\u{111DB}\u{111DD}-\u{111DF}\u{11238}-\u{1123D}\u{112A9}\u{113D4}\u{113D5}\u{113D7}\u{113D8}\u{1144B}-\u{1144F}\u{1145A}\u{1145B}\u{1145D}\u{114C6}\u{115C1}-\u{115D7}\u{11641}-\u{11643}\u{11660}-\u{1166C}\u{116B9}\u{1173C}-\u{1173F}\u{1183B}\u{11944}-\u{11946}\u{119E2}\u{11A3F}-\u{11A46}\u{11A9A}-\u{11A9C}\u{11A9E}-\u{11AA2}\u{11B00}-\u{11B09}\u{11BE1}\u{11C41}-\u{11C45}\u{11C70}\u{11C71}\u{11EF7}\u{11EF8}\u{11F43}-\u{11F4F}\u{11FD5}-\u{11FF1}\u{11FFF}\u{12470}-\u{12474}\u{12FF1}\u{12FF2}\u{16A6E}\u{16A6F}\u{16AF5}\u{16B37}-\u{16B3F}\u{16B44}\u{16B45}\u{16D6D}-\u{16D6F}\u{16E97}-\u{16E9A}\u{16FE2}\u{1BC9C}\u{1BC9F}\u{1CC00}-\u{1CCEF}\u{1CCFA}-\u{1CCFC}\u{1CD00}-\u{1CEB3}\u{1CEBA}-\u{1CED0}\u{1CEE0}-\u{1CEF0}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D164}\u{1D16A}-\u{1D16C}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1EA}\u{1D200}-\u{1D241}\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1E14F}\u{1E2FF}\u{1E5FF}\u{1E95E}\u{1E95F}\u{1ECAC}\u{1ECB0}\u{1ED2E}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F10D}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D8}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F8D0}-\u{1F8D8}\u{1F900}-\u{1FA57}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA8A}\u{1FA8E}-\u{1FAC6}\u{1FAC8}\u{1FACD}-\u{1FADC}\u{1FADF}-\u{1FAEA}\u{1FAEF}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBEF}\u{1FBFA}]/u,tI=/[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19\u{10107}-\u{10133}\u{10140}-\u{10178}\u{1018A}\u{1018B}\u{102E1}-\u{102FB}\u{10320}-\u{10323}\u{10341}\u{1034A}\u{103D1}-\u{103D5}\u{104A0}-\u{104A9}\u{10858}-\u{1085F}\u{10879}-\u{1087F}\u{108A7}-\u{108AF}\u{108FB}-\u{108FF}\u{10916}-\u{1091B}\u{109BC}\u{109BD}\u{109C0}-\u{109CF}\u{109D2}-\u{109FF}\u{10A40}-\u{10A48}\u{10A7D}\u{10A7E}\u{10A9D}-\u{10A9F}\u{10AEB}-\u{10AEF}\u{10B58}-\u{10B5F}\u{10B78}-\u{10B7F}\u{10BA9}-\u{10BAF}\u{10CFA}-\u{10CFF}\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}\u{10F1D}-\u{10F26}\u{10F51}-\u{10F54}\u{10FC5}-\u{10FCB}\u{11052}-\u{1106F}\u{110F0}-\u{110F9}\u{11136}-\u{1113F}\u{111D0}-\u{111D9}\u{111E1}-\u{111F4}\u{112F0}-\u{112F9}\u{11450}-\u{11459}\u{114D0}-\u{114D9}\u{11650}-\u{11659}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11730}-\u{1173B}\u{118E0}-\u{118F2}\u{11950}-\u{11959}\u{11BF0}-\u{11BF9}\u{11C50}-\u{11C6C}\u{11D50}-\u{11D59}\u{11DA0}-\u{11DA9}\u{11DE0}-\u{11DE9}\u{11F50}-\u{11F59}\u{11FC0}-\u{11FD4}\u{12400}-\u{1246E}\u{16130}-\u{16139}\u{16A60}-\u{16A69}\u{16AC0}-\u{16AC9}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16D70}-\u{16D79}\u{16E80}-\u{16E96}\u{16FF4}-\u{16FF6}\u{1CCF0}-\u{1CCF9}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D7CE}-\u{1D7FF}\u{1E140}-\u{1E149}\u{1E2F0}-\u{1E2F9}\u{1E4F0}-\u{1E4F9}\u{1E5F1}-\u{1E5FA}\u{1E8C7}-\u{1E8CF}\u{1E950}-\u{1E959}\u{1EC71}-\u{1ECAB}\u{1ECAD}-\u{1ECAF}\u{1ECB1}-\u{1ECB4}\u{1ED01}-\u{1ED2D}\u{1ED2F}-\u{1ED3D}\u{1F100}-\u{1F10C}\u{1FBF0}-\u{1FBF9}]/u,tj=/(?:[_:.#/\\-]|[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0296-\u02AF\u0300-\u036F\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u0483-\u0489\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u10D0-\u10FA\u10FD-\u10FF\u135D-\u135F\u13F8-\u13FD\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1C80-\u1C88\u1C8A\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1DC0-\u1DFF\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u20D0-\u20F0\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5F\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE-\u2CF1\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA66F-\uA672\uA674-\uA67D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA69E\uA69F\uA6F0\uA6F1\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C1\uA7C3\uA7C8\uA7CA\uA7CD\uA7CF\uA7D1\uA7D3\uA7D5\uA7D7\uA7D9\uA7DB\uA7F6\uA7FA\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uABE3-\uABEA\uABEC\uABED\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF41-\uFF5A\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10428}-\u{1044F}\u{104D8}-\u{104FB}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10CC0}-\u{10CF2}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10D70}-\u{10D85}\u{10EAB}\u{10EAC}\u{10EFA}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{118C0}-\u{118DF}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11B60}-\u{11B67}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16E60}-\u{16E7F}\u{16EBB}-\u{16ED3}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1D41A}-\u{1D433}\u{1D44E}-\u{1D454}\u{1D456}-\u{1D467}\u{1D482}-\u{1D49B}\u{1D4B6}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D4CF}\u{1D4EA}-\u{1D503}\u{1D51E}-\u{1D537}\u{1D552}-\u{1D56B}\u{1D586}-\u{1D59F}\u{1D5BA}-\u{1D5D3}\u{1D5EE}-\u{1D607}\u{1D622}-\u{1D63B}\u{1D656}-\u{1D66F}\u{1D68A}-\u{1D6A5}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6E1}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D71B}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D755}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D78F}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7C9}\u{1D7CB}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF09}\u{1DF0B}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E6E3}\u{1E6E6}\u{1E6EE}\u{1E6EF}\u{1E6F5}\u{1E8D0}-\u{1E8D6}\u{1E922}-\u{1E94A}\u{E0100}-\u{E01EF}][A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C89\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7CB\uA7CC\uA7CE\uA7D0\uA7D2\uA7D4\uA7D6\uA7D8\uA7DA\uA7DC\uA7F5\uFF21-\uFF3A\u{10400}-\u{10427}\u{104B0}-\u{104D3}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10C80}-\u{10CB2}\u{10D50}-\u{10D65}\u{118A0}-\u{118BF}\u{16E40}-\u{16E5F}\u{16EA0}-\u{16EB8}\u{1D400}-\u{1D419}\u{1D434}-\u{1D44D}\u{1D468}-\u{1D481}\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B5}\u{1D4D0}-\u{1D4E9}\u{1D504}\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D538}\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D56C}-\u{1D585}\u{1D5A0}-\u{1D5B9}\u{1D5D4}-\u{1D5ED}\u{1D608}-\u{1D621}\u{1D63C}-\u{1D655}\u{1D670}-\u{1D689}\u{1D6A8}-\u{1D6C0}\u{1D6E2}-\u{1D6FA}\u{1D71C}-\u{1D734}\u{1D756}-\u{1D76E}\u{1D790}-\u{1D7A8}\u{1D7CA}\u{1E900}-\u{1E921}]|^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C89\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7CB\uA7CC\uA7CE\uA7D0\uA7D2\uA7D4\uA7D6\uA7D8\uA7DA\uA7DC\uA7F5\uFF21-\uFF3A\u{10400}-\u{10427}\u{104B0}-\u{104D3}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10C80}-\u{10CB2}\u{10D50}-\u{10D65}\u{118A0}-\u{118BF}\u{16E40}-\u{16E5F}\u{16EA0}-\u{16EB8}\u{1D400}-\u{1D419}\u{1D434}-\u{1D44D}\u{1D468}-\u{1D481}\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B5}\u{1D4D0}-\u{1D4E9}\u{1D504}\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D538}\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D56C}-\u{1D585}\u{1D5A0}-\u{1D5B9}\u{1D5D4}-\u{1D5ED}\u{1D608}-\u{1D621}\u{1D63C}-\u{1D655}\u{1D670}-\u{1D689}\u{1D6A8}-\u{1D6C0}\u{1D6E2}-\u{1D6FA}\u{1D71C}-\u{1D734}\u{1D756}-\u{1D76E}\u{1D790}-\u{1D7A8}\u{1D7CA}\u{1E900}-\u{1E921}]{2,}$)/u,tF=/^[A-Z\xC0-\xD6\xD8-\xDE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u037F\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0528\u052A\u052C\u052E\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u13A0-\u13F5\u1C89\u1C90-\u1CBA\u1CBD-\u1CBF\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2F\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA698\uA69A\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA796\uA798\uA79A\uA79C\uA79E\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA-\uA7AE\uA7B0-\uA7B4\uA7B6\uA7B8\uA7BA\uA7BC\uA7BE\uA7C0\uA7C2\uA7C4-\uA7C7\uA7C9\uA7CB\uA7CC\uA7CE\uA7D0\uA7D2\uA7D4\uA7D6\uA7D8\uA7DA\uA7DC\uA7F5\uFF21-\uFF3A\u{10400}-\u{10427}\u{104B0}-\u{104D3}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10C80}-\u{10CB2}\u{10D50}-\u{10D65}\u{118A0}-\u{118BF}\u{16E40}-\u{16E5F}\u{16EA0}-\u{16EB8}\u{1D400}-\u{1D419}\u{1D434}-\u{1D44D}\u{1D468}-\u{1D481}\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B5}\u{1D4D0}-\u{1D4E9}\u{1D504}\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D538}\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D56C}-\u{1D585}\u{1D5A0}-\u{1D5B9}\u{1D5D4}-\u{1D5ED}\u{1D608}-\u{1D621}\u{1D63C}-\u{1D655}\u{1D670}-\u{1D689}\u{1D6A8}-\u{1D6C0}\u{1D6E2}-\u{1D6FA}\u{1D71C}-\u{1D734}\u{1D756}-\u{1D76E}\u{1D790}-\u{1D7A8}\u{1D7CA}\u{1E900}-\u{1E921}]['\x2D\.A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u065F\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06EF\u06FA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07CA-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u0870-\u0887\u0889-\u088F\u0897-\u08E1\u08E3-\u0963\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09F0\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A70-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5C\u0C5D\u0C60-\u0C63\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDC-\u0CDE\u0CE0-\u0CE3\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u103F\u1050-\u108F\u109A-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1715\u171F-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u180B-\u180D\u180F\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F\u1AA7\u1AB0-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B4C\u1B6B-\u1B73\u1B80-\u1BAF\u1BBA-\u1BF3\u1C00-\u1C37\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2019\u2071\u207F\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005\u3006\u302A-\u302F\u3031-\u3035\u303B\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6E5\uA6F0\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA827\uA82C\uA840-\uA873\uA880-\uA8C5\uA8E0-\uA8F7\uA8FB\uA8FD-\uA8FF\uA90A-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF\uA9E0-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10940}-\u{10959}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D27}\u{10D4A}-\u{10D65}\u{10D69}-\u{10D6D}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EAB}\u{10EAC}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC7}\u{10EFA}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F50}\u{10F70}-\u{10F85}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11000}-\u{11046}\u{11070}-\u{11075}\u{1107F}-\u{110BA}\u{110C2}\u{110D0}-\u{110E8}\u{11100}-\u{11134}\u{11144}-\u{11147}\u{11150}-\u{11173}\u{11176}\u{11180}-\u{111C4}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{11237}\u{1123E}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112EA}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D3}\u{113E1}\u{113E2}\u{11400}-\u{1144A}\u{1145E}-\u{11461}\u{11480}-\u{114C5}\u{114C7}\u{11580}-\u{115B5}\u{115B8}-\u{115C0}\u{115D8}-\u{115DD}\u{11600}-\u{11640}\u{11644}\u{11680}-\u{116B8}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11740}-\u{11746}\u{11800}-\u{1183A}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11943}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E1}\u{119E3}\u{119E4}\u{11A00}-\u{11A3E}\u{11A47}\u{11A50}-\u{11A99}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11B60}-\u{11B67}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C40}\u{11C72}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DB0}-\u{11DDB}\u{11EE0}-\u{11EF6}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13440}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1612F}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF4}\u{16B00}-\u{16B36}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16EA0}-\u{16EB8}\u{16EBB}-\u{16ED3}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FE4}\u{16FF0}-\u{16FF3}\u{17000}-\u{18CD5}\u{18CFF}-\u{18D1E}\u{18D80}-\u{18DF2}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2EF}\u{1E4D0}-\u{1E4EF}\u{1E5D0}-\u{1E5F0}\u{1E6C0}-\u{1E6DE}\u{1E6E0}-\u{1E6F5}\u{1E6FE}\u{1E6FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E8D0}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B81D}\u{2B820}-\u{2CEAD}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{33479}\u{E0100}-\u{E01EF}]{2,}$/u,tO=/[.!?\u2026]["'\)\]\}\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63]*$/u,tz={balanced:()=>({type:"server_vad",threshold:.5,prefix_padding_ms:300,silence_duration_ms:500}),headset:()=>({type:"server_vad",threshold:.4,prefix_padding_ms:200,silence_duration_ms:420}),laptop:()=>({type:"server_vad",threshold:.55,prefix_padding_ms:300,silence_duration_ms:620}),noisy:()=>({type:"server_vad",threshold:.66,prefix_padding_ms:300,silence_duration_ms:760}),semantic:()=>({type:"semantic_vad",eagerness:"low"})},tB={phase:"idle",errorReason:void 0,errorMessage:void 0};function tP(e,t){switch(t.type){case"requesting":return{...tB,phase:"requesting"};case"negotiating":return{...tB,phase:"negotiating"};case"connected":return{...tB,phase:"connected"};case"error":return{...tB,phase:"error",errorReason:t.reason,errorMessage:t.message};case"reset":return tB;}}function tL(e){let t=[...e],n=0,r=t.length;for(;n<r&&tR.test((_t$n=t[n])!==null&&_t$n!==void 0?_t$n:"");){var _t$n;n+=1;}for(;r>n&&tR.test((_t3=t[r-1])!==null&&_t3!==void 0?_t3:"");){var _t3;r-=1;}return t.slice(n,r).join("");}function t$(e){return tL(e).normalize("NFC").toLowerCase();}function tq(e,t){let n=t$(e);return n.length>0&&n===t$(t);}function tV(e,t){let n=tH(e!==null&&e!==void 0?e:""),r=tH(t);if(0===n.length)return r;if(0===r.length)return n;let i=n.split(" "),s=r.split(" "),o=function(e,t){if(tO.test(e.join(" ")))return 0;let n=Math.min(e.length,t.length,8);for(let r=n;r>=2;r-=1){let n=e.length-r;if(t.slice(0,r).every((t,r)=>{var _e2;return tq((_e2=e[n+r])!==null&&_e2!==void 0?_e2:"",t);}))return r;}let r=e.at(-1),i=t[0];return void 0!==r&&void 0!==i&&function(e,t){if(!tq(e,t))return!1;let n=tL(e),r=tL(t),i=t$(e);return tI.test(i)||tj.test(n)||tj.test(r)||tF.test(n)&&tF.test(r);}(r,i)?1:0;}(i,s);return`${n} ${s.slice(o).join(" ")}`.trimEnd();}function tU(){return{answerApplied:!1,rtcConnected:!1,dataChannelOpen:!1,sessionUpdated:!1,warmupComplete:!1,requiresDataChannelAck:!0};}function tW(){let e=new Uint32Array(4);return globalThis.crypto.getRandomValues(e),[...e].map(e=>e.toString(16).padStart(8,"0")).join("");}function tK(e){return e instanceof e5.b||e instanceof tA?{reason:e.reason,message:e.message}:{reason:"connection-failed",message:"Real-time voice could not be started."};}function tH(e){return e.replace(/\s+/gu," ").trim();}var tJ=e.i(69243);function tG(e,t,n,r,i){(0,R.v)(`[keiko] batch voice dialogue (stage=${e})`,{kind:"voice-dialogue",voiceDialogueStage:e,...(void 0===r?{}:{voiceCaptureReason:r}),...(void 0===i?{}:{voiceCaptureError:i}),...(void 0===n?{}:{parentCorrelationId:n}),...(void 0===t?{}:{correlationId:t})});}function tZ(e,t){return e.active&&e.generation===t;}function tQ(e,t,n,r,i){e.generation+=1,e.active=t,e.expectedAnswerId=void 0,e.expectedAnswerCorrelationId=void 0,e.sessionCorrelationId=t?crypto.randomUUID():void 0,n(!1),r(void 0),i(void 0);}async function tY(e){try{if(await e.prepare(),!tZ(e.flagsRef.current,e.generation))return;e.preparedRef.current=!0,e.setPreparing(!1),e.startDictation();}catch{if(!tZ(e.flagsRef.current,e.generation))return;e.setPreparing(!1),e.setStartupError("Voice could not be prepared. Try again."),tG("preparation-failed",e.flagsRef.current.sessionCorrelationId);}}function tX(e){return"requesting"===e||"recording"===e||"finalizing"===e||"transcribing"===e;}function t0({action:e,onAccept:t,onReject:n}){let r=(0,e9.f)(),[i,s]=(0,y.useState)(null),[o,a]=(0,y.useState)(),l=(0,y.useCallback)((t,n)=>{void 0!==n&&null===i&&(s(t),a(void 0),n(e.proposalId).catch(e=>{a(e instanceof Error?e.message:r("voice.realtime.memory.updateFailed"));}).finally(()=>s(null)));},[e.proposalId,i,r]);return(0,f.jsxs)("div",{className:"cmp-voice-memory-candidate",children:[(0,f.jsx)("span",{className:"cmp-voice-memory-candidate-text",children:e.body}),(0,f.jsxs)("div",{className:"cmp-voice-memory-actions",children:[(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn cmp-voice-btn-primary","aria-busy":"accept"===i,"aria-disabled":null!==i||void 0===t,onClick:()=>l("accept",t),children:r("memoria.approve")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn","aria-busy":"reject"===i,"aria-disabled":null!==i||void 0===n,onClick:()=>l("reject",n),children:r("memoria.reject")})]}),void 0!==o?(0,f.jsx)("span",{className:"cmp-voice-memory-error",children:o}):null]});}function t1({memoryContextText:e,memoryContextCount:t,memoryActions:n,onAcceptMemoryCandidate:r,onRejectMemoryCandidate:i}){var _n$filter;let s=(0,e9.f)(),o=void 0!==e&&e.trim().length>0,a=void 0!==t&&t>0?s(1===t?"voice.realtime.memory.one":"voice.realtime.memory.many",{count:t}):o?s("voice.realtime.memory.contextActive"):null,l=(_n$filter=n===null||n===void 0?void 0:n.filter(e=>"candidate"===e.kind&&"proposed"===e.status))!==null&&_n$filter!==void 0?_n$filter:[];return null===a&&0===l.length?null:(0,f.jsxs)("div",{className:"cmp-voice-memory","aria-label":s("voice.realtime.memory.region"),children:[null!==a?(0,f.jsx)("span",{className:"cmp-voice-memory-summary",children:a}):null,l.map(e=>(0,f.jsx)(t0,{action:e,onAccept:r,onReject:i},e.proposalId))]});}function t2({phase:e,error:t,onRetry:n,onDismiss:r,memoryContextText:i,memoryContextCount:s,memoryActions:o,onAcceptMemoryCandidate:a,onRejectMemoryCandidate:l}){let c=(0,e9.f)(),u=(0,y.useRef)(null);return((0,y.useEffect)(()=>{var _u$current;"error"===e&&((_u$current=u.current)===null||_u$current===void 0?void 0:_u$current.focus());},[e]),"negotiating"===e)?(0,f.jsxs)("div",{className:"cmp-voice-preview",role:"status","aria-live":"polite",children:[(0,f.jsx)("span",{className:"cmp-loading-dot","aria-hidden":"true"}),c("voice.realtime.connecting")]}):"connected"===e?(0,f.jsxs)("section",{className:"cmp-voice-preview","aria-label":c("voice.realtime.status"),children:[(0,f.jsxs)("div",{className:"cmp-voice-connected-line",role:"status","aria-live":"polite",children:[(0,f.jsx)("span",{className:"cmp-voice-dot","aria-hidden":"true"}),c("voice.realtime.connected")]}),(0,f.jsx)(t1,{memoryContextText:i,memoryContextCount:s,memoryActions:o,onAcceptMemoryCandidate:a,onRejectMemoryCandidate:l})]}):"error"===e&&void 0!==t?(0,f.jsxs)("div",{className:"cmp-voice-preview cmp-voice-error",role:"alert","aria-atomic":"true",children:[(0,f.jsx)("p",{className:"cmp-voice-error-text",children:function(e,t){switch(e){case"permission-denied":return t("voice.realtime.error.permission");case"no-microphone":return t("voice.error.noMicrophone");case"unsupported":return t("voice.realtime.error.unsupported");case"unavailable":return t("voice.realtime.error.unavailable");case"negotiation-failed":return t("voice.realtime.error.negotiationFailed");case"connection-failed":return t("voice.realtime.error.connectionFailed");}}(t.reason,c)}),(0,f.jsx)("p",{className:"cmp-voice-error-text",children:t.message}),(0,f.jsxs)("div",{className:"cmp-voice-actions",children:[(0,f.jsx)("button",{type:"button",ref:u,className:"cmp-voice-btn",onClick:n,children:c("common.tryAgain")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",onClick:r,children:c("common.dismiss")})]})]}):null;}function t3({controller:e,onAfterDismiss:t,memoryContextText:n,memoryContextCount:r,memoryActions:i,onAcceptMemoryCandidate:s,onRejectMemoryCandidate:o}){return(0,f.jsx)(t2,{phase:e.phase,error:e.error,onRetry:e.retry,memoryContextText:n,memoryContextCount:r,memoryActions:i,onAcceptMemoryCandidate:s,onRejectMemoryCandidate:o,onDismiss:()=>{e.stop(),t();}});}X.f.close,X.f.mic;var t6=e.i(18138);let t5=new Map();function t4(e){if("number"==typeof e)return Number.isInteger(e)&&e>0?e:void 0;let t=e.trim();if(null===/^(?:\[(\d+)\]|【(\d+)】|[(\d+)]|(\d+))$/u.exec(t))return;let n=Number.parseInt(t.replace(/^[\u005B【[]/u,"").replace(/[\u005D】]]$/u,""),10);return Number.isInteger(n)&&n>0?n:void 0;}function t9(e,t,n){let r=t4(n.marker);return`${e}:${t}:${String(r!==null&&r!==void 0?r:n.marker)}:${n.stableId}`;}function t8(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),r;}let t7={ready:"Voice dialogue is ready.",preparing:"Preparing the voice dialogue…",reconnecting:"Reconnecting the voice dialogue…",listening:"Listening to you.",thinking:"The assistant is thinking.","checking-sources":"Checking connected sources…",speaking:"The assistant is speaking.",muted:"Voice dialogue microphone is muted.",interrupted:"Voice dialogue interrupted.",error:"Voice dialogue could not continue. You can keep chatting in text."};var ne=e.i(13271),nt=e.i(95973),nn=e.i(14674),nr=e.i(10644),ni=e.i(64798);function ns(e){return"capsule"===e.kind?`capsule:${e.capsuleId}`:`set:${e.capsuleSetId}`;}function no(e){let{label:t,t:n}=e,{busy:r,disconnectRef:i,handleDisconnect:s}=function({chat:e,scope:t,allScopes:n,onDisconnect:r,updateScopes:i,setError:s,t:o}){let[a,l]=(0,y.useState)(!1),c=(0,y.useRef)(null),u=ns(t);async function d(){if(a)return;s(null),l(!0);let t=c.current,d=t===null||t===void 0?void 0:t.closest(".chat-scope-header");try{let t=n.filter(e=>ns(e)!==u),s=await(0,x.C)(e,t.length>0?t:null,i,r);r===null||r===void 0||r(s.chat);}catch(e){s((0,O.A)(e,o("localKnowledge.scopePill.disconnectError")));}finally{l(!1),(0,nn.a)(d,t);}}return{busy:a,disconnectRef:c,handleDisconnect:d};}(e),o=n("localKnowledge.scopePill.disconnect",{label:t});return(0,f.jsx)("span",{className:`scope-pill-wrap ${B.default.cmpPillWrap}`,children:(0,f.jsxs)("span",{className:"scope-pill scope-pill--connector",children:[(0,f.jsx)("span",{"aria-hidden":"true",children:"◆"}),(0,f.jsx)("span",{"aria-label":t,children:t}),(0,f.jsx)("button",{type:"button",ref:i,className:"scope-pill-disconnect","aria-disabled":r,"aria-label":o,title:o,onClick:()=>{s();},children:(0,f.jsx)("span",{"aria-hidden":"true",children:"×"})})]})});}function na({announcement:e}){return(0,f.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","data-testid":"connector-scope-announcer",children:e});}function nl({chat:e,onDisconnect:t,updateScopes:n=b.WQ,labels:r=new Map(),labelsSettled:i=!0}){let s=(0,nr.u)(),{error:o,setError:a}=(0,ni.u)(e),l=(0,M.r)(e),c=l.map(e=>ns(e)).join(" "),[u,d]=(0,y.useState)(""),h=(0,y.useRef)(c);(0,y.useEffect)(()=>{if(h.current!==c){var e;h.current=c,d((e=l.length,0===e?s("localKnowledge.scopePill.removed"):1===e?s("localKnowledge.scopePill.updated.one"):s("localKnowledge.scopePill.updated.other",{count:e})));}},[c,l.length,s]);let p=(0,f.jsx)(na,{announcement:u});return 0===l.length?(0,ni.k)(u,p,o):(0,f.jsxs)("span",{className:"scope-pill-group scope-pill-group--connector",children:[p,(0,f.jsx)(ni.L,{error:o}),l.map(o=>(0,f.jsx)(no,{chat:e,scope:o,allScopes:l,onDisconnect:t,updateScopes:n,setError:a,label:function(e,t,n,r){let i=t.get(ns(e));if(void 0!==i&&i.length>0)return i;let s="capsule"===e.kind;return r(n?s?"localKnowledge.picker.unavailablePod":"localKnowledge.picker.unavailableSet":s?"localKnowledge.scopePill.pendingPod":"localKnowledge.scopePill.pendingSet");}(o,r,i,s),t:s},ns(o)))]});}var nc=e.i(56049),nu=e.i(2268),nd=e.i(92902);function nh(e){this.content=e;}function np(e){return e>=56320&&e<57344;}function nf(e){return e>=55296&&e<56320;}nh.prototype={constructor:nh,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1;},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1];},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return-1==i?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new nh(s);},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new nh(n);},addToStart:function(e,t){return new nh([e,t].concat(this.remove(e).content));},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new nh(n);},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(-1==s?i.length:s,0,t,n),new nh(i);},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1]);},prepend:function(e){return(e=nh.from(e)).size?new nh(e.content.concat(this.subtract(e).content)):this;},append:function(e){return(e=nh.from(e)).size?new nh(this.subtract(e).content.concat(e.content)):this;},subtract:function(e){var t=this;e=nh.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t;},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n;}),e;},get size(){return this.content.length>>1;}},nh.from=function(e){if(e instanceof nh)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new nh(t);};class nm{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize;}nodesBetween(e,t,n,r=0,i){for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;if(l>e&&!1!==n(a,r+o,i||null,s)&&a.content.size){let i=o+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i);}o=l;}}descendants(e){this.nodesBetween(0,this.size,e);}textBetween(e,t,n,r){let i="",s=!0;return this.nodesBetween(e,t,(o,a)=>{let l=o.isText?o.text.slice(Math.max(e,a)-a,t-a):o.isLeaf?r?"function"==typeof r?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&l||o.isTextblock)&&n&&(s?s=!1:i+=n),i+=l;},0),i;}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new nm(r,this.size+e.size);}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,s=0;s<t;i++){let o=this.content[i],a=s+o.nodeSize;a>e&&((s<e||a>t)&&(o=o.isText?o.cut(Math.max(0,e-s),Math.min(o.text.length,t-s)):o.cut(Math.max(0,e-s-1),Math.min(o.content.size,t-s-1))),n.push(o),r+=o.nodeSize),s=a;}return new nm(n,r);}cutByIndex(e,t){return e==t?nm.empty:0==e&&t==this.content.length?this:new nm(this.content.slice(e,t));}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new nm(r,i);}addToStart(e){return new nm([e].concat(this.content),this.size+e.nodeSize);}addToEnd(e){return new nm(this.content.concat(e),this.size+e.nodeSize);}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0;}get firstChild(){return this.content.length?this.content[0]:null;}get lastChild(){return this.content.length?this.content[this.content.length-1]:null;}get childCount(){return this.content.length;}child(e){let t=this.content[e];if(!t)throw RangeError("Index "+e+" out of range for "+this);return t;}maybeChild(e){return this.content[e]||null;}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize;}}findDiffStart(e,t=0){return function e(t,n,r){for(let i=0;;i++){if(i==t.childCount||i==n.childCount)return t.childCount==n.childCount?null:r;let s=t.child(i),o=n.child(i);if(s==o){r+=s.nodeSize;continue;}if(!s.sameMarkup(o))return r;if(s.isText&&s.text!=o.text){let e=s.text,t=o.text,n=0;for(;e[n]==t[n];n++)r++;return n&&n<e.length&&n<t.length&&nf(e.charCodeAt(n-1))&&np(e.charCodeAt(n))&&r--,r;}if(s.content.size||o.content.size){let t=e(s.content,o.content,r+1);if(null!=t)return t;}r+=s.nodeSize;}}(this,e,t);}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let s=t.childCount,o=n.childCount;;){if(0==s||0==o)return s==o?null:{a:r,b:i};let a=t.child(--s),l=n.child(--o),c=a.nodeSize;if(a==l){r-=c,i-=c;continue;}if(!a.sameMarkup(l))return{a:r,b:i};if(a.isText&&a.text!=l.text){let e=a.text,t=l.text,n=e.length,s=t.length;for(;n>0&&s>0&&e[n-1]==t[s-1];)n--,s--,r--,i--;return n&&s&&n<e.length&&nf(e.charCodeAt(n-1))&&np(e.charCodeAt(n))&&(r++,i++),{a:r,b:i};}if(a.content.size||l.content.size){let t=e(a.content,l.content,r-1,i-1);if(t)return t;}r-=c,i-=c;}}(this,e,t,n);}findIndex(e){if(0==e)return nv(0,e);if(e==this.size)return nv(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=n+this.child(t).nodeSize;if(r>=e){if(r==e)return nv(t+1,r);return nv(t,n);}n=r;}}toString(){return"<"+this.toStringInner()+">";}toStringInner(){return this.content.join(", ");}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null;}static fromJSON(e,t){if(!t)return nm.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return nm.fromArray(t.map(e.nodeFromJSON));}static fromArray(e){if(!e.length)return nm.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i);}return new nm(t||e,n);}static from(e){if(!e)return nm.empty;if(e instanceof nm)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new nm([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""));}}nm.empty=new nm([],0);let ng={index:0,offset:0};function nv(e,t){return ng.index=e,ng.offset=t,ng;}function ny(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!ny(e[n],t[n]))return!1;}else{for(let n in e)if(!(n in t)||!ny(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1;}return!0;}class nk{constructor(e,t){this.type=e,this.attrs=t;}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i);}}return t||(t=e.slice()),n||t.push(this),t;}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e;}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1;}eq(e){return this==e||this.type==e.type&&ny(this.attrs,e.attrs);}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break;}return e;}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs);}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0;}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return nk.none;if(e instanceof nk)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t;}}nk.none=[];class nb extends Error{}class nx{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n;}get size(){return this.content.size-this.openStart-this.openEnd;}insertAt(e,t){let n=function e(t,n,r,i,s,o){let{index:a,offset:l}=t.findIndex(n),c=t.maybeChild(a);if(l==n||c.isText)return o&&i<=0&&s<=0&&!o.canReplace(a,a,r)?null:t.cut(0,n).append(r).append(t.cut(n));let u=e(c.content,n-l-1,r,0==a?i-1:0,a==t.childCount-1?s-1:0,c);return u&&t.replaceChild(a,c.copy(u));}(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return n&&new nx(n,this.openStart,this.openEnd);}removeBetween(e,t){return new nx(function e(t,n,r){let{index:i,offset:s}=t.findIndex(n),o=t.maybeChild(i),{index:a,offset:l}=t.findIndex(r);if(s==n||o.isText){if(l!=r&&!t.child(a).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r));}if(i!=a)throw RangeError("Removing non-flat range");return t.replaceChild(i,o.copy(e(o.content,n-s-1,r-s-1)));}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd);}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd;}toString(){return this.content+"("+this.openStart+","+this.openEnd+")";}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e;}static fromJSON(e,t){if(!t)return nx.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new nx(nm.fromJSON(e,t.content),n,r);}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new nx(e,n,r);}}function nw(e,t){if(!t.type.compatibleContent(e.type))throw new nb("Cannot join "+t.type.name+" onto "+e.type.name);}function nC(e,t,n){let r=e.node(n);return nw(r,t.node(n)),r;}function nS(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e);}function nD(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(nS(e.nodeAfter,r),s++));for(let e=s;e<o;e++)nS(i.child(e),r);t&&t.depth==n&&t.textOffset&&nS(t.nodeBefore,r);}function nA(e,t){if(!e.type.validContent(t))throw new nb("Invalid content for node "+e.type.name);return e.copy(t);}function nE(e,t,n){let r=[];return nD(null,e,n,r),e.depth>n&&nS(nA(nC(e,t,n+1),nE(e,t,n+1)),r),nD(t,null,n,r),new nm(r);}nx.empty=new nx(nm.empty,0,0);class nM{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1;}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e;}get parent(){return this.node(this.depth);}get doc(){return this.node(0);}node(e){return this.path[3*this.resolveDepth(e)];}index(e){return this.path[3*this.resolveDepth(e)+1];}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0);}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1;}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size;}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1];}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize;}get textOffset(){return this.pos-this.path[this.path.length-1];}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r;}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1);}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r;}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return nk.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e;}let i=n.marks;for(var s=0;s<i.length;s++)!1!==i[s].type.spec.inclusive||r&&i[s].isInSet(r.marks)||(i=i[s--].removeFromSet(i));return i;}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n;}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0;}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new nR(this,e,n);return null;}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset;}max(e){return e.pos>this.pos?e:this;}min(e){return e.pos<this.pos?e:this;}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset;}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let t=e;;){let{index:e,offset:s}=t.content.findIndex(i),o=i-s;if(n.push(t,e,r+s),!o||(t=t.child(e)).isText)break;i=o-1,r+=s+1;}return new nM(t,n,i);}static resolveCached(e,t){let n=nT.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r;}else nT.set(e,n=new nN());let r=n.elts[n.i]=nM.resolve(e,t);return n.i=(n.i+1)%n_,r;}}class nN{constructor(){this.elts=[],this.i=0;}}let n_=12,nT=new WeakMap();class nR{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n;}get start(){return this.$from.before(this.depth+1);}get end(){return this.$to.after(this.depth+1);}get parent(){return this.$from.node(this.depth);}get startIndex(){return this.$from.index(this.depth);}get endIndex(){return this.$to.indexAfter(this.depth);}}let nI=Object.create(null);class nj{constructor(e,t,n,r=nk.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||nm.empty;}get children(){return this.content.content;}get nodeSize(){return this.isLeaf?1:2+this.content.size;}get childCount(){return this.content.childCount;}child(e){return this.content.child(e);}maybeChild(e){return this.content.maybeChild(e);}forEach(e){this.content.forEach(e);}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this);}descendants(e){this.nodesBetween(0,this.content.size,e);}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"");}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r);}get firstChild(){return this.content.firstChild;}get lastChild(){return this.content.lastChild;}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content);}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks);}hasMarkup(e,t,n){return this.type==e&&ny(this.attrs,t||e.defaultAttrs||nI)&&nk.sameSet(this.marks,n||nk.none);}copy(e=null){return e==this.content?this:new nj(this.type,this.attrs,e,this.marks);}mark(e){return e==this.marks?this:new nj(this.type,this.attrs,this.content,e);}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t));}slice(e,t=this.content.size,n=!1){if(e==t)return nx.empty;let r=this.resolve(e),i=this.resolve(t),s=n?0:r.sharedDepth(t),o=r.start(s);return new nx(r.node(s).content.cut(r.pos-o,i.pos-o),r.depth-s,i.depth-s);}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new nb("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new nb("Inconsistent open depths");return function e(t,n,r,i){let s=t.index(i),o=t.node(i);if(s==n.index(i)&&i<t.depth-r.openStart){let a=e(t,n,r,i+1);return o.copy(o.content.replaceChild(s,a));}if(!r.content.size)return nA(o,nE(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(nm.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)};}(r,t);return nA(o,function e(t,n,r,i,s){let o=t.depth>s&&nC(t,n,s+1),a=i.depth>s&&nC(r,i,s+1),l=[];return nD(null,t,s,l),o&&a&&n.index(s)==r.index(s)?(nw(o,a),nS(nA(o,e(t,n,r,i,s+1)),l)):(o&&nS(nA(o,nE(t,n,s+1)),l),nD(n,r,s,l),a&&nS(nA(a,nE(r,i,s+1)),l)),nD(i,null,s,l),new nm(l);}(t,e,s,n,i));}{let e=t.parent,i=e.content;return nA(e,i.cut(0,t.parentOffset).append(r.content).append(i.cut(n.parentOffset)));}}(r,i,n,0);}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))return null;if(r==e||t.isText)return t;e-=r+1;}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n};}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize};}resolve(e){return nM.resolveCached(this,e);}resolveNoCache(e){return nM.resolve(this,e);}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r;}get isBlock(){return this.type.isBlock;}get isTextblock(){return this.type.isTextblock;}get inlineContent(){return this.type.inlineContent;}get isInline(){return this.type.isInline;}get isText(){return this.type.isText;}get isLeaf(){return this.type.isLeaf;}get isAtom(){return this.type.isAtom;}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),nO(this.marks,e);}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error("Called contentMatchAt on a node with invalid content");return t;}canReplace(e,t,n=nm.empty,r=0,i=n.childCount){let s=this.contentMatchAt(e).matchFragment(n,r,i),o=s&&s.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0;}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),s=i&&i.matchFragment(this.content,t);return!!s&&s.validEnd;}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type);}check(){this.type.checkContent(this.content),nz(this.type.attrs,this.attrs,"node",this.type.name);let e=nk.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];nz(n.type.attrs,n.attrs,"mark",n.type.name),e=n.addToSet(e);}if(!nk.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check());}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break;}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e;}static fromJSON(e,t){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON);}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n);}let r=nm.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n);}}nj.prototype.text=void 0;class nF extends nj{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError("Empty text nodes are not allowed");this.text=n;}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):nO(this.marks,JSON.stringify(this.text));}get textContent(){return this.text;}textBetween(e,t){return this.text.slice(e,t);}get nodeSize(){return this.text.length;}mark(e){return e==this.marks?this:new nF(this.type,this.attrs,this.text,e);}withText(e){return e==this.text?this:new nF(this.type,this.attrs,e,this.marks);}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t));}eq(e){return this.sameMarkup(e)&&this.text==e.text;}toJSON(){let e=super.toJSON();return e.text=this.text,e;}}function nO(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t;}function nz(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n]);}class nB{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[];}static parse(e,t){var n;let r,i=new nP(e,t);if(null==i.next)return nB.empty;let s=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n;}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r);}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i;}(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e};}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=nL(e),r=n;return e.eat(",")&&(r="}"!=e.next?nL(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t};}(t,n);else break;return n;}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n};}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n};}(i);i.next&&i.err("Unexpected trailing text");let o=(n=function(e){let t=[[]];return i(function e(t,s){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,s)),[]);if("seq"==t.type)for(let r=0;;r++){let o=e(t.exprs[r],s);if(r==t.exprs.length-1)return o;i(o,s=n());}else if("star"==t.type){let o=n();return r(s,o),i(e(t.expr,o),o),[r(o)];}else if("plus"==t.type){let o=n();return i(e(t.expr,s),o),i(e(t.expr,o),o),[r(o)];}else if("opt"==t.type)return[r(s)].concat(e(t.expr,s));else if("range"==t.type){let o=s;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,o),r),o=r;}if(-1==t.max)i(e(t.expr,o),o);else for(let s=t.min;s<t.max;s++){let s=n();r(o,s),i(e(t.expr,o),s),o=s;}return[r(o)];}else if("name"==t.type)return[r(s,void 0,t.value)];else throw Error("Unknown expr type");}(e,0),n()),t;function n(){return t.push([])-1;}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i;}function i(e,t){e.forEach(e=>e.to=t);}}(s),r=Object.create(null),function e(t){let i=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<i.length;t++)i[t][0]==e&&(r=i[t][1]);nq(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t);});}});});let s=r[t.join(",")]=new nB(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(n$);s.next.push({type:i[t][0],next:r[n.join(",")]||e(n)});}return s;}(nq(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,s=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];s.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(o)&&r.push(o);}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)");}}(o,i),o;}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null;}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r;}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline;}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t;}return null;}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1;}fillBefore(e,t=!1,n=0){let r=[this];return function i(s,o){let a=s.matchFragment(e,n);if(a&&(!t||a.validEnd))return nm.from(o.map(e=>e.createAndFill()));for(let e=0;e<s.next.length;e++){let{type:t,next:n}=s.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,o.concat(t));if(e)return e;}}return null;}(this,[]);}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t;}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse();}for(let e=0;e<i.next.length;e++){let{type:s,next:o}=i.next[e];s.isLeaf||s.hasRequiredAttrs()||s.name in t||r.type&&!o.validEnd||(n.push({match:s.contentMatch,type:s,via:r}),t[s.name]=!0);}}return null;}get edgeCount(){return this.next.length;}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e];}toString(){let e=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next);}(this),e.map((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let n=0;n<t.next.length;n++)r+=(n?", ":"")+t.next[n].type.name+"->"+e.indexOf(t.next[n].next);return r;}).join("\n");}}nB.empty=new nB(!0);class nP{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift();}get next(){return this.tokens[this.pos];}eat(e){return this.next==e&&(this.pos++||!0);}err(e){throw SyntaxError(e+" (in content expression '"+this.string+"')");}}function nL(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t;}function n$(e,t){return t-e;}function nq(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:s}=i[e];r||-1!=n.indexOf(s)||t(s);}}(t),n.sort(n$);}function nV(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default;}return t;}function nU(e,t){let n=Object.create(null);for(let r in e){let i=e[r],s=t&&t[r];if(void 0===s){if(i.hasDefault)s=i.default;else throw RangeError("No value supplied for attribute "+r);}else i.validate&&i.validate(s);n[r]=s;}return n;}function nW(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new nH(e,r,t[r]);return n;}class nK{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=nW(e,n.attrs),this.defaultAttrs=nV(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e;}get isInline(){return!this.isBlock;}get isTextblock(){return this.isBlock&&this.inlineContent;}get isLeaf(){return this.contentMatch==nB.empty;}get isAtom(){return this.isLeaf||!!this.spec.atom;}isInGroup(e){return this.groups.indexOf(e)>-1;}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal");}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1;}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch);}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:nU(this.attrs,e);}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new nj(this,this.computeAttrs(e),nm.from(t),nk.setFrom(n));}createChecked(e=null,t,n){return t=nm.from(t),this.checkContent(t),new nj(this,this.computeAttrs(e),t,nk.setFrom(n));}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=nm.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t);}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(nm.empty,!0);return i?new nj(this,e,t.append(i),nk.setFrom(n)):null;}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0;}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`);}checkAttrs(e){}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1;}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0;}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:nk.none:e;}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new nK(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n;}}class nH{constructor(e,t,n){let r;this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?(r=n.validate.split("|"),n=>{let i=null===n?"null":typeof n;if(0>r.indexOf(i))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`);}):n.validate;}get isRequired(){return!this.hasDefault;}}class nJ{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=nW(e,r.attrs),this.excluded=null;let i=nV(this.attrs);this.instance=i?new nk(this,i):null;}create(e=null){return!e&&this.instance?this.instance:new nk(this,nU(this.attrs,e));}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new nJ(e,r++,t,i)),n;}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e;}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t];}excludes(e){return this.excluded.indexOf(e)>-1;}}class nG{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=nh.from(e.nodes),t.marks=nh.from(e.marks||{}),this.nodes=nK.compile(this.spec.nodes,this),this.marks=nJ.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=nB.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!t.isInline||!t.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=t;}t.markSet="_"==i?null:i?nZ(this,i.split(" ")):""!=i&&t.inlineContent?null:[];}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:nZ(this,n.split(" "));}this.nodeFromJSON=e=>nj.fromJSON(this,e),this.markFromJSON=e=>nk.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null);}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof nK){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")");}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r);}text(e,t){let n=this.nodes.text;return new nF(n,n.defaultAttrs,e,nk.setFrom(t));}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t);}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError("Unknown node type: "+e);return t;}}function nZ(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=r);}if(!o)throw SyntaxError("Unknown mark type: '"+t[r]+"'");}return n;}class nQ{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&n.push(t),this.styles.push(e);}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n);});}parse(e,t={}){let n=new n3(this,t,!1);return n.addAll(e,nk.none,t.from,t.to),n.finish();}parseSlice(e,t={}){let n=new n3(this,t,!0);return n.addAll(e,nk.none,t.from,t.to),nx.maxOpen(n.finish());}matchTag(e,t,n){for(let s=n?this.tags.indexOf(n)+1:0;s<this.tags.length;s++){var r,i;let n=this.tags[s];if(r=e,i=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,i)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0;}return n;}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],s=r.style;if(0==s.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(s.length>e.length)||61==s.charCodeAt(e.length)&&s.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0;}return r;}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break;}t.splice(r,0,e);}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=n6(e)),e.mark||e.ignore||e.clearMark||(e.mark=t);});}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=n6(e)),e.node||e.ignore||e.mark||(e.node=t);});}return t;}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nQ(e,nQ.schemaRules(e)));}}let nY={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nX={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},n0={ol:!0,ul:!0};function n1(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n;}class n2{constructor(e,t,n,r,i,s){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=s,this.content=[],this.activeMarks=nk.none,this.match=i||(4&s?null:e.contentMatch);}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(nm.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null;}}return this.match.findWrapping(e.type);}finish(e){if(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)));}let t=nm.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(nm.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t;}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!nY.hasOwnProperty(e.parentNode.nodeName.toLowerCase());}}class n3{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,s=n1(null,t.preserveWhitespace,0)|4*!!n;i=r?new n2(r.type,r.attrs,nk.none,!0,t.topMatch||r.type.contentMatch,s):n?new n2(null,null,nk.none,!0,null,s):new n2(e.schema.topNodeType,null,nk.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1;}get top(){return this.nodes[this.open];}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t);}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=2&r.options?"full":this.localPreserveWS||(1&r.options)>0,{schema:s}=this.parser;if("full"===i||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i){if("full"===i)n=n.replace(/\r\n?/g,"\n");else if(s.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(s.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(s.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(s.text(e[n]),t,!/\S/.test(e[n]));n="";}else n=n.replace(/\r?\n|\r/g," ");}else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&"BR"==i.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1));}n&&this.insertNode(s.text(n),t,!/\S/.test(n)),this.findInText(e);}else this.findInside(e);}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),o;n0.hasOwnProperty(s)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&n0.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null);}}(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));e:if(a?a.ignore:nX.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let n,r=this.needsBlock;if(nY.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e;}let o=a&&a.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r;}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?o:void 0);}this.localPreserveWS=r;}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t);}ignoreFallback(e,t){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),t,!0);}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),!1===n.consuming)e=n;else break;}}return t;}addElementByRule(e,t,n,r){let i,s;if(t.node){if((s=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(s.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(s,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e);}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs));}let o=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1);}i&&this.sync(o)&&this.open--;}addAll(e,t,n,r){let i=n||0;for(let s=n?e.childNodes[n]:e.firstChild,o=null==r?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,t);this.findAtPoint(e,i);}findPlace(e,t,n){let r,i;for(let t=this.open,s=0;t>=0;t--){let o=this.nodes[t],a=o.findWrapping(e);if(a&&(!r||r.length>a.length+s)&&(r=a,i=o,!a.length))break;if(o.solid){if(n)break;s+=2;}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t;}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t));}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&(t.match=t.match.matchType(e.type));let n=nk.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):n5(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0;}return!1;}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&(i=this.enterInner(e,t,n,!0,r)),i;}enterInner(e,t,n,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let o=n1(e,i,s.options);4&s.options&&0==s.content.length&&(o|=4);let a=nk.none;return n=n.filter(t=>(s.type?!s.type.allowsMarkType(t.type):!n5(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new n2(e,t,a,r,null,o)),this.open++,n;}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1;}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen));}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=1);return!1;}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++;}return e;}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos);}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos);}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos);}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset));}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,s=(e,o)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;o>=i;o--)if(s(e-1,o))return!0;return!1;}{let e=o>0||0==o&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;o--;}}return!0;};return s(t.length-1,this.open);}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n;}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t;}}}function n6(e){let t={};for(let n in e)t[n]=e[n];return t;}function n5(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=e=>{s.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>s.indexOf(i)&&o(i))return!0;}};if(o(i.contentMatch))return!0;}}class n4{constructor(e,t){this.nodes=e,this.marks=t;}serializeFragment(e,t={},n){n||(n=n8(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,s=0;for(;n<i.length&&s<e.marks.length;){let t=e.marks[s];if(!this.marks[t.type.name]){s++;continue;}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,s++;}for(;n<i.length;)r=i.pop()[1];for(;s<e.marks.length;){let n=e.marks[s++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom);}}r.appendChild(this.serializeNodeInner(e,t));}),n;}serializeNodeInner(e,t){if(e.isText)return n8(t).createTextNode(e.text);let{dom:n,contentDOM:r}=re(n8(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r);}return n;}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom);}return n;}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&re(n8(n),r(e,t),null,e.attrs);}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:re(e,t,n,r);}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new n4(this.nodesFromSchema(e),this.marksFromSchema(e)));}static nodesFromSchema(e){let t=n9(e.nodes);return t.text||(t.text=e=>e.text),t;}static marksFromSchema(e){return n9(e.marks);}}function n9(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r);}return t;}function n8(e){return e.document||window.document;}let n7=new WeakMap();function re(e,t,n,r){let i,s,o;if(1==t.nodeType)return{dom:t};if(t.dom&&1==t.dom.nodeType)return t;let a=t[0],l;if("string"!=typeof a)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(s=n7.get(r))&&n7.set(r,(o=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t)){if("string"==typeof t[0])o||(o=[]),o.push(t);else for(let n=0;n<t.length;n++)e(t[n]);}else for(let n in t)e(t[n]);}(r),s=o)),l=s)&&l.indexOf(t)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let c=a.indexOf(" ");c>0&&(n=a.slice(0,c),a=a.slice(c+1));let u=n?e.createElementNS(n,a):e.createElement(a),d=t[1],h=1;if(d&&"object"==typeof d&&null==d.nodeType&&!Array.isArray(d)){for(let e in h=2,d)if(null!=d[e]){let t=e.indexOf(" ");t>0?u.setAttributeNS(e.slice(0,t),e.slice(t+1),d[e]):"style"==e&&u.style?u.style.cssText=d[e]:u.setAttribute(e,d[e]);}}for(let s=h;s<t.length;s++){let o=t[s];if(0===o){if(s<t.length-1||s>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u};}if("string"==typeof o)u.appendChild(e.createTextNode(o));else{let{dom:t,contentDOM:s}=re(e,o,n,r);if(u.appendChild(t),s){if(i)throw RangeError("Multiple content holes");i=s;}}}return{dom:u,contentDOM:i};}class rt{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n;}get deleted(){return(8&this.delInfo)>0;}get deletedBefore(){return(5&this.delInfo)>0;}get deletedAfter(){return(6&this.delInfo)>0;}get deletedAcross(){return(4&this.delInfo)>0;}}class rn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&rn.empty)return rn.empty;}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536;}mapResult(e,t=1){return this._map(e,t,!1);}map(e,t=1){return this._map(e,t,!0);}_map(e,t,n){let r=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let a=this.ranges[o]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[o+i],c=this.ranges[o+s],u=a+l;if(e<=u){let i=l?e==a?-1:e==u?1:t:t,s=a+r+(i<0?0:c);if(n)return s;let d=e==(t<0?a:u)?null:o/3+(e-a)*65536,h=0;return l&&(h|=e==a?2:e==u?1:4,(t<0?e!=a:e!=u)&&(h|=8)),new rt(s,h,d);}r+=c-l;}return n?e+r:new rt(e+r,0,null);}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,s=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let a=this.ranges[t+i];if(e<=o+a&&t==3*r)return!0;n+=this.ranges[t+s]-a;}return!1;}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let s=this.ranges[r],o=s-(this.inverted?i:0),a=s+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(o,o+l,a,a+c),i+=c-l;}}invert(){return new rn(this.ranges,!this.inverted);}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges);}static offset(e){return 0==e?rn.empty:new rn(e<0?[0,-e,0]:[0,0,e]);}}rn.empty=new rn([]);class rr{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t);}get maps(){return this._maps;}slice(e=0,t=this.maps.length){return new rr(this._maps,this.mirror,e,t);}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&this.setMirror(this._maps.length-1,t);}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],null!=r&&r<t?n+r:void 0);}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)];}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t);}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),null!=r&&r>t?n-r-1:void 0);}}invert(){let e=new rr();return e.appendMappingInverted(this),e;}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e;}mapResult(e,t=1){return this._map(e,t,!1);}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(null!=i.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue;}}r|=i.delInfo,e=i.pos;}return n?e:new rt(e,r,null);}}let ri=Object.create(null);class rs{getMap(){return rn.empty;}merge(e){return null;}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=ri[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t);}static jsonID(e,t){if(e in ri)throw RangeError("Duplicate use of step JSON ID "+e);return ri[e]=t,t.prototype.jsonID=e,t;}}class ro{constructor(e,t){this.doc=e,this.failed=t;}static ok(e){return new ro(e,null);}static fail(e){return new ro(null,e);}static fromReplace(e,t,n,r){try{return ro.ok(e.replace(t,n,r));}catch(e){if(e instanceof nb)return ro.fail(e.message);throw e;}}}function ra(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(ra(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s);}return nm.fromArray(r);}class rl extends rs{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n;}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new nx(ra(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return ro.fromReplace(e,this.from,this.to,i);}invert(){return new rc(this.from,this.to,this.mark);}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new rl(t.pos,n.pos,this.mark);}merge(e){return e instanceof rl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rl(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null;}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to};}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new rl(t.from,t.to,e.markFromJSON(t.mark));}}rs.jsonID("addMark",rl);class rc extends rs{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n;}apply(e){let t=e.slice(this.from,this.to),n=new nx(ra(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ro.fromReplace(e,this.from,this.to,n);}invert(){return new rl(this.from,this.to,this.mark);}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new rc(t.pos,n.pos,this.mark);}merge(e){return e instanceof rc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null;}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to};}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new rc(t.from,t.to,e.markFromJSON(t.mark));}}rs.jsonID("removeMark",rc);class ru extends rs{constructor(e,t){super(),this.pos=e,this.mark=t;}apply(e){let t=e.nodeAt(this.pos);if(!t)return ro.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ro.fromReplace(e,this.pos,this.pos+1,new nx(nm.from(n),0,+!t.isLeaf));}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new ru(this.pos,t.marks[n]);return new ru(this.pos,this.mark);}}return new rd(this.pos,this.mark);}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ru(t.pos,this.mark);}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()};}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ru(t.pos,e.markFromJSON(t.mark));}}rs.jsonID("addNodeMark",ru);class rd extends rs{constructor(e,t){super(),this.pos=e,this.mark=t;}apply(e){let t=e.nodeAt(this.pos);if(!t)return ro.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ro.fromReplace(e,this.pos,this.pos+1,new nx(nm.from(n),0,+!t.isLeaf));}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new ru(this.pos,this.mark):this;}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rd(t.pos,this.mark);}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()};}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new rd(t.pos,e.markFromJSON(t.mark));}}rs.jsonID("removeNodeMark",rd);class rh extends rs{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r;}apply(e){return this.structure&&rf(e,this.from,this.to)?ro.fail("Structure replace would overwrite content"):ro.fromReplace(e,this.from,this.to,this.slice);}getMap(){return new rn([this.from,this.to-this.from,this.slice.size]);}invert(e){return new rh(this.from,this.from+this.slice.size,e.slice(this.from,this.to));}map(e){let t=e.mapResult(this.to,-1),n=this.from==this.to&&rh.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new rh(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure);}merge(e){if(!(e instanceof rh)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?nx.empty:new nx(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new rh(e.from,this.to,t,this.structure);}{let t=this.slice.size+e.slice.size==0?nx.empty:new nx(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new rh(this.from,this.to+(e.to-e.from),t,this.structure);}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e;}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new rh(t.from,t.to,nx.fromJSON(e,t.slice),!!t.structure);}}rh.MAP_BIAS=1,rs.jsonID("replace",rh);class rp extends rs{constructor(e,t,n,r,i,s,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=s,this.structure=o;}apply(e){if(this.structure&&(rf(e,this.from,this.gapFrom)||rf(e,this.gapTo,this.to)))return ro.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ro.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?ro.fromReplace(e,this.from,this.to,n):ro.fail("Content does not fit in gap");}getMap(){return new rn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert]);}invert(e){let t=this.gapTo-this.gapFrom;return new rp(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure);}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new rp(t.pos,n.pos,r,i,this.slice,this.insert,this.structure);}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e;}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new rp(t.from,t.to,t.gapFrom,t.gapTo,nx.fromJSON(e,t.slice),t.insert,!!t.structure);}}function rf(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let e=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--;}}return!1;}function rm(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),o=[],a=t+1;for(let t=0;t<s.childCount;t++){let l=s.child(t),c=a+l.nodeSize,u=r.matchType(l.type);if(u){r=u;for(let t=0;t<l.marks.length;t++)n.allowsMarkType(l.marks[t].type)||e.step(new rc(a,c,l.marks[t]));if(i&&l.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(l.text);)r||(r=new nx(nm.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),o.push(new rh(a+e.index,a+e.index+e[0].length,r));}}else o.push(new rh(a,c,nx.empty));a=c;}if(!r.validEnd){let t=r.fillBefore(nm.empty,!0);e.replace(a,a,new nx(t,0,0));}for(let t=o.length-1;t>=0;t--)e.step(o[t]);}function rg(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let s=e.$from.node(n),o=e.$from.index(n)+r,a=e.$to.indexAfter(n)-i;if(n<e.depth&&s.canReplace(o,a,t))return n;if(0==n||s.type.spec.isolating||!((0==o||s.canReplace(o,s.childCount))&&(a==s.childCount||s.canReplace(0,a))))break;o&&(r=1),a<s.childCount&&(i=1);}return null;}function rv(e){return{type:e,attrs:null};}function ry(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let i=e.mapping.slice(r).map(n+1+s+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create());}}});}function rk(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+s);e.replaceWith(i,i+1,t.type.schema.text("\n"));}});}function rb(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>s;e--,t--){let n=i.node(e),s=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(s,n.childCount),a=r&&r[t+1];a&&(o=o.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(s+1,n.childCount)||!l.type.validContent(o))return!1;}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type);}function rx(e,t){var n,r;let i=e.resolve(t),s=i.index();return n=i.nodeBefore,r=i.nodeAfter,!!(n&&r&&!n.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let s=t.child(i),o=s.type==r?e.type.schema.nodes.text:s.type;if(!(n=n.matchType(o))||!e.type.allowsMarks(s.marks))return!1;}return n.validEnd;}(n,r))&&i.parent.canReplace(s,s+1);}function rw(e,t,n=t,r=nx.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return rC(i,s,r)?new rh(t,n,r):new rS(i,s,r).fit();}function rC(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content);}rs.jsonID("replaceAround",rp);class rS{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=nm.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))});}for(let t=e.depth;t>0;t--)this.placed=nm.from(e.node(t).copy(this.placed));}get depth(){return this.frontier.length-1;}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode();}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,s=n.depth,o=r.depth;for(;s&&o&&1==i.childCount;)i=i.firstChild.content,s--,o--;let a=new nx(i,s,o);return e>-1?new rp(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new rh(n.pos,r.pos,a):null;}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break;}t=i.content;}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=rE(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:s,match:o}=this.frontier[i],a,l=null;if(1==t&&(r?o.matchType(r.type)||(l=o.fillBefore(nm.from(r),!1)):e&&s.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:l};if(2==t&&r&&(a=o.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:a};if(e&&o.matchType(e.type))break;}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return!(rN(e,-1)<=t)&&(this.unplaced.size>1&&rN(e,1)>n&&n++,this.unplaced=new nx(e,t+1,n),!0);}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=rE(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new nx(rD(e,t-1,1),t-1,i?t-1:n);}else this.unplaced=new nx(rD(e,t,1),t,n);}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let s=this.unplaced,o=n?n.content:s.content,a=s.openStart-e,l=0,c=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r);}let h=o.size+e-(s.content.size-s.openEnd);for(;l<o.childCount;){let e=o.child(l),t=u.matchType(e.type);if(!t)break;(++l>1||0==a||e.content.size)&&(u=t,c.push(function e(t,n,r){if(n<=0)return t;let i=t.content;return n>1&&(i=i.replaceChild(0,e(i.firstChild,n-1,1==i.childCount?r-1:0))),n>0&&(i=t.type.contentMatch.fillBefore(i).append(i),r<=0&&(i=i.append(t.type.contentMatch.matchFragment(i).fillBefore(nm.empty,!0)))),t.copy(i);}(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==o.childCount?h:-1)));}let p=l==o.childCount;p||(h=-1),this.placed=rA(this.placed,t,nm.from(c)),this.frontier[t].match=u,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<h;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content;}this.unplaced=p?0==e?nx.empty:new nx(rD(s.content,e-1,1),e-1,h<0?s.openEnd:e-1):new nx(rD(s.content,e,l),s.openStart,s.openEnd);}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!rM(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r;}findCloseLevel(e){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=rM(e,t,r,n,i);if(s){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=rM(e,n,r,t,!0);if(!i||i.childCount)continue t;}return{depth:t,fit:s,move:i?e.doc.resolve(e.after(t+1)):e};}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=rA(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r);}return e;}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=rA(this.placed,this.depth,nm.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch});}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(nm.empty,!0);e.childCount&&(this.placed=rA(this.placed,this.frontier.length,e));}}function rD(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(rD(e.firstChild.content,t-1,n)));}function rA(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(rA(e.lastChild.content,t-1,n)));}function rE(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e;}function rM(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1;}(n,s.content,o)?a:null;}function rN(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content;}}function r_(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i);}return n;}class rT extends rs{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n;}apply(e){let t=e.nodeAt(this.pos);if(!t)return ro.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return ro.fromReplace(e,this.pos,this.pos+1,new nx(nm.from(r),0,+!t.isLeaf));}getMap(){return rn.empty;}invert(e){return new rT(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr]);}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rT(t.pos,this.attr,this.value);}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value};}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new rT(t.pos,t.attr,t.value);}}rs.jsonID("attr",rT);class rR extends rs{constructor(e,t){super(),this.attr=e,this.value=t;}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return ro.ok(n);}getMap(){return rn.empty;}invert(e){return new rR(this.attr,e.attrs[this.attr]);}map(e){return this;}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value};}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new rR(t.attr,t.value);}}rs.jsonID("docAttr",rR);let rI=class extends Error{};(rI=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n;}).prototype=Object.create(Error.prototype),rI.prototype.constructor=rI,rI.prototype.name="TransformError";class rj{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new rr();}get before(){return this.docs.length?this.docs[0]:this.doc;}step(e){let t=this.maybeStep(e);if(t.failed)throw new rI(t.failed);return this;}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t;}get docChanged(){return this.steps.length>0;}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,s)=>{e=Math.min(e,i),t=Math.max(t,s);});}return 1e9==e?null:{from:e,to:t};}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t;}replace(e,t=e,n=nx.empty){let r=rw(this.doc,e,t,n);return r&&this.step(r),this;}replaceWith(e,t,n){return this.replace(e,t,new nx(nm.from(n),0,0));}delete(e,t){return this.replace(e,t,nx.empty);}insert(e,t){return this.replaceWith(e,e,t);}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(rC(i,s,r))return e.step(new rh(t,n,r));let o=r_(i,s);0==o[o.length-1]&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?a=e:i.before(e)==t&&o.splice(1,0,-e);}let l=o.indexOf(a),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content;}for(let e=u-1;e>=0;e--){var d;let t=c[e],n=(d=t.type).spec.defining||d.spec.definingForContent;if(n&&!t.sameMarkup(i.node(Math.abs(a)-1)))u=e;else if(n||!t.type.isTextblock)break;}for(let t=r.openStart;t>=0;t--){let a=(t+u+1)%(r.openStart+1),d=c[a];if(d)for(let t=0;t<o.length;t++){let c=o[(t+l)%o.length],u=!0;c<0&&(u=!1,c=-c);let h=i.node(c-1),p=i.index(c-1);if(h.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(c),u?s.after(c):n,new nx(function e(t,n,r,i,s){if(n<r){let s=t.firstChild;t=t.replaceChild(0,s.copy(e(s.content,n+1,r,i,s)));}if(n>i){let e=s.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(nm.empty,!0));}return t;}(r.content,0,r.openStart,a),a,r.openEnd));}}let h=e.steps.length;for(let a=o.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>h));a--){let e=o[a];e<0||(t=i.before(e),n=s.after(e));}}(this,e,t,n),this;}replaceRangeWith(e,t,n){var r=e,i=t;if(!n.isInline&&r==i&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null;}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)break;}return null;}(this.doc,r,n.type);null!=e&&(r=i=e);}return this.replaceRange(r,i,new nx(nm.from(n),0,0)),this;}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&0==r.parentOffset&&0==i.parentOffset){let s=r.sharedDepth(n),o=!1;for(let e=r.depth;e>s;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>s;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n);}}let s=r_(r,i);for(let t=0;t<s.length;t++){let n=s[t],o=t==s.length-1;if(o&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n));}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n);}(this,e,t),this;}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:s}=t,o=r.before(s+1),a=i.after(s+1),l=o,c=a,u=nm.empty,d=0;for(let e=s,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=nm.from(r.node(e).copy(u)),d++):l--;let h=nm.empty,p=0;for(let e=s,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=nm.from(i.node(e).copy(h)),p++):c++;e.step(new rp(l,c,o,a,new nx(u.append(h),d,p),u.size-d,!0));}(this,e,t),this;}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),o=s.node().type;if(i&&o.inlineContent){let e="pre"==o.whitespace,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0);}let a=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);rk(e,r.node(),r.before(),a);}o.inlineContent&&rm(e,t+n-1,o,s.node().contentMatchAt(s.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new rh(c,l.map(t+n,-1),nx.empty,!0)),!0===r){let t=e.doc.resolve(c);ry(e,t.node(),t.before(),e.steps.length);}}(this,e,t),this;}wrap(e,t){return!function(e,t,n){let r=nm.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");}r=nm.from(n[e].type.create(n[e].attrs,r));}let i=t.start,s=t.end;e.step(new rp(i,s,i,s,new nx(r,0,0),n.length,!0));}(this,e,t),this;}setBlockType(e,t=e,n,r=null){var i=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let s=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var o,a,l;let c,u,d="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,d)&&(o=i.doc,a=i.mapping.slice(s).map(t),l=n,u=(c=o.resolve(a)).index(),c.parent.canReplaceWith(u,u+1,l))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0);}!1===r&&rk(i,e,t,s),rm(i,i.mapping.slice(s).map(t,1),n,void 0,null===r);let o=i.mapping.slice(s),a=o.map(t,1),l=o.map(t+e.nodeSize,1);return i.step(new rp(a,l,a+1,l-1,new nx(nm.from(n.create(d,null,e.marks)),0,0),1,!0)),!0===r&&ry(i,e,t,s),!1;}}),this;}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,o);if(!n.validContent(s.content))throw RangeError("Invalid content for node type "+n.name);e.step(new rp(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new nx(nm.from(o),0,0),1,!0));}(this,e,t,n,r),this;}setNodeAttribute(e,t,n){return this.step(new rT(e,t,n)),this;}setDocAttribute(e,t){return this.step(new rR(e,t)),this;}addNodeMark(e,t){return this.step(new ru(e,t)),this;}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof nk)t.isInSet(n.marks)&&this.step(new rd(e,t));else{let r=n.marks,i,s=[];for(;i=t.isInSet(r);)s.push(new rd(e,i)),r=i.removeFromSet(r);for(let e=s.length-1;e>=0;e--)this.step(s[e]);}return this;}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),s=nm.empty,o=nm.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){s=nm.from(i.node(e).copy(s));let t=r&&r[a];o=nm.from(t?t.type.create(t.attrs,o):i.node(e).copy(o));}e.step(new rh(t,t,new nx(s.append(o),n,n),!0));}(this,e,t,n),this;}addMark(e,t,n){var r;let i,s,o,a;return r=this,o=[],a=[],r.doc.nodesBetween(e,t,(r,l,c)=>{if(!r.isInline)return;let u=r.marks;if(!n.isInSet(u)&&c.type.allowsMarkType(n.type)){let c=Math.max(l,e),d=Math.min(l+r.nodeSize,t),h=n.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(h)||(i&&i.to==c&&i.mark.eq(u[e])?i.to=d:o.push(i=new rc(c,d,u[e])));s&&s.to==c?s.to=d:a.push(s=new rl(c,d,n));}}),o.forEach(e=>r.step(e)),a.forEach(e=>r.step(e)),this;}removeMark(e,t,n){var r;let i,s;return r=this,i=[],s=0,r.doc.nodesBetween(e,t,(r,o)=>{if(!r.isInline)return;s++;let a=null;if(n instanceof nJ){let e=r.marks,t;for(;t=n.isInSet(e);)(a||(a=[])).push(t),e=t.removeFromSet(e);}else n?n.isInSet(r.marks)&&(a=[n]):a=r.marks;if(a&&a.length){let n=Math.min(o+r.nodeSize,t);for(let t=0;t<a.length;t++){let r=a[t],l;for(let e=0;e<i.length;e++){let t=i[e];t.step==s-1&&r.eq(i[e].style)&&(l=t);}l?(l.to=n,l.step=s):i.push({style:r,from:Math.max(o,e),to:n,step:s});}}}),i.forEach(e=>r.step(new rc(e.from,e.to,e.style))),this;}clearIncompatible(e,t,n){return rm(this,e,t,n),this;}}let rF=Object.create(null);class rO{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new rz(e.min(t),e.max(t))];}get anchor(){return this.$anchor.pos;}get head(){return this.$head.pos;}get from(){return this.$from.pos;}get to(){return this.$to.pos;}get $from(){return this.ranges[0].$from;}get $to(){return this.ranges[0].$to;}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0;}content(){return this.$from.doc.slice(this.from,this.to,!0);}replace(e,t=nx.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:a,$to:l}=s[o],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),o?nx.empty:t),0==o&&rH(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1);}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:o}=r[i],a=e.mapping.slice(n),l=a.map(s.pos),c=a.map(o.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),rH(e,n,t.isInline?-1:1));}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new rL(e):rK(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?rK(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):rK(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i;}return null;}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new rU(e.node(0));}static atStart(e){return rK(e,e,0,0,1)||new rU(e);}static atEnd(e){return rK(e,e,e.content.size,e.childCount,-1)||new rU(e);}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=rF[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t);}static jsonID(e,t){if(e in rF)throw RangeError("Duplicate use of selection JSON ID "+e);return rF[e]=t,t.prototype.jsonID=e,t;}getBookmark(){return rL.between(this.$anchor,this.$head).getBookmark();}}rO.prototype.visible=!0;class rz{constructor(e,t){this.$from=e,this.$to=t;}}let rB=!1;function rP(e){rB||e.parent.inlineContent||(rB=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"));}class rL extends rO{constructor(e,t=e){rP(e),rP(t),super(e,t);}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null;}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return rO.near(n);let r=e.resolve(t.map(this.anchor));return new rL(r.parent.inlineContent?r:n,n);}replace(e,t=nx.empty){if(super.replace(e,t),t==nx.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t);}}eq(e){return e instanceof rL&&e.anchor==this.anchor&&e.head==this.head;}getBookmark(){return new r$(this.anchor,this.head);}toJSON(){return{type:"text",anchor:this.anchor,head:this.head};}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new rL(e.resolve(t.anchor),e.resolve(t.head));}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n));}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=rO.findFrom(t,n,!0)||rO.findFrom(t,-n,!0);if(!e)return rO.near(t,n);t=e.$head;}return e.parent.inlineContent||(0==r?e=t:(e=(rO.findFrom(e,-n,!0)||rO.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new rL(e,t);}}rO.jsonID("text",rL);class r${constructor(e,t){this.anchor=e,this.head=t;}map(e){return new r$(e.map(this.anchor),e.map(this.head));}resolve(e){return rL.between(e.resolve(this.anchor),e.resolve(this.head));}}class rq extends rO{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t;}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?rO.near(i):new rq(i);}content(){return new nx(nm.from(this.node),0,0);}eq(e){return e instanceof rq&&e.anchor==this.anchor;}toJSON(){return{type:"node",anchor:this.anchor};}getBookmark(){return new rV(this.anchor);}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new rq(e.resolve(t.anchor));}static create(e,t){return new rq(e.resolve(t));}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable;}}rq.prototype.visible=!1,rO.jsonID("node",rq);class rV{constructor(e){this.anchor=e;}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new r$(n,n):new rV(n);}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&rq.isSelectable(n)?new rq(t):rO.near(t);}}class rU extends rO{constructor(e){super(e.resolve(0),e.resolve(e.content.size));}replace(e,t=nx.empty){if(t==nx.empty){e.delete(0,e.doc.content.size);let t=rO.atStart(e.doc);t.eq(e.selection)||e.setSelection(t);}else super.replace(e,t);}toJSON(){return{type:"all"};}static fromJSON(e){return new rU(e);}map(e){return new rU(e);}eq(e){return e instanceof rU;}getBookmark(){return rW;}}rO.jsonID("all",rU);let rW={map(){return this;},resolve:e=>new rU(e)};function rK(e,t,n,r,i,s=!1){if(t.inlineContent)return rL.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(r.isAtom){if(!s&&rq.isSelectable(r))return rq.create(e,n-(i<0?r.nodeSize:0));}else{let t=rK(e,r,n+i,i<0?r.childCount:0,i,s);if(t)return t;}n+=r.nodeSize*i;}return null;}function rH(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let s=e.steps[i];(s instanceof rh||s instanceof rp)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i);}),e.setSelection(rO.near(e.doc.resolve(r),n)));}class rJ extends rj{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks;}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection;}setSelection(e){if(e.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this;}get selectionSet(){return(1&this.updated)>0;}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this;}ensureMarks(e){return nk.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this;}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()));}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()));}get storedMarksSet(){return(2&this.updated)>0;}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null;}setTime(e){return this.time=e,this;}replaceSelection(e){return this.selection.replace(this,e),this;}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||nk.none))),n.replaceWith(this,e),this;}deleteSelection(){return this.selection.replace(this),this;}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n));}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.selection.to!=t+e.length||this.setSelection(rO.near(this.selection.$to)),this;}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this;}getMeta(e){return this.meta["string"==typeof e?e:e.key];}get isGeneric(){for(let e in this.meta)return!1;return!0;}scrollIntoView(){return this.updated|=4,this;}get scrolledIntoView(){return(4&this.updated)>0;}}function rG(e,t){return t&&e?e.bind(t):e;}class rZ{constructor(e,t,n){this.name=e,this.init=rG(t.init,n),this.apply=rG(t.apply,n);}}let rQ=[new rZ("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new rZ("selection",{init:(e,t)=>e.selection||rO.atStart(t.doc),apply:e=>e.selection}),new rZ("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new rZ("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class rY{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rQ.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new rZ(e.key,e.spec.state,e));});}}class rX{constructor(e){this.config=e;}get schema(){return this.config.schema;}get plugins(){return this.config.plugins;}apply(e){return this.applyTransaction(e).state;}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1;}return!0;}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let o=this.config.plugins[s];if(o.spec.appendTransaction){let a=r?r[s].n:0,l=r?r[s].state:this,c=a<t.length&&o.spec.appendTransaction.call(o,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<s?{state:n,n:t.length}:{state:this,n:0});}t.push(c),n=n.applyInner(c),i=!0;}r&&(r[s]={state:n,n:t.length});}}if(!i)return{state:n,transactions:t};}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new rX(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t);}return t;}get tr(){return new rJ(this);}static create(e){let t=new rY(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new rX(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n;}reconfigure(e){let t=new rY(this.schema,e.plugins),n=t.fields,r=new rX(t);for(let t=0;t<n.length;t++){let i=n[t].name;r[i]=this.hasOwnProperty(i)?this[i]:n[t].init(e,r);}return r;}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]));}return t;}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new rY(e.schema,e.plugins),i=new rX(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=nj.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=rO.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let s in n){let o=n[s],a=o.spec.state;if(o.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){i[r.name]=a.fromJSON.call(o,e,t[s],i);return;}}i[r.name]=r.init(e,i);}}),i;}}class r0{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let s=t[i];s instanceof Function?s=s.bind(n):"handleDOMEvents"==i&&(s=e(s,n,{})),r[i]=s;}return r;}(e.props,this,this.props),this.key=e.key?e.key.key:r2("plugin");}getState(e){return e[this.key];}}let r1=Object.create(null);function r2(e){return e in r1?e+"$"+ ++r1[e]:(r1[e]=0,e+"$");}class r3{constructor(e="key"){this.key=r2(e);}get(e){return e.config.pluginsByKey[this.key];}getState(e){return e[this.key];}}let r6=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t;},r5=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t;},r4=null,r9=function(e,t,n){let r=r4||(r4=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r;},r8=function(){r4=null;},r7=function(e,t,n,r){return n&&(it(e,t,n,r,-1)||it(e,t,n,r,1));},ie=/^(img|br|input|textarea|hr)$/i;function it(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ir(e))){let n=e.parentNode;if(!n||!ii(n)||ia(e)||ie.test(e.nodeName)||"false"==e.contentEditable)return!1;t=r6(e)+(i<0?0:1),e=n;}else{if(!ii(e))return!1;let n=e.childNodes[t+(i<0?-1:0)];if(ii(n)&&"false"==n.contentEditable){if(null==(s=n.pmViewDesc)||!s.ignoreForSelection)return!1;else t+=i;}else e=n,t=i<0?ir(e):0;}}}function ir(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length;}function ii(e){return 1==e.nodeType;}function is(e){return 3==e.nodeType;}function io(e,t){return!!t&&e.contains(ii(t)?t:t.parentNode);}function ia(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e);}let il=function(e){return e.focusNode&&r7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset);};function ic(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n;}let iu="u">typeof navigator?navigator:null,id="u">typeof document?document:null,ih=iu&&iu.userAgent||"",ip=/Edge\/(\d+)/.exec(ih),im=/MSIE \d/.exec(ih),ig=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ih),iv=!!(im||ig||ip),iy=im?document.documentMode:ig?+ig[1]:ip?+ip[1]:0,ik=!iv&&/gecko\/(\d+)/i.test(ih);ik&&(/Firefox\/(\d+)/.exec(ih)||[0,0])[1];let ib=!iv&&/Chrome\/(\d+)/.exec(ih),ix=!!ib,iw=ib?+ib[1]:0,iC=!iv&&!!iu&&/Apple Computer/.test(iu.vendor),iS=iC&&(/Mobile\/\w+/.test(ih)||!!iu&&iu.maxTouchPoints>2),iD=iS||!!iu&&/Mac/.test(iu.platform),iA=!!iu&&/Win/.test(iu.platform),iE=/Android \d/.test(ih),iM=!!id&&"webkitFontSmoothing"in id.documentElement.style,iN=iM?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function i_(e,t){return"number"==typeof e?e:e[t];}function iT(e,t,n){if(!iO(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!ii(o)){o=r5(o);continue;}let e=o==s.body,n=e?function(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight};}(s):function(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r};}(o),a=0,l=0;if(t.top<n.top+i_(r,"top")?l=-(n.top-t.top+i_(i,"top")):t.bottom>n.bottom-i_(r,"bottom")&&(l=t.bottom-t.top>n.bottom-n.top?t.top+i_(i,"top")-n.top:t.bottom-n.bottom+i_(i,"bottom")),t.left<n.left+i_(r,"left")?a=-(n.left-t.left+i_(i,"left")):t.right>n.right-i_(r,"right")&&(a=t.right-n.right+i_(i,"right")),a||l)if(e)s.defaultView.scrollBy(a,l);else{let e=o.scrollLeft,n=o.scrollTop;l&&(o.scrollTop+=l),a&&(o.scrollLeft+=a);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i};}let c=e?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(c))break;o="absolute"==c?o.offsetParent:r5(o);}}function iR(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=r5(r));return t;}function iI(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s);}}let ij=null;function iF(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1;}function iO(e){return e.top<e.bottom||e.left<e.right;}function iz(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(iO(e))return e;}return Array.prototype.find.call(n,iO)||e.getBoundingClientRect();}let iB=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function iP(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),o=iM||ik;if(is(r))if(o&&(iB.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=iz(r9(r,i,i),n);if(ik&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=iz(r9(r,i-1,i-1),-1);if(t.top==e.top){let n=iz(r9(r,i,i+1),-1);if(n.top!=e.top)return iL(n,n.left<t.left);}}return e;}else{let e=i,t=i,s=n<0?1:-1;return n<0&&!i?(t++,s=-1):n>=0&&i==r.nodeValue.length?(e--,s=1):n<0?e--:t++,iL(iz(r9(r,e,t),s),s<0);}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(null==s&&i&&(n<0||i==ir(r))){let e=r.childNodes[i-1];if(ii(e))return i$(e.getBoundingClientRect(),!1);}if(null==s&&i<ir(r)){let e=r.childNodes[i];if(ii(e))return i$(e.getBoundingClientRect(),!0);}return i$(r.getBoundingClientRect(),n>=0);}if(null==s&&i&&(n<0||i==ir(r))){let e=r.childNodes[i-1],t=is(e)?r9(e,ir(e)-!o):ii(e)&&("BR"!=e.nodeName||!e.nextSibling)?e:null;if(t)return iL(iz(t,1),!1);}if(null==s&&i<ir(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?is(e)?r9(e,0,+!o):ii(e)?e:null:null;if(t)return iL(iz(t,-1),!0);}return iL(iz(is(r)?r9(r):r,-n),n>=0);}function iL(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n};}function i$(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right};}function iq(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n();}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus();}}let iV=/[\u0590-\u08ac]/,iU=null,iW=null,iK=!1;class iH{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this;}matchesWidget(e){return!1;}matchesMark(e){return!1;}matchesNode(e,t,n){return!1;}matchesHack(e){return!1;}parseRule(e){return null;}stopEvent(e){return!1;}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e;}get border(){return 0;}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy();}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size;}}get posBefore(){return this.parent.posBeforeChild(this);}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0;}get posAfter(){return this.posBefore+this.size;}get posAtEnd(){return this.posAtStart+this.size-2*this.border;}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&io(this.contentDOM,e))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling;}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart;}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling;}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd;}if(e==this.dom&&this.contentDOM)r=t>r6(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(4&e.compareDocumentPosition(this.contentDOM));else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break;}if(t.previousSibling)break;}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break;}if(t.nextSibling)break;}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart;}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),s;if(i&&(!t||i.node))if(!n||!(s=i.nodeDOM)||(ii(s)?io(s,e):s==e))return i;else n=!1;}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t;}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n);}return-1;}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break;}}return r;}if(e<i)return r.descAt(e-n-r.border);n=i;}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=t+this.children[n].size;if(i>e){r=e-t;break;}t=i;}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof i0||e instanceof iJ&&e.side>=0))break;}if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?r6(e.dom)+1:0};}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?r6(e.dom):this.contentDOM.childNodes.length};}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=n,o=0;;o++){let n=this.children[o],a=s+n.size;if(-1==r&&e<=a){let i=s+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=s;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=r6(n.dom)+1;break;}e-=n.size;}-1==r&&(r=0);}if(r>-1&&(a>t||o==this.children.length-1)){t=a;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=r6(n.dom);break;}t+=n.size;}-1==i&&(i=this.contentDOM.childNodes.length);break;}s=a;}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i};}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e);}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(!ii(t)||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n];}setSelection(e,t,n,r=!1){let i=Math.min(e,t),s=Math.max(e,t);for(let o=0,a=0;o<this.children.length;o++){let l=this.children[o],c=a+l.size;if(i>a&&s<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c;}let o=this.domFromPos(e,e?-1:1),a=t==e?o:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((ik||iC)&&e==t){let{node:e,offset:t}=o;if(is(e)){if((u=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(o=a={node:n.parentNode,offset:r6(n)+1});break;}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break;}}else{let n=e.childNodes[t-1];u=n&&("BR"==n.nodeName||"false"==n.contentEditable);}}if(ik&&c.focusNode&&c.focusNode!=a.node&&ii(c.focusNode)){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0);}if(!(r||u&&iC)&&r7(o.node,o.offset,c.anchorNode,c.anchorOffset)&&r7(a.node,a.offset,c.focusNode,c.focusOffset))return;let d=!1;if((l.extend||e==t)&&!(u&&ik)){l.collapse(o.node,o.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0;}catch(e){}}if(!d){if(e>t){let e=o;o=a,a=e;}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(o.node,o.offset),l.removeAllRanges(),l.addRange(n);}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type;}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM);}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],s=n+i.size;if(n==s?e<=s&&t>=n:e<s&&t>n){let r=n+i.border,o=s-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==s?2:1,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=3:i.markDirty(e-r,t-r);return;}i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2;}n=s;}this.dirty=2;}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n);}}get domAtom(){return!1;}get ignoreForCoords(){return!1;}get ignoreForSelection(){return!1;}isText(e){return!1;}}class iJ extends iH{constructor(e,t,n,r){let i,s=t.type.toDOM;if("function"==typeof s&&(s=s(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){let e=ii(s)?s:document.createElement("span");e!=s&&e.appendChild(s),e.hasAttribute("contenteditable")||(e.contentEditable="false"),e.classList.add("ProseMirror-widget");}super(e,[],s,null),this.widget=t,this.widget=t,i=this;}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type);}parseRule(){return{ignore:!0};}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e);}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection;}destroy(){this.widget.type.destroy(this.dom),super.destroy();}get domAtom(){return!0;}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide;}get side(){return this.widget.type.side;}}class iG extends iH{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r;}get size(){return this.text.length;}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t;}domFromPos(e){return{node:this.textDOM,offset:e};}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue;}}class iZ extends iH{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i;}static create(e,t,n,r){let i=r.nodeViews[t.type.name],s=i&&i(t,r,n);return s&&s.dom||(s=n4.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new iZ(e,t,s.dom,s.contentDOM||s.dom,s);}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM};}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e);}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0;}}slice(e,t,n){let r=iZ.create(this.parent,this.mark,!0,n),i=this.children,s=this.size;t<s&&(i=st(i,t,s,n)),e>0&&(i=st(i,0,e,n));for(let e=0;e<i.length;e++)i[e].parent=r;return r.children=i,r;}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e);}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}}class iQ extends iH{constructor(e,t,n,r,i,s,o){super(e,[],i,s),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o;}static create(e,t,n,r,i,s){let o=i.nodeViews[t.type.name],a,l=o&&o(t,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText){if(c){if(!is(c))throw RangeError("Text must be rendered as a DOM text node");}else c=document.createTextNode(t.text);}else if(!c){let e=n4.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:u}=e);}u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return(c=i4(c,n,t),l)?a=new i1(e,t,n,r,c,u||null,d,l):t.isText?new iX(e,t,n,r,c,d):new iQ(e,t,n,r,c,u||null,d);}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM){if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break;}}if(!t.contentElement){let n=e&&e.find(t=>ii(t)&&0>e.indexOf(t.parentNode)&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>nm.empty;}}else t.contentElement=this.contentDOM;}else t.getContent=()=>this.node.content;return t;}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&i9(t,this.outerDeco)&&n.eq(this.innerDeco);}get size(){return this.node.nodeSize;}get border(){return+!this.node.isLeaf;}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,s=i&&i.pos>-1?i:null,o=i&&i.pos<0,a=new i7(this,s&&s.node,e),l=this.node.inlineContent,c=l&&this.node.isBlock;(function(e,t,n,r){let i=t.locals(e),s=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(s,o),n),s+=o.nodeSize;}return;}let o=0,a=[],l=null;for(let c=0;;){let u,d,h,p;for(;o<i.length&&i[o].to==s;){let e=i[o++];e.widget&&(u?(d||(d=[u])).push(e):u=e);}if(u)if(d){d.sort(se);for(let e=0;e<d.length;e++)n(d[e],c,!!l);}else n(u,c,!!l);if(l)p=-1,h=l,l=null;else if(c<e.childCount)p=c,h=e.child(c++);else break;for(let e=0;e<a.length;e++)a[e].to<=s&&a.splice(e--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let f=s+h.nodeSize;if(h.isText){let e=f;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-s),h=h.cut(0,e-s),f=e,p=-1);}else for(;o<i.length&&i[o].to<f;)o++;let m=h.isInline&&!h.isLeaf?a.filter(e=>!e.inline):a.slice();r(h,m,t.forChild(s,h),p),s=f;}})(this.node,this.innerDeco,(t,i,s)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!s&&a.syncToMarks(i==this.node.childCount?nk.none:this.node.child(i).marks,n,e,i),a.placeWidget(t,e,r);},(t,s,u,d)=>{let h;a.syncToMarks(t.marks,n,e,d),c&&t.isAtom&&!t.isText&&a.addHackNode("IMG",a.top),a.findNodeMatch(t,s,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,s,u,h,e)||a.updateNextNode(t,s,u,e,d,r)||a.addNode(t,s,u,e,r),r+=t.nodeSize,l&&(c=t.isAtom&&!t.isText);}),a.syncToMarks([],n,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(s&&this.protectLocalComposition(e,s),function e(t,n,r){let i=t.firstChild,s=!1;for(let o=0;o<n.length;o++){let a=n[o],l=a.dom;if(l.parentNode==t){for(;l!=i;)i=i8(i),s=!0;i=i.nextSibling;}else s=!0,t.insertBefore(l,i);if(a instanceof iZ){let n=i?i.previousSibling:t.lastChild;e(a.contentDOM,a.children,r),i=n?n.nextSibling:t.firstChild;}}for(;i;)i=i8(i),s=!0;s&&r.trackWrites==t&&(r.trackWrites=null);}(this.contentDOM,this.children,e),iS&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t;}}(this.dom));}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof rL)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(!this.node.inlineContent)return{node:i,pos:-1,text:""};{let e=i.nodeValue,s=function(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let o=e.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<e.childCount;){let t=e.child(i++);if(s+=t.nodeSize,!t.isText)break;l+=t.text;}if(s>=n){if(s>=r&&l.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?l.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r;}}return-1;}(this.node.content,e,n-t,r-t);return s<0?null:{node:i,pos:s,text:e};}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0);}let s=new iG(this,i,t,r);e.input.compositionNodes.push(s),this.children=st(this.children,n,n+r.length,e,s);}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(this.updateInner(e,t,n,r),!0);}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0;}updateOuterDeco(e){if(i9(e,this.outerDeco))return;let t=!ii(this.nodeDOM),n=this.dom;this.dom=i5(this.dom,this.nodeDOM,i6(this.outerDeco,this.node,t),i6(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e;}selectNode(){ii(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0));}deselectNode(){ii(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"));}get domAtom(){return this.node.isAtom;}}function iY(e,t,n,r,i){i4(r,t,e);let s=new iQ(void 0,e,t,n,r,r,r);return s.contentDOM&&s.updateChildren(i,0),s;}class iX extends iQ{constructor(e,t,n,r,i,s){super(e,t,n,r,i,null,s);}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0};}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0);}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1;}domFromPos(e){return{node:this.nodeDOM,offset:e};}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n);}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type;}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new iX(this.parent,r,this.outerDeco,this.innerDeco,i,i);}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3);}get domAtom(){return!1;}isText(e){return this.node.text==e;}}class i0 extends iH{parseRule(){return{ignore:!0};}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e;}get domAtom(){return!0;}get ignoreForCoords(){return"IMG"==this.dom.nodeName;}}class i1 extends iQ{constructor(e,t,n,r,i,s,o,a){super(e,t,n,r,i,s,o),this.spec=a;}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i;}return(!!this.contentDOM||!!e.isLeaf)&&super.update(e,t,n,r);}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode();}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode();}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r);}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy();}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e);}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e);}}let i2=function(e){e&&(this.nodeName=e);};i2.prototype=Object.create(null);let i3=[new i2()];function i6(e,t,n){if(0==e.length)return i3;let r=n?i3[0]:new i2(),i=[r];for(let s=0;s<e.length;s++){let o=e[s].type.attrs;if(o)for(let e in o.nodeName&&i.push(r=new i2(o.nodeName)),o){let s=o[e];null!=s&&(n&&1==i.length&&i.push(r=new i2(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+s:"style"==e?r.style=(r.style?r.style+";":"")+s:"nodeName"!=e&&(r[e]=s));}}return i;}function i5(e,t,n,r){if(n==i3&&r==i3)return t;let i=t;for(let t=0;t<r.length;t++){let s=r[t],o=n[t];if(t){let t;o&&o.nodeName==s.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==s.nodeName||((t=document.createElement(s.nodeName)).pmIsDeco=!0,t.appendChild(i),o=i3[0]),i=t;}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class");}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1]);}n.style&&(e.style.cssText+=n.style);}}(i,o||i3[0],s);}return i;}function i4(e,t,n){return i5(e,e,i3,i6(t,n,!ii(e)));}function i9(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0;}function i8(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t;}class i7{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map(),o=[];n:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(e instanceof iZ)n=e,r=e.children.length;else{a=e,r--;break;}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let l=a.node;if(l){if(l!=e.child(i-1))break;--i,s.set(a,i),o.push(a);}}return{index:i,matched:s,matches:o.reverse()};}(e.node.content,e);}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0;}}destroyRest(){this.destroyBetween(this.index,this.top.children.length);}syncToMarks(e,t,n,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[s])&&!this.isLocked(n.dom)){i=t;break;}}if(i<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof iZ&&3!=t.dirty&&t.mark.type==e[s].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[s])&&(t.mark=e[s],i=this.index,this.changed=!0);}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=iZ.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0;}this.index=0,s++;}}findNodeMatch(e,t,n,r){let i=-1,s;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,n))i=this.top.children.indexOf(s,this.index);else for(let r=this.index,s=Math.min(this.top.children.length,r+5);r<s;r++){let s=this.top.children[r];if(s.matchesNode(e,t,n)&&!this.preMatch.matched.has(s)){i=r;break;}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0);}updateNodeAt(e,t,n,r,i){let s=this.top.children[r];return 3==s.dirty&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0);}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;}return-1;}e=t;}}updateNextNode(e,t,n,r,i,s){for(let o=this.index;o<this.top.children.length;o++){let a=this.top.children[o];if(a instanceof iQ){let l=this.preMatch.matched.get(a);if(null!=l&&l!=i)return!1;let c=a.dom,u,d=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&i9(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,o),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(a,e,t,n,r,s)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(r,s+1),u.dirty=0),this.changed=!0,this.index++,!0;break;}}return!1;}recreateWrapper(e,t,n,r,i,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!i9(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=iQ.create(this.top,t,n,r,i,s);if(o.contentDOM)for(let t of(o.children=e.children,e.children=[],o.children))t.parent=o;return e.destroy(),o;}addNode(e,t,n,r,i){let s=iQ.create(this.top,e,t,n,r,i);s.contentDOM&&s.updateChildren(r,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0;}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new iJ(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0;}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof iZ;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof iX)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((iC||ix)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top));}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new i0(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0;}}isLocked(e){return this.lock&&(e==this.lock||ii(e)&&e.contains(this.lock.parentNode));}}function se(e,t){return e.type.side-t.type.side;}function st(e,t,n,r,i){let s=[];for(let o=0,a=0;o<e.length;o++){let l=e[o],c=a,u=a+=l.size;c>=n||u<=t?s.push(l):(c<t&&s.push(l.slice(0,t-c,r)),i&&(s.push(i),i=void 0),u>n&&s.push(l.slice(n-c,l.size,r)));}return s;}function sn(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&0==i.size,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(il(n)){for(l=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&rq.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&function(e,t,n){for(let r=0==t,i=t==ir(e);r||i;){if(e==n)return!0;let t=r6(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==ir(e);}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;c=new rq(o==e?a:r.resolve(e));}else if(ik&&"key"==t&&o>e.state.selection.to&&ii(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if("visible"!=getComputedStyle(e).overflow){c=rO.findFrom(r.resolve(i.posAtStart),1);break;}if(e==i.dom||e.nextSibling||!e.parentNode||!ii(e.parentNode))break;}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let s=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(s.startContainer,s.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(s.endContainer,s.endOffset,-1));}if(t<0)return null;[l,o]=i==e.state.selection.anchor?[i,t]:[t,i],a=r.resolve(o);}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null;}let u=r.resolve(l);if(!c){let n="pointer"==t||e.state.selection.head<a.pos&&!s?1:-1;c=sd(e,u,a,n);}return c;}function sr(e){return e.editable?e.hasFocus():sp(e)&&document.activeElement&&document.activeElement.contains(e.dom);}function si(e,t=!1){let n=e.state.selection;if(sc(e,n),!sr(e))return;let r=e.input.mouseDown;if(!t&&ix&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&r7(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate())return void e.domObserver.setCurSelection();}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r="IMG"==n.nodeName;r?t.collapse(n.parentNode,r6(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&iv&&iy<=11&&(n.disabled=!0,n.disabled=!1);}(e);else{var i;let r,s,o,a,{anchor:l,head:c}=n,u,d;ss&&!(n instanceof rL)&&(n.$from.parent.inlineContent||(u=so(e,n.from)),n.empty||n.$from.parent.inlineContent||(d=so(e,n.to))),e.docView.setSelection(l,c,e,t),ss&&(u&&sl(u),d&&sl(d)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((r=(i=e).dom.ownerDocument).removeEventListener("selectionchange",i.input.hideSelectionGuard),o=(s=i.domSelectionRange()).anchorNode,a=s.anchorOffset,r.addEventListener("selectionchange",i.input.hideSelectionGuard=()=>{(s.anchorNode!=o||s.anchorOffset!=a)&&(r.removeEventListener("selectionchange",i.input.hideSelectionGuard),setTimeout(()=>{(!sr(i)||i.state.selection.visible)&&i.dom.classList.remove("ProseMirror-hideselection");},20));})));}e.domObserver.setCurSelection(),e.domObserver.connectSelection();}let ss=iC||ix&&iw<63;function so(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(iC&&i&&"false"==i.contentEditable)return sa(i);if((!i||"false"==i.contentEditable)&&(!s||"false"==s.contentEditable)){if(i)return sa(i);else if(s)return sa(s);}}function sa(e){return e.contentEditable="true",iC&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e;}function sl(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null);}function sc(e,t){if(t instanceof rq){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(su(e),n&&n.selectNode(),e.lastSelectedViewDesc=n);}else su(e);}function su(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0);}function sd(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||rL.between(t,n,r);}function sh(e){return(!e.editable||!!e.hasFocus())&&sp(e);}function sp(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return io(e.dom,t.anchorNode)&&(e.editable||io(e.dom,t.focusNode));}catch(e){return!1;}}function sf(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&rO.findFrom(s,t);}function sm(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0;}function sg(e,t,n){let r=e.state.selection;if(r instanceof rL){if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return sm(e,new rL(r.$anchor,s));}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=sf(e.state,t);return!!n&&n instanceof rq&&sm(e,n);}else if(!(iD&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,s;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(s=e.docView.descAt(o))&&!s.contentDOM)&&(rq.isSelectable(i)?sm(e,new rq(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):sm(e,new rL(e.state.doc.resolve(t<0?o:o+i.nodeSize))));}}else{if(r instanceof rq&&r.node.isInline)return sm(e,new rL(t>0?r.$to:r.$from));let n=sf(e.state,t);return!!n&&sm(e,n);}}function sv(e,t){let n=e.pmViewDesc;return n?0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName):ii(e)&&"false"==e.contentEditable;}function sy(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=!1;for(ik&&ii(n)&&r<ir(n)&&sv(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!ii(n))break;let e=n.childNodes[r-1];if(sv(e,-1))i=n,s=--r;else if(is(e))r=(n=e).nodeValue.length;else break;}else if(sk(n))break;else{let t=n.previousSibling;for(;t&&sv(t,-1);)i=n.parentNode,s=r6(t),t=t.previousSibling;if(t)r=ir(n=t);else{if((n=n.parentNode)==e.dom)break;r=0;}}o?sb(e,n,r):i&&sb(e,i,s);}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,s=r.focusOffset;if(!i)return;let o=ir(i);for(;;)if(s<o){if(!ii(i))break;if(sv(i.childNodes[s],1))t=i,n=++s;else break;}else if(sk(i))break;else{let r=i.nextSibling;for(;r&&sv(r,1);)t=r.parentNode,n=r6(r)+1,r=r.nextSibling;if(r)s=0,o=ir(i=r);else{if((i=i.parentNode)==e.dom)break;s=o=0;}}t&&sb(e,t,n);}(e);}function sk(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock;}function sb(e,t,n){if(!is(t)){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!ia(e);)t=r6(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(is(n))return n;if(ii(n)&&"false"==n.contentEditable)break;e=n,t=0;}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!ia(e);)t=r6(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(is(n))return n;if(ii(n)&&"false"==n.contentEditable)break;t=(e=n).childNodes.length;}}(t,n))&&(t=e,n=e.nodeValue.length);}let r=e.domSelection();if(!r)return;if(il(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e);}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&si(e);},50);}function sx(e,t){let n=e.state.doc.resolve(t);if(!(ix||iA)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl";}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl";}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr";}function sw(e,t,n){let r=e.state.selection;if(r instanceof rL&&!r.empty||n.indexOf("s")>-1||iD&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=sf(e.state,t);if(n&&n instanceof rq)return sm(e,n);}if(!i.parent.inlineContent){let n=t<0?i:s,o=r instanceof rU?rO.near(n,t):rO.findFrom(n,t);return!!o&&sm(e,o);}return!1;}function sC(e,t){if(!(e.state.selection instanceof rL))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let r=e.state.tr;return t<0?r.delete(n.pos-s.nodeSize,n.pos):r.delete(n.pos,n.pos+s.nodeSize),e.dispatch(r),!0;}return!1;}function sS(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start();}function sD(e,t){e.someProp("transformCopied",n=>{t=n(t,e);});let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,s--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content;}let o=e.someProp("clipboardSerializer")||n4.fromSchema(e.state.schema),a=sR(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&ii(c)&&(u=sT[c.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=a.createElement(u[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++;}c=l.firstChild;}return c&&ii(c)&&c.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t};}function sA(e,t,n,r,i){let s,o,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=!!t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",n=>{t=n(t,a||r,e);}),a)return o=new nx(nm.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{o=t(o,e,!0);}),o;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)o=n;else{let n=i.marks(),{schema:r}=e.state,o=n4.fromSchema(r);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=s.appendChild(document.createElement("p"));e&&t.appendChild(o.serializeNode(r.text(e,n)));});}}else e.someProp("transformPastedHTML",t=>{n=t(n,e);}),s=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=sR(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),s;if((s=i&&sT[i[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!sI){if(sI=t.defaultPolicy)try{return sI.createHTML(e);}catch(e){}sI=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e});}return sI.createHTML(e);}(e),s)for(let e=0;e<s.length;e++)r=r.querySelector(s[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText;}}}return r;}(n),iM&&function(e){let t=e.querySelectorAll(ix?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r);}}(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=s.firstChild;for(;e&&!ii(e);)e=e.nextSibling;if(!e)break;s=e;}if(o||(o=(e.someProp("clipboardParser")||e.someProp("domParser")||nQ.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||sE.test(e.parentNode.nodeName)?null:{ignore:!0}})),u)o=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t);}catch(t){return e;}let{content:i,openStart:s,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=nm.from(t.create(r[e+1],i));}catch(e){break;}s++,o++;}return new nx(i,s,o);}(s_(o,+u[1],+u[2]),u[4]);else if((o=nx.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(e=>{if(!s)return;let t=r.findWrapping(e.type),n;if(!t)return s=null;if(n=s.length&&i.length&&function e(t,n,r,i,s){if(s<t.length&&s<n.length&&t[s]==n[s]){let o=e(t,n,r,i.lastChild,s+1);if(o)return i.copy(i.content.replaceChild(i.childCount-1,o));if(i.contentMatchAt(i.childCount).matchType(s==t.length-1?r.type:t[s+1]))return i.copy(i.content.append(nm.from(sM(r,t,s+1))));}}(t,i,e,s[s.length-1],0))s[s.length-1]=n;else{s.length&&(s[s.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),i=t.contentMatchAt(t.childCount).fillBefore(nm.empty,!0);return t.copy(r.append(i));}(s[s.length-1],i.length));let n=sM(e,t);s.push(n),r=r.matchType(n.type),i=t;}}),s)return nm.from(s);}return e;}(o.content,i),!0)).openStart||o.openEnd){let e=0,t=0;for(let t=o.content.firstChild;e<o.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=o.content.lastChild;t<o.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);o=s_(o,e,t);}return e.someProp("transformPasted",t=>{o=t(o,e,l);}),o;}let sE=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function sM(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,nm.from(e));return e;}function sN(e,t,n,r,i,s){let o=t<0?e.firstChild:e.lastChild,a=o.content;return e.childCount>1&&(s=0),i<r-1&&(a=sN(a,t,n,r,i+1,s)),i>=n&&(a=t<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(nm.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(a));}function s_(e,t,n){return t<e.openStart&&(e=new nx(sN(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new nx(sN(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e;}let sT={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function sR(){return document.implementation.createHTMLDocument("title");}let sI=null,sj={},sF={},sO={touchstart:!0,touchmove:!0};class sz{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null;}}function sB(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now();}function sP(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>sL(e,t));});}function sL(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented);});}function s$(e){return{left:e.clientX,top:e.clientY};}function sq(e,t,n,r,i){if(-1==r)return!1;let s=e.state.doc.resolve(r);for(let r=s.depth+1;r>0;r--)if(e.someProp(t,t=>r>s.depth?t(e,n,s.nodeAfter,s.before(r),i,!0):t(e,n,s.node(r),s.before(r),i,!1)))return!0;return!1;}function sV(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r);}function sU(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?rL.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),s=i.before(e);if(t.inlineContent)return rL.create(r,s+1,s+1+t.content.size);if(n&&rq.isSelectable(t))return rq.create(r,s);}return null;}sF.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!sG(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!iE||!ix||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!iS||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,i=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||iD&&72==r&&"c"==i)return sC(e,-1)||sy(e,-1);if(46==r&&!t.shiftKey||iD&&68==r&&"c"==i)return sC(e,1)||sy(e,1);if(13==r||27==r)return!0;if(37==r||iD&&66==r&&"c"==i){let t=37==r?"ltr"==sx(e,e.state.selection.from)?-1:1:-1;return sg(e,t,i)||sy(e,t);}if(39==r||iD&&70==r&&"c"==i){let t=39==r?"ltr"==sx(e,e.state.selection.from)?1:-1:1;return sg(e,t,i)||sy(e,t);}else if(38==r||iD&&80==r&&"c"==i)return sw(e,-1,i)||sy(e,-1);else if(40==r||iD&&78==r&&"c"==i)return function(e){if(!iC||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&ii(t)&&0==n&&t.firstChild&&ii(t.firstChild)&&"false"==t.firstChild.contentEditable){let n=t.firstChild;sS(e,n,"true"),setTimeout(()=>sS(e,n,"false"),20);}return!1;}(e)||sw(e,1,i)||sy(e,1);else if(i==(iD?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1;}(e,t)?t.preventDefault():sB(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter"))),e.input.lastIOSEnter=0);},200);}},sF.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1);},sF.keypress=(e,t)=>{if(sG(e)||!t.charCode||t.ctrlKey&&!t.altKey||iD&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof rL)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,i))||e.dispatch(i()),t.preventDefault();}};let sW=iD?"metaKey":"ctrlKey";sj.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let s=sX(e),o=Date.now(),a="singleClick";o-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[sW]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:o,x:t.clientX,y:t.clientY,type:a,button:t.button},e.input.mouseDown&&e.input.mouseDown.done();let l=e.posAtCoords(s$(t));l&&("singleClick"==a?e.input.mouseDown=new sH(e,l,t,!!s):("doubleClick"==a?function(e,t,n,r){return sq(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r));}:function(e,t,n,r){return sq(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=sU(e,t,!0),i=e.state.doc;return!!r&&(sV(e,r),r instanceof rL&&i.eq(e.state.doc)&&(e.input.mouseDown=new sJ(e,r)),!0);}(e,n,r);})(e,l.pos,l.inside,t)?t.preventDefault():sB(e,"pointer"));};class sK{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this));}up(e){this.done();}move(e){0==e.buttons&&this.done();}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null);}delaySelUpdate(){return!1;}}class sH extends sK{constructor(e,t,n,r){let i,s;if(super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[sW],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),s=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,s=n.depth?n.before():0;}let o=r?null:n.target,a=o?e.docView.nearestDesc(o,!0):null;this.target=a&&ii(a.nodeDOM)?a.nodeDOM:null;let{selection:l}=e.state;0==n.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof rq&&l.from<=s&&l.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ik&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false");},20),this.view.domObserver.start()),sB(e,"pointer");}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||si(this.view);});}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(s$(e))),this.updateAllowDefault(e),this.allowDefault||!t)sB(this.view,"pointer");else{var n,r,i,s;(n=this.view,r=t.pos,i=t.inside,s=this.selectNode,sq(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(s?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof rq&&(r=n.node);let s=e.state.doc.resolve(t);for(let e=s.depth+1;e>0;e--){let t=e>s.depth?s.nodeAfter:s.node(e);if(rq.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?s.before(n.$from.depth):s.before(e);break;}}return null!=i&&(sV(e,rq.create(e.state.doc,i)),!0);}(n,i):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&rq.isSelectable(r))&&(sV(e,new rq(n)),!0);}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||iC&&this.mightDrag&&!this.mightDrag.node.isAtom||ix&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(sV(this.view,rO.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):sB(this.view,"pointer");}}move(e){this.updateAllowDefault(e),sB(this.view,"pointer"),super.move(e);}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0);}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0);}}class sJ extends sK{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc;}move(e){if(0==e.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();e.preventDefault(),sB(this.view,"pointer");let t=this.view.posAtCoords(s$(e)),n=t&&sU(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[s,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];sV(this.view,rL.create(r,s,o));}}function sG(e,t){return!!e.composing||!!(iC&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0);}sj.touchstart=e=>{e.input.lastTouch=Date.now(),sX(e),sB(e,"pointer");},sj.touchmove=e=>{e.input.lastTouch=Date.now(),sB(e,"pointer");},sj.contextmenu=e=>sX(e);let sZ=iE?5e3:-1;function sQ(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>sX(e),t));}function sY(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty();}function sX(e,t=!1){if(!iE||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),sY(e),t||e.docView&&e.docView.dirty){let n=sn(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0;}return!1;}}sF.compositionstart=sF.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof rL&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||ix&&iA&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!ii(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return ii(r)&&"false"==r.contentEditable;}(e)))e.markCursor=e.state.storedMarks||n.marks(),sX(e,!0),e.markCursor=null;else if(sX(e,!t.selection.empty),ik&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&ii(n)&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(is(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break;}n=t,r=-1;}}e.input.composing=!0;}sQ(e,sZ);},sF.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,sQ(e,20));};let s0=iv&&iy<15||iS&&iN<604;function s1(e,t,n,r,i){let s=sA(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,s||nx.empty)))return!0;if(!s)return!1;let o=0==s.openStart&&0==s.openEnd&&1==s.content.childCount?s.content.firstChild:null,a=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(s);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0;}function s2(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):"";}sj.copy=sF.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=s0?null:t.clipboardData,{dom:s,text:o}=sD(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",o)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus();},50);}(e,s),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));},sF.paste=(e,t)=>{if(e.composing&&!iE)return;let n=s0?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&s1(e,s2(n),n.getData("text/html"),r,t)?t.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?s1(e,r.value,null,i,t):s1(e,r.textContent,r.innerHTML,i,t);},50);}(e,t);};class s3{constructor(e,t,n){this.slice=e,this.move=t,this.node=n;}}let s6=iD?"altKey":"ctrlKey";function s5(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t);}),null!=n?!n:!t[s6];}for(let e in sj.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(s$(t));if(s&&s.pos>=i.from&&s.pos<=(i instanceof rq?i.to-1:i.to));else if(r&&r.mightDrag)n=rq.create(e.state.doc,r.mightDrag.pos);else if(t.target&&ii(t.target)){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=rq.create(e.state.doc,r.posBefore));}let o=(n||e.state.selection).content(),{dom:a,text:l,slice:c}=sD(e,o);t.dataTransfer.files.length&&ix&&!(iw>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(s0?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",s0||t.dataTransfer.setData("text/plain",l),e.dragging=new s3(c,s5(e,t),n);},sj.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null);},50);},sF.dragover=sF.dragenter=(e,t)=>t.preventDefault(),sF.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(s$(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",t=>{s=t(s,e,!1);}):s=sA(e,s2(t.dataTransfer),s0?null:t.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&s5(e,t));if(e.someProp("handleDrop",n=>n(e,t,s||nx.empty,o)))return t.preventDefault();if(!s)return;t.preventDefault();let a=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(0==n.openStart&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,s=r.index(t)+ +(n>0),o=r.node(t),a=!1;if(1==e)a=o.canReplace(s,s,i);else{let e=o.contentMatchAt(s).findWrapping(i.firstChild.type);a=e&&o.canReplaceWith(s,s,e[0]);}if(a)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1);}return null;}(e.state.doc,i.pos,s):i.pos;null==a&&(a=i.pos);let l=e.state.tr;if(o){let{node:e}=n;e?e.replace(l):l.deleteSelection();}let c=l.mapping.map(a),u=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,d=l.doc;if(u?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(d))return;let h=l.doc.resolve(c);if(u&&rq.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new rq(h));else{let t=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),l.setSelection(sd(e,h,l.doc.resolve(t)));}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"));}(e,t,e.dragging);}finally{e.dragging=null;}},sj.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&si(e);},20));},sj.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1);},sj.beforeinput=(e,t)=>{if(iE&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",t=>t(e,ic(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView());},50);}},sF)sj[e]=sF[e];function s4(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0;}class s9{constructor(e,t){this.toDOM=e,this.spec=t||on,this.side=this.spec.side||0;}map(e,t,n,r){let{pos:i,deleted:s}=e.mapResult(t.from+r,this.side<0?-1:1);return s?null:new oe(i-n,i-n,this);}valid(){return!0;}eq(e){return this==e||e instanceof s9&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&s4(this.spec,e.spec));}destroy(e){this.spec.destroy&&this.spec.destroy(e);}}class s8{constructor(e,t){this.attrs=e,this.spec=t||on;}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,s=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=s?null:new oe(i,s,this);}valid(e,t){return t.from<t.to;}eq(e){return this==e||e instanceof s8&&s4(this.attrs,e.attrs)&&s4(this.spec,e.spec);}static is(e){return e.type instanceof s8;}destroy(){}}class s7{constructor(e,t){this.attrs=e,this.spec=t||on;}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let s=e.mapResult(t.to+r,-1);return s.deleted||s.pos<=i.pos?null:new oe(i.pos-n,s.pos-n,this);}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to;}eq(e){return this==e||e instanceof s7&&s4(this.attrs,e.attrs)&&s4(this.spec,e.spec);}destroy(){}}class oe{constructor(e,t,n){this.from=e,this.to=t,this.type=n;}copy(e,t){return new oe(e,t,this.type);}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to;}map(e,t,n){return this.type.map(e,this,t,n);}static widget(e,t,n){return new oe(e,e,new s9(t,n));}static inline(e,t,n,r){return new oe(e,t,new s8(n,r));}static node(e,t,n,r){return new oe(e,t,new s7(n,r));}get spec(){return this.type.spec;}get inline(){return this.type instanceof s8;}get widget(){return this.type instanceof s9;}}let ot=[],on={};class or{constructor(e,t){this.local=e.length?e:ot,this.children=t.length?t:ot;}static create(e,t){return t.length?ou(t,e,0,on):oi;}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r;}findInner(e,t,n,r,i){for(let s=0;s<this.local.length;s++){let o=this.local[s];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r));}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let o=this.children[s]+1;this.children[s+2].findInner(e-o,t-o,n,r+o,i);}}map(e,t,n){return this==oi||0==e.maps.length?this:this.mapInner(e,t,0,0,n||on);}mapInner(e,t,n,r,i){let s;for(let o=0;o<this.local.length;o++){let a=this.local[o].map(e,n,r);a&&a.type.valid(t,a)?(s||(s=[])).push(a):i.onRemove&&i.onRemove(this.local[o].spec);}return this.children.length?function(e,t,n,r,i,s,o){let a=e.slice();for(let e=0,t=s;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,s)=>{let o=s-i-(n-e);for(let i=0;i<a.length;i+=3){let s=a[i+1];if(s<0||e>s+t-r)continue;let l=a[i]+t-r;n>=l?a[i+1]=e<=l?-2:-1:e>=t&&o&&(a[i]+=o,a[i+1]+=o);}r+=o;}),t=n.maps[e].map(t,-1);}let l=!1;for(let t=0;t<a.length;t+=3)if(a[t+1]<0){if(-2==a[t+1]){l=!0,a[t+1]=-1;continue;}let c=n.map(e[t]+s),u=c-i;if(u<0||u>=r.content.size){l=!0;continue;}let d=n.map(e[t+1]+s,-1)-i,{index:h,offset:p}=r.content.findIndex(u),f=r.maybeChild(h);if(f&&p==u&&p+f.nodeSize==d){let r=a[t+2].mapInner(n,f,c+1,e[t]+s+1,o);r!=oi?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0);}else l=!0;}if(l){let l=ou(function(e,t,n,r,i,s,o){for(let a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,s){for(let e=0;e<t.local.length;e++){let a=t.local[e].map(r,i,s);a?n.push(a):o.onRemove&&o.onRemove(t.local[e].spec);}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+s+1);}(e[a+2],t[a]+s+1);return n;}(a,e,t,n,i,s,o),r,0,o);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let n=l.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2]);}}return new or(t.sort(od),a);}(this.children,s||[],e,t,n,r,i):s?new or(s.sort(od),ot):oi;}add(e,t){return t.length?this==oi?or.create(e,t):this.addInner(e,t,0):this;}addInner(e,t,n){let r,i=0;e.forEach((e,s)=>{let o=s+n,a;if(a=ol(t,e,o)){for(r||(r=this.children.slice());i<r.length&&r[i]<s;)i+=3;r[i]==s?r[i+2]=r[i+2].addInner(e,a,o+1):r.splice(i,0,s,s+e.nodeSize,ou(a,e,o+1,on)),i+=3;}});let s=oa(i?oc(t):t,-n);for(let t=0;t<s.length;t++)s[t].type.valid(e,s[t])||s.splice(t--,1);return new or(s.length?this.local.concat(s).sort(od):this.local,r||this.children);}remove(e){return 0==e.length||this==oi?this:this.removeInner(e,0);}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let i,s=n[r]+t,o=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>s&&n.to<o&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,s+1);a!=oi?n[r+2]=a:(n.splice(r,3),r-=3);}if(r.length){for(let n=0,i;n<e.length;n++)if(i=e[n])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));}return n==this.children&&r==this.local?this:r.length||n.length?new or(r,n):oi;}forChild(e,t){let n,r;if(this==oi)return this;if(t.isLeaf)return or.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break;}let i=e+1,s=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<s&&t.to>i&&t.type instanceof s8){let e=Math.max(i,t.from)-i,n=Math.min(s,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n));}}if(r){let e=new or(r.sort(od),ot);return n?new oo([e,n]):e;}return n||oi;}eq(e){if(this==e)return!0;if(!(e instanceof or)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0;}locals(e){return oh(this.localsInner(e));}localsInner(e){if(this==oi)return ot;if(e.inlineContent||!this.local.some(s8.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof s8||t.push(this.local[e]);return t;}forEachSet(e){e(this);}}or.empty=new or([],[]),or.removeOverlap=oh;let oi=or.empty;class oo{constructor(e){this.members=e;}map(e,t){let n=this.members.map(n=>n.map(e,t,on));return oo.from(n);}forChild(e,t){if(t.isLeaf)return or.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=oi&&(i instanceof oo?n=n.concat(i.members):n.push(i));}return oo.from(n);}eq(e){if(!(e instanceof oo)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0;}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e]);}else t=i;}return t?oh(n?t:t.sort(od)):ot;}static from(e){switch(e.length){case 0:return oi;case 1:return e[0];default:return new oo(e.every(e=>e instanceof or)?e:e.reduce((e,t)=>e.concat(t instanceof or?t:t.members),[]));}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e);}}function oa(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new oe(i.from+t,i.to+t,i.type));}return n;}function ol(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,s;t<e.length;t++)(s=e[t])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),e[t]=null);return i;}function oc(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t;}function ou(e,t,n,r){let i=[],s=!1;t.forEach((t,o)=>{let a=ol(e,t,o+n);if(a){s=!0;let e=ou(a,t,n+o+1,r);e!=oi&&i.push(o,o+t.nodeSize,e);}});let o=oa(s?oc(e):e,-n).sort(od);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new or(o,i):oi;}function od(e,t){return e.from-t.from||e.to-t.to;}function oh(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),op(t,i+1,s.copy(r.to,s.to)));continue;}s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),op(t,i,r.copy(s.from,r.to)));break;}}return t;}function op(e,t,n){for(;t<e.length&&od(n,e[t])>0;)t++;e.splice(t,0,n);}function of(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=oi&&t.push(r);}),e.cursorWrapper&&t.push(or.create(e.state.doc,[e.cursorWrapper.deco])),oo.from(t);}let om={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},og=iv&&iy<=11;class ov{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0;}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset;}clear(){this.anchorNode=this.focusNode=null;}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset;}}class oy{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ov(),this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);iv&&iy<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():iC&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush();}),og&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon();}),this.onSelectionChange=this.onSelectionChange.bind(this);}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush();},20));}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush());}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,om)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection();}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20);}this.observer.disconnect();}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection();}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50);}onSelectionChange(){if(sh(this.view)){if(this.suppressingSelectionUpdates)return si(this.view);if(iv&&iy<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&r7(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon();}this.flush();}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange());}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set(),n;for(let n=e.focusNode;n;n=r5(n))t.add(n);for(let r=e.anchorNode;r;r=r5(r))if(t.has(r)){n=r;break;}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:is(n)?n.parentNode:n}))return this.setCurSelection(),!0;}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue;}flush(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&sh(t)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],l);t&&(s=s<0?t.from:Math.min(t.from,s),o=o<0?t.to:Math.max(t.to,o),t.typeOver&&(a=!0));}if(l.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||ix&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(e=>"childList"==e.type&&e.removedNodes.length))){for(let e of l)if("BR"==e.nodeName&&e.parentNode){let t=e.nextSibling;for(;t&&ii(t);){if("false"==t.contentEditable){e.parentNode.removeChild(e);break;}t=t.firstChild;}}}else if(ik&&l.length){let e=l.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove();}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n;}return null;}(t,n)!=e)&&r.remove();}}}let c=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&il(r)&&(c=sn(t))&&c.eq(rO.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,si(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,o),e=t,!ok.has(e)&&(ok.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=ik,ob||(console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),ob=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let s of t)if((null==(n=s.parentNode)?void 0:n.nodeName)=="TR"){let t=s.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||!ii(e)||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e;}n.insertBefore(s,n.firstChild),r==s&&e.domSelection().collapse(s,i);}else s.parentNode.removeChild(s);}}(t,l)),this.handleDOMChange(s,o,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||si(t),this.currentSelection.set(r));}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),is(r)&&(this.lastChangedTextNode=r);}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(iv&&iy<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:s}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!s||0>Array.prototype.indexOf.call(e.addedNodes,s))&&(i=s);}let s=r&&r.parentNode==e.target?r6(r)+1:0,o=n.localPosFromDOM(e.target,s,-1),a=i&&i.parentNode==e.target?r6(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,a,1)};}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue});}}let ok=new WeakMap(),ob=!1;function ox(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return r7(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s};}let ow=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function oC(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:sd(e,t.resolve(n.anchor),t.resolve(n.head));}function oS(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++;}return i;}class oD{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new sz(),this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(o_),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=oM(this),oE(this),this.nodeViews=oN(this),this.docView=iY(this.state.doc,oA(this),of(this),this.dom,this),this.domObserver=new oy(this,(e,t,n,r)=>function(e,t,n,r,i){var s,o,a;let l,c,u,d,h,p=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=sn(e,t);if(n&&!e.state.selection.eq(n)){if(ix&&iE&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),p&&r.setMeta("composition",p),e.dispatch(r);}return;}let f=e.state.doc.resolve(t),m=f.sharedDepth(n);t=f.before(m+1),n=e.state.doc.resolve(n).after(m+1);let g=e.state.selection,v=function(e,t,n,r){let i,s,{node:o,fromOffset:a,toOffset:l,from:c,to:u}=e.docView.parseRange(t,n),d=e.domSelectionRange(),h=d.anchorNode;if(h&&io(e.dom,h)&&(s=[{node:h,offset:d.anchorOffset}],il(d)||s.push({node:d.focusNode,offset:d.focusOffset})),ix&&8===e.input.lastKeyCode)for(let e=l;e>a;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){l=e;break;}if(!n||n.size)break;}let p=e.state.doc,f=e.someProp("domParser")||nQ.fromSchema(e.state.schema),m=p.resolve(c),g=null,v=f.parse(o,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:l,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:s,ruleFromNode:(i=r,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(i);if("BR"==e.nodeName&&e.parentNode){if(iC&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e};}else if(e.parentNode.lastChild==e||iC&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0};}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null;}),context:m});if(s&&null!=s[0].pos){let e=s[0].pos,t=s[1]&&s[1].pos;null==t&&(t=e),g={anchor:e+c,head:t+c};}return{doc:v,sel:g,from:c,to:u};}(e,t,n,i),y=e.state.doc,k=y.slice(v.from,v.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,d="end"):(u=e.state.selection.from,d="start"),e.input.lastKeyCode=null;let b=function(e,t,n,r,i){let s=e.findDiffStart(t,n),o=n+e.size,a=n+t.size;if(null==s)return null;let{a:l,b:c}=e.findDiffEnd(t,o,a);if("end"==i){let e=Math.max(0,s-Math.min(l,c));r-=l+e-s;}if(l<s&&o<a){let e=r<=s&&r>=l?s-r:0;s-=e,c=s+(c-l),l=s;}else if(c<s){let e=r<=s&&r>=c?s-r:0;s-=e,l=s+(l-c),c=s;}return{start:s,endA:l,endB:c};}(k.content,v.doc.content,v.from,u,d);if(b&&e.input.domChangeCount++,(iS&&e.input.lastIOSEnter>Date.now()-225||iE)&&i.some(e=>ii(e)&&!ow.test(e.nodeName))&&(!b||b.endA>=b.endB)&&e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return;}if(!b)if(r&&g instanceof rL&&!g.empty&&g.$head.sameParent(g.$anchor)&&!e.composing&&!(v.sel&&v.sel.anchor!=v.sel.head))b={start:g.from,endA:g.to,endB:g.to};else{if(v.sel){let t=oC(e,e.state.doc,v.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);p&&n.setMeta("composition",p),e.dispatch(n);}}return;}e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof rL&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2&&e.state.selection.from>=v.from?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&e.state.selection.to<=v.to&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),iv&&iy<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>v.from&&"  "==v.doc.textBetween(b.start-v.from-1,b.start-v.from+1)&&(b.start--,b.endA--,b.endB--);let x=v.doc.resolveNoCache(b.start-v.from),w=v.doc.resolveNoCache(b.endB-v.from),C=y.resolve(b.start),S=x.sameParent(w)&&x.parent.inlineContent&&C.end()>=b.endA;if((iS&&e.input.lastIOSEnter>Date.now()-225&&(!S||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!S&&(s=v.doc,o=x.pos,a=w.pos,l=0,c=0,s.nodesBetween(o,a,(e,t)=>{e.isTextblock&&t>=o&&t<a?l++:(e.isText?/\S/.test(e.text.slice(Math.max(0,o-t),Math.min(e.nodeSize,a-t))):e.isLeaf)&&c++;}),0==c&&1==l))&&e.someProp("handleKeyDown",t=>t(e,ic(13,"Enter")))){e.input.lastIOSEnter=0;return;}if(e.state.selection.anchor>b.start&&function(e,t,n,r,i){if(n-t<=i.pos-r.pos||oS(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let e=s.nodeAfter;return null!=e&&n==t+e.nodeSize;}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=e.resolve(oS(s,!0,!0));return!(!o.parent.isTextblock||o.pos>n||oS(o,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(o.parent.content);}(y,b.start,b.endA,x,w)&&e.someProp("handleKeyDown",t=>t(e,ic(8,"Backspace")))){iE&&ix&&e.domObserver.suppressSelectionUpdates();return;}ix&&b.endB==b.start&&(e.input.lastChromeDelete=Date.now()),iE&&!S&&x.start()!=w.start()&&0==w.parentOffset&&x.depth==w.depth&&v.sel&&v.sel.anchor==v.sel.head&&v.sel.head==b.endA&&(b.endB-=2,w=v.doc.resolveNoCache(b.endB-v.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,ic(13,"Enter"));});},20));let D=b.start,A=b.endA,E=t=>{let n=t||e.state.tr.replace(D,A,v.doc.slice(b.start-v.from,b.endB-v.from));if(v.sel){let t=oC(e,n.doc,v.sel);t&&!(ix&&e.composing&&t.empty&&(b.start!=b.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==D||t.head==n.mapping.map(A)-1)||iv&&t.empty&&t.head==D)&&n.setSelection(t);}return p&&n.setMeta("composition",p),n.scrollIntoView();};if(S){if(x.pos==w.pos){iv&&iy<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>si(e),20));let t=E(e.state.tr.delete(D,A)),n=y.resolve(b.start).marksAcross(y.resolve(b.endA));n&&t.ensureMarks(n),e.dispatch(t);}else if(b.endA==b.endB&&(h=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,o,a,l;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)s=n[e].removeFromSet(s);if(1==i.length&&0==s.length)a=i[0],o="add",l=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=s.length)return null;a=s[0],o="remove",l=e=>e.mark(a.removeFromSet(e.marks));}let c=[];for(let e=0;e<t.childCount;e++)c.push(l(t.child(e)));if(nm.from(c).eq(e))return{mark:a,type:o};}(x.parent.content.cut(x.parentOffset,w.parentOffset),C.parent.content.cut(C.parentOffset,b.endA-C.start())))){let t=E(e.state.tr);"add"==h.type?t.addMark(D,A,h.mark):t.removeMark(D,A,h.mark),e.dispatch(t);}else if(x.parent.child(x.index()).isText&&x.index()==w.index()-!w.textOffset){let t=x.parent.textBetween(x.parentOffset,w.parentOffset),n=()=>E(e.state.tr.insertText(t,D,A));e.someProp("handleTextInput",r=>r(e,D,A,t,n))||e.dispatch(n());}else e.dispatch(E());}else e.dispatch(E());}(this,e,t,n,r)),this.domObserver.start();var n=this;for(let e in sj){let t=sj[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=e=>{!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0;}(n,e)||sL(n,e)||!n.editable&&e.type in sF||t(n,e);},sO[e]?{passive:!0}:void 0);}iC&&n.dom.addEventListener("input",()=>null),sP(n),this.updatePluginViews();}get composing(){return this.input.composing;}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state;}return this._props;}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&sP(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(o_),this.directPlugins=e.plugins),this.updateStateInner(e.state,t);}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t);}updateState(e){this.updateStateInner(e,this._props);}updateStateInner(e,t){var n,r,i;let s=this.state,o=!1,a=!1;e.storedMarks&&this.composing&&(sY(this),a=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=oN(this);(function(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++;}for(let e in t)r++;return n!=r;})(e,this.nodeViews)&&(this.nodeViews=e,o=!0);}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&sP(this),this.editable=oM(this),oE(this);let c=of(this),u=oA(this),d=s.plugins==e.plugins||s.doc.eq(e.doc)?e.scrollToSelection>s.scrollToSelection?"to selection":"preserve":"reset",h=o||!this.docView.matchesNode(e.doc,u,c);(h||!e.selection.eq(s.selection))&&(a=!0);let p="preserve"==d&&a&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let s=(r.left+r.right)/2,o=i+1;o<Math.min(innerHeight,r.bottom);o+=5){let r=e.root.elementFromPoint(s,o);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break;}}return{refDOM:t,refTop:n,stack:iR(e.dom)};}(this);if(a){let t,n,a;this.domObserver.stop();let l=h&&(iv||ix)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&(r=s.selection,i=e.selection,a=Math.min(r.$anchor.sharedDepth(r.head),i.$anchor.sharedDepth(i.head)),r.$anchor.start(a)!=i.$anchor.start(a));if(h){let t=ix?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(is(e)&&t)return e;if(ii(e)&&t>0){if("false"==e.contentEditable)return null;t=ir(e=e.childNodes[t-1]);}else{if(!e.parentNode||ia(e))return null;t=r6(e),e=e.parentNode;}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(is(e)&&t<e.nodeValue.length)return e;if(ii(e)&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0;}else{if(!e.parentNode||ia(e))return null;t=r6(e)+1,e=e.parentNode;}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r;}}return n||r;}(this)),(o||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=iY(e.doc,u,c,this.dom,this)),!t||this.trackWrites&&this.dom.contains(this.trackWrites)||(l=!0);}let d=this.input.mouseDown;l||!(d&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),r7(t.node,t.offset,n.anchorNode,n.anchorOffset))&&d.delaySelUpdate())?si(this,l):(sc(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(s),(null==(n=this.dragging)?void 0:n.node)&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),"reset"==d?this.dom.scrollTop=0:"to selection"==d?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;iI(n,0==r?0:r-t);}(p);}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&io(this.dom,e))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof rq){let t=this.docView.domAfterPos(this.state.selection.from);ii(t)&&iT(this,t.getBoundingClientRect(),e);}else iT(this,this.coordsAtPos(this.state.selection.head,1),e);}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy();}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e);}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this));}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this));}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e);}this.dragging=new s3(e.slice,e.move,r<0?void 0:rq.create(this.state.doc,r));}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(null!=i&&(r=t?t(i):i))return r;}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let s=i[n].props[e];if(null!=s&&(r=t?t(s):s))return r;}}hasFocus(){if(iv){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement;}return!0;}return this.root.activeElement==this.dom;}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(ij)return e.focus(ij);let t=iR(e);e.focus(null==ij?{get preventScroll(){return ij={preventScroll:!0},!0;}}:void 0),ij||(ij=!1,iI(t,0));}(this.dom),si(this),this.domObserver.start();}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e;}return e||document;}updateRoot(){this._root=null;}posAtCoords(e){return function(e,t){var n;let r,i,s=e.dom.ownerDocument,o,a=0,l=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ir(r.offsetNode),r.offset)};}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ir(r.startContainer),r.startOffset)};}}(s,t.left,t.top);l&&({node:o,offset:a}=l);let c=(e.root.elementFromPoint?e.root:s).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(c)){let n=e.dom.getBoundingClientRect();if(!iF(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let s=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),o=s;;){let r=t.childNodes[o];if(ii(r)){let t=r.getClientRects();for(let i=0;i<t.length;i++){let s=t[i];if(iF(n,s))return e(r,n,s);}}if((o=(o+1)%i)==s)break;}return t;}(e.dom,t,n)))return null;}if(iC)for(let e=c;o&&e;e=r5(e))e.draggable&&(o=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,o){let n;if(ik&&ii(o)&&(a=Math.min(a,o.childNodes.length))<o.childNodes.length){let e=o.childNodes[a],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&a++;}iM&&a&&ii(o)&&ii(n=o.childNodes[a-1])&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&a--,o==e.dom&&a==o.childNodes.length-1&&ii(o.lastChild)&&t.top>o.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:0!=a&&ii(o)&&"BR"==o.childNodes[a-1].nodeName||(i=function(e,t,n,r){let i=-1;for(let n=t,s=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(ii(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!s&&o.left>r.left||o.top>r.top?i=t.posBefore:(!s&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),s=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode;}return i>-1?i:e.docView.posFromDOM(t,n,-1);}(e,o,a,t));}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,s,o=2e8,a,l=0,c=n.top,u=n.top;for(let e=t.firstChild,d=0;e;e=e.nextSibling,d++){let t;if(ii(e))t=e.getClientRects();else{if(!is(e))continue;t=r9(e).getClientRects();}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=c&&p.bottom>=u){c=Math.max(p.bottom,c),u=Math.min(p.top,u);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<o){r=e,o=t,a=t&&is(r)?{left:p.right<n.left?p.right:p.left,top:n.top}:n,ii(e)&&t&&(l=d+ +(n.left>=(p.left+p.right)/2));continue;}}else p.top>n.top&&!i&&p.left<=n.left&&p.right>=n.left&&(i=e,s={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!r&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(l=d+1);}}return(!r&&i&&(r=i,a=s,o=0),r&&is(r))?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let n=iz(r,1);if(n.top!=n.bottom&&iF(t,n)){i={node:e,offset:s+ +(t.left>=(n.left+n.right)/2)};break;}}return r.detach(),i||{node:e,offset:0};}(r,a):!r||o?{node:t,offset:l}:e(r,a);}(t,n),s=-1;if(ii(r)&&!r.firstChild){let e=r.getBoundingClientRect();s=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1;}return e.docView.posFromDOM(r,i,s);}(e,c,t));let u=e.docView.nearestDesc(c,!0);return{pos:i,inside:u?u.posAtStart-u.border:-1};}(this,e);}coordsAtPos(e,t=1){return iP(this,e,t);}domAtPos(e,t=0){return this.docView.domFromPos(e,t);}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null;}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw RangeError("DOM position not inside the editor");return r;}endOfTextblock(e,t){return function(e,t,n){let r,i;return iU==t&&iW==n?iK:(iU=t,iW=n,iK="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,iq(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break;}t=n.dom.parentNode;}let r=iP(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(ii(e))t=e.getClientRects();else{if(!is(e))continue;t=r9(e,0,e.nodeValue.length).getClientRects();}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1;}}return!0;})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=i==r.parent.content.size,o=e.domSelection();return o?iV.test(r.parent.textContent)&&o.modify?iq(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:s,anchorOffset:a}=e.domSelectionRange(),l=o.caretBidiLevel;o.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),h=u&&!io(c,u)||t==u&&i==d;try{o.collapse(s,a),t&&(t!=s||i!=a)&&o.extend&&o.extend(t,i);}catch(e){}return null!=l&&(o.caretBidiLevel=l),h;}):"left"==n||"backward"==n?!i:s:r.pos==r.start()||r.pos==r.end();}(e,t,n));}(this,t||this.state,e);}pasteHTML(e,t){return s1(this,"",e,!1,t||new ClipboardEvent("paste"));}pasteText(e,t){return s1(this,e,null,!0,t||new ClipboardEvent("paste"));}serializeForClipboard(e){return sD(this,e);}destroy(){if(this.docView){for(let e in this.input.mouseDown&&this.input.mouseDown.done(),this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],of(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,r8();}}get isDestroyed(){return null==this.docView;}dispatchEvent(e){!sL(this,e)&&sj[e.type]&&(this.editable||!(e.type in sF))&&sj[e.type](this,e);}domSelectionRange(){let e=!1!==this.dom.isConnected&&this.domSelection();return e?iC&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t;}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return ox(e,n);}function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0];}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?ox(e,n):null;}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0};}domSelection(){return this.root.getSelection();}}function oA(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]));}),t.translate||(t.translate="no"),[oe.node(0,e.state.doc.content.size,t)];}function oE(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:oe.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})};}else e.cursorWrapper=null;}function oM(e){return!e.someProp("editable",t=>!1===t(e.state));}function oN(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);}return e.someProp("nodeViews",n),e.someProp("markViews",n),t;}function o_(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component");}oD.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e));};let oT=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function oR(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break;}return!1;}function oI(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break;}return null;}function oj(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break;}return null;}function oF(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n;}return null;}let oO=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof rU||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=oF(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,s.createAndFill());o.setSelection(rL.create(o.doc,n+1)),t(o.scrollIntoView());}return!0;},oz=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(rb(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0;}let r=n.blockRange(),i=r&&rg(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0);},oB=(e,t)=>{if(e.selection instanceof rq&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!rb(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);}if(!e.selection.$from.depth)return!1;let n=e.tr;!e.selection.empty&&(e.selection instanceof rL||e.selection instanceof rU)&&n.deleteSelection();let{$from:r}=n.selection,i=n.steps.length,s=[],o,a,l=!1,c=!1;for(let e=r.depth;;e--){if(r.node(e).isBlock){let t;l=r.end(e)==r.pos+(r.depth-e),c=r.start(e)==r.pos-(r.depth-e),a=oF(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));s.unshift(t||(l&&a?{type:a}:null)),o=e;break;}if(1==e)return!1;s.unshift(null);}let u=r.pos,d=rb(n.doc,u,s.length,s);if(d||(s[0]=a?{type:a}:null,d=rb(n.doc,u,s.length,s)),!d)return!1;if(n.split(u,s.length,s),!l&&c&&r.node(o).type!=a){let e=n.mapping.slice(i),t=e.map(r.before(o)),s=n.doc.resolve(t);a&&r.node(o-1).canReplaceWith(s.index(),s.index()+1,a)&&n.setNodeMarkup(e.map(r.before(o)),a);}return t&&t(n.scrollIntoView()),!0;};function oP(e,t,n,r){let i,s,o,a=t.nodeBefore,l=t.nodeAfter,c,u,d=a.type.spec.isolating||l.type.spec.isolating;if(!d&&(i=t.nodeBefore,s=t.nodeAfter,o=t.index(),i&&s&&i.type.compatibleContent(s.type)&&(!i.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(o,o+1)&&!!(s.isTextblock||rx(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let h=!d&&t.parent.canReplace(t.index(),t.index()+1);if(h&&(c=(u=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&u.matchType(c[0]||l.type).validEnd){if(n){let r=t.pos+l.nodeSize,i=nm.empty;for(let e=c.length-1;e>=0;e--)i=nm.from(c[e].create(null,i));i=nm.from(a.copy(i));let s=e.tr.step(new rp(t.pos-1,r,t.pos,r,new nx(i,1,0),c.length,!0)),o=s.doc.resolve(r+2*c.length);o.nodeAfter&&o.nodeAfter.type==a.type&&rx(s.doc,o.pos)&&s.join(o.pos),n(s.scrollIntoView());}return!0;}let p=l.type.spec.isolating||r>0&&d?null:rO.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&rg(f);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0;if(h&&oR(l,"start",!0)&&oR(a,"end")){let r=a,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let s=l,o=1;for(;!s.isTextblock;s=s.firstChild)o++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=nm.empty;for(let e=i.length-1;e>=0;e--)r=nm.from(i[e].copy(r));n(e.tr.step(new rp(t.pos-i.length,t.pos+l.nodeSize,t.pos+o,t.pos+l.nodeSize-o,new nx(r,i.length,0),0,!0)).scrollIntoView());}return!0;}}return!1;}function oL(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--;}return!!i.node(s).isTextblock&&(n&&n(t.tr.setSelection(rL.create(t.doc,e<0?i.start(s):i.end(s)))),!0);};}let o$=oL(-1),oq=oL(1);function oV(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(s,o,(r,s)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(s),r=t.index();i=t.parent.canReplaceWith(r,r+1,e);}});}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:s},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(s,o,e,t);}r(i.scrollIntoView());}return!0;};}function oU(e,t=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms),s=!(n&&n.includeWhitespace);return function(n,o){let{empty:a,$cursor:l,ranges:c}=n.selection;if(a&&!l||!function(e,t,n,r){for(let i=0;i<t.length;i++){let{$from:s,$to:o}=t[i],a=0==s.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(s.pos,o.pos,(e,t)=>{if(a||!r&&e.isAtom&&e.isInline&&t>=s.pos&&t+e.nodeSize<=o.pos)return!1;a=e.inlineContent&&e.type.allowsMarkType(n);}),a)return!0;}return!1;}(n.doc,c,e,i))return!1;if(o)if(l)o(e.isInSet(n.storedMarks||l.marks())?n.tr.removeStoredMark(e):n.tr.addStoredMark(e.create(t)));else{let a,l=n.tr;i||(c=function(e){let t=[];for(let n=0;n<e.length;n++){let{$from:r,$to:i}=e[n];r.doc.nodesBetween(r.pos,i.pos,(e,n)=>{if(e.isAtom&&e.content.size&&e.isInline&&n>=r.pos&&n+e.nodeSize<=i.pos)return n+1>r.pos&&t.push(new rz(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1;}),r.pos<i.pos&&t.push(new rz(r,i));}return t;}(c)),a=r?!c.some(t=>n.doc.rangeHasMark(t.$from.pos,t.$to.pos,e)):!c.every(t=>{let n=!1;return l.doc.nodesBetween(t.$from.pos,t.$to.pos,(r,i,s)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!s&&s.type.allowsMarkType(e)&&!(r.isText&&/^\s*$/.test(r.textBetween(Math.max(0,t.$from.pos-i),Math.min(r.nodeSize,t.$to.pos-i))));}),!n;});for(let n=0;n<c.length;n++){let{$from:r,$to:i}=c[n];if(a){let n=r.pos,o=i.pos,a=r.nodeAfter,c=i.nodeBefore,u=s&&a&&a.isText?/^\s*/.exec(a.text)[0].length:0,d=s&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+u<o&&(n+=u,o-=d),l.addMark(n,o,e.create(t));}else l.removeMark(r.pos,i.pos,e);}o(l.scrollIntoView());}return!0;};}function oW(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1;};}let oK=oW(oT,(e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null;}(e,n);if(!r)return!1;let i=oI(r);if(!i){let n=r.blockRange(),i=n&&rg(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0);}let s=i.nodeBefore;if(oP(e,i,t,-1))return!0;if(0==r.parent.content.size&&(oR(s,"end")||rq.isSelectable(s)))for(let n=r.depth;;n--){let o=rw(e.doc,r.before(n),r.after(n),nx.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(oR(s,"end")?rO.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):rq.create(n.doc,i.pos-s.nodeSize)),t(n.scrollIntoView());}return!0;}if(1==n||r.node(n-1).childCount>1)break;}return!!s.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0);},(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=oI(r);}let o=s&&s.nodeBefore;return!!o&&!!rq.isSelectable(o)&&(t&&t(e.tr.setSelection(rq.create(e.doc,s.pos-o.nodeSize)).scrollIntoView()),!0);}),oH=oW(oT,(e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null;}(e,n);if(!r)return!1;let i=oj(r);if(!i)return!1;let s=i.nodeAfter;if(oP(e,i,t,1))return!0;if(0==r.parent.content.size&&(oR(s,"start")||rq.isSelectable(s))){let n=rw(e.doc,r.before(),r.after(),nx.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(oR(s,"start")?rO.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):rq.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView());}return!0;}}return!!s.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0);},(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=oj(r);}let o=s&&s.nodeAfter;return!!o&&!!rq.isSelectable(o)&&(t&&t(e.tr.setSelection(rq.create(e.doc,s.pos)).scrollIntoView()),!0);}),oJ={Enter:oW((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0);},oO,oz,oB),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=oF(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(rO.near(i.doc.resolve(r),1)),t(i.scrollIntoView());}return!0;},Backspace:oK,"Mod-Backspace":oK,"Shift-Backspace":oK,Delete:oH,"Mod-Delete":oH,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new rU(e.doc))),!0)},oG={"Ctrl-h":oJ.Backspace,"Alt-Backspace":oJ["Mod-Backspace"],"Ctrl-d":oJ.Delete,"Ctrl-Alt-Backspace":oJ["Mod-Delete"],"Alt-Delete":oJ["Mod-Delete"],"Alt-d":oJ["Mod-Delete"],"Ctrl-a":o$,"Ctrl-e":oq};for(let e in oJ)oG[e]=oJ[e];let oZ=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?oG:oJ;var oQ=function(){};oQ.prototype.append=function(e){return e.length?(e=oQ.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this;},oQ.prototype.prepend=function(e){return e.length?oQ.from(e).append(this):this;},oQ.prototype.appendInner=function(e){return new oX(this,e);},oQ.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?oQ.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t));},oQ.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e);},oQ.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0);},oQ.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n));},t,n),r;},oQ.from=function(e){return e instanceof oQ?e:e&&e.length?new oY(e):oQ.empty;};var oY=function(e){function t(t){e.call(this),this.values=t;}t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values;},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n));},t.prototype.getInner=function(e){return this.values[e];},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1;},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1;},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()));},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values));},n.length.get=function(){return this.values.length;},n.depth.get=function(){return 0;},Object.defineProperties(t.prototype,n),t;}(oQ);oQ.empty=new oY([]);var oX=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1;}return t.__proto__=e,t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten());},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length);},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))return!1;},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))return!1;},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n));},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n);},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right);},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e);},t;}(oQ);class o0{constructor(e,t){this.items=e,this.eventCount=t;}popEvent(e,t){let n,r,i,s;if(0==this.eventCount)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break;}t&&(r=(n=this.remapping(o,this.items.length)).maps.length);let a=e.tr,l=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(o,t+1)).maps.length),r--,c.push(e);return;}if(n){c.push(new o1(e.map));let t=e.step.map(n.slice(r)),i;t&&a.maybeStep(t).doc&&(i=a.mapping.maps[a.mapping.maps.length-1],l.push(new o1(i,void 0,void 0,l.length+c.length))),r--,i&&n.appendMap(i,r);}else a.maybeStep(e.step);if(e.selection)return i=n?e.selection.map(n.slice(r)):e.selection,s=new o0(this.items.slice(0,o).append(c.reverse().concat(l)),this.eventCount-1),!1;},this.items.length,0),{remaining:s,transform:a,selection:i};}addTransform(e,t,n,r){var i,s;let o,a=[],l=this.eventCount,c=this.items,u=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let i=e.steps[n].invert(e.docs[n]),s=new o1(e.mapping.maps[n],i,t),o;(o=u&&u.merge(s))&&(s=o,n?a.pop():c=c.slice(0,c.length-1)),a.push(s),t&&(l++,t=void 0),r||(u=s);}let d=l-n.depth;return d>o3&&(i=c,s=d,i.forEach((e,t)=>{if(e.selection&&0==s--)return o=t,!1;}),c=i.slice(o),l-=d),new o0(c.append(a),l);}remapping(e,t){let n=new rr();return this.items.forEach((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i);},e,t),n;}addMaps(e){return 0==this.eventCount?this:new o0(this.items.append(e.map(e=>new o1(e))),this.eventCount);}rebased(e,t){if(!this.eventCount)return this;t=Math.min(this.items.length,t);let n=[],r=this.items.length-t,i=e.mapping,s=e.steps.length,o=this.eventCount;this.items.forEach(e=>{e.selection&&o--;},r);let a=t;this.items.forEach(t=>{let r=i.getMirror(--a);if(null==r)return;s=Math.min(s,r);let l=i.maps[r];if(t.step){let s=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&o++,n.push(new o1(l,s,c));}else n.push(new o1(l));},r);let l=[];for(let e=t;e<s;e++)l.push(new o1(i.maps[e]));let c=new o0(this.items.slice(0,r).append(l).append(n),o);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c;}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++;}),e;}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach((s,o)=>{if(o>=e)r.push(s),s.selection&&i++;else if(s.step){let e=s.step.map(t.slice(n)),o=e&&e.getMap();if(n--,o&&t.appendMap(o,n),e){let a=s.selection&&s.selection.map(t.slice(n));a&&i++;let l=new o1(o.invert(),e,a),c,u=r.length-1;(c=r.length&&r[u].merge(l))?r[u]=c:r.push(l);}}else s.map&&n--;},this.items.length,0),new o0(oQ.from(r.reverse()),i);}}o0.empty=new o0(oQ.empty,0);class o1{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r;}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new o1(t.getMap().invert(),t,this.selection);}}}class o2{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i;}}let o3=20;function o6(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t;}function o5(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s);}return n;}let o4=!1,o9=null;function o8(e){let t=e.plugins;if(o9!=t){o4=!1,o9=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){o4=!0;break;}}return o4;}let o7=new r3("history"),ae=new r3("closeHistory");function at(e,t){return(n,r)=>{let i=o7.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let s=function(e,t,n){let r=o8(t),i=o7.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),l=new o2(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(o7,{redo:n,historyState:l});}(i,n,e);s&&r(t?s.scrollIntoView():s);}return!0;};}let an=at(!1,!0),ar=at(!0,!0);at(!1,!1),at(!0,!1);class ai{constructor(e,t,n={}){var r;this.match=e,this.match=e,this.handler="string"==typeof t?(r=t,function(e,t,n,i){let s=r;if(t[1]){let e=t[0].lastIndexOf(t[1]);s+=t[0].slice(e+t[1].length);let r=(n+=e)-i;r>0&&(s=t[0].slice(e-r,e)+s,n=i);}return e.tr.insertText(s,n,i);}):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark;}}function as(e,t,n,r,i,s){if(e.composing)return!1;let o=e.state,a=o.doc.resolve(t),l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c<i.length;c++){let u=i[c];if(!u.inCodeMark&&a.marks().some(e=>e.type.spec.code))continue;if(a.parent.type.spec.code){if(!u.inCode)continue;}else if("only"===u.inCode)continue;let d=u.match.exec(l);if(!d||d[0].length<r.length)continue;let h=t-(d[0].length-r.length);if(!u.inCodeMark){let e=!1;if(o.doc.nodesBetween(h,a.pos,t=>{t.isInline&&t.marks.some(e=>e.type.spec.code)&&(e=!0);}),e)continue;}let p=u.handler(o,d,h,n);if(p)return u.undoable&&p.setMeta(s,{transform:p,from:t,to:n,text:r}),e.dispatch(p),!0;}return!1;}let ao=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){let n=e.tr,r=s.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(s.text){let t=n.doc.resolve(s.from).marks();n.replaceWith(s.from,s.to,e.schema.text(s.text,t));}else n.delete(s.from,s.to);t(n);}return!0;}}return!1;};function aa(e,t,n=null,r){return new ai(e,(e,i,s,o)=>{let a=n instanceof Function?n(i):n,l=e.tr.delete(s,o),c=l.doc.resolve(s).blockRange(),u=c&&function(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null;}(e,t),s=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let a=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?o:null;}(r,t);return s?i.map(rv).concat({type:t,attrs:n}).concat(s.map(rv)):null;}(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(s-1).nodeBefore;return d&&d.type==t&&rx(l.doc,s-1)&&(!r||r(i,d))&&l.join(s-1),l;});}new ai(/--$/,"—",{inCodeMark:!1}),new ai(/\.\.\.$/,"…",{inCodeMark:!1}),new ai(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new ai(/"$/,"”",{inCodeMark:!1}),new ai(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new ai(/'$/,"’",{inCodeMark:!1});for(var al={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ac={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},au="u">typeof navigator&&/Mac/.test(navigator.platform),ad="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ah=0;ah<10;ah++)al[48+ah]=al[96+ah]=String(ah);for(var ah=1;ah<=24;ah++)al[ah+111]="F"+ah;for(var ah=65;ah<=90;ah++)al[ah]=String.fromCharCode(ah+32),ac[ah]=String.fromCharCode(ah);for(var ap in al)ac.hasOwnProperty(ap)||(ac[ap]=al[ap]);let af="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),am="u">typeof navigator&&/Win/.test(navigator.platform);function ag(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e;}function av(e){let t;return new r0({props:{handleKeyDown:(t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,s=e.split(/-(?!$)/),o=s[s.length-1];"Space"==o&&(o=" ");for(let e=0;e<s.length-1;e++){let o=s[e];if(/^(cmd|meta|m)$/i.test(o))i=!0;else if(/^a(lt)?$/i.test(o))t=!0;else if(/^(c|ctrl|control)$/i.test(o))n=!0;else if(/^s(hift)?$/i.test(o))r=!0;else if(/^mod$/i.test(o))af?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+o);}return t&&(o="Alt-"+o),n&&(o="Ctrl-"+o),i&&(o="Meta-"+o),r&&(o="Shift-"+o),o;}(n)]=e[n];return t;}(e),function(e,n){var r;let i=("Esc"==(r=!(au&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||ad&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?ac:al)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),s,o=t[ag(i,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[ag(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0;}if((n.altKey||n.metaKey||n.ctrlKey)&&!(am&&n.ctrlKey&&n.altKey)&&(s=al[n.keyCode])&&s!=i){let r=t[ag(s,n)];if(r&&r(e.state,e.dispatch,e))return!0;}}return!1;})}});}function ay(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return!!s&&(!n||(r.node(s.depth-1).type==e?function(e,t,n,r){let i=e.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new rp(s-1,o,s,o,new nx(nm.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new nR(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let a=rg(r);if(null==a)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(s,-1)-1);return rx(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0;}(t,n,e,s):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,s=n.startIndex;t>s;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+ +!a,u+1,o.content.append(l?nm.empty:nm.from(i))))return!1;let d=s.pos,h=d+o.nodeSize;return r.step(new rp(d-!!a,h+ +!!l,d+1,h-1,new nx((a?nm.empty:nm.from(i.copy(nm.empty))).append(l?nm.empty:nm.from(i.copy(nm.empty))),+!a,+!l),+!a)),t(r.scrollIntoView()),!0;}(t,n,s)));};}let ak={};function ab(e,t){"string"!=typeof t&&(t=ab.defaultChars);let n=function(e){let t=ak[e];if(t)return t;t=ak[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n);}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2);}return t;}(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t="";for(let r=0,i=e.length;r<i;r+=3){let s=parseInt(e.slice(r+1,r+3),16);if(s<128){t+=n[s];continue;}if((224&s)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((192&n)==128){let e=s<<6&1984|63&n;e<128?t+="��":t+=String.fromCharCode(e),r+=3;continue;}}if((240&s)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((192&n)==128&&(192&i)==128){let e=s<<12&61440|n<<6&4032|63&i;e<2048||e>=55296&&e<=57343?t+="���":t+=String.fromCharCode(e),r+=6;continue;}}if((248&s)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((192&n)==128&&(192&i)==128&&(192&o)==128){let e=s<<18&1835008|n<<12&258048|i<<6&4032|63&o;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue;}}t+="�";}return t;});}ab.defaultChars=";/?:@&=+$,#",ab.componentChars="";let ax={};function aw(e,t,n){"string"!=typeof t&&(n=t,t=aw.defaultChars),void 0===n&&(n=!0);let r=function(e){let t=ax[e];if(t)return t;t=ax[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t;}(t),i="";for(let t=0,s=e.length;t<s;t++){let o=e.charCodeAt(t);if(n&&37===o&&t+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue;}if(o<128){i+=r[o];continue;}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<s){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue;}}i+="%EF%BF%BD";continue;}i+=encodeURIComponent(e[t]);}return i;}function aC(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"";}function aS(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null;}aw.defaultChars=";/?:@&=+$,-_.!~*'()#",aw.componentChars="-_.!~*'()";let aD=/^([a-z0-9.+-]+:)/i,aA=/:[0-9]*$/,aE=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,aM=["%","/","?",";","#"].concat(["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]))),aN=["/","?","#"],a_=/^[+a-z0-9A-Z_-]{0,63}$/,aT=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,aR={javascript:!0,"javascript:":!0},aI={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};aS.prototype.parse=function(e,t){let n,r,i,s=e;if(s=s.trim(),!t&&1===e.split("#").length){let e=aE.exec(s);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this;}let o=aD.exec(s);if(o&&(n=(o=o[0]).toLowerCase(),this.protocol=o,s=s.substr(o.length)),(t||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===s.substr(0,2))&&!(o&&aR[o])&&(s=s.substr(2),this.slashes=!0),!aR[o]&&(i||o&&!aI[o])){let e,t,n=-1;for(let e=0;e<aN.length;e++)-1!==(r=s.indexOf(aN[e]))&&(-1===n||r<n)&&(n=r);-1!==(t=-1===n?s.lastIndexOf("@"):s.lastIndexOf("@",n))&&(e=s.slice(0,t),s=s.slice(t+1),this.auth=e),n=-1;for(let e=0;e<aM.length;e++)-1!==(r=s.indexOf(aM[e]))&&(-1===n||r<n)&&(n=r);-1===n&&(n=s.length),":"===s[n-1]&&n--;let i=s.slice(0,n);s=s.slice(n),this.parseHost(i),this.hostname=this.hostname||"";let o="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(a_)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(a_)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(aT);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(s=i.join(".")+s),this.hostname=r.join(".");break;}}}}this.hostname.length>255&&(this.hostname=""),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2));}let a=s.indexOf("#");-1!==a&&(this.hash=s.substr(a),s=s.slice(0,a));let l=s.indexOf("?");return-1!==l&&(this.search=s.substr(l),s=s.slice(0,l)),s&&(this.pathname=s),aI[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this;},aS.prototype.parseHost=function(e){let t=aA.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e);};let aj=function(e,t){if(e&&e instanceof aS)return e;let n=new aS();return n.parse(e,t),n;};e.s(["decode",0,ab,"encode",0,aw,"format",0,aC,"parse",0,aj],65555);var aF=e.i(65555);let aO=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,az=/[\0-\x1F\x7F-\x9F]/,aB=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,aP=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,aL=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;e.s(["Any",0,aO,"Cc",0,az,"Cf",0,/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,"P",0,aB,"S",0,aP,"Z",0,aL],7055);var a$=e.i(7055);let aq=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),aV=new Uint16Array("Ȁaglq \x15\x18\x1bɭ\x0f\0\0\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),aU=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),aW=null!=(a=String.fromCodePoint)?a:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|1023&e),t+=String.fromCharCode(e);};function aK(e){return e>=l.ZERO&&e<=l.NINE;}(t=l||(l={}))[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z",(n=c||(c={}))[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE",(r=u||(u={}))[r.EntityStart=0]="EntityStart",r[r.NumericStart=1]="NumericStart",r[r.NumericDecimal=2]="NumericDecimal",r[r.NumericHex=3]="NumericHex",r[r.NamedEntity=4]="NamedEntity",(i=d||(d={}))[i.Legacy=0]="Legacy",i[i.Strict=1]="Strict",i[i.Attribute=2]="Attribute";class aH{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=u.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=d.Strict;}startEntity(e){this.decodeMode=e,this.state=u.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1;}write(e,t){switch(this.state){case u.EntityStart:if(e.charCodeAt(t)===l.NUM)return this.state=u.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1);return this.state=u.NamedEntity,this.stateNamedEntity(e,t);case u.NumericStart:return this.stateNumericStart(e,t);case u.NumericDecimal:return this.stateNumericDecimal(e,t);case u.NumericHex:return this.stateNumericHex(e,t);case u.NamedEntity:return this.stateNamedEntity(e,t);}}stateNumericStart(e,t){return t>=e.length?-1:(32|e.charCodeAt(t))===l.LOWER_X?(this.state=u.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=u.NumericDecimal,this.stateNumericDecimal(e,t));}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*Math.pow(r,i)+parseInt(e.substr(t,i),r),this.consumed+=i;}}stateNumericHex(e,t){let n=t;for(;t<e.length;){var r;let i=e.charCodeAt(t);if(!aK(i)&&(!((r=i)>=l.UPPER_A)||!(r<=l.UPPER_F))&&(!(r>=l.LOWER_A)||!(r<=l.LOWER_F)))return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(i,3);t+=1;}return this.addToNumericResult(e,n,t,16),-1;}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(!aK(r))return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2);t+=1;}return this.addToNumericResult(e,n,t,10),-1;}emitNumericEntity(e,t){var n,r,i;if(this.consumed<=t)return null==(n=this.errors)||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===l.SEMI)this.consumed+=1;else if(this.decodeMode===d.Strict)return 0;return this.emitCodePoint((r=this.result)>=55296&&r<=57343||r>1114111?65533:null!=(i=aU.get(r))?i:r,this.consumed),this.errors&&(e!==l.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed;}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&c.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let s=e.charCodeAt(t);if(this.treeIndex=function(e,t,n,r){let i=(t&c.BRANCH_LENGTH)>>7,s=t&c.JUMP_TABLE;if(0===i)return 0!==s&&r===s?n:-1;if(s){let t=r-s;return t<0||t>=i?-1:e[n+t]-1;}let o=n,a=o+i-1;for(;o<=a;){let t=o+a>>>1,n=e[t];if(n<r)o=t+1;else{if(!(n>r))return e[t+i];a=t-1;}}return-1;}(n,r,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return 0===this.result||this.decodeMode===d.Attribute&&(0===i||function(e){var t;return e===l.EQUALS||(t=e)>=l.UPPER_A&&t<=l.UPPER_Z||t>=l.LOWER_A&&t<=l.LOWER_Z||aK(t);}(s))?0:this.emitNotTerminatedNamedEntity();if(0!=(i=((r=n[this.treeIndex])&c.VALUE_LENGTH)>>14)){if(s===l.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==d.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0);}}return-1;}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&c.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),null==(e=this.errors)||e.missingSemicolonAfterCharacterReference(),this.consumed;}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(1===t?r[e]&~c.VALUE_LENGTH:r[e+1],n),3===t&&this.emitCodePoint(r[e+2],n),n;}end(){var e;switch(this.state){case u.NamedEntity:return 0!==this.result&&(this.decodeMode!==d.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case u.NumericDecimal:return this.emitNumericEntity(0,2);case u.NumericHex:return this.emitNumericEntity(0,3);case u.NumericStart:return null==(e=this.errors)||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case u.EntityStart:return 0;}}}function aJ(e){let t="",n=new aH(e,e=>t+=aW(e));return function(e,r){let i=0,s=0;for(;(s=e.indexOf("&",s))>=0;){t+=e.slice(i,s),n.startEntity(r);let o=n.write(e,s+1);if(o<0){i=s+n.end();break;}i=s+o,s=0===o?i+1:i;}let o=t+e.slice(i);return t="",o;};}let aG=aJ(aq);aJ(aV);let aZ=new Map([[34,"&quot;"],[38,"&amp;"],[39,"&apos;"],[60,"&lt;"],[62,"&gt;"]]);function aQ(e,t){return function(n){let r,i=0,s="";for(;r=e.exec(n);)i!==r.index&&(s+=n.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+n.substring(i);};}String.prototype.codePointAt,aQ(/[&<>'"]/g,aZ),aQ(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),aQ(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),(s=h||(h={}))[s.XML=0]="XML",s[s.HTML=1]="HTML",(o=p||(p={}))[o.UTF8=0]="UTF8",o[o.ASCII=1]="ASCII",o[o.Extensive=2]="Extensive",o[o.Attribute=3]="Attribute",o[o.Text=4]="Text";let aY=Object.prototype.hasOwnProperty;function aX(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){if(t){if("object"!=typeof t)throw TypeError(t+"must be object");Object.keys(t).forEach(function(n){e[n]=t[n];});}}),e;}function a0(e){return(!(e>=55296)||!(e<=57343))&&(!(e>=64976)||!(e<=65007))&&(65535&e)!=65535&&(65535&e)!=65534&&(!(e>=0)||!(e<=8))&&11!==e&&(!(e>=14)||!(e<=31))&&(!(e>=127)||!(e<=159))&&!(e>1114111)&&!0;}function a1(e){return e>65535?String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e)):String.fromCharCode(e);}let a2=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,a3=RegExp(a2.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),a6=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function a5(e){return 0>e.indexOf("\\")&&0>e.indexOf("&")?e:e.replace(a3,function(e,t,n){if(t)return t;if(35===n.charCodeAt(0)&&a6.test(n)){let t="x"===n[1].toLowerCase()?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return a0(t)?a1(t):e;}let r=function(e,t=d.Legacy){return aG(e,t);}(e);return r!==e?r:e;});}let a4=/[&<>"]/,a9=/[&<>"]/g,a8={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function a7(e){return a8[e];}function le(e){return a4.test(e)?e.replace(a9,a7):e;}let lt=/[.?*+^$[\]\\(){}|-]/g;function ln(e){switch(e){case 9:case 32:return!0;}return!1;}function lr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0;}return!1;}function li(e){return aB.test(e)||aP.test(e);}function ls(e){return li(a1(e));}function lo(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1;}}function la(e){return(e=e.trim().replace(/\s+/g," ")).toLowerCase().toUpperCase();}function ll(e){return 32===e||9===e||10===e||13===e;}function lc(e){let t=0;for(;t<e.length&&ll(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&ll(e.charCodeAt(n));n--);return e.slice(t,n+1);}e.s(["arrayReplaceAt",0,function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1));},"asciiTrim",0,lc,"assign",0,aX,"escapeHtml",0,le,"escapeRE",0,function(e){return e.replace(lt,"\\$&");},"fromCodePoint",0,a1,"has",0,function(e,t){return aY.call(e,t);},"isMdAsciiPunct",0,lo,"isPunctChar",0,li,"isPunctCharCode",0,ls,"isSpace",0,ln,"isString",0,function(e){return"[object String]"===Object.prototype.toString.call(e);},"isValidEntityCode",0,a0,"isWhiteSpace",0,lr,"lib",0,{mdurl:aF,ucmicro:a$},"normalizeReference",0,la,"unescapeAll",0,a5,"unescapeMd",0,function(e){return 0>e.indexOf("\\")?e:e.replace(a2,"$1");}],37422);var lu=e.i(37422);e.s(["parseLinkDestination",0,function(e,t,n){let r,i=t,s={ok:!1,pos:0,str:""};if(60===e.charCodeAt(i)){for(i++;i<n&&10!==(r=e.charCodeAt(i))&&60!==r;){if(62===r){s.pos=i+1,s.str=a5(e.slice(t+1,i)),s.ok=!0;break;}if(92===r&&i+1<n){i+=2;continue;}i++;}return s;}let o=0;for(;i<n&&32!==(r=e.charCodeAt(i))&&!(r<32)&&127!==r;){if(92===r&&i+1<n){if(32===e.charCodeAt(i+1)){i++;continue;}i+=2;continue;}if(40===r&&++o>32)return s;if(41===r){if(0===o)break;o--;}i++;}return t===i||0!==o||(s.str=a5(e.slice(t,i)),s.pos=i,s.ok=!0),s;},"parseLinkLabel",0,function(e,t,n){let r,i,s,o,a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(93===(s=e.src.charCodeAt(e.pos))&&0==--r){i=!0;break;}if(o=e.pos,e.md.inline.skipToken(e),91===s){if(o===e.pos-1)r++;else if(n)return e.pos=l,-1;}}let c=-1;return i&&(c=e.pos),e.pos=l,c;},"parseLinkTitle",0,function(e,t,n,r){let i,s=t,o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let r=e.charCodeAt(s);if(34!==r&&39!==r&&40!==r)return o;t++,s++,40===r&&(r=41),o.marker=r;}for(;s<n;){if((i=e.charCodeAt(s))===o.marker)return o.pos=s+1,o.str+=a5(e.slice(t,s)),o.ok=!0,o;if(40===i&&41===o.marker)return o;92===i&&s+1<n&&s++,s++;}return o.can_continue=!0,o.str+=a5(e.slice(t,s)),o;}],39414);var ld=e.i(39414);let lh={};function lp(){this.rules=aX({},lh);}function lf(){this.__rules__=[],this.__cache__=null;}function lm(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1;}function lg(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t;}lh.code_inline=function(e,t,n,r,i){let s=e[t];return"<code"+i.renderAttrs(s)+">"+le(s.content)+"</code>";},lh.code_block=function(e,t,n,r,i){let s=e[t];return"<pre"+i.renderAttrs(s)+"><code>"+le(e[t].content)+"</code></pre>\n";},lh.fence=function(e,t,n,r,i){let s,o=e[t],a=o.info?a5(o.info).trim():"",l="",c="";if(a){let e=a.split(/(\s+)/g);l=e[0],c=e.slice(2).join("");}if(0===(s=n.highlight&&n.highlight(o.content,l,c)||le(o.content)).indexOf("<pre"))return s+"\n";if(a){let e=o.attrIndex("class"),t=o.attrs?o.attrs.slice():[];return e<0?t.push(["class",n.langPrefix+l]):(t[e]=t[e].slice(),t[e][1]+=" "+n.langPrefix+l),`<pre><code${i.renderAttrs({attrs:t})}>${s}</code></pre>
3
3
  `;}return`<pre><code${i.renderAttrs(o)}>${s}</code></pre>
4
4
  `;},lh.image=function(e,t,n,r,i){let s=e[t];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(e,t,n);},lh.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n";},lh.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n";},lh.text=function(e,t){return le(e[t].content);},lh.html_block=function(e,t){return e[t].content;},lh.html_inline=function(e,t){return e[t].content;},lp.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(t=0,r="",n=e.attrs.length;t<n;t++)r+=" "+le(e.attrs[t][0])+'="'+le(e.attrs[t][1])+'"';return r;},lp.prototype.renderToken=function(e,t,n){let r=e[t],i="";if(r.hidden)return"";r.block&&-1!==r.nesting&&t&&e[t-1].hidden&&(i+="\n"),i+=(-1===r.nesting?"</":"<")+r.tag,i+=this.renderAttrs(r),0===r.nesting&&n.xhtmlOut&&(i+=" /");let s=!1;if(r.block&&(s=!0,1===r.nesting&&t+1<e.length)){let n=e[t+1];"inline"===n.type||n.hidden?s=!1:-1===n.nesting&&n.tag===r.tag&&(s=!1);}return i+(s?">\n":">");},lp.prototype.renderInline=function(e,t,n){let r="",i=this.rules;for(let s=0,o=e.length;s<o;s++){let o=e[s].type;void 0!==i[o]?r+=i[o](e,s,t,n,this):r+=this.renderToken(e,s,t);}return r;},lp.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,s=e.length;i<s;i++)switch(e[i].type){case"text":case"html_inline":case"html_block":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"softbreak":case"hardbreak":r+="\n";}return r;},lp.prototype.render=function(e,t,n){let r="",i=this.rules;for(let s=0,o=e.length;s<o;s++){let o=e[s].type;"inline"===o?r+=this.renderInline(e[s].children,t,n):void 0!==i[o]?r+=i[o](e,s,t,n,this):r+=this.renderToken(e,s,t,n);}return r;},lf.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1;},lf.prototype.__compile__=function(){let e=this,t=[""];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){0>t.indexOf(e)&&t.push(e);});}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){!n.enabled||t&&0>n.alt.indexOf(t)||e.__cache__[t].push(n.fn);});});},lf.prototype.at=function(e,t,n){let r=this.__find__(e);if(-1===r)throw Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=(n||{}).alt||[],this.__cache__=null;},lf.prototype.before=function(e,t,n,r){let i=this.__find__(e);if(-1===i)throw Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:(r||{}).alt||[]}),this.__cache__=null;},lf.prototype.after=function(e,t,n,r){let i=this.__find__(e);if(-1===i)throw Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:(r||{}).alt||[]}),this.__cache__=null;},lf.prototype.push=function(e,t,n){this.__rules__.push({name:e,enabled:!0,fn:t,alt:(n||{}).alt||[]}),this.__cache__=null;},lf.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error("Rules manager: invalid rule name "+e);}this.__rules__[r].enabled=!0,n.push(e);},this),this.__cache__=null,n;},lf.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1;}),this.enable(e,t);},lf.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error("Rules manager: invalid rule name "+e);}this.__rules__[r].enabled=!1,n.push(e);},this),this.__cache__=null,n;},lf.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[];},lm.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1;},lm.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e];},lm.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r;},lm.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n;},lm.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t;},lg.prototype.Token=lm;let lv=/\r\n?|\n/g,ly=/\0/g,lk=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,lb=/\((c|tm|r)\)/i,lx=/\((c|tm|r)\)/ig,lw={c:"©",r:"®",tm:"™"};function lC(e,t){return lw[t.toLowerCase()];}let lS=/['"]/,lD=/['"]/g;function lA(e,t,n){for(;e.length>n;){let n=e.pop();n.isSingleQuote?t.single=n.prevSameQuoteIdx:t.double=n.prevSameQuoteIdx;}}function lE(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r});}let lM=[["normalize",function(e){let t;t=(t=e.src.replace(lv,"\n")).replace(ly,"�"),e.src=t;}],["block",function(e){let t;e.inlineMode?((t=new e.Token("inline","",0)).content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens);}],["inline",function(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];"inline"===r.type&&e.md.inline.parse(r.content,e.md,e.env,r.children);}}],["linkify",function(e){let t=e.tokens;if(e.md.options.linkify)for(let i=0,s=t.length;i<s;i++){if("inline"!==t[i].type||!e.md.linkify.pretest(t[i].content))continue;let s=t[i].children,o=[],a=0;for(let t=s.length-1;t>=0;t--){let i=s[t];if("link_close"===i.type){for(t--;s[t].level!==i.level&&"link_open"!==s[t].type;)t--;continue;}if("html_inline"===i.type){var n,r;n=i.content,/^<a[>\s]/i.test(n)&&a>0&&a--,r=i.content,/^<\/a\s*>/i.test(r)&&a++;}if(!(a>0)&&"text"===i.type&&e.md.linkify.test(i.content)){let n=i.content,r=e.md.linkify.match(n),a=[],l=i.level,c=0;r.length>0&&0===r[0].index&&t>0&&"text_special"===s[t-1].type&&(r=r.slice(1));for(let t=0;t<r.length;t++){let i=r[t].url,s=e.md.normalizeLink(i);if(!e.md.validateLink(s))continue;let o=r[t].text;o=r[t].schema?"mailto:"!==r[t].schema||/^mailto:/i.test(o)?e.md.normalizeLinkText(o):e.md.normalizeLinkText("mailto:"+o).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+o).replace(/^http:\/\//,"");let u=r[t].index;if(u>c){let t=new e.Token("text","",0);t.content=n.slice(c,u),t.level=l,a.push(t);}let d=new e.Token("link_open","a",1);d.attrs=[["href",s]],d.level=l++,d.markup="linkify",d.info="auto",a.push(d);let h=new e.Token("text","",0);h.content=o,h.level=l,a.push(h);let p=new e.Token("link_close","a",-1);p.level=--l,p.markup="linkify",p.info="auto",a.push(p),c=r[t].lastIndex;}if(c<n.length){let t=new e.Token("text","",0);t.content=n.slice(c),t.level=l,a.push(t);}o.push({index:t,nodes:a});}}if(o.length>0){let e=s.length;for(let t of o)e+=t.nodes.length-1;let n=Array(e),r=0,a=0;o.reverse();for(let e=0;e<s.length;e++){let t=o[r];if((t===null||t===void 0?void 0:t.index)===e){for(let e of t.nodes)n[a++]=e;r++;}else n[a++]=s[e];}t[i].children=n;}}}],["replacements",function(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&(lb.test(e.tokens[t].content)&&function(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];"text"!==r.type||t||(r.content=r.content.replace(lx,lC)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++;}}(e.tokens[t].children),lk.test(e.tokens[t].content)&&function(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];"text"===r.type&&!t&&lk.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++;}}(e.tokens[t].children));}],["smartquotes",function(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)"inline"===e.tokens[t].type&&lS.test(e.tokens[t].content)&&function(e,t){let n,r=[],i={single:-1,double:-1},s={};for(let o=0;o<e.length;o++){let a=e[o],l=e[o].level;for(n=r.length-1;n>=0&&!(r[n].level<=l);n--);if(lA(r,i,n+1),"text"!==a.type)continue;let c=a.content,u=0,d=c.length;for(;u<d;){lD.lastIndex=u;let a=lD.exec(c);if(!a)break;let h=!0,p=!0;u=a.index+1;let f="'"===a[0],m=32;if(a.index-1>=0)m=c.charCodeAt(a.index-1);else for(n=o-1;n>=0&&"softbreak"!==e[n].type&&"hardbreak"!==e[n].type;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break;}let g=32;if(u<d)g=c.charCodeAt(u);else for(n=o+1;n<e.length&&"softbreak"!==e[n].type&&"hardbreak"!==e[n].type;n++)if(e[n].content){g=e[n].content.charCodeAt(0);break;}let v=lo(m)||ls(m),y=lo(g)||ls(g),k=lr(m),b=lr(g);if(b?h=!1:y&&!(k||v)&&(h=!1),k?p=!1:v&&!(b||y)&&(p=!1),34===g&&'"'===a[0]&&m>=48&&m<=57&&(p=h=!1),h&&p&&(h=v,p=y),!h&&!p){f&&lE(s,o,a.index,"’");continue;}if(p&&(n=f?i.single:i.double)>=0&&r[n].level===l){let e,l,c=r[n];f?(e=t.md.options.quotes[2],l=t.md.options.quotes[3]):(e=t.md.options.quotes[0],l=t.md.options.quotes[1]),lE(s,o,a.index,l),lE(s,c.tokenIdx,c.contentPos,e),lA(r,i,n);continue;}if(h){if(r.length>=1e3)return;r.push({tokenIdx:o,contentPos:a.index,isSingleQuote:f,level:l,prevSameQuoteIdx:f?i.single:i.double}),f?i.single=r.length-1:i.double=r.length-1;}else p&&f&&lE(s,o,a.index,"’");}}Object.keys(s).forEach(function(t){e[t].content=function(e,t){let n="",r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let s=t[i];n+=e.slice(r,s.pos)+s.ch,r=s.pos+1;}return n+e.slice(r);}(e[t].content,s[t]);});}(e.tokens[t].children,e);}],["text_join",function(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if("inline"!==r[e].type)continue;let i=r[e].children,s=i.length;for(t=0;t<s;t++)"text_special"===i[t].type&&(i[t].type="text");for(t=n=0;t<s;t++)"text"===i[t].type&&t+1<s&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n);}}]];function lN(){this.ruler=new lf();for(let e=0;e<lM.length;e++)this.ruler.push(lM[e][0],lM[e][1]);}function l_(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,s=i.length,o=!1;t<s;t++){let a=i.charCodeAt(t);if(!o)if(ln(a)){n++,9===a?r+=4-r%4:r++;continue;}else o=!0;(10===a||t===s-1)&&(10!==a&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1);}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1;}function lT(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r);}function lR(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),s=!1,o=0,a="";for(;r<n;)124===i&&(s?(a+=e.substring(o,r-1),o=r):(t.push(a+e.substring(o,r)),a="",o=r+1)),s=92===i,r++,i=e.charCodeAt(r);return t.push(a+e.substring(o)),t;}function lI(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return 42!==i&&45!==i&&43!==i||r<n&&!ln(e.src.charCodeAt(r))?-1:r;}function lj(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let s=e.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if((s=e.src.charCodeAt(i++))>=48&&s<=57){if(i-n>=10)return-1;continue;}if(41===s||46===s)break;return-1;}return i<r&&!ln(s=e.src.charCodeAt(i))?-1:i;}function lF(e,t){return Math.min(e.eMarks[t]+1,e.src.length);}function lO(e,t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let s=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){s=!0;break;}if(e.parentType=i,s)return-1;}return e.bMarks[t]+e.tShift[t];}lN.prototype.process=function(e){let t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e);},lN.prototype.State=lg,l_.prototype.push=function(e,t,n){let r=new lm(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r;},l_.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e];},l_.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e;},l_.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&ln(this.src.charCodeAt(e));e++);return e;},l_.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!ln(this.src.charCodeAt(--e)))return e+1;return e;},l_.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e;},l_.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e;},l_.prototype.getLines=function(e,t,n,r){if(e>=t)return"";let i=Array(t-e);for(let s=0,o=e;o<t;o++,s++){let e,a=0,l=this.bMarks[o],c=l;for(e=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<e&&a<n;){let e=this.src.charCodeAt(c);if(ln(e))9===e?a+=4-(a+this.bsCount[o])%4:a++;else if(c-l<this.tShift[o])a++;else break;c++;}a>n?i[s]=Array(a-n+1).join(" ")+this.src.slice(c,e):i[s]=this.src.slice(c,e);}return i.join("");},l_.prototype.Token=lm;let lz="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",lB="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";RegExp("^(?:"+lz+"|"+lB+"|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)");let lP=RegExp("^(?:"+lz+"|"+lB+")"),lL=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp("^</?(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)(?=(\\s|/?>|$))","i"),/^$/,!0],[RegExp(lP.source+"\\s*$"),/^$/,!1]],l$=[["table",function(e,t,n,r){let i;if(t+2>n)return!1;let s=t+1;if(e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)return!1;let o=e.bMarks[s]+e.tShift[s];if(o>=e.eMarks[s])return!1;let a=e.src.charCodeAt(o++);if(124!==a&&45!==a&&58!==a||o>=e.eMarks[s])return!1;let l=e.src.charCodeAt(o++);if(124!==l&&45!==l&&58!==l&&!ln(l)||45===a&&ln(l))return!1;for(;o<e.eMarks[s];){let t=e.src.charCodeAt(o);if(124!==t&&45!==t&&58!==t&&!ln(t))return!1;o++;}let c=lT(e,t+1),u=c.split("|"),d=[];for(let e=0;e<u.length;e++){let t=u[e].trim();if(!t)if(0===e||e===u.length-1)continue;else return!1;if(!/^:?-+:?$/.test(t))return!1;58===t.charCodeAt(t.length-1)?d.push(58===t.charCodeAt(0)?"center":"right"):58===t.charCodeAt(0)?d.push("left"):d.push("");}if(-1===(c=lT(e,t).trim()).indexOf("|")||e.sCount[t]-e.blkIndent>=4)return!1;(u=lR(c)).length&&""===u[0]&&u.shift(),u.length&&""===u[u.length-1]&&u.pop();let h=u.length;if(0===h||h!==d.length)return!1;if(r)return!0;let p=e.parentType;e.parentType="table";let f=e.md.block.ruler.getRules("blockquote"),m=e.push("table_open","table",1),g=[t,0];m.map=g,e.push("thead_open","thead",1).map=[t,t+1],e.push("tr_open","tr",1).map=[t,t+1];for(let t=0;t<u.length;t++){let n=e.push("th_open","th",1);d[t]&&(n.attrs=[["style","text-align:"+d[t]]]);let r=e.push("inline","",0);r.content=u[t].trim(),r.children=[],e.push("th_close","th",-1);}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let v=0;for(s=t+2;s<n&&!(e.sCount[s]<e.blkIndent);s++){let r=!1;for(let t=0,i=f.length;t<i;t++)if(f[t](e,s,n,!0)){r=!0;break;}if(r||!(c=lT(e,s).trim())||e.sCount[s]-e.blkIndent>=4||((u=lR(c)).length&&""===u[0]&&u.shift(),u.length&&""===u[u.length-1]&&u.pop(),(v+=h-u.length)>65536))break;s===t+2&&(e.push("tbody_open","tbody",1).map=i=[t+2,0]),e.push("tr_open","tr",1).map=[s,s+1];for(let t=0;t<h;t++){let n=e.push("td_open","td",1);d[t]&&(n.attrs=[["style","text-align:"+d[t]]]);let r=e.push("inline","",0);r.content=u[t]?u[t].trim():"",r.children=[],e.push("td_close","td",-1);}e.push("tr_close","tr",-1);}return i&&(e.push("tbody_close","tbody",-1),i[1]=s),e.push("table_close","table",-1),g[1]=s,e.parentType=p,e.line=s,!0;},["paragraph","reference"]],["code",function(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue;}if(e.sCount[r]-e.blkIndent>=4){i=++r;continue;}break;}e.line=i;let s=e.push("code_block","code",0);return s.content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",s.map=[t,e.line],!0;}],["fence",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>s)return!1;let o=e.src.charCodeAt(i);if(126!==o&&96!==o)return!1;let a=i,l=(i=e.skipChars(i,o))-a;if(l<3)return!1;let c=e.src.slice(a,i),u=e.src.slice(i,s);if(96===o&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,h=!1;for(;!(++d>=n)&&(!((i=a=e.bMarks[d]+e.tShift[d])<(s=e.eMarks[d]))||!(e.sCount[d]<e.blkIndent));){;if(!(e.src.charCodeAt(i)!==o||e.sCount[d]-e.blkIndent>=4||(i=e.skipChars(i,o))-a<l)&&!((i=e.skipSpaces(i))<s)){h=!0;break;}}l=e.sCount[t],e.line=d+ +!!h;let p=e.push("fence","code",0);return p.info=u,p.content=e.getLines(t+1,d,l,!0),p.markup=c,p.map=[t,e.line],!0;},["paragraph","reference","blockquote","list"]],["blockquote",function(e,t,n,r){let i,s=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||62!==e.src.charCodeAt(s))return!1;if(r)return!0;let l=[],c=[],u=[],d=[],h=e.md.block.ruler.getRules("blockquote"),p=e.parentType;e.parentType="blockquote";let f=!1;for(i=t;i<n;i++){let t=e.sCount[i]<e.blkIndent;if((s=e.bMarks[i]+e.tShift[i])>=(o=e.eMarks[i]))break;if(62===e.src.charCodeAt(s++)&&!t){let t,n,r=e.sCount[i]+1;32===e.src.charCodeAt(s)?(s++,r++,n=!1,t=!0):9===e.src.charCodeAt(s)?(t=!0,(e.bsCount[i]+r)%4==3?(s++,r++,n=!1):n=!0):t=!1;let a=r;for(l.push(e.bMarks[i]),e.bMarks[i]=s;s<o;){let t=e.src.charCodeAt(s);if(ln(t))9===t?a+=4-(a+e.bsCount[i]+ +!!n)%4:a++;else break;s++;}f=s>=o,c.push(e.bsCount[i]),e.bsCount[i]=e.sCount[i]+1+ +!!t,u.push(e.sCount[i]),e.sCount[i]=a-r,d.push(e.tShift[i]),e.tShift[i]=s-e.bMarks[i];continue;}if(f)break;let r=!1;for(let t=0,s=h.length;t<s;t++)if(h[t](e,i,n,!0)){r=!0;break;}if(r){e.lineMax=i,0!==e.blkIndent&&(l.push(e.bMarks[i]),c.push(e.bsCount[i]),d.push(e.tShift[i]),u.push(e.sCount[i]),e.sCount[i]-=e.blkIndent);break;}l.push(e.bMarks[i]),c.push(e.bsCount[i]),d.push(e.tShift[i]),u.push(e.sCount[i]),e.sCount[i]=-1;}let m=e.blkIndent;e.blkIndent=0;let g=e.push("blockquote_open","blockquote",1);g.markup=">";let v=[t,0];g.map=v,e.md.block.tokenize(e,t,i),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=a,e.parentType=p,v[1]=e.line;for(let n=0;n<d.length;n++)e.bMarks[n+t]=l[n],e.tShift[n+t]=d[n],e.sCount[n+t]=u[n],e.bsCount[n+t]=c[n];return e.blkIndent=m,!0;},["paragraph","reference","blockquote","list"]],["hr",function(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(s++);if(42!==o&&45!==o&&95!==o)return!1;let a=1;for(;s<i;){let t=e.src.charCodeAt(s++);if(t!==o&&!ln(t))return!1;t===o&&a++;}if(a<3)return!1;if(r)return!0;e.line=t+1;let l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(o)),!0;},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,r){let i,s,o,a,l,c,u,d=t,h=!0;if(e.sCount[d]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[d]-e.listIndent>=4&&e.sCount[d]<e.blkIndent)return!1;let p=!1;if(r&&"paragraph"===e.parentType&&e.sCount[d]>=e.blkIndent&&(p=!0),(u=lj(e,d))>=0){if(l=!0,o=e.bMarks[d]+e.tShift[d],c=Number(e.src.slice(o,u-1)),p&&1!==c)return!1;}else{if(!((u=lI(e,d))>=0))return!1;l=!1;}if(p&&e.skipSpaces(u)>=e.eMarks[d])return!1;if(r)return!0;let f=e.src.charCodeAt(u-1),m=e.tokens.length;l?(a=e.push("ordered_list_open","ol",1),1!==c&&(a.attrs=[["start",c]])):a=e.push("bullet_list_open","ul",1);let g=[d,0];a.map=g,a.markup=String.fromCharCode(f);let v=!1,y=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";d<n;){let t;s=u,i=e.eMarks[d];let r=e.sCount[d]+u-(e.bMarks[d]+e.tShift[d]),c=r;for(;s<i;){let t=e.src.charCodeAt(s);if(9===t)c+=4-(c+e.bsCount[d])%4;else if(32===t)c++;else break;s++;}let p=s;(t=p>=i?1:c-r)>4&&(t=1);let m=r+t;(a=e.push("list_item_open","li",1)).markup=String.fromCharCode(f);let g=[d,0];a.map=g,l&&(a.info=e.src.slice(o,u-1));let k=e.tight,b=e.tShift[d],x=e.sCount[d],w=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=m,e.tight=!0,e.tShift[d]=p-e.bMarks[d],e.sCount[d]=c,p>=i&&e.isEmpty(d+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,d,n,!0),(!e.tight||v)&&(h=!1),v=e.line-d>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=w,e.tShift[d]=b,e.sCount[d]=x,e.tight=k,(a=e.push("list_item_close","li",-1)).markup=String.fromCharCode(f),d=e.line,g[1]=d,d>=n||e.sCount[d]<e.blkIndent||e.sCount[d]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=y.length;t<r;t++)if(y[t](e,d,n,!0)){C=!0;break;}if(C)break;if(l){if((u=lj(e,d))<0)break;o=e.bMarks[d]+e.tShift[d];}else if((u=lI(e,d))<0)break;if(f!==e.src.charCodeAt(u-1))break;}return(a=l?e.push("ordered_list_close","ol",-1):e.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(f),g[1]=d,e.line=d,e.parentType=k,h&&function(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&"paragraph_open"===e.tokens[r].type&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2);}(e,m),!0;},["paragraph","reference","blockquote"]],["reference",function(e,t,n,r){let i,s=e.src,o=e.bMarks[t]+e.tShift[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||91!==s.charCodeAt(o))return!1;let l=lF(e,t),c="",u=-1,d=++o;for(;o<l;){if(c.length+o-d>1998)return!1;let t=s.charCodeAt(o);if(91===t)return!1;if(93===t){u=o;break;}if(92===t&&(t=s.charCodeAt(++o)),10===t&&o<l){let t=lO(e,a);if(t<0)return!1;c+=s.slice(d,l),o=d=t,l=lF(e,a++);continue;}o++;}if(u<0||58!==s.charCodeAt(u+1)||(c+=s.slice(d,u)).length>999&&function(e){let t=e.length;for(let n=0;n<e.length-1;n++){let r=e.charCodeAt(n);if(r<55296||r>56319)continue;let i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(t--,n++);}return t;}(c)>999)return!1;for(o=u+2;o<l;){let t=s.charCodeAt(o);if(10===t){let t=lO(e,a);if(t<0)break;o=t,l=lF(e,a++);}else if(ln(t))o++;else break;}let h=e.md.helpers.parseLinkDestination(s,o,l);if(!h.ok)return!1;let p=e.md.normalizeLink(h.str);if(!e.md.validateLink(p))return!1;let f=o=h.pos,m=l,g=a;for(;o<l;){let t=s.charCodeAt(o);if(10===t){let t=lO(e,a);if(t<0)break;o=t,l=lF(e,a++);}else if(ln(t))o++;else break;}let v=o,y=e.md.helpers.parseLinkTitle(s,o,l);for(;y.can_continue;){let t=lO(e,a);if(t<0)break;o=t,l=lF(e,a++),y=e.md.helpers.parseLinkTitle(s,o,l,y);}for(v!==f&&y.ok?(i=y.str,o=y.pos):(i="",o=f,l=m,a=g);o<l&&ln(s.charCodeAt(o));)o++;if(o<l&&10!==s.charCodeAt(o)&&i)for(i="",o=f,l=m,a=g;o<l&&ln(s.charCodeAt(o));)o++;if(o<l&&10!==s.charCodeAt(o))return!1;let k=la(c);return!!k&&(!!r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[k]&&(e.env.references[k]={title:i,href:p}),e.line=a,!0));}],["html_block",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||60!==e.src.charCodeAt(i))return!1;let o=e.src.slice(i,s),a=0;for(;a<lL.length&&!lL[a][0].test(o);a++);if(a===lL.length)return!1;if(r)return lL[a][2];let l=t+1,c=lL[a][1].test("");if(!lL[a][1].test(o)){for(;l<n&&(!(e.sCount[l]<e.blkIndent)||!c&&e.isEmpty(l));l++)if(i=e.bMarks[l]+e.tShift[l],s=e.eMarks[l],o=e.src.slice(i,s),lL[a][1].test(o)){0!==o.length&&l++;break;}}e.line=l;let u=e.push("html_block","",0);return u.map=[t,l],u.content=e.getLines(t,l,e.blkIndent,!0),!0;},["paragraph","reference","blockquote"]],["heading",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(35!==o||i>=s)return!1;let a=1;for(o=e.src.charCodeAt(++i);35===o&&i<s&&a<=6;)a++,o=e.src.charCodeAt(++i);if(a>6||i<s&&!ln(o))return!1;if(r)return!0;s=e.skipSpacesBack(s,i);let l=e.skipCharsBack(s,35,i);l>i&&ln(e.src.charCodeAt(l-1))&&(s=l),e.line=t+1;let c=e.push("heading_open","h"+String(a),1);c.markup="########".slice(0,a),c.map=[t,e.line];let u=e.push("inline","",0);return u.content=lc(e.src.slice(i,s)),u.map=[t,e.line],u.children=[],e.push("heading_close","h"+String(a),-1).markup="########".slice(0,a),!0;},["paragraph","reference","blockquote"]],["lheading",function(e,t,n){let r,i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.parentType;e.parentType="paragraph";let o=0,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let t=e.bMarks[a]+e.tShift[a],n=e.eMarks[a];if(t<n&&(45===(r=e.src.charCodeAt(t))||61===r)&&(t=e.skipChars(t,r),(t=e.skipSpaces(t))>=n)){o=61===r?1:2;break;}}if(e.sCount[a]<0)continue;let t=!1;for(let r=0,s=i.length;r<s;r++)if(i[r](e,a,n,!0)){t=!0;break;}if(t)break;}if(!o)return e.parentType=s,!1;let l=lc(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;let c=e.push("heading_open","h"+String(o),1);c.markup=String.fromCharCode(r),c.map=[t,e.line];let u=e.push("inline","",0);return u.content=l,u.map=[t,e.line-1],u.children=[],e.push("heading_close","h"+String(o),-1).markup=String.fromCharCode(r),e.parentType=s,!0;}],["paragraph",function(e,t,n){let r=e.md.block.ruler.getRules("paragraph"),i=e.parentType,s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,s,n,!0)){t=!0;break;}if(t)break;}let o=lc(e.getLines(t,s,e.blkIndent,!1));e.line=s,e.push("paragraph_open","p",1).map=[t,e.line];let a=e.push("inline","",0);return a.content=o,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0;}]];function lq(){this.ruler=new lf();for(let e=0;e<l$.length;e++)this.ruler.push(l$[e][0],l$[e][1],{alt:(l$[e][2]||[]).slice()});}function lV(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.skipHtmlSpecial=!1,this.linkLevel=0;}lq.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(""),i=r.length,s=e.md.options.maxNesting,o=t,a=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n)&&!(e.sCount[o]<e.blkIndent));){if(e.level>=s){e.line=n;break;}let t=e.line,l=!1;for(let s=0;s<i;s++)if(l=r[s](e,o,n,!1)){if(t>=e.line)throw Error("block rule didn't increment state.line");break;}if(!l)throw Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),(o=e.line)<n&&e.isEmpty(o)&&(a=!0,e.line=++o);}},lq.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax);},lq.prototype.State=l_,lV.prototype.pushPending=function(){let e=new lm("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e;},lV.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new lm(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r;},lV.prototype.scanDelims=function(e,t){let n,r=this.posMax,i=this.src.charCodeAt(e);if(0===e)n=32;else if(1===e)(63488&(n=this.src.charCodeAt(0)))==55296&&(n=65533);else if((64512&(n=this.src.charCodeAt(e-1)))==56320){let t=this.src.charCodeAt(e-2);n=(64512&t)==55296?65536+(t-55296<<10)+(n-56320):65533;}else(64512&n)==55296&&(n=65533);let s=e;for(;s<r&&this.src.charCodeAt(s)===i;)s++;let o=s-e,a=s<r?this.src.charCodeAt(s):32;if((64512&a)==55296){let e=this.src.charCodeAt(s+1);a=(64512&e)==56320?65536+(a-55296<<10)+(e-56320):65533;}else(64512&a)==56320&&(a=65533);let l=lo(n)||ls(n),c=lo(a)||ls(a),u=lr(n),d=lr(a),h=!d&&(!c||u||l),p=!u&&(!l||d||c);return{can_open:h&&(t||!p||l),can_close:p&&(t||!h||c),length:o};},lV.prototype.Token=lm;let lU=[];for(let e=0;e<256;e++)lU.push(0);function lW(e,t){let n,r=[],i=t.length;for(let s=0;s<i;s++){let i=t[s];if(126!==i.marker||-1===i.end)continue;let o=t[i.end];(n=e.tokens[i.token]).type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",(n=e.tokens[o.token]).type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[o.token-1].type&&"~"===e.tokens[o.token-1].content&&r.push(o.token-1);}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&"s_close"===e.tokens[i].type;)i++;t!==--i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n);}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){lU[e.charCodeAt(0)]=1;});function lK(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(95!==n.marker&&42!==n.marker||-1===n.end)continue;let i=t[n.end],s=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),a=e.tokens[n.token];a.type=s?"strong_open":"em_open",a.tag=s?"strong":"em",a.nesting=1,a.markup=s?o+o:o,a.content="";let l=e.tokens[i.token];l.type=s?"strong_close":"em_close",l.tag=s?"strong":"em",l.nesting=-1,l.markup=s?o+o:o,l.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[n.end+1].token].content="",r--);}}let lH=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,lJ=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function lG(e){let t=32|e;return t>=97&&t<=122;}let lZ=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,lQ=/^&([a-z][a-z0-9]{1,31});/i;function lY(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,s=[];for(let o=0;o<n;o++){let n=e[o];if(s.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let a=t[n.marker][3*!!n.open+n.length%3],l=r-s[r]-1,c=l;for(;l>a;l-=s[l]+1){let t=e[l];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=l>0&&!e[l-1].open?s[l-1]+1:0;s[o]=o-l+r,s[l]=r,n.open=!1,t.end=o,t.close=!1,c=-1,i=-2;break;}}}-1!==c&&(t[n.marker][3*!!n.open+(n.length||0)%3]=c);}}let lX=[["text",function(e,t){let n=e.pos;for(;n<e.posMax&&!function(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1;}}(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0);}],["linkify",function(e,t){var n,r;if(!e.md.options.linkify||e.linkLevel>0)return!1;let i=e.pos;if(i+3>e.posMax||58!==e.src.charCodeAt(i)||47!==e.src.charCodeAt(i+1)||47!==e.src.charCodeAt(i+2))return!1;let s=i-Math.min(10,e.pending.length,i),o=i;for(;o>s&&((n=e.src.charCodeAt(o-1))>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||43===n||45===n||46===n);)o--;if(o===i||!((r=e.src.charCodeAt(o))>=65&&r<=90||r>=97&&r<=122))return!1;let a=i-o,l=e.md.linkify.matchAtStart(e.src.slice(o));if(!l)return!1;let c=l.url;if(c.length<=a)return!1;let u=c.length;for(;u>0&&42===c.charCodeAt(u-1);)u--;u!==c.length&&(c=c.slice(0,u));let d=e.md.normalizeLink(c);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-a);let t=e.push("link_open","a",1);t.attrs=[["href",d]],t.markup="linkify",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(c);let n=e.push("link_close","a",-1);n.markup="linkify",n.info="auto";}return e.pos+=c.length-a,!0;}],["newline",function(e,t){let n=e.pos;if(10!==e.src.charCodeAt(n))return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&32===e.pending.charCodeAt(r)){if(r>=1&&32===e.pending.charCodeAt(r-1)){let t=r-1;for(;t>=1&&32===e.pending.charCodeAt(t-1);)t--;e.pending=e.pending.slice(0,t),e.push("hardbreak","br",0);}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);}else e.push("softbreak","br",0);for(n++;n<i&&ln(e.src.charCodeAt(n));)n++;return e.pos=n,!0;}],["escape",function(e,t){let n=e.pos,r=e.posMax;if(92!==e.src.charCodeAt(n)||++n>=r)return!1;let i=e.src.charCodeAt(n);if(10===i){for(t||e.push("hardbreak","br",0),n++;n<r&&ln(i=e.src.charCodeAt(n));)n++;return e.pos=n,!0;}if(32===i){if(!t){let t=e.push("text_special","",0);t.content="\\",t.markup="\\",t.info="escape";}return e.pos=n,!0;}let s=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(s+=e.src[n+1],n++);}let o="\\"+s;if(!t){let t=e.push("text_special","",0);i<256&&0!==lU[i]?t.content=s:t.content=o,t.markup=o,t.info="escape";}return e.pos=n+1,!0;}],["backticks",function(e,t){let n,r=e.pos;if(96!==e.src.charCodeAt(r))return!1;let i=r;r++;let s=e.posMax;for(;r<s&&96===e.src.charCodeAt(r);)r++;let o=e.src.slice(i,r),a=o.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=o),e.pos+=a,!0;let l=r;for(;-1!==(n=e.src.indexOf("`",l));){for(l=n+1;l<s&&96===e.src.charCodeAt(l);)l++;let i=l-n;if(i===a){if(!t){let t=e.push("code_inline","code",0);t.markup=o,t.content=e.src.slice(r,n).replace(/\n/g," ").replace(/^ (.+) $/,"$1");}return e.pos=l,!0;}e.backticks[i]=n;}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=a,!0;}],["strikethrough",function(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||126!==r)return!1;let i=e.scanDelims(e.pos,!0),s=i.length,o=String.fromCharCode(r);if(s<2)return!1;s%2&&(e.push("text","",0).content=o,s--);for(let t=0;t<s;t+=2)e.push("text","",0).content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0;}],["emphasis",function(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||95!==r&&42!==r)return!1;let i=e.scanDelims(e.pos,42===r);for(let t=0;t<i.length;t++)e.push("text","",0).content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0;}],["link",function(e,t){let n,r,i,s,o="",a="",l=e.pos,c=!0;if(91!==e.src.charCodeAt(e.pos))return!1;let u=e.pos,d=e.posMax,h=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let f=p+1;if(f<d&&40===e.src.charCodeAt(f)){for(c=!1,f++;f<d&&(ln(n=e.src.charCodeAt(f))||10===n);f++);if(f>=d)return!1;if(l=f,(i=e.md.helpers.parseLinkDestination(e.src,f,e.posMax)).ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?f=i.pos:o="",l=f;f<d&&(ln(n=e.src.charCodeAt(f))||10===n);f++);if(i=e.md.helpers.parseLinkTitle(e.src,f,e.posMax),f<d&&l!==f&&i.ok)for(a=i.str,f=i.pos;f<d&&(ln(n=e.src.charCodeAt(f))||10===n);f++);}(f>=d||41!==e.src.charCodeAt(f))&&(c=!0),f++;}if(c){if(void 0===e.env.references)return!1;if(f<d&&91===e.src.charCodeAt(f)?(l=f+1,(f=e.md.helpers.parseLinkLabel(e,f))>=0?r=e.src.slice(l,f++):f=p+1):f=p+1,r||(r=e.src.slice(h,p)),!(s=e.env.references[la(r)]))return e.pos=u,!1;o=s.href,a=s.title;}if(!t){e.pos=h,e.posMax=p;let t=e.push("link_open","a",1),n=[["href",o]];t.attrs=n,a&&n.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1);}return e.pos=f,e.posMax=d,!0;}],["image",function(e,t){let n,r,i,s,o,a,l,c,u="",d=e.pos,h=e.posMax;if(33!==e.src.charCodeAt(e.pos)||91!==e.src.charCodeAt(e.pos+1))return!1;let p=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if((s=f+1)<h&&40===e.src.charCodeAt(s)){for(s++;s<h&&(ln(n=e.src.charCodeAt(s))||10===n);s++);if(s>=h)return!1;for(c=s,(a=e.md.helpers.parseLinkDestination(e.src,s,e.posMax)).ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?s=a.pos:u=""),c=s;s<h&&(ln(n=e.src.charCodeAt(s))||10===n);s++);if(a=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<h&&c!==s&&a.ok)for(l=a.str,s=a.pos;s<h&&(ln(n=e.src.charCodeAt(s))||10===n);s++);else l="";if(s>=h||41!==e.src.charCodeAt(s))return e.pos=d,!1;s++;}else{if(void 0===e.env.references)return!1;if(s<h&&91===e.src.charCodeAt(s)?(c=s+1,(s=e.md.helpers.parseLinkLabel(e,s))>=0?i=e.src.slice(c,s++):s=f+1):s=f+1,i||(i=e.src.slice(p,f)),!(o=e.env.references[la(i)]))return e.pos=d,!1;u=o.href,l=o.title;}if(!t){r=e.src.slice(p,f);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push("image","img",0),i=[["src",u],["alt",""]];n.attrs=i,n.children=t,n.content=r,l&&i.push(["title",l]);}return e.pos=s,e.posMax=h,!0;}],["autolink",function(e,t){let n=e.pos;if(60!==e.src.charCodeAt(n))return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(60===t)return!1;if(62===t)break;}let s=e.src.slice(r+1,n);if(lJ.test(s)){let n=e.md.normalizeLink(s);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(s);let r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto";}return e.pos+=s.length+2,!0;}if(lH.test(s)){let n=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push("link_open","a",1);t.attrs=[["href",n]],t.markup="autolink",t.info="auto",e.push("text","",0).content=e.md.normalizeLinkText(s);let r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto";}return e.pos+=s.length+2,!0;}return!1;}],["html_inline",function(e,t){let n;if(!e.md.options.html)return!1;let r=e.posMax,i=e.pos;if(60!==e.src.charCodeAt(i)||i+2>=r)return!1;let s=e.src.charCodeAt(i+1);if(33===s||63===s)n=function(e,t){let n,r,i=e.src;if(i.startsWith("<!--",t)){if(i.startsWith(">",t+4))return t+5;if(i.startsWith("->",t+4))return t+6;n=t+4,r="-->";}else if(i.startsWith("<![CDATA[",t))n=t+9,r="]]>";else if(63===i.charCodeAt(t+1))n=t+2,r="?>";else{if(!lG(i.charCodeAt(t+2)))return-1;n=t+3,r=">";}if(e.skipHtmlSpecial)return-1;let s=i.indexOf(r,n);return s<0?(e.skipHtmlSpecial=!0,-1):s+r.length;}(e,i);else{if(!(47===s||lG(s)))return!1;let t=e.src.slice(i).match(lP);n=t?i+t[0].length:-1;}if(n<0)return!1;if(!t){var o,a;let t=e.push("html_inline","",0);t.content=e.src.slice(i,n),o=t.content,/^<a[>\s]/i.test(o)&&e.linkLevel++,a=t.content,/^<\/a\s*>/i.test(a)&&e.linkLevel--;}return e.pos=n,!0;}],["entity",function(e,t){let n=e.pos,r=e.posMax;if(38!==e.src.charCodeAt(n)||n+1>=r)return!1;if(35===e.src.charCodeAt(n+1)){let r=e.src.slice(n).match(lZ);if(r){if(!t){let t="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push("text_special","",0);n.content=a0(t)?a1(t):a1(65533),n.markup=r[0],n.info="entity";}return e.pos+=r[0].length,!0;}}else{let r=e.src.slice(n).match(lQ);if(r){let n=aG(r[0],d.Strict);if(n!==r[0]){if(!t){let t=e.push("text_special","",0);t.content=n,t.markup=r[0],t.info="entity";}return e.pos+=r[0].length,!0;}}}return!1;}]],l0=[["balance_pairs",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;lY(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&lY(t[e].delimiters);}],["strikethrough",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;lW(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&lW(e,t[r].delimiters);}],["emphasis",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;lK(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&lK(e,t[r].delimiters);}],["fragments_join",function(e){let t,n,r=0,i=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,"text"===i[t].type&&t+1<s&&"text"===i[t+1].type?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n);}]];function l1(){this.ruler=new lf();for(let e=0;e<lX.length;e++)this.ruler.push(lX[e][0],lX[e][1]);this.ruler2=new lf();for(let e=0;e<l0.length;e++)this.ruler2.push(l0[e][0],l0[e][1]);}function l2(e){let t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n];});}),e;}function l3(e){return Object.prototype.toString.call(e);}function l6(e){return"[object Function]"===l3(e);}function l5(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&");}l1.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,s=e.cache;if(void 0!==s[t]){e.pos=s[t];return;}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error("inline rule didn't increment state.pos");break;}}else e.pos=e.posMax;!o&&e.pos++,s[t]=e.pos;},l1.prototype.tokenize=function(e){let t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let s=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1)){if(s>=e.pos)throw Error("inline rule didn't increment state.pos");break;}}if(o){if(e.pos>=r)break;continue;}e.pending+=e.src[e.pos++];}e.pending&&e.pushPending();},l1.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let s=this.ruler2.getRules(""),o=s.length;for(let e=0;e<o;e++)s[e](i);},l1.prototype.State=lV;let l4={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},l9={"http:":{validate:function(e,t,n){let r=e.slice(t);return(n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(r))?r.match(n.re.http)[0].length:0;}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){let r=e.slice(t);return(n.re.no_http||(n.re.no_http=RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r))?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0;}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return(n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(r))?r.match(n.re.mailto)[0].length:0;}}},l8="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function l7(){return function(e,t){t.normalize(e);};}function ce(e){var t;let n,r,i=(t=e.__opts__,t=t||{},(n={}).src_Any=aO.source,n.src_Cc=az.source,n.src_Z=aL.source,n.src_P=aB.source,n.src_ZPCc=[n.src_Z,n.src_P,n.src_Cc].join("|"),n.src_ZCc=[n.src_Z,n.src_Cc].join("|"),r="[><|]",n.src_pseudo_letter=`(?:(?!${r}|${n.src_ZPCc})${n.src_Any})`,n.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",n.src_auth=`(?:(?:(?!${n.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,n.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",n.src_host_terminator=`(?=$|${r}|${n.src_ZPCc})(?!${t["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${n.src_ZPCc}))`,n.src_path=`(?:[/?#](?:(?!${n.src_ZCc}|${r}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${n.src_ZCc}|\\]).)*\\]|\\((?:(?!${n.src_ZCc}|[)]).)*\\)|\\{(?:(?!${n.src_ZCc}|[}]).)*\\}|\\"(?:(?!${n.src_ZCc}|["]).)+\\"|\\'(?:(?!${n.src_ZCc}|[']).)+\\'|\\'(?=${n.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${n.src_ZCc}|[.]|$)|`+(t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${n.src_ZCc}|$)|`+`;(?!${n.src_ZCc}|$)|`+`\\!+(?!${n.src_ZCc}|[!]|$)|`+`\\?(?!${n.src_ZCc}|[?]|$)`+")+|\\/)?",n.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',n.src_xn="xn--[a-z0-9\\-]{1,59}",n.src_domain_root="(?:"+n.src_xn+"|"+`${n.src_pseudo_letter}{1,63}`+")",n.src_domain="(?:"+n.src_xn+"|"+`(?:${n.src_pseudo_letter})`+"|"+`(?:${n.src_pseudo_letter}(?:-|${n.src_pseudo_letter}){0,61}${n.src_pseudo_letter})`+")",n.src_host=`(?:(?:(?:(?:${n.src_domain})\\.)*${n.src_domain}))`,n.tpl_host_fuzzy="(?:"+n.src_ip4+"|"+`(?:(?:(?:${n.src_domain})\\.)+(?:%TLDS%))`+")",n.tpl_host_no_ip_fuzzy=`(?:(?:(?:${n.src_domain})\\.)+(?:%TLDS%))`,n.src_host_strict=n.src_host+n.src_host_terminator,n.tpl_host_fuzzy_strict=n.tpl_host_fuzzy+n.src_host_terminator,n.src_host_port_strict=n.src_host+n.src_port+n.src_host_terminator,n.tpl_host_port_fuzzy_strict=n.tpl_host_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_port_no_ip_fuzzy_strict=n.tpl_host_no_ip_fuzzy+n.src_port+n.src_host_terminator,n.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${n.src_ZPCc}|>|$))`,n.tpl_email_fuzzy=`(^|${r}|"|\\(|${n.src_ZCc})(${n.src_email_name}@${n.tpl_host_fuzzy_strict})`,n.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${n.src_ZPCc}))((?![$+<=>^\`||])${n.tpl_host_port_fuzzy_strict}${n.src_path})`,n.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${n.src_ZPCc}))((?![$+<=>^\`||])${n.tpl_host_port_no_ip_fuzzy_strict}${n.src_path})`,e.re=n),s=e.__tlds__.slice();function o(e){return e.replace("%TLDS%",i.src_tlds);}e.onCompile(),e.__tlds_replaced__||s.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),s.push(i.src_xn),i.src_tlds=s.join("|"),i.email_fuzzy=RegExp(o(i.tpl_email_fuzzy),"i"),i.email_fuzzy_global=RegExp(o(i.tpl_email_fuzzy),"ig"),i.link_fuzzy=RegExp(o(i.tpl_link_fuzzy),"i"),i.link_fuzzy_global=RegExp(o(i.tpl_link_fuzzy),"ig"),i.link_no_ip_fuzzy=RegExp(o(i.tpl_link_no_ip_fuzzy),"i"),i.link_no_ip_fuzzy_global=RegExp(o(i.tpl_link_no_ip_fuzzy),"ig"),i.host_fuzzy_test=RegExp(o(i.tpl_host_fuzzy_test),"i");let a=[];function l(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`);}e.__compiled__={},Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(null===n)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===l3(n)){if("[object RegExp]"===l3(n.validate)){var i;i=n.validate,r.validate=function(e,t){let n=e.slice(t);return i.test(n)?n.match(i)[0].length:0;};}else l6(n.validate)?r.validate=n.validate:l(t,n);l6(n.normalize)?r.normalize=n.normalize:n.normalize?l(t,n):r.normalize=l7();return;}"[object String]"===l3(n)?a.push(t):l(t,n);}),a.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize);}),e.__compiled__[""]={validate:null,normalize:l7()};let c=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t];}).map(l5).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${i.src_ZPCc}))(${c})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${i.src_ZPCc}))(${c})`,"ig"),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i");}function ct(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i;}function cn(e,t){if(!(this instanceof cn))return new cn(e,t);!t&&Object.keys(e||{}).reduce(function(e,t){return e||l4.hasOwnProperty(t);},!1)&&(t=e,e={}),this.__opts__=l2({},l4,t),this.__schemas__=l2({},l9,e),this.__compiled__={},this.__tlds__=l8,this.__tlds_replaced__=!1,this.re={},ce(this);}cn.prototype.add=function(e,t){return this.__schemas__[e]=t,ce(this),this;},cn.prototype.set=function(e){return this.__opts__=l2(this.__opts__,e),this;},cn.prototype.test=function(e){let t,n;if(!e.length)return!1;if(this.re.schema_test.test(e)){for((n=this.re.schema_search).lastIndex=0;null!==(t=n.exec(e));)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&null!==e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&null!==e.match(this.re.email_fuzzy));},cn.prototype.pretest=function(e){return this.re.pretest.test(e);},cn.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0;},cn.prototype.match=function(e){let t,n,r,i=[],s=[],o=[],a=[];function l(e,t){return e?t?e.index!==t.index?e.index<t.index?e:t:e.lastIndex>=t.lastIndex?e:t:e:t;}if(!e.length)return null;if(this.re.schema_test.test(e))for((r=this.re.schema_search).lastIndex=0;null!==(t=r.exec(e));)(n=this.testSchemaAt(e,t[2],r.lastIndex))&&s.push({schema:t[2],index:t.index+t[1].length,lastIndex:t.index+t[0].length+n});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for((r=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global).lastIndex=0;null!==(t=r.exec(e));)o.push({schema:"",index:t.index+t[1].length,lastIndex:t.index+t[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for((r=this.re.email_fuzzy_global).lastIndex=0;null!==(t=r.exec(e));)a.push({schema:"mailto:",index:t.index+t[1].length,lastIndex:t.index+t[0].length});let c=[0,0,0],u=0;for(;;){let t=[s[c[0]],a[c[1]],o[c[2]]],n=l(l(t[0],t[1]),t[2]);if(!n)break;if(n===t[0]?c[0]++:n===t[1]?c[1]++:c[2]++,n.index<u)continue;let r=new ct(e,n.schema,n.index,n.lastIndex);this.__compiled__[r.schema].normalize(r,this),i.push(r),u=n.lastIndex;}return i.length?i:null;},cn.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new ct(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r;},cn.prototype.tlds=function(e,t){return(e=Array.isArray(e)?e:[e],t)?this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1];}).reverse():(this.__tlds__=e.slice(),this.__tlds_replaced__=!0),ce(this),this;},cn.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url=`mailto:${e.url}`);},cn.prototype.onCompile=function(){};let cr=/^xn--/,ci=/[^\0-\x7F]/,cs=/[\x2E\u3002\uFF0E\uFF61]/g,co={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},ca=Math.floor,cl=String.fromCharCode;function cc(e){throw RangeError(co[e]);}function cu(e,t){let n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+function(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n;}((e=e.replace(cs,".")).split("."),t).join(".");}let cd=function(e,t){return e+22+75*(e<26)-((0!=t)<<5);},ch=function(e,t,n){let r=0;for(e=n?ca(e/700):e>>1,e+=ca(e/t);e>455;r+=36)e=ca(e/35);return ca(r+36*e/(e+38));},cp=function(e){let t=[],n=e.length,r=0,i=128,s=72,o=e.lastIndexOf("-");o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&cc("not-basic"),t.push(e.charCodeAt(n));for(let l=o>0?o+1:0;l<n;){let o=r;for(let t=1,i=36;;i+=36){var a;l>=n&&cc("invalid-input");let o=(a=e.charCodeAt(l++))>=48&&a<58?26+(a-48):a>=65&&a<91?a-65:a>=97&&a<123?a-97:36;o>=36&&cc("invalid-input"),o>ca((0x7fffffff-r)/t)&&cc("overflow"),r+=o*t;let c=i<=s?1:i>=s+26?26:i-s;if(o<c)break;let u=36-c;t>ca(0x7fffffff/u)&&cc("overflow"),t*=u;}let c=t.length+1;s=ch(r-o,c,0==o),ca(r/c)>0x7fffffff-i&&cc("overflow"),i+=ca(r/c),r%=c,t.splice(r++,0,i);}return String.fromCodePoint(...t);},cf=function(e){let t=[],n=(e=function(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(64512&r)==56320?t.push(((1023&i)<<10)+(1023&r)+65536):(t.push(i),n--);}else t.push(i);}return t;}(e)).length,r=128,i=0,s=72;for(let n of e)n<128&&t.push(cl(n));let o=t.length,a=o;for(o&&t.push("-");a<n;){let n=0x7fffffff;for(let t of e)t>=r&&t<n&&(n=t);let l=a+1;for(let c of(n-r>ca((0x7fffffff-i)/l)&&cc("overflow"),i+=(n-r)*l,r=n,e))if(c<r&&++i>0x7fffffff&&cc("overflow"),c===r){let e=i;for(let n=36;;n+=36){let r=n<=s?1:n>=s+26?26:n-s;if(e<r)break;let i=e-r,o=36-r;t.push(cl(cd(r+i%o,0))),e=ca(i/o);}t.push(cl(cd(e,0))),s=ch(i,l,a===o),i=0,++a;}++i,++r;}return t.join("");},cm={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},cg=/^(vbscript|javascript|file|data):/,cv=/^data:image\/(gif|png|jpeg|webp);/;function cy(e){let t=e.trim().toLowerCase();return!cg.test(t)||cv.test(t);}let ck=["http:","https:","mailto:"];function cb(e){let t=aj(e,!0);if(t.hostname&&(!t.protocol||ck.indexOf(t.protocol)>=0))try{var n;n=t.hostname,t.hostname=cu(n,function(e){return ci.test(e)?"xn--"+cf(e):e;});}catch(e){}return aw(aC(t));}function cx(e){let t=aj(e,!0);if(t.hostname&&(!t.protocol||ck.indexOf(t.protocol)>=0))try{var n;n=t.hostname,t.hostname=cu(n,function(e){return cr.test(e)?cp(e.slice(4).toLowerCase()):e;});}catch(e){}return ab(aC(t),ab.defaultChars+"%");}function cw(e,t){if(!(this instanceof cw))return new cw(e,t);t||lu.isString(e)||(t=e||{},e="default"),this.inline=new l1(),this.block=new lq(),this.core=new lN(),this.renderer=new lp(),this.linkify=new cn(),this.validateLink=cy,this.normalizeLink=cb,this.normalizeLinkText=cx,this.utils=lu,this.helpers=lu.assign({},ld),this.options={},this.configure(e),t&&this.set(t);}cw.prototype.set=function(e){return lu.assign(this.options,e),this;},cw.prototype.configure=function(e){let t=this;if(lu.isString(e)){let t=e;if(!(e=cm[t]))throw Error('Wrong `markdown-it` preset "'+t+'", check name');}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2);}),this;},cw.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0));},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return 0>n.indexOf(e);});if(r.length&&!t)throw Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this;},cw.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0));},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return 0>n.indexOf(e);});if(r.length&&!t)throw Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this;},cw.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this;},cw.prototype.parse=function(e,t){if("string"!=typeof e)throw Error("Input data should be a String");let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens;},cw.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t);},cw.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens;},cw.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t);};let cC=new nG({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["div",["hr"]]},heading:{attrs:{level:{default:1,validate:"number"}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:e=>["h"+ +e.attrs.level,0]},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM:e=>["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")})}],toDOM:e=>["ol",{start:1==e.attrs.order?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM:e=>["ul",{"data-tight":e.attrs.tight?"true":null},0]},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM:()=>["li",0]},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:e=>({src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")})}],toDOM:e=>["img",e.attrs]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>"em"==e.type.name}],toDOM:()=>["em"]},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!=e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>"strong"==e.type.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM:()=>["strong"]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),title:e.getAttribute("title")})}],toDOM:e=>["a",e.attrs]},code:{code:!0,parseDOM:[{tag:"code"}],toDOM:()=>["code"]}}});class cS{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:nk.none}];}top(){return this.stack[this.stack.length-1];}push(e){this.stack.length&&this.top().content.push(e);}addText(e){if(!e)return;let t=this.top(),n=t.content,r=n[n.length-1],i=this.schema.text(e,t.marks),s;r&&(s=function(e,t){if(e.isText&&t.isText&&nk.sameSet(e.marks,t.marks))return e.withText(e.text+t.text);}(r,i))?n[n.length-1]=s:n.push(i);}openMark(e){let t=this.top();t.marks=e.addToSet(t.marks);}closeMark(e){let t=this.top();t.marks=e.removeFromSet(t.marks);}parseTokens(e){for(let t=0;t<e.length;t++){let n=e[t],r=this.tokenHandlers[n.type];if(!r)throw Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,e,t);}}addNode(e,t,n){let r=this.top(),i=e.createAndFill(t,n,r?r.marks:[]);return i?(this.push(i),i):null;}openNode(e,t){this.stack.push({type:e,attrs:t,content:[],marks:nk.none});}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content);}}function cD(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs;}function cA(e,t){return e.noCloseToken||"code_inline"==t||"code_block"==t||"fence"==t;}function cE(e){return"\n"==e[e.length-1]?e.slice(0,e.length-1):e;}function cM(){}class cN{constructor(e,t,n){this.schema=e,this.tokenizer=t,this.tokens=n,this.tokenHandlers=function(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let t=e.nodeType(i.block);cA(i,r)?n[r]=(e,n,r,s)=>{e.openNode(t,cD(i,n,r,s)),e.addText(cE(n.content)),e.closeNode();}:(n[r+"_open"]=(e,n,r,s)=>e.openNode(t,cD(i,n,r,s)),n[r+"_close"]=e=>e.closeNode());}else if(i.node){let t=e.nodeType(i.node);n[r]=(e,n,r,s)=>e.addNode(t,cD(i,n,r,s));}else if(i.mark){let t=e.marks[i.mark];cA(i,r)?n[r]=(e,n,r,s)=>{e.openMark(t.create(cD(i,n,r,s))),e.addText(cE(n.content)),e.closeMark(t);}:(n[r+"_open"]=(e,n,r,s)=>e.openMark(t.create(cD(i,n,r,s))),n[r+"_close"]=e=>e.closeMark(t));}else if(i.ignore)cA(i,r)?n[r]=cM:(n[r+"_open"]=cM,n[r+"_close"]=cM);else throw RangeError("Unrecognized parsing spec "+JSON.stringify(i));}return n.text=(e,t)=>e.addText(t.content),n.inline=(e,t)=>e.parseTokens(t.children),n.softbreak=n.softbreak||(e=>e.addText(" ")),n;}(e,n);}parse(e,t={}){let n=new cS(this.schema,this.tokenHandlers),r;n.parseTokens(this.tokenizer.parse(e,t));do r=n.closeNode();while(n.stack.length);return r||this.schema.topNodeType.createAndFill();}}function c_(e,t){for(;++t<e.length;)if("list_item_open"!=e[t].type)return e[t].hidden;return!1;}let cT=new cN(cC,cw("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:c_(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:c_(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}}),cR={open:"",close:"",mixable:!0};class cI{constructor(e,t,n={}){this.nodes=e,this.marks=t,this.options=n;}serialize(e,t={}){t=Object.assign({},this.options,t);let n=new cO(this.nodes,this.marks,t);return n.renderContent(e),n.out;}}let cj=new cI({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t));},code_block(e,t){let n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||"")+"\n"),e.text(t.textContent,!1),e.write("\n"),e.write(r),e.closeBlock(t);},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t);},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t);},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ");},ordered_list(e,t){var n;let r=null!=(n=t.attrs.order)?n:1,i=String(r+t.childCount-1).length,s=e.repeat(" ",i+2);e.renderList(t,s,t=>{let n=String(r+t);return e.repeat(" ",i-n.length)+n+". ";});},list_item(e,t){e.renderContent(t);},paragraph(e,t){e.renderInline(t),e.closeBlock(t);},image(e,t){e.write("!["+e.esc(t.attrs.alt||"")+"]("+t.attrs.src.replace(/[\(\)]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")");},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type)return void e.write("\\\n");},text(e,t){e.text(t.text,!e.inAutolink);}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open:(e,t,n,r)=>(e.inAutolink=function(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!!r.isText&&r.text==e.attrs.href&&r.marks[r.marks.length-1]==e&&(n==t.childCount-1||!e.isInSet(t.child(n+1).marks));}(t,n,r),e.inAutolink?"<":"["),close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")";},mixable:!0},code:{open:(e,t,n,r)=>cF(n.child(r),-1),close:(e,t,n,r)=>cF(n.child(r-1),1),escape:!1}});function cF(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let s=i>0&&t>0?" `":"`";for(let e=0;e<i;e++)s+="`";return i>0&&t<0&&(s+=" "),s;}class cO{constructor(e,t,n){this.nodes=e,this.marks=t,this.options=n,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,void 0===this.options.tightLists&&(this.options.tightLists=!1),void 0===this.options.hardBreakNodeName&&(this.options.hardBreakNodeName="hard_break");}flushClose(e=2){if(this.closed){if(this.atBlank()||(this.out+="\n"),e>1){let t=this.delim,n=/\s+$/.exec(t);n&&(t=t.slice(0,t.length-n[0].length));for(let n=1;n<e;n++)this.out+=t+"\n";}this.closed=null;}}getMark(e){let t=this.marks[e];if(!t){if(!1!==this.options.strict)throw Error(`Mark type \`${e}\` not supported by Markdown renderer`);t=cR;}return t;}wrapBlock(e,t,n,r){let i=this.delim;this.write(null!=t?t:e),this.delim+=e,r(),this.delim=i,this.closeBlock(n);}atBlank(){return /(^|\n)$/.test(this.out);}ensureNewLine(){this.atBlank()||(this.out+="\n");}write(e){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),e&&(this.out+=e);}closeBlock(e){this.closed=e;}text(e,t=!0){let n=e.split("\n");for(let e=0;e<n.length;e++)this.write(),!t&&"["==n[e][0]&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=t?this.esc(n[e],this.atBlockStart):n[e],e!=n.length-1&&(this.out+="\n");}render(e,t,n){if(this.nodes[e.type.name])this.nodes[e.type.name](this,e,t,n);else if(!1!==this.options.strict)throw Error("Token type `"+e.type.name+"` not supported by Markdown renderer");else!e.type.isLeaf&&(e.type.inlineContent?this.renderInline(e):this.renderContent(e),e.isBlock&&this.closeBlock(e));}renderContent(e){e.forEach((t,n,r)=>this.render(t,e,r));}renderInline(e,t=!0){this.atBlockStart=t;let n=[],r="",i=(t,i,s)=>{let o=t?t.marks:[];t&&t.type.name===this.options.hardBreakNodeName&&(o=o.filter(t=>{if(s+1==e.childCount)return!1;let n=e.child(s+1);return t.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text));}));let a=o.length?o[o.length-1]:null,l=a&&!1===this.getMark(a.type.name).escape,c=o.length-!!l;n:for(let e=0;e<c;e++){let t=o[e];if(!this.getMark(t.type.name).mixable)break;for(let r=0;r<n.length;r++){let i=n[r];if(!this.getMark(i.type.name).mixable)break;if(t.eq(i)){e>r?o=o.slice(0,r).concat(t).concat(o.slice(r,e)).concat(o.slice(e+1,c)):r>e&&(o=o.slice(0,e).concat(o.slice(e+1,r)).concat(t).concat(o.slice(r,c)));continue n;}}}let u=0;for(;u<Math.min(n.length,c)&&o[u].eq(n[u]);)++u;let d=r;if(r="",t&&t.isText&&o.some(e=>{let t=this.getMark(e.type.name);return t&&t.expelEnclosingWhitespace&&!n.some((t,n)=>n<u&&t.eq(e));})){let[e,r,i]=/^(\s*)(.*)$/m.exec(t.text);r&&(d+=r,(t=i?t.withText(i):null)||(o=n));}if(t&&t.isText&&o.some((t,n)=>{let r=this.getMark(t.type.name);return r&&r.expelEnclosingWhitespace&&!this.isMarkAhead(e,s+1,o.slice(0,n+1));})){let[e,i,s]=/^(.*?)(\s*)$/m.exec(t.text);s&&(r=s,(t=i?t.withText(i):null)||(o=n));}if(t||s==e.childCount)for(;u<n.length;)this.text(this.markString(n.pop(),!1,e,s),!1);if(d&&this.text(d),t){for(;n.length<c;){let t=o[n.length];n.push(t),this.text(this.markString(t,!0,e,s),!1),this.atBlockStart=!1;}l&&t.isText?this.text(this.markString(a,!0,e,s)+t.text+this.markString(a,!1,e,s+1),!1):this.render(t,e,s),this.atBlockStart=!1,t.isText&&t.nodeSize>0&&(this.atBlockStart=!1);}};e.forEach(i),i(null,0,e.childCount),this.atBlockStart=!1;}renderList(e,t,n){this.closed&&this.closed.type==e.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=void 0!==e.attrs.tight?e.attrs.tight:this.options.tightLists,i=this.inTightList;this.inTightList=r,e.forEach((i,s,o)=>{o&&r&&this.flushClose(1),this.wrapBlock(t,n(o),e,()=>this.render(i,e,o));}),this.inTightList=i;}esc(e,t=!1){return e=e.replace(/[`*\\~\[\]_]/g,(t,n)=>"_"==t&&n>0&&n+1<e.length&&e[n-1].match(/\w/)&&e[n+1].match(/\w/)?t:"\\"+t),t&&(e=e.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(e=e.replace(this.options.escapeExtraCharacters,"\\$&")),e;}quote(e){let t=-1==e.indexOf('"')?'""':-1==e.indexOf("'")?"''":"()";return t[0]+e+t[1];}repeat(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n;}markString(e,t,n,r){let i=this.getMark(e.type.name),s=t?i.open:i.close;return"string"==typeof s?s:s(this,e,n,r);}getEnclosingWhitespace(e){return{leading:(e.match(/^(\s+)/)||[void 0])[0],trailing:(e.match(/(\s+)$/)||[void 0])[0]};}isMarkAhead(e,t,n){for(;;t++){if(t>=e.childCount)return!1;let r=e.child(t);if(r.type.name!=this.options.hardBreakNodeName)return r.marks.length>=n.length&&nk.sameSet(r.marks.slice(0,n.length),n);t++;}}}let cz=[["typescript",[/\binterface[ \t]{1,16}\w/u,/\b(?:import|export)[ \t]{1,16}type\b/u,/\breadonly[ \t]{1,16}\w{1,128}[ \t]{0,16}:/u,/:[ \t]{0,16}(?:string|number|boolean)\b/u]],["java",[/\bpublic[ \t]{1,16}(?:class|interface)\b/u,/\bimport[ \t]{1,16}java\./u]],["go",[/^package[ \t]{1,16}\w/u,/^func[ \t]{1,16}\w{1,128}\(/u]],["rust",[/\bfn[ \t]{1,16}\w{1,128}\(/u,/\blet[ \t]{1,16}mut\b/u]],["python",[/^(?:async )?def[ \t]{1,16}\w{1,128}\(/u,/^from[ \t]{1,16}\w{1,128} import /u]],["shell",[/^#![^\n]{0,128}\b(?:bash|sh)\b/u,/^(?:echo|printf)\b/u,/^export \w{1,128}=/u]],["sql",[/^SELECT\b/iu,/^CREATE TABLE\b/iu,/^INSERT INTO\b/iu]],["html",[/<!doctype html/iu,/<\/(?:div|span|body|html|p|section)>/iu]],["css",[/^[.#][\w-]{1,128}[ \t]{0,16}\{/u]],["json",[/^[{[][ \t]{0,16}"/u]],["javascript",[/\b(?:const|let|var)[ \t]{1,16}\w{1,128}[ \t]{0,16}=/u,/\bfunction[ \t]{1,16}\w{1,128}[ \t]{0,16}\(/u,/=>/u,/^import .{1,128} from /u]],["yaml",[/^[\w-]{1,128}:[ \t]{0,16}$/u]],["markdown",[/^#{1,6} \S/u,/^[-*] \[[ x]\]/u]]];function cB(e){var _cz$find;let t=e.slice(0,4096).split("\n").map(e=>e.trim());return(_cz$find=cz.find(([,e])=>e.some(e=>t.some(t=>e.test(t)))))===null||_cz$find===void 0?void 0:_cz$find[0];}let cP=new nG({nodes:cC.spec.nodes.update("image",{...cC.spec.nodes.get("image"),toDOM:e=>{var _e$attrs$alt,_e$attrs$src;return["span",{"data-markdown-image":""},`![${String((_e$attrs$alt=e.attrs.alt)!==null&&_e$attrs$alt!==void 0?_e$attrs$alt:"")}](${String((_e$attrs$src=e.attrs.src)!==null&&_e$attrs$src!==void 0?_e$attrs$src:"")}${cL(e.attrs.title)})`];}}),marks:cC.spec.marks.update("link",{...cC.spec.marks.get("link"),toDOM:e=>{var _e$attrs$href;return["span",{"data-markdown-link":""},["span",{},0],["span",{"data-markdown-destination":"",contenteditable:"false"},` (${String((_e$attrs$href=e.attrs.href)!==null&&_e$attrs$href!==void 0?_e$attrs$href:"")}${cL(e.attrs.title)})`]];}})});function cL(e){return"string"==typeof e&&e.length>0?` "${e}"`:"";}let c$=new cN(cP,cT.tokenizer,cT.tokens),cq=new cI({...cj.nodes,text:(e,t)=>{var _t$text;return e.write((_t$text=t.text)!==null&&_t$text!==void 0?_t$text:"");},hard_break:e=>e.write("\n")},cj.marks),cV=new cI({...cq.nodes,code_block:(e,t,n,r)=>{let i=t.attrs.params||cB(t.textContent)||"",s=t.type.create({...t.attrs,params:i},t.content,t.marks);cj.nodes.code_block(e,s,n,r);}},cq.marks);function cU(e){return cV.serialize(e);}function cW(e){let t=[];return e.split("\n").forEach((e,n)=>{n>0&&t.push(cP.node("hard_break")),e&&t.push(cP.text(e));}),cP.node("doc",null,cP.node("paragraph",null,t));}function cK(e){let t=c$.parse(e);return cq.serialize(t)===e?t:cW(e);}function cH(e,t,n){let r=cJ(n),i=0,s=e.doc.content.size;for(;i<s;){let n=Math.floor((i+s)/2),o=rL.near(e.doc.resolve(n));cU(e.tr.insertText(r,o.head).doc).indexOf(r)<t?i=n+1:s=n;}return rL.near(e.doc.resolve(i));}function cJ(e){let t="";for(;e.includes(`${t}`);)t+=t;let n=`${t}`;return t.length>1&&(0,R.v)("Keiko composer cursor marker collision avoided.",{composerActivity:"cursor-collision"}),n;}function cG(e,t){return new ai(e,(e,n,r,i)=>{let s=n[1],o=cP.marks[t];if(!s||!o)return null;let a=e.doc.textBetween(e.selection.$from.start(),r);return"code"!==t&&(s.trim()!==s||function(e){let t=0;for(let n of e.matchAll(/`+/g))0===t?t=n[0].length:t===n[0].length&&(t=0);return t>0;}(a))?((0,R.v)("Keiko composer literal punctuation preserved.",{composerActivity:"literal-input-preserved"}),null):e.tr.insertText(s,r,i).addMark(r,r+s.length,o.create()).removeStoredMark(o);});}let cZ=(e,t)=>{var _i$;let{$from:n,empty:r}=e.selection;if(!r||"paragraph"!==n.parent.type.name)return!1;let i=/^```([\w+-]*)$/.exec(n.parent.textContent),s=cP.nodes.code_block;return!!i&&!!s&&n.parentOffset===n.parent.content.size&&(t!==null&&t!==void 0&&t(e.tr.delete(n.start(),n.end()).setBlockType(n.start(),n.start(),s,{params:(_i$=i[1])!==null&&_i$!==void 0?_i$:""})),!0);},cQ=(e,t)=>{let n=((e,t,_e$storedMarks)=>{let{$from:n,empty:r}=e.selection,i=e.schema.nodes.paragraph,s=e.schema.nodes.list_item;return!!r&&0===n.parentOffset&&!!i&&!!s&&("heading"===n.parent.type.name?oV(i)(e,t):0===n.parent.content.size&&("code_block"===n.parent.type.name?oV(i)(e,t):!!oW(ay(s),oz)(e,t)||0!==((_e$storedMarks=e.storedMarks)!==null&&_e$storedMarks!==void 0?_e$storedMarks:e.selection.$from.marks()).length&&(t!==null&&t!==void 0&&t(e.tr.setStoredMarks([])),!0)));})(e,t);return n&&t&&(0,R.v)("Keiko composer block formatting removed.",{composerActivity:"format-removed"}),n;};function cY(e,t){var _t$clipboardData,_t$clipboardData2;let n=(_t$clipboardData=t.clipboardData)===null||_t$clipboardData===void 0?void 0:_t$clipboardData.getData("text/plain");if(void 0===n)return!1;let r=(_t$clipboardData2=t.clipboardData)!==null&&_t$clipboardData2!==void 0&&(_t$clipboardData2=_t$clipboardData2.types)!==null&&_t$clipboardData2!==void 0&&_t$clipboardData2.includes("text/markdown")?t.clipboardData.getData("text/markdown"):void 0;return n||r?(e.dispatch(e.state.tr.replaceSelection(nx.maxOpen((r?c$.parse(r):cW(n)).content)).scrollIntoView()),!0):((0,R.v)("Keiko composer non-text clipboard left unchanged.",{composerActivity:"non-text-paste-ignored"}),!1);}var cX=e.i(21179);let c0=["plaintext","typescript","javascript","json","python","shell","sql","java","go","rust","yaml","html","css","markdown"],c1={ts:"typescript",js:"javascript",py:"python",bash:"shell",sh:"shell",yml:"yaml",md:"markdown"};function c2(e){var _String$split$,_c1$t;let t=(_String$split$=String(e.attrs.params).split(/\s/)[0])!==null&&_String$split$!==void 0?_String$split$:"";return(_c1$t=c1[t])!==null&&_c1$t!==void 0?_c1$t:t||cB(e.textContent)||"plaintext";}class c3{static create(e,t,n,r){let i=new c3(e,t,n,r);return i.loadEditor(),i;}constructor(e,t,n,r){var _cX$default$cmpCode,_cX$default$cmpCodeHo,_cX$default$cmpNotice;_defineProperty(this,"node",void 0);_defineProperty(this,"view",void 0);_defineProperty(this,"getPos",void 0);_defineProperty(this,"labels",void 0);_defineProperty(this,"dom",void 0);_defineProperty(this,"host",void 0);_defineProperty(this,"fallback",void 0);_defineProperty(this,"notice",void 0);_defineProperty(this,"languageSelect",void 0);_defineProperty(this,"editor",void 0);_defineProperty(this,"disposed",void 0);_defineProperty(this,"updating",void 0);this.node=e,this.view=t,this.getPos=n,this.labels=r,this.dom=document.createElement("div"),this.host=document.createElement("div"),this.fallback=document.createElement("textarea"),this.notice=document.createElement("div"),this.languageSelect=document.createElement("select"),this.disposed=!1,this.updating=!1,this.dom.className=(_cX$default$cmpCode=cX.default.cmpCode)!==null&&_cX$default$cmpCode!==void 0?_cX$default$cmpCode:"",this.dom.contentEditable="false",this.dom.dataset.composerCode="",this.host.className=(_cX$default$cmpCodeHo=cX.default.cmpCodeHost)!==null&&_cX$default$cmpCodeHo!==void 0?_cX$default$cmpCodeHo:"",this.host.dataset.workspaceScrollOwner="virtual",this.notice.className=(_cX$default$cmpNotice=cX.default.cmpNotice)!==null&&_cX$default$cmpNotice!==void 0?_cX$default$cmpNotice:"",this.notice.textContent=r.loading,this.setupFallback(),this.dom.append(this.header(),this.host,this.fallback,this.notice),this.host.hidden=!0;}header(){var _cX$default$cmpCodeHe,_cX$default$cmpLangua,_cX$default$cmpContin;let e=document.createElement("div");e.className=(_cX$default$cmpCodeHe=cX.default.cmpCodeHeader)!==null&&_cX$default$cmpCodeHe!==void 0?_cX$default$cmpCodeHe:"";let t=this.languageSelect;t.className=(_cX$default$cmpLangua=cX.default.cmpLanguage)!==null&&_cX$default$cmpLangua!==void 0?_cX$default$cmpLangua:"",t.setAttribute("aria-label",this.labels.language);let n=c2(this.node);for(let e of(""===this.node.attrs.params&&"plaintext"!==n&&(0,R.v)("Keiko composer code language detected.",{composerActivity:"code-language-detected"}),new Set([...c0,n])))t.add(new Option("plaintext"===e?this.labels.plainText:e,e));t.value=n,t.addEventListener("change",()=>{let e=this.getPos();void 0!==e&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{params:t.value}));});let r=document.createElement("button");return r.type="button",r.className=(_cX$default$cmpContin=cX.default.cmpContinue)!==null&&_cX$default$cmpContin!==void 0?_cX$default$cmpContin:"",r.textContent=this.labels.continueText,r.addEventListener("click",()=>this.exit()),e.append(t,r),e;}setupFallback(){var _cX$default$cmpFallba;this.fallback.className=(_cX$default$cmpFallba=cX.default.cmpFallback)!==null&&_cX$default$cmpFallba!==void 0?_cX$default$cmpFallba:"",this.fallback.setAttribute("aria-label",this.labels.code),this.fallback.spellcheck=!1,this.fallback.value=this.node.textContent,this.fallback.addEventListener("input",()=>this.change(this.fallback.value,this.fallback.selectionStart,this.fallback.selectionEnd)),this.fallback.addEventListener("select",()=>this.selectOuter(this.fallback.selectionStart,this.fallback.selectionEnd)),this.fallback.addEventListener("keydown",e=>{("Backspace"===e.key||"Delete"===e.key)&&""===this.fallback.value&&(e.preventDefault(),this.clearEmptyCode()),"Escape"===e.key&&(e.preventDefault(),this.exit()),(e.ctrlKey||e.metaKey)&&"z"===e.key.toLowerCase()&&(e.preventDefault(),(e.shiftKey?ar:an)(this.view.state,this.view.dispatch));});}async loadEditor(){let t="module-load";try{let{mountComposerCode:n}=await e.A(69453);if(this.disposed)return;this.host.hidden=!1;let r=await n(this.host,{value:this.node.textContent,language:c2(this.node),label:this.labels.code,onChange:(e,t,n)=>this.change(e,t,n),onSelect:(e,t)=>this.selectOuter(e,t),onExit:()=>this.exit(),onEmptyBackspace:()=>this.clearEmptyCode(),onUndo:()=>{an(this.view.state,this.view.dispatch);},onStage:e=>{t=e;},onRedo:()=>{ar(this.view.state,this.view.dispatch);}});if(this.disposed)return void r.dispose();this.adoptEditor(r),(0,R.v)("Keiko composer code editor ready.",{composerActivity:"code-ready"});}catch(e){if((0,R.v)(`Keiko composer code editor unavailable (${t}): ${(0,Z.R)(e)}`,{kind:"other",errorEvidence:(0,K.f)(e),composerCodeStage:t}),this.disposed)return;this.host.hidden=!0,this.notice.textContent=this.labels.unavailable;}}adoptEditor(e){let t=document.activeElement===this.fallback,n=[this.fallback.selectionStart,this.fallback.selectionEnd];this.editor=e,this.update(this.node),this.fallback.hidden=!0,this.notice.hidden=!0,t&&(e.select(...n),e.focus());}change(e,t,n){if(this.updating||this.disposed)return;let r=this.getPos();if(void 0===r||e===this.node.textContent)return;let i=this.view.state.tr.insertText(e,r+1,r+1+this.node.content.size),s=""===this.node.attrs.params?cB(e):void 0;void 0!==s&&s!==c2(this.node)&&(0,R.v)("Keiko composer code language detected.",{composerActivity:"code-language-detected"}),i.setSelection(rL.create(i.doc,r+1+t,r+1+n)),this.view.dispatch(i),this.update(this.node);}selectOuter(e,t){if(this.updating||this.disposed)return;let n=this.getPos();if(void 0===n)return;let r=rL.create(this.view.state.doc,n+1+Math.min(e,this.node.content.size),n+1+Math.min(t,this.node.content.size));r.eq(this.view.state.selection)||this.view.dispatch(this.view.state.tr.setSelection(r));}exit(){let e=this.getPos();if(void 0===e)return;let t=e+this.node.nodeSize,n=this.view.state.doc.resolve(t);for(let e=n.depth;e>0;e-=1)n.end(e)===t&&(t=n.after(e));let r=this.view.state.tr,i=this.view.state.schema.nodes.paragraph;t===r.doc.content.size&&i&&r.insert(t,i.create()),r.setSelection(rL.near(r.doc.resolve(t),1)),this.view.dispatch(r.scrollIntoView()),this.view.focus();}clearEmptyCode(){0===this.node.content.size&&(this.selectOuter(0,0),cQ(this.view.state,this.view.dispatch),this.view.focus());}update(e){var _this$editor,_this$editor2;if("code_block"!==e.type.name)return!1;let t=c2(this.node);this.node=e,this.updating=!0,this.fallback.value=e.textContent,(_this$editor=this.editor)===null||_this$editor===void 0?void 0:_this$editor.update(e.textContent);let n=c2(e);return this.languageSelect.value=n,t!==n&&(_this$editor2=this.editor)!==null&&_this$editor2!==void 0&&_this$editor2.setLanguage(n).catch(e=>{(0,R.v)("Keiko composer code language unavailable.",{kind:"other",errorEvidence:(0,K.f)(e),composerCodeStage:"language"});}),this.updating=!1,!0;}setSelection(e,t){this.updating=!0,this.editor?(this.editor.select(e,t),this.editor.focus()):(this.fallback.focus(),this.fallback.setSelectionRange(e,t)),this.updating=!1;}stopEvent(){return!0;}ignoreMutation(){return!0;}destroy(){var _this$editor3;this.disposed=!0,(_this$editor3=this.editor)===null||_this$editor3===void 0?void 0:_this$editor3.dispose();}}class c6{constructor(e,t,n){_defineProperty(this,"props",void 0);_defineProperty(this,"onNotice",void 0);_defineProperty(this,"view",void 0);_defineProperty(this,"value",void 0);_defineProperty(this,"equivalentEditReported",void 0);_defineProperty(this,"staleAcknowledgmentReported",void 0);_defineProperty(this,"trackKeyboardFocus",void 0);_defineProperty(this,"trackPointerFocus",void 0);this.props=t,this.onNotice=n,this.equivalentEditReported=!1,this.staleAcknowledgmentReported=!1,this.trackKeyboardFocus=e=>{"Tab"===e.key&&(this.view.dom.dataset.keyboardFocus="true");},this.trackPointerFocus=()=>{this.view.dom.dataset.keyboardFocus="false";},this.value=t.value,this.view=new oD(e,{state:this.createState(t.value),attributes:this.attributes(),dispatchTransaction:e=>this.dispatch(e),handlePaste:cY,handleDrop:()=>!0,handleDOMEvents:{keydown:(e,t)=>!t.isComposing&&(this.props.onKeyDown(t,this.value),t.defaultPrevented)},nodeViews:{code_block:(e,t,n)=>c3.create(e,t,n,this.props.labels)},decorations:e=>{var _e$doc$firstChild;return 1===e.doc.childCount&&((_e$doc$firstChild=e.doc.firstChild)===null||_e$doc$firstChild===void 0?void 0:_e$doc$firstChild.type.name)==="paragraph"&&0===e.doc.firstChild.content.size?or.create(e.doc,[oe.node(0,e.doc.firstChild.nodeSize,{"data-placeholder":this.props.placeholder})]):null;},clipboardTextSerializer:e=>this.clipboardText(e)}),this.view.dom.ownerDocument.addEventListener("keydown",this.trackKeyboardFocus,!0),this.view.dom.ownerDocument.addEventListener("pointerdown",this.trackPointerFocus,!0),(0,R.v)("Keiko Markdown composer initialized.",{composerActivity:"initialized",composerFocusIndicator:"keyboard"});}clipboardText(e){let t=e.openStart>0||e.openEnd>0?e.content.textBetween(0,e.content.size,"\n","\n"):cU(this.view.state.schema.node("doc",null,e.content));return(0,R.v)("Keiko composer selection copied.",{composerActivity:"text-copied"}),t;}createState(e){var t,n;return t=this.props.maxLength,n=()=>{this.onNotice(this.props.labels.limit),(0,R.v)("Keiko Markdown composer input limit reached.",{composerActivity:"input-limit"});},rX.create({doc:cK(e),plugins:[function(){let{heading:e,blockquote:t,bullet_list:n,ordered_list:r}=cP.nodes;if(!e||!t||!n||!r)throw TypeError("Invalid composer schema");return function({rules:e}){let t=new r0({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t);}},props:{handleTextInput:(n,r,i,s)=>as(n,r,i,s,e,t),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&as(n,r.pos,r.pos,"",e,t);});}}},isInputRules:!0});return t;}({rules:[function(e,t,n=null){return new ai(e,(e,r,i,s)=>{let o=e.doc.resolve(i),a=n instanceof Function?n(r):n;return o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t)?e.tr.delete(i,s).setBlockType(i,i,t,a):null;});}(/^(#{1,6})\s$/,e,e=>{var _e$1$length,_e$;return{level:(_e$1$length=(_e$=e[1])===null||_e$===void 0?void 0:_e$.length)!==null&&_e$1$length!==void 0?_e$1$length:1};}),aa(/^>\s$/,t),aa(/^[-*+]\s$/,n),aa(/^(\d+)\.\s$/,r,e=>({order:Number(e[1])})),cG(/\*\*([^*]+)\*\*$/,"strong"),cG(/(?<!\*)\*([^*]+)\*$/,"em"),cG(/`([^`]+)`$/,"code")]});}(),function(){let{strong:e,em:t,code:n}=cP.marks,r=cP.nodes.list_item;if(!e||!t||!n||!r)throw TypeError("Invalid composer schema");return av({...oZ,Enter:()=>!0,"Shift-Enter":function(){let e=cP.nodes.list_item;if(!e)throw TypeError("Invalid composer list schema");return oW(cZ,function(t,n){let{$from:r,$to:i,node:s}=t.selection;if(s&&s.isBlock||r.depth<2||!r.sameParent(i))return!1;let o=r.node(-1);if(o.type!=e)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(3==r.depth||r.node(-3).type!=e||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){let i=nm.empty,s=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-s;e>=r.depth-3;e--)i=nm.from(r.node(e).copy(i));let o=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(nm.from(e.createAndFill()));let a=r.before(r.depth-(s-1)),l=t.tr.replace(a,r.after(-o),new nx(i,4-s,0)),c=-1;l.doc.nodesBetween(a,l.doc.content.size,(e,t)=>{if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1);}),c>-1&&l.setSelection(rO.near(l.doc.resolve(c))),n(l.scrollIntoView());}return!0;}let a=i.pos==r.end()?o.contentMatchAt(0).defaultType:null,l=t.tr.delete(r.pos,i.pos),c=a?[null,{type:a}]:void 0;return!!rb(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0);},oO,oz,oB);}(),"Mod-z":an,"Shift-Mod-z":ar,"Mod-y":ar,"Mod-b":oU(e),"Mod-i":oU(t),"Mod-`":oU(n),Backspace:oW(cQ,ao),Delete:(e,t,n)=>0===e.selection.$from.parent.content.size&&cQ(e,t),Tab:function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(0==o)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=r)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,i=nm.from(n?r.create():null),o=new nx(nm.from(r.create(null,nm.from(a.type.create(null,i)))),n?3:1,0),c=s.start,u=s.end;t(e.tr.step(new rp(c-(n?3:1),u,c,u,o,1,!0)).scrollIntoView());}return!0;},"Shift-Tab":ay(r)});}(),av(oZ),function(e={}){return new r0({key:o7,state:{init:()=>new o2(o0.empty,o0.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i=n.getMeta(o7),s;if(i)return i.historyState;n.getMeta(ae)&&(e=new o2(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(o&&o.getMeta(o7))if(o.getMeta(o7).redo)return new o2(e.done.addTransform(n,void 0,r,o8(t)),e.undone,o6(n.mapping.maps),e.prevTime,e.prevComposition);else return new o2(e.done,e.undone.addTransform(n,void 0,r,o8(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||o&&!1===o.getMeta("addToHistory"))if(s=n.getMeta("rebased"))return new o2(e.done.rebased(n,s),e.undone.rebased(n,s),o5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new o2(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),o5(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),s=0==e.prevTime||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0);}),n;}(n,e.prevRanges)),a=o?o5(e.prevRanges,n.mapping):o6(n.mapping.maps);return new o2(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,o8(t)),o0.empty,a,n.time,null==i?e.prevComposition:i);}}(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?an:"historyRedo"==n?ar:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch));}}}});}(),new r0({filterTransaction:e=>!e.docChanged||cU(e.doc).length<=t||(n(),!1)})]});}mentionCursor(){return"code_block"===this.view.state.selection.$from.parent.type.name?-1:this.selectionStart;}attributes(){var _cX$default$cmpEditor;return{class:(_cX$default$cmpEditor=cX.default.cmpEditor)!==null&&_cX$default$cmpEditor!==void 0?_cX$default$cmpEditor:"",role:"textbox","aria-multiline":"true","aria-label":this.props.ariaLabel,"aria-description":this.props.labels.hint,...(this.props.ariaControls?{"aria-controls":this.props.ariaControls}:{}),tabindex:"0","data-shell-chord-bypass":"","data-markdown-composer":"",spellcheck:"true"};}dispatch(e){let t=this.view.state,n=t.apply(e);this.view.updateState(n);let r=t.doc.eq(n.doc)?this.value:cU(n.doc);r!==this.value?(this.value=r,this.onNotice(""),this.props.onChange(this.value,this.mentionCursor())):(t.doc===n.doc||this.equivalentEditReported||(this.equivalentEditReported=!0,(0,R.v)("Keiko composer equivalent document update ignored.",{composerActivity:"equivalent-edit-ignored"})),t.selection.eq(n.selection)||this.props.onSelect(this.value,this.mentionCursor()));}update(e,t=!0){let n=e.value===this.value;if(this.updateAttributes(e),!t)return void this.reportStaleAcknowledgment(e.value);if(n||e.value===this.value)return;if(!e.value){this.value="",this.view.updateState(this.createState("")),(0,R.v)("Keiko composer external draft resynchronized.",{composerActivity:"draft-resynchronized"});return;}let r=this.externalDraftTransaction(e.value);if(cU(r.doc)!==e.value){let t=this.view.state;r=t.tr.replaceWith(0,t.doc.content.size,cK(e.value).content),(0,R.v)("Keiko composer external draft resynchronized.",{composerActivity:"draft-resynchronized"});}this.view.updateState(this.view.state.apply(r)),this.value=cU(this.view.state.doc),this.value!==e.value&&this.props.onChange(this.value,this.mentionCursor());}updateAttributes(e){let t=e.ariaLabel!==this.props.ariaLabel||e.ariaControls!==this.props.ariaControls||e.labels.hint!==this.props.labels.hint||e.placeholder!==this.props.placeholder;this.props=e,t&&this.view.setProps({attributes:this.attributes()});}reportStaleAcknowledgment(e){e===this.value||this.staleAcknowledgmentReported||(this.staleAcknowledgmentReported=!0,(0,R.v)("Keiko composer stale draft acknowledgment ignored.",{composerActivity:"stale-draft-echo-ignored"}));}externalDraftTransaction(e){let t=0,n=this.value.length,r=e.length;for(;t<Math.min(n,r)&&this.value[t]===e[t];)t+=1;for(;n>t&&r>t&&this.value[n-1]===e[r-1];)n-=1,r-=1;let i=this.view.state,s=cH(i,t,this.value).head,o=cH(i,n,this.value).head,a=e.slice(t,r),l=i.tr.delete(s,o),c=l.doc.resolve(s);return a.startsWith("\n\n")&&1===c.depth&&c.parentOffset===c.parent.content.size?(l.split(s,1,[{type:i.schema.nodes.paragraph}]),a=a.slice(2),l.setSelection(cH(i,t,this.value).map(l.doc,l.mapping)),l.insert(s+2,cW(a).firstChild.content)):l.replaceRange(s,s,nx.maxOpen(cW(a).content)),l;}focus(){this.view.focus();}get currentMarkdown(){return this.value;}get selectionStart(){var e;let t;return t=cJ(cU((e=this.view.state).doc)),cU(e.tr.insertText(t,e.selection.head).doc).indexOf(t);}setSelectionRange(e,t){this.view.dispatch(this.view.state.tr.setSelection(cH(this.view.state,e,this.value)));}destroy(){this.view.dom.ownerDocument.removeEventListener("keydown",this.trackKeyboardFocus,!0),this.view.dom.ownerDocument.removeEventListener("pointerdown",this.trackPointerFocus,!0),this.view.destroy();}}function c5(e,t,n,r){let i={value:n,revision:void 0};t.current.push(i);let s=e.current.onChange(n,r);"number"==typeof s&&(i.revision=s);}function c4(e){let t,n,r,i,s=(0,y.useRef)(null),o=(0,y.useRef)(null),a=(0,y.useRef)(e),l=(0,y.useRef)([]),c=(0,y.useRef)({value:e.value,revision:e.valueRevision}),[u,d]=(0,y.useState)(""),{publishChange:h,cancel:p}=(t=(0,y.useRef)(null),n=(0,y.useRef)(null),r=(0,y.useCallback)(()=>{null!==n.current&&window.clearTimeout(n.current),n.current=null,t.current=null;},[]),i=(0,y.useCallback)(()=>{let e=t.current;return r(),!!(e!==null&&e!==void 0&&e.owner)&&o.current===e.owner&&(c5(a,l,e.value,e.cursor),!0);},[r,o,a,l]),(0,y.useLayoutEffect)(()=>{let e=()=>{i()&&(0,R.v)("Keiko composer departure flushed the current draft.",{composerActivity:"literal-input-preserved"});},t=()=>{"hidden"===document.visibilityState&&e();};return window.addEventListener("beforeunload",e,!0),window.addEventListener("pagehide",e,!0),document.addEventListener("visibilitychange",t,!0),()=>{window.removeEventListener("beforeunload",e,!0),window.removeEventListener("pagehide",e,!0),document.removeEventListener("visibilitychange",t,!0);};},[i]),{publishChange:(0,y.useCallback)((e,r)=>{t.current={owner:o.current,value:e,cursor:r},null===n.current&&(n.current=window.setTimeout(i,16));},[o,i]),cancel:r}),m=(0,y.useCallback)((e,t)=>{var _e$nativeEvent;"Enter"!==e.key||e.shiftKey||e.isComposing||(_e$nativeEvent=e.nativeEvent)!==null&&_e$nativeEvent!==void 0&&_e$nativeEvent.isComposing||t===a.current.value||(p(),(0,q.flushSync)(()=>{var _o$current$selectionS,_o$current;return c5(a,l,t,(_o$current$selectionS=(_o$current=o.current)===null||_o$current===void 0?void 0:_o$current.selectionStart)!==null&&_o$current$selectionS!==void 0?_o$current$selectionS:-1);}),(0,R.v)("Keiko composer Enter flushed the current draft.",{composerActivity:"literal-input-preserved"})),a.current.onKeyDown(e,t);},[p,o,a,l]);return(0,y.useLayoutEffect)(()=>{a.current=e;}),(0,y.useLayoutEffect)(()=>{if(!s.current)return;let e=new c6(s.current,{...a.current,onChange:h,onKeyDown:m},d);o.current=e,c.current={value:a.current.value,revision:a.current.valueRevision},l.current=[];let t=a.current.inputRef;return t.current=e,()=>{e.destroy(),p(),l.current=[],o.current=null,t.current=null;};},[e.documentKey,h,m,p]),(0,y.useLayoutEffect)(()=>{var _o$current2;let t=function(e,t,n){var r,i;if(r=e.valueRevision,i=t.current.revision,void 0!==r&&void 0!==i&&r<i)return!1;let s=n.current.findIndex(t=>t.value===e.value&&(void 0===t.revision||t.revision===e.valueRevision)),o=t.current.value===e.value&&t.current.revision===e.valueRevision;return t.current={value:e.value,revision:e.valueRevision},s>=0?n.current.splice(0,s+1):o||(n.current=[]),!o&&s<0;}(e,c,l);t&&p(),(_o$current2=o.current)===null||_o$current2===void 0?void 0:_o$current2.update({...e,onChange:h,onKeyDown:m},t);}),(0,f.jsxs)("div",{className:cX.default.cmpRoot,"data-markdown-composer-scope":"",children:[(0,f.jsx)("div",{ref:s}),u&&(0,f.jsx)("output",{className:cX.default.cmpNotice,children:u})]});}var c9=e.i(99211);let c8=X.f.copy,c7=X.f.chevron,ue=X.f.close,ut=X.f.mic,un=X.f.cube,ur=X.f.arrowUp,ui=X.f.spark,us=X.f.brain,uo="cmp-no-model-alert",ua="cmp-send-hint",ul="cmp-skill-send-hint",uc="cmp-loading-status",uu="repo-file-picker-results",ud={display:"block"},uh={width:"100%"};async function up(e,t,n,r){return e({text:t,clientTurnId:n,reportOutcome:!0,...(void 0===r?{}:{correlationId:r})});}let uf={contentVisibility:"auto",containIntrinsicSize:`auto ${String(132)}px`};function um(e){let t=new Date(e),n=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return t.toDateString()===new Date().toDateString()?n:`${t.toLocaleDateString([],{month:"short",day:"numeric"})}, ${n}`;}function ug(e){return{blockSize:`${String(132*e)}px`};}let uv=/\s/u;function uy(e,t){return e.indices.every(e=>e>=1&&e<=t);}function uk(e,t){let n="",r=0;for(let i of(0,U.M)(e)){if(!uy(i,t))continue;let s=i.start;for(;s>r&&uv.test(e.charAt(s-1));)s-=1;n+=e.slice(r,s),r=i.end;}return n+e.slice(r);}function ub(e,t=0){return uk((0,e$.Z)(e),t);}function ux(e){return uk(uC(e),uM(e.groundedAnswer));}function uw(e){return void 0!==e.groundedAnswer&&e.content.includes("<assessment>");}function uC(e){return uw(e)?(0,W._)(e.content):e.content;}let uS=(0,eC.default)(()=>e.A(88743).then(e=>e.AssessedAnswerBody),{loadableGenerated:{modules:[57757]},ssr:!1,loading:()=>null});function uD(e){let t=uM(e.groundedAnswer),n=(0,U.M)(uC(e)),r=n.filter(e=>uy(e,t)).length;return{grounded:void 0!==e.groundedAnswer,strippedGroupCount:r,keptGroupCount:n.length-r};}function uA(e,t){let n=(0,U.M)((0,e$.Z)(e.content)),r=n.filter(t=>uy(t,e.citationCeiling)).length;return{outcome:t,grounded:e.grounded,strippedGroupCount:r,keptGroupCount:n.length-r};}function uE(e,t){void 0===t?(0,R.v)("Keiko chat answer copied.",{answerCopy:uA(e,"copied")}):(0,R.v)("Keiko chat answer copy failed.",{answerCopy:uA(e,"failed"),errorKind:"unavailable",errorEvidence:(0,K.f)(t)});}function uM(e){var _e$promptContext$sent,_e$promptContext;if(void 0===e)return 0;let t="knowledgeCitations"in e?e.knowledgeCitations:[],n=[...e.citations,...t];return Math.max((_e$promptContext$sent=(_e$promptContext=e.promptContext)===null||_e$promptContext===void 0?void 0:_e$promptContext.sentReferenceCount)!==null&&_e$promptContext$sent!==void 0?_e$promptContext$sent:0,n.length,function(e){let t=0;for(let n of e)for(let e of"number"==typeof n?[n]:(0,U.Y)(n!==null&&n!==void 0?n:""))t=Math.max(t,e);return t;}(n.map(e=>e.marker)));}function uN({content:e,citationCeiling:t,grounded:n}){let r=(0,m.a)(),[i,s]=(0,y.useState)("idle"),[o,a]=(0,y.useState)(""),l=(0,y.useCallback)(()=>{let i={content:e,citationCeiling:t,grounded:n};(0,nc.f)(ub(e,t)).then(()=>{uE(i),s("copied"),a(r("chat.copy.copiedStatus")),setTimeout(()=>{s("idle"),a("");},1500);},e=>{uE(i,e),s("failed"),a(r("chat.copy.failedStatus"));});},[t,e,n,r]),c="copied"===i;return(0,f.jsxs)("div",{className:"chat-msg-copy-wrap",children:[(0,f.jsx)("button",{type:"button",className:"chat-msg-copy","aria-label":c?r("chat.copy.copied"):r("chat.copy.message"),title:c?r("chat.copy.copied"):r("chat.copy.message"),"data-copied":c?"true":"false","data-failed":"failed"===i?"true":"false",onClick:l,children:(0,f.jsx)(c8,{size:20,"aria-hidden":"true"})}),(0,f.jsx)("output",{className:"chat-msg-copy-status",children:o})]});}function u_({messageId:e,regenerating:t,onRegenerate:n,onCancel:r}){let i=(0,m.a)(),[s,o]=(0,y.useState)(""),a=(0,y.useCallback)(()=>{if(t){r(),o(i("chat.regenerate.cancelled"));return;}o(i("chat.regenerate.running")),n(e);},[e,r,n,t,i]);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("div",{className:"ai-controls","data-live":t?"true":"false",children:(0,f.jsx)("button",{type:"button",className:"ai-stop","aria-label":t?i("chat.regenerate.cancel"):i("chat.regenerate.action"),"aria-busy":t?"true":void 0,onClick:a,children:t?i("chat.regenerate.cancelShort"):i("chat.regenerate.short")})}),(0,f.jsx)("output",{className:"sr-only",children:s})]});}function uT(e){let{message:t,isUser:n,streaming:r}=e;return uw(t)?(0,f.jsx)(uS,{content:t.content,messageId:t.id,repositoryRoots:e.repositoryRoots,repositoryEvidence:e.repositoryEvidence,openRepositoryReference:e.openRepositoryReference,citationPreview:e.citationPreview}):(0,f.jsx)(eL.b,{source:t.content,literalUserInput:n,diagnosticCorrelationId:t.id,repositoryRoots:e.repositoryRoots,repositoryEvidence:e.repositoryEvidence,openRepositoryReference:e.openRepositoryReference,citationPreview:e.citationPreview,streaming:r,trailing:r?(0,f.jsx)("span",{className:"ai-stream-cursor","aria-hidden":"true"}):void 0});}function uR({contentId:e,collapsed:t,canCollapse:n,...r}){let{isUser:i}=r;return(0,f.jsx)("div",{id:i?void 0:e,className:"chat-msg-content","data-collapsed":!i&&t?"true":"false","data-collapsible":n?"true":"false",children:(0,f.jsx)(uT,{...r})});}function uI(e,t){var _e$responseVersion,_n$at;let n=e.responseVersions,r=(_e$responseVersion=e.responseVersion)!==null&&_e$responseVersion!==void 0?_e$responseVersion:n===null||n===void 0||(_n$at=n.at(-1))===null||_n$at===void 0?void 0:_n$at.version;if(void 0===n||void 0===t||t===r)return e;let i=n.find(e=>e.version===t);return void 0===i?e:{...e,content:i.content,timestamp:i.timestamp,responseVersion:i.version,supersedesResponseVersion:i.supersedesVersion,groundedAnswer:void 0};}function uj({message:e,selectedVersion:t,onSelect:n}){var _e$responseVersion2,_i$at;let r=(0,m.a)(),i=e.responseVersions,s=(_e$responseVersion2=e.responseVersion)!==null&&_e$responseVersion2!==void 0?_e$responseVersion2:i===null||i===void 0||(_i$at=i.at(-1))===null||_i$at===void 0?void 0:_i$at.version,o=t!==null&&t!==void 0?t:s;return void 0===i||i.length<2||void 0===o?null:(0,f.jsxs)("div",{className:g.default.responseVersionControl,children:[(0,f.jsxs)("label",{className:g.default.responseVersionLabel,children:[(0,f.jsx)("span",{children:r("chat.regenerate.versionSelector")}),(0,f.jsx)("select",{className:g.default.responseVersionSelect,value:String(o),onChange:e=>{n(Number(e.target.value));},children:i.map(e=>(0,f.jsx)("option",{value:String(e.version),children:r(e.version===s?"chat.regenerate.versionCurrent":"chat.regenerate.version",{version:e.version})},e.version))})]}),(0,f.jsx)("span",{className:g.default.responseVersionSummary,"aria-live":"polite",children:r("chat.regenerate.versionSummary",{version:o,count:i.length})})]});}function uF({isUser:e,message:t,showRegenerate:n,regenerating:r,onRegenerate:i,onCancelRegenerate:s,canCollapse:o,collapsed:a,onToggleCollapsed:l,contentId:c}){let u=(0,m.a)();return e?null:(0,f.jsxs)("div",{className:"chat-msg-actions",children:[n&&void 0!==i&&void 0!==s?(0,f.jsx)(u_,{messageId:t.id,regenerating:r,onRegenerate:i,onCancel:s}):null,(0,f.jsx)(uN,{content:uC(t),citationCeiling:uM(t.groundedAnswer),grounded:void 0!==t.groundedAnswer}),o?(0,f.jsxs)("button",{type:"button",className:"chat-msg-collapse","aria-controls":c,"aria-expanded":!a,onClick:l,children:[(0,f.jsx)(c7,{size:12,"aria-hidden":"true"}),(0,f.jsx)("span",{children:u(a?"chat.answer.expand":"chat.answer.collapse")})]}):null]});}function uO({message:e,isUser:t,repositoryRoots:n,openRepositoryReference:r,citationPreview:i,openDocumentationTarget:s,onReadPaths:o}){return t||void 0===e.groundedAnswer?null:(0,f.jsxs)("div",{className:"chatw-grounded chatw-grounded-inline",children:[(0,f.jsx)(G.w,{answer:e.groundedAnswer,onReadPaths:o,busy:!1,repositoryRoots:n,openRepositoryReference:r,citationPreview:i,openDocumentationTarget:s}),(0,f.jsx)(ez,{contextSummary:function(e){if(void 0!==e){if("connected-context"===e.groundingKind)return e.contextPack.contextSummary;if("hybrid"===e.groundingKind)return e.contextPack.folder.contextSummary;}}(e.groundedAnswer)})]});}let uz=(0,y.memo)(function({message:e,onOpenRunResult:t,onRegenerate:n,onCancelRegenerate:r,showRegenerate:i=!1,regenerating:s=!1,repositoryRoots:o,openRepositoryReference:a,previewWindows:l,windowId:c,streaming:u=!1,layout:d="stack"}){var _$groundedAnswer2;var h,p;let v,k=(0,m.a)(),x=(0,m.a)(),{activeChat:w}=(0,H.V)(),C=(0,y.useId)(),S=(0,y.useRef)(null),[D,A]=(0,y.useState)(!1),[E,M]=(0,y.useState)({currentVersion:e.responseVersion,selectedVersion:void 0}),N=E.currentVersion===e.responseVersion?E.selectedVersion:void 0,_=uI(e,N),T=function(e,t){var n,r,i;let s,o=(e===null||e===void 0?void 0:e.groundingKind)==="local-knowledge"?void 0:e,a=o===null||o===void 0?void 0:o.evidenceRunId,l=o===null||o===void 0?void 0:o.evidenceRunIds,c=(0,y.useMemo)(()=>Array.from(new Set([...(void 0===a?[]:[a]),...(l!==null&&l!==void 0?l:[])])),[a,l]),u=JSON.stringify([o===null||o===void 0?void 0:o.assistantMessageId,c,t.map(e=>e.root)]),d=(0,y.useRef)(u);(0,y.useEffect)(()=>{d.current=u;},[u]);let[h,p]=(0,y.useState)({key:"",byRun:{}}),f=(0,y.useCallback)((e,t,n)=>{d.current===u&&c.includes(e)&&p(r=>({key:u,byRun:{...(r.key===u?r.byRun:{}),[e]:{paths:t,sourceScopeFingerprint:n}}}));},[u,c]);return void 0===o?{evidence:void 0,onReadPaths:f}:{evidence:(n=o.citations,r=h.key===u?Object.values(h.byRun):[],i=c.length>0&&c.every(e=>h.key===u&&void 0!==h.byRun[e]),s=r.filter(e=>1===t.filter(t=>{var _t$scopeFingerprints;return void 0!==e.sourceScopeFingerprint&&((_t$scopeFingerprints=t.scopeFingerprints)===null||_t$scopeFingerprints===void 0?void 0:_t$scopeFingerprints.includes(e.sourceScopeFingerprint))===!0;}).length).flatMap(e=>e.paths),{citations:n,readStatusVerified:i&&r.every(e=>1===t.filter(t=>{var _t$scopeFingerprints2;return void 0!==e.sourceScopeFingerprint&&((_t$scopeFingerprints2=t.scopeFingerprints)===null||_t$scopeFingerprints2===void 0?void 0:_t$scopeFingerprints2.includes(e.sourceScopeFingerprint))===!0;}).length),readPaths:Array.from(new Set(s)),inspectedPaths:r.flatMap(e=>e.paths.map(t=>({scopePath:t,sourceScopeFingerprint:e.sourceScopeFingerprint})))}),onReadPaths:f};}(_.groundedAnswer,o),R=eX(e),I="user"===e.role,j=function({answer:e,chatId:t,windowId:n,windows:r}){let i=e===null||e===void 0?void 0:e.assistantMessageId,s=(0,y.useMemo)(()=>void 0===e?[]:"local-knowledge"===e.groundingKind?e.citations:"hybrid"===e.groundingKind?e.knowledgeCitations:[],[e]),[o,a]=(0,y.useState)({}),[l,c]=(0,y.useState)(new Set()),u=(0,y.useRef)(new Map()),d=(0,y.useRef)({affordances:o,answer:e,chatId:t,citations:s,windowId:n,windows:r});d.current={affordances:o,answer:e,chatId:t,citations:s,windowId:n,windows:r},(0,y.useEffect)(()=>{if(void 0===t||void 0===i||0===s.length)return void a({});let e=!1;return function(e){let t=`${e.chatId}\0${e.assistantMessageId}`,n=Date.now(),r=t5.get(t);if(void 0!==r&&r.expiresAt>n)return r.promise;let i=(0,b.Zk)(e).catch(e=>{throw t5.delete(t),e;});return t5.set(t,{promise:i,expiresAt:n+3e5}),i;}({chatId:t,assistantMessageId:i}).then(t=>{e||a(function(e,t){let n=new Map(e.map(e=>[e.stableId,e])),r=new Map();for(let t of e){var _r$get;let e=t4(t.marker);if(void 0===e)continue;let n=(_r$get=r.get(e))!==null&&_r$get!==void 0?_r$get:new Set();n.add(t.stableId),r.set(e,n);}let i=new Map();for(let t of e){var _r$get2;let e=t4(t.marker);void 0!==e&&((_r$get2=r.get(e))===null||_r$get2===void 0?void 0:_r$get2.size)===1&&i.set(e,t);}let s={};for(let e of t){var _n$get;if("not-applicable"===e.state)continue;let t=(_n$get=n.get(e.stableId))!==null&&_n$get!==void 0?_n$get:i.get(e.markerIndex);void 0!==t&&(s[t.stableId]={citation:t,state:e.state,...(void 0===e.display?{}:{display:e.display}),...(void 0===e.reason?{}:{reason:e.reason})});}return s;}(s,t.citations));},()=>{e||a({});}),()=>{e=!0;};},[i,t,s]);let h=(0,y.useCallback)(e=>o[e.stableId],[o]),p=(0,y.useCallback)(e=>{let t=t4(e);if(void 0!==t)return s.map(e=>o[e.stableId]).find(e=>void 0!==e&&t4(e.citation.marker)===t);},[o,s]),f=(0,y.useCallback)(n=>void 0!==t&&void 0!==e&&l.has(t9(t,e.assistantMessageId,n)),[e,t,l]),m=(0,y.useCallback)(async(n,i)=>{if(void 0===t||void 0===e||void 0===r)return null;let s=t9(t,e.assistantMessageId,n),o=u.current.get(s);if(void 0!==o)return o;c(e=>t8(e,s,!0));let a=(0,b.DY)({chatId:t,assistantMessageId:e.assistantMessageId,marker:n.marker,stableId:n.stableId,origin:i}).then(r=>{var s,o;let a,l=d.current,c=l.answer;if(l.chatId!==t||(c===null||c===void 0?void 0:c.assistantMessageId)!==e.assistantMessageId||void 0===l.windows)return null;let u=l.citations.find(e=>e.stableId===n.stableId);if(void 0===u)return null;let h=(s=l.citations,o=l.affordances,a=new Set(),s.flatMap(e=>{if(e.lineage.documentId!==u.lineage.documentId||a.has(e.stableId))return[];let t=o[e.stableId];if(void 0===t)return[];let n=function(e,t){if("available"===t.state&&void 0!==t.display)return{citation:{stableId:e.stableId,marker:e.marker,label:e.label,...(void 0===e.source?{}:{source:e.source})},display:t.display};}(e,t);return void 0!==n&&a.add(e.stableId),void 0===n?[]:[n];})),p=0===h.length?void 0:{activeStableId:u.stableId,citations:h,origin:{assistantMessageId:c.assistantMessageId,chatId:t,...(void 0===l.windowId?{}:{chatWindowId:l.windowId}),marker:u.marker,representation:i}};return"authorized"===r.outcome?(0,t6.showPdfCitationPreviewResult)(l.windows,r,{...(void 0===p?{}:{context:p}),currentPage:r.display.pageNumber}):(0,t6.showPdfCitationPreviewFailure)(l.windows,r);}).finally(()=>{u.current.delete(s),c(e=>t8(e,s,!1));});return u.current.set(s,a),a;},[e,t,r]);if(void 0!==t&&void 0!==e&&0!==s.length&&void 0!==r)return{forCitation:h,forMarker:p,isOpening:f,openCitation:m};}({answer:_.groundedAnswer,chatId:w===null||w===void 0?void 0:w.id,windowId:c,windows:l}),F=(0,y.useCallback)(e=>void 0!==l&&null!==l.add("docbrowser",{target:e}),[l]),O=(h=_.content,!u&&!I&&!R&&(h.length>=1800||h.split(/\r\n|\r|\n/u).length>=32));return("failed"===e.turnState?v=x("chat.turn.failed"):"cancelled"===e.turnState&&(v=x("chat.turn.cancelled")),p=w===null||w===void 0?void 0:w.id,(0,y.useEffect)(()=>{var _$groundedAnswer$assi,_$groundedAnswer;let e=(_$groundedAnswer$assi=(_$groundedAnswer=_.groundedAnswer)===null||_$groundedAnswer===void 0?void 0:_$groundedAnswer.assistantMessageId)!==null&&_$groundedAnswer$assi!==void 0?_$groundedAnswer$assi:_.id;if("assistant"===_.role&&void 0!==p&&void 0!==c&&null!==S.current)return(0,t6.registerPdfCitationPreviewMessageTarget)({assistantMessageId:e,chatId:p,chatWindowId:c,element:S.current});},[p,S,(_$groundedAnswer2=_.groundedAnswer)===null||_$groundedAnswer2===void 0?void 0:_$groundedAnswer2.assistantMessageId,_.id,_.role,c]),R)?(0,f.jsx)(e0,{message:e,onOpenResult:t}):(0,f.jsx)("article",{ref:S,className:I?`chat-msg ${g.default.cmpUserMessage}`:"chat-msg","data-role":e.role,"data-layout":d,tabIndex:I?void 0:-1,children:(0,f.jsxs)("div",{className:I?`chat-msg-bubble ${g.default.cmpUserMessageBubble}`:"chat-msg-bubble",children:[I?(0,f.jsx)("div",{className:"chat-msg-role",children:k("chat.role.user")}):(0,f.jsx)(uB,{}),void 0===v?null:(0,f.jsx)("output",{className:g.default.turnEndState,style:eP.u,children:v}),(0,f.jsx)(uR,{repositoryEvidence:T.evidence,message:_,isUser:I,streaming:u,contentId:C,collapsed:D,canCollapse:O,repositoryRoots:o,openRepositoryReference:a,citationPreview:j}),(0,f.jsx)(uj,{message:e,selectedVersion:N,onSelect:t=>{M({currentVersion:e.responseVersion,selectedVersion:t});}}),(0,f.jsxs)("div",{className:"chat-msg-foot",children:[(0,f.jsx)("div",{className:"chat-msg-time",title:new Date(_.timestamp).toLocaleString(),children:um(_.timestamp)}),(0,f.jsx)(uF,{isUser:I,message:_,showRegenerate:i&&void 0===e.groundedAnswer&&!dd(w),regenerating:s,onRegenerate:n,onCancelRegenerate:r,canCollapse:O,collapsed:D,onToggleCollapsed:()=>{A(e=>!e);},contentId:C})]}),(0,f.jsx)(uO,{onReadPaths:T.onReadPaths,message:_,isUser:I,repositoryRoots:o,openRepositoryReference:a,citationPreview:j,openDocumentationTarget:F})]})});});function uB({pulsing:e=!1}){let t=(0,m.a)();return(0,f.jsx)("div",{className:"chat-msg-brand","data-pulsing":e?"true":"false",role:"img","aria-label":t("chat.keikoLogo"),children:(0,f.jsx)($.default,{src:"/keiko-logo.svg",width:22,height:22,alt:"","aria-hidden":"true"})});}function uP(){let e=(0,m.a)();return(0,f.jsx)("article",{className:"chat-msg","data-role":"assistant",children:(0,f.jsxs)("div",{className:"chat-msg-bubble",children:[(0,f.jsx)(uB,{pulsing:!0}),(0,f.jsxs)("span",{className:"chat-typing",role:"img","aria-label":e("chat.keikoResponding"),children:[(0,f.jsx)("i",{}),(0,f.jsx)("i",{}),(0,f.jsx)("i",{})]})]})});}function uL(e,t,n){let r=Math.max(0,Math.min(1,t));e.style.setProperty("--wave-width",`${(8+16*r).toFixed(1)}px`),e.dataset.peak=n?"true":"false";}let u$=(0,y.memo)(function({items:e,onJump:t}){let n=(0,m.a)(),r=(0,y.useRef)(new Map()),i=(0,y.useRef)(null),s=(0,y.useRef)(null),o=(0,y.useCallback)(e=>{let t=Array.from(r.current.values());if(0===t.length)return;let n=-1,i=1/0,s=t.map((t,r)=>{let s=t.getBoundingClientRect(),o=Math.abs(e-(s.top+s.height/2));return o<i&&(i=o,n=r),Math.exp(-(o*o)/1058);});t.forEach((e,t)=>{var _s$t;let r=t===n;uL(e,r?1:(_s$t=s[t])!==null&&_s$t!==void 0?_s$t:0,r);});},[]),a=(0,y.useCallback)(e=>{(i.current=e,"function"!=typeof requestAnimationFrame)?o(e):null===s.current&&(s.current=requestAnimationFrame(()=>{s.current=null;let e=i.current;null!==e&&o(e);}));},[o]),l=(0,y.useCallback)(()=>{for(let e of(null!==s.current&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(s.current),s.current=null,i.current=null,r.current.values()))uL(e,0,!1);},[]),c=(0,y.useCallback)((e,t)=>{null===t?r.current.delete(e):r.current.set(e,t);},[]);return e.length<2?null:(0,f.jsx)("nav",{className:"chat-question-map","aria-label":n("chat.questionMap.label"),onPointerMove:e=>a(e.clientY),onPointerLeave:l,children:(0,f.jsx)("ol",{className:"chat-question-map-list",children:e.map(e=>(0,f.jsx)("li",{className:"chat-question-map-item",children:(0,f.jsxs)("button",{ref:t=>c(e.id,t),type:"button",className:"chat-question-map-button","data-peak":"false",style:{"--wave-width":"8px"},"aria-label":n("chat.questionMap.jump",{index:e.index,preview:e.preview}),onFocus:e=>{let t=e.currentTarget.getBoundingClientRect();a(t.top+t.height/2);},onBlur:l,onClick:()=>t(e.id),children:[(0,f.jsx)("span",{className:"chat-question-map-mark","aria-hidden":"true"}),(0,f.jsxs)("span",{className:"chat-question-map-card","aria-hidden":"true",children:[(0,f.jsx)("span",{className:"chat-question-map-card-title",children:e.preview}),(0,f.jsx)("span",{className:"chat-question-map-card-time",children:e.time})]})]})},e.id))})});}),uq=(0,y.memo)(function({messages:e,streamingAssistantMessage:t,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:s,windowId:o,sending:a,sendStatus:l,regeneratingMessageId:c,activeChat:u,onCancelGrounded:d,onRegenerate:h,onCancelRegenerate:p,showRegenerateControls:v,registerQuestionAnchor:k,focusedMessageId:b}){var _C$at;let x=(0,m.a)(),w=(0,m.a)(),C=(0,y.useMemo)(()=>function(e){let t=[],n=null;for(let r of e){if("user"===r.role){n={id:r.id,user:r,responses:[]},t.push(n);continue;}null===n&&(n={id:r.id,user:null,responses:[]},t.push(n)),n.responses.push(r);}return t;}(e),[e]),S=(0,y.useMemo)(()=>function(e,t){if(e.length<=120)return{turns:e,beforeCount:0,afterCount:0};let n=Math.max(0,e.length-80);if(null!==t){let r=e.findIndex(e=>{var _e$user;return((_e$user=e.user)===null||_e$user===void 0?void 0:_e$user.id)===t||e.responses.some(e=>e.id===t);});r>=0&&(r<n||r>=n+80)&&(n=Math.max(0,r-8));}let r=Math.min(e.length,n+80);return{turns:e.slice(n,r),beforeCount:n,afterCount:e.length-r};}(C,b),[b,C]),D=void 0!==t&&t.content.length>0?t:void 0,A=(_C$at=C.at(-1))===null||_C$at===void 0?void 0:_C$at.id,E=(0,y.useMemo)(()=>{for(let t=e.length-1;t>=0;t-=1){let n=e[t];if((n===null||n===void 0?void 0:n.role)==="assistant")return n.id;}},[e]);return(0,f.jsxs)("div",{className:"chatw-thread","data-windowed":S.beforeCount>0||S.afterCount>0?"true":"false",children:[C.length>48?(0,f.jsx)("output",{className:g.default.contextWindowNotice,"aria-label":w("chat.contextWindow.label"),style:eP.u,children:w("chat.contextWindow.notice",{count:C.length})}):null,S.beforeCount>0?(0,f.jsx)("div",{className:"chat-turn-spacer","aria-hidden":"true","data-position":"before","data-hidden-turns":S.beforeCount,style:ug(S.beforeCount)}):null,S.turns.map(e=>{let t=e.user,a=e.id===A;return(0,f.jsxs)("div",{className:"chat-turn",style:uf,children:[(0,f.jsx)("div",{className:"chat-turn-cell chat-turn-prompt","data-chat-question-id":t===null||t===void 0?void 0:t.id,ref:null!==t&&void 0!==k?e=>k(t.id,e):void 0,children:null!==t?(0,f.jsx)(uz,{message:t,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:s,windowId:o,layout:"turn"}):null}),(0,f.jsxs)("div",{className:"chat-turn-cell chat-turn-answer",children:[e.responses.map((t,u)=>(0,f.jsx)(uz,{message:t,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:s,windowId:o,layout:"turn",onRegenerate:h,onCancelRegenerate:p,showRegenerate:v&&E===t.id,regenerating:c===t.id,streaming:void 0===D&&"streaming"===l&&"assistant"===t.role&&a&&u===e.responses.length-1},t.id)),void 0!==D&&a?(0,f.jsx)(uz,{message:D,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:s,windowId:o,layout:"turn",streaming:"streaming"===l},D.id):null]})]},e.id);}),S.afterCount>0?(0,f.jsx)("div",{className:"chat-turn-spacer","aria-hidden":"true","data-position":"after","data-hidden-turns":S.afterCount,style:ug(S.afterCount)}):null,void 0!==D&&0===C.length?(0,f.jsxs)("div",{className:"chat-turn",children:[(0,f.jsx)("div",{className:"chat-turn-cell chat-turn-prompt"}),(0,f.jsx)("div",{className:"chat-turn-cell chat-turn-answer",children:(0,f.jsx)(uz,{message:D,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:s,windowId:o,layout:"turn",streaming:"streaming"===l})})]},D.id):null,a&&"streaming"!==l?(0,f.jsxs)("div",{className:"chat-turn chat-turn-pending",children:[(0,f.jsx)("div",{className:"chat-turn-cell chat-turn-prompt"}),(0,f.jsx)("div",{className:"chat-turn-cell chat-turn-answer",children:(0,f.jsxs)("div",{className:"chatw-typing-row",children:[(0,f.jsx)(uP,{}),dd(u)?(0,f.jsx)("button",{type:"button",className:"grounded-cancel-btn","aria-label":x("chat.grounded.cancel"),onClick:d,children:x("common.cancel")}):null]})})]}):null]});});function uV(e){return void 0===e?[]:(0,e$.V)(void 0!==e.connectedScopes?e.connectedScopes:void 0!==e.connectedScope?[e.connectedScope]:[],e.projectPath);}function uU(e,t="picker"){return{id:A(e.root,e.path),root:e.root,path:e.path,name:e.name,directory:e.directory,verified:!0,source:t};}function uW(e,t){var _r;let n=Math.max(0,Math.min(t,e.length)),r=e.slice(0,n),i=r.lastIndexOf("@");if(i<0)return null;let s=0===i?"":(_r=r[i-1])!==null&&_r!==void 0?_r:"";if(s.length>0&&!/\s|[([{]/u.test(s))return null;let o=r.slice(i+1);return o.includes("@")||/\s/u.test(o)?null:{start:i,end:n,query:o};}function uK(e,t){switch(e){case"source":return t("chat.repository.role.source");case"test":return t("chat.repository.role.test");case"config":return t("chat.repository.role.config");case"docs":return t("chat.repository.role.docs");case"generated":return t("chat.repository.role.generated");case"asset":return t("chat.repository.role.asset");case"other":case void 0:return t("chat.repository.role.file");}}function uH(e,t){return e instanceof Error&&"EMPTY_REPOSITORY_FILE_SELECTION"===e.message?t("chat.repository.selectFirst"):e instanceof Error&&"REPOSITORY_FILE_SCOPE_LIMIT"===e.message?t("chat.repository.limit",{count:50}):(0,O.A)(e,t("chat.repository.error.reference"));}function uJ({roots:e,selectedRoot:t,onRootChange:n,search:r,pickingPath:i,highlightedIndex:s,pickError:o,onPick:a,onClose:l}){var _e$find,_u$label;let c=(0,m.a)(),u=(_e$find=e.find(e=>e.root===t))!==null&&_e$find!==void 0?_e$find:e[0],d=o!==null&&o!==void 0?o:r.error,h=(0,y.useRef)(null),p=e=>{e.stopPropagation();};return(0,y.useEffect)(()=>{let e=h.current;if(null===e)return;let t=e.querySelector('[data-highlighted="true"]');t===null||t===void 0||t.scrollIntoView({block:"nearest"});},[s,r.results]),(0,f.jsxs)("div",{className:"repo-focus-popover",onPointerDown:p,onMouseDown:p,children:[(0,f.jsxs)("div",{className:"repo-focus-head",children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("span",{className:"repo-focus-title",children:c("chat.repository.title")}),(0,f.jsx)("span",{className:"repo-focus-subtitle",children:(_u$label=u===null||u===void 0?void 0:u.label)!==null&&_u$label!==void 0?_u$label:c("chat.repository.connectedSource")})]}),(0,f.jsx)("button",{type:"button",className:"repo-focus-close","aria-label":c("chat.repository.closePicker"),onClick:l,children:(0,f.jsx)(ue,{size:13})})]}),e.length>1?(0,f.jsx)(z.f,{triggerClassName:"repo-focus-source-select",value:t,ariaLabel:c("chat.repository.source"),menuTitle:c("chat.repository.connectedRepositories"),menuClassName:"repo-focus-source-menu",menuMinWidth:240,sections:[{options:e.map(e=>({value:e.root,label:e.label}))}],onValueChange:n}):null,(0,f.jsx)("div",{className:"repo-focus-message",role:null===d?"status":"alert",children:d!==null&&d!==void 0?d:r.searching?c("chat.repository.searching"):r.message}),r.results.length>0?(0,f.jsx)("ul",{className:"repo-focus-results",id:uu,"aria-label":c("chat.repository.results"),ref:h,style:eP.$,children:r.results.map((e,t)=>{var n;let r;return(0,f.jsx)("li",{style:ud,children:(0,f.jsxs)("button",{type:"button",className:(r="generated"===e.fileRole||"asset"===e.fileRole,`repo-focus-result${r?" repo-focus-result-secondary":""}`),"data-highlighted":t===s?"true":"false","aria-label":c("chat.repository.reference",{path:e.path}),disabled:null!==i,style:uh,onPointerDown:t=>{0===t.button&&null===i&&(t.preventDefault(),t.stopPropagation(),a(e));},onClick:t=>{t.stopPropagation(),0===t.detail&&null===i&&a(e);},children:[(0,f.jsxs)("span",{className:"repo-focus-result-main",children:[(0,f.jsx)("span",{className:"repo-focus-result-name",children:e.name}),(0,f.jsxs)("span",{className:"repo-focus-result-badges","aria-hidden":"true",children:[(0,f.jsx)("span",{className:(n=e.fileRole,`repo-focus-badge repo-focus-badge-${n!==null&&n!==void 0?n:"other"}`),children:uK(e.fileRole,c)}),"nested-git-root"===e.rootKind?(0,f.jsx)("span",{className:"repo-focus-badge repo-focus-badge-root",children:c("chat.repository.nestedRepo")}):null]})]}),(0,f.jsx)("span",{className:"repo-focus-result-path",children:0===e.directory.length?c("chat.repository.root"):e.directory}),(0,f.jsx)("span",{className:"sr-only",children:`${uK(e.fileRole,c)}; ${function(e,t){switch(e){case"exact":return t("chat.repository.match.exact");case"strong":return t("chat.repository.match.strong");case"path":return t("chat.repository.match.path");case"weak":case void 0:return t("chat.repository.match.weak");}}(e.matchQuality,c)}${"nested-git-root"===e.rootKind?`; ${c("chat.repository.nestedRoot")}`:""}.`})]})},`${e.root}:${e.path}`);})}):null]});}function uG({references:e,onRemove:t}){let n=(0,m.a)();return 0===e.length?null:(0,f.jsx)("ul",{className:"repo-token-strip",style:eP.d,"aria-label":n("chat.repository.references"),children:e.map(e=>(0,f.jsxs)("li",{className:`repo-token${e.verified?"":" repo-token-unverified"}`,title:e.verified?`${e.path} - ${e.root}`:`${n("chat.repository.notVerified")} - ${e.path} - ${e.root}`,children:[(0,f.jsx)("span",{className:"repo-token-icon","aria-hidden":"true",children:(0,f.jsx)(e1.f,{name:e.name})}),(0,f.jsxs)("span",{className:"repo-token-main",children:[(0,f.jsx)("span",{className:"repo-token-name",children:n("scope.pill.file",{name:e.name})}),(0,f.jsx)("span",{className:"repo-token-path",children:0===e.directory.length?(0,e$.e)(e.root):e.directory})]}),e.verified?null:(0,f.jsx)("span",{className:"repo-token-status","aria-label":n("chat.repository.notVerified"),children:n("chat.repository.unverified")}),(0,f.jsx)("button",{type:"button",className:"repo-token-remove","aria-label":n("chat.repository.removeReference",{path:e.path}),onClick:()=>t(e.id),children:(0,f.jsx)(ue,{size:12})})]},e.id))});}function uZ({muted:e,onToggle:t,buttonRef:n,compact:r=!1}){let i=(0,y.useId)(),s=e?"Unmute voice dialogue microphone":"Mute voice dialogue microphone";return(0,f.jsxs)("button",{type:"button",ref:n,className:`cmp-icon cmp-voice cmp-voice-dialog-mute ui-tip${r?" cmp-mode-compact":""}`,"data-muted":e?"true":"false","data-tip":s,"aria-label":s,"aria-pressed":e,"aria-describedby":i,onClick:t,children:[(0,f.jsxs)("span",{className:"cmp-voice-dialog-mic-glyph","aria-hidden":"true",children:[(0,f.jsx)(ut,{size:16}),e?(0,f.jsx)("span",{className:"cmp-voice-dialog-mic-slash"}):null]}),(0,f.jsx)("span",{id:i,className:"sr-only",children:"When muted, Keiko cannot hear your microphone until you unmute."})]});}function uQ({session:e}){var _e$activeChat3;return(0,f.jsx)(eE,{skill:e.markdownSkill,modelId:e.selectedModel,disabled:e.sending||void 0!==e.regeneratingMessageId},(_e$activeChat3=e.activeChat)===null||_e$activeChat3===void 0?void 0:_e$activeChat3.id);}function uY({session:e,selectedModelCapability:t,onAttachFiles:n,controlsNarrow:r=!1}){var i,s,o,a;let l=(0,m.a)(),{models:c,selectedModel:u,setSelectedModel:d,noEligibleModels:h,loading:p}=e,g=h?uo:void 0,v=p||h?"":u!==null&&u!==void 0?u:"",y=l(p?"chat.model.loading":h?"chat.model.noEligible":"chat.model.change");return(0,f.jsxs)("div",{className:"cmp-bar-model",children:[(0,f.jsx)(eJ,{model:t,onFiles:n}),(0,f.jsx)("div",{className:`cmp-model mono ui-tip${r?" cmp-model-compact":" cmp-pill-standard"}`,"data-tip":r?y:void 0,children:(0,f.jsx)(z.f,{triggerClassName:"cmp-model-select",value:v,ariaLabel:l("chat.model.menuTitle"),ariaDescribedBy:g,disabled:p,placeholder:l(p?"chat.model.loading":h?"chat.model.noEligible":"chat.model.menuTitle"),leadingVisual:(0,f.jsx)(un,{size:r?16:13,style:{color:"var(--accent)"}}),menuTitle:l("chat.model.menuTitle"),menuPlacement:"up",attached:!1,menuPopoverMinWidth:300,searchPlaceholder:c.length>=10?l("chat.model.search"):void 0,searchEmptyLabel:l("chat.model.searchEmpty"),menuClassName:"cmp-model-menu",menuMinWidth:r?118:280,mono:!0,onOpen:()=>{(0,eB.s)();},sections:[{options:(i=p,s=h,o=c,a=l,i?[{value:"",label:a("chat.model.loading"),disabled:!0}]:s?[{value:"",label:a("chat.model.noEligible"),disabled:!0}]:o.filter(e=>"chat"===e.kind).map(e=>({value:e.id,label:e.id})))}],onValueChange:e=>{h||p||d(e);}})}),(0,f.jsx)(eb,{session:e}),(0,f.jsx)(uQ,{session:e})]});}function uX({onClick:e}){let t=(0,m.a)();return(0,f.jsx)("button",{type:"button",className:"cmp-icon ui-tip","aria-label":t("chat.voice.batchFinish"),"data-tip":t("chat.voice.batchFinish"),onClick:e,children:(0,f.jsx)(ur,{size:18})});}function u0({voiceMuted:e,onToggleVoiceMute:t,playbackButtonRef:n,voiceDialogActive:r,onToggleVoiceDialog:i,voiceDialogButtonRef:s,canInterrupt:o,onInterrupt:a,compact:l=!1,micMuteAvailable:c=!0,onFinishSpeaking:u}){return(0,f.jsx)("div",{className:"cmp-bar cmp-bar-voice-dialog",children:(0,f.jsxs)("div",{className:"cmp-bar-main cmp-bar-main-voice-dialog",children:[(0,f.jsx)(ne.Q,{active:r,onToggle:i,buttonRef:s,compact:l}),c?(0,f.jsx)(uZ,{muted:e,onToggle:t,buttonRef:n,compact:l}):null,void 0!==u?(0,f.jsx)(uX,{onClick:u}):null,void 0!==a?(0,f.jsx)(ne.Y,{iconOnly:!0,canInterrupt:o,onInterrupt:a}):null]})});}function u1({sending:e,cancelSend:t,sendBlocked:n,noEligibleModels:r,loading:i,sendDescribedBy:s}){let o=(0,m.a)();return e?(0,f.jsx)("button",{type:"button",className:"cmp-send cmp-send-cancel cmp-tip-end","data-on":!0,"aria-label":o("chat.send.cancel"),"data-tip":o("chat.send.cancel"),onClick:e=>{e.preventDefault(),t(),(0,R.v)("Keiko composer cancellation requested.",{composerActivity:"send-cancel-requested"});},children:(0,f.jsx)(ue,{size:16})}):(0,f.jsx)("button",{type:n?"button":"submit",className:"cmp-send cmp-tip-end","data-on":!n,"data-tip":o(r?"chat.send.noModel":i?"chat.send.connecting":"chat.send.label"),"aria-disabled":n,"aria-describedby":s,"aria-label":o("chat.send.label"),children:(0,f.jsx)(ur,{size:16})});}function u2({session:e,ready:t,selectedModelCapability:n,onAttachFiles:r,controlsNarrow:i=!1,barCompact:s=!1,voiceDictationVisible:o,dictation:a,micButtonRef:l,voiceSpeechOutputVisible:c,voiceMuted:u,onToggleVoiceMute:d,playbackButtonRef:h,voiceDialogAvailable:p,voiceDialogActive:g,onToggleVoiceDialog:v,voiceDialogButtonRef:y}){var _b;var k,b;let x=(0,m.a)(),{draft:w,noEligibleModels:C,loading:S,sending:D,cancelSend:A}=e,E=C||!t,M=0===w.trim().length,N=(k=(0,ew.y)(e.markdownSkill),C?uo:S?uc:k?ul:M?ua:void 0);return(0,f.jsxs)("div",{className:`cmp-bar${s?" cmp-bar-compact":""}`,children:[(0,f.jsx)(uY,{session:e,selectedModelCapability:n,onAttachFiles:r,controlsNarrow:i}),(0,f.jsx)(te,{controller:a,visible:o}),(0,f.jsxs)("div",{className:"cmp-bar-main",children:[o?(0,f.jsx)(e4.l,{phase:a.phase,insertionPending:(0,e3.j)(a),onStart:a.start,onStop:a.stop,buttonRef:l,compact:i}):null,p?(0,f.jsx)(ne.Q,{active:g,onToggle:v,buttonRef:y,compact:i}):null,c?(0,f.jsx)(tw.f,{muted:u,onToggle:d,buttonRef:h,compact:i}):null,(0,f.jsx)(u1,{sending:D,cancelSend:A,sendBlocked:E,noEligibleModels:C,loading:S,sendDescribedBy:N})]}),N===ul?(0,f.jsx)("span",{id:ul,className:"sr-only",children:(b=e.markdownSkill,x(((_b=b)===null||_b===void 0?void 0:_b.busy)===!0?"chat.skills.loading":"chat.skills.sendBlocked"))}):null,N===ua?(0,f.jsx)("span",{id:ua,className:"sr-only",children:x("chat.send.hint")}):null]});}function u3({transition:e}){let t=(0,m.a)();return void 0===e?null:(0,f.jsx)("p",{className:g.default.cmpDraftNotice,role:"status","aria-live":"polite",children:t("pending"===e?"chat.grounding.sourceUpdatePending":"chat.grounding.sourceUpdateFailed")});}function u6(){let e=(0,m.a)();return(0,f.jsx)("div",{id:uo,role:"alert",className:"gw-error cmp-no-model",children:e("chat.noModelAlert")});}function u5(){let e=(0,m.a)();return(0,f.jsxs)("output",{id:uc,className:"cmp-loading-status",children:[(0,f.jsx)("span",{className:"cmp-loading-dot","aria-hidden":"true"}),e("chat.loadingGateway")]});}function u4({status:e}){let t=function(e,t){switch(e){case"queued":return t("chat.send.statusQueued");case"contacting":return t("chat.send.statusContacting");case"streaming":return t("chat.send.statusStreaming");case"cancelled":return t("chat.send.statusCancelled");default:return"";}}(e,(0,m.a)());return(0,f.jsx)("div",{role:"status","aria-live":"polite","data-send-status":e,className:"cmp-send-status",children:0===t.length?null:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"cmp-loading-dot","aria-hidden":"true"}),t]})});}function u9(e){var _ref2,_e$pickError;return(0,f.jsxs)("div",{className:"repo-focus repo-focus-inline",children:[(0,f.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite",children:(_ref2=(_e$pickError=e.pickError)!==null&&_e$pickError!==void 0?_e$pickError:e.search.error)!==null&&_ref2!==void 0?_ref2:e.search.message}),(0,f.jsx)(uJ,{...e})]});}function u8({voiceDialogActive:e,sendStatus:t,voiceDictationVisible:n,dictation:r}){return(0,f.jsxs)(f.Fragment,{children:[e?null:(0,f.jsx)(u4,{status:t}),!e&&n?(0,f.jsx)(e4.G,{error:r.error,emptyResult:r.emptyResult}):null]});}function u7({attachments:e,onRemove:t}){let n=(0,m.a)();return 0===e.length?null:(0,f.jsxs)("div",{className:g.default["cmp-voice-attachments"],children:[(0,f.jsx)("p",{className:g.default["cmp-voice-attachments-label"],children:n("attachment.voiceStaged")}),(0,f.jsx)(eK,{attachments:e,onRemove:t})]});}function de({dialogue:e,onUseFailedTranscript:t}){var _e$error,_e$dictation$error;let n=(0,m.a)(),r=(_e$error=e.error)!==null&&_e$error!==void 0?_e$error:(_e$dictation$error=e.dictation.error)===null||_e$dictation$error===void 0?void 0:_e$dictation$error.message;return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{className:"sr-only",children:n("chat.voice.batchMode")}),void 0!==r?(0,f.jsxs)("div",{role:"alert",className:"cmp-voice-memory-error",children:[r,(0,f.jsx)("button",{type:"button",onClick:e.retry,children:n("chat.voice.batchRetry")}),void 0!==e.failedTranscript?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:g.default.cmpBatchFailedTranscript,children:e.failedTranscript}),(0,f.jsx)("button",{type:"button",onClick:t,children:n("chat.voice.batchUseText")})]}):null]}):null]});}function dt({active:e,transcript:t,controller:n,batchActive:r,onDismiss:i}){return(0,f.jsxs)(f.Fragment,{children:[e&&void 0!==t?(0,f.jsx)("p",{className:g.default["cmp-partial-transcript"],"aria-live":"off",children:t}):null,!r&&e&&"error"===n.phase?(0,f.jsx)(t3,{controller:n,onAfterDismiss:i}):null]});}function dn({voiceAuraActive:e,announcedVoiceHeadline:t,voiceDialogAvailable:n,voiceLayerRef:r,voiceDialogActive:i,partialUserTranscript:s,realtimeVoiceMuted:o,realtimeVoiceController:a,batchDialogue:l,batchActive:c,onUseFailedTranscript:u,onToggleVoiceMute:d,playbackButtonRef:h,onToggleVoiceDialog:p,onDismissVoiceError:m,voiceDialogButtonRef:v,compact:y,pendingAttachments:k,onRemoveAttachment:b}){return(0,f.jsxs)(f.Fragment,{children:[e?(0,f.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:t}):null,n?(0,f.jsx)("div",{ref:r,className:`${g.default.composerLayer} ${g.default.voiceLayer}`,"data-composer-layer":"voice","aria-hidden":!i||void 0,children:(0,f.jsxs)("div",{className:g.default["cmp-voice-content"],children:[c?(0,f.jsx)("p",{className:g.default.cmpBatchModeLabel,children:t}):null,c?(0,f.jsx)(de,{dialogue:l,onUseFailedTranscript:u}):null,(0,f.jsx)(dt,{active:i,transcript:s,controller:a,batchActive:c,onDismiss:m}),i?(0,f.jsx)(u7,{attachments:k,onRemove:b}):null,(0,f.jsx)(u0,{voiceMuted:o,onToggleVoiceMute:d,playbackButtonRef:h,voiceDialogActive:i,onToggleVoiceDialog:p,canInterrupt:c?l.canInterrupt:a.canInterrupt,onFinishSpeaking:function(e,t){if(t&&!e.waitingForAnswer&&!e.canInterrupt)return"recording"===e.dictation.phase?e.dictation.stop:void 0;}(l,c),onInterrupt:function(e,t,n){return void 0!==e?e.canInterrupt?e.interrupt:void 0:t&&"connected"===n.phase?n.interrupt:void 0;}(c?l:void 0,i,a),micMuteAvailable:!c,voiceDialogButtonRef:v,compact:y})]})}):null]});}let dr=(0,y.memo)(function({ready:e,placeholder:t,inputRef:n,suspended:r=!1,minimal:i=!1,compact:s=!1,controlsNarrow:o=!1,barCompact:a=!1}){var _en$profile,_te$0$root,_te$,_tp$query,_q$id;var l,c,u;let d,h,p=(0,m.a)(),v=(0,H.E)(),{draft:k,sending:w,sendStatus:C,setDraft:S,sendMessage:M,enqueueCanonicalVoiceTurn:_,canonicalVoiceCaptureMustPause:I,interruptCanonicalVoiceDelivery:j,models:F,selectedModel:O,pendingAttachments:z,addPendingAttachment:B,removePendingAttachment:P,error:L,messages:$,activeChat:q,replaceChat:U}=v,[W,J]=(0,y.useState)(),[G,Z]=(0,y.useState)(),Q=F.find(e=>e.id===O),Y=(Q===null||Q===void 0?void 0:Q.kind)==="chat"?Q.id:q===null||q===void 0?void 0:q.selectedModel,X=F.some(e=>e.id===Y&&"chat"===e.kind),ee=void 0!==Q&&(Q.supportsImageInput||Q.supportsDocumentInput),et=(0,y.useCallback)(async e=>{let{reason:t,mime:n}=await e.reduce(async(e,t)=>{let n=await e,r=await B(t);return r.ok||void 0!==n.reason?n:{reason:r.reason,mime:t.type};},Promise.resolve({reason:void 0,mime:void 0}));J(t),Z(n);},[B]),en=(0,e2.f)(),{voiceDictationVisible:er,liveDictationEnabled:ei}=(h=(d=(0,e2.h)(en)&&(0,e6.k)())&&(0,e2.o)(en)&&(0,e5.z)(),{voiceDictationVisible:d,liveDictationEnabled:h}),es=(0,e2.e)(en),eo=(0,y.useRef)(null),ea=(0,y.useRef)(null),el=(0,y.useRef)(null),ec=(0,y.useRef)(null),eu=(0,y.useId)(),ed=(0,y.useCallback)(e=>{var _n$current;S(0===k.trim().length?e:`${k.trimEnd()} ${e}`),(_n$current=n.current)===null||_n$current===void 0?void 0:_n$current.focus();},[k,S,n]),eh=(0,e3.J)({onInsert:ed,insertOnComplete:!0,availableCharacters:(0,e3.y)(k),contextKey:q===null||q===void 0?void 0:q.id,captureOwner:eu,realtime:{enabled:ei}}),ep=(0,tC.v)({capability:en,captureOwner:eu}),{cancel:ef}=eh,{leave:em}=ep;(0,y.useEffect)(()=>{r&&(ef(),em());},[ef,em,r]);let[eg,ev]=(0,y.useState)(null),ey=(0,y.useRef)(q===null||q===void 0?void 0:q.id);ey.current=q===null||q===void 0?void 0:q.id;let ek=(0,y.useRef)(void 0),eb=(0,y.useRef)("none"),ex=(0,y.useRef)(void 0),eC=ek.current,eS=void 0!==eC,eD=ep.active&&eC===(q===null||q===void 0?void 0:q.id),eA=(0,y.useRef)(0),eE=(0,y.useRef)(q===null||q===void 0?void 0:q.id);(0,y.useEffect)(()=>{eE.current!==(q===null||q===void 0?void 0:q.id)&&(eE.current=q===null||q===void 0?void 0:q.id,eA.current+=1);},[q===null||q===void 0?void 0:q.id]);let eM=(0,y.useRef)(new Set()),eN=(0,y.useRef)(new Map()),e_=(0,y.useRef)(!0);(0,y.useEffect)(()=>(e_.current=!0,()=>{e_.current=!1;}),[]),(0,y.useEffect)(()=>{(eg===null||eg===void 0?void 0:eg.chatId)!==(q===null||q===void 0?void 0:q.id)&&null!==eg&&ev(null);},[q===null||q===void 0?void 0:q.id,eg]);let eT=null===eg||eg.chatId!==(q===null||q===void 0?void 0:q.id)||eg.dialogGeneration!==eA.current?void 0:$.find(e=>e.id===eg.assistantMessageId&&e.chatId===eg.chatId&&"assistant"===e.role),eR=function(e,_e$synthesize,_e$synthesize2,_e$createAudio,_e$createAudio2,_e$createObjectUrl,_e$createObjectUrl2,_e$revokeObjectUrl,_e$revokeObjectUrl2,_e$createStreamingSin,_e$createStreamingSin2){let{profile:t,enabled:n,text:r,messageId:i,replayAllowed:s,turnManager:o,persona:a}=e,l=function(e){let{profile:t,replayAllowed:n,turnManager:r}=e,i=(0,y.useMemo)(()=>function(e,_e$clock){let{profile:t}=e,n=(_e$clock=e.clock)!==null&&_e$clock!==void 0?_e$clock:tc(),r=e.observer,i={playbackAllowed:(0,tr.e)("playback.state",t),interruptAllowed:(0,tr.e)("control.interrupt",t),replayAllowed:!0===e.replayAllowed},s=td(t);function o(){return{profile:t,available:i.playbackAllowed,phase:s.phase,active:to(s.phase),settled:ta(s.phase),speaking:"speaking"===s.phase,paused:"paused"===s.phase,muted:s.muted,replayAllowed:i.replayAllowed,spoke:s.spoke,interruptions:s.interruptions,replays:s.replays,wireState:tl(s.phase),failureKind:s.failureKind,lastInterruptAtMs:s.lastInterruptAtMs};}function a(e,t,n){var _r$onTransition;let i=s.phase,o=void 0===s.lastTransitionAtMs?0:n-s.lastTransitionAtMs;s.phase=e,s.lastTransitionAtMs=n,r===null||r===void 0||(_r$onTransition=r.onTransition)===null||_r$onTransition===void 0?void 0:_r$onTransition.call(r,{from:i,to:e,trigger:t,wireState:tl(e),latencyMs:o});}function l(e){for(let t of e){var _r$onEffect;r===null||r===void 0||(_r$onEffect=r.onEffect)===null||_r$onEffect===void 0||_r$onEffect.call(r,{effect:t,phase:s.phase});}}return{dispatch:function(e){if(!i.playbackAllowed||!tu[e.kind](i))return{outcome:"not-allowed-for-profile",effects:[],snapshot:o()};let t=s.phase,c=s.muted,u=function(e,t,_r$onInterrupt){switch(e.kind){case"prepare":return"unavailable"===s.phase||ta(s.phase)?(s.spoke=!1,s.failureKind=void 0,a("preparing","prepare",t),l(["request-synthesis"]),["request-synthesis"]):[];case"play-started":if("preparing"!==s.phase)return[];s.spoke=!0,a("speaking","play-started",t);let n=["start-output","notify-turn-speech-start"];return l(n),n;case"pause":return"speaking"!==s.phase?[]:(a("paused","pause",t),l(["pause-output"]),["pause-output"]);case"resume":return"paused"!==s.phase?[]:(a("speaking","resume",t),l(["resume-output"]),["resume-output"]);case"interrupt":var i=e.atMs;if("speaking"!==s.phase&&"paused"!==s.phase)return[];let o="number"==typeof i&&Number.isFinite(i)?i:void 0;s.interruptions+=1,s.lastInterruptAtMs=o,a("interrupted","interrupt",t);let c=["stop-output","notify-turn-interrupt"];return l(c),r!==null&&r!==void 0&&(_r$onInterrupt=r.onInterrupt)!==null&&_r$onInterrupt!==void 0&&_r$onInterrupt.call(r,{phase:s.phase,atMs:o,interruptions:s.interruptions}),c;case"stop":if(!to(s.phase))return[];a("canceled","stop",t);let u=["stop-output","notify-turn-speech-stopped"];return l(u),u;case"fail":var d=e.failure;if("preparing"!==s.phase&&"speaking"!==s.phase)return[];s.failureKind=d,a("failed","fail",t);let h=["stop-output","notify-turn-speech-stopped"];return l(h),h;case"complete":return to(s.phase)?(a("complete","complete",t),l(["notify-turn-speech-completed"]),["notify-turn-speech-completed"]):[];case"replay":return ta(s.phase)?(s.replays+=1,s.spoke=!1,s.failureKind=void 0,a("preparing","replay",t),l(["request-synthesis"]),["request-synthesis"]):[];case"set-muted":var p=e.muted;if(s.muted===p)return[];s.muted=p;let f=p?"mute-output":"unmute-output";return l([f]),[f];}}(e,n.now());return{outcome:s.phase!==t||s.muted!==c||u.length>0?"transitioned":"no-op",effects:u,snapshot:o()};},snapshot:o,reset:function(){s=td(t);}};}({profile:t,replayAllowed:n}),[t,n]),[s,o]=(0,y.useState)(()=>i.snapshot());(0,y.useEffect)(()=>{o(i.snapshot());},[i]);let a=(0,y.useRef)(!0);(0,y.useEffect)(()=>(a.current=!0,()=>{a.current=!1;}),[]);let l=(0,y.useCallback)(e=>{let t=i.dispatch(e);void 0!==r&&function(e,t){for(let n of e.effects){let r=function(e,t){switch(e){case"notify-turn-speech-start":return{kind:"assistant-speech-start"};case"notify-turn-speech-completed":return{kind:"assistant-speech-end",how:"completed"};case"notify-turn-speech-stopped":return{kind:"assistant-speech-end",how:"stopped"};case"notify-turn-interrupt":return{kind:"user-interrupt",atMs:t};default:return;}}(n,e.snapshot.lastInterruptAtMs);void 0!==r&&t.apply(r);}}(t,r),a.current&&o(t.snapshot);},[i,r]),c=(0,y.useCallback)(()=>{l({kind:"set-muted",muted:!i.snapshot().muted});},[i,l]),u=(0,y.useCallback)(e=>l({kind:"set-muted",muted:e}),[l]),d=(0,y.useCallback)(()=>l({kind:"pause"}),[l]),h=(0,y.useCallback)(()=>l({kind:"resume"}),[l]),p=(0,y.useCallback)(()=>l({kind:"stop"}),[l]),f=(0,y.useCallback)(e=>l({kind:"interrupt",atMs:e}),[l]),m=(0,y.useCallback)(()=>l({kind:"replay"}),[l]),g=(0,y.useCallback)(()=>l({kind:"prepare"}),[l]),v=(0,y.useCallback)(()=>l({kind:"play-started"}),[l]),k=(0,y.useCallback)(()=>l({kind:"complete"}),[l]);return{snapshot:s,toggleMute:c,setMuted:u,pause:d,resume:h,stop:p,interrupt:f,replay:m,prepare:g,playStarted:v,complete:k,fail:(0,y.useCallback)(e=>l({kind:"fail",failure:e}),[l]),reset:(0,y.useCallback)(()=>{i.reset(),a.current&&o(i.snapshot());},[i])};}({profile:t,replayAllowed:s,turnManager:o}),c=(0,y.useRef)(l);c.current=l;let u=(0,y.useRef)((_e$synthesize=e.synthesize)!==null&&_e$synthesize!==void 0?_e$synthesize:tv(a));u.current=(_e$synthesize2=e.synthesize)!==null&&_e$synthesize2!==void 0?_e$synthesize2:tv(a);let d=(0,y.useRef)(e.preparation);d.current=e.preparation;let h=(0,y.useRef)((_e$createAudio=e.createAudio)!==null&&_e$createAudio!==void 0?_e$createAudio:ty);h.current=(_e$createAudio2=e.createAudio)!==null&&_e$createAudio2!==void 0?_e$createAudio2:ty;let p=(0,y.useRef)((_e$createObjectUrl=e.createObjectUrl)!==null&&_e$createObjectUrl!==void 0?_e$createObjectUrl:tk);p.current=(_e$createObjectUrl2=e.createObjectUrl)!==null&&_e$createObjectUrl2!==void 0?_e$createObjectUrl2:tk;let f=(0,y.useRef)((_e$revokeObjectUrl=e.revokeObjectUrl)!==null&&_e$revokeObjectUrl!==void 0?_e$revokeObjectUrl:tb);f.current=(_e$revokeObjectUrl2=e.revokeObjectUrl)!==null&&_e$revokeObjectUrl2!==void 0?_e$revokeObjectUrl2:tb;let m=(0,y.useRef)(null),g=(0,y.useRef)(null),v=(0,y.useRef)(null),k=(0,y.useRef)({id:void 0,nonce:0}),[b,x]=(0,y.useState)(0),w=(0,y.useRef)((_e$createStreamingSin=e.createStreamingSink)!==null&&_e$createStreamingSin!==void 0?_e$createStreamingSin:tg);w.current=(_e$createStreamingSin2=e.createStreamingSink)!==null&&_e$createStreamingSin2!==void 0?_e$createStreamingSin2:tg;let C=(0,y.useRef)(void 0),S=(0,y.useCallback)(()=>{var _C$current;return(_C$current=C.current)!==null&&_C$current!==void 0?_C$current:C.current=w.current(),C.current;},[]),D=(0,y.useRef)(a);D.current=a;let A=(0,y.useRef)(e.onSettled);A.current=e.onSettled;let E=(0,y.useRef)(void 0),M=(0,y.useCallback)(e=>{var _A$current;E.current!==e&&(E.current=e,(_A$current=A.current)===null||_A$current===void 0?void 0:_A$current.call(A,e));},[]),N=(0,y.useCallback)(()=>{var _g$current,_C$current2;(_g$current=g.current)!==null&&_g$current!==void 0&&_g$current.abort(),g.current=null,(_C$current2=C.current)===null||_C$current2===void 0?void 0:_C$current2.stop();let e=m.current;if(null!==e){e.onplaying=null,e.onended=null,e.onerror=null;try{e.pause();}catch{}e.src="",m.current=null;}null!==v.current&&(f.current(v.current),v.current=null);},[]),_=l.snapshot.available;(0,y.useEffect)(()=>{var e;let t,s=c.current;if(!n||!_||void 0===i||void 0===r||0===r.trim().length||k.current.id===i&&k.current.nonce===b)return;let o=k.current.id===i;if(k.current={id:i,nonce:b},s.snapshot.muted&&!o)return void M(i);let a={current:!1},l=new AbortController();g.current=l;let f=(e=d.current,t=(0,T.y)(),void 0!==e&&(0,R.v)("Keiko chat answer prepared for speech.",{answerSpeech:e,correlationId:t}),t);s.prepare();let y=()=>M(i),x=()=>{let e=h.current();e.muted=!1,m.current=e,Promise.resolve(u.current(r,l.signal,f)).then(t=>{if(a.current||l.signal.aborted)return;let n=new Blob([(0,tn.p)(t.audio)],{type:t.mimeType}),r=p.current(n);return v.current=r,e.src=r,e.onplaying=()=>{a.current||c.current.playStarted();},e.onended=()=>{a.current||(c.current.complete(),N(),y());},e.onerror=()=>{a.current||(c.current.fail("internal"),N(),y());},Promise.resolve(e.play()).catch(e=>{a.current||tx(e)||(c.current.fail("internal"),N(),y());});}).catch(e=>{a.current||tx(e)||(c.current.fail(function(e){if(e instanceof tt.a)switch(e.code){case"VOICE_RATE_LIMITED":return"rate-limited";case"VOICE_TIMEOUT":return"timeout";case"VOICE_UNAVAILABLE":return"unavailable";default:return"provider-error";}return"internal";}(e)),N(),M(i));});},w=S();return void 0===w?x():w.play({text:r,...(void 0!==D.current?{persona:D.current}:{})},l.signal,{onStart:()=>{a.current||c.current.playStarted();},onEnded:()=>{a.current||(c.current.complete(),N(),M(i));},onError:()=>{a.current||l.signal.aborted||(c.current.fail("internal"),N(),M(i));}},f).then(e=>{e||a.current||l.signal.aborted||x();}).catch(()=>{a.current||l.signal.aborted||x();}),()=>{a.current=!0,N();};},[n,_,r,i,b,N,M,S]),(0,y.useEffect)(()=>()=>{var _C$current3;(_C$current3=C.current)!==null&&_C$current3!==void 0&&_C$current3.dispose(),C.current=void 0;},[]);let I=(0,y.useCallback)(e=>{c.current.setMuted(e),e&&(N(),c.current.snapshot.active&&c.current.stop());},[N]),j=(0,y.useCallback)(()=>{I(!c.current.snapshot.muted);},[I]),F=(0,y.useCallback)(()=>{var _m$current;(_m$current=m.current)!==null&&_m$current!==void 0&&_m$current.pause(),c.current.pause();},[]),O=(0,y.useCallback)(()=>{let e=m.current;null!==e&&Promise.resolve(e.play()).catch(()=>{}),c.current.resume();},[]),z=(0,y.useCallback)(()=>{N(),c.current.stop();},[N]),B=(0,y.useCallback)(e=>{N();let{phase:t,active:n}=c.current.snapshot;"speaking"===t||"paused"===t?c.current.interrupt(e):n&&c.current.stop();},[N]),P=(0,y.useCallback)(()=>{x(e=>e+1),c.current.replay();},[]),L=(0,y.useCallback)(()=>{var _S;(_S=S())===null||_S===void 0||_S.primeFromUserGesture();},[S]);return(0,y.useMemo)(()=>({snapshot:l.snapshot,toggleMute:j,setMuted:I,pause:F,resume:O,stop:z,interrupt:B,replay:P,prepare:l.prepare,playStarted:l.playStarted,complete:l.complete,fail:l.fail,reset:l.reset,primeAudioOutput:L}),[l,j,I,F,O,z,B,P,L]);}({profile:(_en$profile=en===null||en===void 0?void 0:en.profile)!==null&&_en$profile!==void 0?_en$profile:"none",enabled:eD&&void 0!==eT,text:void 0===eT?void 0:ux(eT),preparation:void 0===eT?void 0:uD(eT),messageId:eT===null||eT===void 0?void 0:eT.id,persona:ep.persona,onSettled:e=>{var _ex$current;return(_ex$current=ex.current)===null||_ex$current===void 0?void 0:_ex$current.call(ex,e);}}),eI=eR.primeAudioOutput,ej=(0,ew.L)(v.markdownSkill),eF=(0,y.useCallback)(({turnId:e,text:t,correlationId:n})=>{var r,i;if(void 0===q||void 0===Y)return!1;let s=q.id,o=eA.current,a=`${s}:${e}`;if(r=eM.current,i=eN.current,r.has(a)||i.has(a))return!0;let l=_===null||_===void 0?void 0:_({text:t,clientTurnId:e,...(void 0===n?{}:{correlationId:n}),target:{chat:q,modelId:Y,expectedSkillSelectionRevision:ej},allowReservedCapacity:!0});if(void 0!==_&&void 0===l)return!1;let c=(l!==null&&l!==void 0?l:up(M,t,e,n)).then(e=>{var t;return t={activeChatId:ey.current,admittedTurnIds:eM.current,chatId:s,composerMounted:e_.current,currentDialogGeneration:eA.current,deliveryKey:a,dialogGeneration:o,setPendingVoiceAnswer:ev},("completed"===e.status||"cancelled"===e.status&&e.userPersisted||"failed"===e.status&&!0===e.userPersisted)&&function(e,t){if(!e.has(t)){if(e.size>=128){let t=e.values().next().value;void 0!==t&&e.delete(t);}e.add(t);}}(t.admittedTurnIds,t.deliveryKey),"completed"===e.status&&t.composerMounted&&t.activeChatId===t.chatId&&t.currentDialogGeneration===t.dialogGeneration&&t.setPendingVoiceAnswer({chatId:t.chatId,assistantMessageId:e.assistantMessageId,dialogGeneration:t.dialogGeneration}),e;}).finally(()=>{eN.current.delete(a);});return eN.current.set(a,c),void 0===l||(I===null||I===void 0?void 0:I())!==!0||"accepted-stop";},[q,I,Y,ej,_,M]),eO=(0,y.useCallback)((e,t)=>{let n=q===null||q===void 0?void 0:q.id;if(void 0===n)return;let r=crypto.randomUUID();if(!1!==eF({turnId:r,text:e,correlationId:t}))return eN.current.get(`${n}:${r}`);},[q===null||q===void 0?void 0:q.id,eF]),ez=function(e,_e$dictation){var t;let n=function(e){let t,n,r=(0,y.useRef)(e);r.current=e;let i=(0,y.useRef)({active:!1,generation:0,expectedAnswerId:void 0,expectedAnswerCorrelationId:void 0,sessionCorrelationId:void 0}),[s,o]=(0,y.useState)(!1),[a,l]=(0,y.useState)(void 0),[c,u]=(0,y.useState)(),d=(0,y.useCallback)(e=>{var t;let n=i.current;if(!n.active)return;let s=crypto.randomUUID(),a=r.current(e,s);if(void 0===a){tG("queue-unavailable",s,n.sessionCorrelationId),u(e),l("The spoken turn could not be queued. You can retry or continue in text.");return;}tG("turn-submitted",s,n.sessionCorrelationId),o(!0);let c=n.generation;t={setWaiting:o,setError:l,setFailedTranscript:u},a.then(r=>function(e,t,n,r,i,s){if(tZ(t,n)){if("completed"===e.status){t.expectedAnswerId=e.assistantMessageId,t.expectedAnswerCorrelationId=i,tG("answer-ready",i,t.sessionCorrelationId);return;}tG("cancelled"===e.status?"delivery-cancelled":"delivery-failed",i,t.sessionCorrelationId),s.setWaiting(!1),s.setFailedTranscript(r),s.setError("cancelled"===e.status?"The spoken turn was cancelled. You can retry or continue in text.":"The spoken turn could not be completed. You can retry or continue in text.");}}(r,n,c,e,s,t),()=>{tZ(n,c)&&(tG("delivery-rejected",s,n.sessionCorrelationId),t.setWaiting(!1),t.setFailedTranscript(e),t.setError("The spoken turn failed. You can retry or continue in text."));});},[r,i,o,l,u]),{activate:h,deactivate:p,clearError:f,takeSettledAnswer:m}=(t=(0,y.useCallback)(()=>{tQ(i.current,!0,o,l,u);},[i,o,l,u]),n=(0,y.useCallback)(()=>{tQ(i.current,!1,o,l,u);},[i,o,l,u]),{activate:t,deactivate:n,clearError:(0,y.useCallback)(()=>{l(void 0),u(void 0);},[l,u]),takeSettledAnswer:(0,y.useCallback)((e,t=!1)=>{let n=i.current;return!!n.active&&n.expectedAnswerId===e&&(n.expectedAnswerId=void 0,o(!1),tG(t?"interrupted":"playback-settled",n.expectedAnswerCorrelationId,n.sessionCorrelationId),n.expectedAnswerCorrelationId=void 0,!0);},[i,o])});return{flagsRef:i,waitingForAnswer:s,error:a,failedTranscript:c,acceptTranscript:d,activate:h,deactivate:p,clearError:f,takeSettledAnswer:m};}(e.submit),{flagsRef:r,acceptTranscript:i,activate:s,deactivate:o,clearError:a,takeSettledAnswer:l}=n,c=(0,y.useRef)(()=>{}),u=(t=(_e$dictation=e.dictation)===null||_e$dictation===void 0?void 0:_e$dictation.vad,(0,y.useMemo)(()=>{let e=t!==null&&t!==void 0?t:(0,tJ.f)();return{start(t,n){let r=!1,i=e.start(t,e=>{r||(n(e),"speech-onset"===e&&c.current());});return{get available(){return!0===i.available;},stop(){r=!0,i.stop();}};}};},[t,c])),d=(0,e3.J)({...e.dictation,onInsert:i,captureOwner:e.captureOwner,captureLease:e.captureLease,...{onSilenceRenewalFailed:e=>{var _n$captureReason,_n2,_n$captureError,_n3;var t;let n;return t=r.current.sessionCorrelationId,n=e instanceof e6.r?e:void 0,void(0,R.v)("[keiko] batch voice dialogue (stage=capture-renewal-failed)",{kind:"voice-dialogue",voiceDialogueStage:"capture-renewal-failed",correlationId:t,voiceCaptureReason:(_n$captureReason=(_n2=n)===null||_n2===void 0?void 0:_n2.captureReason)!==null&&_n$captureReason!==void 0?_n$captureReason:"unknown-failure",voiceCaptureError:(_n$captureError=(_n3=n)===null||_n3===void 0?void 0:_n3.captureError)!==null&&_n$captureError!==void 0?_n$captureError:"other",errorEvidence:(0,K.f)(e)});},onCaptureBoundReached:e=>tG("capture-bound-reached",r.current.sessionCorrelationId,void 0,e),onSilenceRenewed:()=>tG("capture-renewed",r.current.sessionCorrelationId)},vad:u}),{start:h,cancel:p,retry:f}=d;!function(e,t){let n=(0,y.useRef)(!1),{phase:r,transcript:i,discard:s,insert:o,start:a}=e;(0,y.useEffect)(()=>{if("preview"!==r){n.current=!1;return;}if(t.current.active&&!n.current){if(n.current=!0,0===i.trim().length){s(),a();return;}o();}},[r,i,s,o,a,t]);}(d,r);let{start:m,reset:g,preparedRef:v,preparing:k,startupError:b}=function(e,t,n,r,_e$prepareCanonicalVo,_e$prepareCanonicalVo2){let i=(0,y.useRef)((_e$prepareCanonicalVo=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo!==void 0?_e$prepareCanonicalVo:tS.O);i.current=(_e$prepareCanonicalVo2=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo2!==void 0?_e$prepareCanonicalVo2:tS.O;let s=(0,y.useRef)(void 0===e.prepareCanonicalVoiceHasher&&(0,tS.a)()),[o,a]=(0,y.useState)(!1),[l,c]=(0,y.useState)();return{start:(0,y.useCallback)(()=>{if(n(),tG("started",t.current.sessionCorrelationId),c(void 0),s.current)return void r();let e=t.current.generation;a(!0),tY({prepare:i.current,flagsRef:t,generation:e,preparedRef:s,setPreparing:a,setStartupError:c,startDictation:r});},[n,t,r]),preparedRef:s,preparing:o,startupError:l,reset:(0,y.useCallback)(()=>{a(!1),c(void 0);},[])};}(e,r,s,h),x=(0,y.useCallback)(()=>{r.current.active&&tG("stopped",r.current.sessionCorrelationId),o(),g(),p();},[o,g,p,r]),w=(0,y.useCallback)(()=>{r.current.active&&(a(),v.current?f():m());},[r,a,f,v,m]),C=function(e,t){let{phase:n,start:r}=t;return(0,y.useCallback)(t=>{e(t)&&!tX(n)&&r();},[e,n,r]);}(l,d),S=function(e,t,n){let{flagsRef:r,waitingForAnswer:i,takeSettledAnswer:s}=e,{phase:o,start:a}=t,l=(n===null||n===void 0?void 0:n.active)===!0,c=n===null||n===void 0?void 0:n.interrupt,u=(0,y.useCallback)(()=>{let e=r.current,t=e.expectedAnswerId;!l||!e.active||void 0===t||s(t,!0)&&(c!==null&&c!==void 0&&c(),tX(o)||a());},[l,r,o,a,c,s]);return(0,y.useEffect)(()=>{l&&i&&r.current.active&&"idle"===o&&a();},[l,i,r,o,a]),{interrupt:u,canInterrupt:l&&i};}(n,d,e.playback);return c.current=S.interrupt,(0,y.useEffect)(()=>x,[x]),{...S,dictation:d,waitingForAnswer:n.waitingForAnswer,preparing:k,error:b!==null&&b!==void 0?b:n.error,failedTranscript:n.failedTranscript,start:m,stop:x,retry:w,onSpeechSettled:C};}({captureOwner:eu,captureLease:ep.captureLease,submit:eO,playback:{active:eR.snapshot.active,interrupt:eR.interrupt}}),{start:eB,stop:eP}=ez;ex.current=ez.onSpeechSettled;let eL=(0,y.useCallback)(()=>{eA.current+=1,eR.interrupt(),j!==null&&j!==void 0&&j(),ev(null);},[j,eR]),e$=(0,y.useCallback)(()=>(I===null||I===void 0?void 0:I())!==!0,[I]),eq=eD&&w&&dd(q),eV=function(e,_e$createTransport,_e$chatContext,_e$chatContext2,_e$chatContext3,_A$current2,_e$prepareCanonicalVo3,_e$prepareCanonicalVo4,_e$chatContext5,_e$retrieving){let[t,n]=(0,y.useReducer)(tP,tB),r=(0,y.useRef)(function(e,_e$clock2){let t,n,r,i,{profile:s}=e,o=(_e$clock2=e.clock)!==null&&_e$clock2!==void 0?_e$clock2:tc(),a=e.observer,l=(t=(0,tr.e)("media.track.state",s),n=(0,tr.e)("playback.state",s),r=(0,tr.e)("control.interrupt",s),{mediaAllowed:t,playbackAllowed:n,interruptAllowed:r,transcriptAllowed:i=(0,tr.e)("transcript.committed",s),floorControl:t,usesManualCommit:i&&!t,canCaptureUserVoice:t||i}),c=t_(s);function u(){return{profile:s,active:"disabled"!==c.state,state:c.state,floorHolder:tM[c.state],turnIndex:c.turnIndex,interruptions:c.interruptions,backchannels:c.backchannels,pendingCommit:c.pendingCommit,recovering:"recovering"===c.state,lastEndOfTurnAtMs:c.lastEndOfTurnAtMs,lastInterruptAtMs:c.lastInterruptAtMs};}function d(e,t,n){var _a$onTransition;let r=c.state,i=void 0===c.lastTransitionAtMs?0:n-c.lastTransitionAtMs;c.state=e,c.lastTransitionAtMs=n,a===null||a===void 0||(_a$onTransition=a.onTransition)===null||_a$onTransition===void 0?void 0:_a$onTransition.call(a,{from:r,to:e,trigger:t,floorHolder:tM[e],turnIndex:c.turnIndex,latencyMs:i});}function h(e){for(let t of e){var _a$onEffect;a===null||a===void 0||(_a$onEffect=a.onEffect)===null||_a$onEffect===void 0||_a$onEffect.call(a,{effect:t,state:c.state,turnIndex:c.turnIndex});}}function p(e,t,n){var _a$onInterrupt,_a$onInterrupt2;var r;if("idle"===c.state||"listening"===c.state||"recovering"===c.state)return[];if(c.lastInterruptAtMs=t,"yielding"===c.state)return c.interruptions+=1,d("idle","user-interrupt",t),a!==null&&a!==void 0&&(_a$onInterrupt=a.onInterrupt)!==null&&_a$onInterrupt!==void 0&&_a$onInterrupt.call(a,{state:c.state,atMs:e,interruptions:c.interruptions}),[];let i=(r=n,"speaking"===c.state||r?["stop-playback","cancel-speech-generation","preserve-user-turn"]:"thinking"===c.state?["cancel-speech-generation"]:["stop-playback"]);return c.interruptions+=1,d("interrupted","user-interrupt",t),h(i),a!==null&&a!==void 0&&(_a$onInterrupt2=a.onInterrupt)!==null&&_a$onInterrupt2!==void 0&&_a$onInterrupt2.call(a,{state:c.state,atMs:e,interruptions:c.interruptions}),i;}return{apply:function(e){if("none"===s||"disabled"===c.state||!tN[e.kind](l))return{outcome:"not-allowed-for-profile",effects:[],snapshot:u()};let t=c.state,n=c.turnIndex,r=c.pendingCommit,i=function(e,t,_a$onBackchannel){switch(e.kind){case"user-speech-start":var n,r;if("speaking"===c.state){let e=p(t,t,!0);return d("listening","user-speech-start",t),e;}return"thinking"===c.state?(d("listening","user-speech-start",t),h(["preserve-user-turn"]),["preserve-user-turn"]):("listening"===c.state||d("listening","user-speech-start",t),[]);case"user-end-of-turn":return"listening"!==c.state||((c.lastEndOfTurnAtMs=t,l.floorControl)?(c.turnIndex+=1,c.pendingCommit=!1,d("thinking","user-end-of-turn",t)):(c.pendingCommit=!0,d("idle","user-end-of-turn",t))),[];case"dictation-commit":return"idle"===c.state&&c.pendingCommit&&(c.turnIndex+=1,c.pendingCommit=!1,c.lastEndOfTurnAtMs=t,d("idle","dictation-commit",t)),[];case"dictation-discard":return"idle"===c.state&&c.pendingCommit&&(c.pendingCommit=!1,d("idle","dictation-discard",t)),[];case"assistant-speech-start":return"speaking"===c.state||("thinking"===c.state||"idle"===c.state||"interrupted"===c.state)&&d("speaking","assistant-speech-start",t),[];case"assistant-speech-end":return n=e.how,"completed"===n?"speaking"===c.state?d("yielding","assistant-speech-end",t):"thinking"===c.state&&d("idle","assistant-speech-end",t):"speaking"===c.state?d("interrupted","assistant-speech-end",t):"thinking"===c.state&&d("idle","assistant-speech-end",t),[];case"user-interrupt":return p(e.atMs,t,!1);case"backchannel":return c.backchannels+=1,h(["emit-backchannel"]),a!==null&&a!==void 0&&(_a$onBackchannel=a.onBackchannel)!==null&&_a$onBackchannel!==void 0&&_a$onBackchannel.call(a,{state:c.state,backchannels:c.backchannels}),["emit-backchannel"];case"provider-failure":return r=e.recoverable,r?(d("recovering","provider-failure",t),h(["begin-recovery"]),["begin-recovery"]):(d("disabled","provider-failure",t),[]);case"permission-denied":return d("disabled","permission-denied",t),[];case"recovered":return"recovering"===c.state&&d("idle","recovered",t),[];case"session-closed":return d("disabled","session-closed",t),[];}}(e,o.now());return{outcome:c.state!==t||c.turnIndex!==n||c.pendingCommit!==r||i.length>0?"transitioned":"no-op",effects:i,snapshot:u()};},snapshot:u,reset:function(){c=t_(s);}};}({profile:"full-realtime"})),[i,s]=(0,y.useState)(()=>r.current.snapshot()),[o,a]=(0,y.useState)(!1),[l,c]=(0,y.useState)(!1),[u,d]=(0,y.useState)(),h=(_e$createTransport=e.createTransport)!==null&&_e$createTransport!==void 0?_e$createTransport:e5.U,p=(0,y.useRef)(e.chatContext);p.current=e.chatContext;let f=(0,y.useRef)((_e$chatContext=e.chatContext)===null||_e$chatContext===void 0?void 0:_e$chatContext.chatId);f.current=(_e$chatContext2=e.chatContext)===null||_e$chatContext2===void 0?void 0:_e$chatContext2.chatId;let m=(0,y.useRef)(void 0),g=(0,y.useRef)(void 0),v=(0,y.useRef)((_e$chatContext3=e.chatContext)===null||_e$chatContext3===void 0?void 0:_e$chatContext3.chatId),k=(0,y.useMemo)(()=>{var _e$createControl;return(_e$createControl=e.createControl)!==null&&_e$createControl!==void 0?_e$createControl:()=>{var e,t;let n,r,i,s,o,a;return e=void 0,t=p.current,i=e!==null&&e!==void 0?e:e=>new WebSocket(e),s=crypto.randomUUID(),o=crypto.randomUUID(),a=1,{negotiate:e=>new Promise((l,c)=>{let u,d,h,p=a;a+=1;try{let e;n=u=i((e="https:"===location.protocol?"wss:":"ws:",`${e}//${location.host}/api/voice/control`));}catch(e){c(new tA("unavailable",e instanceof Error?e.message:"WebSocket could not be opened."));return;}let f=!1,m=!1,g=!1,v=()=>{void 0!==d&&(clearTimeout(d),d=void 0);},y=e=>{g||(g=!0,v(),r===h&&(r=void 0),c(e));};r=h=()=>{y(new tA("connection-failed","Voice control negotiation was closed."));},d=setTimeout(()=>{d=void 0,y(new tA("connection-failed","Voice control negotiation timed out."));try{u.close();}catch{}},tD),u.addEventListener("error",()=>{f?y(new tA("connection-failed","Voice control connection was lost.")):y(new tA("unavailable","Voice control connection failed."));}),u.addEventListener("close",()=>{f?y(new tA("connection-failed","Voice control connection closed during negotiation.")):y(new tA("unavailable","Voice control connection was closed."));}),u.addEventListener("open",()=>{!g&&(f=!0,u.send(JSON.stringify({protocolVersion:tr.A,sessionId:s,seq:0,direction:"client-to-host",kind:"session.create",idempotencyKey:o,requestedProfile:"full-realtime",negotiationMode:"proxied-sdp",...(void 0!==t?{chatContext:t}:{})})));}),u.addEventListener("message",t=>{let n;if(g)return;try{n=JSON.parse("string"==typeof t.data?t.data:String(t.data));}catch{y(new tA("connection-failed","Received an unparseable control message."));return;}let i=(0,tr.i)(n);if(void 0!==i){var o;if("error"===i.kind)return void y(new tA("negotiation-failed"===i.code?"negotiation-failed":"connection-failed",`Voice control error: ${i.code}`));if("session.created"===i.kind){if(m)return;m=!0,u.send(JSON.stringify({protocolVersion:tr.A,sessionId:s,seq:p,direction:"client-to-host",kind:"signal.sdp.offer",sdp:e}));return;}"signal.sdp.answer"===i.kind&&m&&(o=i.sdp,g||(g=!0,v(),r===h&&(r=void 0),l(o)));}});}),close(e={}){var _r2;if((_r2=r)!==null&&_r2!==void 0&&_r2(),!0!==e.resumable&&void 0!==n)try{var t;n.send(JSON.stringify((t=a,{protocolVersion:tr.A,sessionId:s,seq:t,direction:"client-to-host",kind:"session.close",reason:"client-request"}))),a+=1;}catch{}try{var _n4;(_n4=n)===null||_n4===void 0||_n4.close();}catch{}n=void 0;}};};},[e.createControl]),b=(0,y.useRef)(e.onCanonicalUserTurn),x=(0,y.useRef)(e.onUserSpeechStart),w=(0,y.useRef)(e.canStartCapture),C=(0,y.useRef)(e.turnDetectionProfile),S=(0,y.useRef)(e.turnDetectionProfile),D=(0,y.useRef)(e.latencySink);D.current=e.latencySink;let A=(0,y.useRef)(void 0);(_A$current2=A.current)!==null&&_A$current2!==void 0?_A$current2:A.current=(0,tT.f)({sink:{onMark:e=>{var _D$current,_D$current$onMark;return(_D$current=D.current)===null||_D$current===void 0||(_D$current$onMark=_D$current.onMark)===null||_D$current$onMark===void 0?void 0:_D$current$onMark.call(_D$current,e);},onLeg:e=>{var _D$current2,_D$current2$onLeg;return(_D$current2=D.current)===null||_D$current2===void 0||(_D$current2$onLeg=_D$current2.onLeg)===null||_D$current2$onLeg===void 0?void 0:_D$current2$onLeg.call(_D$current2,e);}}}),b.current=e.onCanonicalUserTurn,x.current=e.onUserSpeechStart,w.current=e.canStartCapture,C.current=e.turnDetectionProfile;let E=(0,y.useRef)(void 0),M=(0,y.useRef)(void 0),N=(0,y.useRef)(void 0),_=(0,y.useRef)(void 0===e.prepareCanonicalVoiceHasher&&(0,tS.a)()),T=(0,y.useRef)((_e$prepareCanonicalVo3=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo3!==void 0?_e$prepareCanonicalVo3:tS.O);T.current=(_e$prepareCanonicalVo4=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo4!==void 0?_e$prepareCanonicalVo4:tS.O;let I=(0,y.useRef)(void 0),j=(0,y.useRef)(void 0),F=(0,y.useRef)(void 0),O=(0,y.useRef)(tU()),z=(0,y.useRef)(!1),B=(0,y.useRef)(!1),P=(0,y.useRef)(0),L=(0,y.useRef)(void 0),$=(0,y.useRef)(new Set()),q=(0,y.useRef)(new Map()),V=(0,y.useRef)(new Map()),U=(0,y.useRef)(new Set()),W=(0,y.useRef)(void 0),K=(0,y.useRef)(!1),H=(0,y.useRef)(void 0),J=(0,y.useRef)(!1),G=(0,y.useRef)(!1),Z=(0,y.useRef)(void 0),Q=(0,y.useRef)(()=>void 0),Y=(0,y.useRef)(()=>void 0),X=(0,y.useRef)(()=>void 0),ee=(0,y.useRef)(()=>void 0),et=(0,y.useRef)(()=>void 0),en=(0,y.useRef)(void 0),er=(0,y.useRef)(0),ei=(0,y.useRef)(tW()),es=(0,y.useRef)(void 0),eo=(0,y.useRef)(void 0),ea=(0,y.useRef)(void 0),el=(0,y.useRef)(()=>void 0),ec=(0,y.useRef)(!0),eu=(0,y.useCallback)(e=>{let t=r.current.apply(e);s(t.snapshot),ee.current(t.effects);},[]),ed=(0,y.useCallback)(()=>{var _A$current3;let e=O.current;!B.current&&ec.current&&e.answerApplied&&e.rtcConnected&&e.dataChannelOpen&&e.warmupComplete&&(!e.requiresDataChannelAck||e.sessionUpdated)&&(B.current=!0,void 0!==F.current&&(clearTimeout(F.current),F.current=void 0),P.current=0,eu({kind:"recovered"}),n({type:"connected"}),(_A$current3=A.current)===null||_A$current3===void 0?void 0:_A$current3.mark("session_ready"));},[eu]),eh=(0,y.useCallback)(()=>{var _E$current,_E$current$sendDataCh;var e;let t;z.current||(z.current=!0,!1===((_E$current=E.current)===null||_E$current===void 0||(_E$current$sendDataCh=_E$current.sendDataChannelEvent)===null||_E$current$sendDataCh===void 0?void 0:_E$current$sendDataCh.call(_E$current,(e=S.current,t={type:"realtime"},void 0===e||(t.audio={input:{turn_detection:{...tz[e!==null&&e!==void 0?e:"balanced"](),interrupt_response:!1,create_response:!1}}}),{type:"session.update",session:t})))&&(O.current={...O.current,sessionUpdated:!1}));},[]),ep=(0,y.useCallback)((e={})=>{r.current.reset(),!0!==e.suppressUiUpdates&&s(r.current.snapshot()),!0!==e.preserveFinalTranscriptDedupe&&($.current.clear(),es.current=void 0),q.current.clear(),V.current.clear(),U.current.clear(),W.current=void 0,K.current=!1,G.current=!1,!0!==e.suppressUiUpdates&&!0!==e.preservePartialTranscript&&d(void 0),en.current=void 0;},[]),ef=(0,y.useCallback)(()=>{void 0!==j.current&&(clearTimeout(j.current),j.current=void 0),void 0!==F.current&&(clearTimeout(F.current),F.current=void 0),O.current=tU(),z.current=!1,B.current=!1;},[]),em=(0,y.useCallback)(()=>{void 0!==j.current&&clearTimeout(j.current),O.current={...O.current,warmupComplete:!1},j.current=setTimeout(()=>{j.current=void 0,ec.current&&(O.current={...O.current,warmupComplete:!0},ed());},150);},[ed]),eg=(0,y.useCallback)(()=>{er.current+=1;let e={fallbackTurnId:`client-turn-${ei.current}-${String(er.current)}`};return en.current=e,e;},[]),ev=(0,y.useCallback)(()=>{var _en$current;return(_en$current=en.current)!==null&&_en$current!==void 0?_en$current:eg();},[eg]),ey=(0,y.useCallback)(()=>{n({type:"error",reason:"connection-failed",message:"The spoken transcript could not be added to chat automatically. It remains visible for review."});},[]),ek=(0,y.useCallback)(()=>{n({type:"error",reason:"connection-failed",message:"The spoken transcript is queued in chat. Voice capture paused until pending turns make room."});},[]),eb=(0,y.useCallback)((e,t=!1)=>{try{let t=e.deliver({turnId:e.baseTurnId,text:e.text});return{accepted:!1!==t,stopCapture:"accepted-stop"===t};}catch{return t||(d(e.text),ey()),{accepted:!1,stopCapture:!1};}},[ey]),ex=(0,y.useCallback)(()=>{void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0);let e=H.current;if(void 0===e||J.current)return;let t=eb(e,!0);if(t.accepted){H.current=void 0,G.current=!1,d(void 0),t.stopCapture&&(ek(),et.current());return;}J.current=!0,d(e.text),ey(),et.current();},[eb,ey,ek]);Q.current=ex;let ew=(0,y.useCallback)(()=>{J.current||ex();},[ex]),eC=(0,y.useCallback)(()=>{void 0===H.current||void 0===E.current||K.current||(void 0!==Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>Q.current(),1600));},[]);Y.current=(0,y.useCallback)(()=>{var _H$current;void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0),d((_H$current=H.current)===null||_H$current===void 0?void 0:_H$current.text);},[]);let eS=e.onTurnBackchannel;ee.current=(0,y.useCallback)(e=>function(e,t){let n=!1;for(let r of e)(0,R.v)(`[keiko] voice turn effect executed (effect=${r})`),"stop-playback"===r||"cancel-speech-generation"===r?n=!0:"preserve-user-turn"===r?t.preserveUserTurn():"emit-backchannel"===r?t.emitBackchannel():t.beginRecovery();n&&t.interruptAssistant();}(e,{interruptAssistant:()=>{var _x$current;return(_x$current=x.current)===null||_x$current===void 0?void 0:_x$current.call(x);},preserveUserTurn:()=>Y.current(),emitBackchannel:()=>eS===null||eS===void 0?void 0:eS(),beginRecovery:()=>X.current()}),[eS]);let eD=(0,y.useRef)(!1);(0,y.useEffect)(()=>{let t=!0===e.assistantSpeaking;t!==eD.current&&(eD.current=t,eu(t?{kind:"assistant-speech-start"}:{kind:"assistant-speech-end",how:"completed"}));},[eu,e.assistantSpeaking]);let eA=(0,y.useCallback)(e=>{void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0),G.current=!0,en.current=void 0,H.current=void 0,d((0,tE.x)(e)),ey();},[ey]),eE=(0,y.useCallback)((e,t,n)=>{en.current=void 0,H.current={baseTurnId:e.fallbackTurnId,text:t,deliver:n},d(t),eC();},[eC]),eM=(0,y.useCallback)((e,t)=>{var _b$current,_r$baseTurnId,_r$deliver;if(G.current)return void ey();let n=m.current===f.current?(_b$current=b.current)!==null&&_b$current!==void 0?_b$current:g.current:g.current;if(void 0===n){en.current=void 0,ey();return;}let r=H.current,i=tV(r===null||r===void 0?void 0:r.text,t);(0,tE.K)(i)>tE.D?void 0===r?eA(i):(ex(),J.current||((0,tE.K)(t)>tE.D?eA(t):eE(e,t,n))):eE({fallbackTurnId:(_r$baseTurnId=r===null||r===void 0?void 0:r.baseTurnId)!==null&&_r$baseTurnId!==void 0?_r$baseTurnId:e.fallbackTurnId},i,(_r$deliver=r===null||r===void 0?void 0:r.deliver)!==null&&_r$deliver!==void 0?_r$deliver:n);},[eA,ex,eE,ey]),eN=(0,y.useCallback)(e=>{var _e$itemId;let t,n,r=(_e$itemId=e.itemId)!==null&&_e$itemId!==void 0?_e$itemId:e.responseId;if(void 0!==r){if($.current.has(r))return;var i,s=$.current;if(!s.has(r)){if(s.size>=32){let e=s.values().next().value;void 0!==e&&s.delete(e);}s.add(r);}U.current.delete(r),q.current.delete(r),V.current.delete(r),W.current===r&&(W.current=void 0);}else{let t=tH(e.text);if(es.current===t)return;es.current=t;}let o=ev();void 0!==r&&(t=JSON.stringify(["canonical-realtime-turn-v1",i=ei.current,r]),n=(0,tS.B)(t),o.fallbackTurnId=`client-turn-${i}-${n}`),G.current||d(void 0),eM(o,e.text);},[ev,eM]),e_=(0,y.useCallback)(e=>{var _e$itemId2,_q$current$get,_V$current$get,_q$current$get2,_H$current3;let t=(_e$itemId2=e.itemId)!==null&&_e$itemId2!==void 0?_e$itemId2:"__current",n=(_q$current$get=q.current.get(t))!==null&&_q$current$get!==void 0?_q$current$get:"";if(!q.current.has(t)&&q.current.size>=32)return void ey();let r=((_V$current$get=V.current.get(t))!==null&&_V$current$get!==void 0?_V$current$get:0)+(0,tE.K)(e.delta);if(r>tE.D){var _H$current2;let r=(0,tE.x)(`${n}${e.delta}`);q.current.set(t,r),V.current.set(t,(0,tE.K)(r)),W.current=t,void 0!==H.current&&ex(),J.current||eA(tV((_H$current2=H.current)===null||_H$current2===void 0?void 0:_H$current2.text,r));return;}W.current=t,q.current.set(t,`${n}${e.delta}`),V.current.set(t,r);let i=tH((_q$current$get2=q.current.get(t))!==null&&_q$current$get2!==void 0?_q$current$get2:"");i.length>0&&(d(tV((_H$current3=H.current)===null||_H$current3===void 0?void 0:_H$current3.text,i)),ev());},[ev,ex,eA,ey]),eT=(0,y.useCallback)(e=>{var _q$current$get3,_H$current4;let t=e!==null&&e!==void 0?e:W.current;if(void 0===t||U.current.has(t))return;let n=tH((_q$current$get3=q.current.get(t))!==null&&_q$current$get3!==void 0?_q$current$get3:"");n.length>0&&d(tV((_H$current4=H.current)===null||_H$current4===void 0?void 0:_H$current4.text,n));},[]),eR=(0,y.useCallback)(()=>{es.current=void 0,G.current=!1,K.current||(K.current=!0),eg(),eu({kind:"user-speech-start"});},[eu,eg]),eI=(0,y.useCallback)(()=>{K.current=!1,eC(),eu({kind:"user-end-of-turn"});},[eu,eC]),ej=(0,y.useCallback)(e=>{var _ref3,_e$itemId3,_e$reviewText,_H$current5;if("limit-exceeded"!==e.reason){eT(e.itemId),eu({kind:"provider-failure",recoverable:!0});return;}let t=(_ref3=(_e$itemId3=e.itemId)!==null&&_e$itemId3!==void 0?_e$itemId3:W.current)!==null&&_ref3!==void 0?_ref3:"__current",n=tV(q.current.get(t),(_e$reviewText=e.reviewText)!==null&&_e$reviewText!==void 0?_e$reviewText:"");if(0===n.length){G.current=!0,ey();return;}q.current.set(t,(0,tE.x)(n)),W.current=t,void 0!==((_H$current5=H.current)===null||_H$current5===void 0?void 0:_H$current5.text)&&ex(),J.current||eA(n);},[eu,ex,eA,eT,ey]),eF=(0,y.useCallback)(e=>{var _A$current4,_A$current5,_A$current6;var t;if(J.current)return;let n=(0,tE.P)(e);if(void 0!==n&&((t=m.current)===f.current||void 0!==t&&"user-transcript-committed"===n.kind))switch(n.kind){case"session-created":return;case"session-updated":O.current={...O.current,sessionUpdated:!0},(_A$current4=A.current)!==null&&_A$current4!==void 0&&_A$current4.mark("session_updated"),ed();return;case"user-speech-start":(_A$current5=A.current)!==null&&_A$current5!==void 0&&_A$current5.mark("user_speech_start"),eR();return;case"user-speech-stop":(_A$current6=A.current)!==null&&_A$current6!==void 0&&_A$current6.mark("vad_stop"),eI();return;case"user-transcript-committed":eN(n);return;case"user-transcript-delta":e_(n);return;case"user-transcript-failed":ej(n);return;case"error":eT(),el.current(n.message);return;}},[e_,eR,eN,eI,ej,ed,eT]),eO=(0,y.useCallback)(()=>{void 0!==ea.current&&(clearTimeout(ea.current),ea.current=void 0);},[]),ez=(0,y.useCallback)(()=>{void 0!==L.current&&(clearTimeout(L.current),L.current=void 0);},[]),eB=(0,y.useCallback)(()=>{eO(),c(!0),ea.current=setTimeout(()=>{ea.current=void 0,ec.current&&c(!1);},300);},[eO]),eP=(0,y.useCallback)((e={})=>{var _e$discardControl,_N$current,_M$current2;let t=(_e$discardControl=e.discardControl)!==null&&_e$discardControl!==void 0?_e$discardControl:!0;(_N$current=N.current)!==null&&_N$current!==void 0&&_N$current.abort(),N.current=void 0,void 0!==eo.current&&(clearTimeout(eo.current),eo.current=void 0),ez(),t&&(P.current=0),void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0),ec.current&&!0!==e.teardown||(H.current=void 0),eO(),!0!==e.teardown&&c(!1);let n=E.current;E.current=void 0,m.current=void 0,g.current=void 0,n!==null&&n!==void 0&&n.close(),(_M$current2=M.current)!==null&&_M$current2!==void 0&&_M$current2.close({resumable:!t}),t&&(M.current=void 0,ei.current=tW(),er.current=0),ep({preserveFinalTranscriptDedupe:!t,preservePartialTranscript:!0===e.preservePartialTranscript,suppressUiUpdates:!0===e.teardown}),ef();},[eO,ez,ef,ep]);et.current=()=>{eP({preservePartialTranscript:!0});};let eL=(0,y.useCallback)(()=>{if(void 0!==eo.current&&(clearTimeout(eo.current),eo.current=void 0),!ec.current||(ex(),J.current))return;let e=P.current;(eP({discardControl:!1}),e>=tr.$.maxReconnectAttempts)?n({type:"error",reason:"connection-failed",message:"Real-time voice connection was lost."}):(P.current=e+1,L.current=setTimeout(()=>{var _I$current;L.current=void 0,ec.current&&((_I$current=I.current)===null||_I$current===void 0?void 0:_I$current.call(I));},Math.min(tr.$.reconnectBackoffInitialMs*2**e,tr.$.reconnectBackoffMaxMs)));},[eP,ex]);X.current=(0,y.useCallback)(()=>{var _eo$current;(_eo$current=eo.current)!==null&&_eo$current!==void 0?_eo$current:eo.current=setTimeout(eL,5e3);},[eL]);let e$=(0,y.useCallback)(()=>{eu({kind:"provider-failure",recoverable:!0});},[eu]),eq=(0,y.useCallback)(()=>{eu({kind:"provider-failure",recoverable:!0}),void 0!==eo.current&&(clearTimeout(eo.current),eo.current=void 0),eL();},[eu,eL]);el.current=(0,y.useCallback)(e=>{ex(),J.current||(eP({preservePartialTranscript:!0}),eu({kind:"provider-failure",recoverable:!1}),n({type:"error",reason:"connection-failed",message:e}));},[eu,eP,ex]);let eV=(0,y.useCallback)(()=>{void 0!==F.current&&clearTimeout(F.current),B.current||(F.current=setTimeout(()=>{F.current=void 0,ec.current&&!B.current&&eq();},tr.$.signalingMs));},[eq]);(0,y.useEffect)(()=>{var _E$current2,_E$current2$setInputM;(_E$current2=E.current)===null||_E$current2===void 0||(_E$current2$setInputM=_E$current2.setInputMuted)===null||_E$current2$setInputM===void 0||_E$current2$setInputM.call(_E$current2,o);},[o]);let eU=(0,y.useCallback)(()=>{J.current?eP({preservePartialTranscript:!0}):(ex(),J.current||(eP(),n({type:"reset"})));},[eP,ex]),eW=(0,y.useCallback)(()=>{var _w$current,_A$current7,_A$current8,_M$current3;if(void 0!==E.current||void 0!==N.current)return;if(((_w$current=w.current)===null||_w$current===void 0?void 0:_w$current.call(w))===!1)return void ek();if(J.current)return void ey();if(!_.current){n({type:"requesting"});let e=new AbortController();N.current=e,T.current().then(()=>{var _I$current2;ec.current&&!e.signal.aborted&&N.current===e&&(_.current=!0,N.current=void 0,(_I$current2=I.current)===null||_I$current2===void 0?void 0:_I$current2.call(I));}).catch(t=>{if(!ec.current||e.signal.aborted||N.current!==e)return;eP({discardControl:!1});let{reason:r,message:i}=tK(t);n({type:"error",reason:r,message:i});});return;}(_A$current7=A.current)!==null&&_A$current7!==void 0&&_A$current7.reset(),(_A$current8=A.current)!==null&&_A$current8!==void 0&&_A$current8.mark("mic_click"),n({type:"requesting"}),ef(),S.current=C.current,m.current=f.current,g.current=b.current;let e=new AbortController();N.current=e;let t=h(),r=(_M$current3=M.current)!==null&&_M$current3!==void 0?_M$current3:k();M.current=r,t.connect({signal:e.signal}).then(async t=>{var _A$current9,_t$setInputMuted,_t$onLocalVoiceActivi,_t$onDataChannelEvent,_A$current10;if(!ec.current||e.signal.aborted||N.current!==e){t.close(),M.current!==r&&r.close();return;}E.current=t;let i=H.current;void 0!==i&&(d(i.text),eC()),(_A$current9=A.current)!==null&&_A$current9!==void 0&&_A$current9.mark("rtc_offer_created"),(_t$setInputMuted=t.setInputMuted)!==null&&_t$setInputMuted!==void 0&&_t$setInputMuted.call(t,o),(_t$onLocalVoiceActivi=t.onLocalVoiceActivity)!==null&&_t$onLocalVoiceActivi!==void 0&&_t$onLocalVoiceActivi.call(t,n=>{if(ec.current&&E.current===t&&!e.signal.aborted){if("speech-onset"===n)return void eR();eI();}}),(_t$onDataChannelEvent=t.onDataChannelEvent)!==null&&_t$onDataChannelEvent!==void 0&&_t$onDataChannelEvent.call(t,n=>{ec.current&&E.current===t&&!e.signal.aborted&&eF(n);}),void 0!==t.onDataChannelStateChange?(O.current={...O.current,requiresDataChannelAck:!0},t.onDataChannelStateChange(n=>{if(ec.current&&E.current===t&&!e.signal.aborted){if("open"===n){var _A$current0;O.current={...O.current,dataChannelOpen:!0},(_A$current0=A.current)!==null&&_A$current0!==void 0&&_A$current0.mark("datachannel_open"),eh(),ed();return;}"closed"===n&&e$();}})):O.current={...O.current,dataChannelOpen:!0,sessionUpdated:!0,requiresDataChannelAck:!1},em(),t.onConnectionStateChange(n=>{var _A$current1;ec.current&&E.current===t&&!e.signal.aborted&&("connected"===n?(void 0!==eo.current&&(clearTimeout(eo.current),eo.current=void 0),O.current={...O.current,rtcConnected:!0},(_A$current1=A.current)!==null&&_A$current1!==void 0&&_A$current1.mark("rtc_connected"),eu({kind:"recovered"}),ed()):"failed"===n||"closed"===n?eq():"disconnected"===n&&e$());}),n({type:"negotiating"});let s=await r.negotiate(t.offerSdp);!ec.current||E.current!==t||e.signal.aborted||(await t.applyAnswer(s),!ec.current||E.current!==t||e.signal.aborted)?t.close():(O.current={...O.current,answerApplied:!0},(_A$current10=A.current)!==null&&_A$current10!==void 0&&_A$current10.mark("sdp_answer"),eV(),ed());}).catch(t=>{if(!ec.current||e.signal.aborted||N.current!==e)return;ex(),eP({discardControl:!1});let{reason:r,message:i}=tK(t);n({type:"error",reason:r,message:i});});},[h,k,o,eF,eP,ef,em,eh,ed,eu,eR,eI,eC,eV,e$,eq,ex,ey,ek]);(0,y.useEffect)(()=>(I.current=eW,()=>{I.current===eW&&(I.current=void 0);}),[eW]);let eK=(0,y.useCallback)(()=>{var _w$current2;((_w$current2=w.current)===null||_w$current2===void 0?void 0:_w$current2.call(w))===!1?ek():(P.current=0,J.current&&(J.current=!1,ex(),J.current)||(ex(),eP({discardControl:!1}),n({type:"reset"}),eW()));},[eP,ex,eW,ek]),eH=(0,y.useCallback)(()=>{eu({kind:"user-interrupt"});},[eu]),eJ=(0,y.useCallback)(()=>{let e=!o;e?(eO(),c(!1)):eB(),a(e);},[eB,eO,o]);return(0,y.useEffect)(()=>{var _e$chatContext4;let t=(_e$chatContext4=e.chatContext)===null||_e$chatContext4===void 0?void 0:_e$chatContext4.chatId;v.current!==t&&(v.current=t,(void 0!==E.current||void 0!==N.current||void 0!==L.current||void 0!==eo.current||void 0!==H.current)&&eU());},[(_e$chatContext5=e.chatContext)===null||_e$chatContext5===void 0?void 0:_e$chatContext5.chatId,eU]),(0,y.useEffect)(()=>(ec.current=!0,()=>{ew(),ec.current=!1,eP({teardown:!0});}),[eP,ew]),{phase:t.phase,busy:"requesting"===t.phase||"negotiating"===t.phase||"connected"===t.phase,error:void 0!==t.errorReason&&void 0!==t.errorMessage?{reason:t.errorReason,message:t.errorMessage}:void 0,turnSnapshot:i,listening:"connected"===t.phase&&!o&&!l&&"listening"===i.state,speaking:"speaking"===i.state,canInterrupt:"speaking"===i.state||"thinking"===i.state,muted:o,partialUserTranscript:u,retrieving:(_e$retrieving=e.retrieving)!==null&&_e$retrieving!==void 0?_e$retrieving:!1,start:eW,stop:eU,retry:eK,interrupt:eH,toggleMute:eJ};}({chatContext:function(e){if(void 0!==e)return{chatId:e.id};}(q),canStartCapture:e$,onCanonicalUserTurn:eF,onUserSpeechStart:eL,assistantSpeaking:eR.snapshot.speaking,retrieving:eq}),eU=eD&&"batch"===ep.capture,eW=ep.available&&void 0!==q&&X,eJ=function(e){switch(e){case"preparing":return"thinking";case"speaking":case"paused":return"speaking";case"interrupted":return"interrupted";case"unavailable":case"canceled":case"complete":case"failed":return"idle";}}(eR.snapshot.phase),eZ=eU?void 0!==ez.error||"error"===ez.dictation.phase?"error":ez.preparing||"requesting"===ez.dictation.phase?"requesting":eU?"connected":"idle":eV.phase,eQ=function(e){let t=void 0!==e.batchDialogue.error||void 0!==e.batchDialogue.dictation.error,n=e.batchActive?"recording"===e.batchDialogue.dictation.phase&&e.batchDialogue.dictation.micReady:e.realtimeVoice.listening&&!e.playback.snapshot.active;var r={voiceDialogActive:e.active,voiceDialogAvailable:e.available,voiceDialogState:e.state,listening:n,speaking:e.playback.snapshot.speaking,sending:e.sending,sendStatus:e.sendStatus,hasSessionError:e.chatHasError||(e.batchActive?t:void 0!==e.realtimeVoice.error),reconnecting:!e.batchActive&&e.realtimeVoice.turnSnapshot.recovering,retrieving:e.batchActive?e.retrieving:e.realtimeVoice.retrieving};if(!r.voiceDialogActive)return{active:!1,state:"ready",intensity:"low"};if(!r.voiceDialogAvailable||r.hasSessionError||"error"===r.voiceDialogState)return{active:!0,state:"error",intensity:"high"};if("interrupted"===r.voiceDialogState)return{active:!0,state:"interrupted",intensity:"high"};if(!0===r.reconnecting)return{active:!0,state:"reconnecting",intensity:"high"};if("muted"===r.voiceDialogState)return{active:!0,state:"muted",intensity:"medium"};if(r.speaking||"speaking"===r.voiceDialogState)return{active:!0,state:"speaking",intensity:"high"};if(!0===r.retrieving)return{active:!0,state:"checking-sources",intensity:"high"};let i=r.sending||"queued"===r.sendStatus||"contacting"===r.sendStatus||"streaming"===r.sendStatus;return"thinking"===r.voiceDialogState||i?{active:!0,state:"thinking",intensity:i?"high":"medium"}:r.listening||"listening"===r.voiceDialogState?{active:!0,state:"listening",intensity:"medium"}:"connecting"===r.voiceDialogState?{active:!0,state:"preparing",intensity:"medium"}:{active:!0,state:"ready",intensity:"low"};}({active:eD,available:eW,state:function(e){let{realtimePhase:t,turnState:n,muted:r}=e;return"error"===t?"error":"requesting"===t||"negotiating"===t||"recovering"===n?"connecting":"interrupted"===n?"interrupted":"connected"===t&&r?"muted":"speaking"===n?"speaking":"thinking"===n?"thinking":"listening"===n?"listening":"idle";}({realtimePhase:eZ,turnState:(l="idle"!==eJ?eJ:ez.waitingForAnswer||"transcribing"===ez.dictation.phase||"finalizing"===ez.dictation.phase?"thinking":"recording"===ez.dictation.phase?"listening":"idle",c=eV.turnSnapshot.state,eU?l:"idle"===eJ?c:eJ),muted:!eU&&eV.muted}),batchActive:eU,batchDialogue:ez,playback:eR,realtimeVoice:eV,chatHasError:void 0!==L,sending:w,sendStatus:C,retrieving:eq}),[eY,eX]=(0,y.useState)("");(0,y.useEffect)(()=>{if(!eQ.active)return void eX("");let e=t7[eQ.state],t=setTimeout(()=>{eX(e);},400);return()=>clearTimeout(t);},[eQ.active,eQ.state]);let e0=(0,y.useCallback)(()=>{!eW||(eI(),ev(null),ek.current=void 0,ep.enter()&&(ek.current=q===null||q===void 0?void 0:q.id,eb.current=ep.capture,"batch"===ep.capture?eB():eV.start()));},[q===null||q===void 0?void 0:q.id,eB,eI,ep,eW,eV]),e1=(0,y.useCallback)(()=>{let e=void 0!==ek.current,t=eb.current;ek.current=void 0,eb.current="none",e&&(eA.current+=1,"batch"===t?eP():eV.stop(),eR.stop(),ev(null)),ep.leave();},[eP,eR,eV,ep]),e4=(0,y.useCallback)(()=>{if(!eU||void 0===ez.failedTranscript)return;let e=ez.failedTranscript;e1(),ed(e);},[eU,ez.failedTranscript,e1,ed]);(0,y.useEffect)(()=>{eD||(eS||ep.active)&&e1();},[e1,ep.active,eD,eS]);let e9=(0,y.useRef)(!1),e8=(0,y.useCallback)(()=>{e9.current=!0,eD?e1():e0();},[eD,e0,e1]),e7=(0,y.useRef)(eD);(0,y.useEffect)(()=>{if(eD&&"error"===eZ){e9.current=!1;return;}!function(e,_ref4){let{active:t,previousActiveRef:n,restoreFocusRef:r,voiceDialogButton:i,normalVoiceDialogButton:s}=e;n.current===t||(n.current=t,r.current&&(r.current=!1,(_ref4=t?i:s)===null||_ref4===void 0?void 0:_ref4.focus()));}({active:eD,previousActiveRef:e7,restoreFocusRef:e9,voiceDialogButton:el.current,normalVoiceDialogButton:ec.current});},[eZ,eD]);let te=(0,y.useMemo)(()=>uV(q),[q]),ti=te.map(e=>e.root).join("\x01"),[ts,th]=(0,y.useState)((_te$0$root=(_te$=te[0])===null||_te$===void 0?void 0:_te$.root)!==null&&_te$0$root!==void 0?_te$0$root:""),[tp,tf]=(0,y.useState)(null),[tm,tw]=(0,y.useState)(null),[tR,tI]=(0,y.useState)(null),[tj,tF]=(0,y.useState)(0),[tO,tL]=(0,y.useState)([]),t$=null!==tp&&te.length>0,tq=function(e,t,n){let r=(0,m.a)(),i=r("chat.repository.searchIdle"),[s,o]=(0,y.useState)([]),[a,l]=(0,y.useState)(!1),[c,u]=(0,y.useState)(i),[d,h]=(0,y.useState)(null);return(0,y.useEffect)(()=>{if(!e){l(!1),o([]),u(i),h(null);return;}let s=n.trim();if(0===t.length||0===s.length){l(!1),o([]),u(i),h(null);return;}let a=new AbortController(),c=!1;l(!0),h(null),u(r("chat.repository.searching"));let d=window.setTimeout(()=>{(0,b.Qy)(t,s,24,{signal:a.signal}).then(e=>{if(!c)if(o(e.results),0===e.results.length)u(r("chat.repository.noMatches"));else{let t=e.results.length;u(e.truncated?r("chat.repository.foundTruncated",{count:t}):r("chat.repository.found",{count:t}));}}).catch(e=>{c||"u">typeof DOMException&&e instanceof DOMException&&"AbortError"===e.name||(o([]),h(uH(e,r)),u(r("chat.repository.searchFailed")));}).finally(()=>{c||l(!1);});},120);return()=>{c=!0,window.clearTimeout(d),a.abort();};},[i,e,n,t,r]),{results:s,searching:a,message:c,error:d};}(t$,ts,(_tp$query=tp===null||tp===void 0?void 0:tp.query)!==null&&_tp$query!==void 0?_tp$query:"");(0,y.useEffect)(()=>{var _te$0$root2,_te$2;if(0===te.length){th(""),tf(null);return;}te.some(e=>e.root===ts)||th((_te$0$root2=(_te$2=te[0])===null||_te$2===void 0?void 0:_te$2.root)!==null&&_te$0$root2!==void 0?_te$0$root2:"");},[ti,te,ts]),(0,y.useEffect)(()=>{tF(0);},[tp===null||tp===void 0?void 0:tp.query,tq.results]),(0,y.useEffect)(()=>{tL(e=>{var t;return function(e){let t=new Set(),n=[];for(E.lastIndex=0;;){var _r$;let r=E.exec(e);if(null===r)break;let i=D((_r$=r[2])!==null&&_r$!==void 0?_r$:"");0===i.length||t.has(i)||(t.add(i),n.push(i));}return n;}((t={current:e,draft:k,selectedRoot:ts,roots:te,searchResults:tq.results}).draft).map(e=>{let n=t.current.find(t=>t.path===e);if((n===null||n===void 0?void 0:n.verified)===!0)return n;let r=t.searchResults.find(t=>t.path===e);return void 0!==r?uU(r,"draft"):n!==null&&n!==void 0?n:function(e,t,n,_n$0$root,_n$,_s$at){let r=D(e);if(0===r.length||r.includes(".."))return null;let i=t.length>0?t:(_n$0$root=(_n$=n[0])===null||_n$===void 0?void 0:_n$.root)!==null&&_n$0$root!==void 0?_n$0$root:"";if(0===i.length)return null;let s=r.split("/").filter(e=>e.length>0),o=(_s$at=s.at(-1))!==null&&_s$at!==void 0?_s$at:r,a=s.length>1?s.slice(0,-1).join("/"):"";return{id:A(i,r),root:i,path:r,name:o,directory:a,verified:!1,source:"draft"};}(e,t.selectedRoot,t.roots);}).filter(e=>null!==e);});},[k,ti,te,tq.results,ts]);let t0=(0,y.useCallback)((e,t)=>{if(0===te.length)return void tf(null);let n=uW(e,t);tf(n),null!==n&&tI(null);},[te.length]),t1=(0,y.useCallback)(async e=>{if(void 0!==q){tw(e.path),tI(null);try{var _n$current$selectionS,_n$current2;let t=N(q,e.root,e.path);if(t.changed){let e=await(0,x.a)(q,{connectedScopes:t.scopes},U);U(e);}let r=(_n$current$selectionS=(_n$current2=n.current)===null||_n$current2===void 0?void 0:_n$current2.selectionStart)!==null&&_n$current$selectionS!==void 0?_n$current$selectionS:k.length,i=tp!==null&&tp!==void 0?tp:uW(k,r),s=function(e,t,n){let r,i,s,o;if(null===t){let t=function(e,t){let n=`@${t}`;if(e.split(/\s+/u).includes(n))return e;let r=e.trimEnd();return 0===r.length?n:`${r} ${n}`;}(e,n);return{value:t,cursor:t.length};}return r=`@${n}`,i=e.slice(0,t.start),o=0!==(s=e.slice(t.end)).length&&/^[\s.,;:!?)}\]]/u.test(s)?r:`${r} `,{value:`${i}${o}${s}`,cursor:i.length+o.length};}(k,i,e.path);tL(t=>{var n;return n=uU(e),t.some(e=>e.id===n.id)?t:[...t,n];}),S(s.value),tf(null),requestAnimationFrame(()=>{var _n$current3,_n$current4;(_n$current3=n.current)!==null&&_n$current3!==void 0&&_n$current3.focus(),(_n$current4=n.current)===null||_n$current4===void 0?void 0:_n$current4.setSelectionRange(s.cursor,s.cursor);});}catch(e){tI(uH(e,p));}finally{tw(null);}}},[q,k,U,tp,S,p,n]),t2=(0,y.useCallback)(e=>{let t=tO.find(t=>t.id===e);if(void 0!==t){var r,i;let s;tL(t=>t.filter(t=>t.id!==e)),S((r=t.path,0===(s=k.replace((i=r,RegExp(String.raw`(^|\s)@${i.replace(/[.*+?^${}()|[\]\\]/gu,String.raw`\$&`)}(?=$|\s)`,"gu")),"$1").replace(/[ \t]{2,}/gu," ")).trim().length?"":s)),requestAnimationFrame(()=>{var _n$current5;(_n$current5=n.current)===null||_n$current5===void 0||_n$current5.focus();});}},[k,tO,S,n]),t3=(0,y.useCallback)((e,t)=>{let n=S(e);return t<0?tf(null):t0(e,t),n;},[S,t0]),t6=(0,y.useCallback)((e,t)=>{null!==tp&&(t<0?tf(null):t0(e,t));},[tp,t0]),t5=(0,y.useCallback)((e,t)=>{!(t$&&function(e,t){let{results:n,highlightedIndex:r,setHighlightedIndex:i,closeMention:s,pickResult:o}=t;if("Escape"===e.key)return e.preventDefault(),s(),!0;if("ArrowDown"===e.key&&n.length>0)return e.preventDefault(),i(e=>Math.min(n.length-1,e+1)),!0;if("ArrowUp"===e.key&&n.length>0)return e.preventDefault(),i(e=>Math.max(0,e-1)),!0;if(("Enter"===e.key||"Tab"===e.key)&&n.length>0){var _n$r;e.preventDefault();let t=(_n$r=n[r])!==null&&_n$r!==void 0?_n$r:n[0];return void 0!==t&&o(t),!0;}return!1;}(e,{results:tq.results,highlightedIndex:tj,setHighlightedIndex:tF,closeMention:()=>tf(null),pickResult:e=>{t1(e);}}))&&(0,nd.Q)(e)&&M({text:t,clearDraftOnAdmission:!0});},[t1,tj,t$,tq.results,M]),t4=["cmp-box",g.default.cmpBox,s?"cmp-box-compact":"",eD?g.default.voiceDialogBox:""].filter(Boolean).join(" "),t9=(0,y.useCallback)(e=>{e===null||e===void 0||e.toggleAttribute("inert",eD);},[eD]),t8=(0,y.useCallback)(e=>{e===null||e===void 0||e.toggleAttribute("inert",!eD);},[eD]),ne=eQ.active?{dataVoiceAura:"on",dataVoiceAuraState:eQ.state,dataVoiceAuraIntensity:eQ.intensity}:{dataVoiceAura:void 0,dataVoiceAuraState:void 0,dataVoiceAuraIntensity:void 0},nt=(u=tq.results.length,t$&&u>0?uu:void 0);return(0,f.jsxs)("div",{className:t4,"data-voice-aura":ne.dataVoiceAura,"data-voice-aura-state":ne.dataVoiceAuraState,"data-voice-aura-intensity":ne.dataVoiceAuraIntensity,children:[(0,f.jsx)("div",{ref:t9,className:`${g.default.composerLayer} ${g.default.normalLayer}`,"data-composer-layer":"normal","aria-hidden":!!eD||void 0,children:(0,f.jsx)(nd.r,{value:k,placeholder:t,input:(0,f.jsx)(c4,{value:k,valueRevision:v.draftRevision,placeholder:t,inputRef:n,documentKey:(_q$id=q===null||q===void 0?void 0:q.id)!==null&&_q$id!==void 0?_q$id:"new-chat",ariaLabel:p("chat.messageLabel"),ariaControls:nt,maxLength:V.R,onChange:t3,onSelect:t6,onKeyDown:t5,labels:{code:p("chat.composer.code"),plainText:p("chat.composer.plainText"),language:p("chat.composer.codeLanguage"),continueText:p("chat.composer.continueText"),loading:p("chat.composer.codeLoading"),unavailable:p("chat.composer.codeUnavailable"),limit:p("chat.composer.inputLimit"),hint:p("chat.composer.markdownHint")}}),aboveInput:(0,f.jsx)(eH,{enabled:ee,onFiles:et}),belowInput:(0,f.jsxs)(f.Fragment,{children:[t$?(0,f.jsx)(u9,{roots:te,selectedRoot:ts,onRootChange:e=>{th(e),tF(0);},search:tq,pickingPath:tm,highlightedIndex:tj,pickError:tR,onPick:e=>{t1(e);},onClose:()=>tf(null)}):null,(0,f.jsx)(uG,{references:tO,onRemove:t2}),(0,f.jsx)(eK,{attachments:z,onRemove:P}),(0,f.jsx)(eG,{reason:W,mimeType:G}),(0,f.jsx)(u8,{voiceDialogActive:eD,sendStatus:C,voiceDictationVisible:er,dictation:eh})]}),footer:(0,f.jsx)(u2,{session:v,ready:e,selectedModelCapability:Q,onAttachFiles:et,controlsNarrow:o,barCompact:a,voiceDictationVisible:er,dictation:eh,micButtonRef:eo,voiceSpeechOutputVisible:es,voiceMuted:eR.snapshot.muted,onToggleVoiceMute:eR.toggleMute,playbackButtonRef:ea,voiceDialogAvailable:eW,voiceDialogActive:!1,onToggleVoiceDialog:e8,voiceDialogButtonRef:ec})})}),(0,f.jsx)(dn,{voiceAuraActive:eQ.active,announcedVoiceHeadline:eY,voiceDialogAvailable:eW,voiceLayerRef:t8,voiceDialogActive:eD,partialUserTranscript:eV.partialUserTranscript,realtimeVoiceMuted:eV.muted,realtimeVoiceController:eV,batchDialogue:ez,batchActive:eU,onUseFailedTranscript:e4,onToggleVoiceMute:eV.toggleMute,playbackButtonRef:ea,onToggleVoiceDialog:e8,onDismissVoiceError:e1,voiceDialogButtonRef:el,compact:o,pendingAttachments:z,onRemoveAttachment:P})]});});function di({minimal:e=!1}){let t=(0,m.a)();return e?(0,f.jsx)("div",{className:"chatw-empty chatw-empty-minimal",role:"note","aria-label":t("chat.conversationReady"),children:(0,f.jsx)("h2",{className:"chatw-empty-headline",children:t("chat.empty.headline")})}):(0,f.jsx)("div",{className:"chatw-empty",children:(0,f.jsx)("h2",{className:"chatw-empty-headline",children:t("chat.empty.headline")})});}function ds(){let e=(0,m.a)();return(0,f.jsxs)("div",{className:"chatw-empty-no-chat",children:[(0,f.jsx)("div",{className:"chatw-empty-no-chat-icon","aria-hidden":"true",children:(0,f.jsx)(ui,{size:20})}),(0,f.jsx)("p",{className:"chatw-empty-no-chat-label",children:e("chat.empty.noChat.title")}),(0,f.jsx)("p",{className:"chatw-empty-no-chat-hint",children:e("chat.empty.noChat.hint")})]});}function da(e){return(void 0!==e.connectedScopes?e.connectedScopes.length:+(void 0!==e.connectedScope))+(void 0!==e.localKnowledgeScopes?e.localKnowledgeScopes.length:+(void 0!==e.localKnowledgeScope));}function dl(e){var _e$localKnowledgeScop,_e$localKnowledgeScop2;if(da(e)>1)return"multi";let t=(_e$localKnowledgeScop=(_e$localKnowledgeScop2=e.localKnowledgeScopes)===null||_e$localKnowledgeScop2===void 0?void 0:_e$localKnowledgeScop2[0])!==null&&_e$localKnowledgeScop!==void 0?_e$localKnowledgeScop:e.localKnowledgeScope;return(t===null||t===void 0?void 0:t.kind)==="capsule"?`capsule:${t.capsuleId}`:(t===null||t===void 0?void 0:t.kind)==="capsule-set"?`capsule-set:${t.capsuleSetId}`:du(e)?"files":"none";}function dc(e){return void 0!==e.localKnowledgeScopes?e.localKnowledgeScopes:void 0!==e.localKnowledgeScope?[e.localKnowledgeScope]:[];}function du(e){return void 0!==e&&(void 0!==e.connectedScope||void 0!==e.connectedScopes&&e.connectedScopes.length>0);}function dd(e){var _e$gitChangeScopes;return du(e)||void 0!==e&&(void 0!==e.localKnowledgeScope||void 0!==e.localKnowledgeScopes&&e.localKnowledgeScopes.length>0)||void 0!==e&&((_e$gitChangeScopes=e.gitChangeScopes)!==null&&_e$gitChangeScopes!==void 0?_e$gitChangeScopes:[]).length>0;}function dh(e,t){return(0,O.A)(e,t("chat.error.scopeUpdate"));}function dp(e,t){if(void 0===e)return{};let{label:n,description:r}=(0,nr.T)(e,t);return{badge:n,description:r};}let df=new Set(["ready","degraded"]);function dm(e){var _e$knowledgePod;let t=(_e$knowledgePod=e.knowledgePod)===null||_e$knowledgePod===void 0?void 0:_e$knowledgePod.readiness;return e.capsuleCount>0&&(void 0===t||df.has(t));}async function dg(e,t,n){let r=da(e);if(r>0&&!window.confirm(t("chat.grounding.disconnectConfirm",{count:r,sourceLabel:t(1===r?"chat.grounding.sourceSingular":"chat.grounding.sourcePlural")})))return;let i=await(0,x.a)(e,{connectedScopes:null,localKnowledgeScopes:null},n);n(i);}async function dv(e,t){let n=await(0,x.a)(e,{localKnowledgeScopes:null},t);t(n);}async function dy(e,t,n){let r={kind:"capsule-set",capsuleSetId:t,connectedAtMs:Date.now()},i=dc(e),s=i.some(e=>"capsule-set"===e.kind&&e.capsuleSetId===r.capsuleSetId)?i:[...i,r],o=await(0,x.a)(e,{localKnowledgeScopes:s},n);n(o);}async function dk(e,t,n){let r={kind:"capsule",capsuleId:t,connectedAtMs:Date.now()},i=dc(e),s=i.some(e=>"capsule"===e.kind&&e.capsuleId===r.capsuleId)?i:[...i,r],o=await(0,x.a)(e,{localKnowledgeScopes:s},n);n(o);}async function db(e,t,n,r){return"none"===e?dg(t,n,r):"files"===e?dv(t,r):e.startsWith("capsule-set:")?dy(t,e.slice(12),r):e.startsWith("capsule:")?dk(t,e.slice(8),r):void 0;}function dx(e,t){return t?{...e,disabled:!0}:e;}function dw({value:e,loading:t,disabled:n,liveFilesAvailable:r,capsuleChoices:i,capsuleSetChoices:s,t:o,onOpen:a,onValueChange:l}){let c,u=[...(c=[{value:"none",label:o("chat.grounding.modelOnly"),disabled:t},{value:"files",label:o("chat.grounding.liveFiles"),disabled:t||!r,...(r?{}:{description:o("chat.grounding.liveFilesUnavailableHint")})}],"multi"===e&&c.push({value:"multi",label:o("chat.grounding.multiple"),disabled:!0}),c),...i.map(e=>dx(e,t)),...s.map(e=>dx(e,t))];return(0,f.jsx)(z.f,{triggerClassName:"scope-grounding-select",value:e,disabled:n,ariaLabel:o("chat.grounding.mode"),menuTitle:o("chat.grounding.strategy"),onOpen:a,sections:[{options:u}],onValueChange:l});}function dC({loading:e,empty:t,error:n,onRetry:r,t:i}){return(0,f.jsxs)(f.Fragment,{children:[e?(0,f.jsx)("span",{className:"scope-connect-hint",role:"status","aria-live":"polite",children:i("chat.grounding.catalogLoading")}):null,t?(0,f.jsx)("span",{className:"scope-connect-hint",children:i("chat.grounding.catalogEmpty")}):null,null!==n?(0,f.jsx)("span",{role:"alert",className:"scope-connect-error",children:n}):null,void 0!==r?(0,f.jsx)("button",{type:"button",className:"scope-connect-btn",onClick:r,children:i("chat.grounding.catalogRetry")}):null]});}function dS({chat:e,onChatChanged:t,catalog:n,connected:r}){let i=(0,m.a)(),s=(0,nr.u)(),{loading:o,refresh:a,refreshOnPickerOpen:l}=n,[c,u]=(0,y.useState)(!1),[d,h]=(0,y.useState)(null);async function p(n){u(!0),h(null);try{await db(n,e,i,t);}catch(e){h(dh(e,i));}finally{u(!1);}}let g=dl(e),{capsuleChoices:v,capsuleSetChoices:k,catalogEmpty:b}=function(e,t,n,r){let i,s,{capsules:o,capsuleSets:a,loading:l,loadError:c}=t,u=l?[]:o.filter(c9.L),d=l?[]:a.filter(dm),h=(i=d.map(e=>{var _e$knowledgePod2;return{value:`capsule-set:${e.id}`,label:n("chat.grounding.capsuleSet",{name:e.displayName}),...dp((_e$knowledgePod2=e.knowledgePod)===null||_e$knowledgePod2===void 0?void 0:_e$knowledgePod2.guidance,r)};}),!(s=dl(e)).startsWith("capsule-set:")||i.some(e=>e.value===s)?i:[...i,{value:s,label:n("chat.grounding.unavailable",{label:"Knowledge Pod Set"}),disabled:!0}]);return{capsuleChoices:function(e,t,n,r,i){let s,o=t.map(e=>{var _e$knowledgePod3;return{value:`capsule:${e.id}`,label:r("chat.grounding.capsule",{name:e.displayName}),...dp((_e$knowledgePod3=e.knowledgePod)===null||_e$knowledgePod3===void 0?void 0:_e$knowledgePod3.guidance,i)};}),a=dl(e);return!a.startsWith("capsule:")||o.some(e=>e.value===a)?o:[...o,void 0===(s=n.find(e=>`capsule:${e.id}`===a))?{value:a,label:r("chat.grounding.unavailable",{label:"Knowledge Pod"}),disabled:!0}:{value:a,label:(0,c9.X)(s,r,e=>r("chat.grounding.capsule",{name:e})),disabled:!0}];}(e,u,o,n,r),capsuleSetChoices:h,catalogEmpty:!l&&null===c&&o.every(e=>!(0,c9.L)(e))&&0===d.length};}(e,n,i,s),x=du(e),w=null===n.loadError?null:dh(n.loadError,i),C=c||o;return(0,f.jsxs)("div",{className:`scope-grounding ${B.default.cmpGrounding}`,"data-connected":r?"true":"false",children:[(0,f.jsx)("span",{className:"scope-grounding-label mono",children:i("chat.grounding.label")}),(0,f.jsx)(dw,{value:g,loading:o,disabled:C,liveFilesAvailable:x,capsuleChoices:v,capsuleSetChoices:k,t:i,onOpen:l,onValueChange:e=>{p(e);}}),(0,f.jsx)(dC,{loading:o,empty:b&&!r,error:d!==null&&d!==void 0?d:w,onRetry:null===d&&null!==w?a:void 0,t:i})]});}let dD=(0,y.memo)(function({chat:e,onChatChanged:t,memoryControl:n,pendingGitChangeComparisons:r}){let i=(0,m.a)(),s=(0,c9.d)(dc(e)),o=r!==null&&r!==void 0?r:[],a=dd(e)||o.length>0;return(0,f.jsxs)("div",{className:`chat-scope-header ${B.default.cmpScopeHeader}`,"data-grounded":a?"true":"false",children:[(0,f.jsx)(dS,{chat:e,onChatChanged:t,catalog:s,connected:a}),void 0!==n?(0,f.jsx)("div",{className:"chat-scope-header-actions",children:n}):null,(0,f.jsx)(F,{chat:e}),(0,f.jsx)(nn.c,{chat:e,onDisconnect:t}),(0,f.jsx)(nl,{chat:e,onDisconnect:t,labels:function(e,t){let n=new Map();for(let r of e.capsules)n.set(`capsule:${r.id}`,(0,c9.X)(r,t));for(let t of e.capsuleSets)n.set(`set:${t.id}`,t.displayName);return n;}(s,i),labelsSettled:!s.loading&&null===s.loadError}),(0,f.jsx)(nt.K,{chat:e,pendingComparisons:o,onDisconnect:t,onRefreshed:t})]});});function dA({action:e,busy:t,error:n,runAction:r,acceptCandidate:i,rejectCandidate:s,onDismissError:o}){let a=(0,m.a)();return(0,f.jsxs)("article",{className:"chat-memory-action",children:[(0,f.jsxs)("div",{className:"chat-memory-action-head",children:[(0,f.jsx)("strong",{children:e.scopeLabel}),(0,f.jsx)("span",{children:"accepted"===e.status?a("chat.memory.accepted"):a(e.requiresApproval?"chat.memory.approvalRequired":"chat.memory.proposedMemory")})]}),(0,f.jsx)("p",{children:e.body}),"proposed"===e.status?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"chat-memory-action-buttons",children:[(0,f.jsx)("button",{type:"button","aria-disabled":t,"aria-busy":t,onClick:()=>{r(()=>i(e.proposalId),a("chat.memory.accepted"),a("chat.memory.acceptError"));},children:a("chat.memory.accept")}),(0,f.jsx)("button",{type:"button","aria-disabled":t,"aria-busy":t,onClick:()=>{r(()=>s(e.proposalId),a("chat.memory.rejected"),a("chat.memory.rejectError"));},children:a("chat.memory.reject")})]}),void 0!==n?(0,f.jsx)(J.f,{error:n,fallback:a("chat.error.memoryUpdate"),onDismiss:o}):null]}):null]});}function dE({action:e}){let t=(0,m.a)();return(0,f.jsxs)("article",{className:"chat-memory-action",children:[(0,f.jsxs)("div",{className:"chat-memory-action-head",children:[(0,f.jsx)("strong",{children:t("chat.memory.updateDetected")}),(0,f.jsx)("span",{children:e.memoryId})]}),(0,f.jsx)("p",{children:void 0!==e.bodyPatch?t("chat.memory.suggestedUpdate",{body:e.bodyPatch}):t("chat.memory.suggestedUpdateFallback")})]});}function dM({action:e,busy:t,confirmForget:n,forgetConfirmText:r,executeForget:i,clearError:s,setConfirmForget:o,setForgetConfirmText:a,t:l}){return e.requiresConfirmation?n?(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("button",{type:"button",disabled:t||"FORGET"!==r,"aria-busy":t,onClick:i,children:l("chat.memory.forgetPermanently")}),(0,f.jsx)("button",{type:"button",disabled:t,"aria-busy":t,onClick:()=>{t||(s(),o(!1),a(""));},children:l("common.cancel")})]}):(0,f.jsx)("button",{type:"button",disabled:t,"aria-busy":t,onClick:()=>{t||(s(),o(!0),a(""));},children:l("chat.memory.reviewForget")}):(0,f.jsx)("button",{type:"button",disabled:t,"aria-busy":t,onClick:i,children:l("chat.memory.forget")});}function dN({action:e,busy:t,error:n,runAction:r,forgetMemoryAction:i,clearError:s}){let o=(0,m.a)(),[a,l]=(0,y.useState)(!1),[c,u]=(0,y.useState)("");return(0,f.jsxs)("article",{className:`chat-memory-action${a?" ai-danger":""}`,children:[(0,f.jsxs)("div",{className:`chat-memory-action-head${a?" ai-danger-h":""}`,children:[a?(0,f.jsx)("span",{className:"ic","aria-hidden":"true",children:"!"}):null,(0,f.jsx)("strong",{children:o("chat.memory.forgetDetected")}),(0,f.jsx)("span",{children:e.requiresConfirmation?o("chat.memory.confirmationRequired"):e.memoryId})]}),(0,f.jsx)("p",{children:o("chat.memory.forgetMatched",{id:e.memoryId})}),a?(0,f.jsxs)("label",{className:"chat-memory-confirm",children:[(0,f.jsx)("span",{children:`Type FORGET to remove ${e.memoryId}.`}),(0,f.jsx)("input",{value:c,onChange:e=>u(e.currentTarget.value),autoComplete:"off"})]}):null,(0,f.jsx)("div",{className:"chat-memory-action-buttons",children:(0,f.jsx)(dM,{action:e,busy:t,confirmForget:a,forgetConfirmText:c,executeForget:()=>{t||e.requiresConfirmation&&"FORGET"!==c||r(()=>i(e.memoryId).then(()=>{l(!1),u("");}),o("chat.memory.forgetCompleted"),o("chat.memory.forgetError"));},clearError:s,setConfirmForget:l,setForgetConfirmText:u,t:o})}),void 0!==n?(0,f.jsx)(J.f,{error:n,fallback:o("chat.error.memoryUpdate"),onDismiss:s}):null]});}function d_({action:e}){let t=(0,m.a)();return(0,f.jsxs)("article",{className:"chat-memory-action",children:[(0,f.jsx)("div",{className:"chat-memory-action-head",children:(0,f.jsx)("strong",{children:t("chat.memory.proposalDeclined")})}),(0,f.jsx)("p",{children:""!==e.reason?e.reason:t("chat.memory.noReason")})]});}function dT({action:e,acceptCandidate:t,rejectCandidate:n,forgetMemoryAction:r,onActionSettled:i}){let s=(0,m.a)(),[o,a]=(0,y.useState)(!1),[l,c]=(0,y.useState)(),u=(0,y.useCallback)(()=>c(void 0),[]),d=(0,y.useCallback)((e,t,n)=>{o||(a(!0),c(void 0),e().then(()=>{i(t);}).catch(e=>{c(e instanceof Error?e.message:n);}).finally(()=>a(!1)));},[o,i]);return"candidate"===e.kind?(0,f.jsx)(dA,{action:e,busy:o,error:l,runAction:d,acceptCandidate:t,rejectCandidate:n,onDismissError:u}):"update"===e.kind?(0,f.jsx)(dE,{action:e}):"forget"===e.kind?(0,f.jsx)(dN,{action:e,busy:o,error:l,runAction:d,forgetMemoryAction:r,clearError:u}):"rejected"===e.kind?(0,f.jsx)(d_,{action:e}):(0,f.jsx)("article",{className:"chat-memory-action",children:(0,f.jsx)("div",{className:"chat-memory-action-head",children:(0,f.jsx)("strong",{children:s("chat.memory.actionNotCreated")})})});}let dR=(0,y.memo)(function({chat:e,busy:t}){return void 0!==e&&dd(e)&&t?(0,f.jsx)("div",{className:"chatw-grounded",children:(0,f.jsx)(G.w,{answer:void 0,busy:t})}):null;});function dI({disclosure:e}){return(0,f.jsxs)("button",{ref:e.disclosureButtonRef,type:"button",className:"chat-memory-disclosure-toggle ui-tip cmp-tip-end","aria-expanded":e.open,"aria-controls":e.disclosureId,"aria-label":e.memoryDisclosureLabel,"data-empty":0===e.memoryCount?"true":"false","data-tip":e.memoryDisclosureLabel,onClick:e.toggleDisclosure,children:[(0,f.jsx)(c7,{size:16}),e.memoryCount>0?(0,f.jsx)("span",{className:"chat-memory-count","aria-hidden":"true",children:e.memoryCountLabel}):null]});}function dj({enabled:e,onChange:t}){let n=(0,m.a)()(e?"chat.memory.disableForChat":"chat.memory.enableForChat");return(0,f.jsx)("button",{type:"button",className:`chat-memory-activation-toggle ui-tip cmp-tip-end ${g.default.memoryActivationButton}`,"aria-label":n,"aria-pressed":e,"data-enabled":e?"true":"false","data-tip":n,onClick:()=>{t(!e);},children:(0,f.jsx)(us,{size:16})});}function dF(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):0;}function dO({budgetTokens:e,setBudgetTokens:t}){let n=(0,m.a)(),r=(0,y.useId)(),i=`${r}-chat-memory-budget`,s=`${r}-chat-memory-budget-help`,o=(0,y.useCallback)(e=>{t(dF(e.target.value));},[t]);return(0,f.jsxs)("div",{className:g.default.memoryBudgetSetting,children:[(0,f.jsx)("label",{htmlFor:i,children:n("memoria.settings.budget")}),(0,f.jsxs)("div",{className:g.default.memoryBudgetControl,children:[(0,f.jsx)("input",{id:i,type:"number",min:0,step:100,value:e,"aria-describedby":s,onChange:o}),(0,f.jsx)("span",{children:n("memoria.settings.budgetUnit")})]}),(0,f.jsx)("p",{id:s,children:n("memoria.settings.budgetHelp")})]});}let dz=(0,y.memo)(function({latestMemory:e,memoryBudgetTokens:t,setMemoryBudgetTokens:n,acceptCandidate:r,rejectCandidate:i,forgetMemoryAction:s,disclosure:o}){let a=(0,m.a)();return o.open?(0,f.jsx)("section",{className:"chat-memory-panel","aria-label":a("chat.memory.panel"),children:(0,f.jsxs)("div",{id:o.disclosureId,className:"chat-memory-disclosure",children:[(0,f.jsx)("p",{className:"chat-memory-summary",children:void 0===e?a("chat.memory.disclosurePending"):e.context.enabled?a("chat.memory.usedTokens",{used:e.context.budget.used,tokens:e.context.budget.tokens}):a("chat.memory.disabledLast")}),(0,f.jsx)(dO,{budgetTokens:t,setBudgetTokens:n}),e===null||e===void 0?void 0:e.context.memories.map(e=>(0,f.jsxs)("article",{className:"chat-memory-item",children:[(0,f.jsxs)("div",{className:"chat-memory-item-head",children:[(0,f.jsx)("strong",{children:e.memoryId}),(0,f.jsx)("span",{children:e.inclusionReason})]}),(0,f.jsx)("p",{children:e.bodyExcerpt}),(0,f.jsxs)("dl",{className:"chat-memory-meta","aria-label":a("chat.memory.provenance",{id:e.memoryId}),children:[(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:a("chat.memory.source")}),(0,f.jsx)("dd",{children:e.sourceKind})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:a("chat.memory.sensitivity")}),(0,f.jsx)("dd",{children:e.sensitivity})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:a("chat.memory.status")}),(0,f.jsx)("dd",{children:e.status})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:a("chat.memory.confidence")}),(0,f.jsx)("dd",{children:`${String(Math.round(100*e.confidence))}%`})]}),(0,f.jsxs)("div",{children:[(0,f.jsx)("dt",{children:a("chat.memory.captured")}),(0,f.jsx)("dd",{children:new Date(e.capturedAt).toISOString().slice(0,10)})]})]}),void 0!==e.captureRationale?(0,f.jsx)("p",{className:"chat-memory-rationale",children:e.captureRationale}):null]},e.memoryId)),e===null||e===void 0?void 0:e.actions.map(e=>(0,f.jsx)(dT,{action:e,acceptCandidate:r,rejectCandidate:i,forgetMemoryAction:s,onActionSettled:o.handleActionSettled},"candidate"===e.kind?e.proposalId:"rejected"===e.kind?e.reason:e.memoryId)),(0,f.jsx)("p",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:o.actionStatus})]})}):null;});function dB({activeChat:e,replaceChat:t,memoryControl:n,pendingGitChangeComparisons:r,latestMemory:i,memoryBudgetTokens:s,setMemoryBudgetTokens:o,acceptMemoryCandidate:a,rejectMemoryCandidate:l,forgetMemoryAction:c,memoryDisclosure:u,noEligibleModels:d,loading:h}){return(0,f.jsxs)(f.Fragment,{children:[void 0!==e?(0,f.jsx)(dD,{chat:e,onChatChanged:t,memoryControl:n,pendingGitChangeComparisons:r}):null,void 0!==e?(0,f.jsx)(dz,{latestMemory:i,memoryBudgetTokens:s,setMemoryBudgetTokens:o,acceptCandidate:a,rejectCandidate:l,forgetMemoryAction:c,disclosure:u}):null,d?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsx)(u6,{})}):null,h?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsx)(u5,{})}):null]});}function dP({activeChat:e,effectiveMinimal:t}){return void 0!==e?(0,f.jsx)(di,{minimal:t}):(0,f.jsx)(ds,{});}function dL({regionRef:e,stickRef:t,onLogScroll:n,pendingQuestionScrollRef:r,focusedQuestionId:i,setFocusedQuestionId:s,visible:o,hasLiveStreamingAssistant:a,activeChat:l,effectiveMinimal:c,showQuestionMap:u,questionMapItems:d,scrollToQuestion:h,streamingAssistantMessage:p,onOpenRunResult:g,repositoryRoots:v,openRepositoryReference:y,previewWindows:k,windowId:b,sending:x,sendStatus:w,regeneratingMessageId:C,cancelGrounded:S,regenerateMessage:D,cancelSend:A,registerQuestionAnchor:E,lastSentDocuments:M,lastSentImages:N}){let _=(0,m.a)();return(0,f.jsx)("div",{className:"chatw-scroll",ref:e,role:"log","aria-label":_("chat.conversation"),tabIndex:0,onScroll:()=>{n(),t.current&&null!==i&&(r.current=null,s(null));},children:0!==o.length||a?(0,f.jsxs)("div",{className:`chatw-log-shell${u?" chatw-log-shell-with-map":""}`,children:[u?(0,f.jsx)(u$,{items:d,onJump:h}):null,(0,f.jsxs)("div",{className:"chatw-log",children:[(0,f.jsx)(uq,{messages:o,streamingAssistantMessage:p,onOpenRunResult:g,repositoryRoots:v,openRepositoryReference:y,previewWindows:k,windowId:b,sending:x,sendStatus:w,regeneratingMessageId:C,activeChat:l,onCancelGrounded:S,onRegenerate:D,onCancelRegenerate:A,showRegenerateControls:!c,registerQuestionAnchor:E,focusedMessageId:i}),(0,f.jsx)(dR,{chat:l,busy:x}),(0,f.jsx)(eZ,{documents:M}),(0,f.jsx)(eQ,{images:N})]})]}):(0,f.jsx)(dP,{activeChat:l,effectiveMinimal:c})});}function d$({notice:e,onDismiss:t}){let n=(0,m.a)();return(0,f.jsxs)("output",{className:g.default.sessionNotice,children:[(0,f.jsx)("span",{children:e}),void 0===t?null:(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",onClick:t,children:n("common.dismiss")})]});}function dq({error:e,clearError:t,notice:n,clearNotice:r}){return void 0!==e?(0,f.jsx)(J.f,{error:e,fallback:"Could not load chat.",onDismiss:t}):void 0!==n?(0,f.jsx)(d$,{notice:n,onDismiss:r}):null;}function dV(){let{markdownSkill:e}=(0,H.E)(),t=(0,m.a)();return(0,ew.y)(e)?(0,f.jsx)("output",{className:g.default.sessionNotice,children:t((e===null||e===void 0?void 0:e.busy)===!0?"chat.skills.loading":"chat.skills.sendBlocked")}):null;}function dU({canonicalVoiceTurnRequiresRetry:e,retryPendingCanonicalVoiceTurn:t,discardPendingCanonicalVoiceTurn:n,error:r,clearError:i,notice:s,clearNotice:o}){let a=(0,m.a)();return e?(0,f.jsxs)("div",{className:g.default.pendingVoiceTurnNotice,role:"alert",children:[(0,f.jsx)("span",{children:a("chat.voice.pendingTurn")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn cmp-voice-btn-primary",onClick:t,children:a("chat.voice.retryPendingTurn")}),(0,f.jsx)("button",{type:"button",className:"cmp-voice-btn",onClick:n,children:a("chat.voice.discardPendingTurn")})]}):void 0!==r?(0,f.jsx)(J.f,{error:r,fallback:a("chat.error.send"),onDismiss:i}):void 0===s?null:(0,f.jsx)(d$,{notice:s,onDismiss:o});}function dW({visible:e,activeChat:t,suspended:n,effectiveCompact:r,effectiveMinimal:i,effectiveControlsNarrow:s,effectiveBarCompact:o,ready:a,loading:l,onSubmit:c,inputRef:u,error:d,clearError:h,notice:p,clearNotice:v,canonicalVoiceTurnRequiresRetry:y,retryPendingCanonicalVoiceTurn:k,discardPendingCanonicalVoiceTurn:b}){var x;let w=(0,m.a)();return(0,f.jsxs)(f.Fragment,{children:[e.length>0||void 0!==t?(0,f.jsx)("div",{className:`chatw-foot ${g.default.cmpFooter}`,children:(0,f.jsxs)("form",{className:`composer${r?" composer-chat-compact":""}`,onSubmit:e=>{e.preventDefault(),c();},children:[(0,f.jsx)(dr,{ready:a,placeholder:(x=e.length,w(0===x&&l?"chat.loadingGateway":"chat.composer.placeholder")),inputRef:u,suspended:n,minimal:i,compact:r,controlsNarrow:s,barCompact:o}),(0,f.jsx)(dV,{}),(0,f.jsx)(dU,{canonicalVoiceTurnRequiresRetry:y,retryPendingCanonicalVoiceTurn:k,discardPendingCanonicalVoiceTurn:b,error:d,clearError:h,notice:p,clearNotice:v})]})}):null,0===e.length&&void 0===t&&(void 0!==d||void 0!==p)?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsx)(dq,{error:d,clearError:h,notice:p,clearNotice:v})}):null]});}e.s(["ChatWindow",0,function({windowId:e,suspended:t=!1,mini:n=!1,minimalChat:r=!1,compact:i=!1,controlsNarrow:s=!1,barCompact:o=!1,workflowCompact:a=!1,linkedRoot:l=null,linkedRoots:c=[],linkedGitChangeComparisons:u=[],openEditorFile:d,previewWindows:h,onOpenRunResult:p}){var _k$latestGrounded,_w$findLast;let k=(0,H.Y)(),b=(0,y.useRef)(null),x=(0,m.a)(),{messages:w,streamingAssistantMessage:C,draft:D,loading:A,sending:E,sendStatus:M,regeneratingMessageId:N,error:_,notice:T,noEligibleModels:I,sendMessage:j,regenerateMessage:F,cancelSend:O,cancelGrounded:z,activeChat:B,canonicalVoiceTurnRequiresRetry:P,retryPendingCanonicalVoiceTurn:$,discardPendingCanonicalVoiceTurn:V,replaceChat:U,memoryEnabled:W,setMemoryEnabled:K,memoryBudgetTokens:J,setMemoryBudgetTokens:G,latestMemory:Z,lastSentDocuments:Q,lastSentImages:Y=[],acceptMemoryCandidate:X,rejectMemoryCandidate:ee,forgetMemoryAction:et}=k,en=(0,m.W)(_,x),er=!(0,ew.y)(k.markdownSkill)&&void 0===k.groundingScopeTransition&&D.trim().length>0&&!E&&!A&&!I&&!0!==P,ei=(0,y.useMemo)(()=>w.filter(e=>"user"===e.role||"assistant"===e.role&&e.content.length>0||eX(e)),[w]),es=void 0!==C&&C.content.length>0,eo=(0,y.useRef)(null),ea=(0,y.useMemo)(()=>{var e;let t,n,r,i;return n=new Set((t=uV((e={chat:B,linkedRoot:l,linkedRoots:c}).chat)).map(({root:e})=>e)),r=null===e.linkedRoot?[]:[e.linkedRoot],i=e.linkedRoots.length>0?e.linkedRoots:r,[...t,...(0,e$.K)(function(e){let t=new Set(),n=[];for(let r of e){let e=r.trim();0===e.length||t.has(e)||(t.add(e),n.push(e));}return n.filter(e=>!n.some(t=>{let n,r;return t!==e&&(n=S(e),r=S(t),n.length>0&&r.length>n.length&&r.startsWith(`${n}/`));}));}([...n,...i])).filter(({root:e})=>!n.has(e))];},[B,l,c]),el=(0,y.useRef)(!1),ec=es?C:ei.length>0?ei.at(-1):void 0,eu=void 0===ec?"":ec.content,{stickRef:ed,onScroll:eh,regionRef:ep,resume:ef}=(0,nu.f)(eo,`${String(ei.length)}:${E?"1":"0"}:${String(eu.length)}`);(0,y.useEffect)(()=>{E&&!el.current&&ef(),el.current=E;},[ef,E]);let{effectiveCompact:em,effectiveControlsNarrow:eg,effectiveBarCompact:ev}={effectiveCompact:i||n,effectiveControlsNarrow:s||n||r||a,effectiveBarCompact:o||r},ey=function(e,_e$context$memories$l){let t=(0,m.a)(),[n,r]=(0,y.useState)(!1),[i,s]=(0,y.useState)(""),o=(0,y.useId)(),a=`${o}-chat-memory-disclosure`,l=(0,y.useRef)(null),c=(0,y.useCallback)(e=>{var _l$current2;s(e),(_l$current2=l.current)===null||_l$current2===void 0?void 0:_l$current2.focus();},[]),u=(0,y.useCallback)(()=>{r(e=>!e);},[]),d=(_e$context$memories$l=e===null||e===void 0?void 0:e.context.memories.length)!==null&&_e$context$memories$l!==void 0?_e$context$memories$l:0,h=d>0?t("chat.memory.included",{count:d}):t("chat.memory.noneIncluded"),p=d>99?"99+":String(d);return(0,y.useMemo)(()=>({open:n,actionStatus:i,disclosureId:a,disclosureButtonRef:l,memoryCount:d,memoryCountLabel:p,memoryDisclosureLabel:h,toggleDisclosure:u,handleActionSettled:c}),[n,i,a,d,p,h,u,c]);}(Z),ek=(0,y.useMemo)(()=>(0,f.jsxs)("div",{className:g.default.memoryControls,children:[(0,f.jsx)(dj,{enabled:W,onChange:K}),(0,f.jsx)(dI,{disclosure:ey})]}),[ey,W,K]),eb=(0,y.useRef)(new Map()),[ex,eC]=(0,y.useState)(null),eS=(0,y.useRef)(null),eD=(0,y.useMemo)(()=>ei.filter(e=>"user"===e.role).map((e,t)=>{let n;return{id:e.id,index:t+1,preview:(n=e.content.replace(/\s+/g," ").trim()).length<=76?n:`${n.slice(0,73).trimEnd()}...`,time:um(e.timestamp)};}),[ei]),eA=eD.length>=2,eE=(0,y.useCallback)((e,t)=>{null===t?eb.current.delete(e):eb.current.set(e,t);},[]),eM=(0,y.useCallback)(e=>{eC(e);let t=eb.current.get(e);if(void 0===t){eS.current=e;return;}ed.current=!1,t.scrollIntoView({block:"start",behavior:"smooth"});},[ed]);return(0,y.useEffect)(()=>{let e=eS.current;if(null===e)return;let t=eb.current.get(e);void 0!==t&&(eS.current=null,ed.current=!1,t.scrollIntoView({block:"start",behavior:"smooth"}));},[ex,ed,ei.length]),(0,y.useEffect)(()=>{E&&(eS.current=null,eC(null));},[E]),(0,y.useEffect)(()=>{eS.current=null,eC(null);},[B===null||B===void 0?void 0:B.id]),(0,f.jsxs)("div",{className:`chatw${em?" chatw-compact":""}${r?" chatw-minimal":""}`,children:[(0,f.jsx)(dB,{activeChat:B,replaceChat:U,memoryControl:ek,pendingGitChangeComparisons:u,latestMemory:Z,memoryBudgetTokens:J,setMemoryBudgetTokens:G,acceptMemoryCandidate:X,rejectMemoryCandidate:ee,forgetMemoryAction:et,memoryDisclosure:ey,noEligibleModels:I,loading:A}),(0,f.jsx)(dL,{regionRef:ep,stickRef:ed,onLogScroll:eh,pendingQuestionScrollRef:eS,focusedQuestionId:ex,setFocusedQuestionId:eC,visible:ei,hasLiveStreamingAssistant:es,activeChat:B,effectiveMinimal:r,showQuestionMap:eA,questionMapItems:eD,scrollToQuestion:eM,streamingAssistantMessage:C,onOpenRunResult:p,repositoryRoots:ea,openRepositoryReference:d,previewWindows:h,windowId:e,sending:E,sendStatus:M,regeneratingMessageId:N,cancelGrounded:z,regenerateMessage:F,cancelSend:O,registerQuestionAnchor:eE,lastSentDocuments:Q,lastSentImages:Y}),(0,f.jsx)(L,{chat:B,answer:(_k$latestGrounded=k.latestGrounded)!==null&&_k$latestGrounded!==void 0?_k$latestGrounded:(_w$findLast=w.findLast(e=>"assistant"===e.role&&void 0!==e.groundedAnswer))===null||_w$findLast===void 0?void 0:_w$findLast.groundedAnswer,onChatChanged:U,setDraft:k.setDraft,draft:D,focusComposer:()=>{var _b$current2;return(_b$current2=b.current)===null||_b$current2===void 0?void 0:_b$current2.focus();}}),(0,f.jsx)(v,{draft:D,persistence:k.draftPersistence}),(0,f.jsx)(u3,{transition:k.groundingScopeTransition}),(0,f.jsx)(dW,{visible:ei,activeChat:B,suspended:t,effectiveCompact:em,effectiveMinimal:r,effectiveControlsNarrow:eg,effectiveBarCompact:ev,ready:er,loading:A,onSubmit:()=>{var _b$current3;let e=(_b$current3=b.current)===null||_b$current3===void 0?void 0:_b$current3.currentMarkdown;void 0===e?j():(e!==D&&((0,q.flushSync)(()=>k.setDraft(e)),(0,R.v)("Keiko composer submitted the current editor draft.",{composerActivity:"literal-input-preserved"})),j({text:e,clearDraftOnAdmission:!0}));},inputRef:b,error:en,clearError:k.clearError,notice:T,clearNotice:k.clearNotice,canonicalVoiceTurnRequiresRetry:!0===P,retryPendingCanonicalVoiceTurn:$,discardPendingCanonicalVoiceTurn:V})]});},"ConversationQuestionMap",0,u$,"MemoryActionForgetButtons",0,dM,"answerReadingText",0,uC,"clearKnowledgeCatalogCacheForTests",()=>c9.c,"copyableMessageText",0,ub,"groundedCitationCeiling",0,uM,"messageForSelectedResponseVersion",0,uI,"normalizeMemoryBudgetInput",0,dF,"rootDisplayName",()=>e$.e,"sendStatusLabel",0,function(e){switch(e){case"idle":case"completed":case"failed":return"";case"queued":return"Submitting your message…";case"contacting":return"Preparing response…";case"streaming":return"Receiving response…";case"cancelled":return"Response cancelled.";}},"speakableAnswerText",0,ux,"speechPreparationEvidence",0,uD],219);},72117,function(e){e.n(e.i(219));},21179,e=>{e.v({cmpCode:"x0BgeG_cmpCode "+e.i(87513).themeTokens,cmpCodeHeader:"x0BgeG_cmpCodeHeader",cmpCodeHost:"x0BgeG_cmpCodeHost",cmpContinue:"x0BgeG_cmpContinue",cmpEditor:"x0BgeG_cmpEditor",cmpFallback:"x0BgeG_cmpFallback",cmpLanguage:"x0BgeG_cmpLanguage",cmpNotice:"x0BgeG_cmpNotice",cmpRoot:"x0BgeG_cmpRoot"});}]);