tocco-admin 1.0.7 → 1.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 +10 -0
- package/dist/010d0560a00a032c33da819e3c86596a.js +1 -368
- package/dist/029ed9161a8d24a9c2ba97124020989d.js +1 -9
- package/dist/02d5c4961ca855a88b1cd3e1b7fa7aa2.js +1 -113
- package/dist/03371bf1d5cbb1eab58e3a0130d1e9c2.js +1 -15001
- package/dist/03487ba89c7b63069d63c1b3802a472c.js +1 -24
- package/dist/03748243ac7148ca150ba06c2919ff81.js +1 -271
- package/dist/03980cb12dacd26148c22bb61fce440f.js +1 -9
- package/dist/03aae8272914723a7bf85b984385032c.js +1 -9
- package/dist/04770a551c5b6daa744be9b180a8d0fe.js +1 -13311
- package/dist/06d958315fc6cdbb28576b03e43203aa.js +1 -9
- package/dist/07101530302fe1d03dcd731992f7a899.js +1 -869
- package/dist/0731d7568a06d2e28351781370bc52bb.js +1 -445
- package/dist/0794fa2b9c882c72fa7d586069b61055.js +1 -3608
- package/dist/0872e65446d05c1c443180c6280b015f.js +1 -214
- package/dist/08b9f3e305b5e3e0b81f7848fa7f3b6b.js +1 -105
- package/dist/09563004132aabcfcc186943555a92a1.js +1 -263
- package/dist/0a1d9862d917663419ac2dd2e8193267.js +1 -9
- package/dist/0a858573915ab9b03fe79f98f8c51a04.js +1 -271
- package/dist/0a9cd3d62e7f1cd404606c50d9da86fb.js +1 -229
- package/dist/0beea7b55cf3b8c9f9b0bd46170bb30e.js +1 -238
- package/dist/0ec4bf56a876c2bf34ea174c584ce628.js +1 -97
- package/dist/0f418117fac55a859631143ad7d0e833.js +1 -1038
- package/dist/10132993df2cf9c9423b53a8a44379ab.js +1 -9
- package/dist/1034e3807d1bcf55cb564491950237ab.js +1 -9
- package/dist/104959bdb953a3792a203e98d2bf530f.js +1 -895
- package/dist/114c58e47951fe3f6d25f683e0cd54e7.js +1 -381
- package/dist/11b2d52156942feeb87b7c608276c49b.js +1 -119
- package/dist/11dc77ef2ea3a04834945a52f7de2072.js +1 -3208
- package/dist/12b520593765ef7e714d7fb3764633ed.js +1 -167
- package/dist/130340e2c62b9e858f186dab5f491e55.js +1 -9
- package/dist/1324f89bd8db0bae85b79b7f90f6c119.js +1 -418
- package/dist/13eda3507db9cbfb400f46b9b3ff6553.js +1 -9
- package/dist/1441681e52f3ae9ab33afbc5517359a0.js +1 -45
- package/dist/1533058f0ce13acdaa8d5bdc7d147bef.js +1 -9
- package/dist/1549fe09fd6b44aca96e2b1b7cbd93d0.js +1 -111
- package/dist/15f3800d33b854ba476c9daf1b9e0326.js +1 -9
- package/dist/16563bfaf4741097d38cc6ce3ccc1a2d.js +1 -2644
- package/dist/170487867de05784a96608617bdd544d.js +1 -9
- package/dist/179a93d3148b7edb72581279c3787d0c.js +1 -353
- package/dist/17dc98279d24649d3ca77cbce8c44e83.js +1 -9
- package/dist/1850762f1bfaf1a1044765b02b243ed4.js +1 -262
- package/dist/18cfa6de2de3832aa10439fbf963217a.js +1 -3035
- package/dist/18e63e724098792b95b076412a860636.js +1 -116
- package/dist/191feb6103c36b202bc01ba262916cdf.js +1 -9
- package/dist/19e684db1b08c82963634abc8b2c989f.js +1 -422
- package/dist/1abc9efccf77fd4527d1c2fc85d87e04.js +1 -647
- package/dist/1b15b9f88acaf59b96e59c6b5f32da12.js +1 -9
- package/dist/1b64f97eed4a3837a93f8bdd363295fb.js +1 -1873
- package/dist/1c02ec6ec024eee3ebb6b34fa8ff316f.js +1 -103
- package/dist/1c57b3481f295105588972ffa1305521.js +1 -9
- package/dist/1cc82820c232a82b5d8b6cb9e4152af3.js +1 -514
- package/dist/1cd3d09b5303cc37fa337225ed6a9132.js +1 -137
- package/dist/1e029a7f1f64457da4f54254d50ac59b.js +1 -95
- package/dist/1e26167b5f75d5b94add34f1f4d8b044.js +1 -380
- package/dist/1e4131e1241a5b81d54c7d9cb66b0e87.js +1 -254
- package/dist/1fe2d583da5f073431d81a6ea13ffc0c.js +1 -275
- package/dist/1fee62e3e043728a265935971fa26200.js +1 -981
- package/dist/211511e7b374f57ad31acaf49dbdccb1.js +1 -9
- package/dist/2183252fe9e1b88fcf2bc454d6fd9273.js +1 -115
- package/dist/222d52530e9db0a0ec565c6306c5db35.js +1 -104
- package/dist/2267d20fd89c81a461e38abecdb8fcdc.js +1 -282
- package/dist/2272c6632c52c3e402ab27b8045ab8f1.js +1 -9
- package/dist/23bb1a9f279e7a732bfd405350aab114.js +1 -9
- package/dist/23da8ba64540ff4aa68a34d3445db680.js +1 -232
- package/dist/243c0c0572ab9866e02e18821558a1c5.js +1 -89
- package/dist/244b1a234ec1728d0268214de601449d.js +1 -343
- package/dist/24a3ff38afde257888d755ece9bfd704.js +1 -9
- package/dist/25718a469574ade47e23567d8c543169.js +1 -9
- package/dist/25c99a71d30112583893bc5277402c46.js +1 -329
- package/dist/25eda4bb98e40a82cfd5b4bf9fbc06ec.js +1 -9
- package/dist/263f7107e9357b1c91997e1a21b59ff5.js +1 -2025
- package/dist/26fb247a2e0630e1f435cb4d91ec51fd.js +1 -397
- package/dist/27730a0bdc6f430cc85049a46a73a029.js +1 -9
- package/dist/27ccb71fa24357a0919a861351d5b82d.js +1 -2806
- package/dist/28474eb7ee45a125e49cc5cbe69e336f.js +1 -1193
- package/dist/28785bea435918d49b290d27bf660baa.js +1 -9
- package/dist/28acb3b48578dfd30dd555fff7c822f7.js +1 -312
- package/dist/291611f874a2bc54dbc291b52d74c512.js +1 -501
- package/dist/2b2fe1a34cdf81c656a47e493ca9d658.js +1 -257
- package/dist/2bcf741e1f2cb07989a722a6ba9c2ea7.js +1 -128
- package/dist/2d2a42eeeeec801ab35f2fff7d900e43.js +1 -330
- package/dist/2dd82c65030101b60dffccedd8741c6e.js +1 -9
- package/dist/2ddd0346681f9f12fd3a191245aa41df.js +1 -797
- package/dist/2f055ac4066041b9008dd6aebf9df34b.js +1 -9
- package/dist/2f5be3e3e9ab852d217168220854ea9b.js +1 -102
- package/dist/2f7c864f08b00c01f04ac22375f7ddd9.js +1 -520
- package/dist/2fc0239242a898632ca8aa451cb930c2.js +1 -9
- package/dist/2ff54aa3c655216f360438bc7f5b181a.js +1 -2742
- package/dist/30e80558090a09477e4466af8af4c40e.js +1 -135
- package/dist/34791bf31a4236531bc887b48f872c1c.js +1 -1090
- package/dist/34b3249d58303435b894a43d3776a5c3.js +1 -1433
- package/dist/3567d1ea443427e944a6f189a0898819.js +1 -9
- package/dist/3646668820dc96864fbed7746f805947.js +1 -452
- package/dist/36474100e81ab63c4ddbc94ab2cc8667.js +1 -799
- package/dist/365b89ceec577ebec0a39c938c2363f0.js +1 -263
- package/dist/367ad31e6d99d0021d05133b85bb9faf.js +1 -93
- package/dist/37172facd8a534a38f378ca2a9c7c11b.js +1 -9
- package/dist/37afa466cdb7fa8fc2e043164d48f29e.js +1 -13110
- package/dist/37ee3b5201ae2e2dc5dc8b1b20ad900e.js +1 -9
- package/dist/38270ad5088729f40c461c4a5a6bad5d.js +1 -248
- package/dist/3b190e5159c72fb7e27271956772bcba.js +1 -9
- package/dist/3b544bb2c5a4e7b225a4b50235a0fd6d.js +1 -9
- package/dist/3b6e7dc98c47eeafd851ca5072db4be6.js +1 -9
- package/dist/3bbf0faa999b08584dc971eab820113a.js +1 -1169
- package/dist/3c5b59a666c5d39d9ba9cc054d36a410.js +1 -9
- package/dist/3c71a5c0e85afc5486ee9ac29099843d.js +1 -230
- package/dist/3dcc18a5dee46b57ad7f85c0bee86802.js +1 -508
- package/dist/3df92508d7112d83474f31fe9590e289.js +1 -1015
- package/dist/3e277a4ce5486a806a00497aea8ecdd3.js +1 -502
- package/dist/3e3e2243675fa4fb4b320dc57daf2d4f.js +1 -346
- package/dist/3f55ba1c6515db2f98bb996c1a5bc9e3.js +1 -76
- package/dist/3f758ea78954547fed0a8d999691dd7c.js +1 -292
- package/dist/406884d5525e864955e9f5058526aa02.js +1 -101
- package/dist/40dc555a17f1c85020333a41f01dd9ba.js +1 -106
- package/dist/40e6f6cb52a24a747b1046614db3b164.js +1 -213
- package/dist/41d8a58fd52b6a06e8d3fb06cdabf67a.js +1 -989
- package/dist/42b4ce6de00994aa6bf7db7ff2f931a8.js +1 -1331
- package/dist/43a0e099f8283dc1c1c6bbd39148d98d.js +1 -867
- package/dist/440f4d477b586c7a6ba4c1c966ca79fc.js +1 -147
- package/dist/444ababf8edc26948943fbb45bd06a19.js +1 -259
- package/dist/44701e25bb6f2ab9ff18343f2357d1b0.js +1 -171
- package/dist/44ac2a2398075299754707d4bac7c276.js +1 -59
- package/dist/460c67d8fe31ef229704bd5ab6d1dd26.js +1 -942
- package/dist/4639c30a609d986a255ccc684404527e.js +1 -676
- package/dist/4700af84801dbda8a3880e3469c21130.js +1 -413
- package/dist/4736a562251eeaea46dd06892b489f35.js +1 -46
- package/dist/47541c23870e955fff15de4be490ba74.js +1 -112
- package/dist/47f0fbf038314894ac52f2d67466b5e9.js +1 -2848
- package/dist/4860a6a7c59b9ed5c779f7201dc1f591.js +1 -349
- package/dist/48e9351c5623d4da657ce7d5d0267ea6.js +1 -9
- package/dist/4a1dab236c2844d28f73c5c128afe299.js +1 -193
- package/dist/4b425eb8188febc5a89674b89a72d296.js +1 -798
- package/dist/4b61fe945e9e73aba22717e5d6f080df.js +1 -642
- package/dist/4bf3bc1fbdd26ac698fef1bdf26e3ff4.js +1 -9
- package/dist/4c2816c26725f7aae5b490142e31112f.js +1 -352
- package/dist/4ceabd28d8dc751f41002ebf2b6fed88.js +1 -539
- package/dist/4d143a2d103a9e376a9e3b55e680eef7.js +1 -310
- package/dist/4d8cb7033879cb7fcc7a43798e2bde22.js +1 -9
- package/dist/4e389cce6fb8f78845fab249bce43c0b.js +1 -9
- package/dist/4eed3725a00fc2bab78accdb014b7826.js +1 -325
- package/dist/4ef80ee74467e0297eec3cc03092da01.js +1 -9
- package/dist/506d44d8712a22011ce2bec8adbb19b2.js +1 -210
- package/dist/50c073327491a2ed3bfa2ebb466c4204.js +1 -25
- package/dist/51f903c5ce5284a63196247cffb5ca40.js +1 -9
- package/dist/5352ecd8e5f1a2637b48e18cc406edb1.js +1 -9
- package/dist/53e3600928916423671f3388e2d67844.js +1 -9
- package/dist/54b3396acd2c700969248de4b20cbf7c.js +1 -109
- package/dist/55892adefebc0d53993fb108151ed150.js +1 -207
- package/dist/57f4109bd1f06be4dc2bcb8ff7eaf1e5.js +1 -9
- package/dist/57f9654d8ecdebfb02c636e1889af2e4.js +1 -2698
- package/dist/582e24f5ba929e358fadfc7be4c18025.js +1 -9
- package/dist/58598705e7012f4ca1eb1dd21d3c59a5.js +1 -9
- package/dist/5861dfe4f2c7823623e82d0619c5bf06.js +1 -9
- package/dist/58aab872dbdb5e1607076e1935130e03.js +1 -9
- package/dist/595aef8d8b0a2017e2fc27db5703e0d1.js +1 -167
- package/dist/59cc05504a1c823b6d4796bf6b430822.js +1 -9
- package/dist/5a496ae20cc576bef1d35972548207cf.js +1 -9
- package/dist/5a67fdd5293af0a35defd2574c05cd04.js +1 -1803
- package/dist/5ada4185d70a1852b578b2063de58e37.js +1 -221
- package/dist/5b6a626249d0bc43e412fffa6a9ee177.js +1 -9
- package/dist/5bad2df0e3bfd8fdc1a332fb6276cb39.js +1 -360
- package/dist/5c53d90bf4029cfd1b6a0945d1cae142.js +1 -3550
- package/dist/5c96efcfd419a70a93c96557979bc66d.js +1 -371
- package/dist/5d3314103b00c8ea165c6f9f6757f794.js +1 -9
- package/dist/5d46734b57c7408a41473abcd515b64c.js +1 -387
- package/dist/5da9145440d57c9b84d469253e84898d.js +1 -154
- package/dist/5e37c1ef17a219449c8c6aa37a87a941.js +1 -101
- package/dist/5e3f006db26e9b277b1bdbc130611a14.js +1 -400
- package/dist/5e55b301888460bd06c8e26d1011e01a.js +1 -9
- package/dist/5e6c2744429a8fac6e536b179c1f31d0.js +1 -293
- package/dist/5ebdef8c548fca6c51280e915d6f4c3f.js +1 -168
- package/dist/5ede1aebde9d4e5f5cce2db3044495c7.js +1 -148
- package/dist/5f3ce6efab3c679ec1ad25ab0b3f6b2f.js +1 -9
- package/dist/5fb6059ab5d7abab7a74eb73028a3aeb.js +1 -361
- package/dist/5fc5c77d4df4f5d77f8530f6b23ecd1e.js +1 -135
- package/dist/5fedbf948ed123687f77167fac1faf8b.js +1 -9
- package/dist/60340be8eea1d704a17f399b3c3f9577.js +1 -200
- package/dist/621b99ed1a029c36b4e91ec35f36c344.js +1 -44
- package/dist/6292be0125d3720498496eaa7f541618.js +1 -56
- package/dist/63b15fb6fc8f897b22a4bf72b7e8452a.js +1 -57668
- package/dist/64a5f4d62507d032038dcd76d15188e1.js +1 -9
- package/dist/64c45b6610e353ba59a58afc6dd090ca.js +1 -450
- package/dist/64d6924350bd7706850cdc0dcc76ccf6.js +1 -9
- package/dist/6511453710d760c2682567b40ddb3301.js +1 -593
- package/dist/656f53e1b4c6e37a31799737faf6d639.js +1 -209
- package/dist/663234c150f2097f3812c6065491497c.js +1 -254
- package/dist/6903d8ef977a1424c4e2eb22b96feb77.js +1 -118
- package/dist/6a7bf4fb4484f6f48d8e4337f126a61d.js +1 -1246
- package/dist/6abb884bd4f1a54529c00b58c14741cc.js +1 -128
- package/dist/6bb61adbbc13088ee1c32d88b5c7e754.js +1 -1743
- package/dist/6c0a75dc5671c3f237a79f6e45b9891c.js +1 -9
- package/dist/6c67587c2093ac3a19da9f2196e040b7.js +1 -9
- package/dist/6d38cef4a006e6cfe54a6117aba7b600.js +1 -9
- package/dist/6f09754fd684f82e6c06ae526d15ac80.js +1 -740
- package/dist/6f64da239140d00b81d8b6c523e86daf.js +1 -116
- package/dist/6faa9e5f2a0122d2333fa450337a09b0.js +1 -9
- package/dist/6fd6a6ddbcbbebe735c9d21e594203ec.js +1 -145
- package/dist/6fe3f0823e345813c2084b243cb6650b.js +1 -6198
- package/dist/70074e0c785c9a808dea76c7c7d17af3.js +1 -9
- package/dist/70286c33cab463fd576766adecd2d5d9.js +1 -9
- package/dist/707fa1de4d2096da1951c4bc9d21cb6d.js +1 -75
- package/dist/7080d2a1db1608264a6d9d9fbaf2cce8.js +1 -9
- package/dist/716879b6ef8945d579595d88534ae402.js +1 -417
- package/dist/725da29f1643c2263a437c08a1454aea.js +1 -9
- package/dist/73c78b067c792ea8c737746e4671d3e0.js +1 -120
- package/dist/740f4264cd757fcf28331fd30daf295e.js +1 -18
- package/dist/7493f0c3c9bf268d6ad785019d993dd7.js +1 -150
- package/dist/74fa46809aba9625071aa51bc0a71561.js +1 -122
- package/dist/755114145e5b97e5571a160a39e716db.js +1 -9
- package/dist/75bffda9455d77087f34708ac4e85371.js +1 -2640
- package/dist/75d2dae20d7bac5ecfa9dafc48ec04eb.js +1 -277
- package/dist/760eb6458a048f3cba7bc3ae52ef2ba4.js +1 -137
- package/dist/7735af777659608bcd8cd6525e3bbe58.js +1 -135
- package/dist/77aaca51c1c32acaf32656d45f4dc017.js +1 -9
- package/dist/77dd68f6396b8ab4ce2c238d6ddb5354.js +1 -331
- package/dist/788819e459cdd8c4c1ef565fd303f519.js +1 -113
- package/dist/7a9a1dced0e327dc9cb1728bef25641d.js +1 -114
- package/dist/7bd84be066027e61c84c9c2aa9543c2a.js +1 -888
- package/dist/7c1cd1223bd45600763f8c152ad167d5.js +1 -873
- package/dist/7c27341a2599ffb713c8fb7beced7601.js +1 -306
- package/dist/7c317e61789b17749dfe6ea294c89b6b.js +1 -193
- package/dist/7c9c55eb1a1e5c1dfd63631511d9a1f0.js +1 -720
- package/dist/7dead8e2fcacc316bbfa632cd9f1c9bb.js +1 -163
- package/dist/7e4099fc2d04c7c1cf96892b962ba4ec.js +1 -9
- package/dist/7ef082035f74b3d7324f95a7498ea656.js +1 -2632
- package/dist/7f12d133c88ce53d0837a6c4c0287a37.js +1 -360
- package/dist/7f407a1006eb830d6f0aaad96c133d26.js +1 -430
- package/dist/805cb6232d7a9fa46025d48a43622ecf.js +1 -9
- package/dist/80a171b7595d1161735e23dec8efddd6.js +1 -363
- package/dist/82fed7ec74be91e0db61c500d9c6d7ee.js +1 -303
- package/dist/83387cb17a7680f59240e7b399e3ac2b.js +1 -9
- package/dist/8361542d34c46713c9aff6c4ce65a9a3.js +1 -2693
- package/dist/85a977f41a907dba8c672f9bf4943da0.js +1 -3028
- package/dist/866bf6ca5057dcb24503761af061d486.js +1 -478
- package/dist/870184211838006214be1c23c98672fc.js +1 -17
- package/dist/8707a7b49421dbbb842506674ff87fa3.js +1 -59
- package/dist/875e553a27bee88a73df34a90b3058e4.js +1 -2564
- package/dist/8772719d0f76ecabded160e32dc5eb77.js +1 -503
- package/dist/87932c8321c9985ed3b6979e86d2a50e.js +1 -96
- package/dist/87d6bf8becf2d5ebe2f71fda95a313ea.js +1 -83
- package/dist/88bbfb9fdb8730ffc23f546b42d8d620.js +1 -395
- package/dist/88e2feda80ac8cfb28f1dc0ec833b40d.js +1 -9
- package/dist/894720f1519e5eb34e1b4f33fca7a9dd.js +1 -185
- package/dist/894edcaf39c3c95818e3949d737ed459.js +1 -9
- package/dist/89d3c35a5ef97a600927b477a9ba06b4.js +1 -414
- package/dist/8ba6618773c9d8d0b4f6ecb785651e2c.js +1 -121
- package/dist/8bf75743fb14fea7cf02a5da1bda79d4.js +1 -73
- package/dist/8cb83aa3fea85e950c29450b8237fb72.js +1 -14
- package/dist/8d9bb1799d9b98db107e84f10132e17f.js +1 -9
- package/dist/8ed58ed9c7e1cb1ae1f2830d29011ffb.js +1 -9
- package/dist/909adc4a16e0f97d869e3dd16d561430.js +1 -122
- package/dist/90bafd962205e96c3285d27cbf95c55c.js +1 -68
- package/dist/91bd2b106800bd7812e2ab5a5fea985b.js +1 -110
- package/dist/92f4aab5c66f6269c7054c8fbcb3de13.js +1 -9
- package/dist/957970f69802c38a9092b9b6264cc1b9.js +1 -112
- package/dist/9600fed6a4508afbbcd2c75923d953c3.js +1 -125
- package/dist/962969a46fefcace3305abd4d6e14a2e.js +1 -9
- package/dist/964646d64dd3196a9c27fe302511414a.js +1 -10922
- package/dist/9671c350e11f1569edb5066cbfeb3334.js +1 -98
- package/dist/9696a4229fb787eeb25b26f1274b75ee.js +1 -9
- package/dist/97e72973d750ecb3bc2e75b75bf63c5b.js +1 -9000
- package/dist/9807cf1e443a7440371904b6525f37eb.js +1 -9
- package/dist/985d6749688c18f94994794f88492444.js +1 -278
- package/dist/99ade8b6895e3a1c3d6eb70583cb924e.js +1 -115
- package/dist/9b1fd9cf4206cc32e84150c49707d811.js +1 -9
- package/dist/9b8e2282f60f104ff3ace5b905af4d62.js +1 -64
- package/dist/9ff6d4a6592c0cb7d0b939113c3a6b31.js +1 -95
- package/dist/a164d0e40c4dfa485dcf8e6d5258d767.js +1 -122
- package/dist/a1c8660c5bcc6b6a43a7fb3c351174d9.js +1 -9
- package/dist/a2a705f6bc3a6827d6c94c5978aec36d.js +1 -243
- package/dist/a2c0fcb443c396b30a11fc1682a29c13.js +1 -115
- package/dist/a4306aa43824ec1a4ee422b59a851e6f.js +1 -2622
- package/dist/a4bedde07e392f8ebf64341b61f75df2.js +1 -9
- package/dist/a533e643002830be2da76c9527265860.js +1 -9
- package/dist/a5d364d12a8f7691339c497b2e725bcf.js +1 -145
- package/dist/a7824ec1ab22aeb22bb35ab8bf1ddc4a.js +1 -715
- package/dist/a934b622dd8bdcdcdc1dde985a07ac14.js +1 -36
- package/dist/a98ead014d010899b35ee25c7c225542.js +1 -411
- package/dist/aa0eee504d52a12d3a30bbd523afcc34.js +1 -9
- package/dist/aa5623ec68d23fedb9c9c115c7d99063.js +1 -9
- package/dist/aaddd877950d1e3bf1b3ef0fc0ff596e.js +1 -449
- package/dist/aaf5c3a4f1a188fd051577cea7b87209.js +1 -457
- package/dist/ab4b314445b23359319c14cce9a0e321.js +1 -3687
- package/dist/abb40a9a6ef0b2fe14c66dcadc9857a2.js +1 -248
- package/dist/ad215d7ba317c941cdcc96ae78e86666.js +1 -67
- package/dist/adc5e81257ed3f8d70d03cf79150eec1.js +1 -320
- package/dist/aedbf3a3ece39aab8c9f3b3a3779e79b.js +1 -115
- package/dist/af959c2a870f08dd8abccae97c9b9bae.js +1 -35
- package/dist/b0071564b0854c39e3de8b99d66e4dfd.js +1 -298
- package/dist/b02d982ccb1011197a5a24800b178a0a.js +1 -9
- package/dist/b0803f33b602bd3b26be70f259e38cee.js +1 -102
- package/dist/b1170472ae4b50e3b0070eb991e502fe.js +1 -9
- package/dist/b1ac30076824f72cdff7ea29ae0b6801.js +1 -489
- package/dist/b1f3f77a9279cdb38846ebe13c3438bc.js +1 -9
- package/dist/b20056c149af6b50c851ecfff90e0ccb.js +1 -2792
- package/dist/b20cd9acf45420fcacfd923754185663.js +1 -9
- package/dist/b25188cf2652d63136d5e54c38abf84e.js +1 -500
- package/dist/b2742fab9568b63c2274698af5d381fc.js +1 -135
- package/dist/b2ff96fbe6501ff45c37491b94c96c5f.js +1 -315
- package/dist/b33ef9b4202539d3690251cb8213a034.js +1 -9
- package/dist/b3bb2c8deddd8c2afcf73f6f5d711596.js +1 -61
- package/dist/b402b938ca2da72e0984a1360eda5897.js +1 -40
- package/dist/b460e24d77f9c0d8b21e65d899840adb.js +1 -363
- package/dist/b6a6a4adaab4f09a7835ff64a5096198.js +1 -80
- package/dist/b6df2278bd475169749bab512944b7ec.js +1 -207
- package/dist/b7b7be8216519adf62d75f123f9c6423.js +1 -1470
- package/dist/b808fb222140a85b23ebbe0fffa906d9.js +1 -9
- package/dist/b8197742452dd2e77090dde34cb2dc4d.js +1 -4105
- package/dist/b881dca9d9a80f61d87374b4bd5a2dd5.js +1 -9
- package/dist/b98206b2175363f1150c074608603942.js +1 -592
- package/dist/ba6b8b3e06cd9d0aee9c69278ee84647.js +1 -9
- package/dist/baa5bf4cfefed057a4657a1b02cfa114.js +1 -32
- package/dist/bb4d542cb170b3f7b27a42c69262975b.js +1 -1421
- package/dist/bb5bab7a675544fe31ddb7f4a77dffb9.js +1 -9
- package/dist/bc0551f89df16ee262a67c0431544a9e.js +1 -128
- package/dist/c0736a7477d7aac4c669bb94ccae25d9.js +1 -381
- package/dist/c0780e66c6b1ade0fa22283ce1f9c402.js +1 -1582
- package/dist/c1bc72d79cc6161590fc01c6b139fccd.js +1 -296
- package/dist/c32ec7d45ccd947b98fe458a8ca1405b.js +1 -412
- package/dist/c40023acde0f3d5f4806f5fccbb4284b.js +1 -160
- package/dist/c45445ab45defa960329c6f8e6224e57.js +1 -317
- package/dist/c51840077c684be0e7e13339f85cd4a9.js +1 -9
- package/dist/c530988d2b1966fd10a4d99fa3877e1b.js +1 -9
- package/dist/c631c95d9019218dfd22d028f215e1d1.js +1 -312
- package/dist/c728b4ef87cfd5f561d1601f0867c39d.js +1 -2509
- package/dist/c733414555a126e689832ffb55cc203f.js +1 -820
- package/dist/c797511423f91a877e7fdffa74d015cb.js +1 -914
- package/dist/c7ca9dccbac3af7ebc82b271dd2aa570.js +1 -400
- package/dist/c80e89199aef31e48addb2b35ea96365.js +1 -9
- package/dist/cb4175466ea600940f2927fa03a217e8.js +1 -472
- package/dist/cb652f200fc3dd740b2e7f678a9272ea.js +1 -9
- package/dist/cbdbd623038183a8c068dd24ecd90682.js +1 -9
- package/dist/cbdc4ca43a8c940a6c3f59a8b6f17df5.js +1 -9
- package/dist/ccde58de5468dd353dbee74d631ebdf0.js +1 -34
- package/dist/cd358d9acaaa7049d85b15ac766fc314.js +1 -311
- package/dist/cd9a17f94a922c7c88000b1b3cdd67df.js +1 -9
- package/dist/cda6c5c52fa5d595982da0fac9da25a5.js +1 -984
- package/dist/cf188b3f83735389d47bb12fc9f7069a.js +1 -9
- package/dist/cf3f6b1c74c72cb5d02870022dbc9f94.js +1 -9
- package/dist/cf90a39d245bf7e6c1b41c7a9a28f0a1.js +1 -681
- package/dist/chunk-207.cc1646ee6c7a19f6220b.js +2 -0
- package/dist/chunk-207.cc1646ee6c7a19f6220b.js.map +1 -0
- package/dist/chunk-404.e573ba4c4c7cedc843f3.js +2 -0
- package/dist/chunk-404.e573ba4c4c7cedc843f3.js.map +1 -0
- package/dist/chunk-actions.c7efc5f5036d72d3b972.js +2 -0
- package/dist/chunk-actions.c7efc5f5036d72d3b972.js.map +1 -0
- package/dist/chunk-code-editor.4932fdbfef27989069a5.js +2 -0
- package/dist/chunk-code-editor.4932fdbfef27989069a5.js.map +1 -0
- package/dist/{chunk-docs-actions.8a808416a2d69710472e.js → chunk-docs-actions.fe615fd8e3c8ff68c449.js} +2 -2
- package/dist/chunk-docs-actions.fe615fd8e3c8ff68c449.js.map +1 -0
- package/dist/chunk-vendor-icons.aae1dc235d12dd74b38e.js +1 -0
- package/dist/d04707d65591e86810ebc56d48b10810.js +1 -296
- package/dist/d1a58542777d072396d7cee5487304f9.js +1 -141
- package/dist/d1efdca26800423a363b769b1834cfcf.js +1 -223
- package/dist/d2a00e1726c71ca10fbaf4b9c4374458.js +1 -1003
- package/dist/d2fe7592ff2fdda099b2b6355abe8c06.js +1 -5240
- package/dist/d30fa4070abd6929228505790744e180.js +1 -279
- package/dist/d43ad5f9bad9a042b49b2592c7639c28.js +1 -9
- package/dist/d542dda7308361c34af2afb9b70d755a.js +1 -9
- package/dist/d5a6140d581e5c4eb200259ce372f40b.js +1 -9
- package/dist/d5f79987405c2169278f8de37bcc9d05.js +1 -9
- package/dist/d78d3b050ea95b068380d975fd413fd7.js +1 -9
- package/dist/d79b3962938d65fb85c6f844e86d92d9.js +1 -172
- package/dist/d7b57d5ebdcade0ce5e047509e06861a.js +1 -580
- package/dist/d7d616d4aa8fd3f51d681242853dcde9.js +1 -9
- package/dist/d83f2acd25388452582e5a4c727255b0.js +1 -174
- package/dist/da1c1b1569c4d5872c9a18c29f0b5c90.js +1 -3088
- package/dist/da55f4fe3daed3f79fc4565668ecf7dd.js +1 -97
- package/dist/db8ca5cfb6fe4aaef215f116f6991784.js +1 -9
- package/dist/dbc87324ecf271d088a2ab0823de9c5d.js +1 -75
- package/dist/dbd05051a3ecf6b10e2f7b8904153f2d.js +1 -3194
- package/dist/dc1eb6c1c92d7067c72b82b2833a7d2c.js +1 -2595
- package/dist/dcb197c0214e800da9d9436dfc9437d6.js +1 -162
- package/dist/ddbc961769cd2ff4d4a7a136168ebf4c.js +1 -9
- package/dist/de0fd4fd7c2d7a4887cbc99eed91f797.js +1 -9
- package/dist/df37029cdf8359ecac0aebdf4f257d03.js +1 -386
- package/dist/df5710d97a899b672060afaa8c4891c2.js +1 -316
- package/dist/dfb7dd1fab06b2403f76c23f80b15738.js +1 -1718
- package/dist/e07a0b284934d3a0e8c02c508edc9df1.js +1 -115
- package/dist/e0adad8a8579bf99f3e22f7c214a5c64.js +1 -9
- package/dist/e0e32c3798e8895695ce5b372a0c989f.js +1 -2166
- package/dist/e2b38a8393be2cf23f3894ace3efb1c3.js +1 -9
- package/dist/e3ba4b654313ae98884a6c9044197e09.js +1 -103
- package/dist/e4565878df49fd4ce3edd3f1022c1695.js +1 -244
- package/dist/e4917fa7632b01d28e99304d32d989f7.js +1 -9
- package/dist/e4968d8264b40c14f123f28419eb456d.js +1 -23
- package/dist/e6070e43daf8a9e5f13f515a5a03e66c.js +1 -498
- package/dist/e61779df91186b23e7adf2d1968b2708.js +1 -9
- package/dist/e6ad50b520736b595970c9e07029c3f1.js +1 -9
- package/dist/e6cf8898b285b71e2abe832717ac7060.js +1 -153
- package/dist/e6fae0b04a3000a57f22bb25325c8afe.js +1 -2635
- package/dist/e6fb5287a46e030336c006e3f50ade3a.js +1 -529
- package/dist/e7e1a807af3160b342e0a3550cf8f7c5.js +1 -9
- package/dist/e874d975c9128dc6eb9a513d088bed9f.js +1 -9
- package/dist/e8fa659263d5ca9e0d1be69c048133a8.js +1 -297
- package/dist/e97cfa120fde26da0359ca29afaf3171.js +1 -43
- package/dist/eaa55a522fb2cb2f0287711f42344984.js +1 -9
- package/dist/eba5ee3fb1f3e92af88c69e50b2a8fd1.js +1 -102
- package/dist/ec2d138afc9cc9e81c4c6ef36ed55228.js +1 -103
- package/dist/ec32839f8f3353e66b85450525fa3114.js +1 -2808
- package/dist/ecd02712f5a40fcdaa3bfa8190470024.js +1 -2596
- package/dist/ecd37b343c4dcc8dac849b1c680dcbef.js +1 -1010
- package/dist/ecdb4966f685f3e44b1f28fae46827a3.js +1 -9
- package/dist/ee694c1bcbdc9439e50f816c39fd1023.js +1 -2875
- package/dist/efc14cdf19554635e477781704353ec2.js +1 -9
- package/dist/f0548260c0ac6b0e7cdb8909df1a5333.js +1 -421
- package/dist/f0878cc386a608146dbc8fb3b6745c42.js +1 -422
- package/dist/f326f2f263b1498fedbe1d07d7254d10.js +1 -9
- package/dist/f3c7b9d832aa442df3d140f7697b4f62.js +1 -98
- package/dist/f42342b39da2c42adc65ebcf52839f90.js +1 -102
- package/dist/f4c53706e1721b08e8b2f650c8bd35c4.js +1 -166
- package/dist/f582d9feb91d31036d3dae4cdaea865f.js +1 -3533
- package/dist/f5bea0e1099339b99b21ee2d3c0fc489.js +1 -23
- package/dist/f7186078e00d958aa2b316483dfc7e1c.js +1 -1715
- package/dist/f79630d85284a7f6dadc25c1d256af0a.js +1 -33
- package/dist/f80efec9a63094f19edae0480a0f2cd8.js +1 -635
- package/dist/f90003058d7087f15baa27b80bf08c1d.js +1 -839
- package/dist/f980fd09c34c277299e2d3f83aebdba5.js +1 -102
- package/dist/fb59a7c154104a421146ab9e5bd71540.js +1 -462
- package/dist/fd40b62490e412d27bc67e660aacae19.js +1 -430
- package/dist/fd5bc50b18c9f46380cbe5ec1ac2127b.js +1 -9
- package/dist/fd5e2efd3b2d047abe8473f99c650a35.js +1 -677
- package/dist/fdf4d851b44839d8fdfa77b3419bce19.js +1 -204
- package/dist/ffd3b83e8b5878f4785591ff54b1dfff.js +1 -9
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-207.a88d16e56962fd4d2978.js +0 -2
- package/dist/chunk-207.a88d16e56962fd4d2978.js.map +0 -1
- package/dist/chunk-404.0ea933a6d9513f2665cf.js +0 -2
- package/dist/chunk-404.0ea933a6d9513f2665cf.js.map +0 -1
- package/dist/chunk-actions.1ad5d759ef5d8509c532.js +0 -2
- package/dist/chunk-actions.1ad5d759ef5d8509c532.js.map +0 -1
- package/dist/chunk-code-editor.c86cda6aae761ec82d57.js +0 -2
- package/dist/chunk-code-editor.c86cda6aae761ec82d57.js.map +0 -1
- package/dist/chunk-docs-actions.8a808416a2d69710472e.js.map +0 -1
- package/dist/chunk-vendor-icons.7f0d1996a77d090b3d9c.js +0 -1
|
@@ -1,2806 +1 @@
|
|
|
1
|
-
ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"], function(require, exports, module) {
|
|
2
|
-
"use strict";
|
|
3
|
-
var keys = require("../../lib/keys");
|
|
4
|
-
module.exports.getEditorKeybordShortcuts = function(editor) {
|
|
5
|
-
var KEY_MODS = keys.KEY_MODS;
|
|
6
|
-
var keybindings = [];
|
|
7
|
-
var commandMap = {};
|
|
8
|
-
editor.keyBinding.$handlers.forEach(function(handler) {
|
|
9
|
-
var ckb = handler.commandKeyBinding;
|
|
10
|
-
for (var i in ckb) {
|
|
11
|
-
var key = i.replace(/(^|-)\w/g, function(x) { return x.toUpperCase(); });
|
|
12
|
-
var commands = ckb[i];
|
|
13
|
-
if (!Array.isArray(commands))
|
|
14
|
-
commands = [commands];
|
|
15
|
-
commands.forEach(function(command) {
|
|
16
|
-
if (typeof command != "string")
|
|
17
|
-
command = command.name;
|
|
18
|
-
if (commandMap[command]) {
|
|
19
|
-
commandMap[command].key += "|" + key;
|
|
20
|
-
} else {
|
|
21
|
-
commandMap[command] = {key: key, command: command};
|
|
22
|
-
keybindings.push(commandMap[command]);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return keybindings;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"], function(require, exports, module) {
|
|
33
|
-
"use strict";
|
|
34
|
-
|
|
35
|
-
var Renderer = require("../virtual_renderer").VirtualRenderer;
|
|
36
|
-
var Editor = require("../editor").Editor;
|
|
37
|
-
var Range = require("../range").Range;
|
|
38
|
-
var event = require("../lib/event");
|
|
39
|
-
var lang = require("../lib/lang");
|
|
40
|
-
var dom = require("../lib/dom");
|
|
41
|
-
|
|
42
|
-
var $singleLineEditor = function(el) {
|
|
43
|
-
var renderer = new Renderer(el);
|
|
44
|
-
|
|
45
|
-
renderer.$maxLines = 4;
|
|
46
|
-
|
|
47
|
-
var editor = new Editor(renderer);
|
|
48
|
-
|
|
49
|
-
editor.setHighlightActiveLine(false);
|
|
50
|
-
editor.setShowPrintMargin(false);
|
|
51
|
-
editor.renderer.setShowGutter(false);
|
|
52
|
-
editor.renderer.setHighlightGutterLine(false);
|
|
53
|
-
|
|
54
|
-
editor.$mouseHandler.$focusTimeout = 0;
|
|
55
|
-
editor.$highlightTagPending = true;
|
|
56
|
-
|
|
57
|
-
return editor;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
var AcePopup = function(parentNode) {
|
|
61
|
-
var el = dom.createElement("div");
|
|
62
|
-
var popup = new $singleLineEditor(el);
|
|
63
|
-
|
|
64
|
-
if (parentNode)
|
|
65
|
-
parentNode.appendChild(el);
|
|
66
|
-
el.style.display = "none";
|
|
67
|
-
popup.renderer.content.style.cursor = "default";
|
|
68
|
-
popup.renderer.setStyle("ace_autocomplete");
|
|
69
|
-
|
|
70
|
-
popup.setOption("displayIndentGuides", false);
|
|
71
|
-
popup.setOption("dragDelay", 150);
|
|
72
|
-
|
|
73
|
-
var noop = function(){};
|
|
74
|
-
|
|
75
|
-
popup.focus = noop;
|
|
76
|
-
popup.$isFocused = true;
|
|
77
|
-
|
|
78
|
-
popup.renderer.$cursorLayer.restartTimer = noop;
|
|
79
|
-
popup.renderer.$cursorLayer.element.style.opacity = 0;
|
|
80
|
-
|
|
81
|
-
popup.renderer.$maxLines = 8;
|
|
82
|
-
popup.renderer.$keepTextAreaAtCursor = false;
|
|
83
|
-
|
|
84
|
-
popup.setHighlightActiveLine(false);
|
|
85
|
-
popup.session.highlight("");
|
|
86
|
-
popup.session.$searchHighlight.clazz = "ace_highlight-marker";
|
|
87
|
-
|
|
88
|
-
popup.on("mousedown", function(e) {
|
|
89
|
-
var pos = e.getDocumentPosition();
|
|
90
|
-
popup.selection.moveToPosition(pos);
|
|
91
|
-
selectionMarker.start.row = selectionMarker.end.row = pos.row;
|
|
92
|
-
e.stop();
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
var lastMouseEvent;
|
|
96
|
-
var hoverMarker = new Range(-1,0,-1,Infinity);
|
|
97
|
-
var selectionMarker = new Range(-1,0,-1,Infinity);
|
|
98
|
-
selectionMarker.id = popup.session.addMarker(selectionMarker, "ace_active-line", "fullLine");
|
|
99
|
-
popup.setSelectOnHover = function(val) {
|
|
100
|
-
if (!val) {
|
|
101
|
-
hoverMarker.id = popup.session.addMarker(hoverMarker, "ace_line-hover", "fullLine");
|
|
102
|
-
} else if (hoverMarker.id) {
|
|
103
|
-
popup.session.removeMarker(hoverMarker.id);
|
|
104
|
-
hoverMarker.id = null;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
popup.setSelectOnHover(false);
|
|
108
|
-
popup.on("mousemove", function(e) {
|
|
109
|
-
if (!lastMouseEvent) {
|
|
110
|
-
lastMouseEvent = e;
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (lastMouseEvent.x == e.x && lastMouseEvent.y == e.y) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
lastMouseEvent = e;
|
|
117
|
-
lastMouseEvent.scrollTop = popup.renderer.scrollTop;
|
|
118
|
-
var row = lastMouseEvent.getDocumentPosition().row;
|
|
119
|
-
if (hoverMarker.start.row != row) {
|
|
120
|
-
if (!hoverMarker.id)
|
|
121
|
-
popup.setRow(row);
|
|
122
|
-
setHoverMarker(row);
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
popup.renderer.on("beforeRender", function() {
|
|
126
|
-
if (lastMouseEvent && hoverMarker.start.row != -1) {
|
|
127
|
-
lastMouseEvent.$pos = null;
|
|
128
|
-
var row = lastMouseEvent.getDocumentPosition().row;
|
|
129
|
-
if (!hoverMarker.id)
|
|
130
|
-
popup.setRow(row);
|
|
131
|
-
setHoverMarker(row, true);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
popup.renderer.on("afterRender", function() {
|
|
135
|
-
var row = popup.getRow();
|
|
136
|
-
var t = popup.renderer.$textLayer;
|
|
137
|
-
var selected = t.element.childNodes[row - t.config.firstRow];
|
|
138
|
-
if (selected !== t.selectedNode && t.selectedNode)
|
|
139
|
-
dom.removeCssClass(t.selectedNode, "ace_selected");
|
|
140
|
-
t.selectedNode = selected;
|
|
141
|
-
if (selected)
|
|
142
|
-
dom.addCssClass(selected, "ace_selected");
|
|
143
|
-
});
|
|
144
|
-
var hideHoverMarker = function() { setHoverMarker(-1); };
|
|
145
|
-
var setHoverMarker = function(row, suppressRedraw) {
|
|
146
|
-
if (row !== hoverMarker.start.row) {
|
|
147
|
-
hoverMarker.start.row = hoverMarker.end.row = row;
|
|
148
|
-
if (!suppressRedraw)
|
|
149
|
-
popup.session._emit("changeBackMarker");
|
|
150
|
-
popup._emit("changeHoverMarker");
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
popup.getHoveredRow = function() {
|
|
154
|
-
return hoverMarker.start.row;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
event.addListener(popup.container, "mouseout", hideHoverMarker);
|
|
158
|
-
popup.on("hide", hideHoverMarker);
|
|
159
|
-
popup.on("changeSelection", hideHoverMarker);
|
|
160
|
-
|
|
161
|
-
popup.session.doc.getLength = function() {
|
|
162
|
-
return popup.data.length;
|
|
163
|
-
};
|
|
164
|
-
popup.session.doc.getLine = function(i) {
|
|
165
|
-
var data = popup.data[i];
|
|
166
|
-
if (typeof data == "string")
|
|
167
|
-
return data;
|
|
168
|
-
return (data && data.value) || "";
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
var bgTokenizer = popup.session.bgTokenizer;
|
|
172
|
-
bgTokenizer.$tokenizeRow = function(row) {
|
|
173
|
-
var data = popup.data[row];
|
|
174
|
-
var tokens = [];
|
|
175
|
-
if (!data)
|
|
176
|
-
return tokens;
|
|
177
|
-
if (typeof data == "string")
|
|
178
|
-
data = {value: data};
|
|
179
|
-
var caption = data.caption || data.value || data.name;
|
|
180
|
-
|
|
181
|
-
function addToken(value, className) {
|
|
182
|
-
value && tokens.push({
|
|
183
|
-
type: (data.className || "") + (className || ""),
|
|
184
|
-
value: value
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
var lower = caption.toLowerCase();
|
|
189
|
-
var filterText = (popup.filterText || "").toLowerCase();
|
|
190
|
-
var lastIndex = 0;
|
|
191
|
-
var lastI = 0;
|
|
192
|
-
for (var i = 0; i <= filterText.length; i++) {
|
|
193
|
-
if (i != lastI && (data.matchMask & (1 << i) || i == filterText.length)) {
|
|
194
|
-
var sub = filterText.slice(lastI, i);
|
|
195
|
-
lastI = i;
|
|
196
|
-
var index = lower.indexOf(sub, lastIndex);
|
|
197
|
-
if (index == -1) continue;
|
|
198
|
-
addToken(caption.slice(lastIndex, index), "");
|
|
199
|
-
lastIndex = index + sub.length;
|
|
200
|
-
addToken(caption.slice(index, lastIndex), "completion-highlight");
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
addToken(caption.slice(lastIndex, caption.length), "");
|
|
204
|
-
|
|
205
|
-
if (data.meta)
|
|
206
|
-
tokens.push({type: "completion-meta", value: data.meta});
|
|
207
|
-
if (data.message)
|
|
208
|
-
tokens.push({type: "completion-message", value: data.message});
|
|
209
|
-
|
|
210
|
-
return tokens;
|
|
211
|
-
};
|
|
212
|
-
bgTokenizer.$updateOnChange = noop;
|
|
213
|
-
bgTokenizer.start = noop;
|
|
214
|
-
|
|
215
|
-
popup.session.$computeWidth = function() {
|
|
216
|
-
return this.screenWidth = 0;
|
|
217
|
-
};
|
|
218
|
-
popup.isOpen = false;
|
|
219
|
-
popup.isTopdown = false;
|
|
220
|
-
popup.autoSelect = true;
|
|
221
|
-
popup.filterText = "";
|
|
222
|
-
|
|
223
|
-
popup.data = [];
|
|
224
|
-
popup.setData = function(list, filterText) {
|
|
225
|
-
popup.filterText = filterText || "";
|
|
226
|
-
popup.setValue(lang.stringRepeat("\n", list.length), -1);
|
|
227
|
-
popup.data = list || [];
|
|
228
|
-
popup.setRow(0);
|
|
229
|
-
};
|
|
230
|
-
popup.getData = function(row) {
|
|
231
|
-
return popup.data[row];
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
popup.getRow = function() {
|
|
235
|
-
return selectionMarker.start.row;
|
|
236
|
-
};
|
|
237
|
-
popup.setRow = function(line) {
|
|
238
|
-
line = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length, line));
|
|
239
|
-
if (selectionMarker.start.row != line) {
|
|
240
|
-
popup.selection.clearSelection();
|
|
241
|
-
selectionMarker.start.row = selectionMarker.end.row = line || 0;
|
|
242
|
-
popup.session._emit("changeBackMarker");
|
|
243
|
-
popup.moveCursorTo(line || 0, 0);
|
|
244
|
-
if (popup.isOpen)
|
|
245
|
-
popup._signal("select");
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
popup.on("changeSelection", function() {
|
|
250
|
-
if (popup.isOpen)
|
|
251
|
-
popup.setRow(popup.selection.lead.row);
|
|
252
|
-
popup.renderer.scrollCursorIntoView();
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
popup.hide = function() {
|
|
256
|
-
this.container.style.display = "none";
|
|
257
|
-
this._signal("hide");
|
|
258
|
-
popup.isOpen = false;
|
|
259
|
-
};
|
|
260
|
-
popup.show = function(pos, lineHeight, topdownOnly) {
|
|
261
|
-
var el = this.container;
|
|
262
|
-
var screenHeight = window.innerHeight;
|
|
263
|
-
var screenWidth = window.innerWidth;
|
|
264
|
-
var renderer = this.renderer;
|
|
265
|
-
var maxH = renderer.$maxLines * lineHeight * 1.4;
|
|
266
|
-
var top = pos.top + this.$borderSize;
|
|
267
|
-
var allowTopdown = top > screenHeight / 2 && !topdownOnly;
|
|
268
|
-
if (allowTopdown && top + lineHeight + maxH > screenHeight) {
|
|
269
|
-
renderer.$maxPixelHeight = top - 2 * this.$borderSize;
|
|
270
|
-
el.style.top = "";
|
|
271
|
-
el.style.bottom = screenHeight - top + "px";
|
|
272
|
-
popup.isTopdown = false;
|
|
273
|
-
} else {
|
|
274
|
-
top += lineHeight;
|
|
275
|
-
renderer.$maxPixelHeight = screenHeight - top - 0.2 * lineHeight;
|
|
276
|
-
el.style.top = top + "px";
|
|
277
|
-
el.style.bottom = "";
|
|
278
|
-
popup.isTopdown = true;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
el.style.display = "";
|
|
282
|
-
|
|
283
|
-
var left = pos.left;
|
|
284
|
-
if (left + el.offsetWidth > screenWidth)
|
|
285
|
-
left = screenWidth - el.offsetWidth;
|
|
286
|
-
|
|
287
|
-
el.style.left = left + "px";
|
|
288
|
-
|
|
289
|
-
this._signal("show");
|
|
290
|
-
lastMouseEvent = null;
|
|
291
|
-
popup.isOpen = true;
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
popup.goTo = function(where) {
|
|
295
|
-
var row = this.getRow();
|
|
296
|
-
var max = this.session.getLength() - 1;
|
|
297
|
-
|
|
298
|
-
switch(where) {
|
|
299
|
-
case "up": row = row <= 0 ? max : row - 1; break;
|
|
300
|
-
case "down": row = row >= max ? -1 : row + 1; break;
|
|
301
|
-
case "start": row = 0; break;
|
|
302
|
-
case "end": row = max; break;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
this.setRow(row);
|
|
306
|
-
};
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
popup.getTextLeftOffset = function() {
|
|
310
|
-
return this.$borderSize + this.renderer.$padding + this.$imageSize;
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
popup.$imageSize = 0;
|
|
314
|
-
popup.$borderSize = 1;
|
|
315
|
-
|
|
316
|
-
return popup;
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
dom.importCssString("\
|
|
320
|
-
.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\
|
|
321
|
-
background-color: #CAD6FA;\
|
|
322
|
-
z-index: 1;\
|
|
323
|
-
}\
|
|
324
|
-
.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\
|
|
325
|
-
background-color: #3a674e;\
|
|
326
|
-
}\
|
|
327
|
-
.ace_editor.ace_autocomplete .ace_line-hover {\
|
|
328
|
-
border: 1px solid #abbffe;\
|
|
329
|
-
margin-top: -1px;\
|
|
330
|
-
background: rgba(233,233,253,0.4);\
|
|
331
|
-
position: absolute;\
|
|
332
|
-
z-index: 2;\
|
|
333
|
-
}\
|
|
334
|
-
.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\
|
|
335
|
-
border: 1px solid rgba(109, 150, 13, 0.8);\
|
|
336
|
-
background: rgba(58, 103, 78, 0.62);\
|
|
337
|
-
}\
|
|
338
|
-
.ace_completion-meta {\
|
|
339
|
-
opacity: 0.5;\
|
|
340
|
-
margin: 0.9em;\
|
|
341
|
-
}\
|
|
342
|
-
.ace_completion-message {\
|
|
343
|
-
color: blue;\
|
|
344
|
-
}\
|
|
345
|
-
.ace_editor.ace_autocomplete .ace_completion-highlight{\
|
|
346
|
-
color: #2d69c7;\
|
|
347
|
-
}\
|
|
348
|
-
.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\
|
|
349
|
-
color: #93ca12;\
|
|
350
|
-
}\
|
|
351
|
-
.ace_editor.ace_autocomplete {\
|
|
352
|
-
width: 300px;\
|
|
353
|
-
z-index: 200000;\
|
|
354
|
-
border: 1px lightgray solid;\
|
|
355
|
-
position: fixed;\
|
|
356
|
-
box-shadow: 2px 3px 5px rgba(0,0,0,.2);\
|
|
357
|
-
line-height: 1.4;\
|
|
358
|
-
background: #fefefe;\
|
|
359
|
-
color: #111;\
|
|
360
|
-
}\
|
|
361
|
-
.ace_dark.ace_editor.ace_autocomplete {\
|
|
362
|
-
border: 1px #484747 solid;\
|
|
363
|
-
box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\
|
|
364
|
-
line-height: 1.4;\
|
|
365
|
-
background: #25282c;\
|
|
366
|
-
color: #c1c1c1;\
|
|
367
|
-
}", "autocompletion.css", false);
|
|
368
|
-
|
|
369
|
-
exports.AcePopup = AcePopup;
|
|
370
|
-
exports.$singleLineEditor = $singleLineEditor;
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
ace.define("ace/autocomplete/util",["require","exports","module"], function(require, exports, module) {
|
|
374
|
-
"use strict";
|
|
375
|
-
|
|
376
|
-
exports.parForEach = function(array, fn, callback) {
|
|
377
|
-
var completed = 0;
|
|
378
|
-
var arLength = array.length;
|
|
379
|
-
if (arLength === 0)
|
|
380
|
-
callback();
|
|
381
|
-
for (var i = 0; i < arLength; i++) {
|
|
382
|
-
fn(array[i], function(result, err) {
|
|
383
|
-
completed++;
|
|
384
|
-
if (completed === arLength)
|
|
385
|
-
callback(result, err);
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
|
|
390
|
-
var ID_REGEX = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;
|
|
391
|
-
|
|
392
|
-
exports.retrievePrecedingIdentifier = function(text, pos, regex) {
|
|
393
|
-
regex = regex || ID_REGEX;
|
|
394
|
-
var buf = [];
|
|
395
|
-
for (var i = pos-1; i >= 0; i--) {
|
|
396
|
-
if (regex.test(text[i]))
|
|
397
|
-
buf.push(text[i]);
|
|
398
|
-
else
|
|
399
|
-
break;
|
|
400
|
-
}
|
|
401
|
-
return buf.reverse().join("");
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
exports.retrieveFollowingIdentifier = function(text, pos, regex) {
|
|
405
|
-
regex = regex || ID_REGEX;
|
|
406
|
-
var buf = [];
|
|
407
|
-
for (var i = pos; i < text.length; i++) {
|
|
408
|
-
if (regex.test(text[i]))
|
|
409
|
-
buf.push(text[i]);
|
|
410
|
-
else
|
|
411
|
-
break;
|
|
412
|
-
}
|
|
413
|
-
return buf;
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
exports.getCompletionPrefix = function (editor) {
|
|
417
|
-
var pos = editor.getCursorPosition();
|
|
418
|
-
var line = editor.session.getLine(pos.row);
|
|
419
|
-
var prefix;
|
|
420
|
-
editor.completers.forEach(function(completer) {
|
|
421
|
-
if (completer.identifierRegexps) {
|
|
422
|
-
completer.identifierRegexps.forEach(function(identifierRegex) {
|
|
423
|
-
if (!prefix && identifierRegex)
|
|
424
|
-
prefix = this.retrievePrecedingIdentifier(line, pos.column, identifierRegex);
|
|
425
|
-
}.bind(this));
|
|
426
|
-
}
|
|
427
|
-
}.bind(this));
|
|
428
|
-
return prefix || this.retrievePrecedingIdentifier(line, pos.column);
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
});
|
|
432
|
-
|
|
433
|
-
ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"], function(require, exports, module) {
|
|
434
|
-
"use strict";
|
|
435
|
-
var dom = require("./lib/dom");
|
|
436
|
-
var oop = require("./lib/oop");
|
|
437
|
-
var EventEmitter = require("./lib/event_emitter").EventEmitter;
|
|
438
|
-
var lang = require("./lib/lang");
|
|
439
|
-
var Range = require("./range").Range;
|
|
440
|
-
var RangeList = require("./range_list").RangeList;
|
|
441
|
-
var HashHandler = require("./keyboard/hash_handler").HashHandler;
|
|
442
|
-
var Tokenizer = require("./tokenizer").Tokenizer;
|
|
443
|
-
var clipboard = require("./clipboard");
|
|
444
|
-
|
|
445
|
-
var VARIABLES = {
|
|
446
|
-
CURRENT_WORD: function(editor) {
|
|
447
|
-
return editor.session.getTextRange(editor.session.getWordRange());
|
|
448
|
-
},
|
|
449
|
-
SELECTION: function(editor, name, indentation) {
|
|
450
|
-
var text = editor.session.getTextRange();
|
|
451
|
-
if (indentation)
|
|
452
|
-
return text.replace(/\n\r?([ \t]*\S)/g, "\n" + indentation + "$1");
|
|
453
|
-
return text;
|
|
454
|
-
},
|
|
455
|
-
CURRENT_LINE: function(editor) {
|
|
456
|
-
return editor.session.getLine(editor.getCursorPosition().row);
|
|
457
|
-
},
|
|
458
|
-
PREV_LINE: function(editor) {
|
|
459
|
-
return editor.session.getLine(editor.getCursorPosition().row - 1);
|
|
460
|
-
},
|
|
461
|
-
LINE_INDEX: function(editor) {
|
|
462
|
-
return editor.getCursorPosition().row;
|
|
463
|
-
},
|
|
464
|
-
LINE_NUMBER: function(editor) {
|
|
465
|
-
return editor.getCursorPosition().row + 1;
|
|
466
|
-
},
|
|
467
|
-
SOFT_TABS: function(editor) {
|
|
468
|
-
return editor.session.getUseSoftTabs() ? "YES" : "NO";
|
|
469
|
-
},
|
|
470
|
-
TAB_SIZE: function(editor) {
|
|
471
|
-
return editor.session.getTabSize();
|
|
472
|
-
},
|
|
473
|
-
CLIPBOARD: function(editor) {
|
|
474
|
-
return clipboard.getText && clipboard.getText();
|
|
475
|
-
},
|
|
476
|
-
FILENAME: function(editor) {
|
|
477
|
-
return /[^/\\]*$/.exec(this.FILEPATH(editor))[0];
|
|
478
|
-
},
|
|
479
|
-
FILENAME_BASE: function(editor) {
|
|
480
|
-
return /[^/\\]*$/.exec(this.FILEPATH(editor))[0].replace(/\.[^.]*$/, "");
|
|
481
|
-
},
|
|
482
|
-
DIRECTORY: function(editor) {
|
|
483
|
-
return this.FILEPATH(editor).replace(/[^/\\]*$/, "");
|
|
484
|
-
},
|
|
485
|
-
FILEPATH: function(editor) { return "/not implemented.txt"; },
|
|
486
|
-
WORKSPACE_NAME: function() { return "Unknown"; },
|
|
487
|
-
FULLNAME: function() { return "Unknown"; },
|
|
488
|
-
BLOCK_COMMENT_START: function(editor) {
|
|
489
|
-
var mode = editor.session.$mode || {};
|
|
490
|
-
return mode.blockComment && mode.blockComment.start || "";
|
|
491
|
-
},
|
|
492
|
-
BLOCK_COMMENT_END: function(editor) {
|
|
493
|
-
var mode = editor.session.$mode || {};
|
|
494
|
-
return mode.blockComment && mode.blockComment.end || "";
|
|
495
|
-
},
|
|
496
|
-
LINE_COMMENT: function(editor) {
|
|
497
|
-
var mode = editor.session.$mode || {};
|
|
498
|
-
return mode.lineCommentStart || "";
|
|
499
|
-
},
|
|
500
|
-
CURRENT_YEAR: date.bind(null, {year: "numeric"}),
|
|
501
|
-
CURRENT_YEAR_SHORT: date.bind(null, {year: "2-digit"}),
|
|
502
|
-
CURRENT_MONTH: date.bind(null, {month: "numeric"}),
|
|
503
|
-
CURRENT_MONTH_NAME: date.bind(null, {month: "long"}),
|
|
504
|
-
CURRENT_MONTH_NAME_SHORT: date.bind(null, {month: "short"}),
|
|
505
|
-
CURRENT_DATE: date.bind(null, {day: "2-digit"}),
|
|
506
|
-
CURRENT_DAY_NAME: date.bind(null, {weekday: "long"}),
|
|
507
|
-
CURRENT_DAY_NAME_SHORT: date.bind(null, {weekday: "short"}),
|
|
508
|
-
CURRENT_HOUR: date.bind(null, {hour: "2-digit", hour12: false}),
|
|
509
|
-
CURRENT_MINUTE: date.bind(null, {minute: "2-digit"}),
|
|
510
|
-
CURRENT_SECOND: date.bind(null, {second: "2-digit"})
|
|
511
|
-
};
|
|
512
|
-
|
|
513
|
-
VARIABLES.SELECTED_TEXT = VARIABLES.SELECTION;
|
|
514
|
-
|
|
515
|
-
function date(dateFormat) {
|
|
516
|
-
var str = new Date().toLocaleString("en-us", dateFormat);
|
|
517
|
-
return str.length == 1 ? "0" + str : str;
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
var SnippetManager = function() {
|
|
521
|
-
this.snippetMap = {};
|
|
522
|
-
this.snippetNameMap = {};
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
(function() {
|
|
526
|
-
oop.implement(this, EventEmitter);
|
|
527
|
-
|
|
528
|
-
this.getTokenizer = function() {
|
|
529
|
-
return SnippetManager.$tokenizer || this.createTokenizer();
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
this.createTokenizer = function() {
|
|
533
|
-
function TabstopToken(str) {
|
|
534
|
-
str = str.substr(1);
|
|
535
|
-
if (/^\d+$/.test(str))
|
|
536
|
-
return [{tabstopId: parseInt(str, 10)}];
|
|
537
|
-
return [{text: str}];
|
|
538
|
-
}
|
|
539
|
-
function escape(ch) {
|
|
540
|
-
return "(?:[^\\\\" + ch + "]|\\\\.)";
|
|
541
|
-
}
|
|
542
|
-
var formatMatcher = {
|
|
543
|
-
regex: "/(" + escape("/") + "+)/",
|
|
544
|
-
onMatch: function(val, state, stack) {
|
|
545
|
-
var ts = stack[0];
|
|
546
|
-
ts.fmtString = true;
|
|
547
|
-
ts.guard = val.slice(1, -1);
|
|
548
|
-
ts.flag = "";
|
|
549
|
-
return "";
|
|
550
|
-
},
|
|
551
|
-
next: "formatString"
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
SnippetManager.$tokenizer = new Tokenizer({
|
|
555
|
-
start: [
|
|
556
|
-
{regex: /\\./, onMatch: function(val, state, stack) {
|
|
557
|
-
var ch = val[1];
|
|
558
|
-
if (ch == "}" && stack.length) {
|
|
559
|
-
val = ch;
|
|
560
|
-
} else if ("`$\\".indexOf(ch) != -1) {
|
|
561
|
-
val = ch;
|
|
562
|
-
}
|
|
563
|
-
return [val];
|
|
564
|
-
}},
|
|
565
|
-
{regex: /}/, onMatch: function(val, state, stack) {
|
|
566
|
-
return [stack.length ? stack.shift() : val];
|
|
567
|
-
}},
|
|
568
|
-
{regex: /\$(?:\d+|\w+)/, onMatch: TabstopToken},
|
|
569
|
-
{regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(str, state, stack) {
|
|
570
|
-
var t = TabstopToken(str.substr(1));
|
|
571
|
-
stack.unshift(t[0]);
|
|
572
|
-
return t;
|
|
573
|
-
}, next: "snippetVar"},
|
|
574
|
-
{regex: /\n/, token: "newline", merge: false}
|
|
575
|
-
],
|
|
576
|
-
snippetVar: [
|
|
577
|
-
{regex: "\\|" + escape("\\|") + "*\\|", onMatch: function(val, state, stack) {
|
|
578
|
-
var choices = val.slice(1, -1).replace(/\\[,|\\]|,/g, function(operator) {
|
|
579
|
-
return operator.length == 2 ? operator[1] : "\x00";
|
|
580
|
-
}).split("\x00").map(function(value){
|
|
581
|
-
return {value: value};
|
|
582
|
-
});
|
|
583
|
-
stack[0].choices = choices;
|
|
584
|
-
return [choices[0]];
|
|
585
|
-
}, next: "start"},
|
|
586
|
-
formatMatcher,
|
|
587
|
-
{regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start"}
|
|
588
|
-
],
|
|
589
|
-
formatString: [
|
|
590
|
-
{regex: /:/, onMatch: function(val, state, stack) {
|
|
591
|
-
if (stack.length && stack[0].expectElse) {
|
|
592
|
-
stack[0].expectElse = false;
|
|
593
|
-
stack[0].ifEnd = {elseEnd: stack[0]};
|
|
594
|
-
return [stack[0].ifEnd];
|
|
595
|
-
}
|
|
596
|
-
return ":";
|
|
597
|
-
}},
|
|
598
|
-
{regex: /\\./, onMatch: function(val, state, stack) {
|
|
599
|
-
var ch = val[1];
|
|
600
|
-
if (ch == "}" && stack.length)
|
|
601
|
-
val = ch;
|
|
602
|
-
else if ("`$\\".indexOf(ch) != -1)
|
|
603
|
-
val = ch;
|
|
604
|
-
else if (ch == "n")
|
|
605
|
-
val = "\n";
|
|
606
|
-
else if (ch == "t")
|
|
607
|
-
val = "\t";
|
|
608
|
-
else if ("ulULE".indexOf(ch) != -1)
|
|
609
|
-
val = {changeCase: ch, local: ch > "a"};
|
|
610
|
-
return [val];
|
|
611
|
-
}},
|
|
612
|
-
{regex: "/\\w*}", onMatch: function(val, state, stack) {
|
|
613
|
-
var next = stack.shift();
|
|
614
|
-
if (next)
|
|
615
|
-
next.flag = val.slice(1, -1);
|
|
616
|
-
this.next = next && next.tabstopId ? "start" : "";
|
|
617
|
-
return [next || val];
|
|
618
|
-
}, next: "start"},
|
|
619
|
-
{regex: /\$(?:\d+|\w+)/, onMatch: function(val, state, stack) {
|
|
620
|
-
return [{text: val.slice(1)}];
|
|
621
|
-
}},
|
|
622
|
-
{regex: /\${\w+/, onMatch: function(val, state, stack) {
|
|
623
|
-
var token = {text: val.slice(2)};
|
|
624
|
-
stack.unshift(token);
|
|
625
|
-
return [token];
|
|
626
|
-
}, next: "formatStringVar"},
|
|
627
|
-
{regex: /\n/, token: "newline", merge: false},
|
|
628
|
-
{regex: /}/, onMatch: function(val, state, stack) {
|
|
629
|
-
var next = stack.shift();
|
|
630
|
-
this.next = next && next.tabstopId ? "start" : "";
|
|
631
|
-
return [next || val];
|
|
632
|
-
}, next: "start"}
|
|
633
|
-
],
|
|
634
|
-
formatStringVar: [
|
|
635
|
-
{regex: /:\/\w+}/, onMatch: function(val, state, stack) {
|
|
636
|
-
var ts = stack[0];
|
|
637
|
-
ts.formatFunction = val.slice(2, -1);
|
|
638
|
-
return [stack.shift()];
|
|
639
|
-
}, next: "formatString"},
|
|
640
|
-
formatMatcher,
|
|
641
|
-
{regex: /:[\?\-+]?/, onMatch: function(val, state, stack) {
|
|
642
|
-
if (val[1] == "+")
|
|
643
|
-
stack[0].ifEnd = stack[0];
|
|
644
|
-
if (val[1] == "?")
|
|
645
|
-
stack[0].expectElse = true;
|
|
646
|
-
}, next: "formatString"},
|
|
647
|
-
{regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString"}
|
|
648
|
-
]
|
|
649
|
-
});
|
|
650
|
-
return SnippetManager.$tokenizer;
|
|
651
|
-
};
|
|
652
|
-
|
|
653
|
-
this.tokenizeTmSnippet = function(str, startState) {
|
|
654
|
-
return this.getTokenizer().getLineTokens(str, startState).tokens.map(function(x) {
|
|
655
|
-
return x.value || x;
|
|
656
|
-
});
|
|
657
|
-
};
|
|
658
|
-
|
|
659
|
-
this.getVariableValue = function(editor, name, indentation) {
|
|
660
|
-
if (/^\d+$/.test(name))
|
|
661
|
-
return (this.variables.__ || {})[name] || "";
|
|
662
|
-
if (/^[A-Z]\d+$/.test(name))
|
|
663
|
-
return (this.variables[name[0] + "__"] || {})[name.substr(1)] || "";
|
|
664
|
-
|
|
665
|
-
name = name.replace(/^TM_/, "");
|
|
666
|
-
if (!this.variables.hasOwnProperty(name))
|
|
667
|
-
return "";
|
|
668
|
-
var value = this.variables[name];
|
|
669
|
-
if (typeof value == "function")
|
|
670
|
-
value = this.variables[name](editor, name, indentation);
|
|
671
|
-
return value == null ? "" : value;
|
|
672
|
-
};
|
|
673
|
-
|
|
674
|
-
this.variables = VARIABLES;
|
|
675
|
-
this.tmStrFormat = function(str, ch, editor) {
|
|
676
|
-
if (!ch.fmt) return str;
|
|
677
|
-
var flag = ch.flag || "";
|
|
678
|
-
var re = ch.guard;
|
|
679
|
-
re = new RegExp(re, flag.replace(/[^gim]/g, ""));
|
|
680
|
-
var fmtTokens = typeof ch.fmt == "string" ? this.tokenizeTmSnippet(ch.fmt, "formatString") : ch.fmt;
|
|
681
|
-
var _self = this;
|
|
682
|
-
var formatted = str.replace(re, function() {
|
|
683
|
-
var oldArgs = _self.variables.__;
|
|
684
|
-
_self.variables.__ = [].slice.call(arguments);
|
|
685
|
-
var fmtParts = _self.resolveVariables(fmtTokens, editor);
|
|
686
|
-
var gChangeCase = "E";
|
|
687
|
-
for (var i = 0; i < fmtParts.length; i++) {
|
|
688
|
-
var ch = fmtParts[i];
|
|
689
|
-
if (typeof ch == "object") {
|
|
690
|
-
fmtParts[i] = "";
|
|
691
|
-
if (ch.changeCase && ch.local) {
|
|
692
|
-
var next = fmtParts[i + 1];
|
|
693
|
-
if (next && typeof next == "string") {
|
|
694
|
-
if (ch.changeCase == "u")
|
|
695
|
-
fmtParts[i] = next[0].toUpperCase();
|
|
696
|
-
else
|
|
697
|
-
fmtParts[i] = next[0].toLowerCase();
|
|
698
|
-
fmtParts[i + 1] = next.substr(1);
|
|
699
|
-
}
|
|
700
|
-
} else if (ch.changeCase) {
|
|
701
|
-
gChangeCase = ch.changeCase;
|
|
702
|
-
}
|
|
703
|
-
} else if (gChangeCase == "U") {
|
|
704
|
-
fmtParts[i] = ch.toUpperCase();
|
|
705
|
-
} else if (gChangeCase == "L") {
|
|
706
|
-
fmtParts[i] = ch.toLowerCase();
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
_self.variables.__ = oldArgs;
|
|
710
|
-
return fmtParts.join("");
|
|
711
|
-
});
|
|
712
|
-
return formatted;
|
|
713
|
-
};
|
|
714
|
-
|
|
715
|
-
this.tmFormatFunction = function(str, ch, editor) {
|
|
716
|
-
if (ch.formatFunction == "upcase")
|
|
717
|
-
return str.toUpperCase();
|
|
718
|
-
if (ch.formatFunction == "downcase")
|
|
719
|
-
return str.toLowerCase();
|
|
720
|
-
return str;
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
this.resolveVariables = function(snippet, editor) {
|
|
724
|
-
var result = [];
|
|
725
|
-
var indentation = "";
|
|
726
|
-
var afterNewLine = true;
|
|
727
|
-
for (var i = 0; i < snippet.length; i++) {
|
|
728
|
-
var ch = snippet[i];
|
|
729
|
-
if (typeof ch == "string") {
|
|
730
|
-
result.push(ch);
|
|
731
|
-
if (ch == "\n") {
|
|
732
|
-
afterNewLine = true;
|
|
733
|
-
indentation = "";
|
|
734
|
-
}
|
|
735
|
-
else if (afterNewLine) {
|
|
736
|
-
indentation = /^\t*/.exec(ch)[0];
|
|
737
|
-
afterNewLine = /\S/.test(ch);
|
|
738
|
-
}
|
|
739
|
-
continue;
|
|
740
|
-
}
|
|
741
|
-
if (!ch) continue;
|
|
742
|
-
afterNewLine = false;
|
|
743
|
-
|
|
744
|
-
if (ch.fmtString) {
|
|
745
|
-
var j = snippet.indexOf(ch, i + 1);
|
|
746
|
-
if (j == -1) j = snippet.length;
|
|
747
|
-
ch.fmt = snippet.slice(i + 1, j);
|
|
748
|
-
i = j;
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
if (ch.text) {
|
|
752
|
-
var value = this.getVariableValue(editor, ch.text, indentation) + "";
|
|
753
|
-
if (ch.fmtString)
|
|
754
|
-
value = this.tmStrFormat(value, ch, editor);
|
|
755
|
-
if (ch.formatFunction)
|
|
756
|
-
value = this.tmFormatFunction(value, ch, editor);
|
|
757
|
-
|
|
758
|
-
if (value && !ch.ifEnd) {
|
|
759
|
-
result.push(value);
|
|
760
|
-
gotoNext(ch);
|
|
761
|
-
} else if (!value && ch.ifEnd) {
|
|
762
|
-
gotoNext(ch.ifEnd);
|
|
763
|
-
}
|
|
764
|
-
} else if (ch.elseEnd) {
|
|
765
|
-
gotoNext(ch.elseEnd);
|
|
766
|
-
} else if (ch.tabstopId != null) {
|
|
767
|
-
result.push(ch);
|
|
768
|
-
} else if (ch.changeCase != null) {
|
|
769
|
-
result.push(ch);
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
function gotoNext(ch) {
|
|
773
|
-
var i1 = snippet.indexOf(ch, i + 1);
|
|
774
|
-
if (i1 != -1)
|
|
775
|
-
i = i1;
|
|
776
|
-
}
|
|
777
|
-
return result;
|
|
778
|
-
};
|
|
779
|
-
|
|
780
|
-
this.insertSnippetForSelection = function(editor, snippetText) {
|
|
781
|
-
var cursor = editor.getCursorPosition();
|
|
782
|
-
var line = editor.session.getLine(cursor.row);
|
|
783
|
-
var tabString = editor.session.getTabString();
|
|
784
|
-
var indentString = line.match(/^\s*/)[0];
|
|
785
|
-
|
|
786
|
-
if (cursor.column < indentString.length)
|
|
787
|
-
indentString = indentString.slice(0, cursor.column);
|
|
788
|
-
|
|
789
|
-
snippetText = snippetText.replace(/\r/g, "");
|
|
790
|
-
var tokens = this.tokenizeTmSnippet(snippetText);
|
|
791
|
-
tokens = this.resolveVariables(tokens, editor);
|
|
792
|
-
tokens = tokens.map(function(x) {
|
|
793
|
-
if (x == "\n")
|
|
794
|
-
return x + indentString;
|
|
795
|
-
if (typeof x == "string")
|
|
796
|
-
return x.replace(/\t/g, tabString);
|
|
797
|
-
return x;
|
|
798
|
-
});
|
|
799
|
-
var tabstops = [];
|
|
800
|
-
tokens.forEach(function(p, i) {
|
|
801
|
-
if (typeof p != "object")
|
|
802
|
-
return;
|
|
803
|
-
var id = p.tabstopId;
|
|
804
|
-
var ts = tabstops[id];
|
|
805
|
-
if (!ts) {
|
|
806
|
-
ts = tabstops[id] = [];
|
|
807
|
-
ts.index = id;
|
|
808
|
-
ts.value = "";
|
|
809
|
-
ts.parents = {};
|
|
810
|
-
}
|
|
811
|
-
if (ts.indexOf(p) !== -1)
|
|
812
|
-
return;
|
|
813
|
-
if (p.choices && !ts.choices)
|
|
814
|
-
ts.choices = p.choices;
|
|
815
|
-
ts.push(p);
|
|
816
|
-
var i1 = tokens.indexOf(p, i + 1);
|
|
817
|
-
if (i1 === -1)
|
|
818
|
-
return;
|
|
819
|
-
|
|
820
|
-
var value = tokens.slice(i + 1, i1);
|
|
821
|
-
var isNested = value.some(function(t) {return typeof t === "object";});
|
|
822
|
-
if (isNested && !ts.value) {
|
|
823
|
-
ts.value = value;
|
|
824
|
-
} else if (value.length && (!ts.value || typeof ts.value !== "string")) {
|
|
825
|
-
ts.value = value.join("");
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
tabstops.forEach(function(ts) {ts.length = 0;});
|
|
829
|
-
var expanding = {};
|
|
830
|
-
function copyValue(val) {
|
|
831
|
-
var copy = [];
|
|
832
|
-
for (var i = 0; i < val.length; i++) {
|
|
833
|
-
var p = val[i];
|
|
834
|
-
if (typeof p == "object") {
|
|
835
|
-
if (expanding[p.tabstopId])
|
|
836
|
-
continue;
|
|
837
|
-
var j = val.lastIndexOf(p, i - 1);
|
|
838
|
-
p = copy[j] || {tabstopId: p.tabstopId};
|
|
839
|
-
}
|
|
840
|
-
copy[i] = p;
|
|
841
|
-
}
|
|
842
|
-
return copy;
|
|
843
|
-
}
|
|
844
|
-
for (var i = 0; i < tokens.length; i++) {
|
|
845
|
-
var p = tokens[i];
|
|
846
|
-
if (typeof p != "object")
|
|
847
|
-
continue;
|
|
848
|
-
var id = p.tabstopId;
|
|
849
|
-
var ts = tabstops[id];
|
|
850
|
-
var i1 = tokens.indexOf(p, i + 1);
|
|
851
|
-
if (expanding[id]) {
|
|
852
|
-
if (expanding[id] === p) {
|
|
853
|
-
delete expanding[id];
|
|
854
|
-
Object.keys(expanding).forEach(function(parentId) {
|
|
855
|
-
ts.parents[parentId] = true;
|
|
856
|
-
});
|
|
857
|
-
}
|
|
858
|
-
continue;
|
|
859
|
-
}
|
|
860
|
-
expanding[id] = p;
|
|
861
|
-
var value = ts.value;
|
|
862
|
-
if (typeof value !== "string")
|
|
863
|
-
value = copyValue(value);
|
|
864
|
-
else if (p.fmt)
|
|
865
|
-
value = this.tmStrFormat(value, p, editor);
|
|
866
|
-
tokens.splice.apply(tokens, [i + 1, Math.max(0, i1 - i)].concat(value, p));
|
|
867
|
-
|
|
868
|
-
if (ts.indexOf(p) === -1)
|
|
869
|
-
ts.push(p);
|
|
870
|
-
}
|
|
871
|
-
var row = 0, column = 0;
|
|
872
|
-
var text = "";
|
|
873
|
-
tokens.forEach(function(t) {
|
|
874
|
-
if (typeof t === "string") {
|
|
875
|
-
var lines = t.split("\n");
|
|
876
|
-
if (lines.length > 1){
|
|
877
|
-
column = lines[lines.length - 1].length;
|
|
878
|
-
row += lines.length - 1;
|
|
879
|
-
} else
|
|
880
|
-
column += t.length;
|
|
881
|
-
text += t;
|
|
882
|
-
} else if (t) {
|
|
883
|
-
if (!t.start)
|
|
884
|
-
t.start = {row: row, column: column};
|
|
885
|
-
else
|
|
886
|
-
t.end = {row: row, column: column};
|
|
887
|
-
}
|
|
888
|
-
});
|
|
889
|
-
var range = editor.getSelectionRange();
|
|
890
|
-
var end = editor.session.replace(range, text);
|
|
891
|
-
|
|
892
|
-
var tabstopManager = new TabstopManager(editor);
|
|
893
|
-
var selectionId = editor.inVirtualSelectionMode && editor.selection.index;
|
|
894
|
-
tabstopManager.addTabstops(tabstops, range.start, end, selectionId);
|
|
895
|
-
};
|
|
896
|
-
|
|
897
|
-
this.insertSnippet = function(editor, snippetText) {
|
|
898
|
-
var self = this;
|
|
899
|
-
if (editor.inVirtualSelectionMode)
|
|
900
|
-
return self.insertSnippetForSelection(editor, snippetText);
|
|
901
|
-
|
|
902
|
-
editor.forEachSelection(function() {
|
|
903
|
-
self.insertSnippetForSelection(editor, snippetText);
|
|
904
|
-
}, null, {keepOrder: true});
|
|
905
|
-
|
|
906
|
-
if (editor.tabstopManager)
|
|
907
|
-
editor.tabstopManager.tabNext();
|
|
908
|
-
};
|
|
909
|
-
|
|
910
|
-
this.$getScope = function(editor) {
|
|
911
|
-
var scope = editor.session.$mode.$id || "";
|
|
912
|
-
scope = scope.split("/").pop();
|
|
913
|
-
if (scope === "html" || scope === "php") {
|
|
914
|
-
if (scope === "php" && !editor.session.$mode.inlinePhp)
|
|
915
|
-
scope = "html";
|
|
916
|
-
var c = editor.getCursorPosition();
|
|
917
|
-
var state = editor.session.getState(c.row);
|
|
918
|
-
if (typeof state === "object") {
|
|
919
|
-
state = state[0];
|
|
920
|
-
}
|
|
921
|
-
if (state.substring) {
|
|
922
|
-
if (state.substring(0, 3) == "js-")
|
|
923
|
-
scope = "javascript";
|
|
924
|
-
else if (state.substring(0, 4) == "css-")
|
|
925
|
-
scope = "css";
|
|
926
|
-
else if (state.substring(0, 4) == "php-")
|
|
927
|
-
scope = "php";
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
return scope;
|
|
932
|
-
};
|
|
933
|
-
|
|
934
|
-
this.getActiveScopes = function(editor) {
|
|
935
|
-
var scope = this.$getScope(editor);
|
|
936
|
-
var scopes = [scope];
|
|
937
|
-
var snippetMap = this.snippetMap;
|
|
938
|
-
if (snippetMap[scope] && snippetMap[scope].includeScopes) {
|
|
939
|
-
scopes.push.apply(scopes, snippetMap[scope].includeScopes);
|
|
940
|
-
}
|
|
941
|
-
scopes.push("_");
|
|
942
|
-
return scopes;
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
this.expandWithTab = function(editor, options) {
|
|
946
|
-
var self = this;
|
|
947
|
-
var result = editor.forEachSelection(function() {
|
|
948
|
-
return self.expandSnippetForSelection(editor, options);
|
|
949
|
-
}, null, {keepOrder: true});
|
|
950
|
-
if (result && editor.tabstopManager)
|
|
951
|
-
editor.tabstopManager.tabNext();
|
|
952
|
-
return result;
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
this.expandSnippetForSelection = function(editor, options) {
|
|
956
|
-
var cursor = editor.getCursorPosition();
|
|
957
|
-
var line = editor.session.getLine(cursor.row);
|
|
958
|
-
var before = line.substring(0, cursor.column);
|
|
959
|
-
var after = line.substr(cursor.column);
|
|
960
|
-
|
|
961
|
-
var snippetMap = this.snippetMap;
|
|
962
|
-
var snippet;
|
|
963
|
-
this.getActiveScopes(editor).some(function(scope) {
|
|
964
|
-
var snippets = snippetMap[scope];
|
|
965
|
-
if (snippets)
|
|
966
|
-
snippet = this.findMatchingSnippet(snippets, before, after);
|
|
967
|
-
return !!snippet;
|
|
968
|
-
}, this);
|
|
969
|
-
if (!snippet)
|
|
970
|
-
return false;
|
|
971
|
-
if (options && options.dryRun)
|
|
972
|
-
return true;
|
|
973
|
-
editor.session.doc.removeInLine(cursor.row,
|
|
974
|
-
cursor.column - snippet.replaceBefore.length,
|
|
975
|
-
cursor.column + snippet.replaceAfter.length
|
|
976
|
-
);
|
|
977
|
-
|
|
978
|
-
this.variables.M__ = snippet.matchBefore;
|
|
979
|
-
this.variables.T__ = snippet.matchAfter;
|
|
980
|
-
this.insertSnippetForSelection(editor, snippet.content);
|
|
981
|
-
|
|
982
|
-
this.variables.M__ = this.variables.T__ = null;
|
|
983
|
-
return true;
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
this.findMatchingSnippet = function(snippetList, before, after) {
|
|
987
|
-
for (var i = snippetList.length; i--;) {
|
|
988
|
-
var s = snippetList[i];
|
|
989
|
-
if (s.startRe && !s.startRe.test(before))
|
|
990
|
-
continue;
|
|
991
|
-
if (s.endRe && !s.endRe.test(after))
|
|
992
|
-
continue;
|
|
993
|
-
if (!s.startRe && !s.endRe)
|
|
994
|
-
continue;
|
|
995
|
-
|
|
996
|
-
s.matchBefore = s.startRe ? s.startRe.exec(before) : [""];
|
|
997
|
-
s.matchAfter = s.endRe ? s.endRe.exec(after) : [""];
|
|
998
|
-
s.replaceBefore = s.triggerRe ? s.triggerRe.exec(before)[0] : "";
|
|
999
|
-
s.replaceAfter = s.endTriggerRe ? s.endTriggerRe.exec(after)[0] : "";
|
|
1000
|
-
return s;
|
|
1001
|
-
}
|
|
1002
|
-
};
|
|
1003
|
-
|
|
1004
|
-
this.snippetMap = {};
|
|
1005
|
-
this.snippetNameMap = {};
|
|
1006
|
-
this.register = function(snippets, scope) {
|
|
1007
|
-
var snippetMap = this.snippetMap;
|
|
1008
|
-
var snippetNameMap = this.snippetNameMap;
|
|
1009
|
-
var self = this;
|
|
1010
|
-
|
|
1011
|
-
if (!snippets)
|
|
1012
|
-
snippets = [];
|
|
1013
|
-
|
|
1014
|
-
function wrapRegexp(src) {
|
|
1015
|
-
if (src && !/^\^?\(.*\)\$?$|^\\b$/.test(src))
|
|
1016
|
-
src = "(?:" + src + ")";
|
|
1017
|
-
|
|
1018
|
-
return src || "";
|
|
1019
|
-
}
|
|
1020
|
-
function guardedRegexp(re, guard, opening) {
|
|
1021
|
-
re = wrapRegexp(re);
|
|
1022
|
-
guard = wrapRegexp(guard);
|
|
1023
|
-
if (opening) {
|
|
1024
|
-
re = guard + re;
|
|
1025
|
-
if (re && re[re.length - 1] != "$")
|
|
1026
|
-
re = re + "$";
|
|
1027
|
-
} else {
|
|
1028
|
-
re = re + guard;
|
|
1029
|
-
if (re && re[0] != "^")
|
|
1030
|
-
re = "^" + re;
|
|
1031
|
-
}
|
|
1032
|
-
return new RegExp(re);
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
function addSnippet(s) {
|
|
1036
|
-
if (!s.scope)
|
|
1037
|
-
s.scope = scope || "_";
|
|
1038
|
-
scope = s.scope;
|
|
1039
|
-
if (!snippetMap[scope]) {
|
|
1040
|
-
snippetMap[scope] = [];
|
|
1041
|
-
snippetNameMap[scope] = {};
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
|
-
var map = snippetNameMap[scope];
|
|
1045
|
-
if (s.name) {
|
|
1046
|
-
var old = map[s.name];
|
|
1047
|
-
if (old)
|
|
1048
|
-
self.unregister(old);
|
|
1049
|
-
map[s.name] = s;
|
|
1050
|
-
}
|
|
1051
|
-
snippetMap[scope].push(s);
|
|
1052
|
-
|
|
1053
|
-
if (s.prefix)
|
|
1054
|
-
s.tabTrigger = s.prefix;
|
|
1055
|
-
|
|
1056
|
-
if (!s.content && s.body)
|
|
1057
|
-
s.content = Array.isArray(s.body) ? s.body.join("\n") : s.body;
|
|
1058
|
-
|
|
1059
|
-
if (s.tabTrigger && !s.trigger) {
|
|
1060
|
-
if (!s.guard && /^\w/.test(s.tabTrigger))
|
|
1061
|
-
s.guard = "\\b";
|
|
1062
|
-
s.trigger = lang.escapeRegExp(s.tabTrigger);
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
if (!s.trigger && !s.guard && !s.endTrigger && !s.endGuard)
|
|
1066
|
-
return;
|
|
1067
|
-
|
|
1068
|
-
s.startRe = guardedRegexp(s.trigger, s.guard, true);
|
|
1069
|
-
s.triggerRe = new RegExp(s.trigger);
|
|
1070
|
-
|
|
1071
|
-
s.endRe = guardedRegexp(s.endTrigger, s.endGuard, true);
|
|
1072
|
-
s.endTriggerRe = new RegExp(s.endTrigger);
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
|
-
if (Array.isArray(snippets)) {
|
|
1076
|
-
snippets.forEach(addSnippet);
|
|
1077
|
-
} else {
|
|
1078
|
-
Object.keys(snippets).forEach(function(key) {
|
|
1079
|
-
addSnippet(snippets[key]);
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
this._signal("registerSnippets", {scope: scope});
|
|
1084
|
-
};
|
|
1085
|
-
this.unregister = function(snippets, scope) {
|
|
1086
|
-
var snippetMap = this.snippetMap;
|
|
1087
|
-
var snippetNameMap = this.snippetNameMap;
|
|
1088
|
-
|
|
1089
|
-
function removeSnippet(s) {
|
|
1090
|
-
var nameMap = snippetNameMap[s.scope||scope];
|
|
1091
|
-
if (nameMap && nameMap[s.name]) {
|
|
1092
|
-
delete nameMap[s.name];
|
|
1093
|
-
var map = snippetMap[s.scope||scope];
|
|
1094
|
-
var i = map && map.indexOf(s);
|
|
1095
|
-
if (i >= 0)
|
|
1096
|
-
map.splice(i, 1);
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
1099
|
-
if (snippets.content)
|
|
1100
|
-
removeSnippet(snippets);
|
|
1101
|
-
else if (Array.isArray(snippets))
|
|
1102
|
-
snippets.forEach(removeSnippet);
|
|
1103
|
-
};
|
|
1104
|
-
this.parseSnippetFile = function(str) {
|
|
1105
|
-
str = str.replace(/\r/g, "");
|
|
1106
|
-
var list = [], snippet = {};
|
|
1107
|
-
var re = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;
|
|
1108
|
-
var m;
|
|
1109
|
-
while (m = re.exec(str)) {
|
|
1110
|
-
if (m[1]) {
|
|
1111
|
-
try {
|
|
1112
|
-
snippet = JSON.parse(m[1]);
|
|
1113
|
-
list.push(snippet);
|
|
1114
|
-
} catch (e) {}
|
|
1115
|
-
} if (m[4]) {
|
|
1116
|
-
snippet.content = m[4].replace(/^\t/gm, "");
|
|
1117
|
-
list.push(snippet);
|
|
1118
|
-
snippet = {};
|
|
1119
|
-
} else {
|
|
1120
|
-
var key = m[2], val = m[3];
|
|
1121
|
-
if (key == "regex") {
|
|
1122
|
-
var guardRe = /\/((?:[^\/\\]|\\.)*)|$/g;
|
|
1123
|
-
snippet.guard = guardRe.exec(val)[1];
|
|
1124
|
-
snippet.trigger = guardRe.exec(val)[1];
|
|
1125
|
-
snippet.endTrigger = guardRe.exec(val)[1];
|
|
1126
|
-
snippet.endGuard = guardRe.exec(val)[1];
|
|
1127
|
-
} else if (key == "snippet") {
|
|
1128
|
-
snippet.tabTrigger = val.match(/^\S*/)[0];
|
|
1129
|
-
if (!snippet.name)
|
|
1130
|
-
snippet.name = val;
|
|
1131
|
-
} else if (key) {
|
|
1132
|
-
snippet[key] = val;
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
return list;
|
|
1137
|
-
};
|
|
1138
|
-
this.getSnippetByName = function(name, editor) {
|
|
1139
|
-
var snippetMap = this.snippetNameMap;
|
|
1140
|
-
var snippet;
|
|
1141
|
-
this.getActiveScopes(editor).some(function(scope) {
|
|
1142
|
-
var snippets = snippetMap[scope];
|
|
1143
|
-
if (snippets)
|
|
1144
|
-
snippet = snippets[name];
|
|
1145
|
-
return !!snippet;
|
|
1146
|
-
}, this);
|
|
1147
|
-
return snippet;
|
|
1148
|
-
};
|
|
1149
|
-
|
|
1150
|
-
}).call(SnippetManager.prototype);
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
var TabstopManager = function(editor) {
|
|
1154
|
-
if (editor.tabstopManager)
|
|
1155
|
-
return editor.tabstopManager;
|
|
1156
|
-
editor.tabstopManager = this;
|
|
1157
|
-
this.$onChange = this.onChange.bind(this);
|
|
1158
|
-
this.$onChangeSelection = lang.delayedCall(this.onChangeSelection.bind(this)).schedule;
|
|
1159
|
-
this.$onChangeSession = this.onChangeSession.bind(this);
|
|
1160
|
-
this.$onAfterExec = this.onAfterExec.bind(this);
|
|
1161
|
-
this.attach(editor);
|
|
1162
|
-
};
|
|
1163
|
-
(function() {
|
|
1164
|
-
this.attach = function(editor) {
|
|
1165
|
-
this.index = 0;
|
|
1166
|
-
this.ranges = [];
|
|
1167
|
-
this.tabstops = [];
|
|
1168
|
-
this.$openTabstops = null;
|
|
1169
|
-
this.selectedTabstop = null;
|
|
1170
|
-
|
|
1171
|
-
this.editor = editor;
|
|
1172
|
-
this.editor.on("change", this.$onChange);
|
|
1173
|
-
this.editor.on("changeSelection", this.$onChangeSelection);
|
|
1174
|
-
this.editor.on("changeSession", this.$onChangeSession);
|
|
1175
|
-
this.editor.commands.on("afterExec", this.$onAfterExec);
|
|
1176
|
-
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
|
1177
|
-
};
|
|
1178
|
-
this.detach = function() {
|
|
1179
|
-
this.tabstops.forEach(this.removeTabstopMarkers, this);
|
|
1180
|
-
this.ranges = null;
|
|
1181
|
-
this.tabstops = null;
|
|
1182
|
-
this.selectedTabstop = null;
|
|
1183
|
-
this.editor.removeListener("change", this.$onChange);
|
|
1184
|
-
this.editor.removeListener("changeSelection", this.$onChangeSelection);
|
|
1185
|
-
this.editor.removeListener("changeSession", this.$onChangeSession);
|
|
1186
|
-
this.editor.commands.removeListener("afterExec", this.$onAfterExec);
|
|
1187
|
-
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
|
1188
|
-
this.editor.tabstopManager = null;
|
|
1189
|
-
this.editor = null;
|
|
1190
|
-
};
|
|
1191
|
-
|
|
1192
|
-
this.onChange = function(delta) {
|
|
1193
|
-
var isRemove = delta.action[0] == "r";
|
|
1194
|
-
var selectedTabstop = this.selectedTabstop || {};
|
|
1195
|
-
var parents = selectedTabstop.parents || {};
|
|
1196
|
-
var tabstops = (this.tabstops || []).slice();
|
|
1197
|
-
for (var i = 0; i < tabstops.length; i++) {
|
|
1198
|
-
var ts = tabstops[i];
|
|
1199
|
-
var active = ts == selectedTabstop || parents[ts.index];
|
|
1200
|
-
ts.rangeList.$bias = active ? 0 : 1;
|
|
1201
|
-
|
|
1202
|
-
if (delta.action == "remove" && ts !== selectedTabstop) {
|
|
1203
|
-
var parentActive = ts.parents && ts.parents[selectedTabstop.index];
|
|
1204
|
-
var startIndex = ts.rangeList.pointIndex(delta.start, parentActive);
|
|
1205
|
-
startIndex = startIndex < 0 ? -startIndex - 1 : startIndex + 1;
|
|
1206
|
-
var endIndex = ts.rangeList.pointIndex(delta.end, parentActive);
|
|
1207
|
-
endIndex = endIndex < 0 ? -endIndex - 1 : endIndex - 1;
|
|
1208
|
-
var toRemove = ts.rangeList.ranges.slice(startIndex, endIndex);
|
|
1209
|
-
for (var j = 0; j < toRemove.length; j++)
|
|
1210
|
-
this.removeRange(toRemove[j]);
|
|
1211
|
-
}
|
|
1212
|
-
ts.rangeList.$onChange(delta);
|
|
1213
|
-
}
|
|
1214
|
-
var session = this.editor.session;
|
|
1215
|
-
if (!this.$inChange && isRemove && session.getLength() == 1 && !session.getValue())
|
|
1216
|
-
this.detach();
|
|
1217
|
-
};
|
|
1218
|
-
this.updateLinkedFields = function() {
|
|
1219
|
-
var ts = this.selectedTabstop;
|
|
1220
|
-
if (!ts || !ts.hasLinkedRanges || !ts.firstNonLinked)
|
|
1221
|
-
return;
|
|
1222
|
-
this.$inChange = true;
|
|
1223
|
-
var session = this.editor.session;
|
|
1224
|
-
var text = session.getTextRange(ts.firstNonLinked);
|
|
1225
|
-
for (var i = 0; i < ts.length; i++) {
|
|
1226
|
-
var range = ts[i];
|
|
1227
|
-
if (!range.linked)
|
|
1228
|
-
continue;
|
|
1229
|
-
var original = range.original;
|
|
1230
|
-
var fmt = exports.snippetManager.tmStrFormat(text, original, this.editor);
|
|
1231
|
-
session.replace(range, fmt);
|
|
1232
|
-
}
|
|
1233
|
-
this.$inChange = false;
|
|
1234
|
-
};
|
|
1235
|
-
this.onAfterExec = function(e) {
|
|
1236
|
-
if (e.command && !e.command.readOnly)
|
|
1237
|
-
this.updateLinkedFields();
|
|
1238
|
-
};
|
|
1239
|
-
this.onChangeSelection = function() {
|
|
1240
|
-
if (!this.editor)
|
|
1241
|
-
return;
|
|
1242
|
-
var lead = this.editor.selection.lead;
|
|
1243
|
-
var anchor = this.editor.selection.anchor;
|
|
1244
|
-
var isEmpty = this.editor.selection.isEmpty();
|
|
1245
|
-
for (var i = 0; i < this.ranges.length; i++) {
|
|
1246
|
-
if (this.ranges[i].linked)
|
|
1247
|
-
continue;
|
|
1248
|
-
var containsLead = this.ranges[i].contains(lead.row, lead.column);
|
|
1249
|
-
var containsAnchor = isEmpty || this.ranges[i].contains(anchor.row, anchor.column);
|
|
1250
|
-
if (containsLead && containsAnchor)
|
|
1251
|
-
return;
|
|
1252
|
-
}
|
|
1253
|
-
this.detach();
|
|
1254
|
-
};
|
|
1255
|
-
this.onChangeSession = function() {
|
|
1256
|
-
this.detach();
|
|
1257
|
-
};
|
|
1258
|
-
this.tabNext = function(dir) {
|
|
1259
|
-
var max = this.tabstops.length;
|
|
1260
|
-
var index = this.index + (dir || 1);
|
|
1261
|
-
index = Math.min(Math.max(index, 1), max);
|
|
1262
|
-
if (index == max)
|
|
1263
|
-
index = 0;
|
|
1264
|
-
this.selectTabstop(index);
|
|
1265
|
-
if (index === 0)
|
|
1266
|
-
this.detach();
|
|
1267
|
-
};
|
|
1268
|
-
this.selectTabstop = function(index) {
|
|
1269
|
-
this.$openTabstops = null;
|
|
1270
|
-
var ts = this.tabstops[this.index];
|
|
1271
|
-
if (ts)
|
|
1272
|
-
this.addTabstopMarkers(ts);
|
|
1273
|
-
this.index = index;
|
|
1274
|
-
ts = this.tabstops[this.index];
|
|
1275
|
-
if (!ts || !ts.length)
|
|
1276
|
-
return;
|
|
1277
|
-
|
|
1278
|
-
this.selectedTabstop = ts;
|
|
1279
|
-
var range = ts.firstNonLinked || ts;
|
|
1280
|
-
if (ts.choices) range.cursor = range.start;
|
|
1281
|
-
if (!this.editor.inVirtualSelectionMode) {
|
|
1282
|
-
var sel = this.editor.multiSelect;
|
|
1283
|
-
sel.toSingleRange(range);
|
|
1284
|
-
for (var i = 0; i < ts.length; i++) {
|
|
1285
|
-
if (ts.hasLinkedRanges && ts[i].linked)
|
|
1286
|
-
continue;
|
|
1287
|
-
sel.addRange(ts[i].clone(), true);
|
|
1288
|
-
}
|
|
1289
|
-
} else {
|
|
1290
|
-
this.editor.selection.fromOrientedRange(range);
|
|
1291
|
-
}
|
|
1292
|
-
|
|
1293
|
-
this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
|
1294
|
-
if (this.selectedTabstop && this.selectedTabstop.choices)
|
|
1295
|
-
this.editor.execCommand("startAutocomplete", {matches: this.selectedTabstop.choices});
|
|
1296
|
-
};
|
|
1297
|
-
this.addTabstops = function(tabstops, start, end) {
|
|
1298
|
-
var useLink = this.useLink || !this.editor.getOption("enableMultiselect");
|
|
1299
|
-
|
|
1300
|
-
if (!this.$openTabstops)
|
|
1301
|
-
this.$openTabstops = [];
|
|
1302
|
-
if (!tabstops[0]) {
|
|
1303
|
-
var p = Range.fromPoints(end, end);
|
|
1304
|
-
moveRelative(p.start, start);
|
|
1305
|
-
moveRelative(p.end, start);
|
|
1306
|
-
tabstops[0] = [p];
|
|
1307
|
-
tabstops[0].index = 0;
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
var i = this.index;
|
|
1311
|
-
var arg = [i + 1, 0];
|
|
1312
|
-
var ranges = this.ranges;
|
|
1313
|
-
tabstops.forEach(function(ts, index) {
|
|
1314
|
-
var dest = this.$openTabstops[index] || ts;
|
|
1315
|
-
|
|
1316
|
-
for (var i = 0; i < ts.length; i++) {
|
|
1317
|
-
var p = ts[i];
|
|
1318
|
-
var range = Range.fromPoints(p.start, p.end || p.start);
|
|
1319
|
-
movePoint(range.start, start);
|
|
1320
|
-
movePoint(range.end, start);
|
|
1321
|
-
range.original = p;
|
|
1322
|
-
range.tabstop = dest;
|
|
1323
|
-
ranges.push(range);
|
|
1324
|
-
if (dest != ts)
|
|
1325
|
-
dest.unshift(range);
|
|
1326
|
-
else
|
|
1327
|
-
dest[i] = range;
|
|
1328
|
-
if (p.fmtString || (dest.firstNonLinked && useLink)) {
|
|
1329
|
-
range.linked = true;
|
|
1330
|
-
dest.hasLinkedRanges = true;
|
|
1331
|
-
} else if (!dest.firstNonLinked)
|
|
1332
|
-
dest.firstNonLinked = range;
|
|
1333
|
-
}
|
|
1334
|
-
if (!dest.firstNonLinked)
|
|
1335
|
-
dest.hasLinkedRanges = false;
|
|
1336
|
-
if (dest === ts) {
|
|
1337
|
-
arg.push(dest);
|
|
1338
|
-
this.$openTabstops[index] = dest;
|
|
1339
|
-
}
|
|
1340
|
-
this.addTabstopMarkers(dest);
|
|
1341
|
-
dest.rangeList = dest.rangeList || new RangeList();
|
|
1342
|
-
dest.rangeList.$bias = 0;
|
|
1343
|
-
dest.rangeList.addList(dest);
|
|
1344
|
-
}, this);
|
|
1345
|
-
|
|
1346
|
-
if (arg.length > 2) {
|
|
1347
|
-
if (this.tabstops.length)
|
|
1348
|
-
arg.push(arg.splice(2, 1)[0]);
|
|
1349
|
-
this.tabstops.splice.apply(this.tabstops, arg);
|
|
1350
|
-
}
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
|
-
this.addTabstopMarkers = function(ts) {
|
|
1354
|
-
var session = this.editor.session;
|
|
1355
|
-
ts.forEach(function(range) {
|
|
1356
|
-
if (!range.markerId)
|
|
1357
|
-
range.markerId = session.addMarker(range, "ace_snippet-marker", "text");
|
|
1358
|
-
});
|
|
1359
|
-
};
|
|
1360
|
-
this.removeTabstopMarkers = function(ts) {
|
|
1361
|
-
var session = this.editor.session;
|
|
1362
|
-
ts.forEach(function(range) {
|
|
1363
|
-
session.removeMarker(range.markerId);
|
|
1364
|
-
range.markerId = null;
|
|
1365
|
-
});
|
|
1366
|
-
};
|
|
1367
|
-
this.removeRange = function(range) {
|
|
1368
|
-
var i = range.tabstop.indexOf(range);
|
|
1369
|
-
if (i != -1) range.tabstop.splice(i, 1);
|
|
1370
|
-
i = this.ranges.indexOf(range);
|
|
1371
|
-
if (i != -1) this.ranges.splice(i, 1);
|
|
1372
|
-
i = range.tabstop.rangeList.ranges.indexOf(range);
|
|
1373
|
-
if (i != -1) range.tabstop.splice(i, 1);
|
|
1374
|
-
this.editor.session.removeMarker(range.markerId);
|
|
1375
|
-
if (!range.tabstop.length) {
|
|
1376
|
-
i = this.tabstops.indexOf(range.tabstop);
|
|
1377
|
-
if (i != -1)
|
|
1378
|
-
this.tabstops.splice(i, 1);
|
|
1379
|
-
if (!this.tabstops.length)
|
|
1380
|
-
this.detach();
|
|
1381
|
-
}
|
|
1382
|
-
};
|
|
1383
|
-
|
|
1384
|
-
this.keyboardHandler = new HashHandler();
|
|
1385
|
-
this.keyboardHandler.bindKeys({
|
|
1386
|
-
"Tab": function(editor) {
|
|
1387
|
-
if (exports.snippetManager && exports.snippetManager.expandWithTab(editor))
|
|
1388
|
-
return;
|
|
1389
|
-
editor.tabstopManager.tabNext(1);
|
|
1390
|
-
editor.renderer.scrollCursorIntoView();
|
|
1391
|
-
},
|
|
1392
|
-
"Shift-Tab": function(editor) {
|
|
1393
|
-
editor.tabstopManager.tabNext(-1);
|
|
1394
|
-
editor.renderer.scrollCursorIntoView();
|
|
1395
|
-
},
|
|
1396
|
-
"Esc": function(editor) {
|
|
1397
|
-
editor.tabstopManager.detach();
|
|
1398
|
-
}
|
|
1399
|
-
});
|
|
1400
|
-
}).call(TabstopManager.prototype);
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
var movePoint = function(point, diff) {
|
|
1405
|
-
if (point.row == 0)
|
|
1406
|
-
point.column += diff.column;
|
|
1407
|
-
point.row += diff.row;
|
|
1408
|
-
};
|
|
1409
|
-
|
|
1410
|
-
var moveRelative = function(point, start) {
|
|
1411
|
-
if (point.row == start.row)
|
|
1412
|
-
point.column -= start.column;
|
|
1413
|
-
point.row -= start.row;
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
dom.importCssString("\
|
|
1418
|
-
.ace_snippet-marker {\
|
|
1419
|
-
-moz-box-sizing: border-box;\
|
|
1420
|
-
box-sizing: border-box;\
|
|
1421
|
-
background: rgba(194, 193, 208, 0.09);\
|
|
1422
|
-
border: 1px dotted rgba(211, 208, 235, 0.62);\
|
|
1423
|
-
position: absolute;\
|
|
1424
|
-
}", "snippets.css", false);
|
|
1425
|
-
|
|
1426
|
-
exports.snippetManager = new SnippetManager();
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
var Editor = require("./editor").Editor;
|
|
1430
|
-
(function() {
|
|
1431
|
-
this.insertSnippet = function(content, options) {
|
|
1432
|
-
return exports.snippetManager.insertSnippet(this, content, options);
|
|
1433
|
-
};
|
|
1434
|
-
this.expandSnippet = function(options) {
|
|
1435
|
-
return exports.snippetManager.expandWithTab(this, options);
|
|
1436
|
-
};
|
|
1437
|
-
}).call(Editor.prototype);
|
|
1438
|
-
|
|
1439
|
-
});
|
|
1440
|
-
|
|
1441
|
-
ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"], function(require, exports, module) {
|
|
1442
|
-
"use strict";
|
|
1443
|
-
|
|
1444
|
-
var HashHandler = require("./keyboard/hash_handler").HashHandler;
|
|
1445
|
-
var AcePopup = require("./autocomplete/popup").AcePopup;
|
|
1446
|
-
var util = require("./autocomplete/util");
|
|
1447
|
-
var lang = require("./lib/lang");
|
|
1448
|
-
var dom = require("./lib/dom");
|
|
1449
|
-
var snippetManager = require("./snippets").snippetManager;
|
|
1450
|
-
var config = require("./config");
|
|
1451
|
-
|
|
1452
|
-
var Autocomplete = function() {
|
|
1453
|
-
this.autoInsert = false;
|
|
1454
|
-
this.autoSelect = true;
|
|
1455
|
-
this.exactMatch = false;
|
|
1456
|
-
this.gatherCompletionsId = 0;
|
|
1457
|
-
this.keyboardHandler = new HashHandler();
|
|
1458
|
-
this.keyboardHandler.bindKeys(this.commands);
|
|
1459
|
-
|
|
1460
|
-
this.blurListener = this.blurListener.bind(this);
|
|
1461
|
-
this.changeListener = this.changeListener.bind(this);
|
|
1462
|
-
this.mousedownListener = this.mousedownListener.bind(this);
|
|
1463
|
-
this.mousewheelListener = this.mousewheelListener.bind(this);
|
|
1464
|
-
|
|
1465
|
-
this.changeTimer = lang.delayedCall(function() {
|
|
1466
|
-
this.updateCompletions(true);
|
|
1467
|
-
}.bind(this));
|
|
1468
|
-
|
|
1469
|
-
this.tooltipTimer = lang.delayedCall(this.updateDocTooltip.bind(this), 50);
|
|
1470
|
-
};
|
|
1471
|
-
|
|
1472
|
-
(function() {
|
|
1473
|
-
|
|
1474
|
-
this.$init = function() {
|
|
1475
|
-
this.popup = new AcePopup(document.body || document.documentElement);
|
|
1476
|
-
this.popup.on("click", function(e) {
|
|
1477
|
-
this.insertMatch();
|
|
1478
|
-
e.stop();
|
|
1479
|
-
}.bind(this));
|
|
1480
|
-
this.popup.focus = this.editor.focus.bind(this.editor);
|
|
1481
|
-
this.popup.on("show", this.tooltipTimer.bind(null, null));
|
|
1482
|
-
this.popup.on("select", this.tooltipTimer.bind(null, null));
|
|
1483
|
-
this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null));
|
|
1484
|
-
return this.popup;
|
|
1485
|
-
};
|
|
1486
|
-
|
|
1487
|
-
this.getPopup = function() {
|
|
1488
|
-
return this.popup || this.$init();
|
|
1489
|
-
};
|
|
1490
|
-
|
|
1491
|
-
this.openPopup = function(editor, prefix, keepPopupPosition) {
|
|
1492
|
-
if (!this.popup)
|
|
1493
|
-
this.$init();
|
|
1494
|
-
|
|
1495
|
-
this.popup.autoSelect = this.autoSelect;
|
|
1496
|
-
|
|
1497
|
-
this.popup.setData(this.completions.filtered, this.completions.filterText);
|
|
1498
|
-
|
|
1499
|
-
editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
|
|
1500
|
-
|
|
1501
|
-
var renderer = editor.renderer;
|
|
1502
|
-
this.popup.setRow(this.autoSelect ? 0 : -1);
|
|
1503
|
-
if (!keepPopupPosition) {
|
|
1504
|
-
this.popup.setTheme(editor.getTheme());
|
|
1505
|
-
this.popup.setFontSize(editor.getFontSize());
|
|
1506
|
-
|
|
1507
|
-
var lineHeight = renderer.layerConfig.lineHeight;
|
|
1508
|
-
|
|
1509
|
-
var pos = renderer.$cursorLayer.getPixelPosition(this.base, true);
|
|
1510
|
-
pos.left -= this.popup.getTextLeftOffset();
|
|
1511
|
-
|
|
1512
|
-
var rect = editor.container.getBoundingClientRect();
|
|
1513
|
-
pos.top += rect.top - renderer.layerConfig.offset;
|
|
1514
|
-
pos.left += rect.left - editor.renderer.scrollLeft;
|
|
1515
|
-
pos.left += renderer.gutterWidth;
|
|
1516
|
-
|
|
1517
|
-
this.popup.show(pos, lineHeight);
|
|
1518
|
-
} else if (keepPopupPosition && !prefix) {
|
|
1519
|
-
this.detach();
|
|
1520
|
-
}
|
|
1521
|
-
this.changeTimer.cancel();
|
|
1522
|
-
};
|
|
1523
|
-
|
|
1524
|
-
this.detach = function() {
|
|
1525
|
-
this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler);
|
|
1526
|
-
this.editor.off("changeSelection", this.changeListener);
|
|
1527
|
-
this.editor.off("blur", this.blurListener);
|
|
1528
|
-
this.editor.off("mousedown", this.mousedownListener);
|
|
1529
|
-
this.editor.off("mousewheel", this.mousewheelListener);
|
|
1530
|
-
this.changeTimer.cancel();
|
|
1531
|
-
this.hideDocTooltip();
|
|
1532
|
-
|
|
1533
|
-
this.gatherCompletionsId += 1;
|
|
1534
|
-
if (this.popup && this.popup.isOpen)
|
|
1535
|
-
this.popup.hide();
|
|
1536
|
-
|
|
1537
|
-
if (this.base)
|
|
1538
|
-
this.base.detach();
|
|
1539
|
-
this.activated = false;
|
|
1540
|
-
this.completions = this.base = null;
|
|
1541
|
-
};
|
|
1542
|
-
|
|
1543
|
-
this.changeListener = function(e) {
|
|
1544
|
-
var cursor = this.editor.selection.lead;
|
|
1545
|
-
if (cursor.row != this.base.row || cursor.column < this.base.column) {
|
|
1546
|
-
this.detach();
|
|
1547
|
-
}
|
|
1548
|
-
if (this.activated)
|
|
1549
|
-
this.changeTimer.schedule();
|
|
1550
|
-
else
|
|
1551
|
-
this.detach();
|
|
1552
|
-
};
|
|
1553
|
-
|
|
1554
|
-
this.blurListener = function(e) {
|
|
1555
|
-
var el = document.activeElement;
|
|
1556
|
-
var text = this.editor.textInput.getElement();
|
|
1557
|
-
var fromTooltip = e.relatedTarget && this.tooltipNode && this.tooltipNode.contains(e.relatedTarget);
|
|
1558
|
-
var container = this.popup && this.popup.container;
|
|
1559
|
-
if (el != text && el.parentNode != container && !fromTooltip
|
|
1560
|
-
&& el != this.tooltipNode && e.relatedTarget != text
|
|
1561
|
-
) {
|
|
1562
|
-
this.detach();
|
|
1563
|
-
}
|
|
1564
|
-
};
|
|
1565
|
-
|
|
1566
|
-
this.mousedownListener = function(e) {
|
|
1567
|
-
this.detach();
|
|
1568
|
-
};
|
|
1569
|
-
|
|
1570
|
-
this.mousewheelListener = function(e) {
|
|
1571
|
-
this.detach();
|
|
1572
|
-
};
|
|
1573
|
-
|
|
1574
|
-
this.goTo = function(where) {
|
|
1575
|
-
this.popup.goTo(where);
|
|
1576
|
-
};
|
|
1577
|
-
|
|
1578
|
-
this.insertMatch = function(data, options) {
|
|
1579
|
-
if (!data)
|
|
1580
|
-
data = this.popup.getData(this.popup.getRow());
|
|
1581
|
-
if (!data)
|
|
1582
|
-
return false;
|
|
1583
|
-
|
|
1584
|
-
var completions = this.completions;
|
|
1585
|
-
this.editor.startOperation({command: {name: "insertMatch"}});
|
|
1586
|
-
if (data.completer && data.completer.insertMatch) {
|
|
1587
|
-
data.completer.insertMatch(this.editor, data);
|
|
1588
|
-
} else {
|
|
1589
|
-
if (completions.filterText) {
|
|
1590
|
-
var ranges = this.editor.selection.getAllRanges();
|
|
1591
|
-
for (var i = 0, range; range = ranges[i]; i++) {
|
|
1592
|
-
range.start.column -= completions.filterText.length;
|
|
1593
|
-
this.editor.session.remove(range);
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
if (data.snippet)
|
|
1597
|
-
snippetManager.insertSnippet(this.editor, data.snippet);
|
|
1598
|
-
else
|
|
1599
|
-
this.editor.execCommand("insertstring", data.value || data);
|
|
1600
|
-
}
|
|
1601
|
-
if (this.completions == completions)
|
|
1602
|
-
this.detach();
|
|
1603
|
-
this.editor.endOperation();
|
|
1604
|
-
};
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
this.commands = {
|
|
1608
|
-
"Up": function(editor) { editor.completer.goTo("up"); },
|
|
1609
|
-
"Down": function(editor) { editor.completer.goTo("down"); },
|
|
1610
|
-
"Ctrl-Up|Ctrl-Home": function(editor) { editor.completer.goTo("start"); },
|
|
1611
|
-
"Ctrl-Down|Ctrl-End": function(editor) { editor.completer.goTo("end"); },
|
|
1612
|
-
|
|
1613
|
-
"Esc": function(editor) { editor.completer.detach(); },
|
|
1614
|
-
"Return": function(editor) { return editor.completer.insertMatch(); },
|
|
1615
|
-
"Shift-Return": function(editor) { editor.completer.insertMatch(null, {deleteSuffix: true}); },
|
|
1616
|
-
"Tab": function(editor) {
|
|
1617
|
-
var result = editor.completer.insertMatch();
|
|
1618
|
-
if (!result && !editor.tabstopManager)
|
|
1619
|
-
editor.completer.goTo("down");
|
|
1620
|
-
else
|
|
1621
|
-
return result;
|
|
1622
|
-
},
|
|
1623
|
-
|
|
1624
|
-
"PageUp": function(editor) { editor.completer.popup.gotoPageUp(); },
|
|
1625
|
-
"PageDown": function(editor) { editor.completer.popup.gotoPageDown(); }
|
|
1626
|
-
};
|
|
1627
|
-
|
|
1628
|
-
this.gatherCompletions = function(editor, callback) {
|
|
1629
|
-
var session = editor.getSession();
|
|
1630
|
-
var pos = editor.getCursorPosition();
|
|
1631
|
-
|
|
1632
|
-
var prefix = util.getCompletionPrefix(editor);
|
|
1633
|
-
|
|
1634
|
-
this.base = session.doc.createAnchor(pos.row, pos.column - prefix.length);
|
|
1635
|
-
this.base.$insertRight = true;
|
|
1636
|
-
|
|
1637
|
-
var matches = [];
|
|
1638
|
-
var total = editor.completers.length;
|
|
1639
|
-
editor.completers.forEach(function(completer, i) {
|
|
1640
|
-
completer.getCompletions(editor, session, pos, prefix, function(err, results) {
|
|
1641
|
-
if (!err && results)
|
|
1642
|
-
matches = matches.concat(results);
|
|
1643
|
-
callback(null, {
|
|
1644
|
-
prefix: util.getCompletionPrefix(editor),
|
|
1645
|
-
matches: matches,
|
|
1646
|
-
finished: (--total === 0)
|
|
1647
|
-
});
|
|
1648
|
-
});
|
|
1649
|
-
});
|
|
1650
|
-
return true;
|
|
1651
|
-
};
|
|
1652
|
-
|
|
1653
|
-
this.showPopup = function(editor, options) {
|
|
1654
|
-
if (this.editor)
|
|
1655
|
-
this.detach();
|
|
1656
|
-
|
|
1657
|
-
this.activated = true;
|
|
1658
|
-
|
|
1659
|
-
this.editor = editor;
|
|
1660
|
-
if (editor.completer != this) {
|
|
1661
|
-
if (editor.completer)
|
|
1662
|
-
editor.completer.detach();
|
|
1663
|
-
editor.completer = this;
|
|
1664
|
-
}
|
|
1665
|
-
|
|
1666
|
-
editor.on("changeSelection", this.changeListener);
|
|
1667
|
-
editor.on("blur", this.blurListener);
|
|
1668
|
-
editor.on("mousedown", this.mousedownListener);
|
|
1669
|
-
editor.on("mousewheel", this.mousewheelListener);
|
|
1670
|
-
|
|
1671
|
-
this.updateCompletions(false, options);
|
|
1672
|
-
};
|
|
1673
|
-
|
|
1674
|
-
this.updateCompletions = function(keepPopupPosition, options) {
|
|
1675
|
-
if (keepPopupPosition && this.base && this.completions) {
|
|
1676
|
-
var pos = this.editor.getCursorPosition();
|
|
1677
|
-
var prefix = this.editor.session.getTextRange({start: this.base, end: pos});
|
|
1678
|
-
if (prefix == this.completions.filterText)
|
|
1679
|
-
return;
|
|
1680
|
-
this.completions.setFilter(prefix);
|
|
1681
|
-
if (!this.completions.filtered.length)
|
|
1682
|
-
return this.detach();
|
|
1683
|
-
if (this.completions.filtered.length == 1
|
|
1684
|
-
&& this.completions.filtered[0].value == prefix
|
|
1685
|
-
&& !this.completions.filtered[0].snippet)
|
|
1686
|
-
return this.detach();
|
|
1687
|
-
this.openPopup(this.editor, prefix, keepPopupPosition);
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
if (options && options.matches) {
|
|
1692
|
-
var pos = this.editor.getSelectionRange().start;
|
|
1693
|
-
this.base = this.editor.session.doc.createAnchor(pos.row, pos.column);
|
|
1694
|
-
this.base.$insertRight = true;
|
|
1695
|
-
this.completions = new FilteredList(options.matches);
|
|
1696
|
-
return this.openPopup(this.editor, "", keepPopupPosition);
|
|
1697
|
-
}
|
|
1698
|
-
var _id = this.gatherCompletionsId;
|
|
1699
|
-
var detachIfFinished = function(results) {
|
|
1700
|
-
if (!results.finished) return;
|
|
1701
|
-
return this.detach();
|
|
1702
|
-
}.bind(this);
|
|
1703
|
-
|
|
1704
|
-
var processResults = function(results) {
|
|
1705
|
-
var prefix = results.prefix;
|
|
1706
|
-
var matches = results.matches;
|
|
1707
|
-
|
|
1708
|
-
this.completions = new FilteredList(matches);
|
|
1709
|
-
|
|
1710
|
-
if (this.exactMatch)
|
|
1711
|
-
this.completions.exactMatch = true;
|
|
1712
|
-
|
|
1713
|
-
this.completions.setFilter(prefix);
|
|
1714
|
-
var filtered = this.completions.filtered;
|
|
1715
|
-
if (!filtered.length)
|
|
1716
|
-
return detachIfFinished(results);
|
|
1717
|
-
if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet)
|
|
1718
|
-
return detachIfFinished(results);
|
|
1719
|
-
if (this.autoInsert && filtered.length == 1 && results.finished)
|
|
1720
|
-
return this.insertMatch(filtered[0]);
|
|
1721
|
-
|
|
1722
|
-
this.openPopup(this.editor, prefix, keepPopupPosition);
|
|
1723
|
-
}.bind(this);
|
|
1724
|
-
|
|
1725
|
-
var isImmediate = true;
|
|
1726
|
-
var immediateResults = null;
|
|
1727
|
-
this.gatherCompletions(this.editor, function(err, results) {
|
|
1728
|
-
var prefix = results.prefix;
|
|
1729
|
-
var matches = results && results.matches;
|
|
1730
|
-
|
|
1731
|
-
if (!matches || !matches.length)
|
|
1732
|
-
return detachIfFinished(results);
|
|
1733
|
-
if (prefix.indexOf(results.prefix) !== 0 || _id != this.gatherCompletionsId)
|
|
1734
|
-
return;
|
|
1735
|
-
if (isImmediate) {
|
|
1736
|
-
immediateResults = results;
|
|
1737
|
-
return;
|
|
1738
|
-
}
|
|
1739
|
-
|
|
1740
|
-
processResults(results);
|
|
1741
|
-
}.bind(this));
|
|
1742
|
-
|
|
1743
|
-
isImmediate = false;
|
|
1744
|
-
if (immediateResults) {
|
|
1745
|
-
var results = immediateResults;
|
|
1746
|
-
immediateResults = null;
|
|
1747
|
-
processResults(results);
|
|
1748
|
-
}
|
|
1749
|
-
};
|
|
1750
|
-
|
|
1751
|
-
this.cancelContextMenu = function() {
|
|
1752
|
-
this.editor.$mouseHandler.cancelContextMenu();
|
|
1753
|
-
};
|
|
1754
|
-
|
|
1755
|
-
this.updateDocTooltip = function() {
|
|
1756
|
-
var popup = this.popup;
|
|
1757
|
-
var all = popup.data;
|
|
1758
|
-
var selected = all && (all[popup.getHoveredRow()] || all[popup.getRow()]);
|
|
1759
|
-
var doc = null;
|
|
1760
|
-
if (!selected || !this.editor || !this.popup.isOpen)
|
|
1761
|
-
return this.hideDocTooltip();
|
|
1762
|
-
this.editor.completers.some(function(completer) {
|
|
1763
|
-
if (completer.getDocTooltip)
|
|
1764
|
-
doc = completer.getDocTooltip(selected);
|
|
1765
|
-
return doc;
|
|
1766
|
-
});
|
|
1767
|
-
if (!doc && typeof selected != "string")
|
|
1768
|
-
doc = selected;
|
|
1769
|
-
|
|
1770
|
-
if (typeof doc == "string")
|
|
1771
|
-
doc = {docText: doc};
|
|
1772
|
-
if (!doc || !(doc.docHTML || doc.docText))
|
|
1773
|
-
return this.hideDocTooltip();
|
|
1774
|
-
this.showDocTooltip(doc);
|
|
1775
|
-
};
|
|
1776
|
-
|
|
1777
|
-
this.showDocTooltip = function(item) {
|
|
1778
|
-
if (!this.tooltipNode) {
|
|
1779
|
-
this.tooltipNode = dom.createElement("div");
|
|
1780
|
-
this.tooltipNode.className = "ace_tooltip ace_doc-tooltip";
|
|
1781
|
-
this.tooltipNode.style.margin = 0;
|
|
1782
|
-
this.tooltipNode.style.pointerEvents = "auto";
|
|
1783
|
-
this.tooltipNode.tabIndex = -1;
|
|
1784
|
-
this.tooltipNode.onblur = this.blurListener.bind(this);
|
|
1785
|
-
this.tooltipNode.onclick = this.onTooltipClick.bind(this);
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
var tooltipNode = this.tooltipNode;
|
|
1789
|
-
if (item.docHTML) {
|
|
1790
|
-
tooltipNode.innerHTML = item.docHTML;
|
|
1791
|
-
} else if (item.docText) {
|
|
1792
|
-
tooltipNode.textContent = item.docText;
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
if (!tooltipNode.parentNode)
|
|
1796
|
-
document.body.appendChild(tooltipNode);
|
|
1797
|
-
var popup = this.popup;
|
|
1798
|
-
var rect = popup.container.getBoundingClientRect();
|
|
1799
|
-
tooltipNode.style.top = popup.container.style.top;
|
|
1800
|
-
tooltipNode.style.bottom = popup.container.style.bottom;
|
|
1801
|
-
|
|
1802
|
-
tooltipNode.style.display = "block";
|
|
1803
|
-
if (window.innerWidth - rect.right < 320) {
|
|
1804
|
-
if (rect.left < 320) {
|
|
1805
|
-
if(popup.isTopdown) {
|
|
1806
|
-
tooltipNode.style.top = rect.bottom + "px";
|
|
1807
|
-
tooltipNode.style.left = rect.left + "px";
|
|
1808
|
-
tooltipNode.style.right = "";
|
|
1809
|
-
tooltipNode.style.bottom = "";
|
|
1810
|
-
} else {
|
|
1811
|
-
tooltipNode.style.top = popup.container.offsetTop - tooltipNode.offsetHeight + "px";
|
|
1812
|
-
tooltipNode.style.left = rect.left + "px";
|
|
1813
|
-
tooltipNode.style.right = "";
|
|
1814
|
-
tooltipNode.style.bottom = "";
|
|
1815
|
-
}
|
|
1816
|
-
} else {
|
|
1817
|
-
tooltipNode.style.right = window.innerWidth - rect.left + "px";
|
|
1818
|
-
tooltipNode.style.left = "";
|
|
1819
|
-
}
|
|
1820
|
-
} else {
|
|
1821
|
-
tooltipNode.style.left = (rect.right + 1) + "px";
|
|
1822
|
-
tooltipNode.style.right = "";
|
|
1823
|
-
}
|
|
1824
|
-
};
|
|
1825
|
-
|
|
1826
|
-
this.hideDocTooltip = function() {
|
|
1827
|
-
this.tooltipTimer.cancel();
|
|
1828
|
-
if (!this.tooltipNode) return;
|
|
1829
|
-
var el = this.tooltipNode;
|
|
1830
|
-
if (!this.editor.isFocused() && document.activeElement == el)
|
|
1831
|
-
this.editor.focus();
|
|
1832
|
-
this.tooltipNode = null;
|
|
1833
|
-
if (el.parentNode)
|
|
1834
|
-
el.parentNode.removeChild(el);
|
|
1835
|
-
};
|
|
1836
|
-
|
|
1837
|
-
this.onTooltipClick = function(e) {
|
|
1838
|
-
var a = e.target;
|
|
1839
|
-
while (a && a != this.tooltipNode) {
|
|
1840
|
-
if (a.nodeName == "A" && a.href) {
|
|
1841
|
-
a.rel = "noreferrer";
|
|
1842
|
-
a.target = "_blank";
|
|
1843
|
-
break;
|
|
1844
|
-
}
|
|
1845
|
-
a = a.parentNode;
|
|
1846
|
-
}
|
|
1847
|
-
};
|
|
1848
|
-
|
|
1849
|
-
this.destroy = function() {
|
|
1850
|
-
this.detach();
|
|
1851
|
-
if (this.popup) {
|
|
1852
|
-
this.popup.destroy();
|
|
1853
|
-
var el = this.popup.container;
|
|
1854
|
-
if (el && el.parentNode)
|
|
1855
|
-
el.parentNode.removeChild(el);
|
|
1856
|
-
}
|
|
1857
|
-
if (this.editor && this.editor.completer == this)
|
|
1858
|
-
this.editor.completer == null;
|
|
1859
|
-
this.popup = null;
|
|
1860
|
-
};
|
|
1861
|
-
|
|
1862
|
-
}).call(Autocomplete.prototype);
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
Autocomplete.for = function(editor) {
|
|
1866
|
-
if (editor.completer) {
|
|
1867
|
-
return editor.completer;
|
|
1868
|
-
}
|
|
1869
|
-
if (config.get("sharedPopups")) {
|
|
1870
|
-
if (!Autocomplete.$shared)
|
|
1871
|
-
Autocomplete.$sharedInstance = new Autocomplete();
|
|
1872
|
-
editor.completer = Autocomplete.$sharedInstance;
|
|
1873
|
-
} else {
|
|
1874
|
-
editor.completer = new Autocomplete();
|
|
1875
|
-
editor.once("destroy", function(e, editor) {
|
|
1876
|
-
editor.completer.destroy();
|
|
1877
|
-
});
|
|
1878
|
-
}
|
|
1879
|
-
return editor.completer;
|
|
1880
|
-
};
|
|
1881
|
-
|
|
1882
|
-
Autocomplete.startCommand = {
|
|
1883
|
-
name: "startAutocomplete",
|
|
1884
|
-
exec: function(editor, options) {
|
|
1885
|
-
var completer = Autocomplete.for(editor);
|
|
1886
|
-
completer.autoInsert = false;
|
|
1887
|
-
completer.autoSelect = true;
|
|
1888
|
-
completer.showPopup(editor, options);
|
|
1889
|
-
completer.cancelContextMenu();
|
|
1890
|
-
},
|
|
1891
|
-
bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space"
|
|
1892
|
-
};
|
|
1893
|
-
|
|
1894
|
-
var FilteredList = function(array, filterText) {
|
|
1895
|
-
this.all = array;
|
|
1896
|
-
this.filtered = array;
|
|
1897
|
-
this.filterText = filterText || "";
|
|
1898
|
-
this.exactMatch = false;
|
|
1899
|
-
};
|
|
1900
|
-
(function(){
|
|
1901
|
-
this.setFilter = function(str) {
|
|
1902
|
-
if (str.length > this.filterText && str.lastIndexOf(this.filterText, 0) === 0)
|
|
1903
|
-
var matches = this.filtered;
|
|
1904
|
-
else
|
|
1905
|
-
var matches = this.all;
|
|
1906
|
-
|
|
1907
|
-
this.filterText = str;
|
|
1908
|
-
matches = this.filterCompletions(matches, this.filterText);
|
|
1909
|
-
matches = matches.sort(function(a, b) {
|
|
1910
|
-
return b.exactMatch - a.exactMatch || b.$score - a.$score
|
|
1911
|
-
|| (a.caption || a.value).localeCompare(b.caption || b.value);
|
|
1912
|
-
});
|
|
1913
|
-
var prev = null;
|
|
1914
|
-
matches = matches.filter(function(item){
|
|
1915
|
-
var caption = item.snippet || item.caption || item.value;
|
|
1916
|
-
if (caption === prev) return false;
|
|
1917
|
-
prev = caption;
|
|
1918
|
-
return true;
|
|
1919
|
-
});
|
|
1920
|
-
|
|
1921
|
-
this.filtered = matches;
|
|
1922
|
-
};
|
|
1923
|
-
this.filterCompletions = function(items, needle) {
|
|
1924
|
-
var results = [];
|
|
1925
|
-
var upper = needle.toUpperCase();
|
|
1926
|
-
var lower = needle.toLowerCase();
|
|
1927
|
-
loop: for (var i = 0, item; item = items[i]; i++) {
|
|
1928
|
-
var caption = item.caption || item.value || item.snippet;
|
|
1929
|
-
if (!caption) continue;
|
|
1930
|
-
var lastIndex = -1;
|
|
1931
|
-
var matchMask = 0;
|
|
1932
|
-
var penalty = 0;
|
|
1933
|
-
var index, distance;
|
|
1934
|
-
|
|
1935
|
-
if (this.exactMatch) {
|
|
1936
|
-
if (needle !== caption.substr(0, needle.length))
|
|
1937
|
-
continue loop;
|
|
1938
|
-
} else {
|
|
1939
|
-
var fullMatchIndex = caption.toLowerCase().indexOf(lower);
|
|
1940
|
-
if (fullMatchIndex > -1) {
|
|
1941
|
-
penalty = fullMatchIndex;
|
|
1942
|
-
} else {
|
|
1943
|
-
for (var j = 0; j < needle.length; j++) {
|
|
1944
|
-
var i1 = caption.indexOf(lower[j], lastIndex + 1);
|
|
1945
|
-
var i2 = caption.indexOf(upper[j], lastIndex + 1);
|
|
1946
|
-
index = (i1 >= 0) ? ((i2 < 0 || i1 < i2) ? i1 : i2) : i2;
|
|
1947
|
-
if (index < 0)
|
|
1948
|
-
continue loop;
|
|
1949
|
-
distance = index - lastIndex - 1;
|
|
1950
|
-
if (distance > 0) {
|
|
1951
|
-
if (lastIndex === -1)
|
|
1952
|
-
penalty += 10;
|
|
1953
|
-
penalty += distance;
|
|
1954
|
-
matchMask = matchMask | (1 << j);
|
|
1955
|
-
}
|
|
1956
|
-
lastIndex = index;
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
|
-
item.matchMask = matchMask;
|
|
1961
|
-
item.exactMatch = penalty ? 0 : 1;
|
|
1962
|
-
item.$score = (item.score || 0) - penalty;
|
|
1963
|
-
results.push(item);
|
|
1964
|
-
}
|
|
1965
|
-
return results;
|
|
1966
|
-
};
|
|
1967
|
-
}).call(FilteredList.prototype);
|
|
1968
|
-
|
|
1969
|
-
exports.Autocomplete = Autocomplete;
|
|
1970
|
-
exports.FilteredList = FilteredList;
|
|
1971
|
-
|
|
1972
|
-
});
|
|
1973
|
-
|
|
1974
|
-
ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
|
|
1975
|
-
'use strict';
|
|
1976
|
-
var dom = require("../../lib/dom");
|
|
1977
|
-
var cssText = "#ace_settingsmenu, #kbshortcutmenu {\
|
|
1978
|
-
background-color: #F7F7F7;\
|
|
1979
|
-
color: black;\
|
|
1980
|
-
box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);\
|
|
1981
|
-
padding: 1em 0.5em 2em 1em;\
|
|
1982
|
-
overflow: auto;\
|
|
1983
|
-
position: absolute;\
|
|
1984
|
-
margin: 0;\
|
|
1985
|
-
bottom: 0;\
|
|
1986
|
-
right: 0;\
|
|
1987
|
-
top: 0;\
|
|
1988
|
-
z-index: 9991;\
|
|
1989
|
-
cursor: default;\
|
|
1990
|
-
}\
|
|
1991
|
-
.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {\
|
|
1992
|
-
box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);\
|
|
1993
|
-
background-color: rgba(255, 255, 255, 0.6);\
|
|
1994
|
-
color: black;\
|
|
1995
|
-
}\
|
|
1996
|
-
.ace_optionsMenuEntry:hover {\
|
|
1997
|
-
background-color: rgba(100, 100, 100, 0.1);\
|
|
1998
|
-
transition: all 0.3s\
|
|
1999
|
-
}\
|
|
2000
|
-
.ace_closeButton {\
|
|
2001
|
-
background: rgba(245, 146, 146, 0.5);\
|
|
2002
|
-
border: 1px solid #F48A8A;\
|
|
2003
|
-
border-radius: 50%;\
|
|
2004
|
-
padding: 7px;\
|
|
2005
|
-
position: absolute;\
|
|
2006
|
-
right: -8px;\
|
|
2007
|
-
top: -8px;\
|
|
2008
|
-
z-index: 100000;\
|
|
2009
|
-
}\
|
|
2010
|
-
.ace_closeButton{\
|
|
2011
|
-
background: rgba(245, 146, 146, 0.9);\
|
|
2012
|
-
}\
|
|
2013
|
-
.ace_optionsMenuKey {\
|
|
2014
|
-
color: darkslateblue;\
|
|
2015
|
-
font-weight: bold;\
|
|
2016
|
-
}\
|
|
2017
|
-
.ace_optionsMenuCommand {\
|
|
2018
|
-
color: darkcyan;\
|
|
2019
|
-
font-weight: normal;\
|
|
2020
|
-
}\
|
|
2021
|
-
.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {\
|
|
2022
|
-
vertical-align: middle;\
|
|
2023
|
-
}\
|
|
2024
|
-
.ace_optionsMenuEntry button[ace_selected_button=true] {\
|
|
2025
|
-
background: #e7e7e7;\
|
|
2026
|
-
box-shadow: 1px 0px 2px 0px #adadad inset;\
|
|
2027
|
-
border-color: #adadad;\
|
|
2028
|
-
}\
|
|
2029
|
-
.ace_optionsMenuEntry button {\
|
|
2030
|
-
background: white;\
|
|
2031
|
-
border: 1px solid lightgray;\
|
|
2032
|
-
margin: 0px;\
|
|
2033
|
-
}\
|
|
2034
|
-
.ace_optionsMenuEntry button:hover{\
|
|
2035
|
-
background: #f0f0f0;\
|
|
2036
|
-
}";
|
|
2037
|
-
dom.importCssString(cssText, "settings_menu.css", false);
|
|
2038
|
-
|
|
2039
|
-
module.exports.overlayPage = function overlayPage(editor, contentElement, callback) {
|
|
2040
|
-
var closer = document.createElement('div');
|
|
2041
|
-
var ignoreFocusOut = false;
|
|
2042
|
-
|
|
2043
|
-
function documentEscListener(e) {
|
|
2044
|
-
if (e.keyCode === 27) {
|
|
2045
|
-
close();
|
|
2046
|
-
}
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
|
-
function close() {
|
|
2050
|
-
if (!closer) return;
|
|
2051
|
-
document.removeEventListener('keydown', documentEscListener);
|
|
2052
|
-
closer.parentNode.removeChild(closer);
|
|
2053
|
-
if (editor) {
|
|
2054
|
-
editor.focus();
|
|
2055
|
-
}
|
|
2056
|
-
closer = null;
|
|
2057
|
-
callback && callback();
|
|
2058
|
-
}
|
|
2059
|
-
function setIgnoreFocusOut(ignore) {
|
|
2060
|
-
ignoreFocusOut = ignore;
|
|
2061
|
-
if (ignore) {
|
|
2062
|
-
closer.style.pointerEvents = "none";
|
|
2063
|
-
contentElement.style.pointerEvents = "auto";
|
|
2064
|
-
}
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
closer.style.cssText = 'margin: 0; padding: 0; ' +
|
|
2068
|
-
'position: fixed; top:0; bottom:0; left:0; right:0;' +
|
|
2069
|
-
'z-index: 9990; ' +
|
|
2070
|
-
(editor ? 'background-color: rgba(0, 0, 0, 0.3);' : '');
|
|
2071
|
-
closer.addEventListener('click', function(e) {
|
|
2072
|
-
if (!ignoreFocusOut) {
|
|
2073
|
-
close();
|
|
2074
|
-
}
|
|
2075
|
-
});
|
|
2076
|
-
document.addEventListener('keydown', documentEscListener);
|
|
2077
|
-
|
|
2078
|
-
contentElement.addEventListener('click', function (e) {
|
|
2079
|
-
e.stopPropagation();
|
|
2080
|
-
});
|
|
2081
|
-
|
|
2082
|
-
closer.appendChild(contentElement);
|
|
2083
|
-
document.body.appendChild(closer);
|
|
2084
|
-
if (editor) {
|
|
2085
|
-
editor.blur();
|
|
2086
|
-
}
|
|
2087
|
-
return {
|
|
2088
|
-
close: close,
|
|
2089
|
-
setIgnoreFocusOut: setIgnoreFocusOut
|
|
2090
|
-
};
|
|
2091
|
-
};
|
|
2092
|
-
|
|
2093
|
-
});
|
|
2094
|
-
|
|
2095
|
-
ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
|
|
2096
|
-
"use strict";
|
|
2097
|
-
|
|
2098
|
-
var modes = [];
|
|
2099
|
-
function getModeForPath(path) {
|
|
2100
|
-
var mode = modesByName.text;
|
|
2101
|
-
var fileName = path.split(/[\/\\]/).pop();
|
|
2102
|
-
for (var i = 0; i < modes.length; i++) {
|
|
2103
|
-
if (modes[i].supportsFile(fileName)) {
|
|
2104
|
-
mode = modes[i];
|
|
2105
|
-
break;
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
return mode;
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
var Mode = function(name, caption, extensions) {
|
|
2112
|
-
this.name = name;
|
|
2113
|
-
this.caption = caption;
|
|
2114
|
-
this.mode = "ace/mode/" + name;
|
|
2115
|
-
this.extensions = extensions;
|
|
2116
|
-
var re;
|
|
2117
|
-
if (/\^/.test(extensions)) {
|
|
2118
|
-
re = extensions.replace(/\|(\^)?/g, function(a, b){
|
|
2119
|
-
return "$|" + (b ? "^" : "^.*\\.");
|
|
2120
|
-
}) + "$";
|
|
2121
|
-
} else {
|
|
2122
|
-
re = "^.*\\.(" + extensions + ")$";
|
|
2123
|
-
}
|
|
2124
|
-
|
|
2125
|
-
this.extRe = new RegExp(re, "gi");
|
|
2126
|
-
};
|
|
2127
|
-
|
|
2128
|
-
Mode.prototype.supportsFile = function(filename) {
|
|
2129
|
-
return filename.match(this.extRe);
|
|
2130
|
-
};
|
|
2131
|
-
var supportedModes = {
|
|
2132
|
-
ABAP: ["abap"],
|
|
2133
|
-
ABC: ["abc"],
|
|
2134
|
-
ActionScript:["as"],
|
|
2135
|
-
ADA: ["ada|adb"],
|
|
2136
|
-
Alda: ["alda"],
|
|
2137
|
-
Apache_Conf: ["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],
|
|
2138
|
-
Apex: ["apex|cls|trigger|tgr"],
|
|
2139
|
-
AQL: ["aql"],
|
|
2140
|
-
AsciiDoc: ["asciidoc|adoc"],
|
|
2141
|
-
ASL: ["dsl|asl|asl.json"],
|
|
2142
|
-
Assembly_x86:["asm|a"],
|
|
2143
|
-
AutoHotKey: ["ahk"],
|
|
2144
|
-
BatchFile: ["bat|cmd"],
|
|
2145
|
-
C_Cpp: ["cpp|c|cc|cxx|h|hh|hpp|ino"],
|
|
2146
|
-
C9Search: ["c9search_results"],
|
|
2147
|
-
Cirru: ["cirru|cr"],
|
|
2148
|
-
Clojure: ["clj|cljs"],
|
|
2149
|
-
Cobol: ["CBL|COB"],
|
|
2150
|
-
coffee: ["coffee|cf|cson|^Cakefile"],
|
|
2151
|
-
ColdFusion: ["cfm"],
|
|
2152
|
-
Crystal: ["cr"],
|
|
2153
|
-
CSharp: ["cs"],
|
|
2154
|
-
Csound_Document: ["csd"],
|
|
2155
|
-
Csound_Orchestra: ["orc"],
|
|
2156
|
-
Csound_Score: ["sco"],
|
|
2157
|
-
CSS: ["css"],
|
|
2158
|
-
Curly: ["curly"],
|
|
2159
|
-
D: ["d|di"],
|
|
2160
|
-
Dart: ["dart"],
|
|
2161
|
-
Diff: ["diff|patch"],
|
|
2162
|
-
Dockerfile: ["^Dockerfile"],
|
|
2163
|
-
Dot: ["dot"],
|
|
2164
|
-
Drools: ["drl"],
|
|
2165
|
-
Edifact: ["edi"],
|
|
2166
|
-
Eiffel: ["e|ge"],
|
|
2167
|
-
EJS: ["ejs"],
|
|
2168
|
-
Elixir: ["ex|exs"],
|
|
2169
|
-
Elm: ["elm"],
|
|
2170
|
-
Erlang: ["erl|hrl"],
|
|
2171
|
-
Forth: ["frt|fs|ldr|fth|4th"],
|
|
2172
|
-
Fortran: ["f|f90"],
|
|
2173
|
-
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
|
2174
|
-
FSL: ["fsl"],
|
|
2175
|
-
FTL: ["ftl"],
|
|
2176
|
-
Gcode: ["gcode"],
|
|
2177
|
-
Gherkin: ["feature"],
|
|
2178
|
-
Gitignore: ["^.gitignore"],
|
|
2179
|
-
Glsl: ["glsl|frag|vert"],
|
|
2180
|
-
Gobstones: ["gbs"],
|
|
2181
|
-
golang: ["go"],
|
|
2182
|
-
GraphQLSchema: ["gql"],
|
|
2183
|
-
Groovy: ["groovy"],
|
|
2184
|
-
HAML: ["haml"],
|
|
2185
|
-
Handlebars: ["hbs|handlebars|tpl|mustache"],
|
|
2186
|
-
Haskell: ["hs"],
|
|
2187
|
-
Haskell_Cabal: ["cabal"],
|
|
2188
|
-
haXe: ["hx"],
|
|
2189
|
-
Hjson: ["hjson"],
|
|
2190
|
-
HTML: ["html|htm|xhtml|vue|we|wpy"],
|
|
2191
|
-
HTML_Elixir: ["eex|html.eex"],
|
|
2192
|
-
HTML_Ruby: ["erb|rhtml|html.erb"],
|
|
2193
|
-
INI: ["ini|conf|cfg|prefs"],
|
|
2194
|
-
Io: ["io"],
|
|
2195
|
-
Jack: ["jack"],
|
|
2196
|
-
Jade: ["jade|pug"],
|
|
2197
|
-
Java: ["java"],
|
|
2198
|
-
JavaScript: ["js|jsm|jsx"],
|
|
2199
|
-
JSON: ["json"],
|
|
2200
|
-
JSON5: ["json5"],
|
|
2201
|
-
JSONiq: ["jq"],
|
|
2202
|
-
JSP: ["jsp"],
|
|
2203
|
-
JSSM: ["jssm|jssm_state"],
|
|
2204
|
-
JSX: ["jsx"],
|
|
2205
|
-
Julia: ["jl"],
|
|
2206
|
-
Kotlin: ["kt|kts"],
|
|
2207
|
-
LaTeX: ["tex|latex|ltx|bib"],
|
|
2208
|
-
Latte: ["latte"],
|
|
2209
|
-
LESS: ["less"],
|
|
2210
|
-
Liquid: ["liquid"],
|
|
2211
|
-
Lisp: ["lisp"],
|
|
2212
|
-
LiveScript: ["ls"],
|
|
2213
|
-
LogiQL: ["logic|lql"],
|
|
2214
|
-
LSL: ["lsl"],
|
|
2215
|
-
Lua: ["lua"],
|
|
2216
|
-
LuaPage: ["lp"],
|
|
2217
|
-
Lucene: ["lucene"],
|
|
2218
|
-
Makefile: ["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],
|
|
2219
|
-
Markdown: ["md|markdown"],
|
|
2220
|
-
Mask: ["mask"],
|
|
2221
|
-
MATLAB: ["matlab"],
|
|
2222
|
-
Maze: ["mz"],
|
|
2223
|
-
MediaWiki: ["wiki|mediawiki"],
|
|
2224
|
-
MEL: ["mel"],
|
|
2225
|
-
MIPS: ["s|asm"],
|
|
2226
|
-
MIXAL: ["mixal"],
|
|
2227
|
-
MUSHCode: ["mc|mush"],
|
|
2228
|
-
MySQL: ["mysql"],
|
|
2229
|
-
Nginx: ["nginx|conf"],
|
|
2230
|
-
Nim: ["nim"],
|
|
2231
|
-
Nix: ["nix"],
|
|
2232
|
-
NSIS: ["nsi|nsh"],
|
|
2233
|
-
Nunjucks: ["nunjucks|nunjs|nj|njk"],
|
|
2234
|
-
ObjectiveC: ["m|mm"],
|
|
2235
|
-
OCaml: ["ml|mli"],
|
|
2236
|
-
Pascal: ["pas|p"],
|
|
2237
|
-
Perl: ["pl|pm"],
|
|
2238
|
-
pgSQL: ["pgsql"],
|
|
2239
|
-
PHP: ["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
|
2240
|
-
PHP_Laravel_blade: ["blade.php"],
|
|
2241
|
-
Pig: ["pig"],
|
|
2242
|
-
Powershell: ["ps1"],
|
|
2243
|
-
Praat: ["praat|praatscript|psc|proc"],
|
|
2244
|
-
Prisma: ["prisma"],
|
|
2245
|
-
Prolog: ["plg|prolog"],
|
|
2246
|
-
Properties: ["properties"],
|
|
2247
|
-
Protobuf: ["proto"],
|
|
2248
|
-
Puppet: ["epp|pp"],
|
|
2249
|
-
Python: ["py"],
|
|
2250
|
-
QML: ["qml"],
|
|
2251
|
-
R: ["r"],
|
|
2252
|
-
Raku: ["raku|rakumod|rakutest|p6|pl6|pm6"],
|
|
2253
|
-
Razor: ["cshtml|asp"],
|
|
2254
|
-
RDoc: ["Rd"],
|
|
2255
|
-
Red: ["red|reds"],
|
|
2256
|
-
RHTML: ["Rhtml"],
|
|
2257
|
-
RST: ["rst"],
|
|
2258
|
-
Ruby: ["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],
|
|
2259
|
-
Rust: ["rs"],
|
|
2260
|
-
SASS: ["sass"],
|
|
2261
|
-
SCAD: ["scad"],
|
|
2262
|
-
Scala: ["scala|sbt"],
|
|
2263
|
-
Scheme: ["scm|sm|rkt|oak|scheme"],
|
|
2264
|
-
Scrypt: ["scrypt"],
|
|
2265
|
-
SCSS: ["scss"],
|
|
2266
|
-
SH: ["sh|bash|^.bashrc"],
|
|
2267
|
-
SJS: ["sjs"],
|
|
2268
|
-
Slim: ["slim|skim"],
|
|
2269
|
-
Smarty: ["smarty|tpl"],
|
|
2270
|
-
Smithy: ["smithy"],
|
|
2271
|
-
snippets: ["snippets"],
|
|
2272
|
-
Soy_Template:["soy"],
|
|
2273
|
-
Space: ["space"],
|
|
2274
|
-
SQL: ["sql"],
|
|
2275
|
-
SQLServer: ["sqlserver"],
|
|
2276
|
-
Stylus: ["styl|stylus"],
|
|
2277
|
-
SVG: ["svg"],
|
|
2278
|
-
Swift: ["swift"],
|
|
2279
|
-
Tcl: ["tcl"],
|
|
2280
|
-
Terraform: ["tf", "tfvars", "terragrunt"],
|
|
2281
|
-
Tex: ["tex"],
|
|
2282
|
-
Text: ["txt"],
|
|
2283
|
-
Textile: ["textile"],
|
|
2284
|
-
Toml: ["toml"],
|
|
2285
|
-
TSX: ["tsx"],
|
|
2286
|
-
Twig: ["twig|swig"],
|
|
2287
|
-
Typescript: ["ts|typescript|str"],
|
|
2288
|
-
Vala: ["vala"],
|
|
2289
|
-
VBScript: ["vbs|vb"],
|
|
2290
|
-
Velocity: ["vm"],
|
|
2291
|
-
Verilog: ["v|vh|sv|svh"],
|
|
2292
|
-
VHDL: ["vhd|vhdl"],
|
|
2293
|
-
Visualforce: ["vfp|component|page"],
|
|
2294
|
-
Wollok: ["wlk|wpgm|wtest"],
|
|
2295
|
-
XML: ["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],
|
|
2296
|
-
XQuery: ["xq"],
|
|
2297
|
-
YAML: ["yaml|yml"],
|
|
2298
|
-
Zeek: ["zeek|bro"],
|
|
2299
|
-
Django: ["html"]
|
|
2300
|
-
};
|
|
2301
|
-
|
|
2302
|
-
var nameOverrides = {
|
|
2303
|
-
ObjectiveC: "Objective-C",
|
|
2304
|
-
CSharp: "C#",
|
|
2305
|
-
golang: "Go",
|
|
2306
|
-
C_Cpp: "C and C++",
|
|
2307
|
-
Csound_Document: "Csound Document",
|
|
2308
|
-
Csound_Orchestra: "Csound",
|
|
2309
|
-
Csound_Score: "Csound Score",
|
|
2310
|
-
coffee: "CoffeeScript",
|
|
2311
|
-
HTML_Ruby: "HTML (Ruby)",
|
|
2312
|
-
HTML_Elixir: "HTML (Elixir)",
|
|
2313
|
-
FTL: "FreeMarker",
|
|
2314
|
-
PHP_Laravel_blade: "PHP (Blade Template)",
|
|
2315
|
-
Perl6: "Perl 6",
|
|
2316
|
-
AutoHotKey: "AutoHotkey / AutoIt"
|
|
2317
|
-
};
|
|
2318
|
-
|
|
2319
|
-
var modesByName = {};
|
|
2320
|
-
for (var name in supportedModes) {
|
|
2321
|
-
var data = supportedModes[name];
|
|
2322
|
-
var displayName = (nameOverrides[name] || name).replace(/_/g, " ");
|
|
2323
|
-
var filename = name.toLowerCase();
|
|
2324
|
-
var mode = new Mode(filename, displayName, data[0]);
|
|
2325
|
-
modesByName[filename] = mode;
|
|
2326
|
-
modes.push(mode);
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
module.exports = {
|
|
2330
|
-
getModeForPath: getModeForPath,
|
|
2331
|
-
modes: modes,
|
|
2332
|
-
modesByName: modesByName
|
|
2333
|
-
};
|
|
2334
|
-
|
|
2335
|
-
});
|
|
2336
|
-
|
|
2337
|
-
ace.define("ace/ext/prompt",["require","exports","module","ace/range","ace/lib/dom","ace/ext/menu_tools/get_editor_keyboard_shortcuts","ace/autocomplete","ace/autocomplete/popup","ace/autocomplete/popup","ace/undomanager","ace/tokenizer","ace/ext/menu_tools/overlay_page","ace/ext/modelist"], function(require, exports, module) {
|
|
2338
|
-
"use strict";
|
|
2339
|
-
|
|
2340
|
-
var Range = require("../range").Range;
|
|
2341
|
-
var dom = require("../lib/dom");
|
|
2342
|
-
var shortcuts = require("../ext/menu_tools/get_editor_keyboard_shortcuts");
|
|
2343
|
-
var FilteredList= require("../autocomplete").FilteredList;
|
|
2344
|
-
var AcePopup = require('../autocomplete/popup').AcePopup;
|
|
2345
|
-
var $singleLineEditor = require('../autocomplete/popup').$singleLineEditor;
|
|
2346
|
-
var UndoManager = require("../undomanager").UndoManager;
|
|
2347
|
-
var Tokenizer = require("../tokenizer").Tokenizer;
|
|
2348
|
-
var overlayPage = require("./menu_tools/overlay_page").overlayPage;
|
|
2349
|
-
var modelist = require("./modelist");
|
|
2350
|
-
var openPrompt;
|
|
2351
|
-
|
|
2352
|
-
function prompt(editor, message, options, callback) {
|
|
2353
|
-
if (typeof message == "object") {
|
|
2354
|
-
return prompt(editor, "", message, options);
|
|
2355
|
-
}
|
|
2356
|
-
if (openPrompt) {
|
|
2357
|
-
var lastPrompt = openPrompt;
|
|
2358
|
-
editor = lastPrompt.editor;
|
|
2359
|
-
lastPrompt.close();
|
|
2360
|
-
if (lastPrompt.name && lastPrompt.name == options.name)
|
|
2361
|
-
return;
|
|
2362
|
-
}
|
|
2363
|
-
if (options.$type)
|
|
2364
|
-
return prompt[options.$type](editor, callback);
|
|
2365
|
-
|
|
2366
|
-
var cmdLine = $singleLineEditor();
|
|
2367
|
-
cmdLine.session.setUndoManager(new UndoManager());
|
|
2368
|
-
|
|
2369
|
-
var el = dom.buildDom(["div", {class: "ace_prompt_container" + (options.hasDescription ? " input-box-with-description" : "")}]);
|
|
2370
|
-
var overlay = overlayPage(editor, el, done);
|
|
2371
|
-
el.appendChild(cmdLine.container);
|
|
2372
|
-
|
|
2373
|
-
if (editor) {
|
|
2374
|
-
editor.cmdLine = cmdLine;
|
|
2375
|
-
cmdLine.setOption("fontSize", editor.getOption("fontSize"));
|
|
2376
|
-
}
|
|
2377
|
-
if (message) {
|
|
2378
|
-
cmdLine.setValue(message, 1);
|
|
2379
|
-
}
|
|
2380
|
-
if (options.selection) {
|
|
2381
|
-
cmdLine.selection.setRange({
|
|
2382
|
-
start: cmdLine.session.doc.indexToPosition(options.selection[0]),
|
|
2383
|
-
end: cmdLine.session.doc.indexToPosition(options.selection[1])
|
|
2384
|
-
});
|
|
2385
|
-
}
|
|
2386
|
-
|
|
2387
|
-
if (options.getCompletions) {
|
|
2388
|
-
var popup = new AcePopup();
|
|
2389
|
-
popup.renderer.setStyle("ace_autocomplete_inline");
|
|
2390
|
-
popup.container.style.display = "block";
|
|
2391
|
-
popup.container.style.maxWidth = "600px";
|
|
2392
|
-
popup.container.style.width = "100%";
|
|
2393
|
-
popup.container.style.marginTop = "3px";
|
|
2394
|
-
popup.renderer.setScrollMargin(2, 2, 0, 0);
|
|
2395
|
-
popup.autoSelect = false;
|
|
2396
|
-
popup.renderer.$maxLines = 15;
|
|
2397
|
-
popup.setRow(-1);
|
|
2398
|
-
popup.on("click", function(e) {
|
|
2399
|
-
var data = popup.getData(popup.getRow());
|
|
2400
|
-
if (!data.error) {
|
|
2401
|
-
cmdLine.setValue(data.value || data.name || data);
|
|
2402
|
-
accept();
|
|
2403
|
-
e.stop();
|
|
2404
|
-
}
|
|
2405
|
-
});
|
|
2406
|
-
el.appendChild(popup.container);
|
|
2407
|
-
updateCompletions();
|
|
2408
|
-
}
|
|
2409
|
-
|
|
2410
|
-
if (options.$rules) {
|
|
2411
|
-
var tokenizer = new Tokenizer(options.$rules);
|
|
2412
|
-
cmdLine.session.bgTokenizer.setTokenizer(tokenizer);
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
if (options.placeholder) {
|
|
2416
|
-
cmdLine.setOption("placeholder", options.placeholder);
|
|
2417
|
-
}
|
|
2418
|
-
|
|
2419
|
-
if (options.hasDescription) {
|
|
2420
|
-
var promptTextContainer = dom.buildDom(["div", {class: "ace_prompt_text_container"}]);
|
|
2421
|
-
dom.buildDom(options.prompt || "Press 'Enter' to confirm or 'Escape' to cancel", promptTextContainer);
|
|
2422
|
-
el.appendChild(promptTextContainer);
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
|
-
overlay.setIgnoreFocusOut(options.ignoreFocusOut);
|
|
2426
|
-
|
|
2427
|
-
function accept() {
|
|
2428
|
-
var val;
|
|
2429
|
-
if (popup && popup.getCursorPosition().row > 0) {
|
|
2430
|
-
val = valueFromRecentList();
|
|
2431
|
-
} else {
|
|
2432
|
-
val = cmdLine.getValue();
|
|
2433
|
-
}
|
|
2434
|
-
var curData = popup ? popup.getData(popup.getRow()) : val;
|
|
2435
|
-
if (curData && !curData.error) {
|
|
2436
|
-
done();
|
|
2437
|
-
options.onAccept && options.onAccept({
|
|
2438
|
-
value: val,
|
|
2439
|
-
item: curData
|
|
2440
|
-
}, cmdLine);
|
|
2441
|
-
}
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
var keys = {
|
|
2445
|
-
"Enter": accept,
|
|
2446
|
-
"Esc|Shift-Esc": function() {
|
|
2447
|
-
options.onCancel && options.onCancel(cmdLine.getValue(), cmdLine);
|
|
2448
|
-
done();
|
|
2449
|
-
}
|
|
2450
|
-
};
|
|
2451
|
-
|
|
2452
|
-
if (popup) {
|
|
2453
|
-
Object.assign(keys, {
|
|
2454
|
-
"Up": function(editor) { popup.goTo("up"); valueFromRecentList();},
|
|
2455
|
-
"Down": function(editor) { popup.goTo("down"); valueFromRecentList();},
|
|
2456
|
-
"Ctrl-Up|Ctrl-Home": function(editor) { popup.goTo("start"); valueFromRecentList();},
|
|
2457
|
-
"Ctrl-Down|Ctrl-End": function(editor) { popup.goTo("end"); valueFromRecentList();},
|
|
2458
|
-
"Tab": function(editor) {
|
|
2459
|
-
popup.goTo("down"); valueFromRecentList();
|
|
2460
|
-
},
|
|
2461
|
-
"PageUp": function(editor) { popup.gotoPageUp(); valueFromRecentList();},
|
|
2462
|
-
"PageDown": function(editor) { popup.gotoPageDown(); valueFromRecentList();}
|
|
2463
|
-
});
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
cmdLine.commands.bindKeys(keys);
|
|
2467
|
-
|
|
2468
|
-
function done() {
|
|
2469
|
-
overlay.close();
|
|
2470
|
-
callback && callback();
|
|
2471
|
-
openPrompt = null;
|
|
2472
|
-
}
|
|
2473
|
-
|
|
2474
|
-
cmdLine.on("input", function() {
|
|
2475
|
-
options.onInput && options.onInput();
|
|
2476
|
-
updateCompletions();
|
|
2477
|
-
});
|
|
2478
|
-
|
|
2479
|
-
function updateCompletions() {
|
|
2480
|
-
if (options.getCompletions) {
|
|
2481
|
-
var prefix;
|
|
2482
|
-
if (options.getPrefix) {
|
|
2483
|
-
prefix = options.getPrefix(cmdLine);
|
|
2484
|
-
}
|
|
2485
|
-
|
|
2486
|
-
var completions = options.getCompletions(cmdLine);
|
|
2487
|
-
popup.setData(completions, prefix);
|
|
2488
|
-
popup.resize(true);
|
|
2489
|
-
}
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
function valueFromRecentList() {
|
|
2493
|
-
var current = popup.getData(popup.getRow());
|
|
2494
|
-
if (current && !current.error)
|
|
2495
|
-
return current.value || current.caption || current;
|
|
2496
|
-
}
|
|
2497
|
-
|
|
2498
|
-
cmdLine.resize(true);
|
|
2499
|
-
if (popup) {
|
|
2500
|
-
popup.resize(true);
|
|
2501
|
-
}
|
|
2502
|
-
cmdLine.focus();
|
|
2503
|
-
|
|
2504
|
-
openPrompt = {
|
|
2505
|
-
close: done,
|
|
2506
|
-
name: options.name,
|
|
2507
|
-
editor: editor
|
|
2508
|
-
};
|
|
2509
|
-
}
|
|
2510
|
-
|
|
2511
|
-
prompt.gotoLine = function(editor, callback) {
|
|
2512
|
-
function stringifySelection(selection) {
|
|
2513
|
-
if (!Array.isArray(selection))
|
|
2514
|
-
selection = [selection];
|
|
2515
|
-
return selection.map(function(r) {
|
|
2516
|
-
var cursor = r.isBackwards ? r.start: r.end;
|
|
2517
|
-
var anchor = r.isBackwards ? r.end: r.start;
|
|
2518
|
-
var row = anchor.row;
|
|
2519
|
-
var s = (row + 1) + ":" + anchor.column;
|
|
2520
|
-
|
|
2521
|
-
if (anchor.row == cursor.row) {
|
|
2522
|
-
if (anchor.column != cursor.column)
|
|
2523
|
-
s += ">" + ":" + cursor.column;
|
|
2524
|
-
} else {
|
|
2525
|
-
s += ">" + (cursor.row + 1) + ":" + cursor.column;
|
|
2526
|
-
}
|
|
2527
|
-
return s;
|
|
2528
|
-
}).reverse().join(", ");
|
|
2529
|
-
}
|
|
2530
|
-
|
|
2531
|
-
prompt(editor, ":" + stringifySelection(editor.selection.toJSON()), {
|
|
2532
|
-
name: "gotoLine",
|
|
2533
|
-
selection: [1, Number.MAX_VALUE],
|
|
2534
|
-
onAccept: function(data) {
|
|
2535
|
-
var value = data.value;
|
|
2536
|
-
var _history = prompt.gotoLine._history;
|
|
2537
|
-
if (!_history)
|
|
2538
|
-
prompt.gotoLine._history = _history = [];
|
|
2539
|
-
if (_history.indexOf(value) != -1)
|
|
2540
|
-
_history.splice(_history.indexOf(value), 1);
|
|
2541
|
-
_history.unshift(value);
|
|
2542
|
-
if (_history.length > 20) _history.length = 20;
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
var pos = editor.getCursorPosition();
|
|
2546
|
-
var ranges = [];
|
|
2547
|
-
value.replace(/^:/, "").split(/,/).map(function(str) {
|
|
2548
|
-
var parts = str.split(/([<>:+-]|c?\d+)|[^c\d<>:+-]+/).filter(Boolean);
|
|
2549
|
-
var i = 0;
|
|
2550
|
-
function readPosition() {
|
|
2551
|
-
var c = parts[i++];
|
|
2552
|
-
if (!c) return;
|
|
2553
|
-
if (c[0] == "c") {
|
|
2554
|
-
var index = parseInt(c.slice(1)) || 0;
|
|
2555
|
-
return editor.session.doc.indexToPosition(index);
|
|
2556
|
-
}
|
|
2557
|
-
var row = pos.row;
|
|
2558
|
-
var column = 0;
|
|
2559
|
-
if (/\d/.test(c)) {
|
|
2560
|
-
row = parseInt(c) - 1;
|
|
2561
|
-
c = parts[i++];
|
|
2562
|
-
}
|
|
2563
|
-
if (c == ":") {
|
|
2564
|
-
c = parts[i++];
|
|
2565
|
-
if (/\d/.test(c)) {
|
|
2566
|
-
column = parseInt(c) || 0;
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
return {row: row, column: column};
|
|
2570
|
-
}
|
|
2571
|
-
pos = readPosition();
|
|
2572
|
-
var range = Range.fromPoints(pos, pos);
|
|
2573
|
-
if (parts[i] == ">") {
|
|
2574
|
-
i++;
|
|
2575
|
-
range.end = readPosition();
|
|
2576
|
-
}
|
|
2577
|
-
else if (parts[i] == "<") {
|
|
2578
|
-
i++;
|
|
2579
|
-
range.start = readPosition();
|
|
2580
|
-
}
|
|
2581
|
-
ranges.unshift(range);
|
|
2582
|
-
});
|
|
2583
|
-
editor.selection.fromJSON(ranges);
|
|
2584
|
-
var scrollTop = editor.renderer.scrollTop;
|
|
2585
|
-
editor.renderer.scrollSelectionIntoView(
|
|
2586
|
-
editor.selection.anchor,
|
|
2587
|
-
editor.selection.cursor,
|
|
2588
|
-
0.5
|
|
2589
|
-
);
|
|
2590
|
-
editor.renderer.animateScrolling(scrollTop);
|
|
2591
|
-
},
|
|
2592
|
-
history: function() {
|
|
2593
|
-
var undoManager = editor.session.getUndoManager();
|
|
2594
|
-
if (!prompt.gotoLine._history)
|
|
2595
|
-
return [];
|
|
2596
|
-
return prompt.gotoLine._history;
|
|
2597
|
-
|
|
2598
|
-
},
|
|
2599
|
-
getCompletions: function(cmdLine) {
|
|
2600
|
-
var value = cmdLine.getValue();
|
|
2601
|
-
var m = value.replace(/^:/, "").split(":");
|
|
2602
|
-
var row = Math.min(parseInt(m[0]) || 1, editor.session.getLength()) - 1;
|
|
2603
|
-
var line = editor.session.getLine(row);
|
|
2604
|
-
var current = value + " " + line;
|
|
2605
|
-
return [current].concat(this.history());
|
|
2606
|
-
},
|
|
2607
|
-
$rules: {
|
|
2608
|
-
start: [{
|
|
2609
|
-
regex: /\d+/,
|
|
2610
|
-
token: "string"
|
|
2611
|
-
}, {
|
|
2612
|
-
regex: /[:,><+\-c]/,
|
|
2613
|
-
token: "keyword"
|
|
2614
|
-
}]
|
|
2615
|
-
}
|
|
2616
|
-
});
|
|
2617
|
-
};
|
|
2618
|
-
|
|
2619
|
-
prompt.commands = function(editor, callback) {
|
|
2620
|
-
function normalizeName(name) {
|
|
2621
|
-
return (name || "").replace(/^./, function(x) {
|
|
2622
|
-
return x.toUpperCase(x);
|
|
2623
|
-
}).replace(/[a-z][A-Z]/g, function(x) {
|
|
2624
|
-
return x[0] + " " + x[1].toLowerCase(x);
|
|
2625
|
-
});
|
|
2626
|
-
}
|
|
2627
|
-
function getEditorCommandsByName(excludeCommands) {
|
|
2628
|
-
var commandsByName = [];
|
|
2629
|
-
var commandMap = {};
|
|
2630
|
-
editor.keyBinding.$handlers.forEach(function(handler) {
|
|
2631
|
-
var platform = handler.platform;
|
|
2632
|
-
var cbn = handler.byName;
|
|
2633
|
-
for (var i in cbn) {
|
|
2634
|
-
var key = cbn[i].bindKey;
|
|
2635
|
-
if (typeof key !== "string") {
|
|
2636
|
-
key = key && key[platform] || "";
|
|
2637
|
-
}
|
|
2638
|
-
var commands = cbn[i];
|
|
2639
|
-
var description = commands.description || normalizeName(commands.name);
|
|
2640
|
-
if (!Array.isArray(commands))
|
|
2641
|
-
commands = [commands];
|
|
2642
|
-
commands.forEach(function(command) {
|
|
2643
|
-
if (typeof command != "string")
|
|
2644
|
-
command = command.name;
|
|
2645
|
-
var needle = excludeCommands.find(function(el) {
|
|
2646
|
-
return el === command;
|
|
2647
|
-
});
|
|
2648
|
-
if (!needle) {
|
|
2649
|
-
if (commandMap[command]) {
|
|
2650
|
-
commandMap[command].key += "|" + key;
|
|
2651
|
-
} else {
|
|
2652
|
-
commandMap[command] = {key: key, command: command, description: description};
|
|
2653
|
-
commandsByName.push(commandMap[command]);
|
|
2654
|
-
}
|
|
2655
|
-
}
|
|
2656
|
-
});
|
|
2657
|
-
}
|
|
2658
|
-
});
|
|
2659
|
-
return commandsByName;
|
|
2660
|
-
}
|
|
2661
|
-
var excludeCommandsList = ["insertstring", "inserttext", "setIndentation", "paste"];
|
|
2662
|
-
var shortcutsArray = getEditorCommandsByName(excludeCommandsList);
|
|
2663
|
-
shortcutsArray = shortcutsArray.map(function(item) {
|
|
2664
|
-
return {value: item.description, meta: item.key, command: item.command};
|
|
2665
|
-
});
|
|
2666
|
-
prompt(editor, "", {
|
|
2667
|
-
name: "commands",
|
|
2668
|
-
selection: [0, Number.MAX_VALUE],
|
|
2669
|
-
maxHistoryCount: 5,
|
|
2670
|
-
onAccept: function(data) {
|
|
2671
|
-
if (data.item) {
|
|
2672
|
-
var commandName = data.item.command;
|
|
2673
|
-
this.addToHistory(data.item);
|
|
2674
|
-
|
|
2675
|
-
editor.execCommand(commandName);
|
|
2676
|
-
}
|
|
2677
|
-
},
|
|
2678
|
-
addToHistory: function(item) {
|
|
2679
|
-
var history = this.history();
|
|
2680
|
-
history.unshift(item);
|
|
2681
|
-
delete item.message;
|
|
2682
|
-
for (var i = 1; i < history.length; i++) {
|
|
2683
|
-
if (history[i]["command"] == item.command ) {
|
|
2684
|
-
history.splice(i, 1);
|
|
2685
|
-
break;
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
if (this.maxHistoryCount > 0 && history.length > this.maxHistoryCount) {
|
|
2689
|
-
history.splice(history.length - 1, 1);
|
|
2690
|
-
}
|
|
2691
|
-
prompt.commands.history = history;
|
|
2692
|
-
},
|
|
2693
|
-
history: function() {
|
|
2694
|
-
return prompt.commands.history || [];
|
|
2695
|
-
},
|
|
2696
|
-
getPrefix: function(cmdLine) {
|
|
2697
|
-
var currentPos = cmdLine.getCursorPosition();
|
|
2698
|
-
var filterValue = cmdLine.getValue();
|
|
2699
|
-
return filterValue.substring(0, currentPos.column);
|
|
2700
|
-
},
|
|
2701
|
-
getCompletions: function(cmdLine) {
|
|
2702
|
-
function getFilteredCompletions(commands, prefix) {
|
|
2703
|
-
var resultCommands = JSON.parse(JSON.stringify(commands));
|
|
2704
|
-
|
|
2705
|
-
var filtered = new FilteredList(resultCommands);
|
|
2706
|
-
return filtered.filterCompletions(resultCommands, prefix);
|
|
2707
|
-
}
|
|
2708
|
-
|
|
2709
|
-
function getUniqueCommandList(commands, usedCommands) {
|
|
2710
|
-
if (!usedCommands || !usedCommands.length) {
|
|
2711
|
-
return commands;
|
|
2712
|
-
}
|
|
2713
|
-
var excludeCommands = [];
|
|
2714
|
-
usedCommands.forEach(function(item) {
|
|
2715
|
-
excludeCommands.push(item.command);
|
|
2716
|
-
});
|
|
2717
|
-
|
|
2718
|
-
var resultCommands = [];
|
|
2719
|
-
|
|
2720
|
-
commands.forEach(function(item) {
|
|
2721
|
-
if (excludeCommands.indexOf(item.command) === -1) {
|
|
2722
|
-
resultCommands.push(item);
|
|
2723
|
-
}
|
|
2724
|
-
});
|
|
2725
|
-
|
|
2726
|
-
return resultCommands;
|
|
2727
|
-
}
|
|
2728
|
-
|
|
2729
|
-
var prefix = this.getPrefix(cmdLine);
|
|
2730
|
-
var recentlyUsedCommands = getFilteredCompletions(this.history(), prefix);
|
|
2731
|
-
var otherCommands = getUniqueCommandList(shortcutsArray, recentlyUsedCommands);
|
|
2732
|
-
otherCommands = getFilteredCompletions(otherCommands, prefix);
|
|
2733
|
-
|
|
2734
|
-
if (recentlyUsedCommands.length && otherCommands.length) {
|
|
2735
|
-
recentlyUsedCommands[0]["message"] = " Recently used";
|
|
2736
|
-
otherCommands[0]["message"] = " Other commands";
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
|
-
var completions = recentlyUsedCommands.concat(otherCommands);
|
|
2740
|
-
return completions.length > 0 ? completions : [{
|
|
2741
|
-
value: "No matching commands",
|
|
2742
|
-
error: 1
|
|
2743
|
-
}];
|
|
2744
|
-
}
|
|
2745
|
-
});
|
|
2746
|
-
};
|
|
2747
|
-
|
|
2748
|
-
prompt.modes = function(editor, callback) {
|
|
2749
|
-
var modesArray = modelist.modes;
|
|
2750
|
-
modesArray = modesArray.map(function(item) {
|
|
2751
|
-
return {value: item.caption, mode: item.name};
|
|
2752
|
-
});
|
|
2753
|
-
prompt(editor, "", {
|
|
2754
|
-
name: "modes",
|
|
2755
|
-
selection: [0, Number.MAX_VALUE],
|
|
2756
|
-
onAccept: function(data) {
|
|
2757
|
-
if (data.item) {
|
|
2758
|
-
var modeName = "ace/mode/" + data.item.mode;
|
|
2759
|
-
editor.session.setMode(modeName);
|
|
2760
|
-
}
|
|
2761
|
-
},
|
|
2762
|
-
getPrefix: function(cmdLine) {
|
|
2763
|
-
var currentPos = cmdLine.getCursorPosition();
|
|
2764
|
-
var filterValue = cmdLine.getValue();
|
|
2765
|
-
return filterValue.substring(0, currentPos.column);
|
|
2766
|
-
},
|
|
2767
|
-
getCompletions: function(cmdLine) {
|
|
2768
|
-
function getFilteredCompletions(modes, prefix) {
|
|
2769
|
-
var resultCommands = JSON.parse(JSON.stringify(modes));
|
|
2770
|
-
|
|
2771
|
-
var filtered = new FilteredList(resultCommands);
|
|
2772
|
-
return filtered.filterCompletions(resultCommands, prefix);
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2775
|
-
var prefix = this.getPrefix(cmdLine);
|
|
2776
|
-
var completions = getFilteredCompletions(modesArray, prefix);
|
|
2777
|
-
return completions.length > 0 ? completions : [{
|
|
2778
|
-
"caption": "No mode matching",
|
|
2779
|
-
"value": "No mode matching",
|
|
2780
|
-
"error": 1
|
|
2781
|
-
}];
|
|
2782
|
-
}
|
|
2783
|
-
});
|
|
2784
|
-
};
|
|
2785
|
-
|
|
2786
|
-
dom.importCssString(".ace_prompt_container {\
|
|
2787
|
-
max-width: 600px;\
|
|
2788
|
-
width: 100%;\
|
|
2789
|
-
margin: 20px auto;\
|
|
2790
|
-
padding: 3px;\
|
|
2791
|
-
background: white;\
|
|
2792
|
-
border-radius: 2px;\
|
|
2793
|
-
box-shadow: 0px 2px 3px 0px #555;\
|
|
2794
|
-
}", "promtp.css", false);
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
exports.prompt = prompt;
|
|
2798
|
-
|
|
2799
|
-
}); (function() {
|
|
2800
|
-
ace.require(["ace/ext/prompt"], function(m) {
|
|
2801
|
-
if (typeof module == "object" && typeof exports == "object" && module) {
|
|
2802
|
-
module.exports = m;
|
|
2803
|
-
}
|
|
2804
|
-
});
|
|
2805
|
-
})();
|
|
2806
|
-
|
|
1
|
+
ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],(function(e,t,n){"use strict";var i=e("../../lib/keys");n.exports.getEditorKeybordShortcuts=function(e){i.KEY_MODS;var t=[],n={};return e.keyBinding.$handlers.forEach((function(e){var i=e.commandKeyBinding;for(var o in i){var r=o.replace(/(^|-)\w/g,(function(e){return e.toUpperCase()})),s=i[o];Array.isArray(s)||(s=[s]),s.forEach((function(e){"string"!=typeof e&&(e=e.name),n[e]?n[e].key+="|"+r:(n[e]={key:r,command:e},t.push(n[e]))}))}})),t}})),ace.define("ace/autocomplete/popup",["require","exports","module","ace/virtual_renderer","ace/editor","ace/range","ace/lib/event","ace/lib/lang","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../virtual_renderer").VirtualRenderer,o=e("../editor").Editor,r=e("../range").Range,s=e("../lib/event"),a=e("../lib/lang"),c=e("../lib/dom"),l=function(e){var t=new i(e);t.$maxLines=4;var n=new o(t);return n.setHighlightActiveLine(!1),n.setShowPrintMargin(!1),n.renderer.setShowGutter(!1),n.renderer.setHighlightGutterLine(!1),n.$mouseHandler.$focusTimeout=0,n.$highlightTagPending=!0,n};c.importCssString(".ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #CAD6FA; z-index: 1;}.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line { background-color: #3a674e;}.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid #abbffe; margin-top: -1px; background: rgba(233,233,253,0.4); position: absolute; z-index: 2;}.ace_dark.ace_editor.ace_autocomplete .ace_line-hover { border: 1px solid rgba(109, 150, 13, 0.8); background: rgba(58, 103, 78, 0.62);}.ace_completion-meta { opacity: 0.5; margin: 0.9em;}.ace_completion-message { color: blue;}.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #2d69c7;}.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{ color: #93ca12;}.ace_editor.ace_autocomplete { width: 300px; z-index: 200000; border: 1px lightgray solid; position: fixed; box-shadow: 2px 3px 5px rgba(0,0,0,.2); line-height: 1.4; background: #fefefe; color: #111;}.ace_dark.ace_editor.ace_autocomplete { border: 1px #484747 solid; box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51); line-height: 1.4; background: #25282c; color: #c1c1c1;}","autocompletion.css",!1),t.AcePopup=function(e){var t=c.createElement("div"),n=new l(t);e&&e.appendChild(t),t.style.display="none",n.renderer.content.style.cursor="default",n.renderer.setStyle("ace_autocomplete"),n.setOption("displayIndentGuides",!1),n.setOption("dragDelay",150);var i,o=function(){};n.focus=o,n.$isFocused=!0,n.renderer.$cursorLayer.restartTimer=o,n.renderer.$cursorLayer.element.style.opacity=0,n.renderer.$maxLines=8,n.renderer.$keepTextAreaAtCursor=!1,n.setHighlightActiveLine(!1),n.session.highlight(""),n.session.$searchHighlight.clazz="ace_highlight-marker",n.on("mousedown",(function(e){var t=e.getDocumentPosition();n.selection.moveToPosition(t),h.start.row=h.end.row=t.row,e.stop()}));var p=new r(-1,0,-1,1/0),h=new r(-1,0,-1,1/0);h.id=n.session.addMarker(h,"ace_active-line","fullLine"),n.setSelectOnHover=function(e){e?p.id&&(n.session.removeMarker(p.id),p.id=null):p.id=n.session.addMarker(p,"ace_line-hover","fullLine")},n.setSelectOnHover(!1),n.on("mousemove",(function(e){if(i){if(i.x!=e.x||i.y!=e.y){(i=e).scrollTop=n.renderer.scrollTop;var t=i.getDocumentPosition().row;p.start.row!=t&&(p.id||n.setRow(t),d(t))}}else i=e})),n.renderer.on("beforeRender",(function(){if(i&&-1!=p.start.row){i.$pos=null;var e=i.getDocumentPosition().row;p.id||n.setRow(e),d(e,!0)}})),n.renderer.on("afterRender",(function(){var e=n.getRow(),t=n.renderer.$textLayer,i=t.element.childNodes[e-t.config.firstRow];i!==t.selectedNode&&t.selectedNode&&c.removeCssClass(t.selectedNode,"ace_selected"),t.selectedNode=i,i&&c.addCssClass(i,"ace_selected")}));var u=function(){d(-1)},d=function(e,t){e!==p.start.row&&(p.start.row=p.end.row=e,t||n.session._emit("changeBackMarker"),n._emit("changeHoverMarker"))};n.getHoveredRow=function(){return p.start.row},s.addListener(n.container,"mouseout",u),n.on("hide",u),n.on("changeSelection",u),n.session.doc.getLength=function(){return n.data.length},n.session.doc.getLine=function(e){var t=n.data[e];return"string"==typeof t?t:t&&t.value||""};var g=n.session.bgTokenizer;return g.$tokenizeRow=function(e){var t=n.data[e],i=[];if(!t)return i;"string"==typeof t&&(t={value:t});var o=t.caption||t.value||t.name;function r(e,n){e&&i.push({type:(t.className||"")+(n||""),value:e})}for(var s=o.toLowerCase(),a=(n.filterText||"").toLowerCase(),c=0,l=0,p=0;p<=a.length;p++)if(p!=l&&(t.matchMask&1<<p||p==a.length)){var h=a.slice(l,p);l=p;var u=s.indexOf(h,c);if(-1==u)continue;r(o.slice(c,u),""),c=u+h.length,r(o.slice(u,c),"completion-highlight")}return r(o.slice(c,o.length),""),t.meta&&i.push({type:"completion-meta",value:t.meta}),t.message&&i.push({type:"completion-message",value:t.message}),i},g.$updateOnChange=o,g.start=o,n.session.$computeWidth=function(){return this.screenWidth=0},n.isOpen=!1,n.isTopdown=!1,n.autoSelect=!0,n.filterText="",n.data=[],n.setData=function(e,t){n.filterText=t||"",n.setValue(a.stringRepeat("\n",e.length),-1),n.data=e||[],n.setRow(0)},n.getData=function(e){return n.data[e]},n.getRow=function(){return h.start.row},n.setRow=function(e){e=Math.max(this.autoSelect?0:-1,Math.min(this.data.length,e)),h.start.row!=e&&(n.selection.clearSelection(),h.start.row=h.end.row=e||0,n.session._emit("changeBackMarker"),n.moveCursorTo(e||0,0),n.isOpen&&n._signal("select"))},n.on("changeSelection",(function(){n.isOpen&&n.setRow(n.selection.lead.row),n.renderer.scrollCursorIntoView()})),n.hide=function(){this.container.style.display="none",this._signal("hide"),n.isOpen=!1},n.show=function(e,t,o){var r=this.container,s=window.innerHeight,a=window.innerWidth,c=this.renderer,l=c.$maxLines*t*1.4,p=e.top+this.$borderSize;p>s/2&&!o&&p+t+l>s?(c.$maxPixelHeight=p-2*this.$borderSize,r.style.top="",r.style.bottom=s-p+"px",n.isTopdown=!1):(p+=t,c.$maxPixelHeight=s-p-.2*t,r.style.top=p+"px",r.style.bottom="",n.isTopdown=!0),r.style.display="";var h=e.left;h+r.offsetWidth>a&&(h=a-r.offsetWidth),r.style.left=h+"px",this._signal("show"),i=null,n.isOpen=!0},n.goTo=function(e){var t=this.getRow(),n=this.session.getLength()-1;switch(e){case"up":t=t<=0?n:t-1;break;case"down":t=t>=n?-1:t+1;break;case"start":t=0;break;case"end":t=n}this.setRow(t)},n.getTextLeftOffset=function(){return this.$borderSize+this.renderer.$padding+this.$imageSize},n.$imageSize=0,n.$borderSize=1,n},t.$singleLineEditor=l})),ace.define("ace/autocomplete/util",["require","exports","module"],(function(e,t,n){"use strict";t.parForEach=function(e,t,n){var i=0,o=e.length;0===o&&n();for(var r=0;r<o;r++)t(e[r],(function(e,t){++i===o&&n(e,t)}))};var i=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;t.retrievePrecedingIdentifier=function(e,t,n){n=n||i;for(var o=[],r=t-1;r>=0&&n.test(e[r]);r--)o.push(e[r]);return o.reverse().join("")},t.retrieveFollowingIdentifier=function(e,t,n){n=n||i;for(var o=[],r=t;r<e.length&&n.test(e[r]);r++)o.push(e[r]);return o},t.getCompletionPrefix=function(e){var t,n=e.getCursorPosition(),i=e.session.getLine(n.row);return e.completers.forEach(function(e){e.identifierRegexps&&e.identifierRegexps.forEach(function(e){!t&&e&&(t=this.retrievePrecedingIdentifier(i,n.column,e))}.bind(this))}.bind(this)),t||this.retrievePrecedingIdentifier(i,n.column)}})),ace.define("ace/snippets",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/range_list","ace/keyboard/hash_handler","ace/tokenizer","ace/clipboard","ace/editor"],(function(e,t,n){"use strict";var i=e("./lib/dom"),o=e("./lib/oop"),r=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),a=e("./range").Range,c=e("./range_list").RangeList,l=e("./keyboard/hash_handler").HashHandler,p=e("./tokenizer").Tokenizer,h=e("./clipboard"),u={CURRENT_WORD:function(e){return e.session.getTextRange(e.session.getWordRange())},SELECTION:function(e,t,n){var i=e.session.getTextRange();return n?i.replace(/\n\r?([ \t]*\S)/g,"\n"+n+"$1"):i},CURRENT_LINE:function(e){return e.session.getLine(e.getCursorPosition().row)},PREV_LINE:function(e){return e.session.getLine(e.getCursorPosition().row-1)},LINE_INDEX:function(e){return e.getCursorPosition().row},LINE_NUMBER:function(e){return e.getCursorPosition().row+1},SOFT_TABS:function(e){return e.session.getUseSoftTabs()?"YES":"NO"},TAB_SIZE:function(e){return e.session.getTabSize()},CLIPBOARD:function(e){return h.getText&&h.getText()},FILENAME:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0]},FILENAME_BASE:function(e){return/[^/\\]*$/.exec(this.FILEPATH(e))[0].replace(/\.[^.]*$/,"")},DIRECTORY:function(e){return this.FILEPATH(e).replace(/[^/\\]*$/,"")},FILEPATH:function(e){return"/not implemented.txt"},WORKSPACE_NAME:function(){return"Unknown"},FULLNAME:function(){return"Unknown"},BLOCK_COMMENT_START:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.start||""},BLOCK_COMMENT_END:function(e){var t=e.session.$mode||{};return t.blockComment&&t.blockComment.end||""},LINE_COMMENT:function(e){return(e.session.$mode||{}).lineCommentStart||""},CURRENT_YEAR:d.bind(null,{year:"numeric"}),CURRENT_YEAR_SHORT:d.bind(null,{year:"2-digit"}),CURRENT_MONTH:d.bind(null,{month:"numeric"}),CURRENT_MONTH_NAME:d.bind(null,{month:"long"}),CURRENT_MONTH_NAME_SHORT:d.bind(null,{month:"short"}),CURRENT_DATE:d.bind(null,{day:"2-digit"}),CURRENT_DAY_NAME:d.bind(null,{weekday:"long"}),CURRENT_DAY_NAME_SHORT:d.bind(null,{weekday:"short"}),CURRENT_HOUR:d.bind(null,{hour:"2-digit",hour12:!1}),CURRENT_MINUTE:d.bind(null,{minute:"2-digit"}),CURRENT_SECOND:d.bind(null,{second:"2-digit"})};function d(e){var t=(new Date).toLocaleString("en-us",e);return 1==t.length?"0"+t:t}u.SELECTED_TEXT=u.SELECTION;var g=function(){this.snippetMap={},this.snippetNameMap={}};(function(){o.implement(this,r),this.getTokenizer=function(){return g.$tokenizer||this.createTokenizer()},this.createTokenizer=function(){function e(e){return e=e.substr(1),/^\d+$/.test(e)?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}var n={regex:"/("+t("/")+"+)/",onMatch:function(e,t,n){var i=n[0];return i.fmtString=!0,i.guard=e.slice(1,-1),i.flag="",""},next:"formatString"};return g.$tokenizer=new p({start:[{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return("}"==i&&n.length||-1!="`$\\".indexOf(i))&&(e=i),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,i){var o=e(t.substr(1));return i.unshift(o[0]),o},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){var i=e.slice(1,-1).replace(/\\[,|\\]|,/g,(function(e){return 2==e.length?e[1]:"\0"})).split("\0").map((function(e){return{value:e}}));return n[0].choices=i,[i[0]]},next:"start"},n,{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectElse?(n[0].expectElse=!1,n[0].ifEnd={elseEnd:n[0]},[n[0].ifEnd]):":"}},{regex:/\\./,onMatch:function(e,t,n){var i=e[1];return"}"==i&&n.length||-1!="`$\\".indexOf(i)?e=i:"n"==i?e="\n":"t"==i?e="\t":-1!="ulULE".indexOf(i)&&(e={changeCase:i,local:i>"a"}),[e]}},{regex:"/\\w*}",onMatch:function(e,t,n){var i=n.shift();return i&&(i.flag=e.slice(1,-1)),this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"},{regex:/\$(?:\d+|\w+)/,onMatch:function(e,t,n){return[{text:e.slice(1)}]}},{regex:/\${\w+/,onMatch:function(e,t,n){var i={text:e.slice(2)};return n.unshift(i),[i]},next:"formatStringVar"},{regex:/\n/,token:"newline",merge:!1},{regex:/}/,onMatch:function(e,t,n){var i=n.shift();return this.next=i&&i.tabstopId?"start":"",[i||e]},next:"start"}],formatStringVar:[{regex:/:\/\w+}/,onMatch:function(e,t,n){return n[0].formatFunction=e.slice(2,-1),[n.shift()]},next:"formatString"},n,{regex:/:[\?\-+]?/,onMatch:function(e,t,n){"+"==e[1]&&(n[0].ifEnd=n[0]),"?"==e[1]&&(n[0].expectElse=!0)},next:"formatString"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"formatString"}]})},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map((function(e){return e.value||e}))},this.getVariableValue=function(e,t,n){if(/^\d+$/.test(t))return(this.variables.__||{})[t]||"";if(/^[A-Z]\d+$/.test(t))return(this.variables[t[0]+"__"]||{})[t.substr(1)]||"";if(t=t.replace(/^TM_/,""),!this.variables.hasOwnProperty(t))return"";var i=this.variables[t];return"function"==typeof i&&(i=this.variables[t](e,t,n)),null==i?"":i},this.variables=u,this.tmStrFormat=function(e,t,n){if(!t.fmt)return e;var i=t.flag||"",o=t.guard;o=new RegExp(o,i.replace(/[^gim]/g,""));var r="string"==typeof t.fmt?this.tokenizeTmSnippet(t.fmt,"formatString"):t.fmt,s=this;return e.replace(o,(function(){var e=s.variables.__;s.variables.__=[].slice.call(arguments);for(var t=s.resolveVariables(r,n),i="E",o=0;o<t.length;o++){var a=t[o];if("object"==typeof a)if(t[o]="",a.changeCase&&a.local){var c=t[o+1];c&&"string"==typeof c&&("u"==a.changeCase?t[o]=c[0].toUpperCase():t[o]=c[0].toLowerCase(),t[o+1]=c.substr(1))}else a.changeCase&&(i=a.changeCase);else"U"==i?t[o]=a.toUpperCase():"L"==i&&(t[o]=a.toLowerCase())}return s.variables.__=e,t.join("")}))},this.tmFormatFunction=function(e,t,n){return"upcase"==t.formatFunction?e.toUpperCase():"downcase"==t.formatFunction?e.toLowerCase():e},this.resolveVariables=function(e,t){for(var n=[],i="",o=!0,r=0;r<e.length;r++){var s=e[r];if("string"!=typeof s){if(s){if(o=!1,s.fmtString){var a=e.indexOf(s,r+1);-1==a&&(a=e.length),s.fmt=e.slice(r+1,a),r=a}if(s.text){var c=this.getVariableValue(t,s.text,i)+"";s.fmtString&&(c=this.tmStrFormat(c,s,t)),s.formatFunction&&(c=this.tmFormatFunction(c,s,t)),c&&!s.ifEnd?(n.push(c),l(s)):!c&&s.ifEnd&&l(s.ifEnd)}else s.elseEnd?l(s.elseEnd):(null!=s.tabstopId||null!=s.changeCase)&&n.push(s)}}else n.push(s),"\n"==s?(o=!0,i=""):o&&(i=/^\t*/.exec(s)[0],o=/\S/.test(s))}function l(t){var n=e.indexOf(t,r+1);-1!=n&&(r=n)}return n},this.insertSnippetForSelection=function(e,t){var n=e.getCursorPosition(),i=e.session.getLine(n.row),o=e.session.getTabString(),r=i.match(/^\s*/)[0];n.column<r.length&&(r=r.slice(0,n.column)),t=t.replace(/\r/g,"");var s=this.tokenizeTmSnippet(t);s=(s=this.resolveVariables(s,e)).map((function(e){return"\n"==e?e+r:"string"==typeof e?e.replace(/\t/g,o):e}));var a=[];s.forEach((function(e,t){if("object"==typeof e){var n=e.tabstopId,i=a[n];if(i||((i=a[n]=[]).index=n,i.value="",i.parents={}),-1===i.indexOf(e)){e.choices&&!i.choices&&(i.choices=e.choices),i.push(e);var o=s.indexOf(e,t+1);if(-1!==o){var r=s.slice(t+1,o);r.some((function(e){return"object"==typeof e}))&&!i.value?i.value=r:!r.length||i.value&&"string"==typeof i.value||(i.value=r.join(""))}}}})),a.forEach((function(e){e.length=0}));var c={};function l(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];if("object"==typeof i){if(c[i.tabstopId])continue;i=t[e.lastIndexOf(i,n-1)]||{tabstopId:i.tabstopId}}t[n]=i}return t}for(var p=0;p<s.length;p++){var h=s[p];if("object"==typeof h){var u=h.tabstopId,d=a[u],g=s.indexOf(h,p+1);if(c[u])c[u]===h&&(delete c[u],Object.keys(c).forEach((function(e){d.parents[e]=!0})));else{c[u]=h;var m=d.value;"string"!=typeof m?m=l(m):h.fmt&&(m=this.tmStrFormat(m,h,e)),s.splice.apply(s,[p+1,Math.max(0,g-p)].concat(m,h)),-1===d.indexOf(h)&&d.push(h)}}}var b=0,v=0,x="";s.forEach((function(e){if("string"==typeof e){var t=e.split("\n");t.length>1?(v=t[t.length-1].length,b+=t.length-1):v+=e.length,x+=e}else e&&(e.start?e.end={row:b,column:v}:e.start={row:b,column:v})}));var y=e.getSelectionRange(),w=e.session.replace(y,x),T=new f(e),k=e.inVirtualSelectionMode&&e.selection.index;T.addTabstops(a,y.start,w,k)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection((function(){n.insertSnippetForSelection(e,t)}),null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";if("html"===(t=t.split("/").pop())||"php"===t){"php"!==t||e.session.$mode.inlinePhp||(t="html");var n=e.getCursorPosition(),i=e.session.getState(n.row);"object"==typeof i&&(i=i[0]),i.substring&&("js-"==i.substring(0,3)?t="javascript":"css-"==i.substring(0,4)?t="css":"php-"==i.substring(0,4)&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],i=this.snippetMap;return i[t]&&i[t].includeScopes&&n.push.apply(n,i[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,i=e.forEachSelection((function(){return n.expandSnippetForSelection(e,t)}),null,{keepOrder:!0});return i&&e.tabstopManager&&e.tabstopManager.tabNext(),i},this.expandSnippetForSelection=function(e,t){var n,i=e.getCursorPosition(),o=e.session.getLine(i.row),r=o.substring(0,i.column),s=o.substr(i.column),a=this.snippetMap;return this.getActiveScopes(e).some((function(e){var t=a[e];return t&&(n=this.findMatchingSnippet(t,r,s)),!!n}),this),!!n&&(t&&t.dryRun||(e.session.doc.removeInLine(i.row,i.column-n.replaceBefore.length,i.column+n.replaceAfter.length),this.variables.M__=n.matchBefore,this.variables.T__=n.matchAfter,this.insertSnippetForSelection(e,n.content),this.variables.M__=this.variables.T__=null),!0)},this.findMatchingSnippet=function(e,t,n){for(var i=e.length;i--;){var o=e[i];if((!o.startRe||o.startRe.test(t))&&((!o.endRe||o.endRe.test(n))&&(o.startRe||o.endRe)))return o.matchBefore=o.startRe?o.startRe.exec(t):[""],o.matchAfter=o.endRe?o.endRe.exec(n):[""],o.replaceBefore=o.triggerRe?o.triggerRe.exec(t)[0]:"",o.replaceAfter=o.endTriggerRe?o.endTriggerRe.exec(n)[0]:"",o}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){var n=this.snippetMap,i=this.snippetNameMap,o=this;function r(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function a(e,t,n){return e=r(e),t=r(t),n?(e=t+e)&&"$"!=e[e.length-1]&&(e+="$"):(e+=t)&&"^"!=e[0]&&(e="^"+e),new RegExp(e)}function c(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],i[t]={});var r=i[t];if(e.name){var c=r[e.name];c&&o.unregister(c),r[e.name]=e}n[t].push(e),e.prefix&&(e.tabTrigger=e.prefix),!e.content&&e.body&&(e.content=Array.isArray(e.body)?e.body.join("\n"):e.body),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger)),(e.trigger||e.guard||e.endTrigger||e.endGuard)&&(e.startRe=a(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger),e.endRe=a(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger))}e||(e=[]),Array.isArray(e)?e.forEach(c):Object.keys(e).forEach((function(t){c(e[t])})),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){var n=this.snippetMap,i=this.snippetNameMap;function o(e){var o=i[e.scope||t];if(o&&o[e.name]){delete o[e.name];var r=n[e.scope||t],s=r&&r.indexOf(e);s>=0&&r.splice(s,1)}}e.content?o(e):Array.isArray(e)&&e.forEach(o)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");for(var t,n=[],i={},o=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm;t=o.exec(e);){if(t[1])try{i=JSON.parse(t[1]),n.push(i)}catch(e){}if(t[4])i.content=t[4].replace(/^\t/gm,""),n.push(i),i={};else{var r=t[2],s=t[3];if("regex"==r){var a=/\/((?:[^\/\\]|\\.)*)|$/g;i.guard=a.exec(s)[1],i.trigger=a.exec(s)[1],i.endTrigger=a.exec(s)[1],i.endGuard=a.exec(s)[1]}else"snippet"==r?(i.tabTrigger=s.match(/^\S*/)[0],i.name||(i.name=s)):r&&(i[r]=s)}}return n},this.getSnippetByName=function(e,t){var n,i=this.snippetNameMap;return this.getActiveScopes(t).some((function(t){var o=i[t];return o&&(n=o[e]),!!n}),this),n}}).call(g.prototype);var f=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){for(var t="r"==e.action[0],n=this.selectedTabstop||{},i=n.parents||{},o=(this.tabstops||[]).slice(),r=0;r<o.length;r++){var s=o[r],a=s==n||i[s.index];if(s.rangeList.$bias=a?0:1,"remove"==e.action&&s!==n){var c=s.parents&&s.parents[n.index],l=s.rangeList.pointIndex(e.start,c);l=l<0?-l-1:l+1;var p=s.rangeList.pointIndex(e.end,c);p=p<0?-p-1:p-1;for(var h=s.rangeList.ranges.slice(l,p),u=0;u<h.length;u++)this.removeRange(h[u])}s.rangeList.$onChange(e)}var d=this.editor.session;this.$inChange||!t||1!=d.getLength()||d.getValue()||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(e&&e.hasLinkedRanges&&e.firstNonLinked){this.$inChange=!0;for(var n=this.editor.session,i=n.getTextRange(e.firstNonLinked),o=0;o<e.length;o++){var r=e[o];if(r.linked){var s=r.original,a=t.snippetManager.tmStrFormat(i,s,this.editor);n.replace(r,a)}}this.$inChange=!1}},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(this.editor){for(var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty(),i=0;i<this.ranges.length;i++)if(!this.ranges[i].linked){var o=this.ranges[i].contains(e.row,e.column),r=n||this.ranges[i].contains(t.row,t.column);if(o&&r)return}this.detach()}},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);(n=Math.min(Math.max(n,1),t))==t&&(n=0),this.selectTabstop(n),0===n&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];if(t&&this.addTabstopMarkers(t),this.index=e,(t=this.tabstops[this.index])&&t.length){this.selectedTabstop=t;var n=t.firstNonLinked||t;if(t.choices&&(n.cursor=n.start),this.editor.inVirtualSelectionMode)this.editor.selection.fromOrientedRange(n);else{var i=this.editor.multiSelect;i.toSingleRange(n);for(var o=0;o<t.length;o++)t.hasLinkedRanges&&t[o].linked||i.addRange(t[o].clone(),!0)}this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler),this.selectedTabstop&&this.selectedTabstop.choices&&this.editor.execCommand("startAutocomplete",{matches:this.selectedTabstop.choices})}},this.addTabstops=function(e,t,n){var i=this.useLink||!this.editor.getOption("enableMultiselect");if(this.$openTabstops||(this.$openTabstops=[]),!e[0]){var o=a.fromPoints(n,n);b(o.start,t),b(o.end,t),e[0]=[o],e[0].index=0}var r=[this.index+1,0],s=this.ranges;e.forEach((function(e,n){for(var o=this.$openTabstops[n]||e,l=0;l<e.length;l++){var p=e[l],h=a.fromPoints(p.start,p.end||p.start);m(h.start,t),m(h.end,t),h.original=p,h.tabstop=o,s.push(h),o!=e?o.unshift(h):o[l]=h,p.fmtString||o.firstNonLinked&&i?(h.linked=!0,o.hasLinkedRanges=!0):o.firstNonLinked||(o.firstNonLinked=h)}o.firstNonLinked||(o.hasLinkedRanges=!1),o===e&&(r.push(o),this.$openTabstops[n]=o),this.addTabstopMarkers(o),o.rangeList=o.rangeList||new c,o.rangeList.$bias=0,o.rangeList.addList(o)}),this),r.length>2&&(this.tabstops.length&&r.push(r.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,r))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))}))},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach((function(e){t.removeMarker(e.markerId),e.markerId=null}))},this.removeRange=function(e){var t=e.tabstop.indexOf(e);-1!=t&&e.tabstop.splice(t,1),-1!=(t=this.ranges.indexOf(e))&&this.ranges.splice(t,1),-1!=(t=e.tabstop.rangeList.ranges.indexOf(e))&&e.tabstop.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(-1!=(t=this.tabstops.indexOf(e.tabstop))&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new l,this.keyboardHandler.bindKeys({Tab:function(e){t.snippetManager&&t.snippetManager.expandWithTab(e)||(e.tabstopManager.tabNext(1),e.renderer.scrollCursorIntoView())},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1),e.renderer.scrollCursorIntoView()},Esc:function(e){e.tabstopManager.detach()}})}).call(f.prototype);var m=function(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row},b=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};i.importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}","snippets.css",!1),t.snippetManager=new g;var v=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(v.prototype)})),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],(function(e,t,n){"use strict";var i=e("./keyboard/hash_handler").HashHandler,o=e("./autocomplete/popup").AcePopup,r=e("./autocomplete/util"),s=e("./lib/lang"),a=e("./lib/dom"),c=e("./snippets").snippetManager,l=e("./config"),p=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new i,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=s.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=s.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new o(document.body||document.documentElement),this.popup.on("click",function(e){this.insertMatch(),e.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(e,t,n){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),e.keyBinding.addKeyboardHandler(this.keyboardHandler);var i=e.renderer;if(this.popup.setRow(this.autoSelect?0:-1),n)n&&!t&&this.detach();else{this.popup.setTheme(e.getTheme()),this.popup.setFontSize(e.getFontSize());var o=i.layerConfig.lineHeight,r=i.$cursorLayer.getPixelPosition(this.base,!0);r.left-=this.popup.getTextLeftOffset();var s=e.container.getBoundingClientRect();r.top+=s.top-i.layerConfig.offset,r.left+=s.left-e.renderer.scrollLeft,r.left+=i.gutterWidth,this.popup.show(r,o)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(e){var t=this.editor.selection.lead;(t.row!=this.base.row||t.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(e){var t=document.activeElement,n=this.editor.textInput.getElement(),i=e.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(e.relatedTarget),o=this.popup&&this.popup.container;t==n||t.parentNode==o||i||t==this.tooltipNode||e.relatedTarget==n||this.detach()},this.mousedownListener=function(e){this.detach()},this.mousewheelListener=function(e){this.detach()},this.goTo=function(e){this.popup.goTo(e)},this.insertMatch=function(e,t){if(e||(e=this.popup.getData(this.popup.getRow())),!e)return!1;var n=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),e.completer&&e.completer.insertMatch)e.completer.insertMatch(this.editor,e);else{if(n.filterText)for(var i,o=this.editor.selection.getAllRanges(),r=0;i=o[r];r++)i.start.column-=n.filterText.length,this.editor.session.remove(i);e.snippet?c.insertSnippet(this.editor,e.snippet):this.editor.execCommand("insertstring",e.value||e)}this.completions==n&&this.detach(),this.editor.endOperation()},this.commands={Up:function(e){e.completer.goTo("up")},Down:function(e){e.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(e){e.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(e){e.completer.goTo("end")},Esc:function(e){e.completer.detach()},Return:function(e){return e.completer.insertMatch()},"Shift-Return":function(e){e.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(e){var t=e.completer.insertMatch();if(t||e.tabstopManager)return t;e.completer.goTo("down")},PageUp:function(e){e.completer.popup.gotoPageUp()},PageDown:function(e){e.completer.popup.gotoPageDown()}},this.gatherCompletions=function(e,t){var n=e.getSession(),i=e.getCursorPosition(),o=r.getCompletionPrefix(e);this.base=n.doc.createAnchor(i.row,i.column-o.length),this.base.$insertRight=!0;var s=[],a=e.completers.length;return e.completers.forEach((function(c,l){c.getCompletions(e,n,i,o,(function(n,i){!n&&i&&(s=s.concat(i)),t(null,{prefix:r.getCompletionPrefix(e),matches:s,finished:0==--a})}))})),!0},this.showPopup=function(e,t){this.editor&&this.detach(),this.activated=!0,this.editor=e,e.completer!=this&&(e.completer&&e.completer.detach(),e.completer=this),e.on("changeSelection",this.changeListener),e.on("blur",this.blurListener),e.on("mousedown",this.mousedownListener),e.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,t)},this.updateCompletions=function(e,t){if(e&&this.base&&this.completions){var n=this.editor.getCursorPosition(),i=this.editor.session.getTextRange({start:this.base,end:n});if(i==this.completions.filterText)return;return this.completions.setFilter(i),this.completions.filtered.length?1!=this.completions.filtered.length||this.completions.filtered[0].value!=i||this.completions.filtered[0].snippet?void this.openPopup(this.editor,i,e):this.detach():this.detach()}if(t&&t.matches){n=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(n.row,n.column),this.base.$insertRight=!0,this.completions=new h(t.matches),this.openPopup(this.editor,"",e)}var o=this.gatherCompletionsId,r=function(e){if(e.finished)return this.detach()}.bind(this),s=function(t){var n=t.prefix,i=t.matches;this.completions=new h(i),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(n);var o=this.completions.filtered;return o.length&&(1!=o.length||o[0].value!=n||o[0].snippet)?this.autoInsert&&1==o.length&&t.finished?this.insertMatch(o[0]):void this.openPopup(this.editor,n,e):r(t)}.bind(this),a=!0,c=null;if(this.gatherCompletions(this.editor,function(e,t){var n=t.prefix,i=t&&t.matches;if(!i||!i.length)return r(t);0===n.indexOf(t.prefix)&&o==this.gatherCompletionsId&&(a?c=t:s(t))}.bind(this)),a=!1,c){var l=c;c=null,s(l)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var e=this.popup,t=e.data,n=t&&(t[e.getHoveredRow()]||t[e.getRow()]),i=null;return n&&this.editor&&this.popup.isOpen?(this.editor.completers.some((function(e){return e.getDocTooltip&&(i=e.getDocTooltip(n)),i})),i||"string"==typeof n||(i=n),"string"==typeof i&&(i={docText:i}),i&&(i.docHTML||i.docText)?void this.showDocTooltip(i):this.hideDocTooltip()):this.hideDocTooltip()},this.showDocTooltip=function(e){this.tooltipNode||(this.tooltipNode=a.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var t=this.tooltipNode;e.docHTML?t.innerHTML=e.docHTML:e.docText&&(t.textContent=e.docText),t.parentNode||document.body.appendChild(t);var n=this.popup,i=n.container.getBoundingClientRect();t.style.top=n.container.style.top,t.style.bottom=n.container.style.bottom,t.style.display="block",window.innerWidth-i.right<320?i.left<320?n.isTopdown?(t.style.top=i.bottom+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.top=n.container.offsetTop-t.offsetHeight+"px",t.style.left=i.left+"px",t.style.right="",t.style.bottom=""):(t.style.right=window.innerWidth-i.left+"px",t.style.left=""):(t.style.left=i.right+1+"px",t.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),this.tooltipNode){var e=this.tooltipNode;this.editor.isFocused()||document.activeElement!=e||this.editor.focus(),this.tooltipNode=null,e.parentNode&&e.parentNode.removeChild(e)}},this.onTooltipClick=function(e){for(var t=e.target;t&&t!=this.tooltipNode;){if("A"==t.nodeName&&t.href){t.rel="noreferrer",t.target="_blank";break}t=t.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var e=this.popup.container;e&&e.parentNode&&e.parentNode.removeChild(e)}this.editor&&this.editor.completer==this&&this.editor.completer,this.popup=null}}).call(p.prototype),p.for=function(e){return e.completer||(l.get("sharedPopups")?(p.$shared||(p.$sharedInstance=new p),e.completer=p.$sharedInstance):(e.completer=new p,e.once("destroy",(function(e,t){t.completer.destroy()})))),e.completer},p.startCommand={name:"startAutocomplete",exec:function(e,t){var n=p.for(e);n.autoInsert=!1,n.autoSelect=!0,n.showPopup(e,t),n.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var h=function(e,t){this.all=e,this.filtered=e,this.filterText=t||"",this.exactMatch=!1};(function(){this.setFilter=function(e){if(e.length>this.filterText&&0===e.lastIndexOf(this.filterText,0))var t=this.filtered;else t=this.all;this.filterText=e,t=(t=this.filterCompletions(t,this.filterText)).sort((function(e,t){return t.exactMatch-e.exactMatch||t.$score-e.$score||(e.caption||e.value).localeCompare(t.caption||t.value)}));var n=null;t=t.filter((function(e){var t=e.snippet||e.caption||e.value;return t!==n&&(n=t,!0)})),this.filtered=t},this.filterCompletions=function(e,t){var n=[],i=t.toUpperCase(),o=t.toLowerCase();e:for(var r,s=0;r=e[s];s++){var a=r.caption||r.value||r.snippet;if(a){var c,l,p=-1,h=0,u=0;if(this.exactMatch){if(t!==a.substr(0,t.length))continue e}else{var d=a.toLowerCase().indexOf(o);if(d>-1)u=d;else for(var g=0;g<t.length;g++){var f=a.indexOf(o[g],p+1),m=a.indexOf(i[g],p+1);if((c=f>=0&&(m<0||f<m)?f:m)<0)continue e;(l=c-p-1)>0&&(-1===p&&(u+=10),u+=l,h|=1<<g),p=c}}r.matchMask=h,r.exactMatch=u?0:1,r.$score=(r.score||0)-u,n.push(r)}}return n}}).call(h.prototype),t.Autocomplete=p,t.FilteredList=h})),ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";e("../../lib/dom").importCssString("#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}","settings_menu.css",!1),n.exports.overlayPage=function(e,t,n){var i=document.createElement("div"),o=!1;function r(e){27===e.keyCode&&s()}function s(){i&&(document.removeEventListener("keydown",r),i.parentNode.removeChild(i),e&&e.focus(),i=null,n&&n())}return i.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; "+(e?"background-color: rgba(0, 0, 0, 0.3);":""),i.addEventListener("click",(function(e){o||s()})),document.addEventListener("keydown",r),t.addEventListener("click",(function(e){e.stopPropagation()})),i.appendChild(t),document.body.appendChild(i),e&&e.blur(),{close:s,setIgnoreFocusOut:function(e){o=e,e&&(i.style.pointerEvents="none",t.style.pointerEvents="auto")}}}})),ace.define("ace/ext/modelist",["require","exports","module"],(function(e,t,n){"use strict";var i=[];var o=function(e,t,n){var i;this.name=e,this.caption=t,this.mode="ace/mode/"+e,this.extensions=n,i=/\^/.test(n)?n.replace(/\|(\^)?/g,(function(e,t){return"$|"+(t?"^":"^.*\\.")}))+"$":"^.*\\.("+n+")$",this.extRe=new RegExp(i,"gi")};o.prototype.supportsFile=function(e){return e.match(this.extRe)};var r={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl|asl.json"],Assembly_x86:["asm|a"],AutoHotKey:["ahk"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],Curly:["curly"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|vue|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],Latte:["latte"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIPS:["s|asm"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Raku:["raku|rakumod|rakutest|p6|pl6|pm6"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],Scrypt:["scrypt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],Smithy:["smithy"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSX:["tsx"],Twig:["twig|swig"],Typescript:["ts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Django:["html"]},s={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},a={};for(var c in r){var l=r[c],p=(s[c]||c).replace(/_/g," "),h=c.toLowerCase(),u=new o(h,p,l[0]);a[h]=u,i.push(u)}n.exports={getModeForPath:function(e){for(var t=a.text,n=e.split(/[\/\\]/).pop(),o=0;o<i.length;o++)if(i[o].supportsFile(n)){t=i[o];break}return t},modes:i,modesByName:a}})),ace.define("ace/ext/prompt",["require","exports","module","ace/range","ace/lib/dom","ace/ext/menu_tools/get_editor_keyboard_shortcuts","ace/autocomplete","ace/autocomplete/popup","ace/autocomplete/popup","ace/undomanager","ace/tokenizer","ace/ext/menu_tools/overlay_page","ace/ext/modelist"],(function(e,t,n){"use strict";var i,o=e("../range").Range,r=e("../lib/dom"),s=(e("../ext/menu_tools/get_editor_keyboard_shortcuts"),e("../autocomplete").FilteredList),a=e("../autocomplete/popup").AcePopup,c=e("../autocomplete/popup").$singleLineEditor,l=e("../undomanager").UndoManager,p=e("../tokenizer").Tokenizer,h=e("./menu_tools/overlay_page").overlayPage,u=e("./modelist");function d(e,t,n,o){if("object"==typeof t)return d(e,"",t,n);if(i){var s=i;if(e=s.editor,s.close(),s.name&&s.name==n.name)return}if(n.$type)return d[n.$type](e,o);var u=c();u.session.setUndoManager(new l);var g=r.buildDom(["div",{class:"ace_prompt_container"+(n.hasDescription?" input-box-with-description":"")}]),f=h(e,g,w);if(g.appendChild(u.container),e&&(e.cmdLine=u,u.setOption("fontSize",e.getOption("fontSize"))),t&&u.setValue(t,1),n.selection&&u.selection.setRange({start:u.session.doc.indexToPosition(n.selection[0]),end:u.session.doc.indexToPosition(n.selection[1])}),n.getCompletions){var m=new a;m.renderer.setStyle("ace_autocomplete_inline"),m.container.style.display="block",m.container.style.maxWidth="600px",m.container.style.width="100%",m.container.style.marginTop="3px",m.renderer.setScrollMargin(2,2,0,0),m.autoSelect=!1,m.renderer.$maxLines=15,m.setRow(-1),m.on("click",(function(e){var t=m.getData(m.getRow());t.error||(u.setValue(t.value||t.name||t),x(),e.stop())})),g.appendChild(m.container),T()}if(n.$rules){var b=new p(n.$rules);u.session.bgTokenizer.setTokenizer(b)}if(n.placeholder&&u.setOption("placeholder",n.placeholder),n.hasDescription){var v=r.buildDom(["div",{class:"ace_prompt_text_container"}]);r.buildDom(n.prompt||"Press 'Enter' to confirm or 'Escape' to cancel",v),g.appendChild(v)}function x(){var e;e=m&&m.getCursorPosition().row>0?k():u.getValue();var t=m?m.getData(m.getRow()):e;t&&!t.error&&(w(),n.onAccept&&n.onAccept({value:e,item:t},u))}f.setIgnoreFocusOut(n.ignoreFocusOut);var y={Enter:x,"Esc|Shift-Esc":function(){n.onCancel&&n.onCancel(u.getValue(),u),w()}};function w(){f.close(),o&&o(),i=null}function T(){if(n.getCompletions){var e;n.getPrefix&&(e=n.getPrefix(u));var t=n.getCompletions(u);m.setData(t,e),m.resize(!0)}}function k(){var e=m.getData(m.getRow());if(e&&!e.error)return e.value||e.caption||e}m&&Object.assign(y,{Up:function(e){m.goTo("up"),k()},Down:function(e){m.goTo("down"),k()},"Ctrl-Up|Ctrl-Home":function(e){m.goTo("start"),k()},"Ctrl-Down|Ctrl-End":function(e){m.goTo("end"),k()},Tab:function(e){m.goTo("down"),k()},PageUp:function(e){m.gotoPageUp(),k()},PageDown:function(e){m.gotoPageDown(),k()}}),u.commands.bindKeys(y),u.on("input",(function(){n.onInput&&n.onInput(),T()})),u.resize(!0),m&&m.resize(!0),u.focus(),i={close:w,name:n.name,editor:e}}d.gotoLine=function(e,t){var n;d(e,":"+(n=e.selection.toJSON(),Array.isArray(n)||(n=[n]),n.map((function(e){var t=e.isBackwards?e.start:e.end,n=e.isBackwards?e.end:e.start,i=n.row+1+":"+n.column;return n.row==t.row?n.column!=t.column&&(i+=">:"+t.column):i+=">"+(t.row+1)+":"+t.column,i})).reverse().join(", ")),{name:"gotoLine",selection:[1,Number.MAX_VALUE],onAccept:function(t){var n=t.value,i=d.gotoLine._history;i||(d.gotoLine._history=i=[]),-1!=i.indexOf(n)&&i.splice(i.indexOf(n),1),i.unshift(n),i.length>20&&(i.length=20);var r=e.getCursorPosition(),s=[];n.replace(/^:/,"").split(/,/).map((function(t){var n=t.split(/([<>:+-]|c?\d+)|[^c\d<>:+-]+/).filter(Boolean),i=0;function a(){var t=n[i++];if(t){if("c"==t[0]){var o=parseInt(t.slice(1))||0;return e.session.doc.indexToPosition(o)}var s=r.row,a=0;return/\d/.test(t)&&(s=parseInt(t)-1,t=n[i++]),":"==t&&(t=n[i++],/\d/.test(t)&&(a=parseInt(t)||0)),{row:s,column:a}}}r=a();var c=o.fromPoints(r,r);">"==n[i]?(i++,c.end=a()):"<"==n[i]&&(i++,c.start=a()),s.unshift(c)})),e.selection.fromJSON(s);var a=e.renderer.scrollTop;e.renderer.scrollSelectionIntoView(e.selection.anchor,e.selection.cursor,.5),e.renderer.animateScrolling(a)},history:function(){e.session.getUndoManager();return d.gotoLine._history?d.gotoLine._history:[]},getCompletions:function(t){var n=t.getValue(),i=n.replace(/^:/,"").split(":"),o=Math.min(parseInt(i[0])||1,e.session.getLength())-1;return[n+" "+e.session.getLine(o)].concat(this.history())},$rules:{start:[{regex:/\d+/,token:"string"},{regex:/[:,><+\-c]/,token:"keyword"}]}})},d.commands=function(e,t){var n,i,o,r=(n=["insertstring","inserttext","setIndentation","paste"],i=[],o={},e.keyBinding.$handlers.forEach((function(e){var t=e.platform,r=e.byName;for(var s in r){var a=r[s].bindKey;"string"!=typeof a&&(a=a&&a[t]||"");var c=r[s],l=c.description||(c.name||"").replace(/^./,(function(e){return e.toUpperCase(e)})).replace(/[a-z][A-Z]/g,(function(e){return e[0]+" "+e[1].toLowerCase(e)}));Array.isArray(c)||(c=[c]),c.forEach((function(e){"string"!=typeof e&&(e=e.name),n.find((function(t){return t===e}))||(o[e]?o[e].key+="|"+a:(o[e]={key:a,command:e,description:l},i.push(o[e])))}))}})),i);r=r.map((function(e){return{value:e.description,meta:e.key,command:e.command}})),d(e,"",{name:"commands",selection:[0,Number.MAX_VALUE],maxHistoryCount:5,onAccept:function(t){if(t.item){var n=t.item.command;this.addToHistory(t.item),e.execCommand(n)}},addToHistory:function(e){var t=this.history();t.unshift(e),delete e.message;for(var n=1;n<t.length;n++)if(t[n].command==e.command){t.splice(n,1);break}this.maxHistoryCount>0&&t.length>this.maxHistoryCount&&t.splice(t.length-1,1),d.commands.history=t},history:function(){return d.commands.history||[]},getPrefix:function(e){var t=e.getCursorPosition();return e.getValue().substring(0,t.column)},getCompletions:function(e){function t(e,t){var n=JSON.parse(JSON.stringify(e));return new s(n).filterCompletions(n,t)}var n=this.getPrefix(e),i=t(this.history(),n),o=function(e,t){if(!t||!t.length)return e;var n=[];t.forEach((function(e){n.push(e.command)}));var i=[];return e.forEach((function(e){-1===n.indexOf(e.command)&&i.push(e)})),i}(r,i);o=t(o,n),i.length&&o.length&&(i[0].message=" Recently used",o[0].message=" Other commands");var a=i.concat(o);return a.length>0?a:[{value:"No matching commands",error:1}]}})},d.modes=function(e,t){var n=u.modes;n=n.map((function(e){return{value:e.caption,mode:e.name}})),d(e,"",{name:"modes",selection:[0,Number.MAX_VALUE],onAccept:function(t){if(t.item){var n="ace/mode/"+t.item.mode;e.session.setMode(n)}},getPrefix:function(e){var t=e.getCursorPosition();return e.getValue().substring(0,t.column)},getCompletions:function(e){var t=this.getPrefix(e),i=function(e,t){var n=JSON.parse(JSON.stringify(e));return new s(n).filterCompletions(n,t)}(n,t);return i.length>0?i:[{caption:"No mode matching",value:"No mode matching",error:1}]}})},r.importCssString(".ace_prompt_container { max-width: 600px; width: 100%; margin: 20px auto; padding: 3px; background: white; border-radius: 2px; box-shadow: 0px 2px 3px 0px #555;}","promtp.css",!1),t.prompt=d})),ace.require(["ace/ext/prompt"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));
|