@clevertask/scribe 0.0.3 → 0.0.5

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.
@@ -1,30 +1,30 @@
1
- import { M as Ae, m as te, c as be, a as $t, P as Wt, d as Le, g as Oe, f as ve, h as Se, i as Ce } from "../../../index-CUP7vhu5.js";
2
- const we = "aaa1rp3barth4b0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0faromeo7ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re2s2c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y0eats7k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking0channel11l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t0isalat7u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0at2delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d0network8tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntdoor4ier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5gtv3iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0eles2s3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1nder2le4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster5ia3d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4de2k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0cys3drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7serati6ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic3tual5v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rthwesternmutual14on4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3ssagens7y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cher3ks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w0time7i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ffany5ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0channel7ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lkswagen7vo3te1ing3o2yage5u0elos6wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", Te = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5تصالات6رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", q = (t, e) => {
3
- for (const n in e)
4
- t[n] = e[n];
1
+ import { M as Pe, c as Ne, m as le, P as qt, a as Vt, d as Ie, g as we, f as ve, h as He, i as Ue } from "../../../index-DzExyr-e.js";
2
+ const xe = "aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", De = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", B = (t, n) => {
3
+ for (const e in n)
4
+ t[e] = n[e];
5
5
  return t;
6
- }, Ht = "numeric", It = "ascii", Dt = "alpha", ft = "asciinumeric", ut = "alphanumeric", zt = "domain", ue = "emoji", Pe = "scheme", Re = "slashscheme", ee = "whitespace";
7
- function xe(t, e) {
8
- return t in e || (e[t] = []), e[t];
6
+ }, zt = "numeric", Wt = "ascii", Ft = "alpha", G = "asciinumeric", K = "alphanumeric", Kt = "domain", ge = "emoji", Me = "scheme", je = "slashscheme", Ut = "whitespace";
7
+ function Be(t, n) {
8
+ return t in n || (n[t] = []), n[t];
9
9
  }
