├── dev ├── assets │ ├── bartek.jpg │ ├── envelop.svg │ ├── linkedin.svg │ ├── github.svg │ └── instagram.svg ├── template.htaccess ├── notes │ ├── assets │ │ └── steel-header.jpg │ ├── index.php │ └── raw │ │ ├── avoid-disaster-book-gates.md │ │ └── steel.md ├── .htaccess ├── src │ ├── main.js │ ├── noteloader.js │ └── marked.js ├── index.html └── css │ ├── notes.css │ └── style.css └── README.md /dev/assets/bartek.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drojdjou/bartekdrozdz/HEAD/dev/assets/bartek.jpg -------------------------------------------------------------------------------- /dev/template.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteBase / 3 | RewriteRule ^notes/([^.]*)$ notes/index.php [L] 4 | -------------------------------------------------------------------------------- /dev/notes/assets/steel-header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/drojdjou/bartekdrozdz/HEAD/dev/notes/assets/steel-header.jpg -------------------------------------------------------------------------------- /dev/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteBase /projects/bartekdrozdz/dev/ 3 | RewriteRule ^notes/([^.]*)$ notes/index.php [L] -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [bartekdrozdz.com](https://bartekdrozdz.com) is a simple website where I gathered a few links to things I work on now and that I worked on in the past. -------------------------------------------------------------------------------- /dev/src/main.js: -------------------------------------------------------------------------------- 1 | let e = document.querySelector("#email"); 2 | 3 | e.addEventListener("click", () => { 4 | let m = "mailto:" + window.atob("YmFydGVrQGV2ZXJ5ZGF5M2QuY29t"); 5 | window.location.href = m; 6 | }); -------------------------------------------------------------------------------- /dev/src/noteloader.js: -------------------------------------------------------------------------------- 1 | const parseMD = () => { 2 | let container = document.querySelector("article"); 3 | 4 | let content = container.innerHTML; 5 | content = content.replace(/CO2/g, "CO₂"); 6 | content = marked.parse(content); 7 | 8 | container.innerHTML = content; 9 | } 10 | 11 | parseMD(); -------------------------------------------------------------------------------- /dev/assets/envelop.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | envelop 4 | 5 | 6 | -------------------------------------------------------------------------------- /dev/assets/linkedin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | linkedin 4 | 5 | 6 | -------------------------------------------------------------------------------- /dev/notes/index.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | <?php echo ucfirst(preg_replace("/[-_]/", " ", $notepath)); ?> 21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
32 |
33 |
34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /dev/assets/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | github 4 | 5 | 6 | -------------------------------------------------------------------------------- /dev/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Bartek Drozdz 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 |
20 |

Hello! My name is Bartek.

21 | 22 |

I'm an interactive designer, startup founder and climate investor. I live in Los Angeles and I was born in Warsaw, Poland.

23 | 24 |
25 | 26 | 43 | 44 | 50 | 51 |
52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /dev/assets/instagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | instagram 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /dev/css/notes.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Merriweather&family=Roboto+Condensed&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Roboto@300:400&&display=swap'); 3 | 4 | * { 5 | box-sizing: border-box; 6 | outline: none; 7 | -webkit-tap-highlight-color: rgba(255, 255, 255, 0); 8 | -webkit-tap-highlight-color: transparent; 9 | scrollbar-width: thin; 10 | } 11 | 12 | body { 13 | background-color: #fff; 14 | color: #000; 15 | font-size: 13pt; 16 | margin: 0; 17 | padding: 1em; 18 | width: 100%; 19 | font-family: "Merriweather", serif; 20 | line-height: 1.66; 21 | } 22 | 23 | main { 24 | width: 100%; 25 | } 26 | 27 | article { 28 | margin-bottom: 2em; 29 | } 30 | 31 | a { 32 | color: inherit; 33 | } 34 | 35 | img { 36 | width: 100%; 37 | height: auto; 38 | display: block; 39 | } 40 | 41 | h1 { 42 | font-family: "Roboto", sans-serif; 43 | font-size: 5em; 44 | margin: 0.5em 0 0 0; 45 | font-weight: 300; 46 | line-height: 1; 47 | } 48 | 49 | h2 { 50 | font-family: "Roboto Condensed", sans-serif; 51 | margin: 0.5em 0 0.5em 0; 52 | font-size: 2em; 53 | line-height: 1; 54 | } 55 | 56 | h3 { 57 | font-family: "Roboto Condensed", sans-serif; 58 | margin: 0.25em 0 0.25em 0; 59 | line-height: 1; 60 | } 61 | 62 | h4, h5, h6 { 63 | font-family: "Roboto", sans-serif; 64 | margin: 0 0 0.5em 0; 65 | font-weight: normal; 66 | line-height: 1.25; 67 | } 68 | 69 | h4 { 70 | font-size: 1em; 71 | font-weight: bold; 72 | } 73 | 74 | h5 { 75 | font-size: 1em; 76 | } 77 | 78 | h6 { 79 | background-color: #eee; 80 | padding: 0.5em; 81 | font-style: italic; 82 | font-size: 12pt; 83 | border-radius: 0.25em; 84 | line-height: 1; 85 | margin: 0.5em 0 0 0; 86 | } 87 | 88 | p, ul, ol { 89 | margin: 1em 0 1em 0; 90 | } 91 | 92 | ul, ol { 93 | padding: 0 0 0 1.25em; 94 | } 95 | 96 | aside { 97 | font-size: 10pt; 98 | } 99 | 100 | @media(min-width: 800px) { 101 | body { 102 | display: flex; 103 | align-items: center; 104 | justify-content: center; 105 | } 106 | 107 | main { 108 | width: 800px; 109 | } 110 | } -------------------------------------------------------------------------------- /dev/notes/raw/avoid-disaster-book-gates.md: -------------------------------------------------------------------------------- 1 | # How To Avoid A Climate Disaster 2 | #### Bill Gates 3 | ##### February 23, 2021 4 | 5 | ###### Notes from the book 6 | 7 | Human activity produces around 52 billion tonnes of greenhouse gases every year. This is how much "CO2 equivalents" are added to the atmosphere. 8 | 9 | We need to get to zero, but not by the way of depriving people around the world from access to energy. The solution should be to make clean energy so cheap that all countries will choose it over fossil fuels. 10 | 11 | During the pandemic in 2020 the emissions only dropped by around 5%. Considering the economic slowdown that it caused, this is suprising how little impact COVID has on emissions. 12 | 13 | The reason for this is that fossil fuels are so prevalent in everything we use and do that we might not eve see it. As an analogy Gates cites a speech from D F Wallace about fish and water. 14 | 15 | Gates gives a few examples: 16 | - toothbroush made of plastic which is made of pertoleum 17 | - cereals grown using feltilizer that releases GHG when produced 18 | - harvested with a tractor that uses an IC engine 19 | - tractor is made of steel that reuires fossil fuels to be produced 20 | - we wear cotton (fertilized, harvested) or polysters (made of etylene, derived from petroleum) 21 | - EVs run on electricity but it may be made from coal or natural gas 22 | - cars a nd even bikes are made of steel and plastic 23 | - houses are made of cement or timber, both require energy and fossil fuels 24 | - last but not least, everything is transported on vehicles mostly powered by IC engines 25 | 26 | The world uses 4 billion gallons of oil per day (100 million barrels, 1 barrel is 42 gallons). There are a few reasons for that, starting with the price - oil is a very cheap source of energy. It is easy to obtain, because there is a big drilling industry that takes care of that. It is also easy to move around since it's a liquid. The price for the damage that comes from burning these fuels is not priced in. 27 | 28 | When it comes to energy usage, it's not just the rich world. Economies of the developing countries (like China, India, Nigeria) are growing and so are their energy needs. Population is also set to increase in those countries, with a predicted total of 10B by the end of the 21st century. It is not moral or pracitical to expect these people to consume less energy. What we need to is to find a way to produce more energry that is also cleaner. 29 | 30 | Historically, energy transitions took a long time. Through most of history, people used the power of their muscles. Fossil fuels did not become dominant source of energy unilt 1890s in the West and the 1960s in China. Typically from their intrduction to mass market it takes several decades. Typically one source replaces another because it is cheaper and/or more efficient. 31 | 32 | In case of renewables, we have different reason to switch - the environmental one - and we need to make sure it happens faster. -------------------------------------------------------------------------------- /dev/css/style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;400;700;900&display=swap'); 2 | @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap'); 3 | 4 | * { 5 | box-sizing: border-box; 6 | outline: none; 7 | -webkit-tap-highlight-color: rgba(255, 255, 255, 0); 8 | -webkit-tap-highlight-color: transparent; 9 | scrollbar-width: thin; 10 | } 11 | 12 | body { 13 | background-color: #fff; 14 | color: #000; 15 | font-family: "Inter", Helvetica, Arial, sans-serif; 16 | font-size: 11pt; 17 | margin: 0; 18 | } 19 | 20 | main { 21 | max-width: 1200px; 22 | } 23 | 24 | .bg-image { 25 | position: fixed; 26 | width: 100%; 27 | height: 50vh; 28 | background-image: url("assets/bartek.jpg"); 29 | background-size: cover; 30 | background-position: center; 31 | } 32 | 33 | .content { 34 | position: relative; 35 | top: 50vh; 36 | padding: 20px; 37 | background-color: #fff; 38 | max-width: 600px; 39 | } 40 | 41 | @media (min-width: 800px) { 42 | .bg-image { 43 | width: 50%; 44 | height: 100%; 45 | } 46 | 47 | .content { 48 | top: 0; 49 | margin-left: 50%; 50 | } 51 | } 52 | 53 | @media (min-width: 1200px) { 54 | .bg-image { 55 | width: 600px; 56 | height: 100%; 57 | } 58 | 59 | .content { 60 | top: 0; 61 | margin-left: 600px; 62 | } 63 | } 64 | 65 | h1, h2, h3, h4, h5, h6, p { 66 | font-weight: 400; 67 | margin: 0; 68 | line-height: 1.4; 69 | } 70 | 71 | p, ul { 72 | font-family: "Roboto", Arial, Helvetica, sans-serif; 73 | margin-bottom: 1em; 74 | line-height: 1.5; 75 | } 76 | 77 | p a { 78 | text-decoration: underline; 79 | } 80 | 81 | p a:hover { 82 | text-decoration: none; 83 | } 84 | 85 | h1 { 86 | margin-bottom: 0.5em; 87 | } 88 | 89 | h1, h2 { 90 | font-size: 2.4em; 91 | font-weight: 200; 92 | } 93 | 94 | h2 { 95 | margin-bottom: 0; 96 | } 97 | 98 | h5 { 99 | opacity: 0.6; 100 | font-style: italic; 101 | } 102 | 103 | ul.links { 104 | display: block; 105 | margin-bottom: 32px; 106 | list-style-type: none; 107 | padding: 0; 108 | } 109 | 110 | ul.links li { 111 | margin-bottom: 16px; 112 | } 113 | 114 | a { 115 | color: inherit; 116 | text-decoration: none; 117 | } 118 | 119 | hr { 120 | border: none; 121 | height: 1px; 122 | background-color: #888; 123 | opacity: 0.4; 124 | margin: 20px 0 0 0; 125 | } 126 | 127 | img.icon { 128 | display: inline-block; 129 | vertical-align: top; 130 | width: 20px; 131 | height: auto; 132 | margin-right: 10px; 133 | filter: invert(); 134 | } 135 | 136 | a:hover, span#email:hover { 137 | cursor: pointer; 138 | color: #239adf; 139 | border-bottom: 1px dotted #239adf; 140 | } 141 | 142 | @media (prefers-color-scheme: dark) { 143 | body { 144 | background-color: #000; 145 | color: #fff; 146 | } 147 | 148 | .content { 149 | background-color: #000; 150 | } 151 | 152 | img.icon { 153 | filter: none; 154 | } 155 | } -------------------------------------------------------------------------------- /dev/notes/raw/steel.md: -------------------------------------------------------------------------------- 1 | # Steel 2 | 3 | ![Steel Production](assets/steel-header.jpg) 4 | 5 | At the very basic level, steel is produced from iron ore metled at temperatures above 1500°C / 2600°F. The final product is composed on ~98% iron and 2% carbon. 6 | 7 | ### Primary steelmaking - Basic Oxygen Furnace (BOF) 8 | 9 | BOF is a method where iron ore, is smetled into **pig iron** that is later transformed into steel. This process occurs when oxygen is blown through the molten iron ore, initiating an **oxidation** process that reduces the carbon content of the alloy (mixture). The intense chemical reactions expel carbon and other impurities, which either escape as gas or form a slag that can be removed, purifying the metal. 10 | 11 | The result is **steel** - an iron-based alloy with a significantly lower carbon content than pig iron, which is both more durable and more versatile for commercial applications. 12 | 13 | BOF is primarely used in large scale production. 14 | 15 | ### Secondary steelmaking - Electric Arc Furnace (EAF) 16 | 17 | EAF is an alternative steelmaking method that primarily utilizes recycled scrap metal as its base material, melting it down using high-voltage electric arcs from graphite electrodes. Unlike methods that rely on iron ore above, the EAF process uses electricity to generate intense heat, melting the scrap and facilitating the production of various steel grades. This approach, crucial for steel recycling, is more energy-efficient and flexible than traditional methods, with its environmental impact heavily influenced by the electricity source. 18 | 19 | EAF is more adaptable to small scale production. 20 | 21 | Regardless of the method used, the resulting steel is then cast into **inglots** (large blocks) or using a process of continous casting producing so called **blooms** (square bar). Those can be later transformed into finished proiduction by the process of **rolling**, that is squeezing the steel by passing it through a gap between rolls. It can also be **forged/hammered** which is the more traditional method. 22 | 23 | ### Types of steel 24 | 25 | - **Carbon steel** - most basic kind of steel where the main alloying element is carbon (0.3% to %1). Used for cars, pipes, springs. 26 | - **Tool steel** - high carbon steel treated for superior hardness. Ideal for making tools. 27 | - **Alloy steel** - steel mixed with specific element, it has high strength & durability, temperature resilience, and resistance to corrosion. Used for example in jet engines. 28 | - **Stainless steel** - alloyed with chromium it is flavorless, easy to clean and rust resistant. Mostyle used for kitchenware & appliances. 29 | 30 | ## History 31 | 32 | Steel production has ancient roots, with the earliest evidence of steel-making found at [Kaman-Kalehöyük](https://en.wikipedia.org/wiki/Kaman-Kaleh%C3%B6y%C3%BCk), Turkey, dating back as far as 1800 BC. 33 | 34 | For centuries, steel was produced using a labor-intensive process called bloomery, where iron ore was heated with charcoal under low oxygen conditions to produce a spongy mass, or 'bloom,' of iron mixed with impurities. The introduction of the blast furnace in the 15th century, which used higher temperatures to produce a greater yield of higher quality iron, marked a significant advancement. 35 | 36 | In 1856, [Henry Bessemer](https://en.wikipedia.org/wiki/Henry_Bessemer) pioneered the concept of air oxidation in steelmaking, but the process had its limitations. In 1940s [Robert Durrer](https://en.wikipedia.org/wiki/Robert_Durrer) and the team at Voestalpine AG improved on it and developed the [LD process](https://en.wikipedia.org/wiki/Basic_oxygen_steelmaking). It is using oxygen instead of air for purer, more controlled steel production. Named after Linz and Donawitz, the first industrial sites of its application, the LD process revolutionized steelmaking, setting the foundation for the modern BOF method. 37 | 38 | EAF was first patented in 1889 by [Paul Héroult](https://en.wikipedia.org/wiki/Paul_H%C3%A9roult). EAFs operate by applying electric arcs to melt scrap steel or direct reduced iron, as opposed to primarily raw materials like in the case of BOF. The EAF method is integral to steel recycling, supporting a more environmentally sustainable model of steel production by significantly reducing CO2 emissions compared to conventional methods. 39 | 40 | ## Production numbers 41 | 42 | The global yearly production is roughly **1.8-1.9 Billion Tons** (1800-1900 Mt). 43 | 44 | About 25-30% is made using EAF, the remaining 70-75% is produced using BOF. The US is the leader in EAF - it accounts for 70% of the steel production vs only 30% BOF. 45 | 46 | Top steel producing countries is China, followed by India, EU, Japan and the US. Largerst producers are, by millions of tonnes produced/year: 47 | 48 | - Baowu Group - China - 131.84 Mt 49 | - ArcelorMittal - Luxemburg - 68.89 Mt 50 | - Ansteel Group - China - 55.65 Mt 51 | - Nippon Steel Corporation - Japan - 44.37 Mt 52 | 53 | Top producer in US, ranked 16th worldwide, has the largest fleet of EAFs in the world: 54 | 55 | - Nucor Corporation - US - 20.60 Mt 56 | 57 | ## Energy usage 58 | 59 | Steel making is an energy intensive process. One ton of steel produced with BOF requires about 20 GJ (GigaJoules) / 5.5 kWh of energy. EAF uses slightly less: 4-7 GJ / 1.1-1.9 kWh. The energy required to produce a ton of steel varies based on the process used, the specific technology at each plant, and the type of steel being produced. The majority of the energy is used for heating processes, but some of it is also used for machinery operations, lighting and transport. 60 | 61 | ## Carbon Emissions 62 | 63 | According to [IEA](https://www.iea.org/energy-system/industry/steel#tracking) the CO2 intensity of steel production is **1.4t of CO2** per 1t of steel. [World Steel Association](https://www.recyclingtoday.com/news/worldsteel-co2-report) put this number slighty higher at **1.85t**. 64 | 65 | There is a significant difference in the processes, with BOF averaging 1.987t of CO2 and EAF only 0.357t, which makes EAF much cleaner. 66 | 67 | The total CO2 emissions of the steel industryare over **3500 Mt** of CO2 emissions account for **8-11%** of global emissions. 68 | 69 | There are multiple steps in steel production that emit CO2. The chemial processes occuring when iron ore is smelted (ironmaking) is responsible for most of the emissions. CO2 is also emitted during the production of to the heat necessary to melt the iron. CO2 can also be emitted when producing the electricity to power the EAFs, if a coal or gas turbine are used. 70 | 71 | ## Ideas for decarbonization 72 | 73 | ... 74 | 75 | ## Case Study 76 | 77 | [Electra](https://www.electra.earth/) - [MCJ Podcast Transcript](https://www.mcjcollective.com/my-climate-journey-podcast/electra) 78 | 79 | --- 80 | 81 | -------------------------------------------------------------------------------- /dev/src/marked.js: -------------------------------------------------------------------------------- 1 | /** 2 | * marked v9.1.2 - a markdown parser 3 | * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed) 4 | * https://github.com/markedjs/marked 5 | * 6 | * Downloaded from https://cdn.jsdelivr.net/npm/marked/marked.min.js 7 | */ 8 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,(function(e){"use strict";function t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function n(t){e.defaults=t}e.defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};const s=/[&<>"']/,r=new RegExp(s.source,"g"),i=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,l=new RegExp(i.source,"g"),o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];function c(e,t){if(t){if(s.test(e))return e.replace(r,a)}else if(i.test(e))return e.replace(l,a);return e}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;const p=/(^|[^\[])\^/g;function u(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s="object"==typeof s&&"source"in s?s.source:s).replace(p,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}function g(e){try{e=encodeURI(e).replace(/%25/g,"%")}catch(e){return null}return e}const k={exec:()=>null};function f(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:d(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=d(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=d(t[0].replace(/^ *>[ \t]?/gm,""),"\n"),n=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let l="",o="",a=!1;for(;e;){let n=!1;if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;l=t[0],e=e.substring(l.length);let s=t[2].split("\n",1)[0].replace(/^\t+/,(e=>" ".repeat(3*e.length))),c=e.split("\n",1)[0],h=0;this.options.pedantic?(h=2,o=s.trimStart()):(h=t[2].search(/[^ ]/),h=h>4?1:h,o=s.slice(h),h+=t[1].length);let p=!1;if(!s&&/^ *$/.test(c)&&(l+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),r=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),i=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);for(;e;){const a=e.split("\n",1)[0];if(c=a,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),r.test(c))break;if(i.test(c))break;if(t.test(c))break;if(n.test(e))break;if(c.search(/[^ ]/)>=h||!c.trim())o+="\n"+c.slice(h);else{if(p)break;if(s.search(/[^ ]/)>=4)break;if(r.test(s))break;if(i.test(s))break;if(n.test(s))break;o+="\n"+c}p||c.trim()||(p=!0),l+=a+"\n",e=e.substring(a.length+1),s=c.slice(h)}}r.loose||(a?r.loose=!0:/\n *\n *$/.test(l)&&(a=!0));let u,g=null;this.options.gfm&&(g=/^\[[ xX]\] /.exec(o),g&&(u="[ ] "!==g[0],o=o.replace(/^\[[ xX]\] +/,""))),r.items.push({type:"list_item",raw:l,task:!!g,checked:u,loose:!1,text:o,tokens:[]}),r.raw+=l}r.items[r.items.length-1].raw=l.trimEnd(),r.items[r.items.length-1].text=o.trimEnd(),r.raw=r.raw.trimEnd();for(let e=0;e"space"===e.type)),n=t.length>0&&t.some((e=>/\n.*\n/.test(e.raw)));r.loose=n}if(r.loose)for(let e=0;e$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(t){if(!/[:|]/.test(t[2]))return;const e={type:"table",raw:t[0],header:f(t[1]).map((e=>({text:e,tokens:[]}))),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let t,n,s,r,i=e.align.length;for(t=0;t({text:e,tokens:[]})));for(i=e.header.length,n=0;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const t=d(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let s=0;s-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^$/.test(e)?n.slice(1):n.slice(1,-1)),x(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return x(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let r,i,l=n,o=0;const a="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+s[0].length-1);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=[...r].length,s[3]||s[4]){l+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);const t=[...e].slice(0,n+s.index+i+1).join("");if(Math.min(n,i)%2){const e=t.slice(1,-1);return{type:"em",raw:t,text:e,tokens:this.lexer.inlineTokens(e)}}const a=t.slice(2,-2);return{type:"strong",raw:t,text:a,tokens:this.lexer.inlineTokens(a)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=c(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=c(t[1]),n="mailto:"+e):(e=c(t[1]),n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=c(t[0]),n="mailto:"+e;else{let s;do{s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0]}while(s!==t[0]);e=c(t[0]),n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:c(t[0]),{type:"text",raw:t[0],text:e}}}}const m={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:k,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};m.def=u(m.def).replace("label",m._label).replace("title",m._title).getRegex(),m.bullet=/(?:[*+-]|\d{1,9}[.)])/,m.listItemStart=u(/^( *)(bull) */).replace("bull",m.bullet).getRegex(),m.list=u(m.list).replace(/bull/g,m.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+m.def.source+")").getRegex(),m._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",m._comment=/|$)/,m.html=u(m.html,"i").replace("comment",m._comment).replace("tag",m._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),m.lheading=u(m.lheading).replace(/bull/g,m.bullet).getRegex(),m.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.blockquote=u(m.blockquote).replace("paragraph",m.paragraph).getRegex(),m.normal={...m},m.gfm={...m.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},m.gfm.table=u(m.gfm.table).replace("hr",m.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.gfm.paragraph=u(m._paragraph).replace("hr",m.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",m.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",m._tag).getRegex(),m.pedantic={...m.normal,html:u("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",m._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:k,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(m.normal._paragraph).replace("hr",m.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",m.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const w={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:k,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:k,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`^|~"};w.punctuation=u(w.punctuation,"u").replace(/punctuation/g,w._punctuation).getRegex(),w.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,w.anyPunctuation=/\\[punct]/g,w._escapes=/\\([punct])/g,w._comment=u(m._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),w.emStrong.lDelim=u(w.emStrong.lDelim,"u").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimAst=u(w.emStrong.rDelimAst,"gu").replace(/punct/g,w._punctuation).getRegex(),w.emStrong.rDelimUnd=u(w.emStrong.rDelimUnd,"gu").replace(/punct/g,w._punctuation).getRegex(),w.anyPunctuation=u(w.anyPunctuation,"gu").replace(/punct/g,w._punctuation).getRegex(),w._escapes=u(w._escapes,"gu").replace(/punct/g,w._punctuation).getRegex(),w._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,w._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,w.autolink=u(w.autolink).replace("scheme",w._scheme).replace("email",w._email).getRegex(),w._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,w.tag=u(w.tag).replace("comment",w._comment).replace("attribute",w._attribute).getRegex(),w._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,w._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,w._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,w.link=u(w.link).replace("label",w._label).replace("href",w._href).replace("title",w._title).getRegex(),w.reflink=u(w.reflink).replace("label",w._label).replace("ref",m._label).getRegex(),w.nolink=u(w.nolink).replace("ref",m._label).getRegex(),w.reflinkSearch=u(w.reflinkSearch,"g").replace("reflink",w.reflink).replace("nolink",w.nolink).getRegex(),w.normal={...w},w.pedantic={...w.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",w._label).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",w._label).getRegex()},w.gfm={...w.normal,escape:u(w.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,s,r,i,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.anyPunctuation.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((e=>{s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class y{options;constructor(t){this.options=t||e.defaults}code(e,t,n){const s=(t||"").match(/^\S*/)?.[0];return e=e.replace(/\n$/,"")+"\n",s?'
'+(n?e:c(e,!0))+"
\n":"
"+(n?e:c(e,!0))+"
\n"}blockquote(e){return`
\n${e}
\n`}html(e,t){return e}heading(e,t,n){return`${e}\n`}hr(){return"
\n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"}listitem(e,t,n){return`
  • ${e}
  • \n`}checkbox(e){return"'}paragraph(e){return`

    ${e}

    \n`}table(e,t){return t&&(t=`${t}`),"\n\n"+e+"\n"+t+"
    \n"}tablerow(e){return`\n${e}\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`\n`}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return"
    "}del(e){return`${e}`}link(e,t,n){const s=g(e);if(null===s)return n;let r='",r}image(e,t,n){const s=g(e);if(null===s)return n;let r=`${n}"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")));continue}case"code":{const e=r;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case"table":{const e=r;let t="",s="";for(let t=0;t0&&"paragraph"===n.tokens[0].type?(n.tokens[0].text=e+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=e+" "+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:"text",text:e+" "}):o+=e+" "}o+=this.parse(n.tokens,i),l+=this.renderer.listitem(o,r,!!s)}n+=this.renderer.list(l,t,s);continue}case"html":{const e=r;n+=this.renderer.html(e.text,e.block);continue}case"paragraph":{const e=r;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case"text":{let i=r,l=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1{n=n.concat(this.walkTokens(e[s],t))})):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach((e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let s=e.renderer.apply(this,t);return!1===s&&(s=n.apply(this,t)),s}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)})),n.extensions=t),e.renderer){const t=this.defaults.renderer||new y(this.defaults);for(const n in e.renderer){const s=e.renderer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new b(this.defaults);for(const n in e.tokenizer){const s=e.tokenizer[n],r=n,i=t[r];t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new T;for(const n in e.hooks){const s=e.hooks[n],r=n,i=t[r];T.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(s.call(t,e)).then((e=>i.call(t,e)));const n=s.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,s=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(s.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(e){return this.defaults={...this.defaults,...e},this}#e(e,t){return(n,s)=>{const r={...s},i={...this.defaults,...r};!0===this.defaults.async&&!1===r.async&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=!0);const l=this.#t(!!i.silent,!!i.async);if(null==n)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof n)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then((t=>e(t,i))).then((e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then((()=>e)):e)).then((e=>t(e,i))).then((e=>i.hooks?i.hooks.postprocess(e):e)).catch(l);try{i.hooks&&(n=i.hooks.preprocess(n));const s=e(n,i);i.walkTokens&&this.walkTokens(s,i.walkTokens);let r=t(s,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return l(e)}}}#t(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="

    An error occurred:

    "+c(n.message+"",!0)+"
    ";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}}const S=new R;function A(e,t){return S.parse(e,t)}A.options=A.setOptions=function(e){return S.setOptions(e),A.defaults=S.defaults,n(A.defaults),A},A.getDefaults=t,A.defaults=e.defaults,A.use=function(...e){return S.use(...e),A.defaults=S.defaults,n(A.defaults),A},A.walkTokens=function(e,t){return S.walkTokens(e,t)},A.parseInline=S.parseInline,A.Parser=z,A.parser=z.parse,A.Renderer=y,A.TextRenderer=$,A.Lexer=_,A.lexer=_.lex,A.Tokenizer=b,A.Hooks=T,A.parse=A;const I=A.options,E=A.setOptions,Z=A.use,q=A.walkTokens,L=A.parseInline,D=A,P=z.parse,v=_.lex;e.Hooks=T,e.Lexer=_,e.Marked=R,e.Parser=z,e.Renderer=y,e.TextRenderer=$,e.Tokenizer=b,e.getDefaults=t,e.lexer=v,e.marked=A,e.options=I,e.parse=D,e.parseInline=L,e.parser=P,e.setOptions=E,e.use=Z,e.walkTokens=q})); --------------------------------------------------------------------------------