@recombine-ai/bosun 0.1.10 → 0.2.0-draft
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/build/academy/academy.ts +584 -0
- package/build/academy/csv/index.ts +155 -0
- package/build/academy/data.ts +299 -0
- package/build/academy/emulate-agents.ts +129 -0
- package/build/academy/google-sheets/index.ts +187 -0
- package/build/academy/runPromptTests.cli.ts +99 -0
- package/build/academy/suite.ts +99 -0
- package/build/client/_app/immutable/assets/0.3Ve1RxLg.css +1 -0
- package/build/client/_app/immutable/assets/0.3Ve1RxLg.css.br +0 -0
- package/build/client/_app/immutable/assets/0.3Ve1RxLg.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.C7pCuiHL.css +1 -0
- package/build/client/_app/immutable/assets/3.C7pCuiHL.css.br +0 -0
- package/build/client/_app/immutable/assets/3.C7pCuiHL.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.Baezuvdj.css +1 -0
- package/build/client/_app/immutable/assets/4.Baezuvdj.css.br +0 -0
- package/build/client/_app/immutable/assets/4.Baezuvdj.css.gz +0 -0
- package/build/client/_app/immutable/assets/6.CebW_jOJ.css +1 -0
- package/build/client/_app/immutable/assets/6.CebW_jOJ.css.br +0 -0
- package/build/client/_app/immutable/assets/6.CebW_jOJ.css.gz +0 -0
- package/build/client/_app/immutable/assets/8.f3T7i0UW.css +1 -0
- package/build/client/_app/immutable/assets/8.f3T7i0UW.css.br +0 -0
- package/build/client/_app/immutable/assets/8.f3T7i0UW.css.gz +0 -0
- package/build/client/_app/immutable/assets/AgentSidebar.BEG0l2mN.css +1 -0
- package/build/client/_app/immutable/assets/AgentSidebar.BEG0l2mN.css.br +0 -0
- package/build/client/_app/immutable/assets/AgentSidebar.BEG0l2mN.css.gz +0 -0
- package/build/client/_app/immutable/assets/Link.D7uHGZ0C.css +1 -0
- package/build/client/_app/immutable/assets/Link.D7uHGZ0C.css.br +1 -0
- package/build/client/_app/immutable/assets/Link.D7uHGZ0C.css.gz +0 -0
- package/build/client/_app/immutable/assets/Tab.DrtF13Tg.css +1 -0
- package/build/client/_app/immutable/assets/Tab.DrtF13Tg.css.br +0 -0
- package/build/client/_app/immutable/assets/Tab.DrtF13Tg.css.gz +0 -0
- package/build/client/_app/immutable/chunks/B6Eu_a6G.js +8 -0
- package/build/client/_app/immutable/chunks/B6Eu_a6G.js.br +0 -0
- package/build/client/_app/immutable/chunks/B6Eu_a6G.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B946i1vX.js +1 -0
- package/build/client/_app/immutable/chunks/B946i1vX.js.br +0 -0
- package/build/client/_app/immutable/chunks/B946i1vX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BDr6IUDE.js +1 -0
- package/build/client/_app/immutable/chunks/BDr6IUDE.js.br +0 -0
- package/build/client/_app/immutable/chunks/BDr6IUDE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BJ0PAzRz.js +1 -0
- package/build/client/_app/immutable/chunks/BJ0PAzRz.js.br +0 -0
- package/build/client/_app/immutable/chunks/BJ0PAzRz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BQsXEsya.js +2 -0
- package/build/client/_app/immutable/chunks/BQsXEsya.js.br +0 -0
- package/build/client/_app/immutable/chunks/BQsXEsya.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BVH8cl8Q.js +1 -0
- package/build/client/_app/immutable/chunks/BVH8cl8Q.js.br +0 -0
- package/build/client/_app/immutable/chunks/BVH8cl8Q.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bckf35or.js +1 -0
- package/build/client/_app/immutable/chunks/Bckf35or.js.br +1 -0
- package/build/client/_app/immutable/chunks/Bckf35or.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BcyK4bvI.js +1 -0
- package/build/client/_app/immutable/chunks/BcyK4bvI.js.br +0 -0
- package/build/client/_app/immutable/chunks/BcyK4bvI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BpsvkpCa.js +1 -0
- package/build/client/_app/immutable/chunks/BpsvkpCa.js.br +0 -0
- package/build/client/_app/immutable/chunks/BpsvkpCa.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C7b8kjFl.js +33 -0
- package/build/client/_app/immutable/chunks/C7b8kjFl.js.br +0 -0
- package/build/client/_app/immutable/chunks/C7b8kjFl.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{D5O98MXA.js → C9ihsQgF.js} +2 -2
- package/build/client/_app/immutable/chunks/C9ihsQgF.js.br +6 -0
- package/build/client/_app/immutable/chunks/C9ihsQgF.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CEHtmspK.js +1 -0
- package/build/client/_app/immutable/chunks/CEHtmspK.js.br +0 -0
- package/build/client/_app/immutable/chunks/CEHtmspK.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CHop8m-3.js +1 -0
- package/build/client/_app/immutable/chunks/CHop8m-3.js.br +0 -0
- package/build/client/_app/immutable/chunks/CHop8m-3.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CUWa2xqt.js +1 -0
- package/build/client/_app/immutable/chunks/CUWa2xqt.js.br +0 -0
- package/build/client/_app/immutable/chunks/CUWa2xqt.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ClfaR3Y2.js +1 -0
- package/build/client/_app/immutable/chunks/ClfaR3Y2.js.br +0 -0
- package/build/client/_app/immutable/chunks/ClfaR3Y2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DAgYAbDT.js +3 -0
- package/build/client/_app/immutable/chunks/DAgYAbDT.js.br +0 -0
- package/build/client/_app/immutable/chunks/DAgYAbDT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DBCXNg0T.js +1 -0
- package/build/client/_app/immutable/chunks/DBCXNg0T.js.br +0 -0
- package/build/client/_app/immutable/chunks/DBCXNg0T.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DDncCuU5.js +1 -0
- package/build/client/_app/immutable/chunks/DDncCuU5.js.br +2 -0
- package/build/client/_app/immutable/chunks/DDncCuU5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DHQ8_yIz.js +1 -0
- package/build/client/_app/immutable/chunks/DHQ8_yIz.js.br +0 -0
- package/build/client/_app/immutable/chunks/DHQ8_yIz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Deb2U3a-.js +1 -0
- package/build/client/_app/immutable/chunks/Deb2U3a-.js.br +0 -0
- package/build/client/_app/immutable/chunks/Deb2U3a-.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{B8bx6-qu.js → DgNsppMf.js} +1 -1
- package/build/client/_app/immutable/chunks/DgNsppMf.js.br +0 -0
- package/build/client/_app/immutable/chunks/DgNsppMf.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DgSSnt2u.js +1 -0
- package/build/client/_app/immutable/chunks/DgSSnt2u.js.br +0 -0
- package/build/client/_app/immutable/chunks/DgSSnt2u.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Dr0H-PA9.js +1 -0
- package/build/client/_app/immutable/chunks/Dr0H-PA9.js.br +0 -0
- package/build/client/_app/immutable/chunks/Dr0H-PA9.js.gz +0 -0
- package/build/client/_app/immutable/chunks/HA3qddzj.js +1 -0
- package/build/client/_app/immutable/chunks/HA3qddzj.js.br +0 -0
- package/build/client/_app/immutable/chunks/HA3qddzj.js.gz +0 -0
- package/build/client/_app/immutable/chunks/LPKWlFs0.js +1 -0
- package/build/client/_app/immutable/chunks/LPKWlFs0.js.br +3 -0
- package/build/client/_app/immutable/chunks/LPKWlFs0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/VpPuF4LW.js +3 -0
- package/build/client/_app/immutable/chunks/VpPuF4LW.js.br +0 -0
- package/build/client/_app/immutable/chunks/VpPuF4LW.js.gz +0 -0
- package/build/client/_app/immutable/chunks/XyRovF4A.js +1 -0
- package/build/client/_app/immutable/chunks/XyRovF4A.js.br +0 -0
- package/build/client/_app/immutable/chunks/XyRovF4A.js.gz +0 -0
- package/build/client/_app/immutable/chunks/mRVZsLQ4.js +1 -0
- package/build/client/_app/immutable/chunks/mRVZsLQ4.js.br +2 -0
- package/build/client/_app/immutable/chunks/mRVZsLQ4.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CVDHq7dN.js +2 -0
- package/build/client/_app/immutable/entry/app.CVDHq7dN.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CVDHq7dN.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.a4wXr-rh.js +1 -0
- package/build/client/_app/immutable/entry/start.a4wXr-rh.js.br +2 -0
- package/build/client/_app/immutable/entry/start.a4wXr-rh.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.q5P1PqkU.js +3 -0
- package/build/client/_app/immutable/nodes/0.q5P1PqkU.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.q5P1PqkU.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.TfmDsqd-.js +1 -0
- package/build/client/_app/immutable/nodes/1.TfmDsqd-.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.TfmDsqd-.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.BpXsBlTN.js +1 -0
- package/build/client/_app/immutable/nodes/10.BpXsBlTN.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.BpXsBlTN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/11.Bs_5a_H1.js +1 -0
- package/build/client/_app/immutable/nodes/11.Bs_5a_H1.js.br +0 -0
- package/build/client/_app/immutable/nodes/11.Bs_5a_H1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.BWtLQzzv.js +3 -0
- package/build/client/_app/immutable/nodes/2.BWtLQzzv.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.BWtLQzzv.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.BlYIVobe.js +1 -0
- package/build/client/_app/immutable/nodes/3.BlYIVobe.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.BlYIVobe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.DMboagHp.js +38 -0
- package/build/client/_app/immutable/nodes/4.DMboagHp.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.DMboagHp.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.DJDEfbU1.js +1 -0
- package/build/client/_app/immutable/nodes/5.DJDEfbU1.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.DJDEfbU1.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.Co1n7leD.js +12 -0
- package/build/client/_app/immutable/nodes/6.Co1n7leD.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.Co1n7leD.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.3clSez0f.js +1 -0
- package/build/client/_app/immutable/nodes/7.3clSez0f.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.3clSez0f.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.D4xImLsM.js +1 -0
- package/build/client/_app/immutable/nodes/8.D4xImLsM.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.D4xImLsM.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.C1KWPSTf.js +1 -0
- package/build/client/_app/immutable/nodes/9.C1KWPSTf.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.C1KWPSTf.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/0-CgyQG-Vf.js +9 -0
- package/build/server/chunks/0-CgyQG-Vf.js.map +1 -0
- package/build/server/chunks/1-DACiLfsu.js +9 -0
- package/build/server/chunks/{1-dPD-duO8.js.map → 1-DACiLfsu.js.map} +1 -1
- package/build/server/chunks/10-zMqY0bCj.js +9 -0
- package/build/server/chunks/10-zMqY0bCj.js.map +1 -0
- package/build/server/chunks/11-B7cPB4ip.js +9 -0
- package/build/server/chunks/11-B7cPB4ip.js.map +1 -0
- package/build/server/chunks/2-uTf78dNT.js +9 -0
- package/build/server/chunks/2-uTf78dNT.js.map +1 -0
- package/build/server/chunks/3-DOOLRXaZ.js +9 -0
- package/build/server/chunks/3-DOOLRXaZ.js.map +1 -0
- package/build/server/chunks/4-CLK_BxY0.js +9 -0
- package/build/server/chunks/4-CLK_BxY0.js.map +1 -0
- package/build/server/chunks/5-DfZ6yJrz.js +9 -0
- package/build/server/chunks/5-DfZ6yJrz.js.map +1 -0
- package/build/server/chunks/6-B2BoZUr6.js +22 -0
- package/build/server/chunks/6-B2BoZUr6.js.map +1 -0
- package/build/server/chunks/{5-p3BDfNc2.js → 7-DmgY6drC.js} +6 -6
- package/build/server/chunks/7-DmgY6drC.js.map +1 -0
- package/build/server/chunks/8-Bku8n4Ko.js +9 -0
- package/build/server/chunks/8-Bku8n4Ko.js.map +1 -0
- package/build/server/chunks/{7-C_AGqUAU.js → 9-nwlpMH7t.js} +5 -5
- package/build/server/chunks/9-nwlpMH7t.js.map +1 -0
- package/build/server/chunks/AgentSidebar-CZIBBsSh.js +141 -0
- package/build/server/chunks/AgentSidebar-CZIBBsSh.js.map +1 -0
- package/build/server/chunks/Button-OUO_MioZ.js +44 -0
- package/build/server/chunks/Button-OUO_MioZ.js.map +1 -0
- package/build/server/chunks/ContextEditor-stz14-2o.js +48 -0
- package/build/server/chunks/ContextEditor-stz14-2o.js.map +1 -0
- package/build/server/chunks/{Dropdown-B-UCol1v.js → Dropdown-BTr_XiAm.js} +2 -2
- package/build/server/chunks/Dropdown-BTr_XiAm.js.map +1 -0
- package/build/server/chunks/{Input-DLAEH36y.js → Input-B_jIG2tD.js} +2 -2
- package/build/server/chunks/Input-B_jIG2tD.js.map +1 -0
- package/build/server/chunks/{Icon-DDJ9D6Sq.js → Link-DaOJVbdB.js} +25 -42
- package/build/server/chunks/Link-DaOJVbdB.js.map +1 -0
- package/build/server/chunks/{Panel-KZDoG3_L.js → Panel-CmvYn6IC.js} +2 -2
- package/build/server/chunks/Panel-CmvYn6IC.js.map +1 -0
- package/build/server/chunks/Tab-n348Mfiq.js +84 -0
- package/build/server/chunks/Tab-n348Mfiq.js.map +1 -0
- package/build/server/chunks/_layout.svelte-CP6tz6DB.js +62 -0
- package/build/server/chunks/_layout.svelte-CP6tz6DB.js.map +1 -0
- package/build/server/chunks/{_layout.svelte-BoAJDYC1.js → _layout.svelte-CvGX8M4U.js} +68 -18
- package/build/server/chunks/_layout.svelte-CvGX8M4U.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CdEfc0bc.js → _page.svelte-AHHrodUG.js} +94 -86
- package/build/server/chunks/_page.svelte-AHHrodUG.js.map +1 -0
- package/build/server/chunks/_page.svelte-Bm-iBjXM.js +80 -0
- package/build/server/chunks/_page.svelte-Bm-iBjXM.js.map +1 -0
- package/build/server/chunks/_page.svelte-D5Xqk3cI.js +52 -0
- package/build/server/chunks/_page.svelte-D5Xqk3cI.js.map +1 -0
- package/build/server/chunks/{_page.svelte-CNhxx79k.js → _page.svelte-DKBFi-JF.js} +202 -240
- package/build/server/chunks/_page.svelte-DKBFi-JF.js.map +1 -0
- package/build/server/chunks/{_page.svelte-DQUdiD4S.js → _page.svelte-DSefP5E9.js} +6 -5
- package/build/server/chunks/_page.svelte-DSefP5E9.js.map +1 -0
- package/build/server/chunks/{_page.svelte-kLLxi8vG.js → _page.svelte-Dldwxu4m.js} +28 -6
- package/build/server/chunks/_page.svelte-Dldwxu4m.js.map +1 -0
- package/build/server/chunks/{_page.svelte-Cc0DAAQW.js → _page.svelte-lU1-SHJj.js} +5 -4
- package/build/server/chunks/_page.svelte-lU1-SHJj.js.map +1 -0
- package/build/server/chunks/{_page.svelte-nsIWq28L.js → _page.svelte-vGR-ltk7.js} +7 -27
- package/build/server/chunks/_page.svelte-vGR-ltk7.js.map +1 -0
- package/build/server/chunks/{_server.ts-d0Tii8aZ.js → _server.ts-3D9tpnMZ.js} +3 -2
- package/build/server/chunks/_server.ts-3D9tpnMZ.js.map +1 -0
- package/build/server/chunks/{_server.ts-BBxm_xV1.js → _server.ts-B56wS_0L.js} +4 -1
- package/build/server/chunks/_server.ts-B56wS_0L.js.map +1 -0
- package/build/server/chunks/{_server.ts-CLKPeFqF.js → _server.ts-BCBY3OIY.js} +3 -2
- package/build/server/chunks/_server.ts-BCBY3OIY.js.map +1 -0
- package/build/server/chunks/{_server.ts-BmZBSYvJ.js → _server.ts-BCfiuZgS.js} +19 -8
- package/build/server/chunks/_server.ts-BCfiuZgS.js.map +1 -0
- package/build/server/chunks/_server.ts-BkL-sSQA.js.map +1 -1
- package/build/server/chunks/{_server.ts-DEHw6op6.js → _server.ts-D0C3cRDU.js} +3 -2
- package/build/server/chunks/_server.ts-D0C3cRDU.js.map +1 -0
- package/build/server/chunks/{_server.ts-BYDdbqNr.js → _server.ts-Dc989xbA.js} +3 -2
- package/build/server/chunks/_server.ts-Dc989xbA.js.map +1 -0
- package/build/server/chunks/_server.ts-Ddto8x_p.js.map +1 -1
- package/build/server/chunks/{_server.ts-BIcKE9RQ.js → _server.ts-I-18L-Sg.js} +3 -2
- package/build/server/chunks/_server.ts-I-18L-Sg.js.map +1 -0
- package/build/server/chunks/_server.ts-iuWHhHZx.js +629 -0
- package/build/server/chunks/_server.ts-iuWHhHZx.js.map +1 -0
- package/build/server/chunks/agents-context-C4MM7lSl.js +6 -0
- package/build/server/chunks/agents-context-C4MM7lSl.js.map +1 -0
- package/build/server/chunks/{client2-tp0-IQU0.js → client-BhnXtftB.js} +6 -29
- package/build/server/chunks/client-BhnXtftB.js.map +1 -0
- package/build/server/chunks/{index2-CVBATI2G.js → context-Dy9MY1Z0.js} +253 -965
- package/build/server/chunks/context-Dy9MY1Z0.js.map +1 -0
- package/build/server/chunks/{data-CbXDDeDB.js → data-BltJc-uF.js} +29 -89
- package/build/server/chunks/data-BltJc-uF.js.map +1 -0
- package/build/server/chunks/error.svelte-Cn6umEWY.js +14 -0
- package/build/server/chunks/error.svelte-Cn6umEWY.js.map +1 -0
- package/build/server/chunks/errors-B8liwVcD.js +17 -0
- package/build/server/chunks/errors-B8liwVcD.js.map +1 -0
- package/build/server/chunks/{events-A18hGvKp.js → events-BFcZEt66.js} +3 -9
- package/build/server/chunks/events-BFcZEt66.js.map +1 -0
- package/build/server/chunks/{index-BoStl4QO.js → index-C0ds_eUO.js} +8 -3
- package/build/server/chunks/index-C0ds_eUO.js.map +1 -0
- package/build/server/chunks/index-server-CMCI3p2Y.js +18 -0
- package/build/server/chunks/index-server-CMCI3p2Y.js.map +1 -0
- package/build/server/chunks/index2-B1rkViAM.js +860 -0
- package/build/server/chunks/index2-B1rkViAM.js.map +1 -0
- package/build/server/chunks/index3-CVYj52gl.js.map +1 -1
- package/build/server/chunks/index4-DSZuWW-A.js +47 -0
- package/build/server/chunks/index4-DSZuWW-A.js.map +1 -0
- package/build/server/chunks/main-DL75vM4l.js +2250 -0
- package/build/server/chunks/main-DL75vM4l.js.map +1 -0
- package/build/server/chunks/{state.svelte-Dze7OxC_.js → state.svelte-CBgyohE1.js} +2 -2
- package/build/server/chunks/state.svelte-CBgyohE1.js.map +1 -0
- package/build/server/chunks/suite-4--Gr0jF.js +60 -0
- package/build/server/chunks/suite-4--Gr0jF.js.map +1 -0
- package/build/server/chunks/ws-client-CyJORDFw.js +98 -0
- package/build/server/chunks/ws-client-CyJORDFw.js.map +1 -0
- package/build/server/index.js +167 -90
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +83 -75
- package/build/server/manifest.js.map +1 -1
- package/package.json +3 -1
- package/src/ws-server/projects.ts +82 -9
- package/build/client/_app/immutable/assets/0.7xdY7TSX.css +0 -1
- package/build/client/_app/immutable/assets/0.7xdY7TSX.css.br +0 -0
- package/build/client/_app/immutable/assets/0.7xdY7TSX.css.gz +0 -0
- package/build/client/_app/immutable/assets/10.C1o6a69m.css +0 -1
- package/build/client/_app/immutable/assets/10.C1o6a69m.css.br +0 -1
- package/build/client/_app/immutable/assets/10.C1o6a69m.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.858mUNwe.css +0 -1
- package/build/client/_app/immutable/assets/4.858mUNwe.css.br +0 -0
- package/build/client/_app/immutable/assets/4.858mUNwe.css.gz +0 -0
- package/build/client/_app/immutable/assets/6.CD1QZ0pt.css +0 -1
- package/build/client/_app/immutable/assets/6.CD1QZ0pt.css.br +0 -0
- package/build/client/_app/immutable/assets/6.CD1QZ0pt.css.gz +0 -0
- package/build/client/_app/immutable/chunks/2PVbuV1X.js +0 -1
- package/build/client/_app/immutable/chunks/2PVbuV1X.js.br +0 -1
- package/build/client/_app/immutable/chunks/2PVbuV1X.js.gz +0 -0
- package/build/client/_app/immutable/chunks/9OGf6H2n.js +0 -1
- package/build/client/_app/immutable/chunks/9OGf6H2n.js.br +0 -2
- package/build/client/_app/immutable/chunks/9OGf6H2n.js.gz +0 -0
- package/build/client/_app/immutable/chunks/B8bx6-qu.js.br +0 -1
- package/build/client/_app/immutable/chunks/B8bx6-qu.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BDTuVTVZ.js +0 -1
- package/build/client/_app/immutable/chunks/BDTuVTVZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/BDTuVTVZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BTGV3Gq0.js +0 -8
- package/build/client/_app/immutable/chunks/BTGV3Gq0.js.br +0 -0
- package/build/client/_app/immutable/chunks/BTGV3Gq0.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUJtMu79.js +0 -3
- package/build/client/_app/immutable/chunks/BUJtMu79.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUJtMu79.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BUoURvZ_.js +0 -1
- package/build/client/_app/immutable/chunks/BUoURvZ_.js.br +0 -0
- package/build/client/_app/immutable/chunks/BUoURvZ_.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BdOqksoz.js +0 -1
- package/build/client/_app/immutable/chunks/BdOqksoz.js.br +0 -0
- package/build/client/_app/immutable/chunks/BdOqksoz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Be371ezp.js +0 -2
- package/build/client/_app/immutable/chunks/Be371ezp.js.br +0 -0
- package/build/client/_app/immutable/chunks/Be371ezp.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bmx4ManB.js +0 -1
- package/build/client/_app/immutable/chunks/Bmx4ManB.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bmx4ManB.js.gz +0 -0
- package/build/client/_app/immutable/chunks/C2Y9UxTx.js +0 -1
- package/build/client/_app/immutable/chunks/C2Y9UxTx.js.br +0 -0
- package/build/client/_app/immutable/chunks/C2Y9UxTx.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CYuXdPQc.js +0 -1
- package/build/client/_app/immutable/chunks/CYuXdPQc.js.br +0 -0
- package/build/client/_app/immutable/chunks/CYuXdPQc.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CpZGG0E7.js +0 -1
- package/build/client/_app/immutable/chunks/CpZGG0E7.js.br +0 -0
- package/build/client/_app/immutable/chunks/CpZGG0E7.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CpdYAO0i.js +0 -1
- package/build/client/_app/immutable/chunks/CpdYAO0i.js.br +0 -0
- package/build/client/_app/immutable/chunks/CpdYAO0i.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CtpS-ZbM.js +0 -1
- package/build/client/_app/immutable/chunks/CtpS-ZbM.js.br +0 -0
- package/build/client/_app/immutable/chunks/CtpS-ZbM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D5O98MXA.js.br +0 -0
- package/build/client/_app/immutable/chunks/D5O98MXA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DIiF2tGe.js +0 -1
- package/build/client/_app/immutable/chunks/DIiF2tGe.js.br +0 -0
- package/build/client/_app/immutable/chunks/DIiF2tGe.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D_4dC3JZ.js +0 -1
- package/build/client/_app/immutable/chunks/D_4dC3JZ.js.br +0 -0
- package/build/client/_app/immutable/chunks/D_4dC3JZ.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DveC87gn.js +0 -33
- package/build/client/_app/immutable/chunks/DveC87gn.js.br +0 -0
- package/build/client/_app/immutable/chunks/DveC87gn.js.gz +0 -0
- package/build/client/_app/immutable/chunks/ISgeSat5.js +0 -1
- package/build/client/_app/immutable/chunks/ISgeSat5.js.br +0 -0
- package/build/client/_app/immutable/chunks/ISgeSat5.js.gz +0 -0
- package/build/client/_app/immutable/chunks/f4SQk-uT.js +0 -3
- package/build/client/_app/immutable/chunks/f4SQk-uT.js.br +0 -0
- package/build/client/_app/immutable/chunks/f4SQk-uT.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.BCqdi-0A.js +0 -2
- package/build/client/_app/immutable/entry/app.BCqdi-0A.js.br +0 -0
- package/build/client/_app/immutable/entry/app.BCqdi-0A.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.FFZ3vuST.js +0 -1
- package/build/client/_app/immutable/entry/start.FFZ3vuST.js.br +0 -2
- package/build/client/_app/immutable/entry/start.FFZ3vuST.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.BFGm6g4L.js +0 -1
- package/build/client/_app/immutable/nodes/0.BFGm6g4L.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.BFGm6g4L.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.BldvfsiS.js +0 -1
- package/build/client/_app/immutable/nodes/1.BldvfsiS.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BldvfsiS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/10.Bdd6Le3Q.js +0 -1
- package/build/client/_app/immutable/nodes/10.Bdd6Le3Q.js.br +0 -0
- package/build/client/_app/immutable/nodes/10.Bdd6Le3Q.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.c7KihIjN.js +0 -3
- package/build/client/_app/immutable/nodes/2.c7KihIjN.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.c7KihIjN.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BokOq116.js +0 -12
- package/build/client/_app/immutable/nodes/4.BokOq116.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BokOq116.js.gz +0 -0
- package/build/client/_app/immutable/nodes/5.BqyMuHwQ.js +0 -1
- package/build/client/_app/immutable/nodes/5.BqyMuHwQ.js.br +0 -0
- package/build/client/_app/immutable/nodes/5.BqyMuHwQ.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.CMaZNrkR.js +0 -38
- package/build/client/_app/immutable/nodes/6.CMaZNrkR.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.CMaZNrkR.js.gz +0 -0
- package/build/client/_app/immutable/nodes/7.CvDadi99.js +0 -1
- package/build/client/_app/immutable/nodes/7.CvDadi99.js.br +0 -0
- package/build/client/_app/immutable/nodes/7.CvDadi99.js.gz +0 -0
- package/build/client/_app/immutable/nodes/8.CLZUC68b.js +0 -1
- package/build/client/_app/immutable/nodes/8.CLZUC68b.js.br +0 -0
- package/build/client/_app/immutable/nodes/8.CLZUC68b.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.BY1rgYUV.js +0 -1
- package/build/client/_app/immutable/nodes/9.BY1rgYUV.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.BY1rgYUV.js.gz +0 -0
- package/build/server/chunks/0-DMd6Dk79.js +0 -9
- package/build/server/chunks/0-DMd6Dk79.js.map +0 -1
- package/build/server/chunks/1-dPD-duO8.js +0 -9
- package/build/server/chunks/10-Ci_AhluU.js +0 -9
- package/build/server/chunks/10-Ci_AhluU.js.map +0 -1
- package/build/server/chunks/2-C0B7VzbP.js +0 -9
- package/build/server/chunks/2-C0B7VzbP.js.map +0 -1
- package/build/server/chunks/3-DGFu_uy6.js +0 -19
- package/build/server/chunks/3-DGFu_uy6.js.map +0 -1
- package/build/server/chunks/4-MwbWFUCO.js +0 -22
- package/build/server/chunks/4-MwbWFUCO.js.map +0 -1
- package/build/server/chunks/5-p3BDfNc2.js.map +0 -1
- package/build/server/chunks/6-B6EVTx8w.js +0 -9
- package/build/server/chunks/6-B6EVTx8w.js.map +0 -1
- package/build/server/chunks/7-C_AGqUAU.js.map +0 -1
- package/build/server/chunks/8-Dr1vf8BH.js +0 -9
- package/build/server/chunks/8-Dr1vf8BH.js.map +0 -1
- package/build/server/chunks/9-BA8KMX2q.js +0 -9
- package/build/server/chunks/9-BA8KMX2q.js.map +0 -1
- package/build/server/chunks/AgentDropdown-C3XtwkaV.js +0 -162
- package/build/server/chunks/AgentDropdown-C3XtwkaV.js.map +0 -1
- package/build/server/chunks/Dropdown-B-UCol1v.js.map +0 -1
- package/build/server/chunks/Icon-DDJ9D6Sq.js.map +0 -1
- package/build/server/chunks/Input-DLAEH36y.js.map +0 -1
- package/build/server/chunks/Panel-KZDoG3_L.js.map +0 -1
- package/build/server/chunks/_layout.svelte-22nlfSFq.js +0 -9
- package/build/server/chunks/_layout.svelte-22nlfSFq.js.map +0 -1
- package/build/server/chunks/_layout.svelte-BoAJDYC1.js.map +0 -1
- package/build/server/chunks/_page.svelte-CNhxx79k.js.map +0 -1
- package/build/server/chunks/_page.svelte-Cc0DAAQW.js.map +0 -1
- package/build/server/chunks/_page.svelte-CdEfc0bc.js.map +0 -1
- package/build/server/chunks/_page.svelte-DQUdiD4S.js.map +0 -1
- package/build/server/chunks/_page.svelte-kLLxi8vG.js.map +0 -1
- package/build/server/chunks/_page.svelte-nsIWq28L.js.map +0 -1
- package/build/server/chunks/_server.ts-BBxm_xV1.js.map +0 -1
- package/build/server/chunks/_server.ts-BIcKE9RQ.js.map +0 -1
- package/build/server/chunks/_server.ts-BYDdbqNr.js.map +0 -1
- package/build/server/chunks/_server.ts-BmZBSYvJ.js.map +0 -1
- package/build/server/chunks/_server.ts-CLKPeFqF.js.map +0 -1
- package/build/server/chunks/_server.ts-DEHw6op6.js.map +0 -1
- package/build/server/chunks/_server.ts-DTyPQO2I.js +0 -93
- package/build/server/chunks/_server.ts-DTyPQO2I.js.map +0 -1
- package/build/server/chunks/_server.ts-d0Tii8aZ.js.map +0 -1
- package/build/server/chunks/client-DpkplAAP.js +0 -25
- package/build/server/chunks/client-DpkplAAP.js.map +0 -1
- package/build/server/chunks/client2-tp0-IQU0.js.map +0 -1
- package/build/server/chunks/context-DVQH5kJk.js +0 -113
- package/build/server/chunks/context-DVQH5kJk.js.map +0 -1
- package/build/server/chunks/data-CbXDDeDB.js.map +0 -1
- package/build/server/chunks/error.svelte-DNcHZkvg.js +0 -29
- package/build/server/chunks/error.svelte-DNcHZkvg.js.map +0 -1
- package/build/server/chunks/events-A18hGvKp.js.map +0 -1
- package/build/server/chunks/index-BoStl4QO.js.map +0 -1
- package/build/server/chunks/index2-CVBATI2G.js.map +0 -1
- package/build/server/chunks/state.svelte-Dze7OxC_.js.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/DLQqXQ6R.js","../chunks/C1FmrZbK.js","../assets/editor.BMIWPGx3.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import"../chunks/CWj6FrbW.js";import{o as At,c as Ct,a as Gt}from"../chunks/CEHtmspK.js";import{ad as Ht,E as zt,bo as Yt,bp as Jt,i as Nt,w as dt,bq as Qt,br as Pt,aL as qt,A as Xt,ay as it,a0 as Zt,p as je,f as fe,d as re,a as Le,r as X,s as le,g as L,u as Ke,t as Pe,b as Z,e as Q,h as we,c as De,B as et,au as at,j as $e,av as ze,F as Xe,n as Qe,bs as lt,aw as st,Y as He,I as Ue,ax as Ft,K as en,$ as tn}from"../chunks/DHQ8_yIz.js";import{d as nn,s as Me,a as rn}from"../chunks/BQsXEsya.js";import{i as Ee}from"../chunks/XyRovF4A.js";import{C as on,k as sn}from"../chunks/C7b8kjFl.js";import{e as tt,i as nt}from"../chunks/BDr6IUDE.js";import{h as an}from"../chunks/Deb2U3a-.js";import{s as Ne}from"../chunks/C9ihsQgF.js";import{p as We,a as wt,s as It}from"../chunks/CUWa2xqt.js";import{g as xt,r as ln}from"../chunks/DAgYAbDT.js";import{B as qe}from"../chunks/B6Eu_a6G.js";import{D as cn}from"../chunks/CHop8m-3.js";import{I as Ze,h as un}from"../chunks/DBCXNg0T.js";import{b as mt}from"../chunks/Bckf35or.js";import{s as Rt}from"../chunks/BVH8cl8Q.js";import{P as vt}from"../chunks/LPKWlFs0.js";import{I as Et}from"../chunks/ClfaR3Y2.js";import{_ as Bt}from"../chunks/C1FmrZbK.js";import"../chunks/DDncCuU5.js";import{i as Kt}from"../chunks/DgNsppMf.js";import{w as fn}from"../chunks/Dr0H-PA9.js";import{A as hn}from"../chunks/BcyK4bvI.js";import{p as kt}from"../chunks/B946i1vX.js";import{T as pn,a as yt}from"../chunks/BJ0PAzRz.js";import{w as ot}from"../chunks/HA3qddzj.js";import{g as dn}from"../chunks/mRVZsLQ4.js";const vn=()=>performance.now(),Ve={tick:U=>requestAnimationFrame(U),now:()=>vn(),tasks:new Set};function Mt(){const U=Ve.now();Ve.tasks.forEach(N=>{N.c(U)||(Ve.tasks.delete(N),N.f())}),Ve.tasks.size!==0&&Ve.tick(Mt)}function mn(U){let N;return Ve.tasks.size===0&&Ve.tick(Mt),{promise:new Promise(E=>{Ve.tasks.add(N={c:U,f:E})}),abort(){Ve.tasks.delete(N)}}}function ft(U,N){Pt(()=>{U.dispatchEvent(new CustomEvent(N))})}function gn(U){if(U==="float")return"cssFloat";if(U==="offset")return"cssOffset";if(U.startsWith("--"))return U;const N=U.split("-");return N.length===1?N[0]:N[0]+N.slice(1).map(E=>E[0].toUpperCase()+E.slice(1)).join("")}function Ot(U){const N={},E=U.split(";");for(const A of E){const[O,v]=A.split(":");if(!O||v===void 0)break;const k=gn(O.trim());N[k]=v.trim()}return N}const _n=U=>U;function ct(U,N,E,A){var O=(U&Qt)!==0,v="both",k,h=N.inert,w=N.style.overflow,f,y;function I(){return Pt(()=>k??(k=E()(N,(A==null?void 0:A())??{},{direction:v})))}var F={is_global:O,in(){N.inert=h,ft(N,"introstart"),f=bt(N,I(),y,1,()=>{ft(N,"introend"),f==null||f.abort(),f=k=void 0,N.style.overflow=w})},out(e){N.inert=!0,ft(N,"outrostart"),y=bt(N,I(),f,0,()=>{ft(N,"outroend"),e==null||e()})},stop:()=>{f==null||f.abort(),y==null||y.abort()}},S=Ht;if((S.transitions??(S.transitions=[])).push(F),nn){var _=O;if(!_){for(var g=S.parent;g&&g.f&zt;)for(;(g=g.parent)&&!(g.f&Yt););_=!g||(g.f&Jt)!==0}_&&Nt(()=>{dt(()=>F.in())})}}function bt(U,N,E,A,O){var v=A===1;if(qt(N)){var k,h=!1;return Xt(()=>{if(!h){var e=N({direction:v?"in":"out"});k=bt(U,e,E,A,O)}}),{abort:()=>{h=!0,k==null||k.abort()},deactivate:()=>k.deactivate(),reset:()=>k.reset(),t:()=>k.t()}}if(E==null||E.deactivate(),!(N!=null&&N.duration))return O(),{abort:it,deactivate:it,reset:it,t:()=>A};const{delay:w=0,css:f,tick:y,easing:I=_n}=N;var F=[];if(v&&E===void 0&&(y&&y(0,1),f)){var S=Ot(f(0,1));F.push(S,S)}var _=()=>1-A,g=U.animate(F,{duration:w,fill:"forwards"});return g.onfinish=()=>{g.cancel();var e=(E==null?void 0:E.t())??1-A;E==null||E.abort();var t=A-e,n=N.duration*Math.abs(t),u=[];if(n>0){var l=!1;if(f)for(var c=Math.ceil(n/16.666666666666668),r=0;r<=c;r+=1){var i=e+t*I(r/c),a=Ot(f(i,1-i));u.push(a),l||(l=a.overflow==="hidden")}l&&(U.style.overflow="hidden"),_=()=>{var o=g.currentTime;return e+t*I(o/n)},y&&mn(()=>{if(g.playState!=="running")return!1;var o=_();return y(o,1-o),!0})}g=U.animate(u,{duration:n,fill:"forwards"}),g.onfinish=()=>{_=()=>A,y==null||y(A,1-A),O()}},{abort:()=>{g&&(g.cancel(),g.effect=null,g.onfinish=it)},deactivate:()=>{O=it},reset:()=>{A===0&&(y==null||y(1,0))},t:()=>_()}}function yn(U){return function(...N){var E=N[0];return E.stopPropagation(),U==null?void 0:U.apply(this,N)}}function Tt(U,N){var v;var E=(v=U.$$events)==null?void 0:v[N.type],A=Zt(E)?E.slice():E==null?[]:[E];for(var O of A)O.call(this,N)}const wn=U=>U;function bn(U){const N=U-1;return N*N*N+1}function pt(U,{delay:N=0,duration:E=400,easing:A=wn}={}){const O=+getComputedStyle(U).opacity;return{delay:N,duration:E,easing:A,css:v=>`opacity: ${v*O}`}}function xn(U,{delay:N=0,duration:E=400,easing:A=bn,axis:O="y"}={}){const v=getComputedStyle(U),k=+v.opacity,h=O==="y"?"height":"width",w=parseFloat(v[h]),f=O==="y"?["top","bottom"]:["left","right"],y=f.map(t=>`${t[0].toUpperCase()}${t.slice(1)}`),I=parseFloat(v[`padding${y[0]}`]),F=parseFloat(v[`padding${y[1]}`]),S=parseFloat(v[`margin${y[0]}`]),_=parseFloat(v[`margin${y[1]}`]),g=parseFloat(v[`border${y[0]}Width`]),e=parseFloat(v[`border${y[1]}Width`]);return{delay:N,duration:E,easing:A,css:t=>`overflow: hidden;opacity: ${Math.min(t*20,1)*k};${h}: ${t*w}px;padding-${f[0]}: ${t*I}px;padding-${f[1]}: ${t*F}px;margin-${f[0]}: ${t*S}px;margin-${f[1]}: ${t*_}px;border-${f[0]}-width: ${t*g}px;border-${f[1]}-width: ${t*e}px;min-${h}: 0`}}var En=fe("<span> </span> <!>",1),kn=fe('<span class="text-green-500"><!></span>'),On=fe('<div class="flex items-start gap-2"><span class="flex h-5 w-5 items-center justify-center"><!></span> <div class="min-w-0"><div class="text-sm font-bold leading-tight text-rc-gray-300"> </div> <div class="mt-1 text-sm leading-tight text-rc-gray-100"> </div></div></div>'),Tn=fe('<div class="mt-1 max-h-96 w-80 overflow-y-auto border border-rc-gray-600 bg-rc-gray-800 shadow-lg" role="listbox"></div>'),Ln=fe("<div><!> <!></div>");function Sn(U,N){je(N,!0);let E=We(N,"class",3,""),A=we(!1),O=we(null);function v(){Q(A,!L(A))}function k(g){N.onSelectState(g),Q(A,!1)}function h(g){const e=g.userMessage;return e==null?"No message":(typeof e=="string"?e:String(e)).trim()||"No message"}function w(g,e=80,t="…"){if(!g)return"";if(g.length<=e)return g;const n=g.slice(0,e+1),u=Math.max(n.lastIndexOf(" "),n.lastIndexOf(" "),n.lastIndexOf(" "),n.lastIndexOf(`
|
|
3
|
+
`),n.lastIndexOf("\r"));return(u>0?n.slice(0,u):g.slice(0,e)).trimEnd()+t}function f(g){g.key==="ArrowDown"&&!L(A)?(Q(A,!0),g.preventDefault()):g.key==="ArrowUp"&&L(A)&&(Q(A,!1),g.preventDefault())}let y=Ke(()=>N.agentStates.find(g=>g.id===N.currentState)??null),I=Ke(()=>{var g;return((g=L(y))==null?void 0:g.name)??"History"});var F=Ln(),S=re(F);qe(S,{variant:"outlined",size:"medium",get"aria-expanded"(){return L(A)},"aria-haspopup":"listbox","aria-controls":"history-dropdown",onclick:v,onkeydown:f,class:"flex items-center gap-3 rounded-xs border border-transparent bg-rc-gray-800 text-rc-gray-300 shadow-sm hover:bg-rc-gray-700 focus:outline-none focus:ring-0",get el(){return L(O)},set el(g){Q(O,g,!0)},children:(g,e)=>{var t=En(),n=Le(t),u=re(n,!0);X(n);var l=le(n,2);{let c=Ke(()=>"size-5 transition-transform "+(L(A)?"rotate-180":""));Ze(l,{name:"chevron-down",get class(){return L(c)}})}Pe(()=>Me(u,L(I))),Z(g,t)},$$slots:{default:!0}});var _=le(S,2);cn(_,{id:"history-dropdown",get open(){return L(A)},onClose:()=>Q(A,!1),get anchorEl(){return L(O)},placement:"bottom-start",offset:[0,1],children:e=>{var t=Tn();tt(t,21,()=>N.agentStates.slice().reverse(),nt,(n,u)=>{{let l=Ke(()=>L(u).id===N.currentState);qe(n,{variant:"ghost",size:"small",role:"option",get"aria-selected"(){return L(l)},onclick:()=>k(L(u).id),class:"w-full border-b border-rc-gray-600 py-2 pr-3 text-left last:border-b-0 hover:bg-rc-gray-700 focus:bg-rc-gray-400",children:(c,r)=>{var i=On(),a=re(i),o=re(a);{var s=B=>{var j=kn(),b=re(j);Ze(b,{name:"checkmark",width:20,height:20,class:"inline-block"}),X(j),ct(3,j,()=>pt,()=>({duration:100})),Z(B,j)};Ee(o,B=>{L(u).id===N.currentState&&B(s)})}X(a);var d=le(a,2),p=re(d),T=re(p,!0);X(p);var R=le(p,2),P=re(R,!0);X(R),X(d),X(i),Pe(B=>{Me(T,L(u).name),Me(P,B)},[()=>w(h(L(u)))]),Z(c,i)},$$slots:{default:!0}})}}),X(t),Z(e,t)},$$slots:{default:!0}}),X(F),Pe(()=>Ne(F,1,`relative ${E()}`)),Z(U,F),De()}et(["click"]);let Ye=at([]);function jt(U){return!gt(U)}function gt(U){return"action"in U}function An(U){Ye.push(U)}function Cn(U){const N=Ye.find(E=>gt(E)&&E.action.id===U.id);N?N.action.state=U.state:Ye.push({action:U,logs:[]})}function Nn(U){const N=Ye.filter(gt),E=N[N.length-1];E&&(E.logs=[...E.logs,U])}function ht(){Ye.length=0}var Pn=fe('<img alt="image"/>'),Fn=fe("<div><!></div>"),In=fe("<div><div><!> <div> </div></div> <!></div>");function Rn(U,N){je(N,!0);let E=we("idle");async function A(S){const _=Ye.filter(jt);let g=_.indexOf(S);g===-1&&(g=_.length-1);const e=_.slice(0,g).map(n=>n.text?`${n.sender}: ${n.text}`:"").filter(Boolean).join(`
|
|
4
|
+
`),t=S.text?`${S.text}`:"";try{Q(E,"idle");const n=(N.agentId||"").trim(),[u,l]=n.includes("/")?n.split("/"):["",""];if(!u||!l)throw new Error("Agent id is not available; cannot add test");const c={pinned:"TRUE",assertion_type:"llm-rubric",assertion_value:"",conversation:e,expected_output:t,similarity_threshold:"60",timeout:"0",context:N.context||{},mergeContexts:!0},r=await fetch(`/tests/${u}/${l}/api/tests`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c)});if(!r.ok)throw new Error(`HTTP ${r.status}`);await r.json().catch(()=>null),Q(E,"ok"),window.open(`/tests/${u}/${l}`,"_blank","noopener,noreferrer"),setTimeout(()=>Q(E,"idle"),3e3)}catch(n){console.error("Failed to add test",n),Q(E,"error"),setTimeout(()=>Q(E,"idle"),4e3)}}var O=In();let v;var k=re(O),h=re(k);{var w=S=>{var _=Pn();Pe(()=>Rt(_,"src",N.message.imageUrl)),Z(S,_)};Ee(h,S=>{N.message.imageUrl&&S(w)})}var f=le(h,2),y=re(f,!0);X(f),X(k);var I=le(k,2);{var F=S=>{var _=Fn();_.__click=()=>A(N.message);var g=re(_);{var e=n=>{var u=$e("Added");Z(n,u)},t=n=>{var u=ze(),l=Le(u);{var c=i=>{var a=$e("Failed");Z(i,a)},r=i=>{var a=$e("Add test");Z(i,a)};Ee(l,i=>{L(E)==="error"?i(c):i(r,!1)},!0)}Z(n,u)};Ee(g,n=>{L(E)==="ok"?n(e):n(t,!1)})}X(_),Pe(()=>Ne(_,1,`add-test cursor-pointer p-2 transition-opacity ${L(E)!=="idle"?"opacity-100":"opacity-0 group-hover:opacity-100"}`)),Z(S,_)};Ee(I,S=>{N.message.sender==="agent"&&S(F)})}X(O),Pe(()=>{v=Ne(O,1,"group flex",null,v,{"justify-end":N.message.sender==="user"||N.message.sender==="system"}),Ne(k,1,`rounded ${N.message.sender==="system"?"w-5/6 justify-self-end whitespace-pre-line break-words border border-emerald-500 text-emerald-500":N.message.sender!=="user"?"w-5/6 whitespace-pre-line break-words bg-emerald-700 text-rc-gray-100":"border-1 max-w5/6 justify-self-end border border-rc-gray-100 text-rc-gray-100"} mb-2 p-2`),Me(y,N.message.text)}),Z(U,O),De()}et(["click"]);var Bn=fe('<span class="ml-1"><!></span>'),Kn=fe('<span class="text-green-500"><!></span>'),Mn=fe("<span>❌</span>"),jn=fe('<div class="whitespace-pre-wrap font-mono text-xs"> <!></div>'),Dn=fe('<div class="z-50 scroll-auto rounded border border-gray-300 bg-gray-100 p-2 text-zinc-800 shadow-lg"></div>'),Un=fe('<div><div class="block"><div><div><div class="mx-1 my-1"> </div></div> <div class="inline-flex"> </div> <!> <!></div> <!></div></div>');function Vn(U,N){je(N,!0);let E=we(!1);function A(){Q(E,!L(E)&&N.action.logs.length>0,!0)}function O(c){return c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var v=Un(),k=re(v),h=re(k);let w;h.__click=A;var f=re(h),y=re(f),I=re(y,!0);X(y),X(f);var F=le(f,2),S=re(F,!0);X(F);var _=le(F,2);{var g=c=>{var r=Bn(),i=re(r);Ze(i,{name:"log",width:15,height:15,class:"inline-block"}),X(r),Z(c,r)};Ee(_,c=>{N.action.logs.length>0&&c(g)})}var e=le(_,2);{var t=c=>{var r=Kn(),i=re(r);Ze(i,{name:"checkmark",width:20,height:20,class:"inline-block"}),X(r),ct(3,r,()=>pt,()=>({duration:100})),Z(c,r)},n=c=>{var r=ze(),i=Le(r);{var a=o=>{var s=Mn();ct(3,s,()=>pt,()=>({duration:100})),Z(o,s)};Ee(i,o=>{N.action.action.state==="failed"&&o(a)},!0)}Z(c,r)};Ee(e,c=>{N.action.action.state==="completed"?c(t):c(n,!1)})}X(h);var u=le(h,2);{var l=c=>{var r=Dn();tt(r,21,()=>N.action.logs,nt,(i,a)=>{var o=jn(),s=re(o),d=le(s);un(d,()=>O(L(a).message)),X(o),Pe(()=>Me(s,`[${L(a).severity??""}]: `)),Z(i,o)}),X(r),ct(3,r,()=>pt,()=>({duration:100})),Z(c,r)};Ee(u,c=>{L(E)&&c(l)})}X(k),X(v),Pe(()=>{w=Ne(h,1,"mb-1 rounded p-0 text-rc-gray-100",null,w,{"cursor-pointer":N.action.logs.length>0}),Ne(f,1,`relative top-0 inline-flex rounded-sm border border-rc-gray-100 text-xs text-rc-gray-100 ${N.action.action.type==="AI Engine"?"hidden":""}`),Me(I,N.action.action.type),Me(S,N.action.action.message)}),Z(U,v),De()}et(["click"]);var $n=fe('<dialog class="dialog m-auto bg-transparent p-0 text-rc-gray-100 shadow-md svelte-jby388"><!> <!></dialog>');function Wn(U,N){je(N,!0);let E,A=We(N,"showCloseButton",3,!1),O=We(N,"onClose",3,()=>{}),v=We(N,"onOpen",3,()=>{}),k=We(N,"isOpen",3,!1);Xe(()=>{k()?(console.log("show"),E==null||E.showModal(),v()()):E!=null&&E.open&&(console.log("close"),E.close())});function h(){O()()}At(()=>(E.addEventListener("close",h),()=>{E.removeEventListener("close",h)}));function w(S){S.target===E&&E.close()}var f=$n();f.__mousedown=w;var y=re(f);rn(y,()=>N.children);var I=le(y,2);{var F=S=>{qe(S,{variant:"ghost",onclick:()=>E.close(),class:"absolute right-2 top-2",children:(_,g)=>{Qe();var e=$e("✕");Z(_,e)},$$slots:{default:!0}})};Ee(I,S=>{A()&&S(F)})}X(f),mt(f,S=>E=S,()=>E),Z(U,f),De()}et(["mousedown"]);var Gn=fe('<form><h2 class="text-l mb-4 text-gray-300">Image URL</h2> <!> <!></form>'),Hn=fe('<div class="chat-action svelte-14u1pl2"><!></div>'),zn=fe("<div><div><!></div></div>"),Yn=fe('<div class="scrollbar-none flex-1 overflow-y-auto"></div> <form class="mt-2 flex flex-none"><!> <!> <!></form>',1),Jn=fe("<!> <!>",1);function Qn(U,N){je(N,!0);let E=at(new Set),A=we(""),O=we(""),v=we(""),k,h=we(!1);Xe(()=>{Ye.length>0&&w(k)});function w(g){E.has(g)||!g||g.scrollTo({top:g.scrollHeight,behavior:"smooth"})}function f(g){g.scrollTop+g.clientHeight+200>g.scrollHeight?E.delete(g):E.add(g)}function y(g){g.preventDefault(),(L(A)||L(v))&&(N.onmessage({sender:"user",text:L(A),imageUrl:L(v)}),Q(v,""),Q(A,""))}function I(g){g.preventDefault(),Q(v,L(O),!0),Q(O,""),Q(h,!1)}var F=Jn(),S=Le(F);Wn(S,{get isOpen(){return L(h)},onClose:()=>Q(h,!1),showCloseButton:!0,children:(g,e)=>{vt(g,{class:"p-4",children:(t,n)=>{var u=Gn(),l=le(re(u),2);Et(l,{class:"mb-2 w-80",get value(){return L(O)},set value(r){Q(O,r,!0)}});var c=le(l,2);qe(c,{variant:"outlined",size:"big",type:"submit",class:"p-2",children:(r,i)=>{Qe();var a=$e("Attach");Z(r,a)},$$slots:{default:!0}}),X(u),lt("submit",u,I),Z(t,u)}})},$$slots:{default:!0}});var _=le(S,2);vt(_,{get class(){return`flex flex-col p-2 ${N.class??""}`},children:(g,e)=>{var t=Yn(),n=Le(t);tt(n,21,()=>Ye,nt,(i,a)=>{var o=zn();let s;var d=re(o),p=re(d);{var T=P=>{var B=Hn(),j=re(B);Vn(j,{get action(){return L(a)}}),X(B),Z(P,B)},R=P=>{Rn(P,{get message(){return L(a)},get context(){return N.context},get agentId(){return N.agentId}})};Ee(p,P=>{gt(L(a))?P(T):P(R,!1)})}X(d),X(o),Pe(P=>s=Ne(o,1,"log-element svelte-14u1pl2",null,s,P),[()=>({"log-element-chat":jt(L(a))})]),Z(i,o)}),X(n),mt(n,i=>k=i,()=>k);var u=le(n,2),l=re(u);Et(l,{class:"block w-full",placeholder:"Enter user's message...",get value(){return L(A)},set value(i){Q(A,i,!0)}});var c=le(l,2);qe(c,{class:"ml-2",onclick:()=>Q(h,!0),children:(i,a)=>{Ze(i,{name:"paperclip"})},$$slots:{default:!0}});var r=le(c,2);qe(r,{class:"ml-2",type:"submit",children:(i,a)=>{Ze(i,{name:"send"})},$$slots:{default:!0}}),X(u),lt("scroll",n,i=>f(i.target)),lt("submit",u,y),Z(g,t)}}),Z(U,F),De()}function qn(U,N){U.languages.registerCompletionItemProvider("markdown",{triggerCharacters:[" ","."],provideCompletionItems:(E,A)=>{const O=E.getValueInRange({startLineNumber:A.lineNumber,startColumn:1,endLineNumber:A.lineNumber,endColumn:A.column}),v=O.match(/\{%\s*(if|elif|for)\s+([^%]*)$/),k=O.match(/\{\{\s*([^}]*)$/);if(v||k){let w="";v?w=v[2].trim():k&&(w=k[1].trim());const{keys:f,lastPartLength:y}=Xn(N,w);return{suggestions:f.map(F=>({label:F,kind:U.languages.CompletionItemKind.Variable,insertText:F,range:{startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:A.column-y,endColumn:A.column}}))}}const h=O.match(/\{%\s*([^%]*)$/);if(h){const w=h[1].trim();return{suggestions:["if","elif","else","endif","for","endfor"].filter(y=>y.startsWith(w)).map((y,I)=>({label:y,kind:U.languages.CompletionItemKind.Keyword,insertText:y,sortText:String(I).padStart(2,"0"),range:{startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:A.column-w.length,endColumn:A.column}}))}}return{suggestions:[]}}})}function Xn(U,N){let E=U,A=[],O=0;if(N==="")A=Object.keys(U??{}),O=0;else if(N.includes(".")){const v=N.split("."),k=v.pop()||"";O=k.length;for(const h of v)if(E&&typeof E=="object"&&h in E)E=E[h];else{E=null;break}E&&typeof E=="object"&&(A=Object.keys(E).filter(h=>h.startsWith(k)))}else O=N.length,A=Object.keys(U??{}).filter(v=>v.startsWith(N));return{keys:A,lastPartLength:O}}var Zn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function er(U){return U&&U.__esModule&&Object.prototype.hasOwnProperty.call(U,"default")?U.default:U}var Dt={exports:{}};/*! Browser bundle of nunjucks 3.2.4 */(function(U,N){(function(A,O){U.exports=O()})(typeof self<"u"?self:Zn,function(){return function(E){var A={};function O(v){if(A[v])return A[v].exports;var k=A[v]={i:v,l:!1,exports:{}};return E[v].call(k.exports,k,k.exports,O),k.l=!0,k.exports}return O.m=E,O.c=A,O.d=function(v,k,h){O.o(v,k)||Object.defineProperty(v,k,{configurable:!1,enumerable:!0,get:h})},O.n=function(v){var k=v&&v.__esModule?function(){return v.default}:function(){return v};return O.d(k,"a",k),k},O.o=function(v,k){return Object.prototype.hasOwnProperty.call(v,k)},O.p="",O(O.s=11)}([function(E,f,O){var v=Array.prototype,k=Object.prototype,h={"&":"&",'"':""","'":"'","<":"<",">":">","\\":"\"},w=/[&"'<>\\]/g,f=E.exports={};function y(m,C){return k.hasOwnProperty.call(m,C)}f.hasOwnProp=y;function I(m){return h[m]}function F(m,C,M){if(M.Update||(M=new f.TemplateError(M)),M.Update(m),!C){var V=M;M=new Error(V.message),M.name=V.name}return M}f._prettifyError=F;function S(m,C,M){var V,z;m instanceof Error&&(z=m,m=z.name+": "+z.message),Object.setPrototypeOf?(V=new Error(m),Object.setPrototypeOf(V,S.prototype)):(V=this,Object.defineProperty(V,"message",{enumerable:!1,writable:!0,value:m})),Object.defineProperty(V,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(V,this.constructor);var ae;if(z){var ee=Object.getOwnPropertyDescriptor(z,"stack");ae=ee&&(ee.get||function(){return ee.value}),ae||(ae=function(){return z.stack})}else{var ge=new Error(m).stack;ae=function(){return ge}}return Object.defineProperty(V,"stack",{get:function(){return ae.call(V)}}),Object.defineProperty(V,"cause",{value:z}),V.lineno=C,V.colno=M,V.firstUpdate=!0,V.Update=function(oe){var ie="("+(oe||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?ie+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(ie+=" [Line "+this.lineno+"]")),ie+=`
|
|
5
|
+
`,this.firstUpdate&&(ie+=" "),this.message=ie+(this.message||""),this.firstUpdate=!1,this},V}Object.setPrototypeOf?Object.setPrototypeOf(S.prototype,Error.prototype):S.prototype=Object.create(Error.prototype,{constructor:{value:S}}),f.TemplateError=S;function _(m){return m.replace(w,I)}f.escape=_;function g(m){return k.toString.call(m)==="[object Function]"}f.isFunction=g;function e(m){return k.toString.call(m)==="[object Array]"}f.isArray=e;function t(m){return k.toString.call(m)==="[object String]"}f.isString=t;function n(m){return k.toString.call(m)==="[object Object]"}f.isObject=n;function u(m){return m?typeof m=="string"?m.split("."):[m]:[]}function l(m){var C=u(m);return function(V){for(var z=V,ae=0;ae<C.length;ae++){var ee=C[ae];if(y(z,ee))z=z[ee];else return}return z}}f.getAttrGetter=l;function c(m,C,M){for(var V={},z=g(C)?C:l(C),ae=0;ae<m.length;ae++){var ee=m[ae],ge=z(ee,ae);if(ge===void 0&&M===!0)throw new TypeError('groupby: attribute "'+C+'" resolved to undefined');(V[ge]||(V[ge]=[])).push(ee)}return V}f.groupBy=c;function r(m){return Array.prototype.slice.call(m)}f.toArray=r;function i(m){var C=[];if(!m)return C;for(var M=m.length,V=r(arguments).slice(1),z=-1;++z<M;)T(V,m[z])===-1&&C.push(m[z]);return C}f.without=i;function a(m,C){for(var M="",V=0;V<C;V++)M+=m;return M}f.repeat=a;function o(m,C,M){if(m!=null){if(v.forEach&&m.forEach===v.forEach)m.forEach(C,M);else if(m.length===+m.length)for(var V=0,z=m.length;V<z;V++)C.call(M,m[V],V,m)}}f.each=o;function s(m,C){var M=[];if(m==null)return M;if(v.map&&m.map===v.map)return m.map(C);for(var V=0;V<m.length;V++)M[M.length]=C(m[V],V);return m.length===+m.length&&(M.length=m.length),M}f.map=s;function d(m,C,M){var V=-1;function z(){V++,V<m.length?C(m[V],V,z,M):M()}z()}f.asyncIter=d;function p(m,C,M){var V=R(m||{}),z=V.length,ae=-1;function ee(){ae++;var ge=V[ae];ae<z?C(ge,m[ge],ae,z,ee):M()}ee()}f.asyncFor=p;function T(m,C,M){return Array.prototype.indexOf.call(m||[],C,M)}f.indexOf=T;function R(m){var C=[];for(var M in m)y(m,M)&&C.push(M);return C}f.keys=R;function P(m){return R(m).map(function(C){return[C,m[C]]})}f._entries=P;function B(m){return R(m).map(function(C){return m[C]})}f._values=B;function j(m,C){return m=m||{},R(C).forEach(function(M){m[M]=C[M]}),m}f._assign=f.extend=j;function b(m,C){if(e(C)||t(C))return C.indexOf(m)!==-1;if(n(C))return m in C;throw new Error('Cannot use "in" operator to search for "'+m+'" in unexpected types.')}f.inOperator=b},function(E,A,O){function v(t,n){for(var u=0;u<n.length;u++){var l=n[u];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(t,h(l.key),l)}}function k(t,n,u){return n&&v(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function h(t){var n=w(t,"string");return typeof n=="symbol"?n:String(n)}function w(t,n){if(typeof t!="object"||t===null)return t;var u=t[Symbol.toPrimitive];if(u!==void 0){var l=u.call(t,n);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function f(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,y(t,n)}function y(t,n){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,c){return l.__proto__=c,l},y(t,n)}var I=O(16),F=O(0);function S(t,n){return typeof t!="function"||typeof n!="function"?n:function(){var l=this.parent;this.parent=t;var c=n.apply(this,arguments);return this.parent=l,c}}function _(t,n,u){u=u||{},F.keys(u).forEach(function(c){u[c]=S(t.prototype[c],u[c])});var l=function(c){f(r,c);function r(){return c.apply(this,arguments)||this}return k(r,[{key:"typename",get:function(){return n}}]),r}(t);return F._assign(l.prototype,u),l}var g=function(){function t(){this.init.apply(this,arguments)}var n=t.prototype;return n.init=function(){},t.extend=function(l,c){return typeof l=="object"&&(c=l,l="anonymous"),_(this,l,c)},k(t,[{key:"typename",get:function(){return this.constructor.name}}]),t}(),e=function(t){f(n,t);function n(){var l,c;return c=t.call(this)||this,(l=c).init.apply(l,arguments),c}var u=n.prototype;return u.init=function(){},n.extend=function(c,r){return typeof c=="object"&&(r=c,c="anonymous"),_(this,c,r)},k(n,[{key:"typename",get:function(){return this.constructor.name}}]),n}(I);E.exports={Obj:g,EmitterObj:e}},function(E,A,O){var v=O(0),k=Array.from,h=typeof Symbol=="function"&&Symbol.iterator&&typeof k=="function",w=function(){function s(p,T){this.variables=Object.create(null),this.parent=p,this.topLevel=!1,this.isolateWrites=T}var d=s.prototype;return d.set=function(T,R,P){var B=T.split("."),j=this.variables,b=this;if(P&&(b=this.resolve(B[0],!0))){b.set(T,R);return}for(var m=0;m<B.length-1;m++){var C=B[m];j[C]||(j[C]={}),j=j[C]}j[B[B.length-1]]=R},d.get=function(T){var R=this.variables[T];return R!==void 0?R:null},d.lookup=function(T){var R=this.parent,P=this.variables[T];return P!==void 0?P:R&&R.lookup(T)},d.resolve=function(T,R){var P=R&&this.isolateWrites?void 0:this.parent,B=this.variables[T];return B!==void 0?this:P&&P.resolve(T)},d.push=function(T){return new s(this,T)},d.pop=function(){return this.parent},s}();function f(s,d,p){return function(){for(var R=arguments.length,P=new Array(R),B=0;B<R;B++)P[B]=arguments[B];var j=S(P),b,m=F(P);if(j>s.length)b=P.slice(0,s.length),P.slice(b.length,j).forEach(function(V,z){z<d.length&&(m[d[z]]=V)}),b.push(m);else if(j<s.length){b=P.slice(0,j);for(var C=j;C<s.length;C++){var M=s[C];b.push(m[M]),delete m[M]}b.push(m)}else b=P;return p.apply(this,b)}}function y(s){return s.__keywords=!0,s}function I(s){return s&&Object.prototype.hasOwnProperty.call(s,"__keywords")}function F(s){var d=s.length;if(d){var p=s[d-1];if(I(p))return p}return{}}function S(s){var d=s.length;if(d===0)return 0;var p=s[d-1];return I(p)?d-1:d}function _(s){if(typeof s!="string")return s;this.val=s,this.length=s.length}_.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),_.prototype.valueOf=function(){return this.val},_.prototype.toString=function(){return this.val};function g(s,d){return s instanceof _?new _(d):d.toString()}function e(s){var d=typeof s;return d==="string"?new _(s):d!=="function"?s:function(T){var R=s.apply(this,arguments);return typeof R=="string"?new _(R):R}}function t(s,d){return s=s??"",d&&!(s instanceof _)&&(s=v.escape(s.toString())),s}function n(s,d,p){if(s==null)throw new v.TemplateError("attempted to output null or undefined value",d+1,p+1);return s}function u(s,d){if(s!=null)return typeof s[d]=="function"?function(){for(var p=arguments.length,T=new Array(p),R=0;R<p;R++)T[R]=arguments[R];return s[d].apply(s,T)}:s[d]}function l(s,d,p,T){if(s){if(typeof s!="function")throw new Error("Unable to call `"+d+"`, which is not a function")}else throw new Error("Unable to call `"+d+"`, which is undefined or falsey");return s.apply(p,T)}function c(s,d,p){var T=d.lookup(p);return T!==void 0?T:s.lookup(p)}function r(s,d,p){return s.lineno?s:new v.TemplateError(s,d,p)}function i(s,d,p,T){if(v.isArray(s)){var R=s.length;v.asyncIter(s,function(B,j,b){switch(d){case 1:p(B,j,R,b);break;case 2:p(B[0],B[1],j,R,b);break;case 3:p(B[0],B[1],B[2],j,R,b);break;default:B.push(j,R,b),p.apply(this,B)}},T)}else v.asyncFor(s,function(B,j,b,m,C){p(B,j,b,m,C)},T)}function a(s,d,p,T){var R=0,P,B;function j(z,ae){R++,B[z]=ae,R===P&&T(null,B.join(""))}if(v.isArray(s))if(P=s.length,B=new Array(P),P===0)T(null,"");else for(var b=0;b<s.length;b++){var m=s[b];switch(d){case 1:p(m,b,P,j);break;case 2:p(m[0],m[1],b,P,j);break;case 3:p(m[0],m[1],m[2],b,P,j);break;default:m.push(b,P,j),p.apply(this,m)}}else{var C=v.keys(s||{});if(P=C.length,B=new Array(P),P===0)T(null,"");else for(var M=0;M<C.length;M++){var V=C[M];p(V,s[V],M,P,j)}}}function o(s){return typeof s!="object"||s===null||v.isArray(s)?s:h&&Symbol.iterator in s?k(s):s}E.exports={Frame:w,makeMacro:f,makeKeywordArgs:y,numArgs:S,suppressValue:t,ensureDefined:n,memberLookup:u,contextOrFrameLookup:c,callWrap:l,handleError:r,isArray:v.isArray,keys:v.keys,SafeString:_,copySafeness:g,markSafe:e,asyncEach:i,asyncAll:a,inOperator:v.inOperator,fromIterator:o}},function(E,A,O){function v(H,q){for(var de=0;de<q.length;de++){var ue=q[de];ue.enumerable=ue.enumerable||!1,ue.configurable=!0,"value"in ue&&(ue.writable=!0),Object.defineProperty(H,h(ue.key),ue)}}function k(H,q,de){return q&&v(H.prototype,q),Object.defineProperty(H,"prototype",{writable:!1}),H}function h(H){var q=w(H,"string");return typeof q=="symbol"?q:String(q)}function w(H,q){if(typeof H!="object"||H===null)return H;var de=H[Symbol.toPrimitive];if(de!==void 0){var ue=de.call(H,q);if(typeof ue!="object")return ue;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(H)}function f(H,q){H.prototype=Object.create(q.prototype),H.prototype.constructor=H,y(H,q)}function y(H,q){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(ue,ve){return ue.__proto__=ve,ue},y(H,q)}var I=O(1),F=I.Obj;function S(H,q,de){H instanceof q&&de.push(H),H instanceof _&&H.findAll(q,de)}var _=function(H){f(q,H);function q(){return H.apply(this,arguments)||this}var de=q.prototype;return de.init=function(ve,xe){for(var Ce=arguments,Je=this,rt=arguments.length,Vt=new Array(rt>2?rt-2:0),ut=2;ut<rt;ut++)Vt[ut-2]=arguments[ut];this.lineno=ve,this.colno=xe,this.fields.forEach(function($t,Wt){var _t=Ce[Wt+2];_t===void 0&&(_t=null),Je[$t]=_t})},de.findAll=function(ve,xe){var Ce=this;return xe=xe||[],this instanceof e?this.children.forEach(function(Je){return S(Je,ve,xe)}):this.fields.forEach(function(Je){return S(Ce[Je],ve,xe)}),xe},de.iterFields=function(ve){var xe=this;this.fields.forEach(function(Ce){ve(xe[Ce],Ce)})},q}(F),g=function(H){f(q,H);function q(){return H.apply(this,arguments)||this}return k(q,[{key:"typename",get:function(){return"Value"}},{key:"fields",get:function(){return["value"]}}]),q}(_),e=function(H){f(q,H);function q(){return H.apply(this,arguments)||this}var de=q.prototype;return de.init=function(ve,xe,Ce){H.prototype.init.call(this,ve,xe,Ce||[])},de.addChild=function(ve){this.children.push(ve)},k(q,[{key:"typename",get:function(){return"NodeList"}},{key:"fields",get:function(){return["children"]}}]),q}(_),t=e.extend("Root"),n=g.extend("Literal"),u=g.extend("Symbol"),l=e.extend("Group"),c=e.extend("Array"),r=_.extend("Pair",{fields:["key","value"]}),i=e.extend("Dict"),a=_.extend("LookupVal",{fields:["target","val"]}),o=_.extend("If",{fields:["cond","body","else_"]}),s=o.extend("IfAsync"),d=_.extend("InlineIf",{fields:["cond","body","else_"]}),p=_.extend("For",{fields:["arr","name","body","else_"]}),T=p.extend("AsyncEach"),R=p.extend("AsyncAll"),P=_.extend("Macro",{fields:["name","args","body"]}),B=P.extend("Caller"),j=_.extend("Import",{fields:["template","target","withContext"]}),b=function(H){f(q,H);function q(){return H.apply(this,arguments)||this}var de=q.prototype;return de.init=function(ve,xe,Ce,Je,rt){H.prototype.init.call(this,ve,xe,Ce,Je||new e,rt)},k(q,[{key:"typename",get:function(){return"FromImport"}},{key:"fields",get:function(){return["template","names","withContext"]}}]),q}(_),m=_.extend("FunCall",{fields:["name","args"]}),C=m.extend("Filter"),M=C.extend("FilterAsync",{fields:["name","args","symbol"]}),V=i.extend("KeywordArgs"),z=_.extend("Block",{fields:["name","body"]}),ae=_.extend("Super",{fields:["blockName","symbol"]}),ee=_.extend("TemplateRef",{fields:["template"]}),ge=ee.extend("Extends"),be=_.extend("Include",{fields:["template","ignoreMissing"]}),oe=_.extend("Set",{fields:["targets","value"]}),ie=_.extend("Switch",{fields:["expr","cases","default"]}),G=_.extend("Case",{fields:["cond","body"]}),J=e.extend("Output"),Y=_.extend("Capture",{fields:["body"]}),ce=n.extend("TemplateData"),ke=_.extend("UnaryOp",{fields:["target"]}),ye=_.extend("BinOp",{fields:["left","right"]}),Re=ye.extend("In"),x=ye.extend("Is"),K=ye.extend("Or"),W=ye.extend("And"),$=ke.extend("Not"),te=ye.extend("Add"),ne=ye.extend("Concat"),pe=ye.extend("Sub"),se=ye.extend("Mul"),_e=ye.extend("Div"),Se=ye.extend("FloorDiv"),Fe=ye.extend("Mod"),D=ye.extend("Pow"),he=ke.extend("Neg"),me=ke.extend("Pos"),Ae=_.extend("Compare",{fields:["expr","ops"]}),Be=_.extend("CompareOperand",{fields:["expr","type"]}),Te=_.extend("CallExtension",{init:function(q,de,ue,ve){this.parent(),this.extName=q.__name||q,this.prop=de,this.args=ue||new e,this.contentArgs=ve||[],this.autoescape=q.autoescape},fields:["extName","prop","args","contentArgs"]}),Ge=Te.extend("CallExtensionAsync");function Oe(H,q,de){var ue=H.split(`
|
|
6
|
+
`);ue.forEach(function(ve,xe){ve&&(de&&xe>0||!de)&&process.stdout.write(" ".repeat(q));var Ce=xe===ue.length-1?"":`
|
|
7
|
+
`;process.stdout.write(""+ve+Ce)})}function Ie(H,q){if(q=q||0,Oe(H.typename+": ",q),H instanceof e)Oe(`
|
|
8
|
+
`),H.children.forEach(function(ve){Ie(ve,q+2)});else if(H instanceof Te)Oe(H.extName+"."+H.prop+`
|
|
9
|
+
`),H.args&&Ie(H.args,q+2),H.contentArgs&&H.contentArgs.forEach(function(ve){Ie(ve,q+2)});else{var de=[],ue=null;H.iterFields(function(ve,xe){ve instanceof _?de.push([xe,ve]):(ue=ue||{},ue[xe]=ve)}),ue?Oe(JSON.stringify(ue,null,2)+`
|
|
10
|
+
`,null,!0):Oe(`
|
|
11
|
+
`),de.forEach(function(ve){var xe=ve[0],Ce=ve[1];Oe("["+xe+"] =>",q+2),Ie(Ce,q+4)})}}E.exports={Node:_,Root:t,NodeList:e,Value:g,Literal:n,Symbol:u,Group:l,Array:c,Pair:r,Dict:i,Output:J,Capture:Y,TemplateData:ce,If:o,IfAsync:s,InlineIf:d,For:p,AsyncEach:T,AsyncAll:R,Macro:P,Caller:B,Import:j,FromImport:b,FunCall:m,Filter:C,FilterAsync:M,KeywordArgs:V,Block:z,Super:ae,Extends:ge,Include:be,Set:oe,Switch:ie,Case:G,LookupVal:a,BinOp:ye,In:Re,Is:x,Or:K,And:W,Not:$,Add:te,Concat:ne,Sub:pe,Mul:se,Div:_e,FloorDiv:Se,Mod:Fe,Pow:D,Neg:he,Pos:me,Compare:Ae,CompareOperand:Be,CallExtension:Te,CallExtensionAsync:Ge,printNodes:Ie}},function(E,A){},function(E,A,O){function v(n,u){n.prototype=Object.create(u.prototype),n.prototype.constructor=n,k(n,u)}function k(n,u){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,r){return c.__proto__=r,c},k(n,u)}var h=O(8),w=O(17),f=O(3),y=O(0),I=y.TemplateError,F=O(2),S=F.Frame,_=O(1),g=_.Obj,e={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},t=function(n){v(u,n);function u(){return n.apply(this,arguments)||this}var l=u.prototype;return l.init=function(r,i){this.templateName=r,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=i},l.fail=function(r,i,a){throw i!==void 0&&(i+=1),a!==void 0&&(a+=1),new I(r,i,a)},l._pushBuffer=function(){var r=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=r,this._emit("var "+this.buffer+' = "";'),r},l._popBuffer=function(){this.buffer=this.bufferStack.pop()},l._emit=function(r){this.codebuf.push(r)},l._emitLine=function(r){this._emit(r+`
|
|
12
|
+
`)},l._emitLines=function(){for(var r=this,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];a.forEach(function(s){return r._emitLine(s)})},l._emitFuncBegin=function(r,i){this.buffer="output",this._scopeClosers="",this._emitLine("function "+i+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+r.lineno+";"),this._emitLine("var colno = "+r.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},l._emitFuncEnd=function(r){r||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},l._addScopeLevel=function(){this._scopeClosers+="})"},l._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},l._withScopedSyntax=function(r){var i=this._scopeClosers;this._scopeClosers="",r.call(this),this._closeScopeLevels(),this._scopeClosers=i},l._makeCallback=function(r){var i=this._tmpid();return"function("+i+(r?","+r:"")+`) {
|
|
13
|
+
if(`+i+") { cb("+i+"); return; }"},l._tmpid=function(){return this.lastId++,"t_"+this.lastId},l._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},l._compileChildren=function(r,i){var a=this;r.children.forEach(function(o){a.compile(o,i)})},l._compileAggregate=function(r,i,a,o){var s=this;a&&this._emit(a),r.children.forEach(function(d,p){p>0&&s._emit(","),s.compile(d,i)}),o&&this._emit(o)},l._compileExpression=function(r,i){this.assertType(r,f.Literal,f.Symbol,f.Group,f.Array,f.Dict,f.FunCall,f.Caller,f.Filter,f.LookupVal,f.Compare,f.InlineIf,f.In,f.Is,f.And,f.Or,f.Not,f.Add,f.Concat,f.Sub,f.Mul,f.Div,f.FloorDiv,f.Mod,f.Pow,f.Neg,f.Pos,f.Compare,f.NodeList),this.compile(r,i)},l.assertType=function(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];a.some(function(s){return r instanceof s})||this.fail("assertType: invalid type: "+r.typename,r.lineno,r.colno)},l.compileCallExtension=function(r,i,a){var o=this,s=r.args,d=r.contentArgs,p=typeof r.autoescape=="boolean"?r.autoescape:!0;if(a||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+r.extName+'")["'+r.prop+'"]('),this._emit("context"),(s||d)&&this._emit(","),s&&(s instanceof f.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),s.children.forEach(function(R,P){o._compileExpression(R,i),(P!==s.children.length-1||d.length)&&o._emit(",")})),d.length&&d.forEach(function(R,P){if(P>0&&o._emit(","),R){o._emitLine("function(cb) {"),o._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var B=o._pushBuffer();o._withScopedSyntax(function(){o.compile(R,i),o._emitLine("cb(null, "+B+");")}),o._popBuffer(),o._emitLine("return "+B+";"),o._emitLine("}")}else o._emit("null")}),a){var T=this._tmpid();this._emitLine(", "+this._makeCallback(T)),this._emitLine(this.buffer+" += runtime.suppressValue("+T+", "+p+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+p+` && env.opts.autoescape);
|
|
14
|
+
`)},l.compileCallExtensionAsync=function(r,i){this.compileCallExtension(r,i,!0)},l.compileNodeList=function(r,i){this._compileChildren(r,i)},l.compileLiteral=function(r){if(typeof r.value=="string"){var i=r.value.replace(/\\/g,"\\\\");i=i.replace(/"/g,'\\"'),i=i.replace(/\n/g,"\\n"),i=i.replace(/\r/g,"\\r"),i=i.replace(/\t/g,"\\t"),i=i.replace(/\u2028/g,"\\u2028"),this._emit('"'+i+'"')}else r.value===null?this._emit("null"):this._emit(r.value.toString())},l.compileSymbol=function(r,i){var a=r.value,o=i.lookup(a);o?this._emit(o):this._emit('runtime.contextOrFrameLookup(context, frame, "'+a+'")')},l.compileGroup=function(r,i){this._compileAggregate(r,i,"(",")")},l.compileArray=function(r,i){this._compileAggregate(r,i,"[","]")},l.compileDict=function(r,i){this._compileAggregate(r,i,"{","}")},l.compilePair=function(r,i){var a=r.key,o=r.value;a instanceof f.Symbol?a=new f.Literal(a.lineno,a.colno,a.value):a instanceof f.Literal&&typeof a.value=="string"||this.fail("compilePair: Dict keys must be strings or names",a.lineno,a.colno),this.compile(a,i),this._emit(": "),this._compileExpression(o,i)},l.compileInlineIf=function(r,i){this._emit("("),this.compile(r.cond,i),this._emit("?"),this.compile(r.body,i),this._emit(":"),r.else_!==null?this.compile(r.else_,i):this._emit('""'),this._emit(")")},l.compileIn=function(r,i){this._emit("runtime.inOperator("),this.compile(r.left,i),this._emit(","),this.compile(r.right,i),this._emit(")")},l.compileIs=function(r,i){var a=r.right.name?r.right.name.value:r.right.value;this._emit('env.getTest("'+a+'").call(context, '),this.compile(r.left,i),r.right.args&&(this._emit(","),this.compile(r.right.args,i)),this._emit(") === true")},l._binOpEmitter=function(r,i,a){this.compile(r.left,i),this._emit(a),this.compile(r.right,i)},l.compileOr=function(r,i){return this._binOpEmitter(r,i," || ")},l.compileAnd=function(r,i){return this._binOpEmitter(r,i," && ")},l.compileAdd=function(r,i){return this._binOpEmitter(r,i," + ")},l.compileConcat=function(r,i){return this._binOpEmitter(r,i,' + "" + ')},l.compileSub=function(r,i){return this._binOpEmitter(r,i," - ")},l.compileMul=function(r,i){return this._binOpEmitter(r,i," * ")},l.compileDiv=function(r,i){return this._binOpEmitter(r,i," / ")},l.compileMod=function(r,i){return this._binOpEmitter(r,i," % ")},l.compileNot=function(r,i){this._emit("!"),this.compile(r.target,i)},l.compileFloorDiv=function(r,i){this._emit("Math.floor("),this.compile(r.left,i),this._emit(" / "),this.compile(r.right,i),this._emit(")")},l.compilePow=function(r,i){this._emit("Math.pow("),this.compile(r.left,i),this._emit(", "),this.compile(r.right,i),this._emit(")")},l.compileNeg=function(r,i){this._emit("-"),this.compile(r.target,i)},l.compilePos=function(r,i){this._emit("+"),this.compile(r.target,i)},l.compileCompare=function(r,i){var a=this;this.compile(r.expr,i),r.ops.forEach(function(o){a._emit(" "+e[o.type]+" "),a.compile(o.expr,i)})},l.compileLookupVal=function(r,i){this._emit("runtime.memberLookup(("),this._compileExpression(r.target,i),this._emit("),"),this._compileExpression(r.val,i),this._emit(")")},l._getNodeName=function(r){switch(r.typename){case"Symbol":return r.value;case"FunCall":return"the return value of ("+this._getNodeName(r.name)+")";case"LookupVal":return this._getNodeName(r.target)+'["'+this._getNodeName(r.val)+'"]';case"Literal":return r.value.toString();default:return"--expression--"}},l.compileFunCall=function(r,i){this._emit("(lineno = "+r.lineno+", colno = "+r.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(r.name,i),this._emit(', "'+this._getNodeName(r.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(r.args,i,"[","])"),this._emit(")")},l.compileFilter=function(r,i){var a=r.name;this.assertType(a,f.Symbol),this._emit('env.getFilter("'+a.value+'").call(context, '),this._compileAggregate(r.args,i),this._emit(")")},l.compileFilterAsync=function(r,i){var a=r.name,o=r.symbol.value;this.assertType(a,f.Symbol),i.set(o,o),this._emit('env.getFilter("'+a.value+'").call(context, '),this._compileAggregate(r.args,i),this._emitLine(", "+this._makeCallback(o)),this._addScopeLevel()},l.compileKeywordArgs=function(r,i){this._emit("runtime.makeKeywordArgs("),this.compileDict(r,i),this._emit(")")},l.compileSet=function(r,i){var a=this,o=[];r.targets.forEach(function(s){var d=s.value,p=i.lookup(d);p==null&&(p=a._tmpid(),a._emitLine("var "+p+";")),o.push(p)}),r.value?(this._emit(o.join(" = ")+" = "),this._compileExpression(r.value,i),this._emitLine(";")):(this._emit(o.join(" = ")+" = "),this.compile(r.body,i),this._emitLine(";")),r.targets.forEach(function(s,d){var p=o[d],T=s.value;a._emitLine('frame.set("'+T+'", '+p+", true);"),a._emitLine("if(frame.topLevel) {"),a._emitLine('context.setVariable("'+T+'", '+p+");"),a._emitLine("}"),T.charAt(0)!=="_"&&(a._emitLine("if(frame.topLevel) {"),a._emitLine('context.addExport("'+T+'", '+p+");"),a._emitLine("}"))})},l.compileSwitch=function(r,i){var a=this;this._emit("switch ("),this.compile(r.expr,i),this._emit(") {"),r.cases.forEach(function(o,s){a._emit("case "),a.compile(o.cond,i),a._emit(": "),a.compile(o.body,i),o.body.children.length&&a._emitLine("break;")}),r.default&&(this._emit("default:"),this.compile(r.default,i)),this._emit("}")},l.compileIf=function(r,i,a){var o=this;this._emit("if("),this._compileExpression(r.cond,i),this._emitLine(") {"),this._withScopedSyntax(function(){o.compile(r.body,i),a&&o._emit("cb()")}),r.else_?(this._emitLine(`}
|
|
15
|
+
else {`),this._withScopedSyntax(function(){o.compile(r.else_,i),a&&o._emit("cb()")})):a&&(this._emitLine(`}
|
|
16
|
+
else {`),this._emit("cb()")),this._emitLine("}")},l.compileIfAsync=function(r,i){this._emit("(function(cb) {"),this.compileIf(r,i,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},l._emitLoopBindings=function(r,i,a,o){var s=this,d=[{name:"index",val:a+" + 1"},{name:"index0",val:a},{name:"revindex",val:o+" - "+a},{name:"revindex0",val:o+" - "+a+" - 1"},{name:"first",val:a+" === 0"},{name:"last",val:a+" === "+o+" - 1"},{name:"length",val:o}];d.forEach(function(p){s._emitLine('frame.set("loop.'+p.name+'", '+p.val+");")})},l.compileFor=function(r,i){var a=this,o=this._tmpid(),s=this._tmpid(),d=this._tmpid();if(i=i.push(),this._emitLine("frame = frame.push();"),this._emit("var "+d+" = "),this._compileExpression(r.arr,i),this._emitLine(";"),this._emit("if("+d+") {"),this._emitLine(d+" = runtime.fromIterator("+d+");"),r.name instanceof f.Array){this._emitLine("var "+o+";"),this._emitLine("if(runtime.isArray("+d+")) {"),this._emitLine("var "+s+" = "+d+".length;"),this._emitLine("for("+o+"=0; "+o+" < "+d+".length; "+o+"++) {"),r.name.children.forEach(function(b,m){var C=a._tmpid();a._emitLine("var "+C+" = "+d+"["+o+"]["+m+"];"),a._emitLine('frame.set("'+b+'", '+d+"["+o+"]["+m+"]);"),i.set(r.name.children[m].value,C)}),this._emitLoopBindings(r,d,o,s),this._withScopedSyntax(function(){a.compile(r.body,i)}),this._emitLine("}"),this._emitLine("} else {");var p=r.name.children,T=p[0],R=p[1],P=this._tmpid(),B=this._tmpid();i.set(T.value,P),i.set(R.value,B),this._emitLine(o+" = -1;"),this._emitLine("var "+s+" = runtime.keys("+d+").length;"),this._emitLine("for(var "+P+" in "+d+") {"),this._emitLine(o+"++;"),this._emitLine("var "+B+" = "+d+"["+P+"];"),this._emitLine('frame.set("'+T.value+'", '+P+");"),this._emitLine('frame.set("'+R.value+'", '+B+");"),this._emitLoopBindings(r,d,o,s),this._withScopedSyntax(function(){a.compile(r.body,i)}),this._emitLine("}"),this._emitLine("}")}else{var j=this._tmpid();i.set(r.name.value,j),this._emitLine("var "+s+" = "+d+".length;"),this._emitLine("for(var "+o+"=0; "+o+" < "+d+".length; "+o+"++) {"),this._emitLine("var "+j+" = "+d+"["+o+"];"),this._emitLine('frame.set("'+r.name.value+'", '+j+");"),this._emitLoopBindings(r,d,o,s),this._withScopedSyntax(function(){a.compile(r.body,i)}),this._emitLine("}")}this._emitLine("}"),r.else_&&(this._emitLine("if (!"+s+") {"),this.compile(r.else_,i),this._emitLine("}")),this._emitLine("frame = frame.pop();")},l._compileAsyncLoop=function(r,i,a){var o=this,s=this._tmpid(),d=this._tmpid(),p=this._tmpid(),T=a?"asyncAll":"asyncEach";if(i=i.push(),this._emitLine("frame = frame.push();"),this._emit("var "+p+" = runtime.fromIterator("),this._compileExpression(r.arr,i),this._emitLine(");"),r.name instanceof f.Array){var R=r.name.children.length;this._emit("runtime."+T+"("+p+", "+R+", function("),r.name.children.forEach(function(j){o._emit(j.value+",")}),this._emit(s+","+d+",next) {"),r.name.children.forEach(function(j){var b=j.value;i.set(b,b),o._emitLine('frame.set("'+b+'", '+b+");")})}else{var P=r.name.value;this._emitLine("runtime."+T+"("+p+", 1, function("+P+", "+s+", "+d+",next) {"),this._emitLine('frame.set("'+P+'", '+P+");"),i.set(P,P)}this._emitLoopBindings(r,p,s,d),this._withScopedSyntax(function(){var j;a&&(j=o._pushBuffer()),o.compile(r.body,i),o._emitLine("next("+s+(j?","+j:"")+");"),a&&o._popBuffer()});var B=this._tmpid();this._emitLine("}, "+this._makeCallback(B)),this._addScopeLevel(),a&&this._emitLine(this.buffer+" += "+B+";"),r.else_&&(this._emitLine("if (!"+p+".length) {"),this.compile(r.else_,i),this._emitLine("}")),this._emitLine("frame = frame.pop();")},l.compileAsyncEach=function(r,i){this._compileAsyncLoop(r,i)},l.compileAsyncAll=function(r,i){this._compileAsyncLoop(r,i,!0)},l._compileMacro=function(r,i){var a=this,o=[],s=null,d="macro_"+this._tmpid(),p=i!==void 0;r.args.children.forEach(function(b,m){m===r.args.children.length-1&&b instanceof f.Dict?s=b:(a.assertType(b,f.Symbol),o.push(b))});var T=[].concat(o.map(function(b){return"l_"+b.value}),["kwargs"]),R=o.map(function(b){return'"'+b.value+'"'}),P=(s&&s.children||[]).map(function(b){return'"'+b.key.value+'"'}),B;p?B=i.push(!0):B=new S,this._emitLines("var "+d+" = runtime.makeMacro(","["+R.join(", ")+"], ","["+P.join(", ")+"], ","function ("+T.join(", ")+") {","var callerFrame = frame;","frame = "+(p?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),o.forEach(function(b){a._emitLine('frame.set("'+b.value+'", l_'+b.value+");"),B.set(b.value,"l_"+b.value)}),s&&s.children.forEach(function(b){var m=b.key.value;a._emit('frame.set("'+m+'", '),a._emit('Object.prototype.hasOwnProperty.call(kwargs, "'+m+'")'),a._emit(' ? kwargs["'+m+'"] : '),a._compileExpression(b.value,B),a._emit(");")});var j=this._pushBuffer();return this._withScopedSyntax(function(){a.compile(r.body,B)}),this._emitLine("frame = "+(p?"frame.pop();":"callerFrame;")),this._emitLine("return new runtime.SafeString("+j+");"),this._emitLine("});"),this._popBuffer(),d},l.compileMacro=function(r,i){var a=this._compileMacro(r),o=r.name.value;i.set(o,a),i.parent?this._emitLine('frame.set("'+o+'", '+a+");"):(r.name.value.charAt(0)!=="_"&&this._emitLine('context.addExport("'+o+'");'),this._emitLine('context.setVariable("'+o+'", '+a+");"))},l.compileCaller=function(r,i){this._emit("(function (){");var a=this._compileMacro(r,i);this._emit("return "+a+";})()")},l._compileGetTemplate=function(r,i,a,o){var s=this._tmpid(),d=this._templateName(),p=this._makeCallback(s),T=a?"true":"false",R=o?"true":"false";return this._emit("env.getTemplate("),this._compileExpression(r.template,i),this._emitLine(", "+T+", "+d+", "+R+", "+p),s},l.compileImport=function(r,i){var a=r.target.value,o=this._compileGetTemplate(r,i,!1,!1);this._addScopeLevel(),this._emitLine(o+".getExported("+(r.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(o)),this._addScopeLevel(),i.set(a,o),i.parent?this._emitLine('frame.set("'+a+'", '+o+");"):this._emitLine('context.setVariable("'+a+'", '+o+");")},l.compileFromImport=function(r,i){var a=this,o=this._compileGetTemplate(r,i,!1,!1);this._addScopeLevel(),this._emitLine(o+".getExported("+(r.withContext?"context.getVariables(), frame, ":"")+this._makeCallback(o)),this._addScopeLevel(),r.names.children.forEach(function(s){var d,p,T=a._tmpid();s instanceof f.Pair?(d=s.key.value,p=s.value.value):(d=s.value,p=d),a._emitLine("if(Object.prototype.hasOwnProperty.call("+o+', "'+d+'")) {'),a._emitLine("var "+T+" = "+o+"."+d+";"),a._emitLine("} else {"),a._emitLine(`cb(new Error("cannot import '`+d+`'")); return;`),a._emitLine("}"),i.set(p,T),i.parent?a._emitLine('frame.set("'+p+'", '+T+");"):a._emitLine('context.setVariable("'+p+'", '+T+");")})},l.compileBlock=function(r){var i=this._tmpid();this.inBlock||this._emit('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this._emit('context.getBlock("'+r.name.value+'")'),this.inBlock||this._emit(")"),this._emitLine("(env, context, frame, runtime, "+this._makeCallback(i)),this._emitLine(this.buffer+" += "+i+";"),this._addScopeLevel()},l.compileSuper=function(r,i){var a=r.blockName.value,o=r.symbol.value,s=this._makeCallback(o);this._emitLine('context.getSuper(env, "'+a+'", b_'+a+", frame, runtime, "+s),this._emitLine(o+" = runtime.markSafe("+o+");"),this._addScopeLevel(),i.set(o,o)},l.compileExtends=function(r,i){var a=this._tmpid(),o=this._compileGetTemplate(r,i,!0,!1);this._emitLine("parentTemplate = "+o),this._emitLine("for(var "+a+" in parentTemplate.blocks) {"),this._emitLine("context.addBlock("+a+", parentTemplate.blocks["+a+"]);"),this._emitLine("}"),this._addScopeLevel()},l.compileInclude=function(r,i){this._emitLine("var tasks = [];"),this._emitLine("tasks.push("),this._emitLine("function(callback) {");var a=this._compileGetTemplate(r,i,!1,r.ignoreMissing);this._emitLine("callback(null,"+a+");});"),this._emitLine("});");var o=this._tmpid();this._emitLine("tasks.push("),this._emitLine("function(template, callback){"),this._emitLine("template.render(context.getVariables(), frame, "+this._makeCallback(o)),this._emitLine("callback(null,"+o+");});"),this._emitLine("});"),this._emitLine("tasks.push("),this._emitLine("function(result, callback){"),this._emitLine(this.buffer+" += result;"),this._emitLine("callback(null);"),this._emitLine("});"),this._emitLine("env.waterfall(tasks, function(){"),this._addScopeLevel()},l.compileTemplateData=function(r,i){this.compileLiteral(r,i)},l.compileCapture=function(r,i){var a=this,o=this.buffer;this.buffer="output",this._emitLine("(function() {"),this._emitLine('var output = "";'),this._withScopedSyntax(function(){a.compile(r.body,i)}),this._emitLine("return output;"),this._emitLine("})()"),this.buffer=o},l.compileOutput=function(r,i){var a=this,o=r.children;o.forEach(function(s){s instanceof f.TemplateData?s.value&&(a._emit(a.buffer+" += "),a.compileLiteral(s,i),a._emitLine(";")):(a._emit(a.buffer+" += runtime.suppressValue("),a.throwOnUndefined&&a._emit("runtime.ensureDefined("),a.compile(s,i),a.throwOnUndefined&&a._emit(","+r.lineno+","+r.colno+")"),a._emit(`, env.opts.autoescape);
|
|
17
|
+
`))})},l.compileRoot=function(r,i){var a=this;i&&this.fail("compileRoot: root node can't have frame"),i=new S,this._emitFuncBegin(r,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(r,i),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var o=[],s=r.findAll(f.Block);s.forEach(function(d,p){var T=d.name.value;if(o.indexOf(T)!==-1)throw new Error('Block "'+T+'" defined more than once.');o.push(T),a._emitFuncBegin(d,"b_"+T);var R=new S;a._emitLine("var frame = frame.push(true);"),a.compile(d.body,R),a._emitFuncEnd()}),this._emitLine("return {"),s.forEach(function(d,p){var T="b_"+d.name.value;a._emitLine(T+": "+T+",")}),this._emitLine(`root: root
|
|
18
|
+
};`)},l.compile=function(r,i){var a=this["compile"+r.typename];a?a.call(this,r,i):this.fail("compile: Cannot compile node: "+r.typename,r.lineno,r.colno)},l.getCode=function(){return this.codebuf.join("")},u}(g);E.exports={compile:function(u,l,c,r,i){i===void 0&&(i={});var a=new t(r,i.throwOnUndefined),o=(c||[]).map(function(d){return d.preprocess}).filter(function(d){return!!d}),s=o.reduce(function(d,p){return p(d)},u);return a.compile(w.transform(h.parse(s,c,i),l,r)),a.getCode()},Compiler:t}},function(E,A,O){function v(y,I){y.prototype=Object.create(I.prototype),y.prototype.constructor=y,k(y,I)}function k(y,I){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,_){return S.__proto__=_,S},k(y,I)}var h=O(4),w=O(1),f=w.EmitterObj;E.exports=function(y){v(I,y);function I(){return y.apply(this,arguments)||this}var F=I.prototype;return F.resolve=function(_,g){return h.resolve(h.dirname(_),g)},F.isRelative=function(_){return _.indexOf("./")===0||_.indexOf("../")===0},I}(f)},function(E,A,O){function v(R,P){R.prototype=Object.create(P.prototype),R.prototype.constructor=R,k(R,P)}function k(R,P){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,b){return j.__proto__=b,j},k(R,P)}var h=O(12),w=O(15),f=O(0),y=O(5),I=O(18),F=O(10),S=F.FileSystemLoader,_=F.WebLoader,g=F.PrecompiledLoader,e=O(20),t=O(21),n=O(1),u=n.Obj,l=n.EmitterObj,c=O(2),r=c.handleError,i=c.Frame,a=O(22);function o(R,P,B){h(function(){R(P,B)})}var s={type:"code",obj:{root:function(P,B,j,b,m){try{m(null,"")}catch(C){m(r(C,null,null))}}}},d=function(R){v(P,R);function P(){return R.apply(this,arguments)||this}var B=P.prototype;return B.init=function(b,m){var C=this;m=this.opts=m||{},this.opts.dev=!!m.dev,this.opts.autoescape=m.autoescape!=null?m.autoescape:!0,this.opts.throwOnUndefined=!!m.throwOnUndefined,this.opts.trimBlocks=!!m.trimBlocks,this.opts.lstripBlocks=!!m.lstripBlocks,this.loaders=[],b?this.loaders=f.isArray(b)?b:[b]:S?this.loaders=[new S("views")]:_&&(this.loaders=[new _("/views")]),typeof window<"u"&&window.nunjucksPrecompiled&&this.loaders.unshift(new g(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=t(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],f._entries(I).forEach(function(M){var V=M[0],z=M[1];return C.addFilter(V,z)}),f._entries(e).forEach(function(M){var V=M[0],z=M[1];return C.addTest(V,z)})},B._initLoaders=function(){var b=this;this.loaders.forEach(function(m){m.cache={},typeof m.on=="function"&&(m.on("update",function(C,M){m.cache[C]=null,b.emit("update",C,M,m)}),m.on("load",function(C,M){b.emit("load",C,M,m)}))})},B.invalidateCache=function(){this.loaders.forEach(function(b){b.cache={}})},B.addExtension=function(b,m){return m.__name=b,this.extensions[b]=m,this.extensionsList.push(m),this},B.removeExtension=function(b){var m=this.getExtension(b);m&&(this.extensionsList=f.without(this.extensionsList,m),delete this.extensions[b])},B.getExtension=function(b){return this.extensions[b]},B.hasExtension=function(b){return!!this.extensions[b]},B.addGlobal=function(b,m){return this.globals[b]=m,this},B.getGlobal=function(b){if(typeof this.globals[b]>"u")throw new Error("global not found: "+b);return this.globals[b]},B.addFilter=function(b,m,C){var M=m;return C&&this.asyncFilters.push(b),this.filters[b]=M,this},B.getFilter=function(b){if(!this.filters[b])throw new Error("filter not found: "+b);return this.filters[b]},B.addTest=function(b,m){return this.tests[b]=m,this},B.getTest=function(b){if(!this.tests[b])throw new Error("test not found: "+b);return this.tests[b]},B.resolveTemplate=function(b,m,C){var M=b.isRelative&&m?b.isRelative(C):!1;return M&&b.resolve?b.resolve(m,C):C},B.getTemplate=function(b,m,C,M,V){var z=this,ae=this,ee=null;if(b&&b.raw&&(b=b.raw),f.isFunction(C)&&(V=C,C=null,m=m||!1),f.isFunction(m)&&(V=m,m=!1),b instanceof T)ee=b;else{if(typeof b!="string")throw new Error("template names must be a string: "+b);for(var ge=0;ge<this.loaders.length;ge++){var be=this.loaders[ge];if(ee=be.cache[this.resolveTemplate(be,C,b)],ee)break}}if(ee)if(m&&ee.compile(),V){V(null,ee);return}else return ee;var oe,ie=function(J,Y){if(!Y&&!J&&!M&&(J=new Error("template not found: "+b)),J)if(V){V(J);return}else throw J;var ce;Y?(ce=new T(Y.src,z,Y.path,m),Y.noCache||(Y.loader.cache[b]=ce)):ce=new T(s,z,"",m),V?V(null,ce):oe=ce};return f.asyncIter(this.loaders,function(G,J,Y,ce){function ke(ye,Re){ye?ce(ye):Re?(Re.loader=G,ce(null,Re)):Y()}b=ae.resolveTemplate(G,C,b),G.async?G.getSource(b,ke):ke(null,G.getSource(b))},ie),oe},B.express=function(b){return a(this,b)},B.render=function(b,m,C){f.isFunction(m)&&(C=m,m=null);var M=null;return this.getTemplate(b,function(V,z){if(V&&C)o(C,V);else{if(V)throw V;M=z.render(m,C)}}),M},B.renderString=function(b,m,C,M){f.isFunction(C)&&(M=C,C={}),C=C||{};var V=new T(b,this,C.path);return V.render(m,M)},B.waterfall=function(b,m,C){return w(b,m,C)},P}(l),p=function(R){v(P,R);function P(){return R.apply(this,arguments)||this}var B=P.prototype;return B.init=function(b,m,C){var M=this;this.env=C||new d,this.ctx=f.extend({},b),this.blocks={},this.exported=[],f.keys(m).forEach(function(V){M.addBlock(V,m[V])})},B.lookup=function(b){return b in this.env.globals&&!(b in this.ctx)?this.env.globals[b]:this.ctx[b]},B.setVariable=function(b,m){this.ctx[b]=m},B.getVariables=function(){return this.ctx},B.addBlock=function(b,m){return this.blocks[b]=this.blocks[b]||[],this.blocks[b].push(m),this},B.getBlock=function(b){if(!this.blocks[b])throw new Error('unknown block "'+b+'"');return this.blocks[b][0]},B.getSuper=function(b,m,C,M,V,z){var ae=f.indexOf(this.blocks[m]||[],C),ee=this.blocks[m][ae+1],ge=this;if(ae===-1||!ee)throw new Error('no super block available for "'+m+'"');ee(b,ge,M,V,z)},B.addExport=function(b){this.exported.push(b)},B.getExported=function(){var b=this,m={};return this.exported.forEach(function(C){m[C]=b.ctx[C]}),m},P}(u),T=function(R){v(P,R);function P(){return R.apply(this,arguments)||this}var B=P.prototype;return B.init=function(b,m,C,M){if(this.env=m||new d,f.isObject(b))switch(b.type){case"code":this.tmplProps=b.obj;break;case"string":this.tmplStr=b.obj;break;default:throw new Error("Unexpected template object type "+b.type+"; expected 'code', or 'string'")}else if(f.isString(b))this.tmplStr=b;else throw new Error("src must be a string or an object describing the source");if(this.path=C,M)try{this._compile()}catch(V){throw f._prettifyError(this.path,this.env.opts.dev,V)}else this.compiled=!1},B.render=function(b,m,C){var M=this;typeof b=="function"?(C=b,b={}):typeof m=="function"&&(C=m,m=null);var V=!m;try{this.compile()}catch(oe){var z=f._prettifyError(this.path,this.env.opts.dev,oe);if(C)return o(C,z);throw z}var ae=new p(b||{},this.blocks,this.env),ee=m?m.push(!0):new i;ee.topLevel=!0;var ge=null,be=!1;return this.rootRenderFunc(this.env,ae,ee,c,function(oe,ie){if(!(be&&C&&typeof ie<"u"))if(oe&&(oe=f._prettifyError(M.path,M.env.opts.dev,oe),be=!0),C)V?o(C,oe,ie):C(oe,ie);else{if(oe)throw oe;ge=ie}}),ge},B.getExported=function(b,m,C){typeof b=="function"&&(C=b,b={}),typeof m=="function"&&(C=m,m=null);try{this.compile()}catch(z){if(C)return C(z);throw z}var M=m?m.push():new i;M.topLevel=!0;var V=new p(b||{},this.blocks,this.env);this.rootRenderFunc(this.env,V,M,c,function(z){z?C(z,null):C(null,V.getExported())})},B.compile=function(){this.compiled||this._compile()},B._compile=function(){var b;if(this.tmplProps)b=this.tmplProps;else{var m=y.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts),C=new Function(m);b=C()}this.blocks=this._getBlocks(b),this.rootRenderFunc=b.root,this.compiled=!0},B._getBlocks=function(b){var m={};return f.keys(b).forEach(function(C){C.slice(0,2)==="b_"&&(m[C.slice(2)]=b[C])}),m},P}(u);E.exports={Environment:d,Template:T}},function(E,A,O){function v(F,S){F.prototype=Object.create(S.prototype),F.prototype.constructor=F,k(F,S)}function k(F,S){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,e){return g.__proto__=e,g},k(F,S)}var h=O(9),w=O(3),f=O(1).Obj,y=O(0),I=function(F){v(S,F);function S(){return F.apply(this,arguments)||this}var _=S.prototype;return _.init=function(e){this.tokens=e,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},_.nextToken=function(e){var t;if(this.peeked)if(!e&&this.peeked.type===h.TOKEN_WHITESPACE)this.peeked=null;else return t=this.peeked,this.peeked=null,t;if(t=this.tokens.nextToken(),!e)for(;t&&t.type===h.TOKEN_WHITESPACE;)t=this.tokens.nextToken();return t},_.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},_.pushToken=function(e){if(this.peeked)throw new Error("pushToken: can only push one token on between reads");this.peeked=e},_.error=function(e,t,n){if(t===void 0||n===void 0){var u=this.peekToken()||{};t=u.lineno,n=u.colno}return t!==void 0&&(t+=1),n!==void 0&&(n+=1),new y.TemplateError(e,t,n)},_.fail=function(e,t,n){throw this.error(e,t,n)},_.skip=function(e){var t=this.nextToken();return!t||t.type!==e?(this.pushToken(t),!1):!0},_.expect=function(e){var t=this.nextToken();return t.type!==e&&this.fail("expected "+e+", got "+t.type,t.lineno,t.colno),t},_.skipValue=function(e,t){var n=this.nextToken();return!n||n.type!==e||n.value!==t?(this.pushToken(n),!1):!0},_.skipSymbol=function(e){return this.skipValue(h.TOKEN_SYMBOL,e)},_.advanceAfterBlockEnd=function(e){var t;return e||(t=this.peekToken(),t||this.fail("unexpected end of file"),t.type!==h.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),e=this.nextToken().value),t=this.nextToken(),t&&t.type===h.TOKEN_BLOCK_END?t.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+e+" statement"),t},_.advanceAfterVariableEnd=function(){var e=this.nextToken();e&&e.type===h.TOKEN_VARIABLE_END?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.VARIABLE_END.length-1)==="-":(this.pushToken(e),this.fail("expected variable end"))},_.parseFor=function(){var e=this.peekToken(),t,n;this.skipSymbol("for")?(t=new w.For(e.lineno,e.colno),n="endfor"):this.skipSymbol("asyncEach")?(t=new w.AsyncEach(e.lineno,e.colno),n="endeach"):this.skipSymbol("asyncAll")?(t=new w.AsyncAll(e.lineno,e.colno),n="endall"):this.fail("parseFor: expected for{Async}",e.lineno,e.colno),t.name=this.parsePrimary(),t.name instanceof w.Symbol||this.fail("parseFor: variable name expected for loop");var u=this.peekToken().type;if(u===h.TOKEN_COMMA){var l=t.name;for(t.name=new w.Array(l.lineno,l.colno),t.name.addChild(l);this.skip(h.TOKEN_COMMA);){var c=this.parsePrimary();t.name.addChild(c)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',e.lineno,e.colno),t.arr=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks(n,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),t.else_=this.parseUntilBlocks(n)),this.advanceAfterBlockEnd(),t},_.parseMacro=function(){var e=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var t=this.parsePrimary(!0),n=this.parseSignature(),u=new w.Macro(e.lineno,e.colno,t,n);return this.advanceAfterBlockEnd(e.value),u.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),u},_.parseCall=function(){var e=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var t=this.parseSignature(!0)||new w.NodeList,n=this.parsePrimary();this.advanceAfterBlockEnd(e.value);var u=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var l=new w.Symbol(e.lineno,e.colno,"caller"),c=new w.Caller(e.lineno,e.colno,l,t,u),r=n.args.children;r[r.length-1]instanceof w.KeywordArgs||r.push(new w.KeywordArgs);var i=r[r.length-1];return i.addChild(new w.Pair(e.lineno,e.colno,l,c)),new w.Output(e.lineno,e.colno,[n])},_.parseWithContext=function(){var e=this.peekToken(),t=null;return this.skipSymbol("with")?t=!0:this.skipSymbol("without")&&(t=!1),t!==null&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",e.lineno,e.colno)),t},_.parseImport=function(){var e=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",e.lineno,e.colno);var t=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',e.lineno,e.colno);var n=this.parseExpression(),u=this.parseWithContext(),l=new w.Import(e.lineno,e.colno,t,n,u);return this.advanceAfterBlockEnd(e.value),l},_.parseFrom=function(){var e=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var t=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",e.lineno,e.colno);for(var n=new w.NodeList,u;;){var l=this.peekToken();if(l.type===h.TOKEN_BLOCK_END){n.children.length||this.fail("parseFrom: Expected at least one import name",e.lineno,e.colno),l.value.charAt(0)==="-"&&(this.dropLeadingWhitespace=!0),this.nextToken();break}n.children.length>0&&!this.skip(h.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",e.lineno,e.colno);var c=this.parsePrimary();if(c.value.charAt(0)==="_"&&this.fail("parseFrom: names starting with an underscore cannot be imported",c.lineno,c.colno),this.skipSymbol("as")){var r=this.parsePrimary();n.addChild(new w.Pair(c.lineno,c.colno,c,r))}else n.addChild(c);u=this.parseWithContext()}return new w.FromImport(e.lineno,e.colno,t,n,u)},_.parseBlock=function(){var e=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",e.lineno,e.colno);var t=new w.Block(e.lineno,e.colno);t.name=this.parsePrimary(),t.name instanceof w.Symbol||this.fail("parseBlock: variable name expected",e.lineno,e.colno),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(t.name.value);var n=this.peekToken();return n||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(n.value),t},_.parseExtends=function(){var e="extends",t=this.peekToken();this.skipSymbol(e)||this.fail("parseTemplateRef: expected "+e);var n=new w.Extends(t.lineno,t.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),n},_.parseInclude=function(){var e="include",t=this.peekToken();this.skipSymbol(e)||this.fail("parseInclude: expected "+e);var n=new w.Include(t.lineno,t.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),n},_.parseIf=function(){var e=this.peekToken(),t;this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new w.If(e.lineno,e.colno):this.skipSymbol("ifAsync")?t=new w.IfAsync(e.lineno,e.colno):this.fail("parseIf: expected if, elif, or elseif",e.lineno,e.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(e.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var n=this.peekToken();switch(n&&n.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},_.parseSet=function(){var e=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",e.lineno,e.colno);for(var t=new w.Set(e.lineno,e.colno,[]),n;(n=this.parsePrimary())&&(t.targets.push(n),!!this.skip(h.TOKEN_COMMA)););return this.skipValue(h.TOKEN_OPERATOR,"=")?(t.value=this.parseExpression(),this.advanceAfterBlockEnd(e.value)):this.skip(h.TOKEN_BLOCK_END)?(t.body=new w.Capture(e.lineno,e.colno,this.parseUntilBlocks("endset")),t.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",e.lineno,e.colno),t},_.parseSwitch=function(){var e="switch",t="endswitch",n="case",u="default",l=this.peekToken();!this.skipSymbol(e)&&!this.skipSymbol(n)&&!this.skipSymbol(u)&&this.fail('parseSwitch: expected "switch," "case" or "default"',l.lineno,l.colno);var c=this.parseExpression();this.advanceAfterBlockEnd(e),this.parseUntilBlocks(n,u,t);var r=this.peekToken(),i=[],a;do{this.skipSymbol(n);var o=this.parseExpression();this.advanceAfterBlockEnd(e);var s=this.parseUntilBlocks(n,u,t);i.push(new w.Case(r.line,r.col,o,s)),r=this.peekToken()}while(r&&r.value===n);switch(r.value){case u:this.advanceAfterBlockEnd(),a=this.parseUntilBlocks(t),this.advanceAfterBlockEnd();break;case t:this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new w.Switch(l.lineno,l.colno,c,i,a)},_.parseStatement=function(){var e=this.peekToken(),t;if(e.type!==h.TOKEN_SYMBOL&&this.fail("tag name expected",e.lineno,e.colno),this.breakOnBlocks&&y.indexOf(this.breakOnBlocks,e.value)!==-1)return null;switch(e.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var n=0;n<this.extensions.length;n++){var u=this.extensions[n];if(y.indexOf(u.tags||[],e.value)!==-1)return u.parse(this,w,h)}this.fail("unknown block tag: "+e.value,e.lineno,e.colno)}return t},_.parseRaw=function(e){e=e||"raw";for(var t="end"+e,n=new RegExp("([\\s\\S]*?){%\\s*("+e+"|"+t+")\\s*(?=%})%}"),u=1,l="",c=null,r=this.advanceAfterBlockEnd();(c=this.tokens._extractRegex(n))&&u>0;){var i=c[0],a=c[1],o=c[2];o===e?u+=1:o===t&&(u-=1),u===0?(l+=a,this.tokens.backN(i.length-a.length)):l+=i}return new w.Output(r.lineno,r.colno,[new w.TemplateData(r.lineno,r.colno,l)])},_.parsePostfix=function(e){for(var t,n=this.peekToken();n;){if(n.type===h.TOKEN_LEFT_PAREN)e=new w.FunCall(n.lineno,n.colno,e,this.parseSignature());else if(n.type===h.TOKEN_LEFT_BRACKET)t=this.parseAggregate(),t.children.length>1&&this.fail("invalid index"),e=new w.LookupVal(n.lineno,n.colno,e,t.children[0]);else if(n.type===h.TOKEN_OPERATOR&&n.value==="."){this.nextToken();var u=this.nextToken();u.type!==h.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+u.value,u.lineno,u.colno),t=new w.Literal(u.lineno,u.colno,u.value),e=new w.LookupVal(n.lineno,n.colno,e,t)}else break;n=this.peekToken()}return e},_.parseExpression=function(){var e=this.parseInlineIf();return e},_.parseInlineIf=function(){var e=this.parseOr();if(this.skipSymbol("if")){var t=this.parseOr(),n=e;e=new w.InlineIf(e.lineno,e.colno),e.body=n,e.cond=t,this.skipSymbol("else")?e.else_=this.parseOr():e.else_=null}return e},_.parseOr=function(){for(var e=this.parseAnd();this.skipSymbol("or");){var t=this.parseAnd();e=new w.Or(e.lineno,e.colno,e,t)}return e},_.parseAnd=function(){for(var e=this.parseNot();this.skipSymbol("and");){var t=this.parseNot();e=new w.And(e.lineno,e.colno,e,t)}return e},_.parseNot=function(){var e=this.peekToken();return this.skipSymbol("not")?new w.Not(e.lineno,e.colno,this.parseNot()):this.parseIn()},_.parseIn=function(){for(var e=this.parseIs();;){var t=this.nextToken();if(!t)break;var n=t.type===h.TOKEN_SYMBOL&&t.value==="not";if(n||this.pushToken(t),this.skipSymbol("in")){var u=this.parseIs();e=new w.In(e.lineno,e.colno,e,u),n&&(e=new w.Not(e.lineno,e.colno,e))}else{n&&this.pushToken(t);break}}return e},_.parseIs=function(){var e=this.parseCompare();if(this.skipSymbol("is")){var t=this.skipSymbol("not"),n=this.parseCompare();e=new w.Is(e.lineno,e.colno,e,n),t&&(e=new w.Not(e.lineno,e.colno,e))}return e},_.parseCompare=function(){for(var e=["==","===","!=","!==","<",">","<=",">="],t=this.parseConcat(),n=[];;){var u=this.nextToken();if(u)if(e.indexOf(u.value)!==-1)n.push(new w.CompareOperand(u.lineno,u.colno,this.parseConcat(),u.value));else{this.pushToken(u);break}else break}return n.length?new w.Compare(n[0].lineno,n[0].colno,t,n):t},_.parseConcat=function(){for(var e=this.parseAdd();this.skipValue(h.TOKEN_TILDE,"~");){var t=this.parseAdd();e=new w.Concat(e.lineno,e.colno,e,t)}return e},_.parseAdd=function(){for(var e=this.parseSub();this.skipValue(h.TOKEN_OPERATOR,"+");){var t=this.parseSub();e=new w.Add(e.lineno,e.colno,e,t)}return e},_.parseSub=function(){for(var e=this.parseMul();this.skipValue(h.TOKEN_OPERATOR,"-");){var t=this.parseMul();e=new w.Sub(e.lineno,e.colno,e,t)}return e},_.parseMul=function(){for(var e=this.parseDiv();this.skipValue(h.TOKEN_OPERATOR,"*");){var t=this.parseDiv();e=new w.Mul(e.lineno,e.colno,e,t)}return e},_.parseDiv=function(){for(var e=this.parseFloorDiv();this.skipValue(h.TOKEN_OPERATOR,"/");){var t=this.parseFloorDiv();e=new w.Div(e.lineno,e.colno,e,t)}return e},_.parseFloorDiv=function(){for(var e=this.parseMod();this.skipValue(h.TOKEN_OPERATOR,"//");){var t=this.parseMod();e=new w.FloorDiv(e.lineno,e.colno,e,t)}return e},_.parseMod=function(){for(var e=this.parsePow();this.skipValue(h.TOKEN_OPERATOR,"%");){var t=this.parsePow();e=new w.Mod(e.lineno,e.colno,e,t)}return e},_.parsePow=function(){for(var e=this.parseUnary();this.skipValue(h.TOKEN_OPERATOR,"**");){var t=this.parseUnary();e=new w.Pow(e.lineno,e.colno,e,t)}return e},_.parseUnary=function(e){var t=this.peekToken(),n;return this.skipValue(h.TOKEN_OPERATOR,"-")?n=new w.Neg(t.lineno,t.colno,this.parseUnary(!0)):this.skipValue(h.TOKEN_OPERATOR,"+")?n=new w.Pos(t.lineno,t.colno,this.parseUnary(!0)):n=this.parsePrimary(),e||(n=this.parseFilter(n)),n},_.parsePrimary=function(e){var t=this.nextToken(),n,u=null;if(t?t.type===h.TOKEN_STRING?n=t.value:t.type===h.TOKEN_INT?n=parseInt(t.value,10):t.type===h.TOKEN_FLOAT?n=parseFloat(t.value):t.type===h.TOKEN_BOOLEAN?t.value==="true"?n=!0:t.value==="false"?n=!1:this.fail("invalid boolean: "+t.value,t.lineno,t.colno):t.type===h.TOKEN_NONE?n=null:t.type===h.TOKEN_REGEX&&(n=new RegExp(t.value.body,t.value.flags)):this.fail("expected expression, got end of file"),n!==void 0?u=new w.Literal(t.lineno,t.colno,n):t.type===h.TOKEN_SYMBOL?u=new w.Symbol(t.lineno,t.colno,t.value):(this.pushToken(t),u=this.parseAggregate()),e||(u=this.parsePostfix(u)),u)return u;throw this.error("unexpected token: "+t.value,t.lineno,t.colno)},_.parseFilterName=function(){for(var e=this.expect(h.TOKEN_SYMBOL),t=e.value;this.skipValue(h.TOKEN_OPERATOR,".");)t+="."+this.expect(h.TOKEN_SYMBOL).value;return new w.Symbol(e.lineno,e.colno,t)},_.parseFilterArgs=function(e){if(this.peekToken().type===h.TOKEN_LEFT_PAREN){var t=this.parsePostfix(e);return t.args.children}return[]},_.parseFilter=function(e){for(;this.skip(h.TOKEN_PIPE);){var t=this.parseFilterName();e=new w.Filter(t.lineno,t.colno,t,new w.NodeList(t.lineno,t.colno,[e].concat(this.parseFilterArgs(e))))}return e},_.parseFilterStatement=function(){var e=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var t=this.parseFilterName(),n=this.parseFilterArgs(t);this.advanceAfterBlockEnd(e.value);var u=new w.Capture(t.lineno,t.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var l=new w.Filter(t.lineno,t.colno,t,new w.NodeList(t.lineno,t.colno,[u].concat(n)));return new w.Output(t.lineno,t.colno,[l])},_.parseAggregate=function(){var e=this.nextToken(),t;switch(e.type){case h.TOKEN_LEFT_PAREN:t=new w.Group(e.lineno,e.colno);break;case h.TOKEN_LEFT_BRACKET:t=new w.Array(e.lineno,e.colno);break;case h.TOKEN_LEFT_CURLY:t=new w.Dict(e.lineno,e.colno);break;default:return null}for(;;){var n=this.peekToken().type;if(n===h.TOKEN_RIGHT_PAREN||n===h.TOKEN_RIGHT_BRACKET||n===h.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(h.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",e.lineno,e.colno)),t instanceof w.Dict){var u=this.parsePrimary();this.skip(h.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",e.lineno,e.colno);var l=this.parseExpression();t.addChild(new w.Pair(u.lineno,u.colno,u,l))}else{var c=this.parseExpression();t.addChild(c)}}return t},_.parseSignature=function(e,t){var n=this.peekToken();if(!t&&n.type!==h.TOKEN_LEFT_PAREN){if(e)return null;this.fail("expected arguments",n.lineno,n.colno)}n.type===h.TOKEN_LEFT_PAREN&&(n=this.nextToken());for(var u=new w.NodeList(n.lineno,n.colno),l=new w.KeywordArgs(n.lineno,n.colno),c=!1;;){if(n=this.peekToken(),!t&&n.type===h.TOKEN_RIGHT_PAREN){this.nextToken();break}else if(t&&n.type===h.TOKEN_BLOCK_END)break;if(c&&!this.skip(h.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",n.lineno,n.colno);else{var r=this.parseExpression();this.skipValue(h.TOKEN_OPERATOR,"=")?l.addChild(new w.Pair(r.lineno,r.colno,r,this.parseExpression())):u.addChild(r)}c=!0}return l.children.length&&u.addChild(l),u},_.parseUntilBlocks=function(){for(var e=this.breakOnBlocks,t=arguments.length,n=new Array(t),u=0;u<t;u++)n[u]=arguments[u];this.breakOnBlocks=n;var l=this.parse();return this.breakOnBlocks=e,l},_.parseNodes=function(){for(var e,t=[];e=this.nextToken();)if(e.type===h.TOKEN_DATA){var n=e.value,u=this.peekToken(),l=u&&u.value;this.dropLeadingWhitespace&&(n=n.replace(/^\s*/,""),this.dropLeadingWhitespace=!1),u&&(u.type===h.TOKEN_BLOCK_START&&l.charAt(l.length-1)==="-"||u.type===h.TOKEN_VARIABLE_START&&l.charAt(this.tokens.tags.VARIABLE_START.length)==="-"||u.type===h.TOKEN_COMMENT&&l.charAt(this.tokens.tags.COMMENT_START.length)==="-")&&(n=n.replace(/\s*$/,"")),t.push(new w.Output(e.lineno,e.colno,[new w.TemplateData(e.lineno,e.colno,n)]))}else if(e.type===h.TOKEN_BLOCK_START){this.dropLeadingWhitespace=!1;var c=this.parseStatement();if(!c)break;t.push(c)}else if(e.type===h.TOKEN_VARIABLE_START){var r=this.parseExpression();this.dropLeadingWhitespace=!1,this.advanceAfterVariableEnd(),t.push(new w.Output(e.lineno,e.colno,[r]))}else e.type===h.TOKEN_COMMENT?this.dropLeadingWhitespace=e.value.charAt(e.value.length-this.tokens.tags.COMMENT_END.length-1)==="-":this.fail("Unexpected token at top-level: "+e.type,e.lineno,e.colno);return t},_.parse=function(){return new w.NodeList(0,0,this.parseNodes())},_.parseAsRoot=function(){return new w.Root(0,0,this.parseNodes())},S}(f);E.exports={parse:function(S,_,g){var e=new I(h.lex(S,g));return _!==void 0&&(e.extensions=_),e.parseAsRoot()},Parser:I}},function(E,A,O){var v=O(0),k=`
|
|
19
|
+
\r `,h="()[]{}%*-+~/#,:|.<>=!",w="0123456789",f="{%",y="%}",I="{{",F="}}",S="{#",_="#}",g="string",e="whitespace",t="data",n="block-start",u="block-end",l="variable-start",c="variable-end",r="comment",i="left-paren",a="right-paren",o="left-bracket",s="right-bracket",d="left-curly",p="right-curly",T="operator",R="comma",P="colon",B="tilde",j="pipe",b="int",m="float",C="boolean",M="none",V="symbol",z="special",ae="regex";function ee(be,oe,ie,G){return{type:be,value:oe,lineno:ie,colno:G}}var ge=function(){function be(ie,G){this.str=ie,this.index=0,this.len=ie.length,this.lineno=0,this.colno=0,this.in_code=!1,G=G||{};var J=G.tags||{};this.tags={BLOCK_START:J.blockStart||f,BLOCK_END:J.blockEnd||y,VARIABLE_START:J.variableStart||I,VARIABLE_END:J.variableEnd||F,COMMENT_START:J.commentStart||S,COMMENT_END:J.commentEnd||_},this.trimBlocks=!!G.trimBlocks,this.lstripBlocks=!!G.lstripBlocks}var oe=be.prototype;return oe.nextToken=function(){var G=this.lineno,J=this.colno,Y;if(this.in_code){var ce=this.current();if(this.isFinished())return null;if(ce==='"'||ce==="'")return ee(g,this._parseString(ce),G,J);if(Y=this._extract(k))return ee(e,Y,G,J);if((Y=this._extractString(this.tags.BLOCK_END))||(Y=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(ce=this.current(),ce===`
|
|
20
|
+
`?this.forward():ce==="\r"&&(this.forward(),ce=this.current(),ce===`
|
|
21
|
+
`?this.forward():this.back())),ee(u,Y,G,J);if((Y=this._extractString(this.tags.VARIABLE_END))||(Y=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,ee(c,Y,G,J);if(ce==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var ke="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else ke+=this.current(),this.forward();for(var ye=["g","i","m","y"],Re="";!this.isFinished();){var x=ye.indexOf(this.current())!==-1;if(x)Re+=this.current(),this.forward();else break}return ee(ae,{body:ke,flags:Re},G,J)}else if(h.indexOf(ce)!==-1){this.forward();var K=["==","===","!=","!==","<=",">=","//","**"],W=ce+this.current(),$;switch(v.indexOf(K,W)!==-1&&(this.forward(),ce=W,v.indexOf(K,W+this.current())!==-1&&(ce=W+this.current(),this.forward())),ce){case"(":$=i;break;case")":$=a;break;case"[":$=o;break;case"]":$=s;break;case"{":$=d;break;case"}":$=p;break;case",":$=R;break;case":":$=P;break;case"~":$=B;break;case"|":$=j;break;default:$=T}return ee($,ce,G,J)}else if(Y=this._extractUntil(k+h),Y.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var te=this._extract(w);return ee(m,Y+"."+te,G,J)}else return ee(b,Y,G,J);else{if(Y.match(/^(true|false)$/))return ee(C,Y,G,J);if(Y==="none")return ee(M,Y,G,J);if(Y==="null")return ee(M,Y,G,J);if(Y)return ee(V,Y,G,J);throw new Error("Unexpected value while parsing: "+Y)}}else{var ne=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((Y=this._extractString(this.tags.BLOCK_START+"-"))||(Y=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,ee(n,Y,G,J);if((Y=this._extractString(this.tags.VARIABLE_START+"-"))||(Y=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,ee(l,Y,G,J);Y="";var pe,se=!1;for(this._matches(this.tags.COMMENT_START)&&(se=!0,Y=this._extractString(this.tags.COMMENT_START));(pe=this._extractUntil(ne))!==null;)if(Y+=pe,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!se){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=Y.length){var _e=Y.slice(-this.colno);if(/^\s+$/.test(_e)&&(Y=Y.slice(0,-this.colno),!Y.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!se)throw new Error("unexpected end of comment");Y+=this._extractString(this.tags.COMMENT_END);break}else Y+=this.current(),this.forward();if(pe===null&&se)throw new Error("expected end of comment, got end of file");return ee(se?r:t,Y,G,J)}},oe._parseString=function(G){this.forward();for(var J="";!this.isFinished()&&this.current()!==G;){var Y=this.current();if(Y==="\\"){switch(this.forward(),this.current()){case"n":J+=`
|
|
22
|
+
`;break;case"t":J+=" ";break;case"r":J+="\r";break;default:J+=this.current()}this.forward()}else J+=Y,this.forward()}return this.forward(),J},oe._matches=function(G){if(this.index+G.length>this.len)return null;var J=this.str.slice(this.index,this.index+G.length);return J===G},oe._extractString=function(G){return this._matches(G)?(this.forwardN(G.length),G):null},oe._extractUntil=function(G){return this._extractMatching(!0,G||"")},oe._extract=function(G){return this._extractMatching(!1,G)},oe._extractMatching=function(G,J){if(this.isFinished())return null;var Y=J.indexOf(this.current());if(G&&Y===-1||!G&&Y!==-1){var ce=this.current();this.forward();for(var ke=J.indexOf(this.current());(G&&ke===-1||!G&&ke!==-1)&&!this.isFinished();)ce+=this.current(),this.forward(),ke=J.indexOf(this.current());return ce}return""},oe._extractRegex=function(G){var J=this.currentStr().match(G);return J?(this.forwardN(J[0].length),J):null},oe.isFinished=function(){return this.index>=this.len},oe.forwardN=function(G){for(var J=0;J<G;J++)this.forward()},oe.forward=function(){this.index++,this.previous()===`
|
|
23
|
+
`?(this.lineno++,this.colno=0):this.colno++},oe.backN=function(G){for(var J=0;J<G;J++)this.back()},oe.back=function(){if(this.index--,this.current()===`
|
|
24
|
+
`){this.lineno--;var G=this.src.lastIndexOf(`
|
|
25
|
+
`,this.index-1);G===-1?this.colno=this.index:this.colno=this.index-G}else this.colno--},oe.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},oe.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},oe.previous=function(){return this.str.charAt(this.index-1)},be}();E.exports={lex:function(oe,ie){return new ge(oe,ie)},TOKEN_STRING:g,TOKEN_WHITESPACE:e,TOKEN_DATA:t,TOKEN_BLOCK_START:n,TOKEN_BLOCK_END:u,TOKEN_VARIABLE_START:l,TOKEN_VARIABLE_END:c,TOKEN_COMMENT:r,TOKEN_LEFT_PAREN:i,TOKEN_RIGHT_PAREN:a,TOKEN_LEFT_BRACKET:o,TOKEN_RIGHT_BRACKET:s,TOKEN_LEFT_CURLY:d,TOKEN_RIGHT_CURLY:p,TOKEN_OPERATOR:T,TOKEN_COMMA:R,TOKEN_COLON:P,TOKEN_TILDE:B,TOKEN_PIPE:j,TOKEN_INT:b,TOKEN_FLOAT:m,TOKEN_BOOLEAN:C,TOKEN_NONE:M,TOKEN_SYMBOL:V,TOKEN_SPECIAL:z,TOKEN_REGEX:ae}},function(E,A,O){function v(I,F){I.prototype=Object.create(F.prototype),I.prototype.constructor=I,k(I,F)}function k(I,F){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,g){return _.__proto__=g,_},k(I,F)}var h=O(6),w=O(19),f=w.PrecompiledLoader,y=function(I){v(F,I);function F(_,g){var e;return e=I.call(this)||this,e.baseURL=_||".",g=g||{},e.useCache=!!g.useCache,e.async=!!g.async,e}var S=F.prototype;return S.resolve=function(g,e){throw new Error("relative templates not support in the browser yet")},S.getSource=function(g,e){var t=this,n=this.useCache,u;return this.fetch(this.baseURL+"/"+g,function(l,c){if(l)if(e)e(l.content);else if(l.status===404)u=null;else throw l.content;else u={src:c,path:g,noCache:!n},t.emit("load",g,u),e&&e(null,u)}),u},S.fetch=function(g,e){if(typeof window>"u")throw new Error("WebLoader can only by used in a browser");var t=new XMLHttpRequest,n=!0;t.onreadystatechange=function(){t.readyState===4&&n&&(n=!1,t.status===0||t.status===200?e(null,t.responseText):e({status:t.status,content:t.responseText}))},g+=(g.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),t.open("GET",g,this.async),t.send()},F}(h);E.exports={WebLoader:y,PrecompiledLoader:f}},function(E,A,O){var v=O(0),k=O(7),h=k.Environment,w=k.Template,f=O(6),y=O(10),I=O(23),F=O(5),S=O(8),_=O(9),g=O(2),e=O(3),t=O(25),n;function u(l,c){c=c||{},v.isObject(l)&&(c=l,l=null);var r;return y.FileSystemLoader?r=new y.FileSystemLoader(l,{watch:c.watch,noCache:c.noCache}):y.WebLoader&&(r=new y.WebLoader(l,{useCache:c.web&&c.web.useCache,async:c.web&&c.web.async})),n=new h(r,c),c&&c.express&&n.express(c.express),n}E.exports={Environment:h,Template:w,Loader:f,FileSystemLoader:y.FileSystemLoader,NodeResolveLoader:y.NodeResolveLoader,PrecompiledLoader:y.PrecompiledLoader,WebLoader:y.WebLoader,compiler:F,parser:S,lexer:_,runtime:g,lib:v,nodes:e,installJinjaCompat:t,configure:u,reset:function(){n=void 0},compile:function(c,r,i,a){return n||u(),new w(c,r,i,a)},render:function(c,r,i){return n||u(),n.render(c,r,i)},renderString:function(c,r,i){return n||u(),n.renderString(c,r,i)},precompile:I?I.precompile:void 0,precompileString:I?I.precompileString:void 0}},function(E,A,O){var v=O(13),k=[],h=[],w=v.makeRequestCallFromTimer(f);function f(){if(h.length)throw h.shift()}E.exports=y;function y(F){var S;k.length?S=k.pop():S=new I,S.task=F,v(S)}function I(){this.task=null}I.prototype.call=function(){try{this.task.call()}catch(F){y.onerror?y.onerror(F):(h.push(F),w())}finally{this.task=null,k[k.length]=this}}},function(E,A,O){(function(v){E.exports=k;function k(e){h.length||w(),h[h.length]=e}var h=[],w,f=0,y=1024;function I(){for(;f<h.length;){var e=f;if(f=f+1,h[e].call(),f>y){for(var t=0,n=h.length-f;t<n;t++)h[t]=h[t+f];h.length-=f,f=0}}h.length=0,f=0}var F=typeof v<"u"?v:self,S=F.MutationObserver||F.WebKitMutationObserver;typeof S=="function"?w=_(I):w=g(I),k.requestFlush=w;function _(e){var t=1,n=new S(e),u=document.createTextNode("");return n.observe(u,{characterData:!0}),function(){t=-t,u.data=t}}function g(e){return function(){var n=setTimeout(l,0),u=setInterval(l,50);function l(){clearTimeout(n),clearInterval(u),e()}}}k.makeRequestCallFromTimer=g}).call(A,O(14))},function(E,A){var O;O=function(){return this}();try{O=O||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(O=window)}E.exports=O},function(E,A,O){var v,k;(function(h){var w=function(){var S=Array.prototype.slice.call(arguments);typeof S[0]=="function"&&S[0].apply(null,S.splice(1))},f=function(S){typeof setImmediate=="function"?setImmediate(S):typeof process<"u"&&process.nextTick?process.nextTick(S):setTimeout(S,0)},y=function(S){var _=function(g){var e=function(){return S.length&&S[g].apply(null,arguments),e.next()};return e.next=function(){return g<S.length-1?_(g+1):null},e};return _(0)},I=Array.isArray||function(S){return Object.prototype.toString.call(S)==="[object Array]"},F=function(S,_,g){var e=g?f:w;if(_=_||function(){},!I(S)){var t=new Error("First argument to waterfall must be an array of functions");return _(t)}if(!S.length)return _();var n=function(u){return function(l){if(l)_.apply(null,arguments),_=function(){};else{var c=Array.prototype.slice.call(arguments,1),r=u.next();r?c.push(n(r)):c.push(_),e(function(){u.apply(null,c)})}}};n(y(S))()};v=[],k=(function(){return F}).apply(A,v),k!==void 0&&(E.exports=k)})()},function(E,A,O){var v=typeof Reflect=="object"?Reflect:null,k=v&&typeof v.apply=="function"?v.apply:function(s,d,p){return Function.prototype.apply.call(s,d,p)},h;v&&typeof v.ownKeys=="function"?h=v.ownKeys:Object.getOwnPropertySymbols?h=function(s){return Object.getOwnPropertyNames(s).concat(Object.getOwnPropertySymbols(s))}:h=function(s){return Object.getOwnPropertyNames(s)};function w(o){console&&console.warn&&console.warn(o)}var f=Number.isNaN||function(s){return s!==s};function y(){y.init.call(this)}E.exports=y,E.exports.once=r,y.EventEmitter=y,y.prototype._events=void 0,y.prototype._eventsCount=0,y.prototype._maxListeners=void 0;var I=10;function F(o){if(typeof o!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof o)}Object.defineProperty(y,"defaultMaxListeners",{enumerable:!0,get:function(){return I},set:function(o){if(typeof o!="number"||o<0||f(o))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+o+".");I=o}}),y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(s){if(typeof s!="number"||s<0||f(s))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+s+".");return this._maxListeners=s,this};function S(o){return o._maxListeners===void 0?y.defaultMaxListeners:o._maxListeners}y.prototype.getMaxListeners=function(){return S(this)},y.prototype.emit=function(s){for(var d=[],p=1;p<arguments.length;p++)d.push(arguments[p]);var T=s==="error",R=this._events;if(R!==void 0)T=T&&R.error===void 0;else if(!T)return!1;if(T){var P;if(d.length>0&&(P=d[0]),P instanceof Error)throw P;var B=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw B.context=P,B}var j=R[s];if(j===void 0)return!1;if(typeof j=="function")k(j,this,d);else for(var b=j.length,m=u(j,b),p=0;p<b;++p)k(m[p],this,d);return!0};function _(o,s,d,p){var T,R,P;if(F(d),R=o._events,R===void 0?(R=o._events=Object.create(null),o._eventsCount=0):(R.newListener!==void 0&&(o.emit("newListener",s,d.listener?d.listener:d),R=o._events),P=R[s]),P===void 0)P=R[s]=d,++o._eventsCount;else if(typeof P=="function"?P=R[s]=p?[d,P]:[P,d]:p?P.unshift(d):P.push(d),T=S(o),T>0&&P.length>T&&!P.warned){P.warned=!0;var B=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(s)+" listeners added. Use emitter.setMaxListeners() to increase limit");B.name="MaxListenersExceededWarning",B.emitter=o,B.type=s,B.count=P.length,w(B)}return o}y.prototype.addListener=function(s,d){return _(this,s,d,!1)},y.prototype.on=y.prototype.addListener,y.prototype.prependListener=function(s,d){return _(this,s,d,!0)};function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function e(o,s,d){var p={fired:!1,wrapFn:void 0,target:o,type:s,listener:d},T=g.bind(p);return T.listener=d,p.wrapFn=T,T}y.prototype.once=function(s,d){return F(d),this.on(s,e(this,s,d)),this},y.prototype.prependOnceListener=function(s,d){return F(d),this.prependListener(s,e(this,s,d)),this},y.prototype.removeListener=function(s,d){var p,T,R,P,B;if(F(d),T=this._events,T===void 0)return this;if(p=T[s],p===void 0)return this;if(p===d||p.listener===d)--this._eventsCount===0?this._events=Object.create(null):(delete T[s],T.removeListener&&this.emit("removeListener",s,p.listener||d));else if(typeof p!="function"){for(R=-1,P=p.length-1;P>=0;P--)if(p[P]===d||p[P].listener===d){B=p[P].listener,R=P;break}if(R<0)return this;R===0?p.shift():l(p,R),p.length===1&&(T[s]=p[0]),T.removeListener!==void 0&&this.emit("removeListener",s,B||d)}return this},y.prototype.off=y.prototype.removeListener,y.prototype.removeAllListeners=function(s){var d,p,T;if(p=this._events,p===void 0)return this;if(p.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):p[s]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete p[s]),this;if(arguments.length===0){var R=Object.keys(p),P;for(T=0;T<R.length;++T)P=R[T],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(d=p[s],typeof d=="function")this.removeListener(s,d);else if(d!==void 0)for(T=d.length-1;T>=0;T--)this.removeListener(s,d[T]);return this};function t(o,s,d){var p=o._events;if(p===void 0)return[];var T=p[s];return T===void 0?[]:typeof T=="function"?d?[T.listener||T]:[T]:d?c(T):u(T,T.length)}y.prototype.listeners=function(s){return t(this,s,!0)},y.prototype.rawListeners=function(s){return t(this,s,!1)},y.listenerCount=function(o,s){return typeof o.listenerCount=="function"?o.listenerCount(s):n.call(o,s)},y.prototype.listenerCount=n;function n(o){var s=this._events;if(s!==void 0){var d=s[o];if(typeof d=="function")return 1;if(d!==void 0)return d.length}return 0}y.prototype.eventNames=function(){return this._eventsCount>0?h(this._events):[]};function u(o,s){for(var d=new Array(s),p=0;p<s;++p)d[p]=o[p];return d}function l(o,s){for(;s+1<o.length;s++)o[s]=o[s+1];o.pop()}function c(o){for(var s=new Array(o.length),d=0;d<s.length;++d)s[d]=o[d].listener||o[d];return s}function r(o,s){return new Promise(function(d,p){function T(P){o.removeListener(s,R),p(P)}function R(){typeof o.removeListener=="function"&&o.removeListener("error",T),d([].slice.call(arguments))}a(o,s,R,{once:!0}),s!=="error"&&i(o,T,{once:!0})})}function i(o,s,d){typeof o.on=="function"&&a(o,"error",s,d)}function a(o,s,d,p){if(typeof o.on=="function")p.once?o.once(s,d):o.on(s,d);else if(typeof o.addEventListener=="function")o.addEventListener(s,function T(R){p.once&&o.removeEventListener(s,T),d(R)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof o)}},function(E,A,O){var v=O(3),k=O(0),h=0;function w(){return"hole_"+h++}function f(n,u){for(var l=null,c=0;c<n.length;c++){var r=u(n[c]);r!==n[c]&&(l||(l=n.slice()),l[c]=r)}return l||n}function y(n,u,l){if(!(n instanceof v.Node))return n;if(!l){var c=u(n);if(c&&c!==n)return c}if(n instanceof v.NodeList){var r=f(n.children,function(d){return y(d,u,l)});r!==n.children&&(n=new v[n.typename](n.lineno,n.colno,r))}else if(n instanceof v.CallExtension){var i=y(n.args,u,l),a=f(n.contentArgs,function(d){return y(d,u,l)});(i!==n.args||a!==n.contentArgs)&&(n=new v[n.typename](n.extName,n.prop,i,a))}else{var o=n.fields.map(function(d){return n[d]}),s=f(o,function(d){return y(d,u,l)});s!==o&&(n=new v[n.typename](n.lineno,n.colno),s.forEach(function(d,p){n[n.fields[p]]=d}))}return l&&u(n)||n}function I(n,u){return y(n,u,!0)}function F(n,u,l){var c=[],r=I(l?n[l]:n,function(i){var a;return i instanceof v.Block?i:((i instanceof v.Filter&&k.indexOf(u,i.name.value)!==-1||i instanceof v.CallExtensionAsync)&&(a=new v.Symbol(i.lineno,i.colno,w()),c.push(new v.FilterAsync(i.lineno,i.colno,i.name,i.args,a))),a)});return l?n[l]=r:n=r,c.length?(c.push(n),new v.NodeList(n.lineno,n.colno,c)):n}function S(n,u){return I(n,function(l){return l instanceof v.Output?F(l,u):l instanceof v.Set?F(l,u,"value"):l instanceof v.For?F(l,u,"arr"):l instanceof v.If?F(l,u,"cond"):l instanceof v.CallExtension?F(l,u,"args"):void 0})}function _(n){return y(n,function(u){if(u instanceof v.Block){var l=!1,c=w();u.body=y(u.body,function(r){if(r instanceof v.FunCall&&r.name.value==="super")return l=!0,new v.Symbol(r.lineno,r.colno,c)}),l&&u.body.children.unshift(new v.Super(0,0,u.name,new v.Symbol(0,0,c)))}})}function g(n){return I(n,function(u){if(!(!(u instanceof v.If)&&!(u instanceof v.For))){var l=!1;if(y(u,function(c){if(c instanceof v.FilterAsync||c instanceof v.IfAsync||c instanceof v.AsyncEach||c instanceof v.AsyncAll||c instanceof v.CallExtensionAsync)return l=!0,c}),l){if(u instanceof v.If)return new v.IfAsync(u.lineno,u.colno,u.cond,u.body,u.else_);if(u instanceof v.For&&!(u instanceof v.AsyncAll))return new v.AsyncEach(u.lineno,u.colno,u.arr,u.name,u.body,u.else_)}}})}function e(n,u){return g(_(S(n,u)))}function t(n,u){return e(n,u||[])}E.exports={transform:t}},function(E,h,O){var v=O(0),k=O(2),h=E.exports={};function w(x,K){return x==null||x===!1?K:x}h.abs=Math.abs;function f(x){return x!==x}function y(x,K,W){var $,te=[],ne=[];for($=0;$<x.length;$++)$%K===0&&ne.length&&(te.push(ne),ne=[]),ne.push(x[$]);if(ne.length){if(W)for($=ne.length;$<K;$++)ne.push(W);te.push(ne)}return te}h.batch=y;function I(x){x=w(x,"");var K=x.toLowerCase();return k.copySafeness(x,K.charAt(0).toUpperCase()+K.slice(1))}h.capitalize=I;function F(x,K){if(x=w(x,""),K=K||80,x.length>=K)return x;var W=K-x.length,$=v.repeat(" ",W/2-W%2),te=v.repeat(" ",W/2);return k.copySafeness(x,$+x+te)}h.center=F;function S(x,K,W){return W?x||K:x!==void 0?x:K}h.default=S;function _(x,K,W){if(!v.isObject(x))throw new v.TemplateError("dictsort filter: val must be an object");var $=[];for(var te in x)$.push([te,x[te]]);var ne;if(W===void 0||W==="key")ne=0;else if(W==="value")ne=1;else throw new v.TemplateError("dictsort filter: You can only sort by either key or value");return $.sort(function(pe,se){var _e=pe[ne],Se=se[ne];return K||(v.isString(_e)&&(_e=_e.toUpperCase()),v.isString(Se)&&(Se=Se.toUpperCase())),_e>Se?1:_e===Se?0:-1}),$}h.dictsort=_;function g(x,K){return JSON.stringify(x,null,K)}h.dump=g;function e(x){return x instanceof k.SafeString?x:(x=x??"",k.markSafe(v.escape(x.toString())))}h.escape=e;function t(x){return x instanceof k.SafeString?x:(x=x??"",k.markSafe(x.toString()))}h.safe=t;function n(x){return x[0]}h.first=n;function u(x){return x=x??"",k.markSafe(v.escape(x.toString()))}h.forceescape=u;function l(x,K){return v.groupBy(x,K,this.env.opts.throwOnUndefined)}h.groupby=l;function c(x,K,W){if(x=w(x,""),x==="")return"";K=K||4;var $=x.split(`
|
|
26
|
+
`),te=v.repeat(" ",K),ne=$.map(function(pe,se){return se===0&&!W?pe:""+te+pe}).join(`
|
|
27
|
+
`);return k.copySafeness(x,ne)}h.indent=c;function r(x,K,W){return K=K||"",W&&(x=v.map(x,function($){return $[W]})),x.join(K)}h.join=r;function i(x){return x[x.length-1]}h.last=i;function a(x){var K=w(x,"");return K!==void 0?typeof Map=="function"&&K instanceof Map||typeof Set=="function"&&K instanceof Set?K.size:v.isObject(K)&&!(K instanceof k.SafeString)?v.keys(K).length:K.length:0}h.length=a;function o(x){if(v.isString(x))return x.split("");if(v.isObject(x))return v._entries(x||{}).map(function(K){var W=K[0],$=K[1];return{key:W,value:$}});if(v.isArray(x))return x;throw new v.TemplateError("list filter: type not iterable")}h.list=o;function s(x){return x=w(x,""),x.toLowerCase()}h.lower=s;function d(x){return x==null?"":k.copySafeness(x,x.replace(/\r\n|\n/g,`<br />
|
|
28
|
+
`))}h.nl2br=d;function p(x){return x[Math.floor(Math.random()*x.length)]}h.random=p;function T(x){function K(W,$,te){$===void 0&&($="truthy");var ne=this,pe=ne.env.getTest($);return v.toArray(W).filter(function(_e){return pe.call(ne,_e,te)===x})}return K}h.reject=T(!1);function R(x,K){return x.filter(function(W){return!W[K]})}h.rejectattr=R,h.select=T(!0);function P(x,K){return x.filter(function(W){return!!W[K]})}h.selectattr=P;function B(x,K,W,$){var te=x;if(K instanceof RegExp)return x.replace(K,W);typeof $>"u"&&($=-1);var ne="";if(typeof K=="number")K=""+K;else if(typeof K!="string")return x;if(typeof x=="number"&&(x=""+x),typeof x!="string"&&!(x instanceof k.SafeString))return x;if(K==="")return ne=W+x.split("").join(W)+W,k.copySafeness(x,ne);var pe=x.indexOf(K);if($===0||pe===-1)return x;for(var se=0,_e=0;pe>-1&&($===-1||_e<$);)ne+=x.substring(se,pe)+W,se=pe+K.length,_e++,pe=x.indexOf(K,se);return se<x.length&&(ne+=x.substring(se)),k.copySafeness(te,ne)}h.replace=B;function j(x){var K;return v.isString(x)?K=o(x):K=v.map(x,function(W){return W}),K.reverse(),v.isString(x)?k.copySafeness(x,K.join("")):K}h.reverse=j;function b(x,K,W){K=K||0;var $=Math.pow(10,K),te;return W==="ceil"?te=Math.ceil:W==="floor"?te=Math.floor:te=Math.round,te(x*$)/$}h.round=b;function m(x,K,W){for(var $=Math.floor(x.length/K),te=x.length%K,ne=[],pe=0,se=0;se<K;se++){var _e=pe+se*$;se<te&&pe++;var Se=pe+(se+1)*$,Fe=x.slice(_e,Se);W&&se>=te&&Fe.push(W),ne.push(Fe)}return ne}h.slice=m;function C(x,K,W){return W===void 0&&(W=0),K&&(x=v.map(x,function($){return $[K]})),W+x.reduce(function($,te){return $+te},0)}h.sum=C,h.sort=k.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(K,W,$,te){var ne=this,pe=v.map(K,function(_e){return _e}),se=v.getAttrGetter(te);return pe.sort(function(_e,Se){var Fe=te?se(_e):_e,D=te?se(Se):Se;if(ne.env.opts.throwOnUndefined&&te&&(Fe===void 0||D===void 0))throw new TypeError('sort: attribute "'+te+'" resolved to undefined');return!$&&v.isString(Fe)&&v.isString(D)&&(Fe=Fe.toLowerCase(),D=D.toLowerCase()),Fe<D?W?1:-1:Fe>D?W?-1:1:0}),pe});function M(x){return k.copySafeness(x,x)}h.string=M;function V(x,K){x=w(x,"");var W=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,$=ae(x.replace(W,"")),te="";return K?te=$.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
|
|
29
|
+
`).replace(/\n\n\n+/g,`
|
|
30
|
+
|
|
31
|
+
`):te=$.replace(/\s+/gi," "),k.copySafeness(x,te)}h.striptags=V;function z(x){x=w(x,"");var K=x.split(" ").map(function(W){return I(W)});return k.copySafeness(x,K.join(" "))}h.title=z;function ae(x){return k.copySafeness(x,x.replace(/^\s*|\s*$/g,""))}h.trim=ae;function ee(x,K,W,$){var te=x;if(x=w(x,""),K=K||255,x.length<=K)return x;if(W)x=x.substring(0,K);else{var ne=x.lastIndexOf(" ",K);ne===-1&&(ne=K),x=x.substring(0,ne)}return x+=$??"...",k.copySafeness(te,x)}h.truncate=ee;function ge(x){return x=w(x,""),x.toUpperCase()}h.upper=ge;function be(x){var K=encodeURIComponent;if(v.isString(x))return K(x);var W=v.isArray(x)?x:v._entries(x);return W.map(function($){var te=$[0],ne=$[1];return K(te)+"="+K(ne)}).join("&")}h.urlencode=be;var oe=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,ie=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,G=/^https?:\/\/.*$/,J=/^www\./,Y=/\.(?:org|net|com)(?:\:|\/|$)/;function ce(x,K,W){f(K)&&(K=1/0);var $=W===!0?' rel="nofollow"':"",te=x.split(/(\s+)/).filter(function(ne){return ne&&ne.length}).map(function(ne){var pe=ne.match(oe),se=pe?pe[1]:ne,_e=se.substr(0,K);return G.test(se)?'<a href="'+se+'"'+$+">"+_e+"</a>":J.test(se)?'<a href="http://'+se+'"'+$+">"+_e+"</a>":ie.test(se)?'<a href="mailto:'+se+'">'+se+"</a>":Y.test(se)?'<a href="http://'+se+'"'+$+">"+_e+"</a>":ne});return te.join("")}h.urlize=ce;function ke(x){x=w(x,"");var K=x?x.match(/\w+/g):null;return K?K.length:null}h.wordcount=ke;function ye(x,K){var W=parseFloat(x);return f(W)?K:W}h.float=ye;var Re=k.makeMacro(["value","default","base"],[],function(K,W,$){$===void 0&&($=10);var te=parseInt(K,$);return f(te)?W:te});h.int=Re,h.d=h.default,h.e=h.escape},function(E,A,O){function v(f,y){f.prototype=Object.create(y.prototype),f.prototype.constructor=f,k(f,y)}function k(f,y){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(F,S){return F.__proto__=S,F},k(f,y)}var h=O(6),w=function(f){v(y,f);function y(F){var S;return S=f.call(this)||this,S.precompiled=F||{},S}var I=y.prototype;return I.getSource=function(S){return this.precompiled[S]?{src:{type:"code",obj:this.precompiled[S]},path:S}:null},y}(h);E.exports={PrecompiledLoader:w}},function(E,A,O){var v=O(2).SafeString;function k(p){return typeof p=="function"}A.callable=k;function h(p){return p!==void 0}A.defined=h;function w(p,T){return p%T===0}A.divisibleby=w;function f(p){return p instanceof v}A.escaped=f;function y(p,T){return p===T}A.equalto=y,A.eq=A.equalto,A.sameas=A.equalto;function I(p){return p%2===0}A.even=I;function F(p){return!p}A.falsy=F;function S(p,T){return p>=T}A.ge=S;function _(p,T){return p>T}A.greaterthan=_,A.gt=A.greaterthan;function g(p,T){return p<=T}A.le=g;function e(p,T){return p<T}A.lessthan=e,A.lt=A.lessthan;function t(p){return p.toLowerCase()===p}A.lower=t;function n(p,T){return p!==T}A.ne=n;function u(p){return p===null}A.null=u;function l(p){return typeof p=="number"}A.number=l;function c(p){return p%2===1}A.odd=c;function r(p){return typeof p=="string"}A.string=r;function i(p){return!!p}A.truthy=i;function a(p){return p===void 0}A.undefined=a;function o(p){return p.toUpperCase()===p}A.upper=o;function s(p){return typeof Symbol<"u"?!!p[Symbol.iterator]:Array.isArray(p)||typeof p=="string"}A.iterable=s;function d(p){var T=p!=null&&typeof p=="object"&&!Array.isArray(p);return Set?T&&!(p instanceof Set):T}A.mapping=d},function(E,A,O){function v(w){var f=-1;return{current:null,reset:function(){f=-1,this.current=null},next:function(){return f++,f>=w.length&&(f=0),this.current=w[f],this.current}}}function k(w){w=w||",";var f=!0;return function(){var y=f?"":w;return f=!1,y}}function h(){return{range:function(f,y,I){typeof y>"u"?(y=f,f=0,I=1):I||(I=1);var F=[];if(I>0)for(var S=f;S<y;S+=I)F.push(S);else for(var _=f;_>y;_+=I)F.push(_);return F},cycler:function(){return v(Array.prototype.slice.call(arguments))},joiner:function(f){return k(f)}}}E.exports=h},function(E,A,O){var v=O(4);E.exports=function(h,w){function f(y,I){if(this.name=y,this.path=y,this.defaultEngine=I.defaultEngine,this.ext=v.extname(y),!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=(this.defaultEngine[0]!=="."?".":"")+this.defaultEngine)}return f.prototype.render=function(I,F){h.render(this.name,I,F)},w.set("view",f),w.set("nunjucksEnv",h),h}},function(E,A,O){var v=O(4),k=O(4),h=O(0),w=h._prettifyError,f=O(5),y=O(7),I=y.Environment,F=O(24);function S(t,n){return Array.isArray(n)?n.some(function(u){return t.match(u)}):!1}function _(t,n){n=n||{},n.isString=!0;var u=n.env||new I([]),l=n.wrapper||F;if(!n.name)throw new Error('the "name" option is required when compiling a string');return l([e(t,n.name,u)],n)}function g(t,n){n=n||{};var u=n.env||new I([]),l=n.wrapper||F;if(n.isString)return _(t,n);var c=v.existsSync(t)&&v.statSync(t),r=[],i=[];function a(d){v.readdirSync(d).forEach(function(p){var T=k.join(d,p),R=T.substr(k.join(t,"/").length),P=v.statSync(T);P&&P.isDirectory()?(R+="/",S(R,n.exclude)||a(T)):S(R,n.include)&&i.push(T)})}if(c.isFile())r.push(e(v.readFileSync(t,"utf-8"),n.name||t,u));else if(c.isDirectory()){a(t);for(var o=0;o<i.length;o++){var s=i[o].replace(k.join(t,"/"),"");try{r.push(e(v.readFileSync(i[o],"utf-8"),s,u))}catch(d){if(n.force)console.error(d);else throw d}}}return l(r,n)}function e(t,n,u){u=u||new I([]);var l=u.asyncFilters,c=u.extensionsList,r;n=n.replace(/\\/g,"/");try{r=f.compile(t,l,c,n,u.opts)}catch(i){throw w(n,!1,i)}return{name:n,template:r}}E.exports={precompile:g,precompileString:_}},function(E,A,O){function v(k,h){var w="";h=h||{};for(var f=0;f<k.length;f++){var y=JSON.stringify(k[f].name),I=k[f].template;w+="(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["+y+`] = (function() {
|
|
32
|
+
`+I+`
|
|
33
|
+
})();
|
|
34
|
+
`,h.asFunction&&(w+="return function(ctx, cb) { return nunjucks.render("+y+`, ctx, cb); }
|
|
35
|
+
`),w+=`})();
|
|
36
|
+
`}return w}E.exports=v},function(E,A,O){function v(){var k=this.runtime,h=this.lib,w=this.compiler.Compiler,f=this.parser.Parser,y=this.nodes,I=this.lexer,F=k.contextOrFrameLookup,S=k.memberLookup,_,g;w&&(_=w.prototype.assertType),f&&(g=f.prototype.parseAggregate);function e(){k.contextOrFrameLookup=F,k.memberLookup=S,w&&(w.prototype.assertType=_),f&&(f.prototype.parseAggregate=g)}k.contextOrFrameLookup=function(a,o,s){var d=F.apply(this,arguments);if(d!==void 0)return d;switch(s){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function t(i){return{index:i.index,lineno:i.lineno,colno:i.colno}}if(y&&w&&f){var n=y.Node.extend("Slice",{fields:["start","stop","step"],init:function(a,o,s,d,p){s=s||new y.Literal(a,o,null),d=d||new y.Literal(a,o,null),p=p||new y.Literal(a,o,1),this.parent(a,o,s,d,p)}});w.prototype.assertType=function(a){a instanceof n||_.apply(this,arguments)},w.prototype.compileSlice=function(a,o){this._emit("("),this._compileExpression(a.start,o),this._emit("),("),this._compileExpression(a.stop,o),this._emit("),("),this._compileExpression(a.step,o),this._emit(")")},f.prototype.parseAggregate=function(){var a=this,o=t(this.tokens);o.colno--,o.index--;try{return g.apply(this)}catch(j){var s=t(this.tokens),d=function(){return h._assign(a.tokens,s),j};h._assign(this.tokens,o),this.peeked=!1;var p=this.peekToken();if(p.type!==I.TOKEN_LEFT_BRACKET)throw d();this.nextToken();for(var T=new n(p.lineno,p.colno),R=!1,P=0;P<=T.fields.length&&!this.skip(I.TOKEN_RIGHT_BRACKET);P++){if(P===T.fields.length)if(R)this.fail("parseSlice: too many slice components",p.lineno,p.colno);else break;if(this.skip(I.TOKEN_COLON))R=!0;else{var B=T.fields[P];T[B]=this.parseExpression(),R=this.skip(I.TOKEN_COLON)||R}}if(!R)throw d();return new y.Array(p.lineno,p.colno,[T])}}}function u(i,a,o,s){i=i||[],a===null&&(a=s<0?i.length-1:0),o===null?o=s<0?-1:i.length:o<0&&(o+=i.length),a<0&&(a+=i.length);for(var d=[],p=a;!(p<0||p>i.length||s>0&&p>=o||s<0&&p<=o);p+=s)d.push(k.memberLookup(i,p));return d}function l(i,a){return Object.prototype.hasOwnProperty.call(i,a)}var c={pop:function(a){if(a===void 0)return this.pop();if(a>=this.length||a<0)throw new Error("KeyError");return this.splice(a,1)},append:function(a){return this.push(a)},remove:function(a){for(var o=0;o<this.length;o++)if(this[o]===a)return this.splice(o,1);throw new Error("ValueError")},count:function(a){for(var o=0,s=0;s<this.length;s++)this[s]===a&&o++;return o},index:function(a){var o;if((o=this.indexOf(a))===-1)throw new Error("ValueError");return o},find:function(a){return this.indexOf(a)},insert:function(a,o){return this.splice(a,0,o)}},r={items:function(){return h._entries(this)},values:function(){return h._values(this)},keys:function(){return h.keys(this)},get:function(a,o){var s=this[a];return s===void 0&&(s=o),s},has_key:function(a){return l(this,a)},pop:function(a,o){var s=this[a];if(s===void 0&&o!==void 0)s=o;else{if(s===void 0)throw new Error("KeyError");delete this[a]}return s},popitem:function(){var a=h.keys(this);if(!a.length)throw new Error("KeyError");var o=a[0],s=this[o];return delete this[o],[o,s]},setdefault:function(a,o){return o===void 0&&(o=null),a in this||(this[a]=o),this[a]},update:function(a){return h._assign(this,a),null}};return r.iteritems=r.items,r.itervalues=r.values,r.iterkeys=r.keys,k.memberLookup=function(a,o,s){return arguments.length===4?u.apply(this,arguments):(a=a||{},h.isArray(a)&&l(c,o)?c[o].bind(a):h.isObject(a)&&l(r,o)?r[o].bind(a):S.apply(this,arguments))},e}E.exports=v}])})})(Dt);var tr=Dt.exports;const Lt=er(tr);var nr=fe('<div class="flex items-center justify-between p-3 focus:outline-none focus:ring-0"><h2 class="text-xl font-semibold">Prompt</h2> <label class="flex items-center gap-2 text-sm"><input type="checkbox" class="checkbox svelte-1br1z62"/> Preview</label></div> <div class="h-full w-full"></div>',1);function rr(U,N){je(N,!0);let E=we(null),A,O=!1;Xe(()=>{if(A)return Bt(()=>import("../chunks/DLQqXQ6R.js").then(y=>y.e),__vite__mapDeps([0,1,2]),import.meta.url).then(y=>{if(!L(E))Q(E,y.editor.create(A,{value:"",language:"markdown",theme:"vs-dark",fontSize:14,fontFamily:'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',automaticLayout:!0,minimap:{enabled:!1},wordBasedSuggestions:"off",wordWrap:"wordWrapColumn",wordWrapColumn:90,matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never"}),!0),qn(y,N.context);else{const F=L(E).getModel();F&&y.editor.setModelLanguage(F,"markdown")}const I=k(N.onPromptChanged,500);L(E).onDidChangeModelContent(()=>{if(!(O||!L(E)))try{const F=L(E).getValue();if(F===N.prompt)return;I(F)}catch(F){console.error("Error updating prompt",F)}})}),()=>{L(E)&&L(E).dispose()}}),Xe(()=>{L(E)&&L(E).setValue(N.prompt)});let v;function k(y,I=300){return(...F)=>{clearTimeout(v),v=setTimeout(()=>{y(...F)},I)}}function h(y,I){return Lt.configure({autoescape:!1,trimBlocks:!0,lstripBlocks:!0}),Lt.renderString(y,I||{})}let w="";function f(y){if(L(E)){if(O=!0,y.currentTarget.checked){w=L(E).getValue();const I=h(w,N.context||{});L(E).setValue(I),L(E).updateOptions({readOnly:!0})}else w&&(L(E).setValue(w),w=""),L(E).updateOptions({readOnly:!1});O=!1}}vt(U,{get class(){return`overflow-hidden ${N.class??""}`},children:(y,I)=>{var F=nr(),S=Le(F),_=le(re(S),2),g=re(_);g.__change=f,Qe(),X(_),X(S);var e=le(S,2);mt(e,t=>A=t,()=>A),Z(y,F)}}),De()}et(["change"]);var ir=fe('<div class="flex items-center justify-between p-3 focus:outline-none focus:ring-0"><h2 class="text-l font-semibold">Schema</h2></div> <div class="h-full w-full"></div>',1);function or(U,N){je(N,!0);let E=we(null),A;Xe(()=>{if(A)return window.MonacoEnvironment={getWorkerUrl(O,v){return URL.createObjectURL(new Blob([""],{type:"text/javascript"}))}},Bt(()=>import("../chunks/DLQqXQ6R.js").then(O=>O.e),__vite__mapDeps([0,1,2]),import.meta.url).then(O=>{L(E)?O.editor.setModelLanguage(L(E).getModel(),"typescript"):Q(E,O.editor.create(A,{value:N.schema,language:"typescript",theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},matchBrackets:"never",bracketPairColorization:{enabled:!1},guides:{highlightActiveBracketPair:!1,bracketPairs:!1,bracketPairsHorizontal:!1},occurrencesHighlight:"off",selectionHighlight:!1,unicodeHighlight:{ambiguousCharacters:!1,nonBasicASCII:!1,invisibleCharacters:!1,includeStrings:!1,includeComments:!1},autoClosingQuotes:"never"}),!0),L(E).onDidChangeModelContent(()=>{const v=L(E).getValue();v!==N.schema&&N.onChange(v)})}),()=>{L(E)&&L(E).dispose()}}),Xe(()=>{L(E)&&L(E).setValue(N.schema)}),vt(U,{get class(){return`overflow-hidden ${N.class??""}`},children:(O,v)=>{var k=ir(),h=le(Le(k),2);mt(h,w=>A=w,()=>A),Z(O,k)}}),De()}function sr(U){return--U*U*U*U*U+1}const St=fn(null);var ar=fe('<span class="chevron svelte-1xs26rn"><!></span>'),lr=fe('<ul class="children svelte-1xs26rn"></ul>'),cr=fe("<li><span> </span> <!></li> <!>",1);function Ut(U,N){je(N,!1);const E=()=>wt(St,"$selectedFilePath",A),[A,O]=It(),v=He(),k=He(),h=He(),w=He();let f=We(N,"node",8),y=We(N,"expanded",8);const I=Ct();function F(){L(v)&&I("toggle",f().path)}function S(){if(L(v)){F();return}St.set(f().path),I("selectFile",f().path)}st(()=>Ue(f()),()=>{Q(v,f().type==="dir")}),st(()=>(L(v),Ue(y()),Ue(f())),()=>{Q(k,L(v)&&y().has(f().path))}),st(()=>(Ue(f()),E()),()=>{Q(h,f().type==="file"&&E()===f().path)}),st(()=>Ue(f()),()=>{Q(w,f().type==="file"&&/\.md$/i.test(f().name))}),Ft(),Kt();var _=cr(),g=Le(_);let e;var t=re(g);let n;var u=re(t,!0);X(t);var l=le(t,2);{var c=a=>{var o=ar(),s=re(o);{let d=en(()=>"opacity-60 transition-transform duration-150 ease-out "+(L(k)?"rotate-180":""));Ze(s,{name:"chevron-down",width:20,height:20,get class(){return L(d)}})}X(o),lt("click",o,yn(F)),Z(a,o)};Ee(l,a=>{L(v)&&a(c)})}X(g);var r=le(g,2);{var i=a=>{var o=lr();tt(o,5,()=>(Ue(f()),dt(()=>f().children??[])),nt,(s,d)=>{var p=ze(),T=Le(p);Ut(T,{get node(){return L(d)},get expanded(){return y()},$$events:{selectFile(R){Tt.call(this,N,R)},toggle(R){Tt.call(this,N,R)}}}),Z(s,p)}),X(o),ct(3,o,()=>xn,()=>({duration:150,easing:sr})),Z(a,o)};Ee(r,a=>{L(v)&&L(k)&&a(i)})}Pe(()=>{e=Ne(g,1,"row svelte-1xs26rn",null,e,{selected:L(h)}),Rt(g,"aria-expanded",L(v)?L(k):void 0),n=Ne(t,1,"name svelte-1xs26rn",null,n,{"text-rc-green-200":L(h),"opacity-60":!L(w)&&!L(h)}),Me(u,(Ue(f()),dt(()=>f().name)))}),lt("click",g,S),Z(U,_),De(),O()}var ur=fe('<div class="p-2 text-rc-gray-300">Loading files…</div>'),fr=fe('<div class="p-2 text-red-400"> </div>'),hr=fe('<div class="pb-2 pr-2"><ul class="file-tree svelte-1eh7ylr"></ul></div>'),pr=fe('<div class="p-2 text-rc-gray-300">No files</div>'),dr=fe('<div class="flex h-full flex-col overflow-auto"><!></div>');function vr(U,N){je(N,!1);let E=We(N,"project",8),A=We(N,"agent",8);const O=Ct();let v=He(null),k=He(!1),h=He(""),w=He(new Set);async function f(){if(!(!E()||!A())){Q(k,!0),Q(h,"");try{const t=await fetch(`/roleplay/api/files?project=${encodeURIComponent(E())}&tree=1`);if(!t.ok)throw new Error(await t.text());const n=await t.json();Q(v,n.tree),Q(w,new Set),L(v)&&y(L(v))}catch(t){Q(h,(t==null?void 0:t.message)||"Failed to load tree")}finally{Q(k,!1)}}}function y(t){if(t.type==="dir"){L(w).add(t.path);for(const n of t.children??[])y(n)}}function I(t){O("selectFile",t.detail)}function F(t){const n=t.detail;L(w).has(n)?L(w).delete(n):L(w).add(n),Q(w,new Set(L(w)))}st(()=>(Ue(E()),Ue(A())),()=>{E()&&A()&&f()}),Ft(),Kt();var S=dr(),_=re(S);{var g=t=>{var n=ur();Z(t,n)},e=t=>{var n=ze(),u=Le(n);{var l=r=>{var i=fr(),a=re(i,!0);X(i),Pe(()=>Me(a,L(h))),Z(r,i)},c=r=>{var i=ze(),a=Le(i);{var o=d=>{var p=hr(),T=re(p);tt(T,5,()=>(L(v),dt(()=>L(v).children??[])),nt,(R,P)=>{Ut(R,{get node(){return L(P)},get expanded(){return L(w)},$$events:{selectFile:I,toggle:F}})}),X(T),X(p),Z(d,p)},s=d=>{var p=pr();Z(d,p)};Ee(a,d=>{L(v)?d(o):d(s,!1)},!0)}Z(r,i)};Ee(u,r=>{L(h)?r(l):r(c,!1)},!0)}Z(t,n)};Ee(_,t=>{L(k)?t(g):t(e,!1)})}X(S),Z(U,S),De()}var mr=fe("<!> <!> <!>",1),gr=fe("<button><span> </span></button>"),_r=fe(`<div class="
|
|
37
|
+
absolute bottom-0 right-0 m-4 rounded-sm border border-red-500 bg-red-50
|
|
38
|
+
px-4 py-2 text-red-800 focus:outline-none focus:ring-0"> </div>`),yr=fe('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-700 py-2 pr-lg"><nav class="flex h-14 flex-none items-center justify-between bg-rc-gray-700"><div class="flex items-center"><!></div> <div class="ml-auto flex items-center gap-5"><!> <!></div></nav> <div class="flex-1 overflow-hidden"><div><div><!></div> <div><!> <!></div> <!> <!></div> <div><div class="text-rc-gray-100">Connecting...</div></div></div></div> <!></div>');function zr(U,N){je(N,!0);const E=()=>wt(h,"$currentAgent",O),A=()=>wt(k,"$agents",O),[O,v]=It(),{agents:k,currentAgent:h,onAgentSelect:w}=dn();let f=we(at([])),y=we(null),I=we(at([])),F=we(null),S=we(null),_=we(null),g=we(at({})),e=we(""),t=we(!1),n=we(null),u=we(!1),l=we(null),c=we(!1),r=we(!1);function i(D,he){return typeof window>"u"?null:(he||(he=new URLSearchParams(window.location.href)),he.get(D))}function a(D,he){if(console.log("setQueryParams",D,he),typeof window>"u")return;const me=new URL(window.location.href);he===null?me.searchParams.delete(D):me.searchParams.set(D,he),ln(me.toString(),{})}let o=()=>{};At(()=>{ot.onOpen(()=>{Q(t,!0)}),ot.onClose(()=>{Q(t,!1)}),o=ot.onMessage(D=>{var he;if(D.channel==="chat")An(D.message);else if(D.channel==="log")Nn(D.message);else if(D.channel=="actions")Cn(D.action);else if(D.channel==="app-events"){if(D.event.type==="agents-loaded"){ht();const me=E()||D.event.agents[0];me&&s({type:"select-agent",agent:me})}else if(D.event.type==="context-updated")Q(S,D.event.context,!0),D.event.promptContext&&Q(_,D.event.promptContext,!0);else if(D.event.type==="prompt-updated")L(c)||(Q(F,D.event.prompt,!0),Q(u,!!L(F),!0));else if(D.event.type==="delayed-actions-updated")Q(g,D.event.actions,!0);else if(D.event.type==="update-states"){const me=L(I).length;Q(I,D.event.states,!0),(!L(n)&&L(I).length>0||L(I).length>me)&&Q(n,L(I)[L(I).length-1].id,!0)}else if(D.event.type==="agent-selected"){console.log("agent-selected, in roleplay"),a("agent",D.event.agent.id),Q(f,D.event.agent.steps,!0);const me=L(f).find(Ae=>Ae.name===i("step"));Q(y,me||L(f)[0],!0),s({type:"step-selected",step:(he=L(y))==null?void 0:he.name})}}else D.channel==="error"&&(Q(e,D.message,!0),setTimeout(()=>{Q(e,"")},5e3),console.error("Error:",D.message))})}),Gt(()=>{o()}),Xe(()=>{let D=i("agent",kt.url.searchParams);!D&&E()&&(D=E()),D&&(console.log("wtf, am I here???"),ht(),Q(n,null),Q(c,!1),Q(l,null),s({type:"select-agent",agent:D}))});function s(D){ot.sendMessage({channel:"app-events",event:D})}function d(D){console.log("Context changed",D),s({type:"context-updated",context:D})}function p(D){if(L(c)&&L(l)){const[he]=(E()||"").split("/");he&&fetch(`/roleplay/api/files?project=${encodeURIComponent(he)}&path=${encodeURIComponent(L(l))}`,{method:"PUT",headers:{"content-type":"text/plain"},body:D}).then(()=>{}).catch(me=>console.error("Failed to save file:",me));return}s({type:"prompt-updated",prompt:D})}function T(D){w(D)}function R(D){Q(n,D,!0),ht(),s({type:"select-agent",agent:E(),state:L(n)})}function P(){ht(),Q(n,null),s({type:"select-agent",agent:E(),state:L(n)})}function B(D){Q(y,L(f).find(he=>he.name===D)||null,!0),L(y)?a("step",L(y).name):a("step",null),s({type:"step-selected",step:D})}async function j(D){Q(l,D,!0),Q(c,!0);const[he]=(E()||"").split("/");if(he)try{const me=await fetch(`/roleplay/api/files?project=${encodeURIComponent(he)}&path=${encodeURIComponent(D)}`);if(!me.ok)throw new Error(await me.text());const Ae=await me.json();Q(F,(Ae==null?void 0:Ae.content)??"",!0),Q(u,!0)}catch(me){console.error("Failed to load file:",me)}}const b=()=>Object.keys(L(g)).length>0,m=Ke(()=>{var D;return((D=L(y))==null?void 0:D.schema)??null}),C=Ke(()=>!!L(m)),M=Ke(()=>({sidebar:{width:"w-1/6",height:"h-full",visibility:"visible"},promptColumn:{width:"w-1/2",height:"h-full",visibility:L(u)?"visible":"hidden"},promptEditor:{width:"w-full",height:L(C)?"h-3/4":"h-full",visibility:L(u)?"visible":"hidden"},schemaEditor:{width:"w-full",height:"h-1/4",visibility:L(C)?"visible":"hidden"},chat:{width:L(u)?"w-1/3":"w-2/3",height:"h-full",visibility:"visible"},contextEditor:{width:b()?"w-1/4":"w-1/3",height:"h-full",visibility:"visible"}}));function V({value:D}){D!=="roleplay"&&(D==="tests"?xt("/tests/"+E()):xt("/"+D))}var z=yr();an("1mlh0pv",D=>{Nt(()=>{tn.title="Bosun: Playground"})});var ae=re(z);hn(ae,{className:"flex-none",get agents(){return A()},get currentAgent(){return E()},onSelect:T,onToggle:()=>Q(r,!L(r)),get isCollapsed(){return L(r)}});var ee=le(ae,2),ge=re(ee),be=re(ge),oe=re(be);{let D=Ke(()=>kt.url.pathname.replace(/^\//,""));pn(oe,{get value(){return L(D)},ariaLabel:"Top tabs",onChange:V,children:(he,me)=>{var Ae=mr(),Be=Le(Ae);yt(Be,{value:"roleplay",class:"px-3",children:(Oe,Ie)=>{Qe();var H=$e("Roleplay");Z(Oe,H)},$$slots:{default:!0}});var Te=le(Be,2);yt(Te,{value:"tests",class:"px-3",children:(Oe,Ie)=>{Qe();var H=$e("Tests");Z(Oe,H)},$$slots:{default:!0}});var Ge=le(Te,2);yt(Ge,{value:"traces",class:"px-3",children:(Oe,Ie)=>{Qe();var H=$e("Traces");Z(Oe,H)},$$slots:{default:!0}}),Z(he,Ae)},$$slots:{default:!0}})}X(be);var ie=le(be,2),G=re(ie);{var J=D=>{Sn(D,{get agentStates(){return L(I)},get currentState(){return L(n)},onSelectState:R})};Ee(G,D=>{L(I).length>1&&D(J)})}var Y=le(G,2);qe(Y,{onclick:P,children:(D,he)=>{Qe();var me=$e("New chat");Z(D,me)},$$slots:{default:!0}}),X(ie),X(ge);var ce=le(ge,2),ke=re(ce),ye=re(ke),Re=re(ye);{var x=D=>{var he=ze(),me=Le(he);{var Ae=Be=>{var Te=ze(),Ge=Le(Te);sn(Ge,()=>h,Oe=>{{let Ie=Ke(()=>(E()||"").split("/")[0]),H=Ke(()=>(E()||"").split("/")[1]);vr(Oe,{get project(){return L(Ie)},get agent(){return L(H)},$$events:{selectFile:q=>j(q.detail)}})}}),Z(Be,Te)};Ee(me,Be=>{h&&Be(Ae)})}Z(D,he)},K=D=>{var he=ze(),me=Le(he);tt(me,17,()=>L(f),nt,(Ae,Be)=>{var Te=gr();Te.__click=()=>B(L(Be).name);var Ge=re(Te),Oe=re(Ge,!0);X(Ge),X(Te),Pe(()=>{var Ie;Ne(Te,1,`border-l-2 p-2 text-left ${L(Be).name===((Ie=L(y))==null?void 0:Ie.name)?"border-l-rc-green-200 text-rc-green-200":"border-l-transparent"}`),Me(Oe,L(Be).name)}),Z(Ae,Te)}),Z(D,he)};Ee(Re,D=>{N.data.leftPaneIsFiles?D(x):D(K,!1)})}X(ye);var W=le(ye,2),$=re(W);{let D=Ke(()=>L(F)??"");rr($,{get class(){return`${L(M).promptEditor.height??""} ${L(M).promptEditor.width??""} rounded-none border-r-thin border-t-0 border-r-rc-gray-300/40 focus:outline-none focus:ring-0`},get prompt(){return L(D)},get context(){return L(_)},onPromptChanged:p})}var te=le($,2);{var ne=D=>{or(D,{get class(){return`${L(M).schemaEditor.height??""} ${L(M).schemaEditor.width??""} rounded-none border-r-thin border-t-0 border-r-rc-gray-300/40`},get schema(){return L(m)},onChange:console.log})};Ee(te,D=>{L(m)&&D(ne)})}X(W);var pe=le(W,2);Qn(pe,{get class(){return`${L(M).chat.height??""} ${L(M).chat.width??""}`},get context(){return L(S)},get agentId(){return E()},onmessage:D=>ot.sendMessage({channel:"chat",message:D})});var se=le(pe,2);on(se,{get class(){return`${L(M).contextEditor.height??""} ${L(M).contextEditor.width??""} min-h-0 rounded-none border-l-thin border-l-rc-gray-300/40 focus:outline-none focus:ring-0`},get context(){return L(S)},onContextChanged:d}),X(ke);var _e=le(ke,2);X(ce),X(ee);var Se=le(ee,2);{var Fe=D=>{var he=_r(),me=re(he,!0);X(he),Pe(()=>Me(me,L(e))),Z(D,he)};Ee(Se,D=>{L(e)&&D(Fe)})}X(z),Pe(()=>{Ne(ke,1,`${L(t)?"flex":"hidden"} h-full w-full border-thin border-rc-gray-300/40 focus:outline-none focus:ring-0`),Ne(ye,1,`flex h-full ${L(M).sidebar.width??""} flex-col border-r-thin border-r-rc-gray-300/40 pt-4 text-rc-gray-200`),Ne(W,1,`${L(M).promptColumn.visibility??""} ${L(M).promptColumn.height??""} ${L(M).promptColumn.width??""} flex-col`),Ne(_e,1,`${L(t)?"hidden":"flex"} h-full items-center justify-center`)}),Z(U,z),De(),v()}et(["click"]);export{zr as component};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{p as B,f as y,e as D,g as a,h as E,b as s,c as F,i as G,d as o,s as n,a as I,j as f,u as J,$ as K,n as l,r as i}from"../chunks/DHQ8_yIz.js";import{i as M}from"../chunks/XyRovF4A.js";import{h as O}from"../chunks/Deb2U3a-.js";import{s as Q,a as A}from"../chunks/CUWa2xqt.js";import{g as U}from"../chunks/DAgYAbDT.js";import{A as V}from"../chunks/BcyK4bvI.js";import{p as W}from"../chunks/B946i1vX.js";import{T as X,a as p}from"../chunks/BJ0PAzRz.js";import{g as Y}from"../chunks/mRVZsLQ4.js";var Z=y("<!> <!> <!>",1),ee=y('<div class="flex h-screen"><!> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-700 py-2 pr-lg"><nav class="flex h-14 flex-none items-center justify-between bg-rc-gray-700"><div class="flex items-center"><!></div></nav> <div class="flex-1 border-thin border-gray-700 border-rc-gray-300/40 pt-40"><div class="flex h-full items-start justify-center">Choose agent on the left panel</div></div></div> <!></div>');function fe(C,P){B(P,!0);const j=()=>A(R,"$agents",u),k=()=>A(S,"$currentAgent",u),[u,w]=Q(),{agents:R,currentAgent:S,onAgentSelect:q}=Y();let c=E(!1);const v=J(()=>W.url.pathname.split("/")[1]);function H({value:e}){e!==a(v)&&U(`/${e}`)}var d=ee();O("dq6umm",e=>{G(()=>{K.title="Recombine Agents Hub: Tests"})});var m=o(d);V(m,{className:"flex-none",get agents(){return j()},get currentAgent(){return k()},get onAgentClick(){return q},onToggle:()=>D(c,!a(c)),get isCollapsed(){return a(c)}});var g=n(m,2),$=o(g),h=o($),L=o(h);X(L,{get value(){return a(v)},ariaLabel:"Top tabs",onChange:H,children:(e,te)=>{var b=Z(),x=I(b);p(x,{value:"roleplay",children:(t,T)=>{l();var r=f("Roleplay");s(t,r)},$$slots:{default:!0}});var _=n(x,2);p(_,{value:"tests",children:(t,T)=>{l();var r=f("Tests");s(t,r)},$$slots:{default:!0}});var z=n(_,2);p(z,{value:"traces",children:(t,T)=>{l();var r=f("Traces");s(t,r)},$$slots:{default:!0}}),s(e,b)},$$slots:{default:!0}}),i(h),i($),l(2),i(g);var N=n(g,2);M(N,e=>{}),i(d),s(C,d),F(),w()}export{fe as component};
|
|
Binary file
|
|
Binary file
|