10
- function z(t, e, n) {
11
- e[Ht] && (e[ft] = !0, e[ut] = !0), e[It] && (e[ft] = !0, e[Dt] = !0), e[ft] && (e[ut] = !0), e[Dt] && (e[ut] = !0), e[ut] && (e[zt] = !0), e[ue] && (e[zt] = !0);
12
- for (const s in e) {
13
- const o = xe(s, n);
14
- o.indexOf(t) < 0 && o.push(t);
10
+ function D(t, n, e) {
11
+ n[zt] && (n[G] = !0, n[K] = !0), n[Wt] && (n[G] = !0, n[Ft] = !0), n[G] && (n[K] = !0), n[Ft] && (n[K] = !0), n[K] && (n[Kt] = !0), n[ge] && (n[Kt] = !0);
12
+ for (const o in n) {
13
+ const s = Be(o, e);
14
+ s.indexOf(t) < 0 && s.push(t);
15
15
  }
16
16
  }
17
- function Ne(t, e) {
18
- const n = {};
19
- for (const s in e)
20
- e[s].indexOf(t) >= 0 && (n[s] = !0);
21
- return n;
17
+ function ze(t, n) {
18
+ const e = {};
19
+ for (const o in n)
20
+ n[o].indexOf(t) >= 0 && (e[o] = !0);
21
+ return e;
22
22
  }
23
- function A(t) {
24
- t === void 0 && (t = null), this.j = {}, this.jr = [], this.jd = null, this.t = t;
23
+ function C(t = null) {
24
+ this.j = {}, this.jr = [], this.jd = null, this.t = t;
25
25
  }
26
- A.groups = {};
27
- A.prototype = {
26
+ C.groups = {};
27
+ C.prototype = {
28
28
  accepts() {
29
29
  return !!this.t;
30
30
  },
@@ -35,15 +35,15 @@ A.prototype = {
35
35
  * @returns {?State<T>} the next state, if any
36
36
  */
37
37
  go(t) {
38
- const e = this, n = e.j[t];
39
- if (n)
40
- return n;
41
- for (let s = 0; s < e.jr.length; s++) {
42
- const o = e.jr[s][0], a = e.jr[s][1];
43
- if (a && o.test(t))
44
- return a;
38
+ const n = this, e = n.j[t];
39
+ if (e)
40
+ return e;
41
+ for (let o = 0; o < n.jr.length; o++) {
42
+ const s = n.jr[o][0], i = n.jr[o][1];
43
+ if (i && s.test(t))
44
+ return i;
45
45
  }
46
- return e.jd;
46
+ return n.jd;
47
47
  },
48
48
  /**
49
49
  * Whether the state has a transition for the given input. Set the second
@@ -52,8 +52,8 @@ A.prototype = {
52
52
  * @param {string} input
53
53
  * @param {boolean} exactOnly
54
54
  */
55
- has(t, e) {
56
- return e === void 0 && (e = !1), e ? t in this.j : !!this.go(t);
55
+ has(t, n = !1) {
56
+ return n ? t in this.j : !!this.go(t);
57
57
  },
58
58
  /**
59
59
  * Short for "transition all"; create a transition from the array of items
@@ -63,9 +63,9 @@ A.prototype = {
63
63
  * @param {Flags} [flags] Collections flags to add token to
64
64
  * @param {Collections<T>} [groups] Master list of token groups
65
65
  */
66
- ta(t, e, n, s) {
67
- for (let o = 0; o < t.length; o++)
68
- this.tt(t[o], e, n, s);
66
+ ta(t, n, e, o) {
67
+ for (let s = 0; s < t.length; s++)
68
+ this.tt(t[s], n, e, o);
69
69
  },
70
70
  /**
71
71
  * Short for "take regexp transition"; defines a transition for this state
@@ -76,10 +76,10 @@ A.prototype = {
76
76
  * @param {Collections<T>} [groups] Master list of token groups
77
77
  * @returns {State<T>} taken after the given input
78
78
  */
79
- tr(t, e, n, s) {
80
- s = s || A.groups;
81
- let o;
82
- return e && e.j ? o = e : (o = new A(e), n && s && z(e, n, s)), this.jr.push([t, o]), o;
79
+ tr(t, n, e, o) {
80
+ o = o || C.groups;
81
+ let s;
82
+ return n && n.j ? s = n : (s = new C(n), e && o && D(n, e, o)), this.jr.push([t, s]), s;
83
83
  },
84
84
  /**
85
85
  * Short for "take transitions", will take as many sequential transitions as
@@ -91,14 +91,14 @@ A.prototype = {
91
91
  * @param {Collections<T>} [groups] Master list of token groups
92
92
  * @returns {State<T>} taken after the given input
93
93
  */
94
- ts(t, e, n, s) {
95
- let o = this;
96
- const a = t.length;
97
- if (!a)
98
- return o;
99
- for (let i = 0; i < a - 1; i++)
100
- o = o.tt(t[i]);
101
- return o.tt(t[a - 1], e, n, s);
94
+ ts(t, n, e, o) {
95
+ let s = this;
96
+ const i = t.length;
97
+ if (!i)
98
+ return s;
99
+ for (let a = 0; a < i - 1; a++)
100
+ s = s.tt(t[a]);
101
+ return s.tt(t[i - 1], n, e, o);
102
102
  },
103
103
  /**
104
104
  * Short for "take transition", this is a method for building/working with
@@ -126,200 +126,216 @@ A.prototype = {
126
126
  * @param {Collections<T>} [groups] Master list of groups
127
127
  * @returns {State<T>} taken after the given input
128
128
  */
129
- tt(t, e, n, s) {
130
- s = s || A.groups;
131
- const o = this;
132
- if (e && e.j)
133
- return o.j[t] = e, e;
134
- const a = e;
135
- let i, l = o.go(t);
136
- if (l ? (i = new A(), q(i.j, l.j), i.jr.push.apply(i.jr, l.jr), i.jd = l.jd, i.t = l.t) : i = new A(), a) {
137
- if (s)
138
- if (i.t && typeof i.t == "string") {
139
- const f = q(Ne(i.t, s), n);
140
- z(a, f, s);
141
- } else n && z(a, n, s);
142
- i.t = a;
129
+ tt(t, n, e, o) {
130
+ o = o || C.groups;
131
+ const s = this;
132
+ if (n && n.j)
133
+ return s.j[t] = n, n;
134
+ const i = n;
135
+ let a, l = s.go(t);
136
+ if (l ? (a = new C(), B(a.j, l.j), a.jr.push.apply(a.jr, l.jr), a.jd = l.jd, a.t = l.t) : a = new C(), i) {
137
+ if (o)
138
+ if (a.t && typeof a.t == "string") {
139
+ const h = B(ze(a.t, o), e);
140
+ D(i, h, o);
141
+ } else e && D(i, e, o);
142
+ a.t = i;
143
143
  }
144
- return o.j[t] = i, i;
144
+ return s.j[t] = a, a;
145
145
  }
146
146
  };
147
- const c = (t, e, n, s, o) => t.ta(e, n, s, o), L = (t, e, n, s, o) => t.tr(e, n, s, o), ne = (t, e, n, s, o) => t.ts(e, n, s, o), r = (t, e, n, s, o) => t.tt(e, n, s, o), T = "WORD", Bt = "UWORD", et = "LOCALHOST", Kt = "TLD", Qt = "UTLD", pt = "SCHEME", Q = "SLASH_SCHEME", _t = "NUM", de = "WS", qt = "NL", $ = "OPENBRACE", V = "OPENBRACKET", X = "OPENANGLEBRACKET", Z = "OPENPAREN", I = "CLOSEBRACE", W = "CLOSEBRACKET", _ = "CLOSEANGLEBRACKET", D = "CLOSEPAREN", gt = "AMPERSAND", mt = "APOSTROPHE", kt = "ASTERISK", x = "AT", Et = "BACKSLASH", yt = "BACKTICK", At = "CARET", N = "COLON", Ft = "COMMA", bt = "DOLLAR", v = "DOT", Lt = "EQUALS", Gt = "EXCLAMATION", S = "HYPHEN", Ot = "PERCENT", vt = "PIPE", St = "PLUS", Ct = "POUND", wt = "QUERY", Yt = "QUOTE", Jt = "SEMI", C = "SLASH", tt = "TILDE", Tt = "UNDERSCORE", he = "EMOJI", Pt = "SYM";
148
- var fe = /* @__PURE__ */ Object.freeze({
147
+ const u = (t, n, e, o, s) => t.ta(n, e, o, s), A = (t, n, e, o, s) => t.tr(n, e, o, s), ce = (t, n, e, o, s) => t.ts(n, e, o, s), r = (t, n, e, o, s) => t.tt(n, e, o, s), w = "WORD", Gt = "UWORD", Ee = "ASCIINUMERICAL", Ae = "ALPHANUMERICAL", J = "LOCALHOST", $t = "TLD", Qt = "UTLD", nt = "SCHEME", j = "SLASH_SCHEME", Jt = "NUM", _t = "WS", Yt = "NL", $ = "OPENBRACE", Q = "CLOSEBRACE", ot = "OPENBRACKET", st = "CLOSEBRACKET", rt = "OPENPAREN", it = "CLOSEPAREN", at = "OPENANGLEBRACKET", lt = "CLOSEANGLEBRACKET", ct = "FULLWIDTHLEFTPAREN", ut = "FULLWIDTHRIGHTPAREN", dt = "LEFTCORNERBRACKET", ht = "RIGHTCORNERBRACKET", ft = "LEFTWHITECORNERBRACKET", pt = "RIGHTWHITECORNERBRACKET", mt = "FULLWIDTHLESSTHAN", gt = "FULLWIDTHGREATERTHAN", Et = "AMPERSAND", Xt = "APOSTROPHE", At = "ASTERISK", H = "AT", Lt = "BACKSLASH", kt = "BACKTICK", Tt = "CARET", U = "COLON", Zt = "COMMA", yt = "DOLLAR", S = "DOT", Ct = "EQUALS", te = "EXCLAMATION", b = "HYPHEN", _ = "PERCENT", Rt = "PIPE", Ot = "PLUS", bt = "POUND", q = "QUERY", ee = "QUOTE", Le = "FULLWIDTHMIDDLEDOT", ne = "SEMI", P = "SLASH", V = "TILDE", St = "UNDERSCORE", ke = "EMOJI", Pt = "SYM";
148
+ var Te = /* @__PURE__ */ Object.freeze({
149
149
  __proto__: null,
150
- WORD: T,
151
- UWORD: Bt,
152
- LOCALHOST: et,
153
- TLD: Kt,
150
+ WORD: w,
151
+ UWORD: Gt,
152
+ ASCIINUMERICAL: Ee,
153
+ ALPHANUMERICAL: Ae,
154
+ LOCALHOST: J,
155
+ TLD: $t,
154
156
  UTLD: Qt,
155
- SCHEME: pt,
156
- SLASH_SCHEME: Q,
157
- NUM: _t,
158
- WS: de,
159
- NL: qt,
157
+ SCHEME: nt,
158
+ SLASH_SCHEME: j,
159
+ NUM: Jt,
160
+ WS: _t,
161
+ NL: Yt,
160
162
  OPENBRACE: $,
161
- OPENBRACKET: V,
162
- OPENANGLEBRACKET: X,
163
- OPENPAREN: Z,
164
- CLOSEBRACE: I,
165
- CLOSEBRACKET: W,
166
- CLOSEANGLEBRACKET: _,
167
- CLOSEPAREN: D,
168
- AMPERSAND: gt,
169
- APOSTROPHE: mt,
170
- ASTERISK: kt,
171
- AT: x,
172
- BACKSLASH: Et,
173
- BACKTICK: yt,
174
- CARET: At,
175
- COLON: N,
176
- COMMA: Ft,
177
- DOLLAR: bt,
178
- DOT: v,
179
- EQUALS: Lt,
180
- EXCLAMATION: Gt,
181
- HYPHEN: S,
182
- PERCENT: Ot,
183
- PIPE: vt,
184
- PLUS: St,
185
- POUND: Ct,
186
- QUERY: wt,
187
- QUOTE: Yt,
188
- SEMI: Jt,
189
- SLASH: C,
190
- TILDE: tt,
191
- UNDERSCORE: Tt,
192
- EMOJI: he,
163
+ CLOSEBRACE: Q,
164
+ OPENBRACKET: ot,
165
+ CLOSEBRACKET: st,
166
+ OPENPAREN: rt,
167
+ CLOSEPAREN: it,
168
+ OPENANGLEBRACKET: at,
169
+ CLOSEANGLEBRACKET: lt,
170
+ FULLWIDTHLEFTPAREN: ct,
171
+ FULLWIDTHRIGHTPAREN: ut,
172
+ LEFTCORNERBRACKET: dt,
173
+ RIGHTCORNERBRACKET: ht,
174
+ LEFTWHITECORNERBRACKET: ft,
175
+ RIGHTWHITECORNERBRACKET: pt,
176
+ FULLWIDTHLESSTHAN: mt,
177
+ FULLWIDTHGREATERTHAN: gt,
178
+ AMPERSAND: Et,
179
+ APOSTROPHE: Xt,
180
+ ASTERISK: At,
181
+ AT: H,
182
+ BACKSLASH: Lt,
183
+ BACKTICK: kt,
184
+ CARET: Tt,
185
+ COLON: U,
186
+ COMMA: Zt,
187
+ DOLLAR: yt,
188
+ DOT: S,
189
+ EQUALS: Ct,
190
+ EXCLAMATION: te,
191
+ HYPHEN: b,
192
+ PERCENT: _,
193
+ PIPE: Rt,
194
+ PLUS: Ot,
195
+ POUND: bt,
196
+ QUERY: q,
197
+ QUOTE: ee,
198
+ FULLWIDTHMIDDLEDOT: Le,
199
+ SEMI: ne,
200
+ SLASH: P,
201
+ TILDE: V,
202
+ UNDERSCORE: St,
203
+ EMOJI: ke,
193
204
  SYM: Pt
194
205
  });
195
- const K = /[a-z]/, Nt = new RegExp("\\p{L}", "u"), jt = new RegExp("\\p{Emoji}", "u"), Mt = /\d/, se = /\s/, oe = `
196
- `, je = "️", Me = "‍";
197
- let dt = null, ht = null;
198
- function Ue(t) {
199
- t === void 0 && (t = []);
200
- const e = {};
201
- A.groups = e;
202
- const n = new A();
203
- dt == null && (dt = re(we)), ht == null && (ht = re(Te)), r(n, "'", mt), r(n, "{", $), r(n, "[", V), r(n, "<", X), r(n, "(", Z), r(n, "}", I), r(n, "]", W), r(n, ">", _), r(n, ")", D), r(n, "&", gt), r(n, "*", kt), r(n, "@", x), r(n, "`", yt), r(n, "^", At), r(n, ":", N), r(n, ",", Ft), r(n, "$", bt), r(n, ".", v), r(n, "=", Lt), r(n, "!", Gt), r(n, "-", S), r(n, "%", Ot), r(n, "|", vt), r(n, "+", St), r(n, "#", Ct), r(n, "?", wt), r(n, '"', Yt), r(n, "/", C), r(n, ";", Jt), r(n, "~", tt), r(n, "_", Tt), r(n, "\\", Et);
204
- const s = L(n, Mt, _t, {
205
- [Ht]: !0
206
+ const N = /[a-z]/, F = new RegExp("\\p{L}", "u"), xt = new RegExp("\\p{Emoji}", "u"), I = /\d/, Dt = /\s/, ue = "\r", Mt = `
207
+ `, We = "️", Fe = "‍", jt = "";
208
+ let Z = null, tt = null;
209
+ function Ke(t = []) {
210
+ const n = {};
211
+ C.groups = n;
212
+ const e = new C();
213
+ Z == null && (Z = de(xe)), tt == null && (tt = de(De)), r(e, "'", Xt), r(e, "{", $), r(e, "}", Q), r(e, "[", ot), r(e, "]", st), r(e, "(", rt), r(e, ")", it), r(e, "<", at), r(e, ">", lt), r(e, "(", ct), r(e, ")", ut), r(e, "「", dt), r(e, "」", ht), r(e, "『", ft), r(e, "』", pt), r(e, "<", mt), r(e, ">", gt), r(e, "&", Et), r(e, "*", At), r(e, "@", H), r(e, "`", kt), r(e, "^", Tt), r(e, ":", U), r(e, ",", Zt), r(e, "$", yt), r(e, ".", S), r(e, "=", Ct), r(e, "!", te), r(e, "-", b), r(e, "%", _), r(e, "|", Rt), r(e, "+", Ot), r(e, "#", bt), r(e, "?", q), r(e, '"', ee), r(e, "/", P), r(e, ";", ne), r(e, "~", V), r(e, "_", St), r(e, "\\", Lt), r(e, "・", Le);
214
+ const o = A(e, I, Jt, {
215
+ [zt]: !0
206
216
  });
207
- L(s, Mt, s);
208
- const o = L(n, K, T, {
209
- [It]: !0
217
+ A(o, I, o);
218
+ const s = A(o, N, Ee, {
219
+ [G]: !0
220
+ }), i = A(o, F, Ae, {
221
+ [K]: !0
222
+ }), a = A(e, N, w, {
223
+ [Wt]: !0
210
224
  });
211
- L(o, K, o);
212
- const a = L(n, Nt, Bt, {
213
- [Dt]: !0
225
+ A(a, I, s), A(a, N, a), A(s, I, s), A(s, N, s);
226
+ const l = A(e, F, Gt, {
227
+ [Ft]: !0
214
228
  });
215
- L(a, K), L(a, Nt, a);
216
- const i = L(n, se, de, {
217
- [ee]: !0
229
+ A(l, N), A(l, I, i), A(l, F, l), A(i, I, i), A(i, N), A(i, F, i);
230
+ const h = r(e, Mt, Yt, {
231
+ [Ut]: !0
232
+ }), c = r(e, ue, _t, {
233
+ [Ut]: !0
234
+ }), f = A(e, Dt, _t, {
235
+ [Ut]: !0
218
236
  });
219
- r(n, oe, qt, {
220
- [ee]: !0
221
- }), r(i, oe), L(i, se, i);
222
- const l = L(n, jt, he, {
223
- [ue]: !0
237
+ r(e, jt, f), r(c, Mt, h), r(c, jt, f), A(c, Dt, f), r(f, ue), r(f, Mt), A(f, Dt, f), r(f, jt, f);
238
+ const d = A(e, xt, ke, {
239
+ [ge]: !0
224
240
  });
225
- L(l, jt, l), r(l, je, l);
226
- const f = r(l, Me);
227
- L(f, jt, l);
228
- const u = [[K, o]], g = [[K, null], [Nt, a]];
229
- for (let d = 0; d < dt.length; d++)
230
- R(n, dt[d], Kt, T, u);
231
- for (let d = 0; d < ht.length; d++)
232
- R(n, ht[d], Qt, Bt, g);
233
- z(Kt, {
241
+ r(d, "#"), A(d, xt, d), r(d, We, d);
242
+ const m = r(d, Fe);
243
+ r(m, "#"), A(m, xt, d);
244
+ const E = [[N, a], [I, s]], R = [[N, null], [F, l], [I, i]];
245
+ for (let L = 0; L < Z.length; L++)
246
+ v(e, Z[L], $t, w, E);
247
+ for (let L = 0; L < tt.length; L++)
248
+ v(e, tt[L], Qt, Gt, R);
249
+ D($t, {
234
250
  tld: !0,
235
251
  ascii: !0
236
- }, e), z(Qt, {
252
+ }, n), D(Qt, {
237
253
  utld: !0,
238
254
  alpha: !0
239
- }, e), R(n, "file", pt, T, u), R(n, "mailto", pt, T, u), R(n, "http", Q, T, u), R(n, "https", Q, T, u), R(n, "ftp", Q, T, u), R(n, "ftps", Q, T, u), z(pt, {
255
+ }, n), v(e, "file", nt, w, E), v(e, "mailto", nt, w, E), v(e, "http", j, w, E), v(e, "https", j, w, E), v(e, "ftp", j, w, E), v(e, "ftps", j, w, E), D(nt, {
240
256
  scheme: !0,
241
257
  ascii: !0
242
- }, e), z(Q, {
258
+ }, n), D(j, {
243
259
  slashscheme: !0,
244
260
  ascii: !0
245
- }, e), t = t.sort((d, h) => d[0] > h[0] ? 1 : -1);
246
- for (let d = 0; d < t.length; d++) {
247
- const h = t[d][0], E = t[d][1] ? {
248
- [Pe]: !0
261
+ }, n), t = t.sort((L, T) => L[0] > T[0] ? 1 : -1);
262
+ for (let L = 0; L < t.length; L++) {
263
+ const T = t[L][0], k = t[L][1] ? {
264
+ [Me]: !0
249
265
  } : {
250
- [Re]: !0
266
+ [je]: !0
251
267
  };
252
- h.indexOf("-") >= 0 ? E[zt] = !0 : K.test(h) ? Mt.test(h) ? E[ft] = !0 : E[It] = !0 : E[Ht] = !0, ne(n, h, h, E);
268
+ T.indexOf("-") >= 0 ? k[Kt] = !0 : N.test(T) ? I.test(T) ? k[G] = !0 : k[Wt] = !0 : k[zt] = !0, ce(e, T, T, k);
253
269
  }
254
- return ne(n, "localhost", et, {
270
+ return ce(e, "localhost", J, {
255
271
  ascii: !0
256
- }), n.jd = new A(Pt), {
257
- start: n,
258
- tokens: q({
259
- groups: e
260
- }, fe)
272
+ }), e.jd = new C(Pt), {
273
+ start: e,
274
+ tokens: B({
275
+ groups: n
276
+ }, Te)
261
277
  };
262
278
  }
263
- function He(t, e) {
264
- const n = Ie(e.replace(/[A-Z]/g, (l) => l.toLowerCase())), s = n.length, o = [];
265
- let a = 0, i = 0;
266
- for (; i < s; ) {
267
- let l = t, f = null, u = 0, g = null, d = -1, h = -1;
268
- for (; i < s && (f = l.go(n[i])); )
269
- l = f, l.accepts() ? (d = 0, h = 0, g = l) : d >= 0 && (d += n[i].length, h++), u += n[i].length, a += n[i].length, i++;
270
- a -= d, i -= h, u -= d, o.push({
271
- t: g.t,
279
+ function ye(t, n) {
280
+ const e = Ge(n.replace(/[A-Z]/g, (l) => l.toLowerCase())), o = e.length, s = [];
281
+ let i = 0, a = 0;
282
+ for (; a < o; ) {
283
+ let l = t, h = null, c = 0, f = null, d = -1, m = -1;
284
+ for (; a < o && (h = l.go(e[a])); )
285
+ l = h, l.accepts() ? (d = 0, m = 0, f = l) : d >= 0 && (d += e[a].length, m++), c += e[a].length, i += e[a].length, a++;
286
+ i -= d, a -= m, c -= d, s.push({
287
+ t: f.t,
272
288
  // token type/name
273
- v: e.slice(a - u, a),
289
+ v: n.slice(i - c, i),
274
290
  // string value
275
- s: a - u,
291
+ s: i - c,
276
292
  // start index
277
- e: a
293
+ e: i
278
294
  // end index (excluding)
279
295
  });
280
296
  }
281
- return o;
297
+ return s;
282
298
  }
283
- function Ie(t) {
284
- const e = [], n = t.length;
285
- let s = 0;
286
- for (; s < n; ) {
287
- let o = t.charCodeAt(s), a, i = o < 55296 || o > 56319 || s + 1 === n || (a = t.charCodeAt(s + 1)) < 56320 || a > 57343 ? t[s] : t.slice(s, s + 2);
288
- e.push(i), s += i.length;
299
+ function Ge(t) {
300
+ const n = [], e = t.length;
301
+ let o = 0;
302
+ for (; o < e; ) {
303
+ let s = t.charCodeAt(o), i, a = s < 55296 || s > 56319 || o + 1 === e || (i = t.charCodeAt(o + 1)) < 56320 || i > 57343 ? t[o] : t.slice(o, o + 2);
304
+ n.push(a), o += a.length;
289
305
  }
290
- return e;
306
+ return n;
291
307
  }
292
- function R(t, e, n, s, o) {
293
- let a;
294
- const i = e.length;
295
- for (let l = 0; l < i - 1; l++) {
296
- const f = e[l];
297
- t.j[f] ? a = t.j[f] : (a = new A(s), a.jr = o.slice(), t.j[f] = a), t = a;
308
+ function v(t, n, e, o, s) {
309
+ let i;
310
+ const a = n.length;
311
+ for (let l = 0; l < a - 1; l++) {
312
+ const h = n[l];
313
+ t.j[h] ? i = t.j[h] : (i = new C(o), i.jr = s.slice(), t.j[h] = i), t = i;
298
314
  }
299
- return a = new A(n), a.jr = o.slice(), t.j[e[i - 1]] = a, a;
315
+ return i = new C(e), i.jr = s.slice(), t.j[n[a - 1]] = i, i;
300
316
  }
301
- function re(t) {
302
- const e = [], n = [];
303
- let s = 0, o = "0123456789";
304
- for (; s < t.length; ) {
305
- let a = 0;
306
- for (; o.indexOf(t[s + a]) >= 0; )
307
- a++;
308
- if (a > 0) {
309
- e.push(n.join(""));
310
- for (let i = parseInt(t.substring(s, s + a), 10); i > 0; i--)
311
- n.pop();
312
- s += a;
317
+ function de(t) {
318
+ const n = [], e = [];
319
+ let o = 0, s = "0123456789";
320
+ for (; o < t.length; ) {
321
+ let i = 0;
322
+ for (; s.indexOf(t[o + i]) >= 0; )
323
+ i++;
324
+ if (i > 0) {
325
+ n.push(e.join(""));
326
+ for (let a = parseInt(t.substring(o, o + i), 10); a > 0; a--)
327
+ e.pop();
328
+ o += i;
313
329
  } else
314
- n.push(t[s]), s++;
330
+ e.push(t[o]), o++;
315
331
  }
316
- return e;
332
+ return n;
317
333
  }
318
- const nt = {
334
+ const Y = {
319
335
  defaultProtocol: "http",
320
336
  events: null,
321
- format: ie,
322
- formatHref: ie,
337
+ format: he,
338
+ formatHref: he,
323
339
  nl2br: !1,
324
340
  tagName: "a",
325
341
  target: null,
@@ -331,17 +347,16 @@ const nt = {
331
347
  ignoreTags: [],
332
348
  render: null
333
349
  };
334
- function Vt(t, e) {
335
- e === void 0 && (e = null);
336
- let n = q({}, nt);
337
- t && (n = q(n, t instanceof Vt ? t.o : t));
338
- const s = n.ignoreTags, o = [];
339
- for (let a = 0; a < s.length; a++)
340
- o.push(s[a].toUpperCase());
341
- this.o = n, e && (this.defaultRender = e), this.ignoreTags = o;
350
+ function oe(t, n = null) {
351
+ let e = B({}, Y);
352
+ t && (e = B(e, t instanceof oe ? t.o : t));
353
+ const o = e.ignoreTags, s = [];
354
+ for (let i = 0; i < o.length; i++)
355
+ s.push(o[i].toUpperCase());
356
+ this.o = e, n && (this.defaultRender = n), this.ignoreTags = s;
342
357
  }
343
- Vt.prototype = {
344
- o: nt,
358
+ oe.prototype = {
359
+ o: Y,
345
360
  /**
346
361
  * @type string[]
347
362
  */
@@ -374,10 +389,10 @@ Vt.prototype = {
374
389
  * @param {MultiToken} [token] The token from linkify.tokenize
375
390
  * @returns {Opts[K] | any}
376
391
  */
377
- get(t, e, n) {
378
- const s = e != null;
379
- let o = this.o[t];
380
- return o && (typeof o == "object" ? (o = n.t in o ? o[n.t] : nt[t], typeof o == "function" && s && (o = o(e, n))) : typeof o == "function" && s && (o = o(e, n.t, n)), o);
392
+ get(t, n, e) {
393
+ const o = n != null;
394
+ let s = this.o[t];
395
+ return s && (typeof s == "object" ? (s = e.t in s ? s[e.t] : Y[t], typeof s == "function" && o && (s = s(n, e))) : typeof s == "function" && o && (s = s(n, e.t, e)), s);
381
396
  },
382
397
  /**
383
398
  * @template {keyof Opts} L
@@ -386,9 +401,9 @@ Vt.prototype = {
386
401
  * @param {MultiToken} [token]
387
402
  * @returns {Opts[L] | any}
388
403
  */
389
- getObj(t, e, n) {
390
- let s = this.o[t];
391
- return typeof s == "function" && e != null && (s = s(e, n.t, n)), s;
404
+ getObj(t, n, e) {
405
+ let o = this.o[t];
406
+ return typeof o == "function" && n != null && (o = o(n, e.t, e)), o;
392
407
  },
393
408
  /**
394
409
  * Convert the given token to a rendered element that may be added to the
@@ -398,17 +413,17 @@ Vt.prototype = {
398
413
  * Component, etc.
399
414
  */
400
415
  render(t) {
401
- const e = t.render(this);
402
- return (this.get("render", null, t) || this.defaultRender)(e, t.t, t);
416
+ const n = t.render(this);
417
+ return (this.get("render", null, t) || this.defaultRender)(n, t.t, t);
403
418
  }
404
419
  };
405
- function ie(t) {
420
+ function he(t) {
406
421
  return t;
407
422
  }
408
- function pe(t, e) {
409
- this.t = "token", this.v = t, this.tk = e;
423
+ function Ce(t, n) {
424
+ this.t = "token", this.v = t, this.tk = n;
410
425
  }
411
- pe.prototype = {
426
+ Ce.prototype = {
412
427
  isLink: !1,
413
428
  /**
414
429
  * Return the string this token represents.
@@ -422,7 +437,7 @@ pe.prototype = {
422
437
  * Returns the `.toString` value by default.
423
438
  * @param {string} [scheme]
424
439
  * @return {string}
425
- */
440
+ */
426
441
  toHref(t) {
427
442
  return this.toString();
428
443
  },
@@ -431,8 +446,8 @@ pe.prototype = {
431
446
  * @returns {string}
432
447
  */
433
448
  toFormattedString(t) {
434
- const e = this.toString(), n = t.get("truncate", e, this), s = t.get("format", e, this);
435
- return n && s.length > n ? s.substring(0, n) + "…" : s;
449
+ const n = this.toString(), e = t.get("truncate", n, this), o = t.get("format", n, this);
450
+ return e && o.length > e ? o.substring(0, e) + "…" : o;
436
451
  },
437
452
  /**
438
453
  *
@@ -466,8 +481,8 @@ pe.prototype = {
466
481
  @method toObject
467
482
  @param {string} [protocol] `'http'` by default
468
483
  */
469
- toObject(t) {
470
- return t === void 0 && (t = nt.defaultProtocol), {
484
+ toObject(t = Y.defaultProtocol) {
485
+ return {
471
486
  type: this.t,
472
487
  value: this.toString(),
473
488
  isLink: this.isLink,
@@ -503,31 +518,31 @@ pe.prototype = {
503
518
  * @param {Options} options Formattinng options
504
519
  */
505
520
  render(t) {
506
- const e = this, n = this.toHref(t.get("defaultProtocol")), s = t.get("formatHref", n, this), o = t.get("tagName", n, e), a = this.toFormattedString(t), i = {}, l = t.get("className", n, e), f = t.get("target", n, e), u = t.get("rel", n, e), g = t.getObj("attributes", n, e), d = t.getObj("events", n, e);
507
- return i.href = s, l && (i.class = l), f && (i.target = f), u && (i.rel = u), g && q(i, g), {
508
- tagName: o,
509
- attributes: i,
510
- content: a,
521
+ const n = this, e = this.toHref(t.get("defaultProtocol")), o = t.get("formatHref", e, this), s = t.get("tagName", e, n), i = this.toFormattedString(t), a = {}, l = t.get("className", e, n), h = t.get("target", e, n), c = t.get("rel", e, n), f = t.getObj("attributes", e, n), d = t.getObj("events", e, n);
522
+ return a.href = o, l && (a.class = l), h && (a.target = h), c && (a.rel = c), f && B(a, f), {
523
+ tagName: s,
524
+ attributes: a,
525
+ content: i,
511
526
  eventListeners: d
512
527
  };
513
528
  }
514
529
  };
515
- function Rt(t, e) {
516
- class n extends pe {
517
- constructor(o, a) {
518
- super(o, a), this.t = t;
530
+ function Nt(t, n) {
531
+ class e extends Ce {
532
+ constructor(s, i) {
533
+ super(s, i), this.t = t;
519
534
  }
520
535
  }
521
- for (const s in e)
522
- n.prototype[s] = e[s];
523
- return n.t = t, n;
536
+ for (const o in n)
537
+ e.prototype[o] = n[o];
538
+ return e.t = t, e;
524
539
  }
525
- const ae = Rt("email", {
540
+ const fe = Nt("email", {
526
541
  isLink: !0,
527
542
  toHref() {
528
543
  return "mailto:" + this.toString();
529
544
  }
530
- }), le = Rt("text"), De = Rt("nl"), H = Rt("url", {
545
+ }), pe = Nt("text"), $e = Nt("nl"), et = Nt("url", {
531
546
  isLink: !0,
532
547
  /**
533
548
  Lowercases relevant parts of the domain and adds the protocol if
@@ -536,8 +551,8 @@ const ae = Rt("email", {
536
551
  @param {string} [scheme] default scheme (e.g., 'https')
537
552
  @return {string} the full href
538
553
  */
539
- toHref(t) {
540
- return t === void 0 && (t = nt.defaultProtocol), this.hasProtocol() ? this.v : `${t}://${this.v}`;
554
+ toHref(t = Y.defaultProtocol) {
555
+ return this.hasProtocol() ? this.v : `${t}://${this.v}`;
541
556
  },
542
557
  /**
543
558
  * Check whether this URL token has a protocol
@@ -545,75 +560,95 @@ const ae = Rt("email", {
545
560
  */
546
561
  hasProtocol() {
547
562
  const t = this.tk;
548
- return t.length >= 2 && t[0].t !== et && t[1].t === N;
563
+ return t.length >= 2 && t[0].t !== J && t[1].t === U;
564
+ }
565
+ }), O = (t) => new C(t);
566
+ function Qe({
567
+ groups: t
568
+ }) {
569
+ const n = t.domain.concat([Et, At, H, Lt, kt, Tt, yt, Ct, b, Jt, _, Rt, Ot, bt, P, Pt, V, St]), e = [U, Zt, S, te, _, q, ee, ne, at, lt, $, Q, st, ot, rt, it, ct, ut, dt, ht, ft, pt, mt, gt], o = [Et, Xt, At, Lt, kt, Tt, yt, Ct, b, $, Q, _, Rt, Ot, bt, q, P, Pt, V, St], s = O(), i = r(s, V);
570
+ u(i, o, i), u(i, t.domain, i);
571
+ const a = O(), l = O(), h = O();
572
+ u(s, t.domain, a), u(s, t.scheme, l), u(s, t.slashscheme, h), u(a, o, i), u(a, t.domain, a);
573
+ const c = r(a, H);
574
+ r(i, H, c), r(l, H, c), r(h, H, c);
575
+ const f = r(i, S);
576
+ u(f, o, i), u(f, t.domain, i);
577
+ const d = O();
578
+ u(c, t.domain, d), u(d, t.domain, d);
579
+ const m = r(d, S);
580
+ u(m, t.domain, d);
581
+ const E = O(fe);
582
+ u(m, t.tld, E), u(m, t.utld, E), r(c, J, E);
583
+ const R = r(d, b);
584
+ r(R, b, R), u(R, t.domain, d), u(E, t.domain, d), r(E, S, m), r(E, b, R);
585
+ const L = r(E, U);
586
+ u(L, t.numeric, fe);
587
+ const T = r(a, b), p = r(a, S);
588
+ r(T, b, T), u(T, t.domain, a), u(p, o, i), u(p, t.domain, a);
589
+ const k = O(et);
590
+ u(p, t.tld, k), u(p, t.utld, k), u(k, t.domain, a), u(k, o, i), r(k, S, p), r(k, b, T), r(k, H, c);
591
+ const Oe = r(k, U), re = O(et);
592
+ u(Oe, t.numeric, re);
593
+ const y = O(et), z = O();
594
+ u(y, n, y), u(y, e, z), u(z, n, y), u(z, e, z), r(k, P, y), r(re, P, y);
595
+ const It = r(l, U), be = r(h, U), Se = r(be, P), wt = r(Se, P);
596
+ u(l, t.domain, a), r(l, S, p), r(l, b, T), u(h, t.domain, a), r(h, S, p), r(h, b, T), u(It, t.domain, y), r(It, P, y), r(It, q, y), u(wt, t.domain, y), u(wt, n, y), r(wt, P, y);
597
+ const ie = [
598
+ [$, Q],
599
+ // {}
600
+ [ot, st],
601
+ // []
602
+ [rt, it],
603
+ // ()
604
+ [at, lt],
605
+ // <>
606
+ [ct, ut],
607
+ // ()
608
+ [dt, ht],
609
+ // 「」
610
+ [ft, pt],
611
+ // 『』
612
+ [mt, gt]
613
+ // <>
614
+ ];
615
+ for (let vt = 0; vt < ie.length; vt++) {
616
+ const [ae, Ht] = ie[vt], X = r(y, ae);
617
+ r(z, ae, X), r(X, Ht, y);
618
+ const M = O(et);
619
+ u(X, n, M);
620
+ const W = O();
621
+ u(X, e), u(M, n, M), u(M, e, W), u(W, n, M), u(W, e, W), r(M, Ht, y), r(W, Ht, y);
549
622
  }
550
- }), y = (t) => new A(t);
551
- function ze(t) {
552
- let {
553
- groups: e
554
- } = t;
555
- const n = e.domain.concat([gt, kt, x, Et, yt, At, bt, Lt, S, _t, Ot, vt, St, Ct, C, Pt, tt, Tt]), s = [mt, _, I, W, D, N, Ft, v, Gt, X, $, V, Z, wt, Yt, Jt], o = [gt, mt, kt, Et, yt, At, I, bt, Lt, S, $, Ot, vt, St, Ct, wt, C, Pt, tt, Tt], a = y(), i = r(a, tt);
556
- c(i, o, i), c(i, e.domain, i);
557
- const l = y(), f = y(), u = y();
558
- c(a, e.domain, l), c(a, e.scheme, f), c(a, e.slashscheme, u), c(l, o, i), c(l, e.domain, l);
559
- const g = r(l, x);
560
- r(i, x, g), r(f, x, g), r(u, x, g);
561
- const d = r(i, v);
562
- c(d, o, i), c(d, e.domain, i);
563
- const h = y();
564
- c(g, e.domain, h), c(h, e.domain, h);
565
- const b = r(h, v);
566
- c(b, e.domain, h);
567
- const E = y(ae);
568
- c(b, e.tld, E), c(b, e.utld, E), r(g, et, E);
569
- const F = r(h, S);
570
- c(F, e.domain, h), c(E, e.domain, h), r(E, v, b), r(E, S, F);
571
- const st = r(E, N);
572
- c(st, e.numeric, ae);
573
- const m = r(l, S), w = r(l, v);
574
- c(m, e.domain, l), c(w, o, i), c(w, e.domain, l);
575
- const O = y(H);
576
- c(w, e.tld, O), c(w, e.utld, O), c(O, e.domain, l), c(O, o, i), r(O, v, w), r(O, S, m), r(O, x, g);
577
- const ke = r(O, N), Xt = y(H);
578
- c(ke, e.numeric, Xt);
579
- const p = y(H), P = y();
580
- c(p, n, p), c(p, s, P), c(P, n, p), c(P, s, P), r(O, C, p), r(Xt, C, p);
581
- const Zt = r(f, N), Ee = r(u, N), ye = r(Ee, C), xt = r(ye, C);
582
- c(f, e.domain, l), r(f, v, w), r(f, S, m), c(u, e.domain, l), r(u, v, w), r(u, S, m), c(Zt, e.domain, p), r(Zt, C, p), c(xt, e.domain, p), c(xt, n, p), r(xt, C, p);
583
- const G = r(p, $), ot = r(p, V), rt = r(p, X), it = r(p, Z);
584
- r(P, $, G), r(P, V, ot), r(P, X, rt), r(P, Z, it), r(G, I, p), r(ot, W, p), r(rt, _, p), r(it, D, p), r(G, I, p);
585
- const B = y(H), j = y(H), M = y(H), U = y(H);
586
- c(G, n, B), c(ot, n, j), c(rt, n, M), c(it, n, U);
587
- const Y = y(), at = y(), lt = y(), ct = y();
588
- return c(G, s), c(ot, s), c(rt, s), c(it, s), c(B, n, B), c(j, n, j), c(M, n, M), c(U, n, U), c(B, s, B), c(j, s, j), c(M, s, M), c(U, s, U), c(Y, n, Y), c(at, n, j), c(lt, n, M), c(ct, n, U), c(Y, s, Y), c(at, s, at), c(lt, s, lt), c(ct, s, ct), r(j, W, p), r(M, _, p), r(U, D, p), r(B, I, p), r(at, W, p), r(lt, _, p), r(ct, D, p), r(Y, D, p), r(a, et, O), r(a, qt, De), {
589
- start: a,
590
- tokens: fe
623
+ return r(s, J, k), r(s, Yt, $e), {
624
+ start: s,
625
+ tokens: Te
591
626
  };
592
627
  }
593
- function Be(t, e, n) {
594
- let s = n.length, o = 0, a = [], i = [];
595
- for (; o < s; ) {
596
- let l = t, f = null, u = null, g = 0, d = null, h = -1;
597
- for (; o < s && !(f = l.go(n[o].t)); )
598
- i.push(n[o++]);
599
- for (; o < s && (u = f || l.go(n[o].t)); )
600
- f = null, l = u, l.accepts() ? (h = 0, d = l) : h >= 0 && h++, o++, g++;
601
- if (h < 0)
602
- o -= g, o < s && (i.push(n[o]), o++);
628
+ function _e(t, n, e) {
629
+ let o = e.length, s = 0, i = [], a = [];
630
+ for (; s < o; ) {
631
+ let l = t, h = null, c = null, f = 0, d = null, m = -1;
632
+ for (; s < o && !(h = l.go(e[s].t)); )
633
+ a.push(e[s++]);
634
+ for (; s < o && (c = h || l.go(e[s].t)); )
635
+ h = null, l = c, l.accepts() ? (m = 0, d = l) : m >= 0 && m++, s++, f++;
636
+ if (m < 0)
637
+ s -= f, s < o && (a.push(e[s]), s++);
603
638
  else {
604
- i.length > 0 && (a.push(Ut(le, e, i)), i = []), o -= h, g -= h;
605
- const b = d.t, E = n.slice(o - g, o);
606
- a.push(Ut(b, e, E));
639
+ a.length > 0 && (i.push(Bt(pe, n, a)), a = []), s -= m, f -= m;
640
+ const E = d.t, R = e.slice(s - f, s);
641
+ i.push(Bt(E, n, R));
607
642
  }
608
643
  }
609
- return i.length > 0 && a.push(Ut(le, e, i)), a;
644
+ return a.length > 0 && i.push(Bt(pe, n, a)), i;
610
645
  }
611
- function Ut(t, e, n) {
612
- const s = n[0].s, o = n[n.length - 1].e, a = e.slice(s, o);
613
- return new t(a, n);
646
+ function Bt(t, n, e) {
647
+ const o = e[0].s, s = e[e.length - 1].e, i = n.slice(o, s);
648
+ return new t(i, e);
614
649
  }
615
- const Ke = typeof console < "u" && console && console.warn || (() => {
616
- }), Qe = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", k = {
650
+ const qe = typeof console < "u" && console && console.warn || (() => {
651
+ }), Ve = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", g = {
617
652
  scanner: null,
618
653
  parser: null,
619
654
  tokenQueue: [],
@@ -621,129 +656,130 @@ const Ke = typeof console < "u" && console && console.warn || (() => {
621
656
  customSchemes: [],
622
657
  initialized: !1
623
658
  };
624
- function $e() {
625
- A.groups = {}, k.scanner = null, k.parser = null, k.tokenQueue = [], k.pluginQueue = [], k.customSchemes = [], k.initialized = !1;
659
+ function Je() {
660
+ return C.groups = {}, g.scanner = null, g.parser = null, g.tokenQueue = [], g.pluginQueue = [], g.customSchemes = [], g.initialized = !1, g;
626
661
  }
627
- function ce(t, e) {
628
- if (e === void 0 && (e = !1), k.initialized && Ke(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Qe}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
662
+ function me(t, n = !1) {
663
+ if (g.initialized && qe(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Ve}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
629
664
  throw new Error(`linkifyjs: incorrect scheme format.
630
665
  1. Must only contain digits, lowercase ASCII letters or "-"
631
666
  2. Cannot start or end with "-"
632
667
  3. "-" cannot repeat`);
633
- k.customSchemes.push([t, e]);
668
+ g.customSchemes.push([t, n]);
634
669
  }
635
- function We() {
636
- k.scanner = Ue(k.customSchemes);
637
- for (let t = 0; t < k.tokenQueue.length; t++)
638
- k.tokenQueue[t][1]({
639
- scanner: k.scanner
670
+ function Ye() {
671
+ g.scanner = Ke(g.customSchemes);
672
+ for (let t = 0; t < g.tokenQueue.length; t++)
673
+ g.tokenQueue[t][1]({
674
+ scanner: g.scanner
640
675
  });
641
- k.parser = ze(k.scanner.tokens);
642
- for (let t = 0; t < k.pluginQueue.length; t++)
643
- k.pluginQueue[t][1]({
644
- scanner: k.scanner,
645
- parser: k.parser
676
+ g.parser = Qe(g.scanner.tokens);
677
+ for (let t = 0; t < g.pluginQueue.length; t++)
678
+ g.pluginQueue[t][1]({
679
+ scanner: g.scanner,
680
+ parser: g.parser
646
681
  });
647
- k.initialized = !0;
682
+ return g.initialized = !0, g;
648
683
  }
649
- function ge(t) {
650
- return k.initialized || We(), Be(k.parser.start, t, He(k.scanner.start, t));
684
+ function se(t) {
685
+ return g.initialized || Ye(), _e(g.parser.start, t, ye(g.scanner.start, t));
651
686
  }
652
- function me(t, e, n) {
653
- if (e === void 0 && (e = null), n === void 0 && (n = null), e && typeof e == "object") {
654
- if (n)
655
- throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);
656
- n = e, e = null;
687
+ se.scan = ye;
688
+ function Re(t, n = null, e = null) {
689
+ if (n && typeof n == "object") {
690
+ if (e)
691
+ throw Error(`linkifyjs: Invalid link type ${n}; must be a string`);
692
+ e = n, n = null;
657
693
  }
658
- const s = new Vt(n), o = ge(t), a = [];
659
- for (let i = 0; i < o.length; i++) {
660
- const l = o[i];
661
- l.isLink && (!e || l.t === e) && s.check(l) && a.push(l.toFormattedObject(s));
694
+ const o = new oe(e), s = se(t), i = [];
695
+ for (let a = 0; a < s.length; a++) {
696
+ const l = s[a];
697
+ l.isLink && (!n || l.t === n) && o.check(l) && i.push(l.toFormattedObject(o));
662
698
  }
663
- return a;
699
+ return i;
664
700
  }
665
- function _e(t) {
701
+ function Xe(t) {
666
702
  return t.length === 1 ? t[0].isLink : t.length === 3 && t[1].isLink ? ["()", "[]"].includes(t[0].value + t[2].value) : !1;
667
703
  }
668
- function qe(t) {
669
- return new $t({
670
- key: new Wt("autolink"),
671
- appendTransaction: (e, n, s) => {
672
- const o = e.some((u) => u.docChanged) && !n.doc.eq(s.doc), a = e.some((u) => u.getMeta("preventAutolink"));
673
- if (!o || a)
704
+ function Ze(t) {
705
+ return new qt({
706
+ key: new Vt("autolink"),
707
+ appendTransaction: (n, e, o) => {
708
+ const s = n.some((c) => c.docChanged) && !e.doc.eq(o.doc), i = n.some((c) => c.getMeta("preventAutolink"));
709
+ if (!s || i)
674
710
  return;
675
- const { tr: i } = s, l = Le(n.doc, [...e]);
676
- if (Oe(l).forEach(({ newRange: u }) => {
677
- const g = ve(s.doc, u, (b) => b.isTextblock);
678
- let d, h;
679
- if (g.length > 1 ? (d = g[0], h = s.doc.textBetween(d.pos, d.pos + d.node.nodeSize, void 0, " ")) : g.length && s.doc.textBetween(u.from, u.to, " ", " ").endsWith(" ") && (d = g[0], h = s.doc.textBetween(d.pos, u.to, void 0, " ")), d && h) {
680
- const b = h.split(" ").filter((m) => m !== "");
681
- if (b.length <= 0)
711
+ const { tr: a } = o, l = Ie(e.doc, [...n]);
712
+ if (we(l).forEach(({ newRange: c }) => {
713
+ const f = ve(o.doc, c, (E) => E.isTextblock);
714
+ let d, m;
715
+ if (f.length > 1 ? (d = f[0], m = o.doc.textBetween(d.pos, d.pos + d.node.nodeSize, void 0, " ")) : f.length && o.doc.textBetween(c.from, c.to, " ", " ").endsWith(" ") && (d = f[0], m = o.doc.textBetween(d.pos, c.to, void 0, " ")), d && m) {
716
+ const E = m.split(" ").filter((p) => p !== "");
717
+ if (E.length <= 0)
682
718
  return !1;
683
- const E = b[b.length - 1], F = d.pos + h.lastIndexOf(E);
684
- if (!E)
719
+ const R = E[E.length - 1], L = d.pos + m.lastIndexOf(R);
720
+ if (!R)
685
721
  return !1;
686
- const st = ge(E).map((m) => m.toObject(t.defaultProtocol));
687
- if (!_e(st))
722
+ const T = se(R).map((p) => p.toObject(t.defaultProtocol));
723
+ if (!Xe(T))
688
724
  return !1;
689
- st.filter((m) => m.isLink).map((m) => ({
690
- ...m,
691
- from: F + m.start + 1,
692
- to: F + m.end + 1
693
- })).filter((m) => s.schema.marks.code ? !s.doc.rangeHasMark(m.from, m.to, s.schema.marks.code) : !0).filter((m) => t.validate(m.value)).filter((m) => t.shouldAutoLink(m.value)).forEach((m) => {
694
- Se(m.from, m.to, s.doc).some((w) => w.mark.type === t.type) || i.addMark(m.from, m.to, t.type.create({
695
- href: m.href
725
+ T.filter((p) => p.isLink).map((p) => ({
726
+ ...p,
727
+ from: L + p.start + 1,
728
+ to: L + p.end + 1
729
+ })).filter((p) => o.schema.marks.code ? !o.doc.rangeHasMark(p.from, p.to, o.schema.marks.code) : !0).filter((p) => t.validate(p.value)).filter((p) => t.shouldAutoLink(p.value)).forEach((p) => {
730
+ He(p.from, p.to, o.doc).some((k) => k.mark.type === t.type) || a.addMark(p.from, p.to, t.type.create({
731
+ href: p.href
696
732
  }));
697
733
  });
698
734
  }
699
- }), !!i.steps.length)
700
- return i;
735
+ }), !!a.steps.length)
736
+ return a;
701
737
  }
702
738
  });
703
739
  }
704
- function Fe(t) {
705
- return new $t({
706
- key: new Wt("handleClickLink"),
740
+ function tn(t) {
741
+ return new qt({
742
+ key: new Vt("handleClickLink"),
707
743
  props: {
708
- handleClick: (e, n, s) => {
709
- var o, a;
710
- if (s.button !== 0 || !e.editable)
744
+ handleClick: (n, e, o) => {
745
+ var s, i;
746
+ if (o.button !== 0 || !n.editable)
711
747
  return !1;
712
- let i = s.target;
748
+ let a = o.target;
713
749
  const l = [];
714
- for (; i.nodeName !== "DIV"; )
715
- l.push(i), i = i.parentNode;
716
- if (!l.find((h) => h.nodeName === "A"))
750
+ for (; a.nodeName !== "DIV"; )
751
+ l.push(a), a = a.parentNode;
752
+ if (!l.find((m) => m.nodeName === "A"))
717
753
  return !1;
718
- const f = Ce(e.state, t.type.name), u = s.target, g = (o = u == null ? void 0 : u.href) !== null && o !== void 0 ? o : f.href, d = (a = u == null ? void 0 : u.target) !== null && a !== void 0 ? a : f.target;
719
- return u && g ? (window.open(g, d), !0) : !1;
754
+ const h = Ue(n.state, t.type.name), c = o.target, f = (s = c == null ? void 0 : c.href) !== null && s !== void 0 ? s : h.href, d = (i = c == null ? void 0 : c.target) !== null && i !== void 0 ? i : h.target;
755
+ return c && f ? (window.open(f, d), !0) : !1;
720
756
  }
721
757
  }
722
758
  });
723
759
  }
724
- function Ge(t) {
725
- return new $t({
726
- key: new Wt("handlePasteLink"),
760
+ function en(t) {
761
+ return new qt({
762
+ key: new Vt("handlePasteLink"),
727
763
  props: {
728
- handlePaste: (e, n, s) => {
729
- const { state: o } = e, { selection: a } = o, { empty: i } = a;
730
- if (i)
764
+ handlePaste: (n, e, o) => {
765
+ const { state: s } = n, { selection: i } = s, { empty: a } = i;
766
+ if (a)
731
767
  return !1;
732
768
  let l = "";
733
- s.content.forEach((u) => {
734
- l += u.textContent;
769
+ o.content.forEach((c) => {
770
+ l += c.textContent;
771
+ });
772
+ const h = Re(l, { defaultProtocol: t.defaultProtocol }).find((c) => c.isLink && c.value === l);
773
+ return !l || !h ? !1 : t.editor.commands.setMark(t.type, {
774
+ href: h.href
735
775
  });
736
- const f = me(l, { defaultProtocol: t.defaultProtocol }).find((u) => u.isLink && u.value === l);
737
- return !l || !f ? !1 : (t.editor.commands.setMark(t.type, {
738
- href: f.href
739
- }), !0);
740
776
  }
741
777
  }
742
778
  });
743
779
  }
744
- const Ye = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
745
- function J(t, e) {
746
- const n = [
780
+ const nn = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
781
+ function x(t, n) {
782
+ const e = [
747
783
  "http",
748
784
  "https",
749
785
  "ftp",
@@ -755,16 +791,16 @@ function J(t, e) {
755
791
  "cid",
756
792
  "xmpp"
757
793
  ];
758
- return e && e.forEach((s) => {
759
- const o = typeof s == "string" ? s : s.scheme;
760
- o && n.push(o);
761
- }), !t || t.replace(Ye, "").match(new RegExp(
794
+ return n && n.forEach((o) => {
795
+ const s = typeof o == "string" ? o : o.scheme;
796
+ s && e.push(s);
797
+ }), !t || t.replace(nn, "").match(new RegExp(
762
798
  // eslint-disable-next-line no-useless-escape
763
- `^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,
799
+ `^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
764
800
  "i"
765
801
  ));
766
802
  }
767
- const Je = Ae.create({
803
+ const on = Pe.create({
768
804
  name: "link",
769
805
  priority: 1e3,
770
806
  keepOnSplit: !1,
@@ -772,14 +808,14 @@ const Je = Ae.create({
772
808
  onCreate() {
773
809
  this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")), this.options.protocols.forEach((t) => {
774
810
  if (typeof t == "string") {
775
- ce(t);
811
+ me(t);
776
812
  return;
777
813
  }
778
- ce(t.scheme, t.optionalSlashes);
814
+ me(t.scheme, t.optionalSlashes);
779
815
  });
780
816
  },
781
817
  onDestroy() {
782
- $e();
818
+ Je();
783
819
  },
784
820
  inclusive() {
785
821
  return this.options.autolink;
@@ -796,7 +832,7 @@ const Je = Ae.create({
796
832
  rel: "noopener noreferrer nofollow",
797
833
  class: null
798
834
  },
799
- isAllowedUri: (t, e) => !!J(t, e.protocols),
835
+ isAllowedUri: (t, n) => !!x(t, n.protocols),
800
836
  validate: (t) => !!t,
801
837
  shouldAutoLink: (t) => !!t
802
838
  };
@@ -825,9 +861,9 @@ const Je = Ae.create({
825
861
  {
826
862
  tag: "a[href]",
827
863
  getAttrs: (t) => {
828
- const e = t.getAttribute("href");
829
- return !e || !this.options.isAllowedUri(e, {
830
- defaultValidate: (n) => !!J(n, this.options.protocols),
864
+ const n = t.getAttribute("href");
865
+ return !n || !this.options.isAllowedUri(n, {
866
+ defaultValidate: (e) => !!x(e, this.options.protocols),
831
867
  protocols: this.options.protocols,
832
868
  defaultProtocol: this.options.defaultProtocol
833
869
  }) ? !1 : null;
@@ -837,86 +873,100 @@ const Je = Ae.create({
837
873
  },
838
874
  renderHTML({ HTMLAttributes: t }) {
839
875
  return this.options.isAllowedUri(t.href, {
840
- defaultValidate: (e) => !!J(e, this.options.protocols),
876
+ defaultValidate: (n) => !!x(n, this.options.protocols),
841
877
  protocols: this.options.protocols,
842
878
  defaultProtocol: this.options.defaultProtocol
843
- }) ? ["a", te(this.options.HTMLAttributes, t), 0] : [
879
+ }) ? ["a", le(this.options.HTMLAttributes, t), 0] : [
844
880
  "a",
845
- te(this.options.HTMLAttributes, { ...t, href: "" }),
881
+ le(this.options.HTMLAttributes, { ...t, href: "" }),
846
882
  0
847
883
  ];
848
884
  },
849
885
  addCommands() {
850
886
  return {
851
- setLink: (t) => ({ chain: e }) => e().setMark(this.name, t).setMeta("preventAutolink", !0).run(),
852
- toggleLink: (t) => ({ chain: e }) => e().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run(),
887
+ setLink: (t) => ({ chain: n }) => {
888
+ const { href: e } = t;
889
+ return this.options.isAllowedUri(e, {
890
+ defaultValidate: (o) => !!x(o, this.options.protocols),
891
+ protocols: this.options.protocols,
892
+ defaultProtocol: this.options.defaultProtocol
893
+ }) ? n().setMark(this.name, t).setMeta("preventAutolink", !0).run() : !1;
894
+ },
895
+ toggleLink: (t) => ({ chain: n }) => {
896
+ const { href: e } = t;
897
+ return this.options.isAllowedUri(e, {
898
+ defaultValidate: (o) => !!x(o, this.options.protocols),
899
+ protocols: this.options.protocols,
900
+ defaultProtocol: this.options.defaultProtocol
901
+ }) ? n().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run() : !1;
902
+ },
853
903
  unsetLink: () => ({ chain: t }) => t().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
854
904
  };
855
905
  },
856
906
  addPasteRules() {
857
907
  return [
858
- be({
908
+ Ne({
859
909
  find: (t) => {
860
- const e = [];
910
+ const n = [];
861
911
  if (t) {
862
- const { protocols: n, defaultProtocol: s } = this.options, o = me(t).filter((a) => a.isLink && this.options.isAllowedUri(a.value, {
863
- defaultValidate: (i) => !!J(i, n),
864
- protocols: n,
865
- defaultProtocol: s
912
+ const { protocols: e, defaultProtocol: o } = this.options, s = Re(t).filter((i) => i.isLink && this.options.isAllowedUri(i.value, {
913
+ defaultValidate: (a) => !!x(a, e),
914
+ protocols: e,
915
+ defaultProtocol: o
866
916
  }));
867
- o.length && o.forEach((a) => e.push({
868
- text: a.value,
917
+ s.length && s.forEach((i) => n.push({
918
+ text: i.value,
869
919
  data: {
870
- href: a.href
920
+ href: i.href
871
921
  },
872
- index: a.start
922
+ index: i.start
873
923
  }));
874
924
  }
875
- return e;
925
+ return n;
876
926
  },
877
927
  type: this.type,
878
928
  getAttributes: (t) => {
879
- var e;
929
+ var n;
880
930
  return {
881
- href: (e = t.data) === null || e === void 0 ? void 0 : e.href
931
+ href: (n = t.data) === null || n === void 0 ? void 0 : n.href
882
932
  };
883
933
  }
884
934
  })
885
935
  ];
886
936
  },
887
937
  addProseMirrorPlugins() {
888
- const t = [], { protocols: e, defaultProtocol: n } = this.options;
889
- return this.options.autolink && t.push(qe({
938
+ const t = [], { protocols: n, defaultProtocol: e } = this.options;
939
+ return this.options.autolink && t.push(Ze({
890
940
  type: this.type,
891
941
  defaultProtocol: this.options.defaultProtocol,
892
- validate: (s) => this.options.isAllowedUri(s, {
893
- defaultValidate: (o) => !!J(o, e),
894
- protocols: e,
895
- defaultProtocol: n
942
+ validate: (o) => this.options.isAllowedUri(o, {
943
+ defaultValidate: (s) => !!x(s, n),
944
+ protocols: n,
945
+ defaultProtocol: e
896
946
  }),
897
947
  shouldAutoLink: this.options.shouldAutoLink
898
- })), this.options.openOnClick === !0 && t.push(Fe({
948
+ })), this.options.openOnClick === !0 && t.push(tn({
899
949
  type: this.type
900
- })), this.options.linkOnPaste && t.push(Ge({
950
+ })), this.options.linkOnPaste && t.push(en({
901
951
  editor: this.editor,
902
952
  defaultProtocol: this.options.defaultProtocol,
903
953
  type: this.type
904
954
  })), t;
905
955
  }
906
- }), Xe = Je.configure({
956
+ }), rn = on.configure({
907
957
  openOnClick: !1,
908
958
  autolink: !0,
909
959
  defaultProtocol: "https",
910
960
  protocols: ["http", "https"],
911
- isAllowedUri: (t, e) => {
961
+ isAllowedUri: (t, n) => {
912
962
  try {
913
- const n = t.includes(":") ? new URL(t) : new URL(`${e.defaultProtocol}://${t}`);
914
- if (!e.defaultValidate(n.href))
963
+ const e = t.includes(":") ? new URL(t) : new URL(`${n.defaultProtocol}://${t}`);
964
+ if (!n.defaultValidate(e.href))
915
965
  return !1;
916
- const s = ["ftp", "file", "mailto"], o = n.protocol.replace(":", "");
917
- return !(s.includes(o) || !e.protocols.map(
918
- (i) => typeof i == "string" ? i : i.scheme
919
- ).includes(o));
966
+ const o = ["ftp", "file", "mailto"], s = e.protocol.replace(":", "");
967
+ return !(o.includes(s) || !n.protocols.map(
968
+ (a) => typeof a == "string" ? a : a.scheme
969
+ ).includes(s));
920
970
  } catch {
921
971
  return !1;
922
972
  }
@@ -930,5 +980,5 @@ const Je = Ae.create({
930
980
  }
931
981
  });
932
982
  export {
933
- Xe as default
983
+ rn as default
934
984
  };