@thebase/ui 0.0.6 → 0.0.8
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/CHANGELOG.md +20 -0
- package/README.md +2 -2
- package/dist/baseui.esm.js +10 -10
- package/dist/baseui.min.js +10 -10
- package/dist/baseui.registry.json +4 -4
- package/dist/icons/lucide.json +2 -2
- package/dist/runtime/milkdown/block-G2R773CV.js +1 -0
- package/dist/runtime/milkdown/{chunk-LIY3GISO.js → chunk-2EZOVVY4.js} +12 -12
- package/dist/runtime/milkdown/chunk-2TBUBNYK.js +3 -0
- package/dist/runtime/milkdown/{chunk-373V6XMI.js → chunk-5ILY25KD.js} +1 -1
- package/dist/runtime/milkdown/{chunk-6HASM4ZR.js → chunk-7GZI2HGN.js} +1 -1
- package/dist/runtime/milkdown/{chunk-TTCZLSO2.js → chunk-7YQMEBMQ.js} +1 -1
- package/dist/runtime/milkdown/chunk-BJC3HW5B.js +1 -0
- package/dist/runtime/milkdown/chunk-CFWAU3WN.js +1 -0
- package/dist/runtime/milkdown/{chunk-SMRDMV2Q.js → chunk-DWBFWB4X.js} +1 -1
- package/dist/runtime/milkdown/{chunk-KXKDEYCC.js → chunk-JA3LDFRC.js} +1 -1
- package/dist/runtime/milkdown/{chunk-R7FZKCAV.js → chunk-LDCXUKI3.js} +1 -1
- package/dist/runtime/milkdown/{chunk-XOIKFU3P.js → chunk-MYC7FIB2.js} +1 -1
- package/dist/runtime/milkdown/{chunk-PSGXCQNW.js → chunk-NX66TKTH.js} +1 -1
- package/dist/runtime/milkdown/{chunk-6RGD2KUU.js → chunk-NXQJDWPI.js} +1 -1
- package/dist/runtime/milkdown/{chunk-VPKKXG6L.js → chunk-OF2BVG4E.js} +1 -1
- package/dist/runtime/milkdown/{chunk-GHRUWTEV.js → chunk-R43NMSZO.js} +1 -1
- package/dist/runtime/milkdown/{chunk-SFCQEU26.js → chunk-SIRQEE7R.js} +1 -1
- package/dist/runtime/milkdown/{chunk-GVZW4OO4.js → chunk-SZCOI4YV.js} +1 -1
- package/dist/runtime/milkdown/{chunk-GAWLLGNO.js → chunk-TFG5E5LZ.js} +1 -1
- package/dist/runtime/milkdown/{chunk-VBVMNS5A.js → chunk-TOUPIB5N.js} +1 -1
- package/dist/runtime/milkdown/{chunk-WGUKYDQQ.js → chunk-VFZ7ST3H.js} +1 -1
- package/dist/runtime/milkdown/{chunk-E5R7FPWA.js → chunk-VJBGANAS.js} +4 -4
- package/dist/runtime/milkdown/{chunk-UBIXYWAI.js → chunk-WMT3RNOX.js} +1 -1
- package/dist/runtime/milkdown/chunk-XNCXGIZE.js +41 -0
- package/dist/runtime/milkdown/chunk-Y4CBBIL4.js +1 -0
- package/dist/runtime/milkdown/{chunk-3EORQGKQ.js → chunk-ZGHJJLEG.js} +1 -1
- package/dist/runtime/milkdown/{chunk-37CATSBM.js → chunk-ZIYJY6SA.js} +1 -1
- package/dist/runtime/milkdown/clipboard-5NOA4E34.js +1 -0
- package/dist/runtime/milkdown/{commonmark-KYRQSFY7.js → commonmark-263P63KC.js} +1 -1
- package/dist/runtime/milkdown/{core-SZ3VAN2E.js → core-T2SC7EXQ.js} +1 -1
- package/dist/runtime/milkdown/cursor-Z4UWEH5V.js +1 -0
- package/dist/runtime/milkdown/{diff-WJOHA5PX.js → diff-K3BORLOX.js} +1 -1
- package/dist/runtime/milkdown/{dist-TKSPPVS4.js → dist-24V6SL4V.js} +1 -1
- package/dist/runtime/milkdown/{dist-EHUNF6M5.js → dist-34ZP4UZ2.js} +1 -1
- package/dist/runtime/milkdown/{dist-I3JGQGWS.js → dist-3LQISA7E.js} +1 -1
- package/dist/runtime/milkdown/{dist-I3LMG6JF.js → dist-4QC5HFKT.js} +1 -1
- package/dist/runtime/milkdown/{dist-U6ZG6DV6.js → dist-562GM6I6.js} +1 -1
- package/dist/runtime/milkdown/{dist-7277C2KF.js → dist-5QJ34QYN.js} +1 -1
- package/dist/runtime/milkdown/{dist-UHXLU77N.js → dist-657PKZSF.js} +1 -1
- package/dist/runtime/milkdown/{dist-ZBCFN6O5.js → dist-6TS6SSJR.js} +1 -1
- package/dist/runtime/milkdown/{dist-X2CT5LDV.js → dist-7JICPTVR.js} +1 -1
- package/dist/runtime/milkdown/{dist-KY7AL6FL.js → dist-DERKVUMC.js} +1 -1
- package/dist/runtime/milkdown/{dist-QB3U2COU.js → dist-MK4VEXBD.js} +1 -1
- package/dist/runtime/milkdown/{dist-5HJGMMBO.js → dist-NYN7ZJXK.js} +1 -1
- package/dist/runtime/milkdown/dist-OPQE4Z43.js +1 -0
- package/dist/runtime/milkdown/{dist-J2KSREXK.js → dist-P4TF777A.js} +1 -1
- package/dist/runtime/milkdown/{dist-IIRHY5PY.js → dist-PEJBUU6H.js} +1 -1
- package/dist/runtime/milkdown/{dist-WNQ5J4WR.js → dist-R2X7SQDZ.js} +1 -1
- package/dist/runtime/milkdown/{dist-QMASZW6X.js → dist-RE2FJN7S.js} +1 -1
- package/dist/runtime/milkdown/{dist-RS6ERIZS.js → dist-THIQIX3E.js} +1 -1
- package/dist/runtime/milkdown/{dist-EG2OA4VS.js → dist-VEPIKH2V.js} +1 -1
- package/dist/runtime/milkdown/dist-X22ABN6K.js +1 -0
- package/dist/runtime/milkdown/{dist-63GMFB3D.js → dist-YH3NI4VG.js} +1 -1
- package/dist/runtime/milkdown/{dockerfile-NAEEVAQU.js → dockerfile-2B5D6FTU.js} +1 -1
- package/dist/runtime/milkdown/{esm-W3C6FIFD.js → esm-H2D66MX5.js} +68 -68
- package/dist/runtime/milkdown/{factor-MYKNDQPQ.js → factor-JBYSQG3O.js} +1 -1
- package/dist/runtime/milkdown/{gfm-E3RPWLDM.js → gfm-IHXC5DQO.js} +1 -1
- package/dist/runtime/milkdown/history-VOPZ3HXQ.js +1 -0
- package/dist/runtime/milkdown/indent-WYLZY3CZ.js +1 -0
- package/dist/runtime/milkdown/{javascript-43PROIAY.js → javascript-375RXK5M.js} +1 -1
- package/dist/runtime/milkdown/{lib-ULUU3LBY.js → lib-32AGHSKT.js} +1 -1
- package/dist/runtime/milkdown/lib-QZEOHNSS.js +1 -0
- package/dist/runtime/milkdown/listener-GNT2L5RH.js +1 -0
- package/dist/runtime/milkdown/milkdown-editor.js +1 -1
- package/dist/runtime/milkdown/milkdown-text-editor.js +1 -1
- package/dist/runtime/milkdown/{model-YUHBWZ3A.js → model-VKXPTJEQ.js} +1 -1
- package/dist/runtime/milkdown/{nsis-2G5LLGBI.js → nsis-XAIDIMGO.js} +1 -1
- package/dist/runtime/milkdown/{pug-VWTHDU4H.js → pug-SMVC7NDW.js} +1 -1
- package/dist/runtime/milkdown/slash-3TY5YM2E.js +1 -0
- package/dist/runtime/milkdown/{streaming-ODT2C2AX.js → streaming-S7JA52O3.js} +1 -1
- package/dist/runtime/milkdown/tooltip-5CTXOYIA.js +1 -0
- package/dist/runtime/milkdown/upload-DA4OHNVQ.js +1 -0
- package/dist/runtime/milkdown/utils-H6AH4ARX.js +1 -0
- package/dist/runtime/milkdown/y-webrtc-VQGJXSXG.js +2 -0
- package/dist/runtime/milkdown/y-websocket-YOL5ECIU.js +2 -0
- package/dist/runtime/milkdown/yjs-H3MVN7TP.js +1 -0
- package/docs/components/text-editor.md +37 -5
- package/package.json +2 -1
- package/dist/runtime/milkdown/block-B3H3PJID.js +0 -1
- package/dist/runtime/milkdown/chunk-7CVS4AGG.js +0 -3
- package/dist/runtime/milkdown/chunk-FGZNEC46.js +0 -1
- package/dist/runtime/milkdown/chunk-VKELS2FZ.js +0 -41
- package/dist/runtime/milkdown/clipboard-SGEGWVIL.js +0 -1
- package/dist/runtime/milkdown/cursor-4RIJS7XF.js +0 -1
- package/dist/runtime/milkdown/dist-6JDVYEX3.js +0 -1
- package/dist/runtime/milkdown/dist-WWUPY2DM.js +0 -1
- package/dist/runtime/milkdown/history-MXXSC4BB.js +0 -1
- package/dist/runtime/milkdown/indent-DPZPSW7O.js +0 -1
- package/dist/runtime/milkdown/lib-OHEPSUTR.js +0 -1
- package/dist/runtime/milkdown/listener-YERMSFXE.js +0 -1
- package/dist/runtime/milkdown/slash-WRZAFLVA.js +0 -1
- package/dist/runtime/milkdown/tooltip-MQR7E3GN.js +0 -1
- package/dist/runtime/milkdown/upload-4DLRUKG7.js +0 -1
- package/dist/runtime/milkdown/utils-RGFMAFOI.js +0 -1
- package/dist/runtime/milkdown/y-webrtc-MVXVFPYO.js +0 -2
- package/dist/runtime/milkdown/yjs-L4ZX4CJ5.js +0 -1
- /package/dist/runtime/milkdown/{apl-2VCEVXBO.js → apl-A2CKMNHU.js} +0 -0
- /package/dist/runtime/milkdown/{asciiarmor-ND4TKJ2V.js → asciiarmor-LYWOUGA4.js} +0 -0
- /package/dist/runtime/milkdown/{asn1-5NCC72L6.js → asn1-NB5F53MP.js} +0 -0
- /package/dist/runtime/milkdown/{asterisk-V3QQOGYS.js → asterisk-SIDVUCAX.js} +0 -0
- /package/dist/runtime/milkdown/{brainfuck-SETQDLAI.js → brainfuck-K7DBLI5P.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-CS3PHHYU.js → chunk-2FDN6WYA.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-UPNN5QP4.js → chunk-2XECCVBE.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-E6JE25ZM.js → chunk-DLMWAKB5.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-HDKYYBRG.js → chunk-DO4RO6KD.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-KJCZ4UN6.js → chunk-ILE44FN6.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-MSEQNMGN.js → chunk-IPNUYGNC.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-FOZORPFE.js → chunk-K2ROPYIW.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-XOU65PX7.js → chunk-KP5VFDTE.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-KOCVWYBK.js → chunk-MAWHENWJ.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-BV6CAHIM.js → chunk-OQJVATGH.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-Q5FF4VKZ.js → chunk-TEMVRH7B.js} +0 -0
- /package/dist/runtime/milkdown/{chunk-VYL5RGSY.js → chunk-U6C7MJSD.js} +0 -0
- /package/dist/runtime/milkdown/{clike-WKR6QU6G.js → clike-EOWJN572.js} +0 -0
- /package/dist/runtime/milkdown/{clojure-7C5XMSLE.js → clojure-VLG72YFE.js} +0 -0
- /package/dist/runtime/milkdown/{cmake-VX6UCCMV.js → cmake-2PXWCEDK.js} +0 -0
- /package/dist/runtime/milkdown/{cobol-IUBDOVSU.js → cobol-PMRFKEKB.js} +0 -0
- /package/dist/runtime/milkdown/{coffeescript-OEAM3K5M.js → coffeescript-B5G6C2AR.js} +0 -0
- /package/dist/runtime/milkdown/{commonlisp-LRFHKBQZ.js → commonlisp-CFTTVW6U.js} +0 -0
- /package/dist/runtime/milkdown/{crystal-7XKMI75H.js → crystal-M6S3MKED.js} +0 -0
- /package/dist/runtime/milkdown/{css-DTJ74K4A.js → css-HESFBL5J.js} +0 -0
- /package/dist/runtime/milkdown/{cypher-Y7ZMLKQ4.js → cypher-IIJXY2ZS.js} +0 -0
- /package/dist/runtime/milkdown/{d-NSEMXQMQ.js → d-ZHLFM7BM.js} +0 -0
- /package/dist/runtime/milkdown/{diff-BO3JC62N.js → diff-7YFE6XTG.js} +0 -0
- /package/dist/runtime/milkdown/{dtd-3HSCMPBI.js → dtd-NPOQOSDS.js} +0 -0
- /package/dist/runtime/milkdown/{dylan-UCUZF6KU.js → dylan-KB7QIKGL.js} +0 -0
- /package/dist/runtime/milkdown/{ebnf-3LHOCFAJ.js → ebnf-TBCUHQC6.js} +0 -0
- /package/dist/runtime/milkdown/{ecl-5R3NXF6N.js → ecl-OXWKHIHJ.js} +0 -0
- /package/dist/runtime/milkdown/{eiffel-CQ4L5MSH.js → eiffel-WRBXQVBO.js} +0 -0
- /package/dist/runtime/milkdown/{elm-6QYNGBQ3.js → elm-MZAQSXJY.js} +0 -0
- /package/dist/runtime/milkdown/{erlang-6NH23EDV.js → erlang-PNSW52ER.js} +0 -0
- /package/dist/runtime/milkdown/{fcl-ACRUXLOI.js → fcl-6ZY3XINI.js} +0 -0
- /package/dist/runtime/milkdown/{forth-MGVKD22I.js → forth-BAIG3TGB.js} +0 -0
- /package/dist/runtime/milkdown/{fortran-Y2LH5YJY.js → fortran-MQWYHO5L.js} +0 -0
- /package/dist/runtime/milkdown/{gas-DGW2BQT5.js → gas-Q6YL6AQO.js} +0 -0
- /package/dist/runtime/milkdown/{gherkin-YE56IVZ5.js → gherkin-W5ZB2USN.js} +0 -0
- /package/dist/runtime/milkdown/{groovy-ACMNYCLF.js → groovy-JTF2GBED.js} +0 -0
- /package/dist/runtime/milkdown/{haskell-MIB6HZSL.js → haskell-HFE6BWET.js} +0 -0
- /package/dist/runtime/milkdown/{haxe-TANQRBYK.js → haxe-WWIJK4Z5.js} +0 -0
- /package/dist/runtime/milkdown/{http-QUK2BL6J.js → http-NZKSSIDP.js} +0 -0
- /package/dist/runtime/milkdown/{idl-54U6ONEE.js → idl-CMM2WWSO.js} +0 -0
- /package/dist/runtime/milkdown/{julia-7E2ZIO2U.js → julia-BMA4W7GB.js} +0 -0
- /package/dist/runtime/milkdown/{livescript-SUEXR7PK.js → livescript-3UKKDN45.js} +0 -0
- /package/dist/runtime/milkdown/{lua-QNGITPQK.js → lua-SWEBXZV4.js} +0 -0
- /package/dist/runtime/milkdown/{mathematica-HJQQXVFC.js → mathematica-CJOQYQFY.js} +0 -0
- /package/dist/runtime/milkdown/{mbox-F6SUCJVD.js → mbox-Y4XZOKOO.js} +0 -0
- /package/dist/runtime/milkdown/{mirc-7S5H76VB.js → mirc-5HDV5JC4.js} +0 -0
- /package/dist/runtime/milkdown/{mllike-TTW7I7W4.js → mllike-2EOQGIBG.js} +0 -0
- /package/dist/runtime/milkdown/{modelica-3POMKZFY.js → modelica-XKNFUSSN.js} +0 -0
- /package/dist/runtime/milkdown/{mscgen-IKAT43RT.js → mscgen-2X7TXJM6.js} +0 -0
- /package/dist/runtime/milkdown/{mumps-XZE3RMGJ.js → mumps-R6QPEBAR.js} +0 -0
- /package/dist/runtime/milkdown/{nginx-QCVWU6DV.js → nginx-7TJP7GQA.js} +0 -0
- /package/dist/runtime/milkdown/{ntriples-T6AMEY2C.js → ntriples-SCDRUUH2.js} +0 -0
- /package/dist/runtime/milkdown/{octave-64EAJHKR.js → octave-RV2OSSMQ.js} +0 -0
- /package/dist/runtime/milkdown/{oz-7QHCZG72.js → oz-6VL77R5Z.js} +0 -0
- /package/dist/runtime/milkdown/{pascal-KWNZTZKE.js → pascal-TQWMLNUO.js} +0 -0
- /package/dist/runtime/milkdown/{perl-KX75FRG7.js → perl-MJLZUOI2.js} +0 -0
- /package/dist/runtime/milkdown/{pig-YA2LFBUW.js → pig-MQKMXNXN.js} +0 -0
- /package/dist/runtime/milkdown/{powershell-SONNWKJG.js → powershell-RJOL52GR.js} +0 -0
- /package/dist/runtime/milkdown/{properties-MEUWSNZY.js → properties-XL2YBZDU.js} +0 -0
- /package/dist/runtime/milkdown/{protobuf-RKCPHWGY.js → protobuf-NQWTK3Z6.js} +0 -0
- /package/dist/runtime/milkdown/{puppet-JMZDB2TG.js → puppet-POQGMO34.js} +0 -0
- /package/dist/runtime/milkdown/{python-GVEPBHD7.js → python-NMGCKPUX.js} +0 -0
- /package/dist/runtime/milkdown/{q-QBK3FAEX.js → q-ILHJCNOR.js} +0 -0
- /package/dist/runtime/milkdown/{r-QZYPZHNL.js → r-XNO7UDHK.js} +0 -0
- /package/dist/runtime/milkdown/{rpm-DU7TLFAI.js → rpm-TPSVG357.js} +0 -0
- /package/dist/runtime/milkdown/{ruby-DMEPZV6P.js → ruby-3ZLDCDCY.js} +0 -0
- /package/dist/runtime/milkdown/{sas-UQCOIXSD.js → sas-X4IZVM55.js} +0 -0
- /package/dist/runtime/milkdown/{scheme-ABXYL6GU.js → scheme-JSRTR252.js} +0 -0
- /package/dist/runtime/milkdown/{shell-M3XELTMZ.js → shell-IJ2JLDQQ.js} +0 -0
- /package/dist/runtime/milkdown/{sieve-MUKKCDBZ.js → sieve-4ACSKBHV.js} +0 -0
- /package/dist/runtime/milkdown/{smalltalk-P4FKOVAU.js → smalltalk-AHTDIHSN.js} +0 -0
- /package/dist/runtime/milkdown/{solr-HHKG4NNK.js → solr-HDS3YMCJ.js} +0 -0
- /package/dist/runtime/milkdown/{sparql-5YJAIBWN.js → sparql-OPR2SX5E.js} +0 -0
- /package/dist/runtime/milkdown/{spreadsheet-M3SEYOFV.js → spreadsheet-YMJBRXJ6.js} +0 -0
- /package/dist/runtime/milkdown/{sql-Z6C3KTS5.js → sql-4LK5AARR.js} +0 -0
- /package/dist/runtime/milkdown/{stex-MO67FBMF.js → stex-CBOLYXFQ.js} +0 -0
- /package/dist/runtime/milkdown/{stylus-JEMVT3OU.js → stylus-5SYL4OMN.js} +0 -0
- /package/dist/runtime/milkdown/{swift-HP7RYRJA.js → swift-W3IKYGAN.js} +0 -0
- /package/dist/runtime/milkdown/{tcl-WPHRLNQC.js → tcl-QKBH3MVM.js} +0 -0
- /package/dist/runtime/milkdown/{textile-3LZDM6IW.js → textile-KRYPADXN.js} +0 -0
- /package/dist/runtime/milkdown/{tiddlywiki-LMGAXCWG.js → tiddlywiki-XNSPF27C.js} +0 -0
- /package/dist/runtime/milkdown/{tiki-SC7NYLRG.js → tiki-ZZLJUPPJ.js} +0 -0
- /package/dist/runtime/milkdown/{toml-VBRI3ILD.js → toml-FCAM6ZFK.js} +0 -0
- /package/dist/runtime/milkdown/{troff-MZNIC3MS.js → troff-7BWGQP4Z.js} +0 -0
- /package/dist/runtime/milkdown/{ttcn-ZUOU74GM.js → ttcn-K3WYQPKS.js} +0 -0
- /package/dist/runtime/milkdown/{ttcn-cfg-2JJUM5CY.js → ttcn-cfg-LDHTKWFO.js} +0 -0
- /package/dist/runtime/milkdown/{turtle-SNBPEJHA.js → turtle-6Q2P3NLY.js} +0 -0
- /package/dist/runtime/milkdown/{vb-U45Y75DV.js → vb-BYDJL3EX.js} +0 -0
- /package/dist/runtime/milkdown/{vbscript-XTRRB36U.js → vbscript-WOMP2PYW.js} +0 -0
- /package/dist/runtime/milkdown/{velocity-Y7TX26SP.js → velocity-ZG7EESTK.js} +0 -0
- /package/dist/runtime/milkdown/{verilog-IFT4S6MZ.js → verilog-MW2R7Q2Y.js} +0 -0
- /package/dist/runtime/milkdown/{vhdl-CK4X465M.js → vhdl-GQOJ6JVT.js} +0 -0
- /package/dist/runtime/milkdown/{webidl-N7XOMHHB.js → webidl-5Q6QYACY.js} +0 -0
- /package/dist/runtime/milkdown/{xquery-EPMIEXTW.js → xquery-MD4ZCF7M.js} +0 -0
- /package/dist/runtime/milkdown/{yacas-A74LVH45.js → yacas-EKNE7G24.js} +0 -0
- /package/dist/runtime/milkdown/{z80-NVBCD5FV.js → z80-44FRSRYD.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as mt}from"./chunk-BJC3HW5B.js";import"./chunk-Y4CBBIL4.js";import{Ba as ne,D as Be,Da as E,Eb as se,Fa as oe,Fb as Te,Gb as y,Ia as lt,Ja as _e,Jb as x,Ka as Se,L as qe,N as $e,Q as Ze,Qa as ct,Qb as dt,S as Ge,Sa as re,Tb as ft,U as Qe,Ub as ut,V as et,Vb as le,W as z,Wa as at,a as He,b as G,ba as xe,bb as ie,c as Je,ca as tt,ea as nt,h as w,ha as ee,i as D,oa as be,pa as ot,ra as rt,u as We,v as Q,vb as we,wa as it,xa as te,ya as st}from"./chunk-VJBGANAS.js";import{Ka as ye,P as he,Q as Ue,R as Xe,T as Y,U as F,_a as je,d as R,e as me,h as De,i as Ee,jb as Le,pa as Ie,pb as ze,qa as pe,ra as ge,ta as Ke,ya as Z}from"./chunk-XNCXGIZE.js";import{a as M,d as L}from"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import{f as p,g as A,h as C,i as j}from"./chunk-23NN352E.js";var Dt=/[\uD800-\uDBFF]/,Et=/[\uDC00-\uDFFF]/,Ut=(t,e)=>{let o=0,n=0;for(;o<t.length&&o<e.length&&t[o]===e[o];)o++;for(o>0&&Dt.test(t[o-1])&&o--;n+o<t.length&&n+o<e.length&&t[t.length-n-1]===e[e.length-n-1];)n++;return n>0&&Et.test(t[t.length-n])&&n--,{index:o,remove:t.length-o-n,insert:e.slice(o,e.length-n)}},ht=Ut;var h=new F("y-sync"),b=new F("y-undo"),O=new F("yjs-cursor");var _=(t,e)=>t>>>e|t<<32-e,It=t=>_(t,2)^_(t,13)^_(t,22),Kt=t=>_(t,6)^_(t,11)^_(t,25),jt=t=>_(t,7)^_(t,18)^t>>>3,Lt=t=>_(t,17)^_(t,19)^t>>>10,zt=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ht=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pe=class{constructor(){let e=new ArrayBuffer(320);this._H=new Uint32Array(e,0,8),this._H.set(Ht),this._W=new Uint32Array(e,64,64)}_updateHash(){let e=this._H,o=this._W;for(let a=16;a<64;a++)o[a]=Lt(o[a-2])+o[a-7]+jt(o[a-15])+o[a-16];let n=e[0],r=e[1],c=e[2],i=e[3],l=e[4],d=e[5],s=e[6],f=e[7];for(let a=0,u,m;a<64;a++)u=f+Kt(l)+(l&d^~l&s)+zt[a]+o[a]>>>0,m=It(n)+(n&r^n&c^r&c)>>>0,f=s,s=d,d=l,l=i+u>>>0,i=c,c=r,r=n,n=u+m>>>0;e[0]+=n,e[1]+=r,e[2]+=c,e[3]+=i,e[4]+=l,e[5]+=d,e[6]+=s,e[7]+=f}digest(e){let o=0;for(;o+56<=e.length;){let i=0;for(;i<16&&o+3<e.length;i++)this._W[i]=e[o++]<<24|e[o++]<<16|e[o++]<<8|e[o++];if(o%64!==0){for(this._W.fill(0,i,16);o<e.length;)this._W[i]|=e[o]<<(3-o%4)*8,o++;this._W[i]|=128<<(3-o%4)*8}this._updateHash()}let n=o%64!==0;this._W.fill(0,0,16);let r=0;for(;o<e.length;r++)for(let i=3;i>=0&&o<e.length;i--)this._W[r]|=e[o++]<<i*8;n||(this._W[r-(o%4===0?0:1)]|=128<<(3-o%4)*8),this._W[14]=e.byteLength/536870912,this._W[15]=e.byteLength*8,this._updateHash();let c=new Uint8Array(32);for(let i=0;i<this._H.length;i++)for(let l=0;l<4;l++)c[i*4+l]=this._H[i]>>>(3-l)*8;return c}},pt=t=>new Pe().digest(t);var Wt=t=>{for(let o=6;o<t.length;o++)t[o%6]=t[o%6]^t[o];return t.slice(0,6)},gt=t=>Ge(Wt(pt(Qe(t))));var _t=()=>({mapping:new Map,isOMark:new Map}),H=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!tt(e.ds,t.id),Qt=[{light:"#ecd44433",dark:"#ecd444"}],en=(t,e,o)=>{if(!t.has(o)){if(t.size<e.length){let n=Je();t.forEach(r=>n.add(r)),e=e.filter(r=>!n.has(r))}t.set(o,Be(e))}return t.get(o)},Ae=(t,{colors:e=Qt,colorMapping:o=new Map,permanentUserData:n=null,onFirstRender:r=()=>{},mapping:c}={})=>{let i=!1,l=new ce(t,c),d=new Y({props:{editable:s=>{let f=h.getState(s);return f.snapshot==null&&f.prevSnapshot==null}},key:h,state:{init:(s,f)=>({type:t,doc:t.doc,binding:l,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:o,permanentUserData:n}),apply:(s,f)=>{let a=s.getMeta(h);if(a!==void 0){f=Object.assign({},f);for(let u in a)f[u]=a[u]}return f.addToHistory=s.getMeta("addToHistory")!==!1,f.isChangeOrigin=a!==void 0&&!!a.isChangeOrigin,f.isUndoRedoOperation=a!==void 0&&!!a.isChangeOrigin&&!!a.isUndoRedoOperation,l.prosemirrorView!==null&&a!==void 0&&(a.snapshot!=null||a.prevSnapshot!=null)&&z(0,()=>{l.prosemirrorView!=null&&(a.restore==null?l._renderSnapshot(a.snapshot,a.prevSnapshot,f):(l._renderSnapshot(a.snapshot,a.snapshot,f),delete f.restore,delete f.snapshot,delete f.prevSnapshot,l.mux(()=>{l._prosemirrorChanged(l.prosemirrorView.state.doc)})))}),f}},view:s=>(l.initView(s),c==null&&l._forceRerender(),r(),{update:()=>{let f=d.getState(s.state);if(f.snapshot==null&&f.prevSnapshot==null&&(i||s.state.doc.content.findDiffStart(s.state.doc.type.createAndFill().content)!==null)){if(i=!0,f.addToHistory===!1&&!f.isChangeOrigin){let a=b.getState(s.state),u=a&&a.undoManager;u&&u.stopCapturing()}l.mux(()=>{f.doc.transact(a=>{a.meta.set("addToHistory",f.addToHistory),l._prosemirrorChanged(s.state.doc)},h)})}},destroy:()=>{l.destroy()}})});return d},tn=(t,e,o)=>{if(e!==null&&e.anchor!==null&&e.head!==null)if(e.type==="all")t.setSelection(new Xe(t.doc));else if(e.type==="node"){let n=T(o.doc,o.type,e.anchor,o.mapping);t.setSelection(Ue.create(t.doc,n))}else{let n=T(o.doc,o.type,e.anchor,o.mapping),r=T(o.doc,o.type,e.head,o.mapping);if(n!==null&&r!==null){let c=he.between(t.doc.resolve(n),t.doc.resolve(r));t.setSelection(c)}}},J=(t,e)=>({type:e.selection.jsonID,anchor:v(e.selection.anchor,t.type,t.mapping),head:v(e.selection.head,t.type,t.mapping)}),ce=class{constructor(e,o=new Map){this.type=e,this.prosemirrorView=null,this.mux=mt(),this.mapping=o,this.isOMark=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&this.prosemirrorView!=null&&(this.beforeTransactionSelection=J(this,this.prosemirrorView.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(Ze&&this._domSelectionInView===null&&(z(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){let e=this.prosemirrorView._root.getSelection();if(e==null||e.anchorNode==null)return!1;let o=this.prosemirrorView._root.createRange();o.setStart(e.anchorNode,e.anchorOffset),o.setEnd(e.focusNode,e.focusOffset),o.getClientRects().length===0&&o.startContainer&&o.collapsed&&o.selectNodeContents(o.startContainer);let r=o.getBoundingClientRect(),c=et.documentElement;return r.bottom>=0&&r.right>=0&&r.left<=(window.innerWidth||c.clientWidth||0)&&r.top<=(window.innerHeight||c.clientHeight||0)}renderSnapshot(e,o){o||(o=ct(nt(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(h,{snapshot:e,prevSnapshot:o}))}unrenderSnapshot(){this.mapping.clear(),this.mux(()=>{let e=this.type.toArray().map(n=>U(n,this.prosemirrorView.state.schema,this)).filter(n=>n!==null),o=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new L(M.from(e),0,0));o.setMeta(h,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(o)})}_forceRerender(){this.mapping.clear(),this.mux(()=>{let e=this.beforeTransactionSelection!==null?null:this.prosemirrorView.state.selection,o=this.type.toArray().map(r=>U(r,this.prosemirrorView.state.schema,this)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new L(M.from(o),0,0));if(e){let r=w(D(e.anchor,0),n.doc.content.size),c=w(D(e.head,0),n.doc.content.size);n.setSelection(he.create(n.doc,r,c))}this.prosemirrorView.dispatch(n.setMeta(h,{isChangeOrigin:!0,binding:this}))})}_renderSnapshot(e,o,n){let r=this.doc,c=this.type;if(e||(e=re(this.doc)),e instanceof Uint8Array||o instanceof Uint8Array)if((!(e instanceof Uint8Array)||!(o instanceof Uint8Array))&&Q(),r=new ee({gc:!1}),be(r,o),o=re(r),be(r,e),e=re(r),c._item===null){let i=Array.from(this.doc.share.keys()).find(l=>this.doc.share.get(l)===this.type);c=r.getXmlFragment(i)}else{let i=r.store.clients.get(c._item.id.client)??[],l=at(i,c._item.id.clock);c=i[l].content.type}this.mapping.clear(),this.mux(()=>{r.transact(i=>{let l=n.permanentUserData;l&&l.dss.forEach(a=>{xe(i,a,u=>{})});let d=(a,u)=>{let m=a==="added"?l.getUserByClientId(u.client):l.getUserByDeletedId(u);return{user:m,type:a,color:en(n.colorMapping,n.colors,m)}},s=we(c,new Se(o.ds,e.sv)).map(a=>!a._item.deleted||H(a._item,e)||H(a._item,o)?U(a,this.prosemirrorView.state.schema,{mapping:new Map,isOMark:new Map},e,o,d):null).filter(a=>a!==null),f=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new L(M.from(s),0,0));this.prosemirrorView.dispatch(f.setMeta(h,{isChangeOrigin:!0}))},h)})}_typeChanged(e,o){if(this.prosemirrorView==null)return;let n=h.getState(this.prosemirrorView.state);if(e.length===0||n.snapshot!=null||n.prevSnapshot!=null){this.renderSnapshot(n.snapshot,n.prevSnapshot);return}this.mux(()=>{let r=(l,d)=>this.mapping.delete(d);xe(o,o.deleteSet,l=>{if(l.constructor===le){let d=l.content.type;d&&this.mapping.delete(d)}}),o.changed.forEach(r),o.changedParentTypes.forEach(r);let c=this.type.toArray().map(l=>St(l,this.prosemirrorView.state.schema,this)).filter(l=>l!==null),i=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new L(M.from(c),0,0));tn(i,this.beforeTransactionSelection,this),i=i.setMeta(h,{isChangeOrigin:!0,isUndoRedoOperation:o.origin instanceof ie}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&i.scrollIntoView(),this.prosemirrorView.dispatch(i)})}_prosemirrorChanged(e){this.doc.transact(()=>{X(this.doc,this.type,e,this),this.beforeTransactionSelection=J(this,this.prosemirrorView.state)},h)}initView(e){this.prosemirrorView!=null&&this.destroy(),this.prosemirrorView=e,this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),this.type.observeDeep(this._observeFunction)}destroy(){this.prosemirrorView!=null&&(this.prosemirrorView=null,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions))}},St=(t,e,o,n,r,c)=>{let i=o.mapping.get(t);if(i===void 0){if(t instanceof y)return U(t,e,o,n,r,c);throw We()}return i},U=(t,e,o,n,r,c)=>{let i=[],l=d=>{if(d instanceof y){let s=St(d,e,o,n,r,c);s!==null&&i.push(s)}else{let s=d._item.right?.content?.type;s instanceof se&&!s._item.deleted&&s._item.id.client===s.doc.clientID&&(d.applyDelta([{retain:d.length},...s.toDelta()]),s.doc.transact(a=>{s._item.delete(a)}));let f=nn(d,e,o,n,r,c);f!==null&&f.forEach(a=>{a!==null&&i.push(a)})}};n===void 0||r===void 0?t.toArray().forEach(l):we(t,new Se(r.ds,n.sv)).forEach(l);try{let d=t.getAttributes(n);n!==void 0&&(H(t._item,n)?H(t._item,r)||(d.ychange=c?c("added",t._item.id):{type:"added"}):d.ychange=c?c("removed",t._item.id):{type:"removed"});let s=e.node(t.nodeName,d,i);return o.mapping.set(t,s),s}catch{return t.doc.transact(s=>{t._item.delete(s)},h),o.mapping.delete(t),null}},nn=(t,e,o,n,r,c)=>{let i=[],l=t.toDelta(n,r,c);try{for(let d=0;d<l.length;d++){let s=l[d];i.push(e.text(s.insert,an(s.attributes,e)))}}catch{return t.doc.transact(s=>{t._item.delete(s)},h),null}return i},on=(t,e)=>{let o=new x,n=t.map(r=>({insert:r.text,attributes:Tt(r.marks,e)}));return o.applyDelta(n),e.mapping.set(o,t),o},rn=(t,e)=>{let o=new y(t.type.name);for(let n in t.attrs){let r=t.attrs[n];r!==null&&n!=="ychange"&&o.setAttribute(n,r)}return o.insert(0,de(t).map(n=>Ce(n,e))),e.mapping.set(o,t),o},Ce=(t,e)=>t instanceof Array?on(t,e):rn(t,e),yt=t=>typeof t=="object"&&t!==null,Me=(t,e)=>{let o=Object.keys(t).filter(r=>t[r]!==null),n=o.length===(e==null?0:Object.keys(e).filter(r=>e[r]!==null).length);for(let r=0;r<o.length&&n;r++){let c=o[r],i=t[c],l=e[c];n=c==="ychange"||i===l||yt(i)&&yt(l)&&Me(i,l)}return n},de=t=>{let e=t.content.content,o=[];for(let n=0;n<e.length;n++){let r=e[n];if(r.isText){let c=[];for(let i=e[n];n<e.length&&i.isText;i=e[++n])c.push(i);n--,o.push(c)}else o.push(r)}return o},wt=(t,e)=>{let o=t.toDelta();return o.length===e.length&&o.every((n,r)=>n.insert===e[r].text&&qe(n.attributes||{}).length===e[r].marks.length&&$e(n.attributes,(c,i)=>{let l=Oe(i),d=e[r].marks;return Me(c,d.find(s=>s.type.name===l)?.attrs)}))},W=(t,e)=>{if(t instanceof y&&!(e instanceof Array)&&Ye(t,e)){let o=de(e);return t._length===o.length&&Me(t.getAttributes(),e.attrs)&&t.toArray().every((n,r)=>W(n,o[r]))}return t instanceof x&&e instanceof Array&&wt(t,e)},ae=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((o,n)=>e[n]===o),xt=(t,e,o)=>{let n=t.toArray(),r=de(e),c=r.length,i=n.length,l=w(i,c),d=0,s=0,f=!1;for(;d<l;d++){let a=n[d],u=r[d];if(ae(o.mapping.get(a),u))f=!0;else if(!W(a,u))break}for(;d+s<l;s++){let a=n[i-s-1],u=r[c-s-1];if(ae(o.mapping.get(a),u))f=!0;else if(!W(a,u))break}return{equalityFactor:d+s,foundMappedChild:f}},sn=t=>{let e="",o=t._start,n={};for(;o!==null;)o.deleted||(o.countable&&o.content instanceof ft?e+=o.content.str:o.content instanceof dt&&(n[o.content.key]=null)),o=o.right;return{str:e,nAttrs:n}},ln=(t,e,o)=>{o.mapping.set(t,e);let{nAttrs:n,str:r}=sn(t),c=e.map(s=>({insert:s.text,attributes:Object.assign({},n,Tt(s.marks,o))})),{insert:i,remove:l,index:d}=ht(r,c.map(s=>s.insert).join(""));t.delete(d,l),t.insert(d,i),t.applyDelta(c.map(s=>({retain:s.insert.length,attributes:s.attributes})))},cn=/(.*)(--[a-zA-Z0-9+/=]{8})$/,Oe=t=>cn.exec(t)?.[1]??t,an=(t,e)=>{let o=[];for(let n in t)o.push(e.mark(Oe(n),t[n]));return o},Tt=(t,e)=>{let o={};return t.forEach(n=>{if(n.type.name!=="ychange"){let r=G(e.isOMark,n.type,()=>!n.type.excludes(n.type));o[r?`${n.type.name}--${gt(n.toJSON())}`:n.type.name]=n.attrs}}),o},X=(t,e,o,n)=>{if(e instanceof y&&e.nodeName!==o.type.name)throw new Error("node name mismatch!");if(n.mapping.set(e,o),e instanceof y){let a=e.getAttributes(),u=o.attrs;for(let m in u)u[m]!==null?a[m]!==u[m]&&m!=="ychange"&&e.setAttribute(m,u[m]):e.removeAttribute(m);for(let m in a)u[m]===void 0&&e.removeAttribute(m)}let r=de(o),c=r.length,i=e.toArray(),l=i.length,d=w(c,l),s=0,f=0;for(;s<d;s++){let a=i[s],u=r[s];if(!ae(n.mapping.get(a),u))if(W(a,u))n.mapping.set(a,u);else break}for(;f+s<d;f++){let a=i[l-f-1],u=r[c-f-1];if(!ae(n.mapping.get(a),u))if(W(a,u))n.mapping.set(a,u);else break}t.transact(()=>{for(;l-s-f>0&&c-s-f>0;){let u=i[s],m=r[s],V=i[l-f-1],K=r[c-f-1];if(u instanceof x&&m instanceof Array)wt(u,m)||ln(u,m,n),s+=1;else{let q=u instanceof y&&Ye(u,m),$=V instanceof y&&Ye(V,K);if(q&&$){let fe=xt(u,m,n),ue=xt(V,K,n);fe.foundMappedChild&&!ue.foundMappedChild?$=!1:!fe.foundMappedChild&&ue.foundMappedChild||fe.equalityFactor<ue.equalityFactor?q=!1:$=!1}q?(X(t,u,m,n),s+=1):$?(X(t,V,K,n),f+=1):(n.mapping.delete(e.get(s)),e.delete(s,1),e.insert(s,[Ce(m,n)]),s+=1)}}let a=l-s-f;if(l===1&&c===0&&i[0]instanceof x?(n.mapping.delete(i[0]),i[0].delete(0,i[0].length)):a>0&&(e.slice(s,s+a).forEach(u=>n.mapping.delete(u)),e.delete(s,a)),s+f<c){let u=[];for(let m=s;m<c-f;m++)u.push(Ce(r[m],n));e.insert(s,u)}},h)},Ye=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name;var B=null,dn=()=>{let t=B;B=null,t.forEach((e,o)=>{let n=o.state.tr,r=h.getState(o.state);r&&r.binding&&!r.binding.isDestroyed&&(e.forEach((c,i)=>{n.setMeta(i,c)}),o.dispatch(n))})},ve=(t,e,o)=>{B||(B=new Map,z(0,dn)),G(B,t,He).set(e,o)},v=(t,e,o)=>{if(t===0)return oe(e,0,e.length===0?-1:0);let n=e._first===null?null:e._first.content.type;for(;n!==null&&e!==n;){if(n instanceof x){if(n._length>=t)return oe(n,t,e.length===0?-1:0);if(t-=n._length,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{do n=n._item===null?null:n._item.parent,t--;while(n!==e&&n!==null&&n._item!==null&&n._item.next===null);n!==null&&n!==e&&(n=n._item===null?null:n._item.next.content.type)}}else{let r=(o.get(n)||{nodeSize:0}).nodeSize;if(n._first!==null&&t<r)n=n._first.content.type,t--;else{if(t===1&&n._length===0&&r>1)return new ne(n._item===null?null:n._item.id,n._item===null?te(n):null,null);if(t-=r,n._item!==null&&n._item.next!==null)n=n._item.next.content.type;else{if(t===0)return n=n._item===null?n:n._item.parent,new ne(n._item===null?null:n._item.id,n._item===null?te(n):null,null);do n=n._item.parent,t--;while(n!==e&&n._item.next===null);n!==e&&(n=n._item.next.content.type)}}}if(n===null)throw Q();if(t===0&&n.constructor!==x&&n!==e)return fn(n._item.parent,n._item)}return oe(e,e._length,e.length===0?-1:0)},fn=(t,e)=>{let o=null,n=null;return t._item===null?n=te(t):o=it(t._item.id.client,t._item.id.clock),new ne(o,n,e.id)},T=(t,e,o,n)=>{let r=lt(o,t);if(r===null||r.type!==e&&!st(e,r.type._item))return null;let c=r.type,i=0;if(c.constructor===x)i=r.index;else if(c._item===null||!c._item.deleted){let l=c._first,d=0;for(;d<c._length&&d<r.index&&l!==null;){if(!l.deleted){let s=l.content.type;d++,s instanceof x?i+=s._length:i+=n.get(s).nodeSize}l=l.right}i+=1}for(;c!==e&&c._item!==null;){let l=c._item.parent;if(l._item===null||!l._item.deleted){i+=1;let d=l._first;for(;d!==null;){let s=d.content.type;if(s===c)break;d.deleted||(s instanceof x?i+=s._length:i+=n.get(s).nodeSize),d=d.right}}c=l}return i-1},Pt=(t,e)=>{let o=t.toArray().map(n=>U(n,e,_t())).filter(n=>n!==null);return M.fromArray(o)},Ne=(t,e)=>e.topNodeType.create(null,Pt(t,e));function ke(t,e="prosemirror"){let o=new ee,n=o.get(e,Te);return n.doc?(Ct(t,n),n.doc):o}function Ct(t,e){let o=e||new Te,n=o.doc?o.doc:{transact:r=>r(void 0)};return X(n,o,t,{mapping:new Map,isOMark:new Map}),o}var un=(t,e,o)=>t!==e,mn=t=>{let e=document.createElement("span");e.classList.add("ProseMirror-yjs-cursor"),e.setAttribute("style",`border-color: ${t.color}`);let o=document.createElement("div");o.setAttribute("style",`background-color: ${t.color}`),o.insertBefore(document.createTextNode(t.name),null);let n=document.createTextNode("\u2060"),r=document.createTextNode("\u2060");return e.insertBefore(n,null),e.insertBefore(o,null),e.insertBefore(r,null),e},hn=t=>({style:`background-color: ${t.color}70`,class:"ProseMirror-yjs-selection"}),pn=/^#[0-9a-fA-F]{6}$/,Yt=(t,e,o,n,r)=>{let c=h.getState(t),i=c.doc,l=[];return c.snapshot!=null||c.prevSnapshot!=null||c.binding.mapping.size===0?ge.create(t.doc,[]):(e.getStates().forEach((d,s)=>{if(o(i.clientID,s,d)&&d.cursor!=null){let f=d.user||{};f.color==null?f.color="#ffa500":pn.test(f.color)||console.warn("A user uses an unsupported color format",f),f.name==null&&(f.name=`User: ${s}`);let a=T(i,c.type,E(d.cursor.anchor),c.binding.mapping),u=T(i,c.type,E(d.cursor.head),c.binding.mapping);if(a!==null&&u!==null){let m=D(t.doc.content.size-1,0);a=w(a,m),u=w(u,m),l.push(pe.widget(u,()=>n(f,s),{key:s+"",side:10}));let V=w(a,u),K=D(a,u);l.push(pe.inline(V,K,r(f,s),{inclusiveEnd:!0,inclusiveStart:!1}))}}}),ge.create(t.doc,l))},At=(t,{awarenessStateFilter:e=un,cursorBuilder:o=mn,selectionBuilder:n=hn,getSelection:r=i=>i.selection}={},c="cursor")=>new Y({key:O,state:{init(i,l){return Yt(l,t,e,o,n)},apply(i,l,d,s){let f=h.getState(s),a=i.getMeta(O);return f&&f.isChangeOrigin||a&&a.awarenessUpdated?Yt(s,t,e,o,n):l.map(i.mapping,i.doc)}},props:{decorations:i=>O.getState(i)},view:i=>{let l=()=>{i.docView&&ve(i,O,{awarenessUpdated:!0})},d=()=>{let s=h.getState(i.state),f=t.getLocalState()||{};if(i.hasFocus()){let a=r(i.state),u=v(a.anchor,s.type,s.binding.mapping),m=v(a.head,s.type,s.binding.mapping);(f.cursor==null||!_e(E(f.cursor.anchor),u)||!_e(E(f.cursor.head),m))&&t.setLocalStateField(c,{anchor:u,head:m})}else f.cursor!=null&&T(s.doc,s.type,E(f.cursor.anchor),s.binding.mapping)!==null&&t.setLocalStateField(c,null)};return t.on("change",l),i.dom.addEventListener("focusin",d),i.dom.addEventListener("focusout",d),{update:d,destroy:()=>{i.dom.removeEventListener("focusin",d),i.dom.removeEventListener("focusout",d),t.off("change",l),t.setLocalStateField(c,null)}}}});var Mt=t=>b.getState(t)?.undoManager?.undo()!=null,Ve=t=>b.getState(t)?.undoManager?.redo()!=null;var gn=new Set(["paragraph"]),yn=(t,e)=>!(t instanceof le)||!(t.content instanceof ut)||!(t.content.type instanceof se||t.content.type instanceof y&&e.has(t.content.type.nodeName))||t.content.type._length===0,Ot=({protectedNodes:t=gn,trackedOrigins:e=[],undoManager:o=null}={})=>new Y({key:b,state:{init:(n,r)=>{let c=h.getState(r),i=o||new ie(c.type,{trackedOrigins:new Set([h].concat(e)),deleteFilter:l=>yn(l,t),captureTransaction:l=>l.meta.get("addToHistory")!==!1});return{undoManager:i,prevSel:null,hasUndoOps:i.undoStack.length>0,hasRedoOps:i.redoStack.length>0}},apply:(n,r,c,i)=>{let l=h.getState(i).binding,d=r.undoManager,s=d.undoStack.length>0,f=d.redoStack.length>0;return l?{undoManager:d,prevSel:J(l,c),hasUndoOps:s,hasRedoOps:f}:s!==r.hasUndoOps||f!==r.hasRedoOps?Object.assign({},r,{hasUndoOps:d.undoStack.length>0,hasRedoOps:d.redoStack.length>0}):r}},view:n=>{let r=h.getState(n.state),c=b.getState(n.state).undoManager;return c.on("stack-item-added",({stackItem:i})=>{let l=r.binding;l&&i.meta.set(l,b.getState(n.state).prevSel)}),c.on("stack-item-popped",({stackItem:i})=>{let l=r.binding;l&&(l.beforeTransactionSelection=i.meta.get(l)||l.beforeTransactionSelection)}),{destroy:()=>{c.destroy()}}}});var kt=new F("MILKDOWN_COLLAB_KEYMAP"),xn=[kt,h,O,b],N,S,I,g,k,P,Rt,Ft,Fe,Nt,Vt=(Nt=class{constructor(){A(this,P);A(this,N,{});A(this,S,null);A(this,I,null);A(this,g,null);A(this,k,!1)}bindCtx(t){return C(this,g,t),this}bindDoc(t){return C(this,S,t.getXmlFragment("prosemirror")),this}bindXmlFragment(t){return C(this,S,t),this}setOptions(t){return C(this,N,t),this}mergeOptions(t){return Object.assign(p(this,N),t),this}setAwareness(t){return C(this,I,t),this}applyTemplate(t,e){if(!p(this,g))throw R();if(!p(this,S))throw me();let o=e||(i=>i.textContent.length===0),n=j(this,P,Rt).call(this,t),r=p(this,g).get(ye),c=Ne(p(this,S),r);if(n&&o(c,n)){let i=p(this,S);i.delete(0,i.length);let l=ke(n),d=rt(l);i.doc&&ot(i.doc,d),l.destroy()}return this}connect(){if(!p(this,g))throw R();if(p(this,k))return;let t=p(this,g).get(Z),e=j(this,P,Ft).call(this),o=t.concat(e);return j(this,P,Fe).call(this,o),C(this,k,!0),this}disconnect(){if(!p(this,g))throw R();if(!p(this,k))return this;let t=p(this,g).get(Z).filter(e=>!e.spec.key||!xn.includes(e.spec.key));return j(this,P,Fe).call(this,t),C(this,k,!1),this}},N=new WeakMap,S=new WeakMap,I=new WeakMap,g=new WeakMap,k=new WeakMap,P=new WeakSet,Rt=function(t){if(!p(this,g))throw R();let e=p(this,g).get(ye),o=p(this,g).get(je);return Le(t,o,e)},Ft=function(){if(!p(this,S))throw me();let{ySyncOpts:t,yUndoOpts:e}=p(this,N),o=[Ae(p(this,S),t),Ot(e),new Y({key:kt,props:{handleKeyDown:Ie({"Mod-z":Mt,"Mod-y":Ve,"Mod-Shift-z":Ve})}})];if(p(this,I)){let{yCursorOpts:n,yCursorStateField:r}=p(this,N);o.push(At(p(this,I),n,r))}return o},Fe=function(t){if(!p(this,g))throw R();p(this,g).set(Z,t);let e=p(this,g).get(Ke),o=e.state.reconfigure({plugins:t});e.updateState(o)},Nt),vt=De(new Vt,"collabServiceCtx"),Re=Ee("CollabReady"),bn=t=>{let e=new Vt;return t.inject(vt,e).record(Re),async()=>(await t.wait(ze),e.bindCtx(t),t.done(Re),()=>{t.remove(vt).clearTimer(Re)})};bn.meta={package:"@milkdown/plugin-collab",displayName:"Collab"};export{kt as CollabKeymapPluginKey,Re as CollabReady,Vt as CollabService,bn as collab,vt as collabServiceCtx};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-SZCOI4YV.js";import"./chunk-K2ROPYIW.js";import"./chunk-XNCXGIZE.js";import"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import"./chunk-23NN352E.js";export{a as ListenerManager,c as key,d as listener,b as listenerCtx};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-23NN352E.js";async function le({root:e,value:o="",onChange:t,collaborative:r=!1,room:s="baseui-markdown",password:i,signaling:m,user:w}={}){if(!e)throw new Error("BaseUI markdown editor: missing root element.");let[C,M,T,U,D,F,I,N,W,x,K,O,R,_]=await Promise.all([import("./core-
|
|
1
|
+
import"./chunk-23NN352E.js";async function le({root:e,value:o="",onChange:t,collaborative:r=!1,room:s="baseui-markdown",password:i,signaling:m,user:w}={}){if(!e)throw new Error("BaseUI markdown editor: missing root element.");let[C,M,T,U,D,F,I,N,W,x,K,O,R,_]=await Promise.all([import("./core-T2SC7EXQ.js"),import("./commonmark-263P63KC.js"),import("./gfm-IHXC5DQO.js"),import("./history-VOPZ3HXQ.js"),import("./clipboard-5NOA4E34.js"),import("./cursor-Z4UWEH5V.js"),import("./indent-WYLZY3CZ.js"),import("./upload-DA4OHNVQ.js"),import("./block-G2R773CV.js"),import("./tooltip-5CTXOYIA.js"),import("./slash-3TY5YM2E.js"),import("./streaming-S7JA52O3.js"),import("./diff-K3BORLOX.js"),import("./listener-GNT2L5RH.js")]),{Editor:j,defaultValueCtx:L,rootCtx:V}=C,{commonmark:q}=M,{gfm:z}=T,{history:G}=U,{clipboard:H}=D,{cursor:J}=F,{indent:Q}=I,{upload:X}=N,{block:Y,BlockProvider:h}=W,{tooltipFactory:Z,TooltipProvider:$}=x,{slashFactory:ee,SlashProvider:te}=K,{streaming:oe}=O,{diff:re}=R,{listener:ne,listenerCtx:se}=_,v=Z("BASEUI_MARKDOWN"),S=ee("BASEUI_MARKDOWN"),a=[],c=j.make().config(n=>{n.set(V,e),n.set(L,String(o??"")),n.set(v.key,ae(e,$)),n.set(S.key,ce(e,te)),n.get(se).markdownUpdated((f,l,d)=>{l!==d&&t?.(l,d,f)})}).use(q).use(z).use(H).use(J).use(Q).use(X).use(Y).use(v).use(S).use(oe).use(re).use(ne);if(r){let[{Doc:n},{WebrtcProvider:f},l]=await Promise.all([import("./yjs-H3MVN7TP.js"),import("./y-webrtc-VQGJXSXG.js"),import("./lib-QZEOHNSS.js")]),{collab:d,collabServiceCtx:ie}=l,u=new n,g={};i&&(g.password=i),Array.isArray(m)&&m.length&&(g.signaling=m);let p=new f(s,u,g),P=w&&typeof w=="object"?w:{};p.awareness?.setLocalStateField("user",{name:P.name||"Anonymous",color:P.color||"#2563eb",...P}),c.use(d),a.push(()=>p.destroy?.(),()=>u.destroy());let b=await c.create();return b.action(A=>{E(A,e,h,a),A.get(ie).bindDoc(u).setAwareness(p.awareness).applyTemplate(String(o??"")).connect()}),{editor:b,provider:p,doc:u,destroy:()=>B(b,a)}}c.use(G);let y=await c.create();return y.action(n=>E(n,e,h,a)),{editor:y,provider:null,doc:null,destroy:()=>B(y,a)}}function k(e,o=""){let t=document.createElement("div");return t.className=e,t.textContent=o,t.setAttribute("aria-hidden","true"),t}function ae(e,o){return{view:t=>{let r=new o({root:e,content:k("baseui-markdown-editor-tooltip","Markdown tools")});return r.update(t),{update:(s,i)=>r.update(s,i),destroy:()=>r.destroy()}}}}function ce(e,o){return{view:t=>{let r=new o({root:e,content:k("baseui-markdown-editor-slash","Type Markdown syntax")});return r.update(t),{update:(s,i)=>r.update(s,i),destroy:()=>r.destroy()}}}}function E(e,o,t,r){let s=new t({ctx:e,root:o,content:k("baseui-markdown-editor-block-handle","::")});s.update(),r.push(()=>s.destroy())}function B(e,o){for(let t of o)t();e.destroy()}export{le as createMilkdownMarkdownEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-23NN352E.js";var
|
|
1
|
+
import"./chunk-23NN352E.js";var R;function ee(){return R??(R=new Promise((n,e)=>{if(document.getElementById("baseui-text-editor-crepe-theme")){n();return}let r=document.createElement("link");r.id="baseui-text-editor-crepe-theme",r.rel="stylesheet",r.href=new URL("./theme/common/style.css",import.meta.url).href,r.addEventListener("load",()=>n()),r.addEventListener("error",()=>e(new Error("BaseUI text editor: failed to load Crepe theme CSS."))),document.head.append(r)})),R}async function ie({root:n,value:e="",onChange:r,collaborative:t=!1,providerType:o="webrtc",room:a="baseui-text-editor",url:i,password:c,signaling:d,user:f,placeholder:m}={}){if(!n)throw new Error("BaseUI text editor: missing root element.");let[{Crepe:h},j,x,H,T,F]=await Promise.all([import("./esm-H2D66MX5.js"),import("./core-T2SC7EXQ.js"),import("./utils-H6AH4ARX.js"),import("./diff-K3BORLOX.js"),import("./streaming-S7JA52O3.js"),import("./lib-32AGHSKT.js"),ee()]),{editorViewCtx:k,schemaCtx:D}=j,{getHTML:p}=x,{diff:U,diffPluginKey:B,getPendingChanges:I,startDiffReviewCmd:z,startDiffReviewFromDocCmd:K,acceptAllDiffsCmd:O,acceptDiffChunkCmd:V,acceptDiffRangeCmd:W,rejectDiffChunkCmd:q,rejectDiffRangeCmd:N,clearDiffReviewCmd:G}=H,{streaming:J,startStreamingCmd:Q,pushChunkCmd:X,endStreamingCmd:Y,abortStreamingCmd:Z}=T,{emoji:_}=F,{callCommand:L}=x;n.replaceChildren();let b=document.createElement("div");b.className="baseui-text-editor-surface",n.append(b);let s=new h({root:b,defaultValue:t?"":{type:"html",dom:y(e)},features:{[h.Feature.Latex]:!1,[h.Feature.AI]:!1},featureConfigs:m?{[h.Feature.Placeholder]:{text:m}}:{}});s.editor.use(U).use(J).use(_);let C="";s.on(S=>{S.updated(w=>{let g=p()(w);if(g!==C){let v=C;C=g,r?.(g,v,w)}})});let A={callCommand:L,editorViewCtx:k,schemaCtx:D,diffPluginKey:B,getPendingChanges:I,startDiffReviewCmd:z,startDiffReviewFromDocCmd:K,acceptAllDiffsCmd:O,acceptDiffChunkCmd:V,acceptDiffRangeCmd:W,rejectDiffChunkCmd:q,rejectDiffRangeCmd:N,clearDiffReviewCmd:G},E={callCommand:L,startStreamingCmd:Q,pushChunkCmd:X,endStreamingCmd:Y,abortStreamingCmd:Z},P=[],l=null,u=null;if(t){let[{Doc:S},w]=await Promise.all([import("./yjs-H3MVN7TP.js"),import("./lib-QZEOHNSS.js")]),{collab:g,collabServiceCtx:v}=w;return u=new S,l=await oe({providerType:o,ydoc:u,room:a,url:i,password:c,signaling:d}),l.awareness?.setLocalStateField("user",ae(f)),s.editor.use(g),P.push(()=>l.destroy?.(),()=>u.destroy()),await s.create(),s.editor.action($=>{$.get(v).bindDoc(u).setAwareness(l.awareness).applyTemplate({type:"html",dom:y(e)}).connect()}),C=s.editor.action(p()),M(s,A,E,P,n,l,u,k,p,D)}return await s.create(),C=s.editor.action(p()),M(s,A,E,P,n,l,u,k,p,D)}function y(n){let e=document.createElement("div");return e.innerHTML=String(n||"").trim()||"<p></p>",e}function M(n,e,r,t,o,a,i,c,d,f){return{editor:n.editor,provider:a,doc:i,focus:()=>n.editor.action(m=>m.get(c).focus()),getHTML:()=>n.editor.action(d()),setHTML:m=>te(n.editor,m,c,f),diff:ne(n.editor,e),streaming:re(n.editor,r),destroy:()=>{for(let m of t)m();n.destroy(),o.replaceChildren()}}}async function te(n,e,r,t){let{DOMParser:o,Slice:a}=await import("./model-VKXPTJEQ.js");n.action(i=>{let c=i.get(t),d=i.get(r),f=o.fromSchema(c).parse(y(e));d.dispatch(d.state.tr.replace(0,d.state.doc.content.size,new a(f.content,0,0)))})}function ne(n,e){let r=(t,o)=>n.action(e.callCommand(t,o));return{startFromMarkdown:t=>r(e.startDiffReviewCmd.key,t),startFromHTML:async t=>{let{DOMParser:o}=await import("./model-VKXPTJEQ.js"),a=n.action(i=>o.fromSchema(i.get(e.schemaCtx)).parse(y(t)));return r(e.startDiffReviewFromDocCmd.key,a)},acceptAll:()=>r(e.acceptAllDiffsCmd.key),acceptChunk:t=>r(e.acceptDiffChunkCmd.key,t),rejectChunk:t=>r(e.rejectDiffChunkCmd.key,t),acceptRange:t=>r(e.acceptDiffRangeCmd.key,t),rejectRange:t=>r(e.rejectDiffRangeCmd.key,t),clear:()=>r(e.clearDiffReviewCmd.key),getPendingChanges:()=>n.action(t=>{let o=e.diffPluginKey.getState(t.get(e.editorViewCtx).state);return o?e.getPendingChanges(o):[]})}}function re(n,e){let r=(t,o)=>n.action(e.callCommand(t,o));return{start:t=>r(e.startStreamingCmd.key,t),pushChunk:t=>r(e.pushChunkCmd.key,t),end:t=>r(e.endStreamingCmd.key,t),abort:()=>r(e.abortStreamingCmd.key)}}async function oe({providerType:n,ydoc:e,room:r,url:t,password:o,signaling:a}){if(n==="websocket"){if(!t)throw new Error("BaseUI text editor: collaborative websocket mode requires a `url`.");let{WebsocketProvider:d}=await import("./y-websocket-YOL5ECIU.js");return new d(t,r,e)}let{WebrtcProvider:i}=await import("./y-webrtc-VQGJXSXG.js"),c={};return o&&(c.password=o),Array.isArray(a)&&a.length&&(c.signaling=a),new i(r,e,c)}function ae(n){let e=n&&typeof n=="object"?n:{};return{name:e.name||"Anonymous",color:e.color||"#2563eb",...e}}export{ie as createMilkdownTextEditor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-
|
|
1
|
+
import"./chunk-IPNUYGNC.js";import{a,b,c,d,e,f,g,h,i,j,k,l,m}from"./chunk-OQJVATGH.js";import"./chunk-23NN352E.js";export{h as ContentMatch,l as DOMParser,m as DOMSerializer,a as Fragment,b as Mark,j as MarkType,g as Node,f as NodeRange,i as NodeType,c as ReplaceError,e as ResolvedPos,k as Schema,d as Slice};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-TEMVRH7B.js";import"./chunk-23NN352E.js";var n=e({start:[{regex:/(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/,token:"number"},{regex:/"(?:[^\\"]|\\.)*"?/,token:"string"},{regex:/'(?:[^\\']|\\.)*'?/,token:"string"},{regex:/`(?:[^\\`]|\\.)*`?/,token:"string"},{regex:/^\s*(?:\!(addincludedir|addplugindir|appendfile|appendmemfile|assert|cd|define|delfile|echo|error|execute|finalize|getdllversion|gettlbversion|include|insertmacro|macro|macroend|macroundef|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|uninstfinalize|verbose|warning))\b/i,token:"keyword"},{regex:/^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/i,token:"keyword",indent:!0},{regex:/^\s*(?:\!(else|endif|macroend))\b/i,token:"keyword",dedent:!0},{regex:/^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetKnownFolderPath|GetLabelAddress|GetRegView|GetShellVarContext|GetTempFileName|GetWinVer|Goto|HideWindow|Icon|IfAbort|IfAltRegView|IfErrors|IfFileExists|IfRebootFlag|IfRtlLanguage|IfShellVarContextAll|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadAndSetImage|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestAppendCustomString|ManifestDisableWindowFiltering|ManifestDPIAware|ManifestDPIAwareness|ManifestGdiScaling|ManifestLongPathAware|ManifestMaxVersionTested|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEAddResource|PEDllCharacteristics|PERemoveResource|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadMemory|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionInstType|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressionLevel|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Target|Unicode|UnsafeStrCpy|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/i,token:"keyword"},{regex:/^\s*(?:Function|PageEx|Section(?:Group)?)\b/i,token:"keyword",indent:!0},{regex:/^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/i,token:"keyword",dedent:!0},{regex:/\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOW|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/i,token:"atom"},{regex:/\b(?:admin|all|amd64-unicode|auto|both|bottom|bzip2|components|current|custom|default|directory|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|Win8\.1|WinVista|x86-(ansi|unicode)|zlib)\b/i,token:"builtin"},{regex:/\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:2|3|4|5|Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/i,token:"variable-2",indent:!0},{regex:/\$\{(?:BannerTrimPath|DirState|DriveSpace|Get(BaseName|Drives|ExeName|ExePath|FileAttributes|FileExt|FileName|FileVersion|Options|OptionsS|Parameters|Parent|Root|Size|Time)|Locate|RefreshShellIcons)\}/i,token:"variable-2",dedent:!0},{regex:/\$\{(?:Memento(?:Section(?:Done|End|Restore|Save)?|UnselectedSection))\}/i,token:"variable-2",dedent:!0},{regex:/\$\{(?:Config(?:Read|ReadS|Write|WriteS)|File(?:Join|ReadFromEnd|Recode)|Line(?:Find|Read|Sum)|Text(?:Compare|CompareS)|TrimNewLines)\}/i,token:"variable-2",dedent:!0},{regex:/\$\{(?:(?:At(?:Least|Most)|Is)(?:ServicePack|Win(?:7|8|8\.1|10|11|95|98|200(?:0|3|8(?:R2)?)|ME|NT4|Vista|XP))|Is(?:NT|Server))\}/i,token:"variable",dedent:!0},{regex:/\$\{(?:StrFilterS?|Version(?:Compare|Convert)|Word(?:AddS?|Find(?:(?:2|3)X)?S?|InsertS?|ReplaceS?))\}/i,token:"keyword",dedent:!0},{regex:/\$\{(?:RunningX64)\}/i,token:"variable",dedent:!0},{regex:/\$\{(?:Disable|Enable)X64FSRedirection\}/i,token:"keyword",dedent:!0},{regex:/(#|;).*/,token:"comment"},{regex:/\/\*/,token:"comment",next:"comment"},{regex:/[-+\/*=<>!]+/,token:"operator"},{regex:/\$\w[\w\.]*/,token:"variable"},{regex:/\${[\!\w\.:-]+}/,token:"variableName.constant"},{regex:/\$\([\!\w\.:-]+\)/,token:"atom"}],comment:[{regex:/.*?\*\//,token:"comment",next:"start"},{regex:/.*/,token:"comment"}],languageData:{name:"nsis",indentOnInput:/^\s*((Function|PageEx|Section|Section(Group)?)End|(\!(endif|macroend))|\$\{(End(If|Unless|While)|Loop(Until)|Next)\})$/i,commentTokens:{line:"#",block:{open:"/*",close:"*/"}}}});export{n as nsis};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-KP5VFDTE.js";import"./chunk-23NN352E.js";var f={"{":"}","(":")","[":"]"};function p(i){if(typeof i!="object")return i;let n={};for(let t in i){let r=i[t];n[t]=r instanceof Array?r.slice():r}return n}var u=class i{constructor(n){this.indentUnit=n,this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=e.startState(n),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken=""}copy(){var n=new i(this.indentUnit);return n.javaScriptLine=this.javaScriptLine,n.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,n.javaScriptArguments=this.javaScriptArguments,n.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,n.isInterpolating=this.isInterpolating,n.interpolationNesting=this.interpolationNesting,n.jsState=(e.copyState||p)(this.jsState),n.restOfLine=this.restOfLine,n.isIncludeFiltered=this.isIncludeFiltered,n.isEach=this.isEach,n.lastTag=this.lastTag,n.isAttrs=this.isAttrs,n.attrsNest=this.attrsNest.slice(),n.inAttributeName=this.inAttributeName,n.attributeIsType=this.attributeIsType,n.attrValue=this.attrValue,n.indentOf=this.indentOf,n.indentToken=this.indentToken,n}};function h(i,n){if(i.sol()&&(n.javaScriptLine=!1,n.javaScriptLineExcludesColon=!1),n.javaScriptLine){if(n.javaScriptLineExcludesColon&&i.peek()===":"){n.javaScriptLine=!1,n.javaScriptLineExcludesColon=!1;return}var t=e.token(i,n.jsState);return i.eol()&&(n.javaScriptLine=!1),t||!0}}function d(i,n){if(n.javaScriptArguments){if(n.javaScriptArgumentsDepth===0&&i.peek()!=="("){n.javaScriptArguments=!1;return}if(i.peek()==="("?n.javaScriptArgumentsDepth++:i.peek()===")"&&n.javaScriptArgumentsDepth--,n.javaScriptArgumentsDepth===0){n.javaScriptArguments=!1;return}var t=e.token(i,n.jsState);return t||!0}}function s(i){if(i.match(/^yield\b/))return"keyword"}function S(i){if(i.match(/^(?:doctype) *([^\n]+)?/))return"meta"}function o(i,n){if(i.match("#{"))return n.isInterpolating=!0,n.interpolationNesting=0,"punctuation"}function v(i,n){if(n.isInterpolating){if(i.peek()==="}"){if(n.interpolationNesting--,n.interpolationNesting<0)return i.next(),n.isInterpolating=!1,"punctuation"}else i.peek()==="{"&&n.interpolationNesting++;return e.token(i,n.jsState)||!0}}function g(i,n){if(i.match(/^case\b/))return n.javaScriptLine=!0,"keyword"}function j(i,n){if(i.match(/^when\b/))return n.javaScriptLine=!0,n.javaScriptLineExcludesColon=!0,"keyword"}function k(i){if(i.match(/^default\b/))return"keyword"}function b(i,n){if(i.match(/^extends?\b/))return n.restOfLine="string","keyword"}function A(i,n){if(i.match(/^append\b/))return n.restOfLine="variable","keyword"}function y(i,n){if(i.match(/^prepend\b/))return n.restOfLine="variable","keyword"}function L(i,n){if(i.match(/^block\b *(?:(prepend|append)\b)?/))return n.restOfLine="variable","keyword"}function w(i,n){if(i.match(/^include\b/))return n.restOfLine="string","keyword"}function N(i,n){if(i.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&i.match("include"))return n.isIncludeFiltered=!0,"keyword"}function x(i,n){if(n.isIncludeFiltered){var t=l(i,n);return n.isIncludeFiltered=!1,n.restOfLine="string",t}}function T(i,n){if(i.match(/^mixin\b/))return n.javaScriptLine=!0,"keyword"}function I(i,n){if(i.match(/^\+([-\w]+)/))return i.match(/^\( *[-\w]+ *=/,!1)||(n.javaScriptArguments=!0,n.javaScriptArgumentsDepth=0),"variable";if(i.match("+#{",!1))return i.next(),n.mixinCallAfter=!0,o(i,n)}function O(i,n){if(n.mixinCallAfter)return n.mixinCallAfter=!1,i.match(/^\( *[-\w]+ *=/,!1)||(n.javaScriptArguments=!0,n.javaScriptArgumentsDepth=0),!0}function C(i,n){if(i.match(/^(if|unless|else if|else)\b/))return n.javaScriptLine=!0,"keyword"}function E(i,n){if(i.match(/^(- *)?(each|for)\b/))return n.isEach=!0,"keyword"}function D(i,n){if(n.isEach){if(i.match(/^ in\b/))return n.javaScriptLine=!0,n.isEach=!1,"keyword";if(i.sol()||i.eol())n.isEach=!1;else if(i.next()){for(;!i.match(/^ in\b/,!1)&&i.next(););return"variable"}}}function F(i,n){if(i.match(/^while\b/))return n.javaScriptLine=!0,"keyword"}function m(i,n){var t;if(t=i.match(/^(\w(?:[-:\w]*\w)?)\/?/))return n.lastTag=t[1].toLowerCase(),"tag"}function l(i,n){if(i.match(/^:([\w\-]+)/))return c(i,n),"atom"}function V(i,n){if(i.match(/^(!?=|-)/))return n.javaScriptLine=!0,"punctuation"}function U(i){if(i.match(/^#([\w-]+)/))return"builtin"}function z(i){if(i.match(/^\.([\w-]+)/))return"className"}function B(i,n){if(i.peek()=="(")return i.next(),n.isAttrs=!0,n.attrsNest=[],n.inAttributeName=!0,n.attrValue="",n.attributeIsType=!1,"punctuation"}function a(i,n){if(n.isAttrs){if(f[i.peek()]&&n.attrsNest.push(f[i.peek()]),n.attrsNest[n.attrsNest.length-1]===i.peek())n.attrsNest.pop();else if(i.eat(")"))return n.isAttrs=!1,"punctuation";if(n.inAttributeName&&i.match(/^[^=,\)!]+/))return(i.peek()==="="||i.peek()==="!")&&(n.inAttributeName=!1,n.jsState=e.startState(2),n.lastTag==="script"&&i.current().trim().toLowerCase()==="type"?n.attributeIsType=!0:n.attributeIsType=!1),"attribute";var t=e.token(i,n.jsState);if(n.attrsNest.length===0&&(t==="string"||t==="variable"||t==="keyword"))try{return Function("","var x "+n.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),n.inAttributeName=!0,n.attrValue="",i.backUp(i.current().length),a(i,n)}catch{}return n.attrValue+=i.current(),t||!0}}function M(i,n){if(i.match(/^&attributes\b/))return n.javaScriptArguments=!0,n.javaScriptArgumentsDepth=0,"keyword"}function R(i){if(i.sol()&&i.eatSpace())return"indent"}function Z(i,n){if(i.match(/^ *\/\/(-)?([^\n]*)/))return n.indentOf=i.indentation(),n.indentToken="comment","comment"}function $(i){if(i.match(/^: */))return"colon"}function q(i,n){if(i.match(/^(?:\| ?| )([^\n]+)/))return"string";if(i.match(/^(<[^\n]*)/,!1))return c(i,n),i.skipToEnd(),n.indentToken}function G(i,n){if(i.eat("."))return c(i,n),"dot"}function H(i){return i.next(),null}function c(i,n){n.indentOf=i.indentation(),n.indentToken="string"}function J(i,n){if(i.sol()&&(n.restOfLine=""),n.restOfLine){i.skipToEnd();var t=n.restOfLine;return n.restOfLine="",t}}function K(i){return new u(i)}function P(i){return i.copy()}function Q(i,n){var t=J(i,n)||v(i,n)||x(i,n)||D(i,n)||a(i,n)||h(i,n)||d(i,n)||O(i,n)||s(i)||S(i)||o(i,n)||g(i,n)||j(i,n)||k(i)||b(i,n)||A(i,n)||y(i,n)||L(i,n)||w(i,n)||N(i,n)||T(i,n)||I(i,n)||C(i,n)||E(i,n)||F(i,n)||m(i,n)||l(i,n)||V(i,n)||U(i)||z(i)||B(i,n)||M(i,n)||R(i)||q(i,n)||Z(i,n)||$(i)||G(i,n)||H(i);return t===!0?null:t}var X={startState:K,copyState:P,token:Q};export{X as pug};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-ZIYJY6SA.js";import"./chunk-MAWHENWJ.js";import"./chunk-K2ROPYIW.js";import"./chunk-R43NMSZO.js";import"./chunk-XNCXGIZE.js";import"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import"./chunk-23NN352E.js";export{b as SlashProvider,a as slashFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-
|
|
1
|
+
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-TOUPIB5N.js";import"./chunk-ZGHJJLEG.js";import"./chunk-R43NMSZO.js";import"./chunk-XNCXGIZE.js";import"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import"./chunk-23NN352E.js";export{i as abortStreamingCmd,d as applyStreamingAction,b as defaultInsertStrategy,h as endStreamingCmd,g as pushChunkCmd,f as startStreamingCmd,j as streaming,a as streamingConfig,e as streamingPlugin,c as streamingPluginKey};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-VFZ7ST3H.js";import"./chunk-MAWHENWJ.js";import"./chunk-K2ROPYIW.js";import"./chunk-R43NMSZO.js";import"./chunk-XNCXGIZE.js";import"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import"./chunk-23NN352E.js";export{a as TooltipProvider,b as tooltipFactory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d,e}from"./chunk-7GZI2HGN.js";import"./chunk-R43NMSZO.js";import"./chunk-XNCXGIZE.js";import"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import"./chunk-23NN352E.js";export{b as defaultUploader,a as readImageAsBase64,e as upload,c as uploadConfig,d as uploadPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-2FDN6WYA.js";import{A,B,C,D,E,F,G,H,I,J,K,L,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-R43NMSZO.js";import"./chunk-XNCXGIZE.js";import"./chunk-OQJVATGH.js";import"./chunk-ILE44FN6.js";import"./chunk-23NN352E.js";export{d as $command,e as $commandAsync,t as $ctx,f as $inputRule,g as $inputRuleAsync,j as $mark,k as $markAsync,y as $markAttr,v as $markSchema,l as $node,m as $nodeAsync,x as $nodeAttr,u as $nodeSchema,h as $pasteRule,i as $pasteRuleAsync,n as $prose,o as $proseAsync,z as $remark,p as $shortcut,q as $shortcutAsync,w as $useKeymap,r as $view,s as $viewAsync,c as addTimer,A as callCommand,B as forceUpdate,C as getHTML,D as getMarkdown,E as insert,J as insertPos,I as markdownToSlice,a as nanoid,F as outline,L as pipe,G as replaceAll,K as replaceRange,H as setAttr,b as upsertById};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as vt,b as Et,c as Ct,d as St,e as Tt,f as ze,g as At,h as kt,i as Ot}from"./chunk-CFWAU3WN.js";import{a as Rt}from"./chunk-BJC3HW5B.js";import{a as Lt,b as Ge,c as xe,d as xt}from"./chunk-Y4CBBIL4.js";import{$ as wt,A as Pe,B as pt,C as gt,E as yt,F as Me,G as mt,H as Le,S as bt,T as _t,X as oe,Y as we,Z as He,_ as Ye,b as Ie,d as ot,e as at,f as ct,g as ut,h as lt,k as We,l as Q,n as te,o as Ve,p as re,q as Ae,r as de,s as ht,t as Ue,w as ke,x as Oe,y as dt,z as ft}from"./chunk-VJBGANAS.js";import{a as Te,b as Ht,d as Yt}from"./chunk-23NN352E.js";var Dt=Ht((Nt,$e)=>{(function(O){if(typeof Nt=="object"&&typeof $e<"u")$e.exports=O();else if(typeof define=="function"&&define.amd)define([],O);else{var D;D=typeof window>"u"?typeof global>"u"?typeof self>"u"?this:self:global:window,D.SimplePeer=O()}})(function(){var O=Math.floor,D=Math.abs,I=Math.pow;return(function(){function E(A,p,s){function w(l,d){if(!p[l]){if(!A[l]){var o=typeof Te=="function"&&Te;if(!d&&o)return o(l,!0);if(k)return k(l,!0);var b=new Error("Cannot find module '"+l+"'");throw b.code="MODULE_NOT_FOUND",b}var C=p[l]={exports:{}};A[l][0].call(C.exports,function(S){var L=A[l][1][S];return w(L||S)},C,C.exports,E,A,p,s)}return p[l].exports}for(var k=typeof Te=="function"&&Te,n=0;n<s.length;n++)w(s[n]);return w}return E})()({1:[function(E,A,p){"use strict";function s(c){var u=c.length;if(0<u%4)throw new Error("Invalid string. Length must be a multiple of 4");var g=c.indexOf("=");g===-1&&(g=u);var h=g===u?0:4-g%4;return[g,h]}function w(c,u,g){return 3*(u+g)/4-g}function k(c){var u,g,h=s(c),_=h[0],x=h[1],f=new C(w(c,_,x)),y=0,N=0<x?_-4:_;for(g=0;g<N;g+=4)u=b[c.charCodeAt(g)]<<18|b[c.charCodeAt(g+1)]<<12|b[c.charCodeAt(g+2)]<<6|b[c.charCodeAt(g+3)],f[y++]=255&u>>16,f[y++]=255&u>>8,f[y++]=255&u;return x===2&&(u=b[c.charCodeAt(g)]<<2|b[c.charCodeAt(g+1)]>>4,f[y++]=255&u),x===1&&(u=b[c.charCodeAt(g)]<<10|b[c.charCodeAt(g+1)]<<4|b[c.charCodeAt(g+2)]>>2,f[y++]=255&u>>8,f[y++]=255&u),f}function n(c){return o[63&c>>18]+o[63&c>>12]+o[63&c>>6]+o[63&c]}function l(c,u,g){for(var h,_=[],x=u;x<g;x+=3)h=(16711680&c[x]<<16)+(65280&c[x+1]<<8)+(255&c[x+2]),_.push(n(h));return _.join("")}function d(c){for(var u,g=c.length,h=g%3,_=[],x=16383,f=0,y=g-h;f<y;f+=x)_.push(l(c,f,f+x>y?y:f+x));return h===1?(u=c[g-1],_.push(o[u>>2]+o[63&u<<4]+"==")):h===2&&(u=(c[g-2]<<8)+c[g-1],_.push(o[u>>10]+o[63&u>>4]+o[63&u<<2]+"=")),_.join("")}p.byteLength=function(c){var u=s(c),g=u[0],h=u[1];return 3*(g+h)/4-h},p.toByteArray=k,p.fromByteArray=d;for(var o=[],b=[],C=typeof Uint8Array>"u"?Array:Uint8Array,S="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",L=0,i=S.length;L<i;++L)o[L]=S[L],b[S.charCodeAt(L)]=L;b[45]=62,b[95]=63},{}],2:[function(){},{}],3:[function(E,A,p){(function(){(function(){"use strict";var s=String.fromCharCode,w=Math.min;function k(e){if(2147483647<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=n.prototype,t}function n(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(e)}return l(e,t,r)}function l(e,t,r){if(typeof e=="string")return C(e,t);if(ArrayBuffer.isView(e))return S(e);if(e==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(m(e,ArrayBuffer)||e&&m(e.buffer,ArrayBuffer))return L(e,t,r);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(a!=null&&a!==e)return n.from(a,t,r);var v=i(e);if(v)return v;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return n.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(0>e)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function o(e,t,r){return d(e),0>=e||t===void 0?k(e):typeof r=="string"?k(e).fill(t,r):k(e).fill(t)}function b(e){return d(e),k(0>e?0:0|c(e))}function C(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!n.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|u(e,t),a=k(r),v=a.write(e,t);return v!==r&&(a=a.slice(0,v)),a}function S(e){for(var t=0>e.length?0:0|c(e.length),r=k(t),a=0;a<t;a+=1)r[a]=255&e[a];return r}function L(e,t,r){if(0>t||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var a;return a=t===void 0&&r===void 0?new Uint8Array(e):r===void 0?new Uint8Array(e,t):new Uint8Array(e,t,r),a.__proto__=n.prototype,a}function i(e){if(n.isBuffer(e)){var t=0|c(e.length),r=k(t);return r.length===0||e.copy(r,0,0,t),r}return e.length===void 0?e.type==="Buffer"&&Array.isArray(e.data)?S(e.data):void 0:typeof e.length!="number"||T(e.length)?k(0):S(e)}function c(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function u(e,t){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||m(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,a=2<arguments.length&&arguments[2]===!0;if(!a&&r===0)return 0;for(var v=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return ce(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(v)return a?-1:ce(e).length;t=(""+t).toLowerCase(),v=!0}}function g(e,t,r){var a=!1;if((t===void 0||0>t)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),0>=r)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return ue(this,t,r);case"utf8":case"utf-8":return X(this,t,r);case"ascii":return F(this,t,r);case"latin1":case"binary":return De(this,t,r);case"base64":return H(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function h(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function _(e,t,r,a,v){if(e.length===0)return-1;if(typeof r=="string"?(a=r,r=0):2147483647<r?r=2147483647:-2147483648>r&&(r=-2147483648),r=+r,T(r)&&(r=v?0:e.length-1),0>r&&(r=e.length+r),r>=e.length){if(v)return-1;r=e.length-1}else if(0>r)if(v)r=0;else return-1;if(typeof t=="string"&&(t=n.from(t,a)),n.isBuffer(t))return t.length===0?-1:x(e,t,r,a,v);if(typeof t=="number")return t&=255,typeof Uint8Array.prototype.indexOf=="function"?v?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):x(e,[t],r,a,v);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,a,v){function R(Se,me){return P===1?Se[me]:Se.readUInt16BE(me*P)}var P=1,V=e.length,J=t.length;if(a!==void 0&&(a=(a+"").toLowerCase(),a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(2>e.length||2>t.length)return-1;P=2,V/=2,J/=2,r/=2}var G;if(v){var Y=-1;for(G=r;G<V;G++)if(R(e,G)!==R(t,Y===-1?0:G-Y))Y!==-1&&(G-=G-Y),Y=-1;else if(Y===-1&&(Y=G),G-Y+1===J)return Y*P}else for(r+J>V&&(r=V-J),G=r;0<=G;G--){for(var z=!0,ye=0;ye<J;ye++)if(R(e,G+ye)!==R(t,ye)){z=!1;break}if(z)return G}return-1}function f(e,t,r,a){r=+r||0;var v=e.length-r;a?(a=+a,a>v&&(a=v)):a=v;var R=t.length;a>R/2&&(a=R/2);for(var P,V=0;V<a;++V){if(P=parseInt(t.substr(2*V,2),16),T(P))return V;e[r+V]=P}return V}function y(e,t,r,a){return se(ce(t,e.length-r),e,r,a)}function N(e,t,r,a){return se(Ce(t),e,r,a)}function M(e,t,r,a){return N(e,t,r,a)}function j(e,t,r,a){return se(ee(t),e,r,a)}function q(e,t,r,a){return se(Re(t,e.length-r),e,r,a)}function H(e,t,r){return t===0&&r===e.length?U.fromByteArray(e):U.fromByteArray(e.slice(t,r))}function X(e,t,r){r=w(e.length,r);for(var a=[],v=t;v<r;){var R=e[v],P=null,V=239<R?4:223<R?3:191<R?2:1;if(v+V<=r){var J,G,Y,z;V===1?128>R&&(P=R):V===2?(J=e[v+1],(192&J)==128&&(z=(31&R)<<6|63&J,127<z&&(P=z))):V===3?(J=e[v+1],G=e[v+2],(192&J)==128&&(192&G)==128&&(z=(15&R)<<12|(63&J)<<6|63&G,2047<z&&(55296>z||57343<z)&&(P=z))):V===4&&(J=e[v+1],G=e[v+2],Y=e[v+3],(192&J)==128&&(192&G)==128&&(192&Y)==128&&(z=(15&R)<<18|(63&J)<<12|(63&G)<<6|63&Y,65535<z&&1114112>z&&(P=z)))}P===null?(P=65533,V=1):65535<P&&(P-=65536,a.push(55296|1023&P>>>10),P=56320|1023&P),a.push(P),v+=V}return Z(a)}function Z(e){var t=e.length;if(t<=4096)return s.apply(String,e);for(var r="",a=0;a<t;)r+=s.apply(String,e.slice(a,a+=4096));return r}function F(e,t,r){var a="";r=w(e.length,r);for(var v=t;v<r;++v)a+=s(127&e[v]);return a}function De(e,t,r){var a="";r=w(e.length,r);for(var v=t;v<r;++v)a+=s(e[v]);return a}function ue(e,t,r){var a=e.length;(!t||0>t)&&(t=0),(!r||0>r||r>a)&&(r=a);for(var v="",R=t;R<r;++R)v+=Ee(e[R]);return v}function ae(e,t,r){for(var a=e.slice(t,r),v="",R=0;R<a.length;R+=2)v+=s(a[R]+256*a[R+1]);return v}function K(e,t,r){if(e%1!=0||0>e)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function $(e,t,r,a,v,R){if(!n.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>v||t<R)throw new RangeError('"value" argument is out of bounds');if(r+a>e.length)throw new RangeError("Index out of range")}function le(e,t,r,a){if(r+a>e.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("Index out of range")}function ie(e,t,r,a,v){return t=+t,r>>>=0,v||le(e,t,r,4,34028234663852886e22,-34028234663852886e22),B.write(e,t,r,a,23,4),r+4}function he(e,t,r,a,v){return t=+t,r>>>=0,v||le(e,t,r,8,17976931348623157e292,-17976931348623157e292),B.write(e,t,r,a,52,8),r+8}function pe(e){if(e=e.split("=")[0],e=e.trim().replace(W,""),2>e.length)return"";for(;e.length%4!=0;)e+="=";return e}function Ee(e){return 16>e?"0"+e.toString(16):e.toString(16)}function ce(e,t){t=t||1/0;for(var r,a=e.length,v=null,R=[],P=0;P<a;++P){if(r=e.charCodeAt(P),55295<r&&57344>r){if(!v){if(56319<r){-1<(t-=3)&&R.push(239,191,189);continue}else if(P+1===a){-1<(t-=3)&&R.push(239,191,189);continue}v=r;continue}if(56320>r){-1<(t-=3)&&R.push(239,191,189),v=r;continue}r=(v-55296<<10|r-56320)+65536}else v&&-1<(t-=3)&&R.push(239,191,189);if(v=null,128>r){if(0>(t-=1))break;R.push(r)}else if(2048>r){if(0>(t-=2))break;R.push(192|r>>6,128|63&r)}else if(65536>r){if(0>(t-=3))break;R.push(224|r>>12,128|63&r>>6,128|63&r)}else if(1114112>r){if(0>(t-=4))break;R.push(240|r>>18,128|63&r>>12,128|63&r>>6,128|63&r)}else throw new Error("Invalid code point")}return R}function Ce(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function Re(e,t){for(var r,a,v,R=[],P=0;P<e.length&&!(0>(t-=2));++P)r=e.charCodeAt(P),a=r>>8,v=r%256,R.push(v),R.push(a);return R}function ee(e){return U.toByteArray(pe(e))}function se(e,t,r,a){for(var v=0;v<a&&!(v+r>=t.length||v>=e.length);++v)t[v+r]=e[v];return v}function m(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function T(e){return e!==e}var U=E("base64-js"),B=E("ieee754");p.Buffer=n,p.SlowBuffer=function(e){return+e!=e&&(e=0),n.alloc(+e)},p.INSPECT_MAX_BYTES=50,p.kMaxLength=2147483647,n.TYPED_ARRAY_SUPPORT=(function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},e.foo()===42}catch{return!1}})(),n.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(n.prototype,"parent",{enumerable:!0,get:function(){return n.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(n.prototype,"offset",{enumerable:!0,get:function(){return n.isBuffer(this)?this.byteOffset:void 0}}),typeof Symbol<"u"&&Symbol.species!=null&&n[Symbol.species]===n&&Object.defineProperty(n,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),n.poolSize=8192,n.from=function(e,t,r){return l(e,t,r)},n.prototype.__proto__=Uint8Array.prototype,n.__proto__=Uint8Array,n.alloc=function(e,t,r){return o(e,t,r)},n.allocUnsafe=function(e){return b(e)},n.allocUnsafeSlow=function(e){return b(e)},n.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==n.prototype},n.compare=function(e,t){if(m(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),m(t,Uint8Array)&&(t=n.from(t,t.offset,t.byteLength)),!n.isBuffer(e)||!n.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,a=t.length,v=0,R=w(r,a);v<R;++v)if(e[v]!==t[v]){r=e[v],a=t[v];break}return r<a?-1:a<r?1:0},n.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},n.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return n.alloc(0);var r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var a=n.allocUnsafe(t),v=0;for(r=0;r<e.length;++r){var R=e[r];if(m(R,Uint8Array)&&(R=n.from(R)),!n.isBuffer(R))throw new TypeError('"list" argument must be an Array of Buffers');R.copy(a,v),v+=R.length}return a},n.byteLength=u,n.prototype._isBuffer=!0,n.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)h(this,t,t+1);return this},n.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},n.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},n.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?X(this,0,e):g.apply(this,arguments)},n.prototype.toLocaleString=n.prototype.toString,n.prototype.equals=function(e){if(!n.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||n.compare(this,e)===0},n.prototype.inspect=function(){var e="",t=p.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},n.prototype.compare=function(e,t,r,a,v){if(m(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),a===void 0&&(a=0),v===void 0&&(v=this.length),0>t||r>e.length||0>a||v>this.length)throw new RangeError("out of range index");if(a>=v&&t>=r)return 0;if(a>=v)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,a>>>=0,v>>>=0,this===e)return 0;for(var R=v-a,P=r-t,V=w(R,P),J=this.slice(a,v),G=e.slice(t,r),Y=0;Y<V;++Y)if(J[Y]!==G[Y]){R=J[Y],P=G[Y];break}return R<P?-1:P<R?1:0},n.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1},n.prototype.indexOf=function(e,t,r){return _(this,e,t,r,!0)},n.prototype.lastIndexOf=function(e,t,r){return _(this,e,t,r,!1)},n.prototype.write=function(e,t,r,a){if(t===void 0)a="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")a=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,a===void 0&&(a="utf8")):(a=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var v=this.length-t;if((r===void 0||r>v)&&(r=v),0<e.length&&(0>r||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var R=!1;;)switch(a){case"hex":return f(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":return N(this,e,t,r);case"latin1":case"binary":return M(this,e,t,r);case"base64":return j(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,e,t,r);default:if(R)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),R=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},n.prototype.slice=function(e,t){var r=this.length;e=~~e,t=t===void 0?r:~~t,0>e?(e+=r,0>e&&(e=0)):e>r&&(e=r),0>t?(t+=r,0>t&&(t=0)):t>r&&(t=r),t<e&&(t=e);var a=this.subarray(e,t);return a.__proto__=n.prototype,a},n.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||K(e,t,this.length);for(var a=this[e],v=1,R=0;++R<t&&(v*=256);)a+=this[e+R]*v;return a},n.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||K(e,t,this.length);for(var a=this[e+--t],v=1;0<t&&(v*=256);)a+=this[e+--t]*v;return a},n.prototype.readUInt8=function(e,t){return e>>>=0,t||K(e,1,this.length),this[e]},n.prototype.readUInt16LE=function(e,t){return e>>>=0,t||K(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUInt16BE=function(e,t){return e>>>=0,t||K(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUInt32LE=function(e,t){return e>>>=0,t||K(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUInt32BE=function(e,t){return e>>>=0,t||K(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||K(e,t,this.length);for(var a=this[e],v=1,R=0;++R<t&&(v*=256);)a+=this[e+R]*v;return v*=128,a>=v&&(a-=I(2,8*t)),a},n.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||K(e,t,this.length);for(var a=t,v=1,R=this[e+--a];0<a&&(v*=256);)R+=this[e+--a]*v;return v*=128,R>=v&&(R-=I(2,8*t)),R},n.prototype.readInt8=function(e,t){return e>>>=0,t||K(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){e>>>=0,t||K(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(e,t){e>>>=0,t||K(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(e,t){return e>>>=0,t||K(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e>>>=0,t||K(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return e>>>=0,t||K(e,4,this.length),B.read(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e>>>=0,t||K(e,4,this.length),B.read(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e>>>=0,t||K(e,8,this.length),B.read(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e>>>=0,t||K(e,8,this.length),B.read(this,e,!1,52,8)},n.prototype.writeUIntLE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var v=I(2,8*r)-1;$(this,e,t,r,v,0)}var R=1,P=0;for(this[t]=255&e;++P<r&&(R*=256);)this[t+P]=255&e/R;return t+r},n.prototype.writeUIntBE=function(e,t,r,a){if(e=+e,t>>>=0,r>>>=0,!a){var v=I(2,8*r)-1;$(this,e,t,r,v,0)}var R=r-1,P=1;for(this[t+R]=255&e;0<=--R&&(P*=256);)this[t+R]=255&e/P;return t+r},n.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,1,255,0),this[t]=255&e,t+1},n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var v=I(2,8*r-1);$(this,e,t,r,v-1,-v)}var R=0,P=1,V=0;for(this[t]=255&e;++R<r&&(P*=256);)0>e&&V===0&&this[t+R-1]!==0&&(V=1),this[t+R]=255&(e/P>>0)-V;return t+r},n.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t>>>=0,!a){var v=I(2,8*r-1);$(this,e,t,r,v-1,-v)}var R=r-1,P=1,V=0;for(this[t+R]=255&e;0<=--R&&(P*=256);)0>e&&V===0&&this[t+R+1]!==0&&(V=1),this[t+R]=255&(e/P>>0)-V;return t+r},n.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeFloatLE=function(e,t,r){return ie(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){return ie(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){return he(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){return he(this,e,t,!1,r)},n.prototype.copy=function(e,t,r,a){if(!n.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),a||a===0||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),0<a&&a<r&&(a=r),a===r||e.length===0||this.length===0)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>r||r>=this.length)throw new RangeError("Index out of range");if(0>a)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-r&&(a=e.length-t+r);var v=a-r;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(t,r,a);else if(this===e&&r<t&&t<a)for(var R=v-1;0<=R;--R)e[R+t]=this[R+r];else Uint8Array.prototype.set.call(e,this.subarray(r,a),t);return v},n.prototype.fill=function(e,t,r,a){if(typeof e=="string"){if(typeof t=="string"?(a=t,t=0,r=this.length):typeof r=="string"&&(a=r,r=this.length),a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!n.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(e.length===1){var v=e.charCodeAt(0);(a==="utf8"&&128>v||a==="latin1")&&(e=v)}}else typeof e=="number"&&(e&=255);if(0>t||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t>>>=0,r=r===void 0?this.length:r>>>0,e||(e=0);var R;if(typeof e=="number")for(R=t;R<r;++R)this[R]=e;else{var P=n.isBuffer(e)?e:n.from(e,a),V=P.length;if(V===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(R=0;R<r-t;++R)this[R+t]=P[R%V]}return this};var W=/[^+/0-9A-Za-z-_]/g}).call(this)}).call(this,E("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:9}],4:[function(E,A,p){(function(s){(function(){function w(){let n;try{n=p.storage.getItem("debug")}catch{}return!n&&typeof s<"u"&&"env"in s&&(n=s.env.DEBUG),n}p.formatArgs=function(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+A.exports.humanize(this.diff),!this.useColors)return;let l="color: "+this.color;n.splice(1,0,l,"color: inherit");let d=0,o=0;n[0].replace(/%[a-zA-Z%]/g,b=>{b==="%%"||(d++,b==="%c"&&(o=d))}),n.splice(o,0,l)},p.save=function(n){try{n?p.storage.setItem("debug",n):p.storage.removeItem("debug")}catch{}},p.load=w,p.useColors=function(){return!!(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))||!(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},p.storage=(function(){try{return localStorage}catch{}})(),p.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),p.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],p.log=console.debug||console.log||(()=>{}),A.exports=E("./common")(p);let{formatters:k}=A.exports;k.j=function(n){try{return JSON.stringify(n)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}).call(this)}).call(this,E("_process"))},{"./common":5,_process:12}],5:[function(E,A){A.exports=function(p){function s(n){function l(...b){if(!l.enabled)return;let C=l,S=+new Date,L=S-(d||S);C.diff=L,C.prev=d,C.curr=S,d=S,b[0]=s.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let i=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(u,g)=>{if(u==="%%")return"%";i++;let h=s.formatters[g];if(typeof h=="function"){let _=b[i];u=h.call(C,_),b.splice(i,1),i--}return u}),s.formatArgs.call(C,b),(C.log||s.log).apply(C,b)}let d,o=null;return l.namespace=n,l.useColors=s.useColors(),l.color=s.selectColor(n),l.extend=w,l.destroy=s.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>o===null?s.enabled(n):o,set:b=>{o=b}}),typeof s.init=="function"&&s.init(l),l}function w(n,l){let d=s(this.namespace+(typeof l>"u"?":":l)+n);return d.log=this.log,d}function k(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}return s.debug=s,s.default=s,s.coerce=function(n){return n instanceof Error?n.stack||n.message:n},s.disable=function(){let n=[...s.names.map(k),...s.skips.map(k).map(l=>"-"+l)].join(",");return s.enable(""),n},s.enable=function(n){s.save(n),s.names=[],s.skips=[];let l,d=(typeof n=="string"?n:"").split(/[\s,]+/),o=d.length;for(l=0;l<o;l++)d[l]&&(n=d[l].replace(/\*/g,".*?"),n[0]==="-"?s.skips.push(new RegExp("^"+n.substr(1)+"$")):s.names.push(new RegExp("^"+n+"$")))},s.enabled=function(n){if(n[n.length-1]==="*")return!0;let l,d;for(l=0,d=s.skips.length;l<d;l++)if(s.skips[l].test(n))return!1;for(l=0,d=s.names.length;l<d;l++)if(s.names[l].test(n))return!0;return!1},s.humanize=E("ms"),s.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(p).forEach(n=>{s[n]=p[n]}),s.names=[],s.skips=[],s.formatters={},s.selectColor=function(n){let l=0;for(let d=0;d<n.length;d++)l=(l<<5)-l+n.charCodeAt(d),l|=0;return s.colors[D(l)%s.colors.length]},s.enable(s.load()),s}},{ms:11}],6:[function(E,A){"use strict";function p(s,w){for(let k in w)Object.defineProperty(s,k,{value:w[k],enumerable:!0,configurable:!0});return s}A.exports=function(s,w,k){if(!s||typeof s=="string")throw new TypeError("Please pass an Error to err-code");k||(k={}),typeof w=="object"&&(k=w,w=""),w&&(k.code=w);try{return p(s,k)}catch{k.message=s.message,k.stack=s.stack;let l=function(){};return l.prototype=Object.create(Object.getPrototypeOf(s)),p(new l,k)}}},{}],7:[function(E,A){"use strict";function p(f){console&&console.warn&&console.warn(f)}function s(){s.init.call(this)}function w(f){if(typeof f!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof f)}function k(f){return f._maxListeners===void 0?s.defaultMaxListeners:f._maxListeners}function n(f,y,N,M){var j,q,H;if(w(N),q=f._events,q===void 0?(q=f._events=Object.create(null),f._eventsCount=0):(q.newListener!==void 0&&(f.emit("newListener",y,N.listener?N.listener:N),q=f._events),H=q[y]),H===void 0)H=q[y]=N,++f._eventsCount;else if(typeof H=="function"?H=q[y]=M?[N,H]:[H,N]:M?H.unshift(N):H.push(N),j=k(f),0<j&&H.length>j&&!H.warned){H.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+H.length+" "+(y+" listeners added. Use emitter.setMaxListeners() to increase limit"));X.name="MaxListenersExceededWarning",X.emitter=f,X.type=y,X.count=H.length,p(X)}return f}function l(){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 d(f,y,N){var M={fired:!1,wrapFn:void 0,target:f,type:y,listener:N},j=l.bind(M);return j.listener=N,M.wrapFn=j,j}function o(f,y,N){var M=f._events;if(M===void 0)return[];var j=M[y];return j===void 0?[]:typeof j=="function"?N?[j.listener||j]:[j]:N?L(j):C(j,j.length)}function b(f){var y=this._events;if(y!==void 0){var N=y[f];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}function C(f,y){for(var N=Array(y),M=0;M<y;++M)N[M]=f[M];return N}function S(f,y){for(;y+1<f.length;y++)f[y]=f[y+1];f.pop()}function L(f){for(var y=Array(f.length),N=0;N<y.length;++N)y[N]=f[N].listener||f[N];return y}function i(f,y,N){typeof f.on=="function"&&c(f,"error",y,N)}function c(f,y,N,M){if(typeof f.on=="function")M.once?f.once(y,N):f.on(y,N);else if(typeof f.addEventListener=="function")f.addEventListener(y,function j(q){M.once&&f.removeEventListener(y,j),N(q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof f)}var u,g=typeof Reflect=="object"?Reflect:null,h=g&&typeof g.apply=="function"?g.apply:function(f,y,N){return Function.prototype.apply.call(f,y,N)};u=g&&typeof g.ownKeys=="function"?g.ownKeys:Object.getOwnPropertySymbols?function(f){return Object.getOwnPropertyNames(f).concat(Object.getOwnPropertySymbols(f))}:function(f){return Object.getOwnPropertyNames(f)};var _=Number.isNaN||function(f){return f!==f};A.exports=s,A.exports.once=function(f,y){return new Promise(function(N,M){function j(H){f.removeListener(y,q),M(H)}function q(){typeof f.removeListener=="function"&&f.removeListener("error",j),N([].slice.call(arguments))}c(f,y,q,{once:!0}),y!=="error"&&i(f,j,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var x=10;Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return x},set:function(f){if(typeof f!="number"||0>f||_(f))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+f+".");x=f}}),s.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},s.prototype.setMaxListeners=function(f){if(typeof f!="number"||0>f||_(f))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+f+".");return this._maxListeners=f,this},s.prototype.getMaxListeners=function(){return k(this)},s.prototype.emit=function(f){for(var y=[],N=1;N<arguments.length;N++)y.push(arguments[N]);var M=f==="error",j=this._events;if(j!==void 0)M=M&&j.error===void 0;else if(!M)return!1;if(M){var q;if(0<y.length&&(q=y[0]),q instanceof Error)throw q;var H=new Error("Unhandled error."+(q?" ("+q.message+")":""));throw H.context=q,H}var X=j[f];if(X===void 0)return!1;if(typeof X=="function")h(X,this,y);else for(var Z=X.length,F=C(X,Z),N=0;N<Z;++N)h(F[N],this,y);return!0},s.prototype.addListener=function(f,y){return n(this,f,y,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(f,y){return n(this,f,y,!0)},s.prototype.once=function(f,y){return w(y),this.on(f,d(this,f,y)),this},s.prototype.prependOnceListener=function(f,y){return w(y),this.prependListener(f,d(this,f,y)),this},s.prototype.removeListener=function(f,y){var N,M,j,q,H;if(w(y),M=this._events,M===void 0)return this;if(N=M[f],N===void 0)return this;if(N===y||N.listener===y)--this._eventsCount==0?this._events=Object.create(null):(delete M[f],M.removeListener&&this.emit("removeListener",f,N.listener||y));else if(typeof N!="function"){for(j=-1,q=N.length-1;0<=q;q--)if(N[q]===y||N[q].listener===y){H=N[q].listener,j=q;break}if(0>j)return this;j===0?N.shift():S(N,j),N.length===1&&(M[f]=N[0]),M.removeListener!==void 0&&this.emit("removeListener",f,H||y)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(f){var y,N,M;if(N=this._events,N===void 0)return this;if(N.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):N[f]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete N[f]),this;if(arguments.length===0){var j,q=Object.keys(N);for(M=0;M<q.length;++M)j=q[M],j!=="removeListener"&&this.removeAllListeners(j);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(y=N[f],typeof y=="function")this.removeListener(f,y);else if(y!==void 0)for(M=y.length-1;0<=M;M--)this.removeListener(f,y[M]);return this},s.prototype.listeners=function(f){return o(this,f,!0)},s.prototype.rawListeners=function(f){return o(this,f,!1)},s.listenerCount=function(f,y){return typeof f.listenerCount=="function"?f.listenerCount(y):b.call(f,y)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return 0<this._eventsCount?u(this._events):[]}},{}],8:[function(E,A){A.exports=function(){if(typeof globalThis>"u")return null;var p={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return p.RTCPeerConnection?p:null}},{}],9:[function(E,A,p){p.read=function(s,w,k,n,l){var d,o,b=8*l-n-1,C=(1<<b)-1,S=C>>1,L=-7,i=k?l-1:0,c=k?-1:1,u=s[w+i];for(i+=c,d=u&(1<<-L)-1,u>>=-L,L+=b;0<L;d=256*d+s[w+i],i+=c,L-=8);for(o=d&(1<<-L)-1,d>>=-L,L+=n;0<L;o=256*o+s[w+i],i+=c,L-=8);if(d===0)d=1-S;else{if(d===C)return o?NaN:(u?-1:1)*(1/0);o+=I(2,n),d-=S}return(u?-1:1)*o*I(2,d-n)},p.write=function(s,w,k,n,l,d){var o,b,C,S=Math.LN2,L=Math.log,i=8*d-l-1,c=(1<<i)-1,u=c>>1,g=l===23?I(2,-24)-I(2,-77):0,h=n?0:d-1,_=n?1:-1,x=0>w||w===0&&0>1/w?1:0;for(w=D(w),isNaN(w)||w===1/0?(b=isNaN(w)?1:0,o=c):(o=O(L(w)/S),1>w*(C=I(2,-o))&&(o--,C*=2),w+=1<=o+u?g/C:g*I(2,1-u),2<=w*C&&(o++,C/=2),o+u>=c?(b=0,o=c):1<=o+u?(b=(w*C-1)*I(2,l),o+=u):(b=w*I(2,u-1)*I(2,l),o=0));8<=l;s[k+h]=255&b,h+=_,b/=256,l-=8);for(o=o<<l|b,i+=l;0<i;s[k+h]=255&o,h+=_,o/=256,i-=8);s[k+h-_]|=128*x}},{}],10:[function(E,A){A.exports=typeof Object.create=="function"?function(p,s){s&&(p.super_=s,p.prototype=Object.create(s.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}))}:function(p,s){if(s){p.super_=s;var w=function(){};w.prototype=s.prototype,p.prototype=new w,p.prototype.constructor=p}}},{}],11:[function(E,A){var p=Math.round;function s(d){if(d+="",!(100<d.length)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(o){var b=parseFloat(o[1]),C=(o[2]||"ms").toLowerCase();return C==="years"||C==="year"||C==="yrs"||C==="yr"||C==="y"?315576e5*b:C==="weeks"||C==="week"||C==="w"?6048e5*b:C==="days"||C==="day"||C==="d"?864e5*b:C==="hours"||C==="hour"||C==="hrs"||C==="hr"||C==="h"?36e5*b:C==="minutes"||C==="minute"||C==="mins"||C==="min"||C==="m"?6e4*b:C==="seconds"||C==="second"||C==="secs"||C==="sec"||C==="s"?1e3*b:C==="milliseconds"||C==="millisecond"||C==="msecs"||C==="msec"||C==="ms"?b:void 0}}}function w(d){var o=D(d);return 864e5<=o?p(d/864e5)+"d":36e5<=o?p(d/36e5)+"h":6e4<=o?p(d/6e4)+"m":1e3<=o?p(d/1e3)+"s":d+"ms"}function k(d){var o=D(d);return 864e5<=o?n(d,o,864e5,"day"):36e5<=o?n(d,o,36e5,"hour"):6e4<=o?n(d,o,6e4,"minute"):1e3<=o?n(d,o,1e3,"second"):d+" ms"}function n(d,o,b,C){return p(d/b)+" "+C+(o>=1.5*b?"s":"")}var l=24*(60*6e4);A.exports=function(d,o){o=o||{};var b=typeof d;if(b=="string"&&0<d.length)return s(d);if(b==="number"&&isFinite(d))return o.long?k(d):w(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))}},{}],12:[function(E,A){function p(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function w(g){if(b===setTimeout)return setTimeout(g,0);if((b===p||!b)&&setTimeout)return b=setTimeout,setTimeout(g,0);try{return b(g,0)}catch{try{return b.call(null,g,0)}catch{return b.call(this,g,0)}}}function k(g){if(C===clearTimeout)return clearTimeout(g);if((C===s||!C)&&clearTimeout)return C=clearTimeout,clearTimeout(g);try{return C(g)}catch{try{return C.call(null,g)}catch{return C.call(this,g)}}}function n(){c&&L&&(c=!1,L.length?i=L.concat(i):u=-1,i.length&&l())}function l(){if(!c){var g=w(n);c=!0;for(var h=i.length;h;){for(L=i,i=[];++u<h;)L&&L[u].run();u=-1,h=i.length}L=null,c=!1,k(g)}}function d(g,h){this.fun=g,this.array=h}function o(){}var b,C,S=A.exports={};(function(){try{b=typeof setTimeout=="function"?setTimeout:p}catch{b=p}try{C=typeof clearTimeout=="function"?clearTimeout:s}catch{C=s}})();var L,i=[],c=!1,u=-1;S.nextTick=function(g){var h=Array(arguments.length-1);if(1<arguments.length)for(var _=1;_<arguments.length;_++)h[_-1]=arguments[_];i.push(new d(g,h)),i.length!==1||c||w(l)},d.prototype.run=function(){this.fun.apply(null,this.array)},S.title="browser",S.browser=!0,S.env={},S.argv=[],S.version="",S.versions={},S.on=o,S.addListener=o,S.once=o,S.off=o,S.removeListener=o,S.removeAllListeners=o,S.emit=o,S.prependListener=o,S.prependOnceListener=o,S.listeners=function(){return[]},S.binding=function(){throw new Error("process.binding is not supported")},S.cwd=function(){return"/"},S.chdir=function(){throw new Error("process.chdir is not supported")},S.umask=function(){return 0}},{}],13:[function(E,A){(function(p){(function(){let s;A.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window>"u"?p:window):w=>(s||(s=Promise.resolve())).then(w).catch(k=>setTimeout(()=>{throw k},0))}).call(this)}).call(this,typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{}],14:[function(E,A){(function(p,s){(function(){"use strict";var w=E("safe-buffer").Buffer,k=s.crypto||s.msCrypto;A.exports=k&&k.getRandomValues?function(n,l){if(n>4294967295)throw new RangeError("requested too many random bytes");var d=w.allocUnsafe(n);if(0<n)if(65536<n)for(var o=0;o<n;o+=65536)k.getRandomValues(d.slice(o,o+65536));else k.getRandomValues(d);return typeof l=="function"?p.nextTick(function(){l(null,d)}):d}:function(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
+
Use Chrome, Firefox or Internet Explorer 11`)}}).call(this)}).call(this,E("_process"),typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{_process:12,"safe-buffer":30}],15:[function(E,A){"use strict";function p(o,b){o.prototype=Object.create(b.prototype),o.prototype.constructor=o,o.__proto__=b}function s(o,b,C){function S(i,c,u){return typeof b=="string"?b:b(i,c,u)}C||(C=Error);var L=(function(i){function c(u,g,h){return i.call(this,S(u,g,h))||this}return p(c,i),c})(C);L.prototype.name=C.name,L.prototype.code=o,d[o]=L}function w(o,b){if(Array.isArray(o)){var C=o.length;return o=o.map(function(S){return S+""}),2<C?"one of ".concat(b," ").concat(o.slice(0,C-1).join(", "),", or ")+o[C-1]:C===2?"one of ".concat(b," ").concat(o[0]," or ").concat(o[1]):"of ".concat(b," ").concat(o[0])}return"of ".concat(b," ").concat(o+"")}function k(o,b,C){return o.substr(!C||0>C?0:+C,b.length)===b}function n(o,b,C){return(C===void 0||C>o.length)&&(C=o.length),o.substring(C-b.length,C)===b}function l(o,b,C){return typeof C!="number"&&(C=0),!(C+b.length>o.length)&&o.indexOf(b,C)!==-1}var d={};s("ERR_INVALID_OPT_VALUE",function(o,b){return'The value "'+b+'" is invalid for option "'+o+'"'},TypeError),s("ERR_INVALID_ARG_TYPE",function(o,b,C){var S;typeof b=="string"&&k(b,"not ")?(S="must not be",b=b.replace(/^not /,"")):S="must be";var L;if(n(o," argument"))L="The ".concat(o," ").concat(S," ").concat(w(b,"type"));else{var i=l(o,".")?"property":"argument";L='The "'.concat(o,'" ').concat(i," ").concat(S," ").concat(w(b,"type"))}return L+=". Received type ".concat(typeof C),L},TypeError),s("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),s("ERR_METHOD_NOT_IMPLEMENTED",function(o){return"The "+o+" method is not implemented"}),s("ERR_STREAM_PREMATURE_CLOSE","Premature close"),s("ERR_STREAM_DESTROYED",function(o){return"Cannot call "+o+" after a stream was destroyed"}),s("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),s("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),s("ERR_STREAM_WRITE_AFTER_END","write after end"),s("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),s("ERR_UNKNOWN_ENCODING",function(o){return"Unknown encoding: "+o},TypeError),s("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),A.exports.codes=d},{}],16:[function(E,A){(function(p){(function(){"use strict";function s(S){return this instanceof s?(l.call(this,S),d.call(this,S),this.allowHalfOpen=!0,void(S&&(S.readable===!1&&(this.readable=!1),S.writable===!1&&(this.writable=!1),S.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",w))))):new s(S)}function w(){this._writableState.ended||p.nextTick(k,this)}function k(S){S.end()}var n=Object.keys||function(S){var L=[];for(var i in S)L.push(i);return L};A.exports=s;var l=E("./_stream_readable"),d=E("./_stream_writable");E("inherits")(s,l);for(var o,b=n(d.prototype),C=0;C<b.length;C++)o=b[C],s.prototype[o]||(s.prototype[o]=d.prototype[o]);Object.defineProperty(s.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(s.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(s.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(s.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._writableState!==void 0&&this._readableState.destroyed&&this._writableState.destroyed},set:function(S){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=S,this._writableState.destroyed=S)}})}).call(this)}).call(this,E("_process"))},{"./_stream_readable":18,"./_stream_writable":20,_process:12,inherits:10}],17:[function(E,A){"use strict";function p(w){return this instanceof p?void s.call(this,w):new p(w)}A.exports=p;var s=E("./_stream_transform");E("inherits")(p,s),p.prototype._transform=function(w,k,n){n(null,w)}},{"./_stream_transform":19,inherits:10}],18:[function(E,A){(function(p,s){(function(){"use strict";function w(e){return K.from(e)}function k(e){return K.isBuffer(e)||e instanceof $}function n(e,t,r){return typeof e.prependListener=="function"?e.prependListener(t,r):void(e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r))}function l(e,t,r){Z=Z||E("./_stream_duplex"),e=e||{},typeof r!="boolean"&&(r=t instanceof Z),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Re(this,e,"readableHighWaterMark",r),this.buffer=new Ee,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(!ie&&(ie=E("string_decoder/").StringDecoder),this.decoder=new ie(e.encoding),this.encoding=e.encoding)}function d(e){if(Z=Z||E("./_stream_duplex"),!(this instanceof d))return new d(e);var t=this instanceof Z;this._readableState=new l(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),ae.call(this)}function o(e,t,r,a,v){F("readableAddChunk",t);var R=e._readableState;if(t===null)R.reading=!1,i(e,R);else{var P;if(v||(P=C(R,t)),P)B(e,P);else if(!(R.objectMode||t&&0<t.length))a||(R.reading=!1,g(e,R));else if(typeof t=="string"||R.objectMode||Object.getPrototypeOf(t)===K.prototype||(t=w(t)),a)R.endEmitted?B(e,new U):b(e,R,t,!0);else if(R.ended)B(e,new m);else{if(R.destroyed)return!1;R.reading=!1,R.decoder&&!r?(t=R.decoder.write(t),R.objectMode||t.length!==0?b(e,R,t,!1):g(e,R)):b(e,R,t,!1)}}return!R.ended&&(R.length<R.highWaterMark||R.length===0)}function b(e,t,r,a){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,a?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&c(e)),g(e,t)}function C(e,t){var r;return k(t)||typeof t=="string"||t===void 0||e.objectMode||(r=new se("chunk",["string","Buffer","Uint8Array"],t)),r}function S(e){return 1073741824<=e?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function L(e,t){return 0>=e||t.length===0&&t.ended?0:t.objectMode?1:e===e?(e>t.highWaterMark&&(t.highWaterMark=S(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)):t.flowing&&t.length?t.buffer.head.data.length:t.length}function i(e,t){if(F("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?c(e):(t.needReadable=!1,!t.emittedReadable&&(t.emittedReadable=!0,u(e)))}}function c(e){var t=e._readableState;F("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(F("emitReadable",t.flowing),t.emittedReadable=!0,p.nextTick(u,e))}function u(e){var t=e._readableState;F("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,M(e)}function g(e,t){t.readingMore||(t.readingMore=!0,p.nextTick(h,e,t))}function h(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(F("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function _(e){return function(){var t=e._readableState;F("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,t.awaitDrain===0&&ue(e,"data")&&(t.flowing=!0,M(e))}}function x(e){var t=e._readableState;t.readableListening=0<e.listenerCount("readable"),t.resumeScheduled&&!t.paused?t.flowing=!0:0<e.listenerCount("data")&&e.resume()}function f(e){F("readable nexttick read 0"),e.read(0)}function y(e,t){t.resumeScheduled||(t.resumeScheduled=!0,p.nextTick(N,e,t))}function N(e,t){F("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(F("flow",t.flowing);t.flowing&&e.read()!==null;);}function j(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function q(e){var t=e._readableState;F("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,p.nextTick(H,t,e))}function H(e,t){if(F("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function X(e,t){for(var r=0,a=e.length;r<a;r++)if(e[r]===t)return r;return-1}A.exports=d;var Z;d.ReadableState=l;var F,De=E("events").EventEmitter,ue=function(e,t){return e.listeners(t).length},ae=E("./internal/streams/stream"),K=E("buffer").Buffer,$=s.Uint8Array||function(){},le=E("util");F=le&&le.debuglog?le.debuglog("stream"):function(){};var ie,he,pe,Ee=E("./internal/streams/buffer_list"),ce=E("./internal/streams/destroy"),Ce=E("./internal/streams/state"),Re=Ce.getHighWaterMark,ee=E("../errors").codes,se=ee.ERR_INVALID_ARG_TYPE,m=ee.ERR_STREAM_PUSH_AFTER_EOF,T=ee.ERR_METHOD_NOT_IMPLEMENTED,U=ee.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;E("inherits")(d,ae);var B=ce.errorOrDestroy,W=["error","close","destroy","pause","resume"];Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState!==void 0&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),d.prototype.destroy=ce.destroy,d.prototype._undestroy=ce.undestroy,d.prototype._destroy=function(e,t){t(e)},d.prototype.push=function(e,t){var r,a=this._readableState;return a.objectMode?r=!0:typeof e=="string"&&(t=t||a.defaultEncoding,t!==a.encoding&&(e=K.from(e,t),t=""),r=!0),o(this,e,t,!1,r)},d.prototype.unshift=function(e){return o(this,e,null,!0,!1)},d.prototype.isPaused=function(){return this._readableState.flowing===!1},d.prototype.setEncoding=function(e){ie||(ie=E("string_decoder/").StringDecoder);var t=new ie(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,a="";r!==null;)a+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),a!==""&&this._readableState.buffer.push(a),this._readableState.length=a.length,this},d.prototype.read=function(e){F("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark===0?0<t.length:t.length>=t.highWaterMark)||t.ended))return F("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?q(this):c(this),null;if(e=L(e,t),e===0&&t.ended)return t.length===0&&q(this),null;var a=t.needReadable;F("need readable",a),(t.length===0||t.length-e<t.highWaterMark)&&(a=!0,F("length less than watermark",a)),t.ended||t.reading?(a=!1,F("reading or ended",a)):a&&(F("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,!t.reading&&(e=L(r,t)));var v;return v=0<e?j(e,t):null,v===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(!t.ended&&(t.needReadable=!0),r!==e&&t.ended&&q(this)),v!==null&&this.emit("data",v),v},d.prototype._read=function(){B(this,new T("_read()"))},d.prototype.pipe=function(e,t){function r(be,_e){F("onunpipe"),be===Y&&_e&&_e.hasUnpiped===!1&&(_e.hasUnpiped=!0,v())}function a(){F("onend"),e.end()}function v(){F("cleanup"),e.removeListener("close",V),e.removeListener("finish",J),e.removeListener("drain",me),e.removeListener("error",P),e.removeListener("unpipe",r),Y.removeListener("end",a),Y.removeListener("end",G),Y.removeListener("data",R),st=!0,z.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&me()}function R(be){F("ondata");var _e=e.write(be);F("dest.write",_e),_e===!1&&((z.pipesCount===1&&z.pipes===e||1<z.pipesCount&&X(z.pipes,e)!==-1)&&!st&&(F("false write response, pause",z.awaitDrain),z.awaitDrain++),Y.pause())}function P(be){F("onerror",be),G(),e.removeListener("error",P),ue(e,"error")===0&&B(e,be)}function V(){e.removeListener("finish",J),G()}function J(){F("onfinish"),e.removeListener("close",V),G()}function G(){F("unpipe"),Y.unpipe(e)}var Y=this,z=this._readableState;switch(z.pipesCount){case 0:z.pipes=e;break;case 1:z.pipes=[z.pipes,e];break;default:z.pipes.push(e)}z.pipesCount+=1,F("pipe count=%d opts=%j",z.pipesCount,t);var ye=(!t||t.end!==!1)&&e!==p.stdout&&e!==p.stderr,Se=ye?a:G;z.endEmitted?p.nextTick(Se):Y.once("end",Se),e.on("unpipe",r);var me=_(Y);e.on("drain",me);var st=!1;return Y.on("data",R),n(e,"error",P),e.once("close",V),e.once("finish",J),e.emit("pipe",Y),z.flowing||(F("pipe resume"),Y.resume()),e},d.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,v=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var R=0;R<v;R++)a[R].emit("unpipe",this,{hasUnpiped:!1});return this}var P=X(t.pipes,e);return P===-1?this:(t.pipes.splice(P,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},d.prototype.on=function(e,t){var r=ae.prototype.on.call(this,e,t),a=this._readableState;return e==="data"?(a.readableListening=0<this.listenerCount("readable"),a.flowing!==!1&&this.resume()):e=="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,F("on readable",a.length,a.reading),a.length?c(this):!a.reading&&p.nextTick(f,this)),r},d.prototype.addListener=d.prototype.on,d.prototype.removeListener=function(e,t){var r=ae.prototype.removeListener.call(this,e,t);return e==="readable"&&p.nextTick(x,this),r},d.prototype.removeAllListeners=function(e){var t=ae.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&p.nextTick(x,this),t},d.prototype.resume=function(){var e=this._readableState;return e.flowing||(F("resume"),e.flowing=!e.readableListening,y(this,e)),e.paused=!1,this},d.prototype.pause=function(){return F("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(F("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},d.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var v in e.on("end",function(){if(F("wrapped end"),r.decoder&&!r.ended){var P=r.decoder.end();P&&P.length&&t.push(P)}t.push(null)}),e.on("data",function(P){if(F("wrapped data"),r.decoder&&(P=r.decoder.write(P)),!(r.objectMode&&P==null)&&(r.objectMode||P&&P.length)){var V=t.push(P);V||(a=!0,e.pause())}}),e)this[v]===void 0&&typeof e[v]=="function"&&(this[v]=(function(P){return function(){return e[P].apply(e,arguments)}})(v));for(var R=0;R<W.length;R++)e.on(W[R],this.emit.bind(this,W[R]));return this._read=function(P){F("wrapped _read",P),a&&(a=!1,e.resume())},this},typeof Symbol=="function"&&(d.prototype[Symbol.asyncIterator]=function(){return he===void 0&&(he=E("./internal/streams/async_iterator")),he(this)}),Object.defineProperty(d.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(d.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(d.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),d._fromList=j,Object.defineProperty(d.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),typeof Symbol=="function"&&(d.from=function(e,t){return pe===void 0&&(pe=E("./internal/streams/from")),pe(d,e,t)})}).call(this)}).call(this,E("_process"),typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/async_iterator":21,"./internal/streams/buffer_list":22,"./internal/streams/destroy":23,"./internal/streams/from":25,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,events:7,inherits:10,"string_decoder/":31,util:2}],19:[function(E,A){"use strict";function p(S,L){var i=this._transformState;i.transforming=!1;var c=i.writecb;if(c===null)return this.emit("error",new d);i.writechunk=null,i.writecb=null,L!=null&&this.push(L),c(S);var u=this._readableState;u.reading=!1,(u.needReadable||u.length<u.highWaterMark)&&this._read(u.highWaterMark)}function s(S){return this instanceof s?(C.call(this,S),this._transformState={afterTransform:p.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,S&&(typeof S.transform=="function"&&(this._transform=S.transform),typeof S.flush=="function"&&(this._flush=S.flush)),void this.on("prefinish",w)):new s(S)}function w(){var S=this;typeof this._flush!="function"||this._readableState.destroyed?k(this,null,null):this._flush(function(L,i){k(S,L,i)})}function k(S,L,i){if(L)return S.emit("error",L);if(i!=null&&S.push(i),S._writableState.length)throw new b;if(S._transformState.transforming)throw new o;return S.push(null)}A.exports=s;var n=E("../errors").codes,l=n.ERR_METHOD_NOT_IMPLEMENTED,d=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,b=n.ERR_TRANSFORM_WITH_LENGTH_0,C=E("./_stream_duplex");E("inherits")(s,C),s.prototype.push=function(S,L){return this._transformState.needTransform=!1,C.prototype.push.call(this,S,L)},s.prototype._transform=function(S,L,i){i(new l("_transform()"))},s.prototype._write=function(S,L,i){var c=this._transformState;if(c.writecb=i,c.writechunk=S,c.writeencoding=L,!c.transforming){var u=this._readableState;(c.needTransform||u.needReadable||u.length<u.highWaterMark)&&this._read(u.highWaterMark)}},s.prototype._read=function(){var S=this._transformState;S.writechunk===null||S.transforming?S.needTransform=!0:(S.transforming=!0,this._transform(S.writechunk,S.writeencoding,S.afterTransform))},s.prototype._destroy=function(S,L){C.prototype._destroy.call(this,S,function(i){L(i)})}},{"../errors":15,"./_stream_duplex":16,inherits:10}],20:[function(E,A){(function(p,s){(function(){"use strict";function w(m){var T=this;this.next=null,this.entry=null,this.finish=function(){q(T,m)}}function k(m){return F.from(m)}function n(m){return F.isBuffer(m)||m instanceof De}function l(){}function d(m,T,U){H=H||E("./_stream_duplex"),m=m||{},typeof U!="boolean"&&(U=T instanceof H),this.objectMode=!!m.objectMode,U&&(this.objectMode=this.objectMode||!!m.writableObjectMode),this.highWaterMark=K(this,m,"writableHighWaterMark",U),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var B=m.decodeStrings===!1;this.decodeStrings=!B,this.defaultEncoding=m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(W){g(T,W)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=m.emitClose!==!1,this.autoDestroy=!!m.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new w(this)}function o(m){H=H||E("./_stream_duplex");var T=this instanceof H;return T||se.call(o,this)?(this._writableState=new d(m,this,T),this.writable=!0,m&&(typeof m.write=="function"&&(this._write=m.write),typeof m.writev=="function"&&(this._writev=m.writev),typeof m.destroy=="function"&&(this._destroy=m.destroy),typeof m.final=="function"&&(this._final=m.final)),void Z.call(this)):new o(m)}function b(m,T){var U=new Ce;ee(m,U),p.nextTick(T,U)}function C(m,T,U,B){var W;return U===null?W=new ce:typeof U!="string"&&!T.objectMode&&(W=new le("chunk",["string","Buffer"],U)),!W||(ee(m,W),p.nextTick(B,W),!1)}function S(m,T,U){return m.objectMode||m.decodeStrings===!1||typeof T!="string"||(T=F.from(T,U)),T}function L(m,T,U,B,W,e){if(!U){var t=S(T,B,W);B!==t&&(U=!0,W="buffer",B=t)}var r=T.objectMode?1:B.length;T.length+=r;var a=T.length<T.highWaterMark;if(a||(T.needDrain=!0),T.writing||T.corked){var v=T.lastBufferedRequest;T.lastBufferedRequest={chunk:B,encoding:W,isBuf:U,callback:e,next:null},v?v.next=T.lastBufferedRequest:T.bufferedRequest=T.lastBufferedRequest,T.bufferedRequestCount+=1}else i(m,T,!1,r,B,W,e);return a}function i(m,T,U,B,W,e,t){T.writelen=B,T.writecb=t,T.writing=!0,T.sync=!0,T.destroyed?T.onwrite(new Ee("write")):U?m._writev(W,T.onwrite):m._write(W,e,T.onwrite),T.sync=!1}function c(m,T,U,B,W){--T.pendingcb,U?(p.nextTick(W,B),p.nextTick(M,m,T),m._writableState.errorEmitted=!0,ee(m,B)):(W(B),m._writableState.errorEmitted=!0,ee(m,B),M(m,T))}function u(m){m.writing=!1,m.writecb=null,m.length-=m.writelen,m.writelen=0}function g(m,T){var U=m._writableState,B=U.sync,W=U.writecb;if(typeof W!="function")throw new he;if(u(U),T)c(m,U,B,T,W);else{var e=f(U)||m.destroyed;e||U.corked||U.bufferProcessing||!U.bufferedRequest||x(m,U),B?p.nextTick(h,m,U,e,W):h(m,U,e,W)}}function h(m,T,U,B){U||_(m,T),T.pendingcb--,B(),M(m,T)}function _(m,T){T.length===0&&T.needDrain&&(T.needDrain=!1,m.emit("drain"))}function x(m,T){T.bufferProcessing=!0;var U=T.bufferedRequest;if(m._writev&&U&&U.next){var B=T.bufferedRequestCount,W=Array(B),e=T.corkedRequestsFree;e.entry=U;for(var t=0,r=!0;U;)W[t]=U,U.isBuf||(r=!1),U=U.next,t+=1;W.allBuffers=r,i(m,T,!0,T.length,W,"",e.finish),T.pendingcb++,T.lastBufferedRequest=null,e.next?(T.corkedRequestsFree=e.next,e.next=null):T.corkedRequestsFree=new w(T),T.bufferedRequestCount=0}else{for(;U;){var a=U.chunk,v=U.encoding,R=U.callback,P=T.objectMode?1:a.length;if(i(m,T,!1,P,a,v,R),U=U.next,T.bufferedRequestCount--,T.writing)break}U===null&&(T.lastBufferedRequest=null)}T.bufferedRequest=U,T.bufferProcessing=!1}function f(m){return m.ending&&m.length===0&&m.bufferedRequest===null&&!m.finished&&!m.writing}function y(m,T){m._final(function(U){T.pendingcb--,U&&ee(m,U),T.prefinished=!0,m.emit("prefinish"),M(m,T)})}function N(m,T){T.prefinished||T.finalCalled||(typeof m._final!="function"||T.destroyed?(T.prefinished=!0,m.emit("prefinish")):(T.pendingcb++,T.finalCalled=!0,p.nextTick(y,m,T)))}function M(m,T){var U=f(T);if(U&&(N(m,T),T.pendingcb===0&&(T.finished=!0,m.emit("finish"),T.autoDestroy))){var B=m._readableState;(!B||B.autoDestroy&&B.endEmitted)&&m.destroy()}return U}function j(m,T,U){T.ending=!0,M(m,T),U&&(T.finished?p.nextTick(U):m.once("finish",U)),T.ended=!0,m.writable=!1}function q(m,T,U){var B=m.entry;for(m.entry=null;B;){var W=B.callback;T.pendingcb--,W(U),B=B.next}T.corkedRequestsFree.next=m}A.exports=o;var H;o.WritableState=d;var X={deprecate:E("util-deprecate")},Z=E("./internal/streams/stream"),F=E("buffer").Buffer,De=s.Uint8Array||function(){},ue=E("./internal/streams/destroy"),ae=E("./internal/streams/state"),K=ae.getHighWaterMark,$=E("../errors").codes,le=$.ERR_INVALID_ARG_TYPE,ie=$.ERR_METHOD_NOT_IMPLEMENTED,he=$.ERR_MULTIPLE_CALLBACK,pe=$.ERR_STREAM_CANNOT_PIPE,Ee=$.ERR_STREAM_DESTROYED,ce=$.ERR_STREAM_NULL_VALUES,Ce=$.ERR_STREAM_WRITE_AFTER_END,Re=$.ERR_UNKNOWN_ENCODING,ee=ue.errorOrDestroy;E("inherits")(o,Z),d.prototype.getBuffer=function(){for(var m=this.bufferedRequest,T=[];m;)T.push(m),m=m.next;return T},(function(){try{Object.defineProperty(d.prototype,"buffer",{get:X.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var se;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(se=Function.prototype[Symbol.hasInstance],Object.defineProperty(o,Symbol.hasInstance,{value:function(m){return!!se.call(this,m)||this===o&&m&&m._writableState instanceof d}})):se=function(m){return m instanceof this},o.prototype.pipe=function(){ee(this,new pe)},o.prototype.write=function(m,T,U){var B=this._writableState,W=!1,e=!B.objectMode&&n(m);return e&&!F.isBuffer(m)&&(m=k(m)),typeof T=="function"&&(U=T,T=null),e?T="buffer":!T&&(T=B.defaultEncoding),typeof U!="function"&&(U=l),B.ending?b(this,U):(e||C(this,B,m,U))&&(B.pendingcb++,W=L(this,B,e,m,T,U)),W},o.prototype.cork=function(){this._writableState.corked++},o.prototype.uncork=function(){var m=this._writableState;m.corked&&(m.corked--,!m.writing&&!m.corked&&!m.bufferProcessing&&m.bufferedRequest&&x(this,m))},o.prototype.setDefaultEncoding=function(m){if(typeof m=="string"&&(m=m.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((m+"").toLowerCase())))throw new Re(m);return this._writableState.defaultEncoding=m,this},Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),o.prototype._write=function(m,T,U){U(new ie("_write()"))},o.prototype._writev=null,o.prototype.end=function(m,T,U){var B=this._writableState;return typeof m=="function"?(U=m,m=null,T=null):typeof T=="function"&&(U=T,T=null),m!=null&&this.write(m,T),B.corked&&(B.corked=1,this.uncork()),B.ending||j(this,B,U),this},Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState!==void 0&&this._writableState.destroyed},set:function(m){this._writableState&&(this._writableState.destroyed=m)}}),o.prototype.destroy=ue.destroy,o.prototype._undestroy=ue.undestroy,o.prototype._destroy=function(m,T){T(m)}}).call(this)}).call(this,E("_process"),typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{"../errors":15,"./_stream_duplex":16,"./internal/streams/destroy":23,"./internal/streams/state":27,"./internal/streams/stream":28,_process:12,buffer:3,inherits:10,"util-deprecate":32}],21:[function(E,A){(function(p){(function(){"use strict";function s(_,x,f){return x in _?Object.defineProperty(_,x,{value:f,enumerable:!0,configurable:!0,writable:!0}):_[x]=f,_}function w(_,x){return{value:_,done:x}}function k(_){var x=_[b];if(x!==null){var f=_[u].read();f!==null&&(_[i]=null,_[b]=null,_[C]=null,x(w(f,!1)))}}function n(_){p.nextTick(k,_)}function l(_,x){return function(f,y){_.then(function(){return x[L]?void f(w(void 0,!0)):void x[c](f,y)},y)}}var d,o=E("./end-of-stream"),b=Symbol("lastResolve"),C=Symbol("lastReject"),S=Symbol("error"),L=Symbol("ended"),i=Symbol("lastPromise"),c=Symbol("handlePromise"),u=Symbol("stream"),g=Object.getPrototypeOf(function(){}),h=Object.setPrototypeOf((d={get stream(){return this[u]},next:function(){var _=this,x=this[S];if(x!==null)return Promise.reject(x);if(this[L])return Promise.resolve(w(void 0,!0));if(this[u].destroyed)return new Promise(function(M,j){p.nextTick(function(){_[S]?j(_[S]):M(w(void 0,!0))})});var f,y=this[i];if(y)f=new Promise(l(y,this));else{var N=this[u].read();if(N!==null)return Promise.resolve(w(N,!1));f=new Promise(this[c])}return this[i]=f,f}},s(d,Symbol.asyncIterator,function(){return this}),s(d,"return",function(){var _=this;return new Promise(function(x,f){_[u].destroy(null,function(y){return y?void f(y):void x(w(void 0,!0))})})}),d),g);A.exports=function(_){var x,f=Object.create(h,(x={},s(x,u,{value:_,writable:!0}),s(x,b,{value:null,writable:!0}),s(x,C,{value:null,writable:!0}),s(x,S,{value:null,writable:!0}),s(x,L,{value:_._readableState.endEmitted,writable:!0}),s(x,c,{value:function(y,N){var M=f[u].read();M?(f[i]=null,f[b]=null,f[C]=null,y(w(M,!1))):(f[b]=y,f[C]=N)},writable:!0}),x));return f[i]=null,o(_,function(y){if(y&&y.code!=="ERR_STREAM_PREMATURE_CLOSE"){var N=f[C];return N!==null&&(f[i]=null,f[b]=null,f[C]=null,N(y)),void(f[S]=y)}var M=f[b];M!==null&&(f[i]=null,f[b]=null,f[C]=null,M(w(void 0,!0))),f[L]=!0}),_.on("readable",n.bind(null,f)),f}}).call(this)}).call(this,E("_process"))},{"./end-of-stream":24,_process:12}],22:[function(E,A){"use strict";function p(i,c){var u=Object.keys(i);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(i);c&&(g=g.filter(function(h){return Object.getOwnPropertyDescriptor(i,h).enumerable})),u.push.apply(u,g)}return u}function s(i){for(var c,u=1;u<arguments.length;u++)c=arguments[u]==null?{}:arguments[u],u%2?p(Object(c),!0).forEach(function(g){w(i,g,c[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(c)):p(Object(c)).forEach(function(g){Object.defineProperty(i,g,Object.getOwnPropertyDescriptor(c,g))});return i}function w(i,c,u){return c in i?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u,i}function k(i,c){if(!(i instanceof c))throw new TypeError("Cannot call a class as a function")}function n(i,c){for(var u,g=0;g<c.length;g++)u=c[g],u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(i,u.key,u)}function l(i,c,u){return c&&n(i.prototype,c),u&&n(i,u),i}function d(i,c,u){b.prototype.copy.call(i,c,u)}var o=E("buffer"),b=o.Buffer,C=E("util"),S=C.inspect,L=S&&S.custom||"inspect";A.exports=(function(){function i(){k(this,i),this.head=null,this.tail=null,this.length=0}return l(i,[{key:"push",value:function(c){var u={data:c,next:null};0<this.length?this.tail.next=u:this.head=u,this.tail=u,++this.length}},{key:"unshift",value:function(c){var u={data:c,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}},{key:"shift",value:function(){if(this.length!==0){var c=this.head.data;return this.head=this.length===1?this.tail=null:this.head.next,--this.length,c}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(c){if(this.length===0)return"";for(var u=this.head,g=""+u.data;u=u.next;)g+=c+u.data;return g}},{key:"concat",value:function(c){if(this.length===0)return b.alloc(0);for(var u=b.allocUnsafe(c>>>0),g=this.head,h=0;g;)d(g.data,u,h),h+=g.data.length,g=g.next;return u}},{key:"consume",value:function(c,u){var g;return c<this.head.data.length?(g=this.head.data.slice(0,c),this.head.data=this.head.data.slice(c)):c===this.head.data.length?g=this.shift():g=u?this._getString(c):this._getBuffer(c),g}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(c){var u=this.head,g=1,h=u.data;for(c-=h.length;u=u.next;){var _=u.data,x=c>_.length?_.length:c;if(h+=x===_.length?_:_.slice(0,c),c-=x,c===0){x===_.length?(++g,this.head=u.next?u.next:this.tail=null):(this.head=u,u.data=_.slice(x));break}++g}return this.length-=g,h}},{key:"_getBuffer",value:function(c){var u=b.allocUnsafe(c),g=this.head,h=1;for(g.data.copy(u),c-=g.data.length;g=g.next;){var _=g.data,x=c>_.length?_.length:c;if(_.copy(u,u.length-c,0,x),c-=x,c===0){x===_.length?(++h,this.head=g.next?g.next:this.tail=null):(this.head=g,g.data=_.slice(x));break}++h}return this.length-=h,u}},{key:L,value:function(c,u){return S(this,s({},u,{depth:0,customInspect:!1}))}}]),i})()},{buffer:3,util:2}],23:[function(E,A){(function(p){(function(){"use strict";function s(n,l){k(n,l),w(n)}function w(n){n._writableState&&!n._writableState.emitClose||n._readableState&&!n._readableState.emitClose||n.emit("close")}function k(n,l){n.emit("error",l)}A.exports={destroy:function(n,l){var d=this,o=this._readableState&&this._readableState.destroyed,b=this._writableState&&this._writableState.destroyed;return o||b?(l?l(n):n&&(this._writableState?!this._writableState.errorEmitted&&(this._writableState.errorEmitted=!0,p.nextTick(k,this,n)):p.nextTick(k,this,n)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(n||null,function(C){!l&&C?d._writableState?d._writableState.errorEmitted?p.nextTick(w,d):(d._writableState.errorEmitted=!0,p.nextTick(s,d,C)):p.nextTick(s,d,C):l?(p.nextTick(w,d),l(C)):p.nextTick(w,d)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(n,l){var d=n._readableState,o=n._writableState;d&&d.autoDestroy||o&&o.autoDestroy?n.destroy(l):n.emit("error",l)}}}).call(this)}).call(this,E("_process"))},{_process:12}],24:[function(E,A){"use strict";function p(l){var d=!1;return function(){if(!d){d=!0;for(var o=arguments.length,b=Array(o),C=0;C<o;C++)b[C]=arguments[C];l.apply(this,b)}}}function s(){}function w(l){return l.setHeader&&typeof l.abort=="function"}function k(l,d,o){if(typeof d=="function")return k(l,null,d);d||(d={}),o=p(o||s);var b=d.readable||d.readable!==!1&&l.readable,C=d.writable||d.writable!==!1&&l.writable,S=function(){l.writable||i()},L=l._writableState&&l._writableState.finished,i=function(){C=!1,L=!0,b||o.call(l)},c=l._readableState&&l._readableState.endEmitted,u=function(){b=!1,c=!0,C||o.call(l)},g=function(x){o.call(l,x)},h=function(){var x;return b&&!c?(l._readableState&&l._readableState.ended||(x=new n),o.call(l,x)):C&&!L?(l._writableState&&l._writableState.ended||(x=new n),o.call(l,x)):void 0},_=function(){l.req.on("finish",i)};return w(l)?(l.on("complete",i),l.on("abort",h),l.req?_():l.on("request",_)):C&&!l._writableState&&(l.on("end",S),l.on("close",S)),l.on("end",u),l.on("finish",i),d.error!==!1&&l.on("error",g),l.on("close",h),function(){l.removeListener("complete",i),l.removeListener("abort",h),l.removeListener("request",_),l.req&&l.req.removeListener("finish",i),l.removeListener("end",S),l.removeListener("close",S),l.removeListener("finish",i),l.removeListener("end",u),l.removeListener("error",g),l.removeListener("close",h)}}var n=E("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;A.exports=k},{"../../../errors":15}],25:[function(E,A){A.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],26:[function(E,A){"use strict";function p(L){var i=!1;return function(){i||(i=!0,L.apply(void 0,arguments))}}function s(L){if(L)throw L}function w(L){return L.setHeader&&typeof L.abort=="function"}function k(L,i,c,u){u=p(u);var g=!1;L.on("close",function(){g=!0}),o===void 0&&(o=E("./end-of-stream")),o(L,{readable:i,writable:c},function(_){return _?u(_):(g=!0,void u())});var h=!1;return function(_){if(!g)return h?void 0:(h=!0,w(L)?L.abort():typeof L.destroy=="function"?L.destroy():void u(_||new S("pipe")))}}function n(L){L()}function l(L,i){return L.pipe(i)}function d(L){return L.length&&typeof L[L.length-1]=="function"?L.pop():s}var o,b=E("../../../errors").codes,C=b.ERR_MISSING_ARGS,S=b.ERR_STREAM_DESTROYED;A.exports=function(){for(var L=arguments.length,i=Array(L),c=0;c<L;c++)i[c]=arguments[c];var u=d(i);if(Array.isArray(i[0])&&(i=i[0]),2>i.length)throw new C("streams");var g,h=i.map(function(_,x){var f=x<i.length-1;return k(_,f,0<x,function(y){g||(g=y),y&&h.forEach(n),f||(h.forEach(n),u(g))})});return i.reduce(l)}},{"../../../errors":15,"./end-of-stream":24}],27:[function(E,A){"use strict";function p(w,k,n){return w.highWaterMark==null?k?w[n]:null:w.highWaterMark}var s=E("../../../errors").codes.ERR_INVALID_OPT_VALUE;A.exports={getHighWaterMark:function(w,k,n,l){var d=p(k,l,n);if(d!=null){if(!(isFinite(d)&&O(d)===d)||0>d){var o=l?n:"highWaterMark";throw new s(o,d)}return O(d)}return w.objectMode?16:16384}}},{"../../../errors":15}],28:[function(E,A){A.exports=E("events").EventEmitter},{events:7}],29:[function(E,A,p){p=A.exports=E("./lib/_stream_readable.js"),p.Stream=p,p.Readable=p,p.Writable=E("./lib/_stream_writable.js"),p.Duplex=E("./lib/_stream_duplex.js"),p.Transform=E("./lib/_stream_transform.js"),p.PassThrough=E("./lib/_stream_passthrough.js"),p.finished=E("./lib/internal/streams/end-of-stream.js"),p.pipeline=E("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":16,"./lib/_stream_passthrough.js":17,"./lib/_stream_readable.js":18,"./lib/_stream_transform.js":19,"./lib/_stream_writable.js":20,"./lib/internal/streams/end-of-stream.js":24,"./lib/internal/streams/pipeline.js":26}],30:[function(E,A,p){function s(l,d){for(var o in l)d[o]=l[o]}function w(l,d,o){return n(l,d,o)}var k=E("buffer"),n=k.Buffer;n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?A.exports=k:(s(k,p),p.Buffer=w),w.prototype=Object.create(n.prototype),s(n,w),w.from=function(l,d,o){if(typeof l=="number")throw new TypeError("Argument must not be a number");return n(l,d,o)},w.alloc=function(l,d,o){if(typeof l!="number")throw new TypeError("Argument must be a number");var b=n(l);return d===void 0?b.fill(0):typeof o=="string"?b.fill(d,o):b.fill(d),b},w.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return n(l)},w.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return k.SlowBuffer(l)}},{buffer:3}],31:[function(E,A,p){"use strict";function s(h){if(!h)return"utf8";for(var _;;)switch(h){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return h;default:if(_)return;h=(""+h).toLowerCase(),_=!0}}function w(h){var _=s(h);if(typeof _!="string"&&(u.isEncoding===g||!g(h)))throw new Error("Unknown encoding: "+h);return _||h}function k(h){this.encoding=w(h);var _;switch(this.encoding){case"utf16le":this.text=b,this.end=C,_=4;break;case"utf8":this.fillLast=o,_=4;break;case"base64":this.text=S,this.end=L,_=3;break;default:return this.write=i,void(this.end=c)}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(_)}function n(h){return 127>=h?0:h>>5==6?2:h>>4==14?3:h>>3==30?4:h>>6==2?-1:-2}function l(h,_,x){var f=_.length-1;if(f<x)return 0;var y=n(_[f]);return 0<=y?(0<y&&(h.lastNeed=y-1),y):--f<x||y===-2?0:(y=n(_[f]),0<=y?(0<y&&(h.lastNeed=y-2),y):--f<x||y===-2?0:(y=n(_[f]),0<=y?(0<y&&(y===2?y=0:h.lastNeed=y-3),y):0))}function d(h,_){if((192&_[0])!=128)return h.lastNeed=0,"\uFFFD";if(1<h.lastNeed&&1<_.length){if((192&_[1])!=128)return h.lastNeed=1,"\uFFFD";if(2<h.lastNeed&&2<_.length&&(192&_[2])!=128)return h.lastNeed=2,"\uFFFD"}}function o(h){var _=this.lastTotal-this.lastNeed,x=d(this,h,_);return x===void 0?this.lastNeed<=h.length?(h.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(h.copy(this.lastChar,_,0,h.length),void(this.lastNeed-=h.length)):x}function b(h,_){if((h.length-_)%2==0){var x=h.toString("utf16le",_);if(x){var f=x.charCodeAt(x.length-1);if(55296<=f&&56319>=f)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1],x.slice(0,-1)}return x}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=h[h.length-1],h.toString("utf16le",_,h.length-1)}function C(h){var _=h&&h.length?this.write(h):"";if(this.lastNeed){var x=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,x)}return _}function S(h,_){var x=(h.length-_)%3;return x==0?h.toString("base64",_):(this.lastNeed=3-x,this.lastTotal=3,x==1?this.lastChar[0]=h[h.length-1]:(this.lastChar[0]=h[h.length-2],this.lastChar[1]=h[h.length-1]),h.toString("base64",_,h.length-x))}function L(h){var _=h&&h.length?this.write(h):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function i(h){return h.toString(this.encoding)}function c(h){return h&&h.length?this.write(h):""}var u=E("safe-buffer").Buffer,g=u.isEncoding||function(h){switch(h=""+h,h&&h.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};p.StringDecoder=k,k.prototype.write=function(h){if(h.length===0)return"";var _,x;if(this.lastNeed){if(_=this.fillLast(h),_===void 0)return"";x=this.lastNeed,this.lastNeed=0}else x=0;return x<h.length?_?_+this.text(h,x):this.text(h,x):_||""},k.prototype.end=function(h){var _=h&&h.length?this.write(h):"";return this.lastNeed?_+"\uFFFD":_},k.prototype.text=function(h,_){var x=l(this,h,_);if(!this.lastNeed)return h.toString("utf8",_);this.lastTotal=x;var f=h.length-(x-this.lastNeed);return h.copy(this.lastChar,0,f),h.toString("utf8",_,f)},k.prototype.fillLast=function(h){return this.lastNeed<=h.length?(h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(h.copy(this.lastChar,this.lastTotal-this.lastNeed,0,h.length),void(this.lastNeed-=h.length))}},{"safe-buffer":30}],32:[function(E,A){(function(p){(function(){function s(w){try{if(!p.localStorage)return!1}catch{return!1}var k=p.localStorage[w];return k!=null&&(k+"").toLowerCase()==="true"}A.exports=function(w,k){function n(){if(!l){if(s("throwDeprecation"))throw new Error(k);s("traceDeprecation")?console.trace(k):console.warn(k),l=!0}return w.apply(this,arguments)}if(s("noDeprecation"))return w;var l=!1;return n}}).call(this)}).call(this,typeof global>"u"?typeof self>"u"?typeof window>"u"?{}:window:self:global)},{}],"/":[function(E,A){function p(L){return L.replace(/a=ice-options:trickle\s\n/g,"")}function s(L){console.warn(L)}let w=E("debug")("simple-peer"),k=E("get-browser-rtc"),n=E("randombytes"),l=E("readable-stream"),d=E("queue-microtask"),o=E("err-code"),{Buffer:b}=E("buffer"),C=65536;class S extends l.Duplex{constructor(i){if(i=Object.assign({allowHalfOpen:!1},i),super(i),this._id=n(4).toString("hex").slice(0,7),this._debug("new peer %o",i),this.channelName=i.initiator?i.channelName||n(20).toString("hex"):null,this.initiator=i.initiator||!1,this.channelConfig=i.channelConfig||S.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},S.config,i.config),this.offerOptions=i.offerOptions||{},this.answerOptions=i.answerOptions||{},this.sdpTransform=i.sdpTransform||(c=>c),this.streams=i.streams||(i.stream?[i.stream]:[]),this.trickle=i.trickle===void 0||i.trickle,this.allowHalfTrickle=i.allowHalfTrickle!==void 0&&i.allowHalfTrickle,this.iceCompleteTimeout=i.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=i.wrtc&&typeof i.wrtc=="object"?i.wrtc:k(),!this._wrtc)throw o(typeof window>"u"?new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"):new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(c){return void this.destroy(o(c,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc=typeof this._pc._peerConnectionId=="number",this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=c=>{this._onIceCandidate(c)},typeof this._pc.peerIdentity=="object"&&this._pc.peerIdentity.catch(c=>{this.destroy(o(c,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=c=>{this._setupData(c)},this.streams&&this.streams.forEach(c=>{this.addStream(c)}),this._pc.ontrack=c=>{this._onTrack(c)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&this._channel.readyState==="open"}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(i){if(!this.destroying){if(this.destroyed)throw o(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if(typeof i=="string")try{i=JSON.parse(i)}catch{i={}}this._debug("signal()"),i.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),i.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(i.transceiverRequest.kind,i.transceiverRequest.init)),i.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(i.candidate):this._pendingCandidates.push(i.candidate)),i.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(i)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(c=>{this._addIceCandidate(c)}),this._pendingCandidates=[],this._pc.remoteDescription.type==="offer"&&this._createAnswer())}).catch(c=>{this.destroy(o(c,"ERR_SET_REMOTE_DESCRIPTION"))}),i.sdp||i.candidate||i.renegotiate||i.transceiverRequest||this.destroy(o(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(i){let c=new this._wrtc.RTCIceCandidate(i);this._pc.addIceCandidate(c).catch(u=>{!c.address||c.address.endsWith(".local")?s("Ignoring unsupported ICE candidate."):this.destroy(o(u,"ERR_ADD_ICE_CANDIDATE"))})}send(i){if(!this.destroying){if(this.destroyed)throw o(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(i)}}addTransceiver(i,c){if(!this.destroying){if(this.destroyed)throw o(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(i,c),this._needsNegotiation()}catch(u){this.destroy(o(u,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:i,init:c}})}}addStream(i){if(!this.destroying){if(this.destroyed)throw o(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),i.getTracks().forEach(c=>{this.addTrack(c,i)})}}addTrack(i,c){if(this.destroying)return;if(this.destroyed)throw o(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");let u=this._senderMap.get(i)||new Map,g=u.get(c);if(!g)g=this._pc.addTrack(i,c),u.set(c,g),this._senderMap.set(i,u),this._needsNegotiation();else throw g.removed?o(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):o(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED")}replaceTrack(i,c,u){if(this.destroying)return;if(this.destroyed)throw o(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");let g=this._senderMap.get(i),h=g?g.get(u):null;if(!h)throw o(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");c&&this._senderMap.set(c,g),h.replaceTrack==null?this.destroy(o(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK")):h.replaceTrack(c)}removeTrack(i,c){if(this.destroying)return;if(this.destroyed)throw o(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");let u=this._senderMap.get(i),g=u?u.get(c):null;if(!g)throw o(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{g.removed=!0,this._pc.removeTrack(g)}catch(h){h.name==="NS_ERROR_UNEXPECTED"?this._sendersAwaitingStable.push(g):this.destroy(o(h,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(i){if(!this.destroying){if(this.destroyed)throw o(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),i.getTracks().forEach(c=>{this.removeTrack(c,i)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,d(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw o(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(i){this._destroy(i,()=>{})}_destroy(i,c){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",i&&(i.message||i)),d(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",i&&(i.message||i)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch{}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch{}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,i&&this.emit("error",i),this.emit("close"),c()}))}_setupData(i){if(!i.channel)return this.destroy(o(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=i.channel,this._channel.binaryType="arraybuffer",typeof this._channel.bufferedAmountLowThreshold=="number"&&(this._channel.bufferedAmountLowThreshold=C),this.channelName=this._channel.label,this._channel.onmessage=u=>{this._onChannelMessage(u)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=u=>{let g=u.error instanceof Error?u.error:new Error(`Datachannel error: ${u.message} ${u.filename}:${u.lineno}:${u.colno}`);this.destroy(o(g,"ERR_DATA_CHANNEL"))};let c=!1;this._closingInterval=setInterval(()=>{this._channel&&this._channel.readyState==="closing"?(c&&this._onChannelClose(),c=!0):c=!1},5e3)}_read(){}_write(i,c,u){if(this.destroyed)return u(o(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(i)}catch(g){return this.destroy(o(g,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>C?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=u):u(null)}else this._debug("write before connect"),this._chunk=i,this._cb=u}_onFinish(){if(!this.destroyed){let i=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?i():this.once("connect",i)}}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(i=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(i.sdp=p(i.sdp)),i.sdp=this.sdpTransform(i.sdp);let c=()=>{if(!this.destroyed){let u=this._pc.localDescription||i;this._debug("signal"),this.emit("signal",{type:u.type,sdp:u.sdp})}};this._pc.setLocalDescription(i).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?c():this.once("_iceComplete",c))}).catch(u=>{this.destroy(o(u,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(i=>{this.destroy(o(i,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(i=>{i.mid||!i.sender.track||i.requested||(i.requested=!0,this.addTransceiver(i.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(i=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(i.sdp=p(i.sdp)),i.sdp=this.sdpTransform(i.sdp);let c=()=>{if(!this.destroyed){let u=this._pc.localDescription||i;this._debug("signal"),this.emit("signal",{type:u.type,sdp:u.sdp}),this.initiator||this._requestMissingTransceivers()}};this._pc.setLocalDescription(i).then(()=>{this.destroyed||(this.trickle||this._iceComplete?c():this.once("_iceComplete",c))}).catch(u=>{this.destroy(o(u,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(i=>{this.destroy(o(i,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||this._pc.connectionState==="failed"&&this.destroy(o(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;let i=this._pc.iceConnectionState,c=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",i,c),this.emit("iceStateChange",i,c),(i==="connected"||i==="completed")&&(this._pcReady=!0,this._maybeReady()),i==="failed"&&this.destroy(o(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),i==="closed"&&this.destroy(o(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(i){let c=u=>(Object.prototype.toString.call(u.values)==="[object Array]"&&u.values.forEach(g=>{Object.assign(u,g)}),u);this._pc.getStats.length===0||this._isReactNativeWebrtc?this._pc.getStats().then(u=>{let g=[];u.forEach(h=>{g.push(c(h))}),i(null,g)},u=>i(u)):0<this._pc.getStats.length?this._pc.getStats(u=>{if(this.destroyed)return;let g=[];u.result().forEach(h=>{let _={};h.names().forEach(x=>{_[x]=h.stat(x)}),_.id=h.id,_.type=h.type,_.timestamp=h.timestamp,g.push(c(_))}),i(null,g)},u=>i(u)):i(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;let i=()=>{this.destroyed||this.getStats((c,u)=>{if(this.destroyed)return;c&&(u=[]);let g={},h={},_={},x=!1;u.forEach(y=>{(y.type==="remotecandidate"||y.type==="remote-candidate")&&(g[y.id]=y),(y.type==="localcandidate"||y.type==="local-candidate")&&(h[y.id]=y),(y.type==="candidatepair"||y.type==="candidate-pair")&&(_[y.id]=y)});let f=y=>{x=!0;let N=h[y.localCandidateId];N&&(N.ip||N.address)?(this.localAddress=N.ip||N.address,this.localPort=+N.port):N&&N.ipAddress?(this.localAddress=N.ipAddress,this.localPort=+N.portNumber):typeof y.googLocalAddress=="string"&&(N=y.googLocalAddress.split(":"),this.localAddress=N[0],this.localPort=+N[1]),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let M=g[y.remoteCandidateId];M&&(M.ip||M.address)?(this.remoteAddress=M.ip||M.address,this.remotePort=+M.port):M&&M.ipAddress?(this.remoteAddress=M.ipAddress,this.remotePort=+M.portNumber):typeof y.googRemoteAddress=="string"&&(M=y.googRemoteAddress.split(":"),this.remoteAddress=M[0],this.remotePort=+M[1]),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(u.forEach(y=>{y.type==="transport"&&y.selectedCandidatePairId&&f(_[y.selectedCandidatePairId]),(y.type==="googCandidatePair"&&y.googActiveConnection==="true"||(y.type==="candidatepair"||y.type==="candidate-pair")&&y.selected)&&f(y)}),!x&&(!Object.keys(_).length||Object.keys(h).length))return void setTimeout(i,100);if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(N){return this.destroy(o(N,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');let y=this._cb;this._cb=null,y(null)}typeof this._channel.bufferedAmountLowThreshold!="number"&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")})};i()}_onInterval(){this._cb&&this._channel&&!(this._channel.bufferedAmount>C)&&this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||(this._pc.signalingState==="stable"&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(i=>{this._pc.removeTrack(i),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(i){this.destroyed||(i.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:i.candidate.candidate,sdpMLineIndex:i.candidate.sdpMLineIndex,sdpMid:i.candidate.sdpMid}}):!i.candidate&&!this._iceComplete&&(this._iceComplete=!0,this.emit("_iceComplete")),i.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(i){if(this.destroyed)return;let c=i.data;c instanceof ArrayBuffer&&(c=b.from(c)),this.push(c)}_onChannelBufferedAmountLow(){if(!this.destroyed&&this._cb){this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);let i=this._cb;this._cb=null,i(null)}}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(i){this.destroyed||i.streams.forEach(c=>{this._debug("on track"),this.emit("track",i.track,c),this._remoteTracks.push({track:i.track,stream:c}),this._remoteStreams.some(u=>u.id===c.id)||(this._remoteStreams.push(c),d(()=>{this._debug("on stream"),this.emit("stream",c)}))})}_debug(){let i=[].slice.call(arguments);i[0]="["+this._id+"] "+i[0],w.apply(null,i)}}S.WEBRTC_SUPPORT=!!k(),S.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},S.channelConfig={},A.exports=S},{buffer:3,debug:4,"err-code":6,"get-browser-rtc":8,"queue-microtask":13,randombytes:14,"readable-stream":29}]},{},[])("/")})});var Gt=1200,Kt=2500,Be=3e4,Ke=O=>{if(O.shouldConnect&&O.ws===null){let D=new WebSocket(O.url),I=O.binaryType,E=null;I&&(D.binaryType=I),O.ws=D,O.connecting=!0,O.connected=!1,D.onmessage=s=>{O.lastMessageReceived=Me();let w=s.data,k=typeof w=="string"?JSON.parse(w):w;k&&k.type==="pong"&&(clearTimeout(E),E=setTimeout(p,Be/2)),O.emit("message",[k,O])};let A=s=>{O.ws!==null&&(O.ws=null,O.connecting=!1,O.connected?(O.connected=!1,O.emit("disconnect",[{type:"disconnect",error:s},O])):O.unsuccessfulReconnects++,setTimeout(Ke,lt(ut(O.unsuccessfulReconnects+1)*Gt,Kt),O)),clearTimeout(E)},p=()=>{O.ws===D&&O.send({type:"ping"})};D.onclose=()=>A(null),D.onerror=s=>A(s),D.onopen=()=>{O.lastMessageReceived=Me(),O.connecting=!1,O.connected=!0,O.unsuccessfulReconnects=0,O.emit("connect",[{type:"connect"},O]),E=setTimeout(p,Be/2)}}},Fe=class extends at{constructor(D,{binaryType:I}={}){super(),this.url=D,this.ws=null,this.binaryType=I||null,this.connected=!1,this.connecting=!1,this.unsuccessfulReconnects=0,this.lastMessageReceived=0,this.shouldConnect=!0,this._checkInterval=setInterval(()=>{this.connected&&Be<Me()-this.lastMessageReceived&&this.ws.close()},Be/2),Ke(this)}send(D){this.ws&&this.ws.send(JSON.stringify(D))}destroy(){clearInterval(this._checkInterval),this.disconnect(),super.destroy()}disconnect(){this.shouldConnect=!1,this.ws!==null&&this.ws.close()}connect(){this.shouldConnect=!0,!this.connected&&this.ws===null&&Ke(this)}};var Ft=Yt(Dt(),1);var It=(O,D)=>{let I=We(O).buffer,E=We(D).buffer;return crypto.subtle.importKey("raw",I,"PBKDF2",!1,["deriveKey"]).then(A=>crypto.subtle.deriveKey({name:"PBKDF2",salt:E,iterations:1e5,hash:"SHA-256"},A,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]))},Je=(O,D)=>{if(!D)return Le(O);let I=crypto.getRandomValues(new Uint8Array(12));return crypto.subtle.encrypt({name:"AES-GCM",iv:I},D,O).then(E=>{let A=Q();return Ae(A,"AES-GCM"),de(A,I),de(A,new Uint8Array(E)),te(A)})},Ut=(O,D)=>{let I=Q();return ht(I,O),Je(te(I),D)},Xe=(O,D)=>{if(!D)return Le(O);let I=ke(O);Pe(I)!=="AES-GCM"&&mt(Ue("Unknown encryption algorithm"));let A=Oe(I),p=Oe(I);return crypto.subtle.decrypt({name:"AES-GCM",iv:A},D,p).then(s=>new Uint8Array(s))},Pt=(O,D)=>Xe(O,D).then(I=>pt(ke(new Uint8Array(I))));var ne=wt("y-webrtc"),ve=0,jt=3,Ne=1,nt=4,je=new Map,ge=new Map,qt=O=>{let D=!0;O.webrtcConns.forEach(I=>{I.synced||(D=!1)}),(!D&&O.synced||D&&!O.synced)&&(O.synced=D,O.provider.emit("synced",[{synced:D}]),ne("synced ",oe,O.name,we," with all peers"))},Wt=(O,D,I)=>{let E=ke(D),A=Q(),p=ft(E);if(O===void 0)return null;let s=O.awareness,w=O.doc,k=!1;switch(p){case ve:{re(A,ve);let n=Ot(E,A,w,O);n===Tt&&!O.synced&&I(),n===St&&(k=!0);break}case jt:re(A,Ne),de(A,xe(s,Array.from(s.getStates().keys()))),k=!0;break;case Ne:xt(s,Oe(E),O);break;case nt:{let n=dt(E)===1,l=Pe(E);if(l!==O.peerId&&(O.bcConns.has(l)&&!n||!O.bcConns.has(l)&&n)){let d=[],o=[];n?(O.bcConns.add(l),o.push(l)):(O.bcConns.delete(l),d.push(l)),O.provider.emit("peers",[{added:o,removed:d,webrtcPeers:Array.from(O.webrtcConns.keys()),bcPeers:Array.from(O.bcConns)}]),Vt(O)}break}default:return console.error("Unable to compute message"),A}return k?A:null},tr=(O,D)=>{let I=O.room;return ne("received message from ",oe,O.remotePeerId,He," (",I.name,")",we,Ye),Wt(I,D,()=>{O.synced=!0,ne("synced ",oe,I.name,we," with ",oe,O.remotePeerId),qt(I)})},Qe=(O,D)=>{ne("send message to ",oe,O.remotePeerId,we,He," (",O.room.name,")",Ye);try{O.peer.send(te(D))}catch{}},rr=(O,D)=>{ne("broadcast message in ",oe,O.name,we),O.webrtcConns.forEach(I=>{try{I.peer.send(D)}catch{}})},qe=class{constructor(D,I,E,A){ne("establishing connection to ",oe,E),this.room=A,this.remotePeerId=E,this.glareToken=void 0,this.closed=!1,this.connected=!1,this.synced=!1,this.peer=new Ft.default({initiator:I,...A.provider.peerOpts}),this.peer.on("signal",p=>{this.glareToken===void 0&&(this.glareToken=Date.now()+Math.random()),it(D,A,{to:E,from:A.peerId,type:"signal",token:this.glareToken,signal:p})}),this.peer.on("connect",()=>{ne("connected to ",oe,E),this.connected=!0;let s=A.provider.doc,w=A.awareness,k=Q();re(k,ve),ze(k,s),Qe(this,k);let n=w.getStates();if(n.size>0){let l=Q();re(l,Ne),de(l,xe(w,Array.from(n.keys()))),Qe(this,l)}}),this.peer.on("close",()=>{this.connected=!1,this.closed=!0,A.webrtcConns.has(this.remotePeerId)&&(A.webrtcConns.delete(this.remotePeerId),A.provider.emit("peers",[{removed:[this.remotePeerId],added:[],webrtcPeers:Array.from(A.webrtcConns.keys()),bcPeers:Array.from(A.bcConns)}])),qt(A),this.peer.destroy(),ne("closed connection to ",oe,E),et(A)}),this.peer.on("error",p=>{ne("Error in connection to ",oe,E,": ",p),et(A)}),this.peer.on("data",p=>{let s=tr(this,p);s!==null&&Qe(this,s)})}destroy(){this.peer.destroy()}},fe=(O,D)=>Je(D,O.key).then(I=>O.mux(()=>Ct(O.name,I))),Mt=(O,D)=>{O.bcconnected&&fe(O,D),rr(O,D)},et=O=>{je.forEach(D=>{D.connected&&(D.send({type:"subscribe",topics:[O.name]}),O.webrtcConns.size<O.provider.maxConns&&it(D,O,{type:"announce",from:O.peerId}))})},Vt=O=>{if(O.provider.filterBcConns){let D=Q();re(D,nt),Ve(D,1),Ae(D,O.peerId),fe(O,te(D))}},tt=class{constructor(D,I,E,A){this.peerId=yt(),this.doc=D,this.awareness=I.awareness,this.provider=I,this.synced=!1,this.name=E,this.key=A,this.webrtcConns=new Map,this.bcConns=new Set,this.mux=Rt(),this.bcconnected=!1,this._bcSubscriber=p=>Xe(new Uint8Array(p),A).then(s=>this.mux(()=>{let w=Wt(this,s,()=>{});w&&fe(this,te(w))})),this._docUpdateHandler=(p,s)=>{let w=Q();re(w,ve),kt(w,p),Mt(this,te(w))},this._awarenessUpdateHandler=({added:p,updated:s,removed:w},k)=>{let n=p.concat(s).concat(w),l=Q();re(l,Ne),de(l,xe(this.awareness,n)),Mt(this,te(l))},this._beforeUnloadHandler=()=>{Ge(this.awareness,[D.clientID],"window unload"),ge.forEach(p=>{p.disconnect()})},typeof window<"u"?window.addEventListener("beforeunload",this._beforeUnloadHandler):typeof process<"u"&&process.on("exit",this._beforeUnloadHandler)}connect(){this.doc.on("update",this._docUpdateHandler),this.awareness.on("update",this._awarenessUpdateHandler),et(this);let D=this.name;vt(D,this._bcSubscriber),this.bcconnected=!0,Vt(this);let I=Q();re(I,ve),ze(I,this.doc),fe(this,te(I));let E=Q();re(E,ve),At(E,this.doc),fe(this,te(E));let A=Q();re(A,jt),fe(this,te(A));let p=Q();re(p,Ne),de(p,xe(this.awareness,[this.doc.clientID])),fe(this,te(p))}disconnect(){je.forEach(I=>{I.connected&&I.send({type:"unsubscribe",topics:[this.name]})}),Ge(this.awareness,[this.doc.clientID],"disconnect");let D=Q();re(D,nt),Ve(D,0),Ae(D,this.peerId),fe(this,te(D)),Et(this.name,this._bcSubscriber),this.bcconnected=!1,this.doc.off("update",this._docUpdateHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.webrtcConns.forEach(I=>I.destroy())}destroy(){this.disconnect(),typeof window<"u"?window.removeEventListener("beforeunload",this._beforeUnloadHandler):typeof process<"u"&&process.off("exit",this._beforeUnloadHandler)}},nr=(O,D,I,E)=>{if(ge.has(I))throw Ue(`A Yjs Doc connected to room "${I}" already exists!`);let A=new tt(O,D,I,E);return ge.set(I,A),A},it=(O,D,I)=>{D.key?Ut(I,D.key).then(E=>{O.send({type:"publish",topic:D.name,data:bt(E)})}):O.send({type:"publish",topic:D.name,data:I})},rt=class extends Fe{constructor(D){super(D),this.providers=new Set,this.on("connect",()=>{ne(`connected (${D})`);let I=Array.from(ge.keys());this.send({type:"subscribe",topics:I}),ge.forEach(E=>it(this,E,{type:"announce",from:E.peerId}))}),this.on("message",I=>{switch(I.type){case"publish":{let E=I.topic,A=ge.get(E);if(A==null||typeof E!="string")return;let p=s=>{let w=A.webrtcConns,k=A.peerId;if(s==null||s.from===k||s.to!==void 0&&s.to!==k||A.bcConns.has(s.from))return;let n=w.has(s.from)?()=>{}:()=>A.provider.emit("peers",[{removed:[],added:[s.from],webrtcPeers:Array.from(A.webrtcConns.keys()),bcPeers:Array.from(A.bcConns)}]);switch(s.type){case"announce":w.size<A.provider.maxConns&&(Ie(w,s.from,()=>new qe(this,!0,s.from,A)),n());break;case"signal":if(s.signal.type==="offer"){let l=w.get(s.from);if(l){let d=s.token,o=l.glareToken;if(o&&o>d){ne("offer rejected: ",s.from);return}l.glareToken=void 0}}if(s.signal.type==="answer"){ne("offer answered by: ",s.from);let l=w.get(s.from);l.glareToken=void 0}s.to===k&&(Ie(w,s.from,()=>new qe(this,!1,s.from,A)).peer.signal(s.signal),n());break}};A.key?typeof I.data=="string"&&Pt(_t(I.data),A.key).then(p):p(I.data)}}}),this.on("disconnect",()=>ne(`disconnect (${D})`))}},Ze=O=>{O.emit("status",[{connected:O.connected}])},Bt=class extends ot{constructor(D,I,{signaling:E=["wss://y-webrtc-eu.fly.dev"],password:A=null,awareness:p=new Lt(I),maxConns:s=20+ct(gt()*15),filterBcConns:w=!0,peerOpts:k={}}={}){super(),this.roomName=D,this.doc=I,this.filterBcConns=w,this.awareness=p,this.shouldConnect=!1,this.signalingUrls=E,this.signalingConns=[],this.maxConns=s,this.peerOpts=k,this.key=A?It(A,D):Le(null),this.room=null,this.key.then(n=>{this.room=nr(I,this,D,n),this.shouldConnect?this.room.connect():this.room.disconnect(),Ze(this)}),this.connect(),this.destroy=this.destroy.bind(this),I.on("destroy",this.destroy)}get connected(){return this.room!==null&&this.shouldConnect}connect(){this.shouldConnect=!0,this.signalingUrls.forEach(D=>{let I=Ie(je,D,()=>new rt(D));this.signalingConns.push(I),I.providers.add(this)}),this.room&&(this.room.connect(),Ze(this))}disconnect(){this.shouldConnect=!1,this.signalingConns.forEach(D=>{D.providers.delete(this),D.providers.size===0&&(D.destroy(),je.delete(D.url))}),this.room&&(this.room.disconnect(),Ze(this))}destroy(){this.doc.off("destroy",this.destroy),this.key.then(()=>{this.room.destroy(),ge.delete(this.roomName)}),super.destroy()}};export{tt as Room,rt as SignalingConn,qe as WebrtcConn,Bt as WebrtcProvider};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as B,b as Q,c as h,e as L,f as p,g as W,h as j,i as N}from"./chunk-CFWAU3WN.js";import{a as $,b as V,c as u,d as O}from"./chunk-Y4CBBIL4.js";import{A as k,F as A,M as D,P,d as R,h as H,j as T,l as a,m as _,n as o,p as i,r as w,w as E,x as M,z as U}from"./chunk-VJBGANAS.js";import"./chunk-23NN352E.js";var ce=0;var Y=(e,n,s)=>{U(e)===ce&&s(n,k(e))};var q=e=>D(e,(n,s)=>`${encodeURIComponent(s)}=${encodeURIComponent(n)}`).join("&");var g=0,G=3,f=1,ae=2,b=[];b[g]=(e,n,s,t,c)=>{i(e,g);let r=N(n,e,s.doc,s);t&&r===L&&!s.synced&&(s.synced=!0)};b[G]=(e,n,s,t,c)=>{i(e,f),w(e,u(s.awareness,Array.from(s.awareness.getStates().keys())))};b[f]=(e,n,s,t,c)=>{O(s.awareness,M(n),s)};b[ae]=(e,n,s,t,c)=>{Y(n,s.doc,(r,m)=>re(s,m))};var z=3e4,re=(e,n)=>console.warn(`Permission denied to access ${e.url}.
|
|
2
|
+
${n}`),J=(e,n,s)=>{let t=E(n),c=a(),r=U(t),m=e.messageHandlers[r];return m?m(c,t,e,s,r):console.error("Unable to compute message"),c},de=e=>!(e.code>=4400&&e.code<4500),C=(e,n,s)=>{if(n!==null&&n===e.ws){e.emit("connection-close",[s,e]),e.ws=null,n.onmessage=null,n.onopen=null,n.onclose=null,n.onerror=()=>{},n.close(),e.wsconnecting=!1,e.wsconnected&&(e.wsconnected=!1,e.synced=!1,V(e.awareness,Array.from(e.awareness.getStates().keys()).filter(c=>c!==e.doc.clientID),e),e.emit("status",[{status:"disconnected"}])),e.wsUnsuccessfulReconnects++;let t=null;s!=null&&!e.shouldReconnect(s,e)&&(e.shouldConnect=!1,t={code:s.code,reason:s.reason}),setTimeout(K,H(T(2,e.wsUnsuccessfulReconnects)*100,e.maxBackoffTime),e),t!==null&&e.emit("closed",[t,e])}},K=e=>{if(e.shouldConnect&&e.ws===null){let n=new e._WS(e.url,e.protocols);n.binaryType="arraybuffer",e.ws=n,e.wsconnecting=!0,e.wsconnected=!1,e.synced=!1,n.onmessage=s=>{if(e.ws!==n)return;e.wsLastMessageReceived=A();let t=J(e,new Uint8Array(s.data),!0);_(t)>1&&n.send(o(t))},n.onerror=s=>{e.ws===n&&e.emit("connection-error",[s,e])},n.onclose=s=>{C(e,n,s)},n.onopen=()=>{if(e.ws!==n)return;e.wsLastMessageReceived=A(),e.wsconnecting=!1,e.wsconnected=!0,e.emit("status",[{status:"connected"}]);let s=a();if(i(s,g),p(s,e.doc),n.send(o(s)),e.awareness.getLocalState()!==null){let t=a();i(t,f),w(t,u(e.awareness,[e.doc.clientID])),n.send(o(t))}},e.emit("status",[{status:"connecting"}])}},x=(e,n)=>{let s=e.ws;e.wsconnected&&s&&s.readyState===s.OPEN&&s.send(n),e.bcconnected&&h(e.bcChannel,n,e)},F=class extends R{constructor(n,s,t,{connect:c=!0,awareness:r=new $(t),params:m={},protocols:X=[],WebSocketPolyfill:Z=WebSocket,resyncInterval:I=-1,maxBackoffTime:v=2500,disableBc:ee=!1,shouldReconnect:ne=de}={}){for(super();n[n.length-1]==="/";)n=n.slice(0,n.length-1);this.serverUrl=n,this.bcChannel=n+"/"+s,this.maxBackoffTime=v,this.shouldReconnect=ne,this.params=m,this.protocols=X,this.roomname=s,this.doc=t,this._WS=Z,this.awareness=r,this.wsconnected=!1,this.wsconnecting=!1,this.bcconnected=!1,this.disableBc=ee,this.wsUnsuccessfulReconnects=0,this.messageHandlers=b.slice(),this._synced=!1,this.ws=null,this.wsLastMessageReceived=0,this.shouldConnect=c,this._resyncInterval=0,I>0&&(this._resyncInterval=setInterval(()=>{if(this.ws&&this.ws.readyState===WebSocket.OPEN){let d=a();i(d,g),p(d,t),this.ws.send(o(d))}},I)),this._bcSubscriber=(d,y)=>{if(y!==this){let l=J(this,new Uint8Array(d),!1);_(l)>1&&h(this.bcChannel,o(l),this)}},this._updateHandler=(d,y)=>{if(y!==this){let l=a();i(l,g),j(l,d),x(this,o(l))}},this.doc.on("update",this._updateHandler),this._awarenessUpdateHandler=({added:d,updated:y,removed:l},le)=>{let se=d.concat(y).concat(l),S=a();i(S,f),w(S,u(r,se)),x(this,o(S))},this._exitHandler=()=>{V(this.awareness,[t.clientID],"app closed")},P&&typeof process<"u"&&process.on("exit",this._exitHandler),r.on("update",this._awarenessUpdateHandler),this._checkInterval=setInterval(()=>{this.wsconnected&&z<A()-this.wsLastMessageReceived&&C(this,this.ws,null)},z/10),c&&this.connect()}get url(){let n=q(this.params);return this.serverUrl+"/"+this.roomname+(n.length===0?"":"?"+n)}get synced(){return this._synced}set synced(n){this._synced!==n&&(this._synced=n,n&&(this.wsUnsuccessfulReconnects=0),this.emit("synced",[n]),this.emit("sync",[n]))}destroy(){this._resyncInterval!==0&&clearInterval(this._resyncInterval),clearInterval(this._checkInterval),this.disconnect(),P&&typeof process<"u"&&process.off("exit",this._exitHandler),this.awareness.off("update",this._awarenessUpdateHandler),this.doc.off("update",this._updateHandler),super.destroy()}connectBc(){if(this.disableBc)return;this.bcconnected||(B(this.bcChannel,this._bcSubscriber),this.bcconnected=!0);let n=a();i(n,g),p(n,this.doc),h(this.bcChannel,o(n),this);let s=a();i(s,g),W(s,this.doc),h(this.bcChannel,o(s),this);let t=a();i(t,G),h(this.bcChannel,o(t),this);let c=a();i(c,f),w(c,u(this.awareness,[this.doc.clientID])),h(this.bcChannel,o(c),this)}disconnectBc(){let n=a();i(n,f),w(n,u(this.awareness,[this.doc.clientID],new Map)),x(this,o(n)),this.bcconnected&&(Q(this.bcChannel,this._bcSubscriber),this.bcconnected=!1)}disconnect(){this.shouldConnect=!1,this.disconnectBc(),this.ws!==null&&C(this,this.ws,null)}connect(){this.shouldConnect=!0,!this.wsconnected&&this.ws===null&&(K(this),this.connectBc())}};export{F as WebsocketProvider,ae as messageAuth,f as messageAwareness,G as messageQueryAwareness,g as messageSync};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$a as $,Aa as A,Ab as Aa,Ba as B,Bb as Ba,Ca as C,Cb as Ca,Da as D,Db as Da,Ea as E,Eb as Ea,Fa as F,Fb as Fa,Ga as G,Gb as Ga,Ha as H,Hb as Ha,Ia as I,Ib as Ia,Ja as J,Jb as Ja,Ka as K,Kb as Ka,La as L,Lb as La,Ma as M,Mb as Ma,Na as N,Nb as Na,Oa as O,Ob as Oa,Pa as P,Pb as Pa,Qa as Q,Qb as Qa,Ra as R,Rb as Ra,Sa as S,Sb as Sa,Ta as T,Tb as Ta,Ua as U,Ub as Ua,Va as V,Vb as Va,Wa as W,Wb as Wa,Xa as X,Ya as Y,Za as Z,_a as _,aa as a,ab as aa,ba as b,bb as ba,ca as c,cb as ca,da as d,db as da,ea as e,eb as ea,fa as f,fb as fa,ga as g,gb as ga,ha as h,hb as ha,ia as i,ib as ia,ja as j,jb as ja,ka as k,kb as ka,la as l,lb as la,ma as m,mb as ma,na as n,nb as na,oa as o,ob as oa,pa as p,pb as pa,qa as q,qb as qa,ra as r,rb as ra,sa as s,sb as sa,ta as t,tb as ta,ua as u,ub as ua,va as v,vb as va,wa as w,wb as wa,xa as x,xb as xa,ya as y,yb as ya,za as z,zb as za}from"./chunk-VJBGANAS.js";import"./chunk-23NN352E.js";export{E as AbsolutePosition,a as AbstractConnector,Ka as AbstractStruct,ua as AbstractType,za as Array,Sa as ContentAny,Ma as ContentBinary,Na as ContentDeleted,Oa as ContentDoc,Pa as ContentEmbed,Qa as ContentFormat,Ra as ContentJSON,Ta as ContentString,Ua as ContentType,h as Doc,La as GC,u as ID,Va as Item,Ba as Map,A as PermanentUserData,B as RelativePosition,Wa as Skip,K as Snapshot,Ea as Text,_ as Transaction,ba as UndoManager,i as UpdateDecoderV1,j as UpdateDecoderV2,k as UpdateEncoderV1,l as UpdateEncoderV2,Ga as XmlElement,Fa as XmlFragment,Ia as XmlHook,Ja as XmlText,ya as YArrayEvent,sa as YEvent,Aa as YMapEvent,Da as YTextEvent,Ha as YXmlEvent,p as applyUpdate,o as applyUpdateV2,Ca as cleanupYTextFormatting,v as compareIDs,J as compareRelativePositions,qa as convertUpdateFormatV1ToV2,ra as convertUpdateFormatV2ToV1,I as createAbsolutePositionFromRelativePosition,e as createDeleteSet,f as createDeleteSetFromStructStore,T as createDocFromSnapshot,w as createID,D as createRelativePositionFromJSON,F as createRelativePositionFromTypeIndex,Q as createSnapshot,H as decodeRelativePosition,P as decodeSnapshot,O as decodeSnapshotV2,s as decodeStateVector,ea as decodeUpdate,fa as decodeUpdateV2,na as diffUpdate,ma as diffUpdateV2,R as emptySnapshot,G as encodeRelativePosition,N as encodeSnapshot,M as encodeSnapshotV2,r as encodeStateAsUpdate,q as encodeStateAsUpdateV2,t as encodeStateVector,ia as encodeStateVectorFromUpdate,ha as encodeStateVectorFromUpdateV2,g as equalDeleteSets,L as equalSnapshots,W as findIndexSS,x as findRootTypeKey,X as getItem,Z as getItemCleanEnd,Y as getItemCleanStart,V as getState,ta as getTypeChildren,c as isDeleted,y as isParentOf,b as iterateDeletedStructs,z as logType,ca as logUpdate,da as logUpdateV2,d as mergeDeleteSets,ga as mergeUpdates,la as mergeUpdatesV2,oa as obfuscateUpdate,pa as obfuscateUpdateV2,ka as parseUpdateMeta,ja as parseUpdateMetaV2,n as readUpdate,m as readUpdateV2,C as relativePositionToJSON,S as snapshot,U as snapshotContainsUpdate,aa as transact,$ as tryGc,va as typeListToArraySnapshot,xa as typeMapGetAllSnapshot,wa as typeMapGetSnapshot};
|