@oscharko-dev/keiko 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/dist/ui/csp-hashes.json +6 -6
- package/dist/ui/static/404.html +1 -1
- package/dist/ui/static/__next.__PAGE__.txt +12 -12
- package/dist/ui/static/__next._full.txt +23 -22
- package/dist/ui/static/__next._tree.txt +2 -2
- package/dist/ui/static/_next/static/chunks/00h6kszysb2wr.js +1 -0
- package/dist/ui/static/_next/static/chunks/013tmcojxoy8z.js +1 -0
- package/dist/ui/static/_next/static/chunks/014h2nyfet3kr.js +1 -0
- package/dist/ui/static/_next/static/chunks/{0mjsj7bp-ukgh.css → 02ycexmxeqhmx.css} +28 -10
- package/dist/ui/static/_next/static/chunks/{2kylv1kq1_4p1.js → 0650rzqxvrg4k.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0851fl0j1ja4e.js +1 -0
- package/dist/ui/static/_next/static/chunks/08896ukd2zxg6.js +1 -0
- package/dist/ui/static/_next/static/chunks/08tg5xjyy073b.js +1 -0
- package/dist/ui/static/_next/static/chunks/0b7xat6jxvrmr.js +1 -0
- package/dist/ui/static/_next/static/chunks/0e0h-sia4dm93.js +2 -0
- package/dist/ui/static/_next/static/chunks/0e3x-8o_fjsn_.js +1 -0
- package/dist/ui/static/_next/static/chunks/0eeyfcixqqfab.js +1 -0
- package/dist/ui/static/_next/static/chunks/0eyoirips0ket.js +1 -0
- package/dist/ui/static/_next/static/chunks/{0--s8pmsbkf62.js → 0gns083_remf0.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0ji_km0dqy8qj.js +1 -0
- package/dist/ui/static/_next/static/chunks/0jtp8te-03j1-.js +1 -0
- package/dist/ui/static/_next/static/chunks/0lw_ax6yn_z8w.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3h-rh_lx0l8_3.js → 0pf5ot48kepng.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0rs9egrg2q85w.js +1 -0
- package/dist/ui/static/_next/static/chunks/0sjewje-u3bqg.js +1 -0
- package/dist/ui/static/_next/static/chunks/{0iu3dyqe7m7_7.js → 0t10yxd1t9qeg.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{0l72usw6suk0h.js → 0ta8ifx4mr6gi.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0wok-g3ndtvch.js +1 -0
- package/dist/ui/static/_next/static/chunks/{0yzmg9aoglud6.js → 0y0r5znrj9qw-.js} +1 -1
- package/dist/ui/static/_next/static/chunks/0y3402xorco2c.js +1 -0
- package/dist/ui/static/_next/static/chunks/14ytv6jraivph.js +1 -0
- package/dist/ui/static/_next/static/chunks/15tj-r-c7bs-p.js +1 -0
- package/dist/ui/static/_next/static/chunks/18idxjg523mhp.js +1 -0
- package/dist/ui/static/_next/static/chunks/18kcx5kpyxr16.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3hclt6m3ok4n9.js → 1g_d_8a7vlqgu.js} +1 -1
- package/dist/ui/static/_next/static/chunks/1lm4kkulhv0b_.js +1 -0
- package/dist/ui/static/_next/static/chunks/1o-own3kgpojf.js +1 -0
- package/dist/ui/static/_next/static/chunks/1pe5ee9wh-qwa.js +1 -0
- package/dist/ui/static/_next/static/chunks/1qcpuq815jtog.js +3 -0
- package/dist/ui/static/_next/static/chunks/1s3u1scfdjjd9.js +1 -0
- package/dist/ui/static/_next/static/chunks/1zqfkyeqq5cl8.js +1 -0
- package/dist/ui/static/_next/static/chunks/20-u8pg5ve_cz.js +1 -0
- package/dist/ui/static/_next/static/chunks/21rpgm75hndoe.js +1 -0
- package/dist/ui/static/_next/static/chunks/21s3ugswalpzt.js +1 -0
- package/dist/ui/static/_next/static/chunks/22zxuap4am9bs.js +1 -0
- package/dist/ui/static/_next/static/chunks/27e2u3lrksak4.js +1 -0
- package/dist/ui/static/_next/static/chunks/2g_pljoa8f0e-.js +1 -0
- package/dist/ui/static/_next/static/chunks/2go0k_akgnv11.js +1 -0
- package/dist/ui/static/_next/static/chunks/2jsnrkl0syr4y.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3qjkuhjy_-_br.js → 2m7wxgg82-7yj.js} +1 -1
- package/dist/ui/static/_next/static/chunks/2pg4yzdak17yp.js +1 -0
- package/dist/ui/static/_next/static/chunks/{0bpexy600ffpg.js → 2tlvii78gzv6c.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{2y98z-sun8_ew.js → 2u5_pu1uc6seh.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{3eduf6vevclfm.js → 2v4u52qc4tcdm.js} +1 -1
- package/dist/ui/static/_next/static/chunks/2xd3_a4jlxum2.css +1 -0
- package/dist/ui/static/_next/static/chunks/{196257vfyrtgu.js → 2ywljh6s1u2zd.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3-pcgkdsv7x4z.js +1 -0
- package/dist/ui/static/_next/static/chunks/307xuhrdmetj7.js +1 -0
- package/dist/ui/static/_next/static/chunks/32jgtvf2y-f54.js +1 -0
- package/dist/ui/static/_next/static/chunks/35ivnhnxr9dmz.js +1 -0
- package/dist/ui/static/_next/static/chunks/363iuc3t94rie.js +1 -0
- package/dist/ui/static/_next/static/chunks/37qsy798-g74f.js +1 -0
- package/dist/ui/static/_next/static/chunks/37v998g0cm36x.js +1 -0
- package/dist/ui/static/_next/static/chunks/{3603jy78awb1p.js → 38rjnjhuttjqs.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3_m42xgt33mnw.js +4 -0
- package/dist/ui/static/_next/static/chunks/3b05n-007vc3e.js +1 -0
- package/dist/ui/static/_next/static/chunks/3cpuzx4fetu6y.js +1 -0
- package/dist/ui/static/_next/static/chunks/3d27ozm1boe_5.js +3 -0
- package/dist/ui/static/_next/static/chunks/{1a6ri-sriyu-m.js → 3ftqojkan-5cl.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3fwt6-8rc2mya.js +1 -0
- package/dist/ui/static/_next/static/chunks/{196x_tfexoucg.js → 3g4px251sg85e.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3hb_wkp14tb6b.js +1 -0
- package/dist/ui/static/_next/static/chunks/3ifa0dznjb9z9.js +1 -0
- package/dist/ui/static/_next/static/chunks/{1n3b0bhd9q0p6.js → 3l3xw2fmr7pct.js} +3 -3
- package/dist/ui/static/_next/static/chunks/3payvp5ps2fne.css +3 -0
- package/dist/ui/static/_next/static/chunks/3q-93bizla3k1.js +1 -0
- package/dist/ui/static/_next/static/chunks/{2ta3xj9td_qot.js → 3rhep1yhgo6a7.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3umqj2wkb8goj.js +1 -0
- package/dist/ui/static/_next/static/chunks/3xi3iilmw9_vy.js +5 -0
- package/dist/ui/static/_next/static/chunks/{09zc5hgtb7s-z.js → 3ya92_ies62hp.js} +1 -1
- package/dist/ui/static/_next/static/chunks/3zxbqudoeow_a.js +1 -0
- package/dist/ui/static/_next/static/chunks/{2b_t95bbpmtej.js → 4014adorwuv48.js} +1 -1
- package/dist/ui/static/_next/static/chunks/{24u-5fslcj3n9.js → 42otn3fqwlbyi.js} +1 -1
- package/dist/ui/static/_next/static/chunks/42pls95xys34g.js +1 -0
- package/dist/ui/static/_next/static/chunks/43z5mfwx4lk4w.js +1 -0
- package/dist/ui/static/_next/static/chunks/{turbopack-2rwr7ign9ynaa.js → turbopack-34k8wgx0iwdzg.js} +1 -1
- package/dist/ui/static/_not-found/__next._full.txt +21 -20
- package/dist/ui/static/_not-found/__next._not-found.__PAGE__.txt +9 -9
- package/dist/ui/static/_not-found/__next._tree.txt +1 -1
- package/dist/ui/static/_not-found.html +1 -1
- package/dist/ui/static/_not-found.txt +21 -20
- package/dist/ui/static/atlassian-connectors/__next._full.txt +23 -22
- package/dist/ui/static/atlassian-connectors/__next._tree.txt +1 -1
- package/dist/ui/static/atlassian-connectors/__next.atlassian-connectors.__PAGE__.txt +11 -11
- package/dist/ui/static/atlassian-connectors.html +1 -1
- package/dist/ui/static/atlassian-connectors.txt +23 -22
- package/dist/ui/static/index.html +1 -1
- package/dist/ui/static/index.txt +23 -22
- package/dist/ui/static/launch/__next._full.txt +26 -25
- package/dist/ui/static/launch/__next._tree.txt +2 -2
- package/dist/ui/static/launch/__next.launch.__PAGE__.txt +12 -12
- package/dist/ui/static/launch.html +1 -1
- package/dist/ui/static/launch.txt +26 -25
- package/dist/ui/static/local-knowledge/__next._full.txt +26 -25
- package/dist/ui/static/local-knowledge/__next._tree.txt +2 -2
- package/dist/ui/static/local-knowledge/__next.local-knowledge.__PAGE__.txt +12 -12
- package/dist/ui/static/local-knowledge/capsule/__next._full.txt +11 -11
- package/dist/ui/static/local-knowledge/capsule/__next._tree.txt +1 -1
- package/dist/ui/static/local-knowledge/capsule/__next.local-knowledge.capsule.__PAGE__.txt +11 -11
- package/dist/ui/static/local-knowledge/capsule.html +1 -1
- package/dist/ui/static/local-knowledge/capsule.txt +11 -11
- package/dist/ui/static/local-knowledge.html +1 -1
- package/dist/ui/static/local-knowledge.txt +26 -25
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-analyze.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-analyze.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-analyze.js +26 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-code-inventory.generated.js +140 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts +14 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-registry-history.generated.js +17 -1
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-retrieval-miss.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-retrieval-miss.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/dist/reader/support-retrieval-miss.js +363 -0
- package/node_modules/@oscharko-dev/keiko-activity-log/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-cli/dist/init.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/init.js +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle-browser-activity.d.ts +22 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle-browser-activity.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle-browser-activity.js +50 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/lifecycle.js +137 -32
- package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts +24 -3
- package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/state-paths.js +126 -5
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui-browser-handoff.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui-browser-handoff.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui-browser-handoff.js +91 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-cli/dist/ui.js +31 -3
- package/node_modules/@oscharko-dev/keiko-cli/package.json +15 -15
- package/node_modules/@oscharko-dev/keiko-connectors/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-connectors/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-connectors/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts +250 -50
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-failure-class-contracts.js +342 -25
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts +2618 -246
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-operations.generated.js +3079 -263
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.d.ts +2509 -153
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/activity-log-registry.generated.js +2962 -36
- package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts +51 -6
- package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/bff-wire.js +64 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session-pairing.d.ts +37 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session-pairing.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session-pairing.js +67 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session.d.ts +2 -35
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-app-session.js +1 -62
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-repository-search.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-repository-search.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-repository-search.js +12 -9
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-safe-activity.d.ts +38 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-safe-activity.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-safe-activity.js +94 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.d.ts +3 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api-validation.js +64 -17
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api.d.ts +8 -4
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-api.js +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.d.ts +17 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime-constants.js +13 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-runtime.js +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-validation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench-validation.js +27 -3
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts +28 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/coding-workbench.js +27 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/connected-context.d.ts +28 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/connected-context.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/connected-context.js +60 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/contract-validation-primitives.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/contract-validation-primitives.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/contract-validation-primitives.js +12 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts +70 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/diagnostics.js +266 -5
- package/node_modules/@oscharko-dev/keiko-contracts/dist/evidence.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/evidence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.d.ts +57 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/gateway.js +4 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/governed-tool-catalog.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/grounded-assessment.d.ts +10 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/grounded-assessment.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/grounded-assessment.js +52 -12
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts +5 -5
- package/node_modules/@oscharko-dev/keiko-contracts/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/markdown-skills.d.ts +41 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/markdown-skills.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/markdown-skills.js +9 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/no-evidence-answer.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/no-evidence-answer.js +29 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/opencode-service-host.d.ts +42 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/opencode-service-host.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/opencode-service-host.js +151 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/prompt-enhancer-bff.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/prompt-enhancer-bff.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/prompt-enhancer-bff.js +7 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/support-report.d.ts +36 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/support-report.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/support-report.js +11 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/tools.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/version.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/version.js +2 -2
- package/node_modules/@oscharko-dev/keiko-contracts/dist/workspace.d.ts +41 -0
- package/node_modules/@oscharko-dev/keiko-contracts/dist/workspace.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-contracts/dist/workspace.js +18 -0
- package/node_modules/@oscharko-dev/keiko-contracts/package.json +9 -1
- package/node_modules/@oscharko-dev/keiko-evaluations/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-evidence/dist/connected-context-evidence.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-evidence/dist/connected-context-evidence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/connected-context-evidence.js +23 -3
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-evidence/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-git/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-git/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-git/package.json +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-harness/package.json +7 -7
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/conversation/grounded-answer-runner.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/conversation/grounded-answer-runner.js +3 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/_internal.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/_internal.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/_internal.js +2 -33
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/parsers/html-parser.js +5 -4
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/index.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/index.js +2 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/retrieval-runner.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/retrieval-runner.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/retrieval-runner.js +1 -0
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/scoped-vector-search.d.ts +9 -2
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/scoped-vector-search.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/retrieval/scoped-vector-search.js +18 -10
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-local-knowledge/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-capture/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-consolidation/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-governance/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-retrieval/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-memory-vault/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/config.js +103 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/embedding.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/embedding.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/embedding.js +2 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway-attempt-admission.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway-attempt-admission.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway-attempt-admission.js +44 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts +89 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/gateway.js +617 -129
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts +4 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/http.js +28 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts +3 -2
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/index.js +2 -2
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/model-selection.d.ts +23 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/model-selection.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/model-selection.js +50 -5
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/normalize.js +54 -2
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/observability.js +2 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts +11 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/openai-adapter.js +262 -58
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/readiness-probe.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/readiness-probe.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/readiness-probe.js +1 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts +143 -3
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/resilience.js +361 -39
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.d.ts +9 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/toolCatalogBridge.js +62 -16
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/types.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-model-gateway/package.json +4 -4
- package/node_modules/@oscharko-dev/keiko-quality-intelligence/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/backends.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/backends.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/backends.js +30 -15
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/plan.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/plan.js +24 -3
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/runtime-gateway.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/runtime-gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/runtime-gateway.js +31 -6
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/seatbelt-execution-root.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/seatbelt-execution-root.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/seatbelt-execution-root.js +141 -0
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/select.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/select.js +2 -0
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/types.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-sandbox/dist/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-sandbox/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-sdk/package.json +9 -9
- package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts +10 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/errors/gateway.js +25 -2
- package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/portable-tree-attestation.d.ts +14 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/portable-tree-attestation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/portable-tree-attestation.js +183 -25
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/redaction.js +16 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-security/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-security/package.json +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-activity.d.ts +9 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-activity.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-activity.js +64 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-compaction-model-summary.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-context-breakdown.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-context-breakdown.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-context-breakdown.js +23 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-context-status.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-context-status.js +27 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts +7 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-handlers.js +37 -9
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget-diagnostics.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget-diagnostics.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget-diagnostics.js +7 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget-token-summary.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget-token-summary.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget-token-summary.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-budget.js +18 -11
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-compaction.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-compaction.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-prompt-compaction.js +4 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-stream-handlers.js +11 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-turn-identity.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/chat-turn-identity.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/client-diagnostics-routes.js +274 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionCookie.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionCookie.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-app-session/sessionCookie.js +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/ciRepairPromptReservation.d.ts +11 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/ciRepairPromptReservation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/ciRepairPromptReservation.js +21 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeActivityOperations.d.ts +50 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeActivityOperations.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeActivityOperations.js +25 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeCiRepairController.d.ts +14 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeCiRepairController.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeCiRepairController.js +33 -26
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.d.ts +46 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeControlPlane.js +33 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.d.ts +51 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeEventHub.js +97 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.d.ts +8 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeManager.js +265 -29
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.d.ts +37 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestrator.js +416 -34
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorState.d.ts +5 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorState.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorState.js +14 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorTypes.d.ts +21 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeOrchestratorTypes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRefusalEscalation.d.ts +79 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRefusalEscalation.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRefusalEscalation.js +305 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRepositoryInstructions.d.ts +100 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRepositoryInstructions.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRepositoryInstructions.js +363 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRoutes.js +13 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRunEffort.d.ts +71 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRunEffort.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeRunEffort.js +294 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeTerminalCause.d.ts +47 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeTerminalCause.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeTerminalCause.js +65 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeVerificationContinuation.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeVerificationContinuation.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingRuntimeVerificationContinuation.js +79 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.d.ts +18 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingSafeActivityProjection.js +201 -42
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolAuthorityPort.d.ts +6 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolAuthorityPort.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolAuthorityPort.js +733 -17
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacade.js +262 -57
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacadePorts.d.ts +185 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacadePorts.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolFacadePorts.js +57 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolGovernedDelegate.d.ts +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolGovernedDelegate.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolGovernedDelegate.js +14 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.d.ts +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolInvocationRegistry.js +50 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.d.ts +21 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolIpc.js +143 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReadEditPorts.d.ts +63 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReadEditPorts.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReadEditPorts.js +710 -170
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.d.ts +108 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/codingToolReplacementEdits.js +477 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLanePortableCodingRuntime.d.ts +2 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLanePortableCodingRuntime.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLanePortableCodingRuntime.js +53 -46
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/devLaneRuntimeProcessBackend.js +51 -52
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/governedToolModelContent.d.ts +48 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/governedToolModelContent.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/governedToolModelContent.js +179 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/materializedPatchRegistry.d.ts +60 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/materializedPatchRegistry.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/materializedPatchRegistry.js +61 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.d.ts +7 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessBackend.js +48 -15
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessPaths.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessPaths.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessPaths.js +14 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessProtocol.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/nativeRuntimeProcessProtocol.js +11 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/npmLaneRuntimeApprovals.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/npmLaneRuntimeApprovals.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/npmLaneRuntimeApprovals.js +28 -14
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeFunctionalHarness/_governedTools.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeFunctionalHarness/_governedTools.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeFunctionalHarness/_governedTools.js +48 -20
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.d.ts +5 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeLaunchProfile.js +11 -12
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativeContext.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativeContext.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeNativeContext.js +27 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeReconciler.d.ts +6 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeReconciler.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeReconciler.js +15 -15
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts +17 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeAdapter.js +198 -43
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts +97 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeRuntimeComposition.js +1334 -103
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeServiceHostArtifact.d.ts +79 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeServiceHostArtifact.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeServiceHostArtifact.js +176 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.d.ts +177 -25
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeToolSchemas.js +131 -38
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.d.ts +18 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2History.js +298 -32
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2HttpClient.js +14 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.d.ts +33 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/opencodeV2LiveText.js +213 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionAuxiliaryPorts.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionAuxiliaryPorts.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionAuxiliaryPorts.js +2 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCiRepairRuntime.js +15 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeHost.js +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts +25 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionCodingRuntimeResolver.js +227 -40
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionManagedWorktreeTools.d.ts +20 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionManagedWorktreeTools.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionManagedWorktreeTools.js +217 -12
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeActivation.d.ts +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeActivation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeActivation.js +20 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.d.ts +8 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/repositorySearchProof.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/repositorySearchProof.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/skillDiscoveryProof.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.functional/skillDiscoveryProof.js +2 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionOpenCodeBackend.js +262 -60
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts +18 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/productionRuntimeWorkspaceAuthority.js +43 -6
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeAuthorityService.d.ts +38 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeAuthorityService.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeAuthorityService.js +115 -16
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.d.ts +20 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeGatewayProcessSandbox.js +48 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/runtimeProcessSupervisor.js +5 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextRead.d.ts +100 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextRead.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextRead.js +435 -25
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadAbsence.d.ts +61 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadAbsence.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadAbsence.js +123 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadArtifact.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadArtifact.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadArtifact.js +26 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadNodeProcess.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadNodeProcess.js +10 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProcess.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProcess.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProcess.js +17 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProtocol.d.ts +69 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProtocol.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-runtime/secureWorkspaceTextReadProtocol.js +266 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts +14 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-gateway.js +761 -122
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/coding-sidecar-tool-facade.js +139 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/command-runner.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/command-runner.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/command-runner.js +176 -19
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-admission.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-admission.js +72 -13
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-log.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/conversation-readiness-log.js +48 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/correlation.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/correlation.js +8 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/credentialVault.js +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts +41 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/deps.js +234 -77
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/diagnostics-log.js +6 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentAuthorityRegistry.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentAuthorityRegistry.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentAuthorityRegistry.js +16 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRootBoundary.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRootBoundary.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRootBoundary.js +60 -12
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.d.ts +13 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/agentRoutes.js +131 -18
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/bufferSafetyTargets.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/bufferSafetyTargets.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/bufferSafetyTargets.js +44 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/changesetLineBreakProvenance.d.ts +26 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/changesetLineBreakProvenance.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/changesetLineBreakProvenance.js +87 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/codingContextProviders.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/codingContextProviders.js +0 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecution.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecution.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecution.js +62 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecutionLog.d.ts +128 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecutionLog.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationExecutionLog.js +213 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRunner.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRunner.js +68 -24
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRuntimeTarget.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRuntimeTarget.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/editor/verificationRuntimeTarget.js +121 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts +10 -10
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-readiness.js +280 -88
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-route-deadline.js +11 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts +15 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-setup.js +445 -45
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup-activity.d.ts +31 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup-activity.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup-activity.js +74 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-startup.js +282 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gateway-tool-calling-probe.js +7 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gitDelivery/commitRoutes.js +7 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/gitPorcelainStatus.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/gitPorcelainStatus.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/gitPorcelainStatus.js +46 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-activity.d.ts +19 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-activity.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-activity.js +177 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-assessment.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-assessment.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-assessment.js +69 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-evidence.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-evidence.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-evidence.js +53 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-repair.d.ts +25 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-repair.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer-repair.js +120 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer.d.ts +56 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-answer.js +194 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-assistant-referents.d.ts +16 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-assistant-referents.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-assistant-referents.js +133 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-candidate-ordering.d.ts +16 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-candidate-ordering.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-candidate-ordering.js +103 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-capability.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-capability.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-capability.js +79 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-log.d.ts +22 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-log.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-log.js +112 -11
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-repair.d.ts +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-repair.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-citation-repair.js +117 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-context-pack-reranker.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-context-pack-reranker.js +4 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-contextual-fallback.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-contextual-fallback.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-contextual-fallback.js +41 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-conversation-continuity.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-conversation-continuity.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-conversation-continuity.js +54 -5
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-diagnostic-references.d.ts +42 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-diagnostic-references.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-diagnostic-references.js +91 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-document-evidence.d.ts +6 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-document-evidence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-document-evidence.js +61 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-eval-support.d.ts +28 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-eval-support.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-eval-support.js +140 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-evidence-selection.d.ts +9 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-evidence-selection.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-evidence-selection.js +40 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-explicit-paths.d.ts +44 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-explicit-paths.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-explicit-paths.js +385 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness-eval.d.ts +5 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness-eval.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness-eval.js +91 -39
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness.d.ts +43 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-faithfulness.js +247 -34
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-follow-up.d.ts +27 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-follow-up.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-follow-up.js +198 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-latency-eval.d.ts +16 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-latency-eval.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-latency-eval.js +69 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts +106 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-orchestrator.js +2618 -376
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-plural-synthesis.d.ts +27 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-plural-synthesis.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-plural-synthesis.js +74 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-preselection-reranker.d.ts +25 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-preselection-reranker.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-preselection-reranker.js +93 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt-context.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt-context.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt-context.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-prompt.js +26 -13
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts +23 -9
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-hybrid.js +429 -97
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts +33 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa-multi-source.js +500 -100
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts +28 -10
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-qa.js +442 -99
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-repo-semantic-search.d.ts +32 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-repo-semantic-search.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-repo-semantic-search.js +370 -48
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank-facade.js +22 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-rerank.js +5 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-retrieval-eval.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-retrieval-eval.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-retrieval-eval.js +25 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-selection-quality.d.ts +19 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-selection-quality.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-selection-quality.js +55 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-semantic-request.d.ts +31 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-semantic-request.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-semantic-request.js +55 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace-cycles.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace-cycles.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace-cycles.js +90 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace.d.ts +44 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-symbol-trace.js +1053 -83
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-recency.d.ts +34 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-recency.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-recency.js +190 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-request.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-request.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/grounded-worktree-request.js +19 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/local-knowledge-grounded-qa.js +27 -8
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-admission.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-admission.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-admission.js +36 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-authority.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-authority.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-authority.js +28 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-log.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-log.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-log.js +47 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-prompt.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-prompt.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-prompt.js +41 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-routes.d.ts +13 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-routes.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-routes.js +150 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-selection-admission.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-selection-admission.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/markdown-skill-selection-admission.js +36 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/observability/route-template.js +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/promptEnhancer/orchestrate.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/promptEnhancer/orchestrate.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/promptEnhancer/orchestrate.js +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/promptEnhancer/routes.d.ts +0 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/promptEnhancer/routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/promptEnhancer/routes.js +70 -28
- package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/read-handlers.js +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/routes.js +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/server.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/server.js +7 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/chats.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/chats.js +3 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/db.js +12 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/legacySchemaTestFixture.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/legacySchemaTestFixture.js +7 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkillSelections.d.ts +9 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkillSelections.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkillSelections.js +58 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkillValidation.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkillValidation.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkillValidation.js +63 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkills.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkills.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/markdownSkills.js +111 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/schema.js +195 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/store/types.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/store/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/support-report-routes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/support-report-routes.js +4 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/task-workspace/routes.js +3 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolDispatch.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolDispatch.js +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.d.ts +20 -4
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolFacadeBridge.js +96 -20
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolPorts.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolPorts.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/tool-catalog/catalogToolRuntimeAuthority.js +47 -3
- package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-staging-verification.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-staging-verification.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-staging-verification.js +23 -7
- package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-verification.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-verification.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-server/dist/update-portable-sidecar-verification.js +12 -0
- package/node_modules/@oscharko-dev/keiko-server/dist/workspace-index-provider.js +4 -4
- package/node_modules/@oscharko-dev/keiko-server/package.json +23 -23
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.d.ts +9 -25
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/opencode.js +207 -112
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/profile.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tool-catalog/dist/profile.js +15 -2
- package/node_modules/@oscharko-dev/keiko-tool-catalog/package.json +3 -3
- package/node_modules/@oscharko-dev/keiko-tools/dist/exec.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/exec.js +44 -5
- package/node_modules/@oscharko-dev/keiko-tools/dist/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch-content.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch-content.js +142 -49
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch-parse.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch-parse.js +14 -3
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch.d.ts +15 -0
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/patch.js +24 -9
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-tools/package.json +7 -7
- package/node_modules/@oscharko-dev/keiko-verification/dist/dependencies.d.ts +16 -4
- package/node_modules/@oscharko-dev/keiko-verification/dist/dependencies.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/dependencies.js +198 -25
- package/node_modules/@oscharko-dev/keiko-verification/dist/failure-location.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/failure-location.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/failure-location.js +34 -17
- package/node_modules/@oscharko-dev/keiko-verification/dist/orchestrator.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/orchestrator.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/orchestrator.js +32 -2
- package/node_modules/@oscharko-dev/keiko-verification/dist/plan.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-verification/dist/plan.js +25 -16
- package/node_modules/@oscharko-dev/keiko-verification/dist/targeted-project.d.ts +7 -0
- package/node_modules/@oscharko-dev/keiko-verification/dist/targeted-project.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-verification/dist/targeted-project.js +37 -0
- package/node_modules/@oscharko-dev/keiko-verification/package.json +5 -5
- package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/failure-parse.d.ts +10 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/failure-parse.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/failure-parse.js +93 -15
- package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/index.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/bug-investigation/index.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/assemble.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/assemble.js +16 -16
- package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/reranker.d.ts +3 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/contextpack/reranker.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/anchors.js +296 -15
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/governor.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts +3 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/index.js +1 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts +7 -2
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/intent.js +85 -5
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/plan.js +507 -32
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/references.d.ts +19 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/references.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/planner/references.js +159 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/promptEnhancer/index.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/promptEnhancer/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/promptEnhancer/index.js +31 -13
- package/node_modules/@oscharko-dev/keiko-workflows/dist/promptEnhancer/markdownSkillDraft.d.ts +20 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/promptEnhancer/markdownSkillDraft.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/promptEnhancer/markdownSkillDraft.js +77 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/filter.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/filter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/filter.js +13 -16
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/index.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/index.js +2 -2
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/rank.js +21 -4
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/scoring.d.ts +6 -0
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/scoring.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/scoring.js +44 -29
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/signals.d.ts +5 -2
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/signals.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workflows/dist/ranking/signals.js +141 -45
- package/node_modules/@oscharko-dev/keiko-workflows/package.json +10 -10
- package/node_modules/@oscharko-dev/keiko-workspace/dist/binaryDetect.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/binaryDetect.js +91 -15
- package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligence.d.ts +22 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligence.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligence.js +661 -106
- package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligenceSurface.d.ts +3 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligenceSurface.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/codeIntelligenceSurface.js +3 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/discovery.d.ts +24 -4
- package/node_modules/@oscharko-dev/keiko-workspace/dist/discovery.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/discovery.js +89 -26
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractAdapter.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractAdapter.js +31 -9
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractGraph.d.ts +3 -2
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractGraph.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractGraph.js +35 -5
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractSource.d.ts +7 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractSource.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractSource.js +40 -7
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractTypes.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/endpointContractTypes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/importGraphEdges.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/importGraphEdges.js +11 -5
- package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts +8 -3
- package/node_modules/@oscharko-dev/keiko-workspace/dist/index.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/index.js +7 -2
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts +26 -5
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearch.js +418 -35
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchHtml.d.ts +5 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchHtml.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchHtml.js +21 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchLineSelection.d.ts +2 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchLineSelection.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchLineSelection.js +5 -3
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts +10 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchMatchers.js +32 -4
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts +5 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchPolicy.js +41 -22
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchQueryTerms.d.ts +14 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchQueryTerms.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchQueryTerms.js +97 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchRoutes.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchRoutes.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchRoutes.js +154 -18
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts +6 -5
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchScan.js +88 -24
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchStream.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/repoSearchStream.js +21 -14
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapterRequestContext.d.ts +4 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapterRequestContext.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapterRequestContext.js +205 -14
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapters.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapters.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralAdapters.js +17 -13
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralExecution.d.ts +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralExecution.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/structuralExecution.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/symbolGraphLexing.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/symbolGraphLexing.js +13 -7
- package/node_modules/@oscharko-dev/keiko-workspace/dist/testSourcePairing.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/types.d.ts +2 -2
- package/node_modules/@oscharko-dev/keiko-workspace/dist/types.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/types.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.d.ts +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/version.js +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndex.d.ts +13 -5
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndex.d.ts.map +1 -1
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndex.js +112 -42
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexQueryMatch.d.ts +11 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexQueryMatch.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexQueryMatch.js +71 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexStreaming.d.ts +47 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexStreaming.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspaceIndexStreaming.js +231 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspacePathDiscovery.d.ts +8 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspacePathDiscovery.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/workspacePathDiscovery.js +178 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/xmlEntities.d.ts +2 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/xmlEntities.d.ts.map +1 -0
- package/node_modules/@oscharko-dev/keiko-workspace/dist/xmlEntities.js +34 -0
- package/node_modules/@oscharko-dev/keiko-workspace/package.json +4 -3
- package/package.json +28 -27
- package/release-impact.catalog.json +170 -0
- package/vendor/oscharko-dev-keiko-activity-log-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-cli-1.2.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-connectors-1.2.0.tgz → oscharko-dev-keiko-connectors-1.2.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-contracts-1.2.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-evaluations-1.2.0.tgz → oscharko-dev-keiko-evaluations-1.2.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-evidence-1.2.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-git-1.2.0.tgz → oscharko-dev-keiko-git-1.2.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-harness-1.2.0.tgz → oscharko-dev-keiko-harness-1.2.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-1.2.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-memory-capture-1.2.0.tgz → oscharko-dev-keiko-memory-capture-1.2.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-consolidation-1.2.0.tgz → oscharko-dev-keiko-memory-consolidation-1.2.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-governance-1.2.0.tgz → oscharko-dev-keiko-memory-governance-1.2.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-retrieval-1.2.0.tgz → oscharko-dev-keiko-memory-retrieval-1.2.2.tgz} +0 -0
- package/vendor/{oscharko-dev-keiko-memory-vault-1.2.0.tgz → oscharko-dev-keiko-memory-vault-1.2.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-1.2.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-quality-intelligence-1.2.0.tgz → oscharko-dev-keiko-quality-intelligence-1.2.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-sandbox-1.2.2.tgz +0 -0
- package/vendor/{oscharko-dev-keiko-sdk-1.2.0.tgz → oscharko-dev-keiko-sdk-1.2.2.tgz} +0 -0
- package/vendor/oscharko-dev-keiko-security-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-tool-catalog-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-tools-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-verification-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-workflows-1.2.2.tgz +0 -0
- package/vendor/oscharko-dev-keiko-workspace-1.2.2.tgz +0 -0
- package/dist/ui/static/_next/static/chunks/07skh7tlpfo1v.js +0 -1
- package/dist/ui/static/_next/static/chunks/09i_8713x46yr.js +0 -1
- package/dist/ui/static/_next/static/chunks/0a6ri2ug5xf10.js +0 -1
- package/dist/ui/static/_next/static/chunks/0bbrrvuzilpy5.js +0 -1
- package/dist/ui/static/_next/static/chunks/0bg7uh6tq8-dx.js +0 -1
- package/dist/ui/static/_next/static/chunks/0cwy6mtvshbuo.js +0 -1
- package/dist/ui/static/_next/static/chunks/0fpbvpzg-omn0.js +0 -1
- package/dist/ui/static/_next/static/chunks/0fz9qig_5p73f.js +0 -1
- package/dist/ui/static/_next/static/chunks/0hvxxuef1gw9p.js +0 -1
- package/dist/ui/static/_next/static/chunks/0ktvc8fs3spkb.js +0 -1
- package/dist/ui/static/_next/static/chunks/0kvy_ru-kodgv.js +0 -1
- package/dist/ui/static/_next/static/chunks/0parm4c86umwk.js +0 -1
- package/dist/ui/static/_next/static/chunks/0q_08tk2d3m2n.js +0 -1
- package/dist/ui/static/_next/static/chunks/0r2lwkgws6jm8.js +0 -1
- package/dist/ui/static/_next/static/chunks/0t73kckx3olud.js +0 -1
- package/dist/ui/static/_next/static/chunks/0u7vyqk91gjb8.js +0 -1
- package/dist/ui/static/_next/static/chunks/0weojtwxo6qw7.js +0 -1
- package/dist/ui/static/_next/static/chunks/0x-r45yl06rdn.js +0 -1
- package/dist/ui/static/_next/static/chunks/0zlw46qz0crxg.css +0 -1
- package/dist/ui/static/_next/static/chunks/0zuaq_9l5pma_.js +0 -1
- package/dist/ui/static/_next/static/chunks/10kb8j7vggfwk.js +0 -1
- package/dist/ui/static/_next/static/chunks/14qdwomthzucj.js +0 -1
- package/dist/ui/static/_next/static/chunks/1a7ko-_7t4wjo.js +0 -1
- package/dist/ui/static/_next/static/chunks/1czgn62g6km38.js +0 -3
- package/dist/ui/static/_next/static/chunks/1juiifi_xnx68.js +0 -1
- package/dist/ui/static/_next/static/chunks/1m-9yzfpcm7wc.js +0 -1
- package/dist/ui/static/_next/static/chunks/1wg1s3jm779ro.js +0 -3
- package/dist/ui/static/_next/static/chunks/224bbe_3ksnlw.js +0 -1
- package/dist/ui/static/_next/static/chunks/263_uck8el32f.js +0 -1
- package/dist/ui/static/_next/static/chunks/26gmn1z4oegqh.js +0 -1
- package/dist/ui/static/_next/static/chunks/28ylcw-leje_k.js +0 -1
- package/dist/ui/static/_next/static/chunks/2937s9os9u2tn.js +0 -1
- package/dist/ui/static/_next/static/chunks/29rlw6dih8owf.js +0 -1
- package/dist/ui/static/_next/static/chunks/2hq0zlnvfqol9.js +0 -1
- package/dist/ui/static/_next/static/chunks/2o584howfzzak.js +0 -3
- package/dist/ui/static/_next/static/chunks/2p66e_a0j23r8.js +0 -1
- package/dist/ui/static/_next/static/chunks/2r4vn_6anv2cw.js +0 -5
- package/dist/ui/static/_next/static/chunks/2ribv7pn1hr-l.js +0 -1
- package/dist/ui/static/_next/static/chunks/2tb2nt2wvu643.js +0 -1
- package/dist/ui/static/_next/static/chunks/2wuj7qxm6mleh.js +0 -1
- package/dist/ui/static/_next/static/chunks/2yot6vshhc19p.css +0 -1
- package/dist/ui/static/_next/static/chunks/30j8jo5v60ga1.js +0 -2
- package/dist/ui/static/_next/static/chunks/30q9b_aw8driv.js +0 -1
- package/dist/ui/static/_next/static/chunks/387k5c-bf1b2e.js +0 -1
- package/dist/ui/static/_next/static/chunks/388eokaf_2t9k.js +0 -1
- package/dist/ui/static/_next/static/chunks/3_alxp77ewgk_.js +0 -1
- package/dist/ui/static/_next/static/chunks/3_ycy0h8pq58a.js +0 -1
- package/dist/ui/static/_next/static/chunks/3ho1f5n8lir4r.js +0 -1
- package/dist/ui/static/_next/static/chunks/3kgc_j74tblcn.js +0 -1
- package/dist/ui/static/_next/static/chunks/3mxpjroefk8ou.js +0 -1
- package/dist/ui/static/_next/static/chunks/3q5jidle0lb3-.js +0 -1
- package/dist/ui/static/_next/static/chunks/3ua7si017r4dg.js +0 -1
- package/dist/ui/static/_next/static/chunks/3v2iluxqnsug9.css +0 -15
- package/dist/ui/static/_next/static/chunks/3z5f2s7yd35cu.js +0 -1
- package/dist/ui/static/_next/static/chunks/40co1uetczqcs.js +0 -1
- package/vendor/oscharko-dev-keiko-activity-log-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-cli-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-contracts-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-evidence-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-local-knowledge-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-model-gateway-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-sandbox-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-security-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-server-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-tool-catalog-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-tools-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-verification-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-workflows-1.2.0.tgz +0 -0
- package/vendor/oscharko-dev-keiko-workspace-1.2.0.tgz +0 -0
- /package/dist/ui/static/_next/static/{LNCY1B2FJBOe2AHFXpzB- → Z7PX-H79azsma78__tTUN}/_buildManifest.js +0 -0
- /package/dist/ui/static/_next/static/{LNCY1B2FJBOe2AHFXpzB- → Z7PX-H79azsma78__tTUN}/_clientMiddlewareManifest.js +0 -0
- /package/dist/ui/static/_next/static/{LNCY1B2FJBOe2AHFXpzB- → Z7PX-H79azsma78__tTUN}/_ssgManifest.js +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
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:"ChatContextMeter-module__h2tPpG__cmpBar",cmpBarSegment:"ChatContextMeter-module__h2tPpG__cmpBarSegment",cmpCompact:"ChatContextMeter-module__h2tPpG__cmpCompact",cmpFill:"ChatContextMeter-module__h2tPpG__cmpFill",cmpHelp:"ChatContextMeter-module__h2tPpG__cmpHelp",cmpLegend:"ChatContextMeter-module__h2tPpG__cmpLegend",cmpLegendDetail:"ChatContextMeter-module__h2tPpG__cmpLegendDetail",cmpLegendLabel:"ChatContextMeter-module__h2tPpG__cmpLegendLabel",cmpLegendRow:"ChatContextMeter-module__h2tPpG__cmpLegendRow",cmpLegendShare:"ChatContextMeter-module__h2tPpG__cmpLegendShare",cmpLegendValue:"ChatContextMeter-module__h2tPpG__cmpLegendValue",cmpMetrics:"ChatContextMeter-module__h2tPpG__cmpMetrics",cmpPanel:"ChatContextMeter-module__h2tPpG__cmpPanel",cmpRoot:"ChatContextMeter-module__h2tPpG__cmpRoot",cmpSavings:"ChatContextMeter-module__h2tPpG__cmpSavings",cmpSpinning:"ChatContextMeter-module__h2tPpG__cmpSpinning",cmpSwatch:"ChatContextMeter-module__h2tPpG__cmpSwatch",cmpTotal:"ChatContextMeter-module__h2tPpG__cmpTotal",cmpTrack:"ChatContextMeter-module__h2tPpG__cmpTrack",cmpTrigger:"ChatContextMeter-module__h2tPpG__cmpTrigger",cmpWarning:"ChatContextMeter-module__h2tPpG__cmpWarning","context-spin":"ChatContextMeter-module__h2tPpG__context-spin"});},8552,e=>{e.v({"cmp-partial-transcript":"ChatWindow-module__iU4D6a__cmp-partial-transcript","cmp-voice-attachments":"ChatWindow-module__iU4D6a__cmp-voice-attachments","cmp-voice-attachments-label":"ChatWindow-module__iU4D6a__cmp-voice-attachments-label","cmp-voice-content":"ChatWindow-module__iU4D6a__cmp-voice-content",cmpBatchFailedTranscript:"ChatWindow-module__iU4D6a__cmpBatchFailedTranscript",cmpBatchModeLabel:"ChatWindow-module__iU4D6a__cmpBatchModeLabel",cmpUserMessage:"ChatWindow-module__iU4D6a__cmpUserMessage",cmpUserMessageBubble:"ChatWindow-module__iU4D6a__cmpUserMessageBubble",composerLayer:"ChatWindow-module__iU4D6a__composerLayer",contextWindowNotice:"ChatWindow-module__iU4D6a__contextWindowNotice",memoryActivationButton:"ChatWindow-module__iU4D6a__memoryActivationButton",memoryBudgetControl:"ChatWindow-module__iU4D6a__memoryBudgetControl",memoryBudgetSetting:"ChatWindow-module__iU4D6a__memoryBudgetSetting",memoryControls:"ChatWindow-module__iU4D6a__memoryControls",normalLayer:"ChatWindow-module__iU4D6a__normalLayer",pendingVoiceTurnNotice:"ChatWindow-module__iU4D6a__pendingVoiceTurnNotice",responseVersionControl:"ChatWindow-module__iU4D6a__responseVersionControl",responseVersionLabel:"ChatWindow-module__iU4D6a__responseVersionLabel",responseVersionSelect:"ChatWindow-module__iU4D6a__responseVersionSelect",responseVersionSummary:"ChatWindow-module__iU4D6a__responseVersionSummary",sessionNotice:"ChatWindow-module__iU4D6a__sessionNotice",turnEndState:"ChatWindow-module__iU4D6a__turnEndState",voiceDialogBox:"ChatWindow-module__iU4D6a__voiceDialogBox",voiceLayer:"ChatWindow-module__iU4D6a__voiceLayer"});},219,e=>{"use strict";var t,n,r,i,o,s,a,l,c,u,d,h,p,f=e.i(43476),m=e.i(46095),g=e.i(57688),y=e.i(74080),v=e.i(71645),k=e.i(26428),b=e.i(71166),x=e.i(94843),w=e.i(74952),C=e.i(24541),S=e.i(80144),D=e.i(79056),_=e.i(54523),E=e.i(95508),A=e.i(29835),M=e.i(92215),N=e.i(30644),T=e.i(50850),O=e.i(85912),R=e.i(92913);function I({status:e}){let t=(0,O.useOptionalWidgetTranslate)(),n=(0,T.useLocale)(),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.jsxs)(f.Fragment,{children:[(0,f.jsx)("dl",{className:R.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))}),(0,f.jsx)($,{status:e})]});}function F({segments:e,window:t}){return(0,f.jsx)("div",{className:R.default.cmpBar,"aria-hidden":"true",children:e.map(e=>(0,f.jsx)("span",{className:R.default.cmpBarSegment,"data-segment":e.id,style:{flexGrow:e.tokens/Math.max(1,t)}},e.id))});}function j({segment:e,status:t}){var n;let r=(0,O.useOptionalWidgetTranslate)(),i=(0,T.useLocale)(),o=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),s=e.tokens/Math.max(1,t.contextWindowTokens)*100;return(0,f.jsxs)("li",{className:R.default.cmpLegendRow,"data-segment":e.id,children:[(0,f.jsx)("span",{className:R.default.cmpSwatch,"data-segment":e.id,"aria-hidden":"true"}),(0,f.jsxs)("span",{className:R.default.cmpLegendLabel,children:[(n=void 0!==t.conversationInputBudgetTokens,{system:r("chat.context.segment.system"),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]),void 0===o?null:(0,f.jsx)("span",{className:R.default.cmpLegendDetail,children:o})]}),(0,f.jsx)("span",{className:R.default.cmpLegendValue,children:e.tokens.toLocaleString(i)}),(0,f.jsx)("span",{className:R.default.cmpLegendShare,children:r("chat.context.percent",{percent:H(s,i)})})]});}function B({status:e,segments:t}){let n=(0,O.useOptionalWidgetTranslate)(),r=(0,T.useLocale)(),i=t.filter(e=>"summary"!==e.id||e.tokens>0);return(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("p",{className:R.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)(F,{segments:i,window:e.contextWindowTokens}),(0,f.jsx)("ul",{className:R.default.cmpLegend,"aria-label":n("chat.context.breakdown"),children:i.map(t=>(0,f.jsx)(j,{segment:t,status:e},t.id))}),(0,f.jsx)(L,{status:e})]});}function L({status:e}){var t;let n,r=(0,O.useOptionalWidgetTranslate)(),i=(0,T.useLocale)(),o=e=>e.toLocaleString(i),s=e.knowledgeSources,a=void 0!==s&&s.sentReferenceCount<s.availableReferenceCount,l=void 0===e.autoCompactionAtTokens?void 0:Math.max(0,e.autoCompactionAtTokens-e.estimatedInputTokens);return(0,f.jsxs)(f.Fragment,{children:[a?(0,f.jsx)("p",{className:R.default.cmpWarning,role:"note",children:r("chat.context.referencesTrimmed",{sent:o(s.sentReferenceCount),available:o(s.availableReferenceCount)})}):null,void 0===e.lastRequest?null:(0,f.jsx)("p",{className:R.default.cmpHelp,children:(n=o((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:o(t.estimatedTokens)}):r("chat.context.lastRequestEstimated",{tokens:n}))}),void 0===l?null:(0,f.jsx)("p",{className:R.default.cmpHelp,children:r(void 0===e.conversationInputBudgetTokens?"chat.context.untilCompaction":"chat.context.untilConversationCompaction",{tokens:o(l)})})]});}function z({status:e}){return void 0===e.segments?(0,f.jsx)(I,{status:e}):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(B,{status:e,segments:e.segments}),(0,f.jsx)($,{status:e})]});}function P({status:e}){var _e$segments;let t=(0,O.useOptionalWidgetTranslate)(),n=(0,T.useLocale)(),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:R.default.cmpHelp,children:t("chat.context.declaredInputLimit",{tokens:e.inputLimitTokens.toLocaleString(n)})});}function $({status:e}){let t=(0,O.useOptionalWidgetTranslate)(),n=(0,T.useLocale)();return(0,f.jsxs)(f.Fragment,{children:[void 0===e.compaction?null:(0,f.jsx)("p",{className:R.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:R.default.cmpSavings,children:t("chat.context.pending",{before:e.pendingCompaction.tokensBefore.toLocaleString(n),after:e.pendingCompaction.tokensAfter.toLocaleString(n)})}),(0,f.jsx)(P,{status:e}),!0===e.contextWindowAssumed?(0,f.jsx)("p",{className:R.default.cmpHelp,children:t("chat.context.windowAssumed")}):null]});}function V({status:e}){var _r$toLocaleString;let t=(0,O.useOptionalWidgetTranslate)(),n=(0,T.useLocale)(),r=e===null||e===void 0?void 0:e.conversationInputBudgetTokens;return(0,f.jsx)("p",{className:R.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 q({status:e}){var _r$toLocaleString2;let t=(0,O.useOptionalWidgetTranslate)(),n=(0,T.useLocale)(),r=e.conversationInputBudgetTokens;return(0,f.jsx)("p",{className:R.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 W(e){var _e$status,_e$status2;let t=(0,O.useOptionalWidgetTranslate)();return(0,f.jsxs)(f.Fragment,{children:[void 0===e.status?(0,f.jsx)("p",{children:t("chat.context.unavailable")}):(0,f.jsx)(z,{status:e.status}),(0,f.jsx)("p",{className:R.default.cmpHelp,children:t("chat.context.estimate")}),(0,f.jsx)(V,{status:e.status}),(0,f.jsx)("p",{className:R.default.cmpHelp,children:t("chat.context.retained")}),((_e$status=e.status)===null||_e$status===void 0?void 0:_e$status.knowledgeSources)===void 0?null:(0,f.jsx)(q,{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:R.default.cmpCompact,disabled:e.busy||e.compacting||((_e$status2=e.status)===null||_e$status2===void 0?void 0:_e$status2.canCompact)!==!0,onClick:e.onCompact,children:t(e.compacting?"chat.context.compacting":"chat.context.compact")}),e.busy?(0,f.jsx)("p",{className:R.default.cmpHelp,children:t("chat.context.wait")}):null]});}function U({percent:e,compacting:t}){return(0,f.jsxs)("svg",{viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",className:t?R.default.cmpSpinning:void 0,children:[(0,f.jsx)("circle",{className:R.default.cmpTrack,cx:"12",cy:"12",r:"9",fill:"none",strokeWidth:"3"}),(0,f.jsx)("circle",{className:R.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 K(e){var t;let n=(0,O.useOptionalWidgetTranslate)(),r=(0,T.useLocale)(),i=(0,v.useId)(),o=function(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),[n,r]=(0,v.useState)(!1),i=function(e,t,n){let[r,i]=(0,v.useState)({visibility:"hidden"});return(0,v.useLayoutEffect)(()=>{if(!e)return;let r=0,o="",s=()=>{if(null!==t.current&&null!==n.current){let e=(0,N.viewportOverlayPosition)({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!==o&&(o=r,i({left:e.left,top:e.top,width:e.width,maxHeight:e.maxHeight}));}r=requestAnimationFrame(s);};return s(),()=>cancelAnimationFrame(r);},[e,t,n]),r;}(n,e,t);return(0,v.useEffect)(()=>{if(!n)return;let i=n=>{var _e$current;"Tab"===n.key?function(e,t,n,_i$current,_i$current2){var r,i,o,s;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,o=l,s=a,r.target===o[0]&&r.shiftKey?(r.preventDefault(),(_i$current=i.current)!==null&&_i$current!==void 0&&_i$current.focus(),!1):r.target!==o.at(-1)||r.shiftKey?!(r.target instanceof Node&&s.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));},o=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",o,!0),document.addEventListener("focusin",o),()=>{document.removeEventListener("keydown",i,!0),document.removeEventListener("pointerdown",o,!0),document.removeEventListener("focusin",o);};},[n]),{trigger:e,panel:t,open:n,position:i,toggle:()=>r(e=>!e)};}(),s=void 0===(t=e.status)?void 0:t.estimatedInputTokens/Math.max(1,t.inputBudgetTokens),a=void 0===s?void 0:100*s,l=void 0===a?void 0:H(a,r),c=void 0===l?n("chat.context.unavailable"):n("chat.context.label",{percent:l});return(0,f.jsxs)("div",{className:R.default.cmpRoot,"data-tone":void 0===s?"unknown":s>=.9?"critical":s>=.8?"warning":"normal","aria-busy":e.compacting,children:[(0,f.jsx)("button",{type:"button",ref:o.trigger,className:R.default.cmpTrigger,"aria-label":c,title:c,"aria-controls":o.open?i:void 0,"aria-expanded":o.open,onClick:o.toggle,children:(0,f.jsx)(U,{percent:a,compacting:e.compacting})}),o.open?(0,y.createPortal)((0,f.jsxs)("section",{ref:o.panel,id:i,className:R.default.cmpPanel,style:o.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)(W,{...e})]}),document.body):null]});}function H(e,t){return e>0&&e<.1?`<${.1.toLocaleString(t)}`:e.toLocaleString(t,{maximumFractionDigits:1});}function G({session:e}){let t=function(e,_e$activeChat,_e$activeChat2,_d,_d2,_d$groundingScopeIden,_d3,_u$connectedScopes,_u,_u2,_u$localKnowledgeScop,_u3,_u4,_u5){var t,n,r,i,o,s,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])])),y=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,b=(n=e.messages,(0,v.useMemo)(()=>JSON.stringify(n.map(e=>e.id)),[n])),[x,w]=(0,v.useState)({key:y,compacting:!1,error:!1}),[C,S]=(0,v.useState)(0),D=(h=(0,v.useRef)(null),(0,v.useEffect)(()=>()=>{var _h$current;(_h$current=h.current)!==null&&_h$current!==void 0&&_h$current.controller.abort(),h.current=null;},[]),h),_=(0,v.useRef)(g);_.current=g;let A=(0,v.useRef)(x.status);A.current=x.status;let M=(r=p,i=f,o=m,s=y,a=g,l=D,c=w,(0,v.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===o)return;let t=new AbortController();l.current={controller:t,authorityKey:a,compact:e},e&&c(e=>{var t,n,r;return t=e,n=s,r=a,{key:n,status:t.key===n?t.status:void 0,compacting:!0,compactionAuthorityKey:r,error:!1};});let n=e?E.compactChatContext:E.fetchChatContextStatus;try{return await J(n(r,i,o,t.signal),t,s,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,o,s,a,l,c])),N=x.compacting&&x.compactionAuthorityKey===g,T=x.key!==y&&N;return(0,v.useEffect)(()=>{var _A$current;var t,n,r;let i,o,s,a;if(e.loading)return;let l=(t=M,n=k,r=(_A$current=A.current)===null||_A$current===void 0?void 0:_A$current.estimatedInputTokens,o=!1,s=0,(a=async()=>{var e;let l=await t(!1);o||void 0===l||s>=6||(e=r,(!0===l.contextWindowProbePending||n&&(void 0===e||l.estimatedInputTokens===e))&&(r=l.estimatedInputTokens,i=setTimeout(()=>{a();},Math.min(1e3*2**s++,8e3))));})(),()=>{o=!0,clearTimeout(i);});return()=>{var _t,_t2;var e;let t;l(),e=_.current,t=D.current,(((_t=t)===null||_t===void 0?void 0:_t.compact)!==!0||t.authorityKey!==e)&&((_t2=t)!==null&&_t2!==void 0&&_t2.controller.abort(),D.current=null);};},[M,k,e.loading,b,C,T,D]),{state:x.key===y?x:{key:y,compacting:N,error:!1},busy:k,compact:()=>{k||N||M(!0);},retry:()=>{S(e=>e+1);}};}(e);return void 0===e.activeChat||void 0===e.selectedModel?null:(0,f.jsx)(K,{status:t.state.status,busy:t.busy,compacting:t.state.compacting,error:t.state.error,onCompact:t.compact,onRetry:t.retry});}async function J(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,C.reportClientDiagnostic)(i?"Keiko manual context compaction request failed.":"Keiko context status request failed.",{correlationId:(0,A.correlationIdOf)(e),errorKind:(0,M.bffRequestErrorKind)(e),errorEvidence:(0,w.clientErrorEvidence)(e)}),r(e=>({...e,compacting:!1,error:!0}));return;}}var Z=e.i(57269);let Y="keiko-conservative-content-v2";Object.freeze(["calibrated","fallback-estimated"]);let Q=(0,Z.deepFreeze)({source:"fallback-estimated",counterId:Y}),X=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,Z.deepFreeze)({schemaVersion:"1",maxInputTokens:128e3,reservedOutputTokens:8e3,safetyMarginTokens:4e3,effectiveInputBudget:116e3,tokenEstimatorId:Y,tokenAccounting:Q}),"u"<typeof TextEncoder||new TextEncoder();var ee=e.i(83449);let et={"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 en(e,t){return t("low"===e?"context.pressure.low":"moderate"===e?"context.pressure.moderate":"high"===e?"context.pressure.high":"context.pressure.exceeded");}function er({laneCounts:e,locale:t}){let n=(0,O.useOptionalWidgetTranslate)(),r=X.map(t=>[t,e[t]]).filter(([,e])=>e>0);return(0,f.jsx)(f.Fragment,{children:r.map(([e,r])=>(0,f.jsx)(_.MetricRow,{label:n(et[e]),value:r.toLocaleString(t)},`lane-${e}`))});}function ei({contextSummary:e}){var t;let n,r=(0,T.useLocale)(),i=(0,O.useOptionalWidgetTranslate)();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:Y}),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=X.filter(e=>t[e]>0).length,[i("context.meta.tokens",{tokens:(0,ee.formatTokens)(e.totalEstimatedTokens)}),i("context.meta.pressure",{pressure:en(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)(_.MetricRow,{label:i("context.metric.estimator"),value:Y}),(0,f.jsx)(_.MetricRow,{label:i("context.metric.assembledEstimate"),value:i("context.metric.tokensShort",{tokens:(0,ee.formatTokens)(e.totalEstimatedTokens)})}),(0,f.jsx)(_.MetricRow,{label:i("context.metric.budgetPressure"),value:en(e.budgetPressure,i)}),(0,f.jsx)(er,{laneCounts:e.laneCounts,locale:r}),(0,f.jsx)(_.MetricRow,{label:i("context.metric.compaction"),value:i(e.compactionActive?"context.compaction.active":"context.compaction.inactive")})]})})]});}var eo=e.i(17161),es=e.i(67914),ea=e.i(20405),el=e.i(60865),ec=e.i(70703),eu=e.i(93806),ed=e.i(64344);function eh(e){let t=e.length;for(;t>0&&"/"===e[t-1];)t-=1;return e.slice(0,t);}function ep(e){return eh(e.replaceAll("\\","/"));}function ef(e){return eh(function(e){let t=0;for(;t<e.length&&"/"===e[t];)t+=1;return e.slice(t);}(e.replaceAll("\\","/")));}function em(e,t){return`${e}\u0001${t}`;}let eg=/(^|\s)@((?:[A-Za-z0-9_.-]+\/)*[A-Za-z0-9_.-]+\.[A-Za-z0-9][A-Za-z0-9]{0,15})(?=$|\s)/gu,ey=eo.Icons.file,ev=eo.Icons.close,ek=eo.Icons.plus;function eb({attachment:e,onRemove:t}){let n=(0,O.useOptionalWidgetTranslate)()("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)(ey,{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,ee.formatBytes)(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 ex({attachments:e,onRemove:t}){let n=(0,O.useOptionalWidgetTranslate)();return 0===e.length?null:(0,f.jsx)("ul",{className:"attach-strip",style:el.NATIVE_LIST_KEEP_PADDING_STYLE,"aria-label":n("attachment.pending"),children:e.map(e=>(0,f.jsx)(eb,{attachment:e,onRemove:t},e.id))});}function ew({enabled:e,onFiles:t}){let n=(0,O.useOptionalWidgetTranslate)(),[r,i]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1);(0,v.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,s(!0));},r=()=>{0===(t=Math.max(0,t-1))&&s(!1);},i=()=>{t=0,s(!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,v.useCallback)(t=>{e&&(t.preventDefault(),i(!0));},[e]),l=(0,v.useCallback)(()=>{i(!1);},[]),c=(0,v.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":o?"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 eC({model:e,onFiles:t}){let n=(0,O.useOptionalWidgetTranslate)(),r=(0,v.useRef)(null),i=void 0!==e&&(e.supportsImageInput||e.supportsDocumentInput),o=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),s=(0,v.useCallback)(()=>{var _r$current;i&&((_r$current=r.current)===null||_r$current===void 0?void 0:_r$current.click());},[i]),a=(0,v.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:o,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:s,children:(0,f.jsx)(ek,{size:16})})]}):null;}function eS({reason:e,mimeType:t}){let n=(0,O.useOptionalWidgetTranslate)(),r=(0,O.useOptionalWidgetTranslate)();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;}},o=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:o});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 eD=(0,v.memo)(function({documents:e}){let t=(0,O.useOptionalWidgetTranslate)();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 e_({images:e}){let t=(0,O.useOptionalWidgetTranslate)();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 eE=eo.Icons.spark;function eA(e){return"system"===e.role&&"string"==typeof e.runId;}function eM({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),o=void 0===e.runId?void 0:`/api/evidence/${encodeURIComponent(e.runId)}`,[s,a]=(0,v.useState)(""),l=(0,v.useRef)(n);return(0,v.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)(eE,{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!==o?(0,f.jsx)("a",{className:"run-summary-card-action run-summary-card-action-secondary",href:o,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:s})]});}var eN=e.i(98729);e.i(87552);var eT=e.i(81056),eO=e.i(13493),eR=e.i(12541),eI=e.i(76826),eF=e.i(84832),ej=e.i(18829),eB=e.i(20081),eL=e.i(29673),ez=e.i(31317);let eP=["preparing","speaking","paused"],e$=["interrupted","canceled","failed","complete"];function eV(e){return eP.includes(e);}function eq(e){return e$.includes(e);}function eW(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 eU(){return{now:()=>performance.now()};}ez.VOICE_REPLAY_CAPACITY;let eK={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 eH(e){return{phase:"unavailable",muted:!1,spoke:!1,interruptions:0,replays:0,failureKind:void 0,lastInterruptAtMs:void 0,lastTransitionAtMs:void 0};}async function eG(e){null!==e.body&&(await e.body.cancel().catch(()=>{}));}async function eJ(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 eG(e),(0,C.reportClientDiagnostic)("[keiko] assistant speech switched to buffered playback",{kind:"voice-dialogue",voiceDialogueStage:"playback-fallback",correlationId:(_e$headers$get2=e.headers.get(eB.CORRELATION_HEADER))!==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 eZ extends Error{}async function eY(e){try{await e.resume();}catch{window.reportError(Error("Assistant speech audio context resume failed."));}}function eQ(){let e,t,n;if(!("u">typeof AudioContext&&"u">typeof AudioWorkletNode))return;async function r(e,t,n){try{return await(0,E.streamAssistantSpeech)(e,t,n);}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return"cancelled";return(0,C.reportClientDiagnostic)("[keiko] assistant speech stream failed; using buffered playback",{kind:"voice-playback",correlationId:(0,A.correlationIdOf)(e)}),"fallback";}}let i=0,o=0,s=new WeakMap();function a(e){let t=s.get(e);if(void 0!==t)return t;let n=e.close().catch(()=>{window.reportError(Error("Assistant speech audio context cleanup failed."));});return s.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&&o===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 eZ();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:o};try{t=new AudioContext({sampleRate:24e3});}catch{return;}return e=t,{context:t,generation:o};}async function h(){if(void 0!==t&&void 0!==e)return{context:e,generation:o,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,s=e;o+=1,n=void 0,t=void 0,e=void 0,i=0,l(r),void 0!==s&&a(s);}function f(e,n){return!n.aborted&&c(e.context,e.generation)&&t===e.node;}async function m(e,t,n,r){let i,o=t.getReader(),s=0;try{for(;;){let{done:t,value:r}=await o.read();if(t)break;if(n.aborted)return void(await o.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,o=new Int16Array(r/2),s=new DataView(n.buffer,n.byteOffset,r);for(let e=0;e<o.length;e+=1)o[e]=s.getInt16(2*e,!0);return{samples:o,leftover:i};}(r,i);i=l,a.length>0&&(s+=a.length,e.port.postMessage(a,[a.buffer]));}0===s?r.onError():e.port.postMessage({type:"end"});}catch{n.aborted||r.onError();}}return{primeFromUserGesture(){let e=d();void 0!==e&&(eY(e.context),h().catch(()=>{}));},async play(e,t,n,o){let s;try{s=await h();}catch(e){if(t.aborted||e instanceof eZ)return!0;return!1;}if(!f(s,t))return!0;i=0;let a=!1;eY(s.context);let l=s.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,o);if("cancelled"===c)return!0;if("fallback"===c)return!1;if(!f(s,t))return await eG(c),!0;let u=await eJ(c);return f(s,t)?void 0!==u&&(m(l,u,t,n),!0):(await eG(c),!0);},stop(){p();},positionMs(){if(void 0!==t&&0!==i)return Math.round(i/24e3*1e3);},dispose(){p();}};}function eX(e){return(t,n,r)=>(0,E.synthesizeAssistantSpeech)(void 0===e?{text:t}:{text:t,persona:e},n,r);}function e0(){return new Audio();}function e1(e){return URL.createObjectURL(e);}function e2(e){URL.revokeObjectURL(e);}function e3(e){return e instanceof DOMException&&"AbortError"===e.name;}var e6=e.i(37448),e5=e.i(64268),e4=e.i(28269);let e9=ez.DEFAULT_VOICE_PROTOCOL_TIMEOUTS.signalingMs;class e8 extends Error{constructor(e,t){super(t),_defineProperty(this,"reason",void 0),this.reason=e,this.name="VoiceControlError";}}var e7=e.i(79274);let te={disabled:"none",idle:"none",listening:"user",thinking:"assistant",speaking:"assistant",interrupted:"none",yielding:"none",recovering:"none"},tt={"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 tn(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 tr=e.i(81046);let ti=/[!-\/:-@\[-`\{-~\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,to=/[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,ts=/(?:[_:.#/\\-]|[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,ta=/^[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,tl=/[.!?\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,tc={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"})},tu={phase:"idle",errorReason:void 0,errorMessage:void 0};function td(e,t){switch(t.type){case"requesting":return{...tu,phase:"requesting"};case"negotiating":return{...tu,phase:"negotiating"};case"connected":return{...tu,phase:"connected"};case"error":return{...tu,phase:"error",errorReason:t.reason,errorMessage:t.message};case"reset":return tu;}}function th(e){let t=[...e],n=0,r=t.length;for(;n<r&&ti.test((_t$n=t[n])!==null&&_t$n!==void 0?_t$n:"");){var _t$n;n+=1;}for(;r>n&&ti.test((_t3=t[r-1])!==null&&_t3!==void 0?_t3:"");){var _t3;r-=1;}return t.slice(n,r).join("");}function tp(e){return th(e).normalize("NFC").toLowerCase();}function tf(e,t){let n=tp(e);return n.length>0&&n===tp(t);}function tm(e,t){let n=tk(e!==null&&e!==void 0?e:""),r=tk(t);if(0===n.length)return r;if(0===r.length)return n;let i=n.split(" "),o=r.split(" "),s=function(e,t){if(tl.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 tf((_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(!tf(e,t))return!1;let n=th(e),r=th(t),i=tp(e);return to.test(i)||ts.test(n)||ts.test(r)||ta.test(n)&&ta.test(r);}(r,i)?1:0;}(i,o);return`${n} ${o.slice(s).join(" ")}`.trimEnd();}function tg(){return{answerApplied:!1,rtcConnected:!1,dataChannelOpen:!1,sessionUpdated:!1,warmupComplete:!1,requiresDataChannelAck:!0};}function ty(){let e=new Uint32Array(4);return globalThis.crypto.getRandomValues(e),[...e].map(e=>e.toString(16).padStart(8,"0")).join("");}function tv(e){return e instanceof eI.VoiceRtcError||e instanceof e8?{reason:e.reason,message:e.message}:{reason:"connection-failed",message:"Real-time voice could not be started."};}function tk(e){return e.replace(/\s+/gu," ").trim();}var tb=e.i(69243);function tx(e,t,n,r,i){(0,C.reportClientDiagnostic)(`[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 tw(e,t){return e.active&&e.generation===t;}function tC(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 tS(e){try{if(await e.prepare(),!tw(e.flagsRef.current,e.generation))return;e.preparedRef.current=!0,e.setPreparing(!1),e.startDictation();}catch{if(!tw(e.flagsRef.current,e.generation))return;e.setPreparing(!1),e.setStartupError("Voice could not be prepared. Try again."),tx("preparation-failed",e.flagsRef.current.sessionCorrelationId);}}function tD(e){return"requesting"===e||"recording"===e||"finalizing"===e||"transcribing"===e;}var t_=e.i(61287);function tE({action:e,onAccept:t,onReject:n}){let r=(0,t_.useVoiceTranslate)(),[i,o]=(0,v.useState)(null),[s,a]=(0,v.useState)(),l=(0,v.useCallback)((t,n)=>{void 0!==n&&null===i&&(o(t),a(void 0),n(e.proposalId).catch(e=>{a(e instanceof Error?e.message:r("voice.realtime.memory.updateFailed"));}).finally(()=>o(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!==s?(0,f.jsx)("span",{className:"cmp-voice-memory-error",children:s}):null]});}function tA({memoryContextText:e,memoryContextCount:t,memoryActions:n,onAcceptMemoryCandidate:r,onRejectMemoryCandidate:i}){var _n$filter;let o=(0,t_.useVoiceTranslate)(),s=void 0!==e&&e.trim().length>0,a=void 0!==t&&t>0?o(1===t?"voice.realtime.memory.one":"voice.realtime.memory.many",{count:t}):s?o("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":o("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)(tE,{action:e,onAccept:r,onReject:i},e.proposalId))]});}function tM({phase:e,error:t,onRetry:n,onDismiss:r,memoryContextText:i,memoryContextCount:o,memoryActions:s,onAcceptMemoryCandidate:a,onRejectMemoryCandidate:l}){let c=(0,t_.useVoiceTranslate)(),u=(0,v.useRef)(null);return((0,v.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)(tA,{memoryContextText:i,memoryContextCount:o,memoryActions:s,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 tN({controller:e,onAfterDismiss:t,memoryContextText:n,memoryContextCount:r,memoryActions:i,onAcceptMemoryCandidate:o,onRejectMemoryCandidate:s}){return(0,f.jsx)(tM,{phase:e.phase,error:e.error,onRetry:e.retry,memoryContextText:n,memoryContextCount:r,memoryActions:i,onAcceptMemoryCandidate:o,onRejectMemoryCandidate:s,onDismiss:()=>{e.stop(),t();}});}eo.Icons.close,eo.Icons.mic;var tT=e.i(18138);let tO=new Map();function tR(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 tI(e,t,n){let r=tR(n.marker);return`${e}:${t}:${String(r!==null&&r!==void 0?r:n.marker)}:${n.stableId}`;}function tF(e,t,n){let r=new Set(e);return n?r.add(t):r.delete(t),r;}let tj={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 tB=e.i(13271),tL=e.i(8552),tz=e.i(95973),tP=e.i(40017),t$=e.i(10644),tV=e.i(64798),tq=e.i(86090),tW=e.i(68611);function tU(e){return"capsule"===e.kind?`capsule:${e.capsuleId}`:`set:${e.capsuleSetId}`;}function tK(e){let{label:t,t:n}=e,{busy:r,disconnectRef:i,handleDisconnect:o}=function({chat:e,scope:t,allScopes:n,onDisconnect:r,updateScopes:i,setError:o,t:s}){let[a,l]=(0,v.useState)(!1),c=(0,v.useRef)(null),u=tU(t);async function d(){if(a)return;o(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=>tU(e)!==u),o=await(0,m.replaceGroundingScopeList)(e,t.length>0?t:null,i,r);r===null||r===void 0||r(o.chat);}catch(e){o((0,tq.formatUserError)(e,s("localKnowledge.scopePill.disconnectError")));}finally{l(!1),(0,tP.restoreScopeHeaderFocus)(d,t);}}return{busy:a,disconnectRef:c,handleDisconnect:d};}(e),s=n("localKnowledge.scopePill.disconnect",{label:t});return(0,f.jsx)("span",{className:"scope-pill-wrap",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":s,title:s,onClick:()=>{o();},children:(0,f.jsx)("span",{"aria-hidden":"true",children:"×"})})]})});}function tH({announcement:e}){return(0,f.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","data-testid":"connector-scope-announcer",children:e});}function tG({chat:e,onDisconnect:t,updateScopes:n=E.updateChatLocalKnowledgeScopes,labels:r=new Map(),labelsSettled:i=!0}){let o=(0,t$.useLocalKnowledgeTranslate)(),{error:s,setError:a}=(0,tV.useScopePillError)(e),l=(0,tW.effectiveLocalKnowledgeScopes)(e),c=l.map(e=>tU(e)).join(" "),[u,d]=(0,v.useState)(""),h=(0,v.useRef)(c);(0,v.useEffect)(()=>{if(h.current!==c){var e;h.current=c,d((e=l.length,0===e?o("localKnowledge.scopePill.removed"):1===e?o("localKnowledge.scopePill.updated.one"):o("localKnowledge.scopePill.updated.other",{count:e})));}},[c,l.length,o]);let p=(0,f.jsx)(tH,{announcement:u});return 0===l.length?(0,tV.emptyScopePill)(u,p,s):(0,f.jsxs)("span",{className:"scope-pill-group scope-pill-group--connector",children:[p,(0,f.jsx)(tV.ScopePillError,{error:s}),l.map(s=>(0,f.jsx)(tK,{chat:e,scope:s,allScopes:l,onDisconnect:t,updateScopes:n,setError:a,label:function(e,t,n,r){let i=t.get(tU(e));if(void 0!==i&&i.length>0)return i;let o="capsule"===e.kind;return r(n?o?"localKnowledge.picker.unavailablePod":"localKnowledge.picker.unavailableSet":o?"localKnowledge.scopePill.pendingPod":"localKnowledge.scopePill.pendingSet");}(s,r,i,o),t:o},tU(s)))]});}var tJ=e.i(56049),tZ=e.i(2268),tY=e.i(92902);function tQ(e){this.content=e;}function tX(e){return e>=56320&&e<57344;}function t0(e){return e>=55296&&e<56320;}tQ.prototype={constructor:tQ,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),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new tQ(o);},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new tQ(n);},addToStart:function(e,t){return new tQ([e,t].concat(this.remove(e).content));},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new tQ(n);},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new tQ(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=tQ.from(e)).size?new tQ(e.content.concat(this.subtract(e).content)):this;},append:function(e){return(e=tQ.from(e)).size?new tQ(this.subtract(e).content.concat(e.content)):this;},subtract:function(e){var t=this;e=tQ.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;}},tQ.from=function(e){if(e instanceof tQ)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new tQ(t);};class t1{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 o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;if(l>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i);}s=l;}}descendants(e){this.nodesBetween(0,this.size,e);}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,(s,a)=>{let l=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&l||s.isTextblock)&&n&&(o?o=!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 t1(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,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a;}return new t1(n,r);}cutByIndex(e,t){return e==t?t1.empty:0==e&&t==this.content.length?this:new t1(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 t1(r,i);}addToStart(e){return new t1([e].concat(this.content),this.size+e.nodeSize);}addToEnd(e){return new t1(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 o=t.child(i),s=n.child(i);if(o==s){r+=o.nodeSize;continue;}if(!o.sameMarkup(s))return r;if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,n=0;for(;e[n]==t[n];n++)r++;return n&&n<e.length&&n<t.length&&t0(e.charCodeAt(n-1))&&tX(e.charCodeAt(n))&&r--,r;}if(o.content.size||s.content.size){let t=e(o.content,s.content,r+1);if(null!=t)return t;}r+=o.nodeSize;}}(this,e,t);}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,i){for(let o=t.childCount,s=n.childCount;;){if(0==o||0==s)return o==s?null:{a:r,b:i};let a=t.child(--o),l=n.child(--s),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,o=t.length;for(;n>0&&o>0&&e[n-1]==t[o-1];)n--,o--,r--,i--;return n&&o&&n<e.length&&t0(e.charCodeAt(n-1))&&tX(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 t3(0,e);if(e==this.size)return t3(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 t3(t+1,r);return t3(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 t1.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return t1.fromArray(t.map(e.nodeFromJSON));}static fromArray(e){if(!e.length)return t1.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 t1(t||e,n);}static from(e){if(!e)return t1.empty;if(e instanceof t1)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t1([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""));}}t1.empty=new t1([],0);let t2={index:0,offset:0};function t3(e,t){return t2.index=e,t2.offset=t,t2;}function t6(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(!t6(e[n],t[n]))return!1;}else{for(let n in e)if(!(n in t)||!t6(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1;}return!0;}class t5{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&&t6(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 t5.none;if(e instanceof t5)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t;}}t5.none=[];class t4 extends Error{}class t9{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,o,s){let{index:a,offset:l}=t.findIndex(n),c=t.maybeChild(a);if(l==n||c.isText)return s&&i<=0&&o<=0&&!s.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?o-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 t9(n,this.openStart,this.openEnd);}removeBetween(e,t){return new t9(function e(t,n,r){let{index:i,offset:o}=t.findIndex(n),s=t.maybeChild(i),{index:a,offset:l}=t.findIndex(r);if(o==n||s.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,s.copy(e(s.content,n-o-1,r-o-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 t9.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 t9(t1.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 t9(e,n,r);}}function t8(e,t){if(!t.type.compatibleContent(e.type))throw new t4("Cannot join "+t.type.name+" onto "+e.type.name);}function t7(e,t,n){let r=e.node(n);return t8(r,t.node(n)),r;}function ne(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 nt(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(ne(e.nodeAfter,r),o++));for(let e=o;e<s;e++)ne(i.child(e),r);t&&t.depth==n&&t.textOffset&&ne(t.nodeBefore,r);}function nn(e,t){if(!e.type.validContent(t))throw new t4("Invalid content for node "+e.type.name);return e.copy(t);}function nr(e,t,n){let r=[];return nt(null,e,n,r),e.depth>n&&ne(nn(t7(e,t,n+1),nr(e,t,n+1)),r),nt(t,null,n,r),new t1(r);}t9.empty=new t9(t1.empty,0,0);class ni{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 t5.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 o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].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 nl(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:o}=t.content.findIndex(i),s=i-o;if(n.push(t,e,r+o),!s||(t=t.child(e)).isText)break;i=s-1,r+=o+1;}return new ni(t,n,i);}static resolveCached(e,t){let n=na.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 na.set(e,n=new no());let r=n.elts[n.i]=ni.resolve(e,t);return n.i=(n.i+1)%ns,r;}}class no{constructor(){this.elts=[],this.i=0;}}let ns=12,na=new WeakMap();class nl{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 nc=Object.create(null);class nu{constructor(e,t,n,r=t5.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||t1.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&&t6(this.attrs,t||e.defaultAttrs||nc)&&t5.sameSet(this.marks,n||t5.none);}copy(e=null){return e==this.content?this:new nu(this.type,this.attrs,e,this.marks);}mark(e){return e==this.marks?this:new nu(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 t9.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o);return new t9(r.node(o).content.cut(r.pos-s,i.pos-s),r.depth-o,i.depth-o);}replace(e,t,n){var r=this.resolve(e),i=this.resolve(t);if(n.openStart>r.depth)throw new t4("Inserted content deeper than insertion position");if(r.depth-n.openStart!=i.depth-n.openEnd)throw new t4("Inconsistent open depths");return function e(t,n,r,i){let o=t.index(i),s=t.node(i);if(o==n.index(i)&&i<t.depth-r.openStart){let a=e(t,n,r,i+1);return s.copy(s.content.replaceChild(o,a));}if(!r.content.size)return nn(s,nr(t,n,i));if(r.openStart||r.openEnd||t.depth!=i||n.depth!=i){let{start:e,end:o}=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(t1.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)};}(r,t);return nn(s,function e(t,n,r,i,o){let s=t.depth>o&&t7(t,n,o+1),a=i.depth>o&&t7(r,i,o+1),l=[];return nt(null,t,o,l),s&&a&&n.index(o)==r.index(o)?(t8(s,a),ne(nn(s,e(t,n,r,i,o+1)),l)):(s&&ne(nn(s,nr(t,n,o+1)),l),nt(n,r,o,l),a&&ne(nn(a,nr(r,i,o+1)),l)),nt(i,null,o,l),new t1(l);}(t,e,o,n,i));}{let e=t.parent,i=e.content;return nn(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 ni.resolveCached(this,e);}resolveNoCache(e){return ni.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()+")"),nh(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=t1.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.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),o=i&&i.matchFragment(this.content,t);return!!o&&o.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),np(this.type.attrs,this.attrs,"node",this.type.name);let e=t5.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];np(n.type.attrs,n.attrs,"mark",n.type.name),e=n.addToSet(e);}if(!t5.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=t1.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n);}}nu.prototype.text=void 0;class nd extends nu{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):nh(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 nd(this.type,this.attrs,this.text,e);}withText(e){return e==this.text?this:new nd(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 nh(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t;}function np(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 nf{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[];}static parse(e,t){var n;let r,i=new nm(e,t);if(null==i.next)return nf.empty;let o=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=ng(e),r=n;return e.eat(",")&&(r="}"!=e.next?ng(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 s=(n=function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,o)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n());}else if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)];}else if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)];}else if("opt"==t.type)return[r(o)].concat(e(t.expr,o));else if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r;}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o;}return[r(s)];}else if("name"==t.type)return[r(o,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);}}(o),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]);nv(n,t).forEach(t=>{r||i.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t);});}});});let o=r[t.join(",")]=new nf(t.indexOf(n.length-1)>-1);for(let t=0;t<i.length;t++){let n=i[t][1].sort(ny);o.next.push({type:i[t][0],next:r[n.join(",")]||e(n)});}return o;}(nv(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),-1==r.indexOf(s)&&r.push(s);}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)");}}(s,i),s;}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(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return t1.from(s.map(e=>e.createAndFill()));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.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:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.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");}}nf.empty=new nf(!0);class nm{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 ng(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t;}function ny(e,t){return t-e;}function nv(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:o}=i[e];r||-1!=n.indexOf(o)||t(o);}}(t),n.sort(ny);}function nk(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 nb(e,t){let n=Object.create(null);for(let r in e){let i=e[r],o=t&&t[r];if(void 0===o){if(i.hasDefault)o=i.default;else throw RangeError("No value supplied for attribute "+r);}else i.validate&&i.validate(o);n[r]=o;}return n;}function nx(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new nC(e,r,t[r]);return n;}class nw{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=nx(e,n.attrs),this.defaultAttrs=nk(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==nf.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:nb(this.attrs,e);}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new nu(this,this.computeAttrs(e),t1.from(t),t5.setFrom(n));}createChecked(e=null,t,n){return t=t1.from(t),this.checkContent(t),new nu(this,this.computeAttrs(e),t,t5.setFrom(n));}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=t1.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(t1.empty,!0);return i?new nu(this,e,t.append(i),t5.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:t5.none:e;}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new nw(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 nC{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return 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}`);};}(e,t,n.validate):n.validate;}get isRequired(){return!this.hasDefault;}}class nS{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=nx(e,r.attrs),this.excluded=null;let i=nk(this.attrs);this.instance=i?new t5(this,i):null;}create(e=null){return!e&&this.instance?this.instance:new t5(this,nb(this.attrs,e));}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,i)=>n[e]=new nS(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 nD{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=tQ.from(e.nodes),t.marks=tQ.from(e.marks||{}),this.nodes=nw.compile(this.spec.nodes,this),this.marks=nS.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]=nf.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?n_(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?[]:n_(this,n.split(" "));}this.nodeFromJSON=e=>nu.fromJSON(this,e),this.markFromJSON=e=>t5.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 nw){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 nd(n,n.defaultAttrs,e,t5.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 n_(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);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(s=r);}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'");}return n;}class nE{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 nR(this,t,!1);return n.addAll(e,t5.none,t.from,t.to),n.finish();}parseSlice(e,t={}){let n=new nR(this,t,!0);return n.addAll(e,t5.none,t.from,t.to),t9.maxOpen(n.finish());}matchTag(e,t,n){for(let o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r,i;let n=this.tags[o];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],o=r.style;if(0==o.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(o.length>e.length)||61==o.charCodeAt(e.length)&&o.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=nI(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=nI(e)),e.node||e.ignore||e.mark||(e.node=t);});}return t;}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new nE(e,nE.schemaRules(e)));}}let nA={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},nM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},nN={ol:!0,ul:!0};function nT(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n;}class nO{constructor(e,t,n,r,i,o){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=o,this.content=[],this.activeMarks=t5.none,this.match=i||(4&o?null:e.contentMatch);}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(t1.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=t1.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(t1.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&&!nA.hasOwnProperty(e.parentNode.nodeName.toLowerCase());}}class nR{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,o=nT(null,t.preserveWhitespace,0)|4*!!n;i=r?new nO(r.type,r.attrs,t5.none,!0,t.topMatch||r.type.contentMatch,o):n?new nO(null,null,t5.none,!0,null,o):new nO(e.schema.topNodeType,null,t5.none,!0,null,o),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:o}=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(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(o.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(o.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(o.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 o=e.nodeName.toLowerCase(),s;nN.hasOwnProperty(o)&&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&&nN.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)||(s=this.parser.matchTag(e,this,n));e:if(a?a.ignore:nM.hasOwnProperty(o))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(nA.hasOwnProperty(o))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 s=a&&a.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(i),this.needsBlock=r;}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,a,n,!1===a.consuming?s: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,o;if(t.node){if((o=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(o.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(o,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 s=this.top;if(o&&o.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(s)&&this.open--;}addAll(e,t,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i);}findPlace(e,t,n){let r,i;for(let t=this.open,o=0;t>=0;t--){let s=this.nodes[t],a=s.findWrapping(e);if(a&&(!r||r.length>a.length+o)&&(r=a,i=s,!a.length))break;if(s.solid){if(n)break;o+=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=t5.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):nF(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 o=this.top;o.match=o.match&&o.match.matchType(e);let s=nT(e,i,o.options);4&o.options&&0==o.content.length&&(s|=4);let a=t5.none;return n=n.filter(t=>(o.type?!o.type.allowsMarkType(t.type):!nF(t.type,e))||(a=t.addToSet(a),!1)),this.nodes.push(new nO(e,t,a,r,null,s)),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,o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1;}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&!e.isInGroup(a))return!1;s--;}}return!0;};return o(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 nI(e){let t={};for(let n in e)t[n]=e[n];return t;}function nF(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||0>o.indexOf(i)&&s(i))return!0;}};if(s(i.contentMatch))return!0;}}class nj{constructor(e,t){this.nodes=e,this.marks=t;}serializeFragment(e,t={},n){n||(n=nL(t).createDocumentFragment());let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(!this.marks[t.type.name]){o++;continue;}if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++;}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom);}}r.appendChild(this.serializeNodeInner(e,t));}),n;}serializeNodeInner(e,t){if(e.isText)return nL(t).createTextNode(e.text);let{dom:n,contentDOM:r}=nP(nL(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&&nP(nL(n),r(e,t),null,e.attrs);}static renderSpec(e,t,n=null,r){return"string"==typeof t?{dom:e.createTextNode(t)}:nP(e,t,n,r);}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new nj(this.nodesFromSchema(e),this.marksFromSchema(e)));}static nodesFromSchema(e){let t=nB(e.nodes);return t.text||(t.text=e=>e.text),t;}static marksFromSchema(e){return nB(e.marks);}}function nB(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r);}return t;}function nL(e){return e.document||window.document;}let nz=new WeakMap();function nP(e,t,n,r){let i,o,s;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===(o=nz.get(r))&&nz.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t)){if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);}else for(let n in t)e(t[n]);}(r),o=s)),l=o)&&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 o=h;o<t.length;o++){let s=t[o];if(0===s){if(o<t.length-1||o>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u};}if("string"==typeof s)u.appendChild(e.createTextNode(s));else{let{dom:t,contentDOM:o}=nP(e,s,n,r);if(u.appendChild(t),o){if(i)throw RangeError("Multiple content holes");i=o;}}}return{dom:u,contentDOM:i};}class n${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 nV{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&nV.empty)return nV.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,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=l?e==a?-1:e==u?1:t:t,o=a+r+(i<0?0:c);if(n)return o;let d=e==(t<0?a:u)?null:s/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 n$(o,h,d);}r+=c-l;}return n?e+r:new n$(e+r,0,null);}touches(e,t){let n=0,r=65535&t,i=this.inverted?2:1,o=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let a=this.ranges[t+i];if(e<=s+a&&t==3*r)return!0;n+=this.ranges[t+o]-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 o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),l=this.ranges[r+t],c=this.ranges[r+n];e(s,s+l,a,a+c),i+=c-l;}}invert(){return new nV(this.ranges,!this.inverted);}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges);}static offset(e){return 0==e?nV.empty:new nV(e<0?[0,-e,0]:[0,0,e]);}}nV.empty=new nV([]);class nq{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 nq(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 nq();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 n$(e,r,null);}}let nW=Object.create(null);class nU{getMap(){return nV.empty;}merge(e){return null;}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=nW[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t);}static jsonID(e,t){if(e in nW)throw RangeError("Duplicate use of step JSON ID "+e);return nW[e]=t,t.prototype.jsonID=e,t;}}class nK{constructor(e,t){this.doc=e,this.failed=t;}static ok(e){return new nK(e,null);}static fail(e){return new nK(null,e);}static fromReplace(e,t,n,r){try{return nK.ok(e.replace(t,n,r));}catch(e){if(e instanceof t4)return nK.fail(e.message);throw e;}}}function nH(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(nH(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o);}return t1.fromArray(r);}class nG extends nU{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 t9(nH(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 nK.fromReplace(e,this.from,this.to,i);}invert(){return new nJ(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 nG(t.pos,n.pos,this.mark);}merge(e){return e instanceof nG&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nG(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 nG(t.from,t.to,e.markFromJSON(t.mark));}}nU.jsonID("addMark",nG);class nJ extends nU{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 t9(nH(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return nK.fromReplace(e,this.from,this.to,n);}invert(){return new nG(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 nJ(t.pos,n.pos,this.mark);}merge(e){return e instanceof nJ&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nJ(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 nJ(t.from,t.to,e.markFromJSON(t.mark));}}nU.jsonID("removeMark",nJ);class nZ extends nU{constructor(e,t){super(),this.pos=e,this.mark=t;}apply(e){let t=e.nodeAt(this.pos);if(!t)return nK.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return nK.fromReplace(e,this.pos,this.pos+1,new t9(t1.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 nZ(this.pos,t.marks[n]);return new nZ(this.pos,this.mark);}}return new nY(this.pos,this.mark);}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new nZ(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 nZ(t.pos,e.markFromJSON(t.mark));}}nU.jsonID("addNodeMark",nZ);class nY extends nU{constructor(e,t){super(),this.pos=e,this.mark=t;}apply(e){let t=e.nodeAt(this.pos);if(!t)return nK.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return nK.fromReplace(e,this.pos,this.pos+1,new t9(t1.from(n),0,+!t.isLeaf));}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new nZ(this.pos,this.mark):this;}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new nY(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 nY(t.pos,e.markFromJSON(t.mark));}}nU.jsonID("removeNodeMark",nY);class nQ extends nU{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r;}apply(e){return this.structure&&n0(e,this.from,this.to)?nK.fail("Structure replace would overwrite content"):nK.fromReplace(e,this.from,this.to,this.slice);}getMap(){return new nV([this.from,this.to-this.from,this.slice.size]);}invert(e){return new nQ(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&&nQ.MAP_BIAS<0?t:e.mapResult(this.from,1);return n.deletedAcross&&t.deletedAcross?null:new nQ(n.pos,Math.max(n.pos,t.pos),this.slice,this.structure);}merge(e){if(!(e instanceof nQ)||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?t9.empty:new t9(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new nQ(e.from,this.to,t,this.structure);}{let t=this.slice.size+e.slice.size==0?t9.empty:new t9(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new nQ(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 nQ(t.from,t.to,t9.fromJSON(e,t.slice),!!t.structure);}}nQ.MAP_BIAS=1,nU.jsonID("replace",nQ);class nX extends nU{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s;}apply(e){if(this.structure&&(n0(e,this.from,this.gapFrom)||n0(e,this.gapTo,this.to)))return nK.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return nK.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?nK.fromReplace(e,this.from,this.to,n):nK.fail("Content does not fit in gap");}getMap(){return new nV([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 nX(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 nX(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 nX(t.from,t.to,t.gapFrom,t.gapTo,t9.fromJSON(e,t.slice),t.insert,!!t.structure);}}function n0(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--;}}return!1;}function n1(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],a=t+1;for(let t=0;t<o.childCount;t++){let l=o.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 nJ(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 t9(t1.from(n.schema.text(" ",n.allowedMarks(l.marks))),0,0)),s.push(new nQ(a+e.index,a+e.index+e[0].length,r));}}else s.push(new nQ(a,c,t9.empty));a=c;}if(!r.validEnd){let t=r.fillBefore(t1.empty,!0);e.replace(a,a,new t9(t,0,0));}for(let t=s.length-1;t>=0;t--)e.step(s[t]);}function n2(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let o=e.$from.node(n),s=e.$from.index(n)+r,a=e.$to.indexAfter(n)-i;if(n<e.depth&&o.canReplace(s,a,t))return n;if(0==n||o.type.spec.isolating||!((0==s||o.canReplace(s,o.childCount))&&(a==o.childCount||o.canReplace(0,a))))break;s&&(r=1),a<o.childCount&&(i=1);}return null;}function n3(e){return{type:e,attrs:null};}function n6(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let i=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create());}}});}function n5(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+o);e.replaceWith(i,i+1,t.type.schema.text("\n"));}});}function n4(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let e=i.depth-1,t=n-2;e>o;e--,t--){let n=i.node(e),o=i.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(o,n.childCount),a=r&&r[t+1];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let l=r&&r[t]||n;if(!n.canReplace(o+1,n.childCount)||!l.type.validContent(s))return!1;}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type);}function n9(e,t){var n,r;let i=e.resolve(t),o=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 o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(o.marks))return!1;}return n.validEnd;}(n,r))&&i.parent.canReplace(o,o+1);}function n8(e,t,n=t,r=t9.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return n7(i,o,r)?new nQ(t,n,r):new re(i,o,r).fit();}function n7(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content);}nU.jsonID("replaceAround",nX);class re{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=t1.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=t1.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,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new t9(i,o,s);return e>-1?new nX(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new nQ(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=rr(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let i=this.depth;i>=0;i--){let{type:o,match:s}=this.frontier[i],a,l=null;if(1==t&&(r?s.matchType(r.type)||(l=s.fillBefore(t1.from(r),!1)):e&&o.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:i,parent:e,inject:l};if(2==t&&r&&(a=s.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:i,parent:e,wrap:a};if(e&&s.matchType(e.type))break;}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced;return!(ro(e,-1)<=t)&&(this.unplaced.size>1&&ro(e,1)>n&&n++,this.unplaced=new t9(e,t+1,n),!0);}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=rr(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new t9(rt(e,t-1,1),t-1,i?t-1:n);}else this.unplaced=new t9(rt(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 o=this.unplaced,s=n?n.content:o.content,a=o.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=s.size+e-(o.content.size-o.openEnd);for(;l<s.childCount;){let e=s.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(t1.empty,!0)))),t.copy(i);}(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)));}let p=l==s.childCount;p||(h=-1),this.placed=rn(this.placed,t,t1.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=s;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?t9.empty:new t9(rt(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new t9(rt(o.content,e,l),o.openStart,o.openEnd);}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ri(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)),o=ri(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=ri(e,n,r,t,!0);if(!i||i.childCount)continue t;}return{depth:t,fit:o,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=rn(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=rn(this.placed,this.depth,t1.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch});}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(t1.empty,!0);e.childCount&&(this.placed=rn(this.placed,this.frontier.length,e));}}function rt(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(rt(e.firstChild.content,t-1,n)));}function rn(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(rn(e.lastChild.content,t-1,n)));}function rr(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e;}function ri(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);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,o.content,s)?a:null;}function ro(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 rs(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 ra extends nU{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 nK.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 nK.fromReplace(e,this.pos,this.pos+1,new t9(t1.from(r),0,+!t.isLeaf));}getMap(){return nV.empty;}invert(e){return new ra(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 ra(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 ra(t.pos,t.attr,t.value);}}nU.jsonID("attr",ra);class rl extends nU{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 nK.ok(n);}getMap(){return nV.empty;}invert(e){return new rl(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 rl(t.attr,t.value);}}nU.jsonID("docAttr",rl);let rc=class extends Error{};(rc=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n;}).prototype=Object.create(Error.prototype),rc.prototype.constructor=rc,rc.prototype.name="TransformError";class ru{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new nq();}get before(){return this.docs.length?this.docs[0]:this.doc;}step(e){let t=this.maybeStep(e);if(t.failed)throw new rc(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,o)=>{e=Math.min(e,i),t=Math.max(t,o);});}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=t9.empty){let r=n8(this.doc,e,t,n);return r&&this.step(r),this;}replaceWith(e,t,n){return this.replace(e,t,new t9(t1.from(n),0,0));}delete(e,t){return this.replace(e,t,t9.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),o=e.doc.resolve(n);if(n7(i,o,r))return e.step(new nQ(t,n,r));let s=rs(i,o);0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.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;s.indexOf(e)>-1?a=e:i.before(e)==t&&s.splice(1,0,-e);}let l=s.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<s.length;t++){let c=s[(t+l)%s.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?o.after(c):n,new t9(function e(t,n,r,i,o){if(n<r){let o=t.firstChild;t=t.replaceChild(0,o.copy(e(o.content,n+1,r,i,o)));}if(n>i){let e=o.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(t1.empty,!0));}return t;}(r.content,0,r.openStart,a),a,r.openEnd));}}let h=e.steps.length;for(let a=s.length-1;a>=0&&(e.replace(t,n,r),!(e.steps.length>h));a--){let e=s[a];e<0||(t=i.before(e),n=o.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 t9(t1.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 o=r.sharedDepth(n),s=!1;for(let e=r.depth;e>o;e--)r.node(e).type.spec.isolating&&(s=!0);for(let e=i.depth;e>o;e--)i.node(e).type.spec.isolating&&(s=!0);if(!s){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 o=rs(r,i);for(let t=0;t<o.length;t++){let n=o[t],s=t==o.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n));}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n);}(this,e,t),this;}lift(e,t){return!function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=t1.empty,d=0;for(let e=o,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=t1.from(r.node(e).copy(u)),d++):l--;let h=t1.empty,p=0;for(let e=o,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,h=t1.from(i.node(e).copy(h)),p++):c++;e.step(new nX(l,c,s,a,new t9(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,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.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);n5(e,r.node(),r.before(),a);}s.inlineContent&&n1(e,t+n-1,s,o.node().contentMatchAt(o.index()),null==r);let l=e.mapping.slice(a),c=l.map(t-n);if(e.step(new nQ(c,l.map(t+n,-1),t9.empty,!0)),!0===r){let t=e.doc.resolve(c);n6(e,t.node(),t.before(),e.steps.length);}}(this,e,t),this;}wrap(e,t){return!function(e,t,n){let r=t1.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=t1.from(n[e].type.create(n[e].attrs,r));}let i=t.start,o=t.end;e.step(new nX(i,o,i,o,new t9(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 o=i.steps.length;return i.doc.nodesBetween(e,t,(e,t)=>{var s,a,l;let c,u,d="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,d)&&(s=i.doc,a=i.mapping.slice(o).map(t),l=n,u=(c=s.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&&n5(i,e,t,o),n1(i,i.mapping.slice(o).map(t,1),n,void 0,null===r);let s=i.mapping.slice(o),a=s.map(t,1),l=s.map(t+e.nodeSize,1);return i.step(new nX(a,l,a+1,l-1,new t9(t1.from(n.create(d,null,e.marks)),0,0),1,!0)),!0===r&&n6(i,e,t,o),!1;}}),this;}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw RangeError("Invalid content for node type "+n.name);e.step(new nX(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new t9(t1.from(s),0,0),1,!0));}(this,e,t,n,r),this;}setNodeAttribute(e,t,n){return this.step(new ra(e,t,n)),this;}setDocAttribute(e,t){return this.step(new rl(e,t)),this;}addNodeMark(e,t){return this.step(new nZ(e,t)),this;}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof t5)t.isInSet(n.marks)&&this.step(new nY(e,t));else{let r=n.marks,i,o=[];for(;i=t.isInSet(r);)o.push(new nY(e,i)),r=i.removeFromSet(r);for(let e=o.length-1;e>=0;e--)this.step(o[e]);}return this;}split(e,t=1,n){return!function(e,t,n=1,r){let i=e.doc.resolve(t),o=t1.empty,s=t1.empty;for(let e=i.depth,t=i.depth-n,a=n-1;e>t;e--,a--){o=t1.from(i.node(e).copy(o));let t=r&&r[a];s=t1.from(t?t.type.create(t.attrs,s):i.node(e).copy(s));}e.step(new nQ(t,t,new t9(o.append(s),n,n),!0));}(this,e,t,n),this;}addMark(e,t,n){var r;let i,o,s,a;return r=this,s=[],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:s.push(i=new nJ(c,d,u[e])));o&&o.to==c?o.to=d:a.push(o=new nG(c,d,n));}}),s.forEach(e=>r.step(e)),a.forEach(e=>r.step(e)),this;}removeMark(e,t,n){var r;let i,o;return r=this,i=[],o=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;o++;let a=null;if(n instanceof nS){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(s+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==o-1&&r.eq(i[e].style)&&(l=t);}l?(l.to=n,l.step=o):i.push({style:r,from:Math.max(s,e),to:n,step:o});}}}),i.forEach(e=>r.step(new nJ(e.from,e.to,e.style))),this;}clearIncompatible(e,t,n){return n1(this,e,t,n),this;}}let rd=Object.create(null);class rh{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new rp(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=t9.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,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],c=e.mapping.slice(i);e.replaceRange(c.map(a.pos),c.map(l.pos),s?t9.empty:t),0==s&&rC(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:o,$to:s}=r[i],a=e.mapping.slice(n),l=a.map(o.pos),c=a.map(s.pos);i?e.deleteRange(l,c):(e.replaceRangeWith(l,c,t),rC(e,n,t.isInline?-1:1));}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new rg(e):rw(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?rw(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):rw(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 rb(e.node(0));}static atStart(e){return rw(e,e,0,0,1)||new rb(e);}static atEnd(e){return rw(e,e,e.content.size,e.childCount,-1)||new rb(e);}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=rd[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t);}static jsonID(e,t){if(e in rd)throw RangeError("Duplicate use of selection JSON ID "+e);return rd[e]=t,t.prototype.jsonID=e,t;}getBookmark(){return rg.between(this.$anchor,this.$head).getBookmark();}}rh.prototype.visible=!0;class rp{constructor(e,t){this.$from=e,this.$to=t;}}let rf=!1;function rm(e){rf||e.parent.inlineContent||(rf=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"));}class rg extends rh{constructor(e,t=e){rm(e),rm(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 rh.near(n);let r=e.resolve(t.map(this.anchor));return new rg(r.parent.inlineContent?r:n,n);}replace(e,t=t9.empty){if(super.replace(e,t),t==t9.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t);}}eq(e){return e instanceof rg&&e.anchor==this.anchor&&e.head==this.head;}getBookmark(){return new ry(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 rg(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=rh.findFrom(t,n,!0)||rh.findFrom(t,-n,!0);if(!e)return rh.near(t,n);t=e.$head;}return e.parent.inlineContent||(0==r?e=t:(e=(rh.findFrom(e,-n,!0)||rh.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new rg(e,t);}}rh.jsonID("text",rg);class ry{constructor(e,t){this.anchor=e,this.head=t;}map(e){return new ry(e.map(this.anchor),e.map(this.head));}resolve(e){return rg.between(e.resolve(this.anchor),e.resolve(this.head));}}class rv extends rh{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?rh.near(i):new rv(i);}content(){return new t9(t1.from(this.node),0,0);}eq(e){return e instanceof rv&&e.anchor==this.anchor;}toJSON(){return{type:"node",anchor:this.anchor};}getBookmark(){return new rk(this.anchor);}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new rv(e.resolve(t.anchor));}static create(e,t){return new rv(e.resolve(t));}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable;}}rv.prototype.visible=!1,rh.jsonID("node",rv);class rk{constructor(e){this.anchor=e;}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new ry(n,n):new rk(n);}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&rv.isSelectable(n)?new rv(t):rh.near(t);}}class rb extends rh{constructor(e){super(e.resolve(0),e.resolve(e.content.size));}replace(e,t=t9.empty){if(t==t9.empty){e.delete(0,e.doc.content.size);let t=rh.atStart(e.doc);t.eq(e.selection)||e.setSelection(t);}else super.replace(e,t);}toJSON(){return{type:"all"};}static fromJSON(e){return new rb(e);}map(e){return new rb(e);}eq(e){return e instanceof rb;}getBookmark(){return rx;}}rh.jsonID("all",rb);let rx={map(){return this;},resolve:e=>new rb(e)};function rw(e,t,n,r,i,o=!1){if(t.inlineContent)return rg.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&rv.isSelectable(r))return rv.create(e,n-(i<0?r.nodeSize:0));}else{let t=rw(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t;}n+=r.nodeSize*i;}return null;}function rC(e,t,n){let r,i=e.steps.length-1;if(i<t)return;let o=e.steps[i];(o instanceof nQ||o instanceof nX)&&(e.mapping.maps[i].forEach((e,t,n,i)=>{null==r&&(r=i);}),e.setSelection(rh.near(e.doc.resolve(r),n)));}class rS extends ru{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 t5.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)||t5.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(rh.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 rD(e,t){return t&&e?e.bind(t):e;}class r_{constructor(e,t,n){this.name=e,this.init=rD(t.init,n),this.apply=rD(t.apply,n);}}let rE=[new r_("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new r_("selection",{init:(e,t)=>e.selection||rh.atStart(t.doc),apply:e=>e.selection}),new r_("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new r_("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class rA{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rE.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 r_(e.key,e.spec.state,e));});}}class rM{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 o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,l=r?r[o].state:this,c=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,l,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0});}t.push(c),n=n.applyInner(c),i=!0;}r&&(r[o]={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 rM(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 rS(this);}static create(e){let t=new rA(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new rM(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 rA(this.schema,e.plugins),n=t.fields,r=new rM(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 rA(e.schema,e.plugins),i=new rM(r);return r.fields.forEach(r=>{if("doc"==r.name)i.doc=nu.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=rh.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 o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){i[r.name]=a.fromJSON.call(s,e,t[o],i);return;}}i[r.name]=r.init(e,i);}}),i;}}class rN{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let i in t){let o=t[i];o instanceof Function?o=o.bind(n):"handleDOMEvents"==i&&(o=e(o,n,{})),r[i]=o;}return r;}(e.props,this,this.props),this.key=e.key?e.key.key:rO("plugin");}getState(e){return e[this.key];}}let rT=Object.create(null);function rO(e){return e in rT?e+"$"+ ++rT[e]:(rT[e]=0,e+"$");}class rR{constructor(e="key"){this.key=rO(e);}get(e){return e.config.pluginsByKey[this.key];}getState(e){return e[this.key];}}let rI=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t;},rF=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t;},rj=null,rB=function(e,t,n){let r=rj||(rj=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r;},rL=function(){rj=null;},rz=function(e,t,n,r){return n&&(r$(e,t,n,r,-1)||r$(e,t,n,r,1));},rP=/^(img|br|input|textarea|hr)$/i;function r$(e,t,n,r,i){for(var o;;){if(e==n&&t==r)return!0;if(t==(i<0?0:rV(e))){let n=e.parentNode;if(!n||!rq(n)||rK(e)||rP.test(e.nodeName)||"false"==e.contentEditable)return!1;t=rI(e)+(i<0?0:1),e=n;}else{if(!rq(e))return!1;let n=e.childNodes[t+(i<0?-1:0)];if(rq(n)&&"false"==n.contentEditable){if(null==(o=n.pmViewDesc)||!o.ignoreForSelection)return!1;else t+=i;}else e=n,t=i<0?rV(e):0;}}}function rV(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length;}function rq(e){return 1==e.nodeType;}function rW(e){return 3==e.nodeType;}function rU(e,t){return!!t&&e.contains(rq(t)?t:t.parentNode);}function rK(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 rH=function(e){return e.focusNode&&rz(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset);};function rG(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n;}let rJ="u">typeof navigator?navigator:null,rZ="u">typeof document?document:null,rY=rJ&&rJ.userAgent||"",rQ=/Edge\/(\d+)/.exec(rY),rX=/MSIE \d/.exec(rY),r0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(rY),r1=!!(rX||r0||rQ),r2=rX?document.documentMode:r0?+r0[1]:rQ?+rQ[1]:0,r3=!r1&&/gecko\/(\d+)/i.test(rY);r3&&(/Firefox\/(\d+)/.exec(rY)||[0,0])[1];let r6=!r1&&/Chrome\/(\d+)/.exec(rY),r5=!!r6,r4=r6?+r6[1]:0,r9=!r1&&!!rJ&&/Apple Computer/.test(rJ.vendor),r8=r9&&(/Mobile\/\w+/.test(rY)||!!rJ&&rJ.maxTouchPoints>2),r7=r8||!!rJ&&/Mac/.test(rJ.platform),ie=!!rJ&&/Win/.test(rJ.platform),it=/Android \d/.test(rY),ir=!!rZ&&"webkitFontSmoothing"in rZ.documentElement.style,ii=ir?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function io(e,t){return"number"==typeof e?e:e[t];}function is(e,t,n){if(!id(t)&&0==t.left)return;let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(!rq(s)){s=rF(s);continue;}let e=s==o.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};}(o):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};}(s),a=0,l=0;if(t.top<n.top+io(r,"top")?l=-(n.top-t.top+io(i,"top")):t.bottom>n.bottom-io(r,"bottom")&&(l=t.bottom-t.top>n.bottom-n.top?t.top+io(i,"top")-n.top:t.bottom-n.bottom+io(i,"bottom")),t.left<n.left+io(r,"left")?a=-(n.left-t.left+io(i,"left")):t.right>n.right-io(r,"right")&&(a=t.right-n.right+io(i,"right")),a||l)if(e)o.defaultView.scrollBy(a,l);else{let e=s.scrollLeft,n=s.scrollTop;l&&(s.scrollTop+=l),a&&(s.scrollLeft+=a);let r=s.scrollLeft-e,i=s.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i};}let c=e?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(c))break;s="absolute"==c?s.offsetParent:rF(s);}}function ia(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=rF(r));return t;}function il(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o);}}let ic=null;function iu(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1;}function id(e){return e.top<e.bottom||e.left<e.right;}function ih(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(id(e))return e;}return Array.prototype.find.call(n,id)||e.getBoundingClientRect();}let ip=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function im(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=ir||r3;if(rW(r))if(s&&(ip.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=ih(rB(r,i,i),n);if(r3&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=ih(rB(r,i-1,i-1),-1);if(t.top==e.top){let n=ih(rB(r,i,i+1),-1);if(n.top!=e.top)return ig(n,n.left<t.left);}}return e;}else{let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,ig(ih(rB(r,e,t),o),o<0);}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==rV(r))){let e=r.childNodes[i-1];if(rq(e))return iy(e.getBoundingClientRect(),!1);}if(null==o&&i<rV(r)){let e=r.childNodes[i];if(rq(e))return iy(e.getBoundingClientRect(),!0);}return iy(r.getBoundingClientRect(),n>=0);}if(null==o&&i&&(n<0||i==rV(r))){let e=r.childNodes[i-1],t=rW(e)?rB(e,rV(e)-!s):rq(e)&&("BR"!=e.nodeName||!e.nextSibling)?e:null;if(t)return ig(ih(t,1),!1);}if(null==o&&i<rV(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?rW(e)?rB(e,0,+!s):rq(e)?e:null:null;if(t)return ig(ih(t,-1),!0);}return ig(ih(rW(r)?rB(r):r,-n),n>=0);}function ig(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 iy(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 iv(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 ik=/[\u0590-\u08ac]/,ib=null,ix=null,iw=!1;class iC{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&&rU(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>rI(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),o;if(i&&(!t||i.node))if(!n||!(o=i.nodeDOM)||(rq(o)?rU(o,e):o==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 iN||e instanceof iS&&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?rI(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?rI(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 o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+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=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=rI(n.dom)+1;break;}e-=n.size;}-1==r&&(r=0);}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=rI(n.dom);break;}t+=n.size;}-1==i&&(i=this.contentDOM.childNodes.length);break;}o=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(!rq(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),o=Math.max(e,t);for(let s=0,a=0;s<this.children.length;s++){let l=this.children[s],c=a+l.size;if(i>a&&o<c)return l.setSelection(e-a-l.border,t-a-l.border,n,r);a=c;}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),l=n.root.getSelection(),c=n.domSelectionRange(),u=!1;if((r3||r9)&&e==t){let{node:e,offset:t}=s;if(rW(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&&(s=a={node:n.parentNode,offset:rI(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(r3&&c.focusNode&&c.focusNode!=a.node&&rq(c.focusNode)){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0);}if(!(r||u&&r9)&&rz(s.node,s.offset,c.anchorNode,c.anchorOffset)&&rz(a.node,a.offset,c.focusNode,c.focusOffset))return;let d=!1;if((l.extend||e==t)&&!(u&&r3)){l.collapse(s.node,s.offset);try{e!=t&&l.extend(a.node,a.offset),d=!0;}catch(e){}}if(!d){if(e>t){let e=s;s=a,a=e;}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.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],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s){this.dirty=e==n||t==o?2:1,e==r&&t==s&&(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=o;}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 iS extends iC{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r)),!t.type.spec.raw){let e=rq(o)?o:document.createElement("span");e!=o&&e.appendChild(o),e.hasAttribute("contenteditable")||(e.contentEditable="false"),e.classList.add("ProseMirror-widget");}super(e,[],o,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 iD extends iC{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 i_ extends iC{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],o=i&&i(t,r,n);return o&&o.dom||(o=nj.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new i_(e,t,o.dom,o.contentDOM||o.dom,o);}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=i_.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=i$(i,t,o,n)),e>0&&(i=i$(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 iE extends iC{constructor(e,t,n,r,i,o,s){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s;}static create(e,t,n,r,i,o){let s=i.nodeViews[t.type.name],a,l=s&&s(t,i,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:o,n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText){if(c){if(!rW(c))throw RangeError("Text must be rendered as a DOM text node");}else c=document.createTextNode(t.text);}else if(!c){let e=nj.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=ij(c,n,t),l)?a=new iT(e,t,n,r,c,u||null,d,l):t.isText?new iM(e,t,n,r,c,d):new iE(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=>rq(t)&&0>e.indexOf(t.parentNode)&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>t1.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)&&iB(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,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new iz(this,o&&o.node,e),l=this.node.inlineContent,c=l&&this.node.isBlock;(function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize;}return;}let s=0,a=[],l=null;for(let c=0;;){let u,d,h,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(u?(d||(d=[u])).push(e):u=e);}if(u)if(d){d.sort(iP);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<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(l=h.cut(e-o),h=h.cut(0,e-o),f=e,p=-1);}else for(;s<i.length&&i[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?a.filter(e=>!e.inline):a.slice();r(h,m,t.forChild(o,h),p),o=f;}})(this.node,this.innerDeco,(t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?t5.none:this.node.child(i).marks,n,e,i),a.placeWidget(t,e,r);},(t,o,u,d)=>{let h;a.syncToMarks(t.marks,n,e,d),c&&t.isAtom&&!t.isText&&a.addHackNode("IMG",a.top),a.findNodeMatch(t,o,u,d)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(h=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,u,h,e)||a.updateNextNode(t,o,u,e,d,r)||a.addNode(t,o,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)&&(o&&this.protectLocalComposition(e,o),function e(t,n,r){let i=t.firstChild,o=!1;for(let s=0;s<n.length;s++){let a=n[s],l=a.dom;if(l.parentNode==t){for(;l!=i;)i=iL(i),o=!0;i=i.nextSibling;}else o=!0,t.insertBefore(l,i);if(a instanceof i_){let n=i?i.previousSibling:t.lastChild;e(a.contentDOM,a.children,r),i=n?n.nextSibling:t.firstChild;}}for(;i;)i=iL(i),o=!0;o&&r.trackWrites==t&&(r.trackWrites=null);}(this.contentDOM,this.children,e),r8&&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 rg)||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,o=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;l+=t.text;}if(o>=n){if(o>=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 o<0?null:{node:i,pos:o,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 o=new iD(this,i,t,r);e.input.compositionNodes.push(o),this.children=i$(this.children,n,n+r.length,e,o);}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(iB(e,this.outerDeco))return;let t=!rq(this.nodeDOM),n=this.dom;this.dom=iF(this.dom,this.nodeDOM,iI(this.outerDeco,this.node,t),iI(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e;}selectNode(){rq(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0));}deselectNode(){rq(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 iA(e,t,n,r,i){ij(r,t,e);let o=new iE(void 0,e,t,n,r,r,r);return o.contentDOM&&o.updateChildren(i,0),o;}class iM extends iE{constructor(e,t,n,r,i,o){super(e,t,n,r,i,null,o);}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 iM(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 iN extends iC{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 iT extends iE{constructor(e,t,n,r,i,o,s,a){super(e,t,n,r,i,o,s),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 iO=function(e){e&&(this.nodeName=e);};iO.prototype=Object.create(null);let iR=[new iO()];function iI(e,t,n){if(0==e.length)return iR;let r=n?iR[0]:new iO(),i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s)for(let e in s.nodeName&&i.push(r=new iO(s.nodeName)),s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new iO(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o));}}return i;}function iF(e,t,n,r){if(n==iR&&r==iR)return t;let i=t;for(let t=0;t<r.length;t++){let o=r[t],s=n[t];if(t){let t;s&&s.nodeName==o.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==o.nodeName||((t=document.createElement(o.nodeName)).pmIsDeco=!0,t.appendChild(i),s=iR[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,s||iR[0],o);}return i;}function ij(e,t,n){return iF(e,e,iR,iI(t,n,!rq(e)));}function iB(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 iL(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t;}class iz{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,o=new Map(),s=[];n:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(e instanceof i_)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,o.set(a,i),s.push(a);}}return{index:i,matched:o,matches:s.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,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let i=-1,s=this.top.children.length;r<this.preMatch.index&&(s=Math.min(this.index+3,s));for(let t=this.index;t<s;t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!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 i_&&3!=t.dirty&&t.mark.type==e[o].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[o])&&(t.mark=e[o],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=i_.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0;}this.index=0,o++;}}findNodeMatch(e,t,n,r){let i=-1,o;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(let r=this.index,o=Math.min(this.top.children.length,r+5);r<o;r++){let o=this.top.children[r];if(o.matchesNode(e,t,n)&&!this.preMatch.matched.has(o)){i=r;break;}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0);}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.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,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof iE){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&&iB(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(a,e,t,n,r,o)))return this.destroyBetween(this.index,s),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(r,o+1),u.dirty=0),this.changed=!0,this.index++,!0;break;}}return!1;}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!iB(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=iE.create(this.top,t,n,r,i,o);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s;}addNode(e,t,n,r,i){let o=iE.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),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 iS(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 i_;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof iM)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((r9||r5)&&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 iN(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||rq(e)&&e.contains(this.lock.parentNode));}}function iP(e,t){return e.type.side-t.type.side;}function i$(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],c=a,u=a+=l.size;c>=n||u<=t?o.push(l):(c<t&&o.push(l.slice(0,t-c,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-c,l.size,r)));}return o;}function iV(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(rH(n)){for(l=s;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&rv.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&function(e,t,n){for(let r=0==t,i=t==rV(e);r||i;){if(e==n)return!0;let t=rI(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==rV(e);}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;c=new rv(s==e?a:r.resolve(e));}else if(r3&&"key"==t&&s>e.state.selection.to&&rq(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=rh.findFrom(r.resolve(i.posAtStart),1);break;}if(e==i.dom||e.nextSibling||!e.parentNode||!rq(e.parentNode))break;}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,i=s;for(let r=0;r<n.rangeCount;r++){let o=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(o.startContainer,o.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(o.endContainer,o.endOffset,-1));}if(t<0)return null;[l,s]=i==e.state.selection.anchor?[i,t]:[t,i],a=r.resolve(s);}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&&!o?1:-1;c=iY(e,u,a,n);}return c;}function iq(e){return e.editable?e.hasFocus():iX(e)&&document.activeElement&&document.activeElement.contains(e.dom);}function iW(e,t=!1){let n=e.state.selection;if(iJ(e,n),!iq(e))return;let r=e.input.mouseDown;if(!t&&r5&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&rz(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,rI(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&r1&&r2<=11&&(n.disabled=!0,n.disabled=!1);}(e);else{var i;let r,o,s,a,{anchor:l,head:c}=n,u,d;iU&&!(n instanceof rg)&&(n.$from.parent.inlineContent||(u=iK(e,n.from)),n.empty||n.$from.parent.inlineContent||(d=iK(e,n.to))),e.docView.setSelection(l,c,e,t),iU&&(u&&iG(u),d&&iG(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),s=(o=i.domSelectionRange()).anchorNode,a=o.anchorOffset,r.addEventListener("selectionchange",i.input.hideSelectionGuard=()=>{(o.anchorNode!=s||o.anchorOffset!=a)&&(r.removeEventListener("selectionchange",i.input.hideSelectionGuard),setTimeout(()=>{(!iq(i)||i.state.selection.visible)&&i.dom.classList.remove("ProseMirror-hideselection");},20));})));}e.domObserver.setCurSelection(),e.domObserver.connectSelection();}let iU=r9||r5&&r4<63;function iK(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(r9&&i&&"false"==i.contentEditable)return iH(i);if((!i||"false"==i.contentEditable)&&(!o||"false"==o.contentEditable)){if(i)return iH(i);else if(o)return iH(o);}}function iH(e){return e.contentEditable="true",r9&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e;}function iG(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null);}function iJ(e,t){if(t instanceof rv){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(iZ(e),n&&n.selectNode(),e.lastSelectedViewDesc=n);}else iZ(e);}function iZ(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0);}function iY(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||rg.between(t,n,r);}function iQ(e){return(!e.editable||!!e.hasFocus())&&iX(e);}function iX(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return rU(e.dom,t.anchorNode)&&(e.editable||rU(e.dom,t.focusNode));}catch(e){return!1;}}function i0(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&rh.findFrom(o,t);}function i1(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0;}function i2(e,t,n){let r=e.state.selection;if(r instanceof rg){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 o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return i1(e,new rg(r.$anchor,o));}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=i0(e.state,t);return!!n&&n instanceof rv&&i1(e,n);}else if(!(r7&&n.indexOf("m")>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,o;if(!i||i.isText)return!1;let s=t<0?n.pos-i.nodeSize:n.pos;return!!(i.isAtom||(o=e.docView.descAt(s))&&!o.contentDOM)&&(rv.isSelectable(i)?i1(e,new rv(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):i1(e,new rg(e.state.doc.resolve(t<0?s:s+i.nodeSize))));}}else{if(r instanceof rv&&r.node.isInline)return i1(e,new rg(t>0?r.$to:r.$from));let n=i0(e.state,t);return!!n&&i1(e,n);}}function i3(e,t){let n=e.pmViewDesc;return n?0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName):rq(e)&&"false"==e.contentEditable;}function i6(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(r3&&rq(n)&&r<rV(n)&&i3(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(!rq(n))break;let e=n.childNodes[r-1];if(i3(e,-1))i=n,o=--r;else if(rW(e))r=(n=e).nodeValue.length;else break;}else if(i5(n))break;else{let t=n.previousSibling;for(;t&&i3(t,-1);)i=n.parentNode,o=rI(t),t=t.previousSibling;if(t)r=rV(n=t);else{if((n=n.parentNode)==e.dom)break;r=0;}}s?i4(e,n,r):i&&i4(e,i,o);}(e):function(e){let t,n,r=e.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s=rV(i);for(;;)if(o<s){if(!rq(i))break;if(i3(i.childNodes[o],1))t=i,n=++o;else break;}else if(i5(i))break;else{let r=i.nextSibling;for(;r&&i3(r,1);)t=r.parentNode,n=rI(r)+1,r=r.nextSibling;if(r)o=0,s=rV(i=r);else{if((i=i.parentNode)==e.dom)break;o=s=0;}}t&&i4(e,t,n);}(e);}function i5(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock;}function i4(e,t,n){if(!rW(t)){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!rK(e);)t=rI(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(rW(n))return n;if(rq(n)&&"false"==n.contentEditable)break;e=n,t=0;}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!rK(e);)t=rI(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(rW(n))return n;if(rq(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(rH(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&&iW(e);},50);}function i9(e,t){let n=e.state.doc.resolve(t);if(!(r5||ie)&&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 i8(e,t,n){let r=e.state.selection;if(r instanceof rg&&!r.empty||n.indexOf("s")>-1||r7&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=i0(e.state,t);if(n&&n instanceof rv)return i1(e,n);}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof rb?rh.near(n,t):rh.findFrom(n,t);return!!s&&i1(e,s);}return!1;}function i7(e,t){if(!(e.state.selection instanceof rg))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 o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0;}return!1;}function oe(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start();}function ot(e,t){e.someProp("transformCopied",n=>{t=n(t,e);});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content;}let s=e.someProp("clipboardSerializer")||nj.fromSchema(e.state.schema),a=oc(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&rq(c)&&(u=ol[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&&rq(c)&&c.setAttribute("data-pm-slice",`${i} ${o}${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 on(e,t,n,r,i){let o,s,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 s=new t9(t1.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0),e.someProp("transformPasted",t=>{s=t(s,e,!0);}),s;let n=e.someProp("clipboardTextParser",n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=nj.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)));});}}else e.someProp("transformPastedHTML",t=>{n=t(n,e);}),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=oc(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),o;if((o=i&&ol[i[1].toLowerCase()])&&(e=o.map(e=>"<"+e+">").join("")+e+o.map(e=>"</"+e+">").reverse().join("")),r.innerHTML=function(e){let t=window.trustedTypes;if(!t)return e;if(!ou){if(ou=t.defaultPolicy)try{return ou.createHTML(e);}catch(e){}ou=t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e});}return ou.createHTML(e);}(e),o)for(let e=0;e<o.length;e++)r=r.querySelector(o[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),ir&&function(e){let t=e.querySelectorAll(r5?"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);}}(o);let c=o&&o.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=o.firstChild;for(;e&&!rq(e);)e=e.nextSibling;if(!e)break;o=e;}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||nE.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||or.test(e.parentNode.nodeName)?null:{ignore:!0}})),u)s=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:o,openEnd:s}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;try{i=t1.from(t.create(r[e+1],i));}catch(e){break;}o++,s++;}return new t9(i,o,s);}(oa(s,+u[1],+u[2]),u[4]);else if((s=t9.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,o=[];if(e.forEach(e=>{if(!o)return;let t=r.findWrapping(e.type),n;if(!t)return o=null;if(n=o.length&&i.length&&function e(t,n,r,i,o){if(o<t.length&&o<n.length&&t[o]==n[o]){let s=e(t,n,r,i.lastChild,o+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(o==t.length-1?r.type:t[o+1]))return i.copy(i.content.append(t1.from(oi(r,t,o+1))));}}(t,i,e,o[o.length-1],0))o[o.length-1]=n;else{o.length&&(o[o.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(t1.empty,!0);return t.copy(r.append(i));}(o[o.length-1],i.length));let n=oi(e,t);o.push(n),r=r.matchType(n.type),i=t;}}),o)return t1.from(o);}return e;}(s.content,i),!0)).openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=oa(s,e,t);}return e.someProp("transformPasted",t=>{s=t(s,e,l);}),s;}let or=/^(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 oi(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,t1.from(e));return e;}function oo(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=oo(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(t1.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a));}function oa(e,t,n){return t<e.openStart&&(e=new t9(oo(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new t9(oo(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e;}let ol={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 oc(){return document.implementation.createHTMLDocument("title");}let ou=null,od={},oh={},op={touchstart:!0,touchmove:!0};class of{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 om(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now();}function og(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>oy(e,t));});}function oy(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented);});}function ov(e){return{left:e.clientX,top:e.clientY};}function ok(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let r=o.depth+1;r>0;r--)if(e.someProp(t,t=>r>o.depth?t(e,n,o.nodeAfter,o.before(r),i,!0):t(e,n,o.node(r),o.before(r),i,!1)))return!0;return!1;}function ob(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 ox(e,t,n){let r=e.state.doc;if(-1==t)return r.inlineContent?rg.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),o=i.before(e);if(t.inlineContent)return rg.create(r,o+1,o+1+t.content.size);if(n&&rv.isSelectable(t))return rv.create(r,o);}return null;}oh.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!o_(e))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!it||!r5||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!r8||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||r7&&72==r&&"c"==i)return i7(e,-1)||i6(e,-1);if(46==r&&!t.shiftKey||r7&&68==r&&"c"==i)return i7(e,1)||i6(e,1);if(13==r||27==r)return!0;if(37==r||r7&&66==r&&"c"==i){let t=37==r?"ltr"==i9(e,e.state.selection.from)?-1:1:-1;return i2(e,t,i)||i6(e,t);}if(39==r||r7&&70==r&&"c"==i){let t=39==r?"ltr"==i9(e,e.state.selection.from)?1:-1:1;return i2(e,t,i)||i6(e,t);}else if(38==r||r7&&80==r&&"c"==i)return i8(e,-1,i)||i6(e,-1);else if(40==r||r7&&78==r&&"c"==i)return function(e){if(!r9||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&rq(t)&&0==n&&t.firstChild&&rq(t.firstChild)&&"false"==t.firstChild.contentEditable){let n=t.firstChild;oe(e,n,"true"),setTimeout(()=>oe(e,n,"false"),20);}return!1;}(e)||i8(e,1,i)||i6(e,1);else if(i==(r7?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1;}(e,t)?t.preventDefault():om(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,rG(13,"Enter"))),e.input.lastIOSEnter=0);},200);}},oh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1);},oh.keypress=(e,t)=>{if(o_(e)||!t.charCode||t.ctrlKey&&!t.altKey||r7&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof rg)||!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 ow=r7?"metaKey":"ctrlKey";od.mousedown=(e,t)=>{var n;let r,i;e.input.shiftKey=t.shiftKey;let o=oN(e),s=Date.now(),a="singleClick";s-e.input.lastClick.time<500&&(r=(n=e.input.lastClick).x-t.clientX)*r+(i=n.y-t.clientY)*i<100&&!t[ow]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?a="doubleClick":"doubleClick"==e.input.lastClick.type&&(a="tripleClick")),e.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:a,button:t.button},e.input.mouseDown&&e.input.mouseDown.done();let l=e.posAtCoords(ov(t));l&&("singleClick"==a?e.input.mouseDown=new oS(e,l,t,!!o):("doubleClick"==a?function(e,t,n,r){return ok(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r));}:function(e,t,n,r){return ok(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=ox(e,t,!0),i=e.state.doc;return!!r&&(ob(e,r),r instanceof rg&&i.eq(e.state.doc)&&(e.input.mouseDown=new oD(e,r)),!0);}(e,n,r);})(e,l.pos,l.inside,t)?t.preventDefault():om(e,"pointer"));};class oC{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 oS extends oC{constructor(e,t,n,r){let i,o;if(super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[ow],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0;}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a&&rq(a.nodeDOM)?a.nodeDOM:null;let{selection:l}=e.state;0==n.button&&(i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof rv&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&r3&&!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()),om(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||iW(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(ov(e))),this.updateAllowDefault(e),this.allowDefault||!t)om(this.view,"pointer");else{var n,r,i,o;(n=this.view,r=t.pos,i=t.inside,o=this.selectNode,ok(n,"handleClickOn",r,i,e)||n.someProp("handleClick",t=>t(n,r,e))||(o?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,i;n instanceof rv&&(r=n.node);let o=e.state.doc.resolve(t);for(let e=o.depth+1;e>0;e--){let t=e>o.depth?o.nodeAfter:o.node(e);if(rv.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?o.before(n.$from.depth):o.before(e);break;}}return null!=i&&(ob(e,rv.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&&rv.isSelectable(r))&&(ob(e,new rv(n)),!0);}(n,i)))?e.preventDefault():0==e.button&&(this.flushed||r9&&this.mightDrag&&!this.mightDrag.node.isAtom||r5&&!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)))?(ob(this.view,rh.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):om(this.view,"pointer");}}move(e){this.updateAllowDefault(e),om(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 oD extends oC{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(),om(this.view,"pointer");let t=this.view.posAtCoords(ov(e)),n=t&&ox(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[o,s]=n.from<i.from?[i.to,n.from]:[i.from,n.to];ob(this.view,rg.create(r,o,s));}}function o_(e,t){return!!e.composing||!!(r9&&500>Math.abs(Date.now()-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0);}od.touchstart=e=>{e.input.lastTouch=Date.now(),oN(e),om(e,"pointer");},od.touchmove=e=>{e.input.lastTouch=Date.now(),om(e,"pointer");},od.contextmenu=e=>oN(e);let oE=it?5e3:-1;function oA(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>oN(e),t));}function oM(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty();}function oN(e,t=!1){if(!it||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),oM(e),t||e.docView&&e.docView.dirty){let n=iV(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;}}oh.compositionstart=oh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof rg&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)||r5&&ie&&function(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!rq(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return rq(r)&&"false"==r.contentEditable;}(e)))e.markCursor=e.state.storedMarks||n.marks(),oN(e,!0),e.markCursor=null;else if(oN(e,!t.selection.empty),r3&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&rq(n)&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(rW(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break;}n=t,r=-1;}}e.input.composing=!0;}oA(e,oE);},oh.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++,oA(e,20));};let oT=r1&&r2<15||r8&&ii<604;function oO(e,t,n,r,i){let o=on(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,i,o||t9.empty)))return!0;if(!o)return!1;let s=0==o.openStart&&0==o.openEnd&&1==o.content.childCount?o.content.firstChild:null,a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0;}function oR(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," "):"";}od.copy=oh.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let i=oT?null:t.clipboardData,{dom:o,text:s}=ot(e,n.content());i?(t.preventDefault(),i.clearData(),i.setData("text/html",o.innerHTML),i.setData("text/plain",s)):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,o),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"));},oh.paste=(e,t)=>{if(e.composing&&!it)return;let n=oT?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&oO(e,oR(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?oO(e,r.value,null,i,t):oO(e,r.textContent,r.innerHTML,i,t);},50);}(e,t);};class oI{constructor(e,t,n){this.slice=e,this.move=t,this.node=n;}}let oF=r7?"altKey":"ctrlKey";function oj(e,t){let n;return e.someProp("dragCopies",e=>{n=n||e(t);}),null!=n?!n:!t[oF];}for(let e in od.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(ov(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof rv?i.to-1:i.to));else if(r&&r.mightDrag)n=rv.create(e.state.doc,r.mightDrag.pos);else if(t.target&&rq(t.target)){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=rv.create(e.state.doc,r.posBefore));}let s=(n||e.state.selection).content(),{dom:a,text:l,slice:c}=ot(e,s);t.dataTransfer.files.length&&r5&&!(r4>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(oT?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",oT||t.dataTransfer.setData("text/plain",l),e.dragging=new oI(c,oj(e,t),n);},od.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null);},50);},oh.dragover=oh.dragenter=(e,t)=>t.preventDefault(),oh.drop=(e,t)=>{try{!function(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(ov(t));if(!r)return;let i=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",t=>{o=t(o,e,!1);}):o=on(e,oR(t.dataTransfer),oT?null:t.dataTransfer.getData("text/html"),!1,i);let s=!!(n&&oj(e,t));if(e.someProp("handleDrop",n=>n(e,t,o||t9.empty,s)))return t.preventDefault();if(!o)return;t.preventDefault();let a=o?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,o=r.index(t)+ +(n>0),s=r.node(t),a=!1;if(1==e)a=s.canReplace(o,o,i);else{let e=s.contentMatchAt(o).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(o,o,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,o):i.pos;null==a&&(a=i.pos);let l=e.state.tr;if(s){let{node:e}=n;e?e.replace(l):l.deleteSelection();}let c=l.mapping.map(a),u=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,d=l.doc;if(u?l.replaceRangeWith(c,c,o.content.firstChild):l.replaceRange(c,c,o),l.doc.eq(d))return;let h=l.doc.resolve(c);if(u&&rv.isSelectable(o.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(o.content.firstChild))l.setSelection(new rv(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(iY(e,h,l.doc.resolve(t)));}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"));}(e,t,e.dragging);}finally{e.dragging=null;}},od.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())&&iW(e);},20));},od.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);},od.beforeinput=(e,t)=>{if(it&&"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,rG(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);}},oh)od[e]=oh[e];function oB(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 oL{constructor(e,t){this.toDOM=e,this.spec=t||oq,this.side=this.spec.side||0;}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new o$(i-n,i-n,this);}valid(){return!0;}eq(e){return this==e||e instanceof oL&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&oB(this.spec,e.spec));}destroy(e){this.spec.destroy&&this.spec.destroy(e);}}class oz{constructor(e,t){this.attrs=e,this.spec=t||oq;}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new o$(i,o,this);}valid(e,t){return t.from<t.to;}eq(e){return this==e||e instanceof oz&&oB(this.attrs,e.attrs)&&oB(this.spec,e.spec);}static is(e){return e.type instanceof oz;}destroy(){}}class oP{constructor(e,t){this.attrs=e,this.spec=t||oq;}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new o$(i.pos-n,o.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 oP&&oB(this.attrs,e.attrs)&&oB(this.spec,e.spec);}destroy(){}}class o${constructor(e,t,n){this.from=e,this.to=t,this.type=n;}copy(e,t){return new o$(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 o$(e,e,new oL(t,n));}static inline(e,t,n,r){return new o$(e,t,new oz(n,r));}static node(e,t,n,r){return new o$(e,t,new oP(n,r));}get spec(){return this.type.spec;}get inline(){return this.type instanceof oz;}get widget(){return this.type instanceof oL;}}let oV=[],oq={};class oW{constructor(e,t){this.local=e.length?e:oV,this.children=t.length?t:oV;}static create(e,t){return t.length?oZ(t,e,0,oq):oU;}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 o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r));}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i);}}map(e,t,n){return this==oU||0==e.maps.length?this:this.mapInner(e,t,0,0,n||oq);}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec);}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let e=0,t=o;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,o)=>{let s=o-i-(n-e);for(let i=0;i<a.length;i+=3){let o=a[i+1];if(o<0||e>o+t-r)continue;let l=a[i]+t-r;n>=l?a[i+1]=e<=l?-2:-1:e>=t&&s&&(a[i]+=s,a[i+1]+=s);}r+=s;}),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]+o),u=c-i;if(u<0||u>=r.content.size){l=!0;continue;}let d=n.map(e[t+1]+o,-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]+o+1,s);r!=oU?(a[t]=u,a[t+1]=d,a[t+2]=r):(a[t+1]=-2,l=!0);}else l=!0;}if(l){let l=oZ(function(e,t,n,r,i,o,s){for(let a=0;a<e.length;a+=3)-1==e[a+1]&&function e(t,o){for(let e=0;e<t.local.length;e++){let a=t.local[e].map(r,i,o);a?n.push(a):s.onRemove&&s.onRemove(t.local[e].spec);}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+o+1);}(e[a+2],t[a]+o+1);return n;}(a,e,t,n,i,o,s),r,0,s);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 oW(t.sort(oY),a);}(this.children,o||[],e,t,n,r,i):o?new oW(o.sort(oY),oV):oU;}add(e,t){return t.length?this==oU?oW.create(e,t):this.addInner(e,t,0):this;}addInner(e,t,n){let r,i=0;e.forEach((e,o)=>{let s=o+n,a;if(a=oG(t,e,s)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,a,s+1):r.splice(i,0,o,o+e.nodeSize,oZ(a,e,s+1,oq)),i+=3;}});let o=oH(i?oJ(t):t,-n);for(let t=0;t<o.length;t++)o[t].type.valid(e,o[t])||o.splice(t--,1);return new oW(o.length?this.local.concat(o).sort(oY):this.local,r||this.children);}remove(e){return 0==e.length||this==oU?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,o=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>o&&n.to<s&&(e[t]=null,(i||(i=[])).push(n));if(!i)continue;n==this.children&&(n=this.children.slice());let a=n[r+2].removeInner(i,o+1);a!=oU?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 oW(r,n):oU;}forChild(e,t){let n,r;if(this==oU)return this;if(t.isLeaf)return oW.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,o=i+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>i&&t.type instanceof oz){let e=Math.max(i,t.from)-i,n=Math.min(o,t.to)-i;e<n&&(r||(r=[])).push(t.copy(e,n));}}if(r){let e=new oW(r.sort(oY),oV);return n?new oK([e,n]):e;}return n||oU;}eq(e){if(this==e)return!0;if(!(e instanceof oW)||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 oQ(this.localsInner(e));}localsInner(e){if(this==oU)return oV;if(e.inlineContent||!this.local.some(oz.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof oz||t.push(this.local[e]);return t;}forEachSet(e){e(this);}}oW.empty=new oW([],[]),oW.removeOverlap=oQ;let oU=oW.empty;class oK{constructor(e){this.members=e;}map(e,t){let n=this.members.map(n=>n.map(e,t,oq));return oK.from(n);}forChild(e,t){if(t.isLeaf)return oW.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=oU&&(i instanceof oK?n=n.concat(i.members):n.push(i));}return oK.from(n);}eq(e){if(!(e instanceof oK)||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?oQ(n?t:t.sort(oY)):oV;}static from(e){switch(e.length){case 0:return oU;case 1:return e[0];default:return new oK(e.every(e=>e instanceof oW)?e:e.reduce((e,t)=>e.concat(t instanceof oW?t:t.members),[]));}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e);}}function oH(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 o$(i.from+t,i.to+t,i.type));}return n;}function oG(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,o;t<e.length;t++)(o=e[t])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[t]=null);return i;}function oJ(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t;}function oZ(e,t,n,r){let i=[],o=!1;t.forEach((t,s)=>{let a=oG(e,t,s+n);if(a){o=!0;let e=oZ(a,t,n+s+1,r);e!=oU&&i.push(s,s+t.nodeSize,e);}});let s=oH(o?oJ(e):e,-n).sort(oY);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||i.length?new oW(s,i):oU;}function oY(e,t){return e.from-t.from||e.to-t.to;}function oQ(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 o=t[i];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),oX(t,i+1,o.copy(r.to,o.to)));continue;}o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),oX(t,i,r.copy(o.from,r.to)));break;}}return t;}function oX(e,t,n){for(;t<e.length&&oY(n,e[t])>0;)t++;e.splice(t,0,n);}function o0(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=oU&&t.push(r);}),e.cursorWrapper&&t.push(oW.create(e.state.doc,[e.cursorWrapper.deco])),oK.from(t);}let o1={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},o2=r1&&r2<=11;class o3{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 o6{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new o3(),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]);r1&&r2<=11&&t.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():r9&&e.composing&&t.some(e=>"childList"==e.type&&"TR"==e.target.nodeName)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush();}),o2&&(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,o1)),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(iQ(this.view)){if(this.suppressingSelectionUpdates)return iW(this.view);if(r1&&r2<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&rz(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=rF(n))t.add(n);for(let r=e.anchorNode;r;r=rF(r))if(t.has(r)){n=r;break;}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:rW(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)&&iQ(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],l);t&&(o=o<0?t.from:Math.min(t.from,o),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(a=!0));}if(l.some(e=>"BR"==e.nodeName)&&(8==t.input.lastKeyCode||46==t.input.lastKeyCode||r5&&(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&&rq(t);){if("false"==t.contentEditable){e.parentNode.removeChild(e);break;}t=t.firstChild;}}}else if(r3&&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;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&rH(r)&&(c=iV(t))&&c.eq(rh.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,iW(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||i)&&(o>-1&&(t.docView.markDirty(o,s),e=t,!o5.has(e)&&(o5.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=r3,o4||(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."),o4=!0))),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,function(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let o of t)if((null==(n=o.parentNode)?void 0:n.nodeName)=="TR"){let t=o.nextSibling;for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.nextSibling;if(t){let n=t;for(;;){let e=n.firstChild;if(!e||!rq(e)||"false"==e.contentEditable||/^(BR|IMG)$/.test(e.nodeName))break;n=e;}n.insertBefore(o,n.firstChild),r==o&&e.domSelection().collapse(o,i);}else o.parentNode.removeChild(o);}}(t,l)),this.handleDOMChange(o,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||iW(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),rW(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(r1&&r2<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!o||0>Array.prototype.indexOf.call(e.addedNodes,o))&&(i=o);}let o=r&&r.parentNode==e.target?rI(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?rI(i):e.target.childNodes.length;return{from:s,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 o5=new WeakMap(),o4=!1;function o9(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return rz(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o};}let o8=/^(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 o7(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:iY(e,t.resolve(n.anchor),t.resolve(n.head));}function se(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 st{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 of(),this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ss),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=si(this),sr(this),this.nodeViews=so(this),this.docView=iA(this.state.doc,sn(this),o0(this),this.dom,this),this.domObserver=new o6(this,(e,t,n,r)=>function(e,t,n,r,i){var o,s,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=iV(e,t);if(n&&!e.state.selection.eq(n)){if(r5&&it&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,rG(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,y=function(e,t,n,r){let i,o,{node:s,fromOffset:a,toOffset:l,from:c,to:u}=e.docView.parseRange(t,n),d=e.domSelectionRange(),h=d.anchorNode;if(h&&rU(e.dom,h)&&(o=[{node:h,offset:d.anchorOffset}],rH(d)||o.push({node:d.focusNode,offset:d.focusOffset})),r5&&8===e.input.lastKeyCode)for(let e=l;e>a;e--){let t=s.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")||nE.fromSchema(e.state.schema),m=p.resolve(c),g=null,y=f.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:l,preserveWhitespace:"pre"!=m.parent.type.whitespace||"full",findPositions:o,ruleFromNode:(i=r,e=>{let t=e.pmViewDesc;if(t)return t.parseRule(i);if("BR"==e.nodeName&&e.parentNode){if(r9&&/^(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||r9&&/^(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(o&&null!=o[0].pos){let e=o[0].pos,t=o[1]&&o[1].pos;null==t&&(t=e),g={anchor:e+c,head:t+c};}return{doc:y,sel:g,from:c,to:u};}(e,t,n,i),v=e.state.doc,k=v.slice(y.from,y.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 o=e.findDiffStart(t,n),s=n+e.size,a=n+t.size;if(null==o)return null;let{a:l,b:c}=e.findDiffEnd(t,s,a);if("end"==i){let e=Math.max(0,o-Math.min(l,c));r-=l+e-o;}if(l<o&&s<a){let e=r<=o&&r>=l?o-r:0;o-=e,c=o+(c-l),l=o;}else if(c<o){let e=r<=o&&r>=c?o-r:0;o-=e,l=o+(l-c),c=o;}return{start:o,endA:l,endB:c};}(k.content,y.doc.content,y.from,u,d);if(b&&e.input.domChangeCount++,(r8&&e.input.lastIOSEnter>Date.now()-225||it)&&i.some(e=>rq(e)&&!o8.test(e.nodeName))&&(!b||b.endA>=b.endB)&&e.someProp("handleKeyDown",t=>t(e,rG(13,"Enter")))){e.input.lastIOSEnter=0;return;}if(!b)if(r&&g instanceof rg&&!g.empty&&g.$head.sameParent(g.$anchor)&&!e.composing&&!(y.sel&&y.sel.anchor!=y.sel.head))b={start:g.from,endA:g.to,endB:g.to};else{if(y.sel){let t=o7(e,e.state.doc,y.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 rg&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2&&e.state.selection.from>=y.from?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&e.state.selection.to<=y.to&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),r1&&r2<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>y.from&&" "==y.doc.textBetween(b.start-y.from-1,b.start-y.from+1)&&(b.start--,b.endA--,b.endB--);let x=y.doc.resolveNoCache(b.start-y.from),w=y.doc.resolveNoCache(b.endB-y.from),C=v.resolve(b.start),S=x.sameParent(w)&&x.parent.inlineContent&&C.end()>=b.endA;if((r8&&e.input.lastIOSEnter>Date.now()-225&&(!S||i.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!S&&(o=y.doc,s=x.pos,a=w.pos,l=0,c=0,o.nodesBetween(s,a,(e,t)=>{e.isTextblock&&t>=s&&t<a?l++:(e.isText?/\S/.test(e.text.slice(Math.max(0,s-t),Math.min(e.nodeSize,a-t))):e.isLeaf)&&c++;}),0==c&&1==l))&&e.someProp("handleKeyDown",t=>t(e,rG(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||se(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let e=o.nodeAfter;return null!=e&&n==t+e.nodeSize;}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(se(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||se(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content);}(v,b.start,b.endA,x,w)&&e.someProp("handleKeyDown",t=>t(e,rG(8,"Backspace")))){it&&r5&&e.domObserver.suppressSelectionUpdates();return;}r5&&b.endB==b.start&&(e.input.lastChromeDelete=Date.now()),it&&!S&&x.start()!=w.start()&&0==w.parentOffset&&x.depth==w.depth&&y.sel&&y.sel.anchor==y.sel.head&&y.sel.head==b.endA&&(b.endB-=2,w=y.doc.resolveNoCache(b.endB-y.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,rG(13,"Enter"));});},20));let D=b.start,_=b.endA,E=t=>{let n=t||e.state.tr.replace(D,_,y.doc.slice(b.start-y.from,b.endB-y.from));if(y.sel){let t=o7(e,n.doc,y.sel);t&&!(r5&&e.composing&&t.empty&&(b.start!=b.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==D||t.head==n.mapping.map(_)-1)||r1&&t.empty&&t.head==D)&&n.setSelection(t);}return p&&n.setMeta("composition",p),n.scrollIntoView();};if(S){if(x.pos==w.pos){r1&&r2<=11&&0==x.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>iW(e),20));let t=E(e.state.tr.delete(D,_)),n=v.resolve(b.start).marksAcross(v.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,o=r,s,a,l;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)o=n[e].removeFromSet(o);if(1==i.length&&0==o.length)a=i[0],s="add",l=e=>e.mark(a.addToSet(e.marks));else{if(0!=i.length||1!=o.length)return null;a=o[0],s="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(t1.from(c).eq(e))return{mark:a,type:s};}(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,_,h.mark):t.removeMark(D,_,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,_));e.someProp("handleTextInput",r=>r(e,D,_,t,n))||e.dispatch(n());}else e.dispatch(E());}else e.dispatch(E());}(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in od){let n=od[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!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;}(e,t)||oy(e,t)||!e.editable&&t.type in oh||n(e,t);},op[t]?{passive:!0}:void 0);}r9&&e.dom.addEventListener("input",()=>null),og(e);}(this),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&&og(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ss),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 o=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(oM(this),a=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=so(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,s=!0);}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&og(this),this.editable=si(this),sr(this);let c=o0(this),u=sn(this),d=o.plugins==e.plugins||o.doc.eq(e.doc)?e.scrollToSelection>o.scrollToSelection?"to selection":"preserve":"reset",h=s||!this.docView.matchesNode(e.doc,u,c);(h||!e.selection.eq(o.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 o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);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:ia(e.dom)};}(this);if(a){let t,n,a;this.domObserver.stop();let l=h&&(r1||r5)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&(r=o.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=r5?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(rW(e)&&t)return e;if(rq(e)&&t>0){if("false"==e.contentEditable)return null;t=rV(e=e.childNodes[t-1]);}else{if(!e.parentNode||rK(e))return null;t=rI(e),e=e.parentNode;}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(rW(e)&&t<e.nodeValue.length)return e;if(rq(e)&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0;}else{if(!e.parentNode||rK(e))return null;t=rI(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)),(s||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=iA(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(),rz(t.node,t.offset,n.anchorNode,n.anchorOffset))&&d.delaySelUpdate())?iW(this,l):(iJ(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start();}this.updatePluginViews(o),(null==(n=this.dragging)?void 0:n.node)&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),"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;il(n,0==r?0:r-t);}(p);}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&rU(this.dom,e))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof rv){let t=this.docView.domAfterPos(this.state.selection.from);rq(t)&&is(this,t.getBoundingClientRect(),e);}else is(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 oI(e.slice,e.move,r<0?void 0:rv.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 o=i[n].props[e];if(null!=o&&(r=t?t(o):o))return r;}}hasFocus(){if(r1){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(ic)return e.focus(ic);let t=ia(e);e.focus(null==ic?{get preventScroll(){return ic={preventScroll:!0},!0;}}:void 0),ic||(ic=!1,il(t,0));}(this.dom),iW(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,o=e.dom.ownerDocument,s,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(rV(r.offsetNode),r.offset)};}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(rV(r.startContainer),r.startOffset)};}}(o,t.left,t.top);l&&({node:s,offset:a}=l);let c=(e.root.elementFromPoint?e.root:o).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(c)){let n=e.dom.getBoundingClientRect();if(!iu(t,n)||!(c=function e(t,n,r){let i=t.childNodes.length;if(i&&r.top<r.bottom)for(let o=Math.max(0,Math.min(i-1,Math.floor(i*(n.top-r.top)/(r.bottom-r.top))-2)),s=o;;){let r=t.childNodes[s];if(rq(r)){let t=r.getClientRects();for(let i=0;i<t.length;i++){let o=t[i];if(iu(n,o))return e(r,n,o);}}if((s=(s+1)%i)==o)break;}return t;}(e.dom,t,n)))return null;}if(r9)for(let e=c;s&&e;e=rF(e))e.draggable&&(s=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(r3&&rq(s)&&(a=Math.min(a,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[a],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&a++;}ir&&a&&rq(s)&&rq(n=s.childNodes[a-1])&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&a--,s==e.dom&&a==s.childNodes.length-1&&rq(s.lastChild)&&t.top>s.lastChild.getBoundingClientRect().bottom?i=e.state.doc.content.size:0!=a&&rq(s)&&"BR"==s.childNodes[a-1].nodeName||(i=function(e,t,n,r){let i=-1;for(let n=t,o=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(rq(t.dom)&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!o&&s.left>r.left||s.top>r.top?i=t.posBefore:(!o&&s.right<r.left||s.bottom<r.top)&&(i=t.posAfter),o=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode;}return i>-1?i:e.docView.posFromDOM(t,n,-1);}(e,s,a,t));}null==i&&(i=function(e,t,n){let{node:r,offset:i}=function e(t,n){let r,i,o,s=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(rq(e))t=e.getClientRects();else{if(!rW(e))continue;t=rB(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<s){r=e,s=t,a=t&&rW(r)?{left:p.right<n.left?p.right:p.left,top:n.top}:n,rq(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,o={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=o,s=0),r&&rW(r))?function(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=ih(r,1);if(n.top!=n.bottom&&iu(t,n)){i={node:e,offset:o+ +(t.left>=(n.left+n.right)/2)};break;}}return r.detach(),i||{node:e,offset:0};}(r,a):!r||s?{node:t,offset:l}:e(r,a);}(t,n),o=-1;if(rq(r)&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1;}return e.docView.posFromDOM(r,i,o);}(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 im(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 ib==t&&ix==n?iw:(ib=t,ix=n,iw="up"==n||"down"==n?(r=t.selection,i="up"==n?r.$from:r.$to,iv(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=im(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(rq(e))t=e.getClientRects();else{if(!rW(e))continue;t=rB(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,o=i==r.parent.content.size,s=e.domSelection();return s?ik.test(r.parent.textContent)&&s.modify?iv(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:a}=e.domSelectionRange(),l=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),h=u&&!rU(c,u)||t==u&&i==d;try{s.collapse(o,a),t&&(t!=o||i!=a)&&s.extend&&s.extend(t,i);}catch(e){}return null!=l&&(s.caretBidiLevel=l),h;}):"left"==n||"backward"==n?!i:o:r.pos==r.start()||r.pos==r.end();}(e,t,n));}(this,t||this.state,e);}pasteHTML(e,t){return oO(this,"",e,!1,t||new ClipboardEvent("paste"));}pasteText(e,t){return oO(this,e,null,!0,t||new ClipboardEvent("paste"));}serializeForClipboard(e){return ot(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,[],o0(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,rL();}}get isDestroyed(){return null==this.docView;}dispatchEvent(e){!oy(this,e)&&od[e.type]&&(this.editable||!(e.type in oh))&&od[e.type](this,e);}domSelectionRange(){let e=!1!==this.dom.isConnected&&this.domSelection();return e?r9&&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 o9(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?o9(e,n):null;}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0};}domSelection(){return this.root.getSelection();}}function sn(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"),[o$.node(0,e.state.doc.content.size,t)];}function sr(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:o$.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})};}else e.cursorWrapper=null;}function si(e){return!e.someProp("editable",t=>!1===t(e.state));}function so(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 ss(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");}st.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e));};let sa=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function sl(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 sc(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 su(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 sd(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 sh=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof rb||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=sd(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(rg.create(s.doc,n+1)),t(s.scrollIntoView());}return!0;},sp=(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(n4(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0;}let r=n.blockRange(),i=r&&n2(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0);},sf=(e,t)=>{if(e.selection instanceof rv&&e.selection.node.isBlock){let{$from:n}=e.selection;return!!n.parentOffset&&!!n4(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 rg||e.selection instanceof rb)&&n.deleteSelection();let{$from:r}=n.selection,i=n.steps.length,o=[],s,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=sd(r.node(e-1).contentMatchAt(r.indexAfter(e-1)));o.unshift(t||(l&&a?{type:a}:null)),s=e;break;}if(1==e)return!1;o.unshift(null);}let u=r.pos,d=n4(n.doc,u,o.length,o);if(d||(o[0]=a?{type:a}:null,d=n4(n.doc,u,o.length,o)),!d)return!1;if(n.split(u,o.length,o),!l&&c&&r.node(s).type!=a){let e=n.mapping.slice(i),t=e.map(r.before(s)),o=n.doc.resolve(t);a&&r.node(s-1).canReplaceWith(o.index(),o.index()+1,a)&&n.setNodeMarkup(e.map(r.before(s)),a);}return t&&t(n.scrollIntoView()),!0;};function sm(e,t,n,r){let i,o,s,a=t.nodeBefore,l=t.nodeAfter,c,u,d=a.type.spec.isolating||l.type.spec.isolating;if(!d&&(i=t.nodeBefore,o=t.nodeAfter,s=t.index(),i&&o&&i.type.compatibleContent(o.type)&&(!i.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(o.isTextblock||n9(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=t1.empty;for(let e=c.length-1;e>=0;e--)i=t1.from(c[e].create(null,i));i=t1.from(a.copy(i));let o=e.tr.step(new nX(t.pos-1,r,t.pos,r,new t9(i,1,0),c.length,!0)),s=o.doc.resolve(r+2*c.length);s.nodeAfter&&s.nodeAfter.type==a.type&&n9(o.doc,s.pos)&&o.join(s.pos),n(o.scrollIntoView());}return!0;}let p=l.type.spec.isolating||r>0&&d?null:rh.findFrom(t,1),f=p&&p.$from.blockRange(p.$to),m=f&&n2(f);if(null!=m&&m>=t.depth)return n&&n(e.tr.lift(f,m).scrollIntoView()),!0;if(h&&sl(l,"start",!0)&&sl(a,"end")){let r=a,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=l,s=1;for(;!o.isTextblock;o=o.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=t1.empty;for(let e=i.length-1;e>=0;e--)r=t1.from(i[e].copy(r));n(e.tr.step(new nX(t.pos-i.length,t.pos+l.nodeSize,t.pos+s,t.pos+l.nodeSize-s,new t9(r,i.length,0),0,!0)).scrollIntoView());}return!0;}}return!1;}function sg(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--;}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(rg.create(t.doc,e<0?i.start(o):i.end(o)))),!0);};}let sy=sg(-1),sv=sg(1);function sk(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:o},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(o,s,(r,o)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(o),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:o},$to:{pos:s}}=n.selection.ranges[r];i.setBlockType(o,s,e,t);}r(i.scrollIntoView());}return!0;};}function sb(e,t=null,n){let r=!1!==(n&&n.removeWhenPresent),i=!1!==(n&&n.enterInlineAtoms),o=!(n&&n.includeWhitespace);return function(n,s){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:o,$to:s}=t[i],a=0==o.depth&&e.inlineContent&&e.type.allowsMarkType(n);if(e.nodesBetween(o.pos,s.pos,(e,t)=>{if(a||!r&&e.isAtom&&e.isInline&&t>=o.pos&&t+e.nodeSize<=s.pos)return!1;a=e.inlineContent&&e.type.allowsMarkType(n);}),a)return!0;}return!1;}(n.doc,c,e,i))return!1;if(s)if(l)s(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 rp(r,r.doc.resolve(n+1))),r=r.doc.resolve(n+1+e.content.size),!1;}),r.pos<i.pos&&t.push(new rp(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,o)=>{if(n)return!1;n=!e.isInSet(r.marks)&&!!o&&o.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,s=i.pos,a=r.nodeAfter,c=i.nodeBefore,u=o&&a&&a.isText?/^\s*/.exec(a.text)[0].length:0,d=o&&c&&c.isText?/\s*$/.exec(c.text)[0].length:0;n+u<s&&(n+=u,s-=d),l.addMark(n,s,e.create(t));}else l.removeMark(r.pos,i.pos,e);}s(l.scrollIntoView());}return!0;};}function sx(...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 sw=sx(sa,(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=sc(r);if(!i){let n=r.blockRange(),i=n&&n2(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0);}let o=i.nodeBefore;if(sm(e,i,t,-1))return!0;if(0==r.parent.content.size&&(sl(o,"end")||rv.isSelectable(o)))for(let n=r.depth;;n--){let s=n8(e.doc,r.before(n),r.after(n),t9.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(sl(o,"end")?rh.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):rv.create(n.doc,i.pos-o.nodeSize)),t(n.scrollIntoView());}return!0;}if(1==n||r.node(n-1).childCount>1)break;}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0);},(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=sc(r);}let s=o&&o.nodeBefore;return!!s&&!!rv.isSelectable(s)&&(t&&t(e.tr.setSelection(rv.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0);}),sC=sx(sa,(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=su(r);if(!i)return!1;let o=i.nodeAfter;if(sm(e,i,t,1))return!0;if(0==r.parent.content.size&&(sl(o,"start")||rv.isSelectable(o))){let n=n8(e.doc,r.before(),r.after(),t9.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(sl(o,"start")?rh.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):rv.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView());}return!0;}}return!!o.isAtom&&i.depth==r.depth-1&&(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0);},(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=su(r);}let s=o&&o.nodeAfter;return!!s&&!!rv.isSelectable(s)&&(t&&t(e.tr.setSelection(rv.create(e.doc,o.pos)).scrollIntoView()),!0);}),sS={Enter:sx((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);},sh,sp,sf),"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),o=n.indexAfter(-1),s=sd(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(rh.near(i.doc.resolve(r),1)),t(i.scrollIntoView());}return!0;},Backspace:sw,"Mod-Backspace":sw,"Shift-Backspace":sw,Delete:sC,"Mod-Delete":sC,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new rb(e.doc))),!0)},sD={"Ctrl-h":sS.Backspace,"Alt-Backspace":sS["Mod-Backspace"],"Ctrl-d":sS.Delete,"Ctrl-Alt-Backspace":sS["Mod-Delete"],"Alt-Delete":sS["Mod-Delete"],"Alt-d":sS["Mod-Delete"],"Ctrl-a":sy,"Ctrl-e":sv};for(let e in sS)sD[e]=sS[e];let s_=("u">typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"u">typeof os&&!!os.platform&&"darwin"==os.platform())?sD:sS;var sE=function(){};sE.prototype.append=function(e){return e.length?(e=sE.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this;},sE.prototype.prepend=function(e){return e.length?sE.from(e).append(this):this;},sE.prototype.appendInner=function(e){return new sM(this,e);},sE.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?sE.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t));},sE.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e);},sE.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);},sE.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;},sE.from=function(e){return e instanceof sE?e:e&&e.length?new sA(e):sE.empty;};var sA=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;}(sE);sE.empty=new sA([]);var sM=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;}(sE);class sN{constructor(e,t){this.items=e,this.eventCount=t;}popEvent(e,t){let n,r,i,o;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break;}t&&(r=(n=this.remapping(s,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(s,t+1)).maps.length),r--,c.push(e);return;}if(n){c.push(new sT(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 sT(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,o=new sN(this.items.slice(0,s).append(c.reverse().concat(l)),this.eventCount-1),!1;},this.items.length,0),{remaining:o,transform:a,selection:i};}addTransform(e,t,n,r){var i,o;let s,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]),o=new sT(e.mapping.maps[n],i,t),s;(s=u&&u.merge(o))&&(o=s,n?a.pop():c=c.slice(0,c.length-1)),a.push(o),t&&(l++,t=void 0),r||(u=o);}let d=l-n.depth;return d>sR&&(i=c,o=d,i.forEach((e,t)=>{if(e.selection&&0==o--)return s=t,!1;}),c=i.slice(s),l-=d),new sN(c.append(a),l);}remapping(e,t){let n=new nq();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 sN(this.items.append(e.map(e=>new sT(e))),this.eventCount);}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--;},r);let a=t;this.items.forEach(t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new sT(l,o,c));}else n.push(new sT(l));},r);let l=[];for(let e=t;e<o;e++)l.push(new sT(i.maps[e]));let c=new sN(this.items.slice(0,r).append(l).append(n),s);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((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l=new sT(s.invert(),e,a),c,u=r.length-1;(c=r.length&&r[u].merge(l))?r[u]=c:r.push(l);}}else o.map&&n--;},this.items.length,0),new sN(sE.from(r.reverse()),i);}}sN.empty=new sN(sE.empty,0);class sT{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 sT(t.getMap().invert(),t,this.selection);}}}class sO{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i;}}let sR=20;function sI(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 sF(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o);}return n;}let sj=!1,sB=null;function sL(e){let t=e.plugins;if(sB!=t){sj=!1,sB=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){sj=!0;break;}}return sj;}let sz=new rR("history"),sP=new rR("closeHistory");function s$(e,t){return(n,r)=>{let i=sz.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=sL(t),i=sz.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),l=new sO(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(sz,{redo:n,historyState:l});}(i,n,e);o&&r(t?o.scrollIntoView():o);}return!0;};}let sV=s$(!1,!0),sq=s$(!0,!0);s$(!1,!1),s$(!0,!1);class sW{constructor(e,t,n={}){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,n,r,i){let o=e;if(n[1]){let e=n[0].lastIndexOf(n[1]);o+=n[0].slice(e+n[1].length);let t=(r+=e)-i;t>0&&(o=n[0].slice(e-t,e)+o,r=i);}return t.tr.insertText(o,r,i);};}(t):t,this.undoable=!1!==n.undoable,this.inCode=n.inCode||!1,this.inCodeMark=!1!==n.inCodeMark;}}function sU(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,a=s.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(s.doc.nodesBetween(h,a.pos,t=>{t.isInline&&t.marks.some(e=>e.type.spec.code)&&(e=!0);}),e)continue;}let p=u.handler(s,d,h,n);if(p)return u.undoable&&p.setMeta(o,{transform:p,from:t,to:n,text:r}),e.dispatch(p),!0;}return!1;}let sK=(e,t)=>{let n=e.plugins;for(let r=0;r<n.length;r++){let i=n[r],o;if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let n=e.tr,r=o.transform;for(let e=r.steps.length-1;e>=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(o.text){let t=n.doc.resolve(o.from).marks();n.replaceWith(o.from,o.to,e.schema.text(o.text,t));}else n.delete(o.from,o.to);t(n);}return!0;}}return!1;};function sH(e,t,n=null,r){return new sW(e,(e,i,o,s)=>{let a=n instanceof Function?n(i):n,l=e.tr.delete(o,s),c=l.doc.resolve(o).blockRange(),u=c&&function(e,t,n=null,r=e){let i=function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let s=o.length?o[0]:t;return n.canReplaceWith(r,i,s)?o:null;}(e,t),o=i&&function(e,t){let{parent:n,startIndex:r,endIndex:i}=e,o=n.child(r),s=t.contentMatch.findWrapping(o.type);if(!s)return null;let a=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;a&&e<i;e++)a=a.matchType(n.child(e).type);return a&&a.validEnd?s:null;}(r,t);return o?i.map(n3).concat({type:t,attrs:n}).concat(o.map(n3)):null;}(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(o-1).nodeBefore;return d&&d.type==t&&n9(l.doc,o-1)&&(!r||r(i,d))&&l.join(o-1),l;});}new sW(/--$/,"—",{inCodeMark:!1}),new sW(/\.\.\.$/,"…",{inCodeMark:!1}),new sW(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new sW(/"$/,"”",{inCodeMark:!1}),new sW(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new sW(/'$/,"’",{inCodeMark:!1});for(var sG={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:"'"},sJ={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},sZ="u">typeof navigator&&/Mac/.test(navigator.platform),sY="u">typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),sQ=0;sQ<10;sQ++)sG[48+sQ]=sG[96+sQ]=String(sQ);for(var sQ=1;sQ<=24;sQ++)sG[sQ+111]="F"+sQ;for(var sQ=65;sQ<=90;sQ++)sG[sQ]=String.fromCharCode(sQ+32),sJ[sQ]=String.fromCharCode(sQ);for(var sX in sG)sJ.hasOwnProperty(sX)||(sJ[sX]=sG[sX]);let s0="u">typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),s1="u">typeof navigator&&/Win/.test(navigator.platform);function s2(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 s3(e){let t;return new rN({props:{handleKeyDown:(t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let e=0;e<o.length-1;e++){let s=o[e];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))s0?i=!0:n=!0;else throw Error("Unrecognized modifier name: "+s);}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s;}(n)]=e[n];return t;}(e),function(e,n){var r;let i=("Esc"==(r=!(sZ&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||sY&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?sJ:sG)[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),o,s=t[s2(i,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[s2(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0;}if((n.altKey||n.metaKey||n.ctrlKey)&&!(s1&&n.ctrlKey&&n.altKey)&&(o=sG[n.keyCode])&&o!=i){let r=t[s2(o,n)];if(r&&r(e.state,e.dispatch,e))return!0;}}return!1;})}});}function s6(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new nX(o-1,s,o,s,new t9(t1.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new nl(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));let a=n2(r);if(null==a)return!1;i.lift(r,a);let l=i.doc.resolve(i.mapping.map(o,-1)-1);return n9(i.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&i.join(l.pos),t(i.scrollIntoView()),!0;}(t,n,e,o):function(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,o=n.startIndex;t>o;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+ +!a,u+1,s.content.append(l?t1.empty:t1.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new nX(d-!!a,h+ +!!l,d+1,h-1,new t9((a?t1.empty:t1.from(i.copy(t1.empty))).append(l?t1.empty:t1.from(i.copy(t1.empty))),+!a,+!l),+!a)),t(r.scrollIntoView()),!0;}(t,n,o)));};}let s5={};function s4(e,t){"string"!=typeof t&&(t=s4.defaultChars);let n=function(e){let t=s5[e];if(t)return t;t=s5[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 o=parseInt(e.slice(r+1,r+3),16);if(o<128){t+=n[o];continue;}if((224&o)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((192&n)==128){let e=o<<6&1984|63&n;e<128?t+="��":t+=String.fromCharCode(e),r+=3;continue;}}if((240&o)==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=o<<12&61440|n<<6&4032|63&i;e<2048||e>=55296&&e<=57343?t+="���":t+=String.fromCharCode(e),r+=6;continue;}}if((248&o)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),s=parseInt(e.slice(r+10,r+12),16);if((192&n)==128&&(192&i)==128&&(192&s)==128){let e=o<<18&1835008|n<<12&258048|i<<6&4032|63&s;e<65536||e>1114111?t+="����":(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(1023&e))),r+=9;continue;}}t+="�";}return t;});}s4.defaultChars=";/?:@&=+$,#",s4.componentChars="";let s9={};function s8(e,t,n){"string"!=typeof t&&(n=t,t=s8.defaultChars),void 0===n&&(n=!0);let r=function(e){let t=s9[e];if(t)return t;t=s9[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,o=e.length;t<o;t++){let s=e.charCodeAt(t);if(n&&37===s&&t+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue;}if(s<128){i+=r[s];continue;}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&t+1<o){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 s7(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 ae(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null;}s8.defaultChars=";/?:@&=+$,-_.!~*'()#",s8.componentChars="-_.!~*'()";let at=/^([a-z0-9.+-]+:)/i,an=/:[0-9]*$/,ar=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ai=["%","/","?",";","#"].concat(["'"].concat(["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n"," "]))),ao=["/","?","#"],as=/^[+a-z0-9A-Z_-]{0,63}$/,aa=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,al={javascript:!0,"javascript:":!0},ac={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};ae.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&1===e.split("#").length){let e=ar.exec(o);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this;}let s=at.exec(o);if(s&&(n=(s=s[0]).toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i="//"===o.substr(0,2))&&!(s&&al[s])&&(o=o.substr(2),this.slashes=!0),!al[s]&&(i||s&&!ac[s])){let e,t,n=-1;for(let e=0;e<ao.length;e++)-1!==(r=o.indexOf(ao[e]))&&(-1===n||r<n)&&(n=r);-1!==(t=-1===n?o.lastIndexOf("@"):o.lastIndexOf("@",n))&&(e=o.slice(0,t),o=o.slice(t+1),this.auth=e),n=-1;for(let e=0;e<ai.length;e++)-1!==(r=o.indexOf(ai[e]))&&(-1===n||r<n)&&(n=r);-1===n&&(n=o.length),":"===o[n-1]&&n--;let i=o.slice(0,n);o=o.slice(n),this.parseHost(i),this.hostname=this.hostname||"";let s="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!s){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(as)){let r="";for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+="x":r+=n[e];if(!r.match(as)){let r=e.slice(0,t),i=e.slice(t+1),s=n.match(aa);s&&(r.push(s[1]),i.unshift(s[2])),i.length&&(o=i.join(".")+o),this.hostname=r.join(".");break;}}}}this.hostname.length>255&&(this.hostname=""),s&&(this.hostname=this.hostname.substr(1,this.hostname.length-2));}let a=o.indexOf("#");-1!==a&&(this.hash=o.substr(a),o=o.slice(0,a));let l=o.indexOf("?");return-1!==l&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),ac[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this;},ae.prototype.parseHost=function(e){let t=an.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e);};let au=function(e,t){if(e&&e instanceof ae)return e;let n=new ae();return n.parse(e,t),n;};e.s([],56918),e.i(56918),e.s(["decode",0,s4,"encode",0,s8,"format",0,s7,"parse",0,au],65555);var ad=e.i(65555);let ah=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ap=/[\0-\x1F\x7F-\x9F]/,af=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\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]/,am=/[\$\+<->\^`\|~\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]/,ag=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;e.s([],81911),e.i(81911),e.s(["Any",0,ah,"Cc",0,ap,"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,af,"S",0,am,"Z",0,ag],7055);var ay=e.i(7055);let av=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୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢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;怳Ādpuct;戏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ǣጓ\0y;䐎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Ā;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀ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Ā;elƀ;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\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»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ↄⅪ←ٖ↛ǰ↉\0proø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;䅓Ācrir;榿;쀀𝔬ͯ\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\0m;櫳;櫽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))),ak=new Uint16Array("Ȁaglq \x15\x18\x1bɭ\x0f\0\0\x12p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0))),ab=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]]),ax=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 aw(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 aC{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(!aw(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(!aw(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=ab.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 o=e.charCodeAt(t);if(this.treeIndex=function(e,t,n,r){let i=(t&c.BRANCH_LENGTH)>>7,o=t&c.JUMP_TABLE;if(0===i)return 0!==o&&r===o?n:-1;if(o){let t=r-o;return t<0||t>=i?-1:e[n+t]-1;}let s=n,a=s+i-1;for(;s<=a;){let t=s+a>>>1,n=e[t];if(n<r)s=t+1;else{if(!(n>r))return e[t+i];a=t-1;}}return-1;}(n,r,this.treeIndex+Math.max(1,i),o),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||aw(t);}(o))?0:this.emitNotTerminatedNamedEntity();if(0!=(i=((r=n[this.treeIndex])&c.VALUE_LENGTH)>>14)){if(o===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 aS(e){let t="",n=new aC(e,e=>t+=ax(e));return function(e,r){let i=0,o=0;for(;(o=e.indexOf("&",o))>=0;){t+=e.slice(i,o),n.startEntity(r);let s=n.write(e,o+1);if(s<0){i=o+n.end();break;}i=o+s,o=0===s?i+1:i;}let s=t+e.slice(i);return t="",s;};}let aD=aS(av);aS(ak);let a_=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);function aE(e,t){return function(n){let r,i=0,o="";for(;r=e.exec(n);)i!==r.index&&(o+=n.substring(i,r.index)),o+=t.get(r[0].charCodeAt(0)),i=r.index+1;return o+n.substring(i);};}String.prototype.codePointAt,aE(/[&<>'"]/g,a_),aE(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),aE(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),(o=h||(h={}))[o.XML=0]="XML",o[o.HTML=1]="HTML",(s=p||(p={}))[s.UTF8=0]="UTF8",s[s.ASCII=1]="ASCII",s[s.Extensive=2]="Extensive",s[s.Attribute=3]="Attribute",s[s.Text=4]="Text";let aA=Object.prototype.hasOwnProperty;function aM(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 aN(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 aT(e){return e>65535?String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e)):String.fromCharCode(e);}let aO=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,aR=RegExp(aO.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),aI=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function aF(e){return 0>e.indexOf("\\")&&0>e.indexOf("&")?e:e.replace(aR,function(e,t,n){if(t)return t;if(35===n.charCodeAt(0)&&aI.test(n)){let t="x"===n[1].toLowerCase()?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return aN(t)?aT(t):e;}let r=function(e,t=d.Legacy){return aD(e,t);}(e);return r!==e?r:e;});}let aj=/[&<>"]/,aB=/[&<>"]/g,aL={"&":"&","<":"<",">":">",'"':"""};function az(e){return aL[e];}function aP(e){return aj.test(e)?e.replace(aB,az):e;}let a$=/[.?*+^$[\]\\(){}|-]/g;function aV(e){switch(e){case 9:case 32:return!0;}return!1;}function aq(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 aW(e){return af.test(e)||am.test(e);}function aU(e){return aW(aT(e));}function aK(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 aH(e){return(e=e.trim().replace(/\s+/g," ")).toLowerCase().toUpperCase();}function aG(e){return 32===e||9===e||10===e||13===e;}function aJ(e){let t=0;for(;t<e.length&&aG(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&aG(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,aJ,"assign",0,aM,"escapeHtml",0,aP,"escapeRE",0,function(e){return e.replace(a$,"\\$&");},"fromCodePoint",0,aT,"has",0,function(e,t){return aA.call(e,t);},"isMdAsciiPunct",0,aK,"isPunctChar",0,aW,"isPunctCharCode",0,aU,"isSpace",0,aV,"isString",0,function(e){return"[object String]"===Object.prototype.toString.call(e);},"isValidEntityCode",0,aN,"isWhiteSpace",0,aq,"lib",0,{mdurl:ad,ucmicro:ay},"normalizeReference",0,aH,"unescapeAll",0,aF,"unescapeMd",0,function(e){return 0>e.indexOf("\\")?e:e.replace(aO,"$1");}],37422);var aZ=e.i(37422);e.s([],50919),e.i(50919),e.s(["parseLinkDestination",0,function(e,t,n){let r,i=t,o={ok:!1,pos:0,str:""};if(60===e.charCodeAt(i)){for(i++;i<n&&10!==(r=e.charCodeAt(i))&&60!==r;){if(62===r){o.pos=i+1,o.str=aF(e.slice(t+1,i)),o.ok=!0;break;}if(92===r&&i+1<n){i+=2;continue;}i++;}return o;}let s=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&&++s>32)return o;if(41===r){if(0===s)break;s--;}i++;}return t===i||0!==s||(o.str=aF(e.slice(t,i)),o.pos=i,o.ok=!0),o;},"parseLinkLabel",0,function(e,t,n){let r,i,o,s,a=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos<a;){if(93===(o=e.src.charCodeAt(e.pos))&&0==--r){i=!0;break;}if(s=e.pos,e.md.inline.skipToken(e),91===o){if(s===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,o=t,s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let r=e.charCodeAt(o);if(34!==r&&39!==r&&40!==r)return s;t++,o++,40===r&&(r=41),s.marker=r;}for(;o<n;){if((i=e.charCodeAt(o))===s.marker)return s.pos=o+1,s.str+=aF(e.slice(t,o)),s.ok=!0,s;if(40===i&&41===s.marker)return s;92===i&&o+1<n&&o++,o++;}return s.can_continue=!0,s.str+=aF(e.slice(t,o)),s;}],39414);var aY=e.i(39414);let aQ={};function aX(){this.rules=aM({},aQ);}function a0(){this.__rules__=[],this.__cache__=null;}function a1(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 a2(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t;}aQ.code_inline=function(e,t,n,r,i){let o=e[t];return"<code"+i.renderAttrs(o)+">"+aP(o.content)+"</code>";},aQ.code_block=function(e,t,n,r,i){let o=e[t];return"<pre"+i.renderAttrs(o)+"><code>"+aP(e[t].content)+"</code></pre>\n";},aQ.fence=function(e,t,n,r,i){let o,s=e[t],a=s.info?aF(s.info).trim():"",l="",c="";if(a){let e=a.split(/(\s+)/g);l=e[0],c=e.slice(2).join("");}if(0===(o=n.highlight&&n.highlight(s.content,l,c)||aP(s.content)).indexOf("<pre"))return o+"\n";if(a){let e=s.attrIndex("class"),t=s.attrs?s.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})}>${o}</code></pre>
|
|
2
|
-
`;}return`<pre><code${i.renderAttrs(s)}>${o}</code></pre>
|
|
3
|
-
`;},aQ.image=function(e,t,n,r,i){let o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n);},aQ.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n";},aQ.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n";},aQ.text=function(e,t){return aP(e[t].content);},aQ.html_block=function(e,t){return e[t].content;},aQ.html_inline=function(e,t){return e[t].content;},aX.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return"";for(t=0,r="",n=e.attrs.length;t<n;t++)r+=" "+aP(e.attrs[t][0])+'="'+aP(e.attrs[t][1])+'"';return r;},aX.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 o=!1;if(r.block&&(o=!0,1===r.nesting&&t+1<e.length)){let n=e[t+1];"inline"===n.type||n.hidden?o=!1:-1===n.nesting&&n.tag===r.tag&&(o=!1);}return i+(o?">\n":">");},aX.prototype.renderInline=function(e,t,n){let r="",i=this.rules;for(let o=0,s=e.length;o<s;o++){let s=e[o].type;void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t);}return r;},aX.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,o=e.length;i<o;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;},aX.prototype.render=function(e,t,n){let r="",i=this.rules;for(let o=0,s=e.length;o<s;o++){let s=e[o].type;"inline"===s?r+=this.renderInline(e[o].children,t,n):void 0!==i[s]?r+=i[s](e,o,t,n,this):r+=this.renderToken(e,o,t,n);}return r;},a0.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1;},a0.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);});});},a0.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;},a0.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;},a0.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;},a0.prototype.push=function(e,t,n){this.__rules__.push({name:e,enabled:!0,fn:t,alt:(n||{}).alt||[]}),this.__cache__=null;},a0.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;},a0.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1;}),this.enable(e,t);},a0.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;},a0.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[];},a1.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;},a1.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e];},a1.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r;},a1.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n;},a1.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;},a2.prototype.Token=a1;let a3=/\r\n?|\n/g,a6=/\0/g,a5=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,a4=/\((c|tm|r)\)/i,a9=/\((c|tm|r)\)/ig,a8={c:"©",r:"®",tm:"™"};function a7(e,t){return a8[t.toLowerCase()];}let le=/['"]/,lt=/['"]/g;function ln(e,t,n){for(;e.length>n;){let n=e.pop();n.isSingleQuote?t.single=n.prevSameQuoteIdx:t.double=n.prevSameQuoteIdx;}}function lr(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r});}let li=[["normalize",function(e){let t;t=(t=e.src.replace(a3,"\n")).replace(a6,"�"),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,o=t.length;i<o;i++){if("inline"!==t[i].type||!e.md.linkify.pretest(t[i].content))continue;let o=t[i].children,s=[],a=0;for(let t=o.length-1;t>=0;t--){let i=o[t];if("link_close"===i.type){for(t--;o[t].level!==i.level&&"link_open"!==o[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"===o[t-1].type&&(r=r.slice(1));for(let t=0;t<r.length;t++){let i=r[t].url,o=e.md.normalizeLink(i);if(!e.md.validateLink(o))continue;let s=r[t].text;s=r[t].schema?"mailto:"!==r[t].schema||/^mailto:/i.test(s)?e.md.normalizeLinkText(s):e.md.normalizeLinkText("mailto:"+s).replace(/^mailto:/,""):e.md.normalizeLinkText("http://"+s).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",o]],d.level=l++,d.markup="linkify",d.info="auto",a.push(d);let h=new e.Token("text","",0);h.content=s,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);}s.push({index:t,nodes:a});}}if(s.length>0){let e=o.length;for(let t of s)e+=t.nodes.length-1;let n=Array(e),r=0,a=0;s.reverse();for(let e=0;e<o.length;e++){let t=s[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++]=o[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&&(a4.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(a9,a7)),"link_open"===r.type&&"auto"===r.info&&t--,"link_close"===r.type&&"auto"===r.info&&t++;}}(e.tokens[t].children),a5.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&&a5.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&&le.test(e.tokens[t].content)&&function(e,t){let n,r=[],i={single:-1,double:-1},o={};for(let s=0;s<e.length;s++){let a=e[s],l=e[s].level;for(n=r.length-1;n>=0&&!(r[n].level<=l);n--);if(ln(r,i,n+1),"text"!==a.type)continue;let c=a.content,u=0,d=c.length;for(;u<d;){lt.lastIndex=u;let a=lt.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=s-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=s+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 y=aK(m)||aU(m),v=aK(g)||aU(g),k=aq(m),b=aq(g);if(b?h=!1:v&&!(k||y)&&(h=!1),k?p=!1:y&&!(b||v)&&(p=!1),34===g&&'"'===a[0]&&m>=48&&m<=57&&(p=h=!1),h&&p&&(h=y,p=v),!h&&!p){f&&lr(o,s,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]),lr(o,s,a.index,l),lr(o,c.tokenIdx,c.contentPos,e),ln(r,i,n);continue;}if(h){if(r.length>=1e3)return;r.push({tokenIdx:s,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&&lr(o,s,a.index,"’");}}Object.keys(o).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 o=t[i];n+=e.slice(r,o.pos)+o.ch,r=o.pos+1;}return n+e.slice(r);}(e[t].content,o[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,o=i.length;for(t=0;t<o;t++)"text_special"===i[t].type&&(i[t].type="text");for(t=n=0;t<o;t++)"text"===i[t].type&&t+1<o&&"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 lo(){this.ruler=new a0();for(let e=0;e<li.length;e++)this.ruler.push(li[e][0],li[e][1]);}function ls(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,o=i.length,s=!1;t<o;t++){let a=i.charCodeAt(t);if(!s)if(aV(a)){n++,9===a?r+=4-r%4:r++;continue;}else s=!0;(10===a||t===o-1)&&(10!==a&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),s=!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 la(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r);}function ll(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),o=!1,s=0,a="";for(;r<n;)124===i&&(o?(a+=e.substring(s,r-1),s=r):(t.push(a+e.substring(s,r)),a="",s=r+1)),o=92===i,r++,i=e.charCodeAt(r);return t.push(a+e.substring(s)),t;}function lc(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&&!aV(e.src.charCodeAt(r))?-1:r;}function lu(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if((o=e.src.charCodeAt(i++))>=48&&o<=57){if(i-n>=10)return-1;continue;}if(41===o||46===o)break;return-1;}return i<r&&!aV(o=e.src.charCodeAt(i))?-1:i;}lo.prototype.process=function(e){let t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e);},lo.prototype.State=a2,ls.prototype.push=function(e,t,n){let r=new a1(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r;},ls.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e];},ls.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e;},ls.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&aV(this.src.charCodeAt(e));e++);return e;},ls.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!aV(this.src.charCodeAt(--e)))return e+1;return e;},ls.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e;},ls.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;},ls.prototype.getLines=function(e,t,n,r){if(e>=t)return"";let i=Array(t-e);for(let o=0,s=e;s<t;s++,o++){let e,a=0,l=this.bMarks[s],c=l;for(e=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];c<e&&a<n;){let e=this.src.charCodeAt(c);if(aV(e))9===e?a+=4-(a+this.bsCount[s])%4:a++;else if(c-l<this.tShift[s])a++;else break;c++;}a>n?i[o]=Array(a-n+1).join(" ")+this.src.slice(c,e):i[o]=this.src.slice(c,e);}return i.join("");},ls.prototype.Token=a1;let ld="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",lh="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",lp=RegExp("^(?:"+ld+"|"+lh+"|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),lf=RegExp("^(?:"+ld+"|"+lh+")"),lm=[[/^<(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(lf.source+"\\s*$"),/^$/,!1]],lg=[["table",function(e,t,n,r){let i;if(t+2>n)return!1;let o=t+1;if(e.sCount[o]<e.blkIndent||e.sCount[o]-e.blkIndent>=4)return!1;let s=e.bMarks[o]+e.tShift[o];if(s>=e.eMarks[o])return!1;let a=e.src.charCodeAt(s++);if(124!==a&&45!==a&&58!==a||s>=e.eMarks[o])return!1;let l=e.src.charCodeAt(s++);if(124!==l&&45!==l&&58!==l&&!aV(l)||45===a&&aV(l))return!1;for(;s<e.eMarks[o];){let t=e.src.charCodeAt(s);if(124!==t&&45!==t&&58!==t&&!aV(t))return!1;s++;}let c=la(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=la(e,t).trim()).indexOf("|")||e.sCount[t]-e.blkIndent>=4)return!1;(u=ll(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 y=0;for(o=t+2;o<n&&!(e.sCount[o]<e.blkIndent);o++){let r=!1;for(let t=0,i=f.length;t<i;t++)if(f[t](e,o,n,!0)){r=!0;break;}if(r||!(c=la(e,o).trim())||e.sCount[o]-e.blkIndent>=4||((u=ll(c)).length&&""===u[0]&&u.shift(),u.length&&""===u[u.length-1]&&u.pop(),(y+=h-u.length)>65536))break;o===t+2&&(e.push("tbody_open","tbody",1).map=i=[t+2,0]),e.push("tr_open","tr",1).map=[o,o+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]=o),e.push("table_close","table",-1),g[1]=o,e.parentType=p,e.line=o,!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 o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0;}],["fence",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;let s=e.src.charCodeAt(i);if(126!==s&&96!==s)return!1;let a=i,l=(i=e.skipChars(i,s))-a;if(l<3)return!1;let c=e.src.slice(a,i),u=e.src.slice(i,o);if(96===s&&u.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let d=t,h=!1;for(;!(++d>=n)&&(!((i=a=e.bMarks[d]+e.tShift[d])<(o=e.eMarks[d]))||!(e.sCount[d]<e.blkIndent));){;if(!(e.src.charCodeAt(i)!==s||e.sCount[d]-e.blkIndent>=4||(i=e.skipChars(i,s))-a<l)&&!((i=e.skipSpaces(i))<o)){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,o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||62!==e.src.charCodeAt(o))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((o=e.bMarks[i]+e.tShift[i])>=(s=e.eMarks[i]))break;if(62===e.src.charCodeAt(o++)&&!t){let t,n,r=e.sCount[i]+1;32===e.src.charCodeAt(o)?(o++,r++,n=!1,t=!0):9===e.src.charCodeAt(o)?(t=!0,(e.bsCount[i]+r)%4==3?(o++,r++,n=!1):n=!0):t=!1;let a=r;for(l.push(e.bMarks[i]),e.bMarks[i]=o;o<s;){let t=e.src.charCodeAt(o);if(aV(t))9===t?a+=4-(a+e.bsCount[i]+ +!!n)%4:a++;else break;o++;}f=o>=s,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]=o-e.bMarks[i];continue;}if(f)break;let r=!1;for(let t=0,o=h.length;t<o;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 y=[t,0];g.map=y,e.md.block.tokenize(e,t,i),e.push("blockquote_close","blockquote",-1).markup=">",e.lineMax=a,e.parentType=p,y[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 o=e.bMarks[t]+e.tShift[t],s=e.src.charCodeAt(o++);if(42!==s&&45!==s&&95!==s)return!1;let a=1;for(;o<i;){let t=e.src.charCodeAt(o++);if(t!==s&&!aV(t))return!1;t===s&&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(s)),!0;},["paragraph","reference","blockquote","list"]],["list",function(e,t,n,r){let i,o,s,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=lu(e,d))>=0){if(l=!0,s=e.bMarks[d]+e.tShift[d],c=Number(e.src.slice(s,u-1)),p&&1!==c)return!1;}else{if(!((u=lc(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 y=!1,v=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";d<n;){let t;o=u,i=e.eMarks[d];let r=e.sCount[d]+u-(e.bMarks[d]+e.tShift[d]),c=r;for(;o<i;){let t=e.src.charCodeAt(o);if(9===t)c+=4-(c+e.bsCount[d])%4;else if(32===t)c++;else break;o++;}let p=o;(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(s,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||y)&&(h=!1),y=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=v.length;t<r;t++)if(v[t](e,d,n,!0)){C=!0;break;}if(C)break;if(l){if((u=lu(e,d))<0)break;s=e.bMarks[d]+e.tShift[d];}else if((u=lc(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,o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||91!==e.src.charCodeAt(o))return!1;function l(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;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 o=!1;for(let i=0,s=r.length;i<s;i++)if(r[i](e,t,n,!0)){o=!0;break;}if(e.parentType=i,o)return null;}let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(i,o+1);}let c=e.src.slice(o,s+1);s=c.length;let u=-1;for(o=1;o<s;o++){let e=c.charCodeAt(o);if(91===e)return!1;if(93===e){u=o;break;}if(10===e){let e=l(a);null!==e&&(c+=e,s=c.length,a++);}else if(92===e&&++o<s&&10===c.charCodeAt(o)){let e=l(a);null!==e&&(c+=e,s=c.length,a++);}}if(u<0||58!==c.charCodeAt(u+1))return!1;for(o=u+2;o<s;o++){let e=c.charCodeAt(o);if(10===e){let e=l(a);null!==e&&(c+=e,s=c.length,a++);}else if(aV(e));else break;}let d=e.md.helpers.parseLinkDestination(c,o,s);if(!d.ok)return!1;let h=e.md.normalizeLink(d.str);if(!e.md.validateLink(h))return!1;let p=o=d.pos,f=a,m=o;for(;o<s;o++){let e=c.charCodeAt(o);if(10===e){let e=l(a);null!==e&&(c+=e,s=c.length,a++);}else if(aV(e));else break;}let g=e.md.helpers.parseLinkTitle(c,o,s);for(;g.can_continue;){let t=l(a);if(null===t)break;c+=t,o=s,s=c.length,a++,g=e.md.helpers.parseLinkTitle(c,o,s,g);}for(o<s&&m!==o&&g.ok?(i=g.str,o=g.pos):(i="",o=p,a=f);o<s&&aV(c.charCodeAt(o));)o++;if(o<s&&10!==c.charCodeAt(o)&&i)for(i="",o=p,a=f;o<s&&aV(c.charCodeAt(o));)o++;if(o<s&&10!==c.charCodeAt(o))return!1;let y=aH(c.slice(1,u));return!!y&&(!!r||(void 0===e.env.references&&(e.env.references={}),void 0===e.env.references[y]&&(e.env.references[y]={title:i,href:h}),e.line=a,!0));}],["html_block",function(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||60!==e.src.charCodeAt(i))return!1;let s=e.src.slice(i,o),a=0;for(;a<lm.length&&!lm[a][0].test(s);a++);if(a===lm.length)return!1;if(r)return lm[a][2];let l=t+1,c=lm[a][1].test("");if(!lm[a][1].test(s)){for(;l<n&&(!(e.sCount[l]<e.blkIndent)||!c&&e.isEmpty(l));l++)if(i=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],s=e.src.slice(i,o),lm[a][1].test(s)){0!==s.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],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(i);if(35!==s||i>=o)return!1;let a=1;for(s=e.src.charCodeAt(++i);35===s&&i<o&&a<=6;)a++,s=e.src.charCodeAt(++i);if(a>6||i<o&&!aV(s))return!1;if(r)return!0;o=e.skipSpacesBack(o,i);let l=e.skipCharsBack(o,35,i);l>i&&aV(e.src.charCodeAt(l-1))&&(o=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=aJ(e.src.slice(i,o)),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 o=e.parentType;e.parentType="paragraph";let s=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)){s=61===r?1:2;break;}}if(e.sCount[a]<0)continue;let t=!1;for(let r=0,o=i.length;r<o;r++)if(i[r](e,a,n,!0)){t=!0;break;}if(t)break;}if(!s)return e.parentType=o,!1;let l=aJ(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;let c=e.push("heading_open","h"+String(s),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(s),-1).markup=String.fromCharCode(r),e.parentType=o,!0;}],["paragraph",function(e,t,n){let r=e.md.block.ruler.getRules("paragraph"),i=e.parentType,o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let t=!1;for(let i=0,s=r.length;i<s;i++)if(r[i](e,o,n,!0)){t=!0;break;}if(t)break;}let s=aJ(e.getLines(t,o,e.blkIndent,!1));e.line=o,e.push("paragraph_open","p",1).map=[t,e.line];let a=e.push("inline","",0);return a.content=s,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0;}]];function ly(){this.ruler=new a0();for(let e=0;e<lg.length;e++)this.ruler.push(lg[e][0],lg[e][1],{alt:(lg[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.linkLevel=0;}ly.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(""),i=r.length,o=e.md.options.maxNesting,s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n)&&!(e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break;}let t=e.line,l=!1;for(let o=0;o<i;o++)if(l=r[o](e,s,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),(s=e.line)<n&&e.isEmpty(s)&&(a=!0,e.line=++s);}},ly.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);},ly.prototype.State=ls,lv.prototype.pushPending=function(){let e=new a1("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 a1(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 o=e;for(;o<r&&this.src.charCodeAt(o)===i;)o++;let s=o-e,a=o<r?this.src.charCodeAt(o):32;if((64512&a)==55296){let e=this.src.charCodeAt(o+1);a=(64512&e)==56320?65536+(a-55296<<10)+(e-56320):65533;}else(64512&a)==56320&&(a=65533);let l=aK(n)||aU(n),c=aK(a)||aU(a),u=aq(n),d=aq(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:s};},lv.prototype.Token=a1;let lk=[];for(let e=0;e<256;e++)lk.push(0);function lb(e,t){let n,r=[],i=t.length;for(let o=0;o<i;o++){let i=t[o];if(126!==i.marker||-1===i.end)continue;let s=t[i.end];(n=e.tokens[i.token]).type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",(n=e.tokens[s.token]).type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="","text"===e.tokens[s.token-1].type&&"~"===e.tokens[s.token-1].content&&r.push(s.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){lk[e.charCodeAt(0)]=1;});function lx(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],o=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,s=String.fromCharCode(n.marker),a=e.tokens[n.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?s+s:s,a.content="";let l=e.tokens[i.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?s+s:s,l.content="",o&&(e.tokens[t[r-1].token].content="",e.tokens[t[n.end+1].token].content="",r--);}}let lw=/^([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])?)*)$/,lC=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/,lS=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,lD=/^&([a-z][a-z0-9]{1,31});/i;function l_(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,o=[];for(let s=0;s<n;s++){let n=e[s];if(o.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=s),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-o[r]-1,c=l;for(;l>a;l-=o[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?o[l-1]+1:0;o[s]=s-l+r,o[l]=r,n.open=!1,t.end=s,t.close=!1,c=-1,i=-2;break;}}}-1!==c&&(t[n.marker][3*!!n.open+(n.length||0)%3]=c);}}let lE=[["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 o=i-Math.min(10,e.pending.length,i),s=i;for(;s>o&&((n=e.src.charCodeAt(s-1))>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||43===n||45===n||46===n);)s--;if(s===i||!((r=e.src.charCodeAt(s))>=65&&r<=90||r>=97&&r<=122))return!1;let a=i-s,l=e.md.linkify.matchAtStart(e.src.slice(s));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&&aV(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&&aV(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 o=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(o+=e.src[n+1],n++);}let s="\\"+o;if(!t){let t=e.push("text_special","",0);i<256&&0!==lk[i]?t.content=o:t.content=s,t.markup=s,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 o=e.posMax;for(;r<o&&96===e.src.charCodeAt(r);)r++;let s=e.src.slice(i,r),a=s.length;if(e.backticksScanned&&(e.backticks[a]||0)<=i)return t||(e.pending+=s),e.pos+=a,!0;let l=r;for(;-1!==(n=e.src.indexOf("`",l));){for(l=n+1;l<o&&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=s,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+=s),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),o=i.length,s=String.fromCharCode(r);if(o<2)return!1;o%2&&(e.push("text","",0).content=s,o--);for(let t=0;t<o;t+=2)e.push("text","",0).content=s+s,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,o,s="",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&&(aV(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(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?f=i.pos:s="",l=f;f<d&&(aV(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&&(aV(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)),!(o=e.env.references[aH(r)]))return e.pos=u,!1;s=o.href,a=o.title;}if(!t){e.pos=h,e.posMax=p;let t=e.push("link_open","a",1),n=[["href",s]];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,o,s,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((o=f+1)<h&&40===e.src.charCodeAt(o)){for(o++;o<h&&(aV(n=e.src.charCodeAt(o))||10===n);o++);if(o>=h)return!1;for(c=o,(a=e.md.helpers.parseLinkDestination(e.src,o,e.posMax)).ok&&(u=e.md.normalizeLink(a.str),e.md.validateLink(u)?o=a.pos:u=""),c=o;o<h&&(aV(n=e.src.charCodeAt(o))||10===n);o++);if(a=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<h&&c!==o&&a.ok)for(l=a.str,o=a.pos;o<h&&(aV(n=e.src.charCodeAt(o))||10===n);o++);else l="";if(o>=h||41!==e.src.charCodeAt(o))return e.pos=d,!1;o++;}else{if(void 0===e.env.references)return!1;if(o<h&&91===e.src.charCodeAt(o)?(c=o+1,(o=e.md.helpers.parseLinkLabel(e,o))>=0?i=e.src.slice(c,o++):o=f+1):o=f+1,i||(i=e.src.slice(p,f)),!(s=e.env.references[aH(i)]))return e.pos=d,!1;u=s.href,l=s.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=o,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 o=e.src.slice(r+1,n);if(lC.test(o)){let n=e.md.normalizeLink(o);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(o);let r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto";}return e.pos+=o.length+2,!0;}if(lw.test(o)){let n=e.md.normalizeLink("mailto:"+o);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(o);let r=e.push("link_close","a",-1);r.markup="autolink",r.info="auto";}return e.pos+=o.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 o=e.src.charCodeAt(i+1);if(33!==o&&63!==o&&47!==o&&(!((n=32|o)>=97)||!(n<=122)))return!1;let s=e.src.slice(i).match(lp);if(!s)return!1;if(!t){var a,l;let t=e.push("html_inline","",0);t.content=s[0],a=t.content,/^<a[>\s]/i.test(a)&&e.linkLevel++,l=t.content,/^<\/a\s*>/i.test(l)&&e.linkLevel--;}return e.pos+=s[0].length,!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(lS);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=aN(t)?aT(t):aT(65533),n.markup=r[0],n.info="entity";}return e.pos+=r[0].length,!0;}}else{let r=e.src.slice(n).match(lD);if(r){let n=aD(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;}]],lA=[["balance_pairs",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;l_(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&l_(t[e].delimiters);}],["strikethrough",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;lb(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&lb(e,t[r].delimiters);}],["emphasis",function(e){let t=e.tokens_meta,n=e.tokens_meta.length;lx(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&lx(e,t[r].delimiters);}],["fragments_join",function(e){let t,n,r=0,i=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,"text"===i[t].type&&t+1<o&&"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 lM(){this.ruler=new a0();for(let e=0;e<lE.length;e++)this.ruler.push(lE[e][0],lE[e][1]);this.ruler2=new a0();for(let e=0;e<lA.length;e++)this.ruler2.push(lA[e][0],lA[e][1]);}function lN(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 lT(e){return Object.prototype.toString.call(e);}function lO(e){return"[object Function]"===lT(e);}function lR(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&");}lM.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,o=e.cache;if(void 0!==o[t]){e.pos=o[t];return;}let s=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error("inline rule didn't increment state.pos");break;}}else e.pos=e.posMax;!s&&e.pos++,o[t]=e.pos;},lM.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 o=e.pos,s=!1;if(e.level<i){for(let r=0;r<n;r++)if(s=t[r](e,!1)){if(o>=e.pos)throw Error("inline rule didn't increment state.pos");break;}}if(s){if(e.pos>=r)break;continue;}e.pending+=e.src[e.pos++];}e.pending&&e.pushPending();},lM.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let o=this.ruler2.getRules(""),s=o.length;for(let e=0;e<s;e++)o[e](i);},lM.prototype.State=lv;let lI={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1},lF={"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;}}},lj="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function lB(){return function(e,t){t.normalize(e);};}function lL(e){var t;let n,r,i=(t=e.__opts__,t=t||{},(n={}).src_Any=ah.source,n.src_Cc=ap.source,n.src_Z=ag.source,n.src_P=af.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=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${n.src_ZPCc}))((?![$+<=>^\`|\uff5c])${n.tpl_host_port_fuzzy_strict}${n.src_path})`,n.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${n.src_ZPCc}))((?![$+<=>^\`|\uff5c])${n.tpl_host_port_no_ip_fuzzy_strict}${n.src_path})`,e.re=n),o=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",i.src_tlds);}e.onCompile(),e.__tlds_replaced__||o.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]"),o.push(i.src_xn),i.src_tlds=o.join("|"),i.email_fuzzy=RegExp(s(i.tpl_email_fuzzy),"i"),i.email_fuzzy_global=RegExp(s(i.tpl_email_fuzzy),"ig"),i.link_fuzzy=RegExp(s(i.tpl_link_fuzzy),"i"),i.link_fuzzy_global=RegExp(s(i.tpl_link_fuzzy),"ig"),i.link_no_ip_fuzzy=RegExp(s(i.tpl_link_no_ip_fuzzy),"i"),i.link_no_ip_fuzzy_global=RegExp(s(i.tpl_link_no_ip_fuzzy),"ig"),i.host_fuzzy_test=RegExp(s(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]"===lT(n)){if("[object RegExp]"===lT(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 lO(n.validate)?r.validate=n.validate:l(t,n);lO(n.normalize)?r.normalize=n.normalize:n.normalize?l(t,n):r.normalize=lB();return;}"[object String]"===lT(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:lB()};let c=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t];}).map(lR).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${i.src_ZPCc}))(${c})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${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 lz(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 lP(e,t){if(!(this instanceof lP))return new lP(e,t);!t&&Object.keys(e||{}).reduce(function(e,t){return e||lI.hasOwnProperty(t);},!1)&&(t=e,e={}),this.__opts__=lN({},lI,t),this.__schemas__=lN({},lF,e),this.__compiled__={},this.__tlds__=lj,this.__tlds_replaced__=!1,this.re={},lL(this);}lP.prototype.add=function(e,t){return this.__schemas__[e]=t,lL(this),this;},lP.prototype.set=function(e){return this.__opts__=lN(this.__opts__,e),this;},lP.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));},lP.prototype.pretest=function(e){return this.re.pretest.test(e);},lP.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0;},lP.prototype.match=function(e){let t,n,r,i=[],o=[],s=[],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))&&o.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));)s.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=[o[c[0]],a[c[1]],s[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 lz(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;},lP.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 lz(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r;},lP.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),lL(this),this;},lP.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url=`mailto:${e.url}`);},lP.prototype.onCompile=function(){};let l$=/^xn--/,lV=/[^\0-\x7F]/,lq=/[\x2E\u3002\uFF0E\uFF61]/g,lW={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},lU=Math.floor,lK=String.fromCharCode;function lH(e){throw RangeError(lW[e]);}function lG(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(lq,".")).split("."),t).join(".");}let lJ=function(e,t){return e+22+75*(e<26)-((0!=t)<<5);},lZ=function(e,t,n){let r=0;for(e=n?lU(e/700):e>>1,e+=lU(e/t);e>455;r+=36)e=lU(e/35);return lU(r+36*e/(e+38));},lY=function(e){let t=[],n=e.length,r=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let n=0;n<s;++n)e.charCodeAt(n)>=128&&lH("not-basic"),t.push(e.charCodeAt(n));for(let l=s>0?s+1:0;l<n;){let s=r;for(let t=1,i=36;;i+=36){var a;l>=n&&lH("invalid-input");let s=(a=e.charCodeAt(l++))>=48&&a<58?26+(a-48):a>=65&&a<91?a-65:a>=97&&a<123?a-97:36;s>=36&&lH("invalid-input"),s>lU((0x7fffffff-r)/t)&&lH("overflow"),r+=s*t;let c=i<=o?1:i>=o+26?26:i-o;if(s<c)break;let u=36-c;t>lU(0x7fffffff/u)&&lH("overflow"),t*=u;}let c=t.length+1;o=lZ(r-s,c,0==s),lU(r/c)>0x7fffffff-i&&lH("overflow"),i+=lU(r/c),r%=c,t.splice(r++,0,i);}return String.fromCodePoint(...t);},lQ=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,o=72;for(let n of e)n<128&&t.push(lK(n));let s=t.length,a=s;for(s&&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>lU((0x7fffffff-i)/l)&&lH("overflow"),i+=(n-r)*l,r=n,e))if(c<r&&++i>0x7fffffff&&lH("overflow"),c===r){let e=i;for(let n=36;;n+=36){let r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;let i=e-r,s=36-r;t.push(lK(lJ(r+i%s,0))),e=lU(i/s);}t.push(lK(lJ(e,0))),o=lZ(i,l,a===s),i=0,++a;}++i,++r;}return t.join("");},lX={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"]}}}},l0=/^(vbscript|javascript|file|data):/,l1=/^data:image\/(gif|png|jpeg|webp);/;function l2(e){let t=e.trim().toLowerCase();return!l0.test(t)||l1.test(t);}let l3=["http:","https:","mailto:"];function l6(e){let t=au(e,!0);if(t.hostname&&(!t.protocol||l3.indexOf(t.protocol)>=0))try{var n;n=t.hostname,t.hostname=lG(n,function(e){return lV.test(e)?"xn--"+lQ(e):e;});}catch(e){}return s8(s7(t));}function l5(e){let t=au(e,!0);if(t.hostname&&(!t.protocol||l3.indexOf(t.protocol)>=0))try{var n;n=t.hostname,t.hostname=lG(n,function(e){return l$.test(e)?lY(e.slice(4).toLowerCase()):e;});}catch(e){}return s4(s7(t),s4.defaultChars+"%");}function l4(e,t){if(!(this instanceof l4))return new l4(e,t);t||aZ.isString(e)||(t=e||{},e="default"),this.inline=new lM(),this.block=new ly(),this.core=new lo(),this.renderer=new aX(),this.linkify=new lP(),this.validateLink=l2,this.normalizeLink=l6,this.normalizeLinkText=l5,this.utils=aZ,this.helpers=aZ.assign({},aY),this.options={},this.configure(e),t&&this.set(t);}l4.prototype.set=function(e){return aZ.assign(this.options,e),this;},l4.prototype.configure=function(e){let t=this;if(aZ.isString(e)){let t=e;if(!(e=lX[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;},l4.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;},l4.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;},l4.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this;},l4.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;},l4.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t);},l4.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens;},l4.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t);};let l9=new nD({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 l8{constructor(e,t){this.schema=e,this.tokenHandlers=t,this.stack=[{type:e.topNodeType,attrs:null,content:[],marks:t5.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),o;r&&(o=function(e,t){if(e.isText&&t.isText&&t5.sameSet(e.marks,t.marks))return e.withText(e.text+t.text);}(r,i))?n[n.length-1]=o: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:t5.none});}closeNode(){let e=this.stack.pop();return this.addNode(e.type,e.attrs,e.content);}}function l7(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs;}function ce(e,t){return e.noCloseToken||"code_inline"==t||"code_block"==t||"fence"==t;}function ct(e){return"\n"==e[e.length-1]?e.slice(0,e.length-1):e;}function cn(){}class cr{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);ce(i,r)?n[r]=(e,n,r,o)=>{e.openNode(t,l7(i,n,r,o)),e.addText(ct(n.content)),e.closeNode();}:(n[r+"_open"]=(e,n,r,o)=>e.openNode(t,l7(i,n,r,o)),n[r+"_close"]=e=>e.closeNode());}else if(i.node){let t=e.nodeType(i.node);n[r]=(e,n,r,o)=>e.addNode(t,l7(i,n,r,o));}else if(i.mark){let t=e.marks[i.mark];ce(i,r)?n[r]=(e,n,r,o)=>{e.openMark(t.create(l7(i,n,r,o))),e.addText(ct(n.content)),e.closeMark(t);}:(n[r+"_open"]=(e,n,r,o)=>e.openMark(t.create(l7(i,n,r,o))),n[r+"_close"]=e=>e.closeMark(t));}else if(i.ignore)ce(i,r)?n[r]=cn:(n[r+"_open"]=cn,n[r+"_close"]=cn);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 l8(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 ci(e,t){for(;++t<e.length;)if("list_item_open"!=e[t].type)return e[t].hidden;return!1;}let co=new cr(l9,l4("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:ci(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:ci(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}}),cs={open:"",close:"",mixable:!0};class ca{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 cu(this.nodes,this.marks,t);return n.renderContent(e),n.out;}}let cl=new ca({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,o=e.repeat(" ",i+2);e.renderList(t,o,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("]/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)=>cc(n.child(r),-1),close:(e,t,n,r)=>cc(n.child(r-1),1),escape:!1}});function cc(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 o=i>0&&t>0?" `":"`";for(let e=0;e<i;e++)o+="`";return i>0&&t<0&&(o+=" "),o;}class cu{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=cs;}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,o)=>{let s=t?t.marks:[];t&&t.type.name===this.options.hardBreakNodeName&&(s=s.filter(t=>{if(o+1==e.childCount)return!1;let n=e.child(o+1);return t.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text));}));let a=s.length?s[s.length-1]:null,l=a&&!1===this.getMark(a.type.name).escape,c=s.length-!!l;n:for(let e=0;e<c;e++){let t=s[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?s=s.slice(0,r).concat(t).concat(s.slice(r,e)).concat(s.slice(e+1,c)):r>e&&(s=s.slice(0,e).concat(s.slice(e+1,r)).concat(t).concat(s.slice(r,c)));continue n;}}}let u=0;for(;u<Math.min(n.length,c)&&s[u].eq(n[u]);)++u;let d=r;if(r="",t&&t.isText&&s.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)||(s=n));}if(t&&t.isText&&s.some((t,n)=>{let r=this.getMark(t.type.name);return r&&r.expelEnclosingWhitespace&&!this.isMarkAhead(e,o+1,s.slice(0,n+1));})){let[e,i,o]=/^(.*?)(\s*)$/m.exec(t.text);o&&(r=o,(t=i?t.withText(i):null)||(s=n));}if(t||o==e.childCount)for(;u<n.length;)this.text(this.markString(n.pop(),!1,e,o),!1);if(d&&this.text(d),t){for(;n.length<c;){let t=s[n.length];n.push(t),this.text(this.markString(t,!0,e,o),!1),this.atBlockStart=!1;}l&&t.isText?this.text(this.markString(a,!0,e,o)+t.text+this.markString(a,!1,e,o+1),!1):this.render(t,e,o),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,o,s)=>{s&&r&&this.flushClose(1),this.wrapBlock(t,n(s),e,()=>this.render(i,e,s));}),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),o=t?i.open:i.close;return"string"==typeof o?o:o(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&&t5.sameSet(r.marks.slice(0,n.length),n);t++;}}}let cd=[["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 ch(e){var _cd$find;let t=e.slice(0,4096).split("\n").map(e=>e.trim());return(_cd$find=cd.find(([,e])=>e.some(e=>t.some(t=>e.test(t)))))===null||_cd$find===void 0?void 0:_cd$find[0];}let cp=new nD({nodes:l9.spec.nodes.update("image",{...l9.spec.nodes.get("image"),toDOM:e=>{var _e$attrs$alt,_e$attrs$src;return["span",{"data-markdown-image":""},`!==null&&_e$attrs$src!==void 0?_e$attrs$src:"")}${cf(e.attrs.title)})`];}}),marks:l9.spec.marks.update("link",{...l9.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:"")}${cf(e.attrs.title)})`]];}})});function cf(e){return"string"==typeof e&&e.length>0?` "${e}"`:"";}let cm=new cr(cp,co.tokenizer,co.tokens),cg=new ca({...cl.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")},cl.marks),cy=new ca({...cg.nodes,code_block:(e,t,n,r)=>{let i=t.attrs.params||ch(t.textContent)||"",o=t.type.create({...t.attrs,params:i},t.content,t.marks);cl.nodes.code_block(e,o,n,r);}},cg.marks);function cv(e){return cy.serialize(e);}function ck(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 cb(e){let t=cm.parse(e);return cg.serialize(t)===e?t:ck(e);}function cx(e,t,n){let r=cw(n),i=0,o=e.doc.content.size;for(;i<o;){let n=Math.floor((i+o)/2),s=rg.near(e.doc.resolve(n));cv(e.tr.insertText(r,s.head).doc).indexOf(r)<t?i=n+1:o=n;}return rg.near(e.doc.resolve(i));}function cw(e){let t="";for(;e.includes(`${t}\uE001`);)t+=t;let n=`${t}\uE001`;return t.length>1&&(0,C.reportClientDiagnostic)("Keiko composer cursor marker collision avoided.",{composerActivity:"cursor-collision"}),n;}function cC(e,t){return new sW(e,(e,n,r,i)=>{let o=n[1],s=cp.marks[t];if(!o||!s)return null;let a=e.doc.textBetween(e.selection.$from.start(),r);return"code"!==t&&(o.trim()!==o||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,C.reportClientDiagnostic)("Keiko composer literal punctuation preserved.",{composerActivity:"literal-input-preserved"}),null):e.tr.insertText(o,r,i).addMark(r,r+o.length,s.create()).removeStoredMark(s);});}let cS=(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),o=cp.nodes.code_block;return!!i&&!!o&&n.parentOffset===n.parent.content.size&&(t!==null&&t!==void 0&&t(e.tr.delete(n.start(),n.end()).setBlockType(n.start(),n.start(),o,{params:(_i$=i[1])!==null&&_i$!==void 0?_i$:""})),!0);},cD=(e,t)=>{let n=((e,t,_e$storedMarks)=>{let{$from:n,empty:r}=e.selection,i=e.schema.nodes.paragraph,o=e.schema.nodes.list_item;return!!r&&0===n.parentOffset&&!!i&&!!o&&("heading"===n.parent.type.name?sk(i)(e,t):0===n.parent.content.size&&("code_block"===n.parent.type.name?sk(i)(e,t):!!sx(s6(o),sp)(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,C.reportClientDiagnostic)("Keiko composer block formatting removed.",{composerActivity:"format-removed"}),n;};function c_(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(t9.maxOpen((r?cm.parse(r):ck(n)).content)).scrollIntoView()),!0):((0,C.reportClientDiagnostic)("Keiko composer non-text clipboard left unchanged.",{composerActivity:"non-text-paste-ignored"}),!1);}var cE=e.i(21179);let cA=["plaintext","typescript","javascript","json","python","shell","sql","java","go","rust","yaml","html","css","markdown"],cM={ts:"typescript",js:"javascript",py:"python",bash:"shell",sh:"shell",yml:"yaml",md:"markdown"};function cN(e){var _String$split$,_cM$t;let t=(_String$split$=String(e.attrs.params).split(/\s/)[0])!==null&&_String$split$!==void 0?_String$split$:"";return(_cM$t=cM[t])!==null&&_cM$t!==void 0?_cM$t:t||ch(e.textContent)||"plaintext";}class cT{static create(e,t,n,r){let i=new cT(e,t,n,r);return i.loadEditor(),i;}constructor(e,t,n,r){var _cE$default$cmpCode,_cE$default$cmpCodeHo,_cE$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=(_cE$default$cmpCode=cE.default.cmpCode)!==null&&_cE$default$cmpCode!==void 0?_cE$default$cmpCode:"",this.dom.contentEditable="false",this.dom.dataset.composerCode="",this.host.className=(_cE$default$cmpCodeHo=cE.default.cmpCodeHost)!==null&&_cE$default$cmpCodeHo!==void 0?_cE$default$cmpCodeHo:"",this.host.dataset.workspaceScrollOwner="virtual",this.notice.className=(_cE$default$cmpNotice=cE.default.cmpNotice)!==null&&_cE$default$cmpNotice!==void 0?_cE$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 _cE$default$cmpCodeHe,_cE$default$cmpLangua,_cE$default$cmpContin;let e=document.createElement("div");e.className=(_cE$default$cmpCodeHe=cE.default.cmpCodeHeader)!==null&&_cE$default$cmpCodeHe!==void 0?_cE$default$cmpCodeHe:"";let t=this.languageSelect;t.className=(_cE$default$cmpLangua=cE.default.cmpLanguage)!==null&&_cE$default$cmpLangua!==void 0?_cE$default$cmpLangua:"",t.setAttribute("aria-label",this.labels.language);let n=cN(this.node);for(let e of(""===this.node.attrs.params&&"plaintext"!==n&&(0,C.reportClientDiagnostic)("Keiko composer code language detected.",{composerActivity:"code-language-detected"}),new Set([...cA,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=(_cE$default$cmpContin=cE.default.cmpContinue)!==null&&_cE$default$cmpContin!==void 0?_cE$default$cmpContin:"",r.textContent=this.labels.continueText,r.addEventListener("click",()=>this.exit()),e.append(t,r),e;}setupFallback(){var _cE$default$cmpFallba;this.fallback.className=(_cE$default$cmpFallba=cE.default.cmpFallback)!==null&&_cE$default$cmpFallba!==void 0?_cE$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?sq:sV)(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:cN(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:()=>{sV(this.view.state,this.view.dispatch);},onStage:e=>{t=e;},onRedo:()=>{sq(this.view.state,this.view.dispatch);}});if(this.disposed)return void r.dispose();this.adoptEditor(r),(0,C.reportClientDiagnostic)("Keiko composer code editor ready.",{composerActivity:"code-ready"});}catch(e){if((0,C.reportClientDiagnostic)(`Keiko composer code editor unavailable (${t}): ${(0,A.clientErrorSummary)(e)}`,{kind:"other",errorEvidence:(0,w.clientErrorEvidence)(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),o=""===this.node.attrs.params?ch(e):void 0;void 0!==o&&o!==cN(this.node)&&(0,C.reportClientDiagnostic)("Keiko composer code language detected.",{composerActivity:"code-language-detected"}),i.setSelection(rg.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=rg.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(rg.near(r.doc.resolve(t),1)),this.view.dispatch(r.scrollIntoView()),this.view.focus();}clearEmptyCode(){0===this.node.content.size&&(this.selectOuter(0,0),cD(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=cN(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=cN(e);return this.languageSelect.value=n,t!==n&&(_this$editor2=this.editor)!==null&&_this$editor2!==void 0&&_this$editor2.setLanguage(n).catch(e=>{(0,C.reportClientDiagnostic)("Keiko composer code language unavailable.",{kind:"other",errorEvidence:(0,w.clientErrorEvidence)(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 cO{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 st(e,{state:this.createState(t.value),attributes:this.attributes(),dispatchTransaction:e=>this.dispatch(e),handlePaste:c_,handleDrop:()=>!0,handleDOMEvents:{keydown:(e,t)=>!t.isComposing&&(this.props.onKeyDown(t,this.value),t.defaultPrevented)},nodeViews:{code_block:(e,t,n)=>cT.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?oW.create(e.doc,[o$.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,C.reportClientDiagnostic)("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"):cv(this.view.state.schema.node("doc",null,e.content));return(0,C.reportClientDiagnostic)("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,C.reportClientDiagnostic)("Keiko Markdown composer input limit reached.",{composerActivity:"input-limit"});},rM.create({doc:cb(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 rN({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t);}},props:{handleTextInput:(n,r,i,o)=>sU(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout(()=>{let{$cursor:r}=n.state.selection;r&&sU(n,r.pos,r.pos,"",e,t);});}}},isInputRules:!0});return t;}({rules:[function(e,t,n=null){return new sW(e,(e,r,i,o)=>{let s=e.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).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};}),sH(/^>\s$/,t),sH(/^[-*+]\s$/,n),sH(/^(\d+)\.\s$/,r,e=>({order:Number(e[1])})),cC(/\*\*([^*]+)\*\*$/,"strong"),cC(/(?<!\*)\*([^*]+)\*$/,"em"),cC(/`([^`]+)`$/,"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 s3({...s_,Enter:()=>!0,"Shift-Enter":function(){let e=cp.nodes.list_item;if(!e)throw TypeError("Invalid composer list schema");return sx(cS,function(t,n){let{$from:r,$to:i,node:o}=t.selection;if(o&&o.isBlock||r.depth<2||!r.sameParent(i))return!1;let s=r.node(-1);if(s.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=t1.empty,o=r.index(-1)?1:r.index(-2)?2:3;for(let e=r.depth-o;e>=r.depth-3;e--)i=t1.from(r.node(e).copy(i));let s=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;i=i.append(t1.from(e.createAndFill()));let a=r.before(r.depth-(o-1)),l=t.tr.replace(a,r.after(-s),new t9(i,4-o,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(rh.near(l.doc.resolve(c))),n(l.scrollIntoView());}return!0;}let a=i.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=t.tr.delete(r.pos,i.pos),c=a?[null,{type:a}]:void 0;return!!n4(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0);},sh,sp,sf);}(),"Mod-z":sV,"Shift-Mod-z":sq,"Mod-y":sq,"Mod-b":sb(e),"Mod-i":sb(t),"Mod-`":sb(n),Backspace:sx(cD,sK),Delete:(e,t,n)=>0===e.selection.$from.parent.content.size&&cD(e,t),Tab:function(e,t){let{$from:n,$to:i}=e.selection,o=n.blockRange(i,e=>e.childCount>0&&e.firstChild.type==r);if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=r)return!1;if(t){let n=l.lastChild&&l.lastChild.type==a.type,i=t1.from(n?r.create():null),s=new t9(t1.from(r.create(null,t1.from(a.type.create(null,i)))),n?3:1,0),c=o.start,u=o.end;t(e.tr.step(new nX(c-(n?3:1),u,c,u,s,1,!0)).scrollIntoView());}return!0;},"Shift-Tab":s6(r)});}(),s3(s_),function(e={}){return new rN({key:sz,state:{init:()=>new sO(sN.empty,sN.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i=n.getMeta(sz),o;if(i)return i.historyState;n.getMeta(sP)&&(e=new sO(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(sz))if(s.getMeta(sz).redo)return new sO(e.done.addTransform(n,void 0,r,sL(t)),e.undone,sI(n.mapping.maps),e.prevTime,e.prevComposition);else return new sO(e.done,e.undone.addTransform(n,void 0,r,sL(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(o=n.getMeta("rebased"))return new sO(e.done.rebased(n,o),e.undone.rebased(n,o),sF(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new sO(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),sF(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&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=s?sF(e.prevRanges,n.mapping):sI(n.mapping.maps);return new sO(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,sL(t)),sN.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?sV:"historyRedo"==n?sq:null;return!!r&&!!e.editable&&(t.preventDefault(),r(e.state,e.dispatch));}}}});}(),new rN({filterTransaction:e=>!e.docChanged||cv(e.doc).length<=t||(n(),!1)})]});}mentionCursor(){return"code_block"===this.view.state.selection.$from.parent.type.name?-1:this.selectionStart;}attributes(){var _cE$default$cmpEditor;return{class:(_cE$default$cmpEditor=cE.default.cmpEditor)!==null&&_cE$default$cmpEditor!==void 0?_cE$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:cv(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,C.reportClientDiagnostic)("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(""));return;}let r=this.externalDraftTransaction(e.value);if(cv(r.doc)!==e.value){let t=this.view.state;r=t.tr.replaceWith(0,t.doc.content.size,cb(e.value).content),(0,C.reportClientDiagnostic)("Keiko composer external draft resynchronized.",{composerActivity:"draft-resynchronized"});}this.view.updateState(this.view.state.apply(r)),this.value=cv(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,C.reportClientDiagnostic)("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,o=cx(i,t,this.value).head,s=cx(i,n,this.value).head,a=e.slice(t,r),l=i.tr.delete(o,s),c=l.doc.resolve(o);return a.startsWith("\n\n")&&1===c.depth&&c.parentOffset===c.parent.content.size?(l.split(o,1,[{type:i.schema.nodes.paragraph}]),a=a.slice(2),l.setSelection(cx(i,t,this.value).map(l.doc,l.mapping)),l.insert(o+2,ck(a).firstChild.content)):l.replaceRange(o,o,t9.maxOpen(ck(a).content)),l;}focus(){this.view.focus();}get currentMarkdown(){return this.value;}get selectionStart(){var e;let t;return t=cw(cv((e=this.view.state).doc)),cv(e.tr.insertText(t,e.selection.head).doc).indexOf(t);}setSelectionRange(e,t){this.view.dispatch(this.view.state.tr.setSelection(cx(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 cR(e){let t,n,r=(0,v.useRef)(null),i=(0,v.useRef)(null),o=(0,v.useRef)(e),s=(0,v.useRef)([]),a=(0,v.useRef)(e.value),[l,c]=(0,v.useState)(""),{publishChange:u,cancel:d}=(t=(0,v.useRef)(null),n=(0,v.useRef)(null),{publishChange:(0,v.useCallback)((e,r)=>{let a=i.current;t.current={owner:a,value:e,cursor:r},null===n.current&&(n.current=window.setTimeout(()=>{n.current=null;let e=t.current;(e===null||e===void 0?void 0:e.owner)!==a||(t.current=null,null!==a&&i.current===a&&(s.current.push(e.value),o.current.onChange(e.value,e.cursor)));},16));},[i,o,s]),cancel:(0,v.useCallback)(()=>{null!==n.current&&window.clearTimeout(n.current),n.current=null,t.current=null;},[])}),h=(0,v.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===o.current.value||(d(),s.current.push(t),(0,y.flushSync)(()=>{var _i$current$selectionS,_i$current3;return o.current.onChange(t,(_i$current$selectionS=(_i$current3=i.current)===null||_i$current3===void 0?void 0:_i$current3.selectionStart)!==null&&_i$current$selectionS!==void 0?_i$current$selectionS:-1);}),(0,C.reportClientDiagnostic)("Keiko composer Enter flushed the current draft.",{composerActivity:"literal-input-preserved"})),o.current.onKeyDown(e,t);},[d,i,o,s]);return(0,v.useLayoutEffect)(()=>{o.current=e;}),(0,v.useLayoutEffect)(()=>{if(!r.current)return;let e=new cO(r.current,{...o.current,onChange:u,onKeyDown:h},c);i.current=e,a.current=o.current.value,s.current=[];let t=o.current.inputRef;return t.current=e,()=>{e.destroy(),d(),s.current=[],i.current=null,t.current=null;};},[e.documentKey,u,h,d]),(0,v.useLayoutEffect)(()=>{var _i$current4;var t;let n,r,o=(t=e.value,n=s.current.indexOf(t),r=t===a.current,a.current=t,n>=0?s.current.splice(0,n+1):r||(s.current=[]),!r&&n<0);o&&d(),(_i$current4=i.current)===null||_i$current4===void 0?void 0:_i$current4.update({...e,onChange:u,onKeyDown:h},o);}),(0,f.jsxs)("div",{className:cE.default.cmpRoot,"data-markdown-composer-scope":"",children:[(0,f.jsx)("div",{ref:r}),l&&(0,f.jsx)("output",{className:cE.default.cmpNotice,children:l})]});}var cI=e.i(99211);let cF=eo.Icons.copy,cj=eo.Icons.chevron,cB=eo.Icons.close,cL=eo.Icons.mic,cz=eo.Icons.cube,cP=eo.Icons.arrowUp,c$=eo.Icons.spark,cV=eo.Icons.brain,cq="cmp-no-model-alert",cW="cmp-send-hint",cU="cmp-loading-status",cK="repo-file-picker-results",cH={display:"block"},cG={width:"100%"};async function cJ(e,t,n,r){return e({text:t,clientTurnId:n,reportOutcome:!0,...(void 0===r?{}:{correlationId:r})});}let cZ={contentVisibility:"auto",containIntrinsicSize:`auto ${String(132)}px`};function cY(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 cQ(e){return{blockSize:`${String(132*e)}px`};}let cX=/\s/u;function c0(e,t){return e.indices.every(e=>e>=1&&e<=t);}function c1(e,t){let n="",r=0;for(let i of(0,b.findCitationMarkerGroups)(e)){if(!c0(i,t))continue;let o=i.start;for(;o>r&&cX.test(e.charAt(o-1));)o-=1;n+=e.slice(r,o),r=i.end;}return n+e.slice(r);}function c2(e,t=0){return c1((0,ed.sanitizeRepositoryEvidenceText)(e),t);}function c3(e){return c1(c5(e),ue(e.groundedAnswer));}function c6(e){return void 0!==e.groundedAnswer&&e.content.includes("<assessment>");}function c5(e){return c6(e)?(0,x.ownAssessmentPlainText)(e.content):e.content;}let c4=(0,ec.default)(()=>e.A(88743).then(e=>e.AssessedAnswerBody),{loadableGenerated:{modules:[57757]},ssr:!1,loading:()=>null});function c9(e){let t=ue(e.groundedAnswer),n=(0,b.findCitationMarkerGroups)(c5(e)),r=n.filter(e=>c0(e,t)).length;return{grounded:void 0!==e.groundedAnswer,strippedGroupCount:r,keptGroupCount:n.length-r};}function c8(e,t){let n=(0,b.findCitationMarkerGroups)((0,ed.sanitizeRepositoryEvidenceText)(e.content)),r=n.filter(t=>c0(t,e.citationCeiling)).length;return{outcome:t,grounded:e.grounded,strippedGroupCount:r,keptGroupCount:n.length-r};}function c7(e,t){void 0===t?(0,C.reportClientDiagnostic)("Keiko chat answer copied.",{answerCopy:c8(e,"copied")}):(0,C.reportClientDiagnostic)("Keiko chat answer copy failed.",{answerCopy:c8(e,"failed"),errorKind:"unavailable",errorEvidence:(0,w.clientErrorEvidence)(t)});}function ue(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,b.citationMarkerIndices)(n!==null&&n!==void 0?n:""))t=Math.max(t,e);return t;}(n.map(e=>e.marker)));}function ut({content:e,citationCeiling:t,grounded:n}){let r=(0,O.useOptionalWidgetTranslate)(),[i,o]=(0,v.useState)("idle"),[s,a]=(0,v.useState)(""),l=(0,v.useCallback)(()=>{let i={content:e,citationCeiling:t,grounded:n};(0,tJ.copyTextToClipboard)(c2(e,t)).then(()=>{c7(i),o("copied"),a(r("chat.copy.copiedStatus")),setTimeout(()=>{o("idle"),a("");},1500);},e=>{c7(i,e),o("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)(cF,{size:20,"aria-hidden":"true"})}),(0,f.jsx)("output",{className:"chat-msg-copy-status",children:s})]});}function un({messageId:e,regenerating:t,onRegenerate:n,onCancel:r}){let i=(0,O.useOptionalWidgetTranslate)(),[o,s]=(0,v.useState)(""),a=(0,v.useCallback)(()=>{if(t){r(),s(i("chat.regenerate.cancelled"));return;}s(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:o})]});}function ur(e){let{message:t,isUser:n,streaming:r}=e;return c6(t)?(0,f.jsx)(c4,{content:t.content,messageId:t.id,repositoryRoots:e.repositoryRoots,openRepositoryReference:e.openRepositoryReference,citationPreview:e.citationPreview}):(0,f.jsx)(eu.SafeMarkdownBoundary,{source:t.content,literalUserInput:n,diagnosticCorrelationId:t.id,repositoryRoots:e.repositoryRoots,openRepositoryReference:e.openRepositoryReference,citationPreview:e.citationPreview,streaming:r,trailing:r?(0,f.jsx)("span",{className:"ai-stream-cursor","aria-hidden":"true"}):void 0});}function ui({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)(ur,{...r})});}function uo(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 us({message:e,selectedVersion:t,onSelect:n}){var _e$responseVersion2,_i$at;let r=(0,O.useOptionalWidgetTranslate)(),i=e.responseVersions,o=(_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,s=t!==null&&t!==void 0?t:o;return void 0===i||i.length<2||void 0===s?null:(0,f.jsxs)("div",{className:tL.default.responseVersionControl,children:[(0,f.jsxs)("label",{className:tL.default.responseVersionLabel,children:[(0,f.jsx)("span",{children:r("chat.regenerate.versionSelector")}),(0,f.jsx)("select",{className:tL.default.responseVersionSelect,value:String(s),onChange:e=>{n(Number(e.target.value));},children:i.map(e=>(0,f.jsx)("option",{value:String(e.version),children:r(e.version===o?"chat.regenerate.versionCurrent":"chat.regenerate.version",{version:e.version})},e.version))})]}),(0,f.jsx)("span",{className:tL.default.responseVersionSummary,"aria-live":"polite",children:r("chat.regenerate.versionSummary",{version:s,count:i.length})})]});}function ua({isUser:e,message:t,showRegenerate:n,regenerating:r,onRegenerate:i,onCancelRegenerate:o,canCollapse:s,collapsed:a,onToggleCollapsed:l,contentId:c}){let u=(0,O.useOptionalWidgetTranslate)();return e?null:(0,f.jsxs)("div",{className:"chat-msg-actions",children:[n&&void 0!==i&&void 0!==o?(0,f.jsx)(un,{messageId:t.id,regenerating:r,onRegenerate:i,onCancel:o}):null,(0,f.jsx)(ut,{content:c5(t),citationCeiling:ue(t.groundedAnswer),grounded:void 0!==t.groundedAnswer}),s?(0,f.jsxs)("button",{type:"button",className:"chat-msg-collapse","aria-controls":c,"aria-expanded":!a,onClick:l,children:[(0,f.jsx)(cj,{size:12,"aria-hidden":"true"}),(0,f.jsx)("span",{children:u(a?"chat.answer.expand":"chat.answer.collapse")})]}):null]});}function ul({message:e,isUser:t,repositoryRoots:n,openRepositoryReference:r,citationPreview:i,openDocumentationTarget:o}){return t||void 0===e.groundedAnswer?null:(0,f.jsxs)("div",{className:"chatw-grounded chatw-grounded-inline",children:[(0,f.jsx)(_.GroundedAnswer,{answer:e.groundedAnswer,busy:!1,repositoryRoots:n,openRepositoryReference:r,citationPreview:i,openDocumentationTarget:o}),(0,f.jsx)(ei,{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 uc=(0,v.memo)(function({message:e,onOpenRunResult:t,onRegenerate:n,onCancelRegenerate:r,showRegenerate:i=!1,regenerating:o=!1,repositoryRoots:s,openRepositoryReference:a,previewWindows:l,windowId:c,streaming:u=!1,layout:d="stack"}){var _M$groundedAnswer2;var h,p;let m,g=(0,O.useOptionalWidgetTranslate)(),y=(0,O.useOptionalWidgetTranslate)(),{activeChat:k}=(0,S.useChatSessionCatalog)(),b=(0,v.useId)(),x=(0,v.useRef)(null),[w,C]=(0,v.useState)(!1),[D,_]=(0,v.useState)({currentVersion:e.responseVersion,selectedVersion:void 0}),A=D.currentVersion===e.responseVersion?D.selectedVersion:void 0,M=uo(e,A),N=eA(e),T="user"===e.role,R=function({answer:e,chatId:t,windowId:n,windows:r}){let i=e===null||e===void 0?void 0:e.assistantMessageId,o=(0,v.useMemo)(()=>void 0===e?[]:"local-knowledge"===e.groundingKind?e.citations:"hybrid"===e.groundingKind?e.knowledgeCitations:[],[e]),[s,a]=(0,v.useState)({}),[l,c]=(0,v.useState)(new Set()),u=(0,v.useRef)(new Map()),d=(0,v.useRef)({affordances:s,answer:e,chatId:t,citations:o,windowId:n,windows:r});d.current={affordances:s,answer:e,chatId:t,citations:o,windowId:n,windows:r},(0,v.useEffect)(()=>{if(void 0===t||void 0===i||0===o.length)return void a({});let e=!1;return function(e){let t=`${e.chatId}\u0000${e.assistantMessageId}`,n=Date.now(),r=tO.get(t);if(void 0!==r&&r.expiresAt>n)return r.promise;let i=(0,E.fetchPdfCitationPreviewStatus)(e).catch(e=>{throw tO.delete(t),e;});return tO.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=tR(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=tR(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 o={};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&&(o[t.stableId]={citation:t,state:e.state,...(void 0===e.display?{}:{display:e.display}),...(void 0===e.reason?{}:{reason:e.reason})});}return o;}(o,t.citations));},()=>{e||a({});}),()=>{e=!0;};},[i,t,o]);let h=(0,v.useCallback)(e=>s[e.stableId],[s]),p=(0,v.useCallback)(e=>{let t=tR(e);if(void 0!==t)return o.map(e=>s[e.stableId]).find(e=>void 0!==e&&tR(e.citation.marker)===t);},[s,o]),f=(0,v.useCallback)(n=>void 0!==t&&void 0!==e&&l.has(tI(t,e.assistantMessageId,n)),[e,t,l]),m=(0,v.useCallback)(async(n,i)=>{if(void 0===t||void 0===e||void 0===r)return null;let o=tI(t,e.assistantMessageId,n),s=u.current.get(o);if(void 0!==s)return s;c(e=>tF(e,o,!0));let a=(0,E.openPdfCitationPreviewSession)({chatId:t,assistantMessageId:e.assistantMessageId,marker:n.marker,stableId:n.stableId,origin:i}).then(r=>{var o,s;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=(o=l.citations,s=l.affordances,a=new Set(),o.flatMap(e=>{if(e.lineage.documentId!==u.lineage.documentId||a.has(e.stableId))return[];let t=s[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,tT.showPdfCitationPreviewResult)(l.windows,r,{...(void 0===p?{}:{context:p}),currentPage:r.display.pageNumber}):(0,tT.showPdfCitationPreviewFailure)(l.windows,r);}).finally(()=>{u.current.delete(o),c(e=>tF(e,o,!1));});return u.current.set(o,a),a;},[e,t,r]);if(void 0!==t&&void 0!==e&&0!==o.length&&void 0!==r)return{forCitation:h,forMarker:p,isOpening:f,openCitation:m};}({answer:M.groundedAnswer,chatId:k===null||k===void 0?void 0:k.id,windowId:c,windows:l}),I=(0,v.useCallback)(e=>void 0!==l&&null!==l.add("docbrowser",{target:e}),[l]),F=(h=M.content,!u&&!T&&!N&&(h.length>=1800||h.split(/\r\n|\r|\n/u).length>=32));return("failed"===e.turnState?m=y("chat.turn.failed"):"cancelled"===e.turnState&&(m=y("chat.turn.cancelled")),p=k===null||k===void 0?void 0:k.id,(0,v.useEffect)(()=>{var _M$groundedAnswer$ass,_M$groundedAnswer;let e=(_M$groundedAnswer$ass=(_M$groundedAnswer=M.groundedAnswer)===null||_M$groundedAnswer===void 0?void 0:_M$groundedAnswer.assistantMessageId)!==null&&_M$groundedAnswer$ass!==void 0?_M$groundedAnswer$ass:M.id;if("assistant"===M.role&&void 0!==p&&void 0!==c&&null!==x.current)return(0,tT.registerPdfCitationPreviewMessageTarget)({assistantMessageId:e,chatId:p,chatWindowId:c,element:x.current});},[p,x,(_M$groundedAnswer2=M.groundedAnswer)===null||_M$groundedAnswer2===void 0?void 0:_M$groundedAnswer2.assistantMessageId,M.id,M.role,c]),N)?(0,f.jsx)(eM,{message:e,onOpenResult:t}):(0,f.jsx)("article",{ref:x,className:T?`chat-msg ${tL.default.cmpUserMessage}`:"chat-msg","data-role":e.role,"data-layout":d,tabIndex:T?void 0:-1,children:(0,f.jsxs)("div",{className:T?`chat-msg-bubble ${tL.default.cmpUserMessageBubble}`:"chat-msg-bubble",children:[T?(0,f.jsx)("div",{className:"chat-msg-role",children:g("chat.role.user")}):(0,f.jsx)(uu,{}),void 0===m?null:(0,f.jsx)("output",{className:tL.default.turnEndState,style:el.NATIVE_BLOCK_STYLE,children:m}),(0,f.jsx)(ui,{message:M,isUser:T,streaming:u,contentId:b,collapsed:w,canCollapse:F,repositoryRoots:s,openRepositoryReference:a,citationPreview:R}),(0,f.jsx)(us,{message:e,selectedVersion:A,onSelect:t=>{_({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(M.timestamp).toLocaleString(),children:cY(M.timestamp)}),(0,f.jsx)(ua,{isUser:T,message:M,showRegenerate:i&&void 0===e.groundedAnswer&&!uK(k),regenerating:o,onRegenerate:n,onCancelRegenerate:r,canCollapse:F,collapsed:w,onToggleCollapsed:()=>{C(e=>!e);},contentId:b})]}),(0,f.jsx)(ul,{message:M,isUser:T,repositoryRoots:s,openRepositoryReference:a,citationPreview:R,openDocumentationTarget:I})]})});});function uu({pulsing:e=!1}){let t=(0,O.useOptionalWidgetTranslate)();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)(g.default,{src:"/keiko-logo.svg",width:22,height:22,alt:"","aria-hidden":"true"})});}function ud(){let e=(0,O.useOptionalWidgetTranslate)();return(0,f.jsx)("article",{className:"chat-msg","data-role":"assistant",children:(0,f.jsxs)("div",{className:"chat-msg-bubble",children:[(0,f.jsx)(uu,{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 uh(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 up=(0,v.memo)(function({items:e,onJump:t}){let n=(0,O.useOptionalWidgetTranslate)(),r=(0,v.useRef)(new Map()),i=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useCallback)(e=>{let t=Array.from(r.current.values());if(0===t.length)return;let n=-1,i=1/0,o=t.map((t,r)=>{let o=t.getBoundingClientRect(),s=Math.abs(e-(o.top+o.height/2));return s<i&&(i=s,n=r),Math.exp(-(s*s)/1058);});t.forEach((e,t)=>{var _o$t;let r=t===n;uh(e,r?1:(_o$t=o[t])!==null&&_o$t!==void 0?_o$t:0,r);});},[]),a=(0,v.useCallback)(e=>{(i.current=e,"function"!=typeof requestAnimationFrame)?s(e):null===o.current&&(o.current=requestAnimationFrame(()=>{o.current=null;let e=i.current;null!==e&&s(e);}));},[s]),l=(0,v.useCallback)(()=>{for(let e of(null!==o.current&&"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(o.current),o.current=null,i.current=null,r.current.values()))uh(e,0,!1);},[]),c=(0,v.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))})});}),uf=(0,v.memo)(function({messages:e,streamingAssistantMessage:t,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:o,windowId:s,sending:a,sendStatus:l,regeneratingMessageId:c,activeChat:u,onCancelGrounded:d,onRegenerate:h,onCancelRegenerate:p,showRegenerateControls:m,registerQuestionAnchor:g,focusedMessageId:y}){var _x$at;let k=(0,O.useOptionalWidgetTranslate)(),b=(0,O.useOptionalWidgetTranslate)(),x=(0,v.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]),w=(0,v.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};}(x,y),[y,x]),C=void 0!==t&&t.content.length>0?t:void 0,S=(_x$at=x.at(-1))===null||_x$at===void 0?void 0:_x$at.id,D=(0,v.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":w.beforeCount>0||w.afterCount>0?"true":"false",children:[x.length>48?(0,f.jsx)("output",{className:tL.default.contextWindowNotice,"aria-label":b("chat.contextWindow.label"),style:el.NATIVE_BLOCK_STYLE,children:b("chat.contextWindow.notice",{count:x.length})}):null,w.beforeCount>0?(0,f.jsx)("div",{className:"chat-turn-spacer","aria-hidden":"true","data-position":"before","data-hidden-turns":w.beforeCount,style:cQ(w.beforeCount)}):null,w.turns.map(e=>{let t=e.user,a=e.id===S;return(0,f.jsxs)("div",{className:"chat-turn",style:cZ,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!==g?e=>g(t.id,e):void 0,children:null!==t?(0,f.jsx)(uc,{message:t,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:o,windowId:s,layout:"turn"}):null}),(0,f.jsxs)("div",{className:"chat-turn-cell chat-turn-answer",children:[e.responses.map((t,u)=>(0,f.jsx)(uc,{message:t,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:o,windowId:s,layout:"turn",onRegenerate:h,onCancelRegenerate:p,showRegenerate:m&&D===t.id,regenerating:c===t.id,streaming:void 0===C&&"streaming"===l&&"assistant"===t.role&&a&&u===e.responses.length-1},t.id)),void 0!==C&&a?(0,f.jsx)(uc,{message:C,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:o,windowId:s,layout:"turn",streaming:"streaming"===l},C.id):null]})]},e.id);}),w.afterCount>0?(0,f.jsx)("div",{className:"chat-turn-spacer","aria-hidden":"true","data-position":"after","data-hidden-turns":w.afterCount,style:cQ(w.afterCount)}):null,void 0!==C&&0===x.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)(uc,{message:C,onOpenRunResult:n,repositoryRoots:r,openRepositoryReference:i,previewWindows:o,windowId:s,layout:"turn",streaming:"streaming"===l})})]},C.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)(ud,{}),uK(u)?(0,f.jsx)("button",{type:"button",className:"grounded-cancel-btn","aria-label":k("chat.grounded.cancel"),onClick:d,children:k("common.cancel")}):null]})})]}):null]});});function um(e){return void 0!==e.connectedScopes?e.connectedScopes:void 0!==e.connectedScope?[e.connectedScope]:[];}function ug(e){return void 0===e?[]:(0,ed.repositoryReferenceRootsForScopes)(um(e),e.projectPath);}function uy(e,t="picker"){return{id:em(e.root,e.path),root:e.root,path:e.path,name:e.name,directory:e.directory,verified:!0,source:t};}function uv(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 o=0===i?"":(_r=r[i-1])!==null&&_r!==void 0?_r:"";if(o.length>0&&!/\s|[([{]/u.test(o))return null;let s=r.slice(i+1);return s.includes("@")||/\s/u.test(s)?null:{start:i,end:n,query:s};}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 ub(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,tq.formatUserError)(e,t("chat.repository.error.reference"));}function ux({roots:e,selectedRoot:t,onRootChange:n,search:r,pickingPath:i,highlightedIndex:o,pickError:s,onPick:a,onClose:l}){var _e$find,_u$label;let c=(0,O.useOptionalWidgetTranslate)(),u=(_e$find=e.find(e=>e.root===t))!==null&&_e$find!==void 0?_e$find:e[0],d=s!==null&&s!==void 0?s:r.error,h=(0,v.useRef)(null),p=e=>{e.stopPropagation();};return(0,v.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"});},[o,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)(cB,{size:13})})]}),e.length>1?(0,f.jsx)(es.default,{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:cK,"aria-label":c("chat.repository.results"),ref:h,style:el.NATIVE_LIST_STYLE,children:r.results.map((e,t)=>{var n;let r;return(0,f.jsx)("li",{style:cH,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===o?"true":"false","aria-label":c("chat.repository.reference",{path:e.path}),disabled:null!==i,style:cG,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 uw({references:e,onRemove:t}){let n=(0,O.useOptionalWidgetTranslate)();return 0===e.length?null:(0,f.jsx)("ul",{className:"repo-token-strip",style:el.NATIVE_LIST_KEEP_PADDING_STYLE,"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)(eN.FileIcon,{name:e.name})}),(0,f.jsxs)("span",{className:"repo-token-main",children:[(0,f.jsx)("span",{className:"repo-token-name",children:e.name}),(0,f.jsx)("span",{className:"repo-token-path",children:0===e.directory.length?(0,ed.repositoryRootLabel)(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)(cB,{size:12})})]},e.id))});}function uC({muted:e,onToggle:t,buttonRef:n,compact:r=!1}){let i=(0,v.useId)(),o=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":o,"aria-label":o,"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)(cL,{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 uS({session:e,selectedModelCapability:t,onAttachFiles:n,controlsNarrow:r=!1}){var i,o,s,a;let l=(0,O.useOptionalWidgetTranslate)(),{models:c,selectedModel:u,setSelectedModel:d,noEligibleModels:h,loading:p}=e,m=h?cq:void 0,g=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)(eC,{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)(es.default,{triggerClassName:"cmp-model-select",value:g,ariaLabel:l("chat.model.menuTitle"),ariaDescribedBy:m,disabled:p,placeholder:l(p?"chat.model.loading":h?"chat.model.noEligible":"chat.model.menuTitle"),leadingVisual:(0,f.jsx)(cz,{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,ea.requestGatewayModelCatalogRefresh)();},sections:[{options:(i=p,o=h,s=c,a=l,i?[{value:"",label:a("chat.model.loading"),disabled:!0}]:o?[{value:"",label:a("chat.model.noEligible"),disabled:!0}]:s.filter(e=>"chat"===e.kind).map(e=>({value:e.id,label:e.id})))}],onValueChange:e=>{h||p||d(e);}})}),(0,f.jsx)(G,{session:e})]});}function uD({onClick:e}){let t=(0,O.useOptionalWidgetTranslate)();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)(cP,{size:18})});}function u_({voiceMuted:e,onToggleVoiceMute:t,playbackButtonRef:n,voiceDialogActive:r,onToggleVoiceDialog:i,voiceDialogButtonRef:o,canInterrupt:s,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)(tB.VoiceDialogModeSwitch,{active:r,onToggle:i,buttonRef:o,compact:l}),c?(0,f.jsx)(uC,{muted:e,onToggle:t,buttonRef:n,compact:l}):null,void 0!==u?(0,f.jsx)(uD,{onClick:u}):null,void 0!==a?(0,f.jsx)(tB.VoiceDialogInterruptButton,{iconOnly:!0,canInterrupt:s,onInterrupt:a}):null]})});}function uE({sending:e,cancelSend:t,sendBlocked:n,noEligibleModels:r,loading:i,sendDescribedBy:o}){let s=(0,O.useOptionalWidgetTranslate)();return e?(0,f.jsx)("button",{type:"button",className:"cmp-send cmp-send-cancel cmp-tip-end","data-on":!0,"aria-label":s("chat.send.cancel"),"data-tip":s("chat.send.cancel"),onClick:t,children:(0,f.jsx)(cB,{size:16})}):(0,f.jsx)("button",{type:n?"button":"submit",className:"cmp-send cmp-tip-end","data-on":!n,"data-tip":s(r?"chat.send.noModel":i?"chat.send.connecting":"chat.send.label"),"aria-disabled":n,"aria-describedby":o,"aria-label":s("chat.send.label"),children:(0,f.jsx)(cP,{size:16})});}function uA({session:e,ready:t,selectedModelCapability:n,onAttachFiles:r,controlsNarrow:i=!1,barCompact:o=!1,voiceDictationVisible:s,dictation:a,micButtonRef:l,voiceSpeechOutputVisible:c,voiceMuted:u,onToggleVoiceMute:d,playbackButtonRef:h,voiceDialogAvailable:p,voiceDialogActive:m,onToggleVoiceDialog:g,voiceDialogButtonRef:y}){let v=(0,O.useOptionalWidgetTranslate)(),{draft:k,noEligibleModels:b,loading:x,sending:w,cancelSend:C}=e,S=b||!t,D=0===k.trim().length,_=b?cq:x?cU:D?cW:void 0;return(0,f.jsxs)("div",{className:`cmp-bar${o?" cmp-bar-compact":""}`,children:[(0,f.jsx)(uS,{session:e,selectedModelCapability:n,onAttachFiles:r,controlsNarrow:i}),(0,f.jsxs)("div",{className:"cmp-bar-main",children:[s?(0,f.jsx)(eF.VoiceDictationButton,{phase:a.phase,audioLevel:a.audioLevel,onStart:a.start,onStop:a.stop,buttonRef:l,compact:i}):null,p?(0,f.jsx)(tB.VoiceDialogModeSwitch,{active:m,onToggle:g,buttonRef:y,compact:i}):null,c?(0,f.jsx)(e6.VoicePlaybackMuteButton,{muted:u,onToggle:d,buttonRef:h,compact:i}):null,(0,f.jsx)(uE,{sending:w,cancelSend:C,sendBlocked:S,noEligibleModels:b,loading:x,sendDescribedBy:_})]}),_===cW?(0,f.jsx)("span",{id:cW,className:"sr-only",children:v("chat.send.hint")}):null]});}function uM(){let e=(0,O.useOptionalWidgetTranslate)();return(0,f.jsx)("div",{id:cq,role:"alert",className:"gw-error cmp-no-model",children:e("chat.noModelAlert")});}function uN(){let e=(0,O.useOptionalWidgetTranslate)();return(0,f.jsxs)("output",{id:cU,className:"cmp-loading-status",children:[(0,f.jsx)("span",{className:"cmp-loading-dot","aria-hidden":"true"}),e("chat.loadingGateway")]});}function uT(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.";}}function uO({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,O.useOptionalWidgetTranslate)());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 uR(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)(ux,{...e})]});}function uI({voiceDialogActive:e,sendStatus:t,voiceDictationVisible:n,dictation:r,onAfterDictationDiscard:i}){return(0,f.jsxs)(f.Fragment,{children:[e?null:(0,f.jsx)(uO,{status:t}),!e&&n?(0,f.jsx)(eF.VoiceDictationPreviewFromController,{controller:r,onAfterDiscard:i}):null]});}function uF({attachments:e,onRemove:t}){let n=(0,O.useOptionalWidgetTranslate)();return 0===e.length?null:(0,f.jsxs)("div",{className:tL.default["cmp-voice-attachments"],children:[(0,f.jsx)("p",{className:tL.default["cmp-voice-attachments-label"],children:n("attachment.voiceStaged")}),(0,f.jsx)(ex,{attachments:e,onRemove:t})]});}function uj({dialogue:e,onUseFailedTranscript:t}){var _e$error,_e$dictation$error;let n=(0,O.useOptionalWidgetTranslate)(),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:tL.default.cmpBatchFailedTranscript,children:e.failedTranscript}),(0,f.jsx)("button",{type:"button",onClick:t,children:n("chat.voice.batchUseText")})]}):null]}):null]});}function uB({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:tL.default["cmp-partial-transcript"],"aria-live":"off",children:t}):null,!r&&e&&"error"===n.phase?(0,f.jsx)(tN,{controller:n,onAfterDismiss:i}):null]});}function uL({voiceAuraActive:e,announcedVoiceHeadline:t,voiceDialogAvailable:n,voiceLayerRef:r,voiceDialogActive:i,partialUserTranscript:o,realtimeVoiceMuted:s,realtimeVoiceController:a,batchDialogue:l,batchActive:c,onUseFailedTranscript:u,onToggleVoiceMute:d,playbackButtonRef:h,onToggleVoiceDialog:p,onDismissVoiceError:m,voiceDialogButtonRef:g,compact:y,pendingAttachments:v,onRemoveAttachment:k}){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:`${tL.default.composerLayer} ${tL.default.voiceLayer}`,"data-composer-layer":"voice","aria-hidden":!i||void 0,children:(0,f.jsxs)("div",{className:tL.default["cmp-voice-content"],children:[c?(0,f.jsx)("p",{className:tL.default.cmpBatchModeLabel,children:t}):null,c?(0,f.jsx)(uj,{dialogue:l,onUseFailedTranscript:u}):null,(0,f.jsx)(uB,{active:i,transcript:o,controller:a,batchActive:c,onDismiss:m}),i?(0,f.jsx)(uF,{attachments:v,onRemove:k}):null,(0,f.jsx)(u_,{voiceMuted:s,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:g,compact:y})]})}):null]});}let uz=(0,v.memo)(function({ready:e,placeholder:t,inputRef:n,suspended:r=!1,minimal:i=!1,compact:o=!1,controlsNarrow:s=!1,barCompact:a=!1}){var _Z$profile,_tI$0$root,_tI$,_tP$query,_z$id;var l,c,u;let d,h,p=(0,O.useOptionalWidgetTranslate)(),g=(0,S.useChatSessionComposer)(),{draft:y,sending:b,sendStatus:x,setDraft:D,sendMessage:_,enqueueCanonicalVoiceTurn:A,canonicalVoiceCaptureMustPause:M,interruptCanonicalVoiceDelivery:N,models:T,selectedModel:R,pendingAttachments:I,addPendingAttachment:F,removePendingAttachment:j,error:B,messages:L,activeChat:z,replaceChat:P}=g,[$,V]=(0,v.useState)(),[q,W]=(0,v.useState)(),U=T.find(e=>e.id===R),K=(U===null||U===void 0?void 0:U.kind)==="chat"?U.id:z===null||z===void 0?void 0:z.selectedModel,H=T.some(e=>e.id===K&&"chat"===e.kind),G=void 0!==U&&(U.supportsImageInput||U.supportsDocumentInput),J=(0,v.useCallback)(async e=>{let{reason:t,mime:n}=await e.reduce(async(e,t)=>{let n=await e,r=await F(t);return r.ok||void 0!==n.reason?n:{reason:r.reason,mime:t.type};},Promise.resolve({reason:void 0,mime:void 0}));V(t),W(n);},[F]),Z=(0,eT.useVoiceCapability)(),{voiceDictationVisible:Y,liveDictationEnabled:Q}=(h=(d=(0,eT.supportsDictation)(Z)&&(0,eR.dictationCaptureSupported)())&&(0,eT.supportsRealtimeVoice)(Z)&&(0,eI.realtimeVoiceTransportSupported)(),{voiceDictationVisible:d,liveDictationEnabled:h}),X=(0,eT.supportsSpeechOutput)(Z),ee=(0,v.useRef)(null),et=(0,v.useRef)(null),en=(0,v.useRef)(null),er=(0,v.useRef)(null),ei=(0,v.useId)(),eo=(0,v.useCallback)(e=>{var _n$current;D(0===y.trim().length?e:`${y.trimEnd()} ${e}`),(_n$current=n.current)===null||_n$current===void 0?void 0:_n$current.focus();},[y,D,n]),es=(0,eO.useDictation)({onInsert:eo,captureOwner:ei,realtime:{enabled:Q}}),ea=(0,e5.useVoiceDialogMode)({capability:Z,captureOwner:ei}),{cancel:el}=es,{leave:ec}=ea;(0,v.useEffect)(()=>{r&&(el(),ec());},[el,ec,r]);let[eu,ed]=(0,v.useState)(null),eh=(0,v.useRef)(z===null||z===void 0?void 0:z.id);eh.current=z===null||z===void 0?void 0:z.id;let ep=(0,v.useRef)(void 0),ey=(0,v.useRef)("none"),ev=(0,v.useRef)(void 0),ek=ep.current,eb=void 0!==ek,eC=ea.active&&ek===(z===null||z===void 0?void 0:z.id),eD=(0,v.useRef)(0),e_=(0,v.useRef)(z===null||z===void 0?void 0:z.id);(0,v.useEffect)(()=>{e_.current!==(z===null||z===void 0?void 0:z.id)&&(e_.current=z===null||z===void 0?void 0:z.id,eD.current+=1);},[z===null||z===void 0?void 0:z.id]);let eE=(0,v.useRef)(new Set()),eA=(0,v.useRef)(new Map()),eM=(0,v.useRef)(!0);(0,v.useEffect)(()=>(eM.current=!0,()=>{eM.current=!1;}),[]),(0,v.useEffect)(()=>{(eu===null||eu===void 0?void 0:eu.chatId)!==(z===null||z===void 0?void 0:z.id)&&null!==eu&&ed(null);},[z===null||z===void 0?void 0:z.id,eu]);let eN=null===eu||eu.chatId!==(z===null||z===void 0?void 0:z.id)||eu.dialogGeneration!==eD.current?void 0:L.find(e=>e.id===eu.assistantMessageId&&e.chatId===eu.chatId&&"assistant"===e.role),eF=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:o,turnManager:s,persona:a}=e,l=function(e){let{profile:t,replayAllowed:n,turnManager:r}=e,i=(0,v.useMemo)(()=>function(e,_e$clock){let{profile:t}=e,n=(_e$clock=e.clock)!==null&&_e$clock!==void 0?_e$clock:eU(),r=e.observer,i={playbackAllowed:(0,ez.voiceMessageAllowedForProfile)("playback.state",t),interruptAllowed:(0,ez.voiceMessageAllowedForProfile)("control.interrupt",t),replayAllowed:!0===e.replayAllowed},o=eH(t);function s(){return{profile:t,available:i.playbackAllowed,phase:o.phase,active:eV(o.phase),settled:eq(o.phase),speaking:"speaking"===o.phase,paused:"paused"===o.phase,muted:o.muted,replayAllowed:i.replayAllowed,spoke:o.spoke,interruptions:o.interruptions,replays:o.replays,wireState:eW(o.phase),failureKind:o.failureKind,lastInterruptAtMs:o.lastInterruptAtMs};}function a(e,t,n){var _r$onTransition;let i=o.phase,s=void 0===o.lastTransitionAtMs?0:n-o.lastTransitionAtMs;o.phase=e,o.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:eW(e),latencyMs:s});}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:o.phase});}}return{dispatch:function(e){if(!i.playbackAllowed||!eK[e.kind](i))return{outcome:"not-allowed-for-profile",effects:[],snapshot:s()};let t=o.phase,c=o.muted,u=function(e,t,_r$onInterrupt){switch(e.kind){case"prepare":return"unavailable"===o.phase||eq(o.phase)?(o.spoke=!1,o.failureKind=void 0,a("preparing","prepare",t),l(["request-synthesis"]),["request-synthesis"]):[];case"play-started":if("preparing"!==o.phase)return[];o.spoke=!0,a("speaking","play-started",t);let n=["start-output","notify-turn-speech-start"];return l(n),n;case"pause":return"speaking"!==o.phase?[]:(a("paused","pause",t),l(["pause-output"]),["pause-output"]);case"resume":return"paused"!==o.phase?[]:(a("speaking","resume",t),l(["resume-output"]),["resume-output"]);case"interrupt":var i=e.atMs;if("speaking"!==o.phase&&"paused"!==o.phase)return[];let s="number"==typeof i&&Number.isFinite(i)?i:void 0;o.interruptions+=1,o.lastInterruptAtMs=s,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:o.phase,atMs:s,interruptions:o.interruptions}),c;case"stop":if(!eV(o.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"!==o.phase&&"speaking"!==o.phase)return[];o.failureKind=d,a("failed","fail",t);let h=["stop-output","notify-turn-speech-stopped"];return l(h),h;case"complete":return eV(o.phase)?(a("complete","complete",t),l(["notify-turn-speech-completed"]),["notify-turn-speech-completed"]):[];case"replay":return eq(o.phase)?(o.replays+=1,o.spoke=!1,o.failureKind=void 0,a("preparing","replay",t),l(["request-synthesis"]),["request-synthesis"]):[];case"set-muted":var p=e.muted;if(o.muted===p)return[];o.muted=p;let f=p?"mute-output":"unmute-output";return l([f]),[f];}}(e,n.now());return{outcome:o.phase!==t||o.muted!==c||u.length>0?"transitioned":"no-op",effects:u,snapshot:s()};},snapshot:s,reset:function(){o=eH(t);}};}({profile:t,replayAllowed:n}),[t,n]),[o,s]=(0,v.useState)(()=>i.snapshot());(0,v.useEffect)(()=>{s(i.snapshot());},[i]);let a=(0,v.useRef)(!0);(0,v.useEffect)(()=>(a.current=!0,()=>{a.current=!1;}),[]);let l=(0,v.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&&s(t.snapshot);},[i,r]),c=(0,v.useCallback)(()=>{l({kind:"set-muted",muted:!i.snapshot().muted});},[i,l]),u=(0,v.useCallback)(e=>l({kind:"set-muted",muted:e}),[l]),d=(0,v.useCallback)(()=>l({kind:"pause"}),[l]),h=(0,v.useCallback)(()=>l({kind:"resume"}),[l]),p=(0,v.useCallback)(()=>l({kind:"stop"}),[l]),f=(0,v.useCallback)(e=>l({kind:"interrupt",atMs:e}),[l]),m=(0,v.useCallback)(()=>l({kind:"replay"}),[l]),g=(0,v.useCallback)(()=>l({kind:"prepare"}),[l]),y=(0,v.useCallback)(()=>l({kind:"play-started"}),[l]),k=(0,v.useCallback)(()=>l({kind:"complete"}),[l]);return{snapshot:o,toggleMute:c,setMuted:u,pause:d,resume:h,stop:p,interrupt:f,replay:m,prepare:g,playStarted:y,complete:k,fail:(0,v.useCallback)(e=>l({kind:"fail",failure:e}),[l]),reset:(0,v.useCallback)(()=>{i.reset(),a.current&&s(i.snapshot());},[i])};}({profile:t,replayAllowed:o,turnManager:s}),c=(0,v.useRef)(l);c.current=l;let u=(0,v.useRef)((_e$synthesize=e.synthesize)!==null&&_e$synthesize!==void 0?_e$synthesize:eX(a));u.current=(_e$synthesize2=e.synthesize)!==null&&_e$synthesize2!==void 0?_e$synthesize2:eX(a);let d=(0,v.useRef)(e.preparation);d.current=e.preparation;let h=(0,v.useRef)((_e$createAudio=e.createAudio)!==null&&_e$createAudio!==void 0?_e$createAudio:e0);h.current=(_e$createAudio2=e.createAudio)!==null&&_e$createAudio2!==void 0?_e$createAudio2:e0;let p=(0,v.useRef)((_e$createObjectUrl=e.createObjectUrl)!==null&&_e$createObjectUrl!==void 0?_e$createObjectUrl:e1);p.current=(_e$createObjectUrl2=e.createObjectUrl)!==null&&_e$createObjectUrl2!==void 0?_e$createObjectUrl2:e1;let f=(0,v.useRef)((_e$revokeObjectUrl=e.revokeObjectUrl)!==null&&_e$revokeObjectUrl!==void 0?_e$revokeObjectUrl:e2);f.current=(_e$revokeObjectUrl2=e.revokeObjectUrl)!==null&&_e$revokeObjectUrl2!==void 0?_e$revokeObjectUrl2:e2;let m=(0,v.useRef)(null),g=(0,v.useRef)(null),y=(0,v.useRef)(null),k=(0,v.useRef)({id:void 0,nonce:0}),[b,x]=(0,v.useState)(0),w=(0,v.useRef)((_e$createStreamingSin=e.createStreamingSink)!==null&&_e$createStreamingSin!==void 0?_e$createStreamingSin:eQ);w.current=(_e$createStreamingSin2=e.createStreamingSink)!==null&&_e$createStreamingSin2!==void 0?_e$createStreamingSin2:eQ;let S=(0,v.useRef)(void 0),D=(0,v.useCallback)(()=>{var _S$current;return(_S$current=S.current)!==null&&_S$current!==void 0?_S$current:S.current=w.current(),S.current;},[]),_=(0,v.useRef)(a);_.current=a;let E=(0,v.useRef)(e.onSettled);E.current=e.onSettled;let A=(0,v.useRef)(void 0),M=(0,v.useCallback)(e=>{var _E$current;A.current!==e&&(A.current=e,(_E$current=E.current)===null||_E$current===void 0?void 0:_E$current.call(E,e));},[]),N=(0,v.useCallback)(()=>{var _g$current,_S$current2;(_g$current=g.current)!==null&&_g$current!==void 0&&_g$current.abort(),g.current=null,(_S$current2=S.current)===null||_S$current2===void 0?void 0:_S$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!==y.current&&(f.current(y.current),y.current=null);},[]),T=l.snapshot.available;(0,v.useEffect)(()=>{var e;let t,o=c.current;if(!n||!T||void 0===i||void 0===r||0===r.trim().length||k.current.id===i&&k.current.nonce===b)return;let s=k.current.id===i;if(k.current={id:i,nonce:b},o.snapshot.muted&&!s)return void M(i);let a={current:!1},l=new AbortController();g.current=l;let f=(e=d.current,t=(0,eB.newClientCorrelationId)(),void 0!==e&&(0,C.reportClientDiagnostic)("Keiko chat answer prepared for speech.",{answerSpeech:e,correlationId:t}),t);o.prepare();let v=()=>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,eL.decodeBase64ArrayBuffer)(t.audio)],{type:t.mimeType}),r=p.current(n);return y.current=r,e.src=r,e.onplaying=()=>{a.current||c.current.playStarted();},e.onended=()=>{a.current||(c.current.complete(),N(),v());},e.onerror=()=>{a.current||(c.current.fail("internal"),N(),v());},Promise.resolve(e.play()).catch(e=>{a.current||e3(e)||(c.current.fail("internal"),N(),v());});}).catch(e=>{a.current||e3(e)||(c.current.fail(function(e){if(e instanceof ej.ApiError)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=D();return void 0===w?x():w.play({text:r,...(void 0!==_.current?{persona:_.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,T,r,i,b,N,M,D]),(0,v.useEffect)(()=>()=>{var _S$current3;(_S$current3=S.current)!==null&&_S$current3!==void 0&&_S$current3.dispose(),S.current=void 0;},[]);let O=(0,v.useCallback)(e=>{c.current.setMuted(e),e&&(N(),c.current.snapshot.active&&c.current.stop());},[N]),R=(0,v.useCallback)(()=>{O(!c.current.snapshot.muted);},[O]),I=(0,v.useCallback)(()=>{var _m$current;(_m$current=m.current)!==null&&_m$current!==void 0&&_m$current.pause(),c.current.pause();},[]),F=(0,v.useCallback)(()=>{let e=m.current;null!==e&&Promise.resolve(e.play()).catch(()=>{}),c.current.resume();},[]),j=(0,v.useCallback)(()=>{N(),c.current.stop();},[N]),B=(0,v.useCallback)(e=>{N();let{phase:t,active:n}=c.current.snapshot;"speaking"===t||"paused"===t?c.current.interrupt(e):n&&c.current.stop();},[N]),L=(0,v.useCallback)(()=>{x(e=>e+1),c.current.replay();},[]),z=(0,v.useCallback)(()=>{var _D;(_D=D())===null||_D===void 0||_D.primeFromUserGesture();},[D]);return(0,v.useMemo)(()=>({snapshot:l.snapshot,toggleMute:R,setMuted:O,pause:I,resume:F,stop:j,interrupt:B,replay:L,prepare:l.prepare,playStarted:l.playStarted,complete:l.complete,fail:l.fail,reset:l.reset,primeAudioOutput:z}),[l,R,O,I,F,j,B,L,z]);}({profile:(_Z$profile=Z===null||Z===void 0?void 0:Z.profile)!==null&&_Z$profile!==void 0?_Z$profile:"none",enabled:eC&&void 0!==eN,text:void 0===eN?void 0:c3(eN),preparation:void 0===eN?void 0:c9(eN),messageId:eN===null||eN===void 0?void 0:eN.id,persona:ea.persona,onSettled:e=>{var _ev$current;return(_ev$current=ev.current)===null||_ev$current===void 0?void 0:_ev$current.call(ev,e);}}),eP=eF.primeAudioOutput,e$=(0,v.useCallback)(({turnId:e,text:t,correlationId:n})=>{var r,i;if(void 0===z||void 0===K)return!1;let o=z.id,s=eD.current,a=`${o}:${e}`;if(r=eE.current,i=eA.current,r.has(a)||i.has(a))return!0;let l=A===null||A===void 0?void 0:A({text:t,clientTurnId:e,...(void 0===n?{}:{correlationId:n}),target:{chat:z,modelId:K},allowReservedCapacity:!0});if(void 0!==A&&void 0===l)return!1;let c=(l!==null&&l!==void 0?l:cJ(_,t,e,n)).then(e=>{var t;return t={activeChatId:eh.current,admittedTurnIds:eE.current,chatId:o,composerMounted:eM.current,currentDialogGeneration:eD.current,deliveryKey:a,dialogGeneration:s,setPendingVoiceAnswer:ed},("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(()=>{eA.current.delete(a);});return eA.current.set(a,c),void 0===l||(M===null||M===void 0?void 0:M())!==!0||"accepted-stop";},[z,M,K,A,_]),eG=(0,v.useCallback)((e,t)=>{let n=z===null||z===void 0?void 0:z.id;if(void 0===n)return;let r=crypto.randomUUID();if(!1!==e$({turnId:r,text:e,correlationId:t}))return eA.current.get(`${n}:${r}`);},[z===null||z===void 0?void 0:z.id,e$]),eJ=function(e,_e$dictation){var t;let n=function(e){let t,n,r=(0,v.useRef)(e);r.current=e;let i=(0,v.useRef)({active:!1,generation:0,expectedAnswerId:void 0,expectedAnswerCorrelationId:void 0,sessionCorrelationId:void 0}),[o,s]=(0,v.useState)(!1),[a,l]=(0,v.useState)(void 0),[c,u]=(0,v.useState)(),d=(0,v.useCallback)(e=>{var t;let n=i.current;if(!n.active)return;let o=crypto.randomUUID(),a=r.current(e,o);if(void 0===a){tx("queue-unavailable",o,n.sessionCorrelationId),u(e),l("The spoken turn could not be queued. You can retry or continue in text.");return;}tx("turn-submitted",o,n.sessionCorrelationId),s(!0);let c=n.generation;t={setWaiting:s,setError:l,setFailedTranscript:u},a.then(r=>function(e,t,n,r,i,o){if(tw(t,n)){if("completed"===e.status){t.expectedAnswerId=e.assistantMessageId,t.expectedAnswerCorrelationId=i,tx("answer-ready",i,t.sessionCorrelationId);return;}tx("cancelled"===e.status?"delivery-cancelled":"delivery-failed",i,t.sessionCorrelationId),o.setWaiting(!1),o.setFailedTranscript(r),o.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,o,t),()=>{tw(n,c)&&(tx("delivery-rejected",o,n.sessionCorrelationId),t.setWaiting(!1),t.setFailedTranscript(e),t.setError("The spoken turn failed. You can retry or continue in text."));});},[r,i,s,l,u]),{activate:h,deactivate:p,clearError:f,takeSettledAnswer:m}=(t=(0,v.useCallback)(()=>{tC(i.current,!0,s,l,u);},[i,s,l,u]),n=(0,v.useCallback)(()=>{tC(i.current,!1,s,l,u);},[i,s,l,u]),{activate:t,deactivate:n,clearError:(0,v.useCallback)(()=>{l(void 0),u(void 0);},[l,u]),takeSettledAnswer:(0,v.useCallback)((e,t=!1)=>{let n=i.current;return!!n.active&&n.expectedAnswerId===e&&(n.expectedAnswerId=void 0,s(!1),tx(t?"interrupted":"playback-settled",n.expectedAnswerCorrelationId,n.sessionCorrelationId),n.expectedAnswerCorrelationId=void 0,!0);},[i,s])});return{flagsRef:i,waitingForAnswer:o,error:a,failedTranscript:c,acceptTranscript:d,activate:h,deactivate:p,clearError:f,takeSettledAnswer:m};}(e.submit),{flagsRef:r,acceptTranscript:i,activate:o,deactivate:s,clearError:a,takeSettledAnswer:l}=n,c=(0,v.useRef)(()=>{}),u=(t=(_e$dictation=e.dictation)===null||_e$dictation===void 0?void 0:_e$dictation.vad,(0,v.useMemo)(()=>{let e=t!==null&&t!==void 0?t:(0,tb.createBrowserVoiceActivityDetector)();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,eO.useDictation)({...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 eR.DictationRecorderError?e:void 0,void(0,C.reportClientDiagnostic)("[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,w.clientErrorEvidence)(e)});},onCaptureBoundReached:e=>tx("capture-bound-reached",r.current.sessionCorrelationId,void 0,e),onSilenceRenewed:()=>tx("capture-renewed",r.current.sessionCorrelationId)},vad:u}),{start:h,cancel:p,retry:f}=d;!function(e,t){let n=(0,v.useRef)(!1),{phase:r,transcript:i,discard:o,insert:s,start:a}=e;(0,v.useEffect)(()=>{if("preview"!==r){n.current=!1;return;}if(t.current.active&&!n.current){if(n.current=!0,0===i.trim().length){o(),a();return;}s();}},[r,i,o,s,a,t]);}(d,r);let{start:m,reset:g,preparedRef:y,preparing:k,startupError:b}=function(e,t,n,r,_e$prepareCanonicalVo,_e$prepareCanonicalVo2){let i=(0,v.useRef)((_e$prepareCanonicalVo=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo!==void 0?_e$prepareCanonicalVo:e4.prepareCanonicalVoiceHasher);i.current=(_e$prepareCanonicalVo2=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo2!==void 0?_e$prepareCanonicalVo2:e4.prepareCanonicalVoiceHasher;let o=(0,v.useRef)(void 0===e.prepareCanonicalVoiceHasher&&(0,e4.canonicalVoiceHasherIsReady)()),[s,a]=(0,v.useState)(!1),[l,c]=(0,v.useState)();return{start:(0,v.useCallback)(()=>{if(n(),tx("started",t.current.sessionCorrelationId),c(void 0),o.current)return void r();let e=t.current.generation;a(!0),tS({prepare:i.current,flagsRef:t,generation:e,preparedRef:o,setPreparing:a,setStartupError:c,startDictation:r});},[n,t,r]),preparedRef:o,preparing:s,startupError:l,reset:(0,v.useCallback)(()=>{a(!1),c(void 0);},[])};}(e,r,o,h),x=(0,v.useCallback)(()=>{r.current.active&&tx("stopped",r.current.sessionCorrelationId),s(),g(),p();},[s,g,p,r]),S=(0,v.useCallback)(()=>{r.current.active&&(a(),y.current?f():m());},[r,a,f,y,m]),D=function(e,t){let{phase:n,start:r}=t;return(0,v.useCallback)(t=>{e(t)&&!tD(n)&&r();},[e,n,r]);}(l,d),_=function(e,t,n){let{flagsRef:r,waitingForAnswer:i,takeSettledAnswer:o}=e,{phase:s,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,v.useCallback)(()=>{let e=r.current,t=e.expectedAnswerId;!l||!e.active||void 0===t||o(t,!0)&&(c!==null&&c!==void 0&&c(),tD(s)||a());},[l,r,s,a,c,o]);return(0,v.useEffect)(()=>{l&&i&&r.current.active&&"idle"===s&&a();},[l,i,r,s,a]),{interrupt:u,canInterrupt:l&&i};}(n,d,e.playback);return c.current=_.interrupt,(0,v.useEffect)(()=>x,[x]),{..._,dictation:d,waitingForAnswer:n.waitingForAnswer,preparing:k,error:b!==null&&b!==void 0?b:n.error,failedTranscript:n.failedTranscript,start:m,stop:x,retry:S,onSpeechSettled:D};}({captureOwner:ei,captureLease:ea.captureLease,submit:eG,playback:{active:eF.snapshot.active,interrupt:eF.interrupt}}),{start:eZ,stop:eY}=eJ;ev.current=eJ.onSpeechSettled;let e6=(0,v.useCallback)(()=>{eD.current+=1,eF.interrupt(),N!==null&&N!==void 0&&N(),ed(null);},[N,eF]),ti=(0,v.useCallback)(()=>(M===null||M===void 0?void 0:M())!==!0,[M]),to=eC&&b&&uK(z),ts=function(e,_e$createTransport,_e$chatContext,_e$chatContext2,_e$chatContext3,_E$current2,_e$prepareCanonicalVo3,_e$prepareCanonicalVo4,_e$chatContext5,_e$retrieving){let[t,n]=(0,v.useReducer)(td,tu),r=(0,v.useRef)(function(e,_e$clock2){let t,n,r,i,{profile:o}=e,s=(_e$clock2=e.clock)!==null&&_e$clock2!==void 0?_e$clock2:eU(),a=e.observer,l=(t=(0,ez.voiceMessageAllowedForProfile)("media.track.state",o),n=(0,ez.voiceMessageAllowedForProfile)("playback.state",o),r=(0,ez.voiceMessageAllowedForProfile)("control.interrupt",o),{mediaAllowed:t,playbackAllowed:n,interruptAllowed:r,transcriptAllowed:i=(0,ez.voiceMessageAllowedForProfile)("transcript.committed",o),floorControl:t,usesManualCommit:i&&!t,canCaptureUserVoice:t||i}),c=tn(o);function u(){return{profile:o,active:"disabled"!==c.state,state:c.state,floorHolder:te[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:te[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"===o||"disabled"===c.state||!tt[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,s.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=tn(o);}};}({profile:"full-realtime"})),[i,o]=(0,v.useState)(()=>r.current.snapshot()),[s,a]=(0,v.useState)(!1),[l,c]=(0,v.useState)(!1),[u,d]=(0,v.useState)(),h=(_e$createTransport=e.createTransport)!==null&&_e$createTransport!==void 0?_e$createTransport:eI.createBrowserVoiceRtcTransport,p=(0,v.useRef)(e.chatContext);p.current=e.chatContext;let f=(0,v.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,v.useRef)(void 0),g=(0,v.useRef)(void 0),y=(0,v.useRef)((_e$chatContext3=e.chatContext)===null||_e$chatContext3===void 0?void 0:_e$chatContext3.chatId),k=(0,v.useMemo)(()=>{var _e$createControl;return(_e$createControl=e.createControl)!==null&&_e$createControl!==void 0?_e$createControl:()=>{var e,t;let n,r,i,o,s,a;return e=void 0,t=p.current,i=e!==null&&e!==void 0?e:e=>new WebSocket(e),o=crypto.randomUUID(),s=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 e8("unavailable",e instanceof Error?e.message:"WebSocket could not be opened."));return;}let f=!1,m=!1,g=!1,y=()=>{void 0!==d&&(clearTimeout(d),d=void 0);},v=e=>{g||(g=!0,y(),r===h&&(r=void 0),c(e));};r=h=()=>{v(new e8("connection-failed","Voice control negotiation was closed."));},d=setTimeout(()=>{d=void 0,v(new e8("connection-failed","Voice control negotiation timed out."));try{u.close();}catch{}},e9),u.addEventListener("error",()=>{f?v(new e8("connection-failed","Voice control connection was lost.")):v(new e8("unavailable","Voice control connection failed."));}),u.addEventListener("close",()=>{f?v(new e8("connection-failed","Voice control connection closed during negotiation.")):v(new e8("unavailable","Voice control connection was closed."));}),u.addEventListener("open",()=>{!g&&(f=!0,u.send(JSON.stringify({protocolVersion:ez.VOICE_PROTOCOL_VERSION,sessionId:o,seq:0,direction:"client-to-host",kind:"session.create",idempotencyKey:s,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{v(new e8("connection-failed","Received an unparseable control message."));return;}let i=(0,ez.decodeVoiceControlMessage)(n);if(void 0!==i){var s;if("error"===i.kind)return void v(new e8("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:ez.VOICE_PROTOCOL_VERSION,sessionId:o,seq:p,direction:"client-to-host",kind:"signal.sdp.offer",sdp:e}));return;}"signal.sdp.answer"===i.kind&&m&&(s=i.sdp,g||(g=!0,y(),r===h&&(r=void 0),l(s)));}});}),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:ez.VOICE_PROTOCOL_VERSION,sessionId:o,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,v.useRef)(e.onCanonicalUserTurn),x=(0,v.useRef)(e.onUserSpeechStart),w=(0,v.useRef)(e.canStartCapture),S=(0,v.useRef)(e.turnDetectionProfile),D=(0,v.useRef)(e.turnDetectionProfile),_=(0,v.useRef)(e.latencySink);_.current=e.latencySink;let E=(0,v.useRef)(void 0);(_E$current2=E.current)!==null&&_E$current2!==void 0?_E$current2:E.current=(0,tr.createVoiceLatencyObserver)({sink:{onMark:e=>{var _$current,_$current$onMark;return(_$current=_.current)===null||_$current===void 0||(_$current$onMark=_$current.onMark)===null||_$current$onMark===void 0?void 0:_$current$onMark.call(_$current,e);},onLeg:e=>{var _$current2,_$current2$onLeg;return(_$current2=_.current)===null||_$current2===void 0||(_$current2$onLeg=_$current2.onLeg)===null||_$current2$onLeg===void 0?void 0:_$current2$onLeg.call(_$current2,e);}}}),b.current=e.onCanonicalUserTurn,x.current=e.onUserSpeechStart,w.current=e.canStartCapture,S.current=e.turnDetectionProfile;let A=(0,v.useRef)(void 0),M=(0,v.useRef)(void 0),N=(0,v.useRef)(void 0),T=(0,v.useRef)(void 0===e.prepareCanonicalVoiceHasher&&(0,e4.canonicalVoiceHasherIsReady)()),O=(0,v.useRef)((_e$prepareCanonicalVo3=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo3!==void 0?_e$prepareCanonicalVo3:e4.prepareCanonicalVoiceHasher);O.current=(_e$prepareCanonicalVo4=e.prepareCanonicalVoiceHasher)!==null&&_e$prepareCanonicalVo4!==void 0?_e$prepareCanonicalVo4:e4.prepareCanonicalVoiceHasher;let R=(0,v.useRef)(void 0),I=(0,v.useRef)(void 0),F=(0,v.useRef)(void 0),j=(0,v.useRef)(tg()),B=(0,v.useRef)(!1),L=(0,v.useRef)(!1),z=(0,v.useRef)(0),P=(0,v.useRef)(void 0),$=(0,v.useRef)(new Set()),V=(0,v.useRef)(new Map()),q=(0,v.useRef)(new Map()),W=(0,v.useRef)(new Set()),U=(0,v.useRef)(void 0),K=(0,v.useRef)(!1),H=(0,v.useRef)(void 0),G=(0,v.useRef)(!1),J=(0,v.useRef)(!1),Z=(0,v.useRef)(void 0),Y=(0,v.useRef)(()=>void 0),Q=(0,v.useRef)(()=>void 0),X=(0,v.useRef)(()=>void 0),ee=(0,v.useRef)(()=>void 0),et=(0,v.useRef)(()=>void 0),en=(0,v.useRef)(void 0),er=(0,v.useRef)(0),ei=(0,v.useRef)(ty()),eo=(0,v.useRef)(void 0),es=(0,v.useRef)(void 0),ea=(0,v.useRef)(void 0),el=(0,v.useRef)(()=>void 0),ec=(0,v.useRef)(!0),eu=(0,v.useCallback)(e=>{let t=r.current.apply(e);o(t.snapshot),ee.current(t.effects);},[]),ed=(0,v.useCallback)(()=>{var _E$current3;let e=j.current;!L.current&&ec.current&&e.answerApplied&&e.rtcConnected&&e.dataChannelOpen&&e.warmupComplete&&(!e.requiresDataChannelAck||e.sessionUpdated)&&(L.current=!0,void 0!==F.current&&(clearTimeout(F.current),F.current=void 0),z.current=0,eu({kind:"recovered"}),n({type:"connected"}),(_E$current3=E.current)===null||_E$current3===void 0?void 0:_E$current3.mark("session_ready"));},[eu]),eh=(0,v.useCallback)(()=>{var _A$current2,_A$current2$sendDataC;var e;let t;B.current||(B.current=!0,!1===((_A$current2=A.current)===null||_A$current2===void 0||(_A$current2$sendDataC=_A$current2.sendDataChannelEvent)===null||_A$current2$sendDataC===void 0?void 0:_A$current2$sendDataC.call(_A$current2,(e=D.current,t={type:"realtime"},void 0===e||(t.audio={input:{turn_detection:{...tc[e!==null&&e!==void 0?e:"balanced"](),interrupt_response:!1,create_response:!1}}}),{type:"session.update",session:t})))&&(j.current={...j.current,sessionUpdated:!1}));},[]),ep=(0,v.useCallback)((e={})=>{r.current.reset(),!0!==e.suppressUiUpdates&&o(r.current.snapshot()),!0!==e.preserveFinalTranscriptDedupe&&($.current.clear(),eo.current=void 0),V.current.clear(),q.current.clear(),W.current.clear(),U.current=void 0,K.current=!1,J.current=!1,!0!==e.suppressUiUpdates&&!0!==e.preservePartialTranscript&&d(void 0),en.current=void 0;},[]),ef=(0,v.useCallback)(()=>{void 0!==I.current&&(clearTimeout(I.current),I.current=void 0),void 0!==F.current&&(clearTimeout(F.current),F.current=void 0),j.current=tg(),B.current=!1,L.current=!1;},[]),em=(0,v.useCallback)(()=>{void 0!==I.current&&clearTimeout(I.current),j.current={...j.current,warmupComplete:!1},I.current=setTimeout(()=>{I.current=void 0,ec.current&&(j.current={...j.current,warmupComplete:!0},ed());},150);},[ed]),eg=(0,v.useCallback)(()=>{er.current+=1;let e={fallbackTurnId:`client-turn-${ei.current}-${String(er.current)}`};return en.current=e,e;},[]),ey=(0,v.useCallback)(()=>{var _en$current;return(_en$current=en.current)!==null&&_en$current!==void 0?_en$current:eg();},[eg]),ev=(0,v.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,v.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,v.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),ev()),{accepted:!1,stopCapture:!1};}},[ev]),ex=(0,v.useCallback)(()=>{void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0);let e=H.current;if(void 0===e||G.current)return;let t=eb(e,!0);if(t.accepted){H.current=void 0,J.current=!1,d(void 0),t.stopCapture&&(ek(),et.current());return;}G.current=!0,d(e.text),ev(),et.current();},[eb,ev,ek]);Y.current=ex;let ew=(0,v.useCallback)(()=>{G.current||ex();},[ex]),eC=(0,v.useCallback)(()=>{void 0===H.current||void 0===A.current||K.current||(void 0!==Z.current&&clearTimeout(Z.current),Z.current=setTimeout(()=>Y.current(),1600));},[]);Q.current=(0,v.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,v.useCallback)(e=>function(e,t){let n=!1;for(let r of e)(0,C.reportClientDiagnostic)(`[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:()=>Q.current(),emitBackchannel:()=>eS===null||eS===void 0?void 0:eS(),beginRecovery:()=>X.current()}),[eS]);let eD=(0,v.useRef)(!1);(0,v.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 e_=(0,v.useCallback)(e=>{void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0),J.current=!0,en.current=void 0,H.current=void 0,d((0,e7.boundedRealtimeTranscriptText)(e)),ev();},[ev]),eE=(0,v.useCallback)((e,t,n)=>{en.current=void 0,H.current={baseTurnId:e.fallbackTurnId,text:t,deliver:n},d(t),eC();},[eC]),eA=(0,v.useCallback)((e,t)=>{var _b$current,_r$baseTurnId,_r$deliver;if(J.current)return void ev();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,ev();return;}let r=H.current,i=tm(r===null||r===void 0?void 0:r.text,t);(0,e7.realtimeTranscriptByteLength)(i)>e7.MAX_REVIEWABLE_REALTIME_TRANSCRIPT_BYTES?void 0===r?e_(i):(ex(),G.current||((0,e7.realtimeTranscriptByteLength)(t)>e7.MAX_REVIEWABLE_REALTIME_TRANSCRIPT_BYTES?e_(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);},[e_,ex,eE,ev]),eM=(0,v.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,o=$.current;if(!o.has(r)){if(o.size>=32){let e=o.values().next().value;void 0!==e&&o.delete(e);}o.add(r);}W.current.delete(r),V.current.delete(r),q.current.delete(r),U.current===r&&(U.current=void 0);}else{let t=tk(e.text);if(eo.current===t)return;eo.current=t;}let s=ey();void 0!==r&&(t=JSON.stringify(["canonical-realtime-turn-v1",i=ei.current,r]),n=(0,e4.canonicalVoiceSha256Hex)(t),s.fallbackTurnId=`client-turn-${i}-${n}`),J.current||d(void 0),eA(s,e.text);},[ey,eA]),eN=(0,v.useCallback)(e=>{var _e$itemId2,_V$current$get,_q$current$get,_V$current$get2,_H$current3;let t=(_e$itemId2=e.itemId)!==null&&_e$itemId2!==void 0?_e$itemId2:"__current",n=(_V$current$get=V.current.get(t))!==null&&_V$current$get!==void 0?_V$current$get:"";if(!V.current.has(t)&&V.current.size>=32)return void ev();let r=((_q$current$get=q.current.get(t))!==null&&_q$current$get!==void 0?_q$current$get:0)+(0,e7.realtimeTranscriptByteLength)(e.delta);if(r>e7.MAX_REVIEWABLE_REALTIME_TRANSCRIPT_BYTES){var _H$current2;let r=(0,e7.boundedRealtimeTranscriptText)(`${n}${e.delta}`);V.current.set(t,r),q.current.set(t,(0,e7.realtimeTranscriptByteLength)(r)),U.current=t,void 0!==H.current&&ex(),G.current||e_(tm((_H$current2=H.current)===null||_H$current2===void 0?void 0:_H$current2.text,r));return;}U.current=t,V.current.set(t,`${n}${e.delta}`),q.current.set(t,r);let i=tk((_V$current$get2=V.current.get(t))!==null&&_V$current$get2!==void 0?_V$current$get2:"");i.length>0&&(d(tm((_H$current3=H.current)===null||_H$current3===void 0?void 0:_H$current3.text,i)),ey());},[ey,ex,e_,ev]),eT=(0,v.useCallback)(e=>{var _V$current$get3,_H$current4;let t=e!==null&&e!==void 0?e:U.current;if(void 0===t||W.current.has(t))return;let n=tk((_V$current$get3=V.current.get(t))!==null&&_V$current$get3!==void 0?_V$current$get3:"");n.length>0&&d(tm((_H$current4=H.current)===null||_H$current4===void 0?void 0:_H$current4.text,n));},[]),eO=(0,v.useCallback)(()=>{eo.current=void 0,J.current=!1,K.current||(K.current=!0),eg(),eu({kind:"user-speech-start"});},[eu,eg]),eR=(0,v.useCallback)(()=>{K.current=!1,eC(),eu({kind:"user-end-of-turn"});},[eu,eC]),eF=(0,v.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:U.current)!==null&&_ref3!==void 0?_ref3:"__current",n=tm(V.current.get(t),(_e$reviewText=e.reviewText)!==null&&_e$reviewText!==void 0?_e$reviewText:"");if(0===n.length){J.current=!0,ev();return;}V.current.set(t,(0,e7.boundedRealtimeTranscriptText)(n)),U.current=t,void 0!==((_H$current5=H.current)===null||_H$current5===void 0?void 0:_H$current5.text)&&ex(),G.current||e_(n);},[eu,ex,e_,eT,ev]),ej=(0,v.useCallback)(e=>{var _E$current4,_E$current5,_E$current6;var t;if(G.current)return;let n=(0,e7.parseRealtimeVoiceEvent)(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":j.current={...j.current,sessionUpdated:!0},(_E$current4=E.current)!==null&&_E$current4!==void 0&&_E$current4.mark("session_updated"),ed();return;case"user-speech-start":(_E$current5=E.current)!==null&&_E$current5!==void 0&&_E$current5.mark("user_speech_start"),eO();return;case"user-speech-stop":(_E$current6=E.current)!==null&&_E$current6!==void 0&&_E$current6.mark("vad_stop"),eR();return;case"user-transcript-committed":eM(n);return;case"user-transcript-delta":eN(n);return;case"user-transcript-failed":eF(n);return;case"error":eT(),el.current(n.message);return;}},[eN,eO,eM,eR,eF,ed,eT]),eB=(0,v.useCallback)(()=>{void 0!==ea.current&&(clearTimeout(ea.current),ea.current=void 0);},[]),eL=(0,v.useCallback)(()=>{void 0!==P.current&&(clearTimeout(P.current),P.current=void 0);},[]),eP=(0,v.useCallback)(()=>{eB(),c(!0),ea.current=setTimeout(()=>{ea.current=void 0,ec.current&&c(!1);},300);},[eB]),e$=(0,v.useCallback)((e={})=>{var _e$discardControl,_N$current,_M$current;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!==es.current&&(clearTimeout(es.current),es.current=void 0),eL(),t&&(z.current=0),void 0!==Z.current&&(clearTimeout(Z.current),Z.current=void 0),ec.current&&!0!==e.teardown||(H.current=void 0),eB(),!0!==e.teardown&&c(!1);let n=A.current;A.current=void 0,m.current=void 0,g.current=void 0,n!==null&&n!==void 0&&n.close(),(_M$current=M.current)!==null&&_M$current!==void 0&&_M$current.close({resumable:!t}),t&&(M.current=void 0,ei.current=ty(),er.current=0),ep({preserveFinalTranscriptDedupe:!t,preservePartialTranscript:!0===e.preservePartialTranscript,suppressUiUpdates:!0===e.teardown}),ef();},[eB,eL,ef,ep]);et.current=()=>{e$({preservePartialTranscript:!0});};let eV=(0,v.useCallback)(()=>{if(void 0!==es.current&&(clearTimeout(es.current),es.current=void 0),!ec.current||(ex(),G.current))return;let e=z.current;(e$({discardControl:!1}),e>=ez.DEFAULT_VOICE_PROTOCOL_TIMEOUTS.maxReconnectAttempts)?n({type:"error",reason:"connection-failed",message:"Real-time voice connection was lost."}):(z.current=e+1,P.current=setTimeout(()=>{var _R$current;P.current=void 0,ec.current&&((_R$current=R.current)===null||_R$current===void 0?void 0:_R$current.call(R));},Math.min(ez.DEFAULT_VOICE_PROTOCOL_TIMEOUTS.reconnectBackoffInitialMs*2**e,ez.DEFAULT_VOICE_PROTOCOL_TIMEOUTS.reconnectBackoffMaxMs)));},[e$,ex]);X.current=(0,v.useCallback)(()=>{var _es$current;(_es$current=es.current)!==null&&_es$current!==void 0?_es$current:es.current=setTimeout(eV,5e3);},[eV]);let eq=(0,v.useCallback)(()=>{eu({kind:"provider-failure",recoverable:!0});},[eu]),eW=(0,v.useCallback)(()=>{eu({kind:"provider-failure",recoverable:!0}),void 0!==es.current&&(clearTimeout(es.current),es.current=void 0),eV();},[eu,eV]);el.current=(0,v.useCallback)(e=>{ex(),G.current||(e$({preservePartialTranscript:!0}),eu({kind:"provider-failure",recoverable:!1}),n({type:"error",reason:"connection-failed",message:e}));},[eu,e$,ex]);let eK=(0,v.useCallback)(()=>{void 0!==F.current&&clearTimeout(F.current),L.current||(F.current=setTimeout(()=>{F.current=void 0,ec.current&&!L.current&&eW();},ez.DEFAULT_VOICE_PROTOCOL_TIMEOUTS.signalingMs));},[eW]);(0,v.useEffect)(()=>{var _A$current3,_A$current3$setInputM;(_A$current3=A.current)===null||_A$current3===void 0||(_A$current3$setInputM=_A$current3.setInputMuted)===null||_A$current3$setInputM===void 0||_A$current3$setInputM.call(_A$current3,s);},[s]);let eH=(0,v.useCallback)(()=>{G.current?e$({preservePartialTranscript:!0}):(ex(),G.current||(e$(),n({type:"reset"})));},[e$,ex]),eG=(0,v.useCallback)(()=>{var _w$current,_E$current7,_E$current8,_M$current2;if(void 0!==A.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(G.current)return void ev();if(!T.current){n({type:"requesting"});let e=new AbortController();N.current=e,O.current().then(()=>{var _R$current2;ec.current&&!e.signal.aborted&&N.current===e&&(T.current=!0,N.current=void 0,(_R$current2=R.current)===null||_R$current2===void 0?void 0:_R$current2.call(R));}).catch(t=>{if(!ec.current||e.signal.aborted||N.current!==e)return;e$({discardControl:!1});let{reason:r,message:i}=tv(t);n({type:"error",reason:r,message:i});});return;}(_E$current7=E.current)!==null&&_E$current7!==void 0&&_E$current7.reset(),(_E$current8=E.current)!==null&&_E$current8!==void 0&&_E$current8.mark("mic_click"),n({type:"requesting"}),ef(),D.current=S.current,m.current=f.current,g.current=b.current;let e=new AbortController();N.current=e;let t=h(),r=(_M$current2=M.current)!==null&&_M$current2!==void 0?_M$current2:k();M.current=r,t.connect({signal:e.signal}).then(async t=>{var _E$current9,_t$setInputMuted,_t$onLocalVoiceActivi,_t$onDataChannelEvent,_E$current10;if(!ec.current||e.signal.aborted||N.current!==e){t.close(),M.current!==r&&r.close();return;}A.current=t;let i=H.current;void 0!==i&&(d(i.text),eC()),(_E$current9=E.current)!==null&&_E$current9!==void 0&&_E$current9.mark("rtc_offer_created"),(_t$setInputMuted=t.setInputMuted)!==null&&_t$setInputMuted!==void 0&&_t$setInputMuted.call(t,s),(_t$onLocalVoiceActivi=t.onLocalVoiceActivity)!==null&&_t$onLocalVoiceActivi!==void 0&&_t$onLocalVoiceActivi.call(t,n=>{if(ec.current&&A.current===t&&!e.signal.aborted){if("speech-onset"===n)return void eO();eR();}}),(_t$onDataChannelEvent=t.onDataChannelEvent)!==null&&_t$onDataChannelEvent!==void 0&&_t$onDataChannelEvent.call(t,n=>{ec.current&&A.current===t&&!e.signal.aborted&&ej(n);}),void 0!==t.onDataChannelStateChange?(j.current={...j.current,requiresDataChannelAck:!0},t.onDataChannelStateChange(n=>{if(ec.current&&A.current===t&&!e.signal.aborted){if("open"===n){var _E$current0;j.current={...j.current,dataChannelOpen:!0},(_E$current0=E.current)!==null&&_E$current0!==void 0&&_E$current0.mark("datachannel_open"),eh(),ed();return;}"closed"===n&&eq();}})):j.current={...j.current,dataChannelOpen:!0,sessionUpdated:!0,requiresDataChannelAck:!1},em(),t.onConnectionStateChange(n=>{var _E$current1;ec.current&&A.current===t&&!e.signal.aborted&&("connected"===n?(void 0!==es.current&&(clearTimeout(es.current),es.current=void 0),j.current={...j.current,rtcConnected:!0},(_E$current1=E.current)!==null&&_E$current1!==void 0&&_E$current1.mark("rtc_connected"),eu({kind:"recovered"}),ed()):"failed"===n||"closed"===n?eW():"disconnected"===n&&eq());}),n({type:"negotiating"});let o=await r.negotiate(t.offerSdp);!ec.current||A.current!==t||e.signal.aborted||(await t.applyAnswer(o),!ec.current||A.current!==t||e.signal.aborted)?t.close():(j.current={...j.current,answerApplied:!0},(_E$current10=E.current)!==null&&_E$current10!==void 0&&_E$current10.mark("sdp_answer"),eK(),ed());}).catch(t=>{if(!ec.current||e.signal.aborted||N.current!==e)return;ex(),e$({discardControl:!1});let{reason:r,message:i}=tv(t);n({type:"error",reason:r,message:i});});},[h,k,s,ej,e$,ef,em,eh,ed,eu,eO,eR,eC,eK,eq,eW,ex,ev,ek]);(0,v.useEffect)(()=>(R.current=eG,()=>{R.current===eG&&(R.current=void 0);}),[eG]);let eJ=(0,v.useCallback)(()=>{var _w$current2;((_w$current2=w.current)===null||_w$current2===void 0?void 0:_w$current2.call(w))===!1?ek():(z.current=0,G.current&&(G.current=!1,ex(),G.current)||(ex(),e$({discardControl:!1}),n({type:"reset"}),eG()));},[e$,ex,eG,ek]),eZ=(0,v.useCallback)(()=>{eu({kind:"user-interrupt"});},[eu]),eY=(0,v.useCallback)(()=>{let e=!s;e?(eB(),c(!1)):eP(),a(e);},[eP,eB,s]);return(0,v.useEffect)(()=>{var _e$chatContext4;let t=(_e$chatContext4=e.chatContext)===null||_e$chatContext4===void 0?void 0:_e$chatContext4.chatId;y.current!==t&&(y.current=t,(void 0!==A.current||void 0!==N.current||void 0!==P.current||void 0!==es.current||void 0!==H.current)&&eH());},[(_e$chatContext5=e.chatContext)===null||_e$chatContext5===void 0?void 0:_e$chatContext5.chatId,eH]),(0,v.useEffect)(()=>(ec.current=!0,()=>{ew(),ec.current=!1,e$({teardown:!0});}),[e$,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&&!s&&!l&&"listening"===i.state,speaking:"speaking"===i.state,canInterrupt:"speaking"===i.state||"thinking"===i.state,muted:s,partialUserTranscript:u,retrieving:(_e$retrieving=e.retrieving)!==null&&_e$retrieving!==void 0?_e$retrieving:!1,start:eG,stop:eH,retry:eJ,interrupt:eZ,toggleMute:eY};}({chatContext:function(e){if(void 0!==e)return{chatId:e.id};}(z),canStartCapture:ti,onCanonicalUserTurn:e$,onUserSpeechStart:e6,assistantSpeaking:eF.snapshot.speaking,retrieving:to}),ta=eC&&"batch"===ea.capture,tl=ea.available&&void 0!==z&&H,th=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";}}(eF.snapshot.phase),tp=ta?void 0!==eJ.error||"error"===eJ.dictation.phase?"error":eJ.preparing||"requesting"===eJ.dictation.phase?"requesting":ta?"connected":"idle":ts.phase,tf=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:eC,available:tl,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:tp,turnState:(l="idle"!==th?th:eJ.waitingForAnswer||"transcribing"===eJ.dictation.phase||"finalizing"===eJ.dictation.phase?"thinking":"recording"===eJ.dictation.phase?"listening":"idle",c=ts.turnSnapshot.state,ta?l:"idle"===th?c:th),muted:!ta&&ts.muted}),batchActive:ta,batchDialogue:eJ,playback:eF,realtimeVoice:ts,chatHasError:void 0!==B,sending:b,sendStatus:x,retrieving:to}),[t_,tE]=(0,v.useState)("");(0,v.useEffect)(()=>{if(!tf.active)return void tE("");let e=tj[tf.state],t=setTimeout(()=>{tE(e);},400);return()=>clearTimeout(t);},[tf.active,tf.state]);let tA=(0,v.useCallback)(()=>{!tl||(eP(),ed(null),ep.current=void 0,ea.enter()&&(ep.current=z===null||z===void 0?void 0:z.id,ey.current=ea.capture,"batch"===ea.capture?eZ():ts.start()));},[z===null||z===void 0?void 0:z.id,eZ,eP,ea,tl,ts]),tM=(0,v.useCallback)(()=>{let e=void 0!==ep.current,t=ey.current;ep.current=void 0,ey.current="none",e&&(eD.current+=1,"batch"===t?eY():ts.stop(),eF.stop(),ed(null)),ea.leave();},[eY,eF,ts,ea]),tN=(0,v.useCallback)(()=>{if(!ta||void 0===eJ.failedTranscript)return;let e=eJ.failedTranscript;tM(),eo(e);},[ta,eJ.failedTranscript,tM,eo]);(0,v.useEffect)(()=>{eC||(eb||ea.active)&&tM();},[tM,ea.active,eC,eb]);let tT=(0,v.useRef)(!1),tO=(0,v.useCallback)(()=>{tT.current=!0,eC?tM():tA();},[eC,tA,tM]),tR=(0,v.useRef)(eC);(0,v.useEffect)(()=>{if(eC&&"error"===tp){tT.current=!1;return;}!function(e,_ref4){let{active:t,previousActiveRef:n,restoreFocusRef:r,voiceDialogButton:i,normalVoiceDialogButton:o}=e;n.current===t||(n.current=t,r.current&&(r.current=!1,(_ref4=t?i:o)===null||_ref4===void 0?void 0:_ref4.focus()));}({active:eC,previousActiveRef:tR,restoreFocusRef:tT,voiceDialogButton:en.current,normalVoiceDialogButton:er.current});},[tp,eC]);let tI=(0,v.useMemo)(()=>ug(z),[z]),tF=tI.map(e=>e.root).join("\x01"),[tB,tz]=(0,v.useState)((_tI$0$root=(_tI$=tI[0])===null||_tI$===void 0?void 0:_tI$.root)!==null&&_tI$0$root!==void 0?_tI$0$root:""),[tP,t$]=(0,v.useState)(null),[tV,tq]=(0,v.useState)(null),[tW,tU]=(0,v.useState)(null),[tK,tH]=(0,v.useState)(0),[tG,tJ]=(0,v.useState)([]),tZ=null!==tP&&tI.length>0,tQ=function(e,t,n){let r=(0,O.useOptionalWidgetTranslate)(),i=r("chat.repository.searchIdle"),[o,s]=(0,v.useState)([]),[a,l]=(0,v.useState)(!1),[c,u]=(0,v.useState)(i),[d,h]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!e){l(!1),s([]),u(i),h(null);return;}let o=n.trim();if(0===t.length||0===o.length){l(!1),s([]),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,E.fetchFilesSearch)(t,o,24,{signal:a.signal}).then(e=>{if(!c)if(s(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||(s([]),h(ub(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:o,searching:a,message:c,error:d};}(tZ,tB,(_tP$query=tP===null||tP===void 0?void 0:tP.query)!==null&&_tP$query!==void 0?_tP$query:"");(0,v.useEffect)(()=>{var _tI$0$root2,_tI$2;if(0===tI.length){tz(""),t$(null);return;}tI.some(e=>e.root===tB)||tz((_tI$0$root2=(_tI$2=tI[0])===null||_tI$2===void 0?void 0:_tI$2.root)!==null&&_tI$0$root2!==void 0?_tI$0$root2:"");},[tF,tI,tB]),(0,v.useEffect)(()=>{tH(0);},[tP===null||tP===void 0?void 0:tP.query,tQ.results]),(0,v.useEffect)(()=>{tJ(e=>{var t;return function(e){let t=new Set(),n=[];for(eg.lastIndex=0;;){var _r$;let r=eg.exec(e);if(null===r)break;let i=ef((_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:y,selectedRoot:tB,roots:tI,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?uy(r,"draft"):n!==null&&n!==void 0?n:function(e,t,n,_n$0$root,_n$,_o$at){let r=ef(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 o=r.split("/").filter(e=>e.length>0),s=(_o$at=o.at(-1))!==null&&_o$at!==void 0?_o$at:r,a=o.length>1?o.slice(0,-1).join("/"):"";return{id:em(i,r),root:i,path:r,name:s,directory:a,verified:!1,source:"draft"};}(e,t.selectedRoot,t.roots);}).filter(e=>null!==e);});},[y,tF,tI,tQ.results,tB]);let tX=(0,v.useCallback)((e,t)=>{if(0===tI.length)return void t$(null);let n=uv(e,t);t$(n),null!==n&&tU(null);},[tI.length]),t0=(0,v.useCallback)(async e=>{if(void 0!==z){tq(e.path),tU(null);try{var _n$current$selectionS,_n$current2;let t=function(e,t,n,r=Date.now){let i=ef(n);if(0===i.length)throw Error("EMPTY_REPOSITORY_FILE_SELECTION");let o=um(e),s=[],a=!1,l=!1;for(let n of o){var _n$root;let o=(_n$root=n.root)!==null&&_n$root!==void 0?_n$root:e.projectPath;if("files"===n.kind&&o===t){if(a=!0,n.relativePaths.includes(i)){s.push(n);continue;}if(n.relativePaths.length>=50)throw Error("REPOSITORY_FILE_SCOPE_LIMIT");s.push({...n,root:t,relativePaths:[...n.relativePaths,i],connectedAtMs:r()}),l=!0;continue;}s.push(n);}return a||(s.push({kind:"files",root:t,relativePaths:[i],connectedAtMs:r()}),l=!0),{scopes:s,changed:l};}(z,e.root,e.path);if(t.changed){let e=await(0,m.updateGroundingScopes)(z,{connectedScopes:t.scopes},P);P(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:y.length,i=tP!==null&&tP!==void 0?tP:uv(y,r),o=function(e,t,n){let r,i,o,s;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=e.slice(t.end),s=0!==o.length&&/^[\s.,;:!?)}\]]/u.test(o)?r:`${r} `,{value:`${i}${s}${o}`,cursor:i.length+s.length};}(y,i,e.path);tJ(t=>{var n;return n=uy(e),t.some(e=>e.id===n.id)?t:[...t,n];}),D(o.value),t$(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(o.cursor,o.cursor);});}catch(e){tU(ub(e,p));}finally{tq(null);}}},[z,y,P,tP,D,p,n]),t1=(0,v.useCallback)(e=>{let t=tG.find(t=>t.id===e);if(void 0!==t){var r,i;let o;tJ(t=>t.filter(t=>t.id!==e)),D((r=t.path,0===(o=y.replace((i=r,RegExp(String.raw`(^|\s)@${i.replace(/[.*+?^${}()|[\]\\]/gu,String.raw`\$&`)}(?=$|\s)`,"gu")),"$1").replace(/[ \t]{2,}/gu," ")).trim().length?"":o)),requestAnimationFrame(()=>{var _n$current5;(_n$current5=n.current)===null||_n$current5===void 0||_n$current5.focus();});}},[y,tG,D,n]),t2=(0,v.useCallback)((e,t)=>{D(e),t<0?t$(null):tX(e,t);},[D,tX]),t3=(0,v.useCallback)((e,t)=>{null!==tP&&(t<0?t$(null):tX(e,t));},[tP,tX]),t6=(0,v.useCallback)((e,t)=>{!(tZ&&function(e,t){let{results:n,highlightedIndex:r,setHighlightedIndex:i,closeMention:o,pickResult:s}=t;if("Escape"===e.key)return e.preventDefault(),o(),!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&&s(t),!0;}return!1;}(e,{results:tQ.results,highlightedIndex:tK,setHighlightedIndex:tH,closeMention:()=>t$(null),pickResult:e=>{t0(e);}}))&&(0,tY.composerEnterSubmits)(e)&&_({text:t,clearDraftOnAdmission:!0});},[t0,tK,tZ,tQ.results,_]),t5=["cmp-box",o?"cmp-box-compact":"",eC?tL.default.voiceDialogBox:""].filter(Boolean).join(" "),t4=(0,v.useCallback)(e=>{e===null||e===void 0||e.toggleAttribute("inert",eC);},[eC]),t9=(0,v.useCallback)(e=>{e===null||e===void 0||e.toggleAttribute("inert",!eC);},[eC]),t8=tf.active?{dataVoiceAura:"on",dataVoiceAuraState:tf.state,dataVoiceAuraIntensity:tf.intensity}:{dataVoiceAura:void 0,dataVoiceAuraState:void 0,dataVoiceAuraIntensity:void 0},t7=(u=tQ.results.length,tZ&&u>0?cK:void 0);return(0,f.jsxs)("div",{className:t5,"data-voice-aura":t8.dataVoiceAura,"data-voice-aura-state":t8.dataVoiceAuraState,"data-voice-aura-intensity":t8.dataVoiceAuraIntensity,children:[(0,f.jsx)("div",{ref:t4,className:`${tL.default.composerLayer} ${tL.default.normalLayer}`,"data-composer-layer":"normal","aria-hidden":!!eC||void 0,children:(0,f.jsx)(tY.ComposerShell,{value:y,placeholder:t,input:(0,f.jsx)(cR,{value:y,placeholder:t,inputRef:n,documentKey:(_z$id=z===null||z===void 0?void 0:z.id)!==null&&_z$id!==void 0?_z$id:"new-chat",ariaLabel:p("chat.messageLabel"),ariaControls:t7,maxLength:k.MAX_DESKTOP_CHAT_INPUT_CHARS,onChange:t2,onSelect:t3,onKeyDown:t6,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)(ew,{enabled:G,onFiles:J}),belowInput:(0,f.jsxs)(f.Fragment,{children:[tZ?(0,f.jsx)(uR,{roots:tI,selectedRoot:tB,onRootChange:e=>{tz(e),tH(0);},search:tQ,pickingPath:tV,highlightedIndex:tK,pickError:tW,onPick:e=>{t0(e);},onClose:()=>t$(null)}):null,(0,f.jsx)(uw,{references:tG,onRemove:t1}),(0,f.jsx)(ex,{attachments:I,onRemove:j}),(0,f.jsx)(eS,{reason:$,mimeType:q}),(0,f.jsx)(uI,{voiceDialogActive:eC,sendStatus:x,voiceDictationVisible:Y,dictation:es,onAfterDictationDiscard:()=>{var _ee$current;return(_ee$current=ee.current)===null||_ee$current===void 0?void 0:_ee$current.focus();}})]}),footer:(0,f.jsx)(uA,{session:g,ready:e,selectedModelCapability:U,onAttachFiles:J,controlsNarrow:s,barCompact:a,voiceDictationVisible:Y,dictation:es,micButtonRef:ee,voiceSpeechOutputVisible:X,voiceMuted:eF.snapshot.muted,onToggleVoiceMute:eF.toggleMute,playbackButtonRef:et,voiceDialogAvailable:tl,voiceDialogActive:!1,onToggleVoiceDialog:tO,voiceDialogButtonRef:er})})}),(0,f.jsx)(uL,{voiceAuraActive:tf.active,announcedVoiceHeadline:t_,voiceDialogAvailable:tl,voiceLayerRef:t9,voiceDialogActive:eC,partialUserTranscript:ts.partialUserTranscript,realtimeVoiceMuted:ts.muted,realtimeVoiceController:ts,batchDialogue:eJ,batchActive:ta,onUseFailedTranscript:tN,onToggleVoiceMute:ts.toggleMute,playbackButtonRef:et,onToggleVoiceDialog:tO,onDismissVoiceError:tM,voiceDialogButtonRef:en,compact:s,pendingAttachments:I,onRemoveAttachment:j})]});});function uP({minimal:e=!1}){let t=(0,O.useOptionalWidgetTranslate)();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 u$(){let e=(0,O.useOptionalWidgetTranslate)();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)(c$,{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 uV(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 uq(e){var _e$localKnowledgeScop,_e$localKnowledgeScop2;if(uV(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}`:uU(e)?"files":"none";}function uW(e){return void 0!==e.localKnowledgeScopes?e.localKnowledgeScopes:void 0!==e.localKnowledgeScope?[e.localKnowledgeScope]:[];}function uU(e){return void 0!==e&&(void 0!==e.connectedScope||void 0!==e.connectedScopes&&e.connectedScopes.length>0);}function uK(e){var _e$gitChangeScopes;return uU(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 uH(e,t){return(0,tq.formatUserError)(e,t("chat.error.scopeUpdate"));}function uG(e,t){if(void 0===e)return{};let{label:n,description:r}=(0,t$.knowledgePodGuidanceText)(e,t);return{badge:n,description:r};}let uJ=new Set(["ready","degraded"]);function uZ(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||uJ.has(t));}async function uY(e,t,n){let r=uV(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,m.updateGroundingScopes)(e,{connectedScopes:null,localKnowledgeScopes:null},n);n(i);}async function uQ(e,t){let n=await(0,m.updateGroundingScopes)(e,{localKnowledgeScopes:null},t);t(n);}async function uX(e,t,n){let r={kind:"capsule-set",capsuleSetId:t,connectedAtMs:Date.now()},i=uW(e),o=i.some(e=>"capsule-set"===e.kind&&e.capsuleSetId===r.capsuleSetId)?i:[...i,r],s=await(0,m.updateGroundingScopes)(e,{localKnowledgeScopes:o},n);n(s);}async function u0(e,t,n){let r={kind:"capsule",capsuleId:t,connectedAtMs:Date.now()},i=uW(e),o=i.some(e=>"capsule"===e.kind&&e.capsuleId===r.capsuleId)?i:[...i,r],s=await(0,m.updateGroundingScopes)(e,{localKnowledgeScopes:o},n);n(s);}async function u1(e,t,n,r){return"none"===e?uY(t,n,r):"files"===e?uQ(t,r):e.startsWith("capsule-set:")?uX(t,e.slice(12),r):e.startsWith("capsule:")?u0(t,e.slice(8),r):void 0;}function u2(e,t){return t?{...e,disabled:!0}:e;}function u3({value:e,loading:t,disabled:n,liveFilesAvailable:r,capsuleChoices:i,capsuleSetChoices:o,t:s,onOpen:a,onValueChange:l}){let c,u=[...(c=[{value:"none",label:s("chat.grounding.modelOnly"),disabled:t},{value:"files",label:s("chat.grounding.liveFiles"),disabled:t||!r,...(r?{}:{description:s("chat.grounding.liveFilesUnavailableHint")})}],"multi"===e&&c.push({value:"multi",label:s("chat.grounding.multiple"),disabled:!0}),c),...i.map(e=>u2(e,t)),...o.map(e=>u2(e,t))];return(0,f.jsx)(es.default,{triggerClassName:"scope-grounding-select",value:e,disabled:n,ariaLabel:s("chat.grounding.mode"),menuTitle:s("chat.grounding.strategy"),onOpen:a,sections:[{options:u}],onValueChange:l});}function u6({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 u5({chat:e,onChatChanged:t,catalog:n,connected:r}){let i=(0,O.useOptionalWidgetTranslate)(),o=(0,t$.useLocalKnowledgeTranslate)(),{loading:s,refresh:a,refreshOnPickerOpen:l}=n,[c,u]=(0,v.useState)(!1),[d,h]=(0,v.useState)(null);async function p(n){u(!0),h(null);try{await u1(n,e,i,t);}catch(e){h(uH(e,i));}finally{u(!1);}}let m=uq(e),{capsuleChoices:g,capsuleSetChoices:y,catalogEmpty:k}=function(e,t,n,r){let i,o,{capsules:s,capsuleSets:a,loading:l,loadError:c}=t,u=l?[]:s.filter(cI.isReadyCapsule),d=l?[]:a.filter(uZ),h=(i=d.map(e=>{var _e$knowledgePod2;return{value:`capsule-set:${e.id}`,label:n("chat.grounding.capsuleSet",{name:e.displayName}),...uG((_e$knowledgePod2=e.knowledgePod)===null||_e$knowledgePod2===void 0?void 0:_e$knowledgePod2.guidance,r)};}),!(o=uq(e)).startsWith("capsule-set:")||i.some(e=>e.value===o)?i:[...i,{value:o,label:n("chat.grounding.unavailable",{label:"Knowledge Pod Set"}),disabled:!0}]);return{capsuleChoices:function(e,t,n,r,i){let o,s=t.map(e=>{var _e$knowledgePod3;return{value:`capsule:${e.id}`,label:r("chat.grounding.capsule",{name:e.displayName}),...uG((_e$knowledgePod3=e.knowledgePod)===null||_e$knowledgePod3===void 0?void 0:_e$knowledgePod3.guidance,i)};}),a=uq(e);return!a.startsWith("capsule:")||s.some(e=>e.value===a)?s:[...s,void 0===(o=n.find(e=>`capsule:${e.id}`===a))?{value:a,label:r("chat.grounding.unavailable",{label:"Knowledge Pod"}),disabled:!0}:{value:a,label:(0,cI.capsuleNameWithState)(o,r,e=>r("chat.grounding.capsule",{name:e})),disabled:!0}];}(e,u,s,n,r),capsuleSetChoices:h,catalogEmpty:!l&&null===c&&s.every(e=>!(0,cI.isReadyCapsule)(e))&&0===d.length};}(e,n,i,o),b=uU(e),x=null===n.loadError?null:uH(n.loadError,i),w=c||s;return(0,f.jsxs)("div",{className:"scope-grounding","data-connected":r?"true":"false",children:[(0,f.jsx)("span",{className:"scope-grounding-label mono",children:i("chat.grounding.label")}),(0,f.jsx)(u3,{value:m,loading:s,disabled:w,liveFilesAvailable:b,capsuleChoices:g,capsuleSetChoices:y,t:i,onOpen:l,onValueChange:e=>{p(e);}}),(0,f.jsx)(u6,{loading:s,empty:k,error:d!==null&&d!==void 0?d:x,onRetry:null===d&&null!==x?a:void 0,t:i})]});}let u4=(0,v.memo)(function({chat:e,onChatChanged:t,memoryControl:n,pendingGitChangeComparisons:r}){let i=(0,O.useOptionalWidgetTranslate)(),o=(0,cI.useKnowledgeCatalog)(uW(e)),s=r!==null&&r!==void 0?r:[],a=uK(e)||s.length>0;return(0,f.jsxs)("div",{className:"chat-scope-header","data-grounded":a?"true":"false",children:[(0,f.jsx)(u5,{chat:e,onChatChanged:t,catalog:o,connected:a}),(0,f.jsx)(tP.ConnectedScopePill,{chat:e,onDisconnect:t}),(0,f.jsx)(tG,{chat:e,onDisconnect:t,labels:function(e,t){let n=new Map();for(let r of e.capsules)n.set(`capsule:${r.id}`,(0,cI.capsuleNameWithState)(r,t));for(let t of e.capsuleSets)n.set(`set:${t.id}`,t.displayName);return n;}(o,i),labelsSettled:!o.loading&&null===o.loadError}),(0,f.jsx)(tz.GitChangeScopePill,{chat:e,pendingComparisons:s,onDisconnect:t,onRefreshed:t}),void 0!==n?(0,f.jsx)("div",{className:"chat-scope-header-actions",children:n}):null]});});function u9({action:e,busy:t,error:n,runAction:r,acceptCandidate:i,rejectCandidate:o,onDismissError:s}){let a=(0,O.useOptionalWidgetTranslate)();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(()=>o(e.proposalId),a("chat.memory.rejected"),a("chat.memory.rejectError"));},children:a("chat.memory.reject")})]}),void 0!==n?(0,f.jsx)(D.ErrorNoticeFromError,{error:n,fallback:a("chat.error.memoryUpdate"),onDismiss:s}):null]}):null]});}function u8({action:e}){let t=(0,O.useOptionalWidgetTranslate)();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 u7({action:e,busy:t,confirmForget:n,forgetConfirmText:r,executeForget:i,clearError:o,setConfirmForget:s,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||(o(),s(!1),a(""));},children:l("common.cancel")})]}):(0,f.jsx)("button",{type:"button",disabled:t,"aria-busy":t,onClick:()=>{t||(o(),s(!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 de({action:e,busy:t,error:n,runAction:r,forgetMemoryAction:i,clearError:o}){let s=(0,O.useOptionalWidgetTranslate)(),[a,l]=(0,v.useState)(!1),[c,u]=(0,v.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:s("chat.memory.forgetDetected")}),(0,f.jsx)("span",{children:e.requiresConfirmation?s("chat.memory.confirmationRequired"):e.memoryId})]}),(0,f.jsx)("p",{children:s("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)(u7,{action:e,busy:t,confirmForget:a,forgetConfirmText:c,executeForget:()=>{t||e.requiresConfirmation&&"FORGET"!==c||r(()=>i(e.memoryId).then(()=>{l(!1),u("");}),s("chat.memory.forgetCompleted"),s("chat.memory.forgetError"));},clearError:o,setConfirmForget:l,setForgetConfirmText:u,t:s})}),void 0!==n?(0,f.jsx)(D.ErrorNoticeFromError,{error:n,fallback:s("chat.error.memoryUpdate"),onDismiss:o}):null]});}function dt({action:e}){let t=(0,O.useOptionalWidgetTranslate)();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 dn({action:e,acceptCandidate:t,rejectCandidate:n,forgetMemoryAction:r,onActionSettled:i}){let o=(0,O.useOptionalWidgetTranslate)(),[s,a]=(0,v.useState)(!1),[l,c]=(0,v.useState)(),u=(0,v.useCallback)(()=>c(void 0),[]),d=(0,v.useCallback)((e,t,n)=>{s||(a(!0),c(void 0),e().then(()=>{i(t);}).catch(e=>{c(e instanceof Error?e.message:n);}).finally(()=>a(!1)));},[s,i]);return"candidate"===e.kind?(0,f.jsx)(u9,{action:e,busy:s,error:l,runAction:d,acceptCandidate:t,rejectCandidate:n,onDismissError:u}):"update"===e.kind?(0,f.jsx)(u8,{action:e}):"forget"===e.kind?(0,f.jsx)(de,{action:e,busy:s,error:l,runAction:d,forgetMemoryAction:r,clearError:u}):"rejected"===e.kind?(0,f.jsx)(dt,{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:o("chat.memory.actionNotCreated")})})});}let dr=(0,v.memo)(function({chat:e,busy:t}){return void 0!==e&&uK(e)&&t?(0,f.jsx)("div",{className:"chatw-grounded",children:(0,f.jsx)(_.GroundedAnswer,{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)(cj,{size:16}),e.memoryCount>0?(0,f.jsx)("span",{className:"chat-memory-count","aria-hidden":"true",children:e.memoryCountLabel}):null]});}function ds({enabled:e,onChange:t}){let n=(0,O.useOptionalWidgetTranslate)()(e?"chat.memory.disableForChat":"chat.memory.enableForChat");return(0,f.jsx)("button",{type:"button",className:`chat-memory-activation-toggle ui-tip cmp-tip-end ${tL.default.memoryActivationButton}`,"aria-label":n,"aria-pressed":e,"data-enabled":e?"true":"false","data-tip":n,onClick:()=>{t(!e);},children:(0,f.jsx)(cV,{size:16})});}function da(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.floor(t):0;}function dl({budgetTokens:e,setBudgetTokens:t}){let n=(0,O.useOptionalWidgetTranslate)(),r=(0,v.useId)(),i=`${r}-chat-memory-budget`,o=`${r}-chat-memory-budget-help`,s=(0,v.useCallback)(e=>{t(da(e.target.value));},[t]);return(0,f.jsxs)("div",{className:tL.default.memoryBudgetSetting,children:[(0,f.jsx)("label",{htmlFor:i,children:n("memoria.settings.budget")}),(0,f.jsxs)("div",{className:tL.default.memoryBudgetControl,children:[(0,f.jsx)("input",{id:i,type:"number",min:0,step:100,value:e,"aria-describedby":o,onChange:s}),(0,f.jsx)("span",{children:n("memoria.settings.budgetUnit")})]}),(0,f.jsx)("p",{id:o,children:n("memoria.settings.budgetHelp")})]});}let dc=(0,v.memo)(function({latestMemory:e,memoryBudgetTokens:t,setMemoryBudgetTokens:n,acceptCandidate:r,rejectCandidate:i,forgetMemoryAction:o,disclosure:s}){let a=(0,O.useOptionalWidgetTranslate)();return s.open?(0,f.jsx)("section",{className:"chat-memory-panel","aria-label":a("chat.memory.panel"),children:(0,f.jsxs)("div",{id:s.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)(dl,{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)(dn,{action:e,acceptCandidate:r,rejectCandidate:i,forgetMemoryAction:o,onActionSettled:s.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:s.actionStatus})]})}):null;});function du({activeChat:e,replaceChat:t,memoryControl:n,pendingGitChangeComparisons:r,latestMemory:i,memoryBudgetTokens:o,setMemoryBudgetTokens:s,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)(u4,{chat:e,onChatChanged:t,memoryControl:n,pendingGitChangeComparisons:r}):null,void 0!==e?(0,f.jsx)(dc,{latestMemory:i,memoryBudgetTokens:o,setMemoryBudgetTokens:s,acceptCandidate:a,rejectCandidate:l,forgetMemoryAction:c,disclosure:u}):null,d?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsx)(uM,{})}):null,h?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsx)(uN,{})}):null]});}function dd({activeChat:e,effectiveMinimal:t}){return void 0!==e?(0,f.jsx)(uP,{minimal:t}):(0,f.jsx)(u$,{});}function dh({scrollRef:e,stickRef:t,onLogScroll:n,pendingQuestionScrollRef:r,focusedQuestionId:i,setFocusedQuestionId:o,visible:s,hasLiveStreamingAssistant:a,activeChat:l,effectiveMinimal:c,showQuestionMap:u,questionMapItems:d,scrollToQuestion:h,streamingAssistantMessage:p,onOpenRunResult:m,repositoryRoots:g,openRepositoryReference:y,previewWindows:v,windowId:k,sending:b,sendStatus:x,regeneratingMessageId:w,cancelGrounded:C,regenerateMessage:S,cancelSend:D,registerQuestionAnchor:_,lastSentDocuments:E,lastSentImages:A}){let M=(0,O.useOptionalWidgetTranslate)();return(0,f.jsx)("div",{className:"chatw-scroll",ref:e,role:"log","aria-label":M("chat.conversation"),tabIndex:0,onScroll:()=>{n(),t.current&&null!==i&&(r.current=null,o(null));},children:0!==s.length||a?(0,f.jsxs)("div",{className:`chatw-log-shell${u?" chatw-log-shell-with-map":""}`,children:[u?(0,f.jsx)(up,{items:d,onJump:h}):null,(0,f.jsxs)("div",{className:"chatw-log",children:[(0,f.jsx)(uf,{messages:s,streamingAssistantMessage:p,onOpenRunResult:m,repositoryRoots:g,openRepositoryReference:y,previewWindows:v,windowId:k,sending:b,sendStatus:x,regeneratingMessageId:w,activeChat:l,onCancelGrounded:C,onRegenerate:S,onCancelRegenerate:D,showRegenerateControls:!c,registerQuestionAnchor:_,focusedMessageId:i}),(0,f.jsx)(dr,{chat:l,busy:b}),(0,f.jsx)(eD,{documents:E}),(0,f.jsx)(e_,{images:A})]})]}):(0,f.jsx)(dd,{activeChat:l,effectiveMinimal:c})});}function dp({notice:e,onDismiss:t}){let n=(0,O.useOptionalWidgetTranslate)();return(0,f.jsxs)("output",{className:tL.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 df({error:e,clearError:t,notice:n,clearNotice:r}){return void 0!==e?(0,f.jsx)(D.ErrorNoticeFromError,{error:e,fallback:"Could not load chat.",onDismiss:t}):void 0!==n?(0,f.jsx)(dp,{notice:n,onDismiss:r}):null;}function dm({canonicalVoiceTurnRequiresRetry:e,retryPendingCanonicalVoiceTurn:t,discardPendingCanonicalVoiceTurn:n,error:r,clearError:i,notice:o,clearNotice:s}){let a=(0,O.useOptionalWidgetTranslate)();return e?(0,f.jsxs)("div",{className:tL.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)(D.ErrorNoticeFromError,{error:r,fallback:a("chat.error.send"),onDismiss:i}):void 0===o?null:(0,f.jsx)(dp,{notice:o,onDismiss:s});}function dg({visible:e,activeChat:t,suspended:n,effectiveCompact:r,effectiveMinimal:i,effectiveControlsNarrow:o,effectiveBarCompact:s,ready:a,loading:l,onSubmit:c,inputRef:u,error:d,clearError:h,notice:p,clearNotice:m,canonicalVoiceTurnRequiresRetry:g,retryPendingCanonicalVoiceTurn:y,discardPendingCanonicalVoiceTurn:v}){var k;let b=(0,O.useOptionalWidgetTranslate)();return(0,f.jsxs)(f.Fragment,{children:[e.length>0||void 0!==t?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsxs)("form",{className:`composer${r?" composer-chat-compact":""}`,onSubmit:e=>{e.preventDefault(),c();},children:[(0,f.jsx)(uz,{ready:a,placeholder:(k=e.length,b(0===k&&l?"chat.loadingGateway":"chat.composer.placeholder")),inputRef:u,suspended:n,minimal:i,compact:r,controlsNarrow:o,barCompact:s}),(0,f.jsx)(dm,{canonicalVoiceTurnRequiresRetry:g,retryPendingCanonicalVoiceTurn:y,discardPendingCanonicalVoiceTurn:v,error:d,clearError:h,notice:p,clearNotice:m})]})}):null,0===e.length&&void 0===t&&(void 0!==d||void 0!==p)?(0,f.jsx)("div",{className:"chatw-foot",children:(0,f.jsx)(df,{error:d,clearError:h,notice:p,clearNotice:m})}):null]});}function dy({windowId:e,suspended:t=!1,mini:n=!1,minimalChat:r=!1,compact:i=!1,controlsNarrow:o=!1,barCompact:s=!1,workflowCompact:a=!1,linkedRoot:l=null,linkedRoots:c=[],linkedGitChangeComparisons:u=[],openEditorFile:d,previewWindows:h,onOpenRunResult:p}){let m=(0,S.useChatSessionContext)(),g=(0,v.useRef)(null),k=(0,O.useOptionalWidgetTranslate)(),{messages:b,streamingAssistantMessage:x,draft:w,loading:D,sending:_,sendStatus:E,regeneratingMessageId:A,error:M,notice:N,noEligibleModels:T,sendMessage:R,regenerateMessage:I,cancelSend:F,cancelGrounded:j,activeChat:B,canonicalVoiceTurnRequiresRetry:L,retryPendingCanonicalVoiceTurn:z,discardPendingCanonicalVoiceTurn:P,replaceChat:$,memoryEnabled:V,setMemoryEnabled:q,memoryBudgetTokens:W,setMemoryBudgetTokens:U,latestMemory:K,lastSentDocuments:H,lastSentImages:G=[],acceptMemoryCandidate:J,rejectMemoryCandidate:Z,forgetMemoryAction:Y}=m,Q=(0,O.presentChatSessionError)(M,k),X=w.trim().length>0&&!_&&!D&&!T&&!0!==L,ee=(0,v.useMemo)(()=>b.filter(e=>"user"===e.role||"assistant"===e.role&&e.content.length>0||eA(e)),[b]),et=void 0!==x&&x.content.length>0,en=(0,v.useRef)(null),er=(0,v.useMemo)(()=>{var e;let t,n,r,i;return n=new Set((t=ug((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,ed.repositoryReferenceRoots)(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=ep(e),r=ep(t),n.length>0&&r.length>n.length&&r.startsWith(`${n}/`));}));}([...n,...i])).filter(({root:e})=>!n.has(e))];},[B,l,c]),ei=(0,v.useRef)(!1),eo=et?x:ee.length>0?ee.at(-1):void 0,es=void 0===eo?"":eo.content,{stickRef:ea,onScroll:el,resume:ec}=(0,tZ.useFollowNewest)(en,`${String(ee.length)}:${_?"1":"0"}:${String(es.length)}`);(0,v.useEffect)(()=>{_&&!ei.current&&ec(),ei.current=_;},[ec,_]);let{effectiveCompact:eu,effectiveControlsNarrow:eh,effectiveBarCompact:ef}={effectiveCompact:i||n,effectiveControlsNarrow:o||n||r||a,effectiveBarCompact:s||r},em=function(e,_e$context$memories$l){let t=(0,O.useOptionalWidgetTranslate)(),[n,r]=(0,v.useState)(!1),[i,o]=(0,v.useState)(""),s=(0,v.useId)(),a=`${s}-chat-memory-disclosure`,l=(0,v.useRef)(null),c=(0,v.useCallback)(e=>{var _l$current2;o(e),(_l$current2=l.current)===null||_l$current2===void 0?void 0:_l$current2.focus();},[]),u=(0,v.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,v.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]);}(K),eg=(0,v.useMemo)(()=>(0,f.jsxs)("div",{className:tL.default.memoryControls,children:[(0,f.jsx)(ds,{enabled:V,onChange:q}),(0,f.jsx)(di,{disclosure:em})]}),[em,V,q]),ey=(0,v.useRef)(new Map()),[ev,ek]=(0,v.useState)(null),eb=(0,v.useRef)(null),ex=(0,v.useMemo)(()=>ee.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:cY(e.timestamp)};}),[ee]),ew=ex.length>=2,eC=(0,v.useCallback)((e,t)=>{null===t?ey.current.delete(e):ey.current.set(e,t);},[]),eS=(0,v.useCallback)(e=>{ek(e);let t=ey.current.get(e);if(void 0===t){eb.current=e;return;}ea.current=!1,t.scrollIntoView({block:"start",behavior:"smooth"});},[ea]);return(0,v.useEffect)(()=>{let e=eb.current;if(null===e)return;let t=ey.current.get(e);void 0!==t&&(eb.current=null,ea.current=!1,t.scrollIntoView({block:"start",behavior:"smooth"}));},[ev,ea,ee.length]),(0,v.useEffect)(()=>{_&&(eb.current=null,ek(null));},[_]),(0,v.useEffect)(()=>{eb.current=null,ek(null);},[B===null||B===void 0?void 0:B.id]),(0,f.jsxs)("div",{className:`chatw${eu?" chatw-compact":""}${r?" chatw-minimal":""}`,children:[(0,f.jsx)(du,{activeChat:B,replaceChat:$,memoryControl:eg,pendingGitChangeComparisons:u,latestMemory:K,memoryBudgetTokens:W,setMemoryBudgetTokens:U,acceptMemoryCandidate:J,rejectMemoryCandidate:Z,forgetMemoryAction:Y,memoryDisclosure:em,noEligibleModels:T,loading:D}),(0,f.jsx)(dh,{scrollRef:en,stickRef:ea,onLogScroll:el,pendingQuestionScrollRef:eb,focusedQuestionId:ev,setFocusedQuestionId:ek,visible:ee,hasLiveStreamingAssistant:et,activeChat:B,effectiveMinimal:r,showQuestionMap:ew,questionMapItems:ex,scrollToQuestion:eS,streamingAssistantMessage:x,onOpenRunResult:p,repositoryRoots:er,openRepositoryReference:d,previewWindows:h,windowId:e,sending:_,sendStatus:E,regeneratingMessageId:A,cancelGrounded:j,regenerateMessage:I,cancelSend:F,registerQuestionAnchor:eC,lastSentDocuments:H,lastSentImages:G}),(0,f.jsx)(dg,{visible:ee,activeChat:B,suspended:t,effectiveCompact:eu,effectiveMinimal:r,effectiveControlsNarrow:eh,effectiveBarCompact:ef,ready:X,loading:D,onSubmit:()=>{var _g$current2;let e=(_g$current2=g.current)===null||_g$current2===void 0?void 0:_g$current2.currentMarkdown;void 0===e?R():(e!==w&&((0,y.flushSync)(()=>m.setDraft(e)),(0,C.reportClientDiagnostic)("Keiko composer submitted the current editor draft.",{composerActivity:"literal-input-preserved"})),R({text:e,clearDraftOnAdmission:!0}));},inputRef:g,error:Q,clearError:m.clearError,notice:N,clearNotice:m.clearNotice,canonicalVoiceTurnRequiresRetry:!0===L,retryPendingCanonicalVoiceTurn:z,discardPendingCanonicalVoiceTurn:P})]});}e.s(["ChatWindow",0,dy,"ConversationQuestionMap",0,up,"MemoryActionForgetButtons",0,u7,"answerReadingText",0,c5,"copyableMessageText",0,c2,"groundedCitationCeiling",0,ue,"messageForSelectedResponseVersion",0,uo,"normalizeMemoryBudgetInput",0,da,"sendStatusLabel",0,uT,"speakableAnswerText",0,c3,"speechPreparationEvidence",0,c9],63834),e.i(63834),e.s(["ChatWindow",0,dy,"ConversationQuestionMap",0,up,"MemoryActionForgetButtons",0,u7,"answerReadingText",0,c5,"clearKnowledgeCatalogCacheForTests",()=>cI.clearKnowledgeCatalogCacheForTests,"copyableMessageText",0,c2,"groundedCitationCeiling",0,ue,"messageForSelectedResponseVersion",0,uo,"normalizeMemoryBudgetInput",0,da,"rootDisplayName",()=>ed.repositoryRootLabel,"sendStatusLabel",0,uT,"speakableAnswerText",0,c3,"speechPreparationEvidence",0,c9],219);},72117,function(e){e.n(e.i(219));},21179,e=>{e.v({cmpCode:"MarkdownComposer-module__x0BgeG__cmpCode "+e.i(87513).themeTokens,cmpCodeHeader:"MarkdownComposer-module__x0BgeG__cmpCodeHeader",cmpCodeHost:"MarkdownComposer-module__x0BgeG__cmpCodeHost",cmpContinue:"MarkdownComposer-module__x0BgeG__cmpContinue",cmpEditor:"MarkdownComposer-module__x0BgeG__cmpEditor",cmpFallback:"MarkdownComposer-module__x0BgeG__cmpFallback",cmpLanguage:"MarkdownComposer-module__x0BgeG__cmpLanguage",cmpNotice:"MarkdownComposer-module__x0BgeG__cmpNotice",cmpRoot:"MarkdownComposer-module__x0BgeG__cmpRoot"});}]);
|