git-semver-tagger 2.3.0 → 2.4.0

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.
@@ -0,0 +1,660 @@
1
+ (function (_, kotlin_kotlin, kotlin_mordant_mordant, kotlin_org_jetbrains_markdown) {
2
+ 'use strict';
3
+ //region block: imports
4
+ var protoOf = kotlin_kotlin.$_$.pa;
5
+ var Companion_instance = kotlin_mordant_mordant.$_$.l;
6
+ var listOf = kotlin_kotlin.$_$.q6;
7
+ var Line_init_$Create$ = kotlin_mordant_mordant.$_$.v;
8
+ var VOID = kotlin_kotlin.$_$.c;
9
+ var listOf_0 = kotlin_kotlin.$_$.r6;
10
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.z4;
11
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.z;
12
+ var plus = kotlin_kotlin.$_$.b7;
13
+ var Unit_instance = kotlin_kotlin.$_$.v;
14
+ var Lines = kotlin_mordant_mordant.$_$.a;
15
+ var render$default = kotlin_mordant_mordant.$_$.u;
16
+ var Widget = kotlin_mordant_mordant.$_$.c;
17
+ var initMetadataForClass = kotlin_kotlin.$_$.r9;
18
+ var ensureNotNull = kotlin_kotlin.$_$.nf;
19
+ var MarkdownElementTypes_getInstance = kotlin_org_jetbrains_markdown.$_$.d;
20
+ var equals = kotlin_kotlin.$_$.l9;
21
+ var toString = kotlin_kotlin.$_$.ra;
22
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.w1;
23
+ var Builder_getInstance = kotlin_org_jetbrains_markdown.$_$.c;
24
+ var verticalLayout = kotlin_mordant_mordant.$_$.f;
25
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a2;
26
+ var Companion_getInstance = kotlin_org_jetbrains_markdown.$_$.e;
27
+ var HorizontalRule_init_$Create$ = kotlin_mordant_mordant.$_$.x;
28
+ var table = kotlin_mordant_mordant.$_$.e;
29
+ var GFMElementTypes_getInstance = kotlin_org_jetbrains_markdown.$_$.a;
30
+ var Whitespace_NORMAL_getInstance = kotlin_mordant_mordant.$_$.r;
31
+ var Text_init_$Create$ = kotlin_mordant_mordant.$_$.a1;
32
+ var EmptyWidget_instance = kotlin_mordant_mordant.$_$.m;
33
+ var Whitespace_PRE_WRAP_getInstance = kotlin_mordant_mordant.$_$.s;
34
+ var Panel_init_$Create$ = kotlin_mordant_mordant.$_$.z;
35
+ var get_lastIndex = kotlin_kotlin.$_$.h6;
36
+ var drop = kotlin_kotlin.$_$.p5;
37
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.a1;
38
+ var OrderedList_init_$Create$ = kotlin_mordant_mordant.$_$.y;
39
+ var UnorderedList_init_$Create$ = kotlin_mordant_mordant.$_$.b1;
40
+ var take = kotlin_kotlin.$_$.pd;
41
+ var GFMTokenTypes_getInstance = kotlin_org_jetbrains_markdown.$_$.b;
42
+ var drop_0 = kotlin_kotlin.$_$.fc;
43
+ var firstOrNull = kotlin_kotlin.$_$.t5;
44
+ var TextStyles_reset_getInstance = kotlin_mordant_mordant.$_$.q;
45
+ var last = kotlin_kotlin.$_$.n6;
46
+ var substring = kotlin_kotlin.$_$.od;
47
+ var THROW_CCE = kotlin_kotlin.$_$.xe;
48
+ var isCharSequence = kotlin_kotlin.$_$.ba;
49
+ var trim = kotlin_kotlin.$_$.fe;
50
+ var joinToString = kotlin_kotlin.$_$.d6;
51
+ var horizontalLayout = kotlin_mordant_mordant.$_$.d;
52
+ var TextStyle = kotlin_mordant_mordant.$_$.b;
53
+ var withPadding = kotlin_mordant_mordant.$_$.i;
54
+ var to = kotlin_kotlin.$_$.xf;
55
+ var map = kotlin_kotlin.$_$.vb;
56
+ var isBlank = kotlin_kotlin.$_$.mc;
57
+ var findChildOfType = kotlin_org_jetbrains_markdown.$_$.g;
58
+ var charSequenceLength = kotlin_kotlin.$_$.i9;
59
+ var Companion_getInstance_0 = kotlin_mordant_mordant.$_$.k;
60
+ var checkIndexOverflow = kotlin_kotlin.$_$.y4;
61
+ var removeSurrounding = kotlin_kotlin.$_$.ad;
62
+ var TextAlign_LEFT_getInstance = kotlin_mordant_mordant.$_$.o;
63
+ var TextAlign_RIGHT_getInstance = kotlin_mordant_mordant.$_$.p;
64
+ var TextAlign_CENTER_getInstance = kotlin_mordant_mordant.$_$.n;
65
+ var startsWith = kotlin_kotlin.$_$.id;
66
+ var endsWith = kotlin_kotlin.$_$.gc;
67
+ var Whitespace_PRE_getInstance = kotlin_mordant_mordant.$_$.t;
68
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.n1;
69
+ var replace = kotlin_kotlin.$_$.cd;
70
+ var GFMFlavourDescriptor = kotlin_org_jetbrains_markdown.$_$.h;
71
+ var MarkdownParser_init_$Create$ = kotlin_org_jetbrains_markdown.$_$.f;
72
+ //endregion
73
+ //region block: pre-declaration
74
+ initMetadataForClass(BlockQuote, 'BlockQuote', VOID, VOID, [Widget]);
75
+ initMetadataForClass(Markdown, 'Markdown', VOID, VOID, [Widget]);
76
+ initMetadataForClass(MarkdownRenderer, 'MarkdownRenderer');
77
+ //endregion
78
+ function BlockQuote(content) {
79
+ this.u30_1 = content;
80
+ }
81
+ protoOf(BlockQuote).u23 = function (t, width) {
82
+ return this.u30_1.u23(t, width - 2 | 0).z23(2);
83
+ };
84
+ protoOf(BlockQuote).v23 = function (t, width) {
85
+ var bar = Companion_instance.x1y(t.k1z_1.l23('markdown.blockquote.bar'), t.k1z_1.i23('markdown.blockquote'));
86
+ var justBar = Line_init_$Create$(listOf(bar));
87
+ var paddedBar = listOf_0([bar, Companion_instance.r1y(VOID, t.k1z_1.i23('markdown.blockquote'))]);
88
+ var lines = this.u30_1.v23(t, width).x21(t.k1z_1.i23('markdown.blockquote')).k1y_1;
89
+ // Inline function 'kotlin.collections.map' call
90
+ // Inline function 'kotlin.collections.mapTo' call
91
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(lines, 10));
92
+ var _iterator__ex2g4s = lines.r();
93
+ while (_iterator__ex2g4s.s()) {
94
+ var item = _iterator__ex2g4s.t();
95
+ var tmp$ret$2 = item.p() ? justBar : Line_init_$Create$(plus(paddedBar, item));
96
+ destination.v(tmp$ret$2);
97
+ }
98
+ return new Lines(destination);
99
+ };
100
+ function document($this, t) {
101
+ if ($this.y30_1 == null) {
102
+ var tmp = $this;
103
+ var tmp0_elvis_lhs = $this.x30_1;
104
+ tmp.y30_1 = (new MarkdownRenderer($this.v30_1, t.k1z_1, $this.w30_1, tmp0_elvis_lhs == null ? t.r1z_1.n2a_1 : tmp0_elvis_lhs)).l26();
105
+ }
106
+ return ensureNotNull($this.y30_1);
107
+ }
108
+ function Markdown(markdown, showHtml, hyperlinks) {
109
+ showHtml = showHtml === VOID ? false : showHtml;
110
+ hyperlinks = hyperlinks === VOID ? null : hyperlinks;
111
+ this.v30_1 = markdown;
112
+ this.w30_1 = showHtml;
113
+ this.x30_1 = hyperlinks;
114
+ this.y30_1 = null;
115
+ }
116
+ protoOf(Markdown).u23 = function (t, width) {
117
+ return document(this, t).u23(t, width);
118
+ };
119
+ protoOf(Markdown).v23 = function (t, width) {
120
+ return document(this, t).v23(t, width);
121
+ };
122
+ function parseFile($this, node) {
123
+ // Inline function 'kotlin.require' call
124
+ // Inline function 'kotlin.require' call
125
+ if (!equals(node.w2g(), MarkdownElementTypes_getInstance().u2d_1)) {
126
+ var message = 'Failed requirement.';
127
+ throw IllegalArgumentException_init_$Create$(toString(message));
128
+ }
129
+ if ($this.b31_1)
130
+ $this.h31_1 = Builder_getInstance().v2t(node, $this.g31_1);
131
+ return parseBlocks($this, node.z2g());
132
+ }
133
+ function parseBlocks($this, nodes) {
134
+ return verticalLayout(MarkdownRenderer$parseBlocks$lambda(nodes, $this));
135
+ }
136
+ function parseStructure($this, node) {
137
+ var tmp0_subject = node.w2g();
138
+ var tmp;
139
+ if (equals(tmp0_subject, MarkdownElementTypes_getInstance().v2d_1)) {
140
+ tmp = UnorderedList_init_$Create$(parseListItems($this, node));
141
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().w2d_1)) {
142
+ tmp = OrderedList_init_$Create$(parseListItems($this, node));
143
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().y2d_1)) {
144
+ // Inline function 'kotlin.collections.filter' call
145
+ var tmp0 = drop(node.z2g(), 1);
146
+ // Inline function 'kotlin.collections.filterTo' call
147
+ var destination = ArrayList_init_$Create$_0();
148
+ var _iterator__ex2g4s = tmp0.r();
149
+ while (_iterator__ex2g4s.s()) {
150
+ var element = _iterator__ex2g4s.t();
151
+ if (!equals(element.w2g(), Companion_getInstance().k2g_1)) {
152
+ destination.v(element);
153
+ }
154
+ }
155
+ tmp = new BlockQuote(parseBlocks($this, destination));
156
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().z2d_1)) {
157
+ var tmp0_0 = node.z2g();
158
+ var tmp$ret$3;
159
+ $l$block: {
160
+ // Inline function 'kotlin.collections.indexOfFirst' call
161
+ var index = 0;
162
+ var _iterator__ex2g4s_0 = tmp0_0.r();
163
+ while (_iterator__ex2g4s_0.s()) {
164
+ var item = _iterator__ex2g4s_0.t();
165
+ if (equals(item.w2g(), Companion_getInstance().d2g_1)) {
166
+ tmp$ret$3 = index;
167
+ break $l$block;
168
+ }
169
+ index = index + 1 | 0;
170
+ }
171
+ tmp$ret$3 = -1;
172
+ }
173
+ var start = tmp$ret$3;
174
+ var tmp0_1 = node.z2g();
175
+ var tmp$ret$5;
176
+ $l$block_0: {
177
+ // Inline function 'kotlin.collections.indexOfLast' call
178
+ var iterator = tmp0_1.i1(tmp0_1.d1());
179
+ while (iterator.g4()) {
180
+ var it = iterator.i4();
181
+ if (equals(it.w2g(), Companion_getInstance().d2g_1)) {
182
+ tmp$ret$5 = iterator.h4();
183
+ break $l$block_0;
184
+ }
185
+ }
186
+ tmp$ret$5 = -1;
187
+ }
188
+ var end = tmp$ret$5;
189
+ var dropLast = end < 0 ? 0 : get_lastIndex(node.z2g()) - end | 0;
190
+ var inner = innerInlines($this, node, start, dropLast);
191
+ var content = Text_init_$Create$($this.z30_1.i23('markdown.code.block').z1u(inner), Whitespace_PRE_WRAP_getInstance());
192
+ tmp = $this.z30_1.k23('markdown.code.block.border') ? Panel_init_$Create$(content) : content;
193
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().a2e_1)) {
194
+ var content_0 = Text_init_$Create$($this.z30_1.i23('markdown.code.block').z1u(innerInlines($this, node)), Whitespace_PRE_WRAP_getInstance());
195
+ tmp = $this.z30_1.k23('markdown.code.block.border') ? Panel_init_$Create$(content_0) : content_0;
196
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().c2e_1)) {
197
+ tmp = $this.a31_1 ? Text_init_$Create$(innerInlines($this, node), Whitespace_PRE_WRAP_getInstance()) : Text_init_$Create$('');
198
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().d2e_1)) {
199
+ tmp = Text_init_$Create$(innerInlines($this, node), Whitespace_NORMAL_getInstance());
200
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().g2e_1)) {
201
+ tmp = $this.b31_1 ? EmptyWidget_instance : Text_init_$Create$($this.z30_1.i23('markdown.link.destination').z1u(nodeText($this, node)), Whitespace_NORMAL_getInstance());
202
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().q2e_1)) {
203
+ tmp = setext($this, $this.z30_1.l23('markdown.h1.rule'), $this.z30_1.i23('markdown.h1'), node);
204
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().r2e_1)) {
205
+ tmp = setext($this, $this.z30_1.l23('markdown.h2.rule'), $this.z30_1.i23('markdown.h2'), node);
206
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().s2e_1)) {
207
+ tmp = atxHr($this, $this.z30_1.l23('markdown.h1.rule'), $this.z30_1.i23('markdown.h1'), node);
208
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().t2e_1)) {
209
+ tmp = atxHr($this, $this.z30_1.l23('markdown.h2.rule'), $this.z30_1.i23('markdown.h2'), node);
210
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().u2e_1)) {
211
+ tmp = atxHr($this, $this.z30_1.l23('markdown.h3.rule'), $this.z30_1.i23('markdown.h3'), node);
212
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().v2e_1)) {
213
+ tmp = atxHr($this, $this.z30_1.l23('markdown.h4.rule'), $this.z30_1.i23('markdown.h4'), node);
214
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().w2e_1)) {
215
+ tmp = atxHr($this, $this.z30_1.l23('markdown.h5.rule'), $this.z30_1.i23('markdown.h5'), node);
216
+ } else if (equals(tmp0_subject, MarkdownElementTypes_getInstance().x2e_1)) {
217
+ tmp = atxHr($this, $this.z30_1.l23('markdown.h6.rule'), $this.z30_1.i23('markdown.h6'), node);
218
+ } else if (equals(tmp0_subject, GFMElementTypes_getInstance().q2k_1)) {
219
+ tmp = table(MarkdownRenderer$parseStructure$lambda($this, node));
220
+ } else if (equals(tmp0_subject, Companion_getInstance().z2f_1)) {
221
+ tmp = HorizontalRule_init_$Create$();
222
+ } else if (equals(tmp0_subject, Companion_getInstance().n2f_1)) {
223
+ tmp = $this.d31_1;
224
+ } else if (equals(tmp0_subject, Companion_getInstance().k2g_1)) {
225
+ tmp = $this.d31_1;
226
+ } else {
227
+ // Inline function 'kotlin.error' call
228
+ var message = 'Unexpected token when parsing structure: ' + toString(node);
229
+ throw IllegalStateException_init_$Create$(toString(message));
230
+ }
231
+ return tmp;
232
+ }
233
+ function parseInlines($this, node) {
234
+ var tmp1_subject = node.w2g();
235
+ var tmp;
236
+ if (equals(tmp1_subject, MarkdownElementTypes_getInstance().b2e_1) || equals(tmp1_subject, GFMElementTypes_getInstance().t2k_1)) {
237
+ var tmp_0 = $this.z30_1.i23('markdown.code.span');
238
+ // Inline function 'kotlin.text.trim' call
239
+ var this_0 = substring($this.g31_1, node.z2g().c1(1).x2g(), last(node.z2g()).x2g());
240
+ var tmp$ret$0 = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE()));
241
+ tmp = tmp_0.z1u(tmp$ret$0);
242
+ } else if (equals(tmp1_subject, GFMElementTypes_getInstance().u2k_1)) {
243
+ var tmp_1 = $this.z30_1.i23('markdown.code.block');
244
+ // Inline function 'kotlin.text.trim' call
245
+ var this_1 = substring($this.g31_1, node.z2g().c1(1).x2g(), last(node.z2g()).x2g());
246
+ var tmp$ret$1 = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE()));
247
+ tmp = tmp_1.z1u(tmp$ret$1);
248
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().e2e_1)) {
249
+ tmp = $this.z30_1.i23('markdown.emph').z1u(innerInlines($this, node, 1));
250
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().f2e_1)) {
251
+ tmp = $this.z30_1.i23('markdown.strong').z1u(innerInlines($this, node, 2));
252
+ } else if (equals(tmp1_subject, GFMElementTypes_getInstance().p2k_1)) {
253
+ tmp = $this.z30_1.i23('markdown.stikethrough').z1u(innerInlines($this, node, 2));
254
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().k2e_1)) {
255
+ tmp = $this.z30_1.i23('markdown.link.text').z1u(nodeText($this, node.z2g().c1(1)));
256
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().h2e_1)) {
257
+ tmp = $this.z30_1.i23('markdown.link.destination').z1u(nodeText($this, node));
258
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().i2e_1)) {
259
+ var tmp_2;
260
+ var tmp2_safe_receiver = firstOrNull(node.z2g());
261
+ if (equals(tmp2_safe_receiver == null ? null : tmp2_safe_receiver.w2g(), Companion_getInstance().i2f_1)) {
262
+ tmp_2 = 1;
263
+ } else {
264
+ tmp_2 = 0;
265
+ }
266
+ var drop = tmp_2;
267
+ var text = TextStyles_reset_getInstance().z1u(innerInlines($this, node, drop));
268
+ tmp = $this.z30_1.i23('markdown.link.destination').z1u(text);
269
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().l2e_1)) {
270
+ tmp = renderInlineLink($this, node);
271
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().m2e_1) || equals(tmp1_subject, MarkdownElementTypes_getInstance().n2e_1)) {
272
+ tmp = renderReferenceLink($this, node);
273
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().o2e_1)) {
274
+ tmp = renderImageLink($this, node);
275
+ } else if (equals(tmp1_subject, Companion_getInstance().h2g_1) || (equals(tmp1_subject, GFMTokenTypes_getInstance().x2k_1) || equals(tmp1_subject, Companion_getInstance().g2g_1))) {
276
+ tmp = $this.z30_1.i23('markdown.link.text').z1u(nodeText($this, node));
277
+ } else if (equals(tmp1_subject, MarkdownElementTypes_getInstance().p2e_1)) {
278
+ tmp = innerInlines($this, node, 1);
279
+ } else if (equals(tmp1_subject, Companion_getInstance().i2g_1)) {
280
+ tmp = $this.a31_1 ? nodeText($this, node) : '';
281
+ } else if (equals(tmp1_subject, Companion_getInstance().a2f_1)) {
282
+ tmp = '';
283
+ } else if (equals(tmp1_subject, Companion_getInstance().z2e_1)) {
284
+ tmp = drop_0(nodeText($this, node), 4);
285
+ } else if (equals(tmp1_subject, Companion_getInstance().m2f_1)) {
286
+ tmp = '\x85';
287
+ } else if (equals(tmp1_subject, Companion_getInstance().w2f_1)) {
288
+ tmp = '`';
289
+ } else if (equals(tmp1_subject, Companion_getInstance().j2g_1)) {
290
+ tmp = '\uFFFD';
291
+ } else if (equals(tmp1_subject, Companion_getInstance().v2f_1) || equals(tmp1_subject, Companion_getInstance().d2g_1) || (equals(tmp1_subject, Companion_getInstance().k2f_1) || equals(tmp1_subject, Companion_getInstance().d2f_1)) || (equals(tmp1_subject, Companion_getInstance().u2f_1) || equals(tmp1_subject, Companion_getInstance().l2f_1) || (equals(tmp1_subject, Companion_getInstance().j2f_1) || (equals(tmp1_subject, Companion_getInstance().b2f_1) || equals(tmp1_subject, Companion_getInstance().g2f_1)))) || (equals(tmp1_subject, Companion_getInstance().e2f_1) || equals(tmp1_subject, Companion_getInstance().i2f_1) || (equals(tmp1_subject, Companion_getInstance().h2f_1) || (equals(tmp1_subject, Companion_getInstance().f2f_1) || equals(tmp1_subject, Companion_getInstance().c2f_1))) || (equals(tmp1_subject, Companion_getInstance().y2e_1) || equals(tmp1_subject, Companion_getInstance().y2f_1) || (equals(tmp1_subject, Companion_getInstance().k2g_1) || (equals(tmp1_subject, GFMTokenTypes_getInstance().v2k_1) || equals(tmp1_subject, GFMTokenTypes_getInstance().a2l_1)))))) {
292
+ tmp = nodeText($this, node);
293
+ } else if (equals(tmp1_subject, Companion_getInstance().n2f_1)) {
294
+ tmp = nodeText($this, node);
295
+ } else {
296
+ // Inline function 'kotlin.error' call
297
+ var message = 'Unexpected token when parsing inlines: ' + toString(node) + '; [' + node.w2g().toString() + ":'" + take(nodeText($this, node), 10) + "'}]";
298
+ throw IllegalStateException_init_$Create$(toString(message));
299
+ }
300
+ return tmp;
301
+ }
302
+ function nodeText($this, $receiver, drop) {
303
+ drop = drop === VOID ? 0 : drop;
304
+ return substring($this.g31_1, $receiver.x2g() + drop | 0, $receiver.y2g() - drop | 0);
305
+ }
306
+ function innerInlines($this, node, drop, dropLast) {
307
+ drop = drop === VOID ? 0 : drop;
308
+ dropLast = dropLast === VOID ? drop : dropLast;
309
+ var tmp = node.z2g().i2(drop, node.z2g().d1() - dropLast | 0);
310
+ return joinToString(tmp, '', VOID, VOID, VOID, VOID, MarkdownRenderer$innerInlines$lambda($this));
311
+ }
312
+ function parseListItems($this, node) {
313
+ // Inline function 'kotlin.collections.filter' call
314
+ var tmp0 = node.z2g();
315
+ // Inline function 'kotlin.collections.filterTo' call
316
+ var destination = ArrayList_init_$Create$_0();
317
+ var _iterator__ex2g4s = tmp0.r();
318
+ while (_iterator__ex2g4s.s()) {
319
+ var element = _iterator__ex2g4s.t();
320
+ if (equals(element.w2g(), MarkdownElementTypes_getInstance().x2d_1)) {
321
+ destination.v(element);
322
+ }
323
+ }
324
+ // Inline function 'kotlin.collections.map' call
325
+ // Inline function 'kotlin.collections.mapTo' call
326
+ var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(destination, 10));
327
+ var _iterator__ex2g4s_0 = destination.r();
328
+ while (_iterator__ex2g4s_0.s()) {
329
+ var item = _iterator__ex2g4s_0.t();
330
+ var tmp;
331
+ if (item.z2g().d1() > 1 && equals(item.z2g().c1(1).w2g(), GFMTokenTypes_getInstance().y2k_1)) {
332
+ tmp = horizontalLayout(MarkdownRenderer$parseListItems$lambda($this, item));
333
+ } else {
334
+ tmp = parseBlocks($this, drop(item.z2g(), 1));
335
+ }
336
+ var tmp$ret$5 = tmp;
337
+ destination_0.v(tmp$ret$5);
338
+ }
339
+ return destination_0;
340
+ }
341
+ function atxHr($this, bar, style, node) {
342
+ return node.z2g().d1() <= 1 ? $this.c31_1 : headerHr($this, Text_init_$Create$(style.z1u(atxContent($this, node)), Whitespace_NORMAL_getInstance()), bar, style);
343
+ }
344
+ function atxContent($this, node) {
345
+ var _destruct__k2r9zo = dropWs($this, node.z2g().c1(1).z2g());
346
+ var drop = _destruct__k2r9zo.fa();
347
+ var dropLast = _destruct__k2r9zo.ga();
348
+ return innerInlines($this, node.z2g().c1(1), drop, dropLast);
349
+ }
350
+ function setext($this, bar, style, node) {
351
+ var _destruct__k2r9zo = dropWs($this, node.z2g().c1(0).z2g());
352
+ var drop = _destruct__k2r9zo.fa();
353
+ var dropLast = _destruct__k2r9zo.ga();
354
+ var content = innerInlines($this, node.z2g().c1(0), drop, dropLast);
355
+ return headerHr($this, Text_init_$Create$(style.z1u(content), Whitespace_NORMAL_getInstance()), bar, style);
356
+ }
357
+ function headerHr($this, content, bar, style) {
358
+ var tmp = HorizontalRule_init_$Create$(content, bar, TextStyle(style.a1y(), style.b1y()));
359
+ return withPadding(tmp, VOID, MarkdownRenderer$headerHr$lambda($this));
360
+ }
361
+ function dropWs($this, nodes) {
362
+ var tmp;
363
+ var tmp3_safe_receiver = firstOrNull(nodes);
364
+ if (equals(tmp3_safe_receiver == null ? null : tmp3_safe_receiver.w2g(), Companion_getInstance().k2g_1)) {
365
+ tmp = 1;
366
+ } else {
367
+ tmp = 0;
368
+ }
369
+ var drop = tmp;
370
+ var dropLast = nodes.d1() > 1 && equals(last(nodes).w2g(), Companion_getInstance().k2g_1) ? 1 : 0;
371
+ return to(drop, dropLast);
372
+ }
373
+ function parseTableRow($this, $receiver, node) {
374
+ return $receiver.x28(MarkdownRenderer$parseTableRow$lambda(node, $this));
375
+ }
376
+ function parseTableAlignment($this, node) {
377
+ var headerSeparator = firstChildOfType(node, GFMTokenTypes_getInstance().w2k_1);
378
+ var tmp = $this.e31_1.ic(nodeText($this, headerSeparator));
379
+ return map(tmp, MarkdownRenderer$parseTableAlignment$lambda);
380
+ }
381
+ function renderInlineLink($this, node) {
382
+ var text = TextStyles_reset_getInstance().z1u(ensureNotNull(findLinkText($this, node)));
383
+ var tmp0_elvis_lhs = findLinkDest($this, node);
384
+ var dest = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
385
+ var tmp;
386
+ if ($this.b31_1) {
387
+ // Inline function 'kotlin.text.isNotBlank' call
388
+ tmp = !isBlank(dest);
389
+ } else {
390
+ tmp = false;
391
+ }
392
+ if (tmp) {
393
+ var style = $this.z30_1.i23('markdown.link.text').q1y(TextStyle(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, dest));
394
+ return style.z1u(text);
395
+ }
396
+ var parsedText = $this.z30_1.i23('markdown.link.text').z1u(text);
397
+ var parsedDest = $this.z30_1.i23('markdown.link.destination').z1u('(' + dest + ')');
398
+ return parsedText + parsedDest;
399
+ }
400
+ function renderReferenceLink($this, node) {
401
+ if (!$this.b31_1)
402
+ return innerInlines($this, node);
403
+ var label = ensureNotNull(findLinkLabel($this, node));
404
+ var tmp4_safe_receiver = $this.h31_1;
405
+ var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver.a2u('[' + label + ']');
406
+ var tmp6_safe_receiver = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.x2t_1;
407
+ var hyperlink = tmp6_safe_receiver == null ? null : toString(tmp6_safe_receiver);
408
+ var tmp;
409
+ if (hyperlink == null) {
410
+ tmp = innerInlines($this, node);
411
+ } else {
412
+ var style = $this.z30_1.i23('markdown.link.text').q1y(TextStyle(VOID, VOID, VOID, VOID, VOID, VOID, VOID, VOID, hyperlink));
413
+ var tmp7_safe_receiver = findLinkText($this, node);
414
+ var tmp_0;
415
+ if (tmp7_safe_receiver == null) {
416
+ tmp_0 = null;
417
+ } else {
418
+ // Inline function 'kotlin.let' call
419
+ tmp_0 = TextStyles_reset_getInstance().z1u(tmp7_safe_receiver);
420
+ }
421
+ var link = tmp_0;
422
+ tmp = style.z1u(link == null ? label : link);
423
+ }
424
+ return tmp;
425
+ }
426
+ function renderImageLink($this, node) {
427
+ var tmp0_elvis_lhs = findChildOfType(node, MarkdownElementTypes_getInstance().l2e_1);
428
+ var tmp1_elvis_lhs = tmp0_elvis_lhs == null ? findChildOfType(node, MarkdownElementTypes_getInstance().m2e_1) : tmp0_elvis_lhs;
429
+ var tmp2_elvis_lhs = tmp1_elvis_lhs == null ? findChildOfType(node, MarkdownElementTypes_getInstance().n2e_1) : tmp1_elvis_lhs;
430
+ var tmp;
431
+ if (tmp2_elvis_lhs == null) {
432
+ return '';
433
+ } else {
434
+ tmp = tmp2_elvis_lhs;
435
+ }
436
+ var link = tmp;
437
+ var tmp8_safe_receiver = findLinkText($this, link);
438
+ var tmp_0;
439
+ if (tmp8_safe_receiver == null) {
440
+ tmp_0 = null;
441
+ } else {
442
+ // Inline function 'kotlin.takeUnless' call
443
+ var tmp_1;
444
+ // Inline function 'kotlin.text.isEmpty' call
445
+ if (!(charSequenceLength(tmp8_safe_receiver) === 0)) {
446
+ tmp_1 = tmp8_safe_receiver;
447
+ } else {
448
+ tmp_1 = null;
449
+ }
450
+ tmp_0 = tmp_1;
451
+ }
452
+ var tmp9_safe_receiver = tmp_0;
453
+ var tmp_2;
454
+ if (tmp9_safe_receiver == null) {
455
+ tmp_2 = null;
456
+ } else {
457
+ // Inline function 'kotlin.let' call
458
+ tmp_2 = TextStyles_reset_getInstance().z1u(tmp9_safe_receiver);
459
+ }
460
+ var tmp3_elvis_lhs = tmp_2;
461
+ var tmp_3;
462
+ if (tmp3_elvis_lhs == null) {
463
+ return '';
464
+ } else {
465
+ tmp_3 = tmp3_elvis_lhs;
466
+ }
467
+ var text = tmp_3;
468
+ return '\uD83D\uDDBC\uFE0F ' + $this.z30_1.i23('markdown.img.alt-text').z1u(text);
469
+ }
470
+ function findLinkLabel($this, node) {
471
+ var tmp10_safe_receiver = findChildOfType(node, MarkdownElementTypes_getInstance().h2e_1);
472
+ var tmp11_safe_receiver = tmp10_safe_receiver == null ? null : tmp10_safe_receiver.z2g();
473
+ var tmp12_safe_receiver = tmp11_safe_receiver == null ? null : tmp11_safe_receiver.c1(1);
474
+ return tmp12_safe_receiver == null ? null : nodeText($this, tmp12_safe_receiver);
475
+ }
476
+ function findLinkDest($this, node) {
477
+ var tmp13_safe_receiver = findChildOfType(node, MarkdownElementTypes_getInstance().i2e_1);
478
+ var tmp14_safe_receiver = tmp13_safe_receiver == null ? null : tmp13_safe_receiver.z2g();
479
+ var tmp;
480
+ if (tmp14_safe_receiver == null) {
481
+ tmp = null;
482
+ } else {
483
+ // Inline function 'kotlin.collections.find' call
484
+ var tmp$ret$1;
485
+ $l$block: {
486
+ // Inline function 'kotlin.collections.firstOrNull' call
487
+ var _iterator__ex2g4s = tmp14_safe_receiver.r();
488
+ while (_iterator__ex2g4s.s()) {
489
+ var element = _iterator__ex2g4s.t();
490
+ if (equals(element.w2g(), Companion_getInstance().y2e_1) || equals(element.w2g(), GFMTokenTypes_getInstance().x2k_1)) {
491
+ tmp$ret$1 = element;
492
+ break $l$block;
493
+ }
494
+ }
495
+ tmp$ret$1 = null;
496
+ }
497
+ tmp = tmp$ret$1;
498
+ }
499
+ var tmp15_safe_receiver = tmp;
500
+ return tmp15_safe_receiver == null ? null : nodeText($this, tmp15_safe_receiver);
501
+ }
502
+ function findLinkText($this, node) {
503
+ var tmp16_safe_receiver = findChildOfType(node, MarkdownElementTypes_getInstance().k2e_1);
504
+ var tmp;
505
+ if (tmp16_safe_receiver == null) {
506
+ tmp = null;
507
+ } else {
508
+ // Inline function 'kotlin.let' call
509
+ tmp = innerInlines($this, tmp16_safe_receiver, 1);
510
+ }
511
+ return tmp;
512
+ }
513
+ function MarkdownRenderer$parseBlocks$lambda($nodes, this$0) {
514
+ return function ($this$verticalLayout) {
515
+ var iterator = $nodes.r();
516
+ var index = 0;
517
+ $l$loop_0: while (iterator.s()) {
518
+ var i = index;
519
+ index = index + 1 | 0;
520
+ var node = iterator.t();
521
+ if (equals(node.w2g(), Companion_getInstance().n2f_1) && (1 <= i ? i < get_lastIndex($nodes) : false) && !listOf_0([Companion_getInstance().n2f_1, Companion_getInstance().k2g_1]).u1($nodes.c1(i - 1 | 0).w2g())) {
522
+ continue $l$loop_0;
523
+ }
524
+ if (equals(node.w2g(), Companion_getInstance().k2g_1)) {
525
+ continue $l$loop_0;
526
+ }
527
+ $this$verticalLayout.w26(parseStructure(this$0, node));
528
+ }
529
+ return Unit_instance;
530
+ };
531
+ }
532
+ function MarkdownRenderer$parseStructure$lambda$lambda($align) {
533
+ return function ($this$column) {
534
+ $this$column.h27($align);
535
+ return Unit_instance;
536
+ };
537
+ }
538
+ function MarkdownRenderer$parseStructure$lambda$lambda_0(this$0, $node) {
539
+ return function ($this$header) {
540
+ $this$header.e27(this$0.z30_1.i23('markdown.table.header'));
541
+ parseTableRow(this$0, $this$header, firstChildOfType($node, GFMElementTypes_getInstance().r2k_1));
542
+ return Unit_instance;
543
+ };
544
+ }
545
+ function MarkdownRenderer$parseStructure$lambda$lambda_1(this$0, $node) {
546
+ return function ($this$body) {
547
+ $this$body.e27(this$0.z30_1.i23('markdown.table.body'));
548
+ // Inline function 'kotlin.collections.filter' call
549
+ var tmp0 = $node.z2g();
550
+ // Inline function 'kotlin.collections.filterTo' call
551
+ var destination = ArrayList_init_$Create$_0();
552
+ var _iterator__ex2g4s = tmp0.r();
553
+ while (_iterator__ex2g4s.s()) {
554
+ var element = _iterator__ex2g4s.t();
555
+ if (equals(element.w2g(), GFMElementTypes_getInstance().s2k_1)) {
556
+ destination.v(element);
557
+ }
558
+ }
559
+ // Inline function 'kotlin.collections.forEach' call
560
+ var _iterator__ex2g4s_0 = destination.r();
561
+ while (_iterator__ex2g4s_0.s()) {
562
+ var element_0 = _iterator__ex2g4s_0.t();
563
+ parseTableRow(this$0, $this$body, element_0);
564
+ }
565
+ return Unit_instance;
566
+ };
567
+ }
568
+ function MarkdownRenderer$parseStructure$lambda(this$0, $node) {
569
+ return function ($this$table) {
570
+ $this$table.s28(this$0.z30_1.k23('markdown.table.ascii') ? Companion_getInstance_0().w20_1 : Companion_getInstance_0().q20_1);
571
+ // Inline function 'kotlin.sequences.forEachIndexed' call
572
+ var index = 0;
573
+ var _iterator__ex2g4s = parseTableAlignment(this$0, $node).r();
574
+ while (_iterator__ex2g4s.s()) {
575
+ var item = _iterator__ex2g4s.t();
576
+ var _unary__edvuaz = index;
577
+ index = _unary__edvuaz + 1 | 0;
578
+ var i = checkIndexOverflow(_unary__edvuaz);
579
+ $this$table.t28(i, MarkdownRenderer$parseStructure$lambda$lambda(item));
580
+ }
581
+ $this$table.u28(MarkdownRenderer$parseStructure$lambda$lambda_0(this$0, $node));
582
+ $this$table.v28(MarkdownRenderer$parseStructure$lambda$lambda_1(this$0, $node));
583
+ return Unit_instance;
584
+ };
585
+ }
586
+ function MarkdownRenderer$innerInlines$lambda(this$0) {
587
+ return function (it) {
588
+ return parseInlines(this$0, it);
589
+ };
590
+ }
591
+ function MarkdownRenderer$parseListItems$lambda(this$0, $it) {
592
+ return function ($this$horizontalLayout) {
593
+ var content = removeSurrounding(ensureNotNull(this$0.f31_1.gc(nodeText(this$0, $it.z2g().c1(1)))).m1(), '[', ']');
594
+ var checkboxString = isBlank(content) ? this$0.z30_1.l23('markdown.task.unchecked') : this$0.z30_1.l23('markdown.task.checked');
595
+ $this$horizontalLayout.w26(checkboxString);
596
+ $this$horizontalLayout.w26(parseBlocks(this$0, drop($it.z2g(), 2)));
597
+ return Unit_instance;
598
+ };
599
+ }
600
+ function MarkdownRenderer$headerHr$lambda(this$0) {
601
+ return function ($this$withPadding) {
602
+ $this$withPadding.b2c(this$0.z30_1.m23('markdown.header.padding'));
603
+ return Unit_instance;
604
+ };
605
+ }
606
+ function MarkdownRenderer$parseTableRow$lambda($node, this$0) {
607
+ return function ($this$row) {
608
+ var _iterator__ex2g4s = $node.z2g().r();
609
+ $l$loop: while (_iterator__ex2g4s.s()) {
610
+ var child = _iterator__ex2g4s.t();
611
+ if (!equals(child.w2g(), GFMTokenTypes_getInstance().z2k_1))
612
+ continue $l$loop;
613
+ var _destruct__k2r9zo = dropWs(this$0, child.z2g());
614
+ var drop = _destruct__k2r9zo.fa();
615
+ var dropLast = _destruct__k2r9zo.ga();
616
+ $this$row.l27(Text_init_$Create$(innerInlines(this$0, child, drop, dropLast), Whitespace_NORMAL_getInstance()));
617
+ }
618
+ return Unit_instance;
619
+ };
620
+ }
621
+ function MarkdownRenderer$parseTableAlignment$lambda(it) {
622
+ var tmp;
623
+ if (endsWith(it.m1(), ':')) {
624
+ tmp = startsWith(it.m1(), ':') ? TextAlign_CENTER_getInstance() : TextAlign_RIGHT_getInstance();
625
+ } else {
626
+ tmp = TextAlign_LEFT_getInstance();
627
+ }
628
+ return tmp;
629
+ }
630
+ function MarkdownRenderer(input, theme, showHtml, hyperlinks) {
631
+ this.z30_1 = theme;
632
+ this.a31_1 = showHtml;
633
+ this.b31_1 = hyperlinks;
634
+ this.c31_1 = Text_init_$Create$('\n', Whitespace_PRE_getInstance());
635
+ this.d31_1 = Text_init_$Create$('');
636
+ this.e31_1 = Regex_init_$Create$(':?-+:?');
637
+ this.f31_1 = Regex_init_$Create$('\\[[^\\]]\\]');
638
+ this.g31_1 = replace(input, '\r', '');
639
+ this.h31_1 = null;
640
+ }
641
+ protoOf(MarkdownRenderer).l26 = function () {
642
+ var flavour = new GFMFlavourDescriptor();
643
+ var parsedTree = MarkdownParser_init_$Create$(flavour).c2v(this.g31_1);
644
+ return parseFile(this, parsedTree);
645
+ };
646
+ function firstChildOfType(_this__u8e3s4, type) {
647
+ return ensureNotNull(findChildOfType(_this__u8e3s4, type));
648
+ }
649
+ //region block: post-declaration
650
+ protoOf(BlockQuote).w23 = render$default;
651
+ protoOf(Markdown).w23 = render$default;
652
+ //endregion
653
+ //region block: exports
654
+ _.$_$ = _.$_$ || {};
655
+ _.$_$.a = Markdown;
656
+ //endregion
657
+ return _;
658
+ }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./mordant-mordant.js'), require('./markdown.js')));
659
+
660
+ //# sourceMappingURL=mordant-mordant-markdown.js.